Files
S.P.L.U.R.T-Station-13/code/modules/reagents/reagent_containers/hypospray.dm
2023-07-19 20:51:25 -03:00

584 lines
23 KiB
Plaintext

/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'
item_state = "hypo"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
icon_state = "hypo"
amount_per_transfer_from_this = 5
volume = 30
possible_transfer_amounts = list()
resistance_flags = ACID_PROOF
reagent_flags = OPENCONTAINER
slot_flags = ITEM_SLOT_BELT
var/ignore_flags = 0
var/infinite = FALSE
/obj/item/reagent_containers/hypospray/Initialize(mapload, vol)
. = ..()
register_item_context()
/obj/item/reagent_containers/add_item_context(obj/item/source, list/context, atom/target, mob/living/user)
. = ..()
if(iscarbon(target))
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Inject")
return CONTEXTUAL_SCREENTIP_SET
/obj/item/reagent_containers/hypospray/attack_paw(mob/user)
return attack_hand(user)
/obj/item/reagent_containers/hypospray/attack(mob/living/M, mob/user)
if(!reagents.total_volume)
to_chat(user, "<span class='warning'>[src] is empty!</span>")
return
if(!iscarbon(M))
return
//Always log attemped injects for admins
var/list/injected = list()
for(var/datum/reagent/R in reagents.reagent_list)
injected += R.name
var/contained = english_list(injected)
log_combat(user, M, "attempted to inject", src, "([contained])")
if(reagents.total_volume && (ignore_flags || M.can_inject(user, 1))) // 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>")
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
reagents.reaction(M, INJECT, fraction)
if(M.reagents)
var/trans = 0
if(!infinite)
trans = reagents.trans_to(M, amount_per_transfer_from_this, log = "hypospray injection")
else
trans = reagents.copy_to(M, amount_per_transfer_from_this)
to_chat(user, "<span class='notice'>[trans] unit\s injected. [reagents.total_volume] unit\s remaining in [src].</span>")
log_combat(user, M, "injected", src, "([contained])")
/obj/item/reagent_containers/hypospray/CMO
list_reagents = list(/datum/reagent/medicine/omnizine = 30)
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
/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 and get people back in the fight."
amount_per_transfer_from_this = 10
item_state = "combat_hypo"
icon_state = "combat_hypo"
volume = 100
ignore_flags = 1 // So they can heal their comrades.
list_reagents = list(/datum/reagent/medicine/epinephrine = 30, /datum/reagent/medicine/lesser_syndicate_nanites = 40, /datum/reagent/medicine/leporazine = 15, /datum/reagent/medicine/atropine = 15)
/obj/item/reagent_containers/hypospray/combat/omnizine // owned idiot
desc = "A modified air-needle autoinjector, used by underfunded support operatives to slowly heal injuries in combat and limp away from a fight."
volume = 90
list_reagents = list(/datum/reagent/medicine/epinephrine = 30, /datum/reagent/medicine/omnizine = 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."
item_state = "nanite_hypo"
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()
if(reagents.total_volume > 0)
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]0"
/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."
item_state = "holy_hypo"
icon_state = "holy_hypo"
volume = 250
list_reagents = list(/datum/reagent/water/holywater = 150, /datum/reagent/peaceborg_tire = 50, /datum/reagent/peaceborg_confuse = 50)
amount_per_transfer_from_this = 50
//MediPens
/obj/item/reagent_containers/hypospray/medipen
name = "epinephrine medipen"
desc = "A rapid and safe way to stabilize patients in critical condition for personnel without advanced medical knowledge. Contains a powerful preservative that can delay decomposition when applied to a dead body."
icon_state = "medipen"
item_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 hardsuits
reagent_flags = DRAWABLE
flags_1 = null
list_reagents = list(/datum/reagent/medicine/epinephrine = 10, /datum/reagent/preservahyde = 3, /datum/reagent/medicine/coagulant = 2)
custom_premium_price = PRICE_ALMOST_EXPENSIVE
/obj/item/reagent_containers/hypospray/medipen/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins to choke on \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return OXYLOSS//ironic. he could save others from oxyloss, but not himself.
/obj/item/reagent_containers/hypospray/medipen/attack(mob/M, mob/user)
if(!reagents.total_volume)
to_chat(user, "<span class='warning'>[src] is empty!</span>")
return
..()
if(!iscyborg(user))
reagents.maximum_volume = 0 //Makes them useless afterwards
reagent_flags = NONE
update_icon()
addtimer(CALLBACK(src, .proc/cyborg_recharge, user), 80)
/obj/item/reagent_containers/hypospray/medipen/proc/cyborg_recharge(mob/living/silicon/robot/user)
if(!reagents.total_volume && iscyborg(user))
var/mob/living/silicon/robot/R = user
if(R.cell.use(100))
reagents.add_reagent_list(list_reagents)
update_icon()
/obj/item/reagent_containers/hypospray/medipen/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/medipen/examine()
. = ..()
if(reagents && reagents.reagent_list.len)
. += "<span class='notice'>It is currently loaded.</span>"
else
. += "<span class='notice'>It is spent.</span>"
/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 = "healthpen"
item_state = "healthpen"
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"
item_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/salglu_solution = 4)
/obj/item/reagent_containers/hypospray/medipen/stimulants
name = "stimpack medipen"
desc = "Contains stimulants."
icon_state = "syndipen"
item_state = "syndipen"
volume = 50
amount_per_transfer_from_this = 50
list_reagents = list(/datum/reagent/medicine/stimulants = 50)
/obj/item/reagent_containers/hypospray/medipen/stimulants/baseball
name = "the reason the syndicate major league team wins"
desc = "They say drugs never win, but look where you are now, then where they are."
icon_state = "baseballstim"
volume = 50
amount_per_transfer_from_this = 50
list_reagents = list(/datum/reagent/medicine/stimulants = 50)
/obj/item/reagent_containers/hypospray/medipen/stimpack //goliath kiting
name = "stimpack medipen"
desc = "A rapid way to stimulate your body's adrenaline, allowing for freer movement in restrictive armor."
icon_state = "stimpen"
item_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/medicine/stimulants = 10, /datum/reagent/medicine/omnizine = 10)
/obj/item/reagent_containers/hypospray/medipen/morphine
name = "morphine medipen"
desc = "A rapid way to get you out of a tight situation and fast! You'll feel rather drowsy, though."
icon_state = "morphen"
item_state = "morphen"
volume = 10
amount_per_transfer_from_this = 10
list_reagents = list(/datum/reagent/medicine/morphine = 10)
/obj/item/reagent_containers/hypospray/medipen/penacid
name = "pentetic acid medipen"
desc = "A autoinjector containing pentetic acid, used to reduce high levels of radiations and moderate toxins."
icon_state = "penacid"
item_state = "penacid"
volume = 10
amount_per_transfer_from_this = 10
list_reagents = list(/datum/reagent/medicine/pen_acid = 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"
item_state = "atropen"
volume = 10
amount_per_transfer_from_this = 10
list_reagents = list(/datum/reagent/medicine/atropine = 10)
/obj/item/reagent_containers/hypospray/medipen/salacid
name = "salicyclic acid medipen"
desc = "A autoinjector containing salicyclic acid, used to treat severe brute damage."
icon_state = "salacid"
item_state = "salacid"
volume = 10
amount_per_transfer_from_this = 10
list_reagents = list(/datum/reagent/medicine/sal_acid = 10)
/obj/item/reagent_containers/hypospray/medipen/oxandrolone
name = "oxandrolone medipen"
desc = "A autoinjector containing oxandrolone, used to treat severe burns."
icon_state = "oxapen"
item_state = "oxapen"
volume = 10
amount_per_transfer_from_this = 10
list_reagents = list(/datum/reagent/medicine/oxandrolone = 10)
/obj/item/reagent_containers/hypospray/medipen/salbutamol
name = "salbutamol medipen"
desc = "A autoinjector containing salbutamol, used to heal oxygen damage quickly."
icon_state = "salpen"
item_state = "salpen"
volume = 10
amount_per_transfer_from_this = 10
list_reagents = list(/datum/reagent/medicine/salbutamol = 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"
item_state = "tbpen"
volume = 60
amount_per_transfer_from_this = 30
list_reagents = list(/datum/reagent/medicine/atropine = 10, /datum/reagent/medicine/epinephrine = 10, /datum/reagent/medicine/salbutamol = 20, /datum/reagent/medicine/spaceacillin = 20)
/obj/item/reagent_containers/hypospray/medipen/tuberculosiscure/update_icon()
if(reagents.total_volume > 30)
icon_state = initial(icon_state)
else if (reagents.total_volume > 0)
icon_state = "[initial(icon_state)]1"
else
icon_state = "[initial(icon_state)]0"
/obj/item/reagent_containers/hypospray/medipen/survival
name = "survival medipen"
desc = "A medipen for surviving in the harshest of environments, heals and protects from environmental hazards. WARNING: Do not inject more than one pen in quick succession."
icon_state = "minepen"
item_state = "minepen"
volume = 52
amount_per_transfer_from_this = 52
list_reagents = list(/datum/reagent/medicine/salbutamol = 10, /datum/reagent/medicine/leporazine = 15, /datum/reagent/medicine/neo_jelly = 15, /datum/reagent/medicine/epinephrine = 10, /datum/reagent/medicine/lavaland_extract = 2)
/obj/item/reagent_containers/hypospray/medipen/firelocker
name = "fire treatment medipen"
desc = "A medipen that has been fulled with burn healing chemicals for personnel without advanced medical knowledge."
icon_state = "firepen"
item_state = "firepen"
volume = 15
amount_per_transfer_from_this = 15
list_reagents = list(/datum/reagent/medicine/oxandrolone = 5, /datum/reagent/medicine/kelotane = 10)
/obj/item/reagent_containers/hypospray/medipen/magillitis
name = "experimental autoinjector"
desc = "A custom-frame needle injector with a small single-use reservoir, containing an experimental serum. Unlike the more common medipen frame, it cannot pierce through protective armor or hardsuits, nor can the chemical inside be extracted."
icon_state = "gorillapen"
item_state = "gorillapen"
volume = 5
ignore_flags = 0
reagent_flags = NONE
list_reagents = list(/datum/reagent/magillitis = 5)
#define HYPO_SPRAY 0
#define HYPO_INJECT 1
#define WAIT_SPRAY 25
#define WAIT_INJECT 25
#define SELF_SPRAY 15
#define SELF_INJECT 15
#define DELUXE_WAIT_SPRAY 20
#define DELUXE_WAIT_INJECT 20
#define DELUXE_SELF_SPRAY 10
#define DELUXE_SELF_INJECT 10
#define COMBAT_WAIT_SPRAY 15
#define COMBAT_WAIT_INJECT 15
#define COMBAT_SELF_SPRAY 0
#define COMBAT_SELF_INJECT 0
//A vial-loaded hypospray. Cartridge-based!
/obj/item/hypospray/mkii
name = "hypospray mk.II"
icon_state = "hypo2"
icon = 'icons/obj/syringe.dmi'
desc = "A new development from DeForest Medical, this hypospray takes 30-unit vials as the drug supply for easy swapping."
w_class = WEIGHT_CLASS_TINY
var/list/allowed_containers = list(/obj/item/reagent_containers/glass/bottle/vial/tiny, /obj/item/reagent_containers/glass/bottle/vial/small)
var/mode = HYPO_INJECT
var/obj/item/reagent_containers/glass/bottle/vial/vial
var/start_vial = /obj/item/reagent_containers/glass/bottle/vial/small
var/spawnwithvial = TRUE
var/inject_wait = WAIT_INJECT
var/spray_wait = WAIT_SPRAY
var/spray_self = SELF_SPRAY
var/inject_self = SELF_INJECT
var/quickload = FALSE
var/penetrates = FALSE
/obj/item/hypospray/mkii/brute
start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/bicaridine
/obj/item/hypospray/mkii/toxin
start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/antitoxin
/obj/item/hypospray/mkii/oxygen
start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/dexalin
/obj/item/hypospray/mkii/burn
start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/kelotane
/obj/item/hypospray/mkii/tricord
start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/tricord
/obj/item/hypospray/mkii/enlarge
spawnwithvial = FALSE
/obj/item/hypospray/mkii/CMO
name = "hypospray mk.II deluxe"
allowed_containers = list(/obj/item/reagent_containers/glass/bottle/vial/tiny, /obj/item/reagent_containers/glass/bottle/vial/small, /obj/item/reagent_containers/glass/bottle/vial/large)
icon_state = "cmo2"
desc = "The Deluxe Hypospray can take larger-size vials. It also acts faster and delivers more reagents per spray."
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
start_vial = /obj/item/reagent_containers/glass/bottle/vial/large/CMO
inject_wait = DELUXE_WAIT_INJECT
spray_wait = DELUXE_WAIT_SPRAY
spray_self = DELUXE_SELF_SPRAY
inject_self = DELUXE_SELF_INJECT
/obj/item/hypospray/mkii/CMO/combat
name = "combat hypospray mk.II"
desc = "A combat-ready deluxe hypospray that acts almost instantly. It can be tactically reloaded by using a vial on it."
icon_state = "combat2"
start_vial = /obj/item/reagent_containers/glass/bottle/vial/large/combat
inject_wait = COMBAT_WAIT_INJECT
spray_wait = COMBAT_WAIT_SPRAY
spray_self = COMBAT_SELF_SPRAY
inject_self = COMBAT_SELF_INJECT
quickload = TRUE
penetrates = TRUE
/obj/item/hypospray/mkii/Initialize(mapload)
. = ..()
if(!spawnwithvial)
update_icon()
return
if(start_vial)
vial = new start_vial
update_icon()
register_context()
register_item_context()
/obj/item/hypospray/mkii/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
// Did you know that clicking something while you're holding it is the same as attack_self()?
if(vial && (held_item == src))
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Remove [vial]")
LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Set to [mode ? "spray" : "inject"]")
LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, "Set transfer amount")
return CONTEXTUAL_SCREENTIP_SET
/obj/item/hypospray/mkii/add_item_context(obj/item/source, list/context, atom/target, mob/living/user)
. = ..()
if(iscarbon(target))
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, mode ? "Inject" : "Spray")
return CONTEXTUAL_SCREENTIP_SET
/obj/item/hypospray/mkii/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/hypospray/mkii/update_icon_state()
icon_state = "[initial(icon_state)][vial ? "" : "-e"]"
/obj/item/hypospray/mkii/examine(mob/user)
. = ..()
if(vial)
. += "[vial] has [vial.reagents.total_volume]u remaining."
else
. += "It has no vial loaded in."
. += "[src] is set to [mode ? "Inject" : "Spray"] contents on application."
/obj/item/hypospray/mkii/proc/unload_hypo(obj/item/I, mob/user)
if((istype(I, /obj/item/reagent_containers/glass/bottle/vial)))
var/obj/item/reagent_containers/glass/bottle/vial/V = I
V.forceMove(user.loc)
user.put_in_hands(V)
to_chat(user, "<span class='notice'>You remove [vial] from [src].</span>")
vial = null
update_icon()
playsound(loc, 'sound/weapons/empty.ogg', 50, 1)
else
to_chat(user, "<span class='notice'>This hypo isn't loaded!</span>")
return
/obj/item/hypospray/mkii/attackby(obj/item/I, mob/living/user)
if((istype(I, /obj/item/reagent_containers/glass/bottle/vial) && vial != null))
if(!quickload)
to_chat(user, "<span class='warning'>[src] can not hold more than one vial!</span>")
return FALSE
unload_hypo(vial, user)
if((istype(I, /obj/item/reagent_containers/glass/bottle/vial)))
var/obj/item/reagent_containers/glass/bottle/vial/V = I
if(!is_type_in_list(V, allowed_containers))
to_chat(user, "<span class='notice'>[src] doesn't accept this type of vial.</span>")
return FALSE
if(!user.transferItemToLoc(V,src))
return FALSE
vial = V
user.visible_message("<span class='notice'>[user] has loaded a vial into [src].</span>","<span class='notice'>You have loaded [vial] into [src].</span>")
update_icon()
playsound(loc, 'sound/weapons/autoguninsert.ogg', 35, 1)
return TRUE
else
to_chat(user, "<span class='notice'>This doesn't fit in [src].</span>")
return FALSE
/obj/item/hypospray/mkii/AltClick(mob/user)
. = ..()
if(vial)
vial.attack_self(user)
return TRUE
// Gunna allow this for now, still really don't approve - Pooj
/obj/item/hypospray/mkii/emag_act(mob/user)
. = ..()
if(obj_flags & EMAGGED)
to_chat(user, "[src] happens to be already overcharged.")
return
inject_wait = COMBAT_WAIT_INJECT
spray_wait = COMBAT_WAIT_SPRAY
spray_self = COMBAT_SELF_INJECT
inject_self = COMBAT_SELF_SPRAY
penetrates = TRUE
to_chat(user, "You overcharge [src]'s control circuit.")
obj_flags |= EMAGGED
return TRUE
/obj/item/hypospray/mkii/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
. = ..() //Don't bother changing this or removing it from containers will break.
/obj/item/hypospray/mkii/attack(obj/item/I, mob/user, params)
return
/obj/item/hypospray/mkii/afterattack(atom/target, mob/user, proximity)
. = ..()
INVOKE_ASYNC(src, .proc/attempt_inject, target, user, proximity)
/obj/item/hypospray/mkii/proc/attempt_inject(atom/target, mob/user, proximity)
if(!vial || !proximity || !isliving(target))
return
var/mob/living/L = target
if(!L.reagents || !L.can_inject(user, TRUE, user.zone_selected, penetrates))
return
if(iscarbon(L))
var/obj/item/bodypart/affecting = L.get_bodypart(check_zone(user.zone_selected))
if(!affecting)
to_chat(user, "<span class='warning'>The limb is missing!</span>")
return
if(!affecting.is_organic_limb())
to_chat(user, "<span class='notice'>Medicine won't work on a robotic limb!</span>")
return
else if(!affecting.is_organic_limb(FALSE) && mode != HYPO_INJECT)
to_chat(user, "<span class='notice'>Biomechanical limbs can only be treated via their integrated injection port, not via spraying!</span>")
return
//Always log attemped injections for admins
var/contained = vial.reagents.log_list()
log_combat(user, L, "attemped to inject", src, addition="which had [contained]")
if(!vial)
to_chat(user, "<span class='notice'>[src] doesn't have any vial installed!</span>")
return
if(!vial.reagents.total_volume)
to_chat(user, "<span class='notice'>[src]'s vial is empty!</span>")
return
var/fp_verb = mode == HYPO_SPRAY ? "spray" : "inject"
var/method = mode == HYPO_SPRAY ? PATCH : INJECT //Medsprays use patch when spraying, feels like an inconsistancy here.
if(L != user)
L.visible_message("<span class='danger'>[user] is trying to [fp_verb] [L] with [src]!</span>", \
"<span class='userdanger'>[user] is trying to [fp_verb] you with [src]!</span>")
if(!do_mob(user, L, inject_wait, extra_checks = CALLBACK(L, /mob/living/proc/can_inject, user, FALSE, user.zone_selected, penetrates)))
return
if(!vial.reagents.total_volume)
return
log_attack("<font color='red'>[user.name] ([user.ckey]) applied [src] to [L.name] ([L.ckey]), which had [contained] (INTENT: [uppertext(user.a_intent)]) (MODE: [mode])</font>")
if(L != user)
L.visible_message("<span class='danger'>[user] uses the [src] on [L]!</span>", \
"<span class='userdanger'>[user] uses the [src] on you!</span>")
else
L.log_message("<font color='orange'>applied [src] to themselves ([contained]).</font>", INDIVIDUAL_ATTACK_LOG)
var/fraction = min(vial.amount_per_transfer_from_this/vial.reagents.total_volume, 1)
vial.reagents.reaction(L, method, fraction)
vial.reagents.trans_to(target, vial.amount_per_transfer_from_this, log = "hypospray fill")
var/long_sound = vial.amount_per_transfer_from_this >= 15
playsound(loc, long_sound ? 'sound/items/hypospray_long.ogg' : pick('sound/items/hypospray.ogg','sound/items/hypospray2.ogg'), 50, 1, -1)
to_chat(user, "<span class='notice'>You [fp_verb] [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units.</span>")
/obj/item/hypospray/mkii/attack_self(mob/living/user)
if(user)
if(user.incapacitated())
return
else if(!vial)
to_chat(user, "This Hypo needs to be loaded first!")
return
else
unload_hypo(vial,user)
/obj/item/hypospray/mkii/CtrlClick(mob/living/user)
. = ..()
if(user.canUseTopic(src, FALSE) && user.get_active_held_item(src))
switch(mode)
if(HYPO_SPRAY)
mode = HYPO_INJECT
to_chat(user, "[src] is now set to inject contents on application.")
if(HYPO_INJECT)
mode = HYPO_SPRAY
to_chat(user, "[src] is now set to spray contents on application.")
return TRUE
/obj/item/hypospray/mkii/examine(mob/user)
. = ..()
. += "<span class='notice'><b>Ctrl-Click</b> it to toggle its mode from spraying to injecting and vice versa.</span>"
#undef HYPO_SPRAY
#undef HYPO_INJECT
#undef WAIT_SPRAY
#undef WAIT_INJECT
#undef SELF_SPRAY
#undef SELF_INJECT
#undef DELUXE_WAIT_SPRAY
#undef DELUXE_WAIT_INJECT
#undef DELUXE_SELF_SPRAY
#undef DELUXE_SELF_INJECT
#undef COMBAT_WAIT_SPRAY
#undef COMBAT_WAIT_INJECT
#undef COMBAT_SELF_SPRAY
#undef COMBAT_SELF_INJECT