@@ -1,235 +1,235 @@
|
||||
/*
|
||||
Contains:
|
||||
Borg Hypospray
|
||||
Borg Shaker
|
||||
Nothing to do with hydroponics in here. Sorry to dissapoint you.
|
||||
*/
|
||||
|
||||
/*
|
||||
Borg Hypospray
|
||||
*/
|
||||
/obj/item/weapon/reagent_containers/borghypo
|
||||
name = "cyborg hypospray"
|
||||
desc = "An advanced chemical synthesizer and injection system, designed for heavy-duty medical equipment."
|
||||
icon = 'icons/obj/syringe.dmi'
|
||||
item_state = "hypo"
|
||||
icon_state = "borghypo"
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 30
|
||||
possible_transfer_amounts = list()
|
||||
var/mode = 1
|
||||
var/charge_cost = 50
|
||||
var/charge_tick = 0
|
||||
var/recharge_time = 5 //Time it takes for shots to recharge (in seconds)
|
||||
var/bypass_protection = 0 //If the hypospray can go through armor or thick material
|
||||
|
||||
var/list/datum/reagents/reagent_list = list()
|
||||
var/list/reagent_ids = list("dexalin", "kelotane", "bicaridine", "antitoxin", "epinephrine", "spaceacillin", "salglu_solution")
|
||||
var/accepts_reagent_upgrades = TRUE //If upgrades can increase number of reagents dispensed.
|
||||
var/list/modes = list() //Basically the inverse of reagent_ids. Instead of having numbers as "keys" and strings as values it has strings as keys and numbers as values.
|
||||
//Used as list for input() in shakers.
|
||||
|
||||
|
||||
/*
|
||||
Contains:
|
||||
Borg Hypospray
|
||||
Borg Shaker
|
||||
Nothing to do with hydroponics in here. Sorry to dissapoint you.
|
||||
*/
|
||||
|
||||
/*
|
||||
Borg Hypospray
|
||||
*/
|
||||
/obj/item/weapon/reagent_containers/borghypo
|
||||
name = "cyborg hypospray"
|
||||
desc = "An advanced chemical synthesizer and injection system, designed for heavy-duty medical equipment."
|
||||
icon = 'icons/obj/syringe.dmi'
|
||||
item_state = "hypo"
|
||||
icon_state = "borghypo"
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 30
|
||||
possible_transfer_amounts = list()
|
||||
var/mode = 1
|
||||
var/charge_cost = 50
|
||||
var/charge_tick = 0
|
||||
var/recharge_time = 5 //Time it takes for shots to recharge (in seconds)
|
||||
var/bypass_protection = 0 //If the hypospray can go through armor or thick material
|
||||
|
||||
var/list/datum/reagents/reagent_list = list()
|
||||
var/list/reagent_ids = list("dexalin", "kelotane", "bicaridine", "antitoxin", "epinephrine", "spaceacillin", "salglu_solution")
|
||||
var/accepts_reagent_upgrades = TRUE //If upgrades can increase number of reagents dispensed.
|
||||
var/list/modes = list() //Basically the inverse of reagent_ids. Instead of having numbers as "keys" and strings as values it has strings as keys and numbers as values.
|
||||
//Used as list for input() in shakers.
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/Initialize()
|
||||
. = ..()
|
||||
|
||||
for(var/R in reagent_ids)
|
||||
add_reagent(R)
|
||||
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg
|
||||
charge_tick++
|
||||
if(charge_tick >= recharge_time)
|
||||
regenerate_reagents()
|
||||
charge_tick = 0
|
||||
|
||||
//update_icon()
|
||||
return 1
|
||||
|
||||
// Purely for testing purposes I swear~ //don't lie to me
|
||||
/*
|
||||
/obj/item/weapon/reagent_containers/borghypo/verb/add_cyanide()
|
||||
set src in world
|
||||
add_reagent("cyanide")
|
||||
*/
|
||||
|
||||
|
||||
// Use this to add more chemicals for the borghypo to produce.
|
||||
/obj/item/weapon/reagent_containers/borghypo/proc/add_reagent(reagent)
|
||||
reagent_ids |= reagent
|
||||
var/datum/reagents/RG = new(30)
|
||||
RG.my_atom = src
|
||||
reagent_list += RG
|
||||
|
||||
var/datum/reagents/R = reagent_list[reagent_list.len]
|
||||
R.add_reagent(reagent, 30)
|
||||
|
||||
modes[reagent] = modes.len + 1
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/proc/regenerate_reagents()
|
||||
if(iscyborg(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
for(var/i in 1 to reagent_ids.len)
|
||||
var/datum/reagents/RG = reagent_list[i]
|
||||
if(RG.total_volume < RG.maximum_volume) //Don't recharge reagents and drain power if the storage is full.
|
||||
R.cell.use(charge_cost) //Take power from borg...
|
||||
RG.add_reagent(reagent_ids[i], 5) //And fill hypo with reagent.
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/attack(mob/living/carbon/M, mob/user)
|
||||
var/datum/reagents/R = reagent_list[mode]
|
||||
if(!R.total_volume)
|
||||
to_chat(user, "<span class='notice'>The injector is empty.</span>")
|
||||
return
|
||||
if(!istype(M))
|
||||
return
|
||||
if(R.total_volume && M.can_inject(user, 1, user.zone_selected,bypass_protection))
|
||||
to_chat(M, "<span class='warning'>You feel a tiny prick!</span>")
|
||||
to_chat(user, "<span class='notice'>You inject [M] with the injector.</span>")
|
||||
var/fraction = min(amount_per_transfer_from_this/R.total_volume, 1)
|
||||
R.reaction(M, INJECT, fraction)
|
||||
if(M.reagents)
|
||||
var/trans = R.trans_to(M, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>[trans] unit\s injected. [R.total_volume] unit\s remaining.</span>")
|
||||
|
||||
var/list/injected = list()
|
||||
for(var/datum/reagent/RG in R.reagent_list)
|
||||
injected += RG.name
|
||||
add_logs(user, M, "injected", src, "(CHEMICALS: [english_list(injected)])")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/attack_self(mob/user)
|
||||
var/chosen_reagent = modes[input(user, "What reagent do you want to dispense?") as null|anything in reagent_ids]
|
||||
if(!chosen_reagent)
|
||||
return
|
||||
mode = chosen_reagent
|
||||
playsound(loc, 'sound/effects/pop.ogg', 50, 0)
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_ids[mode]]
|
||||
to_chat(user, "<span class='notice'>[src] is now dispensing '[R.name]'.</span>")
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/examine(mob/user)
|
||||
usr = user
|
||||
..()
|
||||
DescribeContents() //Because using the standardized reagents datum was just too cool for whatever fuckwit wrote this
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/proc/DescribeContents()
|
||||
var/empty = 1
|
||||
|
||||
for(var/datum/reagents/RS in reagent_list)
|
||||
var/datum/reagent/R = locate() in RS.reagent_list
|
||||
if(R)
|
||||
to_chat(usr, "<span class='notice'>It currently has [R.volume] unit\s of [R.name] stored.</span>")
|
||||
empty = 0
|
||||
|
||||
if(empty)
|
||||
to_chat(usr, "<span class='warning'>It is currently empty! Allow some time for the internal syntheszier to produce more.</span>")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/hacked
|
||||
icon_state = "borghypo_s"
|
||||
reagent_ids = list ("facid", "mutetoxin", "cyanide", "sodium_thiopental", "heparin", "lexorin")
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/syndicate
|
||||
name = "syndicate cyborg hypospray"
|
||||
desc = "An experimental piece of Syndicate technology used to produce powerful restorative nanites used to very quickly restore injuries of all types. Also metabolizes potassium iodide, for radiation poisoning, and morphine, for offense."
|
||||
icon_state = "borghypo_s"
|
||||
charge_cost = 20
|
||||
recharge_time = 2
|
||||
reagent_ids = list("syndicate_nanites", "potass_iodide", "morphine")
|
||||
bypass_protection = 1
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
/*
|
||||
Borg Shaker
|
||||
*/
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker
|
||||
name = "cyborg shaker"
|
||||
desc = "An advanced drink synthesizer and mixer."
|
||||
icon = 'icons/obj/drinks.dmi'
|
||||
icon_state = "shaker"
|
||||
possible_transfer_amounts = list(5,10,20)
|
||||
charge_cost = 20 //Lots of reagents all regenerating at once, so the charge cost is lower. They also regenerate faster.
|
||||
recharge_time = 3
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
reagent_ids = list("beer", "orangejuice", "limejuice", "tomatojuice", "cola", "tonic", "sodawater", "ice", "cream", "whiskey", "vodka", "rum", "gin", "tequila", "vermouth", "wine", "kahlua", "cognac", "ale")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker/attack(mob/M, mob/user)
|
||||
return //Can't inject stuff with a shaker, can we? //not with that attitude
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker/regenerate_reagents()
|
||||
if(iscyborg(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
for(var/i in modes) //Lots of reagents in this one, so it's best to regenrate them all at once to keep it from being tedious.
|
||||
var/valueofi = modes[i]
|
||||
var/datum/reagents/RG = reagent_list[valueofi]
|
||||
if(RG.total_volume < RG.maximum_volume)
|
||||
R.cell.use(charge_cost)
|
||||
RG.add_reagent(reagent_ids[valueofi], 5)
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker/afterattack(obj/target, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
|
||||
else if(target.is_open_container() && target.reagents)
|
||||
var/datum/reagents/R = reagent_list[mode]
|
||||
if(!R.total_volume)
|
||||
to_chat(user, "<span class='warning'>[src] is currently out of this ingredient! Please allow some time for the synthesizer to produce more.</span>")
|
||||
return
|
||||
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = R.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution to [target].</span>")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker/DescribeContents()
|
||||
var/empty = 1
|
||||
|
||||
var/datum/reagents/RS = reagent_list[mode]
|
||||
var/datum/reagent/R = locate() in RS.reagent_list
|
||||
if(R)
|
||||
to_chat(usr, "<span class='notice'>It currently has [R.volume] unit\s of [R.name] stored.</span>")
|
||||
empty = 0
|
||||
|
||||
if(empty)
|
||||
to_chat(usr, "<span class='warning'>It is currently empty! Please allow some time for the synthesizer to produce more.</span>")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker/hacked
|
||||
..()
|
||||
name = "cyborg shaker"
|
||||
desc = "Will mix drinks that knock them dead."
|
||||
icon = 'icons/obj/drinks.dmi'
|
||||
icon_state = "threemileislandglass"
|
||||
possible_transfer_amounts = list(5,10,20)
|
||||
charge_cost = 20 //Lots of reagents all regenerating at once, so the charge cost is lower. They also regenerate faster.
|
||||
recharge_time = 3
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
reagent_ids = list("beer2")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/peace
|
||||
name = "Peace Hypospray"
|
||||
|
||||
reagent_ids = list("dizzysolution","tiresolution")
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/peace/hacked
|
||||
desc = "Everything's peaceful in death!"
|
||||
icon_state = "borghypo_s"
|
||||
reagent_ids = list("dizzysolution","tiresolution","tirizene","sulfonal","sodium_thiopental","cyanide","neurotoxin2")
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/epi
|
||||
name = "epinephrine injector"
|
||||
desc = "An advanced chemical synthesizer and injection system, designed to stabilize patients.."
|
||||
reagent_ids = list("epinephrine")
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
for(var/R in reagent_ids)
|
||||
add_reagent(R)
|
||||
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg
|
||||
charge_tick++
|
||||
if(charge_tick >= recharge_time)
|
||||
regenerate_reagents()
|
||||
charge_tick = 0
|
||||
|
||||
//update_icon()
|
||||
return 1
|
||||
|
||||
// Purely for testing purposes I swear~ //don't lie to me
|
||||
/*
|
||||
/obj/item/weapon/reagent_containers/borghypo/verb/add_cyanide()
|
||||
set src in world
|
||||
add_reagent("cyanide")
|
||||
*/
|
||||
|
||||
|
||||
// Use this to add more chemicals for the borghypo to produce.
|
||||
/obj/item/weapon/reagent_containers/borghypo/proc/add_reagent(reagent)
|
||||
reagent_ids |= reagent
|
||||
var/datum/reagents/RG = new(30)
|
||||
RG.my_atom = src
|
||||
reagent_list += RG
|
||||
|
||||
var/datum/reagents/R = reagent_list[reagent_list.len]
|
||||
R.add_reagent(reagent, 30)
|
||||
|
||||
modes[reagent] = modes.len + 1
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/proc/regenerate_reagents()
|
||||
if(iscyborg(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
for(var/i in 1 to reagent_ids.len)
|
||||
var/datum/reagents/RG = reagent_list[i]
|
||||
if(RG.total_volume < RG.maximum_volume) //Don't recharge reagents and drain power if the storage is full.
|
||||
R.cell.use(charge_cost) //Take power from borg...
|
||||
RG.add_reagent(reagent_ids[i], 5) //And fill hypo with reagent.
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/attack(mob/living/carbon/M, mob/user)
|
||||
var/datum/reagents/R = reagent_list[mode]
|
||||
if(!R.total_volume)
|
||||
to_chat(user, "<span class='notice'>The injector is empty.</span>")
|
||||
return
|
||||
if(!istype(M))
|
||||
return
|
||||
if(R.total_volume && M.can_inject(user, 1, user.zone_selected,bypass_protection))
|
||||
to_chat(M, "<span class='warning'>You feel a tiny prick!</span>")
|
||||
to_chat(user, "<span class='notice'>You inject [M] with the injector.</span>")
|
||||
var/fraction = min(amount_per_transfer_from_this/R.total_volume, 1)
|
||||
R.reaction(M, INJECT, fraction)
|
||||
if(M.reagents)
|
||||
var/trans = R.trans_to(M, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>[trans] unit\s injected. [R.total_volume] unit\s remaining.</span>")
|
||||
|
||||
var/list/injected = list()
|
||||
for(var/datum/reagent/RG in R.reagent_list)
|
||||
injected += RG.name
|
||||
add_logs(user, M, "injected", src, "(CHEMICALS: [english_list(injected)])")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/attack_self(mob/user)
|
||||
var/chosen_reagent = modes[input(user, "What reagent do you want to dispense?") as null|anything in reagent_ids]
|
||||
if(!chosen_reagent)
|
||||
return
|
||||
mode = chosen_reagent
|
||||
playsound(loc, 'sound/effects/pop.ogg', 50, 0)
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_ids[mode]]
|
||||
to_chat(user, "<span class='notice'>[src] is now dispensing '[R.name]'.</span>")
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/examine(mob/user)
|
||||
usr = user
|
||||
..()
|
||||
DescribeContents() //Because using the standardized reagents datum was just too cool for whatever fuckwit wrote this
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/proc/DescribeContents()
|
||||
var/empty = 1
|
||||
|
||||
for(var/datum/reagents/RS in reagent_list)
|
||||
var/datum/reagent/R = locate() in RS.reagent_list
|
||||
if(R)
|
||||
to_chat(usr, "<span class='notice'>It currently has [R.volume] unit\s of [R.name] stored.</span>")
|
||||
empty = 0
|
||||
|
||||
if(empty)
|
||||
to_chat(usr, "<span class='warning'>It is currently empty! Allow some time for the internal syntheszier to produce more.</span>")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/hacked
|
||||
icon_state = "borghypo_s"
|
||||
reagent_ids = list ("facid", "mutetoxin", "cyanide", "sodium_thiopental", "heparin", "lexorin")
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/syndicate
|
||||
name = "syndicate cyborg hypospray"
|
||||
desc = "An experimental piece of Syndicate technology used to produce powerful restorative nanites used to very quickly restore injuries of all types. Also metabolizes potassium iodide, for radiation poisoning, and morphine, for offense."
|
||||
icon_state = "borghypo_s"
|
||||
charge_cost = 20
|
||||
recharge_time = 2
|
||||
reagent_ids = list("syndicate_nanites", "potass_iodide", "morphine")
|
||||
bypass_protection = 1
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
/*
|
||||
Borg Shaker
|
||||
*/
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker
|
||||
name = "cyborg shaker"
|
||||
desc = "An advanced drink synthesizer and mixer."
|
||||
icon = 'icons/obj/drinks.dmi'
|
||||
icon_state = "shaker"
|
||||
possible_transfer_amounts = list(5,10,20)
|
||||
charge_cost = 20 //Lots of reagents all regenerating at once, so the charge cost is lower. They also regenerate faster.
|
||||
recharge_time = 3
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
reagent_ids = list("beer", "orangejuice", "limejuice", "tomatojuice", "cola", "tonic", "sodawater", "ice", "cream", "whiskey", "vodka", "rum", "gin", "tequila", "vermouth", "wine", "kahlua", "cognac", "ale")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker/attack(mob/M, mob/user)
|
||||
return //Can't inject stuff with a shaker, can we? //not with that attitude
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker/regenerate_reagents()
|
||||
if(iscyborg(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
for(var/i in modes) //Lots of reagents in this one, so it's best to regenrate them all at once to keep it from being tedious.
|
||||
var/valueofi = modes[i]
|
||||
var/datum/reagents/RG = reagent_list[valueofi]
|
||||
if(RG.total_volume < RG.maximum_volume)
|
||||
R.cell.use(charge_cost)
|
||||
RG.add_reagent(reagent_ids[valueofi], 5)
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker/afterattack(obj/target, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
|
||||
else if(target.is_open_container() && target.reagents)
|
||||
var/datum/reagents/R = reagent_list[mode]
|
||||
if(!R.total_volume)
|
||||
to_chat(user, "<span class='warning'>[src] is currently out of this ingredient! Please allow some time for the synthesizer to produce more.</span>")
|
||||
return
|
||||
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = R.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution to [target].</span>")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker/DescribeContents()
|
||||
var/empty = 1
|
||||
|
||||
var/datum/reagents/RS = reagent_list[mode]
|
||||
var/datum/reagent/R = locate() in RS.reagent_list
|
||||
if(R)
|
||||
to_chat(usr, "<span class='notice'>It currently has [R.volume] unit\s of [R.name] stored.</span>")
|
||||
empty = 0
|
||||
|
||||
if(empty)
|
||||
to_chat(usr, "<span class='warning'>It is currently empty! Please allow some time for the synthesizer to produce more.</span>")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/borgshaker/hacked
|
||||
..()
|
||||
name = "cyborg shaker"
|
||||
desc = "Will mix drinks that knock them dead."
|
||||
icon = 'icons/obj/drinks.dmi'
|
||||
icon_state = "threemileislandglass"
|
||||
possible_transfer_amounts = list(5,10,20)
|
||||
charge_cost = 20 //Lots of reagents all regenerating at once, so the charge cost is lower. They also regenerate faster.
|
||||
recharge_time = 3
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
reagent_ids = list("beer2")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/peace
|
||||
name = "Peace Hypospray"
|
||||
|
||||
reagent_ids = list("dizzysolution","tiresolution")
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/peace/hacked
|
||||
desc = "Everything's peaceful in death!"
|
||||
icon_state = "borghypo_s"
|
||||
reagent_ids = list("dizzysolution","tiresolution","tirizene","sulfonal","sodium_thiopental","cyanide","neurotoxin2")
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/epi
|
||||
name = "epinephrine injector"
|
||||
desc = "An advanced chemical synthesizer and injection system, designed to stabilize patients.."
|
||||
reagent_ids = list("epinephrine")
|
||||
accepts_reagent_upgrades = FALSE
|
||||
|
||||
@@ -1,96 +1,96 @@
|
||||
/obj/item/weapon/reagent_containers/dropper
|
||||
name = "dropper"
|
||||
desc = "A dropper. Holds up to 5 units."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "dropper0"
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list(1, 2, 3, 4, 5)
|
||||
volume = 5
|
||||
container_type = TRANSPARENT
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper/afterattack(obj/target, mob/user , proximity)
|
||||
if(!proximity) return
|
||||
if(!target.reagents) return
|
||||
|
||||
if(reagents.total_volume > 0)
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper
|
||||
name = "dropper"
|
||||
desc = "A dropper. Holds up to 5 units."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "dropper0"
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list(1, 2, 3, 4, 5)
|
||||
volume = 5
|
||||
container_type = TRANSPARENT
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper/afterattack(obj/target, mob/user , proximity)
|
||||
if(!proximity) return
|
||||
if(!target.reagents) return
|
||||
|
||||
if(reagents.total_volume > 0)
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
if(!target.is_injectable())
|
||||
to_chat(user, "<span class='warning'>You cannot directly fill [target]!</span>")
|
||||
return
|
||||
|
||||
var/trans = 0
|
||||
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
|
||||
|
||||
if(ismob(target))
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/victim = target
|
||||
|
||||
var/obj/item/safe_thing = null
|
||||
if(victim.wear_mask)
|
||||
if(victim.wear_mask.flags_cover & MASKCOVERSEYES)
|
||||
safe_thing = victim.wear_mask
|
||||
if(victim.head)
|
||||
if(victim.head.flags_cover & MASKCOVERSEYES)
|
||||
safe_thing = victim.head
|
||||
if(victim.glasses)
|
||||
if(!safe_thing)
|
||||
safe_thing = victim.glasses
|
||||
|
||||
if(safe_thing)
|
||||
if(!safe_thing.reagents)
|
||||
safe_thing.create_reagents(100)
|
||||
|
||||
reagents.reaction(safe_thing, TOUCH, fraction)
|
||||
trans = reagents.trans_to(safe_thing, amount_per_transfer_from_this)
|
||||
|
||||
target.visible_message("<span class='danger'>[user] tries to squirt something into [target]'s eyes, but fails!</span>", \
|
||||
"<span class='userdanger'>[user] tries to squirt something into [target]'s eyes, but fails!</span>")
|
||||
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution.</span>")
|
||||
update_icon()
|
||||
return
|
||||
else if(isalien(target)) //hiss-hiss has no eyes!
|
||||
to_chat(target, "<span class='danger'>[target] does not seem to have any eyes!</span>")
|
||||
return
|
||||
|
||||
target.visible_message("<span class='danger'>[user] squirts something into [target]'s eyes!</span>", \
|
||||
"<span class='userdanger'>[user] squirts something into [target]'s eyes!</span>")
|
||||
|
||||
reagents.reaction(target, TOUCH, fraction)
|
||||
var/mob/M = target
|
||||
var/R
|
||||
if(reagents)
|
||||
for(var/datum/reagent/A in src.reagents.reagent_list)
|
||||
R += A.id + " ("
|
||||
R += num2text(A.volume) + "),"
|
||||
add_logs(user, M, "squirted", R)
|
||||
|
||||
trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution.</span>")
|
||||
update_icon()
|
||||
|
||||
else
|
||||
|
||||
to_chat(user, "<span class='warning'>You cannot directly fill [target]!</span>")
|
||||
return
|
||||
|
||||
var/trans = 0
|
||||
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
|
||||
|
||||
if(ismob(target))
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/victim = target
|
||||
|
||||
var/obj/item/safe_thing = null
|
||||
if(victim.wear_mask)
|
||||
if(victim.wear_mask.flags_cover & MASKCOVERSEYES)
|
||||
safe_thing = victim.wear_mask
|
||||
if(victim.head)
|
||||
if(victim.head.flags_cover & MASKCOVERSEYES)
|
||||
safe_thing = victim.head
|
||||
if(victim.glasses)
|
||||
if(!safe_thing)
|
||||
safe_thing = victim.glasses
|
||||
|
||||
if(safe_thing)
|
||||
if(!safe_thing.reagents)
|
||||
safe_thing.create_reagents(100)
|
||||
|
||||
reagents.reaction(safe_thing, TOUCH, fraction)
|
||||
trans = reagents.trans_to(safe_thing, amount_per_transfer_from_this)
|
||||
|
||||
target.visible_message("<span class='danger'>[user] tries to squirt something into [target]'s eyes, but fails!</span>", \
|
||||
"<span class='userdanger'>[user] tries to squirt something into [target]'s eyes, but fails!</span>")
|
||||
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution.</span>")
|
||||
update_icon()
|
||||
return
|
||||
else if(isalien(target)) //hiss-hiss has no eyes!
|
||||
to_chat(target, "<span class='danger'>[target] does not seem to have any eyes!</span>")
|
||||
return
|
||||
|
||||
target.visible_message("<span class='danger'>[user] squirts something into [target]'s eyes!</span>", \
|
||||
"<span class='userdanger'>[user] squirts something into [target]'s eyes!</span>")
|
||||
|
||||
reagents.reaction(target, TOUCH, fraction)
|
||||
var/mob/M = target
|
||||
var/R
|
||||
if(reagents)
|
||||
for(var/datum/reagent/A in src.reagents.reagent_list)
|
||||
R += A.id + " ("
|
||||
R += num2text(A.volume) + "),"
|
||||
add_logs(user, M, "squirted", R)
|
||||
|
||||
trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution.</span>")
|
||||
update_icon()
|
||||
|
||||
else
|
||||
|
||||
if(!target.is_drawable(FALSE)) //No drawing from mobs here
|
||||
to_chat(user, "<span class='notice'>You cannot directly remove reagents from [target].</span>")
|
||||
return
|
||||
|
||||
if(!target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty!</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
||||
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] unit\s of the solution.</span>")
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper/update_icon()
|
||||
cut_overlays()
|
||||
if(reagents.total_volume)
|
||||
to_chat(user, "<span class='notice'>You cannot directly remove reagents from [target].</span>")
|
||||
return
|
||||
|
||||
if(!target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty!</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
||||
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] unit\s of the solution.</span>")
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper/update_icon()
|
||||
cut_overlays()
|
||||
if(reagents.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "dropper")
|
||||
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
add_overlay(filling)
|
||||
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
add_overlay(filling)
|
||||
|
||||
@@ -1,290 +1,290 @@
|
||||
/obj/item/weapon/reagent_containers/glass
|
||||
name = "glass"
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5, 10, 15, 20, 25, 30, 50)
|
||||
volume = 50
|
||||
container_type = OPENCONTAINER
|
||||
spillable = 1
|
||||
resistance_flags = ACID_PROOF
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/attack(mob/M, mob/user, obj/target)
|
||||
if(!canconsume(M, user))
|
||||
return
|
||||
|
||||
if(!spillable)
|
||||
return
|
||||
|
||||
if(!reagents || !reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[src] is empty!</span>")
|
||||
return
|
||||
|
||||
if(istype(M))
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
var/R
|
||||
M.visible_message("<span class='danger'>[user] splashes the contents of [src] onto [M]!</span>", \
|
||||
"<span class='userdanger'>[user] splashes the contents of [src] onto [M]!</span>")
|
||||
if(reagents)
|
||||
for(var/datum/reagent/A in reagents.reagent_list)
|
||||
R += A.id + " ("
|
||||
R += num2text(A.volume) + "),"
|
||||
if(isturf(target) && reagents.reagent_list.len && thrownby)
|
||||
add_logs(thrownby, target, "splashed [english_list(reagents.reagent_list)]", "at [target][COORD(target)]")
|
||||
log_game("[key_name(thrownby)] splashed [english_list(reagents.reagent_list)] at [COORD(target)].")
|
||||
message_admins("[key_name_admin(thrownby)] splashed [english_list(reagents.reagent_list)] at [ADMIN_COORDJMP(target)].")
|
||||
reagents.reaction(M, TOUCH)
|
||||
add_logs(user, M, "splashed", R)
|
||||
reagents.clear_reagents()
|
||||
else
|
||||
if(M != user)
|
||||
M.visible_message("<span class='danger'>[user] attempts to feed something to [M].</span>", \
|
||||
"<span class='userdanger'>[user] attempts to feed something to you.</span>")
|
||||
if(!do_mob(user, M))
|
||||
return
|
||||
if(!reagents || !reagents.total_volume)
|
||||
return // The drink might be empty after the delay, such as by spam-feeding
|
||||
M.visible_message("<span class='danger'>[user] feeds something to [M].</span>", "<span class='userdanger'>[user] feeds something to you.</span>")
|
||||
add_logs(user, M, "fed", reagentlist(src))
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You swallow a gulp of [src].</span>")
|
||||
var/fraction = min(5/reagents.total_volume, 1)
|
||||
reagents.reaction(M, INGEST, fraction)
|
||||
spawn(5)
|
||||
reagents.trans_to(M, 5)
|
||||
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/afterattack(obj/target, mob/user, proximity)
|
||||
if((!proximity) || !check_allowed_items(target,target_self=1)) return
|
||||
|
||||
else if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
|
||||
|
||||
if(target.reagents && !target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty and can't be refilled!</span>")
|
||||
return
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[src] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] unit\s of the contents of [target].</span>")
|
||||
|
||||
else if(target.is_open_container() && target.reagents) //Something like a glass. Player probably wants to transfer TO it.
|
||||
if(!reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[src] is empty!</span>")
|
||||
return
|
||||
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
|
||||
var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution to [target].</span>")
|
||||
|
||||
else if(reagents.total_volume)
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
user.visible_message("<span class='danger'>[user] splashes the contents of [src] onto [target]!</span>", \
|
||||
"<span class='notice'>You splash the contents of [src] onto [target].</span>")
|
||||
reagents.reaction(target, TOUCH)
|
||||
reagents.clear_reagents()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/attackby(obj/item/I, mob/user, params)
|
||||
var/hotness = I.is_hot()
|
||||
if(hotness)
|
||||
var/added_heat = (hotness / 100) //ishot returns a temperature
|
||||
if(reagents)
|
||||
if(reagents.chem_temp < hotness) //can't be heated to be hotter than the source
|
||||
reagents.chem_temp += added_heat
|
||||
to_chat(user, "<span class='notice'>You heat [src] with [I].</span>")
|
||||
reagents.handle_reactions()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is already hotter than [I]!</span>")
|
||||
|
||||
if(istype(I,/obj/item/weapon/reagent_containers/food/snacks/egg)) //breaking eggs
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/egg/E = I
|
||||
if(reagents)
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[src] is full.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You break [E] in [src].</span>")
|
||||
reagents.add_reagent("eggyolk", 5)
|
||||
qdel(E)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker
|
||||
name = "beaker"
|
||||
desc = "A beaker. It can hold up to 50 units."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "beaker"
|
||||
item_state = "beaker"
|
||||
materials = list(MAT_GLASS=500)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass
|
||||
name = "glass"
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5, 10, 15, 20, 25, 30, 50)
|
||||
volume = 50
|
||||
container_type = OPENCONTAINER
|
||||
spillable = 1
|
||||
resistance_flags = ACID_PROOF
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/attack(mob/M, mob/user, obj/target)
|
||||
if(!canconsume(M, user))
|
||||
return
|
||||
|
||||
if(!spillable)
|
||||
return
|
||||
|
||||
if(!reagents || !reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[src] is empty!</span>")
|
||||
return
|
||||
|
||||
if(istype(M))
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
var/R
|
||||
M.visible_message("<span class='danger'>[user] splashes the contents of [src] onto [M]!</span>", \
|
||||
"<span class='userdanger'>[user] splashes the contents of [src] onto [M]!</span>")
|
||||
if(reagents)
|
||||
for(var/datum/reagent/A in reagents.reagent_list)
|
||||
R += A.id + " ("
|
||||
R += num2text(A.volume) + "),"
|
||||
if(isturf(target) && reagents.reagent_list.len && thrownby)
|
||||
add_logs(thrownby, target, "splashed [english_list(reagents.reagent_list)]", "at [target][COORD(target)]")
|
||||
log_game("[key_name(thrownby)] splashed [english_list(reagents.reagent_list)] at [COORD(target)].")
|
||||
message_admins("[key_name_admin(thrownby)] splashed [english_list(reagents.reagent_list)] at [ADMIN_COORDJMP(target)].")
|
||||
reagents.reaction(M, TOUCH)
|
||||
add_logs(user, M, "splashed", R)
|
||||
reagents.clear_reagents()
|
||||
else
|
||||
if(M != user)
|
||||
M.visible_message("<span class='danger'>[user] attempts to feed something to [M].</span>", \
|
||||
"<span class='userdanger'>[user] attempts to feed something to you.</span>")
|
||||
if(!do_mob(user, M))
|
||||
return
|
||||
if(!reagents || !reagents.total_volume)
|
||||
return // The drink might be empty after the delay, such as by spam-feeding
|
||||
M.visible_message("<span class='danger'>[user] feeds something to [M].</span>", "<span class='userdanger'>[user] feeds something to you.</span>")
|
||||
add_logs(user, M, "fed", reagentlist(src))
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You swallow a gulp of [src].</span>")
|
||||
var/fraction = min(5/reagents.total_volume, 1)
|
||||
reagents.reaction(M, INGEST, fraction)
|
||||
spawn(5)
|
||||
reagents.trans_to(M, 5)
|
||||
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/afterattack(obj/target, mob/user, proximity)
|
||||
if((!proximity) || !check_allowed_items(target,target_self=1)) return
|
||||
|
||||
else if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
|
||||
|
||||
if(target.reagents && !target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty and can't be refilled!</span>")
|
||||
return
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[src] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] unit\s of the contents of [target].</span>")
|
||||
|
||||
else if(target.is_open_container() && target.reagents) //Something like a glass. Player probably wants to transfer TO it.
|
||||
if(!reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[src] is empty!</span>")
|
||||
return
|
||||
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
|
||||
var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution to [target].</span>")
|
||||
|
||||
else if(reagents.total_volume)
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
user.visible_message("<span class='danger'>[user] splashes the contents of [src] onto [target]!</span>", \
|
||||
"<span class='notice'>You splash the contents of [src] onto [target].</span>")
|
||||
reagents.reaction(target, TOUCH)
|
||||
reagents.clear_reagents()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/attackby(obj/item/I, mob/user, params)
|
||||
var/hotness = I.is_hot()
|
||||
if(hotness)
|
||||
var/added_heat = (hotness / 100) //ishot returns a temperature
|
||||
if(reagents)
|
||||
if(reagents.chem_temp < hotness) //can't be heated to be hotter than the source
|
||||
reagents.chem_temp += added_heat
|
||||
to_chat(user, "<span class='notice'>You heat [src] with [I].</span>")
|
||||
reagents.handle_reactions()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is already hotter than [I]!</span>")
|
||||
|
||||
if(istype(I,/obj/item/weapon/reagent_containers/food/snacks/egg)) //breaking eggs
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/egg/E = I
|
||||
if(reagents)
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[src] is full.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You break [E] in [src].</span>")
|
||||
reagents.add_reagent("eggyolk", 5)
|
||||
qdel(E)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker
|
||||
name = "beaker"
|
||||
desc = "A beaker. It can hold up to 50 units."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "beaker"
|
||||
item_state = "beaker"
|
||||
materials = list(MAT_GLASS=500)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
if(reagents.total_volume)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[icon_state]10")
|
||||
|
||||
var/percent = round((reagents.total_volume / volume) * 100)
|
||||
switch(percent)
|
||||
if(0 to 9)
|
||||
filling.icon_state = "[icon_state]-10"
|
||||
if(10 to 24)
|
||||
filling.icon_state = "[icon_state]10"
|
||||
if(25 to 49)
|
||||
filling.icon_state = "[icon_state]25"
|
||||
if(50 to 74)
|
||||
filling.icon_state = "[icon_state]50"
|
||||
if(75 to 79)
|
||||
filling.icon_state = "[icon_state]75"
|
||||
if(80 to 90)
|
||||
filling.icon_state = "[icon_state]80"
|
||||
if(91 to INFINITY)
|
||||
filling.icon_state = "[icon_state]100"
|
||||
|
||||
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
add_overlay(filling)
|
||||
|
||||
|
||||
var/percent = round((reagents.total_volume / volume) * 100)
|
||||
switch(percent)
|
||||
if(0 to 9)
|
||||
filling.icon_state = "[icon_state]-10"
|
||||
if(10 to 24)
|
||||
filling.icon_state = "[icon_state]10"
|
||||
if(25 to 49)
|
||||
filling.icon_state = "[icon_state]25"
|
||||
if(50 to 74)
|
||||
filling.icon_state = "[icon_state]50"
|
||||
if(75 to 79)
|
||||
filling.icon_state = "[icon_state]75"
|
||||
if(80 to 90)
|
||||
filling.icon_state = "[icon_state]80"
|
||||
if(91 to INFINITY)
|
||||
filling.icon_state = "[icon_state]100"
|
||||
|
||||
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
add_overlay(filling)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/jar
|
||||
name = "honey jar"
|
||||
desc = "A jar for honey. It can hold up to 50 units of sweet delight."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "vapour"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large
|
||||
name = "large beaker"
|
||||
desc = "A large beaker. Can hold up to 100 units."
|
||||
icon_state = "beakerlarge"
|
||||
materials = list(MAT_GLASS=2500)
|
||||
volume = 100
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,50,100)
|
||||
flags = OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/noreact
|
||||
name = "cryostasis beaker"
|
||||
desc = "A cryostasis beaker that allows for chemical storage without \
|
||||
reactions. Can hold up to 50 units."
|
||||
icon_state = "beakernoreact"
|
||||
materials = list(MAT_METAL=3000)
|
||||
volume = 50
|
||||
amount_per_transfer_from_this = 10
|
||||
origin_tech = "materials=2;engineering=3;plasmatech=3"
|
||||
flags = OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large
|
||||
name = "large beaker"
|
||||
desc = "A large beaker. Can hold up to 100 units."
|
||||
icon_state = "beakerlarge"
|
||||
materials = list(MAT_GLASS=2500)
|
||||
volume = 100
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,50,100)
|
||||
flags = OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/noreact
|
||||
name = "cryostasis beaker"
|
||||
desc = "A cryostasis beaker that allows for chemical storage without \
|
||||
reactions. Can hold up to 50 units."
|
||||
icon_state = "beakernoreact"
|
||||
materials = list(MAT_METAL=3000)
|
||||
volume = 50
|
||||
amount_per_transfer_from_this = 10
|
||||
origin_tech = "materials=2;engineering=3;plasmatech=3"
|
||||
flags = OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/noreact/Initialize()
|
||||
. = ..()
|
||||
reagents.set_reacting(FALSE)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/bluespace
|
||||
name = "bluespace beaker"
|
||||
desc = "A bluespace beaker, powered by experimental bluespace technology \
|
||||
and Element Cuban combined with the Compound Pete. Can hold up to \
|
||||
300 units."
|
||||
icon_state = "beakerbluespace"
|
||||
materials = list(MAT_GLASS=3000)
|
||||
volume = 300
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,50,100,300)
|
||||
flags = OPENCONTAINER
|
||||
origin_tech = "bluespace=5;materials=4;plasmatech=4"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/cryoxadone
|
||||
list_reagents = list("cryoxadone" = 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/sulphuric
|
||||
list_reagents = list("sacid" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/slime
|
||||
list_reagents = list("slimejelly" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large/styptic
|
||||
name = "styptic reserve tank"
|
||||
list_reagents = list("styptic_powder" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large/silver_sulfadiazine
|
||||
name = "silver sulfadiazine reserve tank"
|
||||
list_reagents = list("silver_sulfadiazine" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large/charcoal
|
||||
name = "antitoxin reserve tank"
|
||||
list_reagents = list("charcoal" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large/epinephrine
|
||||
name = "epinephrine reserve tank"
|
||||
list_reagents = list("epinephrine" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/synthflesh
|
||||
list_reagents = list("synthflesh" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bucket
|
||||
name = "bucket"
|
||||
desc = "It's a bucket."
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "bucket"
|
||||
item_state = "bucket"
|
||||
materials = list(MAT_METAL=200)
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = list(10,15,20,25,30,50,70)
|
||||
volume = 70
|
||||
flags = OPENCONTAINER
|
||||
flags_inv = HIDEHAIR
|
||||
slot_flags = SLOT_HEAD
|
||||
resistance_flags = 0
|
||||
armor = list(melee = 10, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 75, acid = 50) //Weak melee protection, because you can wear it on your head
|
||||
slot_equipment_priority = list( \
|
||||
slot_back, slot_wear_id,\
|
||||
slot_w_uniform, slot_wear_suit,\
|
||||
slot_wear_mask, slot_head, slot_neck,\
|
||||
slot_shoes, slot_gloves,\
|
||||
slot_ears, slot_glasses,\
|
||||
slot_belt, slot_s_store,\
|
||||
slot_l_store, slot_r_store,\
|
||||
slot_generic_dextrous_storage
|
||||
)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bucket/attackby(obj/O, mob/user, params)
|
||||
if(istype(O, /obj/item/weapon/mop))
|
||||
if(reagents.total_volume < 1)
|
||||
to_chat(user, "<span class='warning'>[src] is out of water!</span>")
|
||||
else
|
||||
reagents.trans_to(O, 5)
|
||||
to_chat(user, "<span class='notice'>You wet [O] in [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
else if(isprox(O))
|
||||
to_chat(user, "<span class='notice'>You add [O] to [src].</span>")
|
||||
qdel(O)
|
||||
qdel(src)
|
||||
user.put_in_hands(new /obj/item/weapon/bucket_sensor)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bucket/equipped(mob/user, slot)
|
||||
..()
|
||||
if(slot == slot_head && reagents.total_volume)
|
||||
to_chat(user, "<span class='userdanger'>[src]'s contents spill all over you!</span>")
|
||||
reagents.reaction(user, TOUCH)
|
||||
reagents.clear_reagents()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bucket/equip_to_best_slot(var/mob/M)
|
||||
if(reagents.total_volume) //If there is water in a bucket, don't quick equip it to the head
|
||||
var/index = slot_equipment_priority.Find(slot_head)
|
||||
slot_equipment_priority.Remove(slot_head)
|
||||
. = ..()
|
||||
slot_equipment_priority.Insert(index, slot_head)
|
||||
return
|
||||
return ..()
|
||||
reagents.set_reacting(FALSE)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/bluespace
|
||||
name = "bluespace beaker"
|
||||
desc = "A bluespace beaker, powered by experimental bluespace technology \
|
||||
and Element Cuban combined with the Compound Pete. Can hold up to \
|
||||
300 units."
|
||||
icon_state = "beakerbluespace"
|
||||
materials = list(MAT_GLASS=3000)
|
||||
volume = 300
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,50,100,300)
|
||||
flags = OPENCONTAINER
|
||||
origin_tech = "bluespace=5;materials=4;plasmatech=4"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/cryoxadone
|
||||
list_reagents = list("cryoxadone" = 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/sulphuric
|
||||
list_reagents = list("sacid" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/slime
|
||||
list_reagents = list("slimejelly" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large/styptic
|
||||
name = "styptic reserve tank"
|
||||
list_reagents = list("styptic_powder" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large/silver_sulfadiazine
|
||||
name = "silver sulfadiazine reserve tank"
|
||||
list_reagents = list("silver_sulfadiazine" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large/charcoal
|
||||
name = "antitoxin reserve tank"
|
||||
list_reagents = list("charcoal" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large/epinephrine
|
||||
name = "epinephrine reserve tank"
|
||||
list_reagents = list("epinephrine" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/synthflesh
|
||||
list_reagents = list("synthflesh" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bucket
|
||||
name = "bucket"
|
||||
desc = "It's a bucket."
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "bucket"
|
||||
item_state = "bucket"
|
||||
materials = list(MAT_METAL=200)
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = list(10,15,20,25,30,50,70)
|
||||
volume = 70
|
||||
flags = OPENCONTAINER
|
||||
flags_inv = HIDEHAIR
|
||||
slot_flags = SLOT_HEAD
|
||||
resistance_flags = 0
|
||||
armor = list(melee = 10, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 75, acid = 50) //Weak melee protection, because you can wear it on your head
|
||||
slot_equipment_priority = list( \
|
||||
slot_back, slot_wear_id,\
|
||||
slot_w_uniform, slot_wear_suit,\
|
||||
slot_wear_mask, slot_head, slot_neck,\
|
||||
slot_shoes, slot_gloves,\
|
||||
slot_ears, slot_glasses,\
|
||||
slot_belt, slot_s_store,\
|
||||
slot_l_store, slot_r_store,\
|
||||
slot_generic_dextrous_storage
|
||||
)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bucket/attackby(obj/O, mob/user, params)
|
||||
if(istype(O, /obj/item/weapon/mop))
|
||||
if(reagents.total_volume < 1)
|
||||
to_chat(user, "<span class='warning'>[src] is out of water!</span>")
|
||||
else
|
||||
reagents.trans_to(O, 5)
|
||||
to_chat(user, "<span class='notice'>You wet [O] in [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
else if(isprox(O))
|
||||
to_chat(user, "<span class='notice'>You add [O] to [src].</span>")
|
||||
qdel(O)
|
||||
qdel(src)
|
||||
user.put_in_hands(new /obj/item/weapon/bucket_sensor)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bucket/equipped(mob/user, slot)
|
||||
..()
|
||||
if(slot == slot_head && reagents.total_volume)
|
||||
to_chat(user, "<span class='userdanger'>[src]'s contents spill all over you!</span>")
|
||||
reagents.reaction(user, TOUCH)
|
||||
reagents.clear_reagents()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bucket/equip_to_best_slot(var/mob/M)
|
||||
if(reagents.total_volume) //If there is water in a bucket, don't quick equip it to the head
|
||||
var/index = slot_equipment_priority.Find(slot_head)
|
||||
slot_equipment_priority.Remove(slot_head)
|
||||
. = ..()
|
||||
slot_equipment_priority.Insert(index, slot_head)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/waterbottle
|
||||
name = "bottle of water"
|
||||
|
||||
@@ -148,4 +148,4 @@
|
||||
desc = "I wouldn't eat this if I were you."
|
||||
icon_state = "pill9"
|
||||
color = "#454545"
|
||||
list_reagents = list("shadowmutationtoxin" = 1)
|
||||
list_reagents = list("shadowmutationtoxin" = 1)
|
||||
@@ -1,254 +1,254 @@
|
||||
#define SYRINGE_DRAW 0
|
||||
#define SYRINGE_INJECT 1
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe
|
||||
name = "syringe"
|
||||
desc = "A syringe that can hold up to 15 units."
|
||||
icon = 'icons/obj/syringe.dmi'
|
||||
item_state = "syringe_0"
|
||||
icon_state = "0"
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list()
|
||||
volume = 15
|
||||
var/mode = SYRINGE_DRAW
|
||||
var/busy = 0 // needed for delayed drawing of blood
|
||||
var/proj_piercing = 0 //does it pierce through thick clothes when shot with syringe gun
|
||||
materials = list(MAT_METAL=10, MAT_GLASS=20)
|
||||
container_type = TRANSPARENT
|
||||
|
||||
#define SYRINGE_DRAW 0
|
||||
#define SYRINGE_INJECT 1
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe
|
||||
name = "syringe"
|
||||
desc = "A syringe that can hold up to 15 units."
|
||||
icon = 'icons/obj/syringe.dmi'
|
||||
item_state = "syringe_0"
|
||||
icon_state = "0"
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list()
|
||||
volume = 15
|
||||
var/mode = SYRINGE_DRAW
|
||||
var/busy = 0 // needed for delayed drawing of blood
|
||||
var/proj_piercing = 0 //does it pierce through thick clothes when shot with syringe gun
|
||||
materials = list(MAT_METAL=10, MAT_GLASS=20)
|
||||
container_type = TRANSPARENT
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/Initialize()
|
||||
. = ..()
|
||||
if(list_reagents) //syringe starts in inject mode if its already got something inside
|
||||
mode = SYRINGE_INJECT
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/pickup(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/dropped(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/attack_self(mob/user)
|
||||
mode = !mode
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/attack_hand()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/attackby(obj/item/I, mob/user, params)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/afterattack(atom/target, mob/user , proximity)
|
||||
if(busy)
|
||||
return
|
||||
if(!proximity)
|
||||
return
|
||||
if(!target.reagents)
|
||||
return
|
||||
|
||||
var/mob/living/L
|
||||
if(isliving(target))
|
||||
L = target
|
||||
if(!L.can_inject(user, 1))
|
||||
return
|
||||
|
||||
// chance of monkey retaliation
|
||||
if(istype(target, /mob/living/carbon/monkey) && prob(MONKEY_SYRINGE_RETALIATION_PROB))
|
||||
var/mob/living/carbon/monkey/M
|
||||
M = target
|
||||
M.retaliate(user)
|
||||
|
||||
switch(mode)
|
||||
if(SYRINGE_DRAW)
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>The syringe is full.</span>")
|
||||
return
|
||||
|
||||
if(L) //living mob
|
||||
var/drawn_amount = reagents.maximum_volume - reagents.total_volume
|
||||
if(target != user)
|
||||
target.visible_message("<span class='danger'>[user] is trying to take a blood sample from [target]!</span>", \
|
||||
"<span class='userdanger'>[user] is trying to take a blood sample from [target]!</span>")
|
||||
busy = 1
|
||||
if(!do_mob(user, target, extra_checks=CALLBACK(L, /mob/living/proc/can_inject,user,1)))
|
||||
busy = 0
|
||||
return
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
return
|
||||
busy = 0
|
||||
if(L.transfer_blood_to(src, drawn_amount))
|
||||
user.visible_message("[user] takes a blood sample from [L].")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You are unable to draw any blood from [L]!</span>")
|
||||
|
||||
else //if not mob
|
||||
if(!target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty!</span>")
|
||||
return
|
||||
|
||||
if(list_reagents) //syringe starts in inject mode if its already got something inside
|
||||
mode = SYRINGE_INJECT
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/pickup(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/dropped(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/attack_self(mob/user)
|
||||
mode = !mode
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/attack_hand()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/attackby(obj/item/I, mob/user, params)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/afterattack(atom/target, mob/user , proximity)
|
||||
if(busy)
|
||||
return
|
||||
if(!proximity)
|
||||
return
|
||||
if(!target.reagents)
|
||||
return
|
||||
|
||||
var/mob/living/L
|
||||
if(isliving(target))
|
||||
L = target
|
||||
if(!L.can_inject(user, 1))
|
||||
return
|
||||
|
||||
// chance of monkey retaliation
|
||||
if(ismonkey(target) && prob(MONKEY_SYRINGE_RETALIATION_PROB))
|
||||
var/mob/living/carbon/monkey/M
|
||||
M = target
|
||||
M.retaliate(user)
|
||||
|
||||
switch(mode)
|
||||
if(SYRINGE_DRAW)
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>The syringe is full.</span>")
|
||||
return
|
||||
|
||||
if(L) //living mob
|
||||
var/drawn_amount = reagents.maximum_volume - reagents.total_volume
|
||||
if(target != user)
|
||||
target.visible_message("<span class='danger'>[user] is trying to take a blood sample from [target]!</span>", \
|
||||
"<span class='userdanger'>[user] is trying to take a blood sample from [target]!</span>")
|
||||
busy = 1
|
||||
if(!do_mob(user, target, extra_checks=CALLBACK(L, /mob/living/proc/can_inject,user,1)))
|
||||
busy = 0
|
||||
return
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
return
|
||||
busy = 0
|
||||
if(L.transfer_blood_to(src, drawn_amount))
|
||||
user.visible_message("[user] takes a blood sample from [L].")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You are unable to draw any blood from [L]!</span>")
|
||||
|
||||
else //if not mob
|
||||
if(!target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty!</span>")
|
||||
return
|
||||
|
||||
if(!target.is_drawable())
|
||||
to_chat(user, "<span class='warning'>You cannot directly remove reagents from [target]!</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares?
|
||||
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] units of the solution.</span>")
|
||||
if (reagents.total_volume >= reagents.maximum_volume)
|
||||
mode=!mode
|
||||
update_icon()
|
||||
|
||||
if(SYRINGE_INJECT)
|
||||
if(!reagents.total_volume)
|
||||
to_chat(user, "<span class='notice'>[src] is empty.</span>")
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='warning'>You cannot directly remove reagents from [target]!</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares?
|
||||
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] units of the solution.</span>")
|
||||
if (reagents.total_volume >= reagents.maximum_volume)
|
||||
mode=!mode
|
||||
update_icon()
|
||||
|
||||
if(SYRINGE_INJECT)
|
||||
if(!reagents.total_volume)
|
||||
to_chat(user, "<span class='notice'>[src] is empty.</span>")
|
||||
return
|
||||
|
||||
if(!target.is_injectable())
|
||||
to_chat(user, "<span class='warning'>You cannot directly fill [target]!</span>")
|
||||
return
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
if(L) //living mob
|
||||
if(L != user)
|
||||
L.visible_message("<span class='danger'>[user] is trying to inject [L]!</span>", \
|
||||
"<span class='userdanger'>[user] is trying to inject [L]!</span>")
|
||||
if(!do_mob(user, L, extra_checks=CALLBACK(L, /mob/living/proc/can_inject,user,1)))
|
||||
return
|
||||
if(!reagents.total_volume)
|
||||
return
|
||||
if(L.reagents.total_volume >= L.reagents.maximum_volume)
|
||||
return
|
||||
L.visible_message("<span class='danger'>[user] injects [L] with the syringe!", \
|
||||
"<span class='userdanger'>[user] injects [L] with the syringe!")
|
||||
|
||||
var/list/rinject = list()
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
rinject += R.name
|
||||
var/contained = english_list(rinject)
|
||||
|
||||
if(L != user)
|
||||
add_logs(user, L, "injected", src, addition="which had [contained]")
|
||||
else
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) injected [L.name] ([L.ckey]) with [src.name], which had [contained] (INTENT: [uppertext(user.a_intent)])</font>")
|
||||
L.log_message("<font color='orange'>Injected themselves ([contained]) with [src.name].</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
|
||||
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
|
||||
reagents.reaction(L, INJECT, fraction)
|
||||
reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You inject [amount_per_transfer_from_this] units of the solution. The syringe now contains [reagents.total_volume] units.</span>")
|
||||
if (reagents.total_volume <= 0 && mode==SYRINGE_INJECT)
|
||||
mode = SYRINGE_DRAW
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/update_icon()
|
||||
var/rounded_vol = Clamp(round((reagents.total_volume / volume * 15),5), 0, 15)
|
||||
cut_overlays()
|
||||
if(ismob(loc))
|
||||
var/injoverlay
|
||||
switch(mode)
|
||||
if (SYRINGE_DRAW)
|
||||
injoverlay = "draw"
|
||||
if (SYRINGE_INJECT)
|
||||
injoverlay = "inject"
|
||||
add_overlay(injoverlay)
|
||||
icon_state = "[rounded_vol]"
|
||||
item_state = "syringe_[rounded_vol]"
|
||||
|
||||
if(reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>You cannot directly fill [target]!</span>")
|
||||
return
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
if(L) //living mob
|
||||
if(L != user)
|
||||
L.visible_message("<span class='danger'>[user] is trying to inject [L]!</span>", \
|
||||
"<span class='userdanger'>[user] is trying to inject [L]!</span>")
|
||||
if(!do_mob(user, L, extra_checks=CALLBACK(L, /mob/living/proc/can_inject,user,1)))
|
||||
return
|
||||
if(!reagents.total_volume)
|
||||
return
|
||||
if(L.reagents.total_volume >= L.reagents.maximum_volume)
|
||||
return
|
||||
L.visible_message("<span class='danger'>[user] injects [L] with the syringe!", \
|
||||
"<span class='userdanger'>[user] injects [L] with the syringe!")
|
||||
|
||||
var/list/rinject = list()
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
rinject += R.name
|
||||
var/contained = english_list(rinject)
|
||||
|
||||
if(L != user)
|
||||
add_logs(user, L, "injected", src, addition="which had [contained]")
|
||||
else
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) injected [L.name] ([L.ckey]) with [src.name], which had [contained] (INTENT: [uppertext(user.a_intent)])</font>")
|
||||
L.log_message("<font color='orange'>Injected themselves ([contained]) with [src.name].</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
|
||||
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
|
||||
reagents.reaction(L, INJECT, fraction)
|
||||
reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You inject [amount_per_transfer_from_this] units of the solution. The syringe now contains [reagents.total_volume] units.</span>")
|
||||
if (reagents.total_volume <= 0 && mode==SYRINGE_INJECT)
|
||||
mode = SYRINGE_DRAW
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/update_icon()
|
||||
var/rounded_vol = Clamp(round((reagents.total_volume / volume * 15),5), 0, 15)
|
||||
cut_overlays()
|
||||
if(ismob(loc))
|
||||
var/injoverlay
|
||||
switch(mode)
|
||||
if (SYRINGE_DRAW)
|
||||
injoverlay = "draw"
|
||||
if (SYRINGE_INJECT)
|
||||
injoverlay = "inject"
|
||||
add_overlay(injoverlay)
|
||||
icon_state = "[rounded_vol]"
|
||||
item_state = "syringe_[rounded_vol]"
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]")
|
||||
filling_overlay.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
add_overlay(filling_overlay)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/epinephrine
|
||||
name = "syringe (epinephrine)"
|
||||
desc = "Contains epinephrine - used to stabilize patients."
|
||||
list_reagents = list("epinephrine" = 15)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/charcoal
|
||||
name = "syringe (charcoal)"
|
||||
desc = "Contains charcoal."
|
||||
list_reagents = list("charcoal" = 15)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/antiviral
|
||||
name = "syringe (spaceacillin)"
|
||||
desc = "Contains antiviral agents."
|
||||
list_reagents = list("spaceacillin" = 15)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/bioterror
|
||||
name = "bioterror syringe"
|
||||
desc = "Contains several paralyzing reagents."
|
||||
list_reagents = list("neurotoxin" = 5, "mutetoxin" = 5, "sodium_thiopental" = 5)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/stimulants
|
||||
name = "Stimpack"
|
||||
desc = "Contains stimulants."
|
||||
amount_per_transfer_from_this = 50
|
||||
volume = 50
|
||||
list_reagents = list("stimulants" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/calomel
|
||||
name = "syringe (calomel)"
|
||||
desc = "Contains calomel."
|
||||
list_reagents = list("calomel" = 15)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/lethal
|
||||
name = "lethal injection syringe"
|
||||
desc = "A syringe used for lethal injections. It can hold up to 50 units."
|
||||
amount_per_transfer_from_this = 50
|
||||
volume = 50
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/lethal/choral
|
||||
list_reagents = list("chloralhydrate" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/lethal/execution
|
||||
list_reagents = list("plasma" = 15, "formaldehyde" = 15, "cyanide" = 10, "facid" = 10)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/mulligan
|
||||
name = "Mulligan"
|
||||
desc = "A syringe used to completely change the users identity."
|
||||
amount_per_transfer_from_this = 1
|
||||
volume = 1
|
||||
list_reagents = list("mulligan" = 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/gluttony
|
||||
name = "Gluttony's Blessing"
|
||||
desc = "A syringe recovered from a dread place. It probably isn't wise to use."
|
||||
amount_per_transfer_from_this = 1
|
||||
volume = 1
|
||||
list_reagents = list("gluttonytoxin" = 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/bluespace
|
||||
name = "bluespace syringe"
|
||||
desc = "An advanced syringe that can hold 60 units of chemicals"
|
||||
amount_per_transfer_from_this = 20
|
||||
volume = 60
|
||||
origin_tech = "bluespace=4;materials=4;biotech=4"
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/noreact
|
||||
name = "cryo syringe"
|
||||
desc = "An advanced syringe that stops reagents inside from reacting. It can hold up to 20 units."
|
||||
volume = 20
|
||||
origin_tech = "materials=3;engineering=3"
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/epinephrine
|
||||
name = "syringe (epinephrine)"
|
||||
desc = "Contains epinephrine - used to stabilize patients."
|
||||
list_reagents = list("epinephrine" = 15)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/charcoal
|
||||
name = "syringe (charcoal)"
|
||||
desc = "Contains charcoal."
|
||||
list_reagents = list("charcoal" = 15)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/antiviral
|
||||
name = "syringe (spaceacillin)"
|
||||
desc = "Contains antiviral agents."
|
||||
list_reagents = list("spaceacillin" = 15)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/bioterror
|
||||
name = "bioterror syringe"
|
||||
desc = "Contains several paralyzing reagents."
|
||||
list_reagents = list("neurotoxin" = 5, "mutetoxin" = 5, "sodium_thiopental" = 5)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/stimulants
|
||||
name = "Stimpack"
|
||||
desc = "Contains stimulants."
|
||||
amount_per_transfer_from_this = 50
|
||||
volume = 50
|
||||
list_reagents = list("stimulants" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/calomel
|
||||
name = "syringe (calomel)"
|
||||
desc = "Contains calomel."
|
||||
list_reagents = list("calomel" = 15)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/lethal
|
||||
name = "lethal injection syringe"
|
||||
desc = "A syringe used for lethal injections. It can hold up to 50 units."
|
||||
amount_per_transfer_from_this = 50
|
||||
volume = 50
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/lethal/choral
|
||||
list_reagents = list("chloralhydrate" = 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/lethal/execution
|
||||
list_reagents = list("plasma" = 15, "formaldehyde" = 15, "cyanide" = 10, "facid" = 10)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/mulligan
|
||||
name = "Mulligan"
|
||||
desc = "A syringe used to completely change the users identity."
|
||||
amount_per_transfer_from_this = 1
|
||||
volume = 1
|
||||
list_reagents = list("mulligan" = 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/gluttony
|
||||
name = "Gluttony's Blessing"
|
||||
desc = "A syringe recovered from a dread place. It probably isn't wise to use."
|
||||
amount_per_transfer_from_this = 1
|
||||
volume = 1
|
||||
list_reagents = list("gluttonytoxin" = 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/bluespace
|
||||
name = "bluespace syringe"
|
||||
desc = "An advanced syringe that can hold 60 units of chemicals"
|
||||
amount_per_transfer_from_this = 20
|
||||
volume = 60
|
||||
origin_tech = "bluespace=4;materials=4;biotech=4"
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/noreact
|
||||
name = "cryo syringe"
|
||||
desc = "An advanced syringe that stops reagents inside from reacting. It can hold up to 20 units."
|
||||
volume = 20
|
||||
origin_tech = "materials=3;engineering=3"
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/noreact/Initialize()
|
||||
. = ..()
|
||||
reagents.set_reacting(FALSE)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/piercing
|
||||
name = "piercing syringe"
|
||||
desc = "A diamond-tipped syringe that pierces armor when launched at high velocity. It can hold up to 10 units."
|
||||
volume = 10
|
||||
proj_piercing = 1
|
||||
origin_tech = "combat=3;materials=4;engineering=5"
|
||||
. = ..()
|
||||
reagents.set_reacting(FALSE)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/piercing
|
||||
name = "piercing syringe"
|
||||
desc = "A diamond-tipped syringe that pierces armor when launched at high velocity. It can hold up to 10 units."
|
||||
volume = 10
|
||||
proj_piercing = 1
|
||||
origin_tech = "combat=3;materials=4;engineering=5"
|
||||
|
||||
Reference in New Issue
Block a user