Compare commits
No commits in common. "afb67d0d0febc905d4145eeaed574ddb92b7712a" and "18b1d6feae9c62c6deb46a8f43e840da806ccab8" have entirely different histories.
afb67d0d0f
...
18b1d6feae
14
src/actor.rs
14
src/actor.rs
|
@ -21,13 +21,13 @@ use bevy_xpbd_3d::prelude::*;
|
||||||
pub const ENGINE_SPEED_FACTOR: f32 = 30.0;
|
pub const ENGINE_SPEED_FACTOR: f32 = 30.0;
|
||||||
const MAX_TRANSMISSION_DISTANCE: f32 = 100.0;
|
const MAX_TRANSMISSION_DISTANCE: f32 = 100.0;
|
||||||
const MAX_INTERACT_DISTANCE: f32 = 50.0;
|
const MAX_INTERACT_DISTANCE: f32 = 50.0;
|
||||||
pub const POWER_DRAIN_THRUSTER: [f32; 3] = [3000.0, 3000.0, 0.0];
|
pub const POWER_DRAIN_THRUSTER: [f32; 3] = [3e6, 3e6, 0.0];
|
||||||
pub const THRUSTER_BOOST_FACTOR: [f64; 3] = [3.0, 3.0, 0.0];
|
pub const THRUSTER_BOOST_FACTOR: [f64; 3] = [3.0, 3.0, 0.0];
|
||||||
pub const POWER_DRAIN_FLASHLIGHT: [f32; 4] = [200.0, 1500.0, 2500.0, 10000.0];
|
pub const POWER_DRAIN_FLASHLIGHT: [f32; 4] = [200e3, 1500e3, 2500e3, 10000e3];
|
||||||
pub const FLASHLIGHT_INTENSITY: [f32; 4] = [10e6, 400e6, 2e9, 100e9]; // in lumens
|
pub const FLASHLIGHT_INTENSITY: [f32; 4] = [10e6, 400e6, 2e9, 100e9]; // in lumens
|
||||||
pub const POWER_DRAIN_LIGHTAMP: [f32; 4] = [0.0, 200.0, 400.0, 1400.0];
|
pub const POWER_DRAIN_LIGHTAMP: [f32; 4] = [0.0, 200e3, 400e3, 1400e3];
|
||||||
pub const POWER_DRAIN_AR: f32 = 300.0;
|
pub const POWER_DRAIN_AR: f32 = 300e3;
|
||||||
pub const POWER_GAIN_REACTOR: [f32; 3] = [0.0, 2000.0, 10000.0];
|
pub const POWER_GAIN_REACTOR: [f32; 3] = [0.0, 2000e3, 10000e3];
|
||||||
|
|
||||||
pub struct ActorPlugin;
|
pub struct ActorPlugin;
|
||||||
impl Plugin for ActorPlugin {
|
impl Plugin for ActorPlugin {
|
||||||
|
@ -268,8 +268,8 @@ pub struct Battery {
|
||||||
impl Default for Battery {
|
impl Default for Battery {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
power: 10.0 * 3600.0,
|
power: 10e3 * 3600.0,
|
||||||
capacity: 10.0 * 3600.0, // 10Wh
|
capacity: 10e3 * 3600.0, // 10kWh
|
||||||
overloaded_recovering: false,
|
overloaded_recovering: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1077,9 +1077,9 @@ fn spawn_entities(
|
||||||
intensity: actor::FLASHLIGHT_INTENSITY[prefs.flashlight_power],
|
intensity: actor::FLASHLIGHT_INTENSITY[prefs.flashlight_power],
|
||||||
color: Color::WHITE,
|
color: Color::WHITE,
|
||||||
shadows_enabled: true,
|
shadows_enabled: true,
|
||||||
inner_angle: PI32 / 8.0 * 0.65,
|
inner_angle: PI32 / 8.0 * 0.85,
|
||||||
outer_angle: PI32 / 8.0 * 1.2,
|
outer_angle: PI32 / 4.0,
|
||||||
range: 300000.0,
|
range: 3000.0,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
visibility: Visibility::Hidden,
|
visibility: Visibility::Hidden,
|
||||||
|
|
38
src/menu.rs
38
src/menu.rs
|
@ -63,9 +63,9 @@ pub enum DeathScreenEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const MENUDEF: &[(&str, MenuAction)] = &[
|
pub const MENUDEF: &[(&str, MenuAction)] = &[
|
||||||
|
("", MenuAction::ToggleMap),
|
||||||
("", MenuAction::ToggleAR),
|
("", MenuAction::ToggleAR),
|
||||||
("", MenuAction::ChangeARAvatar),
|
("", MenuAction::ChangeARAvatar),
|
||||||
("", MenuAction::ToggleMap),
|
|
||||||
("", MenuAction::ModLightAmp),
|
("", MenuAction::ModLightAmp),
|
||||||
("", MenuAction::ModFlashlightPower),
|
("", MenuAction::ModFlashlightPower),
|
||||||
("", MenuAction::ModThrusterBoost),
|
("", MenuAction::ModThrusterBoost),
|
||||||
|
@ -73,8 +73,8 @@ pub const MENUDEF: &[(&str, MenuAction)] = &[
|
||||||
("", MenuAction::ToggleSound),
|
("", MenuAction::ToggleSound),
|
||||||
("", MenuAction::ToggleMusic),
|
("", MenuAction::ToggleMusic),
|
||||||
("", MenuAction::ToggleCamera),
|
("", MenuAction::ToggleCamera),
|
||||||
|
("Toggle Fullscreen [F11]", MenuAction::ToggleFullscreen),
|
||||||
("", MenuAction::ToggleShadows),
|
("", MenuAction::ToggleShadows),
|
||||||
("Fullscreen [F11]", MenuAction::ToggleFullscreen),
|
|
||||||
("Take Off Helmet", MenuAction::Restart),
|
("Take Off Helmet", MenuAction::Restart),
|
||||||
("Quit", MenuAction::Quit),
|
("Quit", MenuAction::Quit),
|
||||||
];
|
];
|
||||||
|
@ -475,7 +475,7 @@ pub fn update_menu(
|
||||||
} else {
|
} else {
|
||||||
&settings.noise_cancellation_modes[0]
|
&settings.noise_cancellation_modes[0]
|
||||||
};
|
};
|
||||||
text.sections[i].value = format!("\nNoise Cancellation: {noisecancel}\n");
|
text.sections[i].value = format!("Noise Cancellation: {noisecancel}\n");
|
||||||
}
|
}
|
||||||
MenuAction::ToggleMusic => {
|
MenuAction::ToggleMusic => {
|
||||||
let station =
|
let station =
|
||||||
|
@ -488,17 +488,17 @@ pub fn update_menu(
|
||||||
}
|
}
|
||||||
MenuAction::ToggleAR => {
|
MenuAction::ToggleAR => {
|
||||||
let onoff = bool2string(settings.hud_active);
|
let onoff = bool2string(settings.hud_active);
|
||||||
let p = if settings.hud_active { actor::POWER_DRAIN_AR } else { 0.0 };
|
let p = if settings.hud_active { actor::POWER_DRAIN_AR / 1e3 } else { 0.0 };
|
||||||
let w = if p > 0.0 { format!(" ({p}W)") } else { String::from("") };
|
let kw = if p > 0.0 { format!(" ({p}kW)") } else { String::from("") };
|
||||||
text.sections[i].value = format!("Augmented Reality: {onoff}{w} [TAB]\n");
|
text.sections[i].value = format!("Augmented Reality: {onoff}{kw} [TAB]\n");
|
||||||
}
|
}
|
||||||
MenuAction::ModLightAmp => {
|
MenuAction::ModLightAmp => {
|
||||||
let p = actor::POWER_DRAIN_LIGHTAMP[prefs.light_amp];
|
let p = actor::POWER_DRAIN_LIGHTAMP[prefs.light_amp] / 1e3;
|
||||||
text.sections[i].value = format!("\nLight Amplification: {p}W\n");
|
text.sections[i].value = format!("Light Amplification: {p}kW\n");
|
||||||
}
|
}
|
||||||
MenuAction::ModFlashlightPower => {
|
MenuAction::ModFlashlightPower => {
|
||||||
let p = actor::POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power];
|
let p = actor::POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power] / 1e3;
|
||||||
text.sections[i].value = format!("Flashlight Power: {p}W\n");
|
text.sections[i].value = format!("Flashlight Power: {p}kW\n");
|
||||||
}
|
}
|
||||||
MenuAction::ModThrusterBoost => {
|
MenuAction::ModThrusterBoost => {
|
||||||
let state = match prefs.thruster_boost {
|
let state = match prefs.thruster_boost {
|
||||||
|
@ -507,9 +507,9 @@ pub fn update_menu(
|
||||||
2 => "Off",
|
2 => "Off",
|
||||||
_ => "ERROR",
|
_ => "ERROR",
|
||||||
};
|
};
|
||||||
let p = actor::POWER_DRAIN_THRUSTER[prefs.thruster_boost];
|
let p = actor::POWER_DRAIN_THRUSTER[prefs.thruster_boost] / 1e3;
|
||||||
let w = if p > 0.0 { format!(" ({p}W)") } else { String::from("") };
|
let kw = if p > 0.0 { format!(" ({p}kW)") } else { String::from("") };
|
||||||
text.sections[i].value = format!("Thruster Boost: {state}{w}\n");
|
text.sections[i].value = format!("Thruster Boost: {state}{kw}\n");
|
||||||
}
|
}
|
||||||
MenuAction::ModReactor => {
|
MenuAction::ModReactor => {
|
||||||
let state = match settings.reactor_state {
|
let state = match settings.reactor_state {
|
||||||
|
@ -518,9 +518,9 @@ pub fn update_menu(
|
||||||
2 => "OVERLOAD",
|
2 => "OVERLOAD",
|
||||||
_ => "ERROR",
|
_ => "ERROR",
|
||||||
};
|
};
|
||||||
let p = actor::POWER_GAIN_REACTOR[settings.reactor_state];
|
let p = actor::POWER_GAIN_REACTOR[settings.reactor_state] / 1e3;
|
||||||
let w = if p > 0.0 { format!(" (+{p}W)") } else { String::from("") };
|
let kw = if p > 0.0 { format!(" (+{p}kW)") } else { String::from("") };
|
||||||
text.sections[i].value = format!("Reactor: {state}{w}\n");
|
text.sections[i].value = format!("Reactor: {state}{kw}\n");
|
||||||
}
|
}
|
||||||
MenuAction::ChangeARAvatar => {
|
MenuAction::ChangeARAvatar => {
|
||||||
if let Some(ava) = hud::PLAYER_AR_AVATARS.get(settings.ar_avatar) {
|
if let Some(ava) = hud::PLAYER_AR_AVATARS.get(settings.ar_avatar) {
|
||||||
|
@ -538,13 +538,13 @@ pub fn update_menu(
|
||||||
} else {
|
} else {
|
||||||
"1st Person"
|
"1st Person"
|
||||||
};
|
};
|
||||||
text.sections[i].value = format!("\nCamera: {onoff} [C]\n");
|
text.sections[i].value = format!("Camera: {onoff} [C]\n");
|
||||||
}
|
}
|
||||||
MenuAction::ToggleShadows => {
|
MenuAction::ToggleShadows => {
|
||||||
let onoff = if settings.shadows_sun {
|
let onoff = if settings.shadows_sun {
|
||||||
"High"
|
"Flashlight + Sun"
|
||||||
} else {
|
} else {
|
||||||
"Low"
|
"Flashlight Only"
|
||||||
};
|
};
|
||||||
text.sections[i].value = format!("Shadows: {onoff}\n");
|
text.sections[i].value = format!("Shadows: {onoff}\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue