forked from External/mage
[ME2] Implement Goblin Ski Patrol (#13285)
This commit is contained in:
parent
815d032798
commit
e57098b9fe
4 changed files with 91 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.TimingRule;
|
||||
|
|
@ -15,8 +16,21 @@ public class ActivateOncePerGameActivatedAbility extends ActivatedAbilityImpl {
|
|||
this(Zone.BATTLEFIELD, effect, cost, TimingRule.INSTANT);
|
||||
}
|
||||
|
||||
public ActivateOncePerGameActivatedAbility(Effect effect, Cost cost, Condition condition) {
|
||||
this(Zone.BATTLEFIELD, effect, cost, condition, TimingRule.INSTANT);
|
||||
}
|
||||
|
||||
public ActivateOncePerGameActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition) {
|
||||
this(zone, effect, cost, condition, TimingRule.INSTANT);
|
||||
}
|
||||
|
||||
public ActivateOncePerGameActivatedAbility(Zone zone, Effect effect, Cost cost, TimingRule timingRule) {
|
||||
this(zone, effect, cost, null, timingRule);
|
||||
}
|
||||
|
||||
public ActivateOncePerGameActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition, TimingRule timingRule) {
|
||||
super(zone, effect, cost);
|
||||
this.condition = condition;
|
||||
this.timing = timingRule;
|
||||
this.maxActivationsPerGame = 1;
|
||||
}
|
||||
|
|
@ -34,6 +48,10 @@ public class ActivateOncePerGameActivatedAbility extends ActivatedAbilityImpl {
|
|||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder(super.getRule());
|
||||
sb.append(" Activate ");
|
||||
if (condition != null) {
|
||||
String message = condition.toString();
|
||||
sb.append("only ").append(message.startsWith("if ") || message.startsWith("during") ? message : "if " + message).append(" and ");
|
||||
}
|
||||
if (this.timing == TimingRule.SORCERY) {
|
||||
sb.append("only as a sorcery and ");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue