From feef6e164a2f23e668bed11ff10a17954d0b49b3 Mon Sep 17 00:00:00 2001 From: Frank Yang Date: Sat, 30 Apr 2022 23:02:35 +0800 Subject: [PATCH] feat: transition death --- GodSeekerPlus/GodSeekerPlus.csproj | 2 +- .../Modules/Bugfix/TransitionDeath.cs | 36 +++++++++++++++++++ GodSeekerPlus/Resources/Lang/en.json | 1 + GodSeekerPlus/Resources/Lang/zh.json | 1 + README.md | 1 + README.zh.md | 1 + 6 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 GodSeekerPlus/Modules/Bugfix/TransitionDeath.cs diff --git a/GodSeekerPlus/GodSeekerPlus.csproj b/GodSeekerPlus/GodSeekerPlus.csproj index f35c1e8..c190585 100644 --- a/GodSeekerPlus/GodSeekerPlus.csproj +++ b/GodSeekerPlus/GodSeekerPlus.csproj @@ -1,7 +1,7 @@ GodSeekerPlus - 0.19.6 + 0.19.7 A Hollow Knight mod to enhance your Godhome experience Clazex diff --git a/GodSeekerPlus/Modules/Bugfix/TransitionDeath.cs b/GodSeekerPlus/Modules/Bugfix/TransitionDeath.cs new file mode 100644 index 0000000..9f8f88b --- /dev/null +++ b/GodSeekerPlus/Modules/Bugfix/TransitionDeath.cs @@ -0,0 +1,36 @@ +namespace GodSeekerPlus.Modules.Bugfix; + +[DefaultEnabled] +internal sealed class TransitionDeath : Module { + private bool deadInSequence = false; + + private protected override void Load() { + On.HeroController.Die += RecordDeath; + On.GameManager.EnterHero += CheckDeath; + } + + private protected override void Unload() { + deadInSequence = false; + On.HeroController.Die -= RecordDeath; + On.GameManager.EnterHero -= CheckDeath; + } + + private IEnumerator RecordDeath(On.HeroController.orig_Die orig, HeroController self) { + if (BossSequenceController.IsInSequence) { + deadInSequence = true; + } + + yield return orig(self); + } + + private void CheckDeath(On.GameManager.orig_EnterHero orig, GameManager self, bool additiveGateSearch) { + orig(self, additiveGateSearch); + + if (deadInSequence && BossSequenceController.IsInSequence) { + Logger.LogWarn("Dead in sequence while not finishing it, trying again"); + Ref.HC.StartCoroutine("Die"); + } else { + deadInSequence = false; + } + } +} diff --git a/GodSeekerPlus/Resources/Lang/en.json b/GodSeekerPlus/Resources/Lang/en.json index fd77dda..0ba745c 100644 --- a/GodSeekerPlus/Resources/Lang/en.json +++ b/GodSeekerPlus/Resources/Lang/en.json @@ -44,6 +44,7 @@ "Modules/NoSpellDamage": "No Spell Damage", "Modules/P5Health": "P5 Health", "Modules/P5Teleport": "P5 Teleport", + "Modules/TransitionDeath": "Transition Death", "Modules/SegmentedP5": "Segmented P5", "Modules/ShortDeathAnimation": "Short Death Animation", "Modules/UnlockAllModes": "Unlock All Modes", diff --git a/GodSeekerPlus/Resources/Lang/zh.json b/GodSeekerPlus/Resources/Lang/zh.json index 51c1301..8243e70 100644 --- a/GodSeekerPlus/Resources/Lang/zh.json +++ b/GodSeekerPlus/Resources/Lang/zh.json @@ -44,6 +44,7 @@ "Modules/NoSpellDamage": "取消法术伤害", "Modules/P5Health": "五门血量", "Modules/P5Teleport": "五门传送", + "Modules/TransitionDeath": "场景转换死亡", "Modules/SegmentedP5": "分段五门", "Modules/ShortDeathAnimation": "短死亡动画", "Modules/UnlockAllModes": "解锁所有模式", diff --git a/README.md b/README.md index 8200903..dd7a05c 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Compatible with `Hollow Knight` 1.5. - **Bugfix**: + **Camera Keep Rumbling**: Prevent camera from keeping rumbling after scene transitions in Godhome. + **Crossing Ooma**: Prevent Ooma from spawning explosive jellies across scenes. + + **Transition Death**: Prevent from continuing pantheon challenges after death upon scene transitions. - **Cosmetic**: + **More Pantheon Caps**: Enable the unused no hit cap for Pantheons 1 to 4, and add a new special effect for all pantheons indicating completed once no hit with all bindings. diff --git a/README.zh.md b/README.zh.md index be5b8fe..3db8b18 100644 --- a/README.zh.md +++ b/README.zh.md @@ -25,6 +25,7 @@ - **Bug 修复**: + **屏幕保持震动**:阻止屏幕在进行神居中的场景转换后保持震动。 + **穿越欧玛**: 阻止欧玛跨场景生成爆炸水母。 + + **场景转换死亡**:阻止在场景转换时死亡后继续万神殿挑战。 - **装饰性**: + **更多万神殿灯**:为第一到四万神殿启用未使用的无伤灯,并为所有万神殿添加一个新的代表曾完成过无伤四锁的效果。