[STX] Implemented Flunk

This commit is contained in:
Evan Kranzler 2021-04-03 21:57:11 -04:00
parent ceabb02270
commit 5657e13d69
2 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,66 @@
package mage.cards.f;
import mage.abilities.Ability;
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.game.Game;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class Flunk extends CardImpl {
public Flunk(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}");
// Target creature gets -X/-X until end of turn, where X is 7 minus the number of cards in that creature's controller's hand.
this.getSpellAbility().addEffect(new FlunkEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
private Flunk(final Flunk card) {
super(card);
}
@Override
public Flunk copy() {
return new Flunk(this);
}
}
class FlunkEffect extends OneShotEffect {
FlunkEffect() {
super(Outcome.Benefit);
staticText = "target creature gets -X/-X until end of turn, where X is 7 " +
"minus the number of cards in that creature's controller's hand";
}
private FlunkEffect(final FlunkEffect effect) {
super(effect);
}
@Override
public FlunkEffect copy() {
return new FlunkEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(game.getControllerId(source.getFirstTarget()));
if (player == null) {
return false;
}
int xValue = Math.max(7 - player.getHand().size(), 0);
game.addEffect(new BoostTargetEffect(-xValue, -xValue), source);
return true;
}
}

View file

@ -84,6 +84,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
cards.add(new SetCardInfo("Eyetwitch", 70, Rarity.UNCOMMON, mage.cards.e.Eyetwitch.class));
cards.add(new SetCardInfo("Field Trip", 131, Rarity.COMMON, mage.cards.f.FieldTrip.class));
cards.add(new SetCardInfo("First Day of Class", 102, Rarity.COMMON, mage.cards.f.FirstDayOfClass.class));
cards.add(new SetCardInfo("Flunk", 71, Rarity.UNCOMMON, mage.cards.f.Flunk.class));
cards.add(new SetCardInfo("Forest", 374, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Fortifying Draught", 132, Rarity.UNCOMMON, mage.cards.f.FortifyingDraught.class));
cards.add(new SetCardInfo("Fractal Summoning", 187, Rarity.COMMON, mage.cards.f.FractalSummoning.class));