mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Fixed AI moving counters from Spike Soldier onto itself.
This commit is contained in:
@@ -12,6 +12,8 @@ import forge.game.card.CardLists;
|
|||||||
import forge.game.card.CounterType;
|
import forge.game.card.CounterType;
|
||||||
import forge.game.combat.CombatUtil;
|
import forge.game.combat.CombatUtil;
|
||||||
import forge.game.cost.Cost;
|
import forge.game.cost.Cost;
|
||||||
|
import forge.game.cost.CostPart;
|
||||||
|
import forge.game.cost.CostRemoveCounter;
|
||||||
import forge.game.phase.PhaseHandler;
|
import forge.game.phase.PhaseHandler;
|
||||||
import forge.game.phase.PhaseType;
|
import forge.game.phase.PhaseType;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -65,9 +67,26 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ComputerUtilCost.checkRemoveCounterCost(abCost, source)) {
|
// disable moving counters
|
||||||
|
for (final CostPart part : abCost.getCostParts()) {
|
||||||
|
if (part instanceof CostRemoveCounter) {
|
||||||
|
final CostRemoveCounter remCounter = (CostRemoveCounter) part;
|
||||||
|
final CounterType counterType = remCounter.counter;
|
||||||
|
if (counterType.name().equals(type)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!part.payCostFromSource()) {
|
||||||
|
if (counterType.name().equals("P1P1")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//don't kill the creature
|
||||||
|
if (counterType.name().equals("P1P1") && source.getLethalDamage() <= 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sa.hasParam("Monstrosity") && source.isMonstrous()) {
|
if (sa.hasParam("Monstrosity") && source.isMonstrous()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user