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
@@ -128,7 +128,7 @@
if(2)
to_chat(user, "<span class='danger'>Power courses through you! You can now shift your form at will.")
if(user.mind)
var/obj/effect/proc_holder/spell/targeted/shapeshift/dragon/D = new
var/obj/effect/proc_holder/spell/shapeshift/dragon/D = new
user.mind.AddSpell(D)
if(3)
to_chat(user, "<span class='danger'>You feel like you could walk straight through lava now.</span>")
@@ -365,7 +365,7 @@
ADD_TRAIT(L, TRAIT_MUTE, STASIS_MUTE)
L.status_flags |= GODMODE
L.mind.transfer_to(holder_animal)
var/obj/effect/proc_holder/spell/targeted/exit_possession/P = new /obj/effect/proc_holder/spell/targeted/exit_possession
var/obj/effect/proc_holder/spell/exit_possession/P = new /obj/effect/proc_holder/spell/exit_possession
holder_animal.mind.AddSpell(P)
holder_animal.verbs -= /mob/living/verb/pulled
@@ -377,7 +377,7 @@
L.notransform = 0
if(holder_animal && !QDELETED(holder_animal))
holder_animal.mind.transfer_to(L)
L.mind.RemoveSpell(/obj/effect/proc_holder/spell/targeted/exit_possession)
L.mind.RemoveSpell(/obj/effect/proc_holder/spell/exit_possession)
if(kill || !isanimal(loc))
L.death(0)
..()
@@ -388,20 +388,19 @@
/obj/structure/closet/stasis/ex_act()
return
/obj/effect/proc_holder/spell/targeted/exit_possession
/obj/effect/proc_holder/spell/exit_possession
name = "Exit Possession"
desc = "Exits the body you are possessing"
charge_max = 60
clothes_req = 0
invocation_type = "none"
max_targets = 1
range = -1
include_user = 1
selection_type = "view"
action_icon_state = "exit_possession"
sound = null
/obj/effect/proc_holder/spell/targeted/exit_possession/cast(list/targets, mob/user = usr)
/obj/effect/proc_holder/spell/exit_possession/create_new_targeting()
return new /datum/spell_targeting/self
/obj/effect/proc_holder/spell/exit_possession/cast(list/targets, mob/user = usr)
if(!isfloorturf(user.loc))
return
var/datum/mind/target_mind = user.mind
@@ -413,4 +412,4 @@
qdel(S)
break
current.gib()
target_mind.RemoveSpell(/obj/effect/proc_holder/spell/targeted/exit_possession)
target_mind.RemoveSpell(/obj/effect/proc_holder/spell/exit_possession)