April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#define N2O_HEAT_RESISTANCE 6 //Higher == Gas makes the crystal more resistant against heat damage.
|
||||
|
||||
#define POWERLOSS_INHIBITION_GAS_THRESHOLD 0.20 //Higher == Higher percentage of inhibitor gas needed before the charge inertia chain reaction effect starts.
|
||||
#define POWERLOSS_INHIBITION_MOLE_THRESHOLD 100 //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_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_PENALTY_THRESHOLD 1800 //Higher == Shard can absorb more moles before triggering the high mole penalties.
|
||||
@@ -39,10 +39,18 @@
|
||||
#define DETONATION_HALLUCINATION 600
|
||||
|
||||
|
||||
#define WARNING_DELAY 30
|
||||
#define WARNING_DELAY 60
|
||||
|
||||
#define HALLUCINATION_RANGE(P) (min(7, round(P ** 0.25)))
|
||||
|
||||
|
||||
#define GRAVITATIONAL_ANOMALY "gravitational_anomaly"
|
||||
#define FLUX_ANOMALY "flux_anomaly"
|
||||
#define PYRO_ANOMALY "pyro_anomaly"
|
||||
|
||||
#define SPEAK(message) radio.talk_into(src, message, null, get_spans(), get_default_language())
|
||||
|
||||
|
||||
/obj/machinery/power/supermatter_shard
|
||||
name = "supermatter shard"
|
||||
desc = "A strangely translucent and iridescent crystal that looks like it used to be part of a larger structure."
|
||||
@@ -64,7 +72,8 @@
|
||||
var/safe_alert = "Crystalline hyperstructure returning to safe operating levels."
|
||||
var/warning_point = 50
|
||||
var/warning_alert = "Danger! Crystal hyperstructure instability!"
|
||||
var/emergency_point = 500
|
||||
var/damage_penalty_point = 550
|
||||
var/emergency_point = 700
|
||||
var/emergency_alert = "CRYSTAL DELAMINATION IMMINENT."
|
||||
var/explosion_point = 900
|
||||
|
||||
@@ -122,7 +131,7 @@
|
||||
. = ..()
|
||||
countdown = new(src)
|
||||
countdown.start()
|
||||
poi_list |= src
|
||||
GLOB.poi_list |= src
|
||||
radio = new(src)
|
||||
radio.listening = 0
|
||||
investigate_log("has been created.", "supermatter")
|
||||
@@ -130,13 +139,9 @@
|
||||
|
||||
/obj/machinery/power/supermatter_shard/Destroy()
|
||||
investigate_log("has been destroyed.", "supermatter")
|
||||
if(radio)
|
||||
qdel(radio)
|
||||
radio = null
|
||||
poi_list -= src
|
||||
if(countdown)
|
||||
qdel(countdown)
|
||||
countdown = null
|
||||
QDEL_NULL(radio)
|
||||
GLOB.poi_list -= src
|
||||
QDEL_NULL(countdown)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/power/supermatter_shard/examine(mob/user)
|
||||
@@ -157,7 +162,7 @@
|
||||
|
||||
/obj/machinery/power/supermatter_shard/proc/explode()
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/mob/M in mob_list)
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
if(M.z == z)
|
||||
M << 'sound/magic/Charge.ogg'
|
||||
to_chat(M, "<span class='boldannounce'>You feel reality distort for a moment...</span>")
|
||||
@@ -230,7 +235,7 @@
|
||||
n2comp = max(removed.gases["n2"][MOLES]/combined_gas, 0)
|
||||
freoncomp = max(removed.gases["freon"][MOLES]/combined_gas, 0)
|
||||
|
||||
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp - n2ocomp - n2comp - freoncomp, 0), 1)
|
||||
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp - n2comp - freoncomp, 0), 1)
|
||||
|
||||
dynamic_heat_modifier = max((plasmacomp * PLASMA_HEAT_PENALTY)+(o2comp * OXYGEN_HEAT_PENALTY)+(co2comp * CO2_HEAT_PENALTY)+(n2comp * NITROGEN_HEAT_MODIFIER), 0.5)
|
||||
dynamic_heat_resistance = max(n2ocomp * N2O_HEAT_RESISTANCE, 1)
|
||||
@@ -245,7 +250,7 @@
|
||||
if (combined_gas > POWERLOSS_INHIBITION_MOLE_THRESHOLD && co2comp > POWERLOSS_INHIBITION_GAS_THRESHOLD)
|
||||
powerloss_dynamic_scaling = Clamp(powerloss_dynamic_scaling + Clamp(co2comp - powerloss_dynamic_scaling, -0.02, 0.02), 0, 1)
|
||||
else
|
||||
powerloss_dynamic_scaling = Clamp(powerloss_dynamic_scaling - 0.10,0, 1)
|
||||
powerloss_dynamic_scaling = Clamp(powerloss_dynamic_scaling - 0.05,0, 1)
|
||||
powerloss_inhibitor = Clamp(1-(powerloss_dynamic_scaling * Clamp(combined_gas/POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD,1 ,1.5)),0 ,1)
|
||||
|
||||
if(matter_power)
|
||||
@@ -302,23 +307,28 @@
|
||||
var/rads = (power / 10) * sqrt( 1 / max(get_dist(l, src),1) )
|
||||
l.rad_act(rads)
|
||||
|
||||
if(power > POWER_PENALTY_THRESHOLD)
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
if(power > CRITICAL_POWER_PENALTY_THRESHOLD)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
if(power > POWER_PENALTY_THRESHOLD || damage > damage_penalty_point)
|
||||
|
||||
if(prob(15))
|
||||
if(power > POWER_PENALTY_THRESHOLD)
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
if(power > CRITICAL_POWER_PENALTY_THRESHOLD)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
else if (damage > damage_penalty_point && prob(20))
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
|
||||
supermatter_zap(src, 5, Clamp(power*2, 4000, 20000))
|
||||
|
||||
if(prob(15) && power > POWER_PENALTY_THRESHOLD)
|
||||
supermatter_pull(src, power/750)
|
||||
if(prob(5))
|
||||
supermatter_anomaly_gen(src, 1, rand(5, 10))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(5) || prob(2))
|
||||
supermatter_anomaly_gen(src, 2, rand(5, 10))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(2) || prob(0.3))
|
||||
supermatter_anomaly_gen(src, 3, rand(5, 10))
|
||||
supermatter_anomaly_gen(src, FLUX_ANOMALY, rand(5, 10))
|
||||
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, PYRO_ANOMALY, rand(5, 10))
|
||||
|
||||
|
||||
|
||||
@@ -327,31 +337,30 @@
|
||||
var/stability = num2text(round((damage / explosion_point) * 100))
|
||||
|
||||
if(damage > emergency_point)
|
||||
|
||||
radio.talk_into(src, "[emergency_alert] Instability: [stability]%")
|
||||
SPEAK("[emergency_alert] Instability: [stability]%")
|
||||
lastwarning = REALTIMEOFDAY
|
||||
if(!has_reached_emergency)
|
||||
investigate_log("has reached the emergency point for the first time.", "supermatter")
|
||||
message_admins("[src] has reached the emergency point <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>(JMP)</a>.")
|
||||
has_reached_emergency = 1
|
||||
else if(damage >= damage_archived) // The damage is still going up
|
||||
radio.talk_into(src, "[warning_alert] Instability: [stability]%")
|
||||
SPEAK("[warning_alert] Instability: [stability]%")
|
||||
lastwarning = REALTIMEOFDAY - (WARNING_DELAY * 5)
|
||||
|
||||
else // Phew, we're safe
|
||||
radio.talk_into(src, "[safe_alert] Instability: [stability]%")
|
||||
SPEAK("[safe_alert] Instability: [stability]%")
|
||||
lastwarning = REALTIMEOFDAY
|
||||
|
||||
if(power > POWER_PENALTY_THRESHOLD)
|
||||
radio.talk_into(src, "Warning: Hyperstructure has reached dangerous power level.")
|
||||
SPEAK("Warning: Hyperstructure has reached dangerous power level.")
|
||||
if(powerloss_inhibitor < 0.5)
|
||||
radio.talk_into(src, "DANGER: CHARGE INERTIA CHAIN REACTION IN PROGRESS.")
|
||||
SPEAK("DANGER: CHARGE INERTIA CHAIN REACTION IN PROGRESS.")
|
||||
|
||||
if(combined_gas > MOLE_PENALTY_THRESHOLD)
|
||||
radio.talk_into(src, "Warning: Critical coolant mass reached.")
|
||||
SPEAK("Warning: Critical coolant mass reached.")
|
||||
|
||||
if(damage > explosion_point)
|
||||
for(var/mob in living_mob_list)
|
||||
for(var/mob in GLOB.living_mob_list)
|
||||
var/mob/living/L = mob
|
||||
if(istype(L) && L.z == z)
|
||||
if(ishuman(mob))
|
||||
@@ -390,7 +399,7 @@
|
||||
investigate_log("Supermatter shard consumed by singularity.","singulo")
|
||||
message_admins("Singularity has consumed a supermatter shard and can now become stage six.")
|
||||
visible_message("<span class='userdanger'>[src] is consumed by the singularity!</span>")
|
||||
for(var/mob/M in mob_list)
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
if(M.z == z)
|
||||
M << 'sound/effects/supermatter.ogg' //everyone goan know bout this
|
||||
to_chat(M, "<span class='boldannounce'>A horrible screeching fills your ears, and a wave of dread washes over you...</span>")
|
||||
@@ -410,6 +419,13 @@
|
||||
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
Consume(B)
|
||||
|
||||
/obj/machinery/power/supermatter_shard/attack_tk(mob/user)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
to_chat(C, "<span class='userdanger'>That was a really dumb idea.</span>")
|
||||
var/obj/item/bodypart/head/rip_u = C.get_bodypart("head")
|
||||
rip_u.dismember(BURN) //nice try jedi
|
||||
|
||||
/obj/machinery/power/supermatter_shard/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
@@ -435,7 +451,7 @@
|
||||
Consume(user)
|
||||
|
||||
/obj/machinery/power/supermatter_shard/proc/transfer_energy()
|
||||
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
|
||||
for(var/obj/machinery/power/rad_collector/R in GLOB.rad_collectors)
|
||||
if(R.z == z && get_dist(R, src) <= 15) //Better than using orange() every process
|
||||
R.receive_pulse(power * (1 + power_transmission_bonus)/10 * freon_transmit_modifier)
|
||||
|
||||
@@ -475,6 +491,8 @@
|
||||
investigate_log("has consumed [key_name(user)].", "supermatter")
|
||||
user.dust()
|
||||
matter_power += 200
|
||||
else if(istype(AM, /obj/singularity))
|
||||
return
|
||||
else if(isobj(AM) && !istype(AM, /obj/effect))
|
||||
investigate_log("has consumed [AM].", "supermatter")
|
||||
qdel(AM)
|
||||
@@ -520,23 +538,17 @@
|
||||
step_towards(pulled_object,center)
|
||||
step_towards(pulled_object,center)
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/power/supermatter_shard/proc/supermatter_anomaly_gen(turf/anomalycenter, type = 1, anomalyrange = 5)
|
||||
/obj/machinery/power/supermatter_shard/proc/supermatter_anomaly_gen(turf/anomalycenter, type = FLUX_ANOMALY, anomalyrange = 5)
|
||||
var/turf/L = pick(orange(anomalyrange, anomalycenter))
|
||||
if(L)
|
||||
if(type == 1)
|
||||
var/obj/effect/anomaly/flux/A = new(L)
|
||||
A.explosive = 0
|
||||
A.lifespan = 300
|
||||
else if(type == 2)
|
||||
var/obj/effect/anomaly/grav/A = new(L)
|
||||
A.lifespan = 250
|
||||
else if(type == 3)
|
||||
var/obj/effect/anomaly/pyro/A = new(L)
|
||||
A.lifespan = 200
|
||||
|
||||
return
|
||||
switch(type)
|
||||
if(FLUX_ANOMALY)
|
||||
var/obj/effect/anomaly/flux/A = new(L, 300)
|
||||
A.explosive = FALSE
|
||||
if(GRAVITATIONAL_ANOMALY)
|
||||
new /obj/effect/anomaly/grav(L, 250)
|
||||
if(PYRO_ANOMALY)
|
||||
new /obj/effect/anomaly/pyro(L, 200)
|
||||
|
||||
/obj/machinery/power/supermatter_shard/proc/supermatter_zap(atom/zapstart, range = 3, power)
|
||||
. = zapstart.dir
|
||||
@@ -607,3 +619,6 @@
|
||||
supermatter_zap(target_structure, 5, power / 1.5)
|
||||
|
||||
#undef HALLUCINATION_RANGE
|
||||
#undef GRAVITATIONAL_ANOMALY
|
||||
#undef FLUX_ANOMALY
|
||||
#undef PYRO_ANOMALY
|
||||
|
||||
Reference in New Issue
Block a user