public void FinishTurn() { turn = (turn + 1) % playerQuantity; if (OnTurnEnded != null) { OnTurnEnded.Invoke(); } }
protected override void Opponent_OnResponseGiven(object sender, PlayerResponseEventArgs e) { if (e.PlayerResponse == PlayerResponse.Missed) { OnTurnEnded?.Invoke(this, new EventArgs()); return; } }
private void EndTurn() { if (!_turnShouldEnd || _movementLock > 0) { return; } _turnShouldEnd = false; OnTurnEnded?.Invoke(); }
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(); } }
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(); }
/// <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(); }