mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 02:52:02 -08:00
[DSC] Implement Shriekwood Devourer
This commit is contained in:
parent
99c6a2d4da
commit
d889fa8e23
2 changed files with 85 additions and 0 deletions
84
Mage.Sets/src/mage/cards/s/ShriekwoodDevourer.java
Normal file
84
Mage.Sets/src/mage/cards/s/ShriekwoodDevourer.java
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
package mage.cards.s;
|
||||||
|
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.MageObject;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.UntapLandsEffect;
|
||||||
|
import mage.abilities.keyword.TrampleAbility;
|
||||||
|
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.filter.StaticFilters;
|
||||||
|
import mage.game.Game;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class ShriekwoodDevourer extends CardImpl {
|
||||||
|
|
||||||
|
public ShriekwoodDevourer(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}");
|
||||||
|
|
||||||
|
this.subtype.add(SubType.TREEFOLK);
|
||||||
|
this.power = new MageInt(7);
|
||||||
|
this.toughness = new MageInt(5);
|
||||||
|
|
||||||
|
// Trample
|
||||||
|
this.addAbility(TrampleAbility.getInstance());
|
||||||
|
|
||||||
|
// Whenever you attack with one or more creatures, untap up to X lands, where X is the greatest power among those creatures.
|
||||||
|
this.addAbility(new AttacksWithCreaturesTriggeredAbility(
|
||||||
|
Zone.BATTLEFIELD, new ShriekwoodDevourerEffect(),
|
||||||
|
1, StaticFilters.FILTER_PERMANENT_CREATURES
|
||||||
|
).setTriggerPhrase("Whenever you attack with one or more creatures, "));
|
||||||
|
}
|
||||||
|
|
||||||
|
private ShriekwoodDevourer(final ShriekwoodDevourer card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ShriekwoodDevourer copy() {
|
||||||
|
return new ShriekwoodDevourer(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ShriekwoodDevourerEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
ShriekwoodDevourerEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "untap up to X lands, where X is the greatest power among those creatures";
|
||||||
|
}
|
||||||
|
|
||||||
|
private ShriekwoodDevourerEffect(final ShriekwoodDevourerEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ShriekwoodDevourerEffect copy() {
|
||||||
|
return new ShriekwoodDevourerEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
int xValue = this
|
||||||
|
.getTargetPointer()
|
||||||
|
.getTargets(game, source)
|
||||||
|
.stream()
|
||||||
|
.map(game::getPermanent)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(MageObject::getPower)
|
||||||
|
.mapToInt(MageInt::getValue)
|
||||||
|
.max()
|
||||||
|
.orElse(0);
|
||||||
|
return xValue > 0 && new UntapLandsEffect(xValue).apply(game, source);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -222,6 +222,7 @@ public final class DuskmournHouseOfHorrorCommander extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Shark Typhoon", 127, Rarity.RARE, mage.cards.s.SharkTyphoon.class));
|
cards.add(new SetCardInfo("Shark Typhoon", 127, Rarity.RARE, mage.cards.s.SharkTyphoon.class));
|
||||||
cards.add(new SetCardInfo("Shigeki, Jukai Visionary", 198, Rarity.RARE, mage.cards.s.ShigekiJukaiVisionary.class));
|
cards.add(new SetCardInfo("Shigeki, Jukai Visionary", 198, Rarity.RARE, mage.cards.s.ShigekiJukaiVisionary.class));
|
||||||
cards.add(new SetCardInfo("Shivan Gorge", 297, Rarity.RARE, mage.cards.s.ShivanGorge.class));
|
cards.add(new SetCardInfo("Shivan Gorge", 297, Rarity.RARE, mage.cards.s.ShivanGorge.class));
|
||||||
|
cards.add(new SetCardInfo("Shriekwood Devourer", 35, Rarity.RARE, mage.cards.s.ShriekwoodDevourer.class));
|
||||||
cards.add(new SetCardInfo("Sigil of the Empty Throne", 103, Rarity.RARE, mage.cards.s.SigilOfTheEmptyThrone.class));
|
cards.add(new SetCardInfo("Sigil of the Empty Throne", 103, Rarity.RARE, mage.cards.s.SigilOfTheEmptyThrone.class));
|
||||||
cards.add(new SetCardInfo("Sign in Blood", 156, Rarity.COMMON, mage.cards.s.SignInBlood.class));
|
cards.add(new SetCardInfo("Sign in Blood", 156, Rarity.COMMON, mage.cards.s.SignInBlood.class));
|
||||||
cards.add(new SetCardInfo("Simic Growth Chamber", 298, Rarity.UNCOMMON, mage.cards.s.SimicGrowthChamber.class));
|
cards.add(new SetCardInfo("Simic Growth Chamber", 298, Rarity.UNCOMMON, mage.cards.s.SimicGrowthChamber.class));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue