mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Merge pull request #139 from Northmoc/changenum_defaults
AI: "ChangeNum" defaults
This commit is contained in:
@@ -709,7 +709,8 @@ public class SpecialCardAi {
|
||||
}
|
||||
}
|
||||
|
||||
int changeNum = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("ChangeNum"), sa);
|
||||
int changeNum = AbilityUtils.calculateAmount(sa.getHostCard(),
|
||||
sa.getParamOrDefault("ChangeNum", "1"), sa);
|
||||
CardCollection lib = CardLists.filter(ai.getCardsIn(ZoneType.Library),
|
||||
Predicates.not(CardPredicates.nameEquals(sa.getHostCard().getName())));
|
||||
Collections.sort(lib, CardLists.CmcComparatorInv);
|
||||
|
||||
@@ -387,15 +387,13 @@ public class ChangeZoneAi extends SpellAbilityAi {
|
||||
return false;
|
||||
}
|
||||
|
||||
String num = sa.getParam("ChangeNum");
|
||||
if (num != null) {
|
||||
if (num.contains("X") && sa.getSVar("X").equals("Count$xPaid")) {
|
||||
// Set PayX here to maximum value.
|
||||
int xPay = ComputerUtilCost.getMaxXValue(sa, ai, sa.isTrigger());
|
||||
if (xPay == 0) return false;
|
||||
xPay = Math.min(xPay, list.size());
|
||||
sa.setXManaCostPaid(xPay);
|
||||
}
|
||||
String num = sa.getParamOrDefault("ChangeNum", "1");
|
||||
if (num.contains("X") && sa.getSVar("X").equals("Count$xPaid")) {
|
||||
// Set PayX here to maximum value.
|
||||
int xPay = ComputerUtilCost.getMaxXValue(sa, ai, sa.isTrigger());
|
||||
if (xPay == 0) return false;
|
||||
xPay = Math.min(xPay, list.size());
|
||||
sa.setXManaCostPaid(xPay);
|
||||
}
|
||||
|
||||
if (sourceName.equals("Temur Sabertooth")) {
|
||||
|
||||
Reference in New Issue
Block a user