public static void AirState(AbstractFighter actor) { StateTransitions.AirControl(actor); if (actor.KeyBuffered("Shield") && actor.GetIntVar(TussleConstants.FighterVariableNames.AIR_DODGES_REMAINING) >= 1) { //actor.doAction("AirDodge"); } if (actor.KeyBuffered("Attack")) { actor.doAirAttack(); } if (actor.KeyBuffered("Special")) { actor.doAirSpecial(); } if (actor.KeyBuffered("Jump") && actor.GetIntVar(TussleConstants.FighterVariableNames.JUMPS_REMAINING) > 0) { actor.doAction("AirJump"); } actor.SendMessage("CheckForGround"); if (actor.GetBoolVar(TussleConstants.FighterVariableNames.IS_GROUNDED) && actor.ground_elasticity == 0 && actor.GetIntVar("tech_window") == 0) { actor.BroadcastMessage("ChangeXPreferred", 0.0f, SendMessageOptions.RequireReceiver); actor.BroadcastMessage("ChangeYPreferred", actor.GetFloatVar(TussleConstants.FighterAttributes.MAX_FALL_SPEED)); actor.doAction("Land"); } //TODO fastfal }
public static void AirControl(AbstractFighter actor) { actor.BroadcastMessage("ChangeXPreferred", actor.GetAxis("Horizontal") * actor.GetFloatVar(TussleConstants.FighterAttributes.MAX_AIR_SPEED)); if (Mathf.Abs(actor.GetFloatVar(TussleConstants.MotionVariableNames.XSPEED)) > actor.GetFloatVar(TussleConstants.FighterAttributes.MAX_AIR_SPEED)) { actor.SendMessage("accel", actor.GetFloatVar(TussleConstants.FighterAttributes.AIR_CONTROL)); } if (Mathf.Abs(actor.GetFloatVar(TussleConstants.MotionVariableNames.YSPEED)) > Mathf.Abs(actor.GetFloatVar(TussleConstants.FighterAttributes.MAX_FALL_SPEED))) { actor.SetVar("landing_lag", actor.GetIntVar(TussleConstants.FighterAttributes.HEAVY_LANDING_LAG)); } }