public override bool CheckForSpecialAttacks() { if (Special) { if (DirectionalInput == Vector2.zero) { CSMachine.ChangeState(GetAttackState(EAttackType.NSpec)); } else if (DirectionalInput.y >= 0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.USpec)); } else if (DirectionalInput.y <= -0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.DSpec)); } else if (Mathf.Abs(DirectionalInput.x) > 0.5f) { Direction = DirectionalInput.x; CSMachine.ChangeState(GetAttackState(EAttackType.FSpec)); } return(true); } return(false); }
public override bool CheckForThrowAttacks() { if (StrongInputs.sqrMagnitude == 1f) { if (Mathf.Abs(StrongInputs.x) > 0.5f) { if (Mathf.Sign(StrongInputs.x) == Direction) { CSMachine.ChangeState(GetAttackState(EAttackType.FTilt)); } else { CSMachine.ChangeState(GetAttackState(EAttackType.Jab1)); } return(true); } else if (StrongInputs.y > 0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.UTilt)); return(true); } else if (StrongInputs.y < -0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.DTilt)); return(true); } } return(false); }
public override bool CheckForSoulAttacks() { Vector2 smash = InputManager.Smash; if (Attack && smash != Vector2.zero) { if (ThrowItem(smash)) { return(true); } if (Mathf.Abs(smash.x) > 0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.FSoul)); } else if (smash.y > 0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.USoul)); } else if (smash.y < -0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.DSoul)); } return(true); } else { return(false); } }
public bool ThrowItem(Vector2 throwVelocity) { if (holdItem != null) { Vector2 itemVelocity; if (throwVelocity == Vector2.zero) { itemVelocity = Vector2.zero; } else if (Mathf.Abs(throwVelocity.x) > Mathf.Abs(throwVelocity.y)) { itemVelocity = new Vector2(Mathf.Sign(throwVelocity.x), 0.25f); } else { itemVelocity = new Vector2(0, Mathf.Sign(throwVelocity.y)); } holdItem.Velocity = itemVelocity.normalized * 25f; ReleaseHoldItem(); InputManager.ClearBuffer(); CSMachine.ChangeState(advancedMovementStates.throwItem); return(true); } return(false); }
public override bool CheckForSpecialAttacks() { if (Special) { Direction = DirectionalInput.x; CSMachine.ChangeState(GetAttackState(EAttackType.NSpec)); return(true); } return(false); }
public override bool CheckForTiltAttacks() { if (Attack) { Direction = DirectionalInput.x; CSMachine.ChangeState(GetAttackState(EAttackType.Jab1)); return(true); } return(false); }
public override bool CheckForAerialAttacks() { if (Attack) { if (canChangeDirctionInAir) { Direction = DirectionalInput.x; } CSMachine.ChangeState(GetAttackState(EAttackType.NAir)); return(true); } return(false); }
public override bool CheckForAerialAttacks() { if (Attack) { if (CheckForItemPickUp()) { return(true); } if (ThrowItem(DirectionalInput)) { return(true); } if (DirectionalInput == Vector2.zero) { CSMachine.ChangeState(GetAttackState(EAttackType.NAir)); } else if (Mathf.Abs(DirectionalInput.x) > 0.5f && Mathf.Sign(DirectionalInput.x) == Direction) { CSMachine.ChangeState(GetAttackState(EAttackType.FAir)); } else if (Mathf.Abs(DirectionalInput.x) > 0.5f && Mathf.Sign(DirectionalInput.x) != Direction) { CSMachine.ChangeState(GetAttackState(EAttackType.BAir)); } else if (DirectionalInput.y > 0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.UAir)); } else if (DirectionalInput.y < -0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.DAir)); } return(true); } if (TiltInput != Vector2.zero) { if (CheckForItemPickUp()) { return(true); } if (ThrowItem(TiltInput)) { return(true); } if (Mathf.Abs(TiltInput.x) > 0.5f && Mathf.Sign(TiltInput.x) == Direction) { CSMachine.ChangeState(GetAttackState(EAttackType.FAir)); } else if (Mathf.Abs(TiltInput.x) > 0.5f && Mathf.Sign(TiltInput.x) != Direction) { CSMachine.ChangeState(GetAttackState(EAttackType.BAir)); } else if (TiltInput.y > 0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.UAir)); } else if (TiltInput.y < -0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.DAir)); } return(true); } if (CheckForSpecialAttacks()) { return(true); } return(false); }
public override bool CheckForTiltAttacks() { if (Attack) { if (ThrowItem(DirectionalInput)) { return(true); } else if (CheckForItemPickUp()) { return(true); } else { if (HoldShield) { CSMachine.ChangeState(GetAttackState(EAttackType.Grab)); } else if (DirectionalInput == Vector2.zero) { CSMachine.ChangeState(GetAttackState(EAttackType.Jab1)); } else if (Mathf.Abs(DirectionalInput.x) > 0.9f) { CSMachine.ChangeState(GetAttackState(EAttackType.DashAtk)); } else if (Mathf.Abs(DirectionalInput.x) > 0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.FTilt)); } else if (DirectionalInput.y > 0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.UTilt)); } else if (DirectionalInput.y < -0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.DTilt)); } } return(true); } if (TiltInput != Vector2.zero) { if (!ThrowItem(TiltInput)) { if (Mathf.Abs(TiltInput.x) > 0.5f) { Direction = TiltInput.x; CSMachine.ChangeState(GetAttackState(EAttackType.FTilt)); } else if (TiltInput.y > 0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.UTilt)); } else if (TiltInput.y < -0.5f) { CSMachine.ChangeState(GetAttackState(EAttackType.DTilt)); } } return(true); } if (Grab) { CSMachine.ChangeState(GetAttackState(EAttackType.Grab)); return(true); } return(false); }