Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 2736f11

Browse files
heya
1 parent d04c9f6 commit 2736f11

File tree

3 files changed

+81
-43
lines changed

3 files changed

+81
-43
lines changed

code/modules/events/portal_storm.dm

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -233,25 +233,10 @@
233233

234234
/datum/round_event/portal_storm/resonance_cascade/tick()
235235
var/turf/T = get_safe_random_station_turf()
236-
237-
if(spawn_hostile())
238-
var/type = pick(hostile_types)
239-
hostile_types[type] = hostile_types[type] - 1
240-
spawn_mob(T, type, hostiles_spawn)
241-
if(!hostile_types[type])
242-
hostile_types -= type
243-
244-
if(spawn_boss())
245-
var/type = pick(boss_types)
246-
boss_types[type] = boss_types[type] - 1
247-
spawn_mob(T, type, boss_spawn)
248-
if(!boss_types[type])
249-
boss_types -= type
250-
251236
var/anomaly = pick(anomaly_types)
252237
anomaly_types[anomaly] = anomaly_types[anomaly] - 1
253238
supermatter_anomaly_gen(T, anomaly, rand(5, 10), has_weak_lifespan = TRUE)
254239
if(!anomaly_types[anomaly])
255240
anomaly_types -= anomaly
256-
257-
time_to_end()
241+
242+
return ..()

code/modules/power/supermatter/supermatter.dm

Lines changed: 72 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
162162
var/corruptor_attached = FALSE // The thing that reduces support integrity
163163
var/resonance_cascading = FALSE // IT'S NOT SHUTTING DOWN!!!!!!!
164164
var/noblium_suppressed = FALSE // or is it?
165-
165+
var/bypass_containment = FALSE // If support_integrity is below 30, setting up a containment field at this point is useless
166+
var/debug_inhibitor = FALSE
166167
// Blob related shit
167168
var/supermatter_blob = FALSE // Well say sike rn
168169

@@ -378,6 +379,17 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
378379
light_color = "#ff5006"
379380
return distort
380381

382+
/obj/machinery/power/supermatter_crystal/proc/antinoblium_safety() //Used for checking containment during antinoblium delamination, if false, things will go south and trigger resonance cascade event
383+
if(bypass_containment) //Containment is uselesss at this point
384+
for(var/obj/machinery/field/generator/gens in urange(5, src, 1))
385+
explosion(gens, heavy_impact_range = 2, light_impact_range = 3)
386+
return FALSE
387+
if(!check_containment(get_turf(src), 5) || corruptor_attached)
388+
return FALSE
389+
for(var/obj/machinery/field/generator/gens in urange(5, src, 1))
390+
Beam(gens, icon_state = "lightning[rand(1,12)]", time = 5, maxdistance = INFINITY, beam_color="#fdd700")
391+
return TRUE
392+
381393
/obj/machinery/power/supermatter_crystal/proc/countdown()
382394
set waitfor = FALSE
383395

@@ -419,9 +431,13 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
419431
if(i == 10 SECONDS)
420432
playsound(src, 'yogstation/sound/voice/sm/fcitadel_10sectosingularity.ogg', 100, FALSE, 100, pressure_affected=FALSE)
421433
if(antinoblium_attached && !resonance_cascading) // yogs- resonance cascade!
422-
priority_announce("RESONANCE CASCADE IMMINENT.", "Anomaly Alert", 'sound/misc/notice1.ogg')
434+
if(antinoblium_safety())
435+
priority_announce("SECONDARY CONTAINMENT SYSTEM IS OPERATING AT MAXIMUM POWER. [emergency_alert]", "Anomaly Alert", 'sound/misc/notice1.ogg', color_override="green")
436+
else
437+
priority_announce("RESONANCE CASCADE IMMINENT.", "Anomaly Alert", 'sound/misc/notice1.ogg', color_override="yellow")
423438
resonance_cascading = TRUE
424439
sound_to_playing_players('sound/magic/lightning_chargeup.ogg', 50, FALSE) // yogs end
440+
add_overlay(mutable_appearance("icons/obj/tesla_engine/energy_ball.dmi", "smenergy_ball", LIGHTING_PRIMARY_LAYER))
425441
if(supermatter_blob)
426442
if(!check_containment(src, 5))
427443
priority_announce("LEVEL 5 BIOHAZARD OUTBREAK IMMINENT.", "Anomaly Alert", 'sound/misc/notice1.ogg', color_override="yellow")
@@ -445,7 +461,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
445461
SSpersistence.rounds_since_engine_exploded = ROUNDCOUNT_ENGINE_JUST_EXPLODED
446462
for (var/obj/structure/sign/delamination_counter/sign as anything in GLOB.map_delamination_counters)
447463
sign.update_count(ROUNDCOUNT_ENGINE_JUST_EXPLODED)
448-
new /datum/supermatter_delamination(power, combined_gas, get_turf(src), explosion_power, gasmix_power_ratio, antinoblium_attached, resonance_cascading, last_rads, supermatter_blob)
464+
new /datum/supermatter_delamination(power, combined_gas, get_turf(src), explosion_power, gasmix_power_ratio, antinoblium_attached, resonance_cascading, last_rads, supermatter_blob, bypass_containment)
449465

