Additional token effect text changes

This commit is contained in:
Evan Kranzler 2017-09-06 17:39:58 -04:00
parent 6fc78d1d78
commit 0f72c4fb22
59 changed files with 154 additions and 150 deletions

View file

@ -1,7 +1,7 @@
package mage.abilities.effects;
import mage.abilities.Ability;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -10,21 +10,21 @@ import mage.target.targetpointer.FixedTarget;
/**
* Created by glerman on 20/6/15.
*/
public class PutTokenOntoBattlefieldCopySourceEffect extends OneShotEffect {
public class CreateTokenCopySourceEffect extends OneShotEffect {
private final int number;
public PutTokenOntoBattlefieldCopySourceEffect() {
public CreateTokenCopySourceEffect() {
this(1);
}
public PutTokenOntoBattlefieldCopySourceEffect(int copies) {
public CreateTokenCopySourceEffect(int copies) {
super(Outcome.PutCreatureInPlay);
this.number = copies;
staticText = "create a token that's a copy of {this}";
}
public PutTokenOntoBattlefieldCopySourceEffect(final PutTokenOntoBattlefieldCopySourceEffect effect) {
public CreateTokenCopySourceEffect(final CreateTokenCopySourceEffect effect) {
super(effect);
this.number = effect.number;
}
@ -33,7 +33,7 @@ public class PutTokenOntoBattlefieldCopySourceEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (permanent != null) {
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, false, number);
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, false, number);
effect.setTargetPointer(new FixedTarget(source.getSourceId()));
return effect.apply(game, source);
}
@ -41,7 +41,7 @@ public class PutTokenOntoBattlefieldCopySourceEffect extends OneShotEffect {
}
@Override
public PutTokenOntoBattlefieldCopySourceEffect copy() {
return new PutTokenOntoBattlefieldCopySourceEffect(this);
public CreateTokenCopySourceEffect copy() {
return new CreateTokenCopySourceEffect(this);
}
}

View file

@ -54,7 +54,7 @@ import mage.util.functions.EmptyApplyToPermanent;
*
* @author LevelX2
*/
public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
public class CreateTokenCopyTargetEffect extends OneShotEffect {
private final UUID playerId;
private final CardType additionalCardType;
@ -74,12 +74,12 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
private boolean useLKI = false;
private boolean isntLegendary = false;
public PutTokenOntoBattlefieldCopyTargetEffect(boolean useLKI) {
public CreateTokenCopyTargetEffect(boolean useLKI) {
this();
this.useLKI = useLKI;
}
public PutTokenOntoBattlefieldCopyTargetEffect() {
public CreateTokenCopyTargetEffect() {
super(Outcome.PutCreatureInPlay);
this.playerId = null;
this.additionalCardType = null;
@ -95,15 +95,15 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
this.color = null;
}
public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId) {
public CreateTokenCopyTargetEffect(UUID playerId) {
this(playerId, null, false);
}
public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste) {
public CreateTokenCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste) {
this(playerId, additionalCardType, gainsHaste, 1);
}
public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number) {
public CreateTokenCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number) {
this(playerId, additionalCardType, gainsHaste, number, false, false);
}
@ -117,15 +117,15 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
* @param tapped
* @param attacking
*/
public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number, boolean tapped, boolean attacking) {
public CreateTokenCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number, boolean tapped, boolean attacking) {
this(playerId, additionalCardType, gainsHaste, number, tapped, attacking, null);
}
public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number, boolean tapped, boolean attacking, UUID attackedPlayer) {
public CreateTokenCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number, boolean tapped, boolean attacking, UUID attackedPlayer) {
this(playerId, additionalCardType, gainsHaste, number, tapped, attacking, attackedPlayer, Integer.MIN_VALUE, Integer.MIN_VALUE, false);
}
public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number, boolean tapped, boolean attacking, UUID attackedPlayer, int power, int toughness, boolean gainsFlying) {
public CreateTokenCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number, boolean tapped, boolean attacking, UUID attackedPlayer, int power, int toughness, boolean gainsFlying) {
super(Outcome.PutCreatureInPlay);
this.playerId = playerId;
this.additionalCardType = additionalCardType;
@ -140,7 +140,7 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
this.gainsFlying = gainsFlying;
}
public PutTokenOntoBattlefieldCopyTargetEffect(final PutTokenOntoBattlefieldCopyTargetEffect effect) {
public CreateTokenCopyTargetEffect(final CreateTokenCopyTargetEffect effect) {
super(effect);
this.playerId = effect.playerId;
this.additionalCardType = effect.additionalCardType;
@ -258,8 +258,8 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
}
@Override
public PutTokenOntoBattlefieldCopyTargetEffect copy() {
return new PutTokenOntoBattlefieldCopyTargetEffect(this);
public CreateTokenCopyTargetEffect copy() {
return new CreateTokenCopyTargetEffect(this);
}
@Override
@ -267,27 +267,29 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
StringBuilder sb = new StringBuilder();
sb.append("Put ");
StringBuilder sb = new StringBuilder("create ");
if (number == 1) {
sb.append("a token");
sb.append("a ");
if (tapped && !attacking) {
sb.append("tapped ");
}
sb.append("token");
} else {
sb.append(CardUtil.numberToText(number)).append(" tokens");
sb.append(number);
sb.append(" ");
if (tapped && !attacking) {
sb.append("tapped ");
}
sb.append("tokens");
}
sb.append(" 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());
if (attacking) {
sb.append(" that are");
if (tapped) {
sb.append(" tapped and");
}
sb.append(" attacking");
}
return sb.toString();
}
public List<Permanent> getAddedPermanent() {

View file

@ -159,6 +159,7 @@ public class CreateTokenEffect extends OneShotEffect {
}
}
if (attacking) {
sb.append(" that are");
if (tapped) {
sb.append(" tapped and");
}

View file

@ -91,6 +91,7 @@ public class CreateTokenTargetEffect extends OneShotEffect {
}
}
if (attacking) {
sb.append(" that are");
if (tapped) {
sb.append(" tapped and");
}

View file

@ -90,7 +90,7 @@ public class PopulateEffect extends OneShotEffect {
if (!game.isSimulation()) {
game.informPlayers("Token selected for populate: " + tokenToCopy.getLogName());
}
Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
Effect effect = new CreateTokenCopyTargetEffect();
effect.setTargetPointer(new FixedTarget(target.getFirstTarget()));
return effect.apply(game, source);
}

View file

@ -35,7 +35,7 @@ import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
import mage.constants.Outcome;
import mage.constants.SetTargetPointer;
import mage.game.Game;
@ -102,7 +102,7 @@ class MyriadEffect extends OneShotEffect {
Player opponent = game.getPlayer(playerId);
if (opponent != null && controller.chooseUse(Outcome.PutCreatureInPlay,
"Put a copy of " + sourceObject.getIdName() + " onto battlefield attacking " + opponent.getName() + '?', source, game)) {
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(controller.getId(), null, false, 1, true, true, playerId);
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(controller.getId(), null, false, 1, true, true, playerId);
effect.setTargetPointer(new FixedTarget(sourceObject, game));
effect.apply(game, source);
tokens.addAll(effect.getAddedPermanent());