mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
AI: fixed error on targeting activated ability on stack (closes #12437);
This commit is contained in:
parent
e2066f41ab
commit
8f70039e3e
1 changed files with 15 additions and 10 deletions
|
|
@ -730,19 +730,24 @@ public class ComputerPlayer6 extends ComputerPlayer {
|
|||
xInfo = "x" + target.getTargetAmount(selectedId) + " ";
|
||||
}
|
||||
|
||||
String targetInfo;
|
||||
|
||||
String targetInfo = null;
|
||||
Player player = game.getPlayer(selectedId);
|
||||
MageObject object = game.getObject(selectedId);
|
||||
mage.game.stack.Spell spell = game.getSpellOrLKIStack(selectedId);
|
||||
|
||||
if (player != null) {
|
||||
targetInfo = player.getName();
|
||||
} else if (object != null) {
|
||||
targetInfo = object.getIdName();
|
||||
} else if (spell != null) {
|
||||
targetInfo = "spell - " + CardUtil.substring(spell.toString(), 20, "...");
|
||||
} else {
|
||||
}
|
||||
if (targetInfo == null) {
|
||||
MageObject object = game.getObject(selectedId);
|
||||
if (object != null) {
|
||||
targetInfo = object.getIdName();
|
||||
}
|
||||
}
|
||||
if (targetInfo == null) {
|
||||
StackObject stackObject = game.getState().getStack().getStackObject(selectedId);
|
||||
if (stackObject != null) {
|
||||
targetInfo = CardUtil.substring(stackObject.toString(), 20, "...");
|
||||
}
|
||||
}
|
||||
if (targetInfo == null) {
|
||||
targetInfo = "unknown";
|
||||
}
|
||||
allTargetsInfo.add(xInfo + targetInfo);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue