Exemple #1
0
    public virtual float GetTargetScore(ITargettable other)
    {
        float dist = (other.GetPosition() - target.transform.position).magnitude;

        if (dist > 0)
        {
            return(((maxRange - dist) / maxRange) * GetFearInfluence(other));
        }
        else
        {
            return(GetFearInfluence(other));
        }
    }
Exemple #2
0
    private float GetFearInfluence(ITargettable other)
    {
        // Based upon the proximity of this target to things we fear, pick another target.
        // fear should be overridden by desperation?
        // how should this be represented?
        // 1f = no fear modifier.
        float fear = 1f - AnimalMap.animalMap.GetFearOfPosition(target.type, other.GetPosition());

        if (fear < GetDesperation())
        {
            return(1f);
        }
        else
        {
            return(fear);
        }
    }