public void Execute(Mobile mobile, Map map, Tile nonPlayerCharacterTile) { if (mobile.CanAttack(map, nonPlayerCharacterTile)) { map.GetPlayer().HitPoints -= 3; Status.WriteToStatusLine("Bob bores you to death... literally!"); return; } }
public void Execute(Mobile mobile, Map map, Tile nonPlayerCharacterTile) { if (mobile.CanAttack(map, nonPlayerCharacterTile)) { map.GetPlayer().HitPoints -= 3; Status.WriteToStatusLine("Bob bores you to death... literally!"); return; } }
public void Execute(Mobile mobile, Map map, Tile nonPlayerCharacterTile) { if (Program.RandomNumber(4) < 3) { //Move var direction = map.GetDirectionRandom(); if (direction != null) { map.MoveMobile(direction, nonPlayerCharacterTile); } } else { //Attack if (nonPlayerCharacterTile.Mobile.CanAttack(map, nonPlayerCharacterTile)) { map.GetPlayer().HitPoints -= 3; Status.WriteToStatusLine("The rat bites you!"); } } }
public void Execute(Mobile mobile, Map map, Tile nonPlayerCharacterTile) { if (Program.RandomNumber(4) < 3) { //Move var direction = map.GetDirectionRandom(); if (direction != null) { map.MoveMobile(direction, nonPlayerCharacterTile); } } else { //Attack if (nonPlayerCharacterTile.Mobile.CanAttack(map, nonPlayerCharacterTile)) { map.GetPlayer().HitPoints -= 3; Status.WriteToStatusLine("The rat bites you!"); } } }
static void Main(string[] args) { InitCommands(); Load(); game.Map = map; game.InitConsole(); while (!Quit && !game.PlayerIsDead) { game.WriteConsole(); if (game.PlayerCanAct()) { var nonTurnAction = HandleInput(); if (nonTurnAction) { continue; } map.GetPlayer().TimeBucket = 0; } game.PerformNonPlayerCharacterAction(); game.AdvanceTime(); } if (game.PlayerIsDead) { Status.WriteToStatusLine("You are Dead!!!!!!!!!!!"); } else { Status.WriteToStatusLine("Game over!"); } Console.ReadKey(true); }