mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Cleanup of hasCandidates.
This commit is contained in:
@@ -660,7 +660,7 @@ public class Target {
|
|||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public final boolean hasCandidates(final SpellAbility sa, final boolean isTargeted) {
|
public final boolean hasCandidates(final SpellAbility sa, final boolean isTargeted) {
|
||||||
final GameState game = sa.getActivatingPlayer().getGame();
|
final GameState game = sa.getSourceCard().getGame();
|
||||||
for (Player player : game.getPlayers()) {
|
for (Player player : game.getPlayers()) {
|
||||||
if (sa.canTarget(player)) {
|
if (sa.canTarget(player)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -672,13 +672,16 @@ public class Target {
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
for (final Card c : game.getCardsIn(this.tgtZone)) {
|
for (final Card c : game.getCardsIn(this.tgtZone)) {
|
||||||
boolean isValidTarget = c.isValid(this.validTgts, this.srcCard.getController(), this.srcCard);
|
if (!c.isValid(this.validTgts, this.srcCard.getController(), this.srcCard)) {
|
||||||
boolean canTarget = (!isTargeted || c.canBeTargetedBy(sa));
|
continue;
|
||||||
boolean isAlreadyTargeted = this.getTargetCards().contains(c);
|
|
||||||
//System.out.print(c);
|
|
||||||
if (isValidTarget && canTarget && !isAlreadyTargeted) {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
if (isTargeted && !c.canBeTargetedBy(sa)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (this.getTargetCards().contains(c)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user