Refactors spell targeting to delegate it to a targeting datum (#16552)

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
Farie82
2021-12-13 17:40:36 +01:00
committed by GitHub
co-authored by AffectedArc07
parent 636e6b8505
commit 576482907b
98 changed files with 1747 additions and 1434 deletions
@@ -0,0 +1,22 @@
/**
* The base class for the handler systems spells use.
* Subtypes of this class can be added to spells to modify their behaviour and change their can_cast.
* Thus allowing for a more modular behaviour system. For example a vampire spell that jaunts can just add the vampire spell_handler to the jaunt spell
*/
/datum/spell_handler
/datum/spell_handler/proc/can_cast(mob/user, charge_check, show_message, obj/effect/proc_holder/spell/spell)
return TRUE
/datum/spell_handler/proc/spend_spell_cost(mob/user, obj/effect/proc_holder/spell/spell)
return
/datum/spell_handler/proc/revert_cast(mob/user, obj/effect/proc_holder/spell/spell)
return
/datum/spell_handler/proc/before_cast(list/targets, mob/user, obj/effect/proc_holder/spell/spell)
return
/datum/spell_handler/proc/after_cast(list/targets, mob/user, obj/effect/proc_holder/spell/spell)
return