Daenks/Meridian59_103 — pull request #508 by skittles1 (2014-07-16 14:01:54+00:00)
Title: Spell overhaul - AttackSpell changes, EQ moved to AttackSpell, system setting for spellpower and LOS for testing.

All attack spells that directly cause damage (LB, FB, blast spells) are in class AttackSpell, with the projectile spells in a subclass of this called BoltSpell. BoltSpell just handles sending projectile animations and setting vbIsRangedAttack to TRUE. AttackSpell handles the ‘CanPayCosts’ for attack spells, which just checks that we have one Battler target and that they’re still in range before propagating to Spell to check generic spellcasting costs. ‘CastSpell’ in AttackSpell currently handles all the specifics of casting a single target attack spell (damage modifiers, improvement, battle messages, kills) and does not propagate to Spell.

This system works perfectly fine for single target attack spells but is unable to handle multiple target area effect spells such as Earthquake, or proposed area effect projectile spells such as Ice Nova. Earthquake itself is directly under the Spell class, and handles everything related to targets and damage there. Thus any new spell that does area damage, or any theoretical monster abilities (like a fire storm or poison nova etc.) would require duplication of the code related to targeting, dealing the damage and if necessary projectile animation also.

This pull request modifies BoltSpell and AttackSpell to handle multiple targets correctly, makes Earthquake part of class AttackSpell, adds new class variables to AttackSpell to deal with special cases (vbIsAreaEffect, vbSelfHarming) and also propagates CastSpell to Spell (redundant code removed).

Most of the code handling messages in Earthquake is moved to AttackSpell, save the code that is sent to all players in the room (however this could be in AttackSpell if more than one spell needs it). Earthquake damage is now calculated similar to the other attack spells but it still modified by the range code in the Earthquake file. CastSpell in AttackSpell is much larger but can also deal with rooms casting area spells (eg. Earthquake) in addition to monsters or players. Propagating to Spell allows attack spells to return spellpower for a future addition, and also any other feature added to CastSpell in Spell with the purpose of affecting *all* spells will now cover attack spells as well.

Earthquake now also displays damage numbers and the damage is affected by int and myst, same as the other attack spells (but is unaffected by mana focus). Damage will increase with smaller increments of spellpower compared to before where earthquake essentially had 4 damage settings (1+spellpower/25). I’ve tried to replicate the current damage as best I can, but it could certainly use some feedback.

Problems still to fix (will update as more are found):
Battle messages can be a bit spammy, especially when you kill something/are killed by EQ.

BONUS: Added spellpower readouts and also a message for when the line of sight code is triggered when casting spells, which can be turned on via system setting (pbDisplaySpellData, default FALSE).