forked from External/mage
Fix #8864
This commit is contained in:
parent
0a22478087
commit
735b1cce69
6 changed files with 53 additions and 58 deletions
|
|
@ -1,14 +1,17 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.CycleOrDiesTriggeredAbility;
|
||||
import mage.abilities.common.CycleTriggeredAbility;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.abilities.meta.OrTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.permanent.token.SoldierToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -26,7 +29,13 @@ public final class BantSojourners extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// When you cycle Bant Sojourners or it dies, you may create a 1/1 white Soldier creature token.
|
||||
this.addAbility(new CycleOrDiesTriggeredAbility(new CreateTokenEffect(new SoldierToken()), true));
|
||||
this.addAbility(new OrTriggeredAbility(Zone.ALL,
|
||||
new CreateTokenEffect(new SoldierToken()),
|
||||
true,
|
||||
"When you cycle {this} or it dies, ",
|
||||
new CycleTriggeredAbility(null, true),
|
||||
new DiesSourceTriggeredAbility(null, true)
|
||||
));
|
||||
|
||||
// Cycling {2}{W}
|
||||
this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{2}{W}")));
|
||||
|
|
|
|||
|
|
@ -2,14 +2,17 @@ package mage.cards.e;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CycleOrDiesTriggeredAbility;
|
||||
import mage.abilities.common.CycleTriggeredAbility;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.MayTapOrUntapTargetEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.abilities.meta.OrTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -28,7 +31,13 @@ public final class EsperSojourners extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// When you cycle Esper Sojourners or it dies, you may tap or untap target permanent.
|
||||
Ability ability = new CycleOrDiesTriggeredAbility(new MayTapOrUntapTargetEffect(), false);
|
||||
Ability ability = new OrTriggeredAbility(Zone.ALL,
|
||||
new MayTapOrUntapTargetEffect(),
|
||||
false,
|
||||
"When you cycle {this} or it dies, ",
|
||||
new CycleTriggeredAbility(null, false),
|
||||
new DiesSourceTriggeredAbility(null, false)
|
||||
);
|
||||
ability.addTarget(new TargetPermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,17 @@ package mage.cards.g;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CycleOrDiesTriggeredAbility;
|
||||
import mage.abilities.common.CycleTriggeredAbility;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.abilities.meta.OrTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -28,7 +30,13 @@ public final class GrixisSojourners extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// When you cycle Grixis Sojourners or it dies, you may exile target card from a graveyard.
|
||||
Ability ability = new CycleOrDiesTriggeredAbility(new ExileTargetEffect(), true);
|
||||
Ability ability = new OrTriggeredAbility(Zone.ALL,
|
||||
new ExileTargetEffect(),
|
||||
true,
|
||||
"When you cycle {this} or it dies, ",
|
||||
new CycleTriggeredAbility(null, true),
|
||||
new DiesSourceTriggeredAbility(null, true)
|
||||
);
|
||||
ability.addTarget(new TargetCardInGraveyard());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,14 +2,17 @@ package mage.cards.j;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CycleOrDiesTriggeredAbility;
|
||||
import mage.abilities.common.CycleTriggeredAbility;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.abilities.meta.OrTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -27,8 +30,13 @@ public final class JundSojourners extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When you cycle Jund Sojourners or it dies, you may have it deal 1 damage to any target.
|
||||
Ability ability = new CycleOrDiesTriggeredAbility(new DamageTargetEffect(1)
|
||||
.setText("you may have it deal 1 damage to any target"), true);
|
||||
Ability ability = new OrTriggeredAbility(Zone.ALL,
|
||||
new DamageTargetEffect(1).setText("it deal 1 damage to any target"),
|
||||
true,
|
||||
"When you cycle {this} or it dies, ",
|
||||
new CycleTriggeredAbility(null, true),
|
||||
new DiesSourceTriggeredAbility(null, true)
|
||||
);
|
||||
ability.addTarget(new TargetAnyTarget());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,14 +2,17 @@ package mage.cards.n;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CycleOrDiesTriggeredAbility;
|
||||
import mage.abilities.common.CycleTriggeredAbility;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.abilities.meta.OrTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
|
|
@ -28,8 +31,12 @@ public final class NayaSojourners extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// When you cycle Naya Sojourners or it dies, you may put a +1/+1 counter on target creature.
|
||||
Ability ability = new CycleOrDiesTriggeredAbility(
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()), true
|
||||
Ability ability = new OrTriggeredAbility(Zone.ALL,
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
|
||||
true,
|
||||
"When you cycle {this} or it dies, ",
|
||||
new CycleTriggeredAbility(null, true),
|
||||
new DiesSourceTriggeredAbility(null, true)
|
||||
);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.stack.StackObject;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class CycleOrDiesTriggeredAbility extends ZoneChangeTriggeredAbility {
|
||||
|
||||
public CycleOrDiesTriggeredAbility(Effect effect, boolean optional) {
|
||||
super(Zone.ALL, effect, "When you cycle {this} or it dies, ", optional);
|
||||
}
|
||||
|
||||
public CycleOrDiesTriggeredAbility(CycleOrDiesTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE
|
||||
|| event.getType() == GameEvent.EventType.ACTIVATED_ABILITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!event.getSourceId().equals(this.getSourceId())) {
|
||||
return false;
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
|
||||
return ((ZoneChangeEvent) event).isDiesEvent();
|
||||
}
|
||||
StackObject object = game.getStack().getStackObject(event.getSourceId());
|
||||
return object != null && object.getStackAbility() instanceof CyclingAbility;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CycleOrDiesTriggeredAbility copy() {
|
||||
return new CycleOrDiesTriggeredAbility(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue