mirror of
https://github.com/correl/mage.git
synced 2024-11-21 19:18:40 +00:00
[LTC] Implement Grey Host Reinforcements
This commit is contained in:
parent
77c558be50
commit
029992ecfa
2 changed files with 89 additions and 0 deletions
87
Mage.Sets/src/mage/cards/g/GreyHostReinforcements.java
Normal file
87
Mage.Sets/src/mage/cards/g/GreyHostReinforcements.java
Normal file
|
@ -0,0 +1,87 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.WardAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author PurpleCrowbar
|
||||
*/
|
||||
public final class GreyHostReinforcements extends CardImpl {
|
||||
|
||||
public GreyHostReinforcements(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
||||
this.subtype.add(SubType.SPIRIT, SubType.SOLDIER);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Ward {3}
|
||||
this.addAbility(new WardAbility(new ManaCostsImpl<>("{3}"), false));
|
||||
|
||||
// When Grey Host Reinforcements enters the battlefield, exile target player's graveyard. Put a number
|
||||
// of +1/+1 counters on Grey Host Reinforcements equal to the number of creature cards exiled this way.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new GreyHostReinforcementsEffect());
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private GreyHostReinforcements(final GreyHostReinforcements card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GreyHostReinforcements copy() {
|
||||
return new GreyHostReinforcements(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GreyHostReinforcementsEffect extends OneShotEffect {
|
||||
|
||||
public GreyHostReinforcementsEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "exile target player's graveyard. Put a number of +1/+1 counters " +
|
||||
"on {this} equal to the number of creature cards exiled this way";
|
||||
}
|
||||
|
||||
public GreyHostReinforcementsEffect(final GreyHostReinforcementsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GreyHostReinforcementsEffect copy() {
|
||||
return new GreyHostReinforcementsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (controller == null || player == null) {
|
||||
return false;
|
||||
}
|
||||
int totalCreatures = player.getGraveyard().count(new FilterCreatureCard(), game);
|
||||
controller.moveCards(player.getGraveyard(), Zone.EXILED, source, game);
|
||||
return new AddCountersSourceEffect(CounterType.P1P1.createInstance(totalCreatures)).apply(game, source);
|
||||
}
|
||||
}
|
|
@ -106,6 +106,8 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Goblin Dark-Dwellers", 219, Rarity.RARE, mage.cards.g.GoblinDarkDwellers.class));
|
||||
cards.add(new SetCardInfo("Graypelt Refuge", 316, Rarity.UNCOMMON, mage.cards.g.GraypeltRefuge.class));
|
||||
cards.add(new SetCardInfo("Great Oak Guardian", 247, Rarity.UNCOMMON, mage.cards.g.GreatOakGuardian.class));
|
||||
cards.add(new SetCardInfo("Grey Host Reinforcements", 14, Rarity.RARE, mage.cards.g.GreyHostReinforcements.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Grey Host Reinforcements", 98, Rarity.RARE, mage.cards.g.GreyHostReinforcements.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Growth Spiral", 267, Rarity.COMMON, mage.cards.g.GrowthSpiral.class));
|
||||
cards.add(new SetCardInfo("Guttersnipe", 220, Rarity.UNCOMMON, mage.cards.g.Guttersnipe.class));
|
||||
cards.add(new SetCardInfo("Harmonize", 248, Rarity.UNCOMMON, mage.cards.h.Harmonize.class));
|
||||
|
|
Loading…
Reference in a new issue