TG Sync 12/15/17

s

s
This commit is contained in:
kevinz000
2017-12-15 03:28:09 -08:00
parent b6b0ab69e3
commit 253c819bc1
762 changed files with 13429 additions and 14872 deletions
+12 -2
View File
@@ -15,6 +15,7 @@
/datum/reagents/New(maximum=100)
maximum_volume = maximum
//I dislike having these here but map-objects are initialised before world/New() is called. >_>
if(!GLOB.chemical_reagents_list)
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
@@ -228,8 +229,7 @@
var/list/cached_reagents = reagent_list
var/list/cached_addictions = addiction_list
if(C)
chem_temp = C.bodytemperature
handle_reactions()
expose_temperature(C.bodytemperature, 0.25)
var/need_mob_update = 0
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
@@ -283,6 +283,7 @@
C.update_stamina()
update_total()
/datum/reagents/proc/set_reacting(react = TRUE)
if(react)
flags &= ~(REAGENT_NOREACT)
@@ -732,6 +733,15 @@
return english_list(out, "something indescribable")
/datum/reagents/proc/expose_temperature(var/temperature, var/coeff=0.02)
var/temp_delta = (temperature - chem_temp) * coeff
if(temp_delta > 0)
chem_temp = min(chem_temp + max(temp_delta, 1), temperature)
else
chem_temp = max(chem_temp + min(temp_delta, -1), temperature)
chem_temp = round(chem_temp)
handle_reactions()
///////////////////////////////////////////////////////////////////////////////////
@@ -2,7 +2,7 @@
#define MILK_TO_BUTTER_COEFF 15
/obj/machinery/reagentgrinder
name = "All-In-One Grinder"
name = "\improper All-In-One Grinder"
desc = "From BlenderTech. Will It Blend? Let's test it out!"
icon = 'icons/obj/kitchen.dmi'
icon_state = "juicer1"
@@ -16,97 +16,6 @@
var/operating = FALSE
var/obj/item/reagent_containers/beaker = null
var/limit = 10
var/static/list/blend_items = list(
//Sheets
/obj/item/stack/sheet/mineral/plasma = list("plasma" = 20),
/obj/item/stack/sheet/metal = list("iron" = 20),
/obj/item/stack/sheet/plasteel = list("iron" = 20, "plasma" = 20),
/obj/item/stack/sheet/mineral/wood = list("carbon" = 20),
/obj/item/stack/sheet/glass = list("silicon" = 20),
/obj/item/stack/sheet/rglass = list("silicon" = 20, "iron" = 20),
/obj/item/stack/sheet/mineral/uranium = list("uranium" = 20),
/obj/item/stack/sheet/mineral/bananium = list("banana" = 20),
/obj/item/stack/sheet/mineral/silver = list("silver" = 20),
/obj/item/stack/sheet/mineral/gold = list("gold" = 20),
/obj/item/stack/sheet/bluespace_crystal = list("bluespace" = 20),
/obj/item/stack/cable_coil = list ("copper" = 5),
/obj/item/ore/bluespace_crystal = list("bluespace" = 20),
/obj/item/grown/nettle/basic = list("sacid" = 0),
/obj/item/grown/nettle/death = list("facid" = 0, "sacid" = 0),
/obj/item/grown/novaflower = list("capsaicin" = 0, "condensedcapsaicin" = 0),
//Blender Stuff
/obj/item/reagent_containers/food/snacks/donkpocket/warm = list("omnizine" = 3),
/obj/item/reagent_containers/food/snacks/grown/soybeans = list("soymilk" = 0),
/obj/item/reagent_containers/food/snacks/grown/tomato = list("ketchup" = 0),
/obj/item/reagent_containers/food/snacks/grown/wheat = list("flour" = -5),
/obj/item/reagent_containers/food/snacks/grown/oat = list("flour" = -5),
/obj/item/reagent_containers/food/snacks/grown/rice = list("rice" = -5),
/obj/item/reagent_containers/food/snacks/donut = list("sprinkles" = -2, "sugar" = 1),
/obj/item/reagent_containers/food/snacks/grown/cherries = list("cherryjelly" = 0),
/obj/item/reagent_containers/food/snacks/grown/bluecherries = list("bluecherryjelly" = 0),
/obj/item/reagent_containers/food/snacks/egg = list("eggyolk" = -5),
/obj/item/reagent_containers/food/snacks/deadmouse = list ("blood" = 20, "gibs" = 5), // You monster
//Grinder stuff, but only if dry
/obj/item/reagent_containers/food/snacks/grown/coffee/robusta = list("coffeepowder" = 0, "morphine" = 0),
/obj/item/reagent_containers/food/snacks/grown/coffee = list("coffeepowder" = 0),
/obj/item/reagent_containers/food/snacks/grown/tea/astra = list("teapowder" = 0, "salglu_solution" = 0),
/obj/item/reagent_containers/food/snacks/grown/tea = list("teapowder" = 0),
//Stuff that doesn't quite fit in the other categories
/obj/item/electronics = list ("iron" = 10, "silicon" = 10),
/obj/item/circuitboard = list ("silicon" = 20, "sacid" = 0.5), // Retrieving acid this way is extremely inefficient
/obj/item/match = list ("phosphorus" = 2),
/obj/item/device/toner = list ("iodine" = 40, "iron" = 10),
/obj/item/photo = list ("iodine" = 4),
/obj/item/pen = list ("iodine" = 2, "iron" = 1),
/obj/item/reagent_containers/food/drinks/soda_cans = list ("aluminium" = 10),
/obj/item/trash/can = list ("aluminium" = 10),
/obj/item/device/flashlight/flare = list ("sulfur" = 15),
/obj/item/device/flashlight/glowstick = list ("phenol" = 15, "hydrodgen" = 10, "oxygen" = 5),
/obj/item/stock_parts/cell = list ("lithium" = 15, "iron" = 5, "silicon" = 5),
/obj/item/soap = list ("lye" = 10),
/obj/item/device/analyzer = list ("mercury" = 5, "iron" = 5, "silicon" = 5),
/obj/item/lighter = list ("iron" = 1, "weldingfuel" = 5, "oil" = 5),
/obj/item/light = list ("silicon" = 5, "nitrogen" = 10), //Nitrogen is used as a cheaper alternative to argon in incandescent lighbulbs
/obj/item/cigbutt/ = list ("carbon" = 2),
/obj/item/trash/coal = list ("carbon" = 20),
/obj/item/stack/medical/bruise_pack = list ("styptic_powder" = 5),
/obj/item/stack/medical/ointment = list ("silver_sulfadiazine" = 5),
//All types that you can put into the grinder to transfer the reagents to the beaker. !Put all recipes above this.!
/obj/item/slime_extract = list(),
/obj/item/reagent_containers/pill = list(),
/obj/item/reagent_containers/food = list(),
/obj/item/reagent_containers/honeycomb = list(),
/obj/item/toy/crayon = list(),
/obj/item/clothing/mask/cigarette = list())
var/static/list/juice_items = list(
//Juicer Stuff
/obj/item/reagent_containers/food/snacks/grown/corn = list("corn_starch" = 0),
/obj/item/reagent_containers/food/snacks/grown/tomato = list("tomatojuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/carrot = list("carrotjuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/berries = list("berryjuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/banana = list("banana" = 0),
/obj/item/reagent_containers/food/snacks/grown/potato = list("potato" = 0),
/obj/item/reagent_containers/food/snacks/grown/citrus/lemon = list("lemonjuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/citrus/orange = list("orangejuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/citrus/lime = list("limejuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/watermelon = list("watermelonjuice" = 0),
/obj/item/reagent_containers/food/snacks/watermelonslice = list("watermelonjuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/berries/poison = list("poisonberryjuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/pumpkin = list("pumpkinjuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/blumpkin = list("blumpkinjuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/apple = list("applejuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/grapes = list("grapejuice" = 0),
/obj/item/reagent_containers/food/snacks/grown/grapes/green = list("grapejuice" = 0))
var/static/list/dried_items = list(
//Grinder stuff, but only if dry,
/obj/item/reagent_containers/food/snacks/grown/coffee/robusta = list("coffeepowder" = 0, "morphine" = 0),
/obj/item/reagent_containers/food/snacks/grown/coffee = list("coffeepowder" = 0),
/obj/item/reagent_containers/food/snacks/grown/tea/astra = list("teapowder" = 0, "salglu_solution" = 0),
/obj/item/reagent_containers/food/snacks/grown/tea = list("teapowder" = 0))
var/list/holdingitems
/obj/machinery/reagentgrinder/Initialize()
@@ -158,6 +67,7 @@
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
return TRUE
to_chat(user, "<span class='notice'>You slide [I] into [src].</span>")
beaker = I
update_icon()
updateUsrDialog()
@@ -165,15 +75,8 @@
to_chat(user, "<span class='warning'>There's already a container inside [src].</span>")
return TRUE //no afterattack
if(is_type_in_list(I, dried_items))
if(istype(I, /obj/item/reagent_containers/food/snacks/grown))
var/obj/item/reagent_containers/food/snacks/grown/G = I
if(!G.dry)
to_chat(user, "<span class='warning'>You must dry [G] first!</span>")
return TRUE
if(length(holdingitems) >= limit)
to_chat(user, "The machine cannot hold anymore items.")
if(holdingitems.len >= limit)
to_chat(user, "<span class='warning'>[src] is filled to capacity!</span>")
return TRUE
//Fill machine with a bag!
@@ -192,14 +95,18 @@
updateUsrDialog()
return TRUE
if (!is_type_in_list(I, blend_items) && !is_type_in_list(I, juice_items))
if(!I.grind_results && !I.juice_results)
if(user.a_intent == INTENT_HARM)
return ..()
else
to_chat(user, "<span class='warning'>Cannot refine into a reagent!</span>")
to_chat(user, "<span class='warning'>You cannot grind [I] into reagents!</span>")
return TRUE
if(!I.grind_requirements(src)) //Error messages should be in the objects' definitions
return
if(user.transferItemToLoc(I, src))
to_chat(user, "<span class='notice'>You add [I] to [src].</span>")
holdingitems[I] = TRUE
updateUsrDialog()
return FALSE
@@ -214,7 +121,7 @@
user.set_machine(src)
interact(user)
/obj/machinery/reagentgrinder/interact(mob/user) // The microwave Menu
/obj/machinery/reagentgrinder/interact(mob/user) // The microwave Menu //I am reasonably certain that this is not a microwave
var/is_chamber_empty = FALSE
var/is_beaker_ready = FALSE
var/processing_chamber = ""
@@ -307,60 +214,10 @@
holdingitems -= O
updateUsrDialog()
/obj/machinery/reagentgrinder/proc/get_allowed_by_obj(obj/item/O)
for (var/i in blend_items)
if (istype(O, i))
return blend_items[i]
/obj/machinery/reagentgrinder/proc/get_allowed_juice_by_obj(obj/item/reagent_containers/food/snacks/O)
for(var/i in juice_items)
if(istype(O, i))
return juice_items[i]
/obj/machinery/reagentgrinder/proc/get_grownweapon_amount(obj/item/grown/O)
if (!istype(O) || !O.seed)
return 5
else if (O.seed.potency == -1)
return 5
else
return round(O.seed.potency)
/obj/machinery/reagentgrinder/proc/get_juice_amount(obj/item/reagent_containers/food/snacks/grown/O)
if (!istype(O) || !O.seed)
return 5
else if (O.seed.potency == -1)
return 5
else
return round(5*sqrt(O.seed.potency))
/obj/machinery/reagentgrinder/proc/remove_object(obj/item/O)
holdingitems -= O
qdel(O)
/obj/machinery/reagentgrinder/proc/juice()
power_change()
if(!beaker || (beaker && (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)))
return
operate_for(50, juicing = TRUE)
//Snacks
for(var/obj/item/i in holdingitems)
var/obj/item/I = i
if(istype(I, /obj/item/reagent_containers/food/snacks))
var/obj/item/reagent_containers/food/snacks/O = I
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
var/list/allowed = get_allowed_juice_by_obj(O)
if(isnull(allowed))
break
for(var/r_id in allowed)
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
var/amount = get_juice_amount(O)
beaker.reagents.add_reagent(r_id, min(amount, space))
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
remove_object(O)
/obj/machinery/reagentgrinder/proc/shake_for(duration)
var/offset = prob(50) ? -2 : 2
var/old_pixel_x = pixel_x
@@ -386,8 +243,26 @@
operating = FALSE
updateUsrDialog()
/obj/machinery/reagentgrinder/proc/grind()
/obj/machinery/reagentgrinder/proc/juice()
power_change()
if(!beaker || (beaker && (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)))
return
operate_for(50, juicing = TRUE)
for(var/obj/item/i in holdingitems)
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
var/obj/item/I = i
if(I.juice_results)
juice_item(I)
/obj/machinery/reagentgrinder/proc/juice_item(obj/item/I) //Juicing results can be found in respective object definitions
if(I.on_juice(src) == -1)
to_chat(usr, "<span class='danger'>[src] shorts out as it tries to juice up [I], and transfers it back to storage.</span>")
return
beaker.reagents.add_reagent_list(I.juice_results)
remove_object(I)
/obj/machinery/reagentgrinder/proc/grind()
power_change()
if(!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
return
@@ -396,82 +271,17 @@
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
var/obj/item/I = i
//Snacks
if(istype(I, /obj/item/reagent_containers/food/snacks))
var/obj/item/reagent_containers/food/snacks/O = I
var/list/allowed = get_allowed_by_obj(O)
if(isnull(allowed))
continue
for(var/r_id in allowed)
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
var/amount = allowed[r_id]
if(amount <= 0)
if(amount == 0)
if (O.reagents != null && O.reagents.has_reagent("nutriment"))
beaker.reagents.add_reagent(r_id, min(O.reagents.get_reagent_amount("nutriment"), space))
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
else
if (O.reagents != null && O.reagents.has_reagent("nutriment"))
beaker.reagents.add_reagent(r_id, min(round(O.reagents.get_reagent_amount("nutriment")*abs(amount)), space))
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
else
O.reagents.trans_id_to(beaker, r_id, min(amount, space))
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
if(O.reagents.reagent_list.len == 0)
remove_object(O)
//Sheets
else if(istype(I, /obj/item/stack/sheet))
var/obj/item/stack/sheet/O = I
var/list/allowed = get_allowed_by_obj(O)
for(var/t in 1 to round(O.amount, 1))
for(var/r_id in allowed)
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
var/amount = allowed[r_id]
beaker.reagents.add_reagent(r_id,min(amount, space))
if (space < amount)
break
if(t == round(O.amount, 1))
remove_object(O)
break
//Plants
else if(istype(I, /obj/item/grown))
var/obj/item/grown/O = I
var/list/allowed = get_allowed_by_obj(O)
for (var/r_id in allowed)
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
var/amount = allowed[r_id]
if (amount == 0)
if (O.reagents != null && O.reagents.has_reagent(r_id))
beaker.reagents.add_reagent(r_id,min(O.reagents.get_reagent_amount(r_id), space))
else
beaker.reagents.add_reagent(r_id,min(amount, space))
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
remove_object(O)
else if(istype(I, /obj/item/slime_extract))
var/obj/item/slime_extract/O = I
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
if (O.reagents != null)
var/amount = O.reagents.total_volume
O.reagents.trans_to(beaker, min(amount, space))
if (O.Uses > 0)
beaker.reagents.add_reagent("slimejelly",min(20, space))
remove_object(O)
if(istype(I, /obj/item/reagent_containers))
var/obj/item/reagent_containers/O = I
var/amount = O.reagents.total_volume
O.reagents.trans_to(beaker, amount)
if(!O.reagents.total_volume)
remove_object(O)
else if(istype(I, /obj/item/toy/crayon))
var/obj/item/toy/crayon/O = I
for (var/r_id in O.reagent_contents)
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
if(!space)
break
beaker.reagents.add_reagent(r_id, min(O.reagent_contents[r_id], space))
remove_object(O)
if(I.grind_results)
grind_item(i)
/obj/machinery/reagentgrinder/proc/grind_item(obj/item/I) //Grind results can be found in respective object definitions
if(I.on_grind(src) == -1) //Call on_grind() to change amount as needed, and stop grinding the item if it returns -1
to_chat(usr, "<span class='danger'>[src] shorts out as it tries to grind up [I], and transfers it back to storage.</span>")
return
beaker.reagents.add_reagent_list(I.grind_results)
if(I.reagents)
I.reagents.trans_to(beaker, I.reagents.total_volume)
remove_object(I)
/obj/machinery/reagentgrinder/proc/mix(mob/user)
//For butter and other things that would change upon shaking or mixing
@@ -129,31 +129,16 @@
taste_description = "sludge"
/datum/reagent/medicine/cryoxadone/on_mob_life(mob/living/M)
switch(M.bodytemperature) // Low temperatures are required to take effect.
if(0 to 100) // At extreme temperatures (upgraded cryo) the effect is greatly increased.
M.status_flags &= ~DISFIGURED
M.adjustCloneLoss(-1, 0)
M.adjustOxyLoss(-9, 0)
M.adjustBruteLoss(-5, 0)
M.adjustFireLoss(-5, 0)
M.adjustToxLoss(-5, 0)
. = 1
if(100 to 225) // At lower temperatures (cryo) the full effect is boosted
M.status_flags &= ~DISFIGURED
M.adjustCloneLoss(-1, 0)
M.adjustOxyLoss(-7, 0)
M.adjustBruteLoss(-3, 0)
M.adjustFireLoss(-3, 0)
M.adjustToxLoss(-3, 0)
. = 1
if(225 to T0C)
M.status_flags &= ~DISFIGURED
M.adjustCloneLoss(-1, 0)
M.adjustOxyLoss(-5, 0)
M.adjustBruteLoss(-1, 0)
M.adjustFireLoss(-1, 0)
M.adjustToxLoss(-1, 0)
. = 1
var/power = -0.00003 * (M.bodytemperature ** 2) + 3
if(M.bodytemperature < T0C)
M.adjustOxyLoss(-3 * power, 0)
M.adjustBruteLoss(-power, 0)
M.adjustFireLoss(-power, 0)
M.adjustToxLoss(-power, 0)
M.adjustCloneLoss(-power, 0)
M.status_flags &= ~DISFIGURED
. = 1
metabolization_rate = REAGENTS_METABOLISM * (0.00001 * (M.bodytemperature ** 2) + 0.5)
..()
/datum/reagent/medicine/clonexadone
+5 -4
View File
@@ -80,8 +80,7 @@
..()
/obj/item/reagent_containers/fire_act(exposed_temperature, exposed_volume)
reagents.chem_temp += 30
reagents.handle_reactions()
reagents.expose_temperature(exposed_temperature)
..()
/obj/item/reagent_containers/throw_impact(atom/target)
@@ -128,6 +127,8 @@
/obj/item/reagent_containers/microwave_act(obj/machinery/microwave/M)
if(is_open_container())
reagents.chem_temp = max(reagents.chem_temp, 1000)
reagents.handle_reactions()
reagents.expose_temperature(1000)
..()
/obj/item/reagent_containers/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
reagents.expose_temperature(exposed_temperature)
@@ -311,4 +311,4 @@
/obj/item/reagent_containers/glass/bottle/tuberculosiscure
name = "BVAK bottle"
desc = "A small bottle containing Bio Virus Antidote Kit."
list_reagents = list("atropine" = 5, "epinephrine" = 5, "salbutamol" = 10, "spaceacillin" = 10)
list_reagents = list("atropine" = 5, "epinephrine" = 5, "salbutamol" = 10, "spaceacillin" = 10)
@@ -91,15 +91,9 @@
/obj/item/reagent_containers/glass/attackby(obj/item/I, mob/user, params)
var/hotness = I.is_hot()
if(hotness)
var/added_heat = (hotness / 100) //ishot returns a temperature
if(reagents)
if(reagents.chem_temp < hotness) //can't be heated to be hotter than the source
reagents.chem_temp += added_heat
to_chat(user, "<span class='notice'>You heat [src] with [I].</span>")
reagents.handle_reactions()
else
to_chat(user, "<span class='warning'>[src] is already hotter than [I]!</span>")
if(hotness && reagents)
reagents.expose_temperature(hotness)
to_chat(user, "<span class='notice'>You heat [name] with [I]!</span>")
if(istype(I, /obj/item/reagent_containers/food/snacks/egg)) //breaking eggs
var/obj/item/reagent_containers/food/snacks/egg/E = I
@@ -8,6 +8,7 @@
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
possible_transfer_amounts = list()
volume = 50
grind_results = list()
var/apply_type = INGEST
var/apply_method = "swallow"
var/roundstart = 0
@@ -151,4 +152,4 @@
desc = "I wouldn't eat this if I were you."
icon_state = "pill9"
color = "#454545"
list_reagents = list("shadowmutationtoxin" = 1)
list_reagents = list("shadowmutationtoxin" = 1)
@@ -123,6 +123,13 @@
current_range = spray_range
to_chat(user, "<span class='notice'>You switch the nozzle setting to [stream_mode ? "\"stream\"":"\"spray\""]. You'll now use [amount_per_transfer_from_this] units per use.</span>")
/obj/item/reagent_containers/spray/attackby(obj/item/I, mob/user, params)
var/hotness = I.is_hot()
if(hotness && reagents)
reagents.expose_temperature(hotness)
to_chat(user, "<span class='notice'>You heat [name] with [I]!</span>")
return ..()
/obj/item/reagent_containers/spray/verb/empty()
set name = "Empty Spray Bottle"
set category = "Object"