position cheats now teleport you relative to identified objects
This commit is contained in:
parent
e3ff386011
commit
5c29681ee3
19
src/world.rs
19
src/world.rs
|
@ -376,6 +376,7 @@ fn handle_cheats(
|
|||
q_target: Query<(&Transform, &Position, &LinearVelocity), (With<hud::IsTargeted>, Without<actor::PlayerCamera>)>,
|
||||
mut ew_playerdies: EventWriter<actor::PlayerDiesEvent>,
|
||||
mut settings: ResMut<var::Settings>,
|
||||
id2pos: Res<actor::Id2Pos>,
|
||||
mut ew_sfx: EventWriter<audio::PlaySfxEvent>,
|
||||
) {
|
||||
if q_player.is_empty() || q_life.is_empty() {
|
||||
|
@ -423,16 +424,22 @@ fn handle_cheats(
|
|||
}
|
||||
|
||||
if key_input.just_pressed(settings.key_cheat_pizza) {
|
||||
pos.0 = DVec3::new(-121100218.0, 593057.0, -190818113.0);
|
||||
gforce.ignore_gforce_seconds = 1.0;
|
||||
if let Some(target) = id2pos.0.get(&"pizzeria".to_string()) {
|
||||
pos.0 = *target + DVec3::new(-60.0, 0.0, 0.0);
|
||||
gforce.ignore_gforce_seconds = 1.0;
|
||||
}
|
||||
}
|
||||
if key_input.just_pressed(settings.key_cheat_farview1) {
|
||||
pos.0 = DVec3::new(27643e3, -47e3, -124434e3);
|
||||
gforce.ignore_gforce_seconds = 1.0;
|
||||
if let Some(target) = id2pos.0.get(&"busstop2".to_string()) {
|
||||
pos.0 = *target + DVec3::new(0.0, -1000.0, 0.0);
|
||||
gforce.ignore_gforce_seconds = 1.0;
|
||||
}
|
||||
}
|
||||
if key_input.just_pressed(settings.key_cheat_farview2) {
|
||||
pos.0 = DVec3::new(-184968e3, 149410e3, -134273e3);
|
||||
gforce.ignore_gforce_seconds = 1.0;
|
||||
if let Some(target) = id2pos.0.get(&"busstop3".to_string()) {
|
||||
pos.0 = *target + DVec3::new(0.0, -1000.0, 0.0);
|
||||
gforce.ignore_gforce_seconds = 1.0;
|
||||
}
|
||||
}
|
||||
if key_input.pressed(settings.key_cheat_adrenaline_zero) {
|
||||
lifeform.adrenaline = 0.0;
|
||||
|
|
Loading…
Reference in a new issue