Beispiel #1
0
        /// <summary>
        /// Process a move this fighter is the target of.
        /// </summary>
        protected void ReceiveMove(List <Effect> ReceivedEffects, PassiveList DamagingMods, double initDmg)
        {
            // Add pertinent pre-damage modifiers
            foreach (PassiveEffect e in ReceivedEffects)
            {
                if (e.InitialCalculationBoolean == true)
                {
                    switch (e.IOType)
                    {
                    case PassiveEffect.ModType.Weakness:
                        SelfDamageModifiers.Add(e);
                        break;

                    case PassiveEffect.ModType.Buff:
                        SelfDamageModifiers.Add(e);
                        break;

                    case PassiveEffect.ModType.Move:
                        SelfMoveModifiers.Add(e);
                        break;
                    }
                }
            }

            Damage(initDmg, DamagingMods);

            foreach (Effect e in ReceivedEffects)
            {
                AddEffect(e);
            }
        }
        /// <summary>
        /// Shallow clone
        /// </summary>
        public object Clone()
        {
            PassiveList output = new PassiveList();

            foreach (PassiveEffect PE in modifiers)
            {
                output.Add(PE);
            }

            return(output);
        }
Beispiel #3
0
        /// <summary>
        /// Damage the fighter applying damage modifiers (on both fighter and attacker)
        /// to the damage.
        /// </summary>
        public void Damage(double damage, PassiveList DamageModifiers)
        {
            PassiveList DamageModifierClone = (PassiveList)DamageModifiers.Clone();

            foreach (PassiveEffect mod in SelfDamageModifiers)
            {
                DamageModifierClone.Add(mod);
            }
            damage = DamageModifierClone.CalculateMax(damage, 0);

            Tuple <double, double> pair = SpeedDamage(damage);

            Speed -= pair.Item2;
            damage = DamageModifierClone.CalculateMin(pair.Item1, 0);
            HealthDamage(damage);
        }