Beispiel #1
0
        public override bool Validate(GameObject caster, object target)
        {
            var targetAsGameObject = target as GameObject;

            if (targetAsGameObject == null)
            {
                return(false);
            }

            var health = targetAsGameObject.GetComponent <HealthComponent>();

            return(health != null && Comparator.Compare(health.HealthFraction, this.data.Fraction, this.data.Comparator));
        }
Beispiel #2
0
        public override bool Validate(GameObject caster, object target)
        {
            var targetAsGameObject = target as GameObject;

            if (targetAsGameObject == null)
            {
                return(false);
            }

            var unit = targetAsGameObject.GetComponent <UnitComponent>();

            if (unit == null)
            {
                return(false);
            }

            return(Comparator.Compare(unit.ChallengeRating, this.data.Value, this.data.Comparator));
        }
Beispiel #3
0
        public override bool Validate(GameObject caster, object target)
        {
            var targetAsGameObject = target as GameObject;

            if (targetAsGameObject == null)
            {
                return(false);
            }

            var behavioursComponent = targetAsGameObject.GetComponent <BehavioursComponent>();

            if (behavioursComponent == null)
            {
                return(false);
            }

            return(Comparator.Compare(
                       behavioursComponent.Behaviours.Where(b => b.Id == this.data.BehaviourId).Sum(b => b.StackCount),
                       this.data.Value,
                       this.data.Comparator
                       ));
        }