private void CheckClueState(Constants.Clues foundClue, Constants.Clues stateClue, string stateName) { if (foundClue == stateClue && storyGraph.IsStateActive(stateName)) { storyGraph.CompleteState(stateName); } }
public override void OnItemFound(Constants.Clues clue) { base.OnItemFound(clue); if (clue == Constants.Clues.Knife && storyGraph.IsStateUnlocked("Find knife")) { storyGraph.CompleteState("Find knife"); } }
//! Gets the clue description for the requested clue. /*! * \param clue Requested clue. * \return Clue description */ public string GetClueDescription(Constants.Clues clue) { Debug.Log("GetClueDescription called for: " + clue.ToString()); if (!clueDescriptions.ContainsKey(clue)) { throw new Exception("No description found for clue: " + clue); } return(clueDescriptions[clue]); }
public virtual void OnItemFound(Constants.Clues item) //! Called after the player picks up a clue. /*! * \param item Constants.Clue type of clue picked up. */ { /* Called after the player picks up an item. */ Debug.Log("Clue Found " + item.ToString()); }
public override void OnItemFound(Constants.Clues type) { base.OnItemFound(type); CheckClueState(type, Constants.Clues.FreddysClothing, "Find Mercury's Clothing"); CheckClueState(type, Constants.Clues.Money, "Find $20 note"); CheckClueState(type, Constants.Clues.WantedPoster, "Find wanted poster"); CheckClueState(type, Constants.Clues.DumbledoresCookbook, "Find Dumbledore's Cookbook"); CheckClueState(type, Constants.Clues.Breadcrumbs, "Find breadcrumbs"); CheckClueState(type, Constants.Clues.Knife, "Find a bloody kitchen knife"); CheckClueState(type, Constants.Clues.MealOrders, "Find meal orders"); CheckClueState(type, Constants.Clues.DoctorsNote, "Find doctor's note"); CheckClueState(type, Constants.Clues.Pistol, "Find gun"); CheckClueState(type, Constants.Clues.Epipen, "Find epipen"); CheckClueState(type, Constants.Clues.BrokenTape, "Find a broken tape"); }
//! Retrieves item from javascript file for use as an Item object. /*! * \param itemType Item to get. * \return Item object. */ public static Item getItem(Constants.Clues itemType) { Debug.Log("Loading story graph from: " + itemJsonFile); JObject itemsJSON = JObject.Parse(File.ReadAllText(itemJsonFile)); JArray listItemJSON = (JArray)itemsJSON.GetValue("items"); foreach (var item in listItemJSON.Children <JObject>()) { string title = item.Value <string>("name"); string description = item.Value <string>("description"); if (title == itemType.ToString()) { return(new Item(title, description)); } } return(null); }
//! Gets clue description of a requested clue. /*! * \param clue Current clue being interacted with. * \return Clue description. */ public string GetClueDescription(Constants.Clues clue) { return(storyScript.GetStoryGraph().GetClueDescription(clue)); }