public void CastArcaneOffense(Monster monster, Player player, int index) { monster.EnergyPoints -= monster.Spellbook[index].EnergyCost; string attackString = $"The {monster.Name} casts a bolt of lightning at you!"; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), attackString); int arcaneSpellDamage = MonsterHelper.CalculateSpellDamage(player, monster, index); arcaneSpellDamage = CombatHelper.GetMonsterAttackDamageUpdatedFromPlayerEffects(player, monster, arcaneSpellDamage); if (arcaneSpellDamage == 0) { return; } player.HitPoints -= arcaneSpellDamage; string attackSuccessString = $"The {monster.Name} hits you for {arcaneSpellDamage} arcane damage."; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), attackSuccessString); }
public void CastSpell(Monster monster, Player player) { DeductManaCost(monster); DisplaySpellAttackMessage(monster); int spellDamage = CombatHelper.GetMonsterAttackDamageUpdatedFromPlayerEffects(player, monster, DamageAmount); if (spellDamage > 0) { HitPlayerWithFireball(monster, player, spellDamage); } }
public void CastFireOffense(Monster monster, Player player, int index) { monster.EnergyPoints -= monster.Spellbook[index].EnergyCost; string attackString = monster.MonsterCategory == MonsterType.Dragon ? $"The {monster.Name} breathes a pillar of fire at you!" : $"The {monster.Name} casts a fireball and launches it at you!"; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), attackString); int fireSpellDamage = MonsterHelper.CalculateSpellDamage(player, monster, index); fireSpellDamage = CombatHelper.GetMonsterAttackDamageUpdatedFromPlayerEffects(player, monster, fireSpellDamage); if (fireSpellDamage == 0) { return; } player.HitPoints -= fireSpellDamage; string attackSuccessString = $"The {monster.Name} hits you for {fireSpellDamage} fire damage."; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), attackSuccessString); if (monster.Spellbook[index].Offensive.AmountOverTime > 0) { const string onFireString = "You burst into flame!"; OutputHelper.Display.StoreUserOutput( Settings.FormatOnFireText(), Settings.FormatDefaultBackground(), onFireString); EffectOverTimeSettings effectOverTimeSettings = new EffectOverTimeSettings { AmountOverTime = monster.Spellbook[index].Offensive.AmountOverTime, EffectHolder = player, MaxRound = monster.Spellbook[index].Offensive.AmountMaxRounds, Name = monster.Spellbook[index].Name }; player.Effects.Add(new BurningEffect(effectOverTimeSettings)); } }
public void CastFrostOffense(Monster monster, Player player, int index) { monster.EnergyPoints -= monster.Spellbook[index].EnergyCost; string attackString = $"The {monster.Name} conjures up a frostbolt and launches it at you!"; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), attackString); int frostSpellDamage = MonsterHelper.CalculateSpellDamage(player, monster, index); frostSpellDamage = CombatHelper.GetMonsterAttackDamageUpdatedFromPlayerEffects(player, monster, frostSpellDamage); if (frostSpellDamage == 0) { return; } player.HitPoints -= frostSpellDamage; string attackSuccessString = $"The {monster.Name} hits you for {frostSpellDamage} frost damage."; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), attackSuccessString); EffectSettings frozenEffectSettings = new EffectSettings { EffectHolder = player, MaxRound = monster.Spellbook[index].Offensive.AmountMaxRounds, Name = monster.Spellbook[index].Name }; player.Effects.Add(new FrozenEffect(frozenEffectSettings)); const string frozenString = "You are frozen. Physical, frost and arcane damage to you will be increased by 50%!"; OutputHelper.Display.StoreUserOutput( Settings.FormatAttackSuccessText(), Settings.FormatDefaultBackground(), frozenString); }