Added check to prevent sceptre AI from canceling its own ward

This commit is contained in:
Knightress Paladin 2021-07-07 19:21:30 -07:00
parent 65d67ef781
commit d0bb7004ab
2 changed files with 4 additions and 2 deletions

View File

@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Animations for using consumables.
- New danari character customizations
- Bald hairstyles for humans and danari
- AI for sceptre weilders and sceptre cultists in Tier 5 dungeons
### Changed

View File

@ -2495,8 +2495,8 @@ impl<'a> AgentData<'a> {
.push(ControlAction::basic_input(InputKind::Primary));
}
}
// Logic to move. Intentionally kept separate from ability logic so duplicated
// work is less necessary.
// Logic to move. Intentionally kept separate from ability logic where possible
// so duplicated work is less necessary.
if attack_data.dist_sqrd < (2.0 * attack_data.min_attack_dist).powi(2) {
// Attempt to move away from target if too close
if let Some((bearing, speed)) = agent.chaser.chase(
@ -2547,6 +2547,7 @@ impl<'a> AgentData<'a> {
}
// Sometimes try to roll
if self.body.map(|b| b.is_humanoid()).unwrap_or(false)
&& !matches!(self.char_state, CharacterState::BasicAura(_))
&& attack_data.dist_sqrd < 16.0f32.powi(2)
&& thread_rng().gen::<f32>() < 0.01
{