mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Merge pull request #3339 from yogstation13/upstream-merge-41253
[MIRROR] Adds logging to reagent transfers
This commit is contained in:
@@ -889,7 +889,7 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/W = new /obj/item/reagent_containers/food/drinks/bottle/whiskey(H.loc)
|
||||
playsound(H.loc, 'sound/items/drink.ogg', rand(10,50), 1)
|
||||
W.reagents.trans_to(H, W.reagents.total_volume)
|
||||
W.reagents.trans_to(H, W.reagents.total_volume, transfered_by = user)
|
||||
user.visible_message("<span class='suicide'>[user] downs the contents of [W.name] in one gulp! Shoulda stuck to sudoku!</span>")
|
||||
|
||||
return(TOXLOSS)
|
||||
|
||||
@@ -310,7 +310,7 @@
|
||||
var/turf/trg = get_turf(target)
|
||||
var/obj/item/reagent_containers/syringe/mechsyringe = syringes[1]
|
||||
mechsyringe.forceMove(get_turf(chassis))
|
||||
reagents.trans_to(mechsyringe, min(mechsyringe.volume, reagents.total_volume))
|
||||
reagents.trans_to(mechsyringe, min(mechsyringe.volume, reagents.total_volume), transfered_by = chassis.occupant)
|
||||
syringes -= mechsyringe
|
||||
mechsyringe.icon = 'icons/obj/chemical.dmi'
|
||||
mechsyringe.icon_state = "syringeproj"
|
||||
@@ -338,7 +338,7 @@
|
||||
mechsyringe.icon_state = initial(mechsyringe.icon_state)
|
||||
mechsyringe.icon = initial(mechsyringe.icon)
|
||||
mechsyringe.reagents.reaction(M, INJECT)
|
||||
mechsyringe.reagents.trans_to(M, mechsyringe.reagents.total_volume)
|
||||
mechsyringe.reagents.trans_to(M, mechsyringe.reagents.total_volume, transfered_by = chassis.occupant)
|
||||
M.take_bodypart_damage(2)
|
||||
log_combat(originaloccupant, M, "shot", "syringegun")
|
||||
break
|
||||
@@ -466,7 +466,7 @@
|
||||
if(!(D.CanPass(S,src.loc)))
|
||||
occupant_message("Unable to load syringe.")
|
||||
return 0
|
||||
S.reagents.trans_to(src, S.reagents.total_volume)
|
||||
S.reagents.trans_to(src, S.reagents.total_volume, transfered_by = chassis.occupant)
|
||||
S.forceMove(src)
|
||||
syringes += S
|
||||
occupant_message("Syringe loaded.")
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
var/datum/reagents/R = new/datum/reagents(5)
|
||||
W.reagents = R
|
||||
R.my_atom = W
|
||||
reagents.trans_to(W,1)
|
||||
reagents.trans_to(W,1, transfered_by = chassis.occupant)
|
||||
for(var/b=0, b<4, b++)
|
||||
if(!W)
|
||||
return
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
to_chat(user, "<span class='notice'>[W] is full!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You scoop up [src] into [W]!</span>")
|
||||
reagents.trans_to(W, reagents.total_volume)
|
||||
reagents.trans_to(W, reagents.total_volume, transfered_by = user)
|
||||
if(!reagents.total_volume) //scooped up all of it
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
if(nutri_check.nutriment_factor >0)
|
||||
H.nutrition += nutri_check.nutriment_factor * nutri_check.volume
|
||||
reagents.remove_reagent(nutri_check.id,nutri_check.volume)
|
||||
reagents.trans_to(H, reagents.total_volume)
|
||||
reagents.trans_to(H, reagents.total_volume, transfered_by = user)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/decal/cleanable/vomit/old
|
||||
|
||||
@@ -148,7 +148,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
if(!proximity || lit) //can't dip if cigarette is lit (it will heat the reagents in the glass instead)
|
||||
return
|
||||
if(istype(glass)) //you can dip cigarettes into beakers
|
||||
if(glass.reagents.trans_to(src, chem_volume)) //if reagents were transfered, show the message
|
||||
if(glass.reagents.trans_to(src, chem_volume, transfered_by = user)) //if reagents were transfered, show the message
|
||||
to_chat(user, "<span class='notice'>You dip \the [src] into \the [glass].</span>")
|
||||
else //if not, either the beaker was empty, or the cigarette was full
|
||||
if(!glass.reagents.total_volume)
|
||||
@@ -440,7 +440,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
packeditem = 1
|
||||
name = "[O.name]-packed [initial(name)]"
|
||||
if(O.reagents)
|
||||
O.reagents.trans_to(src, O.reagents.total_volume)
|
||||
O.reagents.trans_to(src, O.reagents.total_volume, transfered_by = user)
|
||||
qdel(O)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>It has to be dried first!</span>")
|
||||
@@ -689,7 +689,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
if(O.dry)
|
||||
var/obj/item/clothing/mask/cigarette/rollie/R = new /obj/item/clothing/mask/cigarette/rollie(user.loc)
|
||||
R.chem_volume = target.reagents.total_volume
|
||||
target.reagents.trans_to(R, R.chem_volume)
|
||||
target.reagents.trans_to(R, R.chem_volume, transfered_by = user)
|
||||
qdel(target)
|
||||
qdel(src)
|
||||
user.put_in_active_hand(R)
|
||||
@@ -733,7 +733,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
if(O.is_drainable())
|
||||
if(reagents.total_volume < chem_volume)
|
||||
if(O.reagents.total_volume > 0)
|
||||
O.reagents.trans_to(src,25)
|
||||
O.reagents.trans_to(src,25, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You add the contents of [O] to [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[O] is empty!</span>")
|
||||
|
||||
@@ -407,7 +407,7 @@
|
||||
fraction /= affected_turfs.len
|
||||
for(var/t in affected_turfs)
|
||||
reagents.reaction(t, TOUCH, fraction * volume_multiplier)
|
||||
reagents.trans_to(t, ., volume_multiplier)
|
||||
reagents.trans_to(t, ., volume_multiplier, transfered_by = user)
|
||||
check_empty(user)
|
||||
|
||||
/obj/item/toy/crayon/attack(mob/M, mob/user)
|
||||
@@ -418,7 +418,7 @@
|
||||
return
|
||||
var/fraction = min(eaten / reagents.total_volume, 1)
|
||||
reagents.reaction(M, INGEST, fraction * volume_multiplier)
|
||||
reagents.trans_to(M, eaten, volume_multiplier)
|
||||
reagents.trans_to(M, eaten, volume_multiplier, transfered_by = user)
|
||||
// check_empty() is called during afterattack
|
||||
else
|
||||
..()
|
||||
@@ -581,7 +581,7 @@
|
||||
user.visible_message("<span class='suicide'>[user] shakes up [src] with a rattle and lifts it to [user.p_their()] mouth, spraying paint across [user.p_their()] teeth!</span>")
|
||||
user.say("WITNESS ME!!", forced="spraycan suicide")
|
||||
if(pre_noise || post_noise)
|
||||
playsound(loc, 'sound/effects/spray.ogg', 5, 1, 5)
|
||||
playsound(src, 'sound/effects/spray.ogg', 5, TRUE, 5)
|
||||
if(can_change_colour)
|
||||
paint_color = "#C0C0C0"
|
||||
update_icon()
|
||||
@@ -592,7 +592,7 @@
|
||||
var/used = use_charges(user, 10, FALSE)
|
||||
var/fraction = min(1, used / reagents.maximum_volume)
|
||||
reagents.reaction(user, VAPOR, fraction * volume_multiplier)
|
||||
reagents.trans_to(user, used, volume_multiplier)
|
||||
reagents.trans_to(user, used, volume_multiplier, transfered_by = user)
|
||||
|
||||
return (OXYLOSS)
|
||||
|
||||
@@ -661,7 +661,7 @@
|
||||
. = use_charges(user, 2)
|
||||
var/fraction = min(1, . / reagents.maximum_volume)
|
||||
reagents.reaction(target, TOUCH, fraction * volume_multiplier)
|
||||
reagents.trans_to(target, ., volume_multiplier)
|
||||
reagents.trans_to(target, ., volume_multiplier, transfered_by = user)
|
||||
|
||||
if(pre_noise || post_noise)
|
||||
playsound(user.loc, 'sound/effects/spray.ogg', 5, 1, 5)
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
safety = safety_save
|
||||
return 1
|
||||
var/obj/structure/reagent_dispensers/W = target //will it work?
|
||||
var/transferred = W.reagents.trans_to(src, max_water)
|
||||
var/transferred = W.reagents.trans_to(src, max_water, transfered_by = user)
|
||||
if(transferred > 0)
|
||||
to_chat(user, "<span class='notice'>\The [src] has been refilled by [transferred] units.</span>")
|
||||
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
@@ -170,7 +170,7 @@
|
||||
var/datum/reagents/R = new/datum/reagents(5)
|
||||
W.reagents = R
|
||||
R.my_atom = W
|
||||
reagents.trans_to(W,1)
|
||||
reagents.trans_to(W,1, transfered_by = user)
|
||||
|
||||
//Make em move dat ass, hun
|
||||
addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_particles, water_particles), 2)
|
||||
|
||||
@@ -504,7 +504,7 @@
|
||||
return
|
||||
if(prob(30) && ishuman(A))
|
||||
var/mob/living/carbon/human/H = A
|
||||
user.reagents.trans_to(H, user.reagents.total_volume, 1, 1, 0)
|
||||
user.reagents.trans_to(H, user.reagents.total_volume, 1, 1, 0, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>Your pride reflects on [H].</span>")
|
||||
to_chat(H, "<span class='userdanger'>You feel insecure, taking on [user]'s burden.</span>")
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
if(!proximity)
|
||||
return
|
||||
if(!status && O.is_refillable())
|
||||
reagents.trans_to(O, reagents.total_volume)
|
||||
reagents.trans_to(O, reagents.total_volume, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You empty [src]'s fuel tank into [O].</span>")
|
||||
update_icon()
|
||||
if(isOn())
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
else if(reagents.total_volume >= 10)
|
||||
to_chat(user, "<span class='warning'>[src] is full.</span>")
|
||||
else
|
||||
A.reagents.trans_to(src, 10)
|
||||
A.reagents.trans_to(src, 10, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You fill the balloon with the contents of [A].</span>")
|
||||
desc = "A translucent balloon with some form of liquid sloshing around in it."
|
||||
update_icon()
|
||||
@@ -76,7 +76,7 @@
|
||||
else
|
||||
desc = "A translucent balloon with some form of liquid sloshing around in it."
|
||||
to_chat(user, "<span class='notice'>You fill the balloon with the contents of [I].</span>")
|
||||
I.reagents.trans_to(src, 10)
|
||||
I.reagents.trans_to(src, 10, transfered_by = user)
|
||||
update_icon()
|
||||
else if(I.is_sharp())
|
||||
balloon_burst()
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
return 0
|
||||
else
|
||||
var/obj/item/mop/M = mop
|
||||
reagents.trans_to(mop, M.mopcap)
|
||||
reagents.trans_to(mop, M.mopcap, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You wet [mop] in [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
return 1
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
if(reagents.total_volume < 1)
|
||||
to_chat(user, "[src] is out of water!</span>")
|
||||
else
|
||||
reagents.trans_to(I, 5)
|
||||
reagents.trans_to(I, 5, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You wet [I] in [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
update_icon()
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
clear_reagents_to_vomit_pool(M,V)
|
||||
|
||||
/proc/clear_reagents_to_vomit_pool(mob/living/carbon/M, obj/effect/decal/cleanable/vomit/V)
|
||||
M.reagents.trans_to(V, M.reagents.total_volume / 10)
|
||||
M.reagents.trans_to(V, M.reagents.total_volume / 10, transfered_by = M)
|
||||
for(var/datum/reagent/R in M.reagents.reagent_list) //clears the stomach of anything that might be digested as food
|
||||
if(istype(R, /datum/reagent/consumable))
|
||||
var/datum/reagent/consumable/nutri_check = R
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
var/log_object = "a damp rag containing [reagentlist]"
|
||||
if(user.a_intent == INTENT_HARM && !C.is_mouth_covered())
|
||||
reagents.reaction(C, INGEST)
|
||||
reagents.trans_to(C, reagents.total_volume)
|
||||
reagents.trans_to(C, reagents.total_volume, transfered_by = user)
|
||||
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 muffled cries of surprise.</span>")
|
||||
log_combat(user, C, "smothered", log_object)
|
||||
else
|
||||
|
||||
@@ -51,7 +51,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, transfered_by = user)
|
||||
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
||||
return 1
|
||||
|
||||
@@ -70,7 +70,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, transfered_by = user)
|
||||
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
|
||||
@@ -91,7 +91,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, transfered_by = user)
|
||||
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)
|
||||
@@ -410,14 +410,14 @@
|
||||
sleep(10)
|
||||
H.visible_message("<span class='suicide'>[H] takes a big sip from [src]! It looks like [H.p_theyre()] trying to commit suicide!</span>")
|
||||
playsound(H,'sound/items/drink.ogg', 80, 1)
|
||||
reagents.trans_to(H, src.reagents.total_volume) //a big sip
|
||||
reagents.trans_to(H, src.reagents.total_volume, transfered_by = H) //a big sip
|
||||
sleep(5)
|
||||
H.say(pick("Now, Outbomb Cuban Pete, THAT was a game.", "All these new fangled arcade games are too slow. I prefer the classics.", "They don't make 'em like Orion Trail anymore.", "You know what they say. Worst day of spess carp fishing is better than the best day at work.", "They don't make 'em like good old fashioned singularity engines anymore."))
|
||||
if(H.age >= 40)
|
||||
H.Stun(50)
|
||||
sleep(50)
|
||||
playsound(H,'sound/items/drink.ogg', 80, 1)
|
||||
H.say(pick("Another day, another dollar.", "I wonder if I should hold?", "Diversifying is for young'ns.", "Yeap, times were good back then."))
|
||||
H.say(pick("Another day, another dollar.", "I wonder if I should hold?", "Diversifying is for young'ns.", "Yeap, times were good back then."))
|
||||
return MANUAL_SUICIDE
|
||||
sleep(20) //dramatic pause
|
||||
return TOXLOSS
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
var/fraction = min(10/reagents.total_volume, 1)
|
||||
reagents.reaction(M, INGEST, fraction)
|
||||
reagents.trans_to(M, 10)
|
||||
reagents.trans_to(M, 10, transfered_by = user)
|
||||
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
||||
return 1
|
||||
|
||||
@@ -71,7 +71,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, transfered_by = user)
|
||||
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.
|
||||
@@ -82,7 +82,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, transfered_by = user)
|
||||
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)
|
||||
@@ -258,7 +258,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, transfered_by = user)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/reagent_containers/food/condiment/pack/on_reagent_change(changetype)
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
S.generate_trash(get_turf(user))
|
||||
ingredients += S
|
||||
mix_filling_color(S)
|
||||
S.reagents.trans_to(src,min(S.reagents.total_volume, 15)) //limit of 15, we don't want our custom food to be completely filled by just one ingredient with large reagent volume.
|
||||
S.reagents.trans_to(src,min(S.reagents.total_volume, 15), transfered_by = user) //limit of 15, we don't want our custom food to be completely filled by just one ingredient with large reagent volume.
|
||||
foodtype |= S.foodtype
|
||||
update_overlays(S)
|
||||
to_chat(user, "<span class='notice'>You add the [I.name] to the [name].</span>")
|
||||
@@ -81,7 +81,7 @@
|
||||
/obj/item/reagent_containers/food/snacks/customizable/proc/initialize_custom_food(obj/item/BASE, obj/item/I, mob/user)
|
||||
if(istype(BASE, /obj/item/reagent_containers))
|
||||
var/obj/item/reagent_containers/RC = BASE
|
||||
RC.reagents.trans_to(src,RC.reagents.total_volume)
|
||||
RC.reagents.trans_to(src,RC.reagents.total_volume, transfered_by = user)
|
||||
for(var/obj/O in BASE.contents)
|
||||
contents += O
|
||||
if(I && user)
|
||||
@@ -251,7 +251,7 @@
|
||||
to_chat(user, "<span class='notice'>You finish the [src.name].</span>")
|
||||
finished = 1
|
||||
name = "[customname] sandwich"
|
||||
BS.reagents.trans_to(src, BS.reagents.total_volume)
|
||||
BS.reagents.trans_to(src, BS.reagents.total_volume, transfered_by = user)
|
||||
ingMax = ingredients.len //can't add more ingredients after that
|
||||
var/mutable_appearance/TOP = mutable_appearance(icon, "[BS.icon_state]")
|
||||
TOP.pixel_y = 2 * ingredients.len + 3
|
||||
|
||||
@@ -142,7 +142,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, transfered_by = user)
|
||||
bitecount++
|
||||
On_Consume(M)
|
||||
checkLiked(fraction, M)
|
||||
|
||||
@@ -79,7 +79,7 @@ God bless America.
|
||||
to_chat(user, "<span class='warning'>There's nothing to dissolve [I] in!</span>")
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] drops [I] into [src].</span>", "<span class='notice'>You dissolve [I] in [src].</span>")
|
||||
I.reagents.trans_to(src, I.reagents.total_volume)
|
||||
I.reagents.trans_to(src, I.reagents.total_volume, transfered_by = user)
|
||||
qdel(I)
|
||||
return
|
||||
if(!reagents.has_reagent("cooking_oil"))
|
||||
|
||||
@@ -101,8 +101,6 @@
|
||||
visible_message("[icon2html(src, viewers(src))] <span class='info'>[user] scoops delicious [flavour_name] ice cream into [I].</span>")
|
||||
product_types[dispense_flavour] -= 1
|
||||
I.add_ice_cream(flavour_name)
|
||||
// if(beaker)
|
||||
// beaker.reagents.trans_to(I, 10)
|
||||
if(I.reagents.total_volume < 10)
|
||||
I.reagents.add_reagent("sugar", 10 - I.reagents.total_volume)
|
||||
else
|
||||
|
||||
@@ -723,7 +723,7 @@
|
||||
var/datum/reagents/S = new /datum/reagents() //This is a strange way, but I don't know of a better one so I can't fix it at the moment...
|
||||
S.my_atom = H
|
||||
|
||||
reagent_source.reagents.trans_to(S,split)
|
||||
reagent_source.reagents.trans_to(S,split, transfered_by = user)
|
||||
if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill))
|
||||
qdel(reagent_source)
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
if(..())
|
||||
if(reagents.total_volume)
|
||||
if(M.reagents)
|
||||
reagents.trans_to(M, reagents.total_volume)
|
||||
reagents.trans_to(M, reagents.total_volume, transfered_by = user)
|
||||
|
||||
|
||||
/obj/item/pen/sleepy/Initialize()
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
BB.suppressed = quiet
|
||||
|
||||
if(reagents && BB.reagents)
|
||||
reagents.trans_to(BB, reagents.total_volume) //For chemical darts/bullets
|
||||
reagents.trans_to(BB, reagents.total_volume, transfered_by = user) //For chemical darts/bullets
|
||||
qdel(reagents)
|
||||
|
||||
/obj/item/ammo_casing/proc/throw_proj(atom/target, turf/targloc, mob/living/user, params, spread)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
var/obj/item/reagent_containers/syringe/S = SG.syringes[1]
|
||||
|
||||
S.reagents.trans_to(BB, S.reagents.total_volume)
|
||||
S.reagents.trans_to(BB, S.reagents.total_volume, transfered_by = user)
|
||||
BB.name = S.name
|
||||
var/obj/item/projectile/bullet/dart/D = BB
|
||||
D.piercing = S.proj_piercing
|
||||
@@ -35,7 +35,7 @@
|
||||
var/obj/item/gun/chem/CG = loc
|
||||
if(CG.syringes_left <= 0)
|
||||
return
|
||||
CG.reagents.trans_to(BB, 15)
|
||||
CG.reagents.trans_to(BB, 15, transfered_by = user)
|
||||
BB.name = "chemical dart"
|
||||
CG.syringes_left--
|
||||
..()
|
||||
|
||||
@@ -80,9 +80,10 @@
|
||||
return "no reagents"
|
||||
|
||||
var/list/data = list()
|
||||
var/seperator
|
||||
for(var/r in reagent_list) //no reagents will be left behind
|
||||
var/datum/reagent/R = r
|
||||
data += "[R.id] ([round(R.volume, 0.1)]u)"
|
||||
data += "[seperator ? " | " : null][R.id] ([round(R.volume, 0.1)]u)"
|
||||
//Using IDs because SOME chemicals (I'm looking at you, chlorhydrate-beer) have the same names as other chemicals.
|
||||
return english_list(data)
|
||||
|
||||
@@ -160,7 +161,7 @@
|
||||
|
||||
return master
|
||||
|
||||
/datum/reagents/proc/trans_to(obj/target, amount=1, multiplier=1, preserve_data=1, no_react = 0)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
/datum/reagents/proc/trans_to(obj/target, amount=1, multiplier=1, preserve_data=1, no_react = 0, mob/transfered_by)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
var/list/cached_reagents = reagent_list
|
||||
if(!target || !total_volume)
|
||||
return
|
||||
@@ -174,6 +175,11 @@
|
||||
if(!target.reagents)
|
||||
return
|
||||
R = target.reagents
|
||||
|
||||
if(transfered_by)
|
||||
target.add_hiddenprint(transfered_by) //log prints so admins can figure out who touched it last.
|
||||
log_combat(transfered_by, target, "transferred reagents ([log_list()]) from [my_atom] to")
|
||||
|
||||
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
|
||||
var/part = amount / src.total_volume
|
||||
var/trans_data = null
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
P = new(drop_location())
|
||||
P.name = trim("[name] pill")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P,vol_each)
|
||||
reagents.trans_to(P,vol_each, transfered_by = usr)
|
||||
else
|
||||
var/name = stripped_input(usr, "Name:", "Name your pack!", reagents.get_master_reagent_name(), MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
|
||||
@@ -242,7 +242,7 @@
|
||||
P.originalname = name
|
||||
P.name = trim("[name] pack")
|
||||
P.desc = "A small condiment pack. The label says it contains [name]."
|
||||
reagents.trans_to(P,10)
|
||||
reagents.trans_to(P,10, transfered_by = usr)
|
||||
. = TRUE
|
||||
|
||||
if("createPatch")
|
||||
@@ -265,7 +265,7 @@
|
||||
P = new/obj/item/reagent_containers/pill/patch(drop_location())
|
||||
P.name = trim("[name] patch")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P,vol_each)
|
||||
reagents.trans_to(P,vol_each, transfered_by = usr)
|
||||
. = TRUE
|
||||
|
||||
if("createBottle")
|
||||
@@ -280,7 +280,7 @@
|
||||
var/obj/item/reagent_containers/food/condiment/P = new(drop_location())
|
||||
P.originalname = name
|
||||
P.name = trim("[name] bottle")
|
||||
reagents.trans_to(P, P.volume)
|
||||
reagents.trans_to(P, P.volume, transfered_by = usr)
|
||||
else
|
||||
var/amount_full = 0
|
||||
var/vol_part = min(reagents.total_volume, 30)
|
||||
@@ -296,13 +296,13 @@
|
||||
P = new/obj/item/reagent_containers/glass/bottle(drop_location())
|
||||
P.name = trim("[name] bottle")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, 30)
|
||||
reagents.trans_to(P, 30, transfered_by = usr)
|
||||
|
||||
if(vol_part)
|
||||
P = new/obj/item/reagent_containers/glass/bottle(drop_location())
|
||||
P.name = trim("[name] bottle")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_part)
|
||||
reagents.trans_to(P, vol_part, transfered_by = usr)
|
||||
. = TRUE
|
||||
|
||||
if("analyze")
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
beaker.reagents.add_reagent_list(I.juice_results)
|
||||
remove_object(I)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/grind()
|
||||
/obj/machinery/reagentgrinder/proc/grind(mob/user)
|
||||
power_change()
|
||||
if(!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
|
||||
return
|
||||
@@ -282,15 +282,15 @@
|
||||
break
|
||||
var/obj/item/I = i
|
||||
if(I.grind_results)
|
||||
grind_item(i)
|
||||
grind_item(i, user)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/grind_item(obj/item/I) //Grind results can be found in respective object definitions
|
||||
/obj/machinery/reagentgrinder/proc/grind_item(obj/item/I, mob/user) //Grind results can be found in respective object definitions
|
||||
if(I.on_grind(src) == -1) //Call on_grind() to change amount as needed, and stop grinding the item if it returns -1
|
||||
to_chat(usr, "<span class='danger'>[src] shorts out as it tries to grind up [I], and transfers it back to storage.</span>")
|
||||
return
|
||||
beaker.reagents.add_reagent_list(I.grind_results)
|
||||
if(I.reagents)
|
||||
I.reagents.trans_to(beaker, I.reagents.total_volume)
|
||||
I.reagents.trans_to(beaker, I.reagents.total_volume, transfered_by = user)
|
||||
remove_object(I)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/mix(mob/user)
|
||||
|
||||
@@ -82,10 +82,9 @@
|
||||
add_fingerprint(user)
|
||||
if(istype(I, /obj/item/reagent_containers) && I.is_open_container())
|
||||
var/obj/item/reagent_containers/RC = I
|
||||
var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this)
|
||||
var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this, transfered_by = user)
|
||||
if(units)
|
||||
to_chat(user, "<span class='notice'>You transfer [units] units of the solution to [src].</span>")
|
||||
log_combat(usr, src, "has added [english_list(RC.reagents.reagent_list)] to [src]")
|
||||
return
|
||||
if(default_unfasten_wrench(user, I, 40))
|
||||
on = FALSE
|
||||
|
||||
@@ -105,7 +105,7 @@ Borg Hypospray
|
||||
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)
|
||||
var/trans = R.trans_to(M, amount_per_transfer_from_this, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>[trans] unit\s injected. [R.total_volume] unit\s remaining.</span>")
|
||||
|
||||
var/list/injected = list()
|
||||
@@ -211,7 +211,7 @@ Borg Shaker
|
||||
to_chat(user, "<span class='notice'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = R.trans_to(target, amount_per_transfer_from_this)
|
||||
var/trans = R.trans_to(target, amount_per_transfer_from_this, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution to [target].</span>")
|
||||
|
||||
/obj/item/reagent_containers/borghypo/borgshaker/DescribeContents()
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
safe_thing.create_reagents(100)
|
||||
|
||||
reagents.reaction(safe_thing, TOUCH, fraction)
|
||||
trans = reagents.trans_to(safe_thing, amount_per_transfer_from_this)
|
||||
trans = reagents.trans_to(safe_thing, amount_per_transfer_from_this, transfered_by = user)
|
||||
|
||||
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>")
|
||||
@@ -83,12 +83,14 @@
|
||||
viruslist += "\]"
|
||||
// yogs end
|
||||
log_combat(user, M, "squirted", R)
|
||||
|
||||
// yogs start - Adds logs if it is viruslist
|
||||
if(viruslist)
|
||||
investigate_log("[user.real_name] ([user.ckey]) injected [M.real_name] ([M.ckey]) using a projectile with [viruslist]", INVESTIGATE_VIROLOGY)
|
||||
log_game("[user.real_name] ([user.ckey]) injected [M.real_name] ([M.ckey]) with [viruslist]")
|
||||
// yogs end
|
||||
trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
|
||||
trans = src.reagents.trans_to(target, amount_per_transfer_from_this, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution.</span>")
|
||||
update_icon()
|
||||
|
||||
@@ -102,7 +104,7 @@
|
||||
to_chat(user, "<span class='warning'>[target] is empty!</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, transfered_by = user)
|
||||
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] unit\s of the solution.</span>")
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
to_chat(user, "<span class='warning'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
var/trans = reagents.trans_to(target, amount_per_transfer_from_this, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution to [target].</span>")
|
||||
|
||||
else if(target.is_drainable()) //A dispenser. Transfer FROM it TO us.
|
||||
@@ -77,7 +77,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, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] unit\s of the contents of [target].</span>")
|
||||
|
||||
else if(reagents.total_volume)
|
||||
@@ -100,7 +100,7 @@
|
||||
to_chat(user, "<span class='notice'>[src] is full.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You break [E] in [src].</span>")
|
||||
E.reagents.trans_to(src, E.reagents.total_volume)
|
||||
E.reagents.trans_to(src, E.reagents.total_volume, transfered_by = user)
|
||||
qdel(E)
|
||||
return
|
||||
..()
|
||||
@@ -273,7 +273,7 @@
|
||||
if(reagents.total_volume < 1)
|
||||
to_chat(user, "<span class='warning'>[src] is out of water!</span>")
|
||||
else
|
||||
reagents.trans_to(O, 5)
|
||||
reagents.trans_to(O, 5, transfered_by = user)
|
||||
to_chat(user, "<span class='notice'>You wet [O] in [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
else if(isprox(O))
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
// yogs end
|
||||
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, transfered_by = user)
|
||||
else
|
||||
trans = reagents.copy_to(M, amount_per_transfer_from_this)
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
playsound(src, 'sound/effects/spray2.ogg', 50, 1, -6)
|
||||
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
|
||||
reagents.reaction(M, apply_type, fraction)
|
||||
reagents.trans_to(M, amount_per_transfer_from_this)
|
||||
reagents.trans_to(M, amount_per_transfer_from_this, transfered_by = user)
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/medspray/styptic
|
||||
|
||||
@@ -47,10 +47,9 @@
|
||||
"<span class='userdanger'>[user] forces [M] to [apply_method] [src].</span>")
|
||||
|
||||
|
||||
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, transfered_by = user)
|
||||
qdel(src)
|
||||
return 1
|
||||
|
||||
@@ -72,7 +71,7 @@
|
||||
to_chat(user, "<span class='notice'>You dissolve [src] in [target].</span>")
|
||||
for(var/mob/O in viewers(2, user)) //viewers is necessary here because of the small radius
|
||||
to_chat(O, "<span class='warning'>[user] slips something into [target]!</span>")
|
||||
reagents.trans_to(target, reagents.total_volume)
|
||||
reagents.trans_to(target, reagents.total_volume, transfered_by = user)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/reagent_containers/pill/tox
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
to_chat(user, "<span class='warning'>[src] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = A.reagents.trans_to(src, 50) //transfer 50u , using the spray's transfer amount would take too long to refill
|
||||
var/trans = A.reagents.trans_to(src, 50, transfered_by = user) //transfer 50u , using the spray's transfer amount would take too long to refill
|
||||
to_chat(user, "<span class='notice'>You fill \the [src] with [trans] units of the contents of \the [A].</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -101,7 +101,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, transfered_by = user) // 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 (reagents.total_volume >= reagents.maximum_volume)
|
||||
@@ -163,7 +163,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, transfered_by = user)
|
||||
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
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
if(W.reagents.has_reagent("welding_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, transfered_by = user)
|
||||
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()
|
||||
|
||||
@@ -144,7 +144,7 @@ To add a crossbreed:
|
||||
to_chat(user, "<span class='warning'>This can only be used on yourself.</span>")
|
||||
return
|
||||
if(reagents.total_volume && (ignore_flags || M.can_inject(user, 1)))
|
||||
reagents.trans_to(M, reagents.total_volume)
|
||||
reagents.trans_to(M, reagents.total_volume, transfered_by = user)
|
||||
if(user != M)
|
||||
to_chat(M, "<span class='warning'>[user] presses [src] against you!</span>")
|
||||
to_chat(user, "<span class='notice'>You press [src] against [M], injecting [M.p_them()].</span>")
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
|
||||
/datum/action/item_action/hands_free/activate_pill/Trigger()
|
||||
if(!..())
|
||||
return 0
|
||||
return FALSE
|
||||
to_chat(owner, "<span class='caution'>You grit your teeth and burst the implanted [target.name]!</span>")
|
||||
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, transfered_by = owner)
|
||||
qdel(target)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user