Esempio n. 1
0
        public float EvaluateRanged(AIBrain brain, AINode.AICondition condition)
        {
            Character caster = brain.character;

            npcTarget = null;
            float            bestEval = 0;
            List <Character> targets  = targetType == TargetType.Enemies ? brain.enemies : brain.allies;

            foreach (Character ch in targets)
            {
                if (ch != caster)
                {
                    bool cond = AINode.IsCondition(condition, ch, this);
                    if (cond)
                    {
                        float eval = Eval(caster, ch);

                        // TODO - factor in collateral and splash damage ?

                        //Debug.Log("Power:" + name + " Ch:" + ch.name + " Eval:" + eval);
                        if (eval > bestEval)
                        {
                            bestEval  = eval;
                            npcTarget = ch;
                        }
                    }
                    // else
                    //Debug.Log("Power:" + name + " Ch:" + ch.name + "condition not met");
                }
            }

            return(bestEval);
        }
Esempio n. 2
0
        public override void Apply(Prop ch, Character caster = null)
        {
            Power p = null;

            if (caster)
            {
                p = caster.activePower;
            }

            if (AINode.IsCondition(condition, ch, p))
            {
                status.Apply(ch, caster);
            }
        }