Text corrections from issue #6654 (WIP) (#6707)

* 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:
Erik 2020-08-15 16:55:59 -04:00 committed by GitHub
parent 7c929767bb
commit 3d989b24ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 16 deletions

View file

@ -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());
}

View file

@ -135,7 +135,12 @@ public class AddCountersSourceEffect extends OneShotEffect {
} else if (amount.toString().equals("X") && amount.getMessage().isEmpty()) {
sb.append("X ");
} else {
sb.append("a ");
//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");