Implemented Hypothesizzle

This commit is contained in:
Evan Kranzler 2018-09-10 20:33:16 -04:00
parent 00dce3caa0
commit b94f1aec2f
2 changed files with 107 additions and 0 deletions

View file

@ -0,0 +1,106 @@
package mage.cards.h;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.SendOptionUsedEventEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author TheElk801
*/
public final class Hypothesizzle extends CardImpl {
public Hypothesizzle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{R}");
// Draw two cards. Then you may discard a nonland card. When you do, Hypothesizzle deals 4 damage to target creature.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));
this.getSpellAbility().addEffect(new DoIfCostPaid(
new HypothesizzleCreateReflexiveTriggerEffect(),
new DiscardCardCost(StaticFilters.FILTER_CARD_A_NON_LAND),
"Discard a nonland card to deal 4 damage?"
).setText("Then you may discard a nonland card. "
+ "When you do, {this} deals 4 damage to target creature."));
}
public Hypothesizzle(final Hypothesizzle card) {
super(card);
}
@Override
public Hypothesizzle copy() {
return new Hypothesizzle(this);
}
}
class HypothesizzleCreateReflexiveTriggerEffect extends OneShotEffect {
public HypothesizzleCreateReflexiveTriggerEffect() {
super(Outcome.Benefit);
this.staticText = "When you do, it deals 4 damage to target creature";
}
public HypothesizzleCreateReflexiveTriggerEffect(final HypothesizzleCreateReflexiveTriggerEffect effect) {
super(effect);
}
@Override
public HypothesizzleCreateReflexiveTriggerEffect copy() {
return new HypothesizzleCreateReflexiveTriggerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
game.addDelayedTriggeredAbility(new HypothesizzleReflexiveTriggeredAbility(), source);
return new SendOptionUsedEventEffect().apply(game, source);
}
}
class HypothesizzleReflexiveTriggeredAbility extends DelayedTriggeredAbility {
public HypothesizzleReflexiveTriggeredAbility() {
super(new DamageTargetEffect(4), Duration.OneUse, true);
this.addTarget(new TargetCreaturePermanent());
}
public HypothesizzleReflexiveTriggeredAbility(final HypothesizzleReflexiveTriggeredAbility ability) {
super(ability);
}
@Override
public HypothesizzleReflexiveTriggeredAbility copy() {
return new HypothesizzleReflexiveTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.OPTION_USED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId())
&& event.getSourceId().equals(this.getSourceId());
}
@Override
public String getRule() {
return "When you discard a nonland card, "
+ "{this} deals 4 damage to target creature";
}
}

View file

@ -42,6 +42,7 @@ public final class GuildsOfRavnica extends ExpansionSet {
cards.add(new SetCardInfo("Golgari Guildgate", 248, Rarity.COMMON, mage.cards.g.GolgariGuildgate.class));
cards.add(new SetCardInfo("Hammer Dropper", 176, Rarity.COMMON, mage.cards.h.HammerDropper.class));
cards.add(new SetCardInfo("Healer's Hawk", 14, Rarity.COMMON, mage.cards.h.HealersHawk.class));
cards.add(new SetCardInfo("Hypothesizzle", 178, Rarity.COMMON, mage.cards.h.Hypothesizzle.class));
cards.add(new SetCardInfo("Impervious Greatwurm", 273, Rarity.MYTHIC, mage.cards.i.ImperviousGreatwurm.class));
cards.add(new SetCardInfo("Island", 261, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Legion Warboss", 109, Rarity.RARE, mage.cards.l.LegionWarboss.class));