protected override void Activate(Brain brain)
 {
     SetStatus(STATUS.ACTIVE);
     RemoveAllSubGoals(brain);
     if (!brain.targetCtrl.CanReviveOfTargetAlly())
     {
         SetStatus(STATUS.COMPLETED);
     }
     else
     {
         float num = 2f;
         if (brain.owner is Player)
         {
             num = (brain.owner as Player).playerParameter.revivalRange;
         }
         num *= 0.7f;
         brain.moveCtrl.ChangeStopRange(num);
         Character target = brain.targetCtrl.GetAllyTarget() as Character;
         float     lengthWithBetweenObject = AIUtility.GetLengthWithBetweenObject(brain.owner, target);
         if (lengthWithBetweenObject < num)
         {
             AddSubGoal <Goal_Prayer>().SetPrayer(target, num);
         }
         else
         {
             AddSubGoal <Goal_GoToAlly>();
         }
     }
 }
Beispiel #2
0
    protected override STATUS Process(Brain brain)
    {
        if (target == null)
        {
            SetStatus(STATUS.COMPLETED);
            return(status);
        }
        double num = (double)AIUtility.GetLengthWithBetweenObject(brain.owner, target);

        if (num > (double)revival_range)
        {
            SetStatus(STATUS.COMPLETED);
        }
        if (!target.isDead)
        {
            SetStatus(STATUS.COMPLETED);
        }
        return(status);
    }
    protected float EvaluateDistanceWithObject(Brain brain, StageObject obj)
    {
        float lengthWithBetweenObject = AIUtility.GetLengthWithBetweenObject(brain.owner, obj);

        return(EvaluateDistance(lengthWithBetweenObject));
    }