/// <summary> /// Give each defender in a space with a tankard at the end of the Defenders Move phase inspiration. /// </summary> /// <param name="e">An EndPhaseEvent.</param> private void GiveInspiration(Event e) { Debug.Assert(e.GetType() == typeof(EndPhaseEvent), "Non-EndPhaseEvent in GiveInspiration"); EndPhaseEvent endEvent = e as EndPhaseEvent; if (endEvent.Phase.GetType() == typeof(TurnManager.PlayerMove)) { foreach (DefenderSandbox defender in Services.Defenders.GetAllDefenders()) { if (defender != this) { TwoDLoc loc = defender.ReportGridLoc(); if (Services.Board.CheckIfTankard(loc.x, loc.z)) { for (int i = 0; i < BETTER_DRINK_INSP; i++) { defender.DefeatAttacker(); } } } } } }
public virtual void ResetMomentum(Event e) { Debug.Assert(e.GetType() == typeof(EndPhaseEvent), "Non-EndPhaseEvent in ResetMomentum"); EndPhaseEvent endEvent = e as EndPhaseEvent; if (endEvent.Phase.GetType() == typeof(TurnManager.AttackersAdvance)) { Momentum = START_MOMENTUM; GameObject[] momentumMarkers = GameObject.FindGameObjectsWithTag(MARKER_OBJ); foreach (GameObject marker in momentumMarkers) { RemoveMarker(marker); } } }
/// <summary> /// Handle blocking and unblocking all columns when the Guardian has reached The Last Bastion on the Hold the Line track. /// </summary> private void AlternateBlockingColumns(Event e) { Debug.Assert(e.GetType() == typeof(EndPhaseEvent), "Non-NewTurnEvent in AlternateBlockingColumns"); EndPhaseEvent endEvent = e as EndPhaseEvent; if (endEvent.Phase.GetType() != typeof(TurnManager.AttackersAdvance)) { return; } alternateTurn++; if (alternateTurn % 2 == 0) { BlockAllColumns(); Services.UI.PlayerPhaseStatement(ALL_BLOCKED); } else { UnblockAllColumns(); Services.UI.PlayerPhaseStatement(NONE_BLOCKED); } }