public void CombatHandler_PlayerFightNpc_PlayerDies() { var player = new Player(new Position(), new Stats(10, 10, 1), "player", 0); var npc = new HostileNPC(new Position(), new Stats(100, 10, 1), new StandStillMovementStrategy(), "enemy", 0); _combatHandler.Fight(player, npc, layer); Assert.IsFalse(npc.Alive); }
public void TestDropExperienceToCharacter(int xp1, int xp2) { Player player = Substitute.For <Player>(position, stats, "SomePLayer", 100); IStats npcStats = Substitute.For <IStats>(); npcStats.MaxHealth.Returns(xp1); npcStats.Damage.Returns(xp2); uut = new HostileNPC(position, npcStats, movementStrategy, "HostileName"); Assert.AreEqual(xp1 * xp2, player.Experience); }
public void CombatHandler_PlayerFightNpc_SlowPlayerDies() { // Both can kill each other, First strike wins var player = new Player(new Position(), new Stats(10, 10, 1), "player", 0); var npc = new HostileNPC(new Position(), new Stats(10, 10, 2), new StandStillMovementStrategy(), "enemy", 0); _combatHandler.Fight(player, npc, layer); Assert.IsTrue(npc.Alive); Assert.IsFalse(player.Alive); }
public void setup() { uut = new HostileNPC(position, stats, movementStrategy, "HostileName"); }