More bug fixes in the magic system.

Added in a check to make sure that channel spells cant activate if the player is too far away.

The individual spell types (Channel, Rune, Ground, Sky, Self, Projectile) all seem to be working so I finally tied all the code in to allow the NPCs to switch between all types of spells available to them including some random variation with weighted bools. Might want to eventually make this tied to skill level or something.

Wrote a nice new function that can determine and fill out if we have certain kinds of spells like rune or ground spells as a sort of early out for when we are determining what type of spell to cast.

Added an early out for what school of magic to cast a spell from.

Realized NPCs could never cast resotration spells other than Restoring health. Added a new branch to the T_DetermineMagicSpell to allow them to cast other spells in restoration school.

Cleaned up the code inside of T_DetermineMagicSpell using some new events to clean up the spaghetti.

Removed all of the old spell selection code inside of T_DetermineMagicSpell, previously it was designed around the idea of having certain types of mages that could cast a type of spell instead of having universal characters that could cast anything based on their skills and spell inventory.

Fixed a massive bug in the strafing movement code where NPCs would jitter back and forth while a spell was loading.

Next
Next

Ground and Sky spell conversion to Rune Style casting