[MID] Implemented Unnatural Growth

This commit is contained in:
Daniel Bomar 2021-09-05 17:16:51 -05:00
parent 2e1c8879b0
commit 9cf153aeb4
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,70 @@
package mage.cards.u;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author weirddan455
*/
public final class UnnaturalGrowth extends CardImpl {
public UnnaturalGrowth(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}{G}{G}");
// 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 UnnaturalGrowthEffect(), TargetController.ANY, false));
}
private UnnaturalGrowth(final UnnaturalGrowth card) {
super(card);
}
@Override
public UnnaturalGrowth copy() {
return new UnnaturalGrowth(this);
}
}
class UnnaturalGrowthEffect extends OneShotEffect {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
public UnnaturalGrowthEffect() {
super(Outcome.BoostCreature);
staticText = "double the power and toughness of each creature you control until end of turn";
}
private UnnaturalGrowthEffect(final UnnaturalGrowthEffect effect) {
super(effect);
}
@Override
public UnnaturalGrowthEffect copy() {
return new UnnaturalGrowthEffect(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

@ -84,6 +84,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
cards.add(new SetCardInfo("Tavern Smasher", 163, Rarity.COMMON, mage.cards.t.TavernSmasher.class));
cards.add(new SetCardInfo("Thermo-Alchemist", 164, Rarity.UNCOMMON, mage.cards.t.ThermoAlchemist.class));
cards.add(new SetCardInfo("Triskaidekaphile", 81, Rarity.RARE, mage.cards.t.Triskaidekaphile.class));
cards.add(new SetCardInfo("Unnatural Growth", 206, Rarity.RARE, mage.cards.u.UnnaturalGrowth.class));
cards.add(new SetCardInfo("Unruly Mob", 40, Rarity.COMMON, mage.cards.u.UnrulyMob.class));
cards.add(new SetCardInfo("Village Reavers", 165, Rarity.UNCOMMON, mage.cards.v.VillageReavers.class));
cards.add(new SetCardInfo("Village Watch", 165, Rarity.UNCOMMON, mage.cards.v.VillageWatch.class));