More Reagent Cleanup

This commit is contained in:
Fox-McCloud
2016-07-22 05:49:45 -04:00
parent 212ba735ad
commit 44ffbd0667
32 changed files with 382 additions and 494 deletions
+73 -84
View File
@@ -10,6 +10,8 @@ var/const/INGEST = 2
var/total_volume = 0
var/maximum_volume = 100
var/atom/my_atom = null
var/chem_temp = 300
var/list/datum/reagent/addiction_list = new/list()
/datum/reagents/New(maximum=100)
maximum_volume = maximum
@@ -56,17 +58,19 @@ var/const/INGEST = 2
current_list_element = rand(1,reagent_list.len)
while(total_transfered != amount)
if(total_transfered >= amount) break
if(total_volume <= 0 || !reagent_list.len) break
if(total_transfered >= amount)
break
if(total_volume <= 0 || !reagent_list.len)
break
if(current_list_element > reagent_list.len) current_list_element = 1
var/datum/reagent/current_reagent = reagent_list[current_list_element]
src.remove_reagent(current_reagent.id, min(1, amount - total_transfered))
remove_reagent(current_reagent.id, min(1, amount - total_transfered))
current_list_element++
total_transfered++
src.update_total()
update_total()
handle_reactions()
return total_transfered
@@ -94,7 +98,7 @@ var/const/INGEST = 2
/datum/reagents/proc/trans_to(target, amount=1, multiplier=1, preserve_data=1)//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.
if(!target)
return
if(src.total_volume <= 0)
if(total_volume <= 0)
return
var/datum/reagents/R
if(istype(target, /obj))
@@ -102,7 +106,7 @@ var/const/INGEST = 2
if(!O.reagents )
return
R = O.reagents
else if(istype(target, /mob/living))
else if(isliving(target))
var/mob/living/M = target
if(!M.reagents)
return
@@ -112,10 +116,10 @@ var/const/INGEST = 2
else
return
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
var/part = amount / src.total_volume
amount = min(min(amount, total_volume), R.maximum_volume-R.total_volume)
var/part = amount / total_volume
var/trans_data = null
for(var/datum/reagent/current_reagent in src.reagent_list)
for(var/datum/reagent/current_reagent in reagent_list)
if(!current_reagent)
continue
if(current_reagent.id == "blood" && ishuman(target))
@@ -126,59 +130,59 @@ var/const/INGEST = 2
if(preserve_data)
trans_data = copy_data(current_reagent)
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data, src.chem_temp)
src.remove_reagent(current_reagent.id, current_reagent_transfer)
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data, chem_temp)
remove_reagent(current_reagent.id, current_reagent_transfer)
src.update_total()
update_total()
R.update_total()
R.handle_reactions()
src.handle_reactions()
handle_reactions()
return amount
/datum/reagents/proc/copy_to(obj/target, amount=1, multiplier=1, preserve_data=1, safety = 0)
if(!target)
return
if(!target.reagents || src.total_volume<=0)
if(!target.reagents || total_volume<=0)
return
var/datum/reagents/R = target.reagents
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
var/part = amount / src.total_volume
amount = min(min(amount, total_volume), R.maximum_volume-R.total_volume)
var/part = amount / total_volume
var/trans_data = null
for(var/datum/reagent/current_reagent in src.reagent_list)
for(var/datum/reagent/current_reagent in reagent_list)
var/current_reagent_transfer = current_reagent.volume * part
if(preserve_data)
trans_data = copy_data(current_reagent)
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
src.update_total()
update_total()
R.update_total()
R.handle_reactions()
src.handle_reactions()
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
if(!target)
return
if(!target.reagents || src.total_volume<=0 || !src.get_reagent_amount(reagent))
if(!target.reagents || total_volume<=0 || !get_reagent_amount(reagent))
return
var/datum/reagents/R = target.reagents
if(src.get_reagent_amount(reagent)<amount)
amount = src.get_reagent_amount(reagent)
if(get_reagent_amount(reagent)<amount)
amount = get_reagent_amount(reagent)
amount = min(amount, R.maximum_volume-R.total_volume)
var/trans_data = null
for(var/datum/reagent/current_reagent in src.reagent_list)
for(var/datum/reagent/current_reagent in reagent_list)
if(current_reagent.id == reagent)
if(preserve_data)
trans_data = copy_data(current_reagent)
R.add_reagent(current_reagent.id, amount, trans_data, src.chem_temp)
src.remove_reagent(current_reagent.id, amount, 1)
R.add_reagent(current_reagent.id, amount, trans_data, chem_temp)
remove_reagent(current_reagent.id, amount, 1)
break
src.update_total()
update_total()
R.update_total()
R.handle_reactions()
//src.handle_reactions() Don't need to handle reactions on the source since you're (presumably isolating and) transferring a specific reagent.
//handle_reactions() Don't need to handle reactions on the source since you're (presumably isolating and) transferring a specific reagent.
return amount
/*
@@ -201,11 +205,11 @@ var/const/INGEST = 2
if(preserve_data)
trans_data = current_reagent.data
R.add_reagent(current_reagent.id, (1 * multiplier), trans_data)
src.remove_reagent(current_reagent.id, 1)
remove_reagent(current_reagent.id, 1)
current_list_element++
total_transfered++
src.update_total()
update_total()
R.update_total()
R.handle_reactions()
handle_reactions()
@@ -225,19 +229,18 @@ var/const/INGEST = 2
update_total()
/datum/reagents/proc/handle_reactions()
if(my_atom.flags & NOREACT) return //Yup, no reactions here. No siree.
if(my_atom.flags & NOREACT)
return //Yup, no reactions here. No siree.
var/reaction_occured = 0
do
reaction_occured = 0
for(var/datum/reagent/R in reagent_list) // Usually a small list
for(var/reaction in chemical_reactions_list[R.id]) // Was a big list but now it should be smaller since we filtered it with our reagent id
if(!reaction)
continue
var/datum/chemical_reaction/C = reaction
var/total_required_reagents = C.required_reagents.len
var/total_matching_reagents = 0
var/total_required_catalysts = C.required_catalysts.len
@@ -248,11 +251,13 @@ var/const/INGEST = 2
var/min_temp = C.min_temp //Minimum temperature required for the reaction to occur (heat to/above this)
var/max_temp = C.max_temp //Maximum temperature allowed for the reaction to occur (cool to/below this)
for(var/B in C.required_reagents)
if(!has_reagent(B, C.required_reagents[B])) break
if(!has_reagent(B, C.required_reagents[B]))
break
total_matching_reagents++
multipliers += round(get_reagent_amount(B) / C.required_reagents[B])
for(var/B in C.required_catalysts)
if(!has_reagent(B, C.required_catalysts[B])) break
if(!has_reagent(B, C.required_catalysts[B]))
break
total_matching_catalysts++
if(!C.required_container)
@@ -265,17 +270,11 @@ var/const/INGEST = 2
if(!C.required_other)
matching_other = 1
else
/*if(istype(my_atom, /obj/item/slime_core))
var/obj/item/slime_core/M = my_atom
else if(istype(my_atom, /obj/item/slime_extract))
var/obj/item/slime_extract/M = my_atom
if(M.POWERFLAG == C.required_other && M.Uses > 0) // added a limit to slime cores -- Muskets requested this
matching_other = 1*/
if(istype(my_atom, /obj/item/slime_extract))
var/obj/item/slime_extract/M = my_atom
if(M.Uses > 0) // added a limit to slime cores -- Muskets requested this
matching_other = 1
if(M.Uses > 0) // added a limit to slime cores -- Muskets requested this
matching_other = 1
if(min_temp == 0)
min_temp = chem_temp
@@ -302,14 +301,14 @@ var/const/INGEST = 2
var/list/seen = viewers(4, get_turf(my_atom))
for(var/mob/M in seen)
if(!C.no_message)
to_chat(M, "\blue [bicon(my_atom)] [C.mix_message]")
to_chat(M, "<span class='notice'>[bicon(my_atom)] [C.mix_message]</span>")
if(istype(my_atom, /obj/item/slime_extract))
var/obj/item/slime_extract/ME2 = my_atom
ME2.Uses--
if(ME2.Uses <= 0) // give the notification that the slime core is dead
for(var/mob/M in seen)
to_chat(M, "\blue [bicon(my_atom)] The [my_atom]'s power is consumed in the reaction.")
to_chat(M, "<span class='notice'>[bicon(my_atom)] The [my_atom]'s power is consumed in the reaction.</span>")
ME2.name = "used slime extract"
ME2.desc = "This extract has been used up."
@@ -334,7 +333,7 @@ var/const/INGEST = 2
for(var/A in reagent_list)
var/datum/reagent/R = A
if(R.id == reagent)
if(istype(my_atom, /mob/living))
if(isliving(my_atom))
var/mob/living/M = my_atom
R.reagent_deleted(M)
reagent_list -= A
@@ -361,10 +360,8 @@ var/const/INGEST = 2
del_reagent(R.id)
return 0
/datum/reagents/proc/reaction_check(mob/M, datum/reagent/R)
/datum/reagents/proc/reaction_check(mob/living/M, datum/reagent/R)
var/can_process = 0
if(!istype(M, /mob/living)) //Non-living mobs can't metabolize reagents, so don't bother trying (runtime safety check)
return can_process
if(ishuman(M))
var/mob/living/carbon/human/H = M
//Check if this mob's species is set and can process this type of reagent
@@ -389,45 +386,28 @@ var/const/INGEST = 2
switch(method)
if(TOUCH)
for(var/datum/reagent/R in reagent_list)
if(ismob(A))
if(!R)
return
if(isliving(A))
var/check = reaction_check(A, R)
if(!check)
continue
else
R.reaction_mob(A, TOUCH, R.volume*volume_modifier)
if(isturf(A))
if(!R)
return
else
R.reaction_turf(A, R.volume*volume_modifier)
R.reaction_turf(A, R.volume*volume_modifier)
if(isobj(A))
if(!R)
return
else
R.reaction_obj(A, R.volume*volume_modifier)
R.reaction_obj(A, R.volume*volume_modifier)
if(INGEST)
for(var/datum/reagent/R in reagent_list)
if(ismob(A) && R)
if(!R)
return
if(isliving(A))
var/check = reaction_check(A, R)
if(!check)
continue
else
R.reaction_mob(A, INGEST, R.volume*volume_modifier)
if(isturf(A) && R)
if(!R)
return
else
R.reaction_turf(A, R.volume*volume_modifier)
if(isobj(A) && R)
if(!R)
return
else
R.reaction_obj(A, R.volume*volume_modifier)
return
if(isturf(A))
R.reaction_turf(A, R.volume*volume_modifier)
if(isobj(A))
R.reaction_obj(A, R.volume*volume_modifier)
/datum/reagents/proc/add_reagent_list(list/list_reagents, list/data=null) // Like add_reagent but you can enter a list. Format it like this: list("toxin" = 10, "beer" = 15)
for(var/r_id in list_reagents)
@@ -435,10 +415,12 @@ var/const/INGEST = 2
add_reagent(r_id, amt, data)
/datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = 300)
if(!isnum(amount)) return 1
if(!isnum(amount))
return 1
update_total()
if(total_volume + amount > maximum_volume) amount = (maximum_volume - total_volume) //Doesnt fit in. Make it disappear. Shouldnt happen. Will happen.
if(amount <= 0) return 0
if(amount <= 0)
return 0
chem_temp = round(((amount * reagtemp) + (total_volume * chem_temp)) / (total_volume + amount)) //equalize with new chems
for(var/A in reagent_list)
@@ -476,7 +458,8 @@ var/const/INGEST = 2
/datum/reagents/proc/remove_reagent(reagent, amount, safety)//Added a safety check for the trans_id_to
if(!isnum(amount)) return 1
if(!isnum(amount))
return 1
for(var/A in reagent_list)
var/datum/reagent/R = A
@@ -495,10 +478,13 @@ var/const/INGEST = 2
for(var/A in reagent_list)
var/datum/reagent/R = A
if(R.id == reagent)
if(!amount) return R
if(!amount)
return R
else
if(R.volume >= amount) return R
else return 0
if(R.volume >= amount)
return R
else
return 0
return 0
@@ -522,7 +508,8 @@ var/const/INGEST = 2
. = locate(type) in reagent_list
/datum/reagents/proc/remove_all_type(reagent_type, amount, strict = 0, safety = 1) // Removes all reagent of X type. @strict set to 1 determines whether the childs of the type are included.
if(!isnum(amount)) return 1
if(!isnum(amount))
return 1
var/has_removed_reagent = 0
@@ -566,8 +553,10 @@ var/const/INGEST = 2
D.data = new_data
/datum/reagents/proc/copy_data(datum/reagent/current_reagent)
if(!current_reagent || !current_reagent.data) return null
if(!istype(current_reagent.data, /list)) return current_reagent.data
if(!current_reagent || !current_reagent.data)
return null
if(!istype(current_reagent.data, /list))
return current_reagent.data
var/list/trans_data = current_reagent.data.Copy()
+37 -37
View File
@@ -167,7 +167,7 @@
if(href_list["dispense"])
if(dispensable_reagents.Find(href_list["dispense"]) && beaker != null)
var/obj/item/weapon/reagent_containers/glass/B = src.beaker
var/obj/item/weapon/reagent_containers/glass/B = beaker
var/datum/reagents/R = B.reagents
var/space = R.maximum_volume - R.total_volume
@@ -214,12 +214,12 @@
to_chat(user, "<span class='notice'>You fix [src].</span>")
return
if(src.beaker)
if(beaker)
to_chat(user, "<span class='warning'>Something is already loaded into the machine.</span>")
return
if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B, /obj/item/weapon/reagent_containers/food/drinks))
src.beaker = B
beaker = B
if(!user.drop_item())
to_chat(user, "<span class='warning'>\The [B] is stuck to you!</span>")
return
@@ -248,10 +248,10 @@
return
/obj/machinery/chem_dispenser/attack_ai(mob/user)
return src.attack_hand(user)
return attack_hand(user)
/obj/machinery/chem_dispenser/attack_ghost(mob/user)
return src.attack_hand(user)
return attack_hand(user)
/obj/machinery/chem_dispenser/attack_hand(mob/user)
if(stat & BROKEN)
@@ -430,13 +430,13 @@
if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B, /obj/item/weapon/reagent_containers/food/drinks/drinkingglass))
if(src.beaker)
if(beaker)
to_chat(user, "<span class='warning'>A beaker is already loaded into the machine.</span>")
return
if(!user.drop_item())
to_chat(user, "<span class='warning'>\The [B] is stuck to you!</span>")
return
src.beaker = B
beaker = B
B.forceMove(src)
to_chat(user, "<span class='notice'>You add the beaker to the machine!</span>")
nanomanager.update_uis(src)
@@ -444,14 +444,14 @@
else if(istype(B, /obj/item/weapon/storage/pill_bottle))
if(src.loaded_pill_bottle)
if(loaded_pill_bottle)
to_chat(user, "<span class='warning'>A pill bottle is already loaded into the machine.</span>")
return
if(!user.drop_item())
to_chat(user, "<span class='warning'>\The [B] is stuck to you!</span>")
return
src.loaded_pill_bottle = B
loaded_pill_bottle = B
B.forceMove(src)
to_chat(user, "<span class='notice'>You add the pill bottle into the dispenser slot!</span>")
nanomanager.update_uis(src)
@@ -461,13 +461,13 @@
if(..())
return 1
src.add_fingerprint(usr)
add_fingerprint(usr)
usr.set_machine(src)
if(href_list["ejectp"])
if(loaded_pill_bottle)
loaded_pill_bottle.forceMove(src.loc)
loaded_pill_bottle.forceMove(loc)
loaded_pill_bottle = null
else if(href_list["close"])
usr << browse(null, "window=chem_master")
@@ -476,12 +476,12 @@
return
if(href_list["print_p"])
if(!(src.printing))
src.printing = 1
if(!(printing))
printing = 1
for(var/mob/O in viewers(usr))
O.show_message("\blue \the [src] rattles and prints out a sheet of paper.", 1)
playsound(loc, "sound/goonstation/machines/printer_dotmatrix.ogg", 50, 1)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc )
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
P.info = "<CENTER><B>Chemical Analysis</B></CENTER><BR>"
P.info += "<b>Time of analysis:</b> [worldtime2text(world.time)]<br><br>"
P.info += "<b>Chemical name:</b> [href_list["name"]]<br>"
@@ -499,7 +499,7 @@
P.info += "<b>Description:</b> [href_list["desc"]]"
P.info += "<br><br><b>Notes:</b><br>"
P.name = "Chemical Analysis - [href_list["name"]]"
src.printing = null
printing = null
if(beaker)
var/datum/reagents/R = beaker.reagents
@@ -537,7 +537,7 @@
var/id = href_list["addcustom"]
useramount = input("Select the amount to transfer.", 30, useramount) as num
useramount = isgoodnumber(useramount)
src.Topic(null, list("amount" = "[useramount]", "add" = "[id]"))
Topic(null, list("amount" = "[useramount]", "add" = "[id]"))
else if(href_list["remove"])
@@ -555,7 +555,7 @@
var/id = href_list["removecustom"]
useramount = input("Select the amount to transfer.", 30, useramount) as num
useramount = isgoodnumber(useramount)
src.Topic(null, list("amount" = "[useramount]", "remove" = "[id]"))
Topic(null, list("amount" = "[useramount]", "remove" = "[id]"))
else if(href_list["toggle"])
mode = !mode
@@ -586,23 +586,23 @@
return
name = reject_bad_text(name)
while(count--)
var/obj/item/weapon/reagent_containers/food/pill/P = new/obj/item/weapon/reagent_containers/food/pill(src.loc)
var/obj/item/weapon/reagent_containers/food/pill/P = new/obj/item/weapon/reagent_containers/food/pill(loc)
if(!name) name = reagents.get_master_reagent_name()
P.name = "[name] pill"
P.pixel_x = rand(-7, 7) //random position
P.pixel_y = rand(-7, 7)
P.icon_state = "pill"+pillsprite
reagents.trans_to(P,amount_per_pill)
if(src.loaded_pill_bottle)
if(loaded_pill_bottle)
if(loaded_pill_bottle.contents.len < loaded_pill_bottle.storage_slots)
P.forceMove(loaded_pill_bottle)
src.updateUsrDialog()
updateUsrDialog()
else
var/name = input(usr,"Name:","Name your bag!",reagents.get_master_reagent_name()) as text|null
if(!name)
return
name = reject_bad_text(name)
var/obj/item/weapon/reagent_containers/food/condiment/pack/P = new/obj/item/weapon/reagent_containers/food/condiment/pack(src.loc)
var/obj/item/weapon/reagent_containers/food/condiment/pack/P = new/obj/item/weapon/reagent_containers/food/condiment/pack(loc)
if(!name) name = reagents.get_master_reagent_name()
P.originalname = name
P.name = "[name] pack"
@@ -627,7 +627,7 @@
name = reject_bad_text(name)
var/is_medical_patch = chemical_safety_check(reagents)
while(count--)
var/obj/item/weapon/reagent_containers/food/pill/patch/P = new/obj/item/weapon/reagent_containers/food/pill/patch(src.loc)
var/obj/item/weapon/reagent_containers/food/pill/patch/P = new/obj/item/weapon/reagent_containers/food/pill/patch(loc)
if(!name) name = reagents.get_master_reagent_name()
P.name = "[name] patch"
P.pixel_x = rand(-7, 7) //random position
@@ -642,7 +642,7 @@
if(!name)
return
name = reject_bad_text(name)
var/obj/item/weapon/reagent_containers/glass/bottle/P = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
var/obj/item/weapon/reagent_containers/glass/bottle/P = new/obj/item/weapon/reagent_containers/glass/bottle(loc)
if(!name) name = reagents.get_master_reagent_name()
P.name = "[name] bottle"
P.pixel_x = rand(-7, 7) //random position
@@ -650,7 +650,7 @@
P.icon_state = "bottle"+bottlesprite
reagents.trans_to(P,30)
else
var/obj/item/weapon/reagent_containers/food/condiment/P = new/obj/item/weapon/reagent_containers/food/condiment(src.loc)
var/obj/item/weapon/reagent_containers/food/condiment/P = new/obj/item/weapon/reagent_containers/food/condiment(loc)
reagents.trans_to(P,50)
else if(href_list["change_pill"])
#define MAX_PILL_SPRITE 20 //max icon state of the pill sprites
@@ -693,10 +693,10 @@
return
/obj/machinery/chem_master/attack_ai(mob/user)
return src.attack_hand(user)
return attack_hand(user)
/obj/machinery/chem_master/attack_ghost(mob/user)
return src.attack_hand(user)
return attack_hand(user)
/obj/machinery/chem_master/attack_hand(mob/user)
if(..())
@@ -733,7 +733,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "chem_master.tmpl", src.name, 575, 400)
ui = new(user, src, ui_key, "chem_master.tmpl", name, 575, 400)
ui.set_initial_data(data)
ui.open()
@@ -793,7 +793,7 @@
default_deconstruction_crowbar(B)
return 1
else
to_chat(user, "<span class='warning'>You can't use the [src.name] while it's panel is opened!</span>")
to_chat(user, "<span class='warning'>You can't use the [name] while it's panel is opened!</span>")
return 1
else
..()
@@ -886,10 +886,10 @@
if(!user.drop_item())
to_chat(user, "<span class='warning'>\The [O] is stuck to you!</span>")
return
src.beaker = O
beaker = O
O.forceMove(src)
update_icon()
src.updateUsrDialog()
updateUsrDialog()
return 0
if(holdingitems && holdingitems.len >= limit)
@@ -910,7 +910,7 @@
if(!O.contents.len)
to_chat(user, "<span class='notice'>You empty the plant bag into the All-In-One grinder.</span>")
src.updateUsrDialog()
updateUsrDialog()
return 0
@@ -921,7 +921,7 @@
user.unEquip(O)
O.forceMove(src)
holdingitems += O
src.updateUsrDialog()
updateUsrDialog()
return 0
/obj/machinery/reagentgrinder/attack_ai(mob/user)
@@ -989,7 +989,7 @@
eject()
if("detach")
detach()
src.updateUsrDialog()
updateUsrDialog()
return
/obj/machinery/reagentgrinder/proc/detach()
@@ -998,7 +998,7 @@
return
if(!beaker)
return
beaker.forceMove(src.loc)
beaker.forceMove(loc)
beaker = null
update_icon()
@@ -1010,7 +1010,7 @@
return
for(var/obj/item/O in holdingitems)
O.forceMove(src.loc)
O.forceMove(loc)
holdingitems -= O
holdingitems = list()
@@ -1071,7 +1071,7 @@
return
if(!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
return
playsound(src.loc, 'sound/machines/juicer.ogg', 20, 1)
playsound(loc, 'sound/machines/juicer.ogg', 20, 1)
var/offset = prob(50) ? -2 : 2
animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = 200) //start shaking
inuse = 1
@@ -1111,7 +1111,7 @@
return
if(!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
return
playsound(src.loc, 'sound/machines/blender.ogg', 50, 1)
playsound(loc, 'sound/machines/blender.ogg', 50, 1)
var/offset = prob(50) ? -2 : 2
animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = 200) //start shaking
inuse = 1
+20 -23
View File
@@ -24,22 +24,22 @@ About the Holder:
The holder (reagents datum) is the datum that holds a list of all reagents
currently in the object.It also has all the procs needed to manipulate reagents
remove_any(var/amount)
remove_any(amount)
This proc removes reagents from the holder until the passed amount
is matched. It'll try to remove some of ALL reagents contained.
trans_to(var/obj/target, var/amount)
trans_to(obj/target, amount)
This proc equally transfers the contents of the holder to another
objects holder. You need to pass it the object (not the holder) you want
to transfer to and the amount you want to transfer. Its return value is the
actual amount transfered (if one of the objects is full/empty)
trans_id_to(var/obj/target, var/reagent, var/amount)
trans_id_to(obj/target, reagent, amount)
Same as above but only for a specific reagent in the reagent list.
If the specified amount is greater than what is available, it will use
the amount of the reagent that is available. If no reagent exists, returns null.
metabolize(var/mob/M)
metabolize(mob/living/M)
This proc is called by the mobs life proc. It simply calls on_mob_life for
all contained reagents. You shouldnt have to use this one directly.
@@ -49,16 +49,13 @@ About the Holder:
Currently, this proc is automatically called by trans_to.
- Modified from the original to preserve reagent data across reactions (originally for xenoarchaeology)
isolate_reagent(var/reagent)
isolate_reagent(reagent)
Pass it a reagent id and it will remove all reagents but that one.
It's that simple.
del_reagent(var/reagent)
del_reagent(reagent)
Completely remove the reagent with the matching id.
reaction_fire(exposed_temp)
Simply calls the reaction_fire procs of all contained reagents.
update_total()
This one simply updates the total volume of the holder.
(the volume of all reagents added together)
@@ -66,7 +63,7 @@ About the Holder:
clear_reagents()
This proc removes ALL reagents from the holder.
reaction(var/atom/A, var/method=TOUCH, var/volume_modifier=0)
reaction(atom/A, method=TOUCH, volume_modifier=0)
This proc calls the appropriate reaction procs of the reagents.
I.e. if A is an object, it will call the reagents reaction_obj
proc. The method var is used for reaction on mobs. It simply tells
@@ -79,22 +76,22 @@ About the Holder:
contact with the reagents of a holder. (in the 'splash' part of a beaker i.e.)
More on the reaction in the reagent part of this readme.
add_reagent(var/reagent, var/amount, var/data)
add_reagent(reagent, amount, data)
Attempts to add X of the matching reagent to the holder.
You wont use this much. Mostly in new procs for pre-filled
objects.
remove_reagent(var/reagent, var/amount)
remove_reagent(reagent, amount)
The exact opposite of the add_reagent proc.
- Modified from original to return the reagent's data, in order to preserve reagent data across reactions (originally for xenoarchaeology)
has_reagent(var/reagent, var/amount)
has_reagent(reagent, amount)
Returns 1 if the holder contains this reagent.
Or 0 if not.
If you pass it an amount it will additionally check
if the amount is matched. This is optional.
get_reagent_amount(var/reagent)
get_reagent_amount(reagent)
Returns the amount of the matching reagent inside the
holder. Returns 0 if the reagent is missing.
@@ -123,26 +120,27 @@ About Reagents:
Reagents are all the things you can mix and fille in bottles etc. This can be anything from
rejuvs over water to ... iron. Each reagent also has a few procs - i'll explain those below.
reaction_mob(var/mob/M, var/method=TOUCH)
reaction_mob(mob/living/M, method=TOUCH)
This is called by the holder's reation proc.
This version is only called when the reagent
reacts with a mob. The method var can be either
TOUCH or INGEST. You'll want to put stuff like
acid-facemelting in here.
acid-facemelting in here. Should only ever be
called, directly, on living mobs.
reaction_obj(var/obj/O)
reaction_obj(obj/O)
This is called by the holder's reation proc.
This version is called when the reagents reacts
with an object. You'll want to put stuff like
object melting in here ... or something. i dunno.
reaction_turf(var/turf/T)
reaction_turf(turf/T)
This is called by the holder's reation proc.
This version is called when the reagents reacts
with a turf. You'll want to put stuff like extra
slippery floors for lube or something in here.
on_mob_life(var/mob/M)
on_mob_life(mob/living/M)
This proc is called everytime the mobs life proc executes.
This is the place where you put damage for toxins ,
drowsyness for sleep toxins etc etc.
@@ -166,8 +164,7 @@ About Reagents:
The name of the reagent.
data
This var can be used for whatever the fuck you want. I used it for the sleep
toxins to make them work slowly instead of instantly. You could also use this
This var can be used for whatever the fuck you want.You could use this
for DNA in a blood reagent or ... well whatever you want.
color
@@ -185,7 +182,7 @@ About Recipes:
Recipes are simple datums that contain a list of required reagents and a result.
They also have a proc that is called when the recipe is matched.
on_reaction(var/datum/reagents/holder, var/created_volume)
on_reaction(datum/reagents/holder, created_volume)
This proc is called when the recipe is matched.
You'll want to add explosions etc here.
To find the location you'll have to do something
@@ -232,7 +229,7 @@ About the Tools:
R.my_atom = src, <<< set the holders my_atom to src so that we know where we are.
This can also be done by calling a convenience proc:
atom/proc/create_reagents(var/max_volume)
atom/proc/create_reagents(max_volume)
Other important stuff:
@@ -35,8 +35,7 @@
volume = ..()
M.apply_damage(0.6*volume, BURN)
M.IgniteMob()
if(isliving(M))
M.emote("scream")
M.emote("scream")
/datum/reagent/blob/envenomed_filaments //toxin, hallucination, and some bonus spore toxin
name = "Envenomed Filaments"
+2 -2
View File
@@ -100,8 +100,8 @@
ui_interact(user)
/obj/machinery/chem_heater/attack_ai(mob/user)
src.add_hiddenprint(user)
return src.attack_hand(user)
add_hiddenprint(user)
return attack_hand(user)
/obj/machinery/chem_heater/Topic(href, href_list)
if(..())
+1 -3
View File
@@ -133,9 +133,7 @@
M.fakevomit()
..()
/datum/reagent/ethanol/synthanol/reaction_mob(mob/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
/datum/reagent/ethanol/synthanol/reaction_mob(mob/living/M, method=TOUCH, volume)
if(M.isSynthetic())
return
if(method == INGEST)
+1 -3
View File
@@ -522,9 +522,7 @@
result_amount = 4
mix_message = "The mixture swirls around excitedly!"
/datum/reagent/fliptonium/reaction_mob(mob/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
/datum/reagent/fliptonium/reaction_mob(mob/living/M, method=TOUCH, volume)
if(method == INGEST || method == TOUCH)
M.SpinAnimation(speed = 12, loops = -1)
..()
+14 -32
View File
@@ -6,9 +6,7 @@
color = "#63DE63"
metabolization_rate = 0.4
/datum/reagent/questionmark/reaction_mob(mob/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
/datum/reagent/questionmark/reaction_mob(mob/living/M, method=TOUCH, volume)
if(method == INGEST)
M.Stun(2)
M.Weaken(2)
@@ -45,9 +43,7 @@
mix_message = "The citrus juices begin to blend together."
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
/datum/reagent/triple_citrus/reaction_mob(mob/living/carbon/M, method=TOUCH, volume)
if(!istype(M, /mob/living/carbon))
return
/datum/reagent/triple_citrus/reaction_mob(mob/living/M, method=TOUCH, volume)
if(method == INGEST)
M.adjustToxLoss(-rand(1,2))
@@ -134,8 +130,7 @@
..()
/datum/reagent/chocolate/reaction_turf(turf/T, volume)
src = null
if(volume >= 5)
if(volume >= 5 && !istype(T, /turf/space))
new /obj/item/weapon/reagent_containers/food/snacks/choc_pile(T)
/datum/reagent/mugwort
@@ -146,7 +141,7 @@
color = "#21170E"
/datum/reagent/mugwort/on_mob_life(mob/living/M)
if(istype(M, /mob/living/carbon/human) && M.mind)
if(ishuman(M) && M.mind)
if(M.mind.special_role == "Wizard")
M.adjustToxLoss(-1*REM)
M.adjustOxyLoss(-1*REM)
@@ -177,9 +172,7 @@
reagent_state = LIQUID
color = "#C87D28"
/datum/reagent/fungus/reaction_mob(mob/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
/datum/reagent/fungus/reaction_mob(mob/living/M, method=TOUCH, volume)
if(method == INGEST)
var/ranchance = rand(1,10)
if(ranchance == 1)
@@ -211,9 +204,7 @@
color = "#F5F5F5"
metabolization_rate = 0.2
/datum/reagent/msg/reaction_mob(mob/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
/datum/reagent/msg/reaction_mob(mob/living/M, method=TOUCH, volume)
if(method == INGEST)
to_chat(M, "<span class='notice'>That tasted amazing!</span>")
@@ -242,8 +233,7 @@
..()
/datum/reagent/cheese/reaction_turf(turf/T, volume)
src = null
if(volume >= 5)
if(volume >= 5 && !istype(T, /turf/space))
new /obj/item/weapon/reagent_containers/food/snacks/cheesewedge(T)
/datum/chemical_reaction/cheese
@@ -286,8 +276,7 @@
..()
/datum/reagent/weird_cheese/reaction_turf(turf/T, volume)
src = null
if(volume >= 5)
if(volume >= 5 && !istype(T, /turf/space))
new /obj/item/weapon/reagent_containers/food/snacks/weirdcheesewedge(T)
/datum/chemical_reaction/weird_cheese
@@ -323,8 +312,7 @@
color = "#9C5013"
/datum/reagent/bread/reaction_turf(turf/T, volume)
src = null
if(volume >= 5)
if(volume >= 5 && !istype(T, /turf/space))
new /obj/item/weapon/reagent_containers/food/snacks/breadslice(T)
/datum/reagent/vomit
@@ -335,8 +323,7 @@
color = "#FFFF00"
/datum/reagent/vomit/reaction_turf(turf/T, volume)
src = null
if(volume >= 5)
if(volume >= 5 && !istype(T, /turf/space))
new /obj/effect/decal/cleanable/vomit(T)
playsound(T, 'sound/effects/splat.ogg', 50, 1, -3)
@@ -348,8 +335,7 @@
color = "#78FF74"
/datum/reagent/greenvomit/reaction_turf(turf/T, volume)
src = null
if(volume >= 5)
if(volume >= 5 && !istype(T, /turf/space))
new /obj/effect/decal/cleanable/vomit/green(T)
playsound(T, 'sound/effects/splat.ogg', 50, 1, -3)
@@ -362,9 +348,7 @@
color = "#8EAE7B"
process_flags = ORGANIC | SYNTHETIC //Because apparently ghosts in the shell
/datum/reagent/ectoplasm/reaction_mob(mob/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
/datum/reagent/ectoplasm/reaction_mob(mob/living/M, method=TOUCH, volume)
if(method == INGEST)
var/spooky_eat = pick("Ugh, why did you eat that? Your mouth feels haunted. Haunted with bad flavors.", "Ugh, why did you eat that? It has the texture of ham aspic. From the 1950s. Left out in the sun.", "Ugh, why did you eat that? It tastes like a ghost fart.", "Ugh, why did you eat that? It tastes like flavor died.")
to_chat(M, "<span class='warning'>[spooky_eat]</span>")
@@ -376,8 +360,7 @@
..()
/datum/reagent/ectoplasm/reaction_turf(turf/T, volume)
src = null
if(volume >= 10)
if(volume >= 10 && !istype(T, /turf/space))
new /obj/item/weapon/reagent_containers/food/snacks/ectoplasm(T)
/datum/reagent/soybeanoil
@@ -448,8 +431,7 @@
..()
/datum/reagent/meatslurry/reaction_turf(turf/T, volume)
src = null
if(volume >= 5 && prob(10))
if(volume >= 5 && prob(10) && !istype(T, /turf/space))
new /obj/effect/decal/cleanable/blood/gibs/cleangibs(T)
playsound(T, 'sound/effects/splat.ogg', 50, 1, -3)
+4 -8
View File
@@ -89,8 +89,7 @@
..()
/datum/reagent/synthflesh/reaction_turf(turf/T, volume) //let's make a mess!
src = null
if(volume >= 5)
if(volume >= 5 && !istype(T, /turf/space))
new /obj/effect/decal/cleanable/blood/gibs/cleangibs(T)
playsound(T, 'sound/effects/splat.ogg', 50, 1, -3)
@@ -620,7 +619,7 @@
SM.loot.Cut() //no abusing strange reagent for unlimited farming of resources
SM.visible_message("<span class='warning'>[M] seems to rise from the dead!</span>")
if(istype(M, /mob/living/carbon))
if(iscarbon(M))
if(method == INGEST)
if(M.stat == DEAD)
if(M.getBruteLoss()+M.getFireLoss() >= 150)
@@ -952,11 +951,8 @@
result_amount = 2
/datum/reagent/degreaser/reaction_turf(turf/simulated/T, volume)
if(!istype(T))
return
src = null
if(volume >= 1)
if(istype(T) && T.wet)
if(volume >= 1 && istype(T))
if(T.wet)
T.MakeDry(TURF_WET_LUBE)
/datum/reagent/degreaser/on_mob_life(mob/living/M)
@@ -8,17 +8,13 @@
var/overdosed = 0 // You fucked up and this is now triggering it's overdose effects, purge that shit quick.
var/current_cycle = 1
/datum/reagents
var/chem_temp = 300
var/list/datum/reagent/addiction_list = new/list()
/datum/reagents/proc/metabolize(mob/living/M)
if(M)
chem_temp = M.bodytemperature
handle_reactions()
for(var/A in reagent_list)
var/datum/reagent/R = A
if(!istype(R))
if(!istype(R)) // How are non-reagents ending up in the reagents_list?
continue
if(!R.holder)
continue
+4 -4
View File
@@ -124,7 +124,7 @@ var/list/random_color_list = list("#00aedb","#a200ff","#f47835","#d41243","#d111
mix_message = "The substance flashes multiple colors and emits the smell of a pocket protector."
/datum/reagent/colorful_reagent/reaction_mob(mob/living/simple_animal/M, method=TOUCH, volume)
if(M && istype(M))
if(isanimal(M))
M.color = pick(random_color_list)
..()
@@ -187,7 +187,7 @@ var/list/random_color_list = list("#00aedb","#a200ff","#f47835","#d41243","#d111
result_amount = 2
/datum/reagent/hair_dye/reaction_mob(mob/living/M, volume)
if(M && ishuman(M))
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
head_organ.r_facial = rand(0,255)
@@ -217,7 +217,7 @@ var/list/random_color_list = list("#00aedb","#a200ff","#f47835","#d41243","#d111
mix_message = "The liquid becomes slightly hairy."
/datum/reagent/hairgrownium/reaction_mob(mob/living/M, volume)
if(M && ishuman(M))
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
head_organ.h_style = random_hair_style(H.gender, head_organ.species.name)
@@ -244,7 +244,7 @@ var/list/random_color_list = list("#00aedb","#a200ff","#f47835","#d41243","#d111
mix_message = "The liquid becomes amazingly furry and smells peculiar."
/datum/reagent/super_hairgrownium/reaction_mob(mob/living/M, volume)
if(M && ishuman(M))
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
var/datum/sprite_accessory/tmp_hair_style = hair_styles_list["Very Long Hair"]
+15 -22
View File
@@ -65,7 +65,7 @@
new /obj/effect/hotspot(T)
/datum/reagent/clf3/reaction_mob(mob/living/M, method=TOUCH, volume)
if(method == TOUCH && isliving(M))
if(method == TOUCH)
M.adjust_fire_stacks(5)
M.IgniteMob()
M.bodytemperature += 30
@@ -177,9 +177,8 @@
mix_sound = null
/datum/reagent/blackpowder/reaction_turf(turf/T, volume) //oh shit
src = null
if(volume >= 5)
if(!locate(/obj/effect/decal/cleanable/dirt/blackpowder) in get_turf(T)) //let's not have hundreds of decals of black powder on the same turf
if(volume >= 5 && !istype(T, /turf/space))
if(!locate(/obj/effect/decal/cleanable/dirt/blackpowder) in T) //let's not have hundreds of decals of black powder on the same turf
new /obj/effect/decal/cleanable/dirt/blackpowder(T)
/datum/chemical_reaction/blackpowder_explosion/on_reaction(datum/reagents/holder, created_volume)
@@ -436,7 +435,7 @@
..()
/datum/reagent/napalm/reaction_mob(mob/living/M, method=TOUCH, volume)
if(method == TOUCH && isliving(M))
if(method == TOUCH)
M.adjust_fire_stacks(7)
/datum/chemical_reaction/napalm
@@ -474,7 +473,7 @@
holder.handle_reactions()
..()
/datum/reagent/cryostylane/reaction_turf(turf/simulated/T, volume)
/datum/reagent/cryostylane/reaction_turf(turf/T, volume)
if(volume >= 5)
for(var/mob/living/carbon/slime/M in T)
M.adjustToxLoss(rand(15,30))
@@ -537,9 +536,6 @@
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
/datum/reagent/firefighting_foam/reaction_mob(mob/living/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
// Put out fire
if(method == TOUCH)
M.adjust_fire_stacks(-(volume / 5)) // more effective than water
@@ -550,24 +546,23 @@
if(!istype(T))
return
var/CT = cooling_temperature
src = null
if(!istype(T, /turf/space))
new /obj/effect/decal/cleanable/flour/foam(T) //foam mess; clears up quickly.
new /obj/effect/decal/cleanable/flour/foam(T) //foam mess; clears up quickly.
var/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot && !istype(T, /turf/space))
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
lowertemp.temperature = max( min(lowertemp.temperature-(CT*1000),lowertemp.temperature / CT) ,0)
if(hotspot)
var/datum/gas_mixture/lowertemp = T.remove_air(T.air.total_moles())
lowertemp.temperature = max(min(lowertemp.temperature-(CT*1000), lowertemp.temperature / CT), 0)
lowertemp.react()
T.assume_air(lowertemp)
qdel(hotspot)
/datum/reagent/firefighting_foam/reaction_obj(obj/O, volume)
src = null
var/turf/T = get_turf(O)
var/turf/simulated/T = get_turf(O)
if(!istype(T))
return
var/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot && !istype(T, /turf/space))
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
if(hotspot)
var/datum/gas_mixture/lowertemp = T.remove_air(T.air.total_moles())
lowertemp.temperature = max(min(lowertemp.temperature-2000,lowertemp.temperature / 2), 0)
lowertemp.react()
T.assume_air(lowertemp)
qdel(hotspot)
@@ -625,8 +620,6 @@
T.atmos_spawn_air(SPAWN_TOXINS|SPAWN_20C, volume)
/datum/reagent/plasma_dust/reaction_mob(mob/living/M, method=TOUCH, volume)//Splashing people with plasma dust is stronger than fuel!
if(!istype(M, /mob/living))
return
if(method == TOUCH)
M.adjust_fire_stacks(volume / 5)
return
+31 -35
View File
@@ -289,8 +289,6 @@
process_flags = ORGANIC | SYNTHETIC
/datum/reagent/facid/reaction_mob(mob/living/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return //wooo more runtime fixin
if(method == TOUCH || method == INGEST)
if(ishuman(M))
var/mob/living/carbon/human/H = M
@@ -311,18 +309,18 @@
if(!H.wear_mask.unacidable)
qdel(H.wear_mask)
H.update_inv_wear_mask()
to_chat(H, "\red Your mask melts away but protects you from the acid!")
to_chat(H, "<span class='warning'>Your mask melts away but protects you from the acid!</span>")
else
to_chat(H, "\red Your mask protects you from the acid!")
to_chat(H, "<span class='warning'>Your mask protects you from the acid!</span>")
return
if(H.head)
if(!H.head.unacidable)
qdel(H.head)
H.update_inv_head()
to_chat(H, "\red Your helmet melts away but protects you from the acid")
to_chat(H, "<span class='warning'>Your helmet melts away but protects you from the acid</span>")
else
to_chat(H, "\red Your helmet protects you from the acid!")
to_chat(H, "<span class='warning'>Your helmet protects you from the acid!</span>")
return
if(!H.unacidable)
@@ -333,12 +331,11 @@
H.status_flags |= DISFIGURED
/datum/reagent/facid/reaction_obj(obj/O, volume)
if((istype(O,/obj/item) || istype(O,/obj/effect/glowshroom)))
if((istype(O, /obj/item) || istype(O, /obj/effect/glowshroom)))
if(!O.unacidable)
var/obj/effect/decal/cleanable/molten_item/I = new/obj/effect/decal/cleanable/molten_item(O.loc)
I.desc = "Looks like this was \an [O] some time ago."
for(var/mob/M in viewers(5, O))
to_chat(M, "\red \the [O] melts.")
O.visible_message("<span class='warning'>\the [O] melts.</span>")
qdel(O)
/datum/chemical_reaction/facid
@@ -694,45 +691,41 @@
..()
// Clear off wallrot fungi
/datum/reagent/atrazine/reaction_turf(turf/T, volume)
if(istype(T, /turf/simulated/wall))
var/turf/simulated/wall/W = T
if(W.rotting)
W.rotting = 0
for(var/obj/effect/E in W)
if(E.name == "Wallrot")
qdel(E)
/datum/reagent/atrazine/reaction_turf(turf/simulated/wall/W, volume)
if(istype(W) && W.rotting)
W.rotting = 0
for(var/obj/effect/overlay/O in W)
if(O.name == "Wallrot") // This is so awful
qdel(O)
for(var/mob/O in viewers(W, null))
O.show_message(text("\blue The fungi are completely dissolved by the solution!"), 1)
W.visible_message("<span class='warning'>The fungi are completely dissolved by the solution!</span>")
/datum/reagent/atrazine/reaction_obj(obj/O, volume)
if(istype(O,/obj/structure/alien/weeds/))
var/obj/structure/alien/weeds/alien_weeds = O
alien_weeds.health -= rand(15,35) // Kills alien weeds pretty fast
alien_weeds.healthcheck()
else if(istype(O,/obj/effect/glowshroom)) //even a small amount is enough to kill it
else if(istype(O, /obj/effect/glowshroom)) //even a small amount is enough to kill it
qdel(O)
else if(istype(O,/obj/effect/plant))
if(prob(50)) qdel(O) //Kills kudzu too.
if(prob(50))
qdel(O) //Kills kudzu too.
// Damage that is done to growing plants is separately at code/game/machinery/hydroponics at obj/item/hydroponics
/datum/reagent/atrazine/reaction_mob(mob/living/M, method=TOUCH, volume)
src = null
if(iscarbon(M))
var/mob/living/carbon/C = M
if(!C.wear_mask) // If not wearing a mask
C.adjustToxLoss(2) // 4 toxic damage per application, doubled for some reason
C.adjustToxLoss(2) // 2 toxic damage per application
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.dna)
if(H.species.flags & IS_PLANT) //plantmen take a LOT of damage
H.adjustToxLoss(50)
..()
else if(istype(M,/mob/living/simple_animal/diona)) //plantmen monkeys (diona) take EVEN MORE damage
var/mob/living/simple_animal/diona/D = M
D.adjustHealth(100)
..()
if(H.species.flags & IS_PLANT) //plantmen take a LOT of damage
H.adjustToxLoss(50)
..()
else if(istype(M, /mob/living/simple_animal/diona)) //plantmen monkeys (diona) take EVEN MORE damage
var/mob/living/simple_animal/diona/D = M
D.adjustHealth(100)
..()
/datum/chemical_reaction/atrazine
name = "atrazine"
@@ -817,10 +810,11 @@
reagent_state = LIQUID
color = "#00FD00"
/datum/reagent/glowing_slurry/reaction_mob(mob/M, method=TOUCH, volume) //same as mutagen
if(!..()) return
if(!M.dna) return //No robots, AIs, aliens, Ians or other mobs should be affected by this.
src = null
/datum/reagent/glowing_slurry/reaction_mob(mob/living/M, method=TOUCH, volume) //same as mutagen
if(!..())
return
if(!M.dna)
return //No robots, AIs, aliens, Ians or other mobs should be affected by this.
if((method==TOUCH && prob(50)) || method==INGEST)
randmutb(M)
domutcheck(M, null)
@@ -828,6 +822,8 @@
/datum/reagent/glowing_slurry/on_mob_life(mob/living/M)
M.apply_effect(2, IRRADIATE, 0, negate_armor = 1)
if(!M.dna)
return
if(prob(15))
randmutb(M)
if(prob(3))
@@ -21,57 +21,42 @@
var/process_flags = ORGANIC
var/admin_only = 0
/datum/reagent/proc/reaction_mob(mob/M, method=TOUCH, volume) //Some reagents transfer on touch, others don't; dependent on if they penetrate the skin or not.
if(!istype(M, /mob/living))
return 0
var/datum/reagent/self = src
src = null
if(self.holder) //for catching rare runtimes
if(method == TOUCH && self.penetrates_skin)
if(isliving(M))
var/mob/living/L = M
var/block = L.get_permeability_protection()
var/amount = round(self.volume * (1.0 - block), 0.1)
if(L.reagents)
if(amount >= 1)
L.reagents.add_reagent(self.id,amount)
/datum/reagent/proc/reaction_mob(mob/living/M, method=TOUCH, volume) //Some reagents transfer on touch, others don't; dependent on if they penetrate the skin or not.
if(holder) //for catching rare runtimes
if(method == TOUCH && penetrates_skin)
var/block = M.get_permeability_protection()
var/amount = round(volume * (1.0 - block), 0.1)
if(M.reagents)
if(amount >= 1)
M.reagents.add_reagent(id, amount)
if(method == INGEST) //Yes, even Xenos can get addicted to drugs.
var/can_become_addicted = M.reagents.reaction_check(M, self)
var/can_become_addicted = M.reagents.reaction_check(M, src)
if(can_become_addicted)
if(prob(self.addiction_chance) && !is_type_in_list(self, M.reagents.addiction_list))
if(prob(addiction_chance) && !is_type_in_list(src, M.reagents.addiction_list))
to_chat(M, "<span class='danger'>You suddenly feel invigorated and guilty...</span>")
var/datum/reagent/new_reagent = new self.type()
var/datum/reagent/new_reagent = new type()
new_reagent.last_addiction_dose = world.timeofday
M.reagents.addiction_list.Add(new_reagent)
else if(is_type_in_list(self, M.reagents.addiction_list))
else if(is_type_in_list(src, M.reagents.addiction_list))
to_chat(M, "<span class='notice'>You feel slightly better, but for how long?</span>")
for(var/A in M.reagents.addiction_list)
var/datum/reagent/AD = A
if(AD && istype(AD, self))
if(AD && istype(AD, src))
AD.last_addiction_dose = world.timeofday
AD.addiction_stage = 1
return 1
/datum/reagent/proc/reaction_obj(obj/O, volume) //By default we transfer a small part of the reagent to the object
src = null //if it can hold reagents. nope!
//if(O.reagents)
// O.reagents.add_reagent(id,volume/3)
/datum/reagent/proc/reaction_obj(obj/O, volume)
return
/datum/reagent/proc/reaction_turf(turf/T, volume)
src = null
return
/datum/reagent/proc/on_mob_life(mob/living/M)
if(!istype(M))
return
if(holder)
holder.remove_reagent(id, metabolization_rate) //By default it slowly disappears.
current_cycle++
current_cycle++
holder.remove_reagent(id, metabolization_rate) //By default it slowly disappears.
/datum/reagent/proc/on_mob_death(mob/living/M) //use this to have chems have a "death-triggered" effect
return
@@ -29,14 +29,10 @@
to_chat(usr, "The solution melts away the ink on the book.")
else
to_chat(usr, "It wasn't enough...")
return
/datum/reagent/ethanol/reaction_mob(mob/living/M, method=TOUCH, volume)//Splashing people with ethanol isn't quite as good as fuel.
if(!istype(M, /mob/living))
return
if(method == TOUCH)
M.adjust_fire_stacks(volume / 15)
return
/datum/reagent/ethanol/beer
@@ -102,7 +102,7 @@
/datum/reagent/drink/banana/on_mob_life(mob/living/M)
M.nutrition += nutriment_factor
if((istype(M, /mob/living/carbon/human) && M.job in list("Clown") ) || issmall(M))
if((ishuman(M) && M.job in list("Clown") ) || issmall(M))
M.adjustBruteLoss(-1)
M.adjustFireLoss(-1)
..()
@@ -114,7 +114,7 @@
/datum/reagent/drink/nothing/on_mob_life(mob/living/M)
M.nutrition += nutriment_factor
if(istype(M, /mob/living/carbon/human) && M.job in list("Mime"))
if(ishuman(M) && M.job in list("Mime"))
M.adjustBruteLoss(-1)
M.adjustFireLoss(-1)
..()
@@ -265,7 +265,7 @@
/datum/reagent/drink/bananahonk/on_mob_life(mob/living/M)
M.nutrition += nutriment_factor
if((istype(M, /mob/living/carbon/human) && M.job in list("Clown") ) || issmall(M))
if((ishuman(M) && M.job in list("Clown") ) || issmall(M))
M.adjustBruteLoss(-1)
M.adjustFireLoss(-1)
..()
@@ -279,7 +279,7 @@
/datum/reagent/drink/silencer/on_mob_life(mob/living/M)
M.nutrition += nutriment_factor
if(istype(M, /mob/living/carbon/human) && M.job in list("Mime"))
if(ishuman(M) && M.job in list("Mime"))
M.adjustBruteLoss(-1)
M.adjustFireLoss(-1)
..()
@@ -6,8 +6,6 @@
color = "#060606"
/datum/reagent/fuel/reaction_mob(mob/living/M, method=TOUCH, volume)//Splashing people with welding fuel to make them easy to ignite!
if(!istype(M, /mob/living))
return
if(method == TOUCH)
M.adjust_fire_stacks(volume / 10)
return
@@ -56,8 +54,6 @@
..()
/datum/reagent/plasma/reaction_mob(mob/living/M, method=TOUCH, volume)//Splashing people with plasma is stronger than fuel!
if(!istype(M, /mob/living))
return
if(method == TOUCH)
M.adjust_fire_stacks(volume / 5)
..()
@@ -71,13 +67,11 @@
color = "#673910" // rgb: 103, 57, 16
process_flags = ORGANIC | SYNTHETIC
/datum/reagent/thermite/reaction_turf(turf/T, volume)
src = null
if(volume >= 5)
if(istype(T, /turf/simulated/wall))
T:thermite = 1
T.overlays.Cut()
T.overlays = image('icons/effects/effects.dmi',icon_state = "thermite")
/datum/reagent/thermite/reaction_turf(turf/simulated/wall/W, volume)
if(volume >= 5 && istype(W))
W.thermite = 1
T.overlays.Cut()
T.overlays = image('icons/effects/effects.dmi',icon_state = "thermite")
/datum/reagent/glycerol
name = "Glycerol"
@@ -92,19 +92,19 @@
M.bodytemperature += 5 * TEMPERATURE_DAMAGE_COEFFICIENT
if(holder.has_reagent("frostoil"))
holder.remove_reagent("frostoil", 5)
if(istype(M, /mob/living/carbon/slime))
if(isslime(M))
M.bodytemperature += rand(5,20)
if(15 to 25)
M.bodytemperature += 10 * TEMPERATURE_DAMAGE_COEFFICIENT
if(istype(M, /mob/living/carbon/slime))
if(isslime(M))
M.bodytemperature += rand(10,20)
if(25 to 35)
M.bodytemperature += 15 * TEMPERATURE_DAMAGE_COEFFICIENT
if(istype(M, /mob/living/carbon/slime))
if(isslime(M))
M.bodytemperature += rand(15,20)
if(35 to INFINITY)
M.bodytemperature += 20 * TEMPERATURE_DAMAGE_COEFFICIENT
if(istype(M, /mob/living/carbon/slime))
if(isslime(M))
M.bodytemperature += rand(20,25)
..()
@@ -122,27 +122,27 @@
M.bodytemperature -= 10 * TEMPERATURE_DAMAGE_COEFFICIENT
if(holder.has_reagent("capsaicin"))
holder.remove_reagent("capsaicin", 5)
if(istype(M, /mob/living/carbon/slime))
if(isslime(M))
M.bodytemperature -= rand(5,20)
if(15 to 25)
M.bodytemperature -= 15 * TEMPERATURE_DAMAGE_COEFFICIENT
if(istype(M, /mob/living/carbon/slime))
if(isslime(M))
M.bodytemperature -= rand(10,20)
if(25 to 35)
M.bodytemperature -= 20 * TEMPERATURE_DAMAGE_COEFFICIENT
if(prob(1))
M.emote("shiver")
if(istype(M, /mob/living/carbon/slime))
if(isslime(M))
M.bodytemperature -= rand(15,20)
if(35 to INFINITY)
M.bodytemperature -= 20 * TEMPERATURE_DAMAGE_COEFFICIENT
if(prob(1))
M.emote("shiver")
if(istype(M, /mob/living/carbon/slime))
if(isslime(M))
M.bodytemperature -= rand(20,25)
..()
/datum/reagent/frostoil/reaction_turf(turf/simulated/T, volume)
/datum/reagent/frostoil/reaction_turf(turf/T, volume)
if(volume >= 5)
for(var/mob/living/carbon/slime/M in T)
M.adjustToxLoss(rand(15,30))
@@ -202,7 +202,7 @@
/datum/reagent/sprinkles/on_mob_life(mob/living/M)
M.nutrition += nutriment_factor
if(istype(M, /mob/living/carbon/human) && M.job in list("Security Officer", "Security Pod Pilot", "Detective", "Warden", "Head of Security", "Brig Physician", "Internal Affairs Agent", "Magistrate"))
if(ishuman(M) && M.job in list("Security Officer", "Security Pod Pilot", "Detective", "Warden", "Head of Security", "Brig Physician", "Internal Affairs Agent", "Magistrate"))
M.adjustBruteLoss(-1)
M.adjustFireLoss(-1)
..()
@@ -221,14 +221,14 @@
..()
/datum/reagent/cornoil/reaction_turf(turf/simulated/T, volume)
if(!istype(T)) return
src = null
if(!istype(T))
return
if(volume >= 3)
T.MakeSlippery()
var/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot)
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
var/datum/gas_mixture/lowertemp = T.remove_air( T.air.total_moles())
lowertemp.temperature = max(min(lowertemp.temperature-2000, lowertemp.temperature / 2), 0)
lowertemp.react()
T.assume_air(lowertemp)
qdel(hotspot)
@@ -297,7 +297,6 @@
..()
/datum/reagent/flour/reaction_turf(turf/T, volume)
src = null
if(!istype(T, /turf/space))
new /obj/effect/decal/cleanable/flour(T)
@@ -5,9 +5,8 @@
reagent_state = LIQUID
color = "#C7FFFF" // rgb: 199, 255, 255
/datum/reagent/silicate/reaction_obj(var/obj/O, var/volume)
src = null
if(istype(O,/obj/structure/window))
/datum/reagent/silicate/reaction_obj(obj/O, volume)
if(istype(O, /obj/structure/window))
if(O:silicate <= 200)
O:silicate += volume
@@ -30,9 +29,7 @@
var/b = (volume / 50) + 1
I.SetIntensity(r,g,b)
O.icon = I
O:silicateIcon = I
return*/
O:silicateIcon = I */
/datum/reagent/oxygen
@@ -99,12 +96,9 @@
color = "#1C1300" // rgb: 30, 20, 0
/datum/reagent/carbon/reaction_turf(turf/T, volume)
src = null
// Only add one dirt per turf. Was causing people to crash.
if(!istype(T, /turf/space) && !(locate(/obj/effect/decal/cleanable/dirt) in T))
if(!istype(T) && !(locate(/obj/effect/decal/cleanable/dirt) in T)) // Only add one dirt per turf. Was causing people to crash.
new /obj/effect/decal/cleanable/dirt(T)
/datum/reagent/gold
name = "Gold"
id = "gold"
@@ -84,7 +84,7 @@
reagent_state = LIQUID
color = "#13BC5E" // rgb: 19, 188, 94
/datum/reagent/aslimetoxin/reaction_mob(mob/M, method=TOUCH, volume)
/datum/reagent/aslimetoxin/reaction_mob(mob/living/M, method=TOUCH, volume)
if(method != TOUCH)
M.ForceContractDisease(new /datum/disease/transformation/slime(0))
@@ -145,12 +145,8 @@
..()
/datum/reagent/radium/reaction_turf(turf/T, volume)
src = null
if(volume >= 3)
if(!istype(T, /turf/space))
new /obj/effect/decal/cleanable/greenglow(T)
return
if(volume >= 3 && !istype(T, /turf/space))
new /obj/effect/decal/cleanable/greenglow(T)
/datum/reagent/mutagen
name = "Unstable mutagen"
@@ -160,17 +156,19 @@
color = "#04DF27"
metabolization_rate = 0.3
/datum/reagent/mutagen/reaction_mob(mob/M, method=TOUCH, volume)
if(!..()) return
if(!M.dna) return //No robots, AIs, aliens, Ians or other mobs should be affected by this.
src = null
/datum/reagent/mutagen/reaction_mob(mob/living/M, method=TOUCH, volume)
if(!..())
return
if(!M.dna)
return //No robots, AIs, aliens, Ians or other mobs should be affected by this.
if((method==TOUCH && prob(33)) || method==INGEST)
randmutb(M)
domutcheck(M, null)
M.UpdateAppearance()
/datum/reagent/mutagen/on_mob_life(mob/living/M)
if(!M.dna) return //No robots, AIs, aliens, Ians or other mobs should be affected by this.
if(!M.dna)
return //No robots, AIs, aliens, Ians or other mobs should be affected by this.
M.apply_effect(2*REM, IRRADIATE, negate_armor = 1)
if(prob(4))
randmutb(M)
@@ -189,10 +187,8 @@
..()
/datum/reagent/uranium/reaction_turf(turf/T, volume)
src = null
if(volume >= 3)
if(!istype(T, /turf/space))
new /obj/effect/decal/cleanable/greenglow(T)
if(volume >= 3 && !istype(T, /turf/space))
new /obj/effect/decal/cleanable/greenglow(T)
/datum/reagent/lexorin
@@ -221,8 +217,6 @@
..()
/datum/reagent/sacid/reaction_mob(mob/living/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
if(method == TOUCH)
if(ishuman(M))
var/mob/living/carbon/human/H = M
@@ -278,8 +272,7 @@
if(!O.unacidable)
var/obj/effect/decal/cleanable/molten_item/I = new/obj/effect/decal/cleanable/molten_item(O.loc)
I.desc = "Looks like this was \an [O] some time ago."
for(var/mob/M in viewers(5, O))
to_chat(M, "\red \the [O] melts.")
O.visible_message("<span class='warning'>\the [O] melts.</span>")
qdel(O)
@@ -361,10 +354,8 @@
color = "#B31008" // rgb: 179, 16, 8
/datum/reagent/condensedcapsaicin/reaction_mob(mob/living/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
if(method == TOUCH)
if(istype(M, /mob/living/carbon/human))
if(ishuman(M))
var/mob/living/carbon/human/victim = M
var/mouth_covered = 0
var/eyes_covered = 0
@@ -17,9 +17,6 @@
process_flags = ORGANIC | SYNTHETIC
/datum/reagent/water/reaction_mob(mob/living/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
// Put out fire
if(method == TOUCH)
M.adjust_fire_stacks(-(volume / 10))
@@ -30,7 +27,6 @@
/datum/reagent/water/reaction_turf(turf/simulated/T, volume)
if(!istype(T))
return
src = null
if(volume >= 3)
T.MakeSlippery()
@@ -38,32 +34,31 @@
M.apply_water()
var/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot && !istype(T, /turf/space))
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
if(hotspot)
var/datum/gas_mixture/lowertemp = T.remove_air( T.air.total_moles())
lowertemp.temperature = max(min(lowertemp.temperature-2000,lowertemp.temperature / 2), 0)
lowertemp.react()
T.assume_air(lowertemp)
qdel(hotspot)
/datum/reagent/water/reaction_obj(obj/O, volume)
src = null
var/turf/T = get_turf(O)
var/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot && !istype(T, /turf/space))
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
lowertemp.react()
T.assume_air(lowertemp)
qdel(hotspot)
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/monkeycube))
var/turf/simulated/T = get_turf(O)
if(istype(T))
var/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot)
var/datum/gas_mixture/lowertemp = T.remove_air( T.air.total_moles() )
lowertemp.temperature = max(min(lowertemp.temperature-2000,lowertemp.temperature / 2), 0)
lowertemp.react()
T.assume_air(lowertemp)
qdel(hotspot)
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/monkeycube))
var/obj/item/weapon/reagent_containers/food/snacks/monkeycube/cube = O
if(!cube.wrapped)
cube.Expand()
// Dehydrated carp
if(istype(O,/obj/item/toy/carpplushie/dehy_carp))
if(istype(O, /obj/item/toy/carpplushie/dehy_carp))
var/obj/item/toy/carpplushie/dehy_carp/dehy = O
dehy.Swell() // Makes a carp
return
/datum/reagent/lube
@@ -74,9 +69,7 @@
color = "#1BB1AB"
/datum/reagent/lube/reaction_turf(turf/simulated/T, volume)
if(!istype(T)) return
src = null
if(volume >= 1)
if(volume >= 1 && istype(T))
T.MakeSlippery(TURF_WET_LUBE)
@@ -90,11 +83,10 @@
/datum/reagent/space_cleaner/reaction_obj(obj/O, volume)
if(O && !istype(O, /atom/movable/lighting_overlay))
O.color = initial(O.color)
if(istype(O,/obj/effect/decal/cleanable))
if(istype(O, /obj/effect/decal/cleanable))
qdel(O)
else
if(O)
O.clean_blood()
else if(O)
O.clean_blood()
/datum/reagent/space_cleaner/reaction_turf(turf/T, volume)
if(volume >= 1)
@@ -106,14 +98,14 @@
for(var/mob/living/carbon/slime/M in T)
M.adjustToxLoss(rand(5,10))
if(istype(T,/turf/simulated))
if(istype(T, /turf/simulated))
var/turf/simulated/S = T
S.dirt = 0
/datum/reagent/space_cleaner/reaction_mob(mob/M, method=TOUCH, volume)
/datum/reagent/space_cleaner/reaction_mob(mob/living/M, method=TOUCH, volume)
if(iscarbon(M))
var/mob/living/carbon/C = M
if(istype(M,/mob/living/carbon/human))
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.lip_style)
H.lip_style = null
@@ -141,7 +133,6 @@
H.update_inv_shoes(0,0)
M.clean_blood()
..()
return
/datum/reagent/blood
@@ -151,7 +142,7 @@
reagent_state = LIQUID
color = "#C80000" // rgb: 200, 0, 0
/datum/reagent/blood/reaction_mob(mob/M, method=TOUCH, volume)
/datum/reagent/blood/reaction_mob(mob/living/M, method=TOUCH, volume)
if(data && data["viruses"])
for(var/datum/disease/D in data["viruses"])
@@ -232,7 +223,7 @@
id = "vaccine"
color = "#C81040" // rgb: 200, 16, 64
/datum/reagent/vaccine/reaction_mob(mob/M, method=TOUCH, volume)
/datum/reagent/vaccine/reaction_mob(mob/living/M, method=TOUCH, volume)
if(islist(data) && (method == INGEST))
for(var/datum/disease/D in M.viruses)
if(D.GetDiseaseID() in data)
@@ -241,7 +232,7 @@
/datum/reagent/vaccine/on_merge(list/data)
if(istype(data))
src.data |= data.Copy()
data |= data.Copy()
/datum/reagent/fishwater
name = "Fish Water"
@@ -250,9 +241,7 @@
reagent_state = LIQUID
color = "#757547"
/datum/reagent/fishwater/reaction_mob(mob/M, method=TOUCH, volume)
if(!istype(M, /mob/living))
return
/datum/reagent/fishwater/reaction_mob(mob/living/M, method=TOUCH, volume)
if(method == INGEST)
to_chat(M, "Oh god, why did you drink that?")
@@ -271,7 +260,7 @@
reagent_state = LIQUID
color = "#757547"
/datum/reagent/fishwater/toiletwater/reaction_mob(mob/M, method=TOUCH, volume) //For shennanigans
/datum/reagent/fishwater/toiletwater/reaction_mob(mob/living/M, method=TOUCH, volume) //For shennanigans
return
/datum/reagent/holywater
@@ -293,14 +282,14 @@
M.confused += 3
if(isvampirethrall(M))
ticker.mode.remove_vampire_mind(M.mind)
holder.remove_reagent(src.id, src.volume)
holder.remove_reagent(id, volume)
M.jitteriness = 0
M.stuttering = 0
M.confused = 0
return
if(iscultist(M))
ticker.mode.remove_cultist(M.mind)
holder.remove_reagent(src.id, src.volume) // maybe this is a little too perfect and a max() cap on the statuses would be better??
holder.remove_reagent(id, volume) // maybe this is a little too perfect and a max() cap on the statuses would be better??
M.jitteriness = 0
M.stuttering = 0
M.confused = 0
@@ -331,10 +320,10 @@
var/mob/living/carbon/human/H=M
if(method == TOUCH)
if(H.wear_mask)
to_chat(H, "\red Your mask protects you from the holy water!")
to_chat(H, "<span class='warning'>Your mask protects you from the holy water!</span>")
return
else if(H.head)
to_chat(H, "\red Your helmet protects you from the holy water!")
to_chat(H, "<span class='warning'>Your helmet protects you from the holy water!</span>")
return
else
to_chat(M, "<span class='warning'>Something holy interferes with your powers!</span>")
@@ -342,8 +331,8 @@
/datum/reagent/holywater/reaction_turf(turf/simulated/T, volume)
..()
if(!istype(T)) return
if(!istype(T))
return
if(volume>=10)
for(var/obj/effect/rune/R in T)
qdel(R)
@@ -358,13 +347,9 @@
reagent_state = LIQUID
/datum/reagent/liquidgibs/reaction_turf(turf/T, volume) //yes i took it from synthflesh...
src = null
if(volume >= 5)
if(volume >= 5 && !istype(T, /turf/space))
new /obj/effect/decal/cleanable/blood/gibs/cleangibs(T)
playsound(T, 'sound/effects/splat.ogg', 50, 1, -3)
return
/datum/reagent/lye
name = "Lye"
+22 -22
View File
@@ -51,9 +51,9 @@
wait = 1
update_icon()
spawn(waittime)
src.wait = null
wait = null
update_icon()
playsound(src.loc, 'sound/machines/ping.ogg', 30, 1)
playsound(loc, 'sound/machines/ping.ogg', 30, 1)
/obj/machinery/computer/pandemic/update_icon()
if(stat & BROKEN)
@@ -75,8 +75,8 @@
if(!beaker) return
if(href_list["create_vaccine"])
if(!src.wait)
var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
if(!wait)
var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(loc)
if(B)
B.pixel_x = rand(-3, 3)
B.pixel_y = rand(-3, 3)
@@ -101,8 +101,8 @@
B.reagents.add_reagent("vaccine", 15, list(vaccine_type))
replicator_cooldown(200)
else
src.temp_html = "The replicator is not ready yet."
src.updateUsrDialog()
temp_html = "The replicator is not ready yet."
updateUsrDialog()
return
else if(href_list["create_virus_culture"])
if(!wait)
@@ -121,7 +121,7 @@
var/name = stripped_input(usr,"Name:","Name the culture",D.name,MAX_NAME_LEN)
if(name == null || wait)
return
var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(loc)
B.icon_state = "bottle3"
B.pixel_x = rand(-3, 3)
B.pixel_y = rand(-3, 3)
@@ -130,24 +130,24 @@
B.name = "[name] culture bottle"
B.desc = "A small bottle. Contains [D.agent] culture in synthblood medium."
B.reagents.add_reagent("blood",20,data)
src.updateUsrDialog()
updateUsrDialog()
else
src.temp_html = "The replicator is not ready yet."
src.updateUsrDialog()
temp_html = "The replicator is not ready yet."
updateUsrDialog()
return
else if(href_list["empty_beaker"])
beaker.reagents.clear_reagents()
src.updateUsrDialog()
updateUsrDialog()
return
else if(href_list["eject"])
beaker:loc = src.loc
beaker:loc = loc
beaker = null
icon_state = "mixer0"
src.updateUsrDialog()
updateUsrDialog()
return
else if(href_list["clear"])
src.temp_html = ""
src.updateUsrDialog()
temp_html = ""
updateUsrDialog()
return
else if(href_list["name_disease"])
var/new_name = stripped_input(usr, "Name the Disease", "New Name", "", MAX_NAME_LEN)
@@ -161,15 +161,15 @@
A.AssignName(new_name)
for(var/datum/disease/advance/AD in disease_master.processing)
AD.Refresh()
src.updateUsrDialog()
updateUsrDialog()
else
usr << browse(null, "window=pandemic")
src.updateUsrDialog()
updateUsrDialog()
return
src.add_fingerprint(usr)
add_fingerprint(usr)
return
/obj/machinery/computer/pandemic/attack_hand(mob/user)
@@ -177,8 +177,8 @@
return
user.set_machine(src)
var/dat = ""
if(src.temp_html)
dat = "[src.temp_html]<BR><BR><A href='?src=\ref[src];clear=1'>Main Menu</A>"
if(temp_html)
dat = "[temp_html]<BR><BR><A href='?src=\ref[src];clear=1'>Main Menu</A>"
else if(!beaker)
dat += "Please insert beaker.<BR>"
dat += "<A href='?src=\ref[user];mach_close=pandemic'>Close</A>"
@@ -284,11 +284,11 @@
beaker = I
beaker.loc = src
to_chat(user, "<span class='notice'>You add the beaker to the machine.</span>")
src.updateUsrDialog()
updateUsrDialog()
icon_state = "mixer1"
else if(istype(I, /obj/item/weapon/screwdriver))
if(src.beaker)
if(beaker)
beaker.loc = get_turf(src)
..()
return
+1 -1
View File
@@ -28,7 +28,7 @@
/obj/item/weapon/reagent_containers/New()
..()
if(!possible_transfer_amounts)
src.verbs -= /obj/item/weapon/reagent_containers/verb/set_APTFT
verbs -= /obj/item/weapon/reagent_containers/verb/set_APTFT
var/datum/reagents/R = new/datum/reagents(volume)
reagents = R
R.my_atom = src
@@ -49,8 +49,8 @@
if(charge_tick < recharge_time) return 0
charge_tick = 0
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
if(isrobot(loc))
var/mob/living/silicon/robot/R = loc
if(R && R.cell)
var/datum/reagents/RG = reagent_list[mode]
if(RG.total_volume < RG.maximum_volume) //Don't recharge reagents and drain power if the storage is full.
@@ -84,10 +84,10 @@
if(M.reagents)
var/datum/reagent/injected = chemical_reagents_list[reagent_ids[mode]]
var/contained = injected.name
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been injected with [src.name] by [key_name(user)]. Reagents: [contained]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to inject [key_name(M)]. Reagents: [contained]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been injected with [name] by [key_name(user)]. Reagents: [contained]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [name] to inject [key_name(M)]. Reagents: [contained]</font>")
if(M.ckey)
msg_admin_attack("[key_name_admin(user)] injected [key_name_admin(M)] with [src.name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)])")
msg_admin_attack("[key_name_admin(user)] injected [key_name_admin(M)] with [name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)])")
M.LAssailant = user
var/trans = R.trans_to(M, amount_per_transfer_from_this)
@@ -95,7 +95,7 @@
return
/obj/item/weapon/reagent_containers/borghypo/attack_self(mob/user)
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0) //Change the mode
playsound(loc, 'sound/effects/pop.ogg', 50, 0) //Change the mode
mode++
if(mode > reagent_list.len)
mode = 1
@@ -45,17 +45,17 @@
if(safe_thing)
if(!safe_thing.reagents)
safe_thing.create_reagents(100)
trans = src.reagents.trans_to(safe_thing, amount_per_transfer_from_this)
trans = reagents.trans_to(safe_thing, amount_per_transfer_from_this)
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[] tries to squirt something into []'s eyes, but fails!</B>", user, target), 1)
spawn(5)
src.reagents.reaction(safe_thing, TOUCH)
reagents.reaction(safe_thing, TOUCH)
to_chat(user, "\blue You transfer [trans] units of the solution.")
if(src.reagents.total_volume<=0)
if(reagents.total_volume<=0)
filled = 0
icon_state = "[initial(icon_state)]"
return
@@ -63,26 +63,26 @@
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[] squirts something into []'s eyes!</B>", user, target), 1)
src.reagents.reaction(target, TOUCH)
reagents.reaction(target, TOUCH)
var/mob/living/M = target
var/list/injected = list()
for(var/datum/reagent/R in src.reagents.reagent_list)
for(var/datum/reagent/R in reagents.reagent_list)
injected += R.name
var/contained = english_list(injected)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been squirted with [src.name] by [key_name(user)]. Reagents: [contained]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to squirt [key_name(M)]. Reagents: [contained]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been squirted with [name] by [key_name(user)]. Reagents: [contained]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [name] to squirt [key_name(M)]. Reagents: [contained]</font>")
if(M.ckey)
msg_admin_attack("[key_name_admin(user)] squirted [key_name_admin(M)] with [src.name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)])")
msg_admin_attack("[key_name_admin(user)] squirted [key_name_admin(M)] with [name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)])")
if(!iscarbon(user))
M.LAssailant = null
else
M.LAssailant = user
trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
trans = reagents.trans_to(target, amount_per_transfer_from_this)
to_chat(user, "\blue You transfer [trans] units of the solution.")
if(src.reagents.total_volume<=0)
if(reagents.total_volume<=0)
filled = 0
icon_state = "[initial(icon_state)]"
@@ -9,7 +9,7 @@
/obj/item/weapon/reagent_containers/food/drinks/cans/attack_self(mob/user)
if(canopened == 0)
playsound(src.loc,'sound/effects/canopen.ogg', rand(10,50), 1)
playsound(loc,'sound/effects/canopen.ogg', rand(10,50), 1)
to_chat(user, "<span class='notice'>You open the drink with an audible pop!</span>")
canopened = 1
flags |= OPENCONTAINER
@@ -32,7 +32,7 @@
if(canopened == 0)
to_chat(user, "<span class='notice'>You need to open the drink!</span>")
return
else if(M == user && !src.reagents.total_volume && user.a_intent == "harm" && user.zone_sel.selecting == "head")
else if(M == user && !reagents.total_volume && user.a_intent == "harm" && user.zone_sel.selecting == "head")
user.visible_message("<span class='warning'>[user] crushes ["\the [src]"] on \his forehead!</span>", "<span class='notice'>You crush \the [src] on your forehead.</span>")
crush(user)
return
@@ -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 = reagents.trans_to(target, amount_per_transfer_from_this)
to_chat(user, "<span class='notice'>You transfer [trans] units of the condiment to [target].</span>")
/obj/item/weapon/reagent_containers/food/condiment/on_reagent_change()
@@ -223,7 +223,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)
reagents.trans_to(target, amount_per_transfer_from_this)
qdel(src)
/obj/item/weapon/reagent_containers/food/condiment/pack/on_reagent_change()
@@ -80,7 +80,7 @@
refill = reagents.get_master_reagent_id()
refillName = reagents.get_master_reagent_name()
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
to_chat(user, "<span class='notice'> You transfer [trans] units of the solution to [target].</span>")
if(isrobot(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
@@ -101,22 +101,22 @@
if(istype(I, /obj/item/clothing/mask/cigarette)) //ciggies are weird
return
if(is_hot(I))
if(src.reagents)
src.reagents.chem_temp += 15
if(reagents)
reagents.chem_temp += 15
to_chat(user, "<span class='notice'>You heat [src] with [I].</span>")
src.reagents.handle_reactions()
reagents.handle_reactions()
/obj/item/weapon/reagent_containers/food/drinks/examine(mob/user)
if(!..(user, 1))
return
if(!reagents || reagents.total_volume==0)
to_chat(user, "<span class='notice'> \The [src] is empty!</span>")
else if(reagents.total_volume<=src.volume/4)
else if(reagents.total_volume <= volume/4)
to_chat(user, "<span class='notice'> \The [src] is almost empty!</span>")
else if(reagents.total_volume<=src.volume*0.66)
else if(reagents.total_volume <= volume*0.66)
to_chat(user, "<span class='notice'> \The [src] is half full!</span>")// We're all optimistic, right?!
else if(reagents.total_volume<=src.volume*0.90)
else if(reagents.total_volume <= volume*0.90)
to_chat(user, "<span class='notice'> \The [src] is almost full!</span>")
else
to_chat(user, "<span class='notice'> \The [src] is full!</span>")
@@ -22,9 +22,9 @@
else
user.drop_item()
user.put_in_active_hand(B)
B.icon_state = src.icon_state
B.icon_state = icon_state
var/icon/I = new('icons/obj/drinks.dmi', src.icon_state)
var/icon/I = new('icons/obj/drinks.dmi', icon_state)
I.Blend(B.broken_outline, ICON_OVERLAY, rand(5), 1)
I.SwapColor(rgb(255, 0, 220, 255), rgb(0, 0, 0, 0))
B.icon = I
@@ -99,11 +99,11 @@
//Display an attack message.
if(target != user)
target.visible_message("<span class='danger'>[user] has hit [target][head_attack_message] with a bottle of [src.name]!</span>", \
"<span class='userdanger'>[user] has hit [target][head_attack_message] with a bottle of [src.name]!</span>")
target.visible_message("<span class='danger'>[user] has hit [target][head_attack_message] with a bottle of [name]!</span>", \
"<span class='userdanger'>[user] has hit [target][head_attack_message] with a bottle of [name]!</span>")
else
user.visible_message("<span class='danger'>[target] hits \himself with a bottle of [src.name][head_attack_message]!</span>", \
"<span class='userdanger'>[target] hits \himself with a bottle of [src.name][head_attack_message]!</span>")
user.visible_message("<span class='danger'>[target] hits \himself with a bottle of [name][head_attack_message]!</span>", \
"<span class='userdanger'>[target] hits \himself with a bottle of [name][head_attack_message]!</span>")
//Attack logs
add_logs(target, user, "attacked", src)
@@ -44,7 +44,7 @@
spray(A)
playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6)
playsound(loc, 'sound/effects/spray2.ogg', 50, 1, -6)
user.changeNext_move(CLICK_CD_RANGE*2)
user.newtonian_move(get_dir(A, user))
@@ -82,8 +82,8 @@
to_chat(user, "<span class='notice'>You [amount_per_transfer_from_this == 10 ? "remove" : "fix"] the nozzle. You'll now use [amount_per_transfer_from_this] units per spray.</span>")
/obj/item/weapon/reagent_containers/spray/examine(mob/user)
if(..(user, 0) && user==src.loc)
to_chat(user, "[round(src.reagents.total_volume)] units left.")
if(..(user, 0) && user == loc)
to_chat(user, "[round(reagents.total_volume)] units left.")
/obj/item/weapon/reagent_containers/spray/verb/empty()
@@ -94,10 +94,10 @@
return
if(alert(usr, "Are you sure you want to empty that?", "Empty Bottle:", "Yes", "No") != "Yes")
return
if(isturf(usr.loc) && src.loc == usr)
if(isturf(usr.loc) && loc == usr)
to_chat(usr, "<span class='notice'>You empty \the [src] onto the floor.</span>")
reagents.reaction(usr.loc)
src.reagents.clear_reagents()
reagents.clear_reagents()
//space cleaner
/obj/item/weapon/reagent_containers/spray/cleaner
@@ -156,10 +156,10 @@
/obj/item/weapon/reagent_containers/spray/chemsprayer/spray(var/atom/A)
var/Sprays[3]
for(var/i=1, i<=3, i++) // intialize sprays
if(src.reagents.total_volume < 1) break
if(reagents.total_volume < 1) break
var/obj/effect/decal/chempuff/D = new/obj/effect/decal/chempuff(get_turf(src))
D.create_reagents(amount_per_transfer_from_this)
src.reagents.trans_to(D, amount_per_transfer_from_this)
reagents.trans_to(D, amount_per_transfer_from_this)
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
@@ -82,7 +82,7 @@
if(istype(target, /mob/living/carbon/slime))
to_chat(user, "\red You are unable to locate any blood.")
return
if(src.reagents.has_reagent("blood"))
if(reagents.has_reagent("blood"))
to_chat(user, "\red There is already a blood sample in this syringe")
return
if(istype(target, /mob/living/carbon))//maybe just add a blood reagent to all mobs. Then you can suck them dry...With hundreds of syringes. Jolly good idea.
@@ -109,7 +109,7 @@
if(!do_mob(user, target, time))
return
var/amount = src.reagents.maximum_volume - src.reagents.total_volume
var/amount = reagents.maximum_volume - reagents.total_volume
if(amount == 0)
to_chat(usr, "<span class='warning'>The syringe is full!</span>")
return
@@ -125,10 +125,10 @@
B = T.take_blood(src,amount)
if(B)
src.reagents.reagent_list |= B
src.reagents.update_total()
src.on_reagent_change()
src.reagents.handle_reactions()
reagents.reagent_list |= B
reagents.update_total()
on_reagent_change()
reagents.handle_reactions()
to_chat(user, "\blue You take a blood sample from [target]")
for(var/mob/O in viewers(4, user))
@@ -193,25 +193,25 @@
if(istype(target,/mob/living))
var/mob/living/M = target
var/list/injected = list()
for(var/datum/reagent/R in src.reagents.reagent_list)
for(var/datum/reagent/R in reagents.reagent_list)
injected += R.name
var/contained = english_list(injected)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been injected with [src.name] by [key_name(user)]. Reagents: [contained]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to inject [key_name(M)]. Reagents: [contained]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been injected with [name] by [key_name(user)]. Reagents: [contained]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [name] to inject [key_name(M)]. Reagents: [contained]</font>")
if(M.ckey)
msg_admin_attack("[key_name_admin(user)] injected [key_name_admin(M)] with [src.name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)])")
msg_admin_attack("[key_name_admin(user)] injected [key_name_admin(M)] with [name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)])")
if(!iscarbon(user))
M.LAssailant = null
else
M.LAssailant = user
src.reagents.reaction(target, INGEST)
reagents.reaction(target, INGEST)
if(ismob(target) && target == user)
src.reagents.reaction(target, INGEST)
reagents.reaction(target, INGEST)
spawn(5)
var/datum/reagent/blood/B
for(var/datum/reagent/blood/d in src.reagents.reagent_list)
for(var/datum/reagent/blood/d in reagents.reagent_list)
B = d
break
var/trans
@@ -219,8 +219,8 @@
var/mob/living/carbon/C = target
C.inject_blood(src, 5)
else
trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
to_chat(user, "\blue You inject [trans] units of the solution. The syringe now contains [src.reagents.total_volume] units.")
trans = reagents.trans_to(target, amount_per_transfer_from_this)
to_chat(user, "\blue You inject [trans] units of the solution. The syringe now contains [reagents.total_volume] units.")
if(istype(target, /obj/item/weapon/reagent_containers/food/pill/patch))
var/obj/item/weapon/reagent_containers/food/pill/patch/P = target
if(P.instant_application)
@@ -342,12 +342,12 @@
if(!do_mob(user, target, 300)) return
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red [] injects [] with a giant syringe!", user, target), 1)
src.reagents.reaction(target, INGEST)
reagents.reaction(target, INGEST)
if(ismob(target) && target == user)
src.reagents.reaction(target, INGEST)
reagents.reaction(target, INGEST)
spawn(5)
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
to_chat(user, "\blue You inject [trans] units of the solution. The syringe now contains [src.reagents.total_volume] units.")
var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
to_chat(user, "\blue You inject [trans] units of the solution. The syringe now contains [reagents.total_volume] units.")
if(reagents.total_volume >= reagents.maximum_volume && mode==SYRINGE_INJECT)
mode = SYRINGE_DRAW
update_icon()
+6 -6
View File
@@ -20,7 +20,7 @@
reagents = R
R.my_atom = src
if(!possible_transfer_amounts)
src.verbs -= /obj/structure/reagent_dispensers/verb/set_APTFT
verbs -= /obj/structure/reagent_dispensers/verb/set_APTFT
..()
/obj/structure/reagent_dispensers/examine(mob/user)
@@ -50,12 +50,12 @@
return
if(2.0)
if(prob(50))
new /obj/effect/effect/water(src.loc)
new /obj/effect/effect/water(loc)
qdel(src)
return
if(3.0)
if(prob(5))
new /obj/effect/effect/water(src.loc)
new /obj/effect/effect/water(loc)
qdel(src)
return
else
@@ -63,7 +63,7 @@
/obj/structure/reagent_dispensers/blob_act()
if(prob(50))
new /obj/effect/effect/water(src.loc)
new /obj/effect/effect/water(loc)
qdel(src)
@@ -106,7 +106,7 @@
boom()
/obj/structure/reagent_dispensers/fueltank/proc/boom()
explosion(src.loc,0,1,5,7,10, flame_range = 5)
explosion(loc,0,1,5,7,10, flame_range = 5)
if(src)
qdel(src)
@@ -231,7 +231,7 @@
reagents.add_reagent("beer",1000)
/obj/structure/reagent_dispensers/beerkeg/blob_act()
explosion(src.loc,0,3,5,7,10)
explosion(loc,0,3,5,7,10)
qdel(src)
/obj/structure/reagent_dispensers/virusfood