* Varchild, Betrayer of Kjeldor - Fixe dthat the tokens were not created (fixes #5330).

This commit is contained in:
LevelX2 2018-09-23 10:40:59 +02:00
parent 95bbf191cc
commit cf67c272bc
2 changed files with 13 additions and 13 deletions

View file

@ -30,7 +30,7 @@ import mage.target.targetpointer.FixedTarget;
public final class Plaguecrafter extends CardImpl { public final class Plaguecrafter extends CardImpl {
public Plaguecrafter(UUID ownerId, CardSetInfo setInfo) { public Plaguecrafter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SHAMAN); this.subtype.add(SubType.SHAMAN);
@ -53,12 +53,11 @@ public final class Plaguecrafter extends CardImpl {
} }
} }
class PlaguecrafterEffect extends OneShotEffect { class PlaguecrafterEffect extends OneShotEffect {
public PlaguecrafterEffect() { public PlaguecrafterEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
this.staticText = "Each player sacrifices a creature or planeswalker. " this.staticText = "each player sacrifices a creature or planeswalker. "
+ "Each player who can't discards a card."; + "Each player who can't discards a card.";
} }
@ -77,10 +76,10 @@ class PlaguecrafterEffect extends OneShotEffect {
if (controller == null) { if (controller == null) {
return false; return false;
} }
List<UUID> perms = new ArrayList<>(); List<UUID> perms = new ArrayList<>();
List<UUID> cantSac = new ArrayList<>(); List<UUID> cantSac = new ArrayList<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
@ -99,14 +98,14 @@ class PlaguecrafterEffect extends OneShotEffect {
} }
} }
} }
for (UUID permID : perms) { for (UUID permID : perms) {
Permanent permanent = game.getPermanent(permID); Permanent permanent = game.getPermanent(permID);
if (permanent != null) { if (permanent != null) {
permanent.sacrifice(source.getSourceId(), game); permanent.sacrifice(source.getSourceId(), game);
} }
} }
for (UUID playerId : cantSac) { for (UUID playerId : cantSac) {
Effect discardEffect = new DiscardTargetEffect(1); Effect discardEffect = new DiscardTargetEffect(1);
discardEffect.setTargetPointer(new FixedTarget(playerId, game)); discardEffect.setTargetPointer(new FixedTarget(playerId, game));
@ -114,4 +113,4 @@ class PlaguecrafterEffect extends OneShotEffect {
} }
return true; return true;
} }
} }

View file

@ -6,18 +6,19 @@ import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenTargetEffect; import mage.abilities.effects.common.CreateTokenTargetEffect;
import mage.abilities.effects.common.combat.CantAttackYouOrPlaneswalkerAllEffect; import mage.abilities.effects.common.combat.CantAttackYouOrPlaneswalkerAllEffect;
import mage.abilities.effects.common.combat.CantBlockAllEffect; import mage.abilities.effects.common.combat.CantBlockAllEffect;
import mage.abilities.effects.common.continuous.GainControlAllEffect; import mage.abilities.effects.common.continuous.GainControlAllEffect;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
@ -108,9 +109,9 @@ class VarchildBetrayerOfKjeldorEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
int damage = (int) this.getValue("damage"); int damage = (int) this.getValue("damage");
if (damage > 0) { if (damage > 0) {
return new CreateTokenTargetEffect( Effect effect = new CreateTokenTargetEffect(new SurvivorToken(), damage);
new SurvivorToken(), damage effect.setTargetPointer(getTargetPointer());
).apply(game, source); return effect.apply(game, source);
} }
return false; return false;
} }