Example #1
0
 public override void OnEnter()
 {
     Debug.Log("OnEnter FightAction");
     actor.TrySetAnimationState(ActionAnimationState.Guard);
     timeStarted = Time.time;
     phase       = CommandActionPhase.Charge;
 }
Example #2
0
        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);
        }
Example #3
0
 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);
 }
Example #4
0
 public void FinalizeAction()
 {
     phase = CommandActionPhase.FinalizeAction;
 }