* Kuon, Ogre Ascendant - Fixed that also non creatures going to graveyard were count for Kuon, Ogre Ascendant flip ability.

This commit is contained in:
LevelX2 2015-05-07 21:14:21 +02:00
parent 4bea123bf3
commit 182f91ea41
2 changed files with 12 additions and 10 deletions

View file

@ -27,6 +27,7 @@
*/
package mage.watchers.common;
import mage.constants.CardType;
import mage.constants.WatcherScope;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -37,25 +38,27 @@ import mage.watchers.Watcher;
*
* @author LevelX2
*/
public class CreaturesDiedWatcher extends Watcher {
private int amountOfCreaturesThatDied;
public CreaturesDiedWatcher() {
super("CreaturesDiedWatcher", WatcherScope.GAME);
super("CreaturesDiedWatcher", WatcherScope.GAME);
}
public CreaturesDiedWatcher(final CreaturesDiedWatcher watcher) {
super(watcher);
this.amountOfCreaturesThatDied = watcher.amountOfCreaturesThatDied;
super(watcher);
this.amountOfCreaturesThatDied = watcher.amountOfCreaturesThatDied;
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
amountOfCreaturesThatDied++;
}
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent() && zEvent.getTarget() != null && zEvent.getTarget().getCardType().contains(CardType.CREATURE)) {
amountOfCreaturesThatDied++;
}
}
}
@Override
@ -64,12 +67,12 @@ public class CreaturesDiedWatcher extends Watcher {
}
public int getAmountOfCreaturesDiesThisTurn() {
return amountOfCreaturesThatDied;
return amountOfCreaturesThatDied;
}
@Override
public CreaturesDiedWatcher copy() {
return new CreaturesDiedWatcher(this);
return new CreaturesDiedWatcher(this);
}
}