Exemple #1
0
        internal override void Visit(TurnEndEvent evt)
        {
            base.Visit(evt);

            _isSubstitutionDisabled = true; //this prevents answering requests/actions before the question was presented to user
            runPolicy();
            _isSubstitutionDisabled = false;
        }
        /// <summary>
        /// Officially ends the BattleEntity's turn.
        /// </summary>
        public void EndTurn()
        {
            if (this != BattleManager.Instance.EntityTurn)
            {
                Debug.LogError($"Attempting to end the turn of {Name} when it's not their turn!");
                return;
            }

            //End the action
            PreviousAction?.OnActionEnded();

            OnTurnEnd();

            //Invoke the event
            TurnEndEvent?.Invoke();

            //Increment the number of turns
            TurnsUsed++;
        }
Exemple #3
0
        /// <summary>
        /// 回合结束
        /// </summary>
        public void TurnEnd()
        {
            TurnEndEvent?.Invoke();

            List <string> temp = new List <string>();

            foreach (var item in Debuffs)
            {
                item.Value.BuffDecrease(1);
                if (item.Value.BuffLastTurn == 0)
                {
                    item.Value.BuffEnd(this);
                    temp.Add(item.Key);
                }
            }
            foreach (var item in temp)
            {
                Debuffs.Remove(item);
            }
        }
Exemple #4
0
        public void EndTurn(bool forced = false)
        {
            //StatusEffects can have this at 0 before it gets here
            if (NumActions > 0)
            {
                NumActions--;
            }

            //If the entity is out of actions for this turn, end the turn
            if (forced == true || NumActions == 0)
            {
                TurnEndEvent?.Invoke();
                HandleTurnEnd();

                NumActions = 0;

                BattleManager.Instance.TurnEnd();
            }
            //Otherwise restart the turn
            else
            {
                RestartTurn();
            }
        }
Exemple #5
0
 protected virtual void OnTurnEnd(NumberEventArgs args)
 {
     TurnEndEvent?.Invoke(this, args);
 }
 public void EndTurn()
 {
     TurnEndEvent?.Invoke();
     TurnStartEvent?.Invoke();
 }
Exemple #7
0
 internal virtual void Visit(TurnEndEvent evt)
 {
     // nothing to do by default
 }
Exemple #8
0
 public void OnTurnEnd()
 {
     TurnEndEvent?.Invoke();
 }