From 9273dd1ea033788605d032dc8238ea9598385f70 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Tue, 30 Apr 2019 19:21:43 +0400 Subject: [PATCH] Fixed that some cards doesn't trigger counter add events; --- Mage.Sets/src/mage/cards/c/CrovaxTheCursed.java | 9 ++++----- Mage.Sets/src/mage/cards/e/EntrailsFeaster.java | 15 +++++---------- Mage.Sets/src/mage/cards/n/NaturesBlessing.java | 13 ++++++------- Mage.Sets/src/mage/cards/o/Oubliette.java | 11 +++++------ Mage.Sets/src/mage/cards/t/TawnossCoffin.java | 10 +++++----- 5 files changed, 25 insertions(+), 33 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CrovaxTheCursed.java b/Mage.Sets/src/mage/cards/c/CrovaxTheCursed.java index a1f7a602a2..a7598d5058 100644 --- a/Mage.Sets/src/mage/cards/c/CrovaxTheCursed.java +++ b/Mage.Sets/src/mage/cards/c/CrovaxTheCursed.java @@ -1,7 +1,5 @@ - package mage.cards.c; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -22,14 +20,15 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class CrovaxTheCursed extends CardImpl { public CrovaxTheCursed(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(0); @@ -82,7 +81,7 @@ class CrovaxTheCursedEffect extends OneShotEffect { if (creatures > 0 && controller.chooseUse(outcome, "Sacrifice a creature?", source, game)) { if (new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURES, 1, "").apply(game, source)) { if (sourceObject != null) { - sourceObject.getCounters(game).addCounter(CounterType.P1P1.createInstance()); + sourceObject.addCounters(CounterType.P1P1.createInstance(), source, game); game.informPlayers(controller.getLogName() + " puts a +1/+1 counter on " + sourceObject.getName()); } } diff --git a/Mage.Sets/src/mage/cards/e/EntrailsFeaster.java b/Mage.Sets/src/mage/cards/e/EntrailsFeaster.java index b9715cbc12..90b8131918 100644 --- a/Mage.Sets/src/mage/cards/e/EntrailsFeaster.java +++ b/Mage.Sets/src/mage/cards/e/EntrailsFeaster.java @@ -1,7 +1,5 @@ - package mage.cards.e; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -9,11 +7,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Outcome; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.counters.CounterType; import mage.filter.common.FilterCreatureCard; import mage.game.Game; @@ -21,14 +15,15 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCardInGraveyard; +import java.util.UUID; + /** - * * @author L_J */ public final class EntrailsFeaster extends CardImpl { public EntrailsFeaster(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.CAT); this.power = new MageInt(1); @@ -81,7 +76,7 @@ class EntrailsFeasterEffect extends OneShotEffect { if (cardChosen != null) { controller.moveCardsToExile(cardChosen, source, game, true, null, ""); if (sourceObject != null) { - sourceObject.getCounters(game).addCounter(CounterType.P1P1.createInstance()); + sourceObject.addCounters(CounterType.P1P1.createInstance(), source, game); game.informPlayers(controller.getLogName() + " puts a +1/+1 counter on " + sourceObject.getLogName()); } } diff --git a/Mage.Sets/src/mage/cards/n/NaturesBlessing.java b/Mage.Sets/src/mage/cards/n/NaturesBlessing.java index 0b24af291c..4a40038167 100644 --- a/Mage.Sets/src/mage/cards/n/NaturesBlessing.java +++ b/Mage.Sets/src/mage/cards/n/NaturesBlessing.java @@ -1,9 +1,5 @@ - package mage.cards.n; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.DiscardCardCost; @@ -27,14 +23,17 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** - * * @author L_J */ public final class NaturesBlessing extends CardImpl { public NaturesBlessing(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{W}"); // {G}{W}, Discard a card: Put a +1/+1 counter on target creature or that creature gains banding, first strike, or trample. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NaturesBlessingEffect(), new ManaCostsImpl("{G}{W}")); @@ -102,7 +101,7 @@ class NaturesBlessingEffect extends OneShotEffect { if (gainedAbility != null) { game.addEffect(new GainAbilityTargetEffect(gainedAbility, Duration.Custom), source); } else { - targetPermanent.getCounters(game).addCounter(CounterType.P1P1.createInstance()); + targetPermanent.addCounters(CounterType.P1P1.createInstance(), source, game); game.informPlayers(controller.getLogName() + " puts a +1/+1 counter on " + targetPermanent.getLogName()); } return true; diff --git a/Mage.Sets/src/mage/cards/o/Oubliette.java b/Mage.Sets/src/mage/cards/o/Oubliette.java index 57514db438..9e933be131 100644 --- a/Mage.Sets/src/mage/cards/o/Oubliette.java +++ b/Mage.Sets/src/mage/cards/o/Oubliette.java @@ -1,9 +1,5 @@ - package mage.cards.o; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -27,8 +23,11 @@ import mage.target.Target; import mage.target.common.TargetCreaturePermanent; import mage.util.CardUtil; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** - * * @author MarcoMarin */ public final class Oubliette extends CardImpl { @@ -137,7 +136,7 @@ class OublietteReturnEffect extends OneShotEffect { if (counters != null) { for (Counter counter : counters.values()) { if (counter != null) { - newPermanent.getCounters(game).addCounter(counter); + newPermanent.getCounters(game).addCounter(counter); // it's restore counters, not add (e.g. without add events) } } } diff --git a/Mage.Sets/src/mage/cards/t/TawnossCoffin.java b/Mage.Sets/src/mage/cards/t/TawnossCoffin.java index af280935ff..45fef01174 100644 --- a/Mage.Sets/src/mage/cards/t/TawnossCoffin.java +++ b/Mage.Sets/src/mage/cards/t/TawnossCoffin.java @@ -1,8 +1,5 @@ package mage.cards.t; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -32,8 +29,11 @@ import mage.target.Target; import mage.target.common.TargetCreaturePermanent; import mage.util.CardUtil; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** - * * @author MarcoMarin */ public final class TawnossCoffin extends CardImpl { @@ -194,7 +194,7 @@ class TawnossCoffinReturnEffect extends OneShotEffect { if (notedCounters != null) { for (Counter c : notedCounters.values()) { //would be nice if could just use that copy function to set the whole field if (c != null) { - newPermanent.getCounters(game).addCounter(c); + newPermanent.getCounters(game).addCounter(c); // it's restore counters, not add (e.g. without add events) } } }