unlimited energy in god mode

This commit is contained in:
yuni 2024-10-03 05:59:50 +02:00
parent 5da66a5b15
commit 108efd0e55

View file

@ -287,6 +287,7 @@ pub fn update_power(
let mut power_down = false;
let d = time.delta_seconds();
for (mut battery, mut engine) in &mut q_battery {
if !settings.god_mode {
if settings.flashlight_active {
battery.power -= POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power] * d; // 2.4MW
if battery.power <= 0.0 {
@ -330,6 +331,7 @@ pub fn update_power(
if power_down {
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown));
}
}
let reactor = POWER_GAIN_REACTOR[settings.reactor_state];
battery.power = (battery.power + reactor * d).clamp(0.0, battery.capacity);
if battery.overloaded_recovering && battery.power > battery.capacity * 0.5 {