mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
* Fixed a problem with the AI handling of TARGETED event (e.g. Silverfur Partisan not triggering - fixes #1916).
This commit is contained in:
parent
c34a5de186
commit
773decf593
2 changed files with 7 additions and 4 deletions
|
@ -266,7 +266,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
|||
}
|
||||
|
||||
protected void act(Game game) {
|
||||
if (actions == null || actions.size() == 0) {
|
||||
if (actions == null || actions.isEmpty()) {
|
||||
pass(game);
|
||||
} else {
|
||||
boolean usedStack = false;
|
||||
|
@ -277,6 +277,9 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
|||
for (Target target : ability.getTargets()) {
|
||||
for (UUID id : target.getTargets()) {
|
||||
target.updateTarget(id, game);
|
||||
if (!target.isNotTarget()) {
|
||||
game.addSimultaneousEvent(GameEvent.getEvent(GameEvent.EventType.TARGETED, id, ability.getSourceId(), ability.getControllerId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Player player = game.getPlayer(ability.getFirstTarget());
|
||||
|
@ -1200,6 +1203,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* private boolean shouldAttack(Game game, UUID attackingPlayerId, UUID
|
||||
* defenderId, Permanent attacker, List<Permanent> blockers, int
|
||||
|
|
|
@ -141,8 +141,7 @@ public abstract class TargetImpl implements Target {
|
|||
}
|
||||
if (targetName.startsWith("another") || targetName.startsWith("a ") || targetName.startsWith("an ")) {
|
||||
return "Select " + targetName + suffix;
|
||||
}
|
||||
else if (targetName.startsWith("a") || targetName.startsWith("e") || targetName.startsWith("i") || targetName.startsWith("o") || targetName.startsWith("u")) {
|
||||
} else if (targetName.startsWith("a") || targetName.startsWith("e") || targetName.startsWith("i") || targetName.startsWith("o") || targetName.startsWith("u")) {
|
||||
return "Select an " + targetName + suffix;
|
||||
}
|
||||
return "Select a " + targetName + suffix;
|
||||
|
@ -255,7 +254,7 @@ public abstract class TargetImpl implements Target {
|
|||
rememberZoneChangeCounter(id, game);
|
||||
chosen = targets.size() >= getNumberOfTargets();
|
||||
if (!skipEvent) {
|
||||
game.fireEvent(GameEvent.getEvent(EventType.TARGETED, id, source.getSourceId(), source.getControllerId()));
|
||||
game.addSimultaneousEvent(GameEvent.getEvent(EventType.TARGETED, id, source.getSourceId(), source.getControllerId()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue