Implemented Spiteful Sliver

This commit is contained in:
Evan Kranzler 2019-06-03 08:28:01 -04:00
parent 2258e583bd
commit 728490878e
2 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,75 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealtDamageToSourceTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.target.TargetPlayer;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SpitefulSliver extends CardImpl {
public SpitefulSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.subtype.add(SubType.SLIVER);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Sliver creatures you control have "Whenever this creature is dealt damage, it deals that much damage to target player or planeswalker."
Ability ability = new DealtDamageToSourceTriggeredAbility(
Zone.BATTLEFIELD, new SpitefulSliverEffect(),
false, false, true
);
ability.addTarget(new TargetPlayer());
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
ability, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS
).setText("Sliver creatures you control have \"Whenever this creature is dealt damage, " +
"it deals that much damage to target player or planeswalker.\"")
));
}
private SpitefulSliver(final SpitefulSliver card) {
super(card);
}
@Override
public SpitefulSliver copy() {
return new SpitefulSliver(this);
}
}
class SpitefulSliverEffect extends OneShotEffect {
SpitefulSliverEffect() {
super(Outcome.Damage);
this.staticText = "it deals that much damage to target player or planeswalker";
}
private SpitefulSliverEffect(final SpitefulSliverEffect effect) {
super(effect);
}
@Override
public SpitefulSliverEffect copy() {
return new SpitefulSliverEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int amount = (Integer) getValue("damage");
return new DamageTargetEffect(amount).apply(game, source);
}
}

View file

@ -220,6 +220,7 @@ public final class ModernHorizons extends ExpansionSet {
cards.add(new SetCardInfo("Soulherder", 214, Rarity.UNCOMMON, mage.cards.s.Soulherder.class));
cards.add(new SetCardInfo("Spell Snuff", 70, Rarity.COMMON, mage.cards.s.SpellSnuff.class));
cards.add(new SetCardInfo("Spinehorn Minotaur", 147, Rarity.COMMON, mage.cards.s.SpinehornMinotaur.class));
cards.add(new SetCardInfo("Spiteful Sliver", 148, Rarity.RARE, mage.cards.s.SpitefulSliver.class));
cards.add(new SetCardInfo("Splicer's Skill", 31, Rarity.UNCOMMON, mage.cards.s.SplicersSkill.class));
cards.add(new SetCardInfo("Spore Frog", 180, Rarity.COMMON, mage.cards.s.SporeFrog.class));
cards.add(new SetCardInfo("Springbloom Druid", 181, Rarity.COMMON, mage.cards.s.SpringbloomDruid.class));