Add check to see if cultist already has ward buff

This commit is contained in:
Knightress Paladin 2021-07-06 21:10:33 -07:00
parent 98dc0f19b7
commit 598d6594ff

View File

@ -2455,25 +2455,27 @@ impl<'a> AgentData<'a> {
attack_data.dist_sqrd, attack_data.dist_sqrd,
) )
{ {
// If far enough away, and can see target, attempt to shoot beam // If far enough away, and can see target, check which skill is appropriate to use
if self.energy.current() < DESIRED_ENERGY_LEVEL { if self
// If low on energy, use primary to attempt to regen energy
controller
.actions
.push(ControlAction::basic_input(InputKind::Primary));
} else if self
.skill_set .skill_set
.has_skill(Skill::Sceptre(SceptreSkill::UnlockAura)) .has_skill(Skill::Sceptre(SceptreSkill::UnlockAura))
&& self.energy.current() > 100 && self.energy.current() > DESIRED_ENERGY_LEVEL
&& thread_rng().gen_bool(0.7) && !read_data.buffs.get(*self.entity)
.iter()
.any(|buff| buff.iter_kind(BuffKind::ProtectingWard)
.peekable()
.peek()
.is_some())
&& thread_rng().gen_bool(0.4)
{ {
// Use ward if target is far enough away and have sufficient energy // Use ward if target is far enough away, self is not buffed, and have sufficient energy
controller controller
.actions .actions
.push(ControlAction::basic_input(InputKind::Ability(0))); .push(ControlAction::basic_input(InputKind::Ability(0)));
} }
else { else {
// If at desired energy level but not able to ward, just attack // If low on energy, use primary to attempt to regen energy
// Or if at desired energy level but not able to ward, just attack
controller controller
.actions .actions
.push(ControlAction::basic_input(InputKind::Primary)); .push(ControlAction::basic_input(InputKind::Primary));