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