Adjust supermatter mole crush / changes out cryo anomalies / sm zap power gen. (#23843)

* Supermatter generates zap power properly. Introduces mole stability period. Fixes SM darkness

* removes darkness fix
This commit is contained in:
Qwertytoforty
2024-02-04 16:19:15 -05:00
committed by GitHub
parent 19730f6e81
commit a2a804225c
3 changed files with 41 additions and 20 deletions

View File

@@ -25,6 +25,7 @@
#define POWERLOSS_INHIBITION_MOLE_THRESHOLD 20 //Higher == More moles of the gas are needed before the charge inertia chain reaction effect starts. //Scales powerloss inhibition down until this amount of moles is reached
#define POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD 500 //bonus powerloss inhibition boost if this amount of moles is reached
#define MOLE_CRUNCH_THRESHOLD 1700 //Above this value we can get lord singulo and
#define MOLE_PENALTY_THRESHOLD 1800 //Above this value we can get lord singulo and independent mol damage, below it we can heal damage
#define MOLE_HEAT_PENALTY 350 //Heat damage scales around this. Too hot setups with this amount of moles do regular damage, anything above and below is scaled
//Along with damage_penalty_point, makes flux anomalies.
@@ -58,7 +59,7 @@
#define GRAVITATIONAL_ANOMALY "gravitational_anomaly"
#define FLUX_ANOMALY "flux_anomaly"
#define CRYO_ANOMALY "cryo_anomaly"
#define BLUESPACE_ANOMALY "bluespace_anomaly"
//If integrity percent remaining is less than these values, the monitor sets off the relevant alarm.
#define SUPERMATTER_DELAM_PERCENT 5
@@ -379,7 +380,7 @@
else
to_chat(M, "<span class='boldannounceic'>You hold onto \the [M.loc] as hard as you can, as reality distorts around you. You feel safe.</span>")
if(combined_gas > MOLE_PENALTY_THRESHOLD)
if(combined_gas > MOLE_CRUNCH_THRESHOLD)
investigate_log("has collapsed into a singularity.", "supermatter")
if(T)
var/obj/singularity/S = new(T)
@@ -545,8 +546,10 @@
power = max((removed.temperature * temp_factor / T0C) * gasmix_power_ratio + power, 0)
if(prob(50))
radiation_pulse(src, power * max(0, (1 + (power_transmission_bonus / 10))))
var/mole_crunch_bonus = 0
if(combined_gas > MOLE_CRUNCH_THRESHOLD)
mole_crunch_bonus = 7000 //This adds 7000 EER worth of power to the SM. This should make mole crunch potentially worthy as a SM setup, if not risky. More stable than the anomalies, but very easy to push over the edge. Don't forget, a high EER setup can harvest power through zaps
radiation_pulse(src, power * max(0, (1 + (power_transmission_bonus / 10))) + mole_crunch_bonus)
//Power * 0.55 * a value between 1 and 0.8
var/device_energy = power * REACTION_POWER_MODIFIER
@@ -632,7 +635,7 @@
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(5) || prob(1))
supermatter_anomaly_gen(src, GRAVITATIONAL_ANOMALY, rand(5, 10))
if((power > SEVERE_POWER_PENALTY_THRESHOLD && prob(2)) || (prob(0.3) && power > POWER_PENALTY_THRESHOLD))
supermatter_anomaly_gen(src, CRYO_ANOMALY, rand(5, 10))
supermatter_anomaly_gen(src, BLUESPACE_ANOMALY, rand(5, 10))
if(prob(15))
supermatter_pull(loc, min(power / 850, 3)) //850, 1700, 2550
@@ -665,7 +668,7 @@
if(powerloss_inhibitor < 0.5)
radio.autosay("DANGER: CHARGE INERTIA CHAIN REACTION IN PROGRESS.", name, "Engineering", list(z))
if(combined_gas > MOLE_PENALTY_THRESHOLD)
if(combined_gas > MOLE_CRUNCH_THRESHOLD)
radio.autosay("Warning: Critical coolant mass reached.", name, "Engineering", list(z))
//Boom (Mind blown)
if(damage > explosion_point)
@@ -902,7 +905,7 @@
else
remove_filter("icon")
if(combined_gas > MOLE_PENALTY_THRESHOLD)
if(combined_gas > MOLE_CRUNCH_THRESHOLD)
ray_filter_helper(1, power ? clamp((damage/100) * power, 50, 125) : 1, SUPERMATTER_SINGULARITY_RAYS_COLOUR, clamp(damage / 300, 1, 30), clamp(damage / 5, 12, 300))
add_filter(name = "outline", priority = 2, params = list(
@@ -955,7 +958,7 @@
l_power = 3,
l_color = SUPERMATTER_TESLA_COLOUR,
)
if(combined_gas > MOLE_PENALTY_THRESHOLD && get_integrity() > SUPERMATTER_DANGER_PERCENT)
if(combined_gas > MOLE_CRUNCH_THRESHOLD && get_integrity() > SUPERMATTER_DANGER_PERCENT)
set_light(
l_range = 4 + clamp((450 - damage) / 10, 1, 50),
l_power = 3,
@@ -1053,12 +1056,12 @@
if(L)
switch(type)
if(FLUX_ANOMALY)
var/obj/effect/anomaly/flux/A = new(L, 300, FALSE)
var/obj/effect/anomaly/flux/A = new(L, 30 SECONDS, FALSE)
A.explosive = FALSE
if(GRAVITATIONAL_ANOMALY)
new /obj/effect/anomaly/grav(L, 250, FALSE, FALSE)
if(CRYO_ANOMALY)
new /obj/effect/anomaly/cryo(L, 200, FALSE)
new /obj/effect/anomaly/grav(L, 25 SECONDS, FALSE, FALSE)
if(BLUESPACE_ANOMALY)
new /obj/effect/anomaly/bluespace(L, 24 SECONDS, FALSE, FALSE, TRUE)
/obj/machinery/atmospherics/supermatter_crystal/proc/supermatter_zap(atom/zapstart = src, range = 5, zap_str = 4000, zap_flags = ZAP_SUPERMATTER_FLAGS, list/targets_hit = list())
if(QDELETED(zapstart))
@@ -1148,6 +1151,7 @@
if(prob(80))
zap_flags &= ~ZAP_MACHINE_EXPLOSIVE
if(target_type == COIL)
zap_flags += ZAP_GENERATES_POWER
//In the best situation we can expect this to grow up to 2120kw before a delam/IT'S GONE TOO FAR FRED SHUT IT DOWN
//The formula for power gen is zap_str * zap_mod / 2 * capacitor rating, between 1 and 4
var/multi = 10
@@ -1158,6 +1162,7 @@
multi = 40
target.zap_act(zap_str * multi, zap_flags)
zap_str /= 3 //Coils should take a lot out of the power of the zap
zap_flags &= ~ZAP_GENERATES_POWER
else if(isliving(target))//If we got a fleshbag on our hands
var/mob/living/creature = target
@@ -1246,7 +1251,7 @@
#undef HALLUCINATION_RANGE
#undef GRAVITATIONAL_ANOMALY
#undef FLUX_ANOMALY
#undef CRYO_ANOMALY
#undef BLUESPACE_ANOMALY
#undef COIL
#undef ROD
#undef LIVING

View File

@@ -99,7 +99,6 @@
var/power_produced = powernet ? power * input_power_multiplier : power
produce_direct_power(power_produced)
flick("coilhit", src)
playsound(loc, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5)
return power - power_produced //You get back the amount we didn't use
else
. = ..()