void new_phase_started(LOTRGame.GAMEPHASE new_phase) { Debug.Log("new phase started"); cur_phase = new_phase; foreach (LOTRPlayer player in players) { ///player.clear_abilities_on_phase_change(cur_phase); player.new_phase_started(); } }
public void clear_abilities_on_phase_change(LOTRGame.GAMEPHASE new_phase) { List <int> indicies_to_remove = new List <int>(); for (var i = 0; i < abilities.Count; i++) { var ability = abilities[i]; if (ability.expires_on_phase_change() && !ability.active_on_phase(new_phase)) { indicies_to_remove.Add(i); } } foreach (var index in indicies_to_remove) { abilities.RemoveAt(index); } }
public int get_willpower_committed(LOTRGame.GAMEPHASE cur_phase) { var result = 0; foreach (var h in heroes) { if (h.is_committed()) { result += h.get_willpower(); } } foreach (var h in ally_cards) { if (h.is_committed()) { result += h.get_willpower(); } } return(result); }
public bool active_on_phase(LOTRGame.GAMEPHASE phase) { return(relevant_phase == phase); }