public static void PlayerOnPipeExit(Entity entity, MarioClearPipeInteraction interaction) { Player player = entity as Player; if (player != null && !player.Dead && interaction != null) { player.StateMachine.Locked = false; player.DummyGravity = true; player.DummyAutoAnimate = true; player.ForceCameraUpdate = false; if (player.StateMachine.State != Player.StRedDash) { player.StateMachine.State = Player.StNormal; playerDashCooldownTimerMethod.SetValue(player, 0f); } player.Speed = interaction.DirectionVector * interaction.CurrentClearPipe.TransportSpeed; if (Math.Abs(player.Speed.X) > 0.707) { bool inputTowardsPipe = (player.Speed.X < 0 && Input.MoveX > 0 || player.Speed.X > 0 && Input.MoveX < 0); bool notRedBooster = player.StateMachine.State != Player.StRedDash; bool wallClimbable = !ClimbBlocker.Check(player.Scene, player, player.Position + Vector2.UnitX * 3f * Math.Sign(Input.MoveX)); if (interaction.CurrentClearPipe.HasPipeSolids && inputTowardsPipe && notRedBooster && wallClimbable && Input.Grab.Check && notRedBooster) { player.Speed = Vector2.Zero; } } if (player.StateMachine.State == Player.StRedDash) { player.DashDir = player.Speed.SafeNormalize(); } } }
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; }