Exemple #1
0
 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();
         }));
     }
 }
Exemple #2
0
 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();
             }
         }));
     }
 }