Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
61e5e06
Fix bad pixel offset code copypasta
out-of-phaze Feb 9, 2026
670728a
Simplify some conditionals
out-of-phaze Feb 9, 2026
3c67138
Fix duplicated brain damage prob() check
out-of-phaze Feb 9, 2026
b2499e3
Fix gun aiming accuracy bonus
out-of-phaze Feb 11, 2026
02ede69
Implement magnetic gun ammo string
out-of-phaze Feb 11, 2026
b93bc5c
Remove redundant conditional checks
out-of-phaze Feb 11, 2026
c3a5422
Simplify more conditional logic
out-of-phaze Feb 11, 2026
4232c05
Reimplement air alarm remote_control variable
out-of-phaze Feb 12, 2026
028b34f
Remove defunct machinery uid and gl_uid vars
out-of-phaze Feb 12, 2026
d0c054e
Replace MIDNIGHT_ROLLOVER with (1 DAY) in REALTIMEOFDAY
out-of-phaze Feb 12, 2026
06d437f
Remove pointless ToTicks procs
out-of-phaze Feb 12, 2026
7713600
Remove unused beam overlay effect
out-of-phaze Feb 12, 2026
b75859d
Improve access handling helpers
out-of-phaze Feb 12, 2026
77de3bc
Remove redundant and unused canister helpers
out-of-phaze Feb 12, 2026
cd0eed7
Make stack recipe cache use an alist
out-of-phaze Feb 12, 2026
1bce740
Remove defunct can_have_gravity area var
out-of-phaze Feb 12, 2026
9b31a37
Remove defunct equipped_robot helper
out-of-phaze Feb 12, 2026
fc38a5e
Remove unused try_teleport method
out-of-phaze Feb 12, 2026
3a5192d
Reimplement active throwforce on energy blade
out-of-phaze Feb 12, 2026
bedbe61
Clean up brig door timer code
out-of-phaze Feb 12, 2026
bdc8d80
Replace fire alarm timeofday usage with REALTIMEOFDAY
out-of-phaze Feb 12, 2026
a78a120
Improve material stratum picking for levels/planets
out-of-phaze Feb 12, 2026
59eddb2
Fix missing length check in crew records code
out-of-phaze Feb 12, 2026
f55a19f
Implement salvage do_rotation var
out-of-phaze Feb 12, 2026
a4d2530
Use ship-level burn/exhaust velocity helpers in delta-v calc
out-of-phaze Feb 12, 2026
328a5d3
Remove unused military rank grade variable
out-of-phaze Feb 12, 2026
aa0cf95
Remove unused tail hair variables
out-of-phaze Feb 13, 2026
da7324a
Mark unused variables
out-of-phaze Feb 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/__defines/_tick.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

//time of day but automatically adjusts to the server going into the next day within the same round.
//for when you need a reliable time number that doesn't depend on byond time.
#define REALTIMEOFDAY (world.timeofday + (MIDNIGHT_ROLLOVER * MIDNIGHT_ROLLOVER_CHECK))
#define REALTIMEOFDAY (world.timeofday + ((1 DAY) * MIDNIGHT_ROLLOVER_CHECK))
#define MIDNIGHT_ROLLOVER_CHECK ( global.rollovercheck_last_timeofday != world.timeofday ? update_midnight_rollover() : global.midnight_rollovers )
3 changes: 3 additions & 0 deletions code/__defines/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
// Reads L or an empty list if L is not a list. Note: Does NOT assign, L may be an expression.
#define SANITIZE_LIST(L) ( islist(L) ? L : list() )

/// Inserts `I` at the end of the list (NOT LAZYLIST) L. If I is a list, it will insert the list itself as an entry, rather than adding each item in I.
#define ADD_LIST_AS_ENTRY(L, I) (L[++L.len] = I) // NOTE: THIS MUST ONLY EVER REFERENCE `I` ONCE; THIS IS A MACRO AND EACH VARIABLE USAGE IS A LITERAL EXPANSION

