more misc text fixes

This commit is contained in:
Evan Kranzler 2020-04-25 20:39:45 -04:00
parent 4afefea1f5
commit ed66104575
5 changed files with 79 additions and 74 deletions

View file

@ -1,14 +1,11 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.MultipliedValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
@ -16,18 +13,22 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author emerald000
*/
public final class AnyaMercilessAngel extends CardImpl {
public AnyaMercilessAngel(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{W}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ANGEL);
this.power = new MageInt(4);
@ -37,19 +38,22 @@ public final class AnyaMercilessAngel extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Anya, Merciless Angel gets +3/+3 for each opponent whose life total is less than half their starting life total.
DynamicValue dValue = new MultipliedValue(new AnyaMercilessAngelDynamicValue(), 3);
Effect effect = new BoostSourceEffect(dValue, dValue, Duration.WhileOnBattlefield);
effect.setText("{this} gets +3/+3 for each opponent whose life total is less than half their starting life total");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(dValue, dValue, Duration.WhileOnBattlefield)));
this.addAbility(new SimpleStaticAbility(new BoostSourceEffect(
AnyaMercilessAngelDynamicValue.instance,
AnyaMercilessAngelDynamicValue.instance,
Duration.WhileOnBattlefield
).setText("{this} gets +3/+3 for each opponent whose life total is less than half their starting life total")));
// As long as an opponent's life total is less than half their starting life total, Anya has indestructible.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new ConditionalContinuousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield),
AnyaMercilessAngelCondition.instance,
"As long as an opponent's life total is less than half their starting life total, {this} has indestructible")));
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(
IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield
), AnyaMercilessAngelCondition.instance, "As long as an opponent's life total " +
"is less than half their starting life total, {this} has indestructible"
)));
}
public AnyaMercilessAngel(final AnyaMercilessAngel card) {
private AnyaMercilessAngel(final AnyaMercilessAngel card) {
super(card);
}
@ -59,13 +63,16 @@ public final class AnyaMercilessAngel extends CardImpl {
}
}
class AnyaMercilessAngelDynamicValue implements DynamicValue {
enum AnyaMercilessAngelDynamicValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
int opponentCount = 0;
Player controller = game.getPlayer(sourceAbility.getControllerId());
if (controller != null) {
if (controller == null) {
return 3 * opponentCount;
}
int startingLifeTotal = game.getLife();
for (UUID opponentId : game.getOpponents(controller.getId())) {
Player opponent = game.getPlayer(opponentId);
@ -73,13 +80,12 @@ class AnyaMercilessAngelDynamicValue implements DynamicValue {
opponentCount++;
}
}
}
return opponentCount;
return 3 * opponentCount;
}
@Override
public AnyaMercilessAngelDynamicValue copy() {
return new AnyaMercilessAngelDynamicValue();
return instance;
}
@Override
@ -96,9 +102,10 @@ class AnyaMercilessAngelDynamicValue implements DynamicValue {
enum AnyaMercilessAngelCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return new AnyaMercilessAngelDynamicValue().calculate(game, source, null) > 0;
return AnyaMercilessAngelDynamicValue.instance.calculate(game, source, null) > 0;
}
@Override

View file

