mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
[READY] Atmos Refactor Part 7 (I think) - Kills signals + TGUIs stuff (#19867)
* I AM NOT A KING. I AM NOT A GOD. I AM LUNACY. * THE SCOPE CREEP * This was done in vi. No langserver. Send help. * Progress * Some issues fixed * The code builds, but the maps dont * CC builds, I doubt anything else does * Do this now * Safety * The map compiles * THE MAPPING HELL * Airlock controllers dont work * Fixed bombs * AND THATS FIXED * Phantom edit * Restores LL I think * The mapmerge hooks are actually retarded * Fixes spawners * Half working air control * Picky * Hyper efficient tank monitor * Sanity * Laying the framework * Improved alert console * Dont think this is actually done anywhere * Metering * ONE HUNDRED AND ~~EIGHTY~~ TWENTY SEVEN * WE ARE READY FOR BOX TO BUILD * One map done * Well that was easy * Another one * I think this is done * I should have removed this * I would make a russian joke but <current event> * Delta WIP * Makes delta work * Early review * TM safeguard * oops * METAAAAAAAAAAAAAAAAAAAAAAAAA * Fix #4213 * Trailing * oh for piss sake * Shutter fix * Roundstart ATs can go away * Review pass 1 * What could go wrong * BOOM BOOM BOOM * Not needed * Fix seed vault * Oops * Review changes
This commit is contained in:
@@ -11,10 +11,11 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
#define DOOR_NORMAL_PLACEMENT 1
|
||||
#define DOOR_FLIPPED_PLACEMENT 2
|
||||
|
||||
#define AIRPUMP_TAG "[id_to_link]_pump"
|
||||
#define SENSOR_TAG "[id_to_link]_sensor"
|
||||
#define OUTER_DOOR_TAG "[id_to_link]_outer"
|
||||
#define INNER_DOOR_TAG "[id_to_link]_inner"
|
||||
#define VENT_ID "[id_to_link]_vent"
|
||||
#define EXT_DOOR_ID "[id_to_link]_door_ext"
|
||||
#define INT_DOOR_ID "[id_to_link]_door_int"
|
||||
#define EXT_BTN_ID "[id_to_link]_btn_ext"
|
||||
#define INT_BTN_ID "[id_to_link]_btn_int"
|
||||
|
||||
/obj/effect/spawner/airlock
|
||||
name = "1 by 1 airlock spawner (interior north, exterior south)"
|
||||
@@ -32,7 +33,6 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
var/tiles_in_x_direction = 1
|
||||
var/tiles_in_y_direction = 1
|
||||
var/id_to_link
|
||||
var/radio_frequency = 1379
|
||||
req_access_txt = ACCESS_EXTERNAL_AIRLOCKS //If req_one_access_txt is set, this is ignored
|
||||
var/door_name = "external access"
|
||||
var/door_type = /obj/machinery/door/airlock/external/glass
|
||||
@@ -52,11 +52,13 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
id_to_link = "[UID()]" //We want unique IDs, this will give us a unique ID
|
||||
var/turf/turf_interior = get_airlock_location(interior_direction)
|
||||
var/turf/turf_exterior = get_airlock_location(exterior_direction)
|
||||
|
||||
handle_door_creation(turf_interior, TRUE, one_door_interior)
|
||||
handle_door_creation(turf_exterior, FALSE, one_door_exterior)
|
||||
handle_pipes_creation(turf_interior)
|
||||
handle_control_placement()
|
||||
qdel(src)
|
||||
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
/obj/effect/spawner/airlock/proc/get_airlock_location(desired_direction) //Finds a turf to place an airlock and returns it, this turf will be in the middle of the relevant wall
|
||||
var/turf/T
|
||||
@@ -76,7 +78,7 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
if(one_door_only != DOOR_FLIPPED_PLACEMENT)
|
||||
A = new door_type(T)
|
||||
handle_door_stuff(A, is_this_an_interior_airlock)
|
||||
var/obj/machinery/access_button/the_button = spawn_button(T, is_this_an_interior_airlock ? interior_direction : exterior_direction)
|
||||
var/obj/machinery/access_button/the_button = spawn_button(T, is_this_an_interior_airlock ? interior_direction : exterior_direction, is_this_an_interior_airlock)
|
||||
if(one_door_only == DOOR_NORMAL_PLACEMENT) //We only need one door, we are done
|
||||
return
|
||||
if(!(tiles_in_x_direction % 2) && (is_this_an_interior_airlock && north_or_south_interior || !is_this_an_interior_airlock && north_or_south_exterior)) //Handle extra airlock for aesthetics
|
||||
@@ -89,20 +91,20 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
handle_door_stuff(A, is_this_an_interior_airlock)
|
||||
if(one_door_only == DOOR_FLIPPED_PLACEMENT)
|
||||
the_button.forceMove(get_step(the_button, NORTH))
|
||||
if(!one_door_only)
|
||||
the_button.command = "[is_this_an_interior_airlock ? "cycle_interior" : "cycle_exterior"]"
|
||||
|
||||
/obj/effect/spawner/airlock/proc/handle_door_stuff(obj/machinery/door/airlock/A, is_this_an_interior_airlock) //This sets up the door vars correctly and then locks it before first use
|
||||
A.set_frequency(radio_frequency)
|
||||
A.id_tag = is_this_an_interior_airlock ? INNER_DOOR_TAG : OUTER_DOOR_TAG
|
||||
A.id_tag = is_this_an_interior_airlock ? INT_DOOR_ID : EXT_DOOR_ID
|
||||
set_access_helper(A)
|
||||
A.name = door_name
|
||||
A.lock()
|
||||
|
||||
/obj/effect/spawner/airlock/proc/spawn_button(turf/T, some_direction)
|
||||
/obj/effect/spawner/airlock/proc/spawn_button(turf/T, some_direction, interior)
|
||||
var/obj/machinery/access_button/the_button = new(T)
|
||||
the_button.master_tag = id_to_link
|
||||
the_button.set_frequency(radio_frequency)
|
||||
if(interior)
|
||||
the_button.autolink_id = INT_BTN_ID
|
||||
else
|
||||
the_button.autolink_id = EXT_BTN_ID
|
||||
|
||||
switch(some_direction)
|
||||
if(NORTH)
|
||||
the_button.pixel_x -= 25
|
||||
@@ -119,31 +121,26 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
set_access_helper(the_button)
|
||||
return the_button
|
||||
|
||||
/obj/effect/spawner/airlock/proc/handle_control_placement() //Stick the sensor and controller on the same bit of wall, this will ONLY be unsuitable if airlocks are on both the south and west turfs
|
||||
/obj/effect/spawner/airlock/proc/handle_control_placement() //Stick the controller on the wall, this will ONLY be unsuitable if airlocks are on both the south and west turfs
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/machinery/airlock_sensor/AS = new(T)
|
||||
var/obj/machinery/embedded_controller/radio/airlock/airlock_controller/AC = new(T, id_to_link, radio_frequency, OUTER_DOOR_TAG, INNER_DOOR_TAG, AIRPUMP_TAG, SENSOR_TAG)
|
||||
var/obj/machinery/airlock_controller/air_cycler/AC = new(T)
|
||||
set_access_helper(AC)
|
||||
AS.id_tag = SENSOR_TAG
|
||||
AS.set_frequency(radio_frequency)
|
||||
if(interior_direction != WEST && exterior_direction != WEST) //If west wall is free, place stuff there
|
||||
AC.vent_link_id = VENT_ID
|
||||
AC.int_door_link_id = INT_DOOR_ID
|
||||
AC.ext_door_link_id = EXT_DOOR_ID
|
||||
AC.int_button_link_id = INT_BTN_ID
|
||||
AC.ext_button_link_id = EXT_BTN_ID
|
||||
if(interior_direction != WEST && exterior_direction != WEST) //If west wall is free, place it there
|
||||
AC.pixel_x -= 25
|
||||
AC.pixel_y += 9
|
||||
AS.pixel_x -= 25
|
||||
AS.pixel_y -= 9
|
||||
else if(interior_direction != SOUTH && exterior_direction != SOUTH) //If south wall is free, place stuff there
|
||||
else if(interior_direction != SOUTH && exterior_direction != SOUTH) //If south wall is free, place it there
|
||||
AC.pixel_x += 9
|
||||
AC.pixel_y -= 25
|
||||
AS.pixel_x -= 9
|
||||
AS.pixel_y -= 25
|
||||
else //Send them over to the other side of the chamber
|
||||
else //Send it over to the other side of the chamber
|
||||
T = locate(x + tiles_in_x_direction - 1, y + tiles_in_y_direction - 1, z)
|
||||
AC.forceMove(T)
|
||||
AS.forceMove(T)
|
||||
AC.pixel_x += 25
|
||||
AC.pixel_y += 9
|
||||
AS.pixel_x += 25
|
||||
AS.pixel_y -= 9
|
||||
|
||||
/obj/effect/spawner/airlock/proc/handle_pipes_creation(turf/T) //This places all required piping down, then properly initializes it. T is the turf that the interior airlock occupies
|
||||
var/turf/below_T = get_step(T, opposite_interior_direction)
|
||||
@@ -198,8 +195,7 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
A.on_construction(A.dir, initialization_directions ? initialization_directions : A.dir)
|
||||
if(istype(A, /obj/machinery/atmospherics/unary/vent_pump/high_volume))
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/high_volume/created_pump = A
|
||||
created_pump.id_tag = AIRPUMP_TAG
|
||||
created_pump.set_frequency(radio_frequency)
|
||||
created_pump.autolink_id = VENT_ID
|
||||
|
||||
/obj/effect/spawner/airlock/proc/set_access_helper(obj/I)
|
||||
if(req_one_access_txt == "0")
|
||||
@@ -346,7 +342,8 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
#undef CHAMBER_BIGGER
|
||||
#undef DOOR_NORMAL_PLACEMENT
|
||||
#undef DOOR_FLIPPED_PLACEMENT
|
||||
#undef AIRPUMP_TAG
|
||||
#undef SENSOR_TAG
|
||||
#undef OUTER_DOOR_TAG
|
||||
#undef INNER_DOOR_TAG
|
||||
#undef VENT_ID
|
||||
#undef EXT_DOOR_ID
|
||||
#undef INT_DOOR_ID
|
||||
#undef EXT_BTN_ID
|
||||
#undef INT_BTN_ID
|
||||
|
||||
@@ -84,7 +84,6 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
|
||||
/obj/item/radio/New()
|
||||
..()
|
||||
wires = new(src)
|
||||
|
||||
@@ -25,12 +25,10 @@
|
||||
toolspeed = 1
|
||||
tool_behaviour = TOOL_MULTITOOL
|
||||
hitsound = 'sound/weapons/tap.ogg'
|
||||
var/obj/machinery/buffer // simple machine buffer for device linkage
|
||||
|
||||
/obj/item/multitool/proc/IsBufferA(typepath)
|
||||
if(!buffer)
|
||||
return 0
|
||||
return istype(buffer,typepath)
|
||||
/// Reference to whatever machine is held in the buffer
|
||||
var/obj/machinery/buffer // TODO - Make this a soft ref to tie into whats below
|
||||
/// Soft-ref for linked stuff. This should be used over the above var.
|
||||
var/buffer_uid
|
||||
|
||||
/obj/item/multitool/multitool_check_buffer(user, silent = FALSE)
|
||||
return TRUE
|
||||
@@ -56,8 +54,8 @@
|
||||
var/rangewarning = 20 //Glows yellow when inside
|
||||
origin_tech = "magnets=1;engineering=2;syndicate=1"
|
||||
|
||||
/obj/item/multitool/ai_detect/New()
|
||||
..()
|
||||
/obj/item/multitool/ai_detect/Initialize(mapload)
|
||||
. = ..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/multitool/ai_detect/Destroy()
|
||||
|
||||
@@ -243,6 +243,7 @@
|
||||
return 0
|
||||
|
||||
/obj/structure/chrono_field/return_air() //we always have nominal air and temperature
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
var/datum/gas_mixture/GM = new
|
||||
GM.oxygen = MOLES_O2STANDARD
|
||||
GM.nitrogen = MOLES_N2STANDARD
|
||||
|
||||
@@ -44,10 +44,6 @@
|
||||
return
|
||||
..()
|
||||
|
||||
//assembly stuff
|
||||
/obj/item/grenade/plastic/receive_signal()
|
||||
prime()
|
||||
|
||||
/obj/item/grenade/plastic/Crossed(atom/movable/AM, oldloc)
|
||||
if(nadeassembly)
|
||||
nadeassembly.Crossed(AM, oldloc)
|
||||
|
||||
@@ -229,10 +229,6 @@
|
||||
to_chat(user, "<span class='notice'>You need to add an activation mechanism.</span>")
|
||||
return TRUE
|
||||
|
||||
//assembly stuff
|
||||
/obj/item/grenade/chem_grenade/receive_signal()
|
||||
prime()
|
||||
|
||||
/obj/item/grenade/chem_grenade/HasProximity(atom/movable/AM)
|
||||
if(nadeassembly)
|
||||
nadeassembly.HasProximity(AM)
|
||||
|
||||
@@ -209,6 +209,7 @@
|
||||
return air_contents.remove(amount)
|
||||
|
||||
/obj/item/tank/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
return air_contents
|
||||
|
||||
/obj/item/tank/assume_air(datum/gas_mixture/giver)
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
var/can_be_hit = TRUE //can this be bludgeoned by items?
|
||||
|
||||
var/Mtoollink = FALSE // variable to decide if an object should show the multitool menu linking menu, not all objects use it
|
||||
|
||||
var/being_shocked = FALSE
|
||||
var/speed_process = FALSE
|
||||
|
||||
@@ -112,6 +110,7 @@
|
||||
return null
|
||||
|
||||
/obj/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
if(loc)
|
||||
return loc.return_air()
|
||||
else
|
||||
@@ -201,87 +200,7 @@
|
||||
return
|
||||
|
||||
/obj/proc/hear_message(mob/M, text)
|
||||
|
||||
/obj/proc/multitool_menu(mob/user, obj/item/multitool/P)
|
||||
return "<b>NO MULTITOOL_MENU!</b>"
|
||||
|
||||
/obj/proc/linkWith(mob/user, obj/buffer, context)
|
||||
return FALSE
|
||||
|
||||
/obj/proc/unlinkFrom(mob/user, obj/buffer)
|
||||
return FALSE
|
||||
|
||||
/obj/proc/canLink(obj/O, list/context)
|
||||
return FALSE
|
||||
|
||||
/obj/proc/isLinkedWith(obj/O)
|
||||
return FALSE
|
||||
|
||||
/obj/proc/getLink(idx)
|
||||
return null
|
||||
|
||||
/obj/proc/linkMenu(obj/O)
|
||||
var/dat = ""
|
||||
if(canLink(O, list()))
|
||||
dat += " <a href='?src=[UID()];link=1'>\[Link\]</a> "
|
||||
return dat
|
||||
|
||||
/obj/proc/format_tag(label, varname, act = "set_tag")
|
||||
var/value = vars[varname]
|
||||
if(!value || value == "")
|
||||
value = "-----"
|
||||
return "<b>[label]:</b> <a href=\"?src=[UID()];[act]=[varname]\">[value]</a>"
|
||||
|
||||
|
||||
/obj/proc/update_multitool_menu(mob/user)
|
||||
var/obj/item/multitool/P = get_multitool(user)
|
||||
|
||||
if(!istype(P))
|
||||
return FALSE
|
||||
|
||||
var/dat = {"<html>
|
||||
<head>
|
||||
<title>[name] Configuration</title>
|
||||
<style type="text/css">
|
||||
html,body {
|
||||
font-family:courier;
|
||||
background:#999999;
|
||||
color:#333333;
|
||||
}
|
||||
|
||||
a {
|
||||
color:#000000;
|
||||
text-decoration:none;
|
||||
border-bottom:1px solid black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3>[name]</h3>
|
||||
"}
|
||||
if(allowed(user))//no, assistants, you're not ruining all vents on the station with just a multitool
|
||||
dat += multitool_menu(user, P)
|
||||
if(Mtoollink)
|
||||
if(P)
|
||||
if(P.buffer)
|
||||
var/id = null
|
||||
if("id_tag" in P.buffer.vars)
|
||||
id = P.buffer:id_tag
|
||||
dat += "<p><b>MULTITOOL BUFFER:</b> [P.buffer] [id ? "([id])" : ""]"
|
||||
|
||||
dat += linkMenu(P.buffer)
|
||||
|
||||
if(P.buffer)
|
||||
dat += "<a href='?src=[UID()];flush=1'>\[Flush\]</a>"
|
||||
dat += "</p>"
|
||||
else
|
||||
dat += "<p><b>MULTITOOL BUFFER:</b> <a href='?src=[UID()];buffer=1'>\[Add Machine\]</a></p>"
|
||||
else
|
||||
dat += "<b>ACCESS DENIED</a>"
|
||||
dat += "</body></html>"
|
||||
user << browse(dat, "window=mtcomputer")
|
||||
user.set_machine(src)
|
||||
onclose(user, "mtcomputer")
|
||||
return
|
||||
|
||||
/obj/proc/default_welder_repair(mob/user, obj/item/I) //Returns TRUE if the object was successfully repaired. Fully repairs an object (setting BROKEN to FALSE), default repair time = 40
|
||||
if(obj_integrity >= max_integrity)
|
||||
|
||||
@@ -346,6 +346,7 @@
|
||||
var/cooling_power = 40
|
||||
|
||||
/obj/structure/closet/crate/freezer/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
var/datum/gas_mixture/gas = (..())
|
||||
if(!gas) return null
|
||||
var/datum/gas_mixture/newgas = new/datum/gas_mixture()
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
to_chat(user, "<span class='notice'>You put [T] in [src].</span>")
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
|
||||
/obj/structure/dispenser/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
for(var/X in src)
|
||||
var/obj/item/I = X
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
// Should I return a copy here? If the caller edits or qdel()s the returned
|
||||
// datum, there might be problems if I don't...
|
||||
/obj/structure/transit_tube_pod/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
var/datum/gas_mixture/GM = new()
|
||||
GM.copy_from(air_contents)
|
||||
return GM
|
||||
|
||||
Reference in New Issue
Block a user