mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Implemented Whiptongue Hydra
This commit is contained in:
parent
b248a3cd68
commit
29c5936075
2 changed files with 92 additions and 0 deletions
91
Mage.Sets/src/mage/cards/w/WhiptongueHydra.java
Normal file
91
Mage.Sets/src/mage/cards/w/WhiptongueHydra.java
Normal file
|
@ -0,0 +1,91 @@
|
|||
package mage.cards.w;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class WhiptongueHydra extends CardImpl {
|
||||
|
||||
public WhiptongueHydra(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}");
|
||||
|
||||
this.subtype.add(SubType.LIZARD);
|
||||
this.subtype.add(SubType.HYDRA);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Reach
|
||||
this.addAbility(ReachAbility.getInstance());
|
||||
|
||||
// When Whiptongue Hydra enters the battlefield, destroy all creatures with flying. Put a +1/+1 counter on Whiptongue Hydra for each creature destroyed this way.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new WhiptongueHydraEffect(), false));
|
||||
}
|
||||
|
||||
public WhiptongueHydra(final WhiptongueHydra card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WhiptongueHydra copy() {
|
||||
return new WhiptongueHydra(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WhiptongueHydraEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(new AbilityPredicate(FlyingAbility.class));
|
||||
}
|
||||
|
||||
public WhiptongueHydraEffect() {
|
||||
super(Outcome.DestroyPermanent);
|
||||
this.staticText = "destroy all creatures with flying. "
|
||||
+ "Put a +1/+1 counter on {this} for each permanent destroyed this way";
|
||||
}
|
||||
|
||||
public WhiptongueHydraEffect(final WhiptongueHydraEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WhiptongueHydraEffect copy() {
|
||||
return new WhiptongueHydraEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int destroyedPermanents = 0;
|
||||
destroyedPermanents = game.getBattlefield().getActivePermanents(
|
||||
filter, source.getControllerId(), source.getSourceId(), game
|
||||
).stream().filter(
|
||||
(permanent) -> (permanent.destroy(source.getSourceId(), game, false))
|
||||
).map((_item) -> 1).reduce(destroyedPermanents, Integer::sum);
|
||||
if (destroyedPermanents > 0) {
|
||||
return new AddCountersSourceEffect(
|
||||
CounterType.P1P1.createInstance(destroyedPermanents), true
|
||||
).apply(game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -42,5 +42,6 @@ public final class Commander2018 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Tawnos, Urza's Apprentice", 45, Rarity.MYTHIC, mage.cards.t.TawnosUrzasApprentice.class));
|
||||
cards.add(new SetCardInfo("Thantis the Warweaver", 46, Rarity.MYTHIC, mage.cards.t.ThantisTheWarweaver.class));
|
||||
cards.add(new SetCardInfo("Thopter Spy Network", 107, Rarity.RARE, mage.cards.t.ThopterSpyNetwork.class));
|
||||
cards.add(new SetCardInfo("Whiptongue Hydra", 36, Rarity.RARE, mage.cards.w.WhiptongueHydra.class));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue