mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Added some code for XChoice in decideAIPayment of CostTapType.
This commit is contained in:
@@ -165,9 +165,18 @@ public class CostTapType extends CostPartWithList {
|
||||
@Override
|
||||
public final boolean decideAIPayment(final SpellAbility ability, final Card source, final CostPayment payment) {
|
||||
final boolean tap = payment.getCost().getTap();
|
||||
final Integer c = this.convertAmount();
|
||||
final String amount = this.getAmount();
|
||||
Integer c = this.convertAmount();
|
||||
if (c == null) {
|
||||
// Determine Amount
|
||||
final String sVar = source.getSVar(amount);
|
||||
if (sVar.equals("XChoice")) {
|
||||
CardList typeList = ability.getActivatingPlayer().getCardsIn(Zone.Battlefield);
|
||||
typeList = typeList.getValidCards(this.getType().split(";"), ability.getActivatingPlayer(),
|
||||
ability.getSourceCard());
|
||||
typeList = typeList.filter(CardListFilter.UNTAPPED);
|
||||
c = typeList.size();
|
||||
source.setSVar("ChosenX", "Number$" + Integer.toString(c));
|
||||
}
|
||||
}
|
||||
|
||||
this.setList(ComputerUtil.chooseTapType(this.getType(), source, tap, c));
|
||||
|
||||
Reference in New Issue
Block a user