public string UseItem(Item itemName) { if (Unlockable.Contains(itemName)) { if (itemName.Name.ToString().ToLower() == "sword") { Items.Add(new Item("Chainmail", "This would provide some good protection.")); Locked = false; return("You manage to slice the guards down with little effort."); } else if (itemName.Name.ToString().ToLower() == "torch") { Locked = false; return("You wield the torch. Hopefully it doesn't go out."); } else if (itemName.Name.ToString().ToLower() == "ale") { Locked = false; count++; if (count > 8) { return("You drink until you can't see straight"); } return("You drink the ale. Another drink might not be so bad."); } Locked = false; return("Unlocked door"); } else { return("Item has no use here"); } }
public string UseItem(Item itemName) { if (Unlockable.Contains(itemName)) { Locked = false; return("You place the cold gold crown upon your head"); } else { return("Item has no use here"); } }
public string UseItem(Item itemName) { if (Unlockable.Contains(itemName)) { if (itemName.Name.ToString().ToLower() == "key") { Unlock(); Exits["west"].Unlock(); return("Unlocked door"); } } else { return("You wave your" + itemName.ToString() + " around but it has no use here"); } return(""); }