From 002037a683c18c8636b2ccef37df156b728ec747 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 15 Sep 2015 22:35:08 +0200 Subject: [PATCH] * Flamerush Rider - Fixed that the token put onto the battlefield was not attacking and not tapped. --- .../sets/fatereforged/FlamerushRider.java | 2 +- ...tTokenOntoBattlefieldCopyTargetEffect.java | 24 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java b/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java index 888ce088d0..784e936b90 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java +++ b/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java @@ -112,7 +112,7 @@ class FlamerushRiderEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); if (controller != null && permanent != null) { - PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true); + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true, 1, true, true); effect.setTargetPointer(new FixedTarget(permanent, game)); effect.apply(game, source); for (Permanent addedToken : effect.getAddedPermanent()) { diff --git a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java index 2cc2381a78..3d42d6db09 100644 --- a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java @@ -58,6 +58,8 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { private final int number; private List addedTokenPermanents; private String additionalSubType; + private boolean tapped; + private boolean attacking; public PutTokenOntoBattlefieldCopyTargetEffect() { super(Outcome.PutCreatureInPlay); @@ -76,6 +78,10 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { this(playerId, additionalCardType, gainsHaste, 1); } + public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number) { + this(playerId, additionalCardType, gainsHaste, number, false, false); + } + /** * * @param playerId null the token is controlled/owned by the controller of @@ -84,13 +90,15 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { * @param gainsHaste the token gains haste * @param number number of tokens to put into play */ - public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number) { + public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number, boolean tapped, boolean attacking) { super(Outcome.PutCreatureInPlay); this.playerId = playerId; this.additionalCardType = additionalCardType; this.gainsHaste = gainsHaste; this.addedTokenPermanents = new ArrayList<>(); this.number = number; + this.tapped = tapped; + this.attacking = attacking; } public PutTokenOntoBattlefieldCopyTargetEffect(final PutTokenOntoBattlefieldCopyTargetEffect effect) { @@ -101,6 +109,8 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { this.addedTokenPermanents = new ArrayList<>(effect.addedTokenPermanents); this.number = effect.number; this.additionalSubType = effect.additionalSubType; + this.tapped = effect.tapped; + this.attacking = effect.attacking; } @Override @@ -149,7 +159,7 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { token.getSubtype().add(additionalSubType); } } - token.putOntoBattlefield(number, game, source.getSourceId(), playerId == null ? source.getControllerId() : playerId); + token.putOntoBattlefield(number, game, source.getSourceId(), playerId == null ? source.getControllerId() : playerId, tapped, attacking); for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield Permanent tokenPermanent = game.getPermanent(tokenId); if (tokenPermanent != null) { @@ -170,7 +180,15 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { return staticText; } StringBuilder sb = new StringBuilder(); - sb.append("Put a token onto the battlefield that's a copy of target "); + sb.append("Put a token onto the battlefield "); + if (tapped && !attacking) { + sb.append("tapped "); + } else if (!tapped && attacking) { + sb.append("attacking "); + } else if (tapped && attacking) { + sb.append("tapped and attacking "); + } + sb.append("that's a copy of target "); if (mode.getTargets() != null) { sb.append(mode.getTargets().get(0).getTargetName()); }