[BRO] fix Visions of Phyrexia

This commit is contained in:
Evan Kranzler 2022-11-13 14:20:01 -05:00
parent 94c534fba5
commit 221cc8433a

View file

@ -39,7 +39,7 @@ public final class VisionsOfPhyrexia extends CardImpl {
this.addAbility(new BeginningOfEndStepTriggeredAbility( this.addAbility(new BeginningOfEndStepTriggeredAbility(
new CreateTokenEffect(new PowerstoneToken(), 1, true), new CreateTokenEffect(new PowerstoneToken(), 1, true),
TargetController.YOU, VisionsOfPhyrexiaCondition.instance, false TargetController.YOU, VisionsOfPhyrexiaCondition.instance, false
), new VisionsOfPhyrexiaConditionWatcher()); ), new VisionsOfPhyrexiaWatcher());
} }
private VisionsOfPhyrexia(final VisionsOfPhyrexia card) { private VisionsOfPhyrexia(final VisionsOfPhyrexia card) {
@ -57,7 +57,7 @@ enum VisionsOfPhyrexiaCondition implements Condition {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
return !VisionsOfPhyrexiaConditionWatcher.checkPlayer(game, source); return !VisionsOfPhyrexiaWatcher.checkPlayer(game, source);
} }
@Override @Override
@ -66,11 +66,11 @@ enum VisionsOfPhyrexiaCondition implements Condition {
} }
} }
class VisionsOfPhyrexiaConditionWatcher extends Watcher { class VisionsOfPhyrexiaWatcher extends Watcher {
private final Set<UUID> playerSet = new HashSet<>(); private final Set<UUID> playerSet = new HashSet<>();
VisionsOfPhyrexiaConditionWatcher() { VisionsOfPhyrexiaWatcher() {
super(WatcherScope.GAME); super(WatcherScope.GAME);
} }
@ -99,8 +99,8 @@ class VisionsOfPhyrexiaConditionWatcher extends Watcher {
static boolean checkPlayer(Game game, Ability source) { static boolean checkPlayer(Game game, Ability source) {
return game return game
.getState() .getState()
.getWatcher(VisionsOfPhyrexiaConditionWatcher.class) .getWatcher(VisionsOfPhyrexiaWatcher.class)
.playerSet .playerSet
.add(source.getControllerId()); .contains(source.getControllerId());
} }
} }