mirror of
https://github.com/correl/mage.git
synced 2025-04-06 01:04:10 -09:00
Fixed Issue#53: AI casts Rancor, but Rancor goes to graveyard
This commit is contained in:
parent
0758f4bb72
commit
cc4d772483
3 changed files with 16 additions and 4 deletions
Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai
Mage/src/mage/target
|
@ -221,6 +221,11 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
|||
Ability ability = actions.poll();
|
||||
System.out.println("[" + game.getPlayer(playerId).getName() + "] Action: " + ability.toString());
|
||||
if (ability.getTargets().size() > 0) {
|
||||
for (Target target : ability.getTargets()) {
|
||||
for (UUID id : target.getTargets()) {
|
||||
target.updateTarget(id, game);
|
||||
}
|
||||
}
|
||||
Player player = game.getPlayer(ability.getFirstTarget());
|
||||
if (player != null) {
|
||||
System.out.println("targets = " + player.getName());
|
||||
|
|
|
@ -28,16 +28,17 @@
|
|||
|
||||
package mage.target;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.filter.Filter;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
@ -69,6 +70,7 @@ public interface Target extends Serializable {
|
|||
public boolean choose(Outcome outcome, UUID playerId, UUID sourceId, Game game);
|
||||
public void add(UUID id, Game game);
|
||||
public void remove(UUID targetId);
|
||||
public void updateTarget(UUID targetId, Game game);
|
||||
|
||||
public String getMessage();
|
||||
public String getTargetName();
|
||||
|
|
|
@ -202,6 +202,11 @@ public abstract class TargetImpl<T extends TargetImpl<T>> implements Target {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTarget(UUID id, Game game) {
|
||||
rememberZoneChangeCounter(id, game);
|
||||
}
|
||||
|
||||
private void rememberZoneChangeCounter(UUID id, Game game) {
|
||||
Card card = game.getCard(id);
|
||||
|
|
Loading…
Add table
Reference in a new issue