mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
CostTapType: for Crew add Keyword "CARDNAME can't crew a vehicle",
now the cost does check that the creatures does not have this.
This commit is contained in:
@@ -433,7 +433,7 @@ public class AiCostDecision extends CostDecisionMakerBase {
|
||||
totalPower = true;
|
||||
totalP = type.split("withTotalPowerGE")[1];
|
||||
type = type.replace("+withTotalPowerGE" + totalP, "");
|
||||
totap = ComputerUtil.chooseTapTypeAccumulatePower(player, type, source, !cost.canTapSource, Integer.parseInt(totalP), tapped);
|
||||
totap = ComputerUtil.chooseTapTypeAccumulatePower(player, type, ability, !cost.canTapSource, Integer.parseInt(totalP), tapped);
|
||||
} else {
|
||||
totap = ComputerUtil.chooseTapType(player, type, source, !cost.canTapSource, c, tapped);
|
||||
}
|
||||
|
||||
@@ -497,14 +497,19 @@ public class ComputerUtil {
|
||||
return tapList;
|
||||
}
|
||||
|
||||
public static CardCollection chooseTapTypeAccumulatePower(final Player ai, final String type, final Card activate, final boolean tap, final int amount, final CardCollectionView exclude) {
|
||||
public static CardCollection chooseTapTypeAccumulatePower(final Player ai, final String type, final SpellAbility sa, final boolean tap, final int amount, final CardCollectionView exclude) {
|
||||
// Used for Crewing vehicles, ideally we sort by useless creatures. Can't Attack/Defender
|
||||
int totalPower = 0;
|
||||
final Card activate = sa.getHostCard();
|
||||
|
||||
CardCollection all = new CardCollection(ai.getCardsIn(ZoneType.Battlefield));
|
||||
all.removeAll(exclude);
|
||||
CardCollection typeList =
|
||||
CardLists.getValidCards(all, type.split(";"), activate.getController(), activate, null);
|
||||
CardLists.getValidCards(all, type.split(";"), activate.getController(), activate, sa);
|
||||
|
||||
if (sa.hasParam("Crew")) {
|
||||
typeList = CardLists.getNotKeyword(typeList, "CARDNAME can't crew a vehicle");
|
||||
}
|
||||
|
||||
// is this needed?
|
||||
typeList = CardLists.filter(typeList, Presets.UNTAPPED);
|
||||
|
||||
@@ -128,6 +128,10 @@ public class CostTapType extends CostPartWithList {
|
||||
}
|
||||
typeList = CardLists.filter(typeList, Presets.UNTAPPED);
|
||||
|
||||
if (ability.hasParam("Crew")) {
|
||||
typeList = CardLists.getNotKeyword(typeList, "CARDNAME can't crew a vehicle");
|
||||
}
|
||||
|
||||
if (sameType) {
|
||||
for (final Card card : typeList) {
|
||||
if (CardLists.filter(typeList, new Predicate<Card>() {
|
||||
|
||||
@@ -1093,6 +1093,11 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
CardCollection typeList = CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), type.split(";"), player,
|
||||
source, ability);
|
||||
typeList = CardLists.filter(typeList, Presets.UNTAPPED);
|
||||
|
||||
if (ability.hasParam("Crew")) {
|
||||
typeList = CardLists.getNotKeyword(typeList, "CARDNAME can't crew a vehicle");
|
||||
}
|
||||
|
||||
if (c == null && !amount.equals("Any")) {
|
||||
final String sVar = ability.getSVar(amount);
|
||||
// Generalize this
|
||||
|
||||
Reference in New Issue
Block a user