* Nest of Scarabs - Fixed that it does not produce tokens when -1/-1 counters are placed on creatures.

This commit is contained in:
LevelX2 2017-04-26 14:36:52 +02:00
parent 257a0ba433
commit 86bc78e4b8

View file

@ -28,7 +28,6 @@
package mage.cards.n; package mage.cards.n;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.dynamicvalue.common.EffectKeyValue; import mage.abilities.dynamicvalue.common.EffectKeyValue;
@ -70,7 +69,7 @@ public class NestOfScarabs extends CardImpl {
class NestOfScarabsTriggeredAbility extends TriggeredAbilityImpl { class NestOfScarabsTriggeredAbility extends TriggeredAbilityImpl {
NestOfScarabsTriggeredAbility() { NestOfScarabsTriggeredAbility() {
super(Zone.BATTLEFIELD, new CreateTokenEffect(new BlackInsectToken(), new EffectKeyValue("countersAdded"))); super(Zone.BATTLEFIELD, new CreateTokenEffect(new NestOfScarabsBlackInsectToken(), new EffectKeyValue("countersAdded")));
} }
NestOfScarabsTriggeredAbility(final NestOfScarabsTriggeredAbility ability) { NestOfScarabsTriggeredAbility(final NestOfScarabsTriggeredAbility ability) {
@ -84,9 +83,9 @@ class NestOfScarabsTriggeredAbility extends TriggeredAbilityImpl {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
boolean weAreDoingIt = getControllerId().equals(game.getControllerId(event.getSourceId())); boolean weAreDoingIt = getControllerId().equals(game.getControllerId(event.getPlayerId()));
boolean isM1M1Counters = event.getData().equals(CounterType.M1M1.getName()); boolean isM1M1Counters = event.getData().equals(CounterType.M1M1.getName());
if (weAreDoingIt && isM1M1Counters) { if (weAreDoingIt && isM1M1Counters && event.getAmount() > 0) {
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
if (permanent == null) { if (permanent == null) {
permanent = game.getPermanentEntering(event.getTargetId()); permanent = game.getPermanentEntering(event.getTargetId());
@ -110,8 +109,9 @@ class NestOfScarabsTriggeredAbility extends TriggeredAbilityImpl {
} }
} }
class BlackInsectToken extends Token { class NestOfScarabsBlackInsectToken extends Token {
BlackInsectToken() {
NestOfScarabsBlackInsectToken() {
super("Insect", "1/1 black Insect token"); super("Insect", "1/1 black Insect token");
cardType.add(CardType.CREATURE); cardType.add(CardType.CREATURE);
color.setBlack(true); color.setBlack(true);