diff --git a/src/actor.rs b/src/actor.rs index 63d9cee..086f9f7 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -21,13 +21,13 @@ use bevy_xpbd_3d::prelude::*; pub const ENGINE_SPEED_FACTOR: f32 = 30.0; const MAX_TRANSMISSION_DISTANCE: f32 = 100.0; const MAX_INTERACT_DISTANCE: f32 = 50.0; -pub const POWER_DRAIN_THRUSTER: [f32; 3] = [3e6, 3e6, 0.0]; +pub const POWER_DRAIN_THRUSTER: [f32; 3] = [3000.0, 3000.0, 0.0]; pub const THRUSTER_BOOST_FACTOR: [f64; 3] = [3.0, 3.0, 0.0]; -pub const POWER_DRAIN_FLASHLIGHT: [f32; 4] = [200e3, 1500e3, 2500e3, 10000e3]; +pub const POWER_DRAIN_FLASHLIGHT: [f32; 4] = [200.0, 1500.0, 2500.0, 10000.0]; pub const FLASHLIGHT_INTENSITY: [f32; 4] = [10e6, 400e6, 2e9, 100e9]; // in lumens -pub const POWER_DRAIN_LIGHTAMP: [f32; 4] = [0.0, 200e3, 400e3, 1400e3]; -pub const POWER_DRAIN_AR: f32 = 300e3; -pub const POWER_GAIN_REACTOR: [f32; 3] = [0.0, 2000e3, 10000e3]; +pub const POWER_DRAIN_LIGHTAMP: [f32; 4] = [0.0, 200.0, 400.0, 1400.0]; +pub const POWER_DRAIN_AR: f32 = 300.0; +pub const POWER_GAIN_REACTOR: [f32; 3] = [0.0, 2000.0, 10000.0]; pub struct ActorPlugin; impl Plugin for ActorPlugin { @@ -268,8 +268,8 @@ pub struct Battery { impl Default for Battery { fn default() -> Self { Self { - power: 10e3 * 3600.0, - capacity: 10e3 * 3600.0, // 10kWh + power: 10.0 * 3600.0, + capacity: 10.0 * 3600.0, // 10Wh overloaded_recovering: false, } } diff --git a/src/menu.rs b/src/menu.rs index 3c8afde..54e10bf 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -488,17 +488,17 @@ pub fn update_menu( } MenuAction::ToggleAR => { let onoff = bool2string(settings.hud_active); - let p = if settings.hud_active { actor::POWER_DRAIN_AR / 1e3 } else { 0.0 }; - let kw = if p > 0.0 { format!(" ({p}kW)") } else { String::from("") }; - text.sections[i].value = format!("Augmented Reality: {onoff}{kw} [TAB]\n"); + let p = if settings.hud_active { actor::POWER_DRAIN_AR } else { 0.0 }; + let w = if p > 0.0 { format!(" ({p}W)") } else { String::from("") }; + text.sections[i].value = format!("Augmented Reality: {onoff}{w} [TAB]\n"); } MenuAction::ModLightAmp => { - let p = actor::POWER_DRAIN_LIGHTAMP[prefs.light_amp] / 1e3; - text.sections[i].value = format!("\nLight Amplification: {p}kW\n"); + let p = actor::POWER_DRAIN_LIGHTAMP[prefs.light_amp]; + text.sections[i].value = format!("\nLight Amplification: {p}W\n"); } MenuAction::ModFlashlightPower => { - let p = actor::POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power] / 1e3; - text.sections[i].value = format!("Flashlight Power: {p}kW\n"); + let p = actor::POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power]; + text.sections[i].value = format!("Flashlight Power: {p}W\n"); } MenuAction::ModThrusterBoost => { let state = match prefs.thruster_boost { @@ -507,9 +507,9 @@ pub fn update_menu( 2 => "Off", _ => "ERROR", }; - let p = actor::POWER_DRAIN_THRUSTER[prefs.thruster_boost] / 1e3; - let kw = if p > 0.0 { format!(" ({p}kW)") } else { String::from("") }; - text.sections[i].value = format!("Thruster Boost: {state}{kw}\n"); + let p = actor::POWER_DRAIN_THRUSTER[prefs.thruster_boost]; + let w = if p > 0.0 { format!(" ({p}W)") } else { String::from("") }; + text.sections[i].value = format!("Thruster Boost: {state}{w}\n"); } MenuAction::ModReactor => { let state = match settings.reactor_state { @@ -518,9 +518,9 @@ pub fn update_menu( 2 => "OVERLOAD", _ => "ERROR", }; - let p = actor::POWER_GAIN_REACTOR[settings.reactor_state] / 1e3; - let kw = if p > 0.0 { format!(" (+{p}kW)") } else { String::from("") }; - text.sections[i].value = format!("Reactor: {state}{kw}\n"); + let p = actor::POWER_GAIN_REACTOR[settings.reactor_state]; + let w = if p > 0.0 { format!(" (+{p}W)") } else { String::from("") }; + text.sections[i].value = format!("Reactor: {state}{w}\n"); } MenuAction::ChangeARAvatar => { if let Some(ava) = hud::PLAYER_AR_AVATARS.get(settings.ar_avatar) {