Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
999b915
start
XeonMations Feb 24, 2026
e6faf85
awawwa
XeonMations Feb 24, 2026
6a1f474
Update storm_trait.dm
XeonMations Feb 24, 2026
00bd6a1
Update storm_trait.dm
XeonMations Feb 24, 2026
d3e5ed0
Update storm_trait.dm
XeonMations Feb 24, 2026
6396ebb
wew
XeonMations Feb 26, 2026
040b36b
Merge remote-tracking branch 'upstream/master' into anchor
XeonMations Mar 4, 2026
d5a6bec
Update tgstation.dme
XeonMations Mar 4, 2026
8328d75
rahhh
XeonMations Mar 4, 2026
aecc40f
hghh
XeonMations Mar 4, 2026
e17dd5b
awaw
XeonMations Mar 5, 2026
a0b55a2
Update storm_subsystem.dm
XeonMations Mar 5, 2026
723f264
time for frontend
XeonMations Mar 5, 2026
3168042
rahhh
XeonMations Mar 5, 2026
267e310
Update storm_subsystem.dm
XeonMations Mar 5, 2026
0424055
Update redspace_anchor.dm
XeonMations Mar 5, 2026
59e80eb
awawaw
XeonMations Mar 5, 2026
ff4b7dc
hm
XeonMations Mar 5, 2026
78beed1
Update redspace_anchor.dm
XeonMations Mar 5, 2026
6509407
Update redspace_anchor.dm
XeonMations Mar 5, 2026
97e8406
Update RedspaceAnchor.tsx
XeonMations Mar 5, 2026
b0fc012
Update redspace_anchor.dm
XeonMations Mar 5, 2026
fda1973
Update modular_oculis/modules/storm/code/redspace_anchor.dm
XeonMations Mar 6, 2026
29e15a6
Merge remote-tracking branch 'upstream/master' into anchor
XeonMations Mar 10, 2026
12a7c96
Update redspace_anchor.dm
XeonMations Mar 10, 2026
8c70af8
Update redspace_anchor.dm
XeonMations Mar 11, 2026
b1d14b4
wires and stuff
XeonMations Mar 11, 2026
09f7399
awwawa
XeonMations Mar 11, 2026
9d836ba
awawaw
XeonMations Mar 11, 2026
27240f7
awawawwa
XeonMations Mar 11, 2026
b86a2e0
Update anchor_computer.dm
XeonMations Mar 11, 2026
621383a
rah
XeonMations Mar 11, 2026
1f219f4
Update anchor_computer.dm
XeonMations Mar 12, 2026
da8235d
Merge branch 'master' into anchor
XeonMations Mar 21, 2026
caa688c
Update redspace_anchor.dm
XeonMations Mar 22, 2026
9a2dbd1
Merge branch 'master' into anchor
XeonMations Apr 3, 2026
1085a2c
Merge branch 'master' into anchor
XeonMations May 24, 2026
6fb6e57
Update tgstation.dme
XeonMations May 24, 2026
a77cbe8
Update storm_subsystem.dm
XeonMations May 25, 2026
753daf1
wew
XeonMations Jun 4, 2026
92e666f
Update redspace_anchor.dm
XeonMations Jun 5, 2026
be3ed39
TODO
XeonMations Jun 5, 2026
3766e43
Merge branch 'master' into anchor
XeonMations Jul 22, 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
1 change: 1 addition & 0 deletions code/__DEFINES/wires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
#define WIRE_FIRE_DETECT "Automatic Detection"
#define WIRE_FIRE_TRIGGER "Alarm Trigger"
#define WIRE_FIRE_RESET "Alarm Reset"
#define WIRE_DISCHARGE "Discharge" // OCULIS EDIT ADDITION

// Wire states for the AI
#define AI_WIRE_NORMAL 0
Expand Down
2 changes: 2 additions & 0 deletions code/_onclick/hud/parallax/random_layer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@

/// Gassy background with a few random colors
/atom/movable/screen/parallax_layer/random/space_gas
/* // OCULIS EDIT REMOVAL START
//IRIS EDIT START
icon = 'modular_iris/master_files/icons/effects/electrobox.dmi'
icon_state = "lightning"
speed = 0.5
//IRIS EDIT END
*/ // OCULIS EDIT REMOVAL END

