[Goonchem] Reagent Temperature

This commit is contained in:
Fox McCloud
2019-03-18 20:06:15 -04:00
parent 8ef3483119
commit 277722508a
69 changed files with 182 additions and 166 deletions
+4
View File
@@ -1,5 +1,7 @@
/atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(reagents)
reagents.temperature_reagents(exposed_temperature)
return null
@@ -10,6 +12,8 @@
/turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
var/datum/gas_mixture/air_contents = return_air()
if(reagents)
reagents.temperature_reagents(exposed_temperature, 10, 300)
if(!air_contents)
return 0
if(active_hotspot)
+2 -2
View File
@@ -1165,7 +1165,7 @@ var/global/list/common_tools = list(
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/O = W
if(O.isOn())
return 3800
return 2500
else
return 0
if(istype(W, /obj/item/lighter))
@@ -1207,7 +1207,7 @@ var/global/list/common_tools = list(
else
return 0
if(istype(W, /obj/item/assembly/igniter))
return 1000
return 20000
else
return 0
+3 -1
View File
@@ -123,7 +123,9 @@
// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
// Click parameters is the params string from byond Click() code, see that documentation.
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
return
if(is_hot(src) && target.reagents && !ismob(target) && proximity_flag)
to_chat(user, "<span class='notice'>You heat [target].</span>")
target.reagents.temperature_reagents(is_hot(src))
/obj/item/proc/get_clamped_volume()
if(w_class)
+3 -2
View File
@@ -311,8 +311,9 @@
/atom/proc/blob_act(obj/structure/blob/B)
SEND_SIGNAL(src, COMSIG_ATOM_BLOB_ACT, B)
/atom/proc/fire_act()
return
/atom/proc/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
if(reagents)
reagents.temperature_reagents(exposed_temperature)
/atom/proc/emag_act()
return
+1 -1
View File
@@ -46,7 +46,7 @@
pressure_resistance = 100 //100 kPa difference required to push
throw_pressure_limit = 120 //120 kPa difference required to throw
/mob/living/simple_animal/hostile/blob/blobspore/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
/mob/living/simple_animal/hostile/blob/blobspore/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
adjustBruteLoss(Clamp(0.01 * exposed_temperature, 1, 5))
+1 -1
View File
@@ -45,7 +45,7 @@
GLOB.poi_list.Remove(src)
return ..()
/obj/structure/blob/core/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
/obj/structure/blob/core/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
return
/obj/structure/blob/core/update_icon()
+1 -1
View File
@@ -20,7 +20,7 @@
var/image/C = new('icons/mob/blob.dmi', "blob_node_overlay")
src.overlays += C
/obj/structure/blob/node/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
/obj/structure/blob/node/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
return
/obj/structure/blob/node/Destroy()
+5 -5
View File
@@ -3,9 +3,9 @@
icon = 'icons/mob/blob.dmi'
icon_state = "blob_idle"
desc = "Some blob creature thingy"
health = 75
health = 75
fire_resist = 2
var/maxHealth = 75
var/maxHealth = 75
/obj/structure/blob/shield/update_icon()
if(health <= 0)
@@ -13,7 +13,7 @@
return
return
/obj/structure/blob/shield/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
/obj/structure/blob/shield/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
return
/obj/structure/blob/shield/CanPass(atom/movable/mover, turf/target, height=0)
@@ -42,11 +42,11 @@
P.setAngle(new_angle_s)
P.firer = src //so people who fired the lasers are not immune to them when it reflects
visible_message("<span class='warning'>[P] reflects off [src]!</span>")
return -1// complete projectile permutation
return -1// complete projectile permutation
else
playsound(src, P.hitsound, 50, 1)
visible_message("<span class='danger'>[src] is hit by \a [P]!</span>")
take_damage(P.damage, P.damage_type)
/obj/structure/blob/shield/reflective/bullet_act()
return
+1 -1
View File
@@ -45,7 +45,7 @@
Life()
return
/obj/structure/blob/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
/obj/structure/blob/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
var/damage = Clamp(0.01 * exposed_temperature, 0, 4)
take_damage(damage, BURN)
+1 -1
View File
@@ -868,7 +868,7 @@ var/global/list/multiverse = list()
var/area/A = get_area(src)
to_chat(victim, "<span class='notice'>You feel a dark presence from [A.name]</span>")
/obj/item/voodoo/fire_act()
/obj/item/voodoo/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
if(target)
target.adjust_fire_stacks(20)
target.IgniteMob()
@@ -244,6 +244,7 @@ update_flag
return 0
/obj/machinery/portable_atmospherics/canister/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > temperature_resistance)
health -= 5
healthcheck()
@@ -171,6 +171,7 @@
assemblytype = /obj/structure/door_assembly/door_assembly_plasma
/obj/machinery/door/airlock/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > 300)
PlasmaBurn(exposed_temperature)
+1 -1
View File
@@ -205,9 +205,9 @@
qdel(src)
/obj/machinery/door/window/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > T0C + (reinf ? 1600 : 800))
take_damage(round(exposed_volume / 200), BURN, 0, 0)
..()
/obj/machinery/door/window/attack_ai(mob/user)
return attack_hand(user)
+1
View File
@@ -52,6 +52,7 @@ FIRE ALARM
playsound(loc, 'sound/effects/sparks4.ogg', 50, 1)
/obj/machinery/firealarm/temperature_expose(datum/gas_mixture/air, temperature, volume)
..()
if(!emagged && detecting && temperature > T0C + 200)
alarm() // added check of detector status here
+1
View File
@@ -721,6 +721,7 @@
check_for_internal_damage(list(MECHA_INT_FIRE, MECHA_INT_TEMP_CONTROL, MECHA_INT_CONTROL_LOST, MECHA_INT_SHORT_CIRCUIT), 1)
/obj/mecha/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > max_temperature)
log_message("Exposed to dangerous temperature.", 1)
take_damage(5, "fire")
@@ -90,7 +90,8 @@
icon_state = "cobweb1"
burntime = 1
/obj/effect/decal/cleanable/cobweb/fire_act()
/obj/effect/decal/cleanable/cobweb/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
qdel(src)
/obj/effect/decal/cleanable/molten_object
+1 -14
View File
@@ -35,22 +35,9 @@
if(!reagents.total_volume && !noclear) //scooped up all of it
qdel(src)
return
if(is_hot(W)) //todo: make heating a reagent holder proc
if(istype(W, /obj/item/clothing/mask/cigarette))
return
else
src.reagents.chem_temp += 15
src.reagents.handle_reactions()
to_chat(user, "<span class='notice'>You heat [src] with [W]!</span>")
/obj/effect/decal/cleanable/ex_act()
if(reagents)
for(var/datum/reagent/R in reagents.reagent_list)
R.on_ex_act()
..()
/obj/effect/decal/cleanable/fire_act()
if(reagents)
reagents.chem_temp += 30
reagents.handle_reactions()
..()
..()
@@ -84,7 +84,10 @@
// foam disolves when heated
// except metal foams
/obj/effect/particle_effect/foam/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
/obj/effect/particle_effect/foam/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE) //Don't heat the reagents inside
return
/obj/effect/particle_effect/foam/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) // overriden to prevent weird behaviors with heating reagents inside
if(!metal && prob(max(0, exposed_temperature - 475)))
flick("[icon_state]-disolve", src)
-3
View File
@@ -12,8 +12,5 @@
/obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
return
/obj/effect/fire_act()
return
/obj/effect/attack_hulk(mob/living/carbon/human/user, does_attack_animation = FALSE)
return FALSE
+1
View File
@@ -180,6 +180,7 @@
qdel(src)
/obj/structure/glowshroom/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > 300)
endurance -= 5
CheckEndurance()
+4 -2
View File
@@ -113,7 +113,8 @@
else
return ..()
/obj/effect/snow/fire_act()
/obj/effect/snow/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
qdel(src)
/obj/effect/snow/ex_act(severity)
@@ -133,7 +134,8 @@
..()
qdel(src)
/obj/item/snowball/fire_act()
/obj/item/snowball/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
qdel(src)
/obj/item/snowball/ex_act(severity)
+1
View File
@@ -69,6 +69,7 @@
qdel(src)
/obj/structure/spider/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > 300)
health -= 5
healthcheck()
+2 -1
View File
@@ -51,7 +51,8 @@
light("<span class='notice'>[user] tilts [C] and lights [src] with it.</span>")
/obj/item/candle/fire_act()
/obj/item/candle/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
if(!lit)
light() //honk
@@ -47,7 +47,7 @@
update_icon()
/obj/item/taperecorder/fire_act()
/obj/item/taperecorder/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
mytape.ruin() //Fires destroy the tape
return ..()
@@ -262,7 +262,8 @@
var/list/timestamp = list()
var/ruined = 0
/obj/item/tape/fire_act()
/obj/item/tape/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
ruin()
/obj/item/tape/attack_self(mob/user)
+1 -1
View File
@@ -21,7 +21,7 @@
user.visible_message("<span class='notice'>[user] [rolled ? "rolls up" : "unfurls"] [src].</span>", "<span class='notice'>You [rolled ? "roll up" : "unfurl"] [src].</span>", "<span class='warning'>You hear fabric rustling.</span>")
update_icon()
/obj/item/flag/fire_act(global_overlay = FALSE)
/obj/item/flag/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = FALSE)
..()
update_icon()
+1 -1
View File
@@ -50,9 +50,9 @@
burst()
/obj/item/latexballon/temperature_expose(datum/gas_mixture/air, temperature, volume)
..()
if(temperature > T0C+100)
burst()
return
/obj/item/latexballon/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/tank))
@@ -179,7 +179,8 @@ var/global/list/datum/stack_recipe/adamantine_recipes = list(
else
return ..()
/obj/item/stack/sheet/mineral/plasma/fire_act()
/obj/item/stack/sheet/mineral/plasma/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
atmos_spawn_air(SPAWN_HEAT | SPAWN_TOXINS, amount*10)
qdel(src)
+3 -2
View File
@@ -275,7 +275,8 @@
playsound(src, 'sound/effects/snap.ogg', 50, 1)
qdel(src)
/obj/item/toy/snappop/fire_act()
/obj/item/toy/snappop/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
pop_burst()
/obj/item/toy/snappop/throw_impact(atom/hit_atom)
@@ -1689,5 +1690,5 @@ obj/item/toy/cards/deck/syndicate/black
/obj/item/restraints/handcuffs/toy
desc = "Toy handcuffs. Plastic and extremely cheaply made."
throwforce = 0
breakouttime = 0
breakouttime = 0
ignoresClumsy = TRUE
+2 -1
View File
@@ -61,7 +61,8 @@ LIGHTERS ARE IN LIGHTERS.DM
return ..()
/obj/item/clothing/mask/cigarette/fire_act()
/obj/item/clothing/mask/cigarette/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
light()
/obj/item/clothing/mask/cigarette/attackby(obj/item/W as obj, mob/user as mob, params)
+2 -1
View File
@@ -166,7 +166,8 @@
location.hotspot_expose(700, 5)
return
/obj/item/match/fire_act()
/obj/item/match/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
matchignite()
/obj/item/match/proc/matchignite()
+4 -3
View File
@@ -93,7 +93,7 @@
/obj/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
collision_damage(pusher, force, direction)
return TRUE
/obj/proc/collision_damage(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
var/amt = max(0, ((force - (move_resist * MOVE_FORCE_CRUSH_RATIO)) / (move_resist * MOVE_FORCE_CRUSH_RATIO)) * 10)
take_damage(amt, BRUTE)
@@ -163,14 +163,15 @@
//// FIRE
/obj/fire_act(global_overlay=1)
/obj/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
if(!burn_state)
burn_state = ON_FIRE
SSfires.processing[src] = src
burn_world_time = world.time + burntime*rand(10,20)
if(global_overlay)
overlays += fire_overlay
return 1
return TRUE
/obj/proc/burn()
empty_object_contents(1, loc)
+2
View File
@@ -157,6 +157,7 @@
new /obj/structure/alien/weeds(T, linked_node)
/obj/structure/alien/weeds/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > 300)
take_damage(5, BURN, 0, 0)
@@ -294,6 +295,7 @@
Burst(kill = TRUE)
/obj/structure/alien/egg/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > 500)
take_damage(5, BURN, 0, 0)
+1 -1
View File
@@ -245,7 +245,7 @@ LINEN BINS
else icon_state = "linenbin-full"
/obj/structure/bedsheetbin/fire_act()
/obj/structure/bedsheetbin/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
if(!amount)
return
..()
@@ -249,6 +249,7 @@
qdel(src)
/obj/structure/falsewall/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > 300)
burnbabyburn()
+1
View File
@@ -48,6 +48,7 @@
qdel(src)
/obj/structure/girder/temperature_expose(datum/gas_mixture/air, exposed_temperature)
..()
var/temp_check = exposed_temperature
if(temp_check >= GIRDER_MELTING_TEMP)
take_damage(10)
+1 -1
View File
@@ -261,10 +261,10 @@
return 0
/obj/structure/grille/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(!broken)
if(exposed_temperature > T0C + 1500)
take_damage(1, BURN, 0, 0)
..()
/obj/structure/grille/hitby(atom/movable/AM)
if(istype(AM, /obj))
@@ -229,6 +229,7 @@
return ..()
/obj/structure/mineral_door/transparent/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > 300)
TemperatureAct(exposed_temperature)
+3 -1
View File
@@ -169,6 +169,7 @@
icon_state = "xeno"
/obj/structure/statue/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > 300)
PlasmaBurn(exposed_temperature)
@@ -359,7 +360,8 @@
else
return ..()
/obj/structure/snowman/built/fire_act()
/obj/structure/snowman/built/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
qdel(src)
+1 -1
View File
@@ -461,9 +461,9 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
overlays += crack_overlay
/obj/structure/window/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > (T0C + heat_resistance))
take_damage(round(exposed_volume / 100), BURN, 0, 0)
..()
/obj/structure/window/GetExplosionBlock()
return reinf && fulltile ? real_explosion_block : 0
@@ -33,6 +33,7 @@
icons = list("plasma","plasma_dam")
/turf/simulated/floor/mineral/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > 300)
PlasmaBurn()
@@ -107,6 +107,7 @@
atmos_spawn_air(SPAWN_HEAT | SPAWN_TOXINS, 400)
/turf/simulated/wall/mineral/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)//Doesn't fucking work because walls don't interact with air :(
..()
if(exposed_temperature > 300)
PlasmaBurn(exposed_temperature)
+1
View File
@@ -684,6 +684,7 @@
wither()
/obj/structure/spacevine/temperature_expose(null, temp, volume)
..()
var/override = 0
for(var/datum/spacevine_mutation/SM in mutations)
override += SM.process_temperature(src, temp, volume)
@@ -106,17 +106,6 @@
return FALSE
/obj/item/reagent_containers/food/drinks/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/clothing/mask/cigarette)) //ciggies are weird
return FALSE
if(is_hot(I))
if(reagents)
reagents.chem_temp += 15
to_chat(user, "<span class='notice'>You heat [src] with [I].</span>")
reagents.handle_reactions()
else
return ..()
/obj/item/reagent_containers/food/drinks/examine(mob/user)
if(!..(user, 1))
return
@@ -27,7 +27,7 @@
else
..()
/obj/item/reagent_containers/food/drinks/drinkingglass/fire_act()
/obj/item/reagent_containers/food/drinks/drinkingglass/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
if(!reagents.total_volume)
return
..()
@@ -51,7 +51,7 @@
if(A.volume >= 5 && A.alcohol_perc >= 0.35) //Only an approximation to if something's flammable but it will do
return TRUE
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/fire_act(global_overlay = FALSE)
/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = FALSE)
if(!isShotFlammable() || burn_state == ON_FIRE) //You can't light a shot that's not flammable!
return
..()
+1 -2
View File
@@ -151,5 +151,4 @@
/obj/item/reagent_containers/food/snacks/grown/cherry_bomb/proc/prime()
icon_state = "cherry_bomb_lit"
playsound(src, 'sound/goonstation/misc/fuse.ogg', seed.potency, 0)
reagents.chem_temp = 1000 //Sets off the black powder
reagents.handle_reactions()
reagents.set_reagent_temp(1000) //Sets off the black powder
+2 -1
View File
@@ -153,7 +153,8 @@
Burn()
processing_objects.Add(src)
/obj/structure/bonfire/fire_act(exposed_temperature, exposed_volume)
/obj/structure/bonfire/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
StartBurning()
/obj/structure/bonfire/Crossed(atom/movable/AM)
+1 -1
View File
@@ -52,7 +52,7 @@
F.attackby(OB, AM)
return ..()
/obj/item/stack/ore/fire_act()
/obj/item/stack/ore/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
if(isnull(refined_type))
return
@@ -65,9 +65,9 @@ var/const/MAX_ACTIVE_TIME = 400
return
/obj/item/clothing/mask/facehugger/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature > 300)
Die()
return
/obj/item/clothing/mask/facehugger/equipped(mob/M)
Attach(M)
+2 -1
View File
@@ -179,7 +179,8 @@
var/turf/location = get_turf(src)
location.hotspot_expose(700, 50, 1)
/mob/living/fire_act()
/mob/living/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
adjust_fire_stacks(3)
IgniteMob()
@@ -230,7 +230,7 @@
if(on_fire)
overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Generic_mob_burning")
/mob/living/silicon/robot/fire_act()
/mob/living/silicon/robot/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
IgniteMob()
+1 -1
View File
@@ -401,7 +401,7 @@
add_fingerprint(user)
/obj/item/paper/fire_act()
/obj/item/paper/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
if(burn_state >= FLAMMABLE) //Only render paper that's burnable to be hard to read.
info = "[stars(info)]"
+1 -1
View File
@@ -12,7 +12,7 @@
var/amount = 30 //How much paper is in the bin.
var/list/papers = list() //List of papers put in the bin for reference.
/obj/item/paper_bin/fire_act()
/obj/item/paper_bin/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
if(!amount)
return
..()
+1
View File
@@ -586,6 +586,7 @@
// called when on fire
/obj/machinery/light/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(prob(max(0, exposed_temperature - 673))) //0% at <400C, 100% at >500C
broken()
+1 -2
View File
@@ -25,8 +25,7 @@
for(var/datum/reagents/R in reactants)
R.trans_to(splash_holder, R.total_volume, threatscale, 1, 1)
total_temp += R.chem_temp
splash_holder.chem_temp = (total_temp/reactants.len) + extra_heat // Average temperature of reagents + extra heat.
splash_holder.handle_reactions() // React them now.
splash_holder.set_reagent_temp((total_temp / reactants.len) + extra_heat) // Average temperature of reagents + extra heat.
if(splash_holder.total_volume && affected_range >= 0) //The possible reactions didnt use up all reagents, so we spread it around.
var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread()
+30 -5
View File
@@ -9,7 +9,7 @@ var/const/INGEST = 2
var/total_volume = 0
var/maximum_volume = 100
var/atom/my_atom = null
var/chem_temp = 300
var/chem_temp = T20C
var/list/datum/reagent/addiction_list = new/list()
var/flags
@@ -166,6 +166,30 @@ var/const/INGEST = 2
handle_reactions()
return amount
/datum/reagents/proc/set_reagent_temp(new_temp = T0C, react = TRUE)
chem_temp = new_temp
if(react)
temperature_react()
handle_reactions()
/datum/reagents/proc/temperature_react() //Calls the temperature reaction procs without changing the temp.
for(var/datum/reagent/current_reagent in reagent_list)
current_reagent.reaction_temperature(chem_temp, 100)
/datum/reagents/proc/temperature_reagents(exposed_temperature, divisor = 35, change_cap = 15) //This is what you use to change the temp of a reagent holder.
//Do not manually change the reagent unless you know what youre doing.
var/difference = abs(chem_temp - exposed_temperature)
var/change = min(max((difference / divisor), 1), change_cap)
if(exposed_temperature > chem_temp)
chem_temp += change
else if(exposed_temperature < chem_temp)
chem_temp -= change
chem_temp = max(min(chem_temp, 10000), 0) //Cap for the moment.
temperature_react()
handle_reactions()
/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
@@ -194,8 +218,7 @@ var/const/INGEST = 2
/datum/reagents/proc/metabolize(mob/living/M)
if(M)
chem_temp = M.bodytemperature
handle_reactions()
temperature_reagents(M.bodytemperature - 30)
// a bitfield filled in by each reagent's `on_mob_life` to find out which states to update
var/update_flags = STATUS_UPDATE_NONE
@@ -548,14 +571,14 @@ var/const/INGEST = 2
var/amt = list_reagents[r_id]
add_reagent(r_id, amt, data)
/datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = 300, no_react = 0)
/datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = T20C, no_react = 0)
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
chem_temp = round(((amount * reagtemp) + (total_volume * chem_temp)) / (total_volume + amount)) //equalize with new chems
chem_temp = (chem_temp * total_volume + reagtemp * amount) / (total_volume + amount) //equalize with new chems
for(var/A in reagent_list)
@@ -567,6 +590,7 @@ var/const/INGEST = 2
my_atom.on_reagent_change()
R.on_merge(data)
if(!no_react)
temperature_react()
handle_reactions()
return 0
@@ -585,6 +609,7 @@ var/const/INGEST = 2
if(my_atom)
my_atom.on_reagent_change()
if(!no_react)
temperature_react()
handle_reactions()
return 0
else
@@ -7,8 +7,7 @@
use_power = IDLE_POWER_USE
idle_power_usage = 40
var/obj/item/reagent_containers/beaker = null
var/desired_temp = 300
var/heater_coefficient = 0.03
var/desired_temp = T0C
var/on = FALSE
/obj/machinery/chem_heater/New()
@@ -19,34 +18,22 @@
component_parts += new /obj/item/stock_parts/console_screen(null)
RefreshParts()
/obj/machinery/chem_heater/upgraded/New()
..()
component_parts = list()
component_parts += new /obj/item/circuitboard/chem_heater(null)
component_parts += new /obj/item/stock_parts/micro_laser/ultra(null)
component_parts += new /obj/item/stock_parts/console_screen(null)
RefreshParts()
/obj/machinery/chem_heater/RefreshParts()
heater_coefficient = 0.03
for(var/obj/item/stock_parts/micro_laser/M in component_parts)
heater_coefficient *= M.rating
/obj/machinery/chem_heater/process()
..()
if(stat & NOPOWER)
return
var/state_change = 0
var/state_change = FALSE
if(on)
if(beaker)
if(beaker.reagents.chem_temp > desired_temp)
beaker.reagents.chem_temp += min(-1, max((desired_temp - beaker.reagents.chem_temp) * heater_coefficient, -15))
if(beaker.reagents.chem_temp < desired_temp)
beaker.reagents.chem_temp += max(1, min((desired_temp - beaker.reagents.chem_temp) * heater_coefficient, 15))
beaker.reagents.chem_temp = round(beaker.reagents.chem_temp) //stops stuff like 456.12312312302
beaker.reagents.handle_reactions()
state_change = 1
if(!beaker.reagents.total_volume)
on = FALSE
SSnanoui.update_uis(src)
return
beaker.reagents.temperature_reagents(desired_temp)
beaker.reagents.temperature_reagents(desired_temp)
if(abs(beaker.reagents.chem_temp - desired_temp) <= 3)
on = FALSE
state_change = TRUE
if(state_change)
SSnanoui.update_uis(src)
@@ -54,7 +41,6 @@
/obj/machinery/chem_heater/proc/eject_beaker()
if(beaker)
beaker.forceMove(get_turf(src))
beaker.reagents.handle_reactions()
beaker = null
icon_state = "mixer0b"
on = FALSE
@@ -111,6 +97,8 @@
return 0
if(href_list["toggle_on"])
if(!beaker.reagents.total_volume)
return
on = !on
. = 1
@@ -33,6 +33,9 @@
. = ..()
holder = null
/datum/reagent/proc/reaction_temperature(exposed_temperature, exposed_volume) //By default we do nothing.
return
/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)
@@ -224,8 +224,9 @@
/datum/reagent/cryostylane/on_tick()
if(holder.has_reagent("oxygen"))
holder.remove_reagent("oxygen", 1)
holder.chem_temp -= 10
holder.handle_reactions()
holder.remove_reagent("cryostylane", 1)
holder.temperature_reagents(holder.chem_temp - 200)
holder.temperature_reagents(holder.chem_temp - 200)
..()
/datum/reagent/cryostylane/reaction_turf(turf/T, volume)
@@ -249,8 +250,9 @@
/datum/reagent/pyrosium/on_tick()
if(holder.has_reagent("oxygen"))
holder.remove_reagent("oxygen", 1)
holder.chem_temp += 10
holder.handle_reactions()
holder.remove_reagent("pyrosium", 1)
holder.temperature_reagents(holder.chem_temp + 200)
holder.temperature_reagents(holder.chem_temp + 200)
..()
/datum/reagent/firefighting_foam
@@ -229,7 +229,7 @@
id = "flamingmoe"
result = "flamingmoe"
required_reagents = list("vodka" = 1, "gin" = 1, "cognac" = 1, "tequila" = 1, "salglu_solution" = 1) //Close enough
min_temp = 374 //Fire makes it good!
min_temp = T0C + 100 //Fire makes it good!
result_amount = 5
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
mix_message = "The concoction bursts into flame!"
@@ -701,7 +701,7 @@
id = "applejack"
result = "applejack"
required_reagents = list("cider" = 2)
max_temp = 270
max_temp = T0C
result_amount = 1
mix_message = "The drink darkens as the water freezes, leaving the concentrated cider behind."
mix_sound = null
@@ -15,7 +15,7 @@
result_amount = 5
mix_message = "The mixture violently reacts, leaving behind a few crystalline shards."
mix_sound = 'sound/goonstation/effects/crystalshatter.ogg'
min_temp = 390
min_temp = T0C + 100
/datum/chemical_reaction/crank/on_reaction(datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
@@ -30,7 +30,7 @@
required_reagents = list("diphenhydramine" = 1, "morphine" = 1, "cleaner" = 1, "potassium" = 1, "phosphorus" = 1, "fuel" = 1)
result_amount = 6
mix_message = "The mixture dries into a pale blue powder."
min_temp = 380
min_temp = T0C + 100
mix_sound = 'sound/goonstation/misc/fuse.ogg'
/datum/chemical_reaction/methamphetamine
@@ -39,7 +39,7 @@
result = "methamphetamine"
required_reagents = list("ephedrine" = 1, "iodine" = 1, "phosphorus" = 1, "hydrogen" = 1)
result_amount = 4
min_temp = 374
min_temp = T0C + 100
/datum/chemical_reaction/methamphetamine/on_reaction(datum/reagents/holder)
var/turf/T = get_turf(holder.my_atom)
@@ -57,7 +57,7 @@
result = "bath_salts"
required_reagents = list("????" = 1, "saltpetre" = 1, "msg" = 1, "cleaner" = 1, "enzyme" = 1, "mugwort" = 1, "mercury" = 1)
result_amount = 6
min_temp = 374
min_temp = T0C + 100
mix_message = "Tiny cubic crystals precipitate out of the mixture. Huh."
mix_sound = 'sound/goonstation/misc/fuse.ogg'
@@ -124,7 +124,7 @@
result = "corn_syrup"
required_reagents = list("corn_starch" = 1, "sacid" = 1)
result_amount = 2
min_temp = 374
min_temp = T0C + 100
mix_message = "The mixture forms a viscous, clear fluid!"
/datum/chemical_reaction/vhfcs
@@ -176,7 +176,7 @@
result = "hydrogenated_soybeanoil"
required_reagents = list("soybeanoil" = 1, "hydrogen" = 1)
result_amount = 2
min_temp = 520
min_temp = T0C + 250
mix_message = "The mixture emits a burnt, oily smell."
/datum/chemical_reaction/meatslurry
@@ -194,7 +194,7 @@
result = "gravy"
required_reagents = list("porktonium" = 1, "corn_starch" = 1, "milk" = 1)
result_amount = 3
min_temp = 374
min_temp = T0C + 100
mix_message = "The substance thickens and takes on a meaty odor."
/datum/chemical_reaction/beff
@@ -221,7 +221,7 @@
result = "enzyme"
required_reagents = list("vomit" = 1, "sugar" = 1)
result_amount = 2
min_temp = 750
min_temp = T0C + 480
mix_message = "The mixture emits a horrible smell as you heat up the contents. Luckily, enzymes don't stink."
mix_sound = 'sound/goonstation/misc/fuse.ogg'
@@ -231,6 +231,6 @@
result = "enzyme"
required_reagents = list("green_vomit" = 1, "sugar" = 1)
result_amount = 2
min_temp = 750
min_temp = T0C + 480
mix_message = "The mixture emits a horrible smell as you heat up the contents. Luckily, enzymes don't stink."
mix_sound = 'sound/goonstation/misc/fuse.ogg'
@@ -50,7 +50,7 @@
required_reagents = list("ash" = 1, "sodiumchloride" = 1)
result_amount = 2
mix_message = "The mixture yields a fine black powder."
min_temp = 380
min_temp = T0C + 100
mix_sound = 'sound/goonstation/misc/fuse.ogg'
/datum/chemical_reaction/silver_sulfadiazine
@@ -92,7 +92,7 @@
result = "calomel"
required_reagents = list("mercury" = 1, "chlorine" = 1)
result_amount = 2
min_temp = 374
min_temp = T0C + 100
mix_message = "Stinging vapors rise from the solution."
/datum/chemical_reaction/potass_iodide
@@ -135,7 +135,7 @@
result = "perfluorodecalin"
required_reagents = list("hydrogen" = 1, "fluorine" = 1, "oil" = 1)
result_amount = 3
min_temp = 370
min_temp = T0C + 100
mix_message = "The mixture rapidly turns into a dense pink liquid."
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
@@ -195,7 +195,7 @@
result = null
required_reagents = list("strange_reagent" = 1, "synthflesh" = 1, "blood" = 1)
result_amount = 3
min_temp = 374
min_temp = T0C + 100
/datum/chemical_reaction/life/on_reaction(datum/reagents/holder, created_volume)
chemical_mob_spawn(holder, 1, "Life")
@@ -263,7 +263,7 @@
result = "liquid_solder"
required_reagents = list("ethanol" = 1, "copper" = 1, "silver" = 1)
result_amount = 3
min_temp = 370
min_temp = T0C + 100
mix_message = "The solution gently swirls with a metallic sheen."
/datum/chemical_reaction/corazone
@@ -74,7 +74,7 @@
result = "diethylamine"
required_reagents = list ("ammonia" = 1, "ethanol" = 1)
result_amount = 2
min_temp = 374
min_temp = T0C + 100
mix_message = "A horrible smell pours forth from the mixture."
/datum/chemical_reaction/space_cleaner
@@ -98,7 +98,7 @@
id = "plastic_polymers"
result = null
required_reagents = list("oil" = 5, "sacid" = 2, "ash" = 3)
min_temp = 374
min_temp = T0C + 100
result_amount = 1
/datum/chemical_reaction/plastic_polymers/on_reaction(datum/reagents/holder, created_volume)
@@ -177,7 +177,7 @@
result = "ash"
required_reagents = list("oil" = 1)
result_amount = 0.5
min_temp = 480
min_temp = T0C + 600
mix_sound = null
no_message = 1
@@ -195,7 +195,7 @@
result = null
required_reagents = list("nutriment" = 1, "colorful_reagent" = 1, "strange_reagent" = 1, "blood" = 1)
result_amount = 3
min_temp = 374
min_temp = T0C + 100
/datum/chemical_reaction/corgium/on_reaction(datum/reagents/holder, created_volume)
var/location = get_turf(holder.my_atom)
@@ -208,7 +208,7 @@
result = null
required_reagents = list("egg" = 1, "colorful_reagent" = 1, "chicken_soup" = 1, "strange_reagent" = 1, "blood" = 1)
result_amount = 5
min_temp = 374
min_temp = T0C + 100
mix_message = "The substance turns an airy sky-blue and foams up into a new shape."
/datum/chemical_reaction/flaptonium/on_reaction(datum/reagents/holder, created_volume)
@@ -244,7 +244,7 @@
id = "soapification"
result = null
required_reagents = list("liquidgibs" = 10, "lye" = 10) // requires two scooped gib tiles
min_temp = 374
min_temp = T0C + 100
result_amount = 1
@@ -257,7 +257,7 @@
id = "candlefication"
result = null
required_reagents = list("liquidgibs" = 5, "oxygen" = 5) //
min_temp = 374
min_temp = T0C + 100
result_amount = 1
/datum/chemical_reaction/candlefication/on_reaction(datum/reagents/holder, created_volume)
@@ -295,7 +295,7 @@
id = "jestosterone"
result = "jestosterone"
required_reagents = list("blood" = 1, "sodiumchloride" = 1, "banana" = 1, "lube" = 1, "space_drugs" = 1) //Or one freshly-squeezed clown
min_temp = 374
min_temp = T0C + 100
result_amount = 5
mix_message = "The substance quickly shifts colour, cycling from red, to yellow, to green, to blue, and finally settles at a vibrant fuchsia."
@@ -338,7 +338,7 @@
result = "ice"
required_reagents = list("water" = 1)
result_amount = 1
max_temp = 273
max_temp = T0C
mix_message = "Ice forms as the water freezes."
mix_sound = null
@@ -348,7 +348,7 @@
result = "water"
required_reagents = list("ice" = 1)
result_amount = 1
min_temp = 301 // In Space.....ice melts at 82F...don't ask
min_temp = T0C + 29 // In Space.....ice melts at 82F...don't ask
mix_message = "Water pools as the ice melts."
mix_sound = null
@@ -80,7 +80,7 @@
result = "clf3"
required_reagents = list("chlorine" = 1, "fluorine" = 3)
result_amount = 2
min_temp = 424
min_temp = T0C + 150
/datum/chemical_reaction/clf3/on_reaction(datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
@@ -107,7 +107,7 @@
result = "sorium_vortex"
required_reagents = list("sorium" = 1)
result_amount = 1
min_temp = 474
min_temp = T0C + 200
/datum/chemical_reaction/sorium_vortex/on_reaction(datum/reagents/holder, created_volume)
var/turf/simulated/T = get_turf(holder.my_atom)
@@ -134,7 +134,7 @@
result = "ldm_vortex"
required_reagents = list("liquid_dark_matter" = 1)
result_amount = 1
min_temp = 474
min_temp = T0C + 200
/datum/chemical_reaction/ldm_vortex/on_reaction(datum/reagents/holder, created_volume)
var/turf/simulated/T = get_turf(holder.my_atom)
@@ -155,7 +155,7 @@
result = null
required_reagents = list("blackpowder" = 1)
result_amount = 1
min_temp = 474
min_temp = T0C + 200
no_message = 1
mix_sound = null
@@ -202,7 +202,7 @@ datum/chemical_reaction/flash_powder
id = "flash_powder_flash"
result = null
required_reagents = list("flash_powder" = 1)
min_temp = 374
min_temp = T0C + 100
/datum/chemical_reaction/flash_powder_flash/on_reaction(datum/reagents/holder, created_volume)
var/location = get_turf(holder.my_atom)
@@ -256,7 +256,7 @@ datum/chemical_reaction/flash_powder
name = "smoke_powder_smoke"
id = "smoke_powder_smoke"
required_reagents = list("smoke_powder" = 1)
min_temp = 374
min_temp = T0C + 100
secondary = 1
result_amount = 1
forbidden_reagents = list("stimulants")
@@ -307,7 +307,7 @@ datum/chemical_reaction/flash_powder
id = "sonic_powder_deafen"
result = null
required_reagents = list("sonic_powder" = 1)
min_temp = 374
min_temp = T0C + 100
/datum/chemical_reaction/sonic_powder_deafen/on_reaction(datum/reagents/holder, created_volume)
var/location = get_turf(holder.my_atom)
@@ -4,7 +4,7 @@
result = "formaldehyde"
required_reagents = list("ethanol" = 1, "oxygen" = 1, "silver" = 1)
result_amount = 3
min_temp = 420
min_temp = T0C + 150
mix_message = "Ugh, it smells like the morgue in here."
/datum/chemical_reaction/neurotoxin2
@@ -13,7 +13,7 @@
result = "neurotoxin2"
required_reagents = list("space_drugs" = 1)
result_amount = 1
min_temp = 674
min_temp = T0C + 400
mix_sound = null
no_message = 1
@@ -23,7 +23,7 @@
result = "cyanide"
required_reagents = list("oil" = 1, "ammonia" = 1, "oxygen" = 1)
result_amount = 3
min_temp = 380
min_temp = T0C + 100
mix_message = "The mixture gives off a faint scent of almonds."
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
@@ -49,7 +49,7 @@
result = "facid"
required_reagents = list("sacid" = 1, "fluorine" = 1, "hydrogen" = 1, "potassium" = 1)
result_amount = 4
min_temp = 380
min_temp = T0C + 100
mix_message = "The mixture deepens to a dark blue, and slowly begins to corrode its container."
/datum/chemical_reaction/initropidril
@@ -83,7 +83,7 @@
required_reagents = list("chlorine" = 1, "fuel" = 1, "oxygen" = 1, "phosphorus" = 1, "fluorine" = 1, "hydrogen" = 1, "acetone" = 1, "atrazine" = 1)
result_amount = 3
mix_message = "The mixture yields a colorless, odorless liquid."
min_temp = 374
min_temp = T0C + 100
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
/datum/chemical_reaction/sarin/on_reaction(datum/reagents/holder)
@@ -139,7 +139,7 @@
required_reagents = list("plasma" = 1, "silver" = 1, "blackpowder" = 1)
result_amount = 3
mix_message = "<span class='danger'>A jet of sparks flies from the mixture as it merges into a flickering slurry.</span>"
min_temp = 400
min_temp = T0C + 130
mix_sound = null
/datum/chemical_reaction/teslium/on_reaction(datum/reagents/holder, created_volume)
@@ -44,11 +44,6 @@
R.on_ex_act()
..()
/obj/item/reagent_containers/fire_act()
reagents.chem_temp += 30
reagents.handle_reactions()
..()
/obj/item/reagent_containers/attack_self(mob/user)
if(has_lid)
if(is_open_container())
@@ -124,13 +124,6 @@
/obj/item/reagent_containers/glass/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/clothing/mask/cigarette)) //ciggies are weird
return
if(is_hot(I))
if(reagents)
reagents.chem_temp += 15
to_chat(user, "<span class='notice'>You heat [src] with [I].</span>")
reagents.handle_reactions()
if(istype(I, /obj/item/pen) || istype(I, /obj/item/flashlight/pen))
var/tmp_label = sanitize(input(user, "Enter a label for [name]","Label",label_text))
if(length(tmp_label) > MAX_NAME_LEN)
@@ -210,8 +203,7 @@
/obj/item/reagent_containers/glass/beaker/proc/heat_beaker()
if(reagents)
reagents.chem_temp += 30
reagents.handle_reactions()
reagents.temperature_reagents(4000)
/obj/item/reagent_containers/glass/beaker/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/assembly_holder) && can_assembly)
+2 -1
View File
@@ -99,7 +99,8 @@
/obj/structure/reagent_dispensers/fueltank/ex_act()
boom()
/obj/structure/reagent_dispensers/fueltank/fire_act()
/obj/structure/reagent_dispensers/fueltank/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
boom()
/obj/structure/reagent_dispensers/fueltank/tesla_act()