public override void StartEncounter(Player player) { base.StartEncounter(player); foreach (EncounterAction action in player.GetCombatActions()) { actions.Add(new ActionButton(action.item.name, (Encounter encounter) => { CombatEncounter e = (CombatEncounter)encounter; GameEngine.game.WriteText(""); action.action(e, e.player, e.enemy); e.enemy.FightBack(e, e.player); WriteHealth(e); GameEngine.game.UpdatePlayerStats(); })); } }
public override void StartEncounter(Player player) { base.StartEncounter(player); foreach (EncounterAction action in player.GetCombatActions()) { actions.Add(new ActionButton(action.item.name, (Encounter encounter) => { CombatEncounter e = (CombatEncounter)encounter; GameEngine.game.WriteText(""); action.action(e, e.player, e.enemy); e.enemy.FightBack(e, e.player); WriteHealth(e); GameEngine.game.UpdatePlayerStats(); if (e.enemy.isDead) { e.player.inventory.AddRange(e.enemy.inventory); encounter.actions.Clear(); encounter.actions.Add(new ActionButton("Continue", (Encounter en) => { GameEngine.instance.DoNextEncounter(); })); encounter.RefreshActions(); } })); } }