UKEnemyIdentifier

版本 v1.0.2·更新於 2025-03-03

A library used by CybergrindDeathcam for tracking which entity damaged the player

模組介紹 作者原文

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.

Please note that despite that mod supports (almost) every enemy currently present in the game it only applies to spawnable enemies, i.e. those enemies you can spawn in the Sandbox. Therefore, as an example Earthmover's brain projectiles damage won't register.

Currently, Big Johninator is also unsupported.

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)

It's worth noticing though that EnemyId.enemyType field is often unreliable when it comes to necessity of figuring out enemy type (for instance, Mysterious Druid Knight has a Drone enemy type). In order to serialize enemy type properly, use GetEnemyName() function.

EnemyIdentifierManager.Instance.OnPlayerHurt += hurtEvent =>

{

Debug.Log($"Player got hurt by {hurtEvent.EnemyId.GetEnemyName()}");

};

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

Full list of supported enemy types:

  • Filth
  • Stray
  • Schism
  • Soldier
  • Streetcleaner
  • Drone
  • Cerberus
  • Swordsmachine
  • Malicious Face
  • Hideous Mass
  • Mindflayer
  • Stalker
  • Sentry
  • Virtue
  • Sisyphean Insurrectionist
  • Ferryman
  • Gutterman
  • Guttertank
  • Mannequin
  • Minotaur
  • Gabriel (both types)
  • V2 (both types)
  • Minos Prime
  • Sisyphus Prime
  • Flesh Prison
  • Flesh Panopticon
  • Flesh Prison/Panopticon minions
  • Very Cancerous Rodent
  • Mysterious Druid Knight (& Owl)
  • Earthmover Defense System (rocket launcher, mortar & this tall thingy that shoots homing projectiles)
  • Puppet

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack

檔案與校驗

檔案名稱
UKEnemyIdentifier-1.0.2.zip
檔案大小
112.3 KiB