450466
qdel(src)
451467

@@ -587,7 +603,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
587603
else
588604
powerloss_dynamic_scaling = clamp(powerloss_dynamic_scaling - 0.05,0, 1)
589605

590-
if(support_integrity >= 10 && (!supermatter_blob || check_containment(src, 5)))
606+
if((support_integrity >= 20 && (!supermatter_blob || check_containment(src, 5))) || !debug_inhibitor)
591607
powerloss_inhibitor = clamp(1-(powerloss_dynamic_scaling * clamp(combined_gas/POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD,1 ,1.5)),0 ,1)
592608

593609
if(matter_power)
@@ -629,8 +645,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
629645
src.fire_nuclear_particle() // Spawn more radballs at 80% chance each
630646

631647
if(antinobliumcomp >= 0.5 && antinobmol > 100 && nobliumcomp < 0.5 && !antinoblium_attached) // don't put this stuff in the SM
632-
investigate_log("[src] has reached criticial antinoblium concentration and started a resonance cascade.", INVESTIGATE_SUPERMATTER)
633-
message_admins("[src] has reached criticial antinoblium concentration and started a resonance cascade.")
648+
investigate_log("[src] has reached criticial antinoblium concentration, this may cause a resonance cascade or a controlled supermatter energy ball containment.", INVESTIGATE_SUPERMATTER)
649+
message_admins("[src] has reached criticial antinoblium concentration, this may cause a resonance cascade or a controlled supermatter energy ball containment.")
634650
antinoblium_attached = TRUE // oh god oh fuck
635651

636652
if (miasmacomp >= 0.5 && miasmol > 500 && !supermatter_blob) //requires around 4500 mol of miasma for the blob
@@ -639,7 +655,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
639655
supermatter_zap(src, 10, 7000)
640656

641657
// adding enough hypernoblium can save it, but only if it hasn't gotten too bad and it wasn't corrupted using the traitor kit
642-
if(nobliumcomp >= 0.5 && antinoblium_attached && !corruptor_attached && support_integrity > 10 && damage <= damage_archived)
658+
if(nobliumcomp >= 0.5 && antinoblium_attached && !corruptor_attached && support_integrity > 20 && damage <= damage_archived)
643659
support_integrity += 2
644660
if(support_integrity >= 100)
645661
support_integrity = 100
@@ -708,15 +724,15 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
708724
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
709725
supermatter_zap(src, 5, clamp(power*2, 4000, 20000))
710726

