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