mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
refactor: added param to hide activate text in ActivateAsSorceryActivatedAbility (related to #13316);
This commit is contained in:
parent
07f68fbf38
commit
06f24515cc
1 changed files with 12 additions and 0 deletions
|
|
@ -9,6 +9,8 @@ import mage.constants.Zone;
|
|||
|
||||
public class ActivateAsSorceryActivatedAbility extends ActivatedAbilityImpl {
|
||||
|
||||
private boolean showActivateText = true;
|
||||
|
||||
public ActivateAsSorceryActivatedAbility(Effect effect, Cost cost) {
|
||||
this(Zone.BATTLEFIELD, effect, cost);
|
||||
}
|
||||
|
|
@ -20,6 +22,7 @@ public class ActivateAsSorceryActivatedAbility extends ActivatedAbilityImpl {
|
|||
|
||||
protected ActivateAsSorceryActivatedAbility(final ActivateAsSorceryActivatedAbility ability) {
|
||||
super(ability);
|
||||
this.showActivateText = ability.showActivateText;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -27,9 +30,18 @@ public class ActivateAsSorceryActivatedAbility extends ActivatedAbilityImpl {
|
|||
return new ActivateAsSorceryActivatedAbility(this);
|
||||
}
|
||||
|
||||
public ActivateAsSorceryActivatedAbility withShowActivateText(boolean showActivateText) {
|
||||
this.showActivateText = showActivateText;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
String superRule = super.getRule();
|
||||
if (!showActivateText) {
|
||||
return superRule;
|
||||
}
|
||||
|
||||
String newText = (mayActivate == TargetController.OPPONENT
|
||||
? " Only your opponents may activate this ability and only as a sorcery."
|
||||
: " Activate only as a sorcery.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue