Commit b13e1e2b authored by Sol's avatar Sol

Merge branch 'hound' into 'master'

Update PlayerProperties "hasFewer"

Closes #1569

See merge request core-developers/forge!3120
parents c9634e37 25f844f5
......@@ -6,7 +6,6 @@ import forge.game.card.Card;
import forge.game.card.CardCollectionView;
import forge.game.card.CardLists;
import forge.game.card.CardPredicates;
import forge.game.card.CardPredicates.Presets;
import forge.game.spellability.SpellAbility;
import forge.game.zone.ZoneType;
import forge.util.Expressions;
......@@ -269,10 +268,11 @@ public class PlayerProperty {
return false;
}
} else if (property.startsWith("hasFewer")) {
final String cardType = property.split("sIn")[0].substring(8);
final Player controller = "Active".equals(property.split("Than")[1]) ? game.getPhaseHandler().getPlayerTurn() : sourceController;
final ZoneType zt = property.substring(8).startsWith("CreaturesInYard") ? ZoneType.Graveyard : ZoneType.Battlefield;
final CardCollectionView oppList = CardLists.filter(player.getCardsIn(zt), Presets.CREATURES);
final CardCollectionView yourList = CardLists.filter(controller.getCardsIn(zt), Presets.CREATURES);
final CardCollectionView oppList = CardLists.filter(player.getCardsIn(zt), CardPredicates.isType(cardType));
final CardCollectionView yourList = CardLists.filter(controller.getCardsIn(zt), CardPredicates.isType(cardType));
if (oppList.size() >= yourList.size()) {
return false;
}
......
......@@ -3,7 +3,7 @@ ManaCost:3 R
Types:Creature Goblin Mutant
PT:6/6
S:Mode$ CantAttack | ValidCard$ Card.Self | UnlessDefender$ hasFewerCreaturesInPlayThanYou | Description$ CARDNAME can't attack unless you control more creatures than defending player.
S:Mode$ Continuous | Affected$ Card.Self | AddHiddenKeyword$ CARDNAME can't block. | CheckSVar$ Y | SVarCompare$ GEX | Description$ CARDNAME can't block unless you control more creatures than attacking player.
S:Mode$ Continuous | Affected$ Card.Self | Condition$ NotPlayerTurn | AddHiddenKeyword$ CARDNAME can't block. | CheckSVar$ Y | SVarCompare$ GEX | Description$ CARDNAME can't block unless you control more creatures than attacking player.
SVar:X:Count$Valid Creature.YouCtrl
SVar:Y:Count$Valid Creature.ActivePlayerCtrl
SVar:BuffedBy:Creature
......
......@@ -3,7 +3,7 @@ ManaCost:1 R
Types:Creature Goblin
PT:2/2
S:Mode$ CantAttack | ValidCard$ Card.Self | UnlessDefender$ hasFewerCreaturesInPlayThanYou | Description$ CARDNAME can't attack unless you control more creatures than defending player.
S:Mode$ Continuous | Affected$ Card.Self | AddHiddenKeyword$ CARDNAME can't block. | CheckSVar$ Y | SVarCompare$ GEX | Description$ CARDNAME can't block unless you control more creatures than attacking player.
S:Mode$ Continuous | Affected$ Card.Self | Condition$ NotPlayerTurn | AddHiddenKeyword$ CARDNAME can't block. | CheckSVar$ Y | SVarCompare$ GEX | Description$ CARDNAME can't block unless you control more creatures than attacking player.
SVar:X:Count$Valid Creature.YouCtrl
SVar:Y:Count$Valid Creature.ActivePlayerCtrl
SVar:BuffedBy:Creature
......
......@@ -3,7 +3,8 @@ ManaCost:3 R
Types:Creature Dog
PT:4/4
S:Mode$ CantAttack | ValidCard$ Card.Self | UnlessDefender$ hasFewerLandsInPlayThanYou | Description$ CARDNAME can't attack unless you control more lands than defending player.
S:Mode$ Continuous | Affected$ Card.Self | AddHiddenKeyword$ CARDNAME can't block. | CheckSVar$ Y | SVarCompare$ GEX | Description$ CARDNAME can't block unless you control more lands than attacking player.
S:Mode$ Continuous | Affected$ Card.Self | Condition$ NotPlayerTurn | AddHiddenKeyword$ CARDNAME can't block. | CheckSVar$ Y | SVarCompare$ GEX | Description$ CARDNAME can't block unless you control more lands than attacking player.
SVar:X:Count$Valid Land.YouCtrl
SVar:Y:Count$Valid Land.ActivePlayerCtrl
SVar:BuffedBy:Land
Oracle:Monstrous Hound can't attack unless you control more lands than defending player.\nMonstrous Hound can't block unless you control more lands than attacking player.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment