mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Move controllerChangeZoneCorrection to checkStaticAbilities
This commit is contained in:
@@ -672,9 +672,9 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
public final void checkStaticAbilities() { // TODO return checkagain in SBA
|
public final boolean checkStaticAbilities() {
|
||||||
if (game.isGameOver()) {
|
if (game.isGameOver()) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove old effects
|
// remove old effects
|
||||||
@@ -755,13 +755,25 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean checkAgain = false;
|
||||||
|
for (Player p : game.getPlayers()) {
|
||||||
|
for (Card c : p.getCardsIn(ZoneType.Battlefield)) {
|
||||||
|
if (!c.getController().equals(p)) {
|
||||||
|
controllerChangeZoneCorrection(c);
|
||||||
|
checkAgain = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!affectedCards.isEmpty()) {
|
if (!affectedCards.isEmpty()) {
|
||||||
game.fireEvent(new GameEventCardStatsChanged(affectedCards));
|
game.fireEvent(new GameEventCardStatsChanged(affectedCards));
|
||||||
|
checkAgain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||||
game.getTriggerHandler().runTrigger(TriggerType.Always, runParams, false);
|
game.getTriggerHandler().runTrigger(TriggerType.Always, runParams, false);
|
||||||
|
|
||||||
|
return checkAgain;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -797,17 +809,9 @@ public class GameAction {
|
|||||||
// do this twice, sometimes creatures/permanents will survive when they
|
// do this twice, sometimes creatures/permanents will survive when they
|
||||||
// shouldn't
|
// shouldn't
|
||||||
for (int q = 0; q < 9; q++) {
|
for (int q = 0; q < 9; q++) {
|
||||||
boolean checkAgain = false;
|
boolean checkAgain = this.checkStaticAbilities();
|
||||||
|
|
||||||
this.checkStaticAbilities();
|
|
||||||
|
|
||||||
for (Player p : game.getPlayers()) {
|
for (Player p : game.getPlayers()) {
|
||||||
for (Card c : p.getCardsIn(ZoneType.Battlefield)) {
|
|
||||||
if (!c.getController().equals(p)) { // should not be here
|
|
||||||
controllerChangeZoneCorrection(c);
|
|
||||||
checkAgain = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (ZoneType zt : ZoneType.values()) {
|
for (ZoneType zt : ZoneType.values()) {
|
||||||
if (zt == ZoneType.Battlefield) {
|
if (zt == ZoneType.Battlefield) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user