Skip to content

Commit

Permalink
fans
Browse files Browse the repository at this point in the history
  • Loading branch information
Moltijoe committed Apr 10, 2024
1 parent 8dcbcb8 commit 6662dc5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 14 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/maps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Always compile, always use that verb, and always make sure that it works for wha
ZTRAIT_GRAVITY = TRUE, \
ZTRAIT_NOPHASE = TRUE, \
ZTRAIT_NOXRAY = TRUE, \
ZTRAIT_BOMBCAP_MULTIPLIER = 0.5, \
ZTRAIT_BASETURF = /turf/open/floor/plating/backrooms)

///Z level traits for Away Missions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
///If it spawns firedoors to ensure mass spacing doesn't happen
#define ATMOS_CONTROL_FIREDOORS "spawn_firedoors"
///If it spawns atmos fans to ensure mass spacing doesn't happen
#define ATMOS_CONTROL_FANS "spawn_fans"

/datum/map_generator/dungeon_generator/maintenance
weighted_open_turf_types = list(
/turf/open/floor/plating = 10,
Expand All @@ -8,27 +13,38 @@
room_theme_path = /datum/dungeon_room_theme/maintenance

///Boolean, whether or not firelocks are added to the maintenance
var/include_firelocks = TRUE
var/atmos_control = ATMOS_CONTROL_FIREDOORS
///Boolean, wether or not apcs are added to the maintenance
var/include_apcs = TRUE

//var/list/used_spawn_points = list()

/datum/map_generator/dungeon_generator/maintenance/build_dungeon()
. = ..()
if(include_firelocks)
add_firelocks()
if(atmos_control)
add_atmos_control()
if(include_apcs)
add_apcs()
wire_apcs()
add_maint_loot()

/datum/map_generator/dungeon_generator/maintenance/proc/add_firelocks()
/datum/map_generator/dungeon_generator/maintenance/proc/add_atmos_control()
///we only want to look to place firedoors every 5 tiles, so we don't place too many
var/step_increment = 5
var/consecutive_firedoor_limit = 3
var/list/fire_door_spawn_points = list()
var/fire_doors_path = /obj/effect/mapping_helpers/firedoor_border_spawner

var/fire_doors_path
switch(atmos_control)
if(ATMOS_CONTROL_FANS)
fire_doors_path = /obj/structure/fans/tiny/indestructible
if(ATMOS_CONTROL_FIREDOORS)
fire_doors_path = /obj/effect/mapping_helpers/firedoor_border_spawner

if(!fire_doors_path)
return

//spawn vertical lines of atmos control
for(var/y in min_y to max_y step step_increment)
fire_door_spawn_points = list()
for(var/turf/current_turf in block(locate(min_x,y,z_level),locate(max_x,y,z_level)))
Expand All @@ -41,7 +57,10 @@
if(fire_door_spawn_points.len > consecutive_firedoor_limit && current_turf.is_blocked_turf(TRUE))
fire_door_spawn_points = list()

fire_doors_path = /obj/effect/mapping_helpers/firedoor_border_spawner/horizontal
if(atmos_control == ATMOS_CONTROL_FIREDOORS)
fire_doors_path = /obj/effect/mapping_helpers/firedoor_border_spawner/horizontal

//spawn horizontal lines of atmos control
for(var/x in min_x to max_x step step_increment)
fire_door_spawn_points = list()
for(var/turf/current_turf in block(locate(x,min_y,z_level),locate(x,max_y,z_level)))
Expand Down Expand Up @@ -277,17 +296,15 @@
//since there are no firelocks, the place needs to be hard to space and replenish air automatically
weighted_open_turf_types = list(
/turf/open/floor/plating/backrooms = 10,
/turf/open/floor/plating/rust/backrooms = 1,
/turf/open/floor/plating/rust = 1,
)

//removes firelocks and apcs as the area is large enough that it annihilates the server if it has a bunch of firelocks
include_firelocks = FALSE
atmos_control = ATMOS_CONTROL_FANS
include_apcs = FALSE

/turf/open/floor/plating/rust/backrooms
baseturfs = /turf/open/floor/plating/backrooms
planetary_atmos = TRUE // prevent spacing backrooms

/turf/open/floor/plating/backrooms
baseturfs = /turf/open/floor/plating/backrooms
planetary_atmos = TRUE // prevent spacing backrooms
baseturfs = /turf/open/floor/plating/backrooms

#undef ATMOS_CONTROL_FIREDOORS
#undef ATMOS_CONTROL_FANS
4 changes: 4 additions & 0 deletions code/modules/mining/equipment/survival_pod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@
. = ..()
air_update_turf()

//Visible, indestructible fans
/obj/structure/fans/tiny/indestructible
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF

//Inivisible, indestructible fans
/obj/structure/fans/tiny/invisible
name = "air flow blocker"
Expand Down

0 comments on commit 6662dc5

Please sign in to comment.