예제 #1
0
 public void FinishTurn()
 {
     turn = (turn + 1) % playerQuantity;
     if (OnTurnEnded != null)
     {
         OnTurnEnded.Invoke();
     }
 }
예제 #2
0
        protected override void Opponent_OnResponseGiven(object sender, PlayerResponseEventArgs e)
        {
            if (e.PlayerResponse == PlayerResponse.Missed)
            {
                OnTurnEnded?.Invoke(this, new EventArgs());

                return;
            }
        }
예제 #3
0
    private void EndTurn()
    {
        if (!_turnShouldEnd || _movementLock > 0)
        {
            return;
        }

        _turnShouldEnd = false;

        OnTurnEnded?.Invoke();
    }
예제 #4
0
        protected override void Opponent_OnResponseGiven(object sender, PlayerResponseEventArgs e)
        {
            if (e.PlayerResponse == PlayerResponse.Missed)
            {
                OnTurnEnded?.Invoke(this, new EventArgs());

                return;
            }

            if (e.PlayerResponse == PlayerResponse.Sunk)
            {
                TakeRandomGuess();
            }
            else
            {
                TakeStrategicGuess();
            }
        }
예제 #5
0
        private void EndTurn()
        {
            UnityEngine.Debug.Log("End Turn");
            OnTurnEnded?.Invoke(m_allUnits[m_currentTurnIndex]);

            if (m_player.HP.Value <= 0)
            {
                UnityEngine.Debug.Log("Combat End: Player Died");
                EndCombat();
                return;
            }

            for (int i = 0; i < m_allEnemies.Count; i++)
            {
                if (m_allEnemies[i].HP.Value > 0)
                {
                    break;
                }

                if (i == m_allEnemies.Count - 1)
                {
                    UnityEngine.Debug.Log("Combat End: Player Win");
                    EndCombat();
                    return;
                }
            }

            m_currentTurnIndex++;

            if (m_currentTurnIndex >= m_allUnits.Count)
            {
                StartNewRound();
            }
            else
            {
                StartTurn();
            }
        }
 public void EndTurn()
 {
     OnTurnEnded?.Invoke(this, EventArgs.Empty);
     ProcessUnitStats();
     ProcessTurn();
 }
예제 #7
0
파일: Match.cs 프로젝트: garf0134/ticattack
 /// <summary>
 /// Ends the turn, notifies the listeners of the OnTurnEnded event
 /// and advances the turn index
 /// </summary>
 public void EndTurn()
 {
     OnTurnEnded?.Invoke(this, turn, turnOrder.ToArray());
     turn = (turn + 1) % turnOrder.Count;
 }
 public void EndTurn()
 {
     OnTurnEnded?.Invoke();
 }