forked from External/mage
[BRO] Implemented In the Trenches (#9704)
This commit is contained in:
parent
a246e729a9
commit
9410434f05
5 changed files with 115 additions and 27 deletions
|
|
@ -0,0 +1,40 @@
|
|||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public class ActivateOncePerGameActivatedAbility extends ActivatedAbilityImpl {
|
||||
|
||||
public ActivateOncePerGameActivatedAbility(Zone zone, Effect effect, Cost cost, TimingRule timingRule) {
|
||||
super(zone, effect, cost);
|
||||
this.timing = timingRule;
|
||||
this.maxActivationsPerGame = 1;
|
||||
}
|
||||
|
||||
private ActivateOncePerGameActivatedAbility(final ActivateOncePerGameActivatedAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivateOncePerGameActivatedAbility copy() {
|
||||
return new ActivateOncePerGameActivatedAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder(super.getRule());
|
||||
sb.append(" Activate ");
|
||||
if (this.timing == TimingRule.SORCERY) {
|
||||
sb.append("only as a sorcery and ");
|
||||
}
|
||||
sb.append("only once.");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue