/// <summary>
        /// Officially starts the BattleEntity's turn.
        /// </summary>
        public void StartTurn()
        {
            OnTurnStart();

            //Invoke the event
            TurnStartEvent?.Invoke();
        }
Example #2
0
        //Battle-turn related methods
        public void StartTurn()
        {
            //Default to one action. If a StatusEffect changes this, it'll happen in the TurnStartEvent
            NumActions = 1;

            TurnStartEvent?.Invoke();
            HandleTurnStart();

            /*NOTE: We check if NumActions is 0 here then end the turn if so. If NumActions is already 0, don't allow it
            *  to be set to any other value in ModifyNumActions().
            *  This fixes problems with Sleep, Fast, and other turn-modifying StatusEffects on an Entity at the same time*/
            if (NumActions == 0)
            {
                EndTurn();
            }
        }
    void Init()
    {
        _hasInit = true;

        if (eventDictionary == null)
        {
            eventDictionary = new Dictionary <string, UnityEvent>();
        }

        if (TurnStart == null)
        {
            turnStart = new TurnStartEvent();
        }

        if (unitDead == null)
        {
            unitDead = new UnitDeadEvent();
        }
    }
 public void EndTurn()
 {
     TurnEndEvent?.Invoke();
     TurnStartEvent?.Invoke();
 }
Example #5
0
 internal virtual void Visit(TurnStartEvent evt)
 {
     // nothing to do by default
 }
Example #6
0
 /// <summary>
 /// 回合开始
 /// </summary>
 public void TurnStart()
 {
     TurnStartEvent?.Invoke();
 }