mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
changed the constructor for a Watcher. Before, you had to explictly pass the name of the watcher as an argument. But most of the time this was the name of the class itself. So the watcher now determines internally its name. The method 'getBasicKey' can be overridden. Also updated some encapsulation
This commit is contained in:
parent
5c1f41f3a7
commit
c4eeec1bb2
178 changed files with 313 additions and 296 deletions
|
@ -135,7 +135,7 @@ class AbandonedSarcophagusWatcher extends Watcher {
|
|||
private final Map<UUID, Cards> cycledCardsThisTurn = new HashMap<>();
|
||||
|
||||
AbandonedSarcophagusWatcher() {
|
||||
super(AbandonedSarcophagusWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
private AbandonedSarcophagusWatcher(final AbandonedSarcophagusWatcher watcher) {
|
||||
|
|
|
@ -71,7 +71,7 @@ class DamagedByPiratesWatcher extends Watcher {
|
|||
private final Map<UUID, Set<UUID>> damageSourceIds = new HashMap<>();
|
||||
|
||||
public DamagedByPiratesWatcher() {
|
||||
super(DamagedByPiratesWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
private DamagedByPiratesWatcher(final DamagedByPiratesWatcher watcher) {
|
||||
|
|
|
@ -96,7 +96,7 @@ class ApproachOfTheSecondSunWatcher extends Watcher {
|
|||
private Map<UUID, Integer> approachesCast = new HashMap<>();
|
||||
|
||||
public ApproachOfTheSecondSunWatcher() {
|
||||
super(ApproachOfTheSecondSunWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public ApproachOfTheSecondSunWatcher(final ApproachOfTheSecondSunWatcher watcher) {
|
||||
|
|
|
@ -54,7 +54,7 @@ class ArchiveTrapWatcher extends Watcher {
|
|||
private Set<UUID> playerIds = new HashSet<>();
|
||||
|
||||
public ArchiveTrapWatcher() {
|
||||
super(ArchiveTrapWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
private ArchiveTrapWatcher(final ArchiveTrapWatcher watcher) {
|
||||
|
|
|
@ -84,7 +84,7 @@ class ArclightPhoenixWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> instantSorceryCount = new HashMap<>();
|
||||
|
||||
public ArclightPhoenixWatcher() {
|
||||
super(ArclightPhoenixWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public ArclightPhoenixWatcher(final ArclightPhoenixWatcher watcher) {
|
||||
|
|
|
@ -56,7 +56,7 @@ class AsmiraHolyAvengerWatcher extends Watcher {
|
|||
private int creaturesCount = 0;
|
||||
|
||||
public AsmiraHolyAvengerWatcher() {
|
||||
super(AsmiraHolyAvengerWatcher.class.getSimpleName(), WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
condition = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ class AureliasFuryDamagedByWatcher extends Watcher {
|
|||
private final Set<UUID> damagedPlayers = new HashSet<>();
|
||||
|
||||
AureliasFuryDamagedByWatcher() {
|
||||
super(AureliasFuryDamagedByWatcher.class.getSimpleName(), WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
private AureliasFuryDamagedByWatcher(final AureliasFuryDamagedByWatcher watcher) {
|
||||
|
|
|
@ -96,7 +96,7 @@ class BerserkReplacementEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
class CombatDamageStepStartedWatcher extends Watcher {
|
||||
|
||||
public CombatDamageStepStartedWatcher() {
|
||||
super(CombatDamageStepStartedWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public CombatDamageStepStartedWatcher(final CombatDamageStepStartedWatcher watcher) {
|
||||
|
|
|
@ -81,10 +81,10 @@ enum BlazingEffigyCount implements DynamicValue {
|
|||
|
||||
class BlazingEffigyWatcher extends Watcher {
|
||||
|
||||
public final Map<MageObjectReference, Integer> damagedObjects = new HashMap<>();
|
||||
private final Map<MageObjectReference, Integer> damagedObjects = new HashMap<>();
|
||||
|
||||
public BlazingEffigyWatcher() {
|
||||
super(BlazingEffigyWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public BlazingEffigyWatcher(final BlazingEffigyWatcher watcher) {
|
||||
|
|
|
@ -62,7 +62,7 @@ class BoseijuWhoSheltersAllWatcher extends Watcher {
|
|||
private final String originalId;
|
||||
|
||||
public BoseijuWhoSheltersAllWatcher(UUID originalId) {
|
||||
super(BoseijuWhoSheltersAllWatcher.class, WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
this.originalId = originalId.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ class BurningCinderFuryOfCrimsonChaosFireWatcher extends Watcher {
|
|||
private final Set<UUID> tappedActivePlayerIds = new HashSet<>();
|
||||
|
||||
public BurningCinderFuryOfCrimsonChaosFireWatcher() {
|
||||
super(BurningCinderFuryOfCrimsonChaosFireWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public BurningCinderFuryOfCrimsonChaosFireWatcher(final BurningCinderFuryOfCrimsonChaosFireWatcher watcher) {
|
||||
|
|
|
@ -60,7 +60,7 @@ class CallerOfTheClawWatcher extends Watcher {
|
|||
private int creaturesCount = 0;
|
||||
|
||||
public CallerOfTheClawWatcher() {
|
||||
super(CallerOfTheClawWatcher.class.getSimpleName(), WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
condition = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ class CathedralMembraneWatcher extends Watcher {
|
|||
private final Set<UUID> blockedCreatures = new HashSet<>();
|
||||
|
||||
CathedralMembraneWatcher() {
|
||||
super(CathedralMembraneWatcher.class.getSimpleName(), WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
private CathedralMembraneWatcher(final CathedralMembraneWatcher watcher) {
|
||||
|
|
|
@ -125,7 +125,7 @@ class CavernOfSoulsWatcher extends Watcher {
|
|||
private final String originalId;
|
||||
|
||||
public CavernOfSoulsWatcher(UUID originalId) {
|
||||
super(CavernOfSoulsWatcher.class.getSimpleName(), WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
this.originalId = originalId.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ class CerebralVortexWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> draws = new HashMap<>();
|
||||
|
||||
CerebralVortexWatcher() {
|
||||
super(CerebralVortexWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
CerebralVortexWatcher(final CerebralVortexWatcher watcher) {
|
||||
|
|
|
@ -68,10 +68,10 @@ enum CobraTrapCondition implements Condition {
|
|||
|
||||
class CobraTrapWatcher extends Watcher {
|
||||
|
||||
Set<UUID> players = new HashSet<>();
|
||||
private Set<UUID> players = new HashSet<>();
|
||||
|
||||
public CobraTrapWatcher() {
|
||||
super(CobraTrapWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public CobraTrapWatcher(final CobraTrapWatcher watcher) {
|
||||
|
|
|
@ -74,7 +74,7 @@ class ConduitOfRuinWatcher extends Watcher {
|
|||
private Map<UUID, Integer> playerCreatureSpells;
|
||||
|
||||
public ConduitOfRuinWatcher() {
|
||||
super(ConduitOfRuinWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
playerCreatureSpells = new HashMap<>();
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ class CorrosiveOozeCombatWatcher extends Watcher {
|
|||
private final Map<MageObjectReference, Set<MageObjectReference>> oozeEquipmentsToDestroy = new HashMap<>();
|
||||
|
||||
public CorrosiveOozeCombatWatcher() {
|
||||
super(CorrosiveOozeCombatWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public CorrosiveOozeCombatWatcher(final CorrosiveOozeCombatWatcher watcher) {
|
||||
|
@ -132,7 +132,7 @@ class CorrosiveOozeCombatWatcher extends Watcher {
|
|||
oozeBlocksOrBlocked.put(entry.getKey(), newSet);
|
||||
}
|
||||
for (Map.Entry<MageObjectReference, Set<MageObjectReference>> entry : watcher.oozeEquipmentsToDestroy.entrySet()) {
|
||||
HashSet<MageObjectReference> newSet = new HashSet<>(entry.getValue());
|
||||
Set<MageObjectReference> newSet = new HashSet<>(entry.getValue());
|
||||
oozeEquipmentsToDestroy.put(entry.getKey(), newSet);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,10 +25,7 @@ import mage.target.common.TargetCardInYourGraveyard;
|
|||
import mage.target.targetadjustment.TargetAdjuster;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author L_J
|
||||
|
@ -83,10 +80,10 @@ enum CustodiSoulcallerAdjuster implements TargetAdjuster {
|
|||
|
||||
class CustodiSoulcallerWatcher extends Watcher {
|
||||
|
||||
private final HashMap<UUID, Set<UUID>> playersAttacked = new HashMap<>(0);
|
||||
private final Map<UUID, Set<UUID>> playersAttacked = new HashMap<>(0);
|
||||
|
||||
CustodiSoulcallerWatcher() {
|
||||
super("CustodiSoulcallerWatcher", WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
CustodiSoulcallerWatcher(final CustodiSoulcallerWatcher watcher) {
|
||||
|
|
|
@ -190,7 +190,7 @@ class CyclopeanTombCounterWatcher extends Watcher {
|
|||
private final Map<MageObjectReference, Set<MageObjectReference>> counterData = new HashMap<>();
|
||||
|
||||
CyclopeanTombCounterWatcher() {
|
||||
super(CyclopeanTombCounterWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
private CyclopeanTombCounterWatcher(final CyclopeanTombCounterWatcher watcher) {
|
||||
|
|
|
@ -85,7 +85,7 @@ class DarkbladeAgentWatcher extends Watcher {
|
|||
private final Set<UUID> surveiledThisTurn = new HashSet<>();
|
||||
|
||||
public DarkbladeAgentWatcher() {
|
||||
super(DarkbladeAgentWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public DarkbladeAgentWatcher(final DarkbladeAgentWatcher watcher) {
|
||||
|
|
|
@ -106,7 +106,7 @@ class DesolationWatcher extends Watcher {
|
|||
private final Set<UUID> tappedForManaThisTurnPlayers = new HashSet<>();
|
||||
|
||||
public DesolationWatcher() {
|
||||
super(DesolationWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super( WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public DesolationWatcher(final DesolationWatcher watcher) {
|
||||
|
|
|
@ -137,7 +137,7 @@ class DiseasedVerminWatcher extends Watcher {
|
|||
private final Set<UUID> damagedPlayers;
|
||||
|
||||
public DiseasedVerminWatcher() {
|
||||
super(DiseasedVerminWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
damagedPlayers = new HashSet<>();
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class CardsDiscardedThisTurnWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> amountOfCardsDiscardedThisTurn = new HashMap<>();
|
||||
|
||||
public CardsDiscardedThisTurnWatcher() {
|
||||
super(CardsDiscardedThisTurnWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public CardsDiscardedThisTurnWatcher(final CardsDiscardedThisTurnWatcher watcher) {
|
||||
|
|
|
@ -131,7 +131,7 @@ class DungeonGeistsEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
class DungeonGeistsWatcher extends Watcher {
|
||||
|
||||
DungeonGeistsWatcher() {
|
||||
super("ControlLost", WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
DungeonGeistsWatcher(DungeonGeistsWatcher watcher) {
|
||||
|
|
|
@ -86,7 +86,7 @@ class InvestigatedWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> timesInvestigated = new HashMap<>();
|
||||
|
||||
public InvestigatedWatcher() {
|
||||
super(InvestigatedWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public InvestigatedWatcher(final InvestigatedWatcher watcher) {
|
||||
|
|
|
@ -51,7 +51,7 @@ class EtherswornCanonistWatcher extends Watcher {
|
|||
private Set<UUID> castNonartifactSpell = new HashSet<>();
|
||||
|
||||
public EtherswornCanonistWatcher() {
|
||||
super(EtherswornCanonistWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public EtherswornCanonistWatcher(final EtherswornCanonistWatcher watcher) {
|
||||
|
|
|
@ -73,7 +73,7 @@ class FairgroundsTrumpeterWatcher extends Watcher {
|
|||
private final Set<UUID> players = new HashSet<>();
|
||||
|
||||
public FairgroundsTrumpeterWatcher() {
|
||||
super(FairgroundsTrumpeterWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public FairgroundsTrumpeterWatcher(final FairgroundsTrumpeterWatcher watcher) {
|
||||
|
|
|
@ -80,7 +80,7 @@ class FaithsRewardWatcher extends Watcher {
|
|||
private List<UUID> cards = new ArrayList<>();
|
||||
|
||||
public FaithsRewardWatcher() {
|
||||
super(FaithsRewardWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public FaithsRewardWatcher(final FaithsRewardWatcher watcher) {
|
||||
|
|
|
@ -65,7 +65,7 @@ class FellShepherdWatcher extends Watcher {
|
|||
private Set<UUID> creatureIds = new HashSet<>();
|
||||
|
||||
public FellShepherdWatcher() {
|
||||
super(FellShepherdWatcher.class, WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
condition = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class FleshAllergyWatcher extends Watcher {
|
|||
private int creaturesDiedThisTurn = 0;
|
||||
|
||||
public FleshAllergyWatcher() {
|
||||
super(FleshAllergyWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
private FleshAllergyWatcher(final FleshAllergyWatcher watcher) {
|
||||
|
|
|
@ -98,7 +98,7 @@ class FreeRangeChickenWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> totalRolls = new HashMap<>();
|
||||
|
||||
public FreeRangeChickenWatcher() {
|
||||
super(FreeRangeChickenWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public FreeRangeChickenWatcher(final FreeRangeChickenWatcher watcher) {
|
||||
|
|
|
@ -109,7 +109,7 @@ class GarnaTheBloodflameWatcher extends Watcher {
|
|||
private final Set<UUID> cards = new HashSet<>();
|
||||
|
||||
public GarnaTheBloodflameWatcher() {
|
||||
super(GarnaTheBloodflameWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public GarnaTheBloodflameWatcher(final GarnaTheBloodflameWatcher watcher) {
|
||||
|
|
|
@ -63,7 +63,7 @@ class GeneratorServantWatcher extends Watcher {
|
|||
private List<UUID> creatures = new ArrayList<>();
|
||||
|
||||
public GeneratorServantWatcher() {
|
||||
super(GeneratorServantWatcher.class, WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
private GeneratorServantWatcher(final GeneratorServantWatcher watcher) {
|
||||
|
|
|
@ -133,7 +133,7 @@ class GisaAndGeralfWatcher extends Watcher {
|
|||
private boolean abilityUsed = false;
|
||||
|
||||
GisaAndGeralfWatcher() {
|
||||
super("GisaAndGeralfWatcher", WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
GisaAndGeralfWatcher(final GisaAndGeralfWatcher watcher) {
|
||||
|
|
|
@ -120,7 +120,7 @@ class BlockedByWatcher extends Watcher {
|
|||
private List<UUID> blockedByWatcher = new ArrayList<>();
|
||||
|
||||
public BlockedByWatcher() {
|
||||
super(BlockedByWatcher.class.getSimpleName(), WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
private BlockedByWatcher(final BlockedByWatcher watcher) {
|
||||
|
|
|
@ -97,7 +97,7 @@ class GontisMachinationsFirstLostLifeThisTurnWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> playersLostLife = new HashMap<>();
|
||||
|
||||
public GontisMachinationsFirstLostLifeThisTurnWatcher() {
|
||||
super(GontisMachinationsFirstLostLifeThisTurnWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public GontisMachinationsFirstLostLifeThisTurnWatcher(final GontisMachinationsFirstLostLifeThisTurnWatcher watcher) {
|
||||
|
|
|
@ -62,10 +62,10 @@ public final class GrandWarlordRadha extends CardImpl {
|
|||
|
||||
class CreaturesAttackedWatcher extends Watcher {
|
||||
|
||||
public final Set<MageObjectReference> attackedThisTurnCreatures = new HashSet<>();
|
||||
private final Set<MageObjectReference> attackedThisTurnCreatures = new HashSet<>();
|
||||
|
||||
public CreaturesAttackedWatcher() {
|
||||
super(CreaturesAttackedWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public CreaturesAttackedWatcher(final CreaturesAttackedWatcher watcher) {
|
||||
|
|
|
@ -116,7 +116,7 @@ class GrimReminderWatcher extends Watcher {
|
|||
private final Map<String, Set<UUID>> playersCastSpell = new HashMap<>();
|
||||
|
||||
public GrimReminderWatcher() {
|
||||
super(GrimReminderWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public GrimReminderWatcher(final GrimReminderWatcher watcher) {
|
||||
|
|
|
@ -171,7 +171,7 @@ class GrothamaAllDevouringWatcher extends Watcher {
|
|||
private Map<MageObjectReference, Map<UUID, Integer>> damageMap = new HashMap<>();
|
||||
|
||||
GrothamaAllDevouringWatcher() {
|
||||
super(GrothamaAllDevouringWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
GrothamaAllDevouringWatcher(final GrothamaAllDevouringWatcher watcher) {
|
||||
|
|
|
@ -58,7 +58,7 @@ class GuildmagesForumWatcher extends Watcher {
|
|||
private final Ability source;
|
||||
|
||||
GuildmagesForumWatcher(Ability source) {
|
||||
super("GuildmagesForumWatcher", WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ class HallOfTheBanditLordWatcher extends Watcher {
|
|||
private final List<UUID> creatures = new ArrayList<>();
|
||||
|
||||
HallOfTheBanditLordWatcher(Ability source) {
|
||||
super("HallOfTheBanditLordWatcher", WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import mage.watchers.Watcher;
|
|||
public class HomicidalBruteWatcher extends Watcher {
|
||||
|
||||
public HomicidalBruteWatcher() {
|
||||
super(HomicidalBruteWatcher.class.getSimpleName(), WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
public HomicidalBruteWatcher(final HomicidalBruteWatcher watcher) {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
|
||||
package mage.cards.h;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
|
@ -138,10 +136,10 @@ class HopeOfGhirapurPlayerLostLifePredicate implements ObjectSourcePlayerPredica
|
|||
|
||||
class HopeOfGhirapurCombatDamageWatcher extends Watcher {
|
||||
|
||||
private final HashMap<MageObjectReference, Set<UUID>> combatDamagedPlayers = new HashMap<>();
|
||||
private final Map<MageObjectReference, Set<UUID>> combatDamagedPlayers = new HashMap<>();
|
||||
|
||||
public HopeOfGhirapurCombatDamageWatcher() {
|
||||
super(HopeOfGhirapurCombatDamageWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public HopeOfGhirapurCombatDamageWatcher(final HopeOfGhirapurCombatDamageWatcher watcher) {
|
||||
|
|
|
@ -81,7 +81,7 @@ class HotHeadedGiantWatcher extends Watcher {
|
|||
private UUID cardId;
|
||||
|
||||
public HotHeadedGiantWatcher(UUID cardId) {
|
||||
super(HotHeadedGiantWatcher.class.getSimpleName(), WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
this.cardId = cardId;
|
||||
}
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ class IcefallRegentEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
class IcefallRegentWatcher extends Watcher {
|
||||
|
||||
IcefallRegentWatcher() {
|
||||
super("ControlLost", WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
IcefallRegentWatcher(IcefallRegentWatcher watcher) {
|
||||
|
|
|
@ -97,7 +97,7 @@ class IchneumonDruidWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> playerInstantCount = new HashMap<>();
|
||||
|
||||
public IchneumonDruidWatcher() {
|
||||
super(IchneumonDruidWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public IchneumonDruidWatcher(final IchneumonDruidWatcher watcher) {
|
||||
|
|
|
@ -90,7 +90,7 @@ class GreatestAmountOfDamageWatcher extends Watcher {
|
|||
private int damageAmount;
|
||||
|
||||
public GreatestAmountOfDamageWatcher() {
|
||||
super(GreatestAmountOfDamageWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public GreatestAmountOfDamageWatcher(final GreatestAmountOfDamageWatcher watcher) {
|
||||
|
|
|
@ -69,10 +69,10 @@ enum InfernoTrapCondition implements Condition {
|
|||
|
||||
class InfernoTrapWatcher extends Watcher {
|
||||
|
||||
Map<UUID, Set<MageObjectReference>> playerDamagedByCreature = new HashMap<>();
|
||||
private Map<UUID, Set<MageObjectReference>> playerDamagedByCreature = new HashMap<>();
|
||||
|
||||
public InfernoTrapWatcher() {
|
||||
super(InfernoTrapWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public InfernoTrapWatcher(final InfernoTrapWatcher watcher) {
|
||||
|
|
|
@ -83,7 +83,7 @@ class InsatiableRakghoulEffect extends OneShotEffect {
|
|||
class NonArtifactCreaturesDiedWatcher extends Watcher {
|
||||
|
||||
public NonArtifactCreaturesDiedWatcher() {
|
||||
super(NonArtifactCreaturesDiedWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public NonArtifactCreaturesDiedWatcher(final NonArtifactCreaturesDiedWatcher watcher) {
|
||||
|
|
|
@ -104,7 +104,7 @@ class InsistWatcher extends Watcher {
|
|||
protected UUID uncounterableSpell;
|
||||
|
||||
InsistWatcher() {
|
||||
super(InsistWatcher.class, WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
}
|
||||
|
||||
InsistWatcher(final InsistWatcher watcher) {
|
||||
|
|
|
@ -94,10 +94,10 @@ class JandorsRingEffect extends OneShotEffect {
|
|||
|
||||
class JandorsRingWatcher extends Watcher {
|
||||
|
||||
Map<UUID, UUID> lastDrawnCards = new HashMap<>();
|
||||
private Map<UUID, UUID> lastDrawnCards = new HashMap<>();
|
||||
|
||||
public JandorsRingWatcher() {
|
||||
super(JandorsRingWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public JandorsRingWatcher(final JandorsRingWatcher watcher) {
|
||||
|
@ -137,7 +137,7 @@ enum WatchedCardInHandCondition implements Condition {
|
|||
JandorsRingWatcher watcher = game.getState().getWatcher(JandorsRingWatcher.class);
|
||||
|
||||
return watcher != null
|
||||
&& watcher.lastDrawnCards != null && game.getPlayer(source.getControllerId()).getHand().contains(watcher.getLastDrewCard(source.getControllerId()));
|
||||
&& game.getPlayer(source.getControllerId()).getHand().contains(watcher.getLastDrewCard(source.getControllerId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -144,7 +144,7 @@ class JelevaNephaliasWatcher extends Watcher {
|
|||
private final Map<String, Integer> manaSpendToCast = new HashMap<>(); // cast
|
||||
|
||||
public JelevaNephaliasWatcher() {
|
||||
super(JelevaNephaliasWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public JelevaNephaliasWatcher(final JelevaNephaliasWatcher watcher) {
|
||||
|
|
|
@ -163,10 +163,10 @@ class KaradorGhostChieftainCastFromGraveyardEffect extends AsThoughEffectImpl {
|
|||
|
||||
class KaradorGhostChieftainWatcher extends Watcher {
|
||||
|
||||
boolean abilityUsed = false;
|
||||
private boolean abilityUsed = false;
|
||||
|
||||
KaradorGhostChieftainWatcher() {
|
||||
super(KaradorGhostChieftainWatcher.class, WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
KaradorGhostChieftainWatcher(final KaradorGhostChieftainWatcher watcher) {
|
||||
|
|
|
@ -159,7 +159,7 @@ class KessDissidentMageWatcher extends Watcher {
|
|||
private final Map<MageObjectReference, UUID> castSpells = new HashMap<>();
|
||||
|
||||
KessDissidentMageWatcher() {
|
||||
super(KessDissidentMageWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
private KessDissidentMageWatcher(final KessDissidentMageWatcher watcher) {
|
||||
|
|
|
@ -105,7 +105,7 @@ class MonarchAtTurnStartWatcher extends Watcher {
|
|||
private UUID monarchIdAtTurnStart;
|
||||
|
||||
public MonarchAtTurnStartWatcher() {
|
||||
super(MonarchAtTurnStartWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public MonarchAtTurnStartWatcher(final MonarchAtTurnStartWatcher watcher) {
|
||||
|
|
|
@ -115,7 +115,7 @@ enum KrovikanVampireInterveningIfCondition implements Condition {
|
|||
KrovikanVampireCreaturesDiedWatcher watcherDied = game.getState().getWatcher(KrovikanVampireCreaturesDiedWatcher.class);
|
||||
KrovikanVampireCreaturesDamagedWatcher watcherDamaged = game.getState().getWatcher(KrovikanVampireCreaturesDamagedWatcher.class);
|
||||
if (watcherDied != null) {
|
||||
Set<UUID> creaturesThatDiedThisTurn = watcherDied.diedThisTurn;
|
||||
Set<UUID> creaturesThatDiedThisTurn = watcherDied.getDiedThisTurn();
|
||||
for (UUID mor : creaturesThatDiedThisTurn) {
|
||||
if (watcherDamaged != null) {
|
||||
for (UUID mor2 : watcherDamaged.getDamagedBySource()) {
|
||||
|
@ -143,10 +143,10 @@ enum KrovikanVampireInterveningIfCondition implements Condition {
|
|||
|
||||
class KrovikanVampireCreaturesDamagedWatcher extends Watcher {
|
||||
|
||||
public final Set<UUID> damagedBySource = new HashSet<>();
|
||||
private final Set<UUID> damagedBySource = new HashSet<>();
|
||||
|
||||
public KrovikanVampireCreaturesDamagedWatcher() {
|
||||
super(KrovikanVampireCreaturesDamagedWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public KrovikanVampireCreaturesDamagedWatcher(final KrovikanVampireCreaturesDamagedWatcher watcher) {
|
||||
|
@ -179,10 +179,10 @@ class KrovikanVampireCreaturesDamagedWatcher extends Watcher {
|
|||
|
||||
class KrovikanVampireCreaturesDiedWatcher extends Watcher {
|
||||
|
||||
public final Set<UUID> diedThisTurn = new HashSet<>();
|
||||
private final Set<UUID> diedThisTurn = new HashSet<>();
|
||||
|
||||
public KrovikanVampireCreaturesDiedWatcher() {
|
||||
super(KrovikanVampireCreaturesDiedWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public KrovikanVampireCreaturesDiedWatcher(final KrovikanVampireCreaturesDiedWatcher watcher) {
|
||||
|
|
|
@ -109,7 +109,7 @@ class DamagedByEnchantedWatcher extends Watcher {
|
|||
private final Set<MageObjectReference> damagedCreatures = new HashSet<>();
|
||||
|
||||
public DamagedByEnchantedWatcher() {
|
||||
super(DamagedByEnchantedWatcher.class, WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
public DamagedByEnchantedWatcher(final DamagedByEnchantedWatcher watcher) {
|
||||
|
|
|
@ -85,7 +85,7 @@ class KydeleCardsDrawnThisTurnWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> cardsDrawnThisTurn = new HashMap<>();
|
||||
|
||||
public KydeleCardsDrawnThisTurnWatcher() {
|
||||
super(KydeleCardsDrawnThisTurnWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public KydeleCardsDrawnThisTurnWatcher(final KydeleCardsDrawnThisTurnWatcher watcher) {
|
||||
|
|
|
@ -64,8 +64,8 @@ class ManaMazeEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
Card card = game.getCard(event.getSourceId());
|
||||
if (card != null) {
|
||||
LastSpellCastWatcher watcher = game.getState().getWatcher(LastSpellCastWatcher.class);
|
||||
if (watcher != null && watcher.lastSpellCast != null) {
|
||||
return !card.getColor(game).intersection(watcher.lastSpellCast.getColor(game)).isColorless();
|
||||
if (watcher != null && watcher.getLastSpellCast() != null) {
|
||||
return !card.getColor(game).intersection(watcher.getLastSpellCast().getColor(game)).isColorless();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -84,15 +84,15 @@ class ManaMazeEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
|
||||
class LastSpellCastWatcher extends Watcher {
|
||||
|
||||
Spell lastSpellCast = null;
|
||||
private Spell lastSpellCast = null;
|
||||
|
||||
public LastSpellCastWatcher() {
|
||||
super(LastSpellCastWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public LastSpellCastWatcher(final LastSpellCastWatcher watcher) {
|
||||
super(watcher);
|
||||
this.lastSpellCast = watcher.lastSpellCast;
|
||||
this.lastSpellCast = watcher.getLastSpellCast();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -121,4 +121,8 @@ class LastSpellCastWatcher extends Watcher {
|
|||
super.reset();
|
||||
lastSpellCast = null;
|
||||
}
|
||||
|
||||
public Spell getLastSpellCast() {
|
||||
return lastSpellCast;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -254,7 +254,7 @@ class MasterWarcraftCastWatcher extends Watcher {
|
|||
public int copyCountApply = 0;
|
||||
|
||||
public MasterWarcraftCastWatcher() {
|
||||
super(MasterWarcraftCastWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public MasterWarcraftCastWatcher(final MasterWarcraftCastWatcher watcher) {
|
||||
|
|
|
@ -80,7 +80,7 @@ class MindstormCrownWatcher extends Watcher {
|
|||
private int cardsInHandCount;
|
||||
|
||||
public MindstormCrownWatcher() {
|
||||
super(MindstormCrownWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public MindstormCrownWatcher(final MindstormCrownWatcher watcher) {
|
||||
|
|
|
@ -111,7 +111,7 @@ class MoltenPsycheWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> draws = new HashMap<>();
|
||||
|
||||
public MoltenPsycheWatcher() {
|
||||
super(MoltenPsycheWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public MoltenPsycheWatcher(final MoltenPsycheWatcher watcher) {
|
||||
|
|
|
@ -112,7 +112,7 @@ class MuldrothaTheGravetideCastFromGraveyardEffect extends AsThoughEffectImpl {
|
|||
*/
|
||||
class MuldrothaTheGravetideWatcher extends Watcher {
|
||||
|
||||
final HashMap<MageObjectReference, Set<CardType>> sourcePlayedPermanentTypes = new HashMap<>(); // source that played permanent types from graveyard
|
||||
private final HashMap<MageObjectReference, Set<CardType>> sourcePlayedPermanentTypes = new HashMap<>(); // source that played permanent types from graveyard
|
||||
// final HashMap<UUID, Set<CardType>> playerPlayedPermanentTypes = new HashMap<>(); // player that played permanent types from graveyard
|
||||
// 4/27/2018 If multiple effects allow you to play a card from your graveyard, such as those of Gisa and Geralf and Karador,
|
||||
// Ghost Chieftain, you must announce which permission you're using as you begin to play the card.
|
||||
|
@ -121,7 +121,7 @@ class MuldrothaTheGravetideWatcher extends Watcher {
|
|||
private Zone fromZone;
|
||||
|
||||
public MuldrothaTheGravetideWatcher() {
|
||||
super(MuldrothaTheGravetideWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public MuldrothaTheGravetideWatcher(final MuldrothaTheGravetideWatcher watcher) {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -74,10 +72,10 @@ class MultanisPresenceTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
class MultanisPresenceWatcher extends Watcher {
|
||||
|
||||
private final HashMap<UUID, List<UUID>> spellsCast = new HashMap<>();
|
||||
private final Map<UUID, List<UUID>> spellsCast = new HashMap<>();
|
||||
|
||||
public MultanisPresenceWatcher() {
|
||||
super(MultanisPresenceWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public MultanisPresenceWatcher(final MultanisPresenceWatcher watcher) {
|
||||
|
|
|
@ -62,7 +62,7 @@ class NoRestForTheWickedEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (watcher != null && controller != null) {
|
||||
Cards cardsToHand = new CardsImpl();
|
||||
for (UUID cardId : watcher.cards) {
|
||||
for (UUID cardId : watcher.getCards()) {
|
||||
Card c = game.getCard(cardId);
|
||||
if (c != null) {
|
||||
if (game.getState().getZone(cardId) == Zone.GRAVEYARD
|
||||
|
@ -87,10 +87,14 @@ class NoRestForTheWickedEffect extends OneShotEffect {
|
|||
|
||||
class NoRestForTheWickedWatcher extends Watcher {
|
||||
|
||||
List<UUID> cards;
|
||||
public List<UUID> getCards() {
|
||||
return cards;
|
||||
}
|
||||
|
||||
private List<UUID> cards;
|
||||
|
||||
public NoRestForTheWickedWatcher() {
|
||||
super(NoRestForTheWickedWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
this.cards = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ class OathOfChandraWatcher extends Watcher {
|
|||
private final Set<UUID> players = new HashSet<>();
|
||||
|
||||
public OathOfChandraWatcher() {
|
||||
super(OathOfChandraWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public OathOfChandraWatcher(final OathOfChandraWatcher watcher) {
|
||||
|
|
|
@ -73,7 +73,7 @@ class OathOfLilianaWatcher extends Watcher {
|
|||
private final Set<UUID> players = new HashSet<>();
|
||||
|
||||
public OathOfLilianaWatcher() {
|
||||
super(OathOfLilianaWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public OathOfLilianaWatcher(final OathOfLilianaWatcher watcher) {
|
||||
|
|
|
@ -67,7 +67,7 @@ class OpalPalaceWatcher extends Watcher {
|
|||
private final String originalId;
|
||||
|
||||
public OpalPalaceWatcher(String originalId) {
|
||||
super(OpalPalaceWatcher.class, WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
this.originalId = originalId;
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ class OvermasterWatcher extends Watcher {
|
|||
protected UUID uncounterableSpell;
|
||||
|
||||
OvermasterWatcher() {
|
||||
super(OvermasterWatcher.class, WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
}
|
||||
|
||||
OvermasterWatcher(final OvermasterWatcher watcher) {
|
||||
|
|
|
@ -94,7 +94,7 @@ class PalladiaMorsTheRuinerWatcher extends Watcher {
|
|||
private final Set<MageObjectReference> damagers = new HashSet<>();
|
||||
|
||||
public PalladiaMorsTheRuinerWatcher() {
|
||||
super(PalladiaMorsTheRuinerWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public PalladiaMorsTheRuinerWatcher(final PalladiaMorsTheRuinerWatcher watcher) {
|
||||
|
|
|
@ -73,7 +73,7 @@ class PatriciansScornWatcher extends Watcher {
|
|||
}
|
||||
|
||||
public PatriciansScornWatcher() {
|
||||
super(PatriciansScornWatcher.class, WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
public PatriciansScornWatcher(final PatriciansScornWatcher watcher) {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
package mage.cards.p;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
|
@ -87,11 +88,11 @@ class PetrifiedWoodKinEffect extends OneShotEffect {
|
|||
if (player == null || watcher == null || permanent == null) {
|
||||
return false;
|
||||
}
|
||||
ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event
|
||||
List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event
|
||||
int amount = 0;
|
||||
for (UUID opponentId : game.getOpponents(player.getId())) {
|
||||
MageObjectReference mor = new MageObjectReference(opponentId, game);
|
||||
amount += watcher.damagedObjects.getOrDefault(mor, 0);
|
||||
amount += watcher.getDamagedObjects().getOrDefault(mor, 0);
|
||||
}
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game, appliedEffects);
|
||||
return true;
|
||||
|
|
|
@ -91,7 +91,7 @@ class PowerSurgeWatcher extends Watcher {
|
|||
private int untappedLandCount;
|
||||
|
||||
public PowerSurgeWatcher() {
|
||||
super(PowerSurgeWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public PowerSurgeWatcher(final PowerSurgeWatcher watcher) {
|
||||
|
|
|
@ -65,7 +65,7 @@ class DidNotCastCreatureCondition implements Condition {
|
|||
class CastCreatureWatcher extends Watcher {
|
||||
|
||||
public CastCreatureWatcher() {
|
||||
super(CastCreatureWatcher.class, WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
public CastCreatureWatcher(final CastCreatureWatcher watcher) {
|
||||
|
|
|
@ -103,7 +103,7 @@ class ETBSinceYourLastTurnWatcher extends Watcher {
|
|||
private final Map<UUID, Set<MageObjectReference>> playerToETBMap;
|
||||
|
||||
public ETBSinceYourLastTurnWatcher() {
|
||||
super(ETBSinceYourLastTurnWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
this.playerToETBMap = new HashMap<>();
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ class QuickenWatcher extends Watcher {
|
|||
private List<String> activeQuickenSpells = new ArrayList<>();
|
||||
|
||||
public QuickenWatcher() {
|
||||
super(QuickenWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
private QuickenWatcher(final QuickenWatcher watcher) {
|
||||
|
|
|
@ -104,7 +104,7 @@ class RasputinDreamweaverStartedUntappedWatcher extends Watcher {
|
|||
private final Set<UUID> startedUntapped = new HashSet<>(0);
|
||||
|
||||
RasputinDreamweaverStartedUntappedWatcher() {
|
||||
super(RasputinDreamweaverStartedUntappedWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
RasputinDreamweaverStartedUntappedWatcher(final RasputinDreamweaverStartedUntappedWatcher watcher) {
|
||||
|
|
|
@ -69,7 +69,7 @@ class ReversePolarityWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> artifactDamageReceivedThisTurn = new HashMap<>();
|
||||
|
||||
public ReversePolarityWatcher() {
|
||||
super(ReversePolarityWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public ReversePolarityWatcher(final ReversePolarityWatcher watcher) {
|
||||
|
|
|
@ -52,18 +52,18 @@ public final class RocketLauncher extends CardImpl {
|
|||
|
||||
class RocketLauncherWatcher extends Watcher {
|
||||
|
||||
boolean changedControllerOR1stTurn;
|
||||
UUID cardId = null;
|
||||
private boolean changedControllerOR1stTurn;
|
||||
private UUID cardId = null;
|
||||
|
||||
public RocketLauncherWatcher(UUID cardId) {
|
||||
super(RocketLauncherWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
this.changedControllerOR1stTurn = true;
|
||||
this.cardId = cardId;
|
||||
}
|
||||
|
||||
public RocketLauncherWatcher(final RocketLauncherWatcher watcher) {
|
||||
super(watcher);
|
||||
this.changedControllerOR1stTurn = watcher.changedControllerOR1stTurn;
|
||||
this.changedControllerOR1stTurn = watcher.isChangedControllerOR1stTurn();
|
||||
this.cardId = watcher.cardId;
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,10 @@ class RocketLauncherWatcher extends Watcher {
|
|||
super.reset();
|
||||
changedControllerOR1stTurn = true; //when is this reset called? may cause problems if in mid-life
|
||||
}
|
||||
|
||||
public boolean isChangedControllerOR1stTurn() {
|
||||
return changedControllerOR1stTurn;
|
||||
}
|
||||
}
|
||||
|
||||
enum ControlledTurnCondition implements Condition {
|
||||
|
@ -99,7 +103,7 @@ enum ControlledTurnCondition implements Condition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
RocketLauncherWatcher watcher = game.getState().getWatcher(RocketLauncherWatcher.class);
|
||||
|
||||
return watcher != null && !watcher.changedControllerOR1stTurn;
|
||||
return watcher != null && !watcher.isChangedControllerOR1stTurn();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -122,7 +122,7 @@ class SavageSummoningWatcher extends Watcher {
|
|||
private Map<String, Set<String>> cardsCastWithSavageSummoning = new LinkedHashMap<>();
|
||||
|
||||
public SavageSummoningWatcher() {
|
||||
super(SavageSummoningWatcher.class, WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
}
|
||||
|
||||
public SavageSummoningWatcher(final SavageSummoningWatcher watcher) {
|
||||
|
|
|
@ -101,7 +101,7 @@ class ScoutsWarningWatcher extends Watcher {
|
|||
private List<String> activeScoutsWarningSpells = new ArrayList<>();
|
||||
|
||||
public ScoutsWarningWatcher() {
|
||||
super(ScoutsWarningWatcher.class.getSimpleName(), WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
}
|
||||
|
||||
public ScoutsWarningWatcher(final ScoutsWarningWatcher watcher) {
|
||||
|
|
|
@ -58,7 +58,7 @@ class SeaTrollWatcher extends Watcher {
|
|||
private final Set<MageObjectReference> blockedOrBlockedByBlueThisTurnCreatures;
|
||||
|
||||
public SeaTrollWatcher() {
|
||||
super(SeaTrollWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super( WatcherScope.GAME);
|
||||
blockedOrBlockedByBlueThisTurnCreatures = new HashSet<>();
|
||||
}
|
||||
|
||||
|
|
|
@ -109,10 +109,10 @@ class SeasonOfTheWitchEffect extends OneShotEffect {
|
|||
|
||||
class CouldAttackThisTurnWatcher extends Watcher {
|
||||
|
||||
public final Set<MageObjectReference> couldAttackThisTurnCreatures = new HashSet<>();
|
||||
private final Set<MageObjectReference> couldAttackThisTurnCreatures = new HashSet<>();
|
||||
|
||||
public CouldAttackThisTurnWatcher() {
|
||||
super(CouldAttackThisTurnWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public CouldAttackThisTurnWatcher(final CouldAttackThisTurnWatcher watcher) {
|
||||
|
|
|
@ -59,7 +59,7 @@ class SecondSunriseEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
SecondSunriseWatcher watcher = game.getState().getWatcher(SecondSunriseWatcher.class);
|
||||
if (watcher != null) {
|
||||
for (UUID id : watcher.cards) {
|
||||
for (UUID id : watcher.getCards()) {
|
||||
Card c = game.getCard(id);
|
||||
if (c != null && game.getState().getZone(id) == Zone.GRAVEYARD) {
|
||||
if (c.isArtifact() || c.isCreature() ||
|
||||
|
@ -79,10 +79,10 @@ class SecondSunriseEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
class SecondSunriseWatcher extends Watcher {
|
||||
List<UUID> cards = new ArrayList<>();
|
||||
private List<UUID> cards = new ArrayList<>();
|
||||
|
||||
public SecondSunriseWatcher() {
|
||||
super(SecondSunriseWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public SecondSunriseWatcher(final SecondSunriseWatcher watcher) {
|
||||
|
@ -107,4 +107,8 @@ class SecondSunriseWatcher extends Watcher {
|
|||
super.reset();
|
||||
cards.clear();
|
||||
}
|
||||
|
||||
public List<UUID> getCards(){
|
||||
return cards;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ class SentinelTowerWatcher extends Watcher {
|
|||
private final List<MageObjectReference> spellsThisTurn;
|
||||
|
||||
SentinelTowerWatcher() {
|
||||
super(SentinelTowerWatcher.class, WatcherScope.GAME);
|
||||
super( WatcherScope.GAME);
|
||||
this.spellsThisTurn = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ class AttackedOrBlockedSinceYourLastUpkeepWatcher extends Watcher{
|
|||
private final Map<UUID, Set<MageObjectReference>> attackedOrBlockedCreatures = new HashMap<>();
|
||||
|
||||
public AttackedOrBlockedSinceYourLastUpkeepWatcher() {
|
||||
super(AttackedOrBlockedSinceYourLastUpkeepWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public AttackedOrBlockedSinceYourLastUpkeepWatcher(AttackedOrBlockedSinceYourLastUpkeepWatcher watcher) {
|
||||
|
|
|
@ -121,7 +121,7 @@ class ShipbreakerKrakenReplacementEffect extends ContinuousRuleModifyingEffectIm
|
|||
class ShipbreakerKrakenWatcher extends Watcher {
|
||||
|
||||
ShipbreakerKrakenWatcher () {
|
||||
super("ControlLost", WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
ShipbreakerKrakenWatcher(ShipbreakerKrakenWatcher watcher) {
|
||||
|
|
|
@ -80,7 +80,7 @@ class SiftThroughSandsWatcher extends Watcher {
|
|||
boolean castReachThroughMists = false;
|
||||
|
||||
public SiftThroughSandsWatcher() {
|
||||
super(SiftThroughSandsWatcher.class, WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
}
|
||||
|
||||
public SiftThroughSandsWatcher(final SiftThroughSandsWatcher watcher) {
|
||||
|
|
|
@ -84,7 +84,7 @@ class SoulReapWatcher extends Watcher {
|
|||
private UUID cardId;
|
||||
|
||||
public SoulReapWatcher(UUID cardId) {
|
||||
super(SoulReapWatcher.class, WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
this.cardId = cardId;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ class SpinerockKnollWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> amountOfDamageReceivedThisTurn = new HashMap<>(1);
|
||||
|
||||
SpinerockKnollWatcher() {
|
||||
super(SpinerockKnollWatcher.class.getSimpleName(), WatcherScope.CARD);
|
||||
super(WatcherScope.CARD);
|
||||
}
|
||||
|
||||
SpinerockKnollWatcher(final SpinerockKnollWatcher watcher) {
|
||||
|
|
|
@ -88,7 +88,7 @@ class SpinyStarfishWatcher extends Watcher {
|
|||
private final Map<UUID, Integer> regeneratedCount = new HashMap<>();
|
||||
|
||||
public SpinyStarfishWatcher() {
|
||||
super(SpinyStarfishWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public SpinyStarfishWatcher(final SpinyStarfishWatcher watcher) {
|
||||
|
|
|
@ -50,7 +50,7 @@ class SpiritOfTheLabyrinthWatcher extends Watcher {
|
|||
private final Set<UUID> playersThatDrewCard;
|
||||
|
||||
public SpiritOfTheLabyrinthWatcher() {
|
||||
super(SpiritOfTheLabyrinthWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
this.playersThatDrewCard = new HashSet<>();
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ class SpoilsOfBloodEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
CreaturesDiedThisTurnWatcher watcher = game.getState().getWatcher(CreaturesDiedThisTurnWatcher.class);
|
||||
if (watcher != null) {
|
||||
new CreateTokenEffect(new SpoilsOfBloodHorrorToken(watcher.creaturesDiedThisTurn)).apply(game, source);
|
||||
new CreateTokenEffect(new SpoilsOfBloodHorrorToken(watcher.getCreaturesDiedThisTurn())).apply(game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -77,10 +77,14 @@ class SpoilsOfBloodEffect extends OneShotEffect {
|
|||
|
||||
class CreaturesDiedThisTurnWatcher extends Watcher {
|
||||
|
||||
public int creaturesDiedThisTurn = 0;
|
||||
public int getCreaturesDiedThisTurn() {
|
||||
return creaturesDiedThisTurn;
|
||||
}
|
||||
|
||||
private int creaturesDiedThisTurn = 0;
|
||||
|
||||
public CreaturesDiedThisTurnWatcher() {
|
||||
super(CreaturesDiedThisTurnWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public CreaturesDiedThisTurnWatcher(final CreaturesDiedThisTurnWatcher watcher) {
|
||||
|
|
|
@ -104,7 +104,7 @@ class SteelHellkiteWatcher extends Watcher {
|
|||
private final Map<UUID, Set<UUID>> damageMap = new HashMap<>();
|
||||
|
||||
public SteelHellkiteWatcher() {
|
||||
super(SteelHellkiteWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public SteelHellkiteWatcher(final SteelHellkiteWatcher watcher) {
|
||||
|
|
|
@ -67,10 +67,10 @@ enum SummoningTrapCondition implements Condition {
|
|||
|
||||
class SummoningTrapWatcher extends Watcher {
|
||||
|
||||
Set<UUID> players = new HashSet<>();
|
||||
private Set<UUID> players = new HashSet<>();
|
||||
|
||||
public SummoningTrapWatcher() {
|
||||
super(SummoningTrapWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public SummoningTrapWatcher(final SummoningTrapWatcher watcher) {
|
||||
|
|
|
@ -119,7 +119,7 @@ class SylvanLibraryCardsDrawnThisTurnWatcher extends Watcher {
|
|||
private final Map<UUID, Set<UUID>> cardsDrawnThisTurn = new HashMap<>();
|
||||
|
||||
public SylvanLibraryCardsDrawnThisTurnWatcher() {
|
||||
super(SylvanLibraryCardsDrawnThisTurnWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public SylvanLibraryCardsDrawnThisTurnWatcher(final SylvanLibraryCardsDrawnThisTurnWatcher watcher) {
|
||||
|
|
|
@ -112,7 +112,7 @@ class TalarasBattalionWatcher extends Watcher {
|
|||
private final UUID cardId;
|
||||
|
||||
public TalarasBattalionWatcher(UUID cardId) {
|
||||
super(TalarasBattalionWatcher.class, WatcherScope.PLAYER);
|
||||
super(WatcherScope.PLAYER);
|
||||
this.cardId = cardId;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,10 +68,10 @@ enum PlayerCastNonCreatureSpellCondition implements Condition {
|
|||
|
||||
class PlayerCastNonCreatureSpellWatcher extends Watcher {
|
||||
|
||||
Set<UUID> playerIds = new HashSet<>();
|
||||
private Set<UUID> playerIds = new HashSet<>();
|
||||
|
||||
public PlayerCastNonCreatureSpellWatcher() {
|
||||
super(PlayerCastNonCreatureSpellWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public PlayerCastNonCreatureSpellWatcher(final PlayerCastNonCreatureSpellWatcher watcher) {
|
||||
|
|
|
@ -70,7 +70,7 @@ class AttackedLastCombatWatcher extends Watcher {
|
|||
public final Map<UUID, Map<MageObjectReference, UUID>> attackedLastCombatPlayers = new HashMap<>();
|
||||
|
||||
public AttackedLastCombatWatcher() {
|
||||
super(AttackedLastCombatWatcher.class, WatcherScope.GAME);
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public AttackedLastCombatWatcher(final AttackedLastCombatWatcher watcher) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue