Merge pull request #12217 from Putnam3145/putnamos-for-real
The real fastmos: C++ monstermos port
This commit is contained in:
@@ -125,7 +125,7 @@
|
||||
/datum/objective_item/steal/plasma/check_special_completion(obj/item/tank/T)
|
||||
var/target_amount = text2num(name)
|
||||
var/found_amount = 0
|
||||
found_amount += T.air_contents.gases[/datum/gas/plasma]
|
||||
found_amount += T.air_contents.get_moles(/datum/gas/plasma)
|
||||
return found_amount>=target_amount
|
||||
|
||||
|
||||
|
||||
@@ -53,14 +53,14 @@
|
||||
"id_tag" = id_tag,
|
||||
"timestamp" = world.time,
|
||||
"pressure" = air_sample.return_pressure(),
|
||||
"temperature" = air_sample.temperature,
|
||||
"temperature" = air_sample.return_temperature(),
|
||||
"gases" = list()
|
||||
))
|
||||
var/total_moles = air_sample.total_moles()
|
||||
if(total_moles)
|
||||
for(var/gas_id in air_sample.gases)
|
||||
for(var/gas_id in air_sample.get_gases())
|
||||
var/gas_name = GLOB.meta_gas_names[gas_id]
|
||||
signal.data["gases"][gas_name] = air_sample.gases[gas_id] / total_moles * 100
|
||||
signal.data["gases"][gas_name] = air_sample.get_moles(gas_id) / total_moles * 100
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
var/shuttledocked = 0
|
||||
var/delayed_close_requested = FALSE // TRUE means the door will automatically close the next time it's opened.
|
||||
|
||||
var/air_tight = FALSE //TRUE means density will be set as soon as the door begins to close
|
||||
air_tight = FALSE
|
||||
var/prying_so_hard = FALSE
|
||||
|
||||
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
interaction_flags_atom = INTERACT_ATOM_UI_INTERACT
|
||||
|
||||
var/secondsElectrified = 0
|
||||
var/air_tight = FALSE //TRUE means density will be set as soon as the door begins to close
|
||||
var/shockedby
|
||||
var/visible = TRUE // To explain: Whether the door can block line of sight when closed or not.
|
||||
var/operating = FALSE
|
||||
@@ -161,7 +162,7 @@
|
||||
open()
|
||||
else
|
||||
close()
|
||||
return
|
||||
return TRUE
|
||||
if(density)
|
||||
do_animate("deny")
|
||||
|
||||
@@ -181,11 +182,36 @@
|
||||
/obj/machinery/door/proc/try_to_crowbar(obj/item/I, mob/user)
|
||||
return
|
||||
|
||||
/obj/machinery/door/proc/is_holding_pressure()
|
||||
var/turf/open/T = loc
|
||||
if(!T)
|
||||
return FALSE
|
||||
if(!density)
|
||||
return FALSE
|
||||
// alrighty now we check for how much pressure we're holding back
|
||||
var/min_moles = T.air.total_moles()
|
||||
var/max_moles = min_moles
|
||||
// okay this is a bit hacky. First, we set density to 0 and recalculate our adjacent turfs
|
||||
density = FALSE
|
||||
T.ImmediateCalculateAdjacentTurfs()
|
||||
// then we use those adjacent turfs to figure out what the difference between the lowest and highest pressures we'd be holding is
|
||||
for(var/turf/open/T2 in T.atmos_adjacent_turfs)
|
||||
if((flags_1 & ON_BORDER_1) && get_dir(src, T2) != dir)
|
||||
continue
|
||||
var/moles = T2.air.total_moles()
|
||||
if(moles < min_moles)
|
||||
min_moles = moles
|
||||
if(moles > max_moles)
|
||||
max_moles = moles
|
||||
density = TRUE
|
||||
T.ImmediateCalculateAdjacentTurfs() // alright lets put it back
|
||||
return max_moles - min_moles > 20
|
||||
|
||||
/obj/machinery/door/attackby(obj/item/I, mob/user, params)
|
||||
if(user.a_intent != INTENT_HARM && (istype(I, /obj/item/crowbar) || istype(I, /obj/item/fireaxe)))
|
||||
if(user.a_intent != INTENT_HARM && (I.tool_behaviour == TOOL_CROWBAR || istype(I, /obj/item/fireaxe)))
|
||||
try_to_crowbar(I, user)
|
||||
return 1
|
||||
else if(istype(I, /obj/item/weldingtool))
|
||||
else if(I.tool_behaviour == TOOL_WELDER)
|
||||
try_to_weld(I, user)
|
||||
return 1
|
||||
else if(!(I.item_flags & NOBLUDGEON) && user.a_intent != INTENT_HARM)
|
||||
@@ -223,13 +249,13 @@
|
||||
if(prob(20/severity) && (istype(src, /obj/machinery/door/airlock) || istype(src, /obj/machinery/door/window)) )
|
||||
INVOKE_ASYNC(src, .proc/open)
|
||||
if(prob(severity*10 - 20))
|
||||
if(secondsElectrified == 0)
|
||||
secondsElectrified = -1
|
||||
if(secondsElectrified == MACHINE_NOT_ELECTRIFIED)
|
||||
secondsElectrified = MACHINE_ELECTRIFIED_PERMANENT
|
||||
LAZYADD(shockedby, "\[[TIME_STAMP("hh:mm:ss", FALSE)]\]EM Pulse")
|
||||
addtimer(CALLBACK(src, .proc/unelectrify), 300)
|
||||
|
||||
/obj/machinery/door/proc/unelectrify()
|
||||
secondsElectrified = 0
|
||||
secondsElectrified = MACHINE_NOT_ELECTRIFIED
|
||||
|
||||
/obj/machinery/door/update_icon_state()
|
||||
if(density)
|
||||
@@ -289,8 +315,11 @@
|
||||
return
|
||||
|
||||
operating = TRUE
|
||||
|
||||
do_animate("closing")
|
||||
layer = closingLayer
|
||||
if(air_tight)
|
||||
density = TRUE
|
||||
sleep(5)
|
||||
density = TRUE
|
||||
sleep(5)
|
||||
@@ -302,7 +331,7 @@
|
||||
update_freelook_sight()
|
||||
if(safe)
|
||||
CheckForMobs()
|
||||
else
|
||||
else if(!(flags_1 & ON_BORDER_1))
|
||||
crush()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
assemblytype = /obj/structure/firelock_frame
|
||||
armor = list("melee" = 30, "bullet" = 30, "laser" = 20, "energy" = 20, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 95, "acid" = 70)
|
||||
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_REQUIRES_SILICON | INTERACT_MACHINE_OPEN
|
||||
air_tight = TRUE
|
||||
var/emergency_close_timer = 0
|
||||
var/nextstate = null
|
||||
var/boltslocked = TRUE
|
||||
var/list/affecting_areas
|
||||
@@ -68,10 +70,14 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/firedoor/Bumped(atom/movable/AM)
|
||||
if(panel_open || operating)
|
||||
if(panel_open || operating || welded)
|
||||
return
|
||||
if(!density)
|
||||
return ..()
|
||||
if(ismob(AM))
|
||||
var/mob/user = AM
|
||||
if(density && !welded && !operating && !(stat & NOPOWER) && (!density || allow_hand_open(user)))
|
||||
add_fingerprint(user)
|
||||
open()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -86,6 +92,15 @@
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
if(!welded && !operating && !(stat & NOPOWER) && (!density || allow_hand_open(user)))
|
||||
add_fingerprint(user)
|
||||
if(density)
|
||||
emergency_close_timer = world.time + 30 // prevent it from instaclosing again if in space
|
||||
open()
|
||||
else
|
||||
close()
|
||||
return TRUE
|
||||
if(operating || !density)
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
@@ -100,7 +115,7 @@
|
||||
return
|
||||
|
||||
if(welded)
|
||||
if(istype(C, /obj/item/wrench))
|
||||
if(C.tool_behaviour == TOOL_WRENCH)
|
||||
if(boltslocked)
|
||||
to_chat(user, "<span class='notice'>There are screws locking the bolts in place!</span>")
|
||||
return
|
||||
@@ -114,7 +129,7 @@
|
||||
"<span class='notice'>You undo [src]'s floor bolts.</span>")
|
||||
deconstruct(TRUE)
|
||||
return
|
||||
if(istype(C, /obj/item/screwdriver))
|
||||
if(C.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
user.visible_message("<span class='notice'>[user] [boltslocked ? "unlocks" : "locks"] [src]'s bolts.</span>", \
|
||||
"<span class='notice'>You [boltslocked ? "unlock" : "lock"] [src]'s floor bolts.</span>")
|
||||
C.play_tool_sound(src)
|
||||
@@ -140,10 +155,27 @@
|
||||
return
|
||||
|
||||
if(density)
|
||||
if(is_holding_pressure())
|
||||
// tell the user that this is a bad idea, and have a do_after as well
|
||||
to_chat(user, "<span class='warning'>As you begin crowbarring \the [src] a gush of air blows in your face... maybe you should reconsider?</span>")
|
||||
if(!do_after(user, 15, TRUE, src)) // give them a few seconds to reconsider their decision.
|
||||
return
|
||||
log_game("[key_name_admin(user)] has opened a firelock with a pressure difference at [AREACOORD(loc)]") // there bibby I made it logged just for you. Enjoy.
|
||||
// since we have high-pressure-ness, close all other firedoors on the tile
|
||||
whack_a_mole()
|
||||
if(welded || operating || !density)
|
||||
return // in case things changed during our do_after
|
||||
emergency_close_timer = world.time + 60 // prevent it from instaclosing again if in space
|
||||
open()
|
||||
else
|
||||
close()
|
||||
|
||||
/obj/machinery/door/firedoor/proc/allow_hand_open(mob/user)
|
||||
var/area/A = get_area(src)
|
||||
if(A && A.fire)
|
||||
return FALSE
|
||||
return !is_holding_pressure()
|
||||
|
||||
/obj/machinery/door/firedoor/attack_ai(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(welded || operating || stat & NOPOWER)
|
||||
@@ -171,20 +203,16 @@
|
||||
if("closing")
|
||||
flick("door_closing", src)
|
||||
|
||||
/obj/machinery/door/firedoor/update_icon_state()
|
||||
/obj/machinery/door/firedoor/update_icon()
|
||||
cut_overlays()
|
||||
if(density)
|
||||
icon_state = "door_closed"
|
||||
if(welded)
|
||||
add_overlay("welded")
|
||||
else
|
||||
icon_state = "door_open"
|
||||
|
||||
/obj/machinery/door/firedoor/update_overlays()
|
||||
. = ..()
|
||||
if(!welded)
|
||||
return
|
||||
if(density)
|
||||
. += "welded"
|
||||
else
|
||||
. += "welded_open"
|
||||
if(welded)
|
||||
add_overlay("welded_open")
|
||||
|
||||
/obj/machinery/door/firedoor/open()
|
||||
. = ..()
|
||||
@@ -194,6 +222,61 @@
|
||||
. = ..()
|
||||
latetoggle()
|
||||
|
||||
/obj/machinery/door/firedoor/proc/whack_a_mole(reconsider_immediately = FALSE)
|
||||
set waitfor = 0
|
||||
for(var/cdir in GLOB.cardinals)
|
||||
if((flags_1 & ON_BORDER_1) && cdir != dir)
|
||||
continue
|
||||
whack_a_mole_part(get_step(src, cdir), reconsider_immediately)
|
||||
if(flags_1 & ON_BORDER_1)
|
||||
whack_a_mole_part(get_turf(src), reconsider_immediately)
|
||||
|
||||
/obj/machinery/door/firedoor/proc/whack_a_mole_part(turf/start_point, reconsider_immediately)
|
||||
set waitfor = 0
|
||||
var/list/doors_to_close = list()
|
||||
var/list/turfs = list()
|
||||
turfs[start_point] = 1
|
||||
for(var/i = 1; (i <= turfs.len && i <= 11); i++) // check up to 11 turfs.
|
||||
var/turf/open/T = turfs[i]
|
||||
if(istype(T, /turf/open/space))
|
||||
return -1
|
||||
for(var/T2 in T.atmos_adjacent_turfs)
|
||||
if(turfs[T2])
|
||||
continue
|
||||
var/is_cut_by_unopen_door = FALSE
|
||||
for(var/obj/machinery/door/firedoor/FD in T2)
|
||||
if((FD.flags_1 & ON_BORDER_1) && get_dir(T2, T) != FD.dir)
|
||||
continue
|
||||
if(FD.operating || FD == src || FD.welded || FD.density)
|
||||
continue
|
||||
doors_to_close += FD
|
||||
is_cut_by_unopen_door = TRUE
|
||||
|
||||
for(var/obj/machinery/door/firedoor/FD in T)
|
||||
if((FD.flags_1 & ON_BORDER_1) && get_dir(T, T2) != FD.dir)
|
||||
continue
|
||||
if(FD.operating || FD == src || FD.welded || FD.density)
|
||||
continue
|
||||
doors_to_close += FD
|
||||
is_cut_by_unopen_door= TRUE
|
||||
if(!is_cut_by_unopen_door)
|
||||
turfs[T2] = 1
|
||||
if(turfs.len > 10)
|
||||
return // too big, don't bother
|
||||
for(var/obj/machinery/door/firedoor/FD in doors_to_close)
|
||||
FD.emergency_pressure_stop(FALSE)
|
||||
if(reconsider_immediately)
|
||||
var/turf/open/T = FD.loc
|
||||
if(istype(T))
|
||||
T.ImmediateCalculateAdjacentTurfs()
|
||||
|
||||
/obj/machinery/door/firedoor/proc/emergency_pressure_stop(consider_timer = TRUE)
|
||||
set waitfor = 0
|
||||
if(density || operating || welded)
|
||||
return
|
||||
if(world.time >= emergency_close_timer || !consider_timer)
|
||||
close()
|
||||
|
||||
/obj/machinery/door/firedoor/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
var/obj/structure/firelock_frame/F = new assemblytype(get_turf(src))
|
||||
@@ -227,6 +310,59 @@
|
||||
opacity = TRUE
|
||||
density = TRUE
|
||||
|
||||
/obj/machinery/door/firedoor/border_only/close()
|
||||
if(density)
|
||||
return TRUE
|
||||
if(operating || welded)
|
||||
return
|
||||
var/turf/T1 = get_turf(src)
|
||||
var/turf/T2 = get_step(T1, dir)
|
||||
for(var/mob/living/M in T1)
|
||||
if(M.stat == CONSCIOUS && M.pulling && M.pulling.loc == T2 && !M.pulling.anchored && M.pulling.move_resist <= M.move_force)
|
||||
var/mob/living/M2 = M.pulling
|
||||
if(!istype(M2) || !M2.buckled || !M2.buckled.buckle_prevents_pull)
|
||||
to_chat(M, "<span class='notice'>You pull [M.pulling] through [src] right as it closes</span>")
|
||||
M.pulling.forceMove(T1)
|
||||
M.start_pulling(M2)
|
||||
|
||||
for(var/mob/living/M in T2)
|
||||
if(M.stat == CONSCIOUS && M.pulling && M.pulling.loc == T1 && !M.pulling.anchored && M.pulling.move_resist <= M.move_force)
|
||||
var/mob/living/M2 = M.pulling
|
||||
if(!istype(M2) || !M2.buckled || !M2.buckled.buckle_prevents_pull)
|
||||
to_chat(M, "<span class='notice'>You pull [M.pulling] through [src] right as it closes</span>")
|
||||
M.pulling.forceMove(T2)
|
||||
M.start_pulling(M2)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/door/firedoor/border_only/allow_hand_open(mob/user)
|
||||
var/area/A = get_area(src)
|
||||
if((!A || !A.fire) && !is_holding_pressure())
|
||||
return TRUE
|
||||
whack_a_mole(TRUE) // WOOP WOOP SIDE EFFECTS
|
||||
var/turf/T = loc
|
||||
var/turf/T2 = get_step(T, dir)
|
||||
if(!T || !T2)
|
||||
return
|
||||
var/status1 = check_door_side(T)
|
||||
var/status2 = check_door_side(T2)
|
||||
if((status1 == 1 && status2 == -1) || (status1 == -1 && status2 == 1))
|
||||
to_chat(user, "<span class='warning'>Access denied. Try closing another firedoor to minimize decompression, or using a crowbar.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/door/firedoor/border_only/proc/check_door_side(turf/open/start_point)
|
||||
var/list/turfs = list()
|
||||
turfs[start_point] = 1
|
||||
for(var/i = 1; (i <= turfs.len && i <= 11); i++) // check up to 11 turfs.
|
||||
var/turf/open/T = turfs[i]
|
||||
if(istype(T, /turf/open/space))
|
||||
return -1
|
||||
for(var/T2 in T.atmos_adjacent_turfs)
|
||||
turfs[T2] = 1
|
||||
if(turfs.len <= 10)
|
||||
return 0 // not big enough to matter
|
||||
return start_point.air.return_pressure() < 20 ? -1 : 1
|
||||
|
||||
/obj/machinery/door/firedoor/border_only/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return TRUE
|
||||
@@ -257,6 +393,18 @@
|
||||
assemblytype = /obj/structure/firelock_frame/heavy
|
||||
max_integrity = 550
|
||||
|
||||
/obj/machinery/door/firedoor/window
|
||||
name = "window shutter"
|
||||
icon = 'icons/obj/doors/doorfirewindow.dmi'
|
||||
desc = "A second window that slides in when the original window is broken, designed to protect against hull breaches. Truly a work of genius by NT engineers."
|
||||
glass = TRUE
|
||||
explosion_block = 0
|
||||
max_integrity = 50
|
||||
resistance_flags = 0 // not fireproof
|
||||
heat_proof = FALSE
|
||||
|
||||
/obj/machinery/door/firedoor/window/allow_hand_open()
|
||||
return TRUE
|
||||
|
||||
/obj/item/electronics/firelock
|
||||
name = "firelock circuitry"
|
||||
@@ -294,7 +442,7 @@
|
||||
/obj/structure/firelock_frame/attackby(obj/item/C, mob/user)
|
||||
switch(constructionStep)
|
||||
if(CONSTRUCTION_PANEL_OPEN)
|
||||
if(istype(C, /obj/item/crowbar))
|
||||
if(C.tool_behaviour == TOOL_CROWBAR)
|
||||
C.play_tool_sound(src)
|
||||
user.visible_message("<span class='notice'>[user] starts prying something out from [src]...</span>", \
|
||||
"<span class='notice'>You begin prying out the wire cover...</span>")
|
||||
@@ -308,7 +456,7 @@
|
||||
constructionStep = CONSTRUCTION_WIRES_EXPOSED
|
||||
update_icon()
|
||||
return
|
||||
if(istype(C, /obj/item/wrench))
|
||||
if(C.tool_behaviour == TOOL_WRENCH)
|
||||
if(locate(/obj/machinery/door/firedoor) in get_turf(src))
|
||||
to_chat(user, "<span class='warning'>There's already a firelock there.</span>")
|
||||
return
|
||||
@@ -350,7 +498,7 @@
|
||||
return
|
||||
|
||||
if(CONSTRUCTION_WIRES_EXPOSED)
|
||||
if(istype(C, /obj/item/wirecutters))
|
||||
if(C.tool_behaviour == TOOL_WIRECUTTER)
|
||||
C.play_tool_sound(src)
|
||||
user.visible_message("<span class='notice'>[user] starts cutting the wires from [src]...</span>", \
|
||||
"<span class='notice'>You begin removing [src]'s wires...</span>")
|
||||
@@ -364,7 +512,7 @@
|
||||
constructionStep = CONSTRUCTION_GUTTED
|
||||
update_icon()
|
||||
return
|
||||
if(istype(C, /obj/item/crowbar))
|
||||
if(C.tool_behaviour == TOOL_CROWBAR)
|
||||
C.play_tool_sound(src)
|
||||
user.visible_message("<span class='notice'>[user] starts prying a metal plate into [src]...</span>", \
|
||||
"<span class='notice'>You begin prying the cover plate back onto [src]...</span>")
|
||||
@@ -379,7 +527,7 @@
|
||||
update_icon()
|
||||
return
|
||||
if(CONSTRUCTION_GUTTED)
|
||||
if(istype(C, /obj/item/crowbar))
|
||||
if(C.tool_behaviour == TOOL_CROWBAR)
|
||||
user.visible_message("<span class='notice'>[user] begins removing the circuit board from [src]...</span>", \
|
||||
"<span class='notice'>You begin prying out the circuit board from [src]...</span>")
|
||||
if(!C.use_tool(src, user, 50, volume=50))
|
||||
@@ -401,7 +549,7 @@
|
||||
"<span class='notice'>You begin adding wires to [src]...</span>")
|
||||
playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 60, target = src))
|
||||
if(constructionStep != CONSTRUCTION_GUTTED || !B.use_tool(src, user, 0, 5))
|
||||
if(constructionStep != CONSTRUCTION_GUTTED || B.get_amount() < 5 || !B)
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] adds wires to [src].</span>", \
|
||||
"<span class='notice'>You wire [src].</span>")
|
||||
@@ -410,7 +558,7 @@
|
||||
update_icon()
|
||||
return
|
||||
if(CONSTRUCTION_NOCIRCUIT)
|
||||
if(istype(C, /obj/item/weldingtool))
|
||||
if(C.tool_behaviour == TOOL_WELDER)
|
||||
if(!C.tool_start_check(user, amount=1))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] begins cutting apart [src]'s frame...</span>", \
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
var/deltaTemperature = req_power / heat_cap
|
||||
if(deltaTemperature < 0)
|
||||
return
|
||||
env.temperature += deltaTemperature
|
||||
env.set_temperature(env.return_temperature(),deltaTemperature)
|
||||
air_update_turf()
|
||||
|
||||
/obj/machinery/shuttle/engine/default_change_direction_wrench(mob/user, obj/item/I)
|
||||
|
||||
@@ -89,8 +89,8 @@
|
||||
var/datum/gas_mixture/air_contents = airs[1]
|
||||
if(!air_contents)
|
||||
return
|
||||
air_contents.volume = gas_capacity
|
||||
air_contents.temperature = T20C
|
||||
air_contents.set_volume(gas_capacity)
|
||||
air_contents.set_temperature(T20C)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/shuttle/heater/proc/hasFuel(var/required)
|
||||
var/datum/gas_mixture/air_contents = airs[1]
|
||||
|
||||
@@ -83,9 +83,9 @@
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
|
||||
var/newMode = HEATER_MODE_STANDBY
|
||||
if(setMode != HEATER_MODE_COOL && env.temperature < targetTemperature - temperatureTolerance)
|
||||
if(setMode != HEATER_MODE_COOL && env.return_temperature() < targetTemperature - temperatureTolerance)
|
||||
newMode = HEATER_MODE_HEAT
|
||||
else if(setMode != HEATER_MODE_HEAT && env.temperature > targetTemperature + temperatureTolerance)
|
||||
else if(setMode != HEATER_MODE_HEAT && env.return_temperature() > targetTemperature + temperatureTolerance)
|
||||
newMode = HEATER_MODE_COOL
|
||||
|
||||
if(mode != newMode)
|
||||
@@ -96,7 +96,7 @@
|
||||
return
|
||||
|
||||
var/heat_capacity = env.heat_capacity()
|
||||
var/requiredPower = abs(env.temperature - targetTemperature) * heat_capacity
|
||||
var/requiredPower = abs(env.return_temperature() - targetTemperature) * heat_capacity
|
||||
requiredPower = min(requiredPower, heatingPower)
|
||||
|
||||
if(requiredPower < 1)
|
||||
@@ -106,7 +106,7 @@
|
||||
if(mode == HEATER_MODE_COOL)
|
||||
deltaTemperature *= -1
|
||||
if(deltaTemperature)
|
||||
env.temperature += deltaTemperature
|
||||
env.set_temperature(env.return_temperature() + deltaTemperature)
|
||||
air_update_turf()
|
||||
cell.use(requiredPower / efficiency)
|
||||
else
|
||||
@@ -194,9 +194,9 @@
|
||||
var/curTemp
|
||||
if(istype(L))
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
curTemp = env.temperature
|
||||
curTemp = env.return_temperature()
|
||||
else if(isturf(L))
|
||||
curTemp = L.temperature
|
||||
curTemp = L.return_temperature()
|
||||
if(isnull(curTemp))
|
||||
data["currentTemp"] = "N/A"
|
||||
else
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
var/cell_charge = get_charge()
|
||||
var/datum/gas_mixture/int_tank_air = internal_tank.return_air()
|
||||
var/tank_pressure = internal_tank ? round(int_tank_air.return_pressure(),0.01) : "None"
|
||||
var/tank_temperature = internal_tank ? int_tank_air.temperature : "Unknown"
|
||||
var/tank_temperature = internal_tank ? int_tank_air.return_temperature() : "Unknown"
|
||||
var/cabin_pressure = round(return_pressure(),0.01)
|
||||
var/output = {"[report_internal_damage()]
|
||||
[integrity<30?"<font color='red'><b>DAMAGE LEVEL CRITICAL</b></font><br>":null]
|
||||
@@ -155,4 +155,4 @@
|
||||
var/color=""
|
||||
for (var/i=0;i<6;i++)
|
||||
color = color+pick(colors)
|
||||
return color
|
||||
return color
|
||||
|
||||
@@ -422,13 +422,13 @@
|
||||
return
|
||||
var/datum/gas_mixture/GM = new
|
||||
if(prob(10))
|
||||
GM.gases[/datum/gas/plasma] += 100
|
||||
GM.temperature = 1500+T0C //should be enough to start a fire
|
||||
GM.adjust_moles(/datum/gas/plasma,100)
|
||||
GM.set_temperature(1500+T0C) //should be enough to start a fire
|
||||
T.visible_message("[src] suddenly disgorges a cloud of heated plasma.")
|
||||
qdel(src)
|
||||
else
|
||||
GM.gases[/datum/gas/plasma] += 5
|
||||
GM.temperature = istype(T) ? T.air.return_temperature() : T20C
|
||||
GM.adjust_moles(/datum/gas/plasma,5)
|
||||
GM.set_temperature(istype(T) ? T.air.return_temperature() : T20C)
|
||||
T.visible_message("[src] suddenly disgorges a cloud of plasma.")
|
||||
T.assume_air(GM)
|
||||
return
|
||||
|
||||
@@ -247,10 +247,10 @@
|
||||
|
||||
/obj/mecha/proc/add_cabin()
|
||||
cabin_air = new
|
||||
cabin_air.temperature = T20C
|
||||
cabin_air.volume = 200
|
||||
cabin_air.gases[/datum/gas/oxygen] = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
|
||||
cabin_air.gases[/datum/gas/nitrogen] = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
|
||||
cabin_air.set_temperature(T20C)
|
||||
cabin_air.set_volume(200)
|
||||
cabin_air.set_moles(/datum/gas/oxygen,O2STANDARD*cabin_air.return_volume()/(R_IDEAL_GAS_EQUATION*cabin_air.return_temperature()))
|
||||
cabin_air.set_moles(/datum/gas/nitrogen,N2STANDARD*cabin_air.return_volume()/(R_IDEAL_GAS_EQUATION*cabin_air.return_temperature()))
|
||||
return cabin_air
|
||||
|
||||
/obj/mecha/proc/add_radio()
|
||||
@@ -302,9 +302,9 @@
|
||||
if(int_tank_air.return_pressure() > internal_tank.maximum_pressure && !(internal_damage & MECHA_INT_TANK_BREACH))
|
||||
setInternalDamage(MECHA_INT_TANK_BREACH)
|
||||
if(int_tank_air && int_tank_air.return_volume() > 0) //heat the air_contents
|
||||
int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15))
|
||||
int_tank_air.set_temperature(min(6000+T0C, int_tank_air.return_temperature()+rand(10,15)))
|
||||
if(cabin_air && cabin_air.return_volume()>0)
|
||||
cabin_air.temperature = min(6000+T0C, cabin_air.return_temperature()+rand(10,15))
|
||||
cabin_air.set_temperature(min(6000+T0C, cabin_air.return_temperature()+rand(10,15)))
|
||||
if(cabin_air.return_temperature() > max_temperature/2)
|
||||
take_damage(4/round(max_temperature/cabin_air.return_temperature(),0.1), BURN, 0, 0)
|
||||
|
||||
@@ -329,8 +329,8 @@
|
||||
|
||||
if(internal_temp_regulation)
|
||||
if(cabin_air && cabin_air.return_volume() > 0)
|
||||
var/delta = cabin_air.temperature - T20C
|
||||
cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1)))
|
||||
var/delta = cabin_air.return_temperature() - T20C
|
||||
cabin_air.set_temperature(cabin_air.return_temperature() - max(-10, min(10, round(delta/4,0.1))))
|
||||
|
||||
if(internal_tank)
|
||||
var/datum/gas_mixture/tank_air = internal_tank.return_air()
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
var/cell_charge = get_charge()
|
||||
var/datum/gas_mixture/int_tank_air = internal_tank.return_air()
|
||||
var/tank_pressure = internal_tank ? round(int_tank_air.return_pressure(),0.01) : "None"
|
||||
var/tank_temperature = internal_tank ? int_tank_air.temperature : "Unknown"
|
||||
var/tank_temperature = internal_tank ? int_tank_air.return_temperature() : "Unknown"
|
||||
var/cabin_pressure = round(return_pressure(),0.01)
|
||||
. = {"[report_internal_damage()]
|
||||
[integrity<30?"<span class='userdanger'>DAMAGE LEVEL CRITICAL</span><br>":null]
|
||||
|
||||
@@ -40,12 +40,11 @@
|
||||
if(hotspot && istype(T) && T.air)
|
||||
qdel(hotspot)
|
||||
var/datum/gas_mixture/G = T.air
|
||||
var/plas_amt = min(30,G.gases[/datum/gas/plasma]) //Absorb some plasma
|
||||
G.gases[/datum/gas/plasma] -= plas_amt
|
||||
var/plas_amt = min(30,G.get_moles(/datum/gas/plasma)) //Absorb some plasma
|
||||
G.adjust_moles(/datum/gas/plasma,-plas_amt)
|
||||
absorbed_plasma += plas_amt
|
||||
if(G.temperature > T20C)
|
||||
G.temperature = max(G.temperature/2,T20C)
|
||||
GAS_GARBAGE_COLLECT(G.gases)
|
||||
if(G.return_temperature() > T20C)
|
||||
G.set_temperature(max(G.return_temperature()/2,T20C))
|
||||
T.air_update_turf()
|
||||
|
||||
/obj/effect/particle_effect/foam/firefighting/kill_foam()
|
||||
@@ -317,15 +316,13 @@
|
||||
O.ClearWet()
|
||||
if(O.air)
|
||||
var/datum/gas_mixture/G = O.air
|
||||
G.temperature = 293.15
|
||||
G.set_temperature(293.15)
|
||||
for(var/obj/effect/hotspot/H in O)
|
||||
qdel(H)
|
||||
var/list/G_gases = G.gases
|
||||
for(var/I in G_gases)
|
||||
for(var/I in G.get_gases())
|
||||
if(I == /datum/gas/oxygen || I == /datum/gas/nitrogen)
|
||||
continue
|
||||
G_gases[I] = 0
|
||||
GAS_GARBAGE_COLLECT(G.gases)
|
||||
G.set_moles(I, 0)
|
||||
O.air_update_turf()
|
||||
for(var/obj/machinery/atmospherics/components/unary/U in O)
|
||||
if(!U.welded)
|
||||
|
||||
@@ -166,15 +166,13 @@
|
||||
if(T.air)
|
||||
var/datum/gas_mixture/G = T.air
|
||||
if(!distcheck || get_dist(T, location) < blast) // Otherwise we'll get silliness like people using Nanofrost to kill people through walls with cold air
|
||||
G.temperature = temperature
|
||||
G.set_temperature(temperature)
|
||||
T.air_update_turf()
|
||||
for(var/obj/effect/hotspot/H in T)
|
||||
qdel(H)
|
||||
var/list/G_gases = G.gases
|
||||
if(G_gases[/datum/gas/plasma])
|
||||
G_gases[/datum/gas/nitrogen] += (G_gases[/datum/gas/plasma])
|
||||
G_gases[/datum/gas/plasma] = 0
|
||||
GAS_GARBAGE_COLLECT(G.gases)
|
||||
if(G.get_moles(/datum/gas/plasma))
|
||||
G.adjust_moles(/datum/gas/nitrogen, G.get_moles(/datum/gas/plasma))
|
||||
G.set_moles(/datum/gas/plasma, 0)
|
||||
if (weldvents)
|
||||
for(var/obj/machinery/atmospherics/components/unary/U in T)
|
||||
if(!isnull(U.welded) && !U.welded) //must be an unwelded vent pump or vent scrubber.
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
var/obj/item/tank/internals/plasma/PT = new(V)
|
||||
var/obj/item/tank/internals/oxygen/OT = new(V)
|
||||
|
||||
PT.air_contents.gases[/datum/gas/plasma] = pressure_p*PT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_p))
|
||||
PT.air_contents.temperature = CELSIUS_TO_KELVIN(temp_p)
|
||||
PT.air_contents.set_moles(/datum/gas/plasma, pressure_p*PT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_p)))
|
||||
PT.air_contents.set_temperature(CELSIUS_TO_KELVIN(temp_p))
|
||||
|
||||
OT.air_contents.gases[/datum/gas/oxygen] = pressure_o*OT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_o))
|
||||
OT.air_contents.temperature = CELSIUS_TO_KELVIN(temp_o)
|
||||
OT.air_contents.set_moles(/datum/gas/oxygen, pressure_o*OT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_o)))
|
||||
OT.air_contents.set_temperature(CELSIUS_TO_KELVIN(temp_o))
|
||||
|
||||
V.tank_one = PT
|
||||
V.tank_two = OT
|
||||
|
||||
@@ -486,4 +486,15 @@
|
||||
addtimer(CALLBACK(src, .proc/end), 15)
|
||||
|
||||
/obj/effect/constructing_effect/proc/end()
|
||||
qdel(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/temp_visual/dir_setting/space_wind
|
||||
icon = 'icons/effects/atmospherics.dmi'
|
||||
icon_state = "space_wind"
|
||||
layer = FLY_LAYER
|
||||
duration = 20
|
||||
mouse_opacity = 0
|
||||
|
||||
/obj/effect/temp_visual/dir_setting/space_wind/Initialize(mapload, set_dir, set_alpha = 255)
|
||||
. = ..()
|
||||
alpha = set_alpha
|
||||
|
||||
@@ -246,9 +246,9 @@
|
||||
|
||||
/obj/effect/chrono_field/return_air() //we always have nominal air and temperature
|
||||
var/datum/gas_mixture/GM = new
|
||||
GM.gases[/datum/gas/oxygen] = MOLES_O2STANDARD
|
||||
GM.gases[/datum/gas/nitrogen] = MOLES_N2STANDARD
|
||||
GM.temperature = T20C
|
||||
GM.set_moles(/datum/gas/oxygen, MOLES_O2STANDARD)
|
||||
GM.set_moles(/datum/gas/nitrogen, MOLES_N2STANDARD)
|
||||
GM.set_temperature(T20C)
|
||||
return GM
|
||||
|
||||
/obj/effect/chrono_field/Move()
|
||||
|
||||
@@ -437,7 +437,6 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
dat += "Unable to obtain a reading.<br>"
|
||||
else
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
var/list/env_gases = environment.gases
|
||||
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles()
|
||||
@@ -445,12 +444,12 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
dat += "Air Pressure: [round(pressure,0.1)] kPa<br>"
|
||||
|
||||
if (total_moles)
|
||||
for(var/id in env_gases)
|
||||
var/gas_level = env_gases[id]/total_moles
|
||||
for(var/id in environment.get_gases())
|
||||
var/gas_level = environment.get_moles(id)/total_moles
|
||||
if(gas_level > 0)
|
||||
dat += "[GLOB.meta_gas_names[id]]: [round(gas_level*100, 0.01)]%<br>"
|
||||
|
||||
dat += "Temperature: [round(environment.temperature-T0C)]°C<br>"
|
||||
dat += "Temperature: [round(environment.return_temperature()-T0C)]°C<br>"
|
||||
dat += "<br>"
|
||||
else//Else it links to the cart menu proc. Although, it really uses menu hub 4--menu 4 doesn't really exist as it simply redirects to hub.
|
||||
dat += cartridge.generate_menu()
|
||||
|
||||
@@ -556,41 +556,38 @@ GENETICS SCANNER
|
||||
else
|
||||
to_chat(user, "<span class='alert'>Pressure: [round(pressure, 0.01)] kPa</span>")
|
||||
if(total_moles)
|
||||
var/list/env_gases = environment.gases
|
||||
|
||||
var/o2_concentration = env_gases[/datum/gas/oxygen]/total_moles
|
||||
var/n2_concentration = env_gases[/datum/gas/nitrogen]/total_moles
|
||||
var/co2_concentration = env_gases[/datum/gas/carbon_dioxide]/total_moles
|
||||
var/plasma_concentration = env_gases[/datum/gas/plasma]/total_moles
|
||||
var/o2_concentration = environment.get_moles(/datum/gas/oxygen)/total_moles
|
||||
var/n2_concentration = environment.get_moles(/datum/gas/nitrogen)/total_moles
|
||||
var/co2_concentration = environment.get_moles(/datum/gas/carbon_dioxide)/total_moles
|
||||
var/plasma_concentration = environment.get_moles(/datum/gas/plasma)/total_moles
|
||||
|
||||
if(abs(n2_concentration - N2STANDARD) < 20)
|
||||
to_chat(user, "<span class='info'>Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/nitrogen], 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='info'>Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/nitrogen), 0.01)] mol)</span>")
|
||||
else
|
||||
to_chat(user, "<span class='alert'>Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/nitrogen], 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='alert'>Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/nitrogen), 0.01)] mol)</span>")
|
||||
|
||||
if(abs(o2_concentration - O2STANDARD) < 2)
|
||||
to_chat(user, "<span class='info'>Oxygen: [round(o2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/oxygen], 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='info'>Oxygen: [round(o2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/oxygen), 0.01)] mol)</span>")
|
||||
else
|
||||
to_chat(user, "<span class='alert'>Oxygen: [round(o2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/oxygen], 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='alert'>Oxygen: [round(o2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/oxygen), 0.01)] mol)</span>")
|
||||
|
||||
if(co2_concentration > 0.01)
|
||||
to_chat(user, "<span class='alert'>CO2: [round(co2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/carbon_dioxide], 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='alert'>CO2: [round(co2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/carbon_dioxide), 0.01)] mol)</span>")
|
||||
else
|
||||
to_chat(user, "<span class='info'>CO2: [round(co2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/carbon_dioxide], 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='info'>CO2: [round(co2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/carbon_dioxide), 0.01)] mol)</span>")
|
||||
|
||||
if(plasma_concentration > 0.005)
|
||||
to_chat(user, "<span class='alert'>Plasma: [round(plasma_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/plasma], 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='alert'>Plasma: [round(plasma_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/plasma), 0.01)] mol)</span>")
|
||||
else
|
||||
to_chat(user, "<span class='info'>Plasma: [round(plasma_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/plasma], 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='info'>Plasma: [round(plasma_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/plasma), 0.01)] mol)</span>")
|
||||
|
||||
GAS_GARBAGE_COLLECT(environment.gases)
|
||||
|
||||
for(var/id in env_gases)
|
||||
for(var/id in environment.get_gases())
|
||||
if(id in GLOB.hardcoded_gases)
|
||||
continue
|
||||
var/gas_concentration = env_gases[id]/total_moles
|
||||
to_chat(user, "<span class='alert'>[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] % ([round(env_gases[id], 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='info'>Temperature: [round(environment.temperature-T0C, 0.01)] °C ([round(environment.temperature, 0.01)] K)</span>")
|
||||
var/gas_concentration = environment.get_moles(id)/total_moles
|
||||
to_chat(user, "<span class='alert'>[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] % ([round(environment.get_moles(id), 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='info'>Temperature: [round(environment.return_temperature()-T0C, 0.01)] °C ([round(environment.return_temperature(), 0.01)] K)</span>")
|
||||
|
||||
/obj/item/analyzer/AltClick(mob/user) //Barometer output for measuring when the next storm happens
|
||||
. = ..()
|
||||
@@ -669,8 +666,8 @@ GENETICS SCANNER
|
||||
|
||||
var/total_moles = air_contents.total_moles()
|
||||
var/pressure = air_contents.return_pressure()
|
||||
var/volume = air_contents.return_volume() //could just do mixture.volume... but safety, I guess?
|
||||
var/temperature = air_contents.temperature
|
||||
var/volume = air_contents.return_volume()
|
||||
var/temperature = air_contents.return_temperature()
|
||||
var/cached_scan_results = air_contents.analyzer_results
|
||||
|
||||
if(total_moles > 0)
|
||||
@@ -678,10 +675,9 @@ GENETICS SCANNER
|
||||
to_chat(user, "<span class='notice'>Volume: [volume] L</span>")
|
||||
to_chat(user, "<span class='notice'>Pressure: [round(pressure,0.01)] kPa</span>")
|
||||
|
||||
var/list/cached_gases = air_contents.gases
|
||||
for(var/id in cached_gases)
|
||||
var/gas_concentration = cached_gases[id]/total_moles
|
||||
to_chat(user, "<span class='notice'>[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] % ([round(cached_gases[id], 0.01)] mol)</span>")
|
||||
for(var/id in air_contents.get_gases())
|
||||
var/gas_concentration = air_contents.get_moles(id)/total_moles
|
||||
to_chat(user, "<span class='notice'>[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] % ([round(air_contents.get_moles(id), 0.01)] mol)</span>")
|
||||
to_chat(user, "<span class='notice'>Temperature: [round(temperature - T0C,0.01)] °C ([round(temperature, 0.01)] K)</span>")
|
||||
|
||||
else
|
||||
|
||||
@@ -168,8 +168,8 @@
|
||||
target_self = TRUE
|
||||
if(change_volume)
|
||||
if(!target_self)
|
||||
target.volume += tank_two.volume
|
||||
target.volume += tank_one.air_contents.volume
|
||||
target.set_volume(target.return_volume() + tank_two.volume)
|
||||
target.set_volume(target.return_volume() + tank_one.air_contents.return_volume())
|
||||
var/datum/gas_mixture/temp
|
||||
temp = tank_one.air_contents.remove_ratio(1)
|
||||
target.merge(temp)
|
||||
@@ -180,11 +180,11 @@
|
||||
/obj/item/transfer_valve/proc/split_gases()
|
||||
if (!valve_open || !tank_one || !tank_two)
|
||||
return
|
||||
var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume
|
||||
var/ratio1 = tank_one.air_contents.return_volume()/tank_two.air_contents.return_volume()
|
||||
var/datum/gas_mixture/temp
|
||||
temp = tank_two.air_contents.remove_ratio(ratio1)
|
||||
tank_one.air_contents.merge(temp)
|
||||
tank_two.air_contents.volume -= tank_one.air_contents.volume
|
||||
tank_two.air_contents.set_volume(tank_two.air_contents.return_volume() - tank_one.air_contents.return_volume())
|
||||
|
||||
/*
|
||||
Exadv1: I know this isn't how it's going to work, but this was just to check
|
||||
|
||||
@@ -204,11 +204,10 @@
|
||||
//TODO: DEFERRED Consider checking to make sure tank pressure is high enough before doing this...
|
||||
//Transfer 5% of current tank air contents to turf
|
||||
var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(release_amount)
|
||||
if(air_transfer.gases[/datum/gas/plasma])
|
||||
air_transfer.gases[/datum/gas/plasma] *= 5
|
||||
air_transfer.set_moles(/datum/gas/plasma, air_transfer.get_moles(/datum/gas/plasma) * 5)
|
||||
target.assume_air(air_transfer)
|
||||
//Burn it based on transfered gas
|
||||
target.hotspot_expose((ptank.air_contents.temperature*2) + 380,500)
|
||||
target.hotspot_expose((ptank.air_contents.return_temperature()*2) + 380,500)
|
||||
//location.hotspot_expose(1000,500,1)
|
||||
SSair.add_to_active(target, 0)
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
occupant_gas_supply = new
|
||||
if(isanimal(occupant))
|
||||
var/mob/living/simple_animal/animal = occupant
|
||||
occupant_gas_supply.temperature = animal.minbodytemp //simple animals only care about temperature when their turf isnt a location
|
||||
occupant_gas_supply.set_temperature(animal.minbodytemp) //simple animals only care about temperature when their turf isnt a location
|
||||
else
|
||||
if(ishuman(occupant)) //humans require resistance to cold/heat and living in no air while inside, and lose this when outside
|
||||
ADD_TRAIT(occupant, TRAIT_RESISTCOLD, "bluespace_container_cold_resist")
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/obj/item/tank/jetpack/populate_gas()
|
||||
if(gas_type)
|
||||
air_contents.gases[gas_type] = ((6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C))
|
||||
air_contents.set_moles(gas_type, ((6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C)))
|
||||
|
||||
|
||||
/obj/item/tank/jetpack/ui_action_click(mob/user, action)
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
force = 10
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
|
||||
/obj/item/tank/internals/oxygen/populate_gas()
|
||||
air_contents.gases[/datum/gas/oxygen] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.set_moles(/datum/gas/oxygen, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
return
|
||||
|
||||
|
||||
@@ -47,8 +48,9 @@
|
||||
force = 10
|
||||
|
||||
/obj/item/tank/internals/anesthetic/populate_gas()
|
||||
air_contents.gases[/datum/gas/oxygen] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
air_contents.gases[/datum/gas/nitrous_oxide] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
air_contents.set_moles(/datum/gas/oxygen, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD)
|
||||
air_contents.set_moles(/datum/gas/nitrous_oxide, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
|
||||
return
|
||||
|
||||
/*
|
||||
* Air
|
||||
@@ -62,8 +64,9 @@
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
/obj/item/tank/internals/air/populate_gas()
|
||||
air_contents.gases[/datum/gas/oxygen] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
air_contents.gases[/datum/gas/nitrogen] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
air_contents.set_moles(/datum/gas/oxygen, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD)
|
||||
air_contents.set_moles(/datum/gas/nitrogen, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
@@ -79,7 +82,8 @@
|
||||
|
||||
|
||||
/obj/item/tank/internals/plasma/populate_gas()
|
||||
air_contents.gases[/datum/gas/plasma] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.set_moles(/datum/gas/plasma, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
return
|
||||
|
||||
/obj/item/tank/internals/plasma/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/flamethrower))
|
||||
@@ -93,12 +97,16 @@
|
||||
F.update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/tank/internals/plasma/full/populate_gas()
|
||||
air_contents.set_moles(/datum/gas/plasma, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
|
||||
//Makes empty oxygen tanks spawn without gas
|
||||
/obj/item/tank/internals/plasma/empty/populate_gas()
|
||||
return
|
||||
|
||||
/obj/item/tank/internals/plasma/full/populate_gas()
|
||||
air_contents.gases[/datum/gas/plasma] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.set_moles(/datum/gas/plasma, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
|
||||
/*
|
||||
* Plasmaman Plasma Tank
|
||||
@@ -113,10 +121,11 @@
|
||||
distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
|
||||
|
||||
/obj/item/tank/internals/plasmaman/populate_gas()
|
||||
air_contents.gases[/datum/gas/plasma] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.set_moles(/datum/gas/plasma, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
return
|
||||
|
||||
/obj/item/tank/internals/plasmaman/full/populate_gas()
|
||||
air_contents.gases[/datum/gas/plasma] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.set_moles(/datum/gas/plasma, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
return
|
||||
|
||||
|
||||
@@ -129,7 +138,7 @@
|
||||
w_class = WEIGHT_CLASS_SMALL //thanks i forgot this
|
||||
|
||||
/obj/item/tank/internals/plasmaman/belt/full/populate_gas()
|
||||
air_contents.gases[/datum/gas/plasma] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.set_moles(/datum/gas/plasma, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
return
|
||||
|
||||
//makes empty plasma tanks spawn without gas.
|
||||
@@ -152,7 +161,7 @@
|
||||
|
||||
|
||||
/obj/item/tank/internals/emergency_oxygen/populate_gas()
|
||||
air_contents.gases[/datum/gas/oxygen] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.set_moles(/datum/gas/oxygen, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
return
|
||||
|
||||
/obj/item/tank/internals/emergency_oxygen/empty/populate_gas()
|
||||
@@ -172,4 +181,4 @@
|
||||
volume = 10
|
||||
|
||||
/obj/item/tank/internals/emergency_oxygen/double/empty/populate_gas()
|
||||
return
|
||||
return
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
. = ..()
|
||||
|
||||
air_contents = new(volume) //liters
|
||||
air_contents.temperature = T20C
|
||||
air_contents.set_temperature(T20C)
|
||||
|
||||
populate_gas()
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
. += "<span class='notice'>The pressure gauge reads [round(src.air_contents.return_pressure(),0.01)] kPa.</span>"
|
||||
|
||||
var/celsius_temperature = src.air_contents.temperature-T0C
|
||||
var/celsius_temperature = src.air_contents.return_temperature()-T0C
|
||||
var/descriptive
|
||||
|
||||
if (celsius_temperature < 20)
|
||||
@@ -235,7 +235,7 @@
|
||||
if(tank_pressure < distribute_pressure)
|
||||
distribute_pressure = tank_pressure
|
||||
|
||||
var/moles_needed = distribute_pressure*volume_to_return/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
var/moles_needed = distribute_pressure*volume_to_return/(R_IDEAL_GAS_EQUATION*air_contents.return_temperature())
|
||||
|
||||
return remove_air(moles_needed)
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
alpha = 150
|
||||
resistance_flags = FIRE_PROOF
|
||||
|
||||
/obj/structure/holosign/barrier/firelock/blocksTemperature()
|
||||
/obj/structure/holosign/barrier/firelock/BlockSuperconductivity()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/holosign/barrier/combifan
|
||||
@@ -110,7 +110,7 @@
|
||||
CanAtmosPass = ATMOS_PASS_NO
|
||||
resistance_flags = FIRE_PROOF
|
||||
|
||||
/obj/structure/holosign/barrier/combifan/blocksTemperature()
|
||||
/obj/structure/holosign/barrier/combifan/BlockSuperconductivity()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/holosign/barrier/combifan/Initialize()
|
||||
|
||||
@@ -152,8 +152,8 @@
|
||||
pod_moving = 0
|
||||
if(!QDELETED(pod))
|
||||
var/datum/gas_mixture/floor_mixture = loc.return_air()
|
||||
ARCHIVE(floor_mixture)
|
||||
ARCHIVE(pod.air_contents)
|
||||
floor_mixture.archive()
|
||||
pod.air_contents.archive()
|
||||
pod.air_contents.share(floor_mixture, 1) //mix the pod's gas mixture with the tile it's on
|
||||
air_update_turf()
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
/obj/structure/transit_tube_pod/Initialize()
|
||||
. = ..()
|
||||
air_contents.gases[/datum/gas/oxygen] = MOLES_O2STANDARD
|
||||
air_contents.gases[/datum/gas/nitrogen] = MOLES_N2STANDARD
|
||||
air_contents.temperature = T20C
|
||||
air_contents.set_moles(/datum/gas/oxygen, MOLES_O2STANDARD)
|
||||
air_contents.set_moles(/datum/gas/nitrogen, MOLES_N2STANDARD)
|
||||
air_contents.set_temperature(T20C)
|
||||
|
||||
|
||||
/obj/structure/transit_tube_pod/Destroy()
|
||||
@@ -181,4 +181,4 @@
|
||||
return
|
||||
|
||||
/obj/structure/transit_tube_pod/return_temperature()
|
||||
return air_contents.temperature
|
||||
return air_contents.return_temperature()
|
||||
|
||||
@@ -148,6 +148,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
. = ..()
|
||||
if (!.) // changeturf failed or didn't do anything
|
||||
QDEL_NULL(stashed_air)
|
||||
update_air_ref()
|
||||
return
|
||||
var/turf/open/newTurf = .
|
||||
newTurf.air.copy_from(stashed_air)
|
||||
@@ -308,24 +309,14 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/total = new//Holders to assimilate air from nearby turfs
|
||||
var/list/total_gases = total.gases
|
||||
|
||||
for(var/T in atmos_adjacent_turfs)
|
||||
var/turf/open/S = T
|
||||
if(!S.air)
|
||||
continue
|
||||
var/list/S_gases = S.air.gases
|
||||
for(var/id in S_gases)
|
||||
total_gases[id] += S_gases[id]
|
||||
total.temperature += S.air.temperature
|
||||
total.merge(S.air)
|
||||
|
||||
air.copy_from(total)
|
||||
|
||||
var/list/air_gases = air.gases
|
||||
for(var/id in air_gases)
|
||||
air_gases[id] /= turf_count //Averages contents of the turfs, ignoring walls and the like
|
||||
|
||||
air.temperature /= turf_count
|
||||
air.copy_from(total.remove_ratio(1/turf_count))
|
||||
SSair.add_to_active(src)
|
||||
|
||||
/turf/proc/ReplaceWithLattice()
|
||||
|
||||
@@ -7,9 +7,14 @@
|
||||
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
|
||||
rad_insulation = RAD_MEDIUM_INSULATION
|
||||
|
||||
/turf/closed/Initialize()
|
||||
. = ..()
|
||||
update_air_ref()
|
||||
|
||||
/turf/closed/AfterChange()
|
||||
. = ..()
|
||||
SSair.high_pressure_delta -= src
|
||||
update_air_ref()
|
||||
|
||||
/turf/closed/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
|
||||
return FALSE
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
flash_color(L, flash_color = "#C80000", flash_time = 10)
|
||||
|
||||
/turf/open/Initalize_Atmos(times_fired)
|
||||
excited = 0
|
||||
set_excited(FALSE)
|
||||
update_visuals()
|
||||
|
||||
current_cycle = times_fired
|
||||
@@ -207,19 +207,19 @@
|
||||
for(var/i in atmos_adjacent_turfs)
|
||||
var/turf/open/enemy_tile = i
|
||||
var/datum/gas_mixture/enemy_air = enemy_tile.return_air()
|
||||
if(!excited && air.compare(enemy_air))
|
||||
if(!get_excited() && air.compare(enemy_air))
|
||||
//testing("Active turf found. Return value of compare(): [is_active]")
|
||||
excited = TRUE
|
||||
set_excited(TRUE)
|
||||
SSair.active_turfs |= src
|
||||
|
||||
/turf/open/proc/GetHeatCapacity()
|
||||
. = air.heat_capacity()
|
||||
|
||||
/turf/open/proc/GetTemperature()
|
||||
. = air.temperature
|
||||
. = air.return_temperature()
|
||||
|
||||
/turf/open/proc/TakeTemperature(temp)
|
||||
air.temperature += temp
|
||||
air.set_temperature(air.return_temperature() + temp)
|
||||
air_update_turf()
|
||||
|
||||
/turf/open/proc/freon_gas_act()
|
||||
@@ -304,9 +304,8 @@
|
||||
|
||||
/turf/open/rad_act(pulse_strength)
|
||||
. = ..()
|
||||
if (air.gases[/datum/gas/carbon_dioxide] && air.gases[/datum/gas/oxygen])
|
||||
pulse_strength = min(pulse_strength,air.gases[/datum/gas/carbon_dioxide]*1000,air.gases[/datum/gas/oxygen]*2000) //Ensures matter is conserved properly
|
||||
air.gases[/datum/gas/carbon_dioxide]=max(air.gases[/datum/gas/carbon_dioxide]-(pulse_strength/1000),0)
|
||||
air.gases[/datum/gas/oxygen]=max(air.gases[/datum/gas/oxygen]-(pulse_strength/2000),0)
|
||||
air.gases[/datum/gas/pluoxium]+=(pulse_strength/4000)
|
||||
GAS_GARBAGE_COLLECT(air.gases)
|
||||
if (air.get_moles(/datum/gas/carbon_dioxide) && air.get_moles(/datum/gas/oxygen))
|
||||
pulse_strength = min(pulse_strength,air.get_moles(/datum/gas/carbon_dioxide)*1000,air.get_moles(/datum/gas/oxygen)*2000) //Ensures matter is conserved properly
|
||||
air.set_moles(/datum/gas/carbon_dioxide, max(air.get_moles(/datum/gas/carbon_dioxide)-(pulse_strength/1000),0))
|
||||
air.set_moles(/datum/gas/oxygen, max(air.get_moles(/datum/gas/oxygen)-(pulse_strength/2000),0))
|
||||
air.adjust_moles(/datum/gas/pluoxium, pulse_strength/4000)
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
/turf/open/space/Initialize()
|
||||
icon_state = SPACE_ICON_STATE
|
||||
air = space_gas
|
||||
update_air_ref()
|
||||
vis_contents.Cut() //removes inherited overlays
|
||||
visibilityChanged()
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
/turf/open/Entered(atom/movable/AM)
|
||||
..()
|
||||
//melting
|
||||
if(isobj(AM) && air && air.temperature > T0C)
|
||||
if(isobj(AM) && air && air.return_temperature() > T0C)
|
||||
var/obj/O = AM
|
||||
if(O.obj_flags & FROZEN)
|
||||
O.make_unfrozen()
|
||||
|
||||
@@ -9,9 +9,8 @@ GLOBAL_LIST(topic_status_cache)
|
||||
//This happens after the Master subsystem new(s) (it's a global datum)
|
||||
//So subsystems globals exist, but are not initialised
|
||||
/world/New()
|
||||
var/extools = world.GetConfig("env", "EXTOOLS_DLL") || "./byond-extools.dll"
|
||||
if (fexists(extools))
|
||||
call(extools, "maptick_initialize")()
|
||||
if (fexists(EXTOOLS))
|
||||
call(EXTOOLS, "maptick_initialize")()
|
||||
enable_debugger()
|
||||
|
||||
world.Profile(PROFILE_START)
|
||||
@@ -276,6 +275,15 @@ GLOBAL_LIST(topic_status_cache)
|
||||
shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
|
||||
..()
|
||||
|
||||
/world/Del()
|
||||
// memory leaks bad
|
||||
var/num_deleted = 0
|
||||
for(var/datum/gas_mixture/GM)
|
||||
GM.__gasmixture_unregister()
|
||||
num_deleted++
|
||||
log_world("Deallocated [num_deleted] gas mixtures")
|
||||
..()
|
||||
|
||||
/world/proc/update_status()
|
||||
|
||||
var/list/features = list()
|
||||
@@ -344,3 +352,6 @@ GLOBAL_LIST(topic_status_cache)
|
||||
maxz++
|
||||
SSmobs.MaxZChanged()
|
||||
SSidlenpcpool.MaxZChanged()
|
||||
world.refresh_atmos_grid()
|
||||
|
||||
/world/proc/refresh_atmos_grid()
|
||||
|
||||
Reference in New Issue
Block a user