mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
[CLB] Implemented Gale's Redirection
This commit is contained in:
parent
66d31396fe
commit
47974d2c32
2 changed files with 97 additions and 0 deletions
96
Mage.Sets/src/mage/cards/g/GalesRedirection.java
Normal file
96
Mage.Sets/src/mage/cards/g/GalesRedirection.java
Normal file
|
@ -0,0 +1,96 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.effects.common.RollDieWithResultTableEffect;
|
||||
import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetSpell;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class GalesRedirection extends CardImpl {
|
||||
|
||||
public GalesRedirection(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}");
|
||||
|
||||
// Exile target spell, then roll a d20 and add that spell's mana value.
|
||||
// 1-14 | You may cast the exiled card for as long as it remains exiled, and you may spend mana as though it were mana of any color to cast that spell.
|
||||
// 15+ | You may cast the exiled card without paying its mana cost for as long as it remains exiled.
|
||||
this.getSpellAbility().addEffect(new GalesRedirectionEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell());
|
||||
}
|
||||
|
||||
private GalesRedirection(final GalesRedirection card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GalesRedirection copy() {
|
||||
return new GalesRedirection(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GalesRedirectionEffect extends RollDieWithResultTableEffect {
|
||||
|
||||
GalesRedirectionEffect() {
|
||||
super(20, "exile target spell, then roll a d20 and add that spell's mana value");
|
||||
this.addTableEntry(
|
||||
1, 14,
|
||||
new InfoEffect("you may cast the exiled card for as long as it remains exiled, " +
|
||||
"and you may spend mana as though it were mana of any color to cast that spell")
|
||||
);
|
||||
this.addTableEntry(
|
||||
15, Integer.MAX_VALUE,
|
||||
new InfoEffect("you may cast the exiled card without paying " +
|
||||
"its mana cost for as long as it remains exiled")
|
||||
);
|
||||
}
|
||||
|
||||
private GalesRedirectionEffect(final GalesRedirectionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GalesRedirectionEffect copy() {
|
||||
return new GalesRedirectionEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Spell spell = game.getSpell(getTargetPointer().getFirst(game, source));
|
||||
if (player == null || spell == null) {
|
||||
return false;
|
||||
}
|
||||
int manaValue = spell.getManaValue();
|
||||
player.moveCards(spell, Zone.EXILED, source, game);
|
||||
int result = player.rollDice(outcome, source, game, 20) + manaValue;
|
||||
Card card = spell.getMainCard();
|
||||
if (card == null || !Zone.EXILED.match(game.getState().getZone(card.getId()))) {
|
||||
return true;
|
||||
}
|
||||
if (result >= 15) {
|
||||
game.addEffect(new PlayFromNotOwnHandZoneTargetEffect(
|
||||
Zone.EXILED, TargetController.YOU, Duration.Custom, true
|
||||
).setTargetPointer(new FixedTarget(card, game)), source);
|
||||
} else if (result >= 1) {
|
||||
CardUtil.makeCardPlayable(game, source, card, Duration.Custom, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -241,6 +241,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Fraying Line", 314, Rarity.RARE, mage.cards.f.FrayingLine.class));
|
||||
cards.add(new SetCardInfo("From the Catacombs", 671, Rarity.RARE, mage.cards.f.FromTheCatacombs.class));
|
||||
cards.add(new SetCardInfo("Frontline Medic", 693, Rarity.RARE, mage.cards.f.FrontlineMedic.class));
|
||||
cards.add(new SetCardInfo("Gale's Redirection", 73, Rarity.RARE, mage.cards.g.GalesRedirection.class));
|
||||
cards.add(new SetCardInfo("Galepowder Mage", 694, Rarity.RARE, mage.cards.g.GalepowderMage.class));
|
||||
cards.add(new SetCardInfo("Game Trail", 894, Rarity.RARE, mage.cards.g.GameTrail.class));
|
||||
cards.add(new SetCardInfo("Ganax, Astral Hunter", 176, Rarity.UNCOMMON, mage.cards.g.GanaxAstralHunter.class));
|
||||
|
|
Loading…
Reference in a new issue