public static void CastFrostOffense(Monster monster, Player player, int index) { player.ManaPoints -= player.Spellbook[index].ManaCost; int frostSpellDamage = PlayerHelper.CalculateSpellDamage(player, monster, index); foreach (FrozenEffect effect in monster.Effects) { effect.ProcessRound(); effect.IsEffectExpired = true; } string attackSuccessString = $"You hit the {monster.Name} for {frostSpellDamage} frost damage."; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), attackSuccessString); monster.HitPoints -= frostSpellDamage; EffectSettings frozenEffectSettings = new EffectSettings { EffectHolder = monster, MaxRound = player.Spellbook[index].Offensive.AmountMaxRounds, Name = player.Spellbook[index].Name }; monster.Effects.Add(new FrozenEffect(frozenEffectSettings)); string frozenString = $"The {monster.Name} is frozen. Physical, frost and arcane damage to it will be increased by 50%!"; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), frozenString); if (player.Spellbook[index].SpellCategory != SpellType.FrostNova) { return; } EffectSettings effectSettings = new EffectSettings { EffectHolder = monster, MaxRound = player.Spellbook[index].Offensive.AmountMaxRounds, Name = player.Spellbook[index].Name }; monster.Effects.Add(new StunnedEffect(effectSettings)); }
public static void CastFireOffense(Monster monster, Player player, int index) { player.ManaPoints -= player.Spellbook[index].ManaCost; int fireSpellDamage = PlayerHelper.CalculateSpellDamage(player, monster, index); foreach (FrozenEffect effect in monster.Effects) { fireSpellDamage = effect.GetIncreasedDamageFromFrozen(fireSpellDamage); effect.ProcessRound(); effect.IsEffectExpired = true; } string attackSuccessString = $"You hit the {monster.Name} for {fireSpellDamage} fire damage."; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), attackSuccessString); monster.HitPoints -= fireSpellDamage; if (player.Spellbook[index].Offensive.AmountOverTime <= 0) { return; } string onFireString = $"The {monster.Name} bursts into flame!"; OutputHelper.Display.StoreUserOutput( Settings.FormatOnFireText(), Settings.FormatDefaultBackground(), onFireString); EffectOverTimeSettings effectOverTimeSettings = new EffectOverTimeSettings { AmountOverTime = player.Spellbook[index].Offensive.AmountOverTime, EffectHolder = monster, MaxRound = player.Spellbook[index].Offensive.AmountMaxRounds, Name = player.Spellbook[index].Name }; monster.Effects.Add(new BurningEffect(effectOverTimeSettings)); }
public static void CastArcaneOffense(Monster monster, Player player, int index) { player.ManaPoints -= player.Spellbook[index].ManaCost; int arcaneSpellDamage = PlayerHelper.CalculateSpellDamage(player, monster, index); foreach (FrozenEffect effect in monster.Effects.Where(eff => eff.IsEffectExpired is false)) { arcaneSpellDamage = effect.GetIncreasedDamageFromFrozen(arcaneSpellDamage); effect.ProcessRound(); effect.IsEffectExpired = true; } string attackSuccessString = $"You hit the {monster.Name} for {arcaneSpellDamage} arcane damage."; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), attackSuccessString); monster.HitPoints -= arcaneSpellDamage; }