mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Implemented Fireflux Squad
This commit is contained in:
parent
bbc8f0ebcf
commit
03a6891a9a
2 changed files with 112 additions and 0 deletions
111
Mage.Sets/src/mage/cards/f/FirefluxSquad.java
Normal file
111
Mage.Sets/src/mage/cards/f/FirefluxSquad.java
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
package mage.cards.f;
|
||||||
|
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.keyword.HasteAbility;
|
||||||
|
import mage.cards.*;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
|
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||||
|
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||||
|
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class FirefluxSquad extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterPermanent filter = new FilterControlledCreaturePermanent("");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(AnotherPredicate.instance);
|
||||||
|
filter.add(AttackingPredicate.instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FirefluxSquad(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
|
||||||
|
|
||||||
|
this.subtype.add(SubType.HUMAN);
|
||||||
|
this.subtype.add(SubType.SOLDIER);
|
||||||
|
this.power = new MageInt(4);
|
||||||
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
|
// Haste
|
||||||
|
this.addAbility(HasteAbility.getInstance());
|
||||||
|
|
||||||
|
// Whenever Fireflux Squad attacks, you may exile another target attacking creature you control. If you do, reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield tapped and attacking and the rest on the bottom of your library in a random order.
|
||||||
|
Ability ability = new AttacksTriggeredAbility(new FirefluxSquadEffect(), true);
|
||||||
|
ability.addTarget(new TargetPermanent(filter));
|
||||||
|
this.addAbility(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
private FirefluxSquad(final FirefluxSquad card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FirefluxSquad copy() {
|
||||||
|
return new FirefluxSquad(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FirefluxSquadEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
FirefluxSquadEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "exile another target attacking creature you control. If you do, " +
|
||||||
|
"reveal cards from the top of your library until you reveal a creature card. " +
|
||||||
|
"Put that card onto the battlefield tapped and attacking " +
|
||||||
|
"and the rest on the bottom of your library in a random order.";
|
||||||
|
}
|
||||||
|
|
||||||
|
private FirefluxSquadEffect(final FirefluxSquadEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FirefluxSquadEffect copy() {
|
||||||
|
return new FirefluxSquadEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
|
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||||
|
if (player == null || permanent == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
player.moveCards(permanent, Zone.EXILED, source, game);
|
||||||
|
Card toBattlefield = null;
|
||||||
|
Cards cards = new CardsImpl();
|
||||||
|
for (Card card : player.getLibrary().getCards(game)) {
|
||||||
|
cards.add(card);
|
||||||
|
if (card != null && card.isCreature()) {
|
||||||
|
toBattlefield = card;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player.revealCards(source, cards, game);
|
||||||
|
if (toBattlefield == null) {
|
||||||
|
return player.putCardsOnBottomOfLibrary(cards, game, source, false);
|
||||||
|
}
|
||||||
|
player.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, true, false, true, null);
|
||||||
|
permanent = game.getPermanent(toBattlefield.getId());
|
||||||
|
if (permanent != null) {
|
||||||
|
cards.remove(toBattlefield);
|
||||||
|
game.getCombat().addAttackingCreature(permanent.getId(), game);
|
||||||
|
}
|
||||||
|
return player.putCardsOnBottomOfLibrary(cards, game, source, false);
|
||||||
|
}
|
||||||
|
}
|
|
@ -130,6 +130,7 @@ public final class Commander2020Edition extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Exotic Orchard", 273, Rarity.RARE, mage.cards.e.ExoticOrchard.class));
|
cards.add(new SetCardInfo("Exotic Orchard", 273, Rarity.RARE, mage.cards.e.ExoticOrchard.class));
|
||||||
cards.add(new SetCardInfo("Fierce Guardianship", 35, Rarity.RARE, mage.cards.f.FierceGuardianship.class));
|
cards.add(new SetCardInfo("Fierce Guardianship", 35, Rarity.RARE, mage.cards.f.FierceGuardianship.class));
|
||||||
cards.add(new SetCardInfo("Find // Finality", 212, Rarity.RARE, mage.cards.f.FindFinality.class));
|
cards.add(new SetCardInfo("Find // Finality", 212, Rarity.RARE, mage.cards.f.FindFinality.class));
|
||||||
|
cards.add(new SetCardInfo("Fireflux Squad", 51, Rarity.RARE, mage.cards.f.FirefluxSquad.class));
|
||||||
cards.add(new SetCardInfo("Flawless Maneuver", 26, Rarity.RARE, mage.cards.f.FlawlessManeuver.class));
|
cards.add(new SetCardInfo("Flawless Maneuver", 26, Rarity.RARE, mage.cards.f.FlawlessManeuver.class));
|
||||||
cards.add(new SetCardInfo("Fluctuator", 241, Rarity.RARE, mage.cards.f.Fluctuator.class));
|
cards.add(new SetCardInfo("Fluctuator", 241, Rarity.RARE, mage.cards.f.Fluctuator.class));
|
||||||
cards.add(new SetCardInfo("Forgotten Cave", 274, Rarity.UNCOMMON, mage.cards.f.ForgottenCave.class));
|
cards.add(new SetCardInfo("Forgotten Cave", 274, Rarity.UNCOMMON, mage.cards.f.ForgottenCave.class));
|
||||||
|
|
Loading…
Reference in a new issue