mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Expanded AI P/T prediction with +1/+1 counters granting abilities.
This commit is contained in:
@@ -846,14 +846,11 @@ public class ComputerUtilCombat {
|
||||
if (!(ability instanceof AbilityActivated) || ability.getPayCosts() == null) {
|
||||
continue;
|
||||
}
|
||||
if (ability.getApi() != ApiType.Pump) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed")) {
|
||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed") || ability.hasParam("ActivationZone")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability.getApi() == ApiType.Pump) {
|
||||
if (!ability.hasParam("NumAtt")) {
|
||||
continue;
|
||||
}
|
||||
@@ -864,6 +861,18 @@ public class ComputerUtilCombat {
|
||||
power += pBonus;
|
||||
}
|
||||
}
|
||||
} else if (ability.getApi() == ApiType.PutCounter) {
|
||||
if (!ability.hasParam("CounterType") || !ability.getParam("CounterType").equals("P1P1")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ComputerUtilCost.canPayCost(ability, defender.getController())) {
|
||||
int pBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("CounterNum"), ability);
|
||||
if (pBonus > 0) {
|
||||
power += pBonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return power;
|
||||
}
|
||||
@@ -966,20 +975,29 @@ public class ComputerUtilCombat {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed") || ability.hasParam("ActivationZone")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability.getApi() != ApiType.Pump || !ability.hasParam("NumDef")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ComputerUtilCost.canPayCost(ability, defender.getController())) {
|
||||
int tBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("NumDef"), ability);
|
||||
if (tBonus > 0) {
|
||||
toughness += tBonus;
|
||||
}
|
||||
}
|
||||
} else if (ability.getApi() == ApiType.PutCounter) {
|
||||
if (!ability.hasParam("CounterType") || !ability.getParam("CounterType").equals("P1P1")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ComputerUtilCost.canPayCost(ability, defender.getController())) {
|
||||
int tBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("CounterNum"), ability);
|
||||
if (tBonus > 0) {
|
||||
toughness += tBonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return toughness;
|
||||
}
|
||||
@@ -1123,14 +1141,11 @@ public class ComputerUtilCombat {
|
||||
if (!(ability instanceof AbilityActivated) || ability.getPayCosts() == null) {
|
||||
continue;
|
||||
}
|
||||
if (ability.getApi() != ApiType.Pump) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed")) {
|
||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed") || ability.hasParam("ActivationZone")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability.getApi() == ApiType.Pump) {
|
||||
if (!ability.hasParam("NumAtt")) {
|
||||
continue;
|
||||
}
|
||||
@@ -1141,6 +1156,18 @@ public class ComputerUtilCombat {
|
||||
power += pBonus;
|
||||
}
|
||||
}
|
||||
} else if (ability.getApi() == ApiType.PutCounter) {
|
||||
if (!ability.hasParam("CounterType") || !ability.getParam("CounterType").equals("P1P1")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
||||
int pBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("CounterNum"), ability);
|
||||
if (pBonus > 0) {
|
||||
power += pBonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return power;
|
||||
}
|
||||
@@ -1295,20 +1322,29 @@ public class ComputerUtilCombat {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed") || ability.hasParam("ActivationZone")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability.getApi() != ApiType.Pump || !ability.hasParam("NumDef")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
||||
int tBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("NumDef"), ability);
|
||||
if (tBonus > 0) {
|
||||
toughness += tBonus;
|
||||
}
|
||||
}
|
||||
} else if (ability.getApi() == ApiType.PutCounter) {
|
||||
if (!ability.hasParam("CounterType") || !ability.getParam("CounterType").equals("P1P1")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
||||
int tBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("CounterNum"), ability);
|
||||
if (tBonus > 0) {
|
||||
toughness += tBonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return toughness;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user