public void AddItemToInventory() { if (_currentGameItem != null && _currentLocation.GameItems.Contains(_currentGameItem) && (_currentLocation.Id != 2 || _currentLocation.Id != 5)) { // // cast selected game item // GameItemQuantity selectedGameItem = _currentGameItem as GameItemQuantity; if (selectedGameItem.GameItem is Currency) { OnPlayerPickUp(selectedGameItem); _currentLocation.RemoveGameItemQuantityFromLocation(selectedGameItem); } else { if (selectedGameItem.GameItem.ItemID == 307) { } _currentLocation.RemoveGameItemQuantityFromLocation(selectedGameItem); _player.AddGameItemQuantityToInventory(selectedGameItem); OnPlayerPickUp(selectedGameItem); } } else if (_currentGameItem != null && CharacterInventory.Contains(_currentGameItem)) { GameItemQuantity selectedGameItem = _currentGameItem as GameItemQuantity; if (selectedGameItem.GameItem.ItemCost == 0) { _player.AddGameItemQuantityToInventory(selectedGameItem); CharacterInventory.Remove(selectedGameItem); } else if (_player.BootyValue >= selectedGameItem.GameItem.ItemCost) { int newBoooty = _player.BootyValue; _player.AddGameItemQuantityToInventory(selectedGameItem); _player.BootyValue = newBoooty - selectedGameItem.GameItem.ItemCost; CharacterInventory.Remove(selectedGameItem); } else { _currentLocation.Message = "Please comeback with proper funds"; } } }