forked from External/mage
[OTJ] Implement Calamity, Galloping Inferno
This commit is contained in:
parent
438fc677f7
commit
a6eb8d0d4b
2 changed files with 111 additions and 0 deletions
110
Mage.Sets/src/mage/cards/c/CalamityGallopingInferno.java
Normal file
110
Mage.Sets/src/mage/cards/c/CalamityGallopingInferno.java
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksWhileSaddledTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.SaddleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.permanent.SaddledSourceThisTurnPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.watchers.common.SaddledMountWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class CalamityGallopingInferno extends CardImpl {
|
||||
|
||||
public CalamityGallopingInferno(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HORSE);
|
||||
this.subtype.add(SubType.MOUNT);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// Whenever Calamity, Galloping Inferno attacks while saddled, choose a nonlegendary creature that saddled it this turn and create a tapped and attacking token that's a copy of it. Sacrifice that token at the beginning of the next end step. Repeat this process once.
|
||||
this.addAbility(new AttacksWhileSaddledTriggeredAbility(new CalamityGallopingInfernoEffect()), new SaddledMountWatcher());
|
||||
|
||||
// Saddle 1
|
||||
this.addAbility(new SaddleAbility(1));
|
||||
}
|
||||
|
||||
private CalamityGallopingInferno(final CalamityGallopingInferno card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CalamityGallopingInferno copy() {
|
||||
return new CalamityGallopingInferno(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CalamityGallopingInfernoEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterCreaturePermanent("nonlegendary creature that saddled it this turn");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(SuperType.LEGENDARY.getPredicate()));
|
||||
filter.add(SaddledSourceThisTurnPredicate.instance);
|
||||
}
|
||||
|
||||
CalamityGallopingInfernoEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "choose a nonlegendary creature that saddled it this turn " +
|
||||
"and create a tapped and attacking token that's a copy of it. " +
|
||||
"Sacrifice that token at the beginning of the next end step. Repeat this process once";
|
||||
}
|
||||
|
||||
private CalamityGallopingInfernoEffect(final CalamityGallopingInfernoEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CalamityGallopingInfernoEffect copy() {
|
||||
return new CalamityGallopingInfernoEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || !game.getBattlefield().contains(filter, source, game, 1)) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < 2; i++) {
|
||||
TargetPermanent target = new TargetPermanent(filter);
|
||||
target.withNotTarget(true);
|
||||
player.choose(outcome, target, source, game);
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent == null) {
|
||||
continue;
|
||||
}
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(
|
||||
null, null, false, 1, true, true
|
||||
);
|
||||
effect.apply(game, source);
|
||||
effect.sacrificeTokensCreatedAtNextEndStep(game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -56,6 +56,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Bucolic Ranch", 265, Rarity.UNCOMMON, mage.cards.b.BucolicRanch.class));
|
||||
cards.add(new SetCardInfo("Cactarantula", 158, Rarity.COMMON, mage.cards.c.Cactarantula.class));
|
||||
cards.add(new SetCardInfo("Cactusfolk Sureshot", 199, Rarity.UNCOMMON, mage.cards.c.CactusfolkSureshot.class));
|
||||
cards.add(new SetCardInfo("Calamity, Galloping Inferno", 116, Rarity.RARE, mage.cards.c.CalamityGallopingInferno.class));
|
||||
cards.add(new SetCardInfo("Canyon Crab", 40, Rarity.UNCOMMON, mage.cards.c.CanyonCrab.class));
|
||||
cards.add(new SetCardInfo("Caustic Bronco", 82, Rarity.RARE, mage.cards.c.CausticBronco.class));
|
||||
cards.add(new SetCardInfo("Colossal Rattlewurm", 159, Rarity.RARE, mage.cards.c.ColossalRattlewurm.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue