mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
previous fix wasn't 100% correct.
This commit is contained in:
parent
e189543699
commit
27010a2089
3 changed files with 14 additions and 2 deletions
|
|
@ -279,7 +279,7 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
|
|||
targets = threats(opponentId, ((FilterCreatureOrPlayer)t.getFilter()).getCreatureFilter(), game);
|
||||
}
|
||||
for (Permanent permanent: targets) {
|
||||
if (((TargetPermanent)target).canTarget(playerId, permanent.getId(), source, game)) {
|
||||
if (t.canTarget(playerId, permanent.getId(), source, game)) {
|
||||
target.addTarget(permanent.getId(), source, game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Sat Feb 12 11:24:53 MSK 2011
|
||||
#Sat Feb 12 23:42:53 MSK 2011
|
||||
version=0.6
|
||||
groupId=org.mage
|
||||
artifactId=Mage-Tournament-BoosterDraft
|
||||
|
|
|
|||
|
|
@ -107,6 +107,18 @@ public class TargetCreatureOrPlayer extends TargetImpl<TargetCreatureOrPlayer> {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(id);
|
||||
if (permanent != null) {
|
||||
if (source != null)
|
||||
//TODO: check for replacement effects
|
||||
return permanent.canBeTargetedBy(game.getObject(source.getSourceId())) && filter.match(permanent, controllerId, game);
|
||||
else
|
||||
return filter.match(permanent, controllerId, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if there are enough {@link Permanent} or {@link Player} that can be chosen. Should only be used
|
||||
* for Ability targets since this checks for protection, shroud etc.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue