/* * Special Descriptions to add to the richness of the narriative, and to give hints where appropriate: */ private string buildSpecialDescriptions(List <GameItem> roomItems) { string specialText = ""; switch (MisersHouseMain.playerLocation) { case 0: GameItem itemDoor = GameItem.FindItem("DOOR", roomItems); if (itemDoor != null && itemDoor.State.Equals(GameItem.ObjectState.VISIBLE)) //aka opened { specialText = "The door stands open, beckoning you!"; } break; case 1: GameItem itemDoorFoyer = GameItem.FindItem("DOOR", roomItems); if (itemDoorFoyer != null && itemDoorFoyer.State.Equals(GameItem.ObjectState.VISIBLE)) //aka opened { itemDoorFoyer.State = GameItem.ObjectState.LOCKED; } else if (itemDoorFoyer != null && itemDoorFoyer.State.Equals(GameItem.ObjectState.LOCKED)) //aka opened { specialText = itemDoorFoyer.StateDescription[GameItem.ObjectState.LOCKED]; } break; default: break; } return(specialText); }
public static GameItem GetInventoryItem(string item) { GameItem inventoryItem = null; if (Inventory.ContainsItem(item)) { inventoryItem = GameItem.FindItem(item, GameItem.gameItems); } return(inventoryItem); }