add withQuotes chaining method to GainAbilityAttachedEffect

This commit is contained in:
jmlundeen 2025-09-03 10:56:13 -05:00
parent a740a2b2dc
commit ace21c67c1

View file

@ -24,6 +24,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
protected boolean independentEffect; protected boolean independentEffect;
protected String targetObjectName; protected String targetObjectName;
protected boolean doesntRemoveItself = false; protected boolean doesntRemoveItself = false;
protected boolean useQuotes = false;
public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType) { public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType) {
this(ability, attachmentType, Duration.WhileOnBattlefield); this(ability, attachmentType, Duration.WhileOnBattlefield);
@ -68,6 +69,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
this.independentEffect = effect.independentEffect; this.independentEffect = effect.independentEffect;
this.targetObjectName = effect.targetObjectName; this.targetObjectName = effect.targetObjectName;
this.doesntRemoveItself = effect.doesntRemoveItself; this.doesntRemoveItself = effect.doesntRemoveItself;
this.useQuotes = effect.useQuotes;
} }
@Override @Override
@ -130,6 +132,11 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
return this; return this;
} }
public GainAbilityAttachedEffect withQuotes(boolean useQuotes) {
this.useQuotes = useQuotes;
return this;
}
@Override @Override
public String getText(Mode mode) { public String getText(Mode mode) {
if (staticText != null && !staticText.isEmpty()) { if (staticText != null && !staticText.isEmpty()) {
@ -143,7 +150,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
} else { } else {
sb.append("gains "); sb.append("gains ");
} }
boolean quotes = ability instanceof SimpleActivatedAbility boolean quotes = useQuotes || ability instanceof SimpleActivatedAbility
|| ability instanceof TriggeredAbility || ability instanceof TriggeredAbility
|| ability instanceof LoyaltyAbility || ability instanceof LoyaltyAbility
|| ability instanceof ManaAbility || ability instanceof ManaAbility