This commit is contained in:
silicons
2020-12-31 12:33:05 -08:00
parent 0a4fe70873
commit 251bd3e06b
15 changed files with 44 additions and 27 deletions

View File

@@ -48,7 +48,7 @@
var/fraction = min(gulp_size/reagents.total_volume, 1)
checkLiked(fraction, M)
reagents.reaction(M, INGEST, fraction)
reagents.trans_to(M, gulp_size)
reagents.trans_to(M, gulp_size, log = TRUE)
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
return 1
@@ -71,7 +71,7 @@
return
var/refill = reagents.get_master_reagent_id()
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this, log = TRUE)
to_chat(user, "<span class='notice'>You transfer [trans] units of the solution to [target].</span>")
if(iscyborg(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
@@ -92,7 +92,7 @@
to_chat(user, "<span class='warning'>[src] is full.</span>")
return
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this, log = TRUE)
to_chat(user, "<span class='notice'>You fill [src] with [trans] units of the contents of [target].</span>")
/obj/item/reagent_containers/food/drinks/attackby(obj/item/I, mob/user, params)

View File

@@ -55,7 +55,7 @@
var/fraction = min(10/reagents.total_volume, 1)
reagents.reaction(M, INGEST, fraction)
reagents.trans_to(M, 10)
reagents.trans_to(M, 10, log = TRUE)
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
return 1
@@ -73,7 +73,7 @@
to_chat(user, "<span class='warning'>[src] is full!</span>")
return
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this, log = TRUE)
to_chat(user, "<span class='notice'>You fill [src] with [trans] units of the contents of [target].</span>")
//Something like a glass or a food item. Player probably wants to transfer TO it.
@@ -84,7 +84,7 @@
if(target.reagents.total_volume >= target.reagents.maximum_volume)
to_chat(user, "<span class='warning'>you can't add anymore to [target]!</span>")
return
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this, log = TRUE)
to_chat(user, "<span class='notice'>You transfer [trans] units of the condiment to [target].</span>")
/obj/item/reagent_containers/food/condiment/on_reagent_change(changetype)
@@ -270,7 +270,7 @@
return
else
to_chat(user, "<span class='notice'>You tear open [src] above [target] and the condiments drip onto it.</span>")
src.reagents.trans_to(target, amount_per_transfer_from_this)
src.reagents.trans_to(target, amount_per_transfer_from_this, log = TRUE)
qdel(src)
/obj/item/reagent_containers/food/condiment/pack/on_reagent_change(changetype)

View File

@@ -160,7 +160,7 @@ All foods are distributed among various categories. Use common sense.
SEND_SIGNAL(src, COMSIG_FOOD_EATEN, M, user)
var/fraction = min(bitesize / reagents.total_volume, 1)
reagents.reaction(M, INGEST, fraction)
reagents.trans_to(M, bitesize)
reagents.trans_to(M, bitesize, log = TRUE)
bitecount++
On_Consume(M)
checkLiked(fraction, M)
@@ -359,7 +359,7 @@ All foods are distributed among various categories. Use common sense.
if(!M.is_drainable())
to_chat(user, "<span class='warning'>[M] is unable to be dunked in!</span>")
return
if(M.reagents.trans_to(src, dunk_amount)) //if reagents were transfered, show the message
if(M.reagents.trans_to(src, dunk_amount, log = TRUE)) //if reagents were transfered, show the message
to_chat(user, "<span class='notice'>You dunk the [M].</span>")
return
if(!M.reagents.total_volume)

View File

@@ -54,7 +54,7 @@
H.visible_message("<span class='warning'>[H] is creamed by [src]!</span>", "<span class='userdanger'>You've been creamed by [src]!</span>")
playsound(H, "desceration", 50, TRUE)
if(!H.is_mouth_covered())
reagents.trans_to(H,15) //Cream pie combat
reagents.trans_to(H, 15, log = TRUE) //Cream pie combat
if(!H.creamed) // one layer at a time
H.add_overlay(creamoverlay)
H.creamed = TRUE

View File

