mirror of
https://github.com/correl/mage.git
synced 2024-11-21 19:18:40 +00:00
Added AI Targeting for TargetActivatedOrTriggeredAbility. Closes #9276.
This commit is contained in:
parent
f26f56736a
commit
137f02f31b
1 changed files with 12 additions and 0 deletions
|
@ -661,6 +661,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
|
||||
// TODO: implemented findBestPlayerTargets
|
||||
// TODO: add findBest*Targets for all target types
|
||||
// TODO: Much of this code needs to be re-written to move code into Target.possibleTargets
|
||||
// A) Having it here makes this function ridiculously long
|
||||
// B) Each time a new target type is added, people must remember to add it here
|
||||
if (target.getOriginalTarget() instanceof TargetPermanent) {
|
||||
|
||||
FilterPermanent filter = null;
|
||||
|
@ -1043,6 +1046,15 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
return target.isChosen();
|
||||
}
|
||||
|
||||
if (target.getOriginalTarget() instanceof TargetActivatedOrTriggeredAbility
|
||||
|| target.getOriginalTarget() instanceof TargetActivatedOrTriggeredAbilityOrLegendarySpell) {
|
||||
Iterator<UUID> iterator = target.possibleTargets(source.getControllerId(), source, game).iterator();
|
||||
while (!target.isChosen() && iterator.hasNext()) {
|
||||
target.addTarget(iterator.next(), source, game);
|
||||
}
|
||||
return target.isChosen();
|
||||
}
|
||||
|
||||
if (target.getOriginalTarget() instanceof TargetCardInGraveyardBattlefieldOrStack) {
|
||||
List<Card> cards = new ArrayList<>();
|
||||
for (Player player : game.getPlayers().values()) {
|
||||
|
|
Loading…
Reference in a new issue