public static int BoostUpdate() { Player player = FrostModule.StateGetPlayer(); Vector2 boostTarget = (Vector2)FrostModule.player_boostTarget.GetValue(player); Vector2 value = Input.Aim.Value * 3f; Vector2 vector = Calc.Approach(player.ExactPosition, boostTarget - player.Collider.Center + value, 80f * Engine.DeltaTime); player.MoveToX(vector.X, null); player.MoveToY(vector.Y, null); bool pressed = (Input.Dash.Pressed || Input.CrouchDashPressed) && GetBoosterThatIsBoostingPlayer(player).CanFastbubble(); // the state we should be in afterwards int result; if (pressed) { Input.Dash.ConsumePress(); Input.CrouchDash.ConsumePress(); result = RedDash ? CustomRedBoostState : Player.StDash; } else { result = CustomBoostState; } return(result); }
public static void BoostEnd() { Player player = FrostModule.StateGetPlayer(); Vector2 boostTarget = (Vector2)FrostModule.player_boostTarget.GetValue(player); Vector2 vector = (boostTarget - player.Collider.Center).Floor(); player.MoveToX(vector.X, null); player.MoveToY(vector.Y, null); new DynData <Player>(player).Set <GenericCustomBooster>("fh.customBooster", null); }
public static IEnumerator RedDashCoroutine() { Player player = FrostModule.StateGetPlayer(); DynData <Player> data = new DynData <Player>(player); yield return(null); player.Speed = (Vector2)Player_CorrectDashPrecision.Invoke(player, new object[] { data.Get <Vector2>("lastAim") }) * 240f; data["gliderBoostDir"] = player.DashDir = data.Get <Vector2>("lastAim"); player.SceneAs <Level>().DirectionalShake(player.DashDir, 0.2f); if (player.DashDir.X != 0f) { player.Facing = (Facings)Math.Sign(player.DashDir.X); } Player_CallDashEvents.Invoke(player, null); yield break; }
public static IEnumerator BoostCoroutine() { Player player = FrostModule.StateGetPlayer(); GenericCustomBooster booster = GetBoosterThatIsBoostingPlayer(player); if (booster.BoostTime > 0.25f) { yield return(booster.BoostTime - 0.25f); Audio.Play(booster.boostSfx, booster.Position); booster.Flash(); yield return(0.25f); } else { yield return(booster.BoostTime); } player.StateMachine.State = RedDash ? CustomRedBoostState : Player.StDash; yield break; }
public static void RedDashBegin() { Player player = FrostModule.StateGetPlayer(); DynData <Player> data = new DynData <Player>(player); data["calledDashEvents"] = false; data["dashStartedOnGround"] = false; Celeste.Celeste.Freeze(0.05f); Dust.Burst(player.Position, (-player.DashDir).Angle(), 8, null); data["dashCooldownTimer"] = 0.2f; data["dashRefillCooldownTimer"] = 0.1f; data["StartedDashing"] = true; (player.Scene as Level).Displacement.AddBurst(player.Center, 0.5f, 0f, 80f, 0.666f, Ease.QuadOut, Ease.QuadOut); Input.Rumble(RumbleStrength.Strong, RumbleLength.Medium); data["dashAttackTimer"] = 0.3f; data["gliderBoostTimer"] = 0.55f; player.DashDir = player.Speed = Vector2.Zero; if (!data.Get <bool>("onGround") && player.Ducking && player.CanUnDuck) { player.Ducking = false; } Player_DashAssistInit.Invoke(player, new object[] { }); }
public static void BoostBegin() { Player player = FrostModule.StateGetPlayer(); GetBoosterThatIsBoostingPlayer(player).HandleBoostBegin(player); }
public static int RedDashUpdate() { Player player = FrostModule.StateGetPlayer(); DynData <Player> data = new DynData <Player>(player); data["StartedDashing"] = false; bool ch9hub = false;//this.LastBooster != null && this.LastBooster.Ch9HubTransition; data["gliderBoostTimer"] = 0.05f; if (player.CanDash) { GenericCustomBooster booster = null; foreach (GenericCustomBooster b in player.Scene.Tracker.GetEntities <GenericCustomBooster>()) { if (b.BoostingPlayer) { booster = b; break; } } booster.BoostingPlayer = false; return(player.StartDash()); } if (player.DashDir.Y == 0f) { foreach (Entity entity in player.Scene.Tracker.GetEntities <JumpThru>()) { JumpThru jumpThru = (JumpThru)entity; if (player.CollideCheck(jumpThru) && player.Bottom - jumpThru.Top <= 6f) { player.MoveVExact((int)(jumpThru.Top - player.Bottom), null, null); } } if (player.CanUnDuck && Input.Jump.Pressed && data.Get <float>("jumpGraceTimer") > 0f && !ch9hub) { //player.SuperJump(); Player_SuperJump.Invoke(player, null); return(0); } } if (!ch9hub) { if (data.Get <bool>("SuperWallJumpAngleCheck")) { if (Input.Jump.Pressed && player.CanUnDuck) { if ((bool)player_WallJumpCheck.Invoke(player, new object[] { 1 })) { Player_SuperWallJump.Invoke(player, new object[] { -1 }); return(0); } if ((bool)player_WallJumpCheck.Invoke(player, new object[] { -1 })) { Player_SuperWallJump.Invoke(player, new object[] { 1 }); return(0); } } } else if (Input.Jump.Pressed && player.CanUnDuck) { if ((bool)player_WallJumpCheck.Invoke(player, new object[] { 1 })) { if (player.Facing == Facings.Right && Input.Grab.Check && player.Stamina > 0f && player.Holding == null && !ClimbBlocker.Check(player.Scene, player, player.Position + Vector2.UnitX * 3f)) { Player_ClimbJump.Invoke(player, null); } else { player_WallJump.Invoke(player, new object[] { -1 }); } return(0); } if ((bool)player_WallJumpCheck.Invoke(player, new object[] { -1 })) { if (player.Facing == Facings.Left && Input.Grab.Check && player.Stamina > 0f && player.Holding == null && !ClimbBlocker.Check(player.Scene, player, player.Position + Vector2.UnitX * -3f)) { Player_ClimbJump.Invoke(player, null); } else { player_WallJump.Invoke(player, new object[] { 1 }); } return(0); } } } return(CustomRedBoostState);//5; }
public static void RedDashEnd() { Player player = FrostModule.StateGetPlayer(); //Player_CallDashEvents.Invoke(player, new object[] { }); }