Skip to content

Commit

Permalink
[DSC] Implement Shriekwood Devourer
Browse files Browse the repository at this point in the history
  • Loading branch information
theelk801 committed Nov 19, 2024
1 parent 99c6a2d commit d889fa8
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
84 changes: 84 additions & 0 deletions Mage.Sets/src/mage/cards/s/ShriekwoodDevourer.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ private DuskmournHouseOfHorrorCommander() {
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("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("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));
Expand Down

0 comments on commit d889fa8

Please sign in to comment.