mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-01 20:42:08 +00:00
More HFR interactions, better damage control, better Meltdown (#58506)
Some more gas interactions with the HFR -O2 will help remove iron content -Antinoblium accumulation or damage over 60% will now start zaps similar to those of the SM (useful to produce power too) -Bz will make more particles shoot out -Meltdown now spew the hot fusion gases around the machine too (20% of the total gases are randomly placed around the machine in 10 open turfs each containing only 10% of that 20%) -damage system now uses cooling temperature instead of the internal fusion temperature
This commit is contained in:
@@ -39,13 +39,13 @@
|
||||
|
||||
critical_threshold_proximity_archived = critical_threshold_proximity
|
||||
if(power_level == 6)
|
||||
critical_threshold_proximity = max(critical_threshold_proximity + max((round((internal_fusion.total_moles() * 9e5 + internal_fusion.temperature) / 9e5, 1) - 2700) / 400, 0), 0)
|
||||
critical_threshold_proximity = max(critical_threshold_proximity + max((round((internal_fusion.total_moles() * 9e5 + coolant_temperature) / 9e5, 1) - 2700) / 400, 0), 0)
|
||||
|
||||
if(internal_fusion.total_moles() < 2000 || power_level <= 5)
|
||||
critical_threshold_proximity = max(critical_threshold_proximity + min((internal_fusion.total_moles() - 1200) / 200, 0), 0)
|
||||
|
||||
if(internal_fusion.total_moles() > 0 && internal_fusion.temperature < 5e5 && power_level <= 4)
|
||||
critical_threshold_proximity = max(critical_threshold_proximity + min(log(10, internal_fusion.temperature) - 5, 0), 0)
|
||||
if(internal_fusion.total_moles() > 0 && (airs[1].total_moles() && coolant_temperature < 5e5) || power_level <= 4)
|
||||
critical_threshold_proximity = max(critical_threshold_proximity + min(log(10, max(coolant_temperature, 1)) - 5, 0), 0)
|
||||
|
||||
critical_threshold_proximity += max(iron_content - 0.35, 0)
|
||||
|
||||
@@ -495,6 +495,46 @@
|
||||
iron_content = max(iron_content - 0.01 * delta_time, 0)
|
||||
iron_content = clamp(iron_content, 0, 1)
|
||||
|
||||
if(power_level >= 4)
|
||||
if(moderator_list[/datum/gas/bz] > (150 / power_level))
|
||||
var/obj/machinery/hypertorus/corner/picked_corner = pick(corners)
|
||||
picked_corner.loc.fire_nuclear_particle(turn(picked_corner.dir, 180))
|
||||
|
||||
if(moderator_list[/datum/gas/antinoblium] > 50 || critical_threshold_proximity > 500)
|
||||
var/zap_number = power_level - 2
|
||||
|
||||
if(critical_threshold_proximity > 650 && prob(20))
|
||||
zap_number += 1
|
||||
|
||||
var/cutoff = 1500
|
||||
cutoff = clamp(3000 - (power_level * (internal_fusion.total_moles() * 0.45)), 450, 3000)
|
||||
|
||||
var/zaps_aspect = DEFAULT_ZAP_ICON_STATE
|
||||
var/flags = ZAP_SUPERMATTER_FLAGS
|
||||
switch(power_level)
|
||||
if(5)
|
||||
zaps_aspect = SLIGHTLY_CHARGED_ZAP_ICON_STATE
|
||||
flags |= (ZAP_MOB_DAMAGE)
|
||||
if(6)
|
||||
zaps_aspect = OVER_9000_ZAP_ICON_STATE
|
||||
flags |= (ZAP_MOB_DAMAGE | ZAP_OBJ_DAMAGE)
|
||||
|
||||
playsound(loc, 'sound/weapons/emitter2.ogg', 100, TRUE, extrarange = 10)
|
||||
for(var/i in 1 to zap_number)
|
||||
supermatter_zap(src, 5, power_level * 300, flags, zap_cutoff = cutoff, power_level = src.power_level * 1000, zap_icon = zaps_aspect)
|
||||
|
||||
if(moderator_list[/datum/gas/oxygen] > 150)
|
||||
if(iron_content > 0)
|
||||
iron_content = max(iron_content - 0.5, 0)
|
||||
moderator_internal.gases[/datum/gas/oxygen] -= 10
|
||||
|
||||
if(prob(critical_threshold_proximity / 15))
|
||||
var/grav_range = round(log(2.5, critical_threshold_proximity))
|
||||
for(var/mob/alive_mob in GLOB.alive_mob_list)
|
||||
if(alive_mob.z != z || get_dist(alive_mob, src) > grav_range || alive_mob.mob_negates_gravity())
|
||||
continue
|
||||
step_towards(alive_mob, loc)
|
||||
|
||||
//Gases can be removed from the moderator internal by using the interface. Helium and antinoblium inside the fusion mix will get always removed at a fixed rate
|
||||
if(waste_remove && power_level <= 5)
|
||||
var/filtering = TRUE
|
||||
|
||||
@@ -311,16 +311,31 @@
|
||||
/obj/machinery/atmospherics/components/unary/hypertorus/core/proc/meltdown()
|
||||
explosion(src, light_impact_range = power_level * 5, flash_range = power_level * 6, adminlog = TRUE, ignorecap = TRUE)
|
||||
radiation_pulse(loc, power_level * 7000, (1 / (power_level + 5)), TRUE)
|
||||
empulse(loc, power_level * 5, power_level * 7)
|
||||
var/fusion_moles = internal_fusion.total_moles() ? internal_fusion.total_moles() : 0
|
||||
var/moderator_moles = moderator_internal.total_moles() ? moderator_internal.total_moles() : 0
|
||||
empulse(loc, power_level * 5, power_level * 7, TRUE)
|
||||
var/list/around_turfs = circlerangeturfs(src, power_level * 5)
|
||||
for(var/turf/turf as anything in around_turfs)
|
||||
if(isclosedturf(turf) || isspaceturf(turf))
|
||||
around_turfs -= turf
|
||||
continue
|
||||
var/datum/gas_mixture/remove_fusion
|
||||
if(internal_fusion.total_moles() > 0)
|
||||
remove_fusion = internal_fusion.remove(fusion_moles)
|
||||
loc.assume_air(remove_fusion)
|
||||
remove_fusion = internal_fusion.remove_ratio(0.2)
|
||||
var/datum/gas_mixture/remove
|
||||
for(var/i in 1 to 10)
|
||||
remove = remove_fusion.remove_ratio(0.1)
|
||||
var/turf/local = pick(around_turfs)
|
||||
local.assume_air(remove)
|
||||
local.air_update_turf(FALSE, FALSE)
|
||||
loc.assume_air(internal_fusion)
|
||||
var/datum/gas_mixture/remove_moderator
|
||||
if(moderator_internal.total_moles() > 0)
|
||||
remove_moderator = moderator_internal.remove(moderator_moles)
|
||||
loc.assume_air(remove_moderator)
|
||||
remove_moderator = moderator_internal.remove_ratio(0.2)
|
||||
var/datum/gas_mixture/remove
|
||||
for(var/i in 1 to 10)
|
||||
remove = remove_moderator.remove_ratio(0.1)
|
||||
var/turf/local = pick(around_turfs)
|
||||
local.assume_air(remove)
|
||||
local.air_update_turf(FALSE, FALSE)
|
||||
loc.assume_air(moderator_internal)
|
||||
air_update_turf(FALSE, FALSE)
|
||||
qdel(src)
|
||||
|
||||
@@ -597,7 +597,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
|
||||
if(prob(gas_comp[/datum/gas/zauker]))
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, TRUE, extrarange = 10)
|
||||
supermatter_zap(src, 6, clamp(power*2, 4000, 20000), ZAP_MOB_STUN)
|
||||
supermatter_zap(src, 6, clamp(power*2, 4000, 20000), ZAP_MOB_STUN, zap_cutoff = src.zap_cutoff, power_level = power, zap_icon = src.zap_icon)
|
||||
|
||||
if(gas_comp[/datum/gas/bz] >= 0.4 && prob(30 * gas_comp[/datum/gas/bz]))
|
||||
src.fire_nuclear_particle() // Start to emit radballs at a maximum of 30% chance per tick
|
||||
@@ -688,7 +688,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
if(zap_count >= 1)
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, TRUE, extrarange = 10)
|
||||
for(var/i in 1 to zap_count)
|
||||
supermatter_zap(src, range, clamp(power*2, 4000, 20000), flags)
|
||||
supermatter_zap(src, range, clamp(power*2, 4000, 20000), flags, zap_cutoff = src.zap_cutoff, power_level = power, zap_icon = src.zap_icon)
|
||||
|
||||
if(prob(5))
|
||||
supermatter_anomaly_gen(src, FLUX_ANOMALY, rand(5, 10))
|
||||
@@ -1063,7 +1063,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
if(PYRO_ANOMALY)
|
||||
new /obj/effect/anomaly/pyro(L, 200, FALSE)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/supermatter_zap(atom/zapstart = src, range = 5, zap_str = 4000, zap_flags = ZAP_SUPERMATTER_FLAGS, list/targets_hit = list())
|
||||
/obj/machinery/proc/supermatter_zap(atom/zapstart = src, range = 5, zap_str = 4000, zap_flags = ZAP_SUPERMATTER_FLAGS, list/targets_hit = list(), zap_cutoff = 1500, power_level = 0, zap_icon = DEFAULT_ZAP_ICON_STATE)
|
||||
if(QDELETED(zapstart))
|
||||
return
|
||||
. = zapstart.dir
|
||||
@@ -1162,7 +1162,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
//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
|
||||
switch(power)//Between 7k and 9k it's 20, above that it's 40
|
||||
switch(power_level)//Between 7k and 9k it's 20, above that it's 40
|
||||
if(SEVERE_POWER_PENALTY_THRESHOLD to CRITICAL_POWER_PENALTY_THRESHOLD)
|
||||
multi = 20
|
||||
if(CRITICAL_POWER_PENALTY_THRESHOLD to INFINITY)
|
||||
@@ -1177,7 +1177,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
//3 shots a human with no resistance. 2 to crit, one to death. This is at at least 10000 power.
|
||||
//There's no increase after that because the input power is effectivly capped at 10k
|
||||
//Does 1.5 damage at the least
|
||||
var/shock_damage = ((zap_flags & ZAP_MOB_DAMAGE) ? (power / 200) - 10 : rand(5,10))
|
||||
var/shock_damage = ((zap_flags & ZAP_MOB_DAMAGE) ? (power_level / 200) - 10 : rand(5,10))
|
||||
creature.electrocute_act(shock_damage, "Supermatter Discharge Bolt", 1, ((zap_flags & ZAP_MOB_STUN) ? SHOCK_TESLA : SHOCK_NOSTUN))
|
||||
zap_str /= 1.5 //Meatsacks are conductive, makes working in pairs more destructive
|
||||
|
||||
@@ -1197,7 +1197,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
for(var/j in 1 to zap_count)
|
||||
if(zap_count > 1)
|
||||
targets_hit = targets_hit.Copy() //Pass by ref begone
|
||||
supermatter_zap(target, new_range, zap_str, zap_flags, targets_hit)
|
||||
supermatter_zap(target, new_range, zap_str, zap_flags, targets_hit, zap_cutoff, power_level, zap_icon)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/destabilize(portal_numbers)
|
||||
var/turf/turf_loc = get_turf(src)
|
||||
|
||||
Reference in New Issue
Block a user