merge fixes
This commit is contained in:
@@ -171,7 +171,7 @@
|
||||
|
||||
return master
|
||||
|
||||
/datum/reagents/proc/trans_to(obj/target, amount=1, multiplier=1, preserve_data=1, no_react = 0)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
/datum/reagents/proc/trans_to(obj/target, amount = 1, multiplier = 1, preserve_data = 1, no_react = 0, log = FALSE)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
var/list/cached_reagents = reagent_list
|
||||
if(!target || !total_volume)
|
||||
return
|
||||
@@ -188,17 +188,23 @@
|
||||
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
|
||||
var/part = amount / src.total_volume
|
||||
var/trans_data = null
|
||||
var/list/transferred = list()
|
||||
for(var/reagent in cached_reagents)
|
||||
var/datum/reagent/T = reagent
|
||||
var/transfer_amount = T.volume * part
|
||||
if(preserve_data)
|
||||
trans_data = copy_data(T)
|
||||
|
||||
transferred += "[T] - [transfer_amount]"
|
||||
|
||||
R.add_reagent(T.type, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE, ignore_pH = TRUE) //we only handle reaction after every reagent has been transfered.
|
||||
|
||||
remove_reagent(T.type, transfer_amount, ignore_pH = TRUE)
|
||||
|
||||
if(log && amount > 0)
|
||||
var/atom/us = my_atom
|
||||
var/atom/them = R.my_atom
|
||||
var/location_string = "FROM [(us && "[us] ([REF(us)]) [COORD(us)]") || "NULL"] TO [(them && "[them] ([REF(them)]) [COORD(them)]") || "NULL"]"
|
||||
log_reagent_transfer("[location_string] - [key_name(usr)][istext(log) ? " - [log]" : ""]: trans_to with arguments [target] [amount] [multiplier] [preserve_data] [no_react] and reagents [english_list(transferred)]")
|
||||
|
||||
update_total()
|
||||
R.update_total()
|
||||
if(!no_react)
|
||||
@@ -237,7 +243,7 @@
|
||||
src.handle_reactions()
|
||||
return amount
|
||||
|
||||
/datum/reagents/proc/trans_id_to(obj/target, reagent, amount=1, preserve_data=1)//Not sure why this proc didn't exist before. It does now! /N
|
||||
/datum/reagents/proc/trans_id_to(obj/target, reagent, amount = 1, preserve_data = TRUE, log = FALSE)//Not sure why this proc didn't exist before. It does now! /N
|
||||
var/list/cached_reagents = reagent_list
|
||||
if (!target)
|
||||
return
|
||||
@@ -257,8 +263,12 @@
|
||||
if(preserve_data)
|
||||
trans_data = current_reagent.data
|
||||
R.add_reagent(current_reagent.type, amount, trans_data, chem_temp, current_reagent.purity, pH, no_react = TRUE)
|
||||
|
||||
remove_reagent(current_reagent.type, amount, 1)
|
||||
if(log && amount > 0)
|
||||
var/atom/us = my_atom
|
||||
var/atom/them = R.my_atom
|
||||
var/location_string = "FROM [(us && "[us] ([REF(us)]) [COORD(us)]") || "NULL"] TO [(them && "[them] ([REF(them)]) [COORD(them)]") || "NULL"]"
|
||||
log_reagent_transfer("[location_string] - [key_name(usr)][istext(log) ? " - [log]" : ""]: trans_id_to with arguments [target] [reagent] [amount] [preserve_data]")
|
||||
break
|
||||
|
||||
src.update_total()
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
var/working_state = "dispenser_working"
|
||||
var/nopower_state = "dispenser_nopower"
|
||||
var/has_panel_overlay = TRUE
|
||||
var/macrotier = 1
|
||||
var/obj/item/reagent_containers/beaker = null
|
||||
//dispensable_reagents is copypasted in plumbing synthesizers. Please update accordingly. (I didn't make it global because that would limit custom chem dispensers)
|
||||
var/list/dispensable_reagents = list(
|
||||
/datum/reagent/hydrogen,
|
||||
/datum/reagent/lithium,
|
||||
@@ -61,7 +61,7 @@
|
||||
/datum/reagent/bromine,
|
||||
/datum/reagent/stable_plasma
|
||||
)
|
||||
//these become available once upgraded.
|
||||
//These become available once upgraded.
|
||||
var/list/upgrade_reagents = list(
|
||||
/datum/reagent/oil,
|
||||
/datum/reagent/ammonia,
|
||||
@@ -87,11 +87,13 @@
|
||||
/datum/reagent/toxin/histamine,
|
||||
/datum/reagent/medicine/morphine
|
||||
)
|
||||
var/list/recording_recipe
|
||||
|
||||
var/list/saved_recipes = list()
|
||||
|
||||
/obj/machinery/chem_dispenser/Initialize()
|
||||
. = ..()
|
||||
dispensable_reagents = sortList(dispensable_reagents, /proc/cmp_reagents_asc)
|
||||
if(emagged_reagents)
|
||||
emagged_reagents = sortList(emagged_reagents, /proc/cmp_reagents_asc)
|
||||
if(upgrade_reagents)
|
||||
@@ -116,15 +118,6 @@
|
||||
. += "<span class='notice'>The status display reads:\n\
|
||||
Recharging <b>[recharge_amount]</b> power units per interval.\n\
|
||||
Power efficiency increased by <b>[round((powerefficiency*1000)-100, 1)]%</b>.</span>"
|
||||
switch(macrotier)
|
||||
if(1)
|
||||
. += "<span class='notice'>Macro granularity at <b>5u</b>.<span>"
|
||||
if(2)
|
||||
. += "<span class='notice'>Macro granularity at <b>3u</b>.<span>"
|
||||
if(3)
|
||||
. += "<span class='notice'>Macro granularity at <b>2u</b>.<span>"
|
||||
if(4)
|
||||
. += "<span class='notice'>Macro granularity at <b>1u</b>.<span>"
|
||||
|
||||
/obj/machinery/chem_dispenser/process()
|
||||
if (recharge_counter >= 4)
|
||||
@@ -160,7 +153,6 @@
|
||||
beaker_overlay = display_beaker()
|
||||
add_overlay(beaker_overlay)
|
||||
|
||||
|
||||
/obj/machinery/chem_dispenser/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
@@ -225,8 +217,7 @@
|
||||
data["beakerTransferAmounts"] = null
|
||||
data["beakerCurrentpH"] = null
|
||||
|
||||
var/chemicals[0]
|
||||
var/recipes[0]
|
||||
var/list/chemicals = list()
|
||||
var/is_hallucinating = FALSE
|
||||
if(user.hallucinating())
|
||||
is_hallucinating = TRUE
|
||||
@@ -237,10 +228,10 @@
|
||||
if(is_hallucinating && prob(5))
|
||||
chemname = "[pick_list_replacements("hallucination.json", "chemicals")]"
|
||||
chemicals.Add(list(list("title" = chemname, "id" = ckey(temp.name))))
|
||||
for(var/recipe in saved_recipes)
|
||||
recipes.Add(list(recipe))
|
||||
data["chemicals"] = chemicals
|
||||
data["recipes"] = recipes
|
||||
data["recipes"] = saved_recipes
|
||||
|
||||
data["recordingRecipe"] = recording_recipe
|
||||
return data
|
||||
|
||||
/obj/machinery/chem_dispenser/ui_act(action, params)
|
||||
@@ -258,24 +249,28 @@
|
||||
if("dispense")
|
||||
if(!is_operational() || QDELETED(cell))
|
||||
return
|
||||
var/reagent = GLOB.name2reagent[params["reagent"]]
|
||||
if(beaker && dispensable_reagents.Find(reagent))
|
||||
var/datum/reagents/R = beaker.reagents
|
||||
var/free = R.maximum_volume - R.total_volume
|
||||
var/actual = min(amount, (cell.charge * powerefficiency)*10, free)
|
||||
var/reagent_name = params["reagent"]
|
||||
if(!recording_recipe)
|
||||
var/reagent = GLOB.name2reagent[reagent_name]
|
||||
if(beaker && dispensable_reagents.Find(reagent))
|
||||
var/datum/reagents/R = beaker.reagents
|
||||
var/free = R.maximum_volume - R.total_volume
|
||||
var/actual = min(amount, (cell.charge * powerefficiency)*10, free)
|
||||
|
||||
if(!cell.use(actual / powerefficiency))
|
||||
say("Not enough energy to complete operation!")
|
||||
return
|
||||
R.add_reagent(reagent, actual)
|
||||
if(!cell.use(actual / powerefficiency))
|
||||
say("Not enough energy to complete operation!")
|
||||
return
|
||||
R.add_reagent(reagent, actual)
|
||||
|
||||
work_animation()
|
||||
. = TRUE
|
||||
work_animation()
|
||||
else
|
||||
recording_recipe[reagent_name] += amount
|
||||
. = TRUE
|
||||
if("remove")
|
||||
if(!is_operational())
|
||||
if(!is_operational() || recording_recipe)
|
||||
return
|
||||
var/amount = text2num(params["amount"])
|
||||
if(beaker && (amount in beaker.possible_transfer_amounts))
|
||||
if(beaker && amount in beaker.possible_transfer_amounts)
|
||||
beaker.reagents.remove_all(amount)
|
||||
work_animation()
|
||||
. = TRUE
|
||||
@@ -285,57 +280,65 @@
|
||||
if("dispense_recipe")
|
||||
if(!is_operational() || QDELETED(cell))
|
||||
return
|
||||
var/recipe_to_use = params["recipe"]
|
||||
var/list/chemicals_to_dispense = process_recipe_list(recipe_to_use)
|
||||
var/res = get_macro_resolution()
|
||||
for(var/key in chemicals_to_dispense) // i suppose you could edit the list locally before passing it
|
||||
var/list/keysplit = splittext(key," ")
|
||||
var/r_id = GLOB.name2reagent[translate_legacy_chem_id(keysplit[1])]
|
||||
if(beaker && dispensable_reagents.Find(r_id)) // but since we verify we have the reagent, it'll be fine
|
||||
var/list/chemicals_to_dispense = saved_recipes[params["recipe"]]
|
||||
if(!LAZYLEN(chemicals_to_dispense))
|
||||
return
|
||||
for(var/key in chemicals_to_dispense)
|
||||
var/reagent = GLOB.name2reagent[translate_legacy_chem_id(key)]
|
||||
var/dispense_amount = chemicals_to_dispense[key]
|
||||
if(!dispensable_reagents.Find(reagent))
|
||||
return
|
||||
if(!recording_recipe)
|
||||
if(!beaker)
|
||||
return
|
||||
var/datum/reagents/R = beaker.reagents
|
||||
var/free = R.maximum_volume - R.total_volume
|
||||
var/actual = min(max(chemicals_to_dispense[key], res), (cell.charge * powerefficiency)*10, free)
|
||||
var/actual = min(dispense_amount, (cell.charge * powerefficiency)*10, free)
|
||||
if(actual)
|
||||
if(!cell.use(actual / powerefficiency))
|
||||
say("Not enough energy to complete operation!")
|
||||
return
|
||||
R.add_reagent(r_id, actual)
|
||||
R.add_reagent(reagent, actual)
|
||||
work_animation()
|
||||
else
|
||||
recording_recipe[key] += dispense_amount
|
||||
. = TRUE
|
||||
if("clear_recipes")
|
||||
if(!is_operational())
|
||||
return
|
||||
var/yesno = alert("Clear all recipes?",, "Yes","No")
|
||||
if(yesno == "Yes")
|
||||
saved_recipes = list()
|
||||
if("add_recipe")
|
||||
. = TRUE
|
||||
if("record_recipe")
|
||||
if(!is_operational())
|
||||
return
|
||||
recording_recipe = list()
|
||||
. = TRUE
|
||||
if("save_recording")
|
||||
if(!is_operational())
|
||||
return
|
||||
var/name = stripped_input(usr,"Name","What do you want to name this recipe?", "Recipe", MAX_NAME_LEN)
|
||||
var/recipe = stripped_input(usr,"Recipe","Insert recipe with chem IDs")
|
||||
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
|
||||
return
|
||||
if(name && recipe)
|
||||
var/list/first_process = splittext(recipe, ";")
|
||||
if(!LAZYLEN(first_process))
|
||||
return
|
||||
var/res = get_macro_resolution()
|
||||
var/resmismatch = FALSE
|
||||
for(var/reagents in first_process)
|
||||
var/list/reagent = splittext(reagents, "=")
|
||||
var/reagent_id = GLOB.name2reagent[translate_legacy_chem_id(reagent[1])]
|
||||
if(dispensable_reagents.Find(reagent_id))
|
||||
if (!resmismatch && !check_macro_part(reagents, res))
|
||||
resmismatch = TRUE
|
||||
continue
|
||||
else
|
||||
var/chemid = reagent[1]
|
||||
if(saved_recipes[name] && alert("\"[name]\" already exists, do you want to overwrite it?",, "Yes", "No") == "No")
|
||||
return
|
||||
if(name && recording_recipe)
|
||||
for(var/reagent in recording_recipe)
|
||||
var/reagent_id = GLOB.name2reagent[translate_legacy_chem_id(reagent)]
|
||||
if(!dispensable_reagents.Find(reagent_id))
|
||||
visible_message("<span class='warning'>[src] buzzes.</span>", "<span class='italics'>You hear a faint buzz.</span>")
|
||||
to_chat(usr, "<span class ='danger'>[src] cannot find Chemical ID: <b>[chemid]</b>!</span>")
|
||||
to_chat(usr, "<span class ='danger'>[src] cannot find <b>[reagent]</b>!</span>")
|
||||
playsound(src, 'sound/machines/buzz-two.ogg', 50, 1)
|
||||
return
|
||||
if (resmismatch && alert("[src] is not yet capable of replicating this recipe with the precision it needs, do you want to save it anyway?",, "Yes","No") == "No")
|
||||
return
|
||||
saved_recipes += list(list("recipe_name" = name, "contents" = recipe))
|
||||
saved_recipes[name] = recording_recipe
|
||||
recording_recipe = null
|
||||
. = TRUE
|
||||
if("cancel_recording")
|
||||
if(!is_operational())
|
||||
return
|
||||
recording_recipe = null
|
||||
. = TRUE
|
||||
|
||||
/obj/machinery/chem_dispenser/attackby(obj/item/I, mob/user, params)
|
||||
if(default_unfasten_wrench(user, I))
|
||||
@@ -343,7 +346,6 @@
|
||||
if(default_deconstruction_screwdriver(user, icon_state, icon_state, I))
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(default_deconstruction_crowbar(I))
|
||||
return
|
||||
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
|
||||
@@ -384,7 +386,6 @@
|
||||
work_animation()
|
||||
visible_message("<span class='danger'>[src] malfunctions, spraying chemicals everywhere!</span>")
|
||||
|
||||
|
||||
/obj/machinery/chem_dispenser/RefreshParts()
|
||||
recharge_amount = initial(recharge_amount)
|
||||
var/newpowereff = 0.0666666
|
||||
@@ -395,13 +396,11 @@
|
||||
for(var/obj/item/stock_parts/capacitor/C in component_parts)
|
||||
recharge_amount *= C.rating
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
if (M.rating > macrotier)
|
||||
macrotier = M.rating
|
||||
if (M.rating > 1)
|
||||
if(M.rating > 1)
|
||||
dispensable_reagents |= upgrade_reagents
|
||||
if (M.rating > 2)
|
||||
if(M.rating > 2)
|
||||
dispensable_reagents |= upgrade_reagents2
|
||||
if (M.rating > 3)
|
||||
if(M.rating > 3)
|
||||
dispensable_reagents |= upgrade_reagents3
|
||||
powerefficiency = round(newpowereff, 0.01)
|
||||
|
||||
@@ -422,41 +421,14 @@
|
||||
cell = null
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
beaker = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/get_macro_resolution()
|
||||
. = 5
|
||||
if (macrotier > 1)
|
||||
. -= macrotier // 5 for tier1, 3 for 2, 2 for 3, 1 for 4.
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/check_macro(macro)
|
||||
var/res = get_macro_resolution()
|
||||
for (var/reagent in splittext(trim(macro), ";"))
|
||||
if (!check_macro_part(reagent, res))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/check_macro_part(var/part, var/res = get_macro_resolution())
|
||||
var/detail = splittext(part, "=")
|
||||
if (round(text2num(detail[2]), res) != text2num(detail[2]))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/process_recipe_list(var/fucking_hell)
|
||||
var/list/key_list = list()
|
||||
var/list/final_list = list()
|
||||
var/list/first_process = splittext(fucking_hell, ";")
|
||||
for(var/reagents in first_process)
|
||||
var/list/fuck = splittext(reagents, "=")
|
||||
final_list += list(avoid_assoc_duplicate_keys(fuck[1],key_list) = text2num(fuck[2]))
|
||||
return final_list
|
||||
|
||||
/obj/machinery/chem_dispenser/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return TRUE
|
||||
if(istype(user) && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
replace_beaker(user)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_dispenser/drinks/Initialize()
|
||||
. = ..()
|
||||
@@ -540,7 +512,6 @@
|
||||
/datum/reagent/toxin/staminatoxin
|
||||
)
|
||||
|
||||
|
||||
/obj/machinery/chem_dispenser/drinks/fullupgrade //fully ugpraded stock parts, emagged
|
||||
desc = "Contains a large reservoir of soft drinks. This model has had its safeties shorted out."
|
||||
obj_flags = CAN_BE_HIT | EMAGGED
|
||||
@@ -646,7 +617,7 @@
|
||||
/datum/reagent/ammonia,
|
||||
/datum/reagent/ash,
|
||||
/datum/reagent/diethylamine)
|
||||
//same as above.
|
||||
//same as above.
|
||||
upgrade_reagents = null
|
||||
upgrade_reagents2 = null
|
||||
upgrade_reagents3 = null
|
||||
|
||||
@@ -153,20 +153,37 @@
|
||||
color = "#669900" // rgb: 102, 153, 0
|
||||
toxpwr = 0.5
|
||||
taste_description = "death"
|
||||
var/fakedeath_active = FALSE
|
||||
pH = 13
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
L.fakedeath(type)
|
||||
ADD_TRAIT(L, TRAIT_FAKEDEATH, type)
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_end_metabolize(mob/living/L)
|
||||
L.cure_fakedeath(type)
|
||||
..()
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_life(mob/living/carbon/M)
|
||||
M.adjustOxyLoss(0.5*REM, 0)
|
||||
/datum/reagent/toxin/zombiepowder/reaction_mob(mob/living/L, method=TOUCH, reac_volume)
|
||||
L.adjustOxyLoss(0.5*REM, 0)
|
||||
if(method == INGEST)
|
||||
fakedeath_active = TRUE
|
||||
L.fakedeath(type)
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_life(mob/living/M)
|
||||
..()
|
||||
. = 1
|
||||
if(fakedeath_active)
|
||||
return TRUE
|
||||
switch(current_cycle)
|
||||
if(1 to 5)
|
||||
M.confused += 1
|
||||
M.drowsyness += 1
|
||||
M.slurring += 3
|
||||
if(5 to 8)
|
||||
M.adjustStaminaLoss(40, 0)
|
||||
if(9 to INFINITY)
|
||||
fakedeath_active = TRUE
|
||||
M.fakedeath(type)
|
||||
|
||||
/datum/reagent/toxin/ghoulpowder
|
||||
name = "Ghoul Powder"
|
||||
|
||||
@@ -70,6 +70,14 @@
|
||||
required_other = TRUE
|
||||
required_container = /obj/item/slime_extract/green
|
||||
|
||||
/datum/chemical_reaction/slime/slimemammal
|
||||
name = "Mammal Mutation Toxin"
|
||||
id = /datum/reagent/mutationtoxin/mammal
|
||||
results = list(/datum/reagent/mutationtoxin/mammal = 1)
|
||||
required_reagents = list(/datum/reagent/water = 1)
|
||||
required_other = TRUE
|
||||
required_container = /obj/item/slime_extract/green
|
||||
|
||||
//Metal
|
||||
/datum/chemical_reaction/slime/slimemetal
|
||||
name = "Slime Metal"
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#define PH_WEAK (1 << 0)
|
||||
#define TEMP_WEAK (1 << 1)
|
||||
|
||||
/obj/item/reagent_containers
|
||||
name = "Container"
|
||||
desc = "..."
|
||||
@@ -9,14 +6,13 @@
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/amount_per_transfer_from_this = 5
|
||||
var/list/possible_transfer_amounts = list(5,10,15,20,25,30)
|
||||
var/APTFT_altclick = TRUE //will the set amount_per_transfer_from_this proc be called on AltClick() ?
|
||||
var/volume = 30
|
||||
var/reagent_flags
|
||||
var/reagent_flags //used to determine the reagent holder flags on add_initial_reagents()
|
||||
var/list/list_reagents = null
|
||||
var/spawned_disease = null
|
||||
var/disease_amount = 20
|
||||
var/spillable = FALSE
|
||||
var/beaker_weakness_bitflag = NONE//Bitflag!
|
||||
var/container_flags = APTFT_ALTCLICK|APTFT_VERB //the container item flags
|
||||
var/container_HP = 2
|
||||
var/cached_icon
|
||||
|
||||
@@ -24,7 +20,7 @@
|
||||
. = ..()
|
||||
if(isnum(vol) && vol > 0)
|
||||
volume = vol
|
||||
if(length(possible_transfer_amounts))
|
||||
if(container_flags & APTFT_VERB && length(possible_transfer_amounts))
|
||||
verbs += /obj/item/reagent_containers/proc/set_APTFT
|
||||
create_reagents(volume, reagent_flags)
|
||||
if(spawned_disease)
|
||||
@@ -37,12 +33,12 @@
|
||||
. = ..()
|
||||
if(length(possible_transfer_amounts) > 1)
|
||||
. += "Currently transferring [amount_per_transfer_from_this] units per use."
|
||||
if(APTFT_altclick && user.Adjacent(src))
|
||||
if(container_flags & APTFT_ALTCLICK && user.Adjacent(src))
|
||||
. += "<span class='notice'>Alt-click it to set its transfer amount.</span>"
|
||||
|
||||
/obj/item/reagent_containers/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(APTFT_altclick && length(possible_transfer_amounts) > 1 && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
if(container_flags & APTFT_ALTCLICK && length(possible_transfer_amounts) > 1 && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
set_APTFT()
|
||||
return TRUE
|
||||
|
||||
@@ -157,7 +153,7 @@
|
||||
//melts plastic beakers
|
||||
/obj/item/reagent_containers/microwave_act(obj/machinery/microwave/M)
|
||||
reagents.expose_temperature(1000)
|
||||
if(beaker_weakness_bitflag & TEMP_WEAK)
|
||||
if(container_flags & TEMP_WEAK)
|
||||
var/list/seen = viewers(5, get_turf(src))
|
||||
var/iconhtml = icon2html(src, seen)
|
||||
for(var/mob/H in seen)
|
||||
@@ -172,13 +168,13 @@
|
||||
temp_check()
|
||||
|
||||
/obj/item/reagent_containers/proc/temp_check()
|
||||
if(beaker_weakness_bitflag & TEMP_WEAK)
|
||||
if(container_flags & TEMP_WEAK)
|
||||
if(reagents.chem_temp >= 444)//assuming polypropylene
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
//melts glass beakers
|
||||
/obj/item/reagent_containers/proc/pH_check()
|
||||
if(beaker_weakness_bitflag & PH_WEAK)
|
||||
if(container_flags & PH_WEAK)
|
||||
if((reagents.pH < 1.5) || (reagents.pH > 12.5))
|
||||
START_PROCESSING(SSobj, src)
|
||||
else if((reagents.pH < -3) || (reagents.pH > 17))
|
||||
@@ -192,7 +188,7 @@
|
||||
cached_icon = icon_state
|
||||
var/damage
|
||||
var/cause
|
||||
if(beaker_weakness_bitflag & PH_WEAK)
|
||||
if(container_flags & PH_WEAK)
|
||||
if(reagents.pH < 2)
|
||||
damage = (2 - reagents.pH)/20
|
||||
cause = "from the extreme pH"
|
||||
@@ -203,7 +199,7 @@
|
||||
cause = "from the extreme pH"
|
||||
playsound(get_turf(src), 'sound/FermiChem/bufferadd.ogg', 50, 1)
|
||||
|
||||
if(beaker_weakness_bitflag & TEMP_WEAK)
|
||||
if(container_flags & TEMP_WEAK)
|
||||
if(reagents.chem_temp >= 444)
|
||||
if(damage)
|
||||
damage += (reagents.chem_temp/444)/5
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
log_combat(user, M, "splashed", R)
|
||||
reagents.clear_reagents()
|
||||
else
|
||||
if(M != user)
|
||||
var/self_fed = M == user
|
||||
if(!self_fed)
|
||||
M.visible_message("<span class='danger'>[user] attempts to feed something to [M].</span>", \
|
||||
"<span class='userdanger'>[user] attempts to feed something to you.</span>")
|
||||
if(!do_mob(user, M))
|
||||
@@ -44,7 +45,7 @@
|
||||
to_chat(user, "<span class='notice'>You swallow a gulp of [src].</span>")
|
||||
var/fraction = min(5/reagents.total_volume, 1)
|
||||
reagents.reaction(M, INGEST, fraction)
|
||||
addtimer(CALLBACK(reagents, /datum/reagents.proc/trans_to, M, 5), 5)
|
||||
addtimer(CALLBACK(reagents, /datum/reagents.proc/trans_to, M, 5, null, null, null, self_fed? "self swallowed" : "fed by [user]"), 5)
|
||||
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
||||
|
||||
/obj/item/reagent_containers/glass/afterattack(obj/target, mob/user, proximity)
|
||||
@@ -61,7 +62,7 @@
|
||||
to_chat(user, "<span class='warning'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
var/trans = reagents.trans_to(target, amount_per_transfer_from_this, log = "reagentcontainer-glass afterattack transfer to")
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution to [target].</span>")
|
||||
|
||||
else if(target.is_drainable()) //A dispenser. Transfer FROM it TO us.
|
||||
@@ -73,7 +74,7 @@
|
||||
to_chat(user, "<span class='warning'>[src] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this, log = "reagentcontainer-glass afterattack fill from")
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] unit\s of the contents of [target].</span>")
|
||||
|
||||
else if(reagents.total_volume)
|
||||
@@ -96,7 +97,7 @@
|
||||
to_chat(user, "<span class='notice'>[src] is full.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You break [E] in [src].</span>")
|
||||
E.reagents.trans_to(src, E.reagents.total_volume)
|
||||
E.reagents.trans_to(src, E.reagents.total_volume, log = "reagentcontainer-glass break egg in")
|
||||
qdel(E)
|
||||
return
|
||||
..()
|
||||
@@ -110,7 +111,7 @@
|
||||
item_state = "beaker"
|
||||
materials = list(MAT_GLASS=500)
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,50,60)
|
||||
beaker_weakness_bitflag = PH_WEAK
|
||||
container_flags = PH_WEAK|APTFT_ALTCLICK|APTFT_VERB
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/Initialize()
|
||||
. = ..()
|
||||
@@ -203,11 +204,7 @@
|
||||
volume = 180
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,40,50,60,120,180)
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/plastic/Initialize()
|
||||
beaker_weakness_bitflag &= ~PH_WEAK
|
||||
beaker_weakness_bitflag |= TEMP_WEAK
|
||||
. = ..()
|
||||
container_flags = TEMP_WEAK|APTFT_ALTCLICK|APTFT_VERB
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/plastic/update_icon()
|
||||
icon_state = "beakerlarge" // hack to lets us reuse the large beaker reagent fill states
|
||||
@@ -222,10 +219,7 @@
|
||||
volume = 240
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,40,50,60,120,200,240)
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/meta/Initialize() // why the fuck can't you just set the beaker weakness bitflags to nothing? fuck you
|
||||
beaker_weakness_bitflag &= ~PH_WEAK
|
||||
. = ..()
|
||||
container_flags = APTFT_ALTCLICK|APTFT_VERB
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/noreact
|
||||
name = "cryostasis beaker"
|
||||
@@ -236,13 +230,9 @@
|
||||
reagent_flags = OPENCONTAINER | NO_REACT
|
||||
volume = 50
|
||||
amount_per_transfer_from_this = 10
|
||||
container_flags = APTFT_ALTCLICK|APTFT_VERB
|
||||
container_HP = 10//shouldn't be needed
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/noreact/Initialize()
|
||||
beaker_weakness_bitflag &= ~PH_WEAK
|
||||
. = ..()
|
||||
//reagents.set_reacting(FALSE) was this removed in a recent pr?
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/bluespace
|
||||
name = "bluespace beaker"
|
||||
desc = "A bluespace beaker, powered by experimental bluespace technology \
|
||||
@@ -310,18 +300,15 @@
|
||||
SLOT_L_STORE, SLOT_R_STORE,\
|
||||
SLOT_GENERC_DEXTROUS_STORAGE
|
||||
)
|
||||
container_flags = APTFT_ALTCLICK|APTFT_VERB
|
||||
container_HP = 1
|
||||
|
||||
/obj/item/reagent_containers/glass/bucket/Initialize()
|
||||
beaker_weakness_bitflag |= TEMP_WEAK
|
||||
. = ..()
|
||||
|
||||
/obj/item/reagent_containers/glass/bucket/attackby(obj/O, mob/user, params)
|
||||
if(istype(O, /obj/item/mop))
|
||||
if(reagents.total_volume < 1)
|
||||
to_chat(user, "<span class='warning'>[src] is out of water!</span>")
|
||||
else
|
||||
reagents.trans_to(O, 5)
|
||||
reagents.trans_to(O, 5, log = "reagentcontainer-bucket fill mop")
|
||||
to_chat(user, "<span class='notice'>You wet [O] in [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
else if(isprox(O))
|
||||
@@ -365,12 +352,9 @@
|
||||
volume = 50
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,50)
|
||||
container_flags = TEMP_WEAK|APTFT_ALTCLICK|APTFT_VERB
|
||||
container_HP = 1
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/waterbottle/Initialize()
|
||||
beaker_weakness_bitflag |= TEMP_WEAK
|
||||
. = ..()
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/waterbottle/empty
|
||||
list_reagents = list()
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
spillable = FALSE
|
||||
volume = 10
|
||||
possible_transfer_amounts = list(1,2,5,10)
|
||||
APTFT_altclick = FALSE
|
||||
container_flags = APTFT_VERB
|
||||
obj_flags = UNIQUE_RENAME
|
||||
unique_reskin = list("hypovial" = "hypovial",
|
||||
"red hypovial" = "hypovial-b",
|
||||
@@ -25,9 +25,6 @@
|
||||
if(!icon_state)
|
||||
icon_state = "hypovial"
|
||||
update_icon()
|
||||
// beaker_weakness_bitflag |= PH_WEAK // fuck you if you're using these like beakers
|
||||
// beaker_weakness_bitflag |= TEMP_WEAK
|
||||
|
||||
|
||||
/obj/item/reagent_containers/glass/bottle/vial/on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
reagent_flags = REFILLABLE | DRAINABLE
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list()
|
||||
APTFT_altclick = FALSE
|
||||
container_flags = APTFT_VERB
|
||||
volume = 5
|
||||
spillable = FALSE
|
||||
var/wipe_sound
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 250
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,50,100)
|
||||
container_flags = NONE //APTFT is alternated between the initial value and stream_amount and shouldn't be exploited.
|
||||
|
||||
/obj/item/reagent_containers/spray/afterattack(atom/A, mob/user)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user