Compare commits
No commits in common. "361587a7d793ab46e77edf64571a0e9a9d507b18" and "a2423fa642a5b7b1f25dcad5a2837b5756762de7" have entirely different histories.
361587a7d7
...
a2423fa642
22
src/actor.rs
22
src/actor.rs
|
@ -158,8 +158,6 @@ pub struct ActorEnteringVehicle;
|
|||
#[derive(Component)]
|
||||
pub struct ActorVehicleBeingEntered;
|
||||
#[derive(Component)]
|
||||
pub struct MessageOnVehicleEntry(pub String);
|
||||
#[derive(Component)]
|
||||
pub struct PlayersFlashLight;
|
||||
#[derive(Component)]
|
||||
pub struct WantsMaxRotation(pub f64);
|
||||
|
@ -424,7 +422,7 @@ pub fn handle_input(
|
|||
q_camera: Query<&Transform, With<Camera>>,
|
||||
mut q_flashlight: Query<&mut Visibility, With<PlayersFlashLight>>,
|
||||
q_vehicles: Query<
|
||||
(Entity, &Actor, &Transform, Option<&MessageOnVehicleEntry>),
|
||||
(Entity, &Actor, &Transform),
|
||||
(
|
||||
With<actor::Vehicle>,
|
||||
Without<actor::Player>,
|
||||
|
@ -434,7 +432,6 @@ pub fn handle_input(
|
|||
mut ew_conv: EventWriter<chat::StartConversationEvent>,
|
||||
mut ew_vehicle: EventWriter<VehicleEnterExitEvent>,
|
||||
mut ew_sfx: EventWriter<audio::PlaySfxEvent>,
|
||||
mut log: ResMut<hud::Log>,
|
||||
q_player_drives: Query<Entity, With<PlayerDrivesThis>>,
|
||||
) {
|
||||
if q_camera.is_empty() || player.is_empty() {
|
||||
|
@ -460,18 +457,12 @@ pub fn handle_input(
|
|||
}
|
||||
// Entering Vehicles
|
||||
if q_player_drives.is_empty() {
|
||||
// Sort vehicles by their distance to the player
|
||||
let objects: Vec<((Entity, &Actor, Option<&MessageOnVehicleEntry>), &Transform)> =
|
||||
q_vehicles
|
||||
let objects: Vec<((Entity, &Actor), &Transform)> = q_vehicles
|
||||
.iter()
|
||||
.map(|(entity, actor, transform, msg)| ((entity, actor, msg), transform))
|
||||
.map(|(entity, actor, transform)| ((entity, actor), transform))
|
||||
.collect();
|
||||
|
||||
// Get the vehicle with shortest distance
|
||||
if let (Some((entity, actor, msg)), dist) =
|
||||
camera::find_closest_target::<(Entity, &Actor, Option<&MessageOnVehicleEntry>)>(
|
||||
objects, camtrans,
|
||||
)
|
||||
if let (Some((entity, actor)), dist) =
|
||||
camera::find_closest_target::<(Entity, &Actor)>(objects, camtrans)
|
||||
{
|
||||
if dist <= MAX_INTERACT_DISTANCE {
|
||||
commands.entity(entity).insert(ActorVehicleBeingEntered);
|
||||
|
@ -483,9 +474,6 @@ pub fn handle_input(
|
|||
is_entering: q_player_drives.is_empty(),
|
||||
is_player: true,
|
||||
});
|
||||
if let Some(msg) = msg {
|
||||
log.warning(msg.0.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,6 @@ struct ParserState {
|
|||
velocity: DVec3,
|
||||
angular_momentum: DVec3,
|
||||
pronoun: Option<String>,
|
||||
message_on_entry: Option<String>,
|
||||
is_sphere: bool,
|
||||
is_player: bool,
|
||||
is_lifeform: bool,
|
||||
|
@ -139,7 +138,6 @@ impl Default for ParserState {
|
|||
velocity: DVec3::splat(0.0),
|
||||
angular_momentum: DVec3::new(0.03, 0.3, 0.09),
|
||||
pronoun: None,
|
||||
message_on_entry: None,
|
||||
is_sphere: false,
|
||||
is_player: false,
|
||||
is_lifeform: false,
|
||||
|
@ -685,9 +683,6 @@ pub fn load_defs(mut ew_spawn: EventWriter<SpawnEvent>) {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
["message_on_entry", message] => {
|
||||
state.message_on_entry = Some(message.to_string());
|
||||
}
|
||||
_ => {
|
||||
error!("No match for [{}]", parts.join(","));
|
||||
}
|
||||
|
@ -900,9 +895,6 @@ fn spawn_entities(
|
|||
if orbits_jupiter {
|
||||
actor.insert(actor::OrbitsJupiter);
|
||||
}
|
||||
if let Some(message) = &state.message_on_entry {
|
||||
actor.insert(actor::MessageOnVehicleEntry(message.clone()));
|
||||
}
|
||||
actor.insert(world::DespawnOnPlayerDeath);
|
||||
actor.insert(actor::HitPoints::default());
|
||||
actor.insert(Position::from(absolute_pos));
|
||||
|
|
|
@ -298,7 +298,7 @@ actor 700 -100 -1100 suitv2
|
|||
scene 22 0 0 workshop
|
||||
relativeto Luna
|
||||
actor -20 10 -23 MeteorAceGT
|
||||
name "Luna's experimental MeteorAceGT"
|
||||
name "MeteorAceGT™"
|
||||
relativeto Luna
|
||||
scale 5
|
||||
vehicle yes
|
||||
|
@ -309,7 +309,6 @@ actor 700 -100 -1100 suitv2
|
|||
density 500
|
||||
angularmomentum 0 0 0.2
|
||||
pointofinterest yes
|
||||
message_on_entry "NOT DESIGNED FOR HUMAN USE"
|
||||
actor -9 4 11 lightorb
|
||||
relativeto Luna
|
||||
name "Light Orb"
|
||||
|
|
|
@ -942,7 +942,6 @@ fn update_hud(
|
|||
} else {
|
||||
|msg: &&Message| match msg.level {
|
||||
LogLevel::Always => true,
|
||||
LogLevel::Warning => true,
|
||||
LogLevel::Achievement => true,
|
||||
_ => false,
|
||||
}
|
||||
|
|
|
@ -527,7 +527,7 @@ pub fn update_menu(
|
|||
let state = match settings.reactor_state {
|
||||
0 => "Off",
|
||||
1 => "On",
|
||||
2 => "OVERLOAD ☢",
|
||||
2 => "OVERLOAD",
|
||||
_ => "ERROR",
|
||||
};
|
||||
let p = actor::POWER_GAIN_REACTOR[settings.reactor_state];
|
||||
|
|
Loading…
Reference in a new issue