This commit is contained in:
Grimm
2021-12-07 23:04:03 +01:00
16 changed files with 46 additions and 16 deletions

View File

@@ -1967,7 +1967,6 @@ public class GameAction {
} }
// If pl has Backup Plan as a Conspiracy draw that many extra hands // If pl has Backup Plan as a Conspiracy draw that many extra hands
} }
// Choose starting hand for each player with multiple hands // Choose starting hand for each player with multiple hands

View File

@@ -69,7 +69,6 @@ public class MustBlockEffect extends SpellAbilityEffect {
} }
} }
} }
} // mustBlockResolve() } // mustBlockResolve()
@Override @Override

View File

@@ -38,17 +38,26 @@ public class RestartGameEffect extends SpellAbilityEffect {
forge.game.trigger.Trigger.resetIDs(); forge.game.trigger.Trigger.resetIDs();
TriggerHandler trigHandler = game.getTriggerHandler(); TriggerHandler trigHandler = game.getTriggerHandler();
trigHandler.clearDelayedTrigger(); trigHandler.clearDelayedTrigger();
trigHandler.clearPlayerDefinedDelayedTrigger();
trigHandler.suppressMode(TriggerType.ChangesZone); trigHandler.suppressMode(TriggerType.ChangesZone);
// Avoid Psychic Surgery trigger in new game // Avoid Psychic Surgery trigger in new game
trigHandler.suppressMode(TriggerType.Shuffled); trigHandler.suppressMode(TriggerType.Shuffled);
game.getPhaseHandler().resetExtra(); game.getPhaseHandler().resetExtra();
game.getPhaseHandler().setPlayerDeclaresAttackers(null);
game.getPhaseHandler().setPlayerDeclaresBlockers(null);
game.getUntap().clearCommands();
game.getUpkeep().clearCommands();
game.getEndOfCombat().clearCommands();
game.getEndOfTurn().clearCommands();
game.getCleanup().clearCommands();
game.getStack().reset(); game.getStack().reset();
game.clearCounterAddedThisTurn(); game.clearCounterAddedThisTurn();
game.resetPlayersAttackedOnNextTurn(); game.resetPlayersAttackedOnNextTurn();
game.resetPlayersAttackedOnNextTurn(); game.resetPlayersAttackedOnNextTurn();
game.setMonarch(null); game.setMonarch(null);
game.setDayTime(null);
GameAction action = game.getAction(); GameAction action = game.getAction();
for (Player p: players) { for (Player p: players) {
@@ -57,9 +66,13 @@ public class RestartGameEffect extends SpellAbilityEffect {
p.resetSpellCastThisGame(); p.resetSpellCastThisGame();
p.onCleanupPhase(); p.onCleanupPhase();
p.setLandsPlayedLastTurn(0); p.setLandsPlayedLastTurn(0);
p.setSpellsCastLastTurn(0);
p.setLifeLostLastTurn(0);
p.resetCommanderStats(); p.resetCommanderStats();
p.resetCompletedDungeons(); p.resetCompletedDungeons();
p.setBlessing(false); p.setBlessing(false);
p.clearController();
p.setMustAttackEntity(null);
CardCollection newLibrary = new CardCollection(p.getCardsIn(restartZones, false)); CardCollection newLibrary = new CardCollection(p.getCardsIn(restartZones, false));
List<Card> filteredCards = null; List<Card> filteredCards = null;

View File

@@ -6157,7 +6157,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
} }
public void onCleanupPhase(final Player turn) { public void onCleanupPhase(final Player turn) {
if (!this.hasKeyword("Damage isn't removed from CARDNAME during cleanup steps.")) {
setDamage(0); setDamage(0);
}
setHasBeenDealtDeathtouchDamage(false); setHasBeenDealtDeathtouchDamage(false);
resetReceivedDamageFromThisTurn(); resetReceivedDamageFromThisTurn();
setRegeneratedThisTurn(0); setRegeneratedThisTurn(0);

View File

@@ -51,6 +51,14 @@ public class Phase implements java.io.Serializable {
private final HashMap<Player, ArrayList<GameCommand>> untilEndMap = new HashMap<>(); private final HashMap<Player, ArrayList<GameCommand>> untilEndMap = new HashMap<>();
private final HashMap<Player, ArrayList<GameCommand>> registerMap = new HashMap<>(); private final HashMap<Player, ArrayList<GameCommand>> registerMap = new HashMap<>();
public void clearCommands() {
at.clear();
until.clear();
untilMap.clear();
untilEndMap.clear();
registerMap.clear();
}
/** /**
* <p> * <p>
* Add a hardcoded trigger that will execute "at <phase>". * Add a hardcoded trigger that will execute "at <phase>".

View File

@@ -67,6 +67,7 @@ public class LandAbility extends Ability {
return p.canPlayLand(land, false, this); return p.canPlayLand(land, false, this);
} }
@Override @Override
public void resolve() { public void resolve() {
getHostCard().setSplitStateToPlayAbility(this); getHostCard().setSplitStateToPlayAbility(this);
@@ -81,6 +82,7 @@ public class LandAbility extends Ability {
result.setState(CardStateName.Original, true); result.setState(CardStateName.Original, true);
} }
} }
@Override @Override
public String toUnsuppressedString() { public String toUnsuppressedString() {
StringBuilder sb = new StringBuilder("Play land"); StringBuilder sb = new StringBuilder("Play land");

View File

@@ -132,7 +132,6 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable
@Override @Override
public boolean isAbility() { return false; } public boolean isAbility() { return false; }
/** /**
* @return the castFaceDown * @return the castFaceDown
*/ */

View File

@@ -230,7 +230,6 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
if (params.containsKey("ConditionTargetsSingleTarget")) { if (params.containsKey("ConditionTargetsSingleTarget")) {
this.setTargetsSingleTarget(true); this.setTargetsSingleTarget(true);
} }
} // setConditions } // setConditions
/** /**
@@ -390,8 +389,7 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
int life = 1; int life = 1;
if (this.getLifeTotal().equals("OpponentSmallest")) { if (this.getLifeTotal().equals("OpponentSmallest")) {
life = activator.getOpponentsSmallestLifeTotal(); life = activator.getOpponentsSmallestLifeTotal();
} } else {
else {
life = AbilityUtils.getDefinedPlayers(host, this.getLifeTotal(), sa).getFirst().getLife(); life = AbilityUtils.getDefinedPlayers(host, this.getLifeTotal(), sa).getFirst().getLife();
} }
@@ -432,7 +430,6 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
if (matchTgt == null || matchTgt.getFirstTargetedSpell() == null if (matchTgt == null || matchTgt.getFirstTargetedSpell() == null
|| matchTgt.getFirstTargetedSpell().getTargets() == null) { || matchTgt.getFirstTargetedSpell().getTargets() == null) {
return false; return false;
} }
Set<GameObject> targets = new HashSet<>(); Set<GameObject> targets = new HashSet<>();

View File

@@ -604,7 +604,7 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
int activationLimit = AbilityUtils.calculateAmount(c, limit, sa); int activationLimit = AbilityUtils.calculateAmount(c, limit, sa);
this.setActivationLimit(activationLimit); this.setActivationLimit(activationLimit);
if ((this.getActivationLimit() != -1) && (sa.getActivationsThisTurn() >= this.getActivationLimit())) { if (this.getActivationLimit() != -1 && sa.getActivationsThisTurn() >= this.getActivationLimit()) {
return false; return false;
} }
} }
@@ -614,7 +614,7 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
int gameActivationLimit = AbilityUtils.calculateAmount(c, limit, sa); int gameActivationLimit = AbilityUtils.calculateAmount(c, limit, sa);
this.setGameActivationLimit(gameActivationLimit); this.setGameActivationLimit(gameActivationLimit);
if ((this.getGameActivationLimit() != -1) && (sa.getActivationsThisGame() >= this.getGameActivationLimit())) { if (this.getGameActivationLimit() != -1 && sa.getActivationsThisGame() >= this.getGameActivationLimit()) {
return false; return false;
} }
} }

View File

@@ -57,7 +57,6 @@ public class SpellPermanent extends SpellApiBased {
if (this.getPayCosts().getTotalMana().countX() > 0 && StringUtils.isNotBlank(getHostCard().getSVar("X"))) { if (this.getPayCosts().getTotalMana().countX() > 0 && StringUtils.isNotBlank(getHostCard().getSVar("X"))) {
this.setSVar("X", this.getHostCard().getSVar("X")); this.setSVar("X", this.getHostCard().getSVar("X"));
} }
} // Spell_Permanent() } // Spell_Permanent()
} }

View File

@@ -93,6 +93,10 @@ public class TriggerHandler {
playerDefinedDelayedTriggers.put(player, trig); playerDefinedDelayedTriggers.put(player, trig);
} }
public final void clearPlayerDefinedDelayedTrigger() {
playerDefinedDelayedTriggers.clear();
}
public final void handlePlayerDefinedDelTriggers(final Player player) { public final void handlePlayerDefinedDelTriggers(final Player player) {
delayedTriggers.addAll(playerDefinedDelayedTriggers.removeAll(player)); delayedTriggers.addAll(playerDefinedDelayedTriggers.removeAll(player));
} }

View File

@@ -0,0 +1,8 @@
Name:Patient Zero
ManaCost:1 B
Types:Creature Zombie
PT:2/2
K:Lifelink
S:Mode$ Continuous | Affected$ Creature.OppCtrl | AddHiddenKeyword$ Damage isn't removed from CARDNAME during cleanup steps. | Description$ Damage isn't removed from creatures your opponents control during cleanup steps.
DeckHas:Ability$LifeGain
Oracle:Lifelink\nDamage isn't removed from creatures your opponents control during cleanup steps.