forked from External/mage
[FIN] Implement Triple Triad
This commit is contained in:
parent
dfd570de8a
commit
fc7bcdf30c
2 changed files with 88 additions and 0 deletions
86
Mage.Sets/src/mage/cards/t/TripleTriad.java
Normal file
86
Mage.Sets/src/mage/cards/t/TripleTriad.java
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.*;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TripleTriad extends CardImpl {
|
||||
|
||||
public TripleTriad(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}{R}");
|
||||
|
||||
// At the beginning of your upkeep, each player exiles the top card of their library. Until end of turn, you may play the card you own exiled this way and each other card exiled this way with lesser mana value than it without paying their mana costs.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new TripleTriadEffect()));
|
||||
}
|
||||
|
||||
private TripleTriad(final TripleTriad card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TripleTriad copy() {
|
||||
return new TripleTriad(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TripleTriadEffect extends OneShotEffect {
|
||||
|
||||
TripleTriadEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "each player exiles the top card of their library. Until end of turn, " +
|
||||
"you may play the card you own exiled this way and each other card exiled this way " +
|
||||
"with lesser mana value than it without paying their mana costs";
|
||||
}
|
||||
|
||||
private TripleTriadEffect(final TripleTriadEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TripleTriadEffect copy() {
|
||||
return new TripleTriadEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Cards cards = new CardsImpl();
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
if (card == null) {
|
||||
continue;
|
||||
}
|
||||
player.moveCards(card, Zone.EXILED, source, game);
|
||||
cards.add(card);
|
||||
}
|
||||
Card card = cards
|
||||
.getCards(game)
|
||||
.stream()
|
||||
.filter(c -> c.isOwnedBy(source.getControllerId()))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
if (card == null) {
|
||||
return true;
|
||||
}
|
||||
cards.removeIf(uuid -> game.getCard(uuid).getManaValue() >= card.getManaValue());
|
||||
cards.add(card);
|
||||
game.addEffect(new PlayFromNotOwnHandZoneTargetEffect(
|
||||
Zone.EXILED, TargetController.YOU, Duration.EndOfTurn, true, false
|
||||
).setTargetPointer(new FixedTargets(cards, game)), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -276,6 +276,8 @@ public final class FinalFantasy extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Traveling Chocobo", 210, Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Traveling Chocobo", 406, Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Traveling Chocobo", 551, Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Triple Triad", 166, Rarity.RARE, mage.cards.t.TripleTriad.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Triple Triad", 340, Rarity.RARE, mage.cards.t.TripleTriad.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Ultima Weapon", 563, Rarity.RARE, mage.cards.u.UltimaWeapon.class));
|
||||
cards.add(new SetCardInfo("Ultimecia, Omnipotent", 247, Rarity.UNCOMMON, mage.cards.u.UltimeciaOmnipotent.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Ultimecia, Omnipotent", 513, Rarity.UNCOMMON, mage.cards.u.UltimeciaOmnipotent.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue