Fix deadwood not attacking if target is at a different elevation than deadwood.

This commit is contained in:
holychowders 2022-03-27 20:02:38 +00:00 committed by Marcel
parent 4aaefdf6be
commit 39d5a73c10
2 changed files with 3 additions and 2 deletions

View File

@ -372,6 +372,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed entities with voxel colliders being off by one physics tick for collision. - Fixed entities with voxel colliders being off by one physics tick for collision.
- Airships no longer oscillate dramatically into the sky due to mistaking velocity for acceleration. - Airships no longer oscillate dramatically into the sky due to mistaking velocity for acceleration.
- The login and character selection screens no longer cause high GPU usage when the framerate limit is set to Unlimited. - The login and character selection screens no longer cause high GPU usage when the framerate limit is set to Unlimited.
- Deadwood will now attack targets who are at different elevations than itself.
## [0.9.0] - 2021-03-20 ## [0.9.0] - 2021-03-20

View File

@ -2424,7 +2424,7 @@ impl<'a> AgentData<'a> {
// If already dashing, keep dashing and have move_dir set to forward // If already dashing, keep dashing and have move_dir set to forward
controller.push_basic_input(InputKind::Secondary); controller.push_basic_input(InputKind::Secondary);
controller.inputs.move_dir = self.ori.look_vec().xy(); controller.inputs.move_dir = self.ori.look_vec().xy();
} else if attack_data.in_min_range() && attack_data.angle < 10.0 { } else if attack_data.in_min_range() && attack_data.angle_xy < 10.0 {
// If near target, dash at them and through them to get away // If near target, dash at them and through them to get away
controller.push_basic_input(InputKind::Secondary); controller.push_basic_input(InputKind::Secondary);
} else if matches!(self.char_state, CharacterState::BasicBeam(s) if s.stage_section != StageSection::Recover && s.timer < BEAM_TIME) } else if matches!(self.char_state, CharacterState::BasicBeam(s) if s.stage_section != StageSection::Recover && s.timer < BEAM_TIME)
@ -2433,7 +2433,7 @@ impl<'a> AgentData<'a> {
controller.push_basic_input(InputKind::Primary); controller.push_basic_input(InputKind::Primary);
} else if attack_data.dist_sqrd < BEAM_RANGE.powi(2) { } else if attack_data.dist_sqrd < BEAM_RANGE.powi(2) {
// Else if in beam range, beam them // Else if in beam range, beam them
if attack_data.angle < 5.0 { if attack_data.angle_xy < 5.0 {
controller.push_basic_input(InputKind::Primary); controller.push_basic_input(InputKind::Primary);
} else { } else {
// If not in angle, apply slight movement so deadwood orients itself correctly // If not in angle, apply slight movement so deadwood orients itself correctly