1000x speed boost with v/b cheats when holding shift

This commit is contained in:
yuni 2024-04-02 01:14:18 +02:00
parent 8b7ccc1b58
commit 6d3a0da314

View file

@ -320,23 +320,28 @@ fn handle_cheats(
} }
let (trans, mut pos, mut v) = q_player.get_single_mut().unwrap(); let (trans, mut pos, mut v) = q_player.get_single_mut().unwrap();
let (mut lifeform, ) = q_life.get_single_mut().unwrap(); let (mut lifeform, ) = q_life.get_single_mut().unwrap();
let boost = if key_input.pressed(KeyCode::ShiftLeft) {
1e6
} else {
1e3
};
if key_input.just_pressed(settings.key_cheat_pizza) { if key_input.just_pressed(settings.key_cheat_pizza) {
pos.0 = DVec3::new(-303370.0, 0.0, -500000.0); pos.0 = DVec3::new(-303370.0, 0.0, -500000.0);
} }
if key_input.just_pressed(settings.key_cheat_farview1) { if key_input.just_pressed(settings.key_cheat_farview1) {
pos.0 = DVec3::new(-1000000.0, 1000000.0, -500000.0); pos.0 = DVec3::new(-1000.0e6, 1000.0e6, -500.0e6);
} }
if key_input.just_pressed(settings.key_cheat_farview2) { if key_input.just_pressed(settings.key_cheat_farview2) {
pos.0 = DVec3::new(1000000.0, 1000000.0, -500000.0); pos.0 = DVec3::new(1000.0e6, 1000.0e6, -500.0e6);
} }
if key_input.just_pressed(settings.key_cheat_stop) { if key_input.just_pressed(settings.key_cheat_stop) {
v.0 = DVec3::ZERO; v.0 = DVec3::ZERO;
} }
if key_input.pressed(settings.key_cheat_speed) { if key_input.pressed(settings.key_cheat_speed) {
v.0 += DVec3::from(trans.rotation * Vec3::new(0.0, 0.0, 1000.0)); v.0 += DVec3::from(trans.rotation * Vec3::new(0.0, 0.0, boost));
} }
if key_input.pressed(settings.key_cheat_speed_backward) { if key_input.pressed(settings.key_cheat_speed_backward) {
v.0 += DVec3::from(trans.rotation * Vec3::new(0.0, 0.0, -1000.0)); v.0 += DVec3::from(trans.rotation * Vec3::new(0.0, 0.0, -boost));
} }
if key_input.pressed(settings.key_cheat_adrenaline_zero) { if key_input.pressed(settings.key_cheat_adrenaline_zero) {
lifeform.adrenaline = 0.0; lifeform.adrenaline = 0.0;