forked from DaedalusDock/daedalusdock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhypospray.dm
294 lines (253 loc) · 12.7 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
/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/syringe.dmi'
inhand_icon_state = "hypo"
worn_icon_state = "hypo"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
icon_state = "hypo"
worn_icon_state = "hypo"
amount_per_transfer_from_this = 5
volume = 30
possible_transfer_amounts = list(5)
resistance_flags = ACID_PROOF
reagent_flags = OPENCONTAINER
slot_flags = ITEM_SLOT_BELT
var/ignore_flags = NONE
var/infinite = FALSE
/obj/item/reagent_containers/hypospray/attack_paw(mob/user, list/modifiers)
return attack_hand(user, modifiers)
/obj/item/reagent_containers/hypospray/attack(mob/living/affected_mob, mob/user)
inject(affected_mob, user)
///Handles all injection checks, injection and logging.
/obj/item/reagent_containers/hypospray/proc/inject(mob/living/affected_mob, mob/user)
if(!reagents.total_volume)
to_chat(user, span_warning("[src] is empty!"))
return FALSE
if(!iscarbon(affected_mob))
return FALSE
//Always log attemped injects for admins
var/list/injected = list()
for(var/datum/reagent/injected_reagent in reagents.reagent_list)
injected += injected_reagent.name
var/contained = english_list(injected)
log_combat(user, affected_mob, "attempted to inject", src, "([contained])")
if(reagents.total_volume && (ignore_flags || affected_mob.try_inject(user, injection_flags = INJECT_TRY_SHOW_ERROR_MESSAGE))) // Ignore flag should be checked first or there will be an error message.
affected_mob.apply_pain(1, BODY_ZONE_CHEST, "You feel a tiny prick!")
to_chat(user, span_notice("You inject [affected_mob] with [src]."))
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
if(affected_mob.reagents)
var/trans = 0
if(!infinite)
trans = reagents.trans_to(affected_mob, amount_per_transfer_from_this, transfered_by = user, methods = INJECT)
else
reagents.expose(affected_mob, INJECT, fraction)
trans = reagents.copy_to(affected_mob, amount_per_transfer_from_this)
to_chat(user, span_notice("[trans] unit\s injected. [reagents.total_volume] unit\s remaining in [src]."))
log_combat(user, affected_mob, "injected", src, "([contained])")
playsound(src, 'sound/effects/autoinjector.ogg', 25)
return TRUE
return FALSE
/obj/item/reagent_containers/hypospray/cmo
list_reagents = list(/datum/reagent/medicine/tricordrazine = 30)
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
//combat
/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 = 10
inhand_icon_state = "combat_hypo"
icon_state = "combat_hypo"
volume = 90
possible_transfer_amounts = list(5,10)
ignore_flags = 1 // So they can heal their comrades.
list_reagents = list(/datum/reagent/medicine/epinephrine = 30, /datum/reagent/medicine/tricordrazine = 30, /datum/reagent/medicine/leporazine = 15, /datum/reagent/medicine/atropine = 15)
/obj/item/reagent_containers/hypospray/combat/nanites
name = "experimental combat stimulant injector"
desc = "A modified air-needle autoinjector for use in combat situations. Prefilled with experimental medical nanites and a stimulant for rapid healing and a combat boost."
inhand_icon_state = "nanite_hypo"
icon_state = "nanite_hypo"
base_icon_state = "nanite_hypo"
volume = 100
list_reagents = list(/datum/reagent/medicine/adminordrazine/quantum_heal = 80, /datum/reagent/medicine/synaptizine = 20)
/obj/item/reagent_containers/hypospray/combat/nanites/update_icon_state()
icon_state = "[base_icon_state][(reagents.total_volume > 0) ? null : 0]"
return ..()
/obj/item/reagent_containers/hypospray/combat/heresypurge
name = "holy water piercing injector"
desc = "A modified air-needle autoinjector for use in combat situations. Prefilled with 5 doses of a holy water and pacifier mixture. Not for use on your teammates."
inhand_icon_state = "holy_hypo"
icon_state = "holy_hypo"
volume = 250
possible_transfer_amounts = list(25,50)
list_reagents = list(/datum/reagent/water/holywater = 150, /datum/reagent/cryptobiolin = 50)
amount_per_transfer_from_this = 50
//MediPens
/obj/item/reagent_containers/hypospray/medipen
name = "emergency medipen"
desc = "A rapid and safe way to stabilize patients in critical condition for personnel without advanced medical knowledge."
icon_state = "medipen"
inhand_icon_state = "medipen"
worn_icon_state = "medipen"
base_icon_state = "medipen"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
amount_per_transfer_from_this = 15
volume = 15
ignore_flags = 1 //so you can medipen through spacesuits
reagent_flags = DRAWABLE
flags_1 = null
list_reagents = list(/datum/reagent/medicine/inaprovaline = 10, /datum/reagent/medicine/peridaxon = 10, /datum/reagent/medicine/coagulant = 5)
custom_price = PAYCHECK_MEDIUM
custom_premium_price = PAYCHECK_HARD
/obj/item/reagent_containers/hypospray/medipen/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("[user] begins to choke on \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return OXYLOSS//ironic. he could save others from oxyloss, but not himself.
/obj/item/reagent_containers/hypospray/medipen/inject(mob/living/affected_mob, mob/user)
. = ..()
if(.)
reagents.maximum_volume = 0 //Makes them useless afterwards
reagents.flags = NONE
update_appearance()
/obj/item/reagent_containers/hypospray/medipen/attack_self(mob/user)
if(user.canUseTopic(src, USE_CLOSE|USE_IGNORE_TK|USE_RESTING))
inject(user, user)
/obj/item/reagent_containers/hypospray/medipen/update_icon_state()
icon_state = "[base_icon_state][(reagents.total_volume > 0) ? null : 0]"
return ..()
/obj/item/reagent_containers/hypospray/medipen/examine()
. = ..()
if(reagents?.reagent_list.len)
. += span_notice("It is currently loaded.")
else
. += span_notice("It is spent.")
/obj/item/reagent_containers/hypospray/medipen/stimpack //goliath kiting
name = "stimpack autoinjector"
desc = "A rapid way to stimulate your body's adrenaline, allowing for freer movement in restrictive armor."
icon_state = "stimpen"
inhand_icon_state = "stimpen"
base_icon_state = "stimpen"
volume = 20
amount_per_transfer_from_this = 20
list_reagents = list(/datum/reagent/medicine/ephedrine = 10, /datum/reagent/consumable/coffee = 10)
/obj/item/reagent_containers/hypospray/medipen/stimpack/traitor
desc = "A modified stimulants autoinjector for use in combat situations. Has a mild healing effect."
list_reagents = list(/datum/reagent/stimulants = 10, /datum/reagent/medicine/tricordrazine = 10)
/obj/item/reagent_containers/hypospray/medipen/stimulants
name = "stimulant autoinjector"
desc = "Contains a very large amount of an incredibly powerful stimulant, vastly increasing your movement speed and reducing stuns by a very large amount for around five minutes. Do not take if pregnant."
icon_state = "syndipen"
inhand_icon_state = "tbpen"
base_icon_state = "syndipen"
volume = 50
amount_per_transfer_from_this = 50
list_reagents = list(/datum/reagent/stimulants = 50)
/obj/item/reagent_containers/hypospray/medipen/morphine
name = "morphine autoinjector"
desc = "A rapid way to get you out of a tight situation and fast! You'll feel rather drowsy, though."
icon_state = "morphen"
inhand_icon_state = "morphen"
base_icon_state = "morphen"
list_reagents = list(/datum/reagent/medicine/morphine = 10)
/obj/item/reagent_containers/hypospray/medipen/dermaline
name = "dermaline autoinjector"
desc = "An autoinjector containing dermaline, used to treat severe burns."
icon_state = "oxapen"
inhand_icon_state = "oxapen"
base_icon_state = "oxapen"
list_reagents = list(/datum/reagent/medicine/dermaline = 10)
/obj/item/reagent_containers/hypospray/medipen/meralyne
name = "meralyne autoinjector"
desc = "An autoinjector containing meralyne, used to treat severe brute damage."
icon_state = "salacid"
inhand_icon_state = "salacid"
base_icon_state = "salacid"
list_reagents = list(/datum/reagent/medicine/meralyne = 10)
/obj/item/reagent_containers/hypospray/medipen/dexalin
name = "dexalin autoinjector"
desc = "An autoinjector containing dexalin, used to heal oxygen damage quickly."
icon_state = "salpen"
inhand_icon_state = "salpen"
base_icon_state = "salpen"
list_reagents = list(/datum/reagent/medicine/dexalin = 10)
/obj/item/reagent_containers/hypospray/medipen/dylovene
name = "dylovene autoinjector"
desc = "An autoinjector containing dylovene, used to heal toxin damage quickly."
icon_state = "salpen"
inhand_icon_state = "salpen"
base_icon_state = "salpen"
list_reagents = list(/datum/reagent/medicine/dylovene = 10)
/obj/item/reagent_containers/hypospray/medipen/tuberculosiscure
name = "BVAK autoinjector"
desc = "Bio Virus Antidote Kit autoinjector. Has a two use system for yourself, and someone else. Inject when infected."
icon_state = "tbpen"
inhand_icon_state = "tbpen"
base_icon_state = "tbpen"
volume = 20
amount_per_transfer_from_this = 10
list_reagents = list(/datum/reagent/vaccine/fungal_tb = 20)
/obj/item/reagent_containers/hypospray/medipen/tuberculosiscure/update_icon_state()
. = ..()
if(reagents.total_volume >= volume)
icon_state = base_icon_state
return
icon_state = "[base_icon_state][(reagents.total_volume > 0) ? 1 : 0]"
/obj/item/reagent_containers/hypospray/medipen/survival
name = "survival emergency autoinjector"
desc = "A medipen for surviving in the harsh environments, heals most common damage sources. WARNING: May cause organ damage."
icon_state = "stimpen"
inhand_icon_state = "stimpen"
base_icon_state = "stimpen"
volume = 30
amount_per_transfer_from_this = 30
list_reagents = list(/datum/reagent/medicine/synaptizine = 4, /datum/reagent/medicine/dermaline = 8, /datum/reagent/medicine/meralyne = 8, /datum/reagent/medicine/leporazine = 6)
/obj/item/reagent_containers/hypospray/medipen/survival/inject(mob/living/affected_mob, mob/user)
if(DOING_INTERACTION(user, DOAFTER_SOURCE_SURVIVALPEN))
to_chat(user,span_notice("You are too busy to use \the [src]!"))
return
to_chat(user,span_notice("You start manually releasing the low-pressure gauge..."))
if(!do_after(user, affected_mob, 10 SECONDS, interaction_key = DOAFTER_SOURCE_SURVIVALPEN))
return
amount_per_transfer_from_this = initial(amount_per_transfer_from_this) * 0.5
return ..()
/obj/item/reagent_containers/hypospray/medipen/survival/luxury
name = "luxury autoinjector"
desc = "Cutting edge technology allowed humanity to compact 50u of volume into a single medipen. Contains rare and powerful chemicals used to aid in exploration of very hard enviroments."
icon_state = "luxpen"
inhand_icon_state = "atropen"
base_icon_state = "luxpen"
volume = 50
amount_per_transfer_from_this = 50
list_reagents = list(/datum/reagent/medicine/dexalin = 10, /datum/reagent/medicine/meralyne = 10, /datum/reagent/medicine/dermaline = 10, /datum/reagent/medicine/tricordrazine = 10 ,/datum/reagent/medicine/leporazine = 10)
/obj/item/reagent_containers/hypospray/medipen/atropine
name = "atropine autoinjector"
desc = "A rapid way to save a person from a critical injury state!"
icon_state = "atropen"
inhand_icon_state = "atropen"
base_icon_state = "atropen"
list_reagents = list(/datum/reagent/medicine/atropine = 10)
/obj/item/reagent_containers/hypospray/medipen/pumpup
name = "maintenance pump-up"
desc = "A ghetto looking autoinjector filled with a cheap adrenaline shot... Great for shrugging off the effects of stunbatons."
volume = 15
amount_per_transfer_from_this = 15
list_reagents = list(/datum/reagent/drug/pumpup = 15)
icon_state = "maintenance"
base_icon_state = "maintenance"
/obj/item/reagent_containers/hypospray/medipen/ekit
name = "emergency first-aid autoinjector"
desc = "An epinephrine medipen with extra coagulant and antibiotics to help stabilize bad cuts and burns."
icon_state = "firstaid"
base_icon_state = "firstaid"
volume = 15
amount_per_transfer_from_this = 15
list_reagents = list(/datum/reagent/medicine/epinephrine = 12, /datum/reagent/medicine/coagulant = 2.5, /datum/reagent/medicine/spaceacillin = 0.5)
/obj/item/reagent_containers/hypospray/medipen/blood_loss
name = "hypovolemic-response autoinjector"
desc = "A medipen designed to stabilize and rapidly reverse severe bloodloss."
icon_state = "hypovolemic"
base_icon_state = "hypovolemic"
volume = 15
amount_per_transfer_from_this = 15
list_reagents = list(/datum/reagent/medicine/epinephrine = 5, /datum/reagent/medicine/coagulant = 2.5, /datum/reagent/iron = 3.5, /datum/reagent/medicine/saline_glucose = 4)