mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
fixes the HFRs damage from moles over limit (#94895)
## About The Pull Request Fixes the HFRs damage from being over the 10 000 moles of fuel limit. Also makes the code easier to read, by separating the lines of code a little. Tested on a local repo by launching the HFR and exceeding the 10 000 moles fuel limit. Instead of the HFR exploding almost instantly, it now started taking damage at a reasonable rate and could be saved. ## Why It's Good For The Game Fixes #94786 Also makes the code slightly more readable and as such easier to maintain. ## Changelog 🆑 Swan fix: fixes the HFR health dropping exponentially once it starts taking damage from having too many moles /🆑 Co-authored-by: NiceNiceSwan <kubapawelczyk41@gmail.com>
This commit is contained in:
co-authored by
NiceNiceSwan
parent
09ae25cf9e
commit
a7f01670b8
@@ -457,8 +457,10 @@
|
||||
|
||||
// If we have a preposterous amount of mass in the fusion mix, things get bad extremely fast
|
||||
if(internal_fusion.total_moles() >= HYPERTORUS_HYPERCRITICAL_MOLES)
|
||||
var/hypercritical_damage_taken = max((internal_fusion.total_moles() - HYPERTORUS_HYPERCRITICAL_MOLES) * HYPERTORUS_HYPERCRITICAL_SCALE, 0)
|
||||
critical_threshold_proximity = max(critical_threshold_proximity + min(hypercritical_damage_taken, HYPERTORUS_HYPERCRITICAL_MAX_DAMAGE), 0) * seconds_per_tick
|
||||
var/moles_over_limit = internal_fusion.total_moles() - HYPERTORUS_HYPERCRITICAL_MOLES
|
||||
var/hypercritical_damage_taken = max(moles_over_limit * HYPERTORUS_HYPERCRITICAL_SCALE, 0)
|
||||
hypercritical_damage_taken = min(hypercritical_damage_taken, HYPERTORUS_HYPERCRITICAL_MAX_DAMAGE) * seconds_per_tick
|
||||
critical_threshold_proximity = max(critical_threshold_proximity + hypercritical_damage_taken, 0)
|
||||
warning_damage_flags |= HYPERTORUS_FLAG_HIGH_FUEL_MIX_MOLE
|
||||
|
||||
// High power fusion might create other matter other than helium, iron is dangerous inside the machine, damage can be seen
|
||||
|
||||
Reference in New Issue
Block a user