more reasonable
This commit is contained in:
@@ -146,7 +146,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, log = "cigar fill: dip cigarette")) //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)
|
||||
@@ -154,7 +154,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src] is full.</span>")
|
||||
|
||||
|
||||
/obj/item/clothing/mask/cigarette/proc/light(flavor_text = null)
|
||||
if(lit)
|
||||
return
|
||||
@@ -438,7 +437,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, log = "cigar fill: pipe pack")
|
||||
qdel(O)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>It has to be dried first!</span>")
|
||||
@@ -687,7 +686,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, log = "cigar fill: rolling paper afterattack")
|
||||
qdel(target)
|
||||
qdel(src)
|
||||
user.put_in_active_hand(R)
|
||||
@@ -903,7 +902,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
|
||||
//Transfer reagents and remove the plant
|
||||
user.show_message("<span class='notice'>You stuff the [DP] into the [src]'s bowl.</span>", MSG_VISUAL)
|
||||
DP.reagents.trans_to(src, 100)
|
||||
DP.reagents.trans_to(src, 100, log = "cigar fill: bong")
|
||||
qdel(DP)
|
||||
return
|
||||
else
|
||||
|
||||
@@ -171,7 +171,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, log = FALSE)//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
|
||||
@@ -199,8 +199,11 @@
|
||||
R.add_reagent(T.type, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE, ignore_pH = TRUE) //we only handle reaction after every reagent has been transfered.
|
||||
remove_reagent(T.type, transfer_amount, ignore_pH = TRUE)
|
||||
|
||||
var/location_string = "FROM [(us && "[us] [COORD(us)]") || "NULL"] TO [(them && "[them] [COORD(them)]") || "NULL"]"
|
||||
log_reagent_transfer("[location_string] - [key_name(usr)]: trans_to with arguments [target] [amount] [multiplier] [preserve_data] [no_react] and reagents [english_list(trasnferred)]")
|
||||
if(log && amount > 0)
|
||||
var/atom/us = my_atom
|
||||
var/atom/them = their_atom
|
||||
var/location_string = "FROM [(us && "[us] [COORD(us)]") || "NULL"] TO [(them && "[them] [COORD(them)]") || "NULL"]"
|
||||
log_reagent_transfer("[location_string] - [key_name(usr)][istext(log) && [" - [log]"]]: trans_to with arguments [target] [amount] [multiplier] [preserve_data] [no_react] and reagents [english_list(trasnferred)]")
|
||||
|
||||
update_total()
|
||||
R.update_total()
|
||||
@@ -240,7 +243,7 @@
|
||||
src.handle_reactions()
|
||||
return amount
|
||||
|
||||
/datum/reagents/proc/trans_id_to(obj/target, reagent, amount=1, preserve_data=1)//Not sure why this proc didn't exist before. It does now! /N
|
||||
/datum/reagents/proc/trans_id_to(obj/target, reagent, amount = 1, preserve_data = TRUE, log = FALSE)//Not sure why this proc didn't exist before. It does now! /N
|
||||
var/list/cached_reagents = reagent_list
|
||||
if (!target)
|
||||
return
|
||||
@@ -261,10 +264,11 @@
|
||||
trans_data = current_reagent.data
|
||||
R.add_reagent(current_reagent.type, amount, trans_data, chem_temp, current_reagent.purity, pH, no_react = TRUE)
|
||||
remove_reagent(current_reagent.type, amount, 1)
|
||||
var/atom/us = my_atom
|
||||
var/atom/them = their_atom
|
||||
var/location_string = "FROM [(us && "[us] [COORD(us)]") || "NULL"] TO [(them && "[them] [COORD(them)]") || "NULL"]"
|
||||
log_reagent_transfer("[location_string] - [key_name(usr)]: trans_id_to with arguments [target] [reagent] [amount] [preserve_data]")
|
||||
if(log && amount > 0)
|
||||
var/atom/us = my_atom
|
||||
var/atom/them = their_atom
|
||||
var/location_string = "FROM [(us && "[us] [COORD(us)]") || "NULL"] TO [(them && "[them] [COORD(them)]") || "NULL"]"
|
||||
log_reagent_transfer("[location_string] - [key_name(usr)][istext(log) && [" - [log]"]: trans_id_to with arguments [target] [reagent] [amount] [preserve_data]")
|
||||
break
|
||||
|
||||
src.update_total()
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
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)
|
||||
addtimer(CALLBACK(reagents, /datum/reagents.proc/trans_to, M, 5), 5)
|
||||
addtimer(CALLBACK(reagents, /datum/reagents.proc/trans_to, M, 5, log = "feed/swallow"), 5)
|
||||
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
||||
|
||||
/obj/item/reagent_containers/glass/afterattack(obj/target, mob/user, proximity)
|
||||
@@ -66,7 +66,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, log = "reagentcontainer-glass afterattack transfer to")
|
||||
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.
|
||||
@@ -78,7 +78,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 = "reagentcontainer-glass afterattack fill from")
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] unit\s of the contents of [target].</span>")
|
||||
|
||||
else if(reagents.total_volume)
|
||||
@@ -101,7 +101,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, log = "reagentcontainer-glass break egg in")
|
||||
qdel(E)
|
||||
return
|
||||
..()
|
||||
@@ -298,7 +298,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, log = "reagentcontainer-bucket fill mop")
|
||||
to_chat(user, "<span class='notice'>You wet [O] in [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
else if(isprox(O))
|
||||
|
||||
Reference in New Issue
Block a user