Files
Paradise/code/datums/spells/rod_form.dm
T
ded049a902 Spell cooldown refactor (#18327)
* Squashed commit of the following:

commit 979fe5287c3dd33cd5d69bdd968beae245984f2e
Author: hal9000PR <charliesteeples@outlook.com>
Date:   Sat Jul 9 23:40:53 2022 +0100

    guts the old system

* refactors spell cooldowns into a handler

* charge datum

* garbage collection

* cleanup, renames cooldown var

* review changes

* boo cooldown fix

* styling

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>
2022-07-23 00:00:42 +02:00

49 lines
1.3 KiB
Plaintext

/obj/effect/proc_holder/spell/rod_form
name = "Rod Form"
desc = "Take on the form of an immovable rod, destroying all in your path."
clothes_req = TRUE
human_req = FALSE
base_cooldown = 600
cooldown_min = 200
invocation = "CLANG!"
invocation_type = "shout"
action_icon_state = "immrod"
centcom_cancast = FALSE
sound = 'sound/effects/whoosh.ogg'
var/rod_delay = 2
/obj/effect/proc_holder/spell/rod_form/create_new_targeting()
return new /datum/spell_targeting/self
/obj/effect/proc_holder/spell/rod_form/cast(list/targets,mob/user = usr)
for(var/mob/living/M in targets)
var/turf/start = get_turf(M)
var/obj/effect/immovablerod/wizard/W = new(start, get_ranged_target_turf(M, M.dir, (15 + spell_level * 3)), rod_delay)
W.wizard = M
W.max_distance += spell_level * 3 //You travel farther when you upgrade the spell
W.start_turf = start
M.forceMove(W)
M.notransform = TRUE
M.status_flags |= GODMODE
//Wizard Version of the Immovable Rod
/obj/effect/immovablerod/wizard
var/max_distance = 13
var/mob/living/wizard
var/turf/start_turf
notify = FALSE
/obj/effect/immovablerod/wizard/Move()
if(get_dist(start_turf, get_turf(src)) >= max_distance)
qdel(src)
..()
/obj/effect/immovablerod/wizard/Destroy()
if(wizard)
wizard.status_flags &= ~GODMODE
wizard.notransform = FALSE
wizard.forceMove(get_turf(src))
return ..()