mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-23 16:42:13 +00:00
Temperature Reagent System (#5423)
Overview This is the github WIP PR for the reagent system project. This is for other developers and users to track progress of the code if they're curious about it, as well as to show that it actually works.
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
var/t = min(amount_per_transfer_from_this, reagent_volumes[reagent_ids[mode]])
|
||||
M.reagents.add_reagent(reagent_ids[mode], t)
|
||||
reagent_volumes[reagent_ids[mode]] -= t
|
||||
admin_inject_log(user, M, src, reagent_ids[mode], t)
|
||||
admin_inject_log(user, M, src, reagent_ids[mode], reagents.get_temperature(), t)
|
||||
to_chat(user,"<span class='notice'>[t] units injected. [reagent_volumes[reagent_ids[mode]]] units remaining.</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -372,3 +372,25 @@
|
||||
. = ..()
|
||||
reagents.add_reagent("frostoil", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/pyrosilicate
|
||||
name = "pyrosilicate bottle"
|
||||
desc = "A small bottle. Contains pyrosilicate - used to heat up reagents."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
|
||||
Initialize()
|
||||
. = ..()
|
||||
reagents.add_reagent("pyrosilicate", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/cryosurfactant
|
||||
name = "cryosurfactant bottle"
|
||||
desc = "A small bottle. Contains cryosurfactant - used to cool down reagents."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
|
||||
Initialize()
|
||||
. = ..()
|
||||
reagents.add_reagent("cryosurfactant", 60)
|
||||
update_icon()
|
||||
@@ -49,7 +49,7 @@
|
||||
if(M.reagents)
|
||||
var/contained = reagentlist()
|
||||
var/trans = reagents.trans_to_mob(M, amount_per_transfer_from_this, CHEM_BLOOD)
|
||||
admin_inject_log(user, M, src, contained, trans)
|
||||
admin_inject_log(user, M, src, contained, reagents.get_temperature(), trans)
|
||||
to_chat(user,"<span class='notice'>[trans] units injected. [reagents.total_volume] units remaining in \the [src].</span>")
|
||||
|
||||
update_icon()
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
if(H.reagents)
|
||||
var/contained = reagentlist()
|
||||
var/trans = reagents.trans_to_mob(H, amount_per_transfer_from_this, CHEM_TOUCH)
|
||||
admin_inject_log(user, H, src, contained, trans)
|
||||
admin_inject_log(user, H, src, contained, reagents.get_temperature(), trans)
|
||||
playsound(src.loc, 'sound/items/stimpack.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] accidentally sticks the [src] in [H]'s eyes!</span>","<span class='notice'>You accidentally stick the [src] in [H]'s eyes!</span>")
|
||||
to_chat(user,"<span class='notice'>[trans] units injected. [reagents.total_volume] units remaining in \the [src].</span>")
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
if(H.reagents)
|
||||
var/contained = reagentlist()
|
||||
var/trans = reagents.trans_to_mob(H, amount_per_transfer_from_this, CHEM_BREATHE, bypass_checks = TRUE)
|
||||
var/trans = reagents.trans_to_mob(H, amount_per_transfer_from_this, reagents.get_temperature(), CHEM_BREATHE, bypass_checks = TRUE)
|
||||
admin_inject_log(user, H, src, contained, trans)
|
||||
playsound(src.loc, 'sound/items/stimpack.ogg', 50, 1)
|
||||
to_chat(user,"<span class='notice'>[trans] units injected. [reagents.total_volume] units remaining in \the [src].</span>")
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
if(M.reagents)
|
||||
var/contained = stored_cartridge.reagentlist()
|
||||
var/trans = stored_cartridge.reagents.trans_to_mob(M, transfer_amount, CHEM_BREATHE, bypass_checks = TRUE)
|
||||
admin_inject_log(user, M, src, contained, trans)
|
||||
admin_inject_log(user, M, src, contained, reagents.get_temperature(), trans)
|
||||
playsound(M.loc, 'sound/items/stimpack.ogg', 50, 1)
|
||||
if(eject_when_empty)
|
||||
to_chat(user,"<span class='notice'>\The [stored_cartridge] automatically ejects from \the [src].</span>")
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
if(ismob(target))
|
||||
var/contained = reagentlist()
|
||||
trans = reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_BLOOD)
|
||||
admin_inject_log(user, target, src, contained, trans)
|
||||
admin_inject_log(user, target, src, contained, reagents.get_temperature(), trans)
|
||||
else
|
||||
trans = reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
user << "<span class='notice'>You inject [trans] units of the solution. The syringe now contains [src.reagents.total_volume] units.</span>"
|
||||
@@ -269,13 +269,11 @@
|
||||
user.visible_message("<span class='danger'>[user] stabs [target] with [src.name]!</span>")
|
||||
target.take_organ_damage(3)// 7 is the same as crowbar punch
|
||||
|
||||
|
||||
|
||||
var/syringestab_amount_transferred = rand(0, (reagents.total_volume - 5)) //nerfed by popular demand
|
||||
var/contained_reagents = reagents.get_reagents()
|
||||
var/trans = reagents.trans_to_mob(target, syringestab_amount_transferred, CHEM_BLOOD)
|
||||
if(isnull(trans)) trans = 0
|
||||
admin_inject_log(user, target, src, contained_reagents, trans, violent=1)
|
||||
admin_inject_log(user, target, src, contained_reagents, reagents.get_temperature(), trans, violent=1)
|
||||
break_syringe(target, user)
|
||||
|
||||
/obj/item/weapon/reagent_containers/syringe/proc/break_syringe(mob/living/carbon/target, mob/living/carbon/user)
|
||||
|
||||
Reference in New Issue
Block a user