711-
if(prob(15) && (power > POWER_PENALTY_THRESHOLD || combined_gas > MOLE_PENALTY_THRESHOLD || antinoblium_attached || (supermatter_blob && !check_containment(src, 5))))
727+
if(prob(15) && (power > POWER_PENALTY_THRESHOLD || combined_gas > MOLE_PENALTY_THRESHOLD || !antinoblium_safety() || (supermatter_blob && !check_containment(src, 5))))
712728
supermatter_pull(src, power/750)
713-
if(prob(5) || (antinoblium_attached || (supermatter_blob && !check_containment(src, 5))) && prob(10))
729+
if(prob(5) || (!antinoblium_safety() || (supermatter_blob && !check_containment(src, 5))) && prob(10))
714730
supermatter_anomaly_gen(src, ANOMALY_FLUX, rand(5, 10))
715-
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(5) || prob(1) || (antinoblium_attached || (supermatter_blob && !check_containment(src, 5))) && prob(10))
731+
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(5) || prob(1) || (!antinoblium_safety() || (supermatter_blob && !check_containment(src, 5))) && prob(10))
716732
supermatter_anomaly_gen(src, ANOMALY_GRAVITATIONAL, rand(5, 10))
717-
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(2) || prob(0.3) && power > POWER_PENALTY_THRESHOLD || (antinoblium_attached || (supermatter_blob && !check_containment(src, 5))) && prob(10))
733+
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(2) || prob(0.3) && power > POWER_PENALTY_THRESHOLD || (!antinoblium_safety() || (supermatter_blob && !check_containment(src, 5))) && prob(10))
718734
supermatter_anomaly_gen(src, ANOMALY_PYRO, rand(5, 10))
719-
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(5) || prob(0.5) || (antinoblium_attached || (supermatter_blob && !check_containment(src, 5))) && prob(10))
735+
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(5) || prob(0.5) || (!antinoblium_safety() || (supermatter_blob && !check_containment(src, 5))) && prob(10))
720736
supermatter_anomaly_gen(src, ANOMALY_RADIATION, rand(5, 10))
721737

722738
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
@@ -786,9 +802,14 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
786802

