mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* Collective restraint typo fix * set text for EndlessSwarm. Add starts with vowel cond case to CountersSourceEffect * Teferi's Curse, added text option to GainAbilityAttachEffect * added set text to several cards. Implement reviewer suggestions in GainAbilityAttachedEffect * Remove period from rule text (undo my lazy coding fix)
This commit is contained in:
parent
7c929767bb
commit
3d989b24ac
8 changed files with 24 additions and 16 deletions
|
@ -27,7 +27,7 @@ public final class AngelOfRenewal extends CardImpl {
|
|||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// When Angel of Renewal enters the battlefield, you gain 1 life for each creature you control.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(CreaturesYouControlCount.instance)));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(CreaturesYouControlCount.instance).setText("you gain 1 life for each creature you control")));
|
||||
}
|
||||
|
||||
public AngelOfRenewal(final AngelOfRenewal card) {
|
||||
|
|
|
@ -22,11 +22,11 @@ public final class BenedictionOfMoons extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}");
|
||||
|
||||
// You gain 1 life for each player.
|
||||
this.getSpellAbility().addEffect(new GainLifeEffect(new PlayerCount()));
|
||||
this.getSpellAbility().addEffect(new GainLifeEffect(new PlayerCount()).setText("you gain 1 life for each player"));
|
||||
|
||||
// Haunt
|
||||
// When the creature Benediction of Moons haunts dies, you gain 1 life for each player.
|
||||
this.addAbility(new HauntAbility(this, new GainLifeEffect(new PlayerCount())));
|
||||
this.addAbility(new HauntAbility(this, new GainLifeEffect(new PlayerCount()).setText("you gain 1 life for each player")));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class CollectiveRestraintPayManaToAttackAllEffect extends CantAttackYouUnlessPay
|
|||
|
||||
CollectiveRestraintPayManaToAttackAllEffect() {
|
||||
super(null, false);
|
||||
staticText = "Creatures can't attack you unless their controller pays {X} for each creature they control that's attacking you, where X is the number of basic land types you control.";
|
||||
staticText = "Creatures can't attack you unless their controller pays {X} for each creature they control that's attacking you, where X is the number of basic land types among lands you control.";
|
||||
}
|
||||
|
||||
CollectiveRestraintPayManaToAttackAllEffect(CollectiveRestraintPayManaToAttackAllEffect effect) {
|
||||
|
|
|
@ -25,7 +25,7 @@ public final class DwarvenPriest extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// When Dwarven Priest enters the battlefield, you gain 1 life for each creature you control.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(CreaturesYouControlCount.instance)));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(CreaturesYouControlCount.instance).setText("you gain 1 life for each creature you control")));
|
||||
}
|
||||
|
||||
public DwarvenPriest(final DwarvenPriest card) {
|
||||
|
|
|
@ -22,7 +22,7 @@ public final class EndlessSwarm extends CardImpl {
|
|||
|
||||
|
||||
// Create a 1/1 green Snake creature token for each card in your hand.
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new SnakeToken(), CardsInControllerHandCount.instance));
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new SnakeToken(), CardsInControllerHandCount.instance).setText("create a 1/1 green Snake creature token for each card in your hand"));
|
||||
|
||||
// Epic
|
||||
this.getSpellAbility().addEffect(new EpicEffect());
|
||||
|
|
|
@ -10,11 +10,7 @@ import mage.abilities.keyword.EnchantAbility;
|
|||
import mage.abilities.keyword.PhasingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.target.TargetPermanent;
|
||||
|
@ -45,7 +41,7 @@ public final class TeferisCurse extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Enchanted permanent has phasing.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(PhasingAbility.getInstance(), AttachmentType.AURA)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(PhasingAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield, null, "permanent")));
|
||||
}
|
||||
|
||||
public TeferisCurse(final TeferisCurse card) {
|
||||
|
|
|
@ -15,6 +15,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
|
|||
protected Ability ability;
|
||||
protected AttachmentType attachmentType;
|
||||
protected boolean independentEffect;
|
||||
protected String targetObjectName;
|
||||
|
||||
public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType) {
|
||||
this(ability, attachmentType, Duration.WhileOnBattlefield);
|
||||
|
@ -25,7 +26,12 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
|
||||
public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType, Duration duration, String rule) {
|
||||
this(ability, attachmentType, duration, rule, "creature");
|
||||
}
|
||||
|
||||
public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType, Duration duration, String rule, String targetObjectName) {
|
||||
super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||
this.targetObjectName = targetObjectName;
|
||||
this.ability = ability;
|
||||
this.attachmentType = attachmentType;
|
||||
switch (duration) {
|
||||
|
@ -54,6 +60,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
|
|||
ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
|
||||
this.attachmentType = effect.attachmentType;
|
||||
this.independentEffect = effect.independentEffect;
|
||||
this.targetObjectName = effect.targetObjectName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -96,13 +103,13 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
|
|||
private void setText() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(attachmentType.verb());
|
||||
sb.append(" creature ");
|
||||
sb.append(" " + targetObjectName + " ");
|
||||
if (duration == Duration.WhileOnBattlefield) {
|
||||
sb.append("has ");
|
||||
} else {
|
||||
sb.append("gains ");
|
||||
}
|
||||
sb.append(ability.getRule("this creature"));
|
||||
sb.append(ability.getRule("this " + targetObjectName));
|
||||
if (!duration.toString().isEmpty()) {
|
||||
sb.append(' ').append(duration.toString());
|
||||
}
|
||||
|
|
|
@ -134,8 +134,13 @@ public class AddCountersSourceEffect extends OneShotEffect {
|
|||
sb.append(CardUtil.numberToText(counter.getCount())).append(' ');
|
||||
} else if (amount.toString().equals("X") && amount.getMessage().isEmpty()) {
|
||||
sb.append("X ");
|
||||
} else {
|
||||
//if counter name starts with a vowel use 'an' instead of 'a'
|
||||
if ("aeiou".indexOf(counter.getName().toLowerCase(Locale.ENGLISH).charAt(0)) >= 0 ){
|
||||
sb.append("an ");
|
||||
} else {
|
||||
sb.append("a ");
|
||||
}
|
||||
plural = false;
|
||||
}
|
||||
sb.append(counter.getName().toLowerCase(Locale.ENGLISH)).append(" counter");
|
||||
|
|
Loading…
Reference in a new issue