better text generation, a couple more individual fixes

This commit is contained in:
xenohedron 2023-08-30 22:14:44 -04:00
parent 6768184e18
commit 1903f90b3a
4 changed files with 10 additions and 19 deletions

View file

@ -39,7 +39,8 @@ public final class AshiokWickedManipulator extends CardImpl {
// +1: Look at the top two cards of your library. Exile one of them and put the other into your hand.
this.addAbility(new LoyaltyAbility(
new LookLibraryAndPickControllerEffect(2, 1, PutCards.EXILED, PutCards.HAND),
new LookLibraryAndPickControllerEffect(2, 1, PutCards.EXILED, PutCards.HAND)
.setText("look at the top two cards of your library. Exile one of them and put the other into your hand"),
1
));

View file

@ -39,7 +39,7 @@ public final class GumdropPoisoner extends AdventureCard {
// When Gumdrop Poisoner enters the battlefield, up to one target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn.
Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(xValue, xValue)
.setText("target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn"));
.setText("up to one target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn"));
ability.addTarget(new TargetCreaturePermanent(0, 1));
this.addAbility(ability.addHint(ControllerGainedLifeCount.getHint()), new PlayerGainedLifeWatcher());

View file

@ -1,9 +1,8 @@
package mage.cards.p;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
@ -29,8 +28,11 @@ public final class Painsmith extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(1);
SpellCastControllerTriggeredAbility ability = new SpellCastControllerTriggeredAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn), StaticFilters.FILTER_SPELL_AN_ARTIFACT, true);
ability.addEffect(new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn));
// Whenever you cast an artifact spell, you may have target creature get +2/+0 and gain deathtouch until end of turn.
Ability ability = new SpellCastControllerTriggeredAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn)
.setText("target creature get +2/+0"), StaticFilters.FILTER_SPELL_AN_ARTIFACT, true);
ability.addEffect(new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn)
.setText("and gain deathtouch until end of turn"));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}

View file

@ -216,7 +216,7 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
sb.append("you may ");
} else if (!ruleLow.startsWith("its controller may")) {
sb.append("you may have ");
superRule = ruleWithFixedVerbGrammar(superRule);
superRule = superRule.replaceFirst(" (become|block|deal|discard|gain|get|lose|mill|sacrifice)s? ", " $1 ");
}
}
if (replaceRuleText
@ -266,18 +266,6 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|| ruleLow.startsWith("untap");
}
private static String ruleWithFixedVerbGrammar(String rule) {
return rule.replace(" becomes ", " become ")
.replace(" blocks ", " block ")
.replace(" deals ", " deal ")
.replace(" discards ", " discard ")
.replace(" gains ", " gain ")
.replace(" gets ", " get ")
.replace(" loses ", " lose ")
.replace(" mills ", " mill ")
.replace(" sacrifices ", " sacrifice ");
}
@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {