diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm index 7e251532bd1..a7741267d09 100644 --- a/code/game/objects/items/weapons/paint.dm +++ b/code/game/objects/items/weapons/paint.dm @@ -1,7 +1,5 @@ //NEVER USE THIS IT SUX -PETETHEGOAT -var/global/list/cached_icons = list() - /obj/item/weapon/reagent_containers/glass/paint desc = "It's a paint bucket." name = "paint bucket" @@ -10,220 +8,57 @@ var/global/list/cached_icons = list() item_state = "paintcan" materials = list(MAT_METAL=200) w_class = 3 - amount_per_transfer_from_this = 10 - possible_transfer_amounts = list(10,20,30,50,70) + amount_per_transfer_from_this = 5 + possible_transfer_amounts = list(5,10,20,30,50,70) volume = 70 flags = OPENCONTAINER - var/paint_type = "" - afterattack(turf/simulated/target, mob/user, proximity) - if(!proximity) return - if(istype(target) && reagents.total_volume > 5) - for(var/mob/O in viewers(user)) - O.show_message("\red \The [target] has been splashed with something by [user]!", 1) - spawn(5) - reagents.reaction(target, TOUCH) - reagents.remove_any(5) - else - return ..() - - New() - if(paint_type == "remover") - name = "paint remover bucket" - else if(paint_type && lentext(paint_type) > 0) - name = paint_type + " " + name - ..() - reagents.add_reagent("paint_[paint_type]", volume) - - red - icon_state = "paint_red" - paint_type = "red" - - green - icon_state = "paint_green" - paint_type = "green" - - blue - icon_state = "paint_blue" - paint_type = "blue" - - yellow - icon_state = "paint_yellow" - paint_type = "yellow" - - violet - icon_state = "paint_violet" - paint_type = "violet" - - black - icon_state = "paint_black" - paint_type = "black" - - white - icon_state = "paint_white" - paint_type = "white" - - remover - paint_type = "remover" -/* -/obj/item/weapon/paint - name = "Paint Can" - desc = "Used to recolor floors and walls. Can not be removed by the janitor." - icon = 'icons/obj/items.dmi' - icon_state = "paint_neutral" - color = "FFFFFF" - item_state = "paintcan" - w_class = 3 - -/obj/item/weapon/paint/red - name = "Red paint" - color = "FF0000" - icon_state = "paint_red" - -/obj/item/weapon/paint/green - name = "Green paint" - color = "00FF00" - icon_state = "paint_green" - -/obj/item/weapon/paint/blue - name = "Blue paint" - color = "0000FF" - icon_state = "paint_blue" - -/obj/item/weapon/paint/yellow - name = "Yellow paint" - color = "FFFF00" - icon_state = "paint_yellow" - -/obj/item/weapon/paint/violet - name = "Violet paint" - color = "FF00FF" - icon_state = "paint_violet" - -/obj/item/weapon/paint/black - name = "Black paint" - color = "333333" - icon_state = "paint_black" - -/obj/item/weapon/paint/white - name = "White paint" - color = "FFFFFF" - icon_state = "paint_white" - - -/obj/item/weapon/paint/anycolor - name = "Any color" - icon_state = "paint_neutral" - - attack_self(mob/user as mob) - var/t1 = input(user, "Please select a color:", "Locking Computer", null) in list( "red", "blue", "green", "yellow", "black", "white") - if((user.get_active_hand() != src || user.stat || user.restrained())) - return - switch(t1) - if("red") - color = "FF0000" - if("blue") - color = "0000FF" - if("green") - color = "00FF00" - if("yellow") - color = "FFFF00" - if("violet") - color = "FF00FF" - if("white") - color = "FFFFFF" - if("black") - color = "333333" - icon_state = "paint_[t1]" - add_fingerprint(user) +/obj/item/weapon/reagent_containers/glass/paint/afterattack(turf/simulated/target, mob/user, proximity) + if(!proximity) return - - -/obj/item/weapon/paint/afterattack(turf/target, mob/user as mob, proximity) - if(!proximity) return - if(!istype(target) || istype(target, /turf/space)) - return - var/ind = "[initial(target.icon)][color]" - if(!cached_icons[ind]) - var/icon/overlay = new/icon(initial(target.icon)) - overlay.Blend("#[color]",ICON_MULTIPLY) - overlay.SetIntensity(1.4) - target.icon = overlay - cached_icons[ind] = target.icon + if(istype(target) && reagents.total_volume >= 5) + user.visible_message("[target] has been splashed with something by [user]!") + spawn(5) + reagents.reaction(target, TOUCH) + reagents.remove_any(5) else - target.icon = cached_icons[ind] - return + return ..() -/obj/item/weapon/paint/paint_remover - name = "Paint remover" - icon_state = "paint_neutral" +/obj/item/weapon/reagent_containers/glass/paint/red + name = "red paint bucket" + icon_state = "paint_red" + list_reagents = list("paint_red" = 70) - afterattack(turf/target, mob/user as mob) - if(istype(target) && target.icon != initial(target.icon)) - target.icon = initial(target.icon) - return -*/ +/obj/item/weapon/reagent_containers/glass/paint/green + name = "green paint bucket" + icon_state = "paint_green" + list_reagents = list("paint_green" = 70) -datum/reagent/paint - name = "Paint" - id = "paint_" - description = "Floor paint is used to color floor tiles." - reagent_state = 2 - color = "#808080" +/obj/item/weapon/reagent_containers/glass/paint/blue + name = "blue paint bucket" + icon_state = "paint_blue" + list_reagents = list("paint_blue" = 70) - reaction_turf(var/turf/T, var/volume) - if(!istype(T) || istype(T, /turf/space)) - return - T.color = color +/obj/item/weapon/reagent_containers/glass/paint/yellow + name = "yellow paint bucket" + icon_state = "paint_yellow" + list_reagents = list("paint_yellow" = 70) - reaction_obj(var/obj/O, var/volume) - ..() - if(istype(O,/obj/item/weapon/light)) - O.color = color +/obj/item/weapon/reagent_containers/glass/paint/violet + name = "violet paint bucket" + icon_state = "paint_violet" + list_reagents = list("paint_violet" = 70) - red - name = "Red Paint" - id = "paint_red" - color = "#FF0000" +/obj/item/weapon/reagent_containers/glass/paint/black + name = "black paint bucket" + icon_state = "paint_black" + list_reagents = list("paint_black" = 70) - green - name = "Green Paint" - color = "#00FF00" - id = "paint_green" +/obj/item/weapon/reagent_containers/glass/paint/white + name = "white paint bucket" + icon_state = "paint_white" + list_reagents = list("paint_white" = 70) - blue - name = "Blue Paint" - color = "#0000FF" - id = "paint_blue" - - yellow - name = "Yellow Paint" - color = "#FFFF00" - id = "paint_yellow" - - violet - name = "Violet Paint" - color = "#FF00FF" - id = "paint_violet" - - black - name = "Black Paint" - color = "#333333" - id = "paint_black" - - white - name = "White Paint" - color = "#FFFFFF" - id = "paint_white" - -datum/reagent/paint_remover - name = "Paint Remover" - id = "paint_remover" - description = "Paint remover is used to remove floor paint from floor tiles." - reagent_state = 2 - color = "#808080" - - reaction_turf(var/turf/T, var/volume) - if(istype(T) && T.icon != initial(T.icon)) - T.icon = initial(T.icon) - return +/obj/item/weapon/reagent_containers/glass/paint/remover + name = "paint remover bucket" + list_reagents = list("paint_remover" = 70) \ No newline at end of file diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index bce80d857b1..ecc9c9ddc18 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -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) 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, "[bicon(my_atom)] [C.mix_message]") 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, "[bicon(my_atom)] The [my_atom]'s power is consumed in the reaction.") 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() diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 197df4425ec..fd5faf4d7bd 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -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 @@ -207,21 +207,21 @@ S.use(1) else if(!user.drop_item()) - to_chat(user, "\The [B] is stuck to you!") + to_chat(user, "[B] is stuck to you!") return qdel(B) broken_requirements -= broken_requirements[1] to_chat(user, "You fix [src].") return - if(src.beaker) + if(beaker) to_chat(user, "Something is already loaded into the machine.") 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, "\The [B] is stuck to you!") + to_chat(user, "[B] is stuck to you!") return B.forceMove(src) to_chat(user, "You set [B] on the machine.") @@ -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) @@ -362,10 +362,10 @@ playsound(src, 'sound/items/Ratchet.ogg', 50, 1) if(anchored) anchored = 0 - to_chat(user, "\The [src] can now be moved.") + to_chat(user, "[src] can now be moved.") else if(!anchored) anchored = 1 - to_chat(user, "\The [src] is now secured.") + to_chat(user, "[src] is now secured.") if(panel_open) if(istype(I, /obj/item/weapon/crowbar)) @@ -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, "A beaker is already loaded into the machine.") return if(!user.drop_item()) - to_chat(user, "\The [B] is stuck to you!") + to_chat(user, "[B] is stuck to you!") return - src.beaker = B + beaker = B B.forceMove(src) to_chat(user, "You add the beaker to the machine!") 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, "A pill bottle is already loaded into the machine.") return if(!user.drop_item()) - to_chat(user, "\The [B] is stuck to you!") + to_chat(user, "[B] is stuck to you!") return - src.loaded_pill_bottle = B + loaded_pill_bottle = B B.forceMove(src) to_chat(user, "You add the pill bottle into the dispenser slot!") 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,11 @@ return if(href_list["print_p"]) - if(!(src.printing)) - src.printing = 1 - for(var/mob/O in viewers(usr)) - O.show_message("\blue \the [src] rattles and prints out a sheet of paper.", 1) + if(!(printing)) + printing = 1 + visible_message("[src] rattles and prints out a sheet of paper.") 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 = "
Chemical Analysis

" P.info += "Time of analysis: [worldtime2text(world.time)]

" P.info += "Chemical name: [href_list["name"]]
" @@ -499,7 +498,7 @@ P.info += "Description: [href_list["desc"]]" P.info += "

Notes:
" P.name = "Chemical Analysis - [href_list["name"]]" - src.printing = null + printing = null if(beaker) var/datum/reagents/R = beaker.reagents @@ -537,7 +536,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 +554,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 +585,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 +626,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 +641,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 +649,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 +692,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 +732,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 +792,7 @@ default_deconstruction_crowbar(B) return 1 else - to_chat(user, "You can't use the [src.name] while it's panel is opened!") + to_chat(user, "You can't use the [name] while it's panel is opened!") return 1 else ..() @@ -884,12 +883,12 @@ return 1 else if(!user.drop_item()) - to_chat(user, "\The [O] is stuck to you!") + to_chat(user, "[O] is stuck to you!") return - src.beaker = O + beaker = O O.forceMove(src) update_icon() - src.updateUsrDialog() + updateUsrDialog() return 0 if(holdingitems && holdingitems.len >= limit) @@ -910,7 +909,7 @@ if(!O.contents.len) to_chat(user, "You empty the plant bag into the All-In-One grinder.") - src.updateUsrDialog() + updateUsrDialog() return 0 @@ -921,7 +920,7 @@ user.unEquip(O) O.forceMove(src) holdingitems += O - src.updateUsrDialog() + updateUsrDialog() return 0 /obj/machinery/reagentgrinder/attack_ai(mob/user) @@ -989,7 +988,7 @@ eject() if("detach") detach() - src.updateUsrDialog() + updateUsrDialog() return /obj/machinery/reagentgrinder/proc/detach() @@ -998,7 +997,7 @@ return if(!beaker) return - beaker.forceMove(src.loc) + beaker.forceMove(loc) beaker = null update_icon() @@ -1010,7 +1009,7 @@ return for(var/obj/item/O in holdingitems) - O.forceMove(src.loc) + O.forceMove(loc) holdingitems -= O holdingitems = list() @@ -1071,7 +1070,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 +1110,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 diff --git a/code/modules/reagents/Chemistry-Readme.dm b/code/modules/reagents/Chemistry-Readme.dm index fee6e61e2b9..cae0c31162c 100644 --- a/code/modules/reagents/Chemistry-Readme.dm +++ b/code/modules/reagents/Chemistry-Readme.dm @@ -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: diff --git a/code/modules/reagents/newchem/Blob-Reagents.dm b/code/modules/reagents/newchem/Blob-Reagents.dm index e451b561469..d3ebcc447b5 100644 --- a/code/modules/reagents/newchem/Blob-Reagents.dm +++ b/code/modules/reagents/newchem/Blob-Reagents.dm @@ -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" diff --git a/code/modules/reagents/newchem/chem_heater.dm b/code/modules/reagents/newchem/chem_heater.dm index daea5802d64..28d1f4c2afa 100644 --- a/code/modules/reagents/newchem/chem_heater.dm +++ b/code/modules/reagents/newchem/chem_heater.dm @@ -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(..()) diff --git a/code/modules/reagents/newchem/drinks.dm b/code/modules/reagents/newchem/drinks.dm index 4790b4d01ec..5f4dc5b0018 100644 --- a/code/modules/reagents/newchem/drinks.dm +++ b/code/modules/reagents/newchem/drinks.dm @@ -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) diff --git a/code/modules/reagents/newchem/drugs.dm b/code/modules/reagents/newchem/drugs.dm index ac9f2bdcc39..99a637e4fca 100644 --- a/code/modules/reagents/newchem/drugs.dm +++ b/code/modules/reagents/newchem/drugs.dm @@ -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) ..() diff --git a/code/modules/reagents/newchem/food.dm b/code/modules/reagents/newchem/food.dm index c1b78581534..6909a60e2e5 100644 --- a/code/modules/reagents/newchem/food.dm +++ b/code/modules/reagents/newchem/food.dm @@ -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, "That tasted amazing!") @@ -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, "[spooky_eat]") @@ -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) diff --git a/code/modules/reagents/newchem/medicine.dm b/code/modules/reagents/newchem/medicine.dm index 5b5e5722c46..e5e7af93b66 100644 --- a/code/modules/reagents/newchem/medicine.dm +++ b/code/modules/reagents/newchem/medicine.dm @@ -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("[M] seems to rise from the dead!") - 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) diff --git a/code/modules/reagents/newchem/newchem_procs.dm b/code/modules/reagents/newchem/newchem_procs.dm index 4508125387e..68e618a9ac7 100644 --- a/code/modules/reagents/newchem/newchem_procs.dm +++ b/code/modules/reagents/newchem/newchem_procs.dm @@ -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 diff --git a/code/modules/reagents/newchem/other.dm b/code/modules/reagents/newchem/other.dm index 44d506a026a..2ff4a18c3d0 100644 --- a/code/modules/reagents/newchem/other.dm +++ b/code/modules/reagents/newchem/other.dm @@ -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"] diff --git a/code/modules/reagents/newchem/pyro.dm b/code/modules/reagents/newchem/pyro.dm index 96cbecf3680..7afdc564647 100644 --- a/code/modules/reagents/newchem/pyro.dm +++ b/code/modules/reagents/newchem/pyro.dm @@ -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 diff --git a/code/modules/reagents/newchem/toxins.dm b/code/modules/reagents/newchem/toxins.dm index e9729b47f10..56d64d9a62e 100644 --- a/code/modules/reagents/newchem/toxins.dm +++ b/code/modules/reagents/newchem/toxins.dm @@ -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, "Your mask melts away but protects you from the acid!") else - to_chat(H, "\red Your mask protects you from the acid!") + to_chat(H, "Your mask protects you from the acid!") 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, "Your helmet melts away but protects you from the acid") else - to_chat(H, "\red Your helmet protects you from the acid!") + to_chat(H, "Your helmet protects you from the acid!") 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("[O] melts.") 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("The fungi are completely dissolved by the solution!") /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)) diff --git a/code/modules/reagents/oldchem/reagents/_reagent_base.dm b/code/modules/reagents/oldchem/reagents/_reagent_base.dm index 3adfab86292..fbf1398decb 100644 --- a/code/modules/reagents/oldchem/reagents/_reagent_base.dm +++ b/code/modules/reagents/oldchem/reagents/_reagent_base.dm @@ -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, "You suddenly feel invigorated and guilty...") - 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, "You feel slightly better, but for how long?") 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 diff --git a/code/modules/reagents/oldchem/reagents/drink/reagents_alcohol.dm b/code/modules/reagents/oldchem/reagents/drink/reagents_alcohol.dm index bc3fc46c1af..da92ffee0f2 100644 --- a/code/modules/reagents/oldchem/reagents/drink/reagents_alcohol.dm +++ b/code/modules/reagents/oldchem/reagents/drink/reagents_alcohol.dm @@ -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 diff --git a/code/modules/reagents/oldchem/reagents/drink/reagents_drink.dm b/code/modules/reagents/oldchem/reagents/drink/reagents_drink.dm index 418fc80daf4..26bad6c1665 100644 --- a/code/modules/reagents/oldchem/reagents/drink/reagents_drink.dm +++ b/code/modules/reagents/oldchem/reagents/drink/reagents_drink.dm @@ -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) ..() \ No newline at end of file diff --git a/code/modules/reagents/oldchem/reagents/reagents_flammable.dm b/code/modules/reagents/oldchem/reagents/reagents_flammable.dm index 45059ed84dd..52d33e21e07 100644 --- a/code/modules/reagents/oldchem/reagents/reagents_flammable.dm +++ b/code/modules/reagents/oldchem/reagents/reagents_flammable.dm @@ -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 + W.overlays.Cut() + W.overlays = image('icons/effects/effects.dmi',icon_state = "thermite") /datum/reagent/glycerol name = "Glycerol" diff --git a/code/modules/reagents/oldchem/reagents/reagents_food.dm b/code/modules/reagents/oldchem/reagents/reagents_food.dm index 57dfd93c19d..1dbe1f05a20 100644 --- a/code/modules/reagents/oldchem/reagents/reagents_food.dm +++ b/code/modules/reagents/oldchem/reagents/reagents_food.dm @@ -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) diff --git a/code/modules/reagents/oldchem/reagents/reagents_misc.dm b/code/modules/reagents/oldchem/reagents/reagents_misc.dm index c4fec24d054..ff729dcdf3f 100644 --- a/code/modules/reagents/oldchem/reagents/reagents_misc.dm +++ b/code/modules/reagents/oldchem/reagents/reagents_misc.dm @@ -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, /turf/space) && !(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" diff --git a/code/modules/reagents/oldchem/reagents/reagents_paint.dm b/code/modules/reagents/oldchem/reagents/reagents_paint.dm new file mode 100644 index 00000000000..0ca67259126 --- /dev/null +++ b/code/modules/reagents/oldchem/reagents/reagents_paint.dm @@ -0,0 +1,60 @@ +/datum/reagent/paint + name = "Paint" + id = "paint_" + description = "Floor paint is used to color floor tiles." + reagent_state = LIQUID + color = "#808080" + +/datum/reagent/paint/reaction_turf(turf/T, volume) + if(!istype(T, /turf/space)) + T.color = color + +/datum/reagent/paint/reaction_obj(obj/O, volume) + if(istype(O, /obj/item/weapon/light)) + O.color = color + +/datum/reagent/paint/red + name = "Red Paint" + id = "paint_red" + color = "#FF0000" + +/datum/reagent/paint/green + name = "Green Paint" + id = "paint_green" + color = "#00FF00" + +/datum/reagent/paint/blue + name = "Blue Paint" + id = "paint_blue" + color = "#0000FF" + +/datum/reagent/paint/yellow + name = "Yellow Paint" + id = "paint_yellow" + color = "#FFFF00" + +/datum/reagent/paint/violet + name = "Violet Paint" + id = "paint_violet" + color = "#FF00FF" + +/datum/reagent/paint/black + name = "Black Paint" + id = "paint_black" + color = "#333333" + +/datum/reagent/paint/white + name = "White Paint" + id = "paint_white" + color = "#FFFFFF" + +/datum/reagent/paint_remover + name = "Paint Remover" + id = "paint_remover" + description = "Paint remover is used to remove floor paint from floor tiles." + reagent_state = LIQUID + color = "#808080" + +/datum/reagent/paint_remover/reaction_turf(turf/T, volume) + if(!istype(T, /turf/space)) + T.color = initial(T.color) \ No newline at end of file diff --git a/code/modules/reagents/oldchem/reagents/reagents_toxin.dm b/code/modules/reagents/oldchem/reagents/reagents_toxin.dm index 20ccb420e85..bbdf92b8693 100644 --- a/code/modules/reagents/oldchem/reagents/reagents_toxin.dm +++ b/code/modules/reagents/oldchem/reagents/reagents_toxin.dm @@ -53,7 +53,7 @@ /datum/reagent/slimejelly/on_mob_life(mob/living/M) if(prob(10)) - to_chat(M, "\red Your insides are burning!") + to_chat(M, "Your insides are burning!") M.adjustToxLoss(rand(20,60)*REM) else if(prob(40)) M.adjustBruteLoss(-5*REM) @@ -70,10 +70,10 @@ if(ishuman(M)) var/mob/living/carbon/human/human = M if(human.species.name != "Shadow") - to_chat(M, "\red Your flesh rapidly mutates!") - to_chat(M, "You are now a Shadow Person, a mutant race of darkness-dwelling humanoids.") - to_chat(M, "\red Your body reacts violently to light. \green However, it naturally heals in darkness.") - to_chat(M, "Aside from your new traits, you are mentally unchanged and retain your prior obligations.") + to_chat(M, "Your flesh rapidly mutates!") + to_chat(M, "You are now a Shadow Person, a mutant race of darkness-dwelling humanoids.") + to_chat(M, "Your body reacts violently to light. \green However, it naturally heals in darkness.") + to_chat(M, "Aside from your new traits, you are mentally unchanged and retain your prior obligations.") human.set_species("Shadow") ..() @@ -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 @@ -230,11 +224,11 @@ if(volume > 25) if(H.wear_mask) - to_chat(H, "\red Your mask protects you from the acid!") + to_chat(H, "Your mask protects you from the acid!") return if(H.head) - to_chat(H, "\red Your helmet protects you from the acid!") + to_chat(H, "Your helmet protects you from the acid!") return if(!M.unacidable) @@ -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("[O] melts.") 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 @@ -388,10 +379,10 @@ if( !safe_thing ) safe_thing = victim.glasses if( eyes_covered && mouth_covered ) - to_chat(victim, "\red Your [safe_thing] protects you from the pepperspray!") + to_chat(victim, "Your [safe_thing] protects you from the pepperspray!") return else if( mouth_covered ) // Reduced effects if partially protected - to_chat(victim, "\red Your [safe_thing] protect you from most of the pepperspray!") + to_chat(victim, "Your [safe_thing] protect you from most of the pepperspray!") if(prob(5)) victim.emote("scream") victim.eye_blurry = max(M.eye_blurry, 3) @@ -402,14 +393,14 @@ victim.drop_item() return else if( eyes_covered ) // Eye cover is better than mouth cover - to_chat(victim, "\red Your [safe_thing] protects your eyes from the pepperspray!") + to_chat(victim, "Your [safe_thing] protects your eyes from the pepperspray!") victim.eye_blurry = max(M.eye_blurry, 3) victim.damageoverlaytemp = 30 return else // Oh dear :D if(prob(5)) victim.emote("scream") - to_chat(victim, "\red You're sprayed directly in the eyes with pepperspray!") + to_chat(victim, "You're sprayed directly in the eyes with pepperspray!") victim.eye_blurry = max(M.eye_blurry, 5) victim.eye_blind = max(M.eye_blind, 2) victim.confused = max(M.confused, 6) diff --git a/code/modules/reagents/oldchem/reagents/reagents_water.dm b/code/modules/reagents/oldchem/reagents/reagents_water.dm index 7df0fd3fdba..a2ec51f1811 100644 --- a/code/modules/reagents/oldchem/reagents/reagents_water.dm +++ b/code/modules/reagents/oldchem/reagents/reagents_water.dm @@ -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, "Your mask protects you from the holy water!") return else if(H.head) - to_chat(H, "\red Your helmet protects you from the holy water!") + to_chat(H, "Your helmet protects you from the holy water!") return else to_chat(M, "Something holy interferes with your powers!") @@ -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" diff --git a/code/modules/reagents/pandemic.dm b/code/modules/reagents/pandemic.dm index d39b274db8c..059da261c5a 100644 --- a/code/modules/reagents/pandemic.dm +++ b/code/modules/reagents/pandemic.dm @@ -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]

Main Menu" + if(temp_html) + dat = "[temp_html]

Main Menu" else if(!beaker) dat += "Please insert beaker.
" dat += "Close" @@ -284,11 +284,11 @@ beaker = I beaker.loc = src to_chat(user, "You add the beaker to the machine.") - 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 diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index f977047d700..f8e6f626bb1 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -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 @@ -80,7 +80,7 @@ /obj/item/weapon/reagent_containers/wash(mob/user, atom/source) if(is_open_container()) if(reagents.total_volume >= volume) - to_chat(user, "\The [src] is full.") + to_chat(user, "[src] is full.") return else reagents.add_reagent("water", min(volume - reagents.total_volume, amount_per_transfer_from_this)) diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index 6f53f4c423b..634e0875aaf 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghydro.dm @@ -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()]\] Has been injected with [src.name] by [key_name(user)]. Reagents: [contained]") - user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to inject [key_name(M)]. Reagents: [contained]") + M.attack_log += text("\[[time_stamp()]\] Has been injected with [name] by [key_name(user)]. Reagents: [contained]") + user.attack_log += text("\[[time_stamp()]\] Used the [name] to inject [key_name(M)]. Reagents: [contained]") 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 diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm index 419325445f0..deeeb76b58d 100644 --- a/code/modules/reagents/reagent_containers/dropper.dm +++ b/code/modules/reagents/reagent_containers/dropper.dm @@ -18,11 +18,11 @@ if(filled) if(target.reagents.total_volume >= target.reagents.maximum_volume) - to_chat(user, "\red [target] is full.") + to_chat(user, "[target] is full.") return if(!target.is_open_container() && !ismob(target) && !istype(target,/obj/item/weapon/reagent_containers/food) && !istype(target, /obj/item/clothing/mask/cigarette)) //You can inject humans and food but you cant remove the shit. - to_chat(user, "\red You cannot directly fill this object.") + to_chat(user, "You cannot directly fill this object.") return var/trans = 0 @@ -45,60 +45,58 @@ 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 [] tries to squirt something into []'s eyes, but fails!", user, target), 1) + visible_message("[user] tries to squirt something into [victim]'s eyes, but fails!") 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) + to_chat(user, "You transfer [trans] units of the solution.") + if(reagents.total_volume<=0) filled = 0 icon_state = "[initial(icon_state)]" return - for(var/mob/O in viewers(world.view, user)) - O.show_message(text("\red [] squirts something into []'s eyes!", user, target), 1) - src.reagents.reaction(target, TOUCH) + visible_message("[user] squirts something into [target]'s eyes!") + 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()]\] Has been squirted with [src.name] by [key_name(user)]. Reagents: [contained]") - user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to squirt [key_name(M)]. Reagents: [contained]") + M.attack_log += text("\[[time_stamp()]\] Has been squirted with [name] by [key_name(user)]. Reagents: [contained]") + user.attack_log += text("\[[time_stamp()]\] Used the [name] to squirt [key_name(M)]. Reagents: [contained]") 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) - to_chat(user, "\blue You transfer [trans] units of the solution.") - if(src.reagents.total_volume<=0) + trans = reagents.trans_to(target, amount_per_transfer_from_this) + to_chat(user, "You transfer [trans] units of the solution.") + if(reagents.total_volume<=0) filled = 0 icon_state = "[initial(icon_state)]" else if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers)) - to_chat(user, "\red You cannot directly remove reagents from [target].") + to_chat(user, "You cannot directly remove reagents from [target].") return if(!target.reagents.total_volume) - to_chat(user, "\red [target] is empty.") + to_chat(user, "[target] is empty.") return var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) - to_chat(user, "\blue You fill the [src] with [trans] units of the solution.") + to_chat(user, "You fill [src] with [trans] units of the solution.") filled = 1 icon_state = "[initial(icon_state)][filled]" diff --git a/code/modules/reagents/reagent_containers/glass_containers.dm b/code/modules/reagents/reagent_containers/glass_containers.dm index 2dbc77e0ba7..10187280265 100644 --- a/code/modules/reagents/reagent_containers/glass_containers.dm +++ b/code/modules/reagents/reagent_containers/glass_containers.dm @@ -54,10 +54,10 @@ /obj/item/weapon/reagent_containers/glass/attack_self() ..() if(is_open_container()) - to_chat(usr, "You put the lid on \the [src].") + to_chat(usr, "You put the lid on [src].") flags ^= OPENCONTAINER else - to_chat(usr, "You take the lid off \the [src].") + to_chat(usr, "You take the lid off [src].") flags |= OPENCONTAINER update_icon() @@ -208,7 +208,7 @@ if(usr.incapacitated()) return if(assembly) - to_chat(usr, "You detach [assembly] from \the [src]") + to_chat(usr, "You detach [assembly] from [src]") usr.put_in_hands(assembly) assembly = null update_icon() @@ -223,7 +223,7 @@ /obj/item/weapon/reagent_containers/glass/beaker/attackby(obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/device/assembly_holder) && can_assembly) if(assembly) - to_chat(usr, "The [src] already has an assembly.") + to_chat(usr, "[src] already has an assembly.") return ..() assembly = W user.drop_item() diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index 205d025383f..3972f0a4a13 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -27,24 +27,24 @@ if(istype(A, /obj/structure/reagent_dispensers) && get_dist(src,A) <= 1) //this block copypasted from reagent_containers/glass, for lack of a better solution if(!A.reagents.total_volume && A.reagents) - to_chat(user, "\The [A] is empty.") + to_chat(user, "[A] is empty.") return if(reagents.total_volume >= reagents.maximum_volume) - to_chat(user, "\The [src] is full.") + to_chat(user, "[src] is full.") return var/trans = A.reagents.trans_to(src, A:amount_per_transfer_from_this) - to_chat(user, "You fill \the [src] with [trans] units of the contents of \the [A].") + to_chat(user, "You fill [src] with [trans] units of the contents of [A].") return if(reagents.total_volume < amount_per_transfer_from_this) - to_chat(user, "\The [src] is empty!") + to_chat(user, "[src] is empty!") return 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, "You [amount_per_transfer_from_this == 10 ? "remove" : "fix"] the nozzle. You'll now use [amount_per_transfer_from_this] units per spray.") /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) - to_chat(usr, "You empty \the [src] onto the floor.") + if(isturf(usr.loc) && loc == usr) + to_chat(usr, "You empty [src] onto the floor.") 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) diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 71232fa1dad..772eef4d0f9 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -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, "The syringe is full!") 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()]\] Has been injected with [src.name] by [key_name(user)]. Reagents: [contained]") - user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to inject [key_name(M)]. Reagents: [contained]") + M.attack_log += text("\[[time_stamp()]\] Has been injected with [name] by [key_name(user)]. Reagents: [contained]") + user.attack_log += text("\[[time_stamp()]\] Used the [name] to inject [key_name(M)]. Reagents: [contained]") 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() diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 5d2323b9b6e..f5225daeae1 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -20,18 +20,18 @@ 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) if(!..(user, 2)) return - to_chat(user, "\blue It contains:") + to_chat(user, "It contains:") if(reagents && reagents.reagent_list.len) for(var/datum/reagent/R in reagents.reagent_list) - to_chat(user, "\blue [R.volume] units of [R.name]") + to_chat(user, "[R.volume] units of [R.name]") else - to_chat(user, "\blue Nothing.") + to_chat(user, "Nothing.") /obj/structure/reagent_dispensers/verb/set_APTFT() //set amount_per_transfer_from_this set name = "Set transfer amount" @@ -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) @@ -128,13 +128,13 @@ if(!..(user, 2)) return if(rig) - to_chat(usr, "There is some kind of device rigged to the tank.") + to_chat(usr, "There is some kind of device rigged to the tank.") /obj/structure/reagent_dispensers/fueltank/attack_hand() if(rig) - usr.visible_message("[usr] begins to detach [rig] from \the [src].", "You begin to detach [rig] from \the [src]") + usr.visible_message("[usr] begins to detach [rig] from [src].", "You begin to detach [rig] from [src].") if(do_after(usr, 20, target = src)) - usr.visible_message("\blue [usr] detaches [rig] from \the [src].", "\blue You detach [rig] from \the [src]") + usr.visible_message("[usr] detaches [rig] from [src].", "You detach [rig] from [src].") rig.loc = get_turf(usr) rig = null overlays = new/list() @@ -142,11 +142,11 @@ /obj/structure/reagent_dispensers/fueltank/attackby(obj/item/weapon/W, mob/user, params) if(istype(W,/obj/item/device/assembly_holder) && accepts_rig) if(rig) - to_chat(user, "\red There is another device in the way.") + to_chat(user, "There is another device in the way.") return ..() - user.visible_message("[user] begins rigging [W] to \the [src].", "You begin rigging [W] to \the [src]") + user.visible_message("[user] begins rigging [W] to [src].", "You begin rigging [W] to [src]") if(do_after(user, 20, target = src)) - user.visible_message("\blue [user] rigs [W] to \the [src].", "\blue You rig [W] to \the [src]") + user.visible_message("[user] rigs [W] to [src].", "You rig [W] to [src].") var/obj/item/device/assembly_holder/H = W if(istype(H.a_left,/obj/item/device/assembly/igniter) || istype(H.a_right,/obj/item/device/assembly/igniter)) @@ -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 diff --git a/paradise.dme b/paradise.dme index 62bae84d007..d79069d135d 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1866,6 +1866,7 @@ #include "code\modules\reagents\oldchem\reagents\reagents_food.dm" #include "code\modules\reagents\oldchem\reagents\reagents_med.dm" #include "code\modules\reagents\oldchem\reagents\reagents_misc.dm" +#include "code\modules\reagents\oldchem\reagents\reagents_paint.dm" #include "code\modules\reagents\oldchem\reagents\reagents_toxin.dm" #include "code\modules\reagents\oldchem\reagents\reagents_water.dm" #include "code\modules\reagents\oldchem\reagents\drink\reagents_alcohol.dm"