예제 #1
0
        public static void DirectDamages(Fight fight, Fighter caster, List <Fighter> targets, Engines.Spells.SpellEffect effect, int element)
        {
            int damages    = 0;
            int effectBase = effect.Value3;

            if (effect.Value > 0 && effect.Value2 > 0)
            {
                effectBase = Utilities.Basic.Rand(effect.Value + effect.Value3, effect.Value2 + effect.Value3);
            }
            else if (effectBase < 0)
            {
                if (effect.Value >= effect.Value2)
                {
                    effectBase = effect.Value;
                }
                else
                {
                    effectBase = Utilities.Basic.Rand(effect.Value, effect.Value2);
                }
            }
            damages = RandomDamages(effectBase, caster, element);
            damages = (-damages);
            foreach (Fighter target in targets)
            {
                target.TakeDamages(caster.ID, damages, element);
            }
            caster.UnInvisible();
        }
예제 #2
0
        public static void StealLifeDamages(Fight fight, Fighter caster, List <Fighter> targets, Engines.Spells.SpellEffect effect, int element)
        {
            int damages    = 0;
            int effectBase = effect.Value3;

            if (effect.Value > 0 && effect.Value2 > 0)
            {
                effectBase = Utilities.Basic.Rand(effect.Value + effect.Value3, effect.Value2 + effect.Value3);
            }
            damages = RandomDamages(effectBase, caster, element);
            int takenDamages = (-damages);
            int stealedLife  = (int)Math.Truncate((double)(damages / 2));

            foreach (Fighter target in targets)
            {
                target.TakeDamages(target.ID, takenDamages, element);
                caster.Heal(caster.ID, stealedLife, element);
            }
            caster.UnInvisible();
        }
예제 #3
0
 public static void StealLifeDamages(Fight fight, Fighter caster, List<Fighter> targets, Engines.Spells.SpellEffect effect, int element)
 {
     int damages = 0;
     int effectBase = effect.Value3;
     if (effect.Value > 0 && effect.Value2 > 0)
     {
         effectBase = Utilities.Basic.Rand(effect.Value + effect.Value3, effect.Value2 + effect.Value3);
     }
     damages = RandomDamages(effectBase, caster, element);
     int takenDamages = (-damages);
     int stealedLife = (int)Math.Truncate((double)(damages / 2));
     foreach (Fighter target in targets)
     {
         target.TakeDamages(target.ID, takenDamages, element);
         caster.Heal(caster.ID, stealedLife, element);
     }
     caster.UnInvisible();
 }
예제 #4
0
 public static void DirectDamages(Fight fight, Fighter caster, List<Fighter> targets, Engines.Spells.SpellEffect effect, int element)
 {
     int damages = 0;
     int effectBase = effect.Value3;
     if (effect.Value > 0 && effect.Value2 > 0)
     {
         effectBase = Utilities.Basic.Rand(effect.Value + effect.Value3, effect.Value2 + effect.Value3);
     }
     else if (effectBase < 0)
     {
         if (effect.Value >= effect.Value2)
         {
             effectBase = effect.Value;
         }
         else
         {
             effectBase = Utilities.Basic.Rand(effect.Value, effect.Value2);
         }
     }
     damages = RandomDamages(effectBase, caster, element);
     damages = (-damages);
     foreach (Fighter target in targets)
     {
         target.TakeDamages(caster.ID, damages, element);
     }
     caster.UnInvisible();
 }