[ZNR] Implemented Shatterskull Smashing / Shatterskull, the Hammer Pass

This commit is contained in:
Evan Kranzler 2020-09-08 16:03:03 -04:00
parent ded70c590a
commit 900b87d1e4
3 changed files with 119 additions and 0 deletions

View file

@ -0,0 +1,75 @@
package mage.cards.s;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.MultipliedValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.DamageMultiEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.game.Game;
import mage.target.TargetAmount;
import mage.target.common.TargetCreatureOrPlaneswalkerAmount;
import mage.target.targetadjustment.TargetAdjuster;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ShatterskullSmashing extends CardImpl {
private static final DynamicValue xValue = new MultipliedValue(ManacostVariableValue.instance, 2);
public ShatterskullSmashing(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}{R}");
// Shatterskull Smashing deals X damage divided as you choose among up to two target creatures and/or planeswalkers. If X is 6 or more, Shatterskull Smashing deals twice X damage divided as you choose among them instead.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageMultiEffect(xValue), new DamageMultiEffect(ManacostVariableValue.instance),
ShatterskullSmashingCondition.instance, "{this} deals X damage divided as you choose " +
"among up to two target creatures and/or planeswalkers. If X is 6 or more, " +
"{this} deals twice X damage divided as you choose among them instead."
));
this.getSpellAbility().setTargetAdjuster(ShatterskullSmashingAdjuster.instance);
}
private ShatterskullSmashing(final ShatterskullSmashing card) {
super(card);
}
@Override
public ShatterskullSmashing copy() {
return new ShatterskullSmashing(this);
}
}
enum ShatterskullSmashingCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return source.getManaCostsToPay().getX() >= 6;
}
}
enum ShatterskullSmashingAdjuster implements TargetAdjuster {
instance;
@Override
public void adjustTargets(Ability ability, Game game) {
ability.getTargets().clear();
TargetAmount target;
if (ability.getManaCostsToPay().getX() >= 6) {
target = new TargetCreatureOrPlaneswalkerAmount(2 * ability.getManaCostsToPay().getX());
} else {
target = new TargetCreatureOrPlaneswalkerAmount(ability.getManaCostsToPay().getX());
}
target.setMinNumberOfTargets(0);
target.setMaxNumberOfTargets(2);
ability.addTarget(target);
}
}

View file

@ -0,0 +1,42 @@
package mage.cards.s;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.RedManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ShatterskullTheHammerPass extends CardImpl {
public ShatterskullTheHammerPass(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
this.modalDFC = true;
this.nightCard = true;
// As Shatterskull, the Hammer Pass enters the battlefield, you may pay 3 life. If you don't, it enters the battlefield tapped.
this.addAbility(new AsEntersBattlefieldAbility(
new TapSourceUnlessPaysEffect(new PayLifeCost(3)),
"you may pay 3 life. If you don't, it enters the battlefield tapped"
));
// {T}: Add {R}.
this.addAbility(new RedManaAbility());
}
private ShatterskullTheHammerPass(final ShatterskullTheHammerPass card) {
super(card);
}
@Override
public ShatterskullTheHammerPass copy() {
return new ShatterskullTheHammerPass(this);
}
}

View file

@ -267,6 +267,8 @@ public final class ZendikarRising extends ExpansionSet {
cards.add(new SetCardInfo("Sejiri Shelter", 37, Rarity.UNCOMMON, mage.cards.s.SejiriShelter.class));
cards.add(new SetCardInfo("Shadow Stinger", 123, Rarity.UNCOMMON, mage.cards.s.ShadowStinger.class));
cards.add(new SetCardInfo("Shadows' Verdict", 124, Rarity.RARE, mage.cards.s.ShadowsVerdict.class));
cards.add(new SetCardInfo("Shatterskull Smashing", 161, Rarity.MYTHIC, mage.cards.s.ShatterskullSmashing.class));
cards.add(new SetCardInfo("Shatterskull, the Hammer Pass", 161, Rarity.MYTHIC, mage.cards.s.ShatterskullTheHammerPass.class));
cards.add(new SetCardInfo("Shell Shield", 79, Rarity.COMMON, mage.cards.s.ShellShield.class));
cards.add(new SetCardInfo("Shepherd of Heroes", 38, Rarity.COMMON, mage.cards.s.ShepherdOfHeroes.class));
cards.add(new SetCardInfo("Skyclave Basilica", 40, Rarity.UNCOMMON, mage.cards.s.SkyclaveBasilica.class));