/
hypospray.dm
226 lines (191 loc) · 9.17 KB
/
hypospray.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
////////////////////////////////////////////////////////////////////////////////
/// HYPOSPRAY
////////////////////////////////////////////////////////////////////////////////
/obj/item/reagent_containers/hypospray
name = "hypospray"
desc = "The DeForest Medical Corporation hypospray is a sterile, air-needle autoinjector for rapid administration of drugs to patients."
icon = 'icons/obj/hypo.dmi'
item_state = "hypo"
icon_state = "hypo"
belt_icon = "hypospray"
amount_per_transfer_from_this = 5
volume = 30
possible_transfer_amounts = list(1,2,3,4,5,10,15,20,25,30)
resistance_flags = ACID_PROOF
container_type = OPENCONTAINER
slot_flags = SLOT_FLAG_BELT
var/ignore_flags = FALSE
var/safety_hypo = FALSE
var/static/list/safe_chem_list = list("antihol", "charcoal", "epinephrine", "insulin", "teporone", "salbutamol", "omnizine",
"weak_omnizine", "godblood", "potass_iodide", "oculine", "mannitol", "spaceacillin", "salglu_solution",
"sal_acid", "cryoxadone", "sugar", "hydrocodone", "mitocholide", "rezadone", "menthol",
"mutadone", "sanguine_reagent", "iron", "ephedrine", "heparin", "corazone", "sodiumchloride",
"lavaland_extract", "synaptizine", "bicaridine", "kelotane")
/obj/item/reagent_containers/hypospray/proc/apply(mob/living/M, mob/user)
if(!reagents.total_volume)
to_chat(user, "<span class='warning'>[src] is empty!</span>")
return
if(!iscarbon(M))
return
if(reagents.total_volume && (ignore_flags || M.can_inject(user, TRUE))) // Ignore flag should be checked first or there will be an error message.
to_chat(M, "<span class='warning'>You feel a tiny prick!</span>")
to_chat(user, "<span class='notice'>You inject [M] with [src].</span>")
if(M.reagents)
var/list/injected = list()
for(var/datum/reagent/R in reagents.reagent_list)
injected += R.name
var/primary_reagent_name = reagents.get_master_reagent_name()
var/trans = reagents.trans_to(M, amount_per_transfer_from_this)
if(safety_hypo)
visible_message("<span class='warning'>[user] injects [M] with [trans] units of [primary_reagent_name].</span>")
playsound(loc, 'sound/goonstation/items/hypo.ogg', 80, 0)
to_chat(user, "<span class='notice'>[trans] unit\s injected. [reagents.total_volume] unit\s remaining in [src].</span>")
var/contained = english_list(injected)
add_attack_logs(user, M, "Injected with [src] containing ([contained])", reagents.harmless_helper() ? ATKLOG_ALMOSTALL : null)
reagents.reaction(M, REAGENT_INGEST, 0.1)
return TRUE
/obj/item/reagent_containers/hypospray/attack(mob/living/M, mob/user)
return apply(M, user)
/obj/item/reagent_containers/hypospray/attack_self(mob/user)
return apply(user, user)
/obj/item/reagent_containers/hypospray/attackby(obj/item/I, mob/user, params)
if(is_pen(I))
rename_interactive(user, I, use_prefix = TRUE, prompt = "Give [src] a title.")
return TRUE
return ..()
/obj/item/reagent_containers/hypospray/examine(mob/user)
. = ..()
if(Adjacent(user))
. += "<span class='notice'>You can use a pen to add a label to [src].</span>"
/obj/item/reagent_containers/hypospray/on_reagent_change()
if(safety_hypo && !emagged)
var/found_forbidden_reagent = FALSE
for(var/datum/reagent/R in reagents.reagent_list)
if(!safe_chem_list.Find(R.id))
reagents.del_reagent(R.id)
found_forbidden_reagent = TRUE
if(found_forbidden_reagent)
if(ismob(loc))
to_chat(loc, "<span class='warning'>[src] identifies and removes a harmful substance.</span>")
else
visible_message("<span class='warning'>[src] identifies and removes a harmful substance.</span>")
/obj/item/reagent_containers/hypospray/emag_act(mob/user)
if(safety_hypo && !emagged)
emagged = TRUE
ignore_flags = TRUE
to_chat(user, "<span class='warning'>You short out the safeties on [src].</span>")
return TRUE
/obj/item/reagent_containers/hypospray/safety
name = "medical hypospray"
desc = "A general use medical hypospray for quick injection of chemicals. There is a safety button by the trigger."
icon_state = "medivend_hypo"
safety_hypo = TRUE
/obj/item/reagent_containers/hypospray/safety/ert
name = "medical hypospray (Omnizine)"
icon_state = "ert_hypo"
list_reagents = list("omnizine" = 30)
/obj/item/reagent_containers/hypospray/CMO
name = "advanced hypospray"
list_reagents = list("omnizine" = 30)
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
/obj/item/reagent_containers/hypospray/CMO/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_PARENT_QDELETING, PROC_REF(alert_admins_on_destroy))
/obj/item/reagent_containers/hypospray/combat
name = "combat stimulant injector"
desc = "A modified air-needle autoinjector, used by support operatives to quickly heal injuries in combat."
amount_per_transfer_from_this = 15
possible_transfer_amounts = null
icon_state = "combat_hypo"
volume = 90
ignore_flags = 1 // So they can heal their comrades.
list_reagents = list("epinephrine" = 30, "weak_omnizine" = 30, "salglu_solution" = 30)
/obj/item/reagent_containers/hypospray/combat/nanites
desc = "A modified air-needle autoinjector for use in combat situations. Prefilled with expensive medical nanites for rapid healing."
icon_state = "nanites_hypo"
volume = 100
list_reagents = list("nanites" = 100)
/// This is an empty variant
/obj/item/reagent_containers/hypospray/autoinjector
name = "empty autoinjector"
desc = "A rapid and safe way to inject chemicals into humanoids. This one is empty."
icon_state = "autoinjector"
item_state = "autoinjector"
belt_icon = "autoinjector"
amount_per_transfer_from_this = 10
possible_transfer_amounts = null
volume = 10
ignore_flags = TRUE //so you can medipen through hardsuits
container_type = DRAWABLE
flags = null
/obj/item/reagent_containers/hypospray/autoinjector/attack(mob/M, mob/user)
if(!reagents.total_volume)
to_chat(user, "<span class='warning'>[src] is empty!</span>")
return
..()
update_icon(UPDATE_ICON_STATE)
return TRUE
/obj/item/reagent_containers/hypospray/autoinjector/attack_self(mob/user)
..()
update_icon(UPDATE_ICON_STATE)
return TRUE
/obj/item/reagent_containers/hypospray/autoinjector/update_icon_state()
if(reagents.total_volume > 0)
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]0"
/obj/item/reagent_containers/hypospray/autoinjector/examine()
. = ..()
if(reagents && length(reagents.reagent_list))
. += "<span class='notice'>It is currently loaded.</span>"
else
. += "<span class='notice'>It is spent.</span>"
/obj/item/reagent_containers/hypospray/autoinjector/epinephrine
name = "emergency autoinjector"
desc = "A rapid and safe way to stabilize patients in critical condition for personnel without advanced medical knowledge."
list_reagents = list("epinephrine" = 10)
/// basilisks
/obj/item/reagent_containers/hypospray/autoinjector/teporone
name = "teporone autoinjector"
desc = "A rapid way to regulate your body's temperature in the event of a hardsuit malfunction."
icon_state = "lepopen"
list_reagents = list("teporone" = 10)
/// goliath kiting
/obj/item/reagent_containers/hypospray/autoinjector/stimpack
name = "stimpack autoinjector"
desc = "A rapid way to stimulate your body's adrenaline, allowing for freer movement in restrictive armor."
icon_state = "stimpen"
volume = 20
amount_per_transfer_from_this = 20
list_reagents = list("methamphetamine" = 10, "coffee" = 10)
/obj/item/reagent_containers/hypospray/autoinjector/stimulants
name = "Stimulants autoinjector"
desc = "Rapidly stimulates and regenerates the body's organ system."
icon_state = "stimulantspen"
amount_per_transfer_from_this = 50
volume = 50
list_reagents = list("stimulants" = 50)
/obj/item/reagent_containers/hypospray/autoinjector/survival
name = "survival medipen"
desc = "A medipen for surviving in the harshest of environments, heals and protects from environmental hazards. <br><span class='boldwarning'>WARNING: Do not inject more than one pen in quick succession.</span>"
icon_state = "survpen"
volume = 42
amount_per_transfer_from_this = 42
list_reagents = list("salbutamol" = 10, "teporone" = 15, "epinephrine" = 10, "lavaland_extract" = 2, "weak_omnizine" = 5)
/obj/item/reagent_containers/hypospray/autoinjector/emergency_nuclear
name = "emergency stabilization medipen"
desc = "A fast acting life-saving emergency autoinjector. Effective in combat situations, made by the syndicate for the syndicate."
icon_state = "stimpen"
volume = 12
amount_per_transfer_from_this = 12
list_reagents = list("perfluorodecalin" = 3, "teporone" = 3, "atropine" = 3, "mannitol" = 3)
/obj/item/reagent_containers/hypospray/autoinjector/nanocalcium
name = "protoype nanite autoinjector"
desc = "A highly experimental prototype chemical designed to fully mend limbs and organs of soldiers in the field, shuts down body systems whilst aiding in repair.<br><span class='boldwarning'>WARNING: Side effects can cause temporary paralysis, loss of co-ordination and sickness. Do not use with any kind of stimulant or drugs. Serious damage can occur!</span>"
icon_state = "bonepen"
amount_per_transfer_from_this = 30
volume = 30
list_reagents = list("nanocalcium" = 30)
/obj/item/reagent_containers/hypospray/autoinjector/nanocalcium/attack(mob/living/M, mob/user)
if(..())
playsound(loc, 'sound/weapons/smg_empty_alarm.ogg', 20, 1)