mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[MKM] Implement Ill-Timed Explosion
This commit is contained in:
parent
adb14e7a6b
commit
f803e95271
2 changed files with 85 additions and 0 deletions
84
Mage.Sets/src/mage/cards/i/IllTimedExplosion.java
Normal file
84
Mage.Sets/src/mage/cards/i/IllTimedExplosion.java
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
package mage.cards.i;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageAllEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetDiscard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class IllTimedExplosion extends CardImpl {
|
||||
|
||||
public IllTimedExplosion(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{R}");
|
||||
|
||||
// Draw two cards. Then you may discard two cards. When you do, Ill-Timed Explosion deals X damage to each creature, where X is the highest mana value among the discarded cards.
|
||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));
|
||||
this.getSpellAbility().addEffect(new IllTimedExplosionEffect());
|
||||
}
|
||||
|
||||
private IllTimedExplosion(final IllTimedExplosion card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IllTimedExplosion copy() {
|
||||
return new IllTimedExplosion(this);
|
||||
}
|
||||
}
|
||||
|
||||
class IllTimedExplosionEffect extends OneShotEffect {
|
||||
|
||||
IllTimedExplosionEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Then you may discard two cards. When you do, {this} deals X damage to each creature, " +
|
||||
"where X is the highest mana value among the discarded cards";
|
||||
}
|
||||
|
||||
private IllTimedExplosionEffect(final IllTimedExplosionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IllTimedExplosionEffect copy() {
|
||||
return new IllTimedExplosionEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || player.getHand().size() < 2
|
||||
|| !player.chooseUse(outcome, "Discard two cards?", source, game)) {
|
||||
return false;
|
||||
}
|
||||
TargetDiscard target = new TargetDiscard(2, StaticFilters.FILTER_CARD_CARDS, source.getControllerId());
|
||||
player.choose(outcome, target, source, game);
|
||||
Cards cards = new CardsImpl(target.getTargets());
|
||||
player.discard(cards, false, source, game);
|
||||
int xValue = cards
|
||||
.getCards(game)
|
||||
.stream()
|
||||
.mapToInt(MageObject::getManaValue)
|
||||
.max()
|
||||
.orElse(0);
|
||||
game.fireReflexiveTriggeredAbility(new ReflexiveTriggeredAbility(
|
||||
new DamageAllEffect(xValue, StaticFilters.FILTER_PERMANENT_CREATURE), false
|
||||
), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -99,6 +99,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Hotshot Investigators", 60, Rarity.COMMON, mage.cards.h.HotshotInvestigators.class));
|
||||
cards.add(new SetCardInfo("Hunted Bonebrute", 87, Rarity.RARE, mage.cards.h.HuntedBonebrute.class));
|
||||
cards.add(new SetCardInfo("Hustle // Bustle", 249, Rarity.UNCOMMON, mage.cards.h.HustleBustle.class));
|
||||
cards.add(new SetCardInfo("Ill-Timed Explosion", 207, Rarity.RARE, mage.cards.i.IllTimedExplosion.class));
|
||||
cards.add(new SetCardInfo("Inside Source", 19, Rarity.COMMON, mage.cards.i.InsideSource.class));
|
||||
cards.add(new SetCardInfo("Insidious Roots", 208, Rarity.UNCOMMON, mage.cards.i.InsidiousRoots.class));
|
||||
cards.add(new SetCardInfo("Island", 273, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue