死亡拦截

死亡拦截

DeathIntercept 是《Slay the Spire 2》的一个模组,它允许你在角色死亡时选择重试战斗或放弃。

游戏玩法

DeathIntercept / 死亡拦截


English

What is this?

DeathIntercept is a mod for Slay the Spire 2 that lets you choose whether to retry a combat or give up when your character dies. Instead of immediately ending your run and deleting the auto-save, the mod pauses the death flow and presents a dialog:

  • Retry (Enter) — Reload the combat directly from the pre-combat save. The fight restarts from round 1.
  • Give Up (Esc) — Proceed with the normal game over flow. Saves your score, badges, and run history.

How it works

  1. Intercepts CreatureCmd.Kill before the death music and game-over logic run.
  2. Preserves the run save by blocking SaveManager.DeleteCurrentRun.
  3. On retry, reloads the combat in-place using the same flow as the main menu "Continue" button — no main menu transition.

Installation

  1. Drop DeathIntercept.dll and DeathIntercept.json into Slay the Spire 2/mods/DeathIntercept/.
  2. Launch the game. The mod auto-activates.

Credits

The combat reload logic is adapted from STS2-QuickReload, specifically the QuickReloadRunner.RestartSinglePlayer() flow. Thank you for the reference implementation!


汉语

这是什么?

DeathIntercept 是《杀戮尖塔2》的一个 Mod,让你在角色阵亡时可以选择重打或放弃。不再直接结束对局并删除自动存档,而是暂停死亡流程,弹出对话框:

  • 重打(Enter)—— 从战斗前存档直接重载战斗,从第一回合重新开始。
  • 放弃(Esc)—— 走正常游戏结束流程,保存分数、徽章和对局历史。

原理

  1. 在战败 BGM 和游戏结束逻辑运行之前拦截 CreatureCmd.Kill
  2. 通过拦截 SaveManager.DeleteCurrentRun 保护战斗前存档不被删除。
  3. 选择重打时,复用主菜单「继续」按钮的流程原地重载战斗——无需返回主菜单,无需额外点击。

安装

  1. DeathIntercept.dllDeathIntercept.json 放入 Slay the Spire 2/mods/DeathIntercept/
  2. 启动游戏,Mod 自动激活。

鸣谢

战斗重载逻辑参考了 STS2-QuickReload,尤其是 QuickReloadRunner.RestartSinglePlayer() 的实现。感谢参考代码!


GitHub: Douvahkiin/StS2-DeathIntercept