Exemplo n.º 1
0
    public virtual bool CheckTarget(IObjectiveTarget gObj)
    {
        var objEnumerator = Objectives.GetEnumerator();

        while (objEnumerator.MoveNext())
        {
            objEnumerator.Current.CheckTarget(gObj);
        }

        return(IsChecked);
    }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
    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);
    }
Exemplo n.º 5
0
    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();
        }
    }
Exemplo n.º 6
0
    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);
    }
Exemplo n.º 7
0
    /// <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
    }
Exemplo n.º 8
0
    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);
    }
Exemplo n.º 9
0
 public bool CheckTarget(IObjectiveTarget gObj)
 {
     return(true);
 }