@@ -130,7 +130,7 @@
reagents.remove_any(min(0.5, nutridrain))
else
reagents.remove_any(nutridrain)
// Lack of nutrients hurts non-weeds
if(reagents.total_volume <= 0 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
adjustHealth(-rand(1,3))
@@ -501,7 +501,7 @@
if(visi_msg)
visible_message("<span class='notice'>[visi_msg].</span>")
for(var/obj/machinery/hydroponics/H in trays)
//cause I don't want to feel like im juggling 15 tamagotchis and I can get to my real work of ripping flooring apart in hopes of validating my life choices of becoming a space-gardener
//This was originally in apply_chemicals, but due to apply_chemicals only holding nutrients, we handle it here now.
@@ -675,7 +675,7 @@
idle_power_usage = 0
self_sustaining = FALSE
update_icon()
/// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds.///
/obj/machinery/hydroponics/proc/adjustWater(adjustamt)
waterlevel = clamp(waterlevel + adjustamt, 0, maxwater)

View File

@@ -259,6 +259,7 @@
say("Not enough energy to complete operation!")
return
R.add_reagent(reagent, actual)
log_reagent("DISPENSER: ([COORD(src)]) ([REF(src)]) [key_name(usr)] dispensed [actual] of [reagent] to [beaker] ([REF(beaker)]).")
work_animation()
else
@@ -281,11 +282,14 @@
var/list/chemicals_to_dispense = saved_recipes[params["recipe"]]
if(!LAZYLEN(chemicals_to_dispense))
return
var/list/logstring = list()
var/earlyabort = TRUE
for(var/key in chemicals_to_dispense)
var/reagent = GLOB.name2reagent[translate_legacy_chem_id(key)]
var/dispense_amount = chemicals_to_dispense[key]
logstring += "[reagent] = [dispense_amount]"
if(!dispensable_reagents.Find(reagent))
return
break
if(!recording_recipe)
if(!beaker)
return
@@ -295,11 +299,15 @@
if(actual)
if(!cell.use(actual / powerefficiency))
say("Not enough energy to complete operation!")
return
earlyabort = TRUE
break
R.add_reagent(reagent, actual)
work_animation()
else
recording_recipe[key] += dispense_amount
logstring = logstring.Join(", ")
if(!recording_recipe)
log_reagent("DISPENSER: [key_name(usr)] dispensed recipe [params["recipe"]] with chemicals [logstring] to [beaker] ([REF(beaker)])[earlyabort? " (aborted early)":""]")
. = TRUE
if("clear_recipes")
if(!is_operational())
@@ -322,15 +330,19 @@
if(saved_recipes[name] && alert("\"[name]\" already exists, do you want to overwrite it?",, "Yes", "No") == "No")
return
if(name && recording_recipe)
var/logstring = list()
for(var/reagent in recording_recipe)
var/reagent_id = GLOB.name2reagent[translate_legacy_chem_id(reagent)]
logstring += "[reagent_id] = [recording_recipe[reagent]]"
if(!dispensable_reagents.Find(reagent_id))
visible_message("<span class='warning'>[src] buzzes.</span>", "<span class='hear'>You hear a faint buzz.</span>")
to_chat(usr, "<span class ='danger'>[src] cannot find <b>[reagent]</b>!</span>")
playsound(src, 'sound/machines/buzz-two.ogg', 50, TRUE)
return
saved_recipes[name] = recording_recipe
logstring = logstring.Join(", ")
recording_recipe = null
log_reagent("DISPENSER: [key_name(usr)] recorded recipe [name] with chemicals [logstring]")
. = TRUE
if("cancel_recording")
if(!is_operational())

View File

@@ -455,7 +455,7 @@
grinded.on_grind()
reagents.add_reagent_list(grinded.grind_results)
if(grinded.reagents) //food and pills
grinded.reagents.trans_to(src, grinded.reagents.total_volume)
grinded.reagents.trans_to(src, grinded.reagents.total_volume, log = "mortar powdering")
to_chat(user, "<span class='notice'>You break [grinded] into powder.</span>")
QDEL_NULL(grinded)
return

View File

@@ -41,7 +41,7 @@
if(M.reagents)
var/trans = 0
if(!infinite)
trans = reagents.trans_to(M, amount_per_transfer_from_this)
trans = reagents.trans_to(M, amount_per_transfer_from_this, log = TRUE)
else
trans = reagents.copy_to(M, amount_per_transfer_from_this)
@@ -427,7 +427,7 @@
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)
vial.reagents.trans_to(target, vial.amount_per_transfer_from_this, log = TRUE)
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>")

View File

