UKEnemyIdentifier
A library used by CybergrindDeathcam for tracking which entity damaged the player
Date uploaded | 3 months ago |
Version | 1.0.0 |
Download link | Flazhik-UKEnemyIdentifier-1.0.0.zip |
Downloads | 8762 |
Dependency string | Flazhik-UKEnemyIdentifier-1.0.0 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
UKEnemyIdentifier
!!! Disclaimer: this library does ABSOLUTELY NOTHING on its own. Because, you know... it's just a library.
Initially developed as a part of CybergrindDeathcam, this library allows to track which enemy has dealt the damage once the player is hurt.
Currently, only enemies present in Cybergrind mode are supported (soon to be updated).
Usage:
Simply subscribe to OnPlayerHurt
event of EnemyIdentifierManager
instance in order to receive an info regarding who hurt the player, how many damage it inflicted and whether it's killed the player or not.
Like this:
EnemyIdentifierManager.Instance.OnPlayerHurt += hurtEvent =>
{
if (hurtEvent.EnemyId != null)
Debug.Log($"Player got hurt by {hurtEvent.EnemyId.GetEnemyName()}");
Debug.Log($"Inflicted damage: {hurtEvent.Damage}");
if (hurtEvent.PlayerIsKilled)
Debug.Log("Player is killed");
};
Example output of a snippet above with player getting lynched by Stray, Swordsmachine and a Virtue
You can also retrieve all sorts of information regarding an enemy using EnemyId
field (vanilla EnemyIdentifier
type encapsulates lots of info, including enemy type, its GameObject
, health etc)
Important!
Notice how EnemyId
is a nullable value. When it's null, there are 3 possible options here:
- An enemy who inflicted the damage was dead by the moment event is fired (e.g. died before its projectile has reached the player)
- The damage was self-inflicted
- Enemy/damage type is currently unsupported by the library
CHANGELOG
- 1.0.0
- Initial release