remove all copy constructors and copy methods for all watchers

This commit is contained in:
Ingmar Goudt 2019-12-29 19:18:20 +01:00
parent e8303d551d
commit 702a1f2498
160 changed files with 94 additions and 1445 deletions

View file

@ -138,13 +138,6 @@ class AbandonedSarcophagusWatcher extends Watcher {
super(WatcherScope.GAME);
}
private AbandonedSarcophagusWatcher(final AbandonedSarcophagusWatcher watcher) {
super(watcher);
for (Entry<UUID, Cards> entry : watcher.cycledCardsThisTurn.entrySet()) {
cycledCardsThisTurn.put(entry.getKey(), entry.getValue().copy());
}
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.CYCLE_CARD
@ -170,9 +163,4 @@ class AbandonedSarcophagusWatcher extends Watcher {
super.reset();
cycledCardsThisTurn.clear();
}
@Override
public AbandonedSarcophagusWatcher copy() {
return new AbandonedSarcophagusWatcher(this);
}
}

View file

@ -74,27 +74,13 @@ class DamagedByPiratesWatcher extends Watcher {
super(WatcherScope.GAME);
}
private DamagedByPiratesWatcher(final DamagedByPiratesWatcher watcher) {
super(watcher);
for (UUID playerId : watcher.damageSourceIds.keySet()) {
Set<UUID> creatures = new HashSet<>();
creatures.addAll(watcher.damageSourceIds.get(playerId));
this.damageSourceIds.put(playerId, creatures);
}
}
@Override
public DamagedByPiratesWatcher copy() {
return new DamagedByPiratesWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
if (((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanentOrLKIBattlefield(event.getSourceId());
if (creature != null && creature.hasSubtype(SubType.PIRATE, game)) {
if (damageSourceIds.keySet().contains(event.getTargetId())) {
if (damageSourceIds.containsKey(event.getTargetId())) {
damageSourceIds.get(event.getTargetId()).add(creature.getId());
} else {
Set<UUID> creatureSet = new HashSet<>();

View file

@ -30,7 +30,7 @@ public final class Aggravate extends CardImpl {
this.getSpellAbility().addTarget(new TargetPlayer());
// Each creature dealt damage this way attacks this turn if able.
this.getSpellAbility().addEffect(new AggravateRequirementEffect());
this.getSpellAbility().addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher(false));
}
public Aggravate(final Aggravate card) {

View file

@ -26,7 +26,7 @@ public final class AngerOfTheGods extends CardImpl {
//If a creature dealt damage this way would die this turn, exile it instead.
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
this.getSpellAbility().addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher(false));
}
public AngerOfTheGods(final AngerOfTheGods card) {

View file

@ -54,7 +54,7 @@ public final class AnnihilatingFire extends CardImpl {
// If a creature dealt damage this way would die this turn, exile it instead.
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
this.getSpellAbility().addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher(false));
}
public AnnihilatingFire(final AnnihilatingFire card) {

View file

@ -99,11 +99,6 @@ class ApproachOfTheSecondSunWatcher extends Watcher {
super(WatcherScope.GAME);
}
public ApproachOfTheSecondSunWatcher(final ApproachOfTheSecondSunWatcher watcher) {
super(watcher);
approachesCast = new HashMap<>(watcher.approachesCast);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
@ -118,8 +113,4 @@ class ApproachOfTheSecondSunWatcher extends Watcher {
return approachesCast.getOrDefault(player, 0);
}
@Override
public ApproachOfTheSecondSunWatcher copy() {
return new ApproachOfTheSecondSunWatcher(this);
}
}

View file

@ -57,16 +57,6 @@ class ArchiveTrapWatcher extends Watcher {
super(WatcherScope.GAME);
}
private ArchiveTrapWatcher(final ArchiveTrapWatcher watcher) {
super(watcher);
this.playerIds.addAll(watcher.playerIds);
}
@Override
public ArchiveTrapWatcher copy() {
return new ArchiveTrapWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.LIBRARY_SEARCHED

View file

@ -87,16 +87,6 @@ class ArclightPhoenixWatcher extends Watcher {
super(WatcherScope.GAME);
}
public ArclightPhoenixWatcher(final ArclightPhoenixWatcher watcher) {
super(watcher);
this.instantSorceryCount.putAll(watcher.instantSorceryCount);
}
@Override
public ArclightPhoenixWatcher copy() {
return new ArclightPhoenixWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {

View file

@ -60,16 +60,6 @@ class AsmiraHolyAvengerWatcher extends Watcher {
condition = true;
}
public AsmiraHolyAvengerWatcher(final AsmiraHolyAvengerWatcher watcher) {
super(watcher);
this.creaturesCount = watcher.creaturesCount;
}
@Override
public AsmiraHolyAvengerWatcher copy() {
return new AsmiraHolyAvengerWatcher(this);
}
public int getCreaturesCount() {
return creaturesCount;
}

View file

@ -175,17 +175,6 @@ class AureliasFuryDamagedByWatcher extends Watcher {
super(WatcherScope.CARD);
}
private AureliasFuryDamagedByWatcher(final AureliasFuryDamagedByWatcher watcher) {
super(watcher);
this.damagedCreatures.addAll(watcher.damagedCreatures);
this.damagedPlayers.addAll(watcher.damagedPlayers);
}
@Override
public AureliasFuryDamagedByWatcher copy() {
return new AureliasFuryDamagedByWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.DAMAGED_CREATURE) {

View file

@ -99,10 +99,6 @@ class CombatDamageStepStartedWatcher extends Watcher {
super(WatcherScope.GAME);
}
public CombatDamageStepStartedWatcher(final CombatDamageStepStartedWatcher watcher) {
super(watcher);
}
@Override
public void watch(GameEvent event, Game game) {
// if no damage happens, the first event after is END_COMBAT_STEP_PRE
@ -111,10 +107,6 @@ class CombatDamageStepStartedWatcher extends Watcher {
}
}
@Override
public CombatDamageStepStartedWatcher copy() {
return new CombatDamageStepStartedWatcher(this);
}
}
class BerserkDestroyEffect extends OneShotEffect {

View file

@ -87,16 +87,6 @@ class BlazingEffigyWatcher extends Watcher {
super(WatcherScope.GAME);
}
public BlazingEffigyWatcher(final BlazingEffigyWatcher watcher) {
super(watcher);
this.damagedObjects.putAll(watcher.damagedObjects);
}
@Override
public BlazingEffigyWatcher copy() {
return new BlazingEffigyWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {

View file

@ -59,28 +59,17 @@ public final class BoseijuWhoSheltersAll extends CardImpl {
class BoseijuWhoSheltersAllWatcher extends Watcher {
private List<UUID> spells = new ArrayList<>();
private final String originalId;
private final UUID originalId;
public BoseijuWhoSheltersAllWatcher(UUID originalId) {
super(WatcherScope.CARD);
this.originalId = originalId.toString();
}
public BoseijuWhoSheltersAllWatcher(final BoseijuWhoSheltersAllWatcher watcher) {
super(watcher);
this.spells.addAll(watcher.spells);
this.originalId = watcher.originalId;
}
@Override
public BoseijuWhoSheltersAllWatcher copy() {
return new BoseijuWhoSheltersAllWatcher(this);
this.originalId = originalId;
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.MANA_PAID) {
if (event.getData() != null && event.getData().equals(originalId)) {
if (event.getData() != null && event.getData().equals(originalId.toString())) {
Card spell = game.getSpell(event.getTargetId());
if (spell != null && (spell.isInstant() || spell.isSorcery())) {
spells.add(event.getTargetId());

View file

@ -204,10 +204,6 @@ class BurningCinderFuryOfCrimsonChaosFireWatcher extends Watcher {
super(WatcherScope.GAME);
}
public BurningCinderFuryOfCrimsonChaosFireWatcher(final BurningCinderFuryOfCrimsonChaosFireWatcher watcher) {
super(watcher);
this.tappedActivePlayerIds.addAll(watcher.tappedActivePlayerIds);
}
@Override
public void watch(GameEvent event, Game game) {
@ -227,9 +223,4 @@ class BurningCinderFuryOfCrimsonChaosFireWatcher extends Watcher {
public void reset() {
tappedActivePlayerIds.clear();
}
@Override
public BurningCinderFuryOfCrimsonChaosFireWatcher copy() {
return new BurningCinderFuryOfCrimsonChaosFireWatcher(this);
}
}

View file

@ -64,16 +64,6 @@ class CallerOfTheClawWatcher extends Watcher {
condition = true;
}
public CallerOfTheClawWatcher(final CallerOfTheClawWatcher watcher) {
super(watcher);
this.creaturesCount = watcher.creaturesCount;
}
@Override
public CallerOfTheClawWatcher copy() {
return new CallerOfTheClawWatcher(this);
}
public int getCreaturesCount() {
return creaturesCount;
}

View file

@ -26,7 +26,7 @@ public final class Carbonize extends CardImpl {
this.getSpellAbility().addEffect(new CantRegenerateTargetEffect(Duration.EndOfTurn, "That creature"));
this.getSpellAbility().addEffect(new ExileTargetIfDiesEffect().setText("If the creature would die this turn, exile it instead"));
this.getSpellAbility().addTarget(new TargetAnyTarget());
this.getSpellAbility().addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher(false));
}

View file

@ -114,16 +114,6 @@ class CathedralMembraneWatcher extends Watcher {
super(WatcherScope.CARD);
}
private CathedralMembraneWatcher(final CathedralMembraneWatcher watcher) {
super(watcher);
this.blockedCreatures.addAll(watcher.blockedCreatures);
}
@Override
public CathedralMembraneWatcher copy() {
return new CathedralMembraneWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED && event.getSourceId().equals(sourceId)) {

View file

@ -122,28 +122,17 @@ class CavernOfSoulsManaCondition extends CreatureCastManaCondition {
class CavernOfSoulsWatcher extends Watcher {
private List<UUID> spells = new ArrayList<>();
private final String originalId;
private final UUID originalId;
public CavernOfSoulsWatcher(UUID originalId) {
super(WatcherScope.CARD);
this.originalId = originalId.toString();
}
public CavernOfSoulsWatcher(final CavernOfSoulsWatcher watcher) {
super(watcher);
this.spells.addAll(watcher.spells);
this.originalId = watcher.originalId;
}
@Override
public CavernOfSoulsWatcher copy() {
return new CavernOfSoulsWatcher(this);
this.originalId = originalId;
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.MANA_PAID) {
if (event.getData() != null && event.getData().equals(originalId)) {
if (event.getData() != null && event.getData().equals(originalId.toString())) {
spells.add(event.getTargetId());
}
}

View file

@ -84,13 +84,6 @@ class CerebralVortexWatcher extends Watcher {
super(WatcherScope.GAME);
}
CerebralVortexWatcher(final CerebralVortexWatcher watcher) {
super(watcher);
for (Entry<UUID, Integer> entry: watcher.draws.entrySet()) {
draws.put(entry.getKey(), entry.getValue());
}
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.DREW_CARD) {
@ -111,9 +104,4 @@ class CerebralVortexWatcher extends Watcher {
public int getDraws(UUID playerId) {
return draws.getOrDefault(playerId, 0);
}
@Override
public CerebralVortexWatcher copy() {
return new CerebralVortexWatcher(this);
}
}

View file

@ -74,15 +74,6 @@ class CobraTrapWatcher extends Watcher {
super(WatcherScope.GAME);
}
public CobraTrapWatcher(final CobraTrapWatcher watcher) {
super(watcher);
}
@Override
public CobraTrapWatcher copy() {
return new CobraTrapWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.DESTROYED_PERMANENT) {

View file

@ -78,12 +78,6 @@ class ConduitOfRuinWatcher extends Watcher {
playerCreatureSpells = new HashMap<>();
}
public ConduitOfRuinWatcher(final ConduitOfRuinWatcher watcher) {
super(watcher);
this.playerCreatureSpells = new HashMap<>();
playerCreatureSpells.putAll(watcher.playerCreatureSpells);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
@ -98,11 +92,6 @@ class ConduitOfRuinWatcher extends Watcher {
return playerCreatureSpells.getOrDefault(playerId, 0);
}
@Override
public ConduitOfRuinWatcher copy() {
return new ConduitOfRuinWatcher(this);
}
@Override
public void reset() {
super.reset();

View file

@ -125,18 +125,6 @@ class CorrosiveOozeCombatWatcher extends Watcher {
super(WatcherScope.GAME);
}
public CorrosiveOozeCombatWatcher(final CorrosiveOozeCombatWatcher watcher) {
super(watcher);
for (Map.Entry<MageObjectReference, Set<MageObjectReference>> entry : watcher.oozeBlocksOrBlocked.entrySet()) {
Set<MageObjectReference> newSet = new HashSet<>(entry.getValue());
oozeBlocksOrBlocked.put(entry.getKey(), newSet);
}
for (Map.Entry<MageObjectReference, Set<MageObjectReference>> entry : watcher.oozeEquipmentsToDestroy.entrySet()) {
Set<MageObjectReference> newSet = new HashSet<>(entry.getValue());
oozeEquipmentsToDestroy.put(entry.getKey(), newSet);
}
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.BEGIN_COMBAT_STEP_PRE) {
@ -208,10 +196,4 @@ class CorrosiveOozeCombatWatcher extends Watcher {
oozeEquipmentsToDestroy.remove(ooze); // remove here to get no overlap with creatures leaving meanwhile
return equipmentsToDestroy;
}
@Override
public CorrosiveOozeCombatWatcher copy() {
return new CorrosiveOozeCombatWatcher(this);
}
}

View file

@ -86,11 +86,6 @@ class CustodiSoulcallerWatcher extends Watcher {
super(WatcherScope.GAME);
}
CustodiSoulcallerWatcher(final CustodiSoulcallerWatcher watcher) {
super(watcher);
this.playersAttacked.putAll(watcher.playersAttacked);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.BEGIN_COMBAT_STEP_PRE) {
@ -105,9 +100,4 @@ class CustodiSoulcallerWatcher extends Watcher {
public int getNumberOfAttackedPlayers(UUID attackerId) {
return this.playersAttacked.get(attackerId).size();
}
@Override
public CustodiSoulcallerWatcher copy() {
return new CustodiSoulcallerWatcher(this);
}
}

View file

@ -193,20 +193,6 @@ class CyclopeanTombCounterWatcher extends Watcher {
super(WatcherScope.GAME);
}
private CyclopeanTombCounterWatcher(final CyclopeanTombCounterWatcher watcher) {
super(watcher);
for (MageObjectReference mageObjectReference : watcher.counterData.keySet()) {
Set<MageObjectReference> miredLands = new HashSet<>();
miredLands.addAll(watcher.counterData.get(mageObjectReference));
counterData.put(mageObjectReference, miredLands);
}
}
@Override
public CyclopeanTombCounterWatcher copy() {
return new CyclopeanTombCounterWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.COUNTERS_ADDED && event.getData().equals(CounterType.MIRE.getName()) && event.getAmount() > 0) {

View file

@ -88,16 +88,6 @@ class DarkbladeAgentWatcher extends Watcher {
super(WatcherScope.GAME);
}
public DarkbladeAgentWatcher(final DarkbladeAgentWatcher watcher) {
super(watcher);
this.surveiledThisTurn.addAll(watcher.surveiledThisTurn);
}
@Override
public DarkbladeAgentWatcher copy() {
return new DarkbladeAgentWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SURVEILED) {

View file

@ -37,7 +37,7 @@ public final class Demonfire extends CardImpl {
// If a creature dealt damage this way would die this turn, exile it instead.
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
this.getSpellAbility().addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher(false));
// Hellbent - If you have no cards in hand, Demonfire can't be countered and the damage can't be prevented.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(

View file

@ -109,10 +109,6 @@ class DesolationWatcher extends Watcher {
super( WatcherScope.GAME);
}
public DesolationWatcher(final DesolationWatcher watcher) {
super(watcher);
this.tappedForManaThisTurnPlayers.addAll(watcher.tappedForManaThisTurnPlayers);
}
@Override
public void watch(GameEvent event, Game game) {
@ -131,11 +127,8 @@ class DesolationWatcher extends Watcher {
}
public Set<UUID> getPlayersTappedForMana() {
if (tappedForManaThisTurnPlayers != null) {
return tappedForManaThisTurnPlayers;
}
return new HashSet<>();
}
@Override
public void reset() {
@ -143,8 +136,4 @@ class DesolationWatcher extends Watcher {
tappedForManaThisTurnPlayers.clear();
}
@Override
public DesolationWatcher copy() {
return new DesolationWatcher(this);
}
}

View file

@ -141,17 +141,6 @@ class DiseasedVerminWatcher extends Watcher {
damagedPlayers = new HashSet<>();
}
public DiseasedVerminWatcher(final DiseasedVerminWatcher watcher) {
super(watcher);
this.damagedPlayers = new HashSet<>();
this.damagedPlayers.addAll(watcher.damagedPlayers);
}
@Override
public DiseasedVerminWatcher copy() {
return new DiseasedVerminWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.DAMAGED_PLAYER

View file

@ -52,13 +52,6 @@ class CardsDiscardedThisTurnWatcher extends Watcher {
super(WatcherScope.GAME);
}
public CardsDiscardedThisTurnWatcher(final CardsDiscardedThisTurnWatcher watcher) {
super(watcher);
for (Entry<UUID, Integer> entry : watcher.amountOfCardsDiscardedThisTurn.entrySet()) {
amountOfCardsDiscardedThisTurn.put(entry.getKey(), entry.getValue());
}
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DISCARDED_CARD) {
@ -77,11 +70,6 @@ class CardsDiscardedThisTurnWatcher extends Watcher {
public void reset() {
amountOfCardsDiscardedThisTurn.clear();
}
@Override
public CardsDiscardedThisTurnWatcher copy() {
return new CardsDiscardedThisTurnWatcher(this);
}
}
class DreamSalvageEffect extends OneShotEffect {

View file

@ -134,10 +134,6 @@ class DungeonGeistsWatcher extends Watcher {
super(WatcherScope.CARD);
}
DungeonGeistsWatcher(DungeonGeistsWatcher watcher) {
super(watcher);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.LOST_CONTROL && event.getPlayerId().equals(controllerId) && event.getTargetId().equals(sourceId)) {
@ -158,9 +154,4 @@ class DungeonGeistsWatcher extends Watcher {
public void reset() {
//don't reset condition each turn - only when this leaves the battlefield
}
@Override
public DungeonGeistsWatcher copy() {
return new DungeonGeistsWatcher(this);
}
}

View file

@ -89,15 +89,6 @@ class InvestigatedWatcher extends Watcher {
super(WatcherScope.GAME);
}
public InvestigatedWatcher(final InvestigatedWatcher watcher) {
super(watcher);
}
@Override
public InvestigatedWatcher copy() {
return new InvestigatedWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.INVESTIGATED) {

View file

@ -54,11 +54,6 @@ class EtherswornCanonistWatcher extends Watcher {
super(WatcherScope.GAME);
}
public EtherswornCanonistWatcher(final EtherswornCanonistWatcher watcher) {
super(watcher);
this.castNonartifactSpell.addAll(watcher.castNonartifactSpell);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId() != null) {
@ -83,12 +78,6 @@ class EtherswornCanonistWatcher extends Watcher {
public boolean castNonArtifactSpell(UUID playerId) {
return castNonartifactSpell.contains(playerId);
}
@Override
public EtherswornCanonistWatcher copy() {
return new EtherswornCanonistWatcher(this);
}
}
class EtherswornCanonistReplacementEffect extends ContinuousRuleModifyingEffectImpl {

View file

@ -76,11 +76,6 @@ class FairgroundsTrumpeterWatcher extends Watcher {
super(WatcherScope.GAME);
}
public FairgroundsTrumpeterWatcher(final FairgroundsTrumpeterWatcher watcher) {
super(watcher);
this.players.addAll(watcher.players);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.COUNTER_ADDED && event.getData().equals(CounterType.P1P1.getName())) {
@ -103,8 +98,4 @@ class FairgroundsTrumpeterWatcher extends Watcher {
return players.contains(playerId);
}
@Override
public FairgroundsTrumpeterWatcher copy() {
return new FairgroundsTrumpeterWatcher(this);
}
}

View file

@ -83,11 +83,6 @@ class FaithsRewardWatcher extends Watcher {
super(WatcherScope.GAME);
}
public FaithsRewardWatcher(final FaithsRewardWatcher watcher) {
super(watcher);
this.cards.addAll(watcher.cards);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
@ -99,11 +94,6 @@ class FaithsRewardWatcher extends Watcher {
return cards;
}
@Override
public FaithsRewardWatcher copy() {
return new FaithsRewardWatcher(this);
}
@Override
public void reset() {
super.reset();

View file

@ -104,11 +104,6 @@ class FblthpTheLostWatcher extends Watcher {
super(WatcherScope.GAME);
}
private FblthpTheLostWatcher(final FblthpTheLostWatcher watcher) {
super(watcher);
spellsCastFromLibrary.addAll(watcher.spellsCastFromLibrary);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.LIBRARY) {
@ -130,11 +125,6 @@ class FblthpTheLostWatcher extends Watcher {
super.reset();
spellsCastFromLibrary.clear();
}
@Override
public FblthpTheLostWatcher copy() {
return new FblthpTheLostWatcher(this);
}
}
class FblthpTheLostTargetedTriggeredAbility extends TriggeredAbilityImpl {

View file

@ -69,16 +69,6 @@ class FellShepherdWatcher extends Watcher {
condition = true;
}
public FellShepherdWatcher(final FellShepherdWatcher watcher) {
super(watcher);
this.creatureIds.addAll(watcher.creatureIds);
}
@Override
public FellShepherdWatcher copy() {
return new FellShepherdWatcher(this);
}
public Set<UUID> getCreaturesIds() {
return creatureIds;
}

View file

@ -39,7 +39,7 @@ public final class Flamebreak extends CardImpl {
// Flamebreak deals 3 damage to each creature without flying and each player. Creatures dealt damage this way can't be regenerated this turn.
this.getSpellAbility().addEffect(new DamageEverythingEffect(new StaticValue(3), filter1));
this.getSpellAbility().addEffect(new FlamebreakCantRegenerateEffect());
this.getSpellAbility().addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher(false));
}
public Flamebreak(final Flamebreak card) {

View file

@ -60,15 +60,6 @@ class FleshAllergyWatcher extends Watcher {
super(WatcherScope.GAME);
}
private FleshAllergyWatcher(final FleshAllergyWatcher watcher) {
super(watcher);
}
@Override
public FleshAllergyWatcher copy() {
return new FleshAllergyWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {

View file

@ -101,13 +101,6 @@ class FreeRangeChickenWatcher extends Watcher {
super(WatcherScope.GAME);
}
public FreeRangeChickenWatcher(final FreeRangeChickenWatcher watcher) {
super(watcher);
for (Map.Entry<UUID, Integer> entry : watcher.totalRolls.entrySet()) {
this.totalRolls.put(entry.getKey(), entry.getValue());
}
}
@Override
public void watch(GameEvent event, Game game) {
}
@ -117,11 +110,6 @@ class FreeRangeChickenWatcher extends Watcher {
totalRolls.clear();
}
@Override
public FreeRangeChickenWatcher copy() {
return new FreeRangeChickenWatcher(this);
}
public void addRoll(UUID sourceId, int roll) {
totalRolls.put(sourceId, roll);
}

View file

@ -37,7 +37,7 @@ public final class Frostwielder extends CardImpl {
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);
// If a creature dealt damage by Frostwielder this turn would die, exile it instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher(false));
}

View file

@ -112,11 +112,6 @@ class GarnaTheBloodflameWatcher extends Watcher {
super(WatcherScope.GAME);
}
public GarnaTheBloodflameWatcher(final GarnaTheBloodflameWatcher watcher) {
super(watcher);
this.cards.addAll(watcher.cards);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) {
@ -127,11 +122,6 @@ class GarnaTheBloodflameWatcher extends Watcher {
}
}
@Override
public GarnaTheBloodflameWatcher copy() {
return new GarnaTheBloodflameWatcher(this);
}
public Set<UUID> getCardsPutToGraveyardThisTurn() {
return cards;
}

View file

@ -66,16 +66,6 @@ class GeneratorServantWatcher extends Watcher {
super(WatcherScope.CARD);
}
private GeneratorServantWatcher(final GeneratorServantWatcher watcher) {
super(watcher);
this.creatures.addAll(watcher.creatures);
}
@Override
public GeneratorServantWatcher copy() {
return new GeneratorServantWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.MANA_PAID) {

View file

@ -101,11 +101,6 @@ class GideonsTriumphWatcher extends Watcher {
super(WatcherScope.GAME);
}
private GideonsTriumphWatcher(final GideonsTriumphWatcher watcher) {
super(watcher);
this.attackedOrBlockedThisTurnCreatures.addAll(watcher.attackedOrBlockedThisTurnCreatures);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED || event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
@ -117,12 +112,6 @@ class GideonsTriumphWatcher extends Watcher {
return this.attackedOrBlockedThisTurnCreatures.contains(new MageObjectReference(permanent, game));
}
@Override
public GideonsTriumphWatcher copy() {
return new GideonsTriumphWatcher(this);
}
@Override
public void reset() {
attackedOrBlockedThisTurnCreatures.clear();

View file

@ -136,11 +136,6 @@ class GisaAndGeralfWatcher extends Watcher {
super(WatcherScope.CARD);
}
GisaAndGeralfWatcher(final GisaAndGeralfWatcher watcher) {
super(watcher);
this.abilityUsed = watcher.abilityUsed;
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.GRAVEYARD) {
@ -151,11 +146,6 @@ class GisaAndGeralfWatcher extends Watcher {
}
}
@Override
public GisaAndGeralfWatcher copy() {
return new GisaAndGeralfWatcher(this);
}
@Override
public void reset() {
super.reset();

View file

@ -123,16 +123,6 @@ class BlockedByWatcher extends Watcher {
super(WatcherScope.CARD);
}
private BlockedByWatcher(final BlockedByWatcher watcher) {
super(watcher);
this.blockedByWatcher.addAll(watcher.blockedByWatcher);
}
@Override
public BlockedByWatcher copy() {
return new BlockedByWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {

View file

@ -100,11 +100,6 @@ class GontisMachinationsFirstLostLifeThisTurnWatcher extends Watcher {
super(WatcherScope.GAME);
}
public GontisMachinationsFirstLostLifeThisTurnWatcher(final GontisMachinationsFirstLostLifeThisTurnWatcher watcher) {
super(watcher);
this.playersLostLife.putAll(watcher.playersLostLife);
}
@Override
public void watch(GameEvent event, Game game) {
switch (event.getType()) {
@ -115,10 +110,6 @@ class GontisMachinationsFirstLostLifeThisTurnWatcher extends Watcher {
}
}
@Override
public GontisMachinationsFirstLostLifeThisTurnWatcher copy() {
return new GontisMachinationsFirstLostLifeThisTurnWatcher(this);
}
@Override
public void reset() {

View file

@ -68,11 +68,6 @@ class CreaturesAttackedWatcher extends Watcher {
super(WatcherScope.GAME);
}
public CreaturesAttackedWatcher(final CreaturesAttackedWatcher watcher) {
super(watcher);
this.attackedThisTurnCreatures.addAll(watcher.attackedThisTurnCreatures);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.BEGIN_COMBAT_STEP_PRE) {
@ -86,12 +81,6 @@ class CreaturesAttackedWatcher extends Watcher {
public Set<MageObjectReference> getAttackedThisTurnCreatures() {
return this.attackedThisTurnCreatures;
}
@Override
public CreaturesAttackedWatcher copy() {
return new CreaturesAttackedWatcher(this);
}
}
class GrandWarlordRadhaTriggeredAbility extends TriggeredAbilityImpl {

View file

@ -119,13 +119,6 @@ class GrimReminderWatcher extends Watcher {
super(WatcherScope.GAME);
}
public GrimReminderWatcher(final GrimReminderWatcher watcher) {
super(watcher);
for (Map.Entry<String, Set<UUID>> entry : watcher.playersCastSpell.entrySet()) {
playersCastSpell.put(entry.getKey(), entry.getValue());
}
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
@ -147,9 +140,4 @@ class GrimReminderWatcher extends Watcher {
return playersCastSpell.getOrDefault(spellName, new HashSet<>());
}
@Override
public GrimReminderWatcher copy() {
return new GrimReminderWatcher(this);
}
}

View file

@ -174,22 +174,6 @@ class GrothamaAllDevouringWatcher extends Watcher {
super(WatcherScope.GAME);
}
GrothamaAllDevouringWatcher(final GrothamaAllDevouringWatcher watcher) {
super(watcher);
for (MageObjectReference mor : watcher.damageMap.keySet()) {
this.damageMap.putIfAbsent(mor, new HashMap<>());
for (UUID key : watcher.damageMap.get(mor).keySet()) {
this.damageMap.get(mor).putIfAbsent(key, 0);
this.damageMap.get(mor).compute(key, (k, damage) -> damage + watcher.damageMap.get(mor).get(key));
}
}
}
@Override
public GrothamaAllDevouringWatcher copy() {
return new GrothamaAllDevouringWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() != GameEvent.EventType.DAMAGED_CREATURE) {

View file

@ -62,16 +62,6 @@ class GuildmagesForumWatcher extends Watcher {
this.source = source;
}
GuildmagesForumWatcher(final GuildmagesForumWatcher watcher) {
super(watcher);
this.source = watcher.source;
}
@Override
public GuildmagesForumWatcher copy() {
return new GuildmagesForumWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.MANA_PAID) {

View file

@ -70,17 +70,6 @@ class HallOfTheBanditLordWatcher extends Watcher {
this.source = source;
}
HallOfTheBanditLordWatcher(final HallOfTheBanditLordWatcher watcher) {
super(watcher);
this.creatures.addAll(watcher.creatures);
this.source = watcher.source;
}
@Override
public HallOfTheBanditLordWatcher copy() {
return new HallOfTheBanditLordWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.MANA_PAID) {

View file

@ -11,15 +11,6 @@ public class HomicidalBruteWatcher extends Watcher {
super(WatcherScope.CARD);
}
public HomicidalBruteWatcher(final HomicidalBruteWatcher watcher) {
super(watcher);
}
@Override
public HomicidalBruteWatcher copy() {
return new HomicidalBruteWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (condition) {

View file

@ -142,20 +142,6 @@ class HopeOfGhirapurCombatDamageWatcher extends Watcher {
super(WatcherScope.GAME);
}
public HopeOfGhirapurCombatDamageWatcher(final HopeOfGhirapurCombatDamageWatcher watcher) {
super(watcher);
for (MageObjectReference damager : watcher.combatDamagedPlayers.keySet()) {
Set<UUID> players = new HashSet<>();
players.addAll(watcher.combatDamagedPlayers.get(damager));
this.combatDamagedPlayers.put(damager, players);
}
}
@Override
public HopeOfGhirapurCombatDamageWatcher copy() {
return new HopeOfGhirapurCombatDamageWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) {

View file

@ -85,16 +85,6 @@ class HotHeadedGiantWatcher extends Watcher {
this.cardId = cardId;
}
public HotHeadedGiantWatcher(final HotHeadedGiantWatcher watcher) {
super(watcher);
this.cardId = watcher.cardId;
}
@Override
public HotHeadedGiantWatcher copy() {
return new HotHeadedGiantWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (condition == true) { //no need to check - condition has already occured

View file

@ -146,10 +146,6 @@ class IcefallRegentWatcher extends Watcher {
super(WatcherScope.CARD);
}
IcefallRegentWatcher(IcefallRegentWatcher watcher) {
super(watcher);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.LOST_CONTROL && event.getPlayerId().equals(controllerId) && event.getTargetId().equals(sourceId)) {
@ -170,11 +166,6 @@ class IcefallRegentWatcher extends Watcher {
public void reset() {
//don't reset condition each turn - only when this leaves the battlefield
}
@Override
public IcefallRegentWatcher copy() {
return new IcefallRegentWatcher(this);
}
}
class IcefallRegentCostIncreaseEffect extends CostModificationEffectImpl {

View file

@ -100,18 +100,6 @@ class IchneumonDruidWatcher extends Watcher {
super(WatcherScope.GAME);
}
public IchneumonDruidWatcher(final IchneumonDruidWatcher watcher) {
super(watcher);
for (Map.Entry<UUID, Integer> entry : watcher.playerInstantCount.entrySet()) {
playerInstantCount.put(entry.getKey(), entry.getValue());
}
}
@Override
public IchneumonDruidWatcher copy() {
return new IchneumonDruidWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.SPELL_CAST) {

View file

@ -93,16 +93,6 @@ class GreatestAmountOfDamageWatcher extends Watcher {
super(WatcherScope.GAME);
}
public GreatestAmountOfDamageWatcher(final GreatestAmountOfDamageWatcher watcher) {
super(watcher);
this.damageAmount = watcher.damageAmount;
}
@Override
public GreatestAmountOfDamageWatcher copy() {
return new GreatestAmountOfDamageWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
switch(event.getType()) {

View file

@ -27,7 +27,7 @@ public final class IncendiaryFlow extends CardImpl {
Effect effect = new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn);
effect.setText("If a creature dealt damage this way would die this turn, exile it instead");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher(false));
}
public IncendiaryFlow(final IncendiaryFlow card) {

View file

@ -29,7 +29,7 @@ public final class Incinerate extends CardImpl {
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
this.getSpellAbility().addTarget(new TargetAnyTarget());
this.getSpellAbility().addEffect(new IncinerateEffect());
this.getSpellAbility().addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher(false));
}
public Incinerate(final Incinerate card) {

View file

@ -75,11 +75,6 @@ class InfernoTrapWatcher extends Watcher {
super(WatcherScope.GAME);
}
public InfernoTrapWatcher(final InfernoTrapWatcher watcher) {
super(watcher);
playerDamagedByCreature.putAll(watcher.playerDamagedByCreature);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER
@ -106,8 +101,4 @@ class InfernoTrapWatcher extends Watcher {
playerDamagedByCreature.clear();
}
@Override
public InfernoTrapWatcher copy() {
return new InfernoTrapWatcher(this);
}
}

View file

@ -86,10 +86,6 @@ class NonArtifactCreaturesDiedWatcher extends Watcher {
super(WatcherScope.GAME);
}
public NonArtifactCreaturesDiedWatcher(final NonArtifactCreaturesDiedWatcher watcher) {
super(watcher);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
@ -102,9 +98,4 @@ class NonArtifactCreaturesDiedWatcher extends Watcher {
}
}
@Override
public NonArtifactCreaturesDiedWatcher copy() {
return new NonArtifactCreaturesDiedWatcher(this);
}
}

View file

@ -107,16 +107,6 @@ class InsistWatcher extends Watcher {
super(WatcherScope.PLAYER);
}
InsistWatcher(final InsistWatcher watcher) {
super(watcher);
this.uncounterableSpell = watcher.uncounterableSpell;
}
@Override
public InsistWatcher copy() {
return new InsistWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && ready) {

View file

@ -100,11 +100,6 @@ class JandorsRingWatcher extends Watcher {
super(WatcherScope.GAME);
}
public JandorsRingWatcher(final JandorsRingWatcher watcher) {
super(watcher);
this.lastDrawnCards.putAll(watcher.lastDrawnCards);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DREW_CARD) {
@ -112,11 +107,6 @@ class JandorsRingWatcher extends Watcher {
}
}
@Override
public JandorsRingWatcher copy() {
return new JandorsRingWatcher(this);
}
@Override
public void reset() {
super.reset();
@ -124,7 +114,7 @@ class JandorsRingWatcher extends Watcher {
}
public UUID getLastDrewCard(UUID playerId) {
return lastDrawnCards.getOrDefault(null, playerId);
return lastDrawnCards.get(playerId);
}
}

View file

@ -59,7 +59,7 @@ public final class JayaBallardTaskMage extends CardImpl {
ability.addCost(new TapSourceCost());
ability.addCost(new DiscardCardCost());
ability.addEffect(new CantRegenerateEffect());
this.addAbility(ability, new DamagedByWatcher());
this.addAbility(ability, new DamagedByWatcher(false));
// {5}{R}{R}, {tap}, Discard a card: Jaya Ballard deals 6 damage to each creature and each player.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEverythingEffect(6), new ManaCostsImpl("{5}{R}{R}"));

View file

@ -147,15 +147,6 @@ class JelevaNephaliasWatcher extends Watcher {
super(WatcherScope.GAME);
}
public JelevaNephaliasWatcher(final JelevaNephaliasWatcher watcher) {
super(watcher);
}
@Override
public JelevaNephaliasWatcher copy() {
return new JelevaNephaliasWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
// Watcher saves all casts becaus of possible Clone cards that copy Jeleva

View file

@ -178,11 +178,6 @@ class KaradorGhostChieftainWatcher extends Watcher {
super(WatcherScope.CARD);
}
KaradorGhostChieftainWatcher(final KaradorGhostChieftainWatcher watcher) {
super(watcher);
this.abilityUsed = watcher.abilityUsed;
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST
@ -194,11 +189,6 @@ class KaradorGhostChieftainWatcher extends Watcher {
}
}
@Override
public KaradorGhostChieftainWatcher copy() {
return new KaradorGhostChieftainWatcher(this);
}
@Override
public void reset() {
super.reset();

View file

@ -162,12 +162,6 @@ class KessDissidentMageWatcher extends Watcher {
super(WatcherScope.GAME);
}
private KessDissidentMageWatcher(final KessDissidentMageWatcher watcher) {
super(watcher);
this.allowingObjects.addAll(watcher.allowingObjects);
this.castSpells.putAll(watcher.castSpells);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST
@ -184,11 +178,6 @@ class KessDissidentMageWatcher extends Watcher {
}
}
@Override
public KessDissidentMageWatcher copy() {
return new KessDissidentMageWatcher(this);
}
@Override
public void reset() {
super.reset();

View file

@ -108,9 +108,6 @@ class MonarchAtTurnStartWatcher extends Watcher {
super(WatcherScope.GAME);
}
public MonarchAtTurnStartWatcher(final MonarchAtTurnStartWatcher watcher) {
super(watcher);
}
@Override
public void watch(GameEvent event, Game game) {
@ -120,10 +117,6 @@ class MonarchAtTurnStartWatcher extends Watcher {
}
}
@Override
public MonarchAtTurnStartWatcher copy() {
return new MonarchAtTurnStartWatcher(this);
}
@Override
public void reset() {

View file

@ -147,16 +147,6 @@ class KrovikanVampireCreaturesDamagedWatcher extends Watcher {
super(WatcherScope.GAME);
}
public KrovikanVampireCreaturesDamagedWatcher(final KrovikanVampireCreaturesDamagedWatcher watcher) {
super(watcher);
this.damagedBySource.addAll(watcher.damagedBySource);
}
@Override
public KrovikanVampireCreaturesDamagedWatcher copy() {
return new KrovikanVampireCreaturesDamagedWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.DAMAGED_CREATURE
@ -183,11 +173,6 @@ class KrovikanVampireCreaturesDiedWatcher extends Watcher {
super(WatcherScope.GAME);
}
public KrovikanVampireCreaturesDiedWatcher(final KrovikanVampireCreaturesDiedWatcher watcher) {
super(watcher);
this.diedThisTurn.addAll(watcher.diedThisTurn);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
@ -208,11 +193,6 @@ class KrovikanVampireCreaturesDiedWatcher extends Watcher {
public Set<UUID> getDiedThisTurn() {
return this.diedThisTurn;
}
@Override
public KrovikanVampireCreaturesDiedWatcher copy() {
return new KrovikanVampireCreaturesDiedWatcher(this);
}
}
class KrovikanVampireDelayedTriggeredAbility extends DelayedTriggeredAbility {

View file

@ -67,7 +67,7 @@ public final class KumanoMasterYamabushi extends CardImpl {
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);
// If a creature dealt damage by Kumano this turn would die, exile it instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher(false));
}

View file

@ -112,16 +112,6 @@ class DamagedByEnchantedWatcher extends Watcher {
super(WatcherScope.CARD);
}
public DamagedByEnchantedWatcher(final DamagedByEnchantedWatcher watcher) {
super(watcher);
this.damagedCreatures.addAll(watcher.damagedCreatures);
}
@Override
public DamagedByEnchantedWatcher copy() {
return new DamagedByEnchantedWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.DAMAGED_CREATURE) {

View file

@ -28,7 +28,7 @@ public final class KumanosPupils extends CardImpl {
this.toughness = new MageInt(3);
// If a creature dealt damage by Kumano's Pupils this turn would die, exile it instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher(false));
}
public KumanosPupils(final KumanosPupils card) {

View file

@ -88,11 +88,6 @@ class KydeleCardsDrawnThisTurnWatcher extends Watcher {
super(WatcherScope.GAME);
}
public KydeleCardsDrawnThisTurnWatcher(final KydeleCardsDrawnThisTurnWatcher watcher) {
super(watcher);
this.cardsDrawnThisTurn.putAll(watcher.cardsDrawnThisTurn);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DREW_CARD) {
@ -111,9 +106,4 @@ class KydeleCardsDrawnThisTurnWatcher extends Watcher {
cardsDrawnThisTurn.clear();
}
@Override
public KydeleCardsDrawnThisTurnWatcher copy() {
return new KydeleCardsDrawnThisTurnWatcher(this);
}
}

View file

@ -90,16 +90,6 @@ class LastSpellCastWatcher extends Watcher {
super(WatcherScope.GAME);
}
public LastSpellCastWatcher(final LastSpellCastWatcher watcher) {
super(watcher);
this.lastSpellCast = watcher.getLastSpellCast();
}
@Override
public LastSpellCastWatcher copy() {
return new LastSpellCastWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.SPELL_CAST) {

View file

@ -257,11 +257,6 @@ class MasterWarcraftCastWatcher extends Watcher {
super(WatcherScope.GAME);
}
public MasterWarcraftCastWatcher(final MasterWarcraftCastWatcher watcher) {
super(watcher);
this.copyCount = watcher.copyCount;
this.copyCountApply = watcher.copyCountApply;
}
@Override
public void reset() {
@ -269,11 +264,6 @@ class MasterWarcraftCastWatcher extends Watcher {
copyCountApply = 0;
}
@Override
public MasterWarcraftCastWatcher copy() {
return new MasterWarcraftCastWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
}

View file

@ -83,11 +83,6 @@ class MindstormCrownWatcher extends Watcher {
super(WatcherScope.GAME);
}
public MindstormCrownWatcher(final MindstormCrownWatcher watcher) {
super(watcher);
cardsInHandCount = watcher.cardsInHandCount;
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.BEGINNING_PHASE_PRE
@ -110,8 +105,4 @@ class MindstormCrownWatcher extends Watcher {
cardsInHandCount = 0;
}
@Override
public MindstormCrownWatcher copy() {
return new MindstormCrownWatcher(this);
}
}

View file

@ -114,11 +114,6 @@ class MoltenPsycheWatcher extends Watcher {
super(WatcherScope.GAME);
}
public MoltenPsycheWatcher(final MoltenPsycheWatcher watcher) {
super(watcher);
this.draws.putAll(watcher.draws);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DREW_CARD) {
@ -140,9 +135,4 @@ class MoltenPsycheWatcher extends Watcher {
return draws.getOrDefault(playerId, 0);
}
@Override
public MoltenPsycheWatcher copy() {
return new MoltenPsycheWatcher(this);
}
}

View file

@ -124,16 +124,6 @@ class MuldrothaTheGravetideWatcher extends Watcher {
super(WatcherScope.GAME);
}
public MuldrothaTheGravetideWatcher(final MuldrothaTheGravetideWatcher watcher) {
super(watcher);
sourcePlayedPermanentTypes.putAll(watcher.sourcePlayedPermanentTypes);
}
@Override
public MuldrothaTheGravetideWatcher copy() {
return new MuldrothaTheGravetideWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.PLAY_LAND) {

View file

@ -78,16 +78,6 @@ class MultanisPresenceWatcher extends Watcher {
super(WatcherScope.GAME);
}
public MultanisPresenceWatcher(final MultanisPresenceWatcher watcher) {
super(watcher);
this.spellsCast.putAll(watcher.spellsCast);
}
@Override
public MultanisPresenceWatcher copy() {
return new MultanisPresenceWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (GameEvent.EventType.SPELL_CAST == event.getType()) {

View file

@ -98,12 +98,6 @@ class NoRestForTheWickedWatcher extends Watcher {
this.cards = new ArrayList<>();
}
public NoRestForTheWickedWatcher(final NoRestForTheWickedWatcher watcher) {
super(watcher);
this.cards = new ArrayList<>();
this.cards.addAll(watcher.cards);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE
@ -113,11 +107,6 @@ class NoRestForTheWickedWatcher extends Watcher {
}
}
@Override
public NoRestForTheWickedWatcher copy() {
return new NoRestForTheWickedWatcher(this);
}
@Override
public void reset() {
super.reset();

View file

@ -88,11 +88,6 @@ class OathOfChandraWatcher extends Watcher {
super(WatcherScope.GAME);
}
public OathOfChandraWatcher(final OathOfChandraWatcher watcher) {
super(watcher);
this.players.addAll(watcher.players);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
@ -113,9 +108,4 @@ class OathOfChandraWatcher extends Watcher {
return players.contains(playerId);
}
@Override
public OathOfChandraWatcher copy() {
return new OathOfChandraWatcher(this);
}
}

View file

@ -76,11 +76,6 @@ class OathOfLilianaWatcher extends Watcher {
super(WatcherScope.GAME);
}
public OathOfLilianaWatcher(final OathOfLilianaWatcher watcher) {
super(watcher);
this.players.addAll(watcher.players);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
@ -101,9 +96,5 @@ class OathOfLilianaWatcher extends Watcher {
return players.contains(playerId);
}
@Override
public OathOfLilianaWatcher copy() {
return new OathOfLilianaWatcher(this);
}
}

View file

@ -71,21 +71,10 @@ class OpalPalaceWatcher extends Watcher {
this.originalId = originalId;
}
private OpalPalaceWatcher(final OpalPalaceWatcher watcher) {
super(watcher);
this.commanderId.addAll(watcher.commanderId);
this.originalId = watcher.originalId;
}
public boolean manaUsedToCastCommander(UUID id){
return commanderId.contains(id);
}
@Override
public OpalPalaceWatcher copy() {
return new OpalPalaceWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.MANA_PAID) {

View file

@ -109,15 +109,6 @@ class OvermasterWatcher extends Watcher {
super(WatcherScope.PLAYER);
}
OvermasterWatcher(final OvermasterWatcher watcher) {
super(watcher);
this.uncounterableSpell = watcher.uncounterableSpell;
}
@Override
public OvermasterWatcher copy() {
return new OvermasterWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {

View file

@ -97,16 +97,6 @@ class PalladiaMorsTheRuinerWatcher extends Watcher {
super(WatcherScope.GAME);
}
public PalladiaMorsTheRuinerWatcher(final PalladiaMorsTheRuinerWatcher watcher) {
super(watcher);
damagers.addAll(watcher.damagers);
}
@Override
public PalladiaMorsTheRuinerWatcher copy() {
return new PalladiaMorsTheRuinerWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
switch (event.getType()) {

View file

@ -76,15 +76,6 @@ class PatriciansScornWatcher extends Watcher {
super(WatcherScope.CARD);
}
public PatriciansScornWatcher(final PatriciansScornWatcher watcher) {
super(watcher);
}
@Override
public PatriciansScornWatcher copy() {
return new PatriciansScornWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (condition) { //no need to check - condition has already occured

View file

@ -25,7 +25,7 @@ public final class PillarOfFlame extends CardImpl {
this.getSpellAbility().addTarget(new TargetAnyTarget());
// If a creature dealt damage this way would die this turn, exile it instead.
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
this.getSpellAbility().addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher(false));
}
public PillarOfFlame(final PillarOfFlame card) {

View file

@ -94,11 +94,6 @@ class PowerSurgeWatcher extends Watcher {
super(WatcherScope.GAME);
}
public PowerSurgeWatcher(final PowerSurgeWatcher watcher) {
super(watcher);
untappedLandCount = watcher.untappedLandCount;
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.BEGINNING_PHASE_PRE
@ -115,9 +110,4 @@ class PowerSurgeWatcher extends Watcher {
public void reset() {
untappedLandCount = 0;
}
@Override
public PowerSurgeWatcher copy() {
return new PowerSurgeWatcher(this);
}
}

View file

@ -68,10 +68,6 @@ class CastCreatureWatcher extends Watcher {
super(WatcherScope.CARD);
}
public CastCreatureWatcher(final CastCreatureWatcher watcher) {
super(watcher);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST
@ -83,9 +79,4 @@ class CastCreatureWatcher extends Watcher {
}
}
}
@Override
public CastCreatureWatcher copy() {
return new CastCreatureWatcher(this);
}
}

View file

@ -107,14 +107,6 @@ class ETBSinceYourLastTurnWatcher extends Watcher {
this.playerToETBMap = new HashMap<>();
}
public ETBSinceYourLastTurnWatcher(ETBSinceYourLastTurnWatcher watcher) {
super(watcher);
this.playerToETBMap = new HashMap<>();
for (UUID player : watcher.playerToETBMap.keySet()){
this.playerToETBMap.put(player, new HashSet<>(watcher.playerToETBMap.get(player)));
}
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.END_TURN_STEP_POST){
@ -137,9 +129,4 @@ class ETBSinceYourLastTurnWatcher extends Watcher {
public boolean enteredSinceLastTurn(UUID player, MageObjectReference mor){
return playerToETBMap.get(player).contains(mor);
}
@Override
public ETBSinceYourLastTurnWatcher copy() {
return new ETBSinceYourLastTurnWatcher(this);
}
}

View file

@ -103,15 +103,6 @@ class QuickenWatcher extends Watcher {
super(WatcherScope.GAME);
}
private QuickenWatcher(final QuickenWatcher watcher) {
super(watcher);
}
@Override
public QuickenWatcher copy() {
return new QuickenWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {

View file

@ -28,7 +28,7 @@ public final class RageOfPurphoros extends CardImpl {
this.getSpellAbility().addEffect(new CantRegenerateTargetEffect(Duration.EndOfTurn, "It"));
this.getSpellAbility().addEffect(new ScryEffect(1));
this.getSpellAbility().addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher(false));
}
public RageOfPurphoros(final RageOfPurphoros card) {

View file

@ -107,20 +107,10 @@ class RasputinDreamweaverStartedUntappedWatcher extends Watcher {
super(WatcherScope.GAME);
}
RasputinDreamweaverStartedUntappedWatcher(final RasputinDreamweaverStartedUntappedWatcher watcher) {
super(watcher);
this.startedUntapped.addAll(watcher.startedUntapped);
}
@Override
public RasputinDreamweaverStartedUntappedWatcher copy() {
return new RasputinDreamweaverStartedUntappedWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == EventType.BEGINNING_PHASE_PRE) {
game.getBattlefield().getAllActivePermanents(filter, game).stream().forEach(permanent -> startedUntapped.add(permanent.getId()));
game.getBattlefield().getAllActivePermanents(filter, game).forEach(permanent -> startedUntapped.add(permanent.getId()));
}
}

Some files were not shown because too many files have changed in this diff Show more