Example #1
0
        public static Double GetValidEffectsByDelegate(Character c, EffectCompare comp, Effect goal, EnchantmentParameters ep)
        {
            double effectAmount = 0;

            foreach (Effect ef in c.TemporaryEffects)
            {
                //the effect has the correct effect
                if (comp(goal, ef))
                {
                    effectAmount = effectAmount + ef.effectStrength;
                }
            }
            foreach (Effect ef in c.Effects)
            {
                //the effect has the correct effect
                if (comp(goal, ef))
                {
                    effectAmount = effectAmount + ef.effectStrength;
                }
            }
            foreach (Item it in c.Items)
            {
                foreach (Effect ef in it.ItemEffects)
                {
                    //the effect has the correct effect
                    if (comp(goal, ef))
                    {
                        effectAmount = effectAmount + ef.effectStrength;
                    }
                }
            }
            if (c.CombatStuff != null)
            {
                if (c.CombatStuff.CombatWeapon != null)
                {
                    if (c.CombatStuff.CombatWeapon.ItemEffects != null)
                    {
                        foreach (Effect ef in c.CombatStuff.CombatWeapon.ItemEffects)
                        {
                            //the effect has the correct effect
                            if (comp(goal, ef))
                            {
                                effectAmount = effectAmount + ef.effectStrength;
                            }
                        }
                    }
                }
            }
            if (ep != null)
            {
                effectAmount += EnchantmentUtilities.triggerAllEnchantmentsForChar(c, ep);
            }
            return(effectAmount);
        }
Example #2
0
        public static Double GetValidEffectsByTag(Character c, EffectTag desiredTag, bool justForOverload)
        {
            EffectCompare ec = new EffectCompare(TagOnly);

            return(GetValidEffectsByDelegate(c,
                                             ec,
                                             new Effect()
            {
                effectTag = desiredTag
            },
                                             null));
        }
Example #3
0
        public static Double GetValidEffectsByTag(Character c, EffectTag desiredTag)
        {
            EffectCompare ec = new EffectCompare(TagOnly);

            return(GetValidEffectsByDelegate(c,
                                             ec,
                                             new Effect()
            {
                effectTag = desiredTag
            },
                                             new EnchantmentParameters()
            {
                triggerSource = EnchantmentUtilities.SourceTypes.EffectCheck, eta = desiredTag
            }));
        }
Example #4
0
        // an overload of the GVEBE method that does not trigger enchantments, thereby avoiding
        // infinite loops. Use this instead of the normal method within enchantments.
        public static Double GetValidEffectsByEffect(Character c, EffectType desiredEffect, bool justForOverload)
        {
            EffectCompare ec = new EffectCompare(TypeOnly);

            return(GetValidEffectsByDelegate(c,
                                             ec,
                                             new Effect()
            {
                effectTypes = new List <EffectType>()
                {
                    desiredEffect
                }
            },
                                             null));
        }
Example #5
0
        public static Double GetValidEffectsByEffectAndDamageType(Character c, EffectType desiredEffect, Utilities.DamageType?desiredDamageType)
        {
            EffectCompare ec = new EffectCompare(TypeAndDamage);

            return(GetValidEffectsByDelegate(c,
                                             ec,
                                             new Effect()
            {
                effectTypes = new List <EffectType>()
                {
                    desiredEffect
                }, damageType = desiredDamageType
            },
                                             new EnchantmentParameters()
            {
                triggerSource = EnchantmentUtilities.SourceTypes.EffectCheck, ety = desiredEffect, dty = desiredDamageType
            }));
        }
Example #6
0
        public static Double GetValidEffectsByEffect(Character c, EffectType desiredEffect)
        {
            EffectCompare ec = new EffectCompare(TypeOnly);

            return(GetValidEffectsByDelegate(c,
                                             ec,
                                             new Effect()
            {
                effectTypes = new List <EffectType>()
                {
                    desiredEffect
                }
            },
                                             new EnchantmentParameters()
            {
                triggerSource = EnchantmentUtilities.SourceTypes.EffectCheck, ety = desiredEffect
            }));
        }