mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Expanded AI P/T prediction with +1/+1 counters granting abilities.
This commit is contained in:
@@ -845,23 +845,32 @@ public class ComputerUtilCombat {
|
|||||||
for (SpellAbility ability : defender.getAllSpellAbilities()) {
|
for (SpellAbility ability : defender.getAllSpellAbilities()) {
|
||||||
if (!(ability instanceof AbilityActivated) || ability.getPayCosts() == null) {
|
if (!(ability instanceof AbilityActivated) || ability.getPayCosts() == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ability.getApi() != ApiType.Pump) {
|
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed") || ability.hasParam("ActivationZone")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed")) {
|
if (ability.getApi() == ApiType.Pump) {
|
||||||
continue;
|
if (!ability.hasParam("NumAtt")) {
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
if (!ability.hasParam("NumAtt")) {
|
|
||||||
continue;
|
if (ComputerUtilCost.canPayCost(ability, defender.getController())) {
|
||||||
}
|
int pBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("NumAtt"), ability);
|
||||||
|
if (pBonus > 0) {
|
||||||
if (ComputerUtilCost.canPayCost(ability, defender.getController())) {
|
power += pBonus;
|
||||||
int pBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("NumAtt"), ability);
|
}
|
||||||
if (pBonus > 0) {
|
}
|
||||||
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -966,18 +975,27 @@ public class ComputerUtilCombat {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed") || ability.hasParam("ActivationZone")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (ability.getApi() != ApiType.Pump || !ability.hasParam("NumDef")) {
|
if (ability.getApi() != ApiType.Pump || !ability.hasParam("NumDef")) {
|
||||||
continue;
|
if (ComputerUtilCost.canPayCost(ability, defender.getController())) {
|
||||||
}
|
int tBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("NumDef"), ability);
|
||||||
|
if (tBonus > 0) {
|
||||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed")) {
|
toughness += tBonus;
|
||||||
continue;
|
}
|
||||||
}
|
}
|
||||||
|
} else if (ability.getApi() == ApiType.PutCounter) {
|
||||||
if (ComputerUtilCost.canPayCost(ability, defender.getController())) {
|
if (!ability.hasParam("CounterType") || !ability.getParam("CounterType").equals("P1P1")) {
|
||||||
int tBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("NumDef"), ability);
|
continue;
|
||||||
if (tBonus > 0) {
|
}
|
||||||
toughness += tBonus;
|
|
||||||
|
if (ComputerUtilCost.canPayCost(ability, defender.getController())) {
|
||||||
|
int tBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("CounterNum"), ability);
|
||||||
|
if (tBonus > 0) {
|
||||||
|
toughness += tBonus;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1123,22 +1141,31 @@ public class ComputerUtilCombat {
|
|||||||
if (!(ability instanceof AbilityActivated) || ability.getPayCosts() == null) {
|
if (!(ability instanceof AbilityActivated) || ability.getPayCosts() == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ability.getApi() != ApiType.Pump) {
|
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed") || ability.hasParam("ActivationZone")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed")) {
|
if (ability.getApi() == ApiType.Pump) {
|
||||||
continue;
|
if (!ability.hasParam("NumAtt")) {
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
if (!ability.hasParam("NumAtt")) {
|
|
||||||
continue;
|
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
||||||
}
|
int pBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("NumAtt"), ability);
|
||||||
|
if (pBonus > 0) {
|
||||||
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
power += pBonus;
|
||||||
int pBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("NumAtt"), ability);
|
}
|
||||||
if (pBonus > 0) {
|
}
|
||||||
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1295,18 +1322,27 @@ public class ComputerUtilCombat {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed") || ability.hasParam("ActivationZone")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (ability.getApi() != ApiType.Pump || !ability.hasParam("NumDef")) {
|
if (ability.getApi() != ApiType.Pump || !ability.hasParam("NumDef")) {
|
||||||
continue;
|
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
||||||
}
|
int tBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("NumDef"), ability);
|
||||||
|
if (tBonus > 0) {
|
||||||
if (ability.hasParam("ActivationPhases") || ability.hasParam("SorcerySpeed")) {
|
toughness += tBonus;
|
||||||
continue;
|
}
|
||||||
}
|
}
|
||||||
|
} else if (ability.getApi() == ApiType.PutCounter) {
|
||||||
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
if (!ability.hasParam("CounterType") || !ability.getParam("CounterType").equals("P1P1")) {
|
||||||
int tBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("NumDef"), ability);
|
continue;
|
||||||
if (tBonus > 0) {
|
}
|
||||||
toughness += tBonus;
|
|
||||||
|
if (!ability.getPayCosts().hasTapCost() && ComputerUtilCost.canPayCost(ability, attacker.getController())) {
|
||||||
|
int tBonus = AbilityUtils.calculateAmount(ability.getSourceCard(), ability.getParam("CounterNum"), ability);
|
||||||
|
if (tBonus > 0) {
|
||||||
|
toughness += tBonus;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user