Exemplo n.º 1
0
 public static void ApplyEffect(Actor target, Spells spell)
 {
     switch (spell)
     {
         case Spells.BattleLitany:
             ApplyEffect(target, StatusEffects.BattleLitany, 20);
             break;
         case Spells.InternalRelease:
             ApplyEffect(target, StatusEffects.InternalRelease, 15);
             break;
         case Spells.BloodForBlood:
             ApplyEffect(target, StatusEffects.BloodForBlood, 20);
             break;
         case Spells.LifeSurge:
             ApplyEffect(target, StatusEffects.LifeSurge, 10);
             break;
         case Spells.PowerSurge:
             ApplyEffect(target, StatusEffects.PowerSurge, 10);
             break;
         case Spells.StrengthPotion:
             ApplyEffect(target, StatusEffects.StrengthPotion, 15);
             break;
         case Spells.BloodOfTheDragon:
             ApplyEffect(target, StatusEffects.BloodOfTheDragon, 15);
             break;
     }
 }
 public static void ApplyEffect(Actor target, WeaponSkills weaponSkill, bool verbose, EffectSnapshot effectSnapshot = null)
 {
     switch (weaponSkill)
     {
         case WeaponSkills.HeavyThrust:
             ApplyEffect(target, StatusEffects.HeavyThrust, 24, verbose);
             break;
         case WeaponSkills.Disembowel:
             ApplyEffect(target, StatusEffects.Disembowel, 30, verbose);
             break;
         case WeaponSkills.ChaosThrust:
             Debug.Assert(effectSnapshot != null, "effectSnapshot != null");
             effectSnapshot.Duration = (long) TimeSpan.FromSeconds(30).TotalMilliseconds;
             ApplyDamageOverTime(target, StatusEffects.ChaosThrust, effectSnapshot, verbose);
             break;
         case WeaponSkills.Phlebotomize:
             Debug.Assert(effectSnapshot != null, "effectSnapshot != null");
             effectSnapshot.Duration = (long)TimeSpan.FromSeconds(24).TotalMilliseconds;
             ApplyDamageOverTime(target, StatusEffects.Phlebotomize, effectSnapshot, verbose);
             break;
     }
 }
        private static void ApplyEffect(Actor actor, StatusEffects statusEffect, long durationSeconds, bool verbose)
        {
            if (!(actor.StatusEffects.ContainsKey(statusEffect)))
            {
                if (verbose)
                {
                    Console.ForegroundColor = ConsoleColor.Cyan;
                    Console.WriteLine($"{statusEffect} applied!");
                }

                actor.StatusEffects.Add(statusEffect, (long)TimeSpan.FromSeconds(durationSeconds).TotalMilliseconds);
            }
            else
            {
                if (verbose)
                {
                    Console.ForegroundColor = ConsoleColor.Cyan;
                    Console.WriteLine($"{statusEffect} refreshed!");
                }

                actor.StatusEffects[statusEffect] = (long)TimeSpan.FromSeconds(durationSeconds).TotalMilliseconds;
            }
        }
        private static void ApplyDamageOverTime(Actor target, StatusEffects statusEffect, EffectSnapshot effectSnapshot, bool verbose)
        {
            if (!(target.DamageOverTimeEffects.ContainsKey(statusEffect)))
            {
                if (verbose)
                {
                    Console.ForegroundColor = ConsoleColor.Cyan;
                    Console.WriteLine($"{statusEffect} applied!");
                }

                target.DamageOverTimeEffects.Add(statusEffect, effectSnapshot);
            }
            else
            {
                if (verbose)
                {
                    Console.ForegroundColor = ConsoleColor.Cyan;
                    Console.WriteLine($"{statusEffect} refreshed!");
                }

                target.DamageOverTimeEffects[statusEffect] = effectSnapshot;
            }
        }
Exemplo n.º 5
0
 private static void ApplyEffect(Actor actor, StatusEffects statusEffect, long durationSeconds)
 {
     if (!(actor.StatusEffects.ContainsKey(statusEffect)))
     {
         actor.StatusEffects.Add(statusEffect, (long)TimeSpan.FromSeconds(durationSeconds).TotalMilliseconds);
     }
     else
     {
         if (statusEffect == StatusEffects.BloodOfTheDragon &&
             actor.StatusEffects[statusEffect] > (long) TimeSpan.FromSeconds(durationSeconds).TotalMilliseconds)
         {
             return;
         }
         actor.StatusEffects[statusEffect] = (long)TimeSpan.FromSeconds(durationSeconds).TotalMilliseconds;
     }
 }