Esempio n. 1
0
    public override float TaskCompletionCostEstimate(UrbAgent Instigator, UrbTile WorkTile)
    {
        if (NoTarget)
        {
            return(float.MaxValue);
        }

        if (Instigator.HasAction(UrbTestCategory.Hold))
        {
            UrbAction Action       = Instigator.PickAction(UrbTestCategory.Hold);
            float     Estimate     = Action.CostEstimate(Instigator);
            float     CarryAmount  = Action.Test(Instigator);
            float     TargetAmount = GoalSubstance.SubstanceAmount - _TargetTile[GoalSubstance.Substance];
            if (CarryAmount >= TargetAmount)
            {
                return(Estimate);
            }
            else
            {
                return(Estimate * (TargetAmount / CarryAmount));
            }
        }

        return(float.MaxValue);
    }
Esempio n. 2
0
    public float PerformTest(UrbTestCategory Test, float Modifier = 0, bool Execute = false)
    {
        UrbAction ChosenAction = PickAction(Test);

        if (ChosenAction == null)
        {
            return(0.0f);
        }

        return(ChosenAction.Test(mAgent, Modifier));
    }