public void CombatTestOne() { //Setup the aggressor and defender ICombatant supporting objects ICombatant aggressor = new Brawler(), defender = new Skeleton(); //Handle the combat. Take the defenders previous health and obtain the damage done from StaticGameActions.HandleCombat call int defenderPreviousHealth = defender.Health, damageDone = StaticGameActions.HandleCombat(aggressor, defender); //Test that the defenders health has been subtracted properly (TODO - Handle dead defenders and make sure this works if a defender is overkilled) Assert.AreEqual <int>((defenderPreviousHealth - damageDone), defender.Health); }
private void HandleFullDungeonDelve() { Dictionary <KeyValuePair <HeroDefensiveItemType, HeroDefensiveItemSlotType>, int> dictionaryTest = Armour.ArmourMappings; StaticGameActions.HandleCombat(new Brawler(), new Skeleton()); /* * A Turn * ----------------------- * * 1) Next room is revealed * 2) Monsters in the room are listed * 3) Each hero gets a chance to attack the monsters * - All heroes defeated = End of game * 4) Remaining monsters get to attack the heroes * 5) If no monsters remain treasures are revealed * 6) Treasures can be allocated to any hero * 7) Next room is revealed - If all rooms have been processed the dungeon is defeated and the player win * */ Console.WriteLine(); //Heroes enter each room in the dungeon gameDungeon.DungeonRooms.ForEach(room => { HandleRoomCombatPhase(room); //All monsters dead - Handle treasure HandleRoomCollectTreasurePhase(room); Console.WriteLine(); Console.WriteLine("Room Cleared!"); }); Console.WriteLine(); Console.WriteLine("Dungeon Cleared!"); }