NoDamageInShop

版本 v1.0.0·更新於 2026-09-23

Grants godmode (no damage of any kind) only while in shop levels. Rebuilt from scratch against the current game version after the HappyCats and Snowlance versions of this mod both caused permanent god

模組介紹 作者原文

NoDamageInShop (eugenefitz)

Grants players godmode — no damage of any kind — while in shop levels only. Damage applies normally everywhere else.

Why this version exists

Two earlier mods with the same goal (HappyCats-NoDamageInShop, Snowlance-NoDamageInShop) both ended up granting godmode on every level, not just the shop:

  • HappyCats-NoDamageInShop patched PlayerHealth.HurtOther by name only. On the current game version that patch throws AmbiguousMatchException during startup and the mod's own damage guard (SemiFunc.RunIsShop() || RunManager.instance.levelIsShop) never reliably gates anything.
  • Snowlance-NoDamageInShop compared RunManager.instance.levelCurrent == RunManager.instance.levelShop. In the current game version, levelShop is a List (the game rotates between several shop scenes), not a single Level — so that comparison no longer means what it used to.

Both are examples of a mod silently breaking after a REPO update changed the underlying field/method it depended on.

How this mod works

  • Patches a single method: PlayerHealth.Hurt(int damage, bool savingGrace, int enemyIndex, bool hurtByHeal), the one place all player damage funnels through (player-vs-player damage and networked hits both route back into this same method for the local player).
  • The patch is registered against that method's exact parameter types, so it can't silently rebind to the wrong overload if the game ever adds one.
  • The shop check is SemiFunc.RunIsShop() — the same helper the game's own code uses internally for shop-only behavior (e.g. the shopkeeper's own damage rules), rather than a hand-rolled field comparison.
  • If the shop check itself throws (e.g. a future update changes it again), the patch fails open: damage is allowed through as normal instead of silently granting permanent godmode. This is the opposite of what broke the two earlier mods.

Notes

  • Client-side only. Every player who wants shop-immunity needs this installed on their own game.
  • No config options yet — it's unconditionally shop-only, no PvP/betrayal-mode exception.

安裝與使用 安裝:BepInEx 外掛

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

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

前置依賴

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

BepInEx-BepInExPack

檔案與校驗

檔案名稱
NoDamageInShop-1.0.0.zip
檔案大小
5.9 KiB
SHA-256
542c04643e1a2d8da9e5319dfaa0543853457688342b810c7fa3f5303e03e5ec
入庫時間
2026-10-07 12:08