Connect air alarm to air sensor (#75187)

## About The Pull Request

To control vents and scrubbers in ordinance, burn and engine chambers,
mappers extend the area outside of the walls towards a tile where they
place the air alarm.

With this PR, they can now assign `chamber_id` to an air alarm and
connect to the chamber with an air sensor. There is a new map helper for
this.

Also, this connection can be done manually. You need to click on a
sensor with a multi-tool, then unlock certain air alarm, and click with
a multi-tool on it. This action will link sensor to an air alarm,
reporting gas mixture from the sensor tile and giving control over the
vents and scrubbers of the sensor's area.

### TLDR

Before:
<img width="718" alt="ordnance_before"
src="https://user-images.githubusercontent.com/3625094/236577769-5d79871f-2dce-43be-a20a-e6669bfbc1c6.PNG">

After: 
<img width="638" alt="ordnance_after"
src="https://user-images.githubusercontent.com/3625094/236577786-3c7e9c9f-1501-4747-bbe1-292fc4947b0d.PNG">

This is how the area is setup on meta station right now vs if it was
setup with a link

![image](https://user-images.githubusercontent.com/3625094/236578327-531cfb6f-e0ac-4c03-927f-f5b05b9c74ab.png)

This is also true for the supermatter chamber - you can make the air
alarm display the gas mix in the actual chamber and avoid using mapping
area hack there too.
<img width="954" alt="supermatter_after"
src="https://user-images.githubusercontent.com/3625094/236578528-4650b426-6bf0-4634-a5b0-cad7a50d5b01.PNG">

## Why It's Good For The Game

The area hack is no longer needed and you can place air alarm to control
certain remote area wherever you want when you design a map. Even 3 air
alarms next to each other controlling 3 different burn chambers.

The air alarm will also report the gas mix on the actual tile of a
sensor, instead of the gas mix before the air alarm, which is usually a
normal habitable environment.

Also, now you can build such chambers manually because there are no
precise area editing tools available in-game to repeat the area hack.

## Changelog

🆑
add: Air alarms can be connected to an area remotely via air sensor with
multi-tool and corresponding access
qol: Mapping: Added air alarm helper to link air alarm with certain
chamber_id on map load
/🆑
This commit is contained in:
Andrew
2023-05-15 20:10:08 -06:00
committed by GitHub
parent dc0a1e65e4
commit 4b01dbe5d4
7 changed files with 123 additions and 17 deletions
+24 -1
View File
@@ -253,7 +253,7 @@
//air alarm helpers
/obj/effect/mapping_helpers/airalarm
desc = "You shouldn't see this. Report it please."
layer = DOOR_HELPER_LAYER
layer = ABOVE_OBJ_LAYER
late = TRUE
/obj/effect/mapping_helpers/airalarm/Initialize(mapload)
@@ -301,6 +301,9 @@
if(target.syndicate_access + target.away_general_access + target.engine_access + target.mixingchamber_access + target.all_access > 1)
CRASH("Tried to combine incompatible air alarm access helpers!")
if(target.air_sensor_chamber_id)
target.setup_chamber_link()
target.update_appearance()
qdel(src)
@@ -387,6 +390,26 @@
log_mapping("[src] at [AREACOORD(src)] [(area.type)] tried to adjust [target]'s tlv to no_checks but it's already changed!")
target.tlv_no_checks = TRUE
/obj/effect/mapping_helpers/airalarm/link
name = "airalarm link helper"
icon_state = "airalarm_link_helper"
var/chamber_id = ""
var/allow_link_change = FALSE
/obj/effect/mapping_helpers/airalarm/link/Initialize(mapload)
. = ..()
if(!mapload)
log_mapping("[src] spawned outside of mapload!")
return INITIALIZE_HINT_QDEL
var/obj/machinery/airalarm/alarm = locate(/obj/machinery/airalarm) in loc
if(!isnull(alarm))
alarm.air_sensor_chamber_id = chamber_id
alarm.allow_link_change = allow_link_change
else
log_mapping("[src] failed to find air alarm at [AREACOORD(src)].")
return INITIALIZE_HINT_QDEL
//apc helpers
/obj/effect/mapping_helpers/apc
desc = "You shouldn't see this. Report it please."