// The above but for alists. Prefixed with A_ because inserting "A" randomly in the name just made it confusing
#define A_LAZYINITLIST(AL) if (!AL) { AL = alist(); }
#define A_UNSETEMPTY(AL) if(!length(AL)) { AL = null; }
Expand Down
2 changes: 0 additions & 2 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@

#define PIXEL_MULTIPLIER WORLD_ICON_SIZE/32

#define MIDNIGHT_ROLLOVER 864000 //number of deciseconds in a day

//Error handler defines
#define ERROR_USEFUL_LEN 2

Expand Down
6 changes: 0 additions & 6 deletions code/_helpers/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,6 @@
temps[direction] = rstats
return temps

/proc/MinutesToTicks(var/minutes)
return SecondsToTicks(60 * minutes)

/proc/SecondsToTicks(var/seconds)
return seconds * 10

/proc/window_flash(var/client_or_usr)
if (!client_or_usr)
return
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/screen/screen_intent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
requires_ui_style = FALSE
apply_screen_overlay = FALSE
var/intent_width = 16
var/intent_height = 16
var/intent_height = 16 // currently unused
var/list/intent_selectors

/obj/screen/intent/Initialize(mapload, mob/_owner, decl/ui_style/ui_style, ui_color, ui_alpha, ui_cat)
Expand Down
12 changes: 4 additions & 8 deletions code/datums/mil_ranks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@
*/
/datum/mil_rank
var/name = "Unknown"
var/name_short // Abbreviation of the name. Should be null if the
// rank doesn't usually serve as a prefix to the individual's name.
var/list/accessory //type of accesory that will be equipped by job code with this rank
var/sort_order = 0 // A numerical equivalent of the rank used to indicate its order when compared to other datums: eg e-1 = 1, o-1 = 11

//Returns short designation (yes shorter than name_short), like E1, O3 etc.
/datum/mil_rank/proc/grade()
return sort_order
/// Abbreviation of the name. Should be null if the rank doesn't usually serve as a prefix to the individual's name.
var/name_short
///type of accesory that will be equipped by job code with this rank
var/list/accessory
10 changes: 4 additions & 6 deletions code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var/global/list/areas = list()
/// Disables constructing or using APCs in this area.
var/always_unpowered = FALSE

var/atmosalm = 0
var/atmosalm = /obj/machinery/alarm::DANGER_NONE
var/power_equip = 1 // Status
var/power_light = 1
var/power_environ = 1
Expand All @@ -48,8 +48,6 @@ var/global/list/areas = list()
var/oneoff_light = 0
var/oneoff_environ = 0
var/has_gravity = TRUE
/// If FALSE, this area is unable to have its gravity overridden by a gravity generator. Used on /area/space.
var/can_have_gravity = TRUE
var/air_doors_activated = FALSE

var/obj/machinery/apc/apc
Expand Down Expand Up @@ -193,7 +191,7 @@ var/global/list/areas = list()
return cameras

/area/proc/atmosalert(danger_level, var/alarm_source)
if (danger_level == 0)
if (danger_level == /obj/machinery/alarm::DANGER_NONE)
atmosphere_alarm.clearAlarm(src, alarm_source)
else
atmosphere_alarm.triggerAlarm(src, alarm_source, severity = danger_level)
Expand All @@ -204,10 +202,10 @@ var/global/list/areas = list()
danger_level = max(danger_level, AA.danger_level)

if(danger_level != atmosalm)
if (danger_level < 1 && atmosalm >= 1)
if (danger_level < /obj/machinery/alarm::DANGER_WARN && atmosalm >= /obj/machinery/alarm::DANGER_WARN)
//closing the doors on red and opening on green provides a bit of hysteresis that will hopefully prevent fire doors from opening and closing repeatedly due to noise
air_doors_open()
else if (danger_level >= 2 && atmosalm < 2)
else if (danger_level >= /obj/machinery/alarm::DANGER_DANGER && atmosalm < /obj/machinery/alarm::DANGER_DANGER)
air_doors_close()

atmosalm = danger_level
Expand Down
46 changes: 30 additions & 16 deletions code/game/jobs/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,31 +116,45 @@

