mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-29 19:52:12 +00:00
* 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>
27 lines
802 B
Plaintext
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 ..()
|