@ -1,7 +1,5 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
@ -13,11 +11,11 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class BelbesArmor extends CardImpl {
@ -26,20 +24,16 @@ public final class BelbesArmor extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// {X}, {tap}: Target creature gets -X/+X until end of turn.
Ability ability = new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new BoostTargetEffect(
Ability ability = new SimpleActivatedAbility(new BoostTargetEffect(
new MultipliedValue(ManacostVariableValue.instance, -1),
ManacostVariableValue.instance,
Duration.EndOfTurn
),
new ManaCostsImpl("{X}"));
ManacostVariableValue.instance, Duration.EndOfTurn
).setText("Target creature gets -X/+X until end of turn"), new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public BelbesArmor(final BelbesArmor card) {
private BelbesArmor(final BelbesArmor card) {
super(card);
}

View file

@ -1,8 +1,5 @@
package mage.cards.c;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
@ -11,15 +8,17 @@ import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.repository.CardInfo;
import mage.constants.CardType;
import mage.cards.repository.CardRepository;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.List;
import java.util.UUID;
/**
*
* @author spjspj
*/
public final class CapitalOffense extends CardImpl {
@ -28,12 +27,15 @@ public final class CapitalOffense extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}{B}");
// target creature gets -x/-x until end of turn, where x is the number of times a capital letter appears in its rules text. (ignore reminder text and flavor text.)
DynamicValue xValue = new NumberOfCapitalsInTextOfTargetCreatureCount();
this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true));
this.getSpellAbility().addEffect(new BoostTargetEffect(
capitaloffensecount.instance, capitaloffensecount.instance, Duration.EndOfTurn, true
).setText("target creature gets -x/-x until end of turn, where x is the number of times " +
"a capital letter appears in its rules text. <i>(ignore reminder text and flavor text.)</i>"
));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
public CapitalOffense(final CapitalOffense card) {
private CapitalOffense(final CapitalOffense card) {
super(card);
}
@ -43,39 +45,43 @@ public final class CapitalOffense extends CardImpl {
}
}
class NumberOfCapitalsInTextOfTargetCreatureCount implements DynamicValue {
enum capitaloffensecount implements DynamicValue {
instance;
@Override
public NumberOfCapitalsInTextOfTargetCreatureCount copy() {
return new NumberOfCapitalsInTextOfTargetCreatureCount();
public capitaloffensecount copy() {
return instance;
}
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Permanent permanent = game.getPermanent(sourceAbility.getTargets().get(0).getFirstTarget());
if (permanent != null) {
if (permanent == null) {
return 0;
}
int capitals = 0;
List<CardInfo> cards = CardRepository.instance.findCards(permanent.getName());
if (cards != null) {
if (cards == null) {
return 0;
}
for (CardInfo cardInfo : cards) {
Card dummy = cardInfo != null ? cardInfo.getCard() : null;
if (dummy != null) {
if (dummy == null) {
return -1 * capitals;
}
for (String line : dummy.getRules()) {
line = line.replaceAll("(?i)<i.*?</i>", ""); // Ignoring reminder text in italic
line = line.replaceAll("\\{this\\}", permanent.getName());
capitals += line.length() - line.replaceAll("[A-Z]", "").length();
}
}
return -1 * capitals;
}
}
}
return 0;
}
@Override
public String getMessage() {
return "target creature gets -x/-x until end of turn, where x is the number of times a capital letter appears in its rules text. (ignore reminder text and flavor text.)";
return "";
}
}

View file

@ -37,8 +37,7 @@ public final class JandorsRing extends CardImpl {
Watcher watcher = new JandorsRingWatcher();
// {2}, {tap}, Discard the last card you drew this turn: Draw a card.
// TODO: discard has to be a cost not a payment during resolution
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
new JandorsRingEffect(), new ManaCostsImpl("{2}"), WatchedCardInHandCondition.instance, "Last drawn card still in hand?");
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new JandorsRingEffect(), new ManaCostsImpl("{2}"), WatchedCardInHandCondition.instance, "{2}, {T}, Discard the last card you drew this turn: Draw a card.");
ability.addCost(new TapSourceCost());
this.addAbility(ability, watcher);
}

View file

@ -1,7 +1,5 @@
package mage.abilities.effects.common;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
@ -9,8 +7,9 @@ import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author cg5
*/
public class TurnFaceUpTargetEffect extends OneShotEffect {
@ -42,6 +41,6 @@ public class TurnFaceUpTargetEffect extends OneShotEffect {
@Override
public String getText(Mode mode) {
return "turn target " + mode.getTargets().toString() + " face-up";
return "turn target " + mode.getTargets().get(0).getTargetName() + " face-up";
}
}