Made Equip reminder text optional (#8667)

This commit is contained in:
Alex Vasile 2022-05-12 09:22:59 -06:00 committed by GitHub
commit 5ac8032445
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
204 changed files with 329 additions and 235 deletions

View file

@ -16,24 +16,39 @@ import mage.target.common.TargetControlledCreaturePermanent;
public class EquipAbility extends ActivatedAbilityImpl {
private String costReduceText = null;
private final boolean showAbilityHint;
public EquipAbility(int cost) {
this(Outcome.AddAbility, new GenericManaCost(cost));
this(cost, true);
}
public EquipAbility(int cost, boolean showAbilityHint) {
this(Outcome.AddAbility, new GenericManaCost(cost), showAbilityHint);
}
public EquipAbility(Outcome outcome, Cost cost) {
this(outcome, cost, new TargetControlledCreaturePermanent());
this(outcome, cost, true);
}
public EquipAbility(Outcome outcome, Cost cost, boolean showAbilityHint) {
this(outcome, cost, new TargetControlledCreaturePermanent(), showAbilityHint);
}
public EquipAbility(Outcome outcome, Cost cost, Target target) {
this(outcome, cost, target, true);
}
public EquipAbility(Outcome outcome, Cost cost, Target target, boolean showAbilityHint) {
super(Zone.BATTLEFIELD, new AttachEffect(outcome, "Equip"), cost);
this.addTarget(target);
this.timing = TimingRule.SORCERY;
this.showAbilityHint = showAbilityHint;
}
public EquipAbility(final EquipAbility ability) {
super(ability);
this.costReduceText = ability.costReduceText;
this.showAbilityHint = ability.showAbilityHint;
}
public void setCostReduceText(String text) {
@ -68,7 +83,9 @@ public class EquipAbility extends ActivatedAbilityImpl {
if (maxActivationsPerTurn == 1) {
sb.append(". Activate only once each turn.");
}
sb.append(reminderText);
if (showAbilityHint) {
sb.append(reminderText);
}
return sb.toString();
}
}