/// <summary> /// This method will be called everytime a move is made to keep track of where the character is and what enemy will spawn. /// </summary> /// <param name="location"></param> private void MoveChar(Location location) { if (character.HasGotKey(location) == false) { gameTextBox.Text += "You need the " + location.RequiredKey.Name + " to enter this room \n"; BottomMsg(); return; } character.CharLocation = location; locationLabel.Text = location.Name; descLabel.Text = location.LokationsDesc; if (location.RoomEnemy != null) { gameTextBox.Text += "Prepare for battle! You have a " + location.RoomEnemy.Name + " incoming! \n"; Enemy roomEnemy = WorldEvents.EnemyID(location.RoomEnemy.ID); enemy = new Enemy(roomEnemy.ID, roomEnemy.Name, roomEnemy.Damage, roomEnemy.GivenExp, roomEnemy.Health, roomEnemy.TotalHealth); foreach (Loot droppedLoot in roomEnemy.DropLoot) // Ooh, the enemy will drop loot. { enemy.DropLoot.Add(droppedLoot); } } CharacterUpdate(); GearUpdate(); Map(); BottomMsg(); }
/// <summary> /// Creating the character, adding what the character stats with and where the character is starting. /// </summary> public CharlesÄventyr() { InitializeComponent(); character = new Character(0, 10, 10); character.Bag.Add(new Inventory(WorldEvents.ItemID(WorldEvents.Weapon_ID_Iron_Sword), 1)); MoveChar(WorldEvents.LocationID(WorldEvents.Location_ID_Start)); CharacterUpdate(); exitCombat(); atkButton.Visible = false; }