@@ -80,7 +80,7 @@
playsound(src, 'sound/effects/spray2.ogg', 50, 1, -6)
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
reagents.reaction(L, apply_type, fraction)
reagents.trans_to(L, amount_per_transfer_from_this)
reagents.trans_to(L, amount_per_transfer_from_this, log = TRUE)
return
/obj/item/reagent_containers/medspray/styptic

View File

@@ -56,7 +56,7 @@
log_combat(user, M, "fed", reagents.log_list())
if(reagents.total_volume)
reagents.reaction(M, apply_type)
reagents.trans_to(M, reagents.total_volume)
reagents.trans_to(M, reagents.total_volume, log = TRUE)
qdel(src)
return TRUE
@@ -76,7 +76,8 @@
user.visible_message("<span class='warning'>[user] slips something into [target]!</span>",
"<span class='notice'>You dissolve [src] in [target].</span>", vision_distance = 2)
reagents.trans_to(target, reagents.total_volume)
log_combat(user, target, "spiked", src, reagents.log_list())
reagents.trans_to(target, reagents.total_volume, log = TRUE)
qdel(src)
return STOP_ATTACK_PROC_CHAIN

View File

@@ -39,7 +39,7 @@
C.visible_message("<span class='danger'>[user] is trying to smother \the [C] with \the [src]!</span>", "<span class='userdanger'>[user] is trying to smother you with \the [src]!</span>", "<span class='italics'>You hear some struggling and muffled cries of surprise.</span>")
if(do_after(user, 20, target = C))
reagents.reaction(C, INGEST)
reagents.trans_to(C, 5)
reagents.trans_to(C, 5, log = TRUE)
C.visible_message("<span class='danger'>[user] has smothered \the [C] with \the [src]!</span>", "<span class='userdanger'>[user] has smothered you with \the [src]!</span>", "<span class='italics'>You hear some struggling and a heavy breath taken.</span>")
log_combat(user, C, "smothered", log_object)
else
@@ -107,7 +107,7 @@
reagents.clear_reagents()
else
msg += "'s liquids into \the [target]"
reagents.trans_to(target, reagents.total_volume)
reagents.trans_to(target, reagents.total_volume, log = TRUE)
to_chat(user, "<span class='notice'>[msg].</span>")
return TRUE

View File

@@ -81,6 +81,10 @@
else
reagents.trans_to(D, amount_per_transfer_from_this, 1/range)
D.color = mix_color_from_reagents(D.reagents.reagent_list)
var/turf/T = get_turf(src)
if(!T)
return
log_reagent("SPRAY: [key_name(usr)] fired [src] ([REF(src)]) [COORD(T)] at [A] ([REF(A)]) [COORD(A)] (chempuff: [D.reagents.log_string()])")
var/wait_step = max(round(2+ spray_delay * INVERSE(range)), 2)
last_spray = world.time
INVOKE_ASYNC(src, .proc/do_spray, A, wait_step, D, range, puff_reagent_left)

View File

@@ -113,7 +113,7 @@
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?
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this, log = TRUE) // transfer from, transfer to - who cares?
to_chat(user, "<span class='notice'>You fill [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.</span>")
if (round(reagents.total_volume, 0.1) >= reagents.maximum_volume)
@@ -158,7 +158,7 @@
L.log_message("injected themselves ([contained]) with [src.name]", LOG_ATTACK, color="orange")
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)
reagents.trans_to(target, amount_per_transfer_from_this, log = TRUE)
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

View File

@@ -182,7 +182,7 @@
if(W.reagents.has_reagent(/datum/reagent/fuel, W.max_fuel))
to_chat(user, "<span class='warning'>Your [W.name] is already full!</span>")
return
reagents.trans_to(W, W.max_fuel)
reagents.trans_to(W, W.max_fuel, log = TRUE)
user.visible_message("<span class='notice'>[user] refills [user.p_their()] [W.name].</span>", "<span class='notice'>You refill [W].</span>")
playsound(src, 'sound/effects/refill.ogg', 50, 1)
W.update_icon()

View File

@@ -36,6 +36,6 @@
log_combat(owner, null, "swallowed an implanted pill", target)
if(target.reagents.total_volume)
target.reagents.reaction(owner, INGEST)
target.reagents.trans_to(owner, target.reagents.total_volume)
target.reagents.trans_to(owner, target.reagents.total_volume, log = TRUE)
qdel(target)
return 1