Skip to content

Commit

Permalink
Add support for CH custom dash states to dashthru spikes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalobi committed Sep 7, 2024
1 parent d27de43 commit 7ac2c1f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Code/Entities/DashThroughSpikes.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Celeste.Mod.Entities;
using Celeste.Mod.NerdHelper.Module;
using Microsoft.Xna.Framework;
using Monocle;

Expand All @@ -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))
Expand Down
7 changes: 7 additions & 0 deletions Code/Module/NerdHelperModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> GetDreamTunnelDashState;

Check warning on line 17 in Code/Module/NerdHelperModule.cs

View workflow job for this annotation

GitHub Actions / build

Field 'NerdHelperModule.CommunalHelperInterop.GetDreamTunnelDashState' is never assigned to, and will always have its default value null

Check warning on line 17 in Code/Module/NerdHelperModule.cs

View workflow job for this annotation

GitHub Actions / build

Field 'NerdHelperModule.CommunalHelperInterop.GetDreamTunnelDashState' is never assigned to, and will always have its default value null
public static Func<bool> IsSeekerDashAttacking;

Check warning on line 18 in Code/Module/NerdHelperModule.cs

View workflow job for this annotation

GitHub Actions / build

Field 'NerdHelperModule.CommunalHelperInterop.IsSeekerDashAttacking' is never assigned to, and will always have its default value null

Check warning on line 18 in Code/Module/NerdHelperModule.cs

View workflow job for this annotation

GitHub Actions / build

Field 'NerdHelperModule.CommunalHelperInterop.IsSeekerDashAttacking' is never assigned to, and will always have its default value null
}

public NerdHelperModule() {
Instance = this;
}
Expand All @@ -23,6 +29,7 @@ public override void Load() {
NodedFlingBird.Load();

typeof(NerdHelperInterop).ModInterop();
typeof(CommunalHelperInterop).ModInterop();
}

public override void Unload() {
Expand Down
7 changes: 5 additions & 2 deletions everest.yaml
Original file line number Diff line number Diff line change
@@ -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
Version: 1.4986.0
OptionalDependencies:
- Name: CommunalHelper
Version: 1.20.6

0 comments on commit 7ac2c1f

Please sign in to comment.