Example #1
0
        public int AbilityCount()
        {
            int count = 0;

            if (MagicalAbility != MagicalAbility.None)
            {
                count++;
            }

            if (SpecialAbilities != null)
            {
                count += SpecialAbilities.Count(a => !a.NaturalAbility);
            }

            if (AreaEffects != null)
            {
                count += AreaEffects.Length;
            }

            if (WeaponAbilities != null)
            {
                count += WeaponAbilities.Length;
            }

            return(count);
        }
Example #2
0
        public bool CanChooseSpecialAbility(SpecialAbility[] list)
        {
            if (!Creature.Controlled)
            {
                return(true);
            }

            if (HasSpecialMagicalAbility() &&
                list.Any(abil => IsRuleBreaker(abil)) &&
                (AreaEffects == null || AreaEffects.Length == 0) &&
                (SpecialAbilities == null || SpecialAbilities.Length == 0 || SpecialAbilities.All(a => a.NaturalAbility)))
            {
                return(true);
            }

            return(!HasSpecialMagicalAbility() && (SpecialAbilities == null || SpecialAbilities.Count(a => !a.NaturalAbility) == 0) && AbilityCount() < 3);
        }