public void MoveNorth() { if (HasLocationToNorth) { CurrentLocation = CurrentWorld.LocationAt(CurrentLocation.XCoordinate, CurrentLocation.YCoordinate + 1); } }
public void MoveWest() { if (HasLocationToWest) { CurrentLocation = CurrentWorld.LocationAt(CurrentLocation.XCoordinate - 1, CurrentLocation.YCoordinate); } }
public void MoveSouth() { if (HasLocationToSouth) { CurrentLocation = CurrentWorld.LocationAt(CurrentLocation.XCoordinate, CurrentLocation.YCoordinate - 1); } }
public GameSession() { CurrentPlayer = new Player("Chad", "Magic User?", 0, 20, 20, 10, 10, 101); if (!CurrentPlayer.Weapons.Any()) { CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(1001)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(1005)); } if (!CurrentPlayer.MagicList.Any()) { CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(7001)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(7002)); } CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(8001)); // Legendary Sword CurrentPlayer.LearnRecipe(RecipeFactory.RecipeByID(1)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(3000)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(3001)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(3002)); // Prison Key CurrentPlayer.LearnRecipe(RecipeFactory.RecipeByID(2)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(3003)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(3004)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(3005)); CurrentWorld = WorldFactory.CreateWorld(); CurrentLocation = CurrentWorld.LocationAt(-3, 1); }
private void OnCurrentPlayerKilled(object sender, System.EventArgs eventArgs) { RaiseMessage(""); RaiseMessage($"The {CurrentMonster.Name} killed you."); CurrentLocation = CurrentWorld.LocationAt(0, -1); CurrentPlayer.CompletelyHeal(); }
private void OnCurrentPlayerKilled(object sender, System.EventArgs eventArgs) { RaiseMessage(""); RaiseMessage($"You have been killed."); CurrentLocation = CurrentWorld.LocationAt(0, -1); CurrentPlayer.CompletelyHeal(); }
private void OnCurrentPlayerKilled(object sender, System.EventArgs eventArgs) { RaiseMessage(""); RaiseMessage($"Something has defeated you. You awaken back at home."); CurrentLocation = CurrentWorld.LocationAt(0, -1); CurrentPlayer.CompletelyHeal(); }
private void OnCurrentPlayerKilled(object sender, System.EventArgs eventArgs) { RaiseMessage(""); RaiseMessage($"You died. Idiot."); CurrentPlayer.CompletelyHeal(); CurrentLocation = CurrentWorld.LocationAt(0, -1);//Player's home }
private void OnCurrentPlayerKilled(object sender, System.EventArgs eventArgs) { RaiseMessage(""); RaiseMessage("You have been defeated."); //Idea: Create a variable for home location CurrentLocation = CurrentWorld.LocationAt(1, 2); CurrentPlayer.CompletelyHeal(); }
public void OnKilled_CurrentPlayer(object sender, System.EventArgs eventArgs) { RaiseMessage(""); RaiseMessage($"You have been killed"); // TODO: Add message to event based on what killed. CurrentLocation = CurrentWorld.LocationAt(0, -1); CurrentPlayer.CompletelyHeal(); }
private void OnCurrentPlayerKilled(object sender, System.EventArgs eventArgs) { _messageBroker.RaiseMessage(""); _messageBroker.RaiseMessage($"You have been slain"); CurrentLocation = CurrentWorld.LocationAt(0, 0); CurrentPlayer.CompletelyHeal(); }
public void MoveNorth() { // guard condition to prevent errors. Check this condition before setting CurrentLocation if (HasLocationToNorth) { CurrentLocation = CurrentWorld.LocationAt(CurrentLocation.XCoordinate, CurrentLocation.YCoordinate + 1); } }
private void MoveSafely(int deltaX, int deltaY) { Location nextLocation = CurrentWorld.LocationAt(CurrentLocation.XCoordinate + deltaX, CurrentLocation.YCoordinate + deltaY); if (nextLocation != null) { CurrentLocation = nextLocation; } }
public GameSession() { CurrentLocation = CurrentWorld.LocationAt(0, 0); CurrentPlayer = new Player("Test", "Fighter", 10, gold: 1000); CurrentPlayer.AddToInventory(ItemFactory.NewItem(1001)); CurrentPlayer.AddToInventory(ItemFactory.NewItem(2001)); CurrentPlayer.LearnRecipe(RecipeFactory.GetRecipe(1)); }
public void OnCurrentPlayerKilled(object sender, System.EventArgs eventArgs) { RaiseMessage($""); RaiseMessage($"{CurrentMonster.Name} te ubio."); RaiseMessage("Teleportiram te kuci"); CurrentLocation = CurrentWorld.LocationAt(0, -1); // Vracas se kuci CurrentPlayer.CompletylHeal(); }
private void OnCurrentPlayerKilled(object sender, System.EventArgs eventArgs) { RaiseMessage(""); RaiseMessage("Zabili tě."); CurrentLocation = CurrentWorld.LocationAt(0, -1); CurrentPlayer.CompletelyHeal(); CurrentPlayer.CompletelyRegainMana(); }
private void OnCurrentPlayerKilled(object sender, System.EventArgs eventArgs) { RaiseMessage(""); RaiseMessage("You have been descimated and can no longer go on."); CurrentLocation = CurrentWorld.LocationAt(-3, 1); CurrentPlayer.CompleteHeal(); CurrentPlayer.FullManaRestore(); }
public GameSession() { CurrentPlayer = new Player { Name = "Melvin", CharacterClass = "Knight", ExperiencePoints = 0, Gold = 0, HitPoints = 100, Level = 0 }; CurrentWorld = WorldFactory.CreateWorld(); CurrentLocation = CurrentWorld.LocationAt(0, 0); }
private void OnCurrentPlayerKilled(object sender, System.EventArgs e) { // If player dies, revive at home RaiseMessage(""); //RaiseMessage($"The {CurrentMonster.Name} killed you."); RaiseMessage($"You have been killed."); CurrentLocation = CurrentWorld.LocationAt(0, -1); // Player home CurrentPlayer.CompletelyHeal(); }
public Tuple <bool, bool, bool, bool> Exits() { // return a tuple expression which directions the player can travel from the current location return(Tuple.Create( CurrentWorld.LocationAt(CurrentLocation.X, CurrentLocation.Y + 1) != null, // north CurrentWorld.LocationAt(CurrentLocation.X, CurrentLocation.Y - 1) != null, // south CurrentWorld.LocationAt(CurrentLocation.X + 1, CurrentLocation.Y) != null, // east CurrentWorld.LocationAt(CurrentLocation.X - 1, CurrentLocation.Y) != null // west )); }
public void MoveWest() { if (CurrentWorld.LocationAt(CurrentLocation.XCoordinate - 1, CurrentLocation.YCoordinate) != null) { CurrentLocation = CurrentWorld.LocationAt(CurrentLocation.XCoordinate - 1, CurrentLocation.YCoordinate); if (CurrentLocation.IsCheckpoint) { Checkpoint = CurrentLocation; } } }
public GameSession() { //---Player Info--- CurrentPlayer = new Player { Name = "Patrick", CharacterClass = "Fighter", HitPoints = 10, Gold = 100, ExperiencePoints = 0, Level = 1 }; //---Location Info--- CurrentWorld = WorldFactory.CreateWorld(); CurrentLocation = CurrentWorld.LocationAt(0, 0); }
public void MoveNorth() { if (CurrentWorld.LocationAt(CurrentLocation.XCoordinate, CurrentLocation.YCoordinate + 1) != null) { CurrentLocation = CurrentWorld.LocationAt(CurrentLocation.XCoordinate, CurrentLocation.YCoordinate + 1); if (CurrentLocation.IsCheckpoint) { Checkpoint = CurrentLocation; } } }
public GameSession(string characterName) { CurrentPlayer = new Player(characterName, "Hardcoded", 0, 10, 10, 1000000); if (!CurrentPlayer.Weapons.Any()) { CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(1001)); } CurrentWorld = WorldFactory.CreateWorld(); // Stvori world CurrentLocation = CurrentWorld.LocationAt(0, 0); // Trenutna lokacija }
public GameSession() { CurrentPlayer = new Player("Vincent", "Azure Administrator", 0, 10, 10, 0, 0); if (!CurrentPlayer.Weapons.Any()) { CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(1001)); } CurrentWorld = WorldFactory.CreateWorld(); CurrentLocation = CurrentWorld.LocationAt(0, -1); }
public GameSession() { CurrentPlayer = new Player(name: "Tahj", characterClass: "Fighter", experiencePoints: 0, maximumHitPoints: 10, currentHitPoints: 10, strength: 10, dexterity: 10, armorClass: 10, strengthAbilityScore: 0, gold: 10); if (!CurrentPlayer.Weapons.Any()) { CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(1001)); } CurrentWorld = WorldFactory.CreateWorld(); CurrentLocation = CurrentWorld.LocationAt(0, 0); }
public GameSession() { CurrentPlayer = new Player("Auston", "Fighter", 0, 10, 10, 1000000); if (!CurrentPlayer.Weapons.Any()) { CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(1001)); } CurrentWorld = WorldFactory.CreateWorld(); CurrentLocation = CurrentWorld.LocationAt(0, 0); }
public GameSession() { CurrentPlayer = new Player("Chuyue", "Fighter", 0, 10, 10, 1000000); //Player should always have something to fight with if (!CurrentPlayer.Weapons.Any()) { CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(1001)); } CurrentWorld = WorldFactory.CreateWorld(); CurrentLocation = CurrentWorld.LocationAt(0, 0); }
public void StartTheGame() { CurrentPlayer = new Player("John Doe", "Scientist", 0, 10, 10, 10, 100); if (CurrentPlayer.Inventory.Weapons.Count == 0) { CurrentPlayer.AddItemToInventory(ItemFactory.CreateItem(1)); } CurrentPlayer.AddItemToInventory(ItemFactory.CreateItem(6)); CurrentPlayer.LearnScheme(SchemeFactory.GetSchemeById(1)); CurrentWorld = WorldFactory.CreateWorld(); CurrentLocation = CurrentWorld.LocationAt(0, 0); }
public GameSession() { CurrentPlayer = new Player // object literal - improves readability { Name = "Eli", CharacterClass = "Monk", HitPoints = 10, Gold = 1000000, ExperiencePoints = 0, Level = 1, }; CurrentWorld = WorldFactory.CreateWorld(); // we only use this once - so we make this static CurrentLocation = CurrentWorld.LocationAt(0, -1); }