diff --git a/Mage.Sets/src/mage/cards/m/MistbindClique.java b/Mage.Sets/src/mage/cards/m/MistbindClique.java index 6fa7d699f87..a50f70750e1 100644 --- a/Mage.Sets/src/mage/cards/m/MistbindClique.java +++ b/Mage.Sets/src/mage/cards/m/MistbindClique.java @@ -41,7 +41,7 @@ import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; import mage.target.TargetPlayer; /** @@ -51,7 +51,7 @@ import mage.target.TargetPlayer; public class MistbindClique extends CardImpl { public MistbindClique(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.subtype.add("Faerie"); this.subtype.add("Wizard"); @@ -98,7 +98,7 @@ class MistbindCliqueAbility extends ZoneChangeTriggeredAbility { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.ZONE_CHANGE; + return event.getType() == GameEvent.EventType.CREATURE_CHAMPIONED; } @Override @@ -106,8 +106,8 @@ class MistbindCliqueAbility extends ZoneChangeTriggeredAbility { if (event.getSourceId() != null && event.getSourceId().equals(getSourceId()) && !event.getSourceId().equals(event.getTargetId())) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getTarget() != null && zEvent.getTarget().hasSubtype("Faerie", game)) { + Permanent sacrificed = game.getPermanentOrLKIBattlefield(event.getTargetId()); + if (sacrificed != null && sacrificed.hasSubtype("Faerie", game)) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/ChampionAbility.java b/Mage/src/main/java/mage/abilities/keyword/ChampionAbility.java index c27ac62d4e6..bb804ce83aa 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ChampionAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ChampionAbility.java @@ -49,6 +49,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; +import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetControlledPermanent; @@ -87,7 +88,8 @@ public class ChampionAbility extends StaticAbility { * @param card * @param subtypes subtypes to champion with, if empty all creatures can be * used - * @param requiresCreature for cards that specifically require championing another creature + * @param requiresCreature for cards that specifically require championing + * another creature */ public ChampionAbility(Card card, String[] subtypes, boolean requiresCreature) { super(Zone.BATTLEFIELD, null); @@ -121,7 +123,7 @@ public class ChampionAbility extends StaticAbility { // When this permanent enters the battlefield, sacrifice it unless you exile another [object] you control. Ability ability1 = new EntersBattlefieldTriggeredAbility( - new SacrificeSourceUnlessPaysEffect(new ChampionExileCost(filter, new StringBuilder(card.getName()).append(" championed permanents").toString())), false); + new SacrificeSourceUnlessPaysEffect(new ChampionExileCost(filter, card.getName() + " championed permanents")), false); ability1.setRuleVisible(false); addSubAbility(ability1); @@ -180,6 +182,9 @@ class ChampionExileCost extends CostImpl { return false; } paid |= controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName() + " championed permanents", sourceId, game, Zone.BATTLEFIELD, true); + if (paid) { + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CREATURE_CHAMPIONED, permanent.getId(), sourceId, controllerId)); + } } } } diff --git a/Mage/src/main/java/mage/game/events/GameEvent.java b/Mage/src/main/java/mage/game/events/GameEvent.java index c7f2e94a9ff..eecd1a633d2 100644 --- a/Mage/src/main/java/mage/game/events/GameEvent.java +++ b/Mage/src/main/java/mage/game/events/GameEvent.java @@ -117,6 +117,12 @@ public class GameEvent implements Serializable { flag true = from comabat damage - other from non combat damage */ PLAY_LAND, LAND_PLAYED, + CREATURE_CHAMPIONED, + /* CREATURE_CHAMPIONED + targetId the id of the creature that was championed + sourceId sourceId of the creature using the champion ability + playerId the id of the controlling player + */ CREW_VEHICLE, /* CREW_VEHICLE targetId the id of the creature that crewed a vehicle