787803
if(antinoblium_attached)
788804
if(support_integrity <= 10)
789-
radio.talk_into(src, "DANGER: RESONANCE CASCADE IMMINENT.", engineering_channel)
790-
log_game("The supermatter crystal: DANGER: RESONANCE CASCADE IMMINENT.") // yogs start - Logs SM chatter
791-
investigate_log("The supermatter crystal: DANGER: RESONANCE CASCADE IMMINENT.", INVESTIGATE_SUPERMATTER) // yogs end
805+
if(!antinoblium_safety())
806+
radio.talk_into(src, "WARNING: CONTROLLED ANTINOBLIUM CONCENTRATION DE, PROCEED WITH CAUTION.", engineering_channel)
807+
log_game("The supermatter crystal: DANGER: RESONANCE CASCADE IMMINENT.") // yogs start - Logs SM chatter
808+
investigate_log("The supermatter crystal: DANGER: RESONANCE CASCADE IMMINENT.", INVESTIGATE_SUPERMATTER) // yogs end
809+
else
810+
radio.talk_into(src, "WARNING: CONTROLLED ANTINOBLIUM CONCENTRATION DETECTED, PROCEED WITH CAUTION.", engineering_channel)
811+
log_game("The supermatter crystal: WARNING: CONTROLLED ANTINOBLIUM CONCENTRATION DETECTED, PROCEED WITH CAUTION.") // yogs start - Logs SM chatter
812+
investigate_log("The supermatter crystal: WARNING: CONTROLLED ANTINOBLIUM CONCENTRATION DETECTED, PROCEED WITH CAUTION.", INVESTIGATE_SUPERMATTER) // yogs end
792813
else if(noblium_suppressed)
793814
radio.talk_into(src, "Paranoblium interface returning to safe operating parameters.", engineering_channel)
794815
log_game("The supermatter crystal: DANGER: RESONANCE CASCADE IMMINENT.") // yogs start - Logs SM chatter
@@ -833,29 +854,49 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
833854
radio.talk_into(src, "COMPLETE FAILURE OF GAMMA RADIATION SUPPRESSION SYSTEM DETECTED, ACTIVATING GAMMA EMISSION BUNDLING AND DISPERSION SYSTEM.", engineering_channel)
834855
if(40)
835856
radio.talk_into(src, "DISPERSION SYSTEM ACTIVATION FAILED, BUNDLER NOW FIRING WITHOUT GUIDANCE.", engineering_channel)
836-
priority_announce("SUPERMATTER INSTABILITY IS AT 60%, PULSEWAVE IMMINENT.", "Anomaly Alert", 'sound/misc/notice1.ogg')
857+
priority_announce("SUPERMATTER INSTABILITY IS AT 60%, PULSEWAVE IMMINENT.", "Anomaly Alert", 'sound/misc/notice1.ogg', color_override="yellow")
837858
if(30)
838859
radio.talk_into(src, "WARNING ENERGY SPIKE IN CRYSTAL WELL DETECTED, ESTIMATED ENERGY OUTPUT EXCEEDS PEAK CHARGE DISPERSION CAPACITY.", engineering_channel)
839860
if(20)
840-
radio.talk_into(src, "CRYSTAL WELL DESTABILIZED, ELECTROMAGNETIC PULSES INBOUND, PARANOBLIUM INTERFACE OPERATING AT [round(15+ rand()*10,0.01)]% CAPACITY.", common_channel)
861+
if(!antinoblium_safety())
862+
radio.talk_into(src, "CRYSTAL WELL DESTABILIZED, ELECTROMAGNETIC PULSES INBOUND, PARANOBLIUM INTERFACE OPERATING AT [round(15+ rand()*10,0.01)]% CAPACITY.", common_channel)
863+
else
864+
radio.talk_into(src, "CRYSTAL WELL RESTABILIZATION IN PROGRESS, ACTIVATING SECONDARY ELECTROMAGNETIC FIELD CONTAINMENT, PARANOBLIUM INTERFACE OPERATING AT [round(15+ rand()*10,0.01)]% CAPACITY.", common_channel)
841865
if(10)
842-
radio.talk_into(src, "ELECTROMAGNETIC FIELD CONTAINMENT FAILED, PARANOBLIUM INTERFACE NONFUNCTIONAL, RESONANCE CASCADE IMMINENT.", common_channel)
843-
priority_announce("SUPERMATTER INSTABILITY IS AT 90%, SUPERMATTER SURGE DETECTED, VACATE THE AREA IMMEDIATELY.", "Anomaly Alert", 'sound/misc/notice1.ogg')
866+
if(!antinoblium_safety())
867+
radio.talk_into(src, "ELECTROMAGNETIC FIELD CONTAINMENT FAILED, PARANOBLIUM INTERFACE NONFUNCTIONAL, RESONANCE CASCADE IMMINENT.", common_channel)
868+
priority_announce("SUPERMATTER INSTABILITY IS AT 90%, SUPERMATTER SURGE DETECTED, VACATE THE AREA IMMEDIATELY.", "Anomaly Alert", 'sound/misc/notice1.ogg', color_override="yellow")
869+
else
870+
radio.talk_into(src, "SECONDARY ELECTROMAGNETIC FIELD CONTAINMENT ENGAGED, PARANOBLIUM INTERFACE REBOOTING", common_channel)
871+
priority_announce("SUPERMATTER INSTABILITY IS AT 90%, SUPERMATTER SURGE DETECTED, ACTIVATING SECONDARY FAILSAFE CONTAINMENT, PROCEED WITH CAUTION.", "Anomaly Alert", 'sound/misc/notice1.ogg', color_override="green")
844872
if(6)
845-
radio.talk_into(src, "ELECTROMAGNETIC PULSES IMMINENT, CONTAINMENT AND COOLING FAILURE IMMINENT.", common_channel)
873+
if(!antinoblium_safety())
874+
radio.talk_into(src, "ELECTROMAGNETIC PULSES IMMINENT, CONTAINMENT AND COOLING FAILURE IMMINENT.", common_channel)
875+
else
876+
radio.talk_into(src, "ELECTROMAGNETIC PULSES MINIMAL, SECONDARY CONTAINMENT AND COOLING FULLY OPERATIONAL.", common_channel)
846877
if(1)
847-
priority_announce("COMPLETE DESTABILIZATION OF ALL MAJOR SUPPORT SYSTEMS, MATTER EMISSION FACTOR AT 600%, COMPLETE EVACUATION IS ADVISED.", "Anomaly Alert", 'sound/misc/notice1.ogg')
878+
if(!antinoblium_safety())
879+
priority_announce("COMPLETE DESTABILIZATION OF ALL MAJOR SUPPORT SYSTEMS, MATTER EMISSION FACTOR AT 600%, COMPLETE EVACUATION IS ADVISED.", "Anomaly Alert", 'sound/misc/notice1.ogg', color_override="yellow")
880+
else
881+
priority_announce("COMPLETE RESTABILIZATION OF ALL MAJOR SUPPORT SYSTEMS, MATTER EMISSION FACTOR PERCENTAGE DROPPING, PROCEED WITH CAUTION.", "Anomaly Alert", 'sound/misc/notice1.ogg', color_override="green")
848882
support_integrity -= 1
849883
radiation_pulse(src, (100-support_integrity)*2, 4)
884+
supermatter_zap(src, 7, 2000)
885+
antinoblium_safety()
850886
if(support_integrity<3)
851887
var/emp_power = round(explosion_power * (1+(1-(support_integrity/3))),1)
852888
empulse(src, emp_power)
889+
supermatter_zap(src, 7, 2000+power)
890+
antinoblium_safety()
853891
if(support_integrity<100)
854892
power += round((100-support_integrity)/2,1)
893+
supermatter_zap(src, 7, 2000+power)
894+
antinoblium_safety()
855895
if(support_integrity<70)
856896
if(prob(30+round((100-support_integrity)/2,1)))
857897
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
858-
supermatter_zap(src, 5, min(power*2, 20000))
898+
supermatter_zap(src, 7, 2000+min(power*2, 20000))
899+
antinoblium_safety()
859900
if(support_integrity<40)
860901
if(prob(10))
861902
T.hotspot_expose(max(((100-support_integrity)*2)+FIRE_MINIMUM_TEMPERATURE_TO_EXIST,T.return_air().return_temperature()), 100)
@@ -864,13 +905,21 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
864905
var/ballcount = round(10-(support_integrity/10), 1) // Cause more radballs to be spawned
865906
for(var/i = 1 to ballcount)
866907
fire_nuclear_particle()
908+
antinoblium_safety()
909+
supermatter_zap(src, 7, 2000+power)
910+
if(support_integrity<=20)
911+
if(!antinoblium_safety())
912+
bypass_containment = TRUE
867913
if(support_integrity<10)
868914
powerloss_inhibitor = 0.01 //ensure big explosion
869-
surging = 10000
915+
surging = 100000
870916
if(istype(T, /turf/open/space) || T.return_air().total_moles() < MOLE_SPACE_THRESHOLD)
871917
damage += DAMAGE_HARDCAP * explosion_point //Can't cheat by spacing the crystal to buy time, it will just delaminate faster
872918
if(prob(2))
873919
empulse(src, 10-support_integrity) //EMPs must always be spewing every so often to ensure that containment is guaranteed to fail.
920+
if(prob(30))
921+
antinoblium_safety()
922+
supermatter_zap(src, 7, 2000+power)
874923

