File tree Expand file tree Collapse file tree 4 files changed +25
-8
lines changed
Expand file tree Collapse file tree 4 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ public class CommunalHelperSession : EverestModuleSession
2323 public double ExpiringDashRemainingTime { get ; set ; }
2424 public float ExpiringDashFlashThreshold { get ; set ; }
2525
26- // todo: this is ugly
2726 #region Player States
2827
2928 public bool CanDeployElytra { get ; set ; }
Original file line number Diff line number Diff line change 1- using Celeste . Mod . CommunalHelper . DashStates ;
1+ using Celeste . Mod . CommunalHelper . States ;
22using MonoMod . ModInterop ;
33
44namespace Celeste . Mod . CommunalHelper . Imports ;
@@ -9,17 +9,34 @@ public static void Initialize()
99 {
1010 typeof ( SaveLoadImports ) . ModInterop ( ) ;
1111
12- SaveLoadImports . RegisterStaticTypes ? . Invoke ( typeof ( DreamTunnelDash ) , [
13- "St.DreamTunnelDash" ,
14- "hasDreamTunnelDash" ,
12+ // state fields
13+ // todo: eventually migrate to using components on the player to store this data
14+ SaveLoadImports . RegisterStaticTypes ? . Invoke ( typeof ( DashStates . DreamTunnelDash ) , [
1515 "dreamTunnelDashCount" ,
16+ "canStartDreamTunnelDashAttack" ,
1617 "dreamTunnelDashAttacking" ,
1718 "dreamTunnelDashTimer" ,
1819 "nextDashFeather" ,
1920 "FeatherMode" ,
2021 "overrideDreamDashCheck" ,
2122 "DreamTrailColorIndex"
2223 ] ) ;
24+ SaveLoadImports . RegisterStaticTypes ? . Invoke ( typeof ( DashStates . SeekerDash ) , [
25+ "hasSeekerDash" ,
26+ "seekerDashAttacking" ,
27+ "seekerDashTimer" ,
28+ "seekerDashLaunched" ,
29+ "launchPossible"
30+ ] ) ;
31+ SaveLoadImports . RegisterStaticTypes ? . Invoke ( typeof ( Elytra ) , [
32+ "elytraToggle"
33+ ] ) ;
34+
35+ // state indices
36+ SaveLoadImports . RegisterStaticTypes ? . Invoke ( typeof ( St ) , [
37+ "DreamTunnelDash" ,
38+ "Elytra"
39+ ] ) ;
2340 }
2441
2542 [ ModImportName ( "SpeedrunTool.SaveLoad" ) ]
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ public struct ElytraConfiguration
5959 public static readonly ElytraConfiguration DefaultElytraConfiguration = new ( )
6060 {
6161 DisableReverseVerticalMomentum = false ,
62+ UpdateCooldownInEveryState = false
6263 } ;
6364
6465 /// <summary>
Original file line number Diff line number Diff line change @@ -60,14 +60,14 @@ internal static void Load()
6060 {
6161 Everest . Events . Player . OnSpawn += ResetCurrentOptions ;
6262 Everest . Events . Player . OnDie += ResetCurrentOptions ;
63- Everest . Events . Level . OnTransitionTo += OnTransitionTo ;
63+ Everest . Events . Level . OnLoadLevel += OnLoadLevel ;
6464 }
6565
6666 internal static void Unload ( )
6767 {
6868 Everest . Events . Player . OnSpawn -= ResetCurrentOptions ;
6969 Everest . Events . Player . OnDie -= ResetCurrentOptions ;
70- Everest . Events . Level . OnTransitionTo -= OnTransitionTo ;
70+ Everest . Events . Level . OnLoadLevel -= OnLoadLevel ;
7171 }
7272
7373 private static void ResetCurrentOptions ( Player player )
@@ -78,7 +78,7 @@ private static void ResetCurrentOptions(Player player)
7878 trigger . SaveCurrentOptions ( player , trigger . GetPerRoomOptions ( ) ) ;
7979 }
8080
81- private static void OnTransitionTo ( Level level , LevelData next , Vector2 direction )
81+ private static void OnLoadLevel ( Level level , Player . IntroTypes introType , bool isFromLoader )
8282 {
8383 Player player = level . Tracker . GetEntity < Player > ( ) ;
8484 if ( player is null )
You can’t perform that action at this time.
0 commit comments