This commit is contained in:
tool4EvEr
2023-01-26 10:15:53 +01:00
parent 616309c22f
commit 5ae42b4c71
7 changed files with 11 additions and 12 deletions

View File

@@ -1637,6 +1637,8 @@ public class AiController {
return false; return false;
} }
// TODO needed to pay propaganda
return true; return true;
} }

View File

@@ -240,9 +240,9 @@ public class AiCostDecision extends CostDecisionMakerBase {
@Override @Override
public PaymentDecision visit(final CostEnlist cost) { public PaymentDecision visit(final CostEnlist cost) {
CardCollection choices = cost.getCardsForEnlisting(player, source, ability); CardCollection choices = CostEnlist.getCardsForEnlisting(player);
CardLists.sortByPowerDesc(choices); CardLists.sortByPowerDesc(choices);
return PaymentDecision.card(choices.getFirst()); return choices.isEmpty() ? null : PaymentDecision.card(choices.getFirst());
} }
@Override @Override

View File

@@ -1208,6 +1208,8 @@ public class ComputerUtilCombat {
theTriggers.addAll(blocker.getTriggers()); theTriggers.addAll(blocker.getTriggers());
} }
// TODO consider Exert + Enlist
// look out for continuous static abilities that only care for attacking creatures // look out for continuous static abilities that only care for attacking creatures
if (!withoutCombatStaticAbilities) { if (!withoutCombatStaticAbilities) {
final CardCollectionView cardList = CardCollection.combine(game.getCardsIn(ZoneType.Battlefield), game.getCardsIn(ZoneType.Command)); final CardCollectionView cardList = CardCollection.combine(game.getCardsIn(ZoneType.Battlefield), game.getCardsIn(ZoneType.Command));

View File

@@ -341,7 +341,7 @@ public class PlayerControllerAi extends PlayerController {
@Override @Override
public List<Card> enlistAttackers(List<Card> attackers) { public List<Card> enlistAttackers(List<Card> attackers) {
CardCollection cards = CostEnlist.getCardsForEnlisting(brains.getPlayer(), null, null); CardCollection cards = CostEnlist.getCardsForEnlisting(brains.getPlayer());
ComputerUtilCard.sortByEvaluateCreature(new CardCollection(attackers)); ComputerUtilCard.sortByEvaluateCreature(new CardCollection(attackers));
// do not enlist more than available payment choices // do not enlist more than available payment choices
attackers = attackers.subList(0, cards.size()); attackers = attackers.subList(0, cards.size());

View File

@@ -1081,10 +1081,6 @@ public class CardProperty {
if (card.isFirstTurnControlled()) { if (card.isFirstTurnControlled()) {
return false; return false;
} }
} else if (property.startsWith("sick")) {
if (!card.isSick()) {
return false;
}
} else if (property.startsWith("startedTheTurnUntapped")) { } else if (property.startsWith("startedTheTurnUntapped")) {
if (!card.hasStartedTheTurnUntapped()) { if (!card.hasStartedTheTurnUntapped()) {
return false; return false;

View File

@@ -26,7 +26,6 @@ import forge.game.card.CardLists;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
import forge.game.trigger.TriggerType; import forge.game.trigger.TriggerType;
import forge.game.zone.ZoneType;
/** /**
* The Class CostExert. * The Class CostExert.
@@ -70,7 +69,7 @@ public class CostEnlist extends CostPartWithTrigger {
*/ */
@Override @Override
public final boolean canPay(final SpellAbility ability, final Player payer, final boolean effect) { public final boolean canPay(final SpellAbility ability, final Player payer, final boolean effect) {
return true; return !getCardsForEnlisting(payer).isEmpty();
} }
@Override @Override
@@ -101,8 +100,8 @@ public class CostEnlist extends CostPartWithTrigger {
return visitor.visit(this); return visitor.visit(this);
} }
public static CardCollection getCardsForEnlisting(Player active, Card source, SpellAbility paySA) { public static CardCollection getCardsForEnlisting(Player active) {
return CardLists.getValidCards(active.getCardsIn(ZoneType.Battlefield), "Creature.notattacking+untapped+!sick", active, source, paySA); return CardLists.filter(active.getCreaturesInPlay(), c -> c.isUntapped() && !c.isSick() && !c.isAttacking());
} }
} }

View File

@@ -468,7 +468,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
@Override @Override
public PaymentDecision visit(final CostEnlist cost) { public PaymentDecision visit(final CostEnlist cost) {
CardCollectionView list = cost.getCardsForEnlisting(player, source, ability); CardCollectionView list = CostEnlist.getCardsForEnlisting(player);
if (list.isEmpty()) { if (list.isEmpty()) {
return null; return null;
} }