/// <summary> /// Drop an item from inventory /// </summary> /// <returns></returns> private bool DropItem() { //User selects which item to use int chosenIndex = PlayerChooseFromInventory(); //Player exited if (chosenIndex == -1) { return(false); } Dungeon dungeon = Game.Dungeon; Player player = dungeon.Player; Inventory playerInventory = player.Inventory; InventoryListing selectedGroup = playerInventory.InventoryListing[chosenIndex]; Item selectedItem = playerInventory.Items[selectedGroup.ItemIndex[0]]; //Check there is no item here already if (dungeon.ItemAtSpace(player.LocationLevel, player.LocationMap) != null) { Game.MessageQueue.AddMessage("Can't drop - already an item here!"); return(false); } //Remove from player inventory playerInventory.RemoveItem(selectedItem); //Drop the item here selectedItem.InInventory = false; selectedItem.LocationLevel = player.LocationLevel; selectedItem.LocationMap = player.LocationMap; Game.MessageQueue.AddMessage(selectedItem.SingleItemDescription + " dropped."); return(true); }