mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Some minor changes.
This commit is contained in:
parent
f777668a4d
commit
54b40646d9
37 changed files with 202 additions and 320 deletions
|
|
@ -91,12 +91,28 @@ public class CardsInHandCondition implements Condition {
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case ACTIVE:
|
||||
Player player = game.getPlayer(game.getActivePlayerId());
|
||||
if (player != null) {
|
||||
switch (this.type) {
|
||||
case FEWER_THAN:
|
||||
conditionApplies = player.getHand().size() < this.count;
|
||||
break;
|
||||
case MORE_THAN:
|
||||
conditionApplies = player.getHand().size() > this.count;
|
||||
break;
|
||||
case EQUAL_TO:
|
||||
conditionApplies = player.getHand().size() == this.count;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ANY:
|
||||
boolean conflict = false;
|
||||
switch (this.type) {
|
||||
case FEWER_THAN:
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.getHand().size() >= this.count) {
|
||||
conflict = true;
|
||||
|
|
@ -107,7 +123,7 @@ public class CardsInHandCondition implements Condition {
|
|||
break;
|
||||
case MORE_THAN:
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.getHand().size() <= this.count) {
|
||||
conflict = true;
|
||||
|
|
@ -118,7 +134,7 @@ public class CardsInHandCondition implements Condition {
|
|||
break;
|
||||
case EQUAL_TO:
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.getHand().size() != this.count) {
|
||||
conflict = true;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public class StaticFilters {
|
|||
public static final FilterCard FILTER_CARD_ARTIFACT_OR_CREATURE = new FilterCard("artifact or creature card");
|
||||
|
||||
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_GOBLINS = new FilterCreaturePermanent("Goblin", "Goblin creatures");
|
||||
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_SLIVERS = new FilterCreaturePermanent("Sliver", "Sliver creatures");
|
||||
|
||||
static {
|
||||
FILTER_PERMANENT_ARTIFACT_OR_CREATURE.add(Predicates.or(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue