-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathimplant_spell.dm
62 lines (49 loc) · 1.85 KB
/
implant_spell.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/obj/item/implant/spell
name = "spell implant"
desc = "Allows you to cast a spell as if you were a wizard."
actions_types = null
/// Whether to make the spell robeless
var/make_robeless = TRUE
/// The typepath of the spell we give to people. Instantiated in Initialize
var/datum/action/cooldown/spell/spell_type
/// The actual spell we give to the person on implant
var/datum/action/cooldown/spell/spell_to_give
/obj/item/implant/spell/Initialize(mapload)
. = ..()
if(!spell_type)
return
spell_to_give = new spell_type(src)
if(make_robeless && (spell_to_give.spell_requirements & SPELL_REQUIRES_WIZARD_GARB))
spell_to_give.spell_requirements &= ~SPELL_REQUIRES_WIZARD_GARB
/obj/item/implant/spell/Destroy()
QDEL_NULL(spell_to_give)
return ..()
/obj/item/implant/spell/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
<b>Name:</b> Spell Implant<BR>
<b>Life:</b> 4 hours after death of host<BR>
<b>Implant Details:</b> <BR>
<b>Function:</b> [spell_to_give ? "Allows a non-wizard to cast [spell_to_give] as if they were a wizard." : "None."]"}
return dat
/obj/item/implant/spell/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
if (!.)
return
if (!spell_to_give)
return FALSE
spell_to_give.Grant(target)
return TRUE
/obj/item/implant/spell/removed(mob/living/source, silent = FALSE, special = 0)
if (!.)
return FALSE
if(spell_to_give)
spell_to_give.Remove(source)
if(source.stat != DEAD && !silent)
to_chat(source, span_boldnotice("The knowledge of how to cast [spell_to_give] slips out from your mind."))
return TRUE
/obj/item/implanter/spell
name = "implanter (spell)"
imp_type = /obj/item/implant/spell
/obj/item/implantcase/spell
name = "implant case - 'Wizardry'"
desc = "A glass case containing an implant that can teach the user the arts of Wizardry."
imp_type = /obj/item/implant/spell