Exemple #1
0
        protected virtual BattleAction TakeAction()
        {
            IAction      action       = ThisEntity.ChooseAction();
            BattleAction battleAction = TakeAction(action);

            return(battleAction);
        }
Exemple #2
0
        protected virtual BattleAction TakeAction(IAction action)
        {
            BattleEntity battleTarget = currentScene.GetOpponent(this);
            Character    target       = battleTarget.ThisEntity;
            BattleAction battleAction = new BattleAction(this.ThisEntity, target, action);

            return(battleAction);
        }
Exemple #3
0
 public virtual void Update()
 {
     if (shouldAct)
     {
         BattleAction actionToAdd = TakeAction();
         currentScene.QueueAction(actionToAdd);
         shouldAct = false;
     }
 }
Exemple #4
0
        private void OnActionChosen(IAction actionChosen)
        {
            BattleEntity target;

            if (actionChosen is ISelfTargetAction)
            {
                target = this;
            }
            else
            {
                target = currentScene.GetOpponent(this);
            }
            BattleAction action = new BattleAction(this.ThisEntity, target.ThisEntity, actionChosen);

            currentScene.QueueAction(action);
            hasFinishedAction = true;
        }