Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,15 @@
data["active"] = TRUE
if(data_corrupted) //yes it goes negative, that's even more funny
data["SM_integrity"] = active.get_fake_integrity()
data["SM_power"] = active.power + round((rand()-0.5)*12000,1)
data["SM_power"] = active.power + round((rand()-0.5)*12000,1)
data["SM_radiation"] = active.last_rads + round((rand()-0.5)*12000,1)
data["SM_ambienttemp"] = air.return_temperature() + round((rand()-0.5)*20000,1)
data["SM_ambientpressure"] = air.return_pressure() + round((rand()-0.5)*15000,1)
data["SM_moles"] = air.total_moles() + round((rand()-0.5)*1800,1)
else
data["SM_integrity"] = active.get_integrity()
data["SM_power"] = active.power
data["SM_radiation"] = active.last_rads
data["SM_ambienttemp"] = air.return_temperature()
data["SM_ambientpressure"] = air.return_pressure()
data["SM_moles"] = air.total_moles()
Expand Down
9 changes: 8 additions & 1 deletion code/modules/power/supermatter/supermatter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

/// How much extra radioactivity to emit
#define BZ_RADIOACTIVITY_MODIFIER 5 // Up to 500% rads
#define TRITIUM_RADIOACTIVITY_MODIFIER 3
#define PLUOXIUM_RADIOACTIVITY_MODIFIER -2

/// Higher == Gas makes the crystal more resistant against heat damage.
#define N2O_HEAT_RESISTANCE 6
Expand Down Expand Up @@ -136,6 +138,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)

/// Additonal power to add over time comes from sliver extraction(800) or consuming(200)
var/matter_power = 0
var/last_rads = 0

///How much the bullets damage should be multiplied by when it is added to the internal variables
var/config_bullet_energy = 2
Expand Down Expand Up @@ -349,6 +352,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
M.rad_act(rads)

var/turf/T = get_turf(src)
INVOKE_ASYNC(GLOBAL_PROC, /proc/empulse, T, 200 * max(0.2, gasmix_power_ratio), 300 * max(0.2, gasmix_power_ratio), TRUE, FALSE, FALSE, TRUE)
for(var/_M in GLOB.player_list)
var/mob/M = _M
var/turf/T2 = get_turf(M)
Expand Down Expand Up @@ -459,6 +463,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
var/pluoxiumcomp = max(removed.get_moles(/datum/gas/pluoxium)/combined_gas, 0)
var/tritiumcomp = max(removed.get_moles(/datum/gas/tritium)/combined_gas, 0)
var/bzcomp = max(removed.get_moles(/datum/gas/bz)/combined_gas, 0)
var/pluoxiumbonus = max(removed.get_moles(/datum/gas/pluoxium)/combined_gas, 0)


// Mole releated calculations
var/bzmol = max(removed.get_moles(/datum/gas/bz), 0)
Expand Down Expand Up @@ -499,7 +505,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)

if(prob(50))
//1 + (tritRad + pluoxDampen * bzDampen * o2Rad * plasmaRad / (10 - bzrads))
radiation_pulse(src, max((power * (1 + (power_transmission_bonus/(10-(bzcomp * BZ_RADIOACTIVITY_MODIFIER))))) * radmodifier)) //Yogs addition, radmodifier
last_rads = power * (1 + (tritiumcomp * TRITIUM_RADIOACTIVITY_MODIFIER) + ((pluoxiumcomp * PLUOXIUM_RADIOACTIVITY_MODIFIER) * pluoxiumbonus) * (power_transmission_bonus/(10-(bzcomp * BZ_RADIOACTIVITY_MODIFIER)))) * radmodifier
radiation_pulse(src, max(last_rads))

if(bzcomp >= 0.4 && prob(50 * bzcomp))
src.fire_nuclear_particle() // Start to emit radballs at a maximum of 50% chance per tick
Expand Down
18 changes: 18 additions & 0 deletions tgui/packages/tgui/interfaces/NtosSupermatterMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const NtosSupermatterMonitorContent = (props, context) => {
active,
SM_integrity,
SM_power,
SM_radiation,
SM_ambienttemp,
SM_ambientpressure,
SM_moles,
Expand Down Expand Up @@ -68,6 +69,23 @@ export const NtosSupermatterMonitorContent = (props, context) => {
{toFixed(SM_power) + ' MeV/cm3'}
</ProgressBar>
</LabeledList.Item>
<LabeledList.Item label="Radiation">
<ProgressBar
value={SM_radiation}
minValue={0}
maxValue={7000}
ranges={{
// The threshold where enough radiation gets to the
// collectors to start generating power. Experimentally
// determined, because radiation waves are inscrutable.
grey: [-Infinity, 320],
good: [320, 5000],
average: [5000, 7000],
bad: [7000, Infinity],
}}>
{toFixed(SM_radiation) + ' Sv/h'}
</ProgressBar>
</LabeledList.Item>
<LabeledList.Item label="Temperature">
<ProgressBar
value={logScale(SM_ambienttemp)}
Expand Down