mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[MIR] Implement Sirocco
This commit is contained in:
parent
6415a493ff
commit
06415dbb23
2 changed files with 93 additions and 1 deletions
92
Mage.Sets/src/mage/cards/s/Sirocco.java
Normal file
92
Mage.Sets/src/mage/cards/s/Sirocco.java
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class Sirocco extends CardImpl {
|
||||
|
||||
public Sirocco(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}");
|
||||
|
||||
// Target player reveals their hand. For each blue instant card revealed this way, that player discards that card unless they pay 4 life.
|
||||
this.getSpellAbility().addEffect(new SiroccoEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
||||
private Sirocco(final Sirocco card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sirocco copy() {
|
||||
return new Sirocco(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SiroccoEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("blue instant card");
|
||||
|
||||
static {
|
||||
filter.add(CardType.INSTANT.getPredicate());
|
||||
filter.add(new ColorPredicate(ObjectColor.BLUE));
|
||||
}
|
||||
|
||||
SiroccoEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "target player reveals their hand. For each blue instant card revealed this way, " +
|
||||
"that player discards that card unless they pay 4 life";
|
||||
}
|
||||
|
||||
private SiroccoEffect(final SiroccoEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SiroccoEffect copy() {
|
||||
return new SiroccoEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (player == null || player.getHand().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
player.revealCards(source, player.getHand(), game);
|
||||
Set<Card> cards = player.getHand().getCards(filter, game);
|
||||
if (cards.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
for (Card card : cards) {
|
||||
Cost cost = new PayLifeCost(4);
|
||||
if (!cost.canPay(source, source, player.getId(), game)
|
||||
|| !player.chooseUse(
|
||||
outcome, "Pay 4 life or discard " + card.getIdName() + '?',
|
||||
null, "Pay life", "Discard", source, game
|
||||
) || !cost.pay(source, game, source, player.getId(), true)) {
|
||||
player.discard(card, false, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -302,7 +302,7 @@ public final class Mirage extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Shauku, Endbringer", 142, Rarity.RARE, mage.cards.s.ShaukuEndbringer.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Shimmer", 92, Rarity.RARE, mage.cards.s.Shimmer.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Sidar Jabari", 39, Rarity.RARE, mage.cards.s.SidarJabari.class, RETRO_ART));
|
||||
// cards.add(new SetCardInfo("Sirocco", 192, Rarity.UNCOMMON, mage.cards.s.Sirocco.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Sirocco", 192, Rarity.UNCOMMON, mage.cards.s.Sirocco.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Skulking Ghost", 143, Rarity.COMMON, mage.cards.s.SkulkingGhost.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Sky Diamond", 319, Rarity.UNCOMMON, mage.cards.s.SkyDiamond.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Soar", 93, Rarity.COMMON, mage.cards.s.Soar.class, RETRO_ART));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue