Compare commits
No commits in common. "26ec38e9ce4f466bf83f4123469600babc0e5a5d" and "7b5341989972441a4924ecf0437e67e00601df4c" have entirely different histories.
26ec38e9ce
...
7b53419899
|
@ -14,7 +14,7 @@ OutFly is an atmospheric, open world, realistic 3D space game that throws you in
|
|||
|
||||
Imagine a blend of [Fallout](https://en.wikipedia.org/wiki/Fallout_%28series%29) and [Outer Wilds](https://en.wikipedia.org/wiki/Outer_Wilds), where you are free to explore the breathtaking expanse of the Jupiter system and discover what life could be like after hundreds of years of space colonization.
|
||||
|
||||
This game aims to respect the player as much as possible. It doesn't waste your time: Despite the vastness of space, nothing takes too long. Speed cheats are active by default, allowing you to visit places you normally couldn't, without passing out from the g-forces. There are no anxiety-causing features (apart of, maybe, space itself), no loading screens, nothing to micromanage, not even save games. You can plunge into the game any time you feel like it, and it's up to you whether you just want to soak in the beautiful scenery, engage with the survival mechanics, or dive into the game story [still in development]. And finally, it's not just DRM-free but completely open source, allowing you to tinker on any part of the game to your liking.
|
||||
This game aims to respect the player as much as possible. It doesn't waste your time: Despite the vastness of space, nothing takes too long. Speed cheats are active by default, allowing you to visit places you normally couldn't, without passing out from the g-forces. There are no anxiety-causing features (apart of, maybe, space itself), no loading screens, nothing to micromanage, not even save games. You can plunge into the game any time you feel like it, and it's up to you whether you just want to soak in the beautiful scenery, engage with the survival mechanics [still in development], or dive into the game story [still in development]. And finally, it's not just DRM-free but completely open source, allowing you to tinker on any part of the game to your liking.
|
||||
|
||||
Source code: https://codeberg.org/outfly/outfly
|
||||
|
||||
|
|
79
src/actor.rs
79
src/actor.rs
|
@ -287,50 +287,48 @@ 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 {
|
||||
power_down = true;
|
||||
settings.flashlight_active = false;
|
||||
for mut flashlight_vis in &mut q_flashlight {
|
||||
*flashlight_vis = Visibility::Hidden;
|
||||
}
|
||||
if settings.flashlight_active {
|
||||
battery.power -= POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power] * d; // 2.4MW
|
||||
if battery.power <= 0.0 {
|
||||
power_down = true;
|
||||
settings.flashlight_active = false;
|
||||
for mut flashlight_vis in &mut q_flashlight {
|
||||
*flashlight_vis = Visibility::Hidden;
|
||||
}
|
||||
}
|
||||
if settings.hud_active {
|
||||
let mut hud_drain = POWER_DRAIN_AR;
|
||||
hud_drain += POWER_DRAIN_LIGHTAMP[prefs.light_amp];
|
||||
battery.power -= hud_drain * d;
|
||||
if battery.power <= 0.0 {
|
||||
power_down = true;
|
||||
ew_game.send(GameEvent::SetAR(Turn::Off));
|
||||
for mut flashlight_vis in &mut q_flashlight {
|
||||
*flashlight_vis = Visibility::Hidden;
|
||||
}
|
||||
}
|
||||
if settings.hud_active {
|
||||
let mut hud_drain = POWER_DRAIN_AR;
|
||||
hud_drain += POWER_DRAIN_LIGHTAMP[prefs.light_amp];
|
||||
battery.power -= hud_drain * d;
|
||||
if battery.power <= 0.0 {
|
||||
power_down = true;
|
||||
ew_game.send(GameEvent::SetAR(Turn::Off));
|
||||
for mut flashlight_vis in &mut q_flashlight {
|
||||
*flashlight_vis = Visibility::Hidden;
|
||||
}
|
||||
}
|
||||
let drain = POWER_DRAIN_THRUSTER[prefs.thruster_boost];
|
||||
let boosting = !battery.overloaded_recovering
|
||||
&& prefs.thruster_boost != 2
|
||||
&& (prefs.thruster_boost == 1 || engine.currently_matching_velocity);
|
||||
if boosting {
|
||||
if battery.power > drain * d * 100.0 {
|
||||
engine.current_boost_factor = THRUSTER_BOOST_FACTOR[prefs.thruster_boost];
|
||||
if engine.currently_firing {
|
||||
battery.power -= drain * d;
|
||||
}
|
||||
} else {
|
||||
power_down = true;
|
||||
battery.overloaded_recovering = true;
|
||||
engine.current_boost_factor = 1.0;
|
||||
}
|
||||
let drain = POWER_DRAIN_THRUSTER[prefs.thruster_boost];
|
||||
let boosting = !battery.overloaded_recovering
|
||||
&& prefs.thruster_boost != 2
|
||||
&& (prefs.thruster_boost == 1 || engine.currently_matching_velocity);
|
||||
if boosting {
|
||||
if battery.power > drain * d * 100.0 {
|
||||
engine.current_boost_factor = THRUSTER_BOOST_FACTOR[prefs.thruster_boost];
|
||||
if engine.currently_firing {
|
||||
battery.power -= drain * d;
|
||||
}
|
||||
} else {
|
||||
power_down = true;
|
||||
battery.overloaded_recovering = true;
|
||||
engine.current_boost_factor = 1.0;
|
||||
}
|
||||
if power_down {
|
||||
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown));
|
||||
}
|
||||
} else {
|
||||
engine.current_boost_factor = 1.0;
|
||||
}
|
||||
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);
|
||||
|
@ -345,14 +343,7 @@ pub fn update_physics_lifeforms(
|
|||
time: Res<Time>,
|
||||
settings: Res<Settings>,
|
||||
id2pos: Res<game::Id2Pos>,
|
||||
mut query: Query<(
|
||||
&mut LifeForm,
|
||||
&mut HitPoints,
|
||||
&mut Suit,
|
||||
&LinearVelocity,
|
||||
&Position,
|
||||
Option<&Player>,
|
||||
)>,
|
||||
mut query: Query<(&mut LifeForm, &mut HitPoints, &mut Suit, &LinearVelocity, &Position, Option<&Player>)>,
|
||||
) {
|
||||
let d = time.delta_seconds();
|
||||
for (mut lifeform, mut hp, mut suit, velocity, pos, player) in query.iter_mut() {
|
||||
|
|
|
@ -267,7 +267,6 @@ pub fn play_zoom_sfx(
|
|||
}
|
||||
|
||||
pub fn play_gasp_sfx(
|
||||
settings: Res<Settings>,
|
||||
player: Query<&actor::Suit, With<actor::Player>>,
|
||||
mut ew_sfx: EventWriter<PlaySfxEvent>,
|
||||
q_audiosinks: Query<(&audio::Sfx, &AudioSink)>,
|
||||
|
@ -277,12 +276,8 @@ pub fn play_gasp_sfx(
|
|||
if *sfxtype != Sfx::Gasp {
|
||||
continue;
|
||||
}
|
||||
if suit.oxygen <= 0.0 && !settings.god_mode {
|
||||
if settings.mute_sfx {
|
||||
sink.set_volume(0.0);
|
||||
} else {
|
||||
sink.set_volume(0.6);
|
||||
}
|
||||
if suit.oxygen <= 0.0 {
|
||||
sink.set_volume(0.6);
|
||||
sink.play();
|
||||
} else {
|
||||
if !sink.is_paused() {
|
||||
|
|
|
@ -691,12 +691,7 @@ pub fn apply_input_to_player(
|
|||
actor::EngineType::Monopropellant,
|
||||
sinks.get(&audio::Sfx::Thruster),
|
||||
),
|
||||
(
|
||||
1.0,
|
||||
1.0,
|
||||
actor::EngineType::Ion,
|
||||
sinks.get(&audio::Sfx::Ion),
|
||||
),
|
||||
(1.0, 1.0, actor::EngineType::Ion, sinks.get(&audio::Sfx::Ion)),
|
||||
];
|
||||
let seconds_to_max_vol = 0.05;
|
||||
let seconds_to_min_vol = 0.05;
|
||||
|
|
30
src/menu.rs
30
src/menu.rs
|
@ -488,16 +488,8 @@ pub fn update_menu(
|
|||
}
|
||||
MenuAction::ToggleAR => {
|
||||
let onoff = bool2string(settings.hud_active);
|
||||
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("")
|
||||
};
|
||||
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 => {
|
||||
|
@ -516,11 +508,7 @@ pub fn update_menu(
|
|||
_ => "ERROR",
|
||||
};
|
||||
let p = actor::POWER_DRAIN_THRUSTER[prefs.thruster_boost];
|
||||
let w = if p > 0.0 {
|
||||
format!(" ({p}W)")
|
||||
} else {
|
||||
String::from("")
|
||||
};
|
||||
let w = if p > 0.0 { format!(" ({p}W)") } else { String::from("") };
|
||||
text.sections[i].value = format!("Thruster Boost: {state}{w}\n");
|
||||
}
|
||||
MenuAction::ModReactor => {
|
||||
|
@ -531,11 +519,7 @@ pub fn update_menu(
|
|||
_ => "ERROR",
|
||||
};
|
||||
let p = actor::POWER_GAIN_REACTOR[settings.reactor_state];
|
||||
let w = if p > 0.0 {
|
||||
format!(" (+{p}W)")
|
||||
} else {
|
||||
String::from("")
|
||||
};
|
||||
let w = if p > 0.0 { format!(" (+{p}W)") } else { String::from("") };
|
||||
text.sections[i].value = format!("Reactor: {state}{w}\n");
|
||||
}
|
||||
MenuAction::ChangeARAvatar => {
|
||||
|
@ -557,7 +541,11 @@ pub fn update_menu(
|
|||
text.sections[i].value = format!("\nCamera: {onoff} [C]\n");
|
||||
}
|
||||
MenuAction::ToggleShadows => {
|
||||
let onoff = if settings.shadows_sun { "High" } else { "Low" };
|
||||
let onoff = if settings.shadows_sun {
|
||||
"High"
|
||||
} else {
|
||||
"Low"
|
||||
};
|
||||
text.sections[i].value = format!("Shadows: {onoff}\n");
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
@ -232,7 +232,10 @@ pub fn pos_offset_for_orbiting_body(
|
|||
}
|
||||
|
||||
/// Assumes the "front" (as seen in blender) is pointing at the orbited mass
|
||||
pub fn rotation_for_orbiting_body(orbit_distance: f64, mass: f64) -> f64 {
|
||||
pub fn rotation_for_orbiting_body(
|
||||
orbit_distance: f64,
|
||||
mass: f64,
|
||||
) -> f64 {
|
||||
if let Ok(epoch) = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) {
|
||||
let orbital_period = nature::simple_orbital_period(mass, orbit_distance);
|
||||
let now = epoch.as_secs_f64() + ORBIT_TIME_OFFSET;
|
||||
|
|
Loading…
Reference in a new issue