var/global/list/datum/access/priv_all_access_datums
/proc/get_all_access_datums()
if(!priv_all_access_datums)
priv_all_access_datums = init_subtypes(/datum/access)
priv_all_access_datums = dd_sortedObjectList(priv_all_access_datums)
if(!global.priv_all_access_datums)
global.priv_all_access_datums = init_subtypes(/datum/access)
global.priv_all_access_datums = dd_sortedObjectList(global.priv_all_access_datums)

return priv_all_access_datums.Copy()
return global.priv_all_access_datums.Copy()

var/global/list/datum/access/priv_all_access_datums_id
/proc/get_all_access_datums_by_id()
if(!priv_all_access_datums_id)
priv_all_access_datums_id = list()
if(!global.priv_all_access_datums_id)
global.priv_all_access_datums_id = list()
for(var/datum/access/A in get_all_access_datums())
priv_all_access_datums_id["[A.id]"] = A
global.priv_all_access_datums_id["[A.id]"] = A

return priv_all_access_datums_id.Copy()
return global.priv_all_access_datums_id.Copy()

var/global/list/datum/access/priv_all_access_datums_region
var/global/alist/priv_all_access_datums_region
/// Returns an alist of all region indices -> their associated access datums.
/proc/get_all_access_datums_by_region()
if(!priv_all_access_datums_region)
priv_all_access_datums_region = list()
RETURN_TYPE(/alist)
if(!global.priv_all_access_datums_region)
global.priv_all_access_datums_region = alist()
for(var/datum/access/A in get_all_access_datums())
if(!priv_all_access_datums_region[A.region])
priv_all_access_datums_region[A.region] = list()
priv_all_access_datums_region[A.region] += A
if(!global.priv_all_access_datums_region[A.region])
global.priv_all_access_datums_region[A.region] = alist()
global.priv_all_access_datums_region[A.region] += A

return priv_all_access_datums_region.Copy()
return global.priv_all_access_datums_region.Copy()

var/global/alist/priv_all_access_datums_region_names
/// Returns an alist of all region names -> their associated access datums.
/proc/get_all_access_datums_by_region_name()
RETURN_TYPE(/alist)
if(!global.priv_all_access_datums_region_names)
global.priv_all_access_datums_region_names = alist()
for(var/region_index, region_data in get_all_access_datums_by_region())
var/region_name = get_access_region_name(region_index)
global.priv_all_access_datums_region_names[region_name] = region_data

return global.priv_all_access_datums_region_names.Copy()

/proc/get_access_ids(var/access_types = ACCESS_TYPE_ALL)
. = list()
Expand Down Expand Up @@ -191,7 +205,7 @@ var/global/list/priv_region_access
var/list/region = priv_region_access["[code]"]
return islist(region) ? region.Copy() : list()

/proc/get_region_accesses_name(var/code)
/proc/get_access_region_name(var/code)
switch(code)
if(ACCESS_REGION_ALL)
return "All"
Expand Down
8 changes: 0 additions & 8 deletions code/game/machinery/_machines_base/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ Class Variables:
panel_open (num)
Whether the panel is open

uid (num)
Unique id of machine across all machines.

gl_uid (global num)
Next uid value in sequence

