mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Added the SVar NeedsToPlay. The AI won't play cards with it unless a valid card is on the battlefield.
- Updated the Lairs to use it.
This commit is contained in:
@@ -762,6 +762,19 @@ public class ComputerUtil
|
||||
for (Card crd : lands)
|
||||
landList.add(crd);
|
||||
}
|
||||
|
||||
landList = landList.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
if (c.getSVar("NeedsToPlay").length() > 0) {
|
||||
String needsToPlay = c.getSVar("NeedsToPlay");
|
||||
CardList list = AllZoneUtil.getCardsInPlay();
|
||||
|
||||
list = list.getValidCards(needsToPlay.split(","), c.getController(), c);
|
||||
if (list.isEmpty()) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
while(!landList.isEmpty() && computer.canPlayLand()){
|
||||
// play as many lands as you can
|
||||
|
||||
@@ -228,6 +228,14 @@ public class Spell_Permanent extends Spell {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (card.getSVar("NeedsToPlay").length() > 0) {
|
||||
String needsToPlay = card.getSVar("NeedsToPlay");
|
||||
CardList list = AllZoneUtil.getCardsInPlay();
|
||||
|
||||
list = list.getValidCards(needsToPlay.split(","), card.getController(), card);
|
||||
if (list.isEmpty()) return false;
|
||||
}
|
||||
|
||||
if (!checkETBEffects(card, this, null))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user