public override ActionType OnUpdate() { switch (phase) { case CommandActionPhase.Charge: //if (Time.time - timeStarted > attackChargeTime) { actor.TrySetAnimationState(ActionAnimationState.MainAttack); phase = CommandActionPhase.ReadyToExecute; } break; case CommandActionPhase.ReadyToExecute: // waiting for BattleManager to give signal to go. break; case CommandActionPhase.Execute: if (actor.MoveToAttackPosition() && actor.IsAnimationComplete()) { actionContest.AttackAnimationComplete(); phase = CommandActionPhase.WaitForResult; } break; case CommandActionPhase.FinalizeAction: actor.TrySetAnimationState(ActionAnimationState.Neutral); actionContest = null; return(ActionType.Stand); } return(actionType); }
public ActionContest ExecuteAction(BattleActor target) { phase = CommandActionPhase.Execute; actor.OnBattleTimePause(BattleTimer.PauseRequestType.Unpause); target.OnBattleTimePause(BattleTimer.PauseRequestType.Unpause); actor.PreventPause(); target.PreventPause(); actionContest = new ActionContest(actor, target, this); return(actionContest); }