From 7ac2c1f2b7f9d296f430791211f4550f7f40188e Mon Sep 17 00:00:00 2001 From: Kalobi <46748261+Kalobi@users.noreply.github.com> Date: Sat, 7 Sep 2024 16:24:53 +0200 Subject: [PATCH] Add support for CH custom dash states to dashthru spikes --- Code/Entities/DashThroughSpikes.cs | 4 ++++ Code/Module/NerdHelperModule.cs | 7 +++++++ everest.yaml | 7 +++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Code/Entities/DashThroughSpikes.cs b/Code/Entities/DashThroughSpikes.cs index 5cec265..5acc18b 100644 --- a/Code/Entities/DashThroughSpikes.cs +++ b/Code/Entities/DashThroughSpikes.cs @@ -1,5 +1,6 @@ using System; using Celeste.Mod.Entities; +using Celeste.Mod.NerdHelper.Module; using Microsoft.Xna.Framework; using Monocle; @@ -21,6 +22,9 @@ private void OnPlayer(Player player) { if (((player.StateMachine.State == Player.StDash || player.DashAttacking && player.StateMachine.State != Player.StRedDash || player.StateMachine.State == Player.StDreamDash + || (NerdHelperModule.CommunalHelperInterop.GetDreamTunnelDashState != null + && player.StateMachine.State == NerdHelperModule.CommunalHelperInterop.GetDreamTunnelDashState()) + || (NerdHelperModule.CommunalHelperInterop.IsSeekerDashAttacking?.Invoke() ?? false) || player.StateMachine.State == Player.StRedDash && red) && (!zeroSpeedOnly || player.Speed.Equals(Vector2.Zero)) && CheckDir(player.DashDir)) diff --git a/Code/Module/NerdHelperModule.cs b/Code/Module/NerdHelperModule.cs index 4bd4b0b..313c122 100644 --- a/Code/Module/NerdHelperModule.cs +++ b/Code/Module/NerdHelperModule.cs @@ -12,6 +12,12 @@ public class NerdHelperModule : EverestModule { public override Type SettingsType => typeof(NerdHelperModuleSettings); public static NerdHelperModuleSettings Settings => (NerdHelperModuleSettings) Instance._Settings; + [ModImportName("CommunalHelper.DashStates")] + internal class CommunalHelperInterop { + public static Func GetDreamTunnelDashState; + public static Func IsSeekerDashAttacking; + } + public NerdHelperModule() { Instance = this; } @@ -23,6 +29,7 @@ public override void Load() { NodedFlingBird.Load(); typeof(NerdHelperInterop).ModInterop(); + typeof(CommunalHelperInterop).ModInterop(); } public override void Unload() { diff --git a/everest.yaml b/everest.yaml index 2972844..ba8880e 100644 --- a/everest.yaml +++ b/everest.yaml @@ -1,6 +1,9 @@ - Name: NerdHelper - Version: 1.6.1 + Version: 1.6.2 DLL: bin/NerdHelper.dll Dependencies: - Name: EverestCore - Version: 1.4896.0 \ No newline at end of file + Version: 1.4986.0 + OptionalDependencies: + - Name: CommunalHelper + Version: 1.20.6 \ No newline at end of file