[ONE] Implement Zopandrel, Hunger Dominus (#9917)

This commit is contained in:
Grath 2023-01-28 18:15:21 -05:00 committed by GitHub
parent 63d10798a8
commit 2167b7cb4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 99 additions and 0 deletions

View file

@ -0,0 +1,98 @@
package mage.cards.z;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.ReachAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledPermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author weirddan455
*/
public final class ZopandrelHungerDominus extends CardImpl {
private static final FilterControlledCreaturePermanent filter
= new FilterControlledCreaturePermanent("other creatures");
static {
filter.add(AnotherPredicate.instance);
}
public ZopandrelHungerDominus(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.PHYREXIAN);
this.subtype.add(SubType.HORROR);
this.power = new MageInt(4);
this.toughness = new MageInt(6);
// Reach
this.addAbility(ReachAbility.getInstance());
// At the beginning of each combat, double the power and toughness of each creature you control until end of turn.
this.addAbility(new BeginningOfCombatTriggeredAbility(new ZopandrelHungerDominusEffect(), TargetController.ANY, false));
// {G/P}{G/P}, Sacrifice two other creatures: Put an indestructible counter on Zopandrel, Hunger Dominus.
Ability ability = new SimpleActivatedAbility(new AddCountersSourceEffect(CounterType.INDESTRUCTIBLE.createInstance()), new ManaCostsImpl<>("{G/P}{G/P}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(2, filter)));
this.addAbility(ability);
}
private ZopandrelHungerDominus(final ZopandrelHungerDominus card) {
super(card);
}
@Override
public ZopandrelHungerDominus copy() {
return new ZopandrelHungerDominus(this);
}
}
class ZopandrelHungerDominusEffect extends OneShotEffect {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
public ZopandrelHungerDominusEffect() {
super(Outcome.BoostCreature);
staticText = "double the power and toughness of each creature you control until end of turn";
}
private ZopandrelHungerDominusEffect(final ZopandrelHungerDominusEffect effect) {
super(effect);
}
@Override
public ZopandrelHungerDominusEffect copy() {
return new ZopandrelHungerDominusEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
ContinuousEffect effect = new BoostTargetEffect(permanent.getPower().getValue(), permanent.getToughness().getValue());
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
return true;
}
}

View file

@ -206,6 +206,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
cards.add(new SetCardInfo("Vulshok Splitter", 156, Rarity.COMMON, mage.cards.v.VulshokSplitter.class));
cards.add(new SetCardInfo("Whisper of the Dross", 117, Rarity.COMMON, mage.cards.w.WhisperOfTheDross.class));
cards.add(new SetCardInfo("White Sun's Twilight", 38, Rarity.RARE, mage.cards.w.WhiteSunsTwilight.class));
cards.add(new SetCardInfo("Zopandrel, Hunger Dominus", 195, Rarity.MYTHIC, mage.cards.z.ZopandrelHungerDominus.class));
}
// @Override