stat (bitflag)
Machine status bit flags.
Possible bit flags:
Expand Down Expand Up @@ -112,9 +106,7 @@ Class Procs:
var/list/uncreated_component_parts = list(/obj/item/stock_parts/power/apc)
/// null - no max. list(type part = number max).
var/list/maximum_component_parts = list(/obj/item/stock_parts = 10)
var/uid
var/panel_open = FALSE
var/static/gl_uid = 1
/// Can the machine be interacted with while de-powered.
var/interact_offline = FALSE
/// sound played on successful interface use
Expand Down
23 changes: 12 additions & 11 deletions code/game/machinery/_machines_base/stock_parts/access_lock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,19 @@
var/list/data = list()
var/list/regions = list()
if(!autoset)
for(var/i in ACCESS_REGION_MIN to ACCESS_REGION_MAX) //code/game/jobs/_access_defs.dm
var/list/region = list()
for(var/region_name, access_data in get_all_access_datums_by_region_name())
var/list/accesses = list()
for(var/j in get_region_accesses(i))
var/list/access = list()
access["name"] = get_access_desc(j)
access["id"] = j
access["req"] = conf_access && (j in conf_access)
accesses[++accesses.len] = access
region["name"] = get_region_accesses_name(i)
region["accesses"] = accesses
regions[++regions.len] = region
for(var/datum/access/access_datum in access_data)
// += or Add would add each individual entry
ADD_LIST_AS_ENTRY(accesses, list(
"name" = access_datum.desc,
"id" = access_datum.id,
"req" = LAZYISIN(conf_access, access_datum.id)
))
ADD_LIST_AS_ENTRY(regions, list(
"name" = region_name,
"accesses" = accesses
))
data["regions"] = regions
data["oneAccess"] = one_access
data["locked"] = locked
Expand Down
54 changes: 30 additions & 24 deletions code/game/machinery/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,18 @@
directional_offset = @'{"NORTH":{"y":-21}, "SOUTH":{"y":21}, "EAST":{"x":-21}, "WEST":{"x":21}}'

var/alarm_id = null
var/breach_detection = 1 // Whether to use automatic breach detection or not
var/breach_detection = TRUE // Whether to use automatic breach detection or not
var/frequency = 1439
var/alarm_frequency = 1437
var/remote_control = 0
var/rcon_setting = 2
/// If TRUE, remote controllers like the atmos control computer can control the air alarm; if FALSE, they can only view it.
/// Typically auto-set by rcon_setting.
var/remote_control = FALSE
/// On RCON_AUTO, remote control is enabled when danger_level is DANGER_DANGER.
var/rcon_setting = RCON_AUTO
var/rcon_remote_override_access = list(access_ce)
var/locked = 1
var/aidisabled = 0
var/shorted = 0
var/locked = TRUE
var/aidisabled = FALSE
var/shorted = FALSE

var/mode = AALARM_MODE_SCRUBBING
var/screen = AALARM_SCREEN_MAIN
Expand All @@ -89,14 +92,17 @@
var/list/TLV = list() // stands for Threshold Limit Value, since it handles exposure amounts
var/list/trace_gas = list() //list of other gases that this air alarm is able to detect

var/danger_level = 0
var/pressure_dangerlevel = 0
var/oxygen_dangerlevel = 0
var/co2_dangerlevel = 0
var/temperature_dangerlevel = 0
var/other_dangerlevel = 0
var/const/DANGER_NONE = 0
var/const/DANGER_WARN = 1
var/const/DANGER_DANGER = 2 // danger, danger, circuits ready
var/danger_level = DANGER_NONE
var/pressure_dangerlevel = DANGER_NONE
var/oxygen_dangerlevel = DANGER_NONE
var/co2_dangerlevel = DANGER_NONE
var/temperature_dangerlevel = DANGER_NONE
var/other_dangerlevel = DANGER_NONE
var/environment_type = /decl/environment_data
var/report_danger_level = 1
var/report_danger_level = TRUE

/obj/machinery/alarm/cold
target_temperature = T0C+4
Expand Down Expand Up @@ -215,14 +221,14 @@
//atmos computer remote controll stuff
switch(rcon_setting)
if(RCON_NO)
remote_control = 0
remote_control = FALSE
if(RCON_AUTO)
if(danger_level == 2)
remote_control = 1
remote_control = TRUE
else
remote_control = 0
remote_control = FALSE
if(RCON_YES)
remote_control = 1
remote_control = TRUE

return

Expand Down Expand Up @@ -318,10 +324,10 @@

/obj/machinery/alarm/proc/get_danger_level(var/current_value, var/list/danger_levels)
if((current_value >= danger_levels[4] && danger_levels[4] > 0) || current_value <= danger_levels[1])
return 2
return DANGER_DANGER
if((current_value > danger_levels[3] && danger_levels[3] > 0) || current_value < danger_levels[2])
return 1
return 0
return DANGER_WARN
return DANGER_NONE

