Files
Paradise/code/datums/spells/conjure_item.dm
Charlie 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

27 lines
802 B
Plaintext

/obj/effect/proc_holder/spell/conjure_item
name = "Summon weapon"
desc = "A generic spell that should not exist. This summons an instance of a specific type of item, or if one already exists, un-summons it."
invocation_type = "none"
clothes_req = FALSE
var/obj/item/item
var/item_type = /obj/item/banhammer
school = "conjuration"
base_cooldown = 15 SECONDS
cooldown_min = 10
/obj/effect/proc_holder/spell/conjure_item/create_new_targeting()
return new /datum/spell_targeting/self
/obj/effect/proc_holder/spell/conjure_item/cast(list/targets, mob/user = usr)
if(item)
QDEL_NULL(item)
else
for(var/mob/living/carbon/C in targets)
if(C.drop_item())
item = new item_type
C.put_in_hands(item)
/obj/effect/proc_holder/spell/conjure_item/Destroy()
QDEL_NULL(item)
return ..()