875924
// I FUCKING LOVE DATA!!!!!!
876925
powerData += power

code/modules/power/supermatter/supermatter_delamination.dm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
var/supermatter_radiation = 0
1818
///Blob shit
1919
var/supermatter_blob = FALSE
20+
///(Force trigger resonance cascade event if true)
21+
var/bypass_containment = FALSE
2022

21-
/datum/supermatter_delamination/New(supermatter_power, supermatter_gas_amount, turf/supermatter_turf, supermatter_explosion_power, supermatter_gasmix_power_ratio, supermatter_antinoblium, supermatter_cascading, supermatter_radiation, supermatter_blob)
23+
/datum/supermatter_delamination/New(supermatter_power, supermatter_gas_amount, turf/supermatter_turf, supermatter_explosion_power, supermatter_gasmix_power_ratio, supermatter_antinoblium, supermatter_cascading, supermatter_radiation, supermatter_blob, bypass_containment)
2224
. = ..()
2325

2426
src.supermatter_power = supermatter_power
@@ -30,6 +32,7 @@
3032
src.supermatter_cascading = supermatter_cascading
3133
src.supermatter_radiation = supermatter_radiation
3234
src.supermatter_blob = supermatter_blob
35+
src.bypass_containment = bypass_containment
3336

3437
setup_mob_interaction()
3538
setup_delamination_type()
@@ -66,9 +69,10 @@
6669
call_blob()
6770
return
6871
if(supermatter_cascading && !supermatter_blob)
69-
call_cascading()
7072
call_cascadetesla()
71-
call_explosion()
73+
if(bypass_containment)
74+
call_cascading()
75+
call_explosion()
7276
return
7377
if(supermatter_gas_amount > MOLE_PENALTY_THRESHOLD && !supermatter_cascading && !supermatter_blob)
7478
call_singulo()

0 commit comments

Comments
 (0)