/// The colors we can be
var/possible_colors = list(COLOR_STRONG_VIOLET, COLOR_VIOLET, COLOR_LIGHT_PINK, COLOR_MOSTLY_PURE_PINK, COLOR_AMETHYST, COLOR_OCULIS_LOGO, COLOR_PURPLE) //OCULIS EDIT
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ SUBSYSTEM_DEF(ticker)
//Configure mode and assign player to antagonists
var/can_continue = FALSE
can_continue = SSdynamic.select_roundstart_antagonists() //Choose antagonists
SSeidolon_storm.initialize_storm_intensity() // OCULIS EDIT ADDITION - EIDOLON_STORM
CHECK_TICK
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_PRE_JOBS_ASSIGNED, src)
can_continue = can_continue && SSjob.divide_occupations() //Distribute jobs
Expand Down
69 changes: 69 additions & 0 deletions modular_oculis/modules/storm/code/anchor/anchor_computer.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/obj/item/circuitboard/computer/redspace_anchor_control
name = "Redspace Anchor Control"
greyscale_colors = CIRCUIT_COLOR_COMMAND
build_path = /obj/machinery/computer/redspace_anchor_computer

/obj/machinery/computer/redspace_anchor_computer
name = "redspace anchor control computer"
desc = "Used to control the redspace anchor."
icon_screen = "comm"
circuit = /obj/item/circuitboard/computer/redspace_anchor_control
var/obj/machinery/redspace_anchor/connected_anchor = null

/obj/machinery/computer/redspace_anchor_computer/Initialize(mapload, obj/item/circuitboard/C)
. = ..()
for(var/obj/machinery/redspace_anchor/anchor as anything in SSmachines.get_machines_by_type(/obj/machinery/redspace_anchor))
if(anchor.z == z)
connected_anchor = anchor
update_appearance()

/obj/machinery/computer/redspace_anchor_computer/update_overlays()
if(connected_anchor?.breaker)
icon_screen = "comm"
else
icon_screen = "syndishuttle"
. = ..()

/obj/machinery/computer/redspace_anchor_computer/ui_status(mob/user, datum/ui_state/state)
if(HAS_SILICON_ACCESS(user) && connected_anchor.ai_disabled)
to_chat(user, span_info("AI control has been disabled."))
else if(!connected_anchor.shorted)
return ..()
return UI_CLOSE

/obj/machinery/computer/redspace_anchor_computer/ui_interact(mob/user, datum/tgui/ui)
. = ..()
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "RedspaceAnchor", name)
ui.open()

/obj/machinery/computer/redspace_anchor_computer/ui_data(mob/user)
var/list/data = list()
data["breaker"] = connected_anchor.breaker
data["charge_count"] = connected_anchor.charge_count
data["charging_state"] = connected_anchor.charging_state
data["on"] = connected_anchor.on
data["operational"] = (connected_anchor.machine_stat & BROKEN) ? FALSE : TRUE
data["violetspace_energy"] = connected_anchor.violetspace_energy
return data

/obj/machinery/computer/redspace_anchor_computer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return

switch(action)
if("gentoggle")
connected_anchor.breaker = !connected_anchor.breaker
investigate_log("was toggled [connected_anchor.breaker ? "<font color='green'>ON</font>" : "<font color='red'>OFF</font>"] by [key_name(usr)].", INVESTIGATE_ENGINE)
if(connected_anchor.violetspace_energy)
connected_anchor.trigger_unsafe_discharge()
investigate_log("was overloaded by remaining violetspace energy.", INVESTIGATE_ENGINE)
connected_anchor.set_power()
. = TRUE
if("discharge_violetspace")
if(connected_anchor.violetspace_energy && connected_anchor.can_discharge)
investigate_log("has discharged violetspace energy by [key_name(usr)].", INVESTIGATE_ENGINE)
connected_anchor.trigger_safe_discharge()
. = TRUE
278 changes: 278 additions & 0 deletions modular_oculis/modules/storm/code/anchor/redspace_anchor.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
#define POWER_IDLE 0
#define POWER_UP 1
#define POWER_DOWN 2

/obj/machinery/redspace_anchor
name = "redspace anchor"
icon = 'modular_oculis/modules/storm/icons/redspace_anchor.dmi'
icon_state = "anchor_off"
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF

/*
* Yes, I know this doesn't use BASE_MACHINE_IDLE_CONSUMPTION at all,
* and this is purelly done so that the code is readable without pulling out a calculator
* to make sure these values are right.
*/
use_power = IDLE_POWER_USE
idle_power_usage = (6 MEGA WATTS) // Lotta fucking power to keep the storm at bay.

// 3x3 offset by one row
pixel_x = -32
pixel_y = -32
bound_height = 96
bound_width = 96
bound_x = -32
bound_y = -32
density = TRUE
move_resist = INFINITY

/// Whether the redspace anchor is currently active.
var/on = TRUE
/// If the main breaker is on/off, to enable/disable the anchor.
var/breaker = TRUE
/// If the power cable is cut or not.
var/shorted = FALSE
/// If a silicon can interact with it.
var/ai_disabled = FALSE
/// If the anchor will produce an alarm when changing states.
var/alarm_disabled = FALSE
/// If the anchor can safely discharge its redspace energy.
var/can_discharge = TRUE
/// If the generator is idle, charging, or down.
var/charging_state = POWER_IDLE
/// How much charge the redspace anchor has, goes down when breaker is shut, and shuts down at 0.
var/charge_count = 100

/// The overlay currently used.
var/current_overlay = null

/// Audio for when the redspace anchor is on
var/datum/looping_sound/redspace_anchor/soundloop
Comment thread
XeonMations marked this conversation as resolved.

/// How much excess violetspace energy the redspace anchor has, which can cause it to fail once it reaches 100.
var/violetspace_energy = 0

/obj/machinery/redspace_anchor/Initialize(mapload)
. = ..()
SSeidolon_storm.register_anchor(src)
set_wires(new /datum/wires/redspace_anchor(src))
soundloop = new(src, start_immediately = FALSE)
if(on)
add_overlay("activated")

/obj/machinery/redspace_anchor/examine(mob/user)
if(HAS_TRAIT(user, TRAIT_MINDSHIELD))
desc = "The most important machine on the station. You feel more... Stable, near it."
return ..()
desc = "The most important machine on the station. \n[span_danger("Looking directly at it gives you a headache.")]"
return ..()

/obj/machinery/redspace_anchor/safe_throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, datum/callback/callback, force = MOVE_FORCE_STRONG, gentle = FALSE)
return FALSE

/obj/machinery/redspace_anchor/ex_act(severity, target)
if(severity >= EXPLODE_DEVASTATE) // Very sturdy.
set_broken()
return TRUE
return FALSE

/obj/machinery/redspace_anchor/blob_act(obj/structure/blob/B)
if(prob(20))
set_broken()

/obj/machinery/redspace_anchor/zap_act(power, zap_flags)
. = ..()
if(zap_flags & ZAP_MACHINE_EXPLOSIVE)
qdel(src) //like the singulo, tesla deletes it. stops it from exploding over and over

// You aren't allowed to move.
/obj/machinery/redspace_anchor/Move()
. = ..()
qdel(src)

/obj/machinery/redspace_anchor/proc/set_broken()
atom_break()
update_appearance()

/obj/machinery/redspace_anchor/proc/set_fix()
set_machine_stat(machine_stat & ~BROKEN)
update_appearance()

/obj/machinery/redspace_anchor/update_icon_state()
. = ..()
if(on)
icon_state = "anchor_on"
else
icon_state = "anchor_off"

/obj/machinery/redspace_anchor/screwdriver_act(mob/living/user, obj/item/tool)
if(machine_stat & BROKEN)
return
tool.play_tool_sound(src)
toggle_panel_open()
to_chat(user, span_notice("The wires have been [panel_open ? "exposed" : "unexposed"]."))
update_appearance()
return TRUE

// Wire interactions
/obj/machinery/redspace_anchor/proc/reset(wire)
switch(wire)
if(WIRE_POWER)
if(!wires.is_cut(WIRE_POWER))
shorted = FALSE
set_power()
if(WIRE_AI)
if(!wires.is_cut(WIRE_AI))
ai_disabled = FALSE
if(WIRE_ALARM)
if(!wires.is_cut(WIRE_ALARM))
alarm_disabled = FALSE
if(WIRE_DISCHARGE)
update_appearance()

/obj/machinery/redspace_anchor/power_change()
. = ..()
if(SSticker.current_state == GAME_STATE_PLAYING)
investigate_log("has [machine_stat & NOPOWER ? "lost" : "regained"] power.", INVESTIGATE_ENGINE)
set_power()

// Set the charging state based on power/breaker.
/obj/machinery/redspace_anchor/proc/set_power()
var/new_state = FALSE
if(machine_stat & (NOPOWER|BROKEN) || !breaker || shorted)
new_state = FALSE
else if(breaker)
new_state = TRUE

charging_state = new_state ? POWER_UP : POWER_DOWN // Startup sequence animation.
if(SSticker.current_state == GAME_STATE_PLAYING)
investigate_log("is now [charging_state == POWER_UP ? "charging" : "discharging"].", INVESTIGATE_ENGINE)
update_appearance()

/obj/machinery/redspace_anchor/proc/enable()
charging_state = POWER_IDLE
on = TRUE

//soundloop.start()
update_appearance()

