mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
* Armory Automaton - fixed infinite AI choose (#5023);
This commit is contained in:
parent
ec9198fb22
commit
a0805327d1
1 changed files with 5 additions and 4 deletions
|
@ -88,7 +88,9 @@ class ArmoryAutomatonEffect extends OneShotEffect {
|
|||
while (player.canRespond() && countBattlefield > 0 && player.chooseUse(Outcome.Benefit, "Select and attach a target Equipment?", source, game)) {
|
||||
Target targetEquipment = new TargetPermanent(currentFilter);
|
||||
targetEquipment.setRequired(false);
|
||||
if (player.choose(Outcome.Benefit, targetEquipment, source.getSourceId(), game)) {
|
||||
if (player.choose(Outcome.Benefit, targetEquipment, source.getSourceId(), game) && targetEquipment.getFirstTarget() != null) {
|
||||
currentFilter.add(Predicates.not(new PermanentIdPredicate(targetEquipment.getFirstTarget()))); // exclude selected for next time
|
||||
|
||||
Permanent aura = game.getPermanent(targetEquipment.getFirstTarget());
|
||||
if (aura != null) {
|
||||
Permanent attachedTo = game.getPermanent(aura.getAttachedTo());
|
||||
|
@ -96,10 +98,9 @@ class ArmoryAutomatonEffect extends OneShotEffect {
|
|||
attachedTo.removeAttachment(aura.getId(), game);
|
||||
}
|
||||
sourcePermanent.addAttachment(aura.getId(), game);
|
||||
|
||||
// exclude selected
|
||||
currentFilter.add(Predicates.not(new PermanentIdPredicate(aura.getId())));
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
countBattlefield = game.getBattlefield().getAllActivePermanents(currentFilter, game).size();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue