mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
fixed Gyome, Master Chef and Valentin, Dean of the Vein counting noncreature permanents (fixes #7913)
This commit is contained in:
parent
630f28bdf7
commit
a5bcf94a21
2 changed files with 10 additions and 3 deletions
|
@ -22,6 +22,7 @@ import mage.filter.common.FilterControlledPermanent;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.EntersTheBattlefieldEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import mage.game.permanent.token.FoodToken;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
@ -110,10 +111,14 @@ class GyomeMasterChefWatcher extends Watcher {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD
|
||||
&& !(((EntersTheBattlefieldEvent) event).getTarget() instanceof PermanentToken)) {
|
||||
playerMap.compute(event.getPlayerId(), (u, i) -> i != null ? Integer.sum(i, 1) : 1);
|
||||
if (event.getType() != GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
|
||||
return;
|
||||
}
|
||||
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
if (permanent == null || permanent instanceof PermanentToken || !permanent.isCreature()) {
|
||||
return;
|
||||
}
|
||||
playerMap.compute(event.getPlayerId(), (u, i) -> i != null ? Integer.sum(i, 1) : 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -118,7 +118,9 @@ class ValentinDeanOfTheVeinEffect extends ReplacementEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
return zEvent.isDiesEvent()
|
||||
&& zEvent.getTarget() != null
|
||||
&& !(zEvent.getTarget() instanceof PermanentToken)
|
||||
&& zEvent.getTarget().isCreature()
|
||||
&& game.getOpponents(zEvent.getTarget().getControllerId()).contains(source.getControllerId());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue