[STX] Implemented Humiliate

This commit is contained in:
Evan Kranzler 2021-04-04 12:22:38 -04:00
parent a1d091d9c6
commit 2513a0a7ec
2 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,82 @@
package mage.cards.h;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class Humiliate extends CardImpl {
public Humiliate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}{B}");
// Target opponent reveals their hand. You choose a nonland card from it. That player discards that card. Put a +1/+1 counter on a creature you control.
this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(
StaticFilters.FILTER_CARD_NON_LAND, TargetController.OPPONENT
));
this.getSpellAbility().addEffect(new HumiliateEffect());
this.getSpellAbility().addTarget(new TargetOpponent());
}
private Humiliate(final Humiliate card) {
super(card);
}
@Override
public Humiliate copy() {
return new Humiliate(this);
}
}
class HumiliateEffect extends OneShotEffect {
HumiliateEffect() {
super(Outcome.Benefit);
staticText = "Put a +1/+1 counter on a creature you control";
}
private HumiliateEffect(final HumiliateEffect effect) {
super(effect);
}
@Override
public HumiliateEffect copy() {
return new HumiliateEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null || game.getBattlefield().count(
StaticFilters.FILTER_CONTROLLED_CREATURE,
source.getSourceId(), source.getControllerId(), game
) < 1) {
return false;
}
TargetPermanent target = new TargetControlledCreaturePermanent();
target.setNotTarget(true);
target.withChooseHint("+1/+1 counter");
player.choose(outcome, target, source.getSourceId(), game);
Permanent permanent = game.getPermanent(target.getFirstTarget());
return permanent != null && permanent.addCounters(
CounterType.P1P1.createInstance(), source.getControllerId(), source, game
);
}
}

View file

@ -105,6 +105,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
cards.add(new SetCardInfo("Guiding Voice", 19, Rarity.COMMON, mage.cards.g.GuidingVoice.class));
cards.add(new SetCardInfo("Hall Monitor", 105, Rarity.UNCOMMON, mage.cards.h.HallMonitor.class));
cards.add(new SetCardInfo("Heated Debate", 106, Rarity.COMMON, mage.cards.h.HeatedDebate.class));
cards.add(new SetCardInfo("Humiliate", 193, Rarity.UNCOMMON, mage.cards.h.Humiliate.class));
cards.add(new SetCardInfo("Hunt for Specimens", 73, Rarity.COMMON, mage.cards.h.HuntForSpecimens.class));
cards.add(new SetCardInfo("Igneous Inspiration", 107, Rarity.UNCOMMON, mage.cards.i.IgneousInspiration.class));
cards.add(new SetCardInfo("Illuminate History", 108, Rarity.RARE, mage.cards.i.IlluminateHistory.class));