mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Better fix for the AI cheating with X values on replay (fixing the cause and not the effect).
This commit is contained in:
@@ -2654,11 +2654,6 @@ public class ComputerUtil {
|
|||||||
AiController aic = ((PlayerControllerAi) ai.getController()).getAi();
|
AiController aic = ((PlayerControllerAi) ai.getController()).getAi();
|
||||||
Card targetSpellCard = null;
|
Card targetSpellCard = null;
|
||||||
for (Card c : options) {
|
for (Card c : options) {
|
||||||
if (withoutPayingManaCost && c.getManaCost() != null && c.getManaCost().getShardCount(ManaCostShard.X) > 0) {
|
|
||||||
// The AI will otherwise cheat with the mana payment, announcing X > 0 for spells like Heat Ray when replaying them
|
|
||||||
// without paying their mana cost.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (SpellAbility ab : c.getSpellAbilities()) {
|
for (SpellAbility ab : c.getSpellAbilities()) {
|
||||||
if (ab.getApi() == null) {
|
if (ab.getApi() == null) {
|
||||||
// only API-based SAs are supported, other things may lead to a NPE (e.g. Ancestral Vision Suspend SA)
|
// only API-based SAs are supported, other things may lead to a NPE (e.g. Ancestral Vision Suspend SA)
|
||||||
|
|||||||
@@ -184,9 +184,15 @@ public class GameAction {
|
|||||||
zoneChangedEarly = true;
|
zoneChangedEarly = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up the temporary Dash SVar when the Dashed card leaves the battlefield
|
if (fromBattlefield) {
|
||||||
if (fromBattlefield && c.getSVar("EndOfTurnLeavePlay").equals("Dash")) {
|
// Clean up the temporary Dash SVar when the Dashed card leaves the battlefield
|
||||||
c.removeSVar("EndOfTurnLeavePlay");
|
if (c.getSVar("EndOfTurnLeavePlay").equals("Dash")) {
|
||||||
|
c.removeSVar("EndOfTurnLeavePlay");
|
||||||
|
}
|
||||||
|
// Clean up the temporary X announcement variable used by the AI
|
||||||
|
if (!zoneTo.is(ZoneType.Stack) && c.hasSVar("PayX")) {
|
||||||
|
c.removeSVar("PayX");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fromBattlefield && !toBattlefield) {
|
if (fromBattlefield && !toBattlefield) {
|
||||||
|
|||||||
Reference in New Issue
Block a user