monstermos wow
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -16,6 +16,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
|
||||
var/operating = FALSE
|
||||
@@ -160,7 +161,7 @@
|
||||
open()
|
||||
else
|
||||
close()
|
||||
return
|
||||
return TRUE
|
||||
if(density)
|
||||
do_animate("deny")
|
||||
|
||||
@@ -180,11 +181,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/twohanded/fireaxe)))
|
||||
if(user.a_intent != INTENT_HARM && (I.tool_behaviour == TOOL_CROWBAR || istype(I, /obj/item/twohanded/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)
|
||||
@@ -292,6 +318,8 @@
|
||||
layer = closingLayer
|
||||
if(!safe)
|
||||
crush()
|
||||
if(air_tight)
|
||||
density = TRUE
|
||||
sleep(5)
|
||||
density = TRUE
|
||||
sleep(5)
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
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
|
||||
var/emergency_close_timer = 0
|
||||
var/nextstate = null
|
||||
var/boltslocked = TRUE
|
||||
var/list/affecting_areas
|
||||
@@ -100,7 +101,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 +115,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,6 +141,17 @@
|
||||
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()
|
||||
@@ -194,6 +206,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 +294,30 @@
|
||||
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/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return TRUE
|
||||
@@ -293,7 +384,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>")
|
||||
@@ -307,7 +398,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
|
||||
@@ -349,7 +440,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>")
|
||||
@@ -363,7 +454,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>")
|
||||
@@ -378,7 +469,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))
|
||||
@@ -400,7 +491,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>")
|
||||
@@ -409,7 +500,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>", \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -142,6 +142,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)
|
||||
|
||||
@@ -6,9 +6,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,9 +207,9 @@
|
||||
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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -262,6 +262,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()
|
||||
@@ -330,3 +339,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