Files
Paradise/code/datums/spells/bloodcrawl.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

42 lines
1.2 KiB
Plaintext

/obj/effect/proc_holder/spell/bloodcrawl
name = "Blood Crawl"
desc = "Use pools of blood to phase out of existence."
base_cooldown = 0
clothes_req = FALSE
cooldown_min = 0
should_recharge_after_cast = FALSE
overlay = null
action_icon_state = "bloodcrawl"
action_background_icon_state = "bg_demon"
panel = "Demon"
var/phased = FALSE
/obj/effect/proc_holder/spell/bloodcrawl/create_new_targeting()
var/datum/spell_targeting/targeted/T = new()
T.selection_type = SPELL_SELECTION_RANGE
T.allowed_type = /obj/effect/decal/cleanable
T.random_target = TRUE
T.range = 1
T.use_turf_of_user = TRUE
return T
/obj/effect/proc_holder/spell/bloodcrawl/valid_target(obj/effect/decal/cleanable/target, user)
return target.can_bloodcrawl_in()
/obj/effect/proc_holder/spell/bloodcrawl/can_cast(mob/living/user, charge_check, show_message)
. = ..()
if(!.)
return
if(!isliving(user))
return FALSE
/obj/effect/proc_holder/spell/bloodcrawl/cast(list/targets, mob/living/user)
var/obj/effect/decal/cleanable/target = targets[1] // TODO Test this spell
if(phased)
if(user.phasein(target))
phased = FALSE
else
if(user.phaseout(target))
phased = TRUE
cooldown_handler.start_recharge()