public virtual bool CheckTarget(IObjectiveTarget gObj) { var objEnumerator = Objectives.GetEnumerator(); while (objEnumerator.MoveNext()) { objEnumerator.Current.CheckTarget(gObj); } return(IsChecked); }
public override bool CheckTarget(IObjectiveTarget gObj) { if (base.CheckTarget(gObj)) { SuccessRating = 1 - (Mathf.Clamp(gObj.Health, 0, gObj.MaxHealth) / gObj.MaxHealth); return(true); } else { return(false); } }
public bool CheckTarget(IObjectiveTarget initTarget, IEnumerable <IObjectiveTarget> gObjs) { var innerObjIsChecked = base.CheckTarget(initTarget); if (IsChecked) { ForceCheck(gObjs); } // Consider the return logic. // Should maybe return whether the quest itself is checked. return(innerObjIsChecked); }
public virtual bool CheckTarget(IObjectiveTarget gObj) { // As long as this is accessed through ForceCheck(), neither of the below can be true. if (IsChecked) { return(true); } if (gObj.IsChecked) { return(false); } // Flags the target and the objective as checked. return(IsChecked = gObj.IsChecked = gObj.ID == targetID); }
internal void CheckObjectives(IObjectiveTarget IObj) { if (StaticData.currQuest == null) { Debug.LogWarning("No quest could be found"); return; } StaticData.currQuest.CheckTarget(IObj, OM.GetObjectives()); if (StaticData.currQuest.IsChecked) { Debug.LogWarning("Shits done!"); EndQuest(); } }
public override bool CheckTarget(IObjectiveTarget gObj) { var innerObjIsChecked = base.CheckTarget(gObj); if (innerObjIsChecked && IsChecked) { Debug.LogWarning("CheckTarget with only 1 object was called on MultiQuest object! All remaining objectives will be marked invalid."); // TODO: URGENT: Should be the actual in-game list of IObjectiveTargets. ForceCheck(new List <IObjectiveTarget>()); } // Consider the return logic. // Should maybe return whether the quest itself is checked. return(innerObjIsChecked); }
/// <summary> /// Spawn a single monster at a certain location /// </summary> public void SpawnMonsters(int ID, Vector3 pos, Transform target) { GameObject obj = GameObject.Instantiate(objectivePrefabs[ID]); obj.transform.position = pos; IObjectiveTarget objective = obj.GetComponent <IObjectiveTarget>(); MonsterAI monster = obj.GetComponent <MonsterAI>(); if (monster != null) { initMonster(monster, target); } obj.transform.SetParent(objectiveListObject); objectives.Add(objective); //Init monsters }
public override bool CheckTarget(IObjectiveTarget gObj) { if (IsChecked) { return(true); } if (gObj.IsChecked) { return(false); } IsChecked = gObj.IsChecked = gObj.ID == targetID && gObj.Health <= 0; if (IsChecked) { // Should a completed timer have SuccessRating 1 or 0?? SuccessRating = (Mathf.Clamp(gObj.Health, 0, gObj.MaxHealth) / gObj.MaxHealth); } return(IsChecked); }
public bool CheckTarget(IObjectiveTarget gObj) { return(true); }