/obj/machinery/alarm/on_update_icon()
// Broken or deconstructed states
Expand Down Expand Up @@ -477,7 +483,7 @@
/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = global.default_topic_state)
var/data[0]
var/remote_connection = istype(state, /datum/topic_state/remote) // Remote connection means we're non-adjacent/connecting from another computer
var/remote_access = remote_connection && CanInteract(user, state) // Remote access means we also have the privilege to alter the air alarm.
var/remote_access = remote_control && remote_connection && CanInteract(user, state) // Remote access means we also have the privilege to alter the air alarm.

data["locked"] = locked && !issilicon(user)
data["remote_connection"] = remote_connection
Expand Down Expand Up @@ -923,14 +929,14 @@ FIRE ALARM

if(src.timing)
if(src.time > 0)
src.time = src.time - ((world.timeofday - last_process)/10)
src.time = src.time - ((REALTIMEOFDAY - last_process)/(1 SECOND))
else
src.alarm()
src.time = 0
src.timing = 0
STOP_PROCESSING_MACHINE(src, MACHINERY_PROCESS_SELF)
src.updateDialog()
last_process = world.timeofday
last_process = REALTIMEOFDAY

if(locate(/obj/fire) in loc)
alarm()
Expand Down Expand Up @@ -988,7 +994,7 @@ FIRE ALARM
. = TOPIC_REFRESH
else if (href_list["time"])
src.timing = text2num(href_list["time"])
last_process = world.timeofday
last_process = REALTIMEOFDAY
START_PROCESSING_MACHINE(src, MACHINERY_PROCESS_SELF)
. = TOPIC_REFRESH
else if (href_list["tp"])
Expand Down
5 changes: 1 addition & 4 deletions code/game/machinery/atmo_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@
/obj/machinery/computer/air_control/proc/get_console_data()
if(sensor_info)
var/list/temp = list()
if(input_tag || output_tag)
data["control"] = 1
else
data["control"] = 0
data["control"] = !!(input_tag || output_tag)

if(!sensor_name && sensor_tag)
temp += list("long_name" = sensor_tag)
Expand Down
18 changes: 3 additions & 15 deletions code/game/machinery/atmoalter/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ EMPTY_CANISTER(hydrogen, /obj/machinery/portable_atmospherics/canister/hydrogen)
if(get_port())
add_overlay("can-connector")

var/tank_pressure = return_pressure()
var/tank_pressure = air_contents?.return_pressure()
if(tank_pressure < 10)
add_overlay("can-o0")
else if(tank_pressure < ONE_ATMOSPHERE)
Expand Down Expand Up @@ -205,18 +205,6 @@ EMPTY_CANISTER(hydrogen, /obj/machinery/portable_atmospherics/canister/hydrogen)
if(holding)
holding.update_icon()

/obj/machinery/portable_atmospherics/canister/proc/return_temperature()
var/datum/gas_mixture/GM = return_air()
if(GM?.total_volume>0)
return GM.temperature
return 0

/obj/machinery/portable_atmospherics/canister/proc/return_pressure()
var/datum/gas_mixture/GM = return_air()
if(GM?.total_volume>0)
return GM.return_pressure()
return 0

/obj/machinery/portable_atmospherics/canister/bullet_act(var/obj/item/projectile/Proj)
if(!(Proj.atom_damage_type == BRUTE || Proj.atom_damage_type == BURN))
return
Expand Down Expand Up @@ -258,8 +246,8 @@ EMPTY_CANISTER(hydrogen, /obj/machinery/portable_atmospherics/canister/hydrogen)
data["name"] = name
data["canLabel"] = can_label ? 1 : 0
data["portConnected"] = get_port() ? 1 : 0
data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
data["releasePressure"] = round(release_pressure ? release_pressure : 0)
data["tankPressure"] = round(air_contents.return_pressure())
data["releasePressure"] = round(release_pressure)
data["minReleasePressure"] = round(0.1 ATM)
data["maxReleasePressure"] = round(10 ATM)
data["valveOpen"] = valve_open ? 1 : 0
Expand Down
Loading
Loading