cleanup
This commit is contained in:
parent
054c9f0361
commit
c86d51fe92
13
src/actor.rs
13
src/actor.rs
|
@ -1,10 +1,5 @@
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
use crate::nature;
|
||||||
#[allow(unused)] pub const OXYGEN_USE_KG_PER_S: f32 = 1e-5;
|
|
||||||
#[allow(unused)] pub const OXY_S: f32 = OXYGEN_USE_KG_PER_S;
|
|
||||||
#[allow(unused)] pub const OXY_M: f32 = OXYGEN_USE_KG_PER_S * 60.0;
|
|
||||||
#[allow(unused)] pub const OXY_H: f32 = OXYGEN_USE_KG_PER_S * 60.0 * 60.0;
|
|
||||||
#[allow(unused)] pub const OXY_D: f32 = OXYGEN_USE_KG_PER_S * 60.0 * 60.0 * 24.0;
|
|
||||||
|
|
||||||
pub struct ActorPlugin;
|
pub struct ActorPlugin;
|
||||||
impl Plugin for ActorPlugin {
|
impl Plugin for ActorPlugin {
|
||||||
|
@ -55,8 +50,8 @@ impl Default for Suit { fn default() -> Self { SUIT_SIMPLE } }
|
||||||
const SUIT_SIMPLE: Suit = Suit {
|
const SUIT_SIMPLE: Suit = Suit {
|
||||||
power: 1e5,
|
power: 1e5,
|
||||||
power_max: 1e5,
|
power_max: 1e5,
|
||||||
oxygen: OXY_D,
|
oxygen: nature::OXY_D,
|
||||||
oxygen_max: OXY_D,
|
oxygen_max: nature::OXY_D,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn update(
|
pub fn update(
|
||||||
|
@ -72,7 +67,7 @@ pub fn update(
|
||||||
lifeform.adrenaline_jolt = 0.0
|
lifeform.adrenaline_jolt = 0.0
|
||||||
}
|
}
|
||||||
lifeform.adrenaline = (lifeform.adrenaline - 0.0001 + lifeform.adrenaline_jolt * 0.01).clamp(0.0, 1.0);
|
lifeform.adrenaline = (lifeform.adrenaline - 0.0001 + lifeform.adrenaline_jolt * 0.01).clamp(0.0, 1.0);
|
||||||
suit.oxygen = (suit.oxygen - OXY_S*d).clamp(0.0, 1.0);
|
suit.oxygen = (suit.oxygen - nature::OXY_S*d).clamp(0.0, 1.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,12 @@
|
||||||
// nobody cares how it works, but I guess we need it as an ingredient for
|
// nobody cares how it works, but I guess we need it as an ingredient for
|
||||||
// the universe *sigh* so here we go.
|
// the universe *sigh* so here we go.
|
||||||
|
|
||||||
|
pub const OXYGEN_USE_KG_PER_S: f32 = 1e-5;
|
||||||
|
pub const OXY_S: f32 = OXYGEN_USE_KG_PER_S;
|
||||||
|
pub const OXY_M: f32 = OXYGEN_USE_KG_PER_S * 60.0;
|
||||||
|
pub const OXY_H: f32 = OXYGEN_USE_KG_PER_S * 60.0 * 60.0;
|
||||||
|
pub const OXY_D: f32 = OXYGEN_USE_KG_PER_S * 60.0 * 60.0 * 24.0;
|
||||||
|
|
||||||
pub fn star_color_index_to_rgb(color_index: f32) -> (f32, f32, f32) {
|
pub fn star_color_index_to_rgb(color_index: f32) -> (f32, f32, f32) {
|
||||||
let temperature = 4600.0 * ((1.0 / (0.92 * color_index + 1.7)) + (1.0 / (0.92 * color_index + 0.62)));
|
let temperature = 4600.0 * ((1.0 / (0.92 * color_index + 1.7)) + (1.0 / (0.92 * color_index + 0.62)));
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub struct Settings {
|
||||||
impl Default for Settings {
|
impl Default for Settings {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Settings {
|
Settings {
|
||||||
mute_sfx: true,
|
mute_sfx: false,
|
||||||
mute_music: true,
|
mute_music: true,
|
||||||
volume_sfx: 100,
|
volume_sfx: 100,
|
||||||
volume_music: 100,
|
volume_music: 100,
|
||||||
|
|
|
@ -71,7 +71,7 @@ pub fn setup(
|
||||||
actor::Actor::default(),
|
actor::Actor::default(),
|
||||||
actor::LifeForm::default(),
|
actor::LifeForm::default(),
|
||||||
actor::Suit {
|
actor::Suit {
|
||||||
oxygen: actor::OXY_M,
|
oxygen: nature::OXY_M,
|
||||||
..default()
|
..default()
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
Loading…
Reference in a new issue