/// <summary> /// Continuously checks where player is and sets target true/false based on site properties. /// </summary> public override void Update(Task caller) { bool result = false; // Get place resource Place place = ParentQuest.GetPlace(placeSymbol); if (place == null) { return; } // Check if player at this place result = place.IsPlayerHere(); // Handle positive check if (result) { // "saying" popup // TODO: Should this run every time or only once? if (textId != 0) { ParentQuest.ShowMessagePopup(textId); } // Start target task ParentQuest.StartTask(taskSymbol); } else { // Clear target task ParentQuest.ClearTask(taskSymbol); } }
/// <summary> /// Continuously checks where player is and sets target true/false based on site properties. /// </summary> public override void Update(Task caller) { bool result = false; // Get place resource Place place = ParentQuest.GetPlace(placeSymbol); if (place == null) { return; } // Check if player at this place result = place.IsPlayerHere(); // Handle positive check if (result) { // "saying" popup // Only display this once or player can get a popup loop if (textId != 0 && !textShown) { ParentQuest.ShowMessagePopup(textId); textShown = true; } // Start target task ParentQuest.StartTask(taskSymbol); } else { // Clear target task ParentQuest.ClearTask(taskSymbol); } }
public override void Update(Task caller) { // Attempt to get Item resource Item item = ParentQuest.GetItem(targetItem); if (item == null) { throw new Exception(string.Format("Could not find Item resource symbol {0}", targetItem)); } // Start/Clear target task based on player carrying item if (GameManager.Instance.PlayerEntity.Items.Contains(item.DaggerfallUnityItem)) { ParentQuest.StartTask(targetTask); } else { ParentQuest.ClearTask(targetTask); } }