if(SSticker.current_state == GAME_STATE_PLAYING)
investigate_log("was brought online.", INVESTIGATE_ENGINE)
message_admins("The redspace anchor was brought online [ADMIN_VERBOSEJMP(src)]")
shake_everyone()

/obj/machinery/redspace_anchor/proc/disable()
charging_state = POWER_IDLE
on = FALSE

//soundloop.stop()
update_appearance()

if(SSticker.current_state == GAME_STATE_PLAYING)
investigate_log("was brought offline.", INVESTIGATE_ENGINE)
message_admins("The redspace anchor was brought offline. [ADMIN_VERBOSEJMP(src)]")
shake_everyone()

// Charge/Discharge and turn on/off when you reach 0/100 percent.
/obj/machinery/redspace_anchor/process()
if(machine_stat & BROKEN)
cut_overlays()
return

var/overlay_state = null
switch(charge_count)
if(0 to 20)
overlay_state = null
if(21 to 40)
overlay_state = "startup"
if(41 to 60)
overlay_state = "idle"
if(61 to 80)
overlay_state = "activating"
if(81 to 100)
overlay_state = "activated"

if(overlay_state != current_overlay)
cut_overlays()
if(overlay_state)
add_overlay(overlay_state)
current_overlay = overlay_state

if(charging_state == POWER_IDLE)
return
if((charging_state == POWER_UP) && (charge_count >= 100))
enable()
else if((charging_state == POWER_DOWN) && (charge_count <= 0))
disable()
else
if(charging_state == POWER_UP)
charge_count += 2
else if(charging_state == POWER_DOWN)
charge_count -= 2

for(var/mob/mobs as anything in GLOB.mob_list)
var/turf/mob_turf = get_turf(mobs)
if(!istype(mob_turf))
continue
if(!is_valid_z_level(src, mob_turf))
continue
if(mobs.client)
if((charge_count % 4 == 0 && prob(75)) && !alarm_disabled) // Let them know it is charging/discharging.
if(charging_state == POWER_UP)
mobs.playsound_local(mob_turf, 'sound/effects/magic/cosmic_expansion.ogg', 100, TRUE)
else
mobs.playsound_local(mob_turf, 'sound/effects/magic/swap.ogg', 100, TRUE)
if((charge_count <= 50) && (charging_state == POWER_DOWN) && prob(5))
to_chat(mobs, span_bolddanger("You feel a foreign presence encroaching around you."))

/// Shake everyone on the z level to let them know that the anchor was enagaged/disengaged.
/obj/machinery/redspace_anchor/proc/shake_everyone()
var/turf/T = get_turf(src)
var/sound/alert_sound = sound('sound/effects/alert.ogg')
for(var/mob/mobs as anything in GLOB.mob_list)
var/turf/mob_turf = get_turf(mobs)
if(!istype(mob_turf))
continue
if(!is_valid_z_level(T, mob_turf))
continue
if(mobs.client)
shake_camera(mobs, 15, 1)
mobs.playsound_local(T, null, 100, 1, 0.5, sound_to_use = alert_sound)
if(!SSmapping.level_has_any_trait(z, ZTRAIT_STATION))
return
if(on)
priority_announce("Redspace Anchor activated. Storm dissipation in progress.", "Redspace Anchor")
else
priority_announce("Warning: Redspace Anchor has been disabled. Storm encroaching on station perimeter.", "Redspace Anchor")

/obj/machinery/redspace_anchor/proc/tick(intensity)
if((charging_state != POWER_IDLE) || !on)
return
violetspace_energy += (rand(1,5) * intensity)
if(violetspace_energy >= 100)
trigger_unsafe_discharge()

/obj/machinery/redspace_anchor/proc/trigger_unsafe_discharge()
violetspace_energy = 0
breaker = FALSE
set_power()
priority_announce(
text = "Redspace Anchor failure! Unsafe shutdown in progress!",
title = "Redspace Anchor",
sound = SSstation.announcer.get_rand_alert_sound(),
has_important_message = TRUE,
)

/obj/machinery/redspace_anchor/proc/trigger_safe_discharge()
violetspace_energy = 0
priority_announce(
text = "Redspace Anchor safe discharge in progress.",
title = "Redspace Anchor",
sound = SSstation.announcer.get_rand_alert_sound(),
has_important_message = TRUE,
)

#undef POWER_IDLE
#undef POWER_UP
#undef POWER_DOWN
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/datum/looping_sound/redspace_anchor
mid_sounds = list('sound/machines/hypertorus/loops/hypertorus_nominal.ogg')
mid_length = 6 SECONDS
volume = 55
extra_range = 15
vary = TRUE
Loading
Loading