diff --git a/Mage.Sets/src/mage/cards/b/BonePicker.java b/Mage.Sets/src/mage/cards/b/BonePicker.java index 8ad905c6b95..624b0dfa03b 100644 --- a/Mage.Sets/src/mage/cards/b/BonePicker.java +++ b/Mage.Sets/src/mage/cards/b/BonePicker.java @@ -34,14 +34,12 @@ import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.MorbidCondition; import mage.abilities.costs.AdjustingSourceCosts; -import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.FilterPermanent; -import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.util.CardUtil; import mage.watchers.common.MorbidWatcher; @@ -54,7 +52,7 @@ public class BonePicker extends CardImpl { public BonePicker(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); - + this.subtype.add("Bird"); this.power = new MageInt(3); this.toughness = new MageInt(2); @@ -106,6 +104,6 @@ class BonePickerCostAdjustmentAbility extends SimpleStaticAbility implements Adj if (MorbidCondition.instance.apply(game, ability)) { CardUtil.adjustCost((SpellAbility) ability, 3); } - } + } } } diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index 9030dcd5dfb..a7fe78783eb 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -981,6 +981,7 @@ public abstract class GameImpl implements Game, Serializable { } } getState().setChoosingPlayerId(null); + state.getWatchers().reset(); // watcher objects from cards are reused during match so reset all card watchers already added Watchers watchers = state.getWatchers(); // add default watchers for (UUID playerId : state.getPlayerList(startingPlayerId)) { diff --git a/Mage/src/main/java/mage/game/GameState.java b/Mage/src/main/java/mage/game/GameState.java index fbda67dc8c7..95a88bceb88 100644 --- a/Mage/src/main/java/mage/game/GameState.java +++ b/Mage/src/main/java/mage/game/GameState.java @@ -27,6 +27,8 @@ */ package mage.game; +import java.io.Serializable; +import java.util.*; import mage.MageObject; import mage.abilities.*; import mage.abilities.effects.ContinuousEffect; @@ -58,9 +60,6 @@ import mage.util.ThreadLocalStringBuilder; import mage.watchers.Watcher; import mage.watchers.Watchers; -import java.io.Serializable; -import java.util.*; - /** * * @author BetaSteward_at_googlemail.com diff --git a/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java b/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java index d69521a7996..f50ae28ddbe 100644 --- a/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,21 +20,17 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.watchers.common; -import mage.constants.CardType; import mage.constants.WatcherScope; -import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; -import mage.game.permanent.Permanent; import mage.watchers.Watcher; /** @@ -56,11 +52,10 @@ public class MorbidWatcher extends Watcher { if (condition) { return; } - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { - Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (p != null && p.isCreature()) { - condition = true; - } + if (event.getType() == GameEvent.EventType.ZONE_CHANGE + && ((ZoneChangeEvent) event).isDiesEvent() + && ((ZoneChangeEvent) event).getTarget().isCreature()) { + condition = true; } }