mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Improved CountersPutAi.
This commit is contained in:
@@ -158,6 +158,12 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
amount = ComputerUtilMana.determineLeftoverMana(sa, ai);
|
amount = ComputerUtilMana.determineLeftoverMana(sa, ai);
|
||||||
source.setSVar("PayX", Integer.toString(amount));
|
source.setSVar("PayX", Integer.toString(amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't use it if no counters to add
|
||||||
|
if (amount <= 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ("Polukranos".equals(sa.getParam("AILogic"))) {
|
if ("Polukranos".equals(sa.getParam("AILogic"))) {
|
||||||
List<Card> humCreatures = ai.getOpponent().getCreaturesInPlay();
|
List<Card> humCreatures = ai.getOpponent().getCreaturesInPlay();
|
||||||
//TODO how to grab target restrictions from subsequent triggered ability?
|
//TODO how to grab target restrictions from subsequent triggered ability?
|
||||||
@@ -187,11 +193,6 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't use it if no counters to add
|
|
||||||
if (amount <= 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Targeting
|
// Targeting
|
||||||
if (abTgt != null) {
|
if (abTgt != null) {
|
||||||
sa.resetTargets();
|
sa.resetTargets();
|
||||||
@@ -284,13 +285,16 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!type.equals("P1P1") && !type.equals("M1M1") && !sa.hasParam("ActivationPhases")) {
|
||||||
// Don't use non P1P1/M1M1 counters before main 2 if possible
|
// Don't use non P1P1/M1M1 counters before main 2 if possible
|
||||||
if (ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2)
|
if (ph.getPhase().isBefore(PhaseType.MAIN2)
|
||||||
&& !sa.hasParam("ActivationPhases")
|
|
||||||
&& !(type.equals("P1P1") || type.equals("M1M1"))
|
|
||||||
&& !ComputerUtil.castSpellInMain1(ai, sa)) {
|
&& !ComputerUtil.castSpellInMain1(ai, sa)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (ph.isPlayerTurn(ai) && !isSorcerySpeed(sa)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ComputerUtil.waitForBlocking(sa)) {
|
if (ComputerUtil.waitForBlocking(sa)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user