Implemented Super-Duper Death Ray

This commit is contained in:
Evan Kranzler 2020-04-08 20:32:40 -04:00
parent 82aa9fdb95
commit b0b3952a8a
2 changed files with 84 additions and 0 deletions

View file

@ -0,0 +1,83 @@
package mage.cards.s;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SuperDuperDeathRay extends CardImpl {
public SuperDuperDeathRay(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
// Trample
this.addAbility(new SimpleStaticAbility(new InfoEffect(
"Trample <i>(This spell can deal excess damage to its targets controller.)</i>"
)));
// Super-Duper Death Ray deals 4 damage to target creature.
this.getSpellAbility().addEffect(new SuperDuperDeathRayEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
private SuperDuperDeathRay(final SuperDuperDeathRay card) {
super(card);
}
@Override
public SuperDuperDeathRay copy() {
return new SuperDuperDeathRay(this);
}
}
class SuperDuperDeathRayEffect extends OneShotEffect {
SuperDuperDeathRayEffect() {
super(Outcome.Benefit);
staticText = "{this} deals 4 damage to target creature.";
}
private SuperDuperDeathRayEffect(final SuperDuperDeathRayEffect effect) {
super(effect);
}
@Override
public SuperDuperDeathRayEffect copy() {
return new SuperDuperDeathRayEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
MageObject sourceObject = source.getSourceObject(game);
if (permanent == null || sourceObject == null) {
return false;
}
int lethal = Math.max(permanent.getToughness().getValue() - permanent.getDamage(), 0);
if (sourceObject.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())) {
lethal = Math.min(lethal, 1);
}
lethal = Math.min(lethal, 4);
permanent.damage(lethal, source.getSourceId(), game);
Player player = game.getPlayer(permanent.getControllerId());
if (player != null && lethal < 4) {
player.damage(4 - lethal, source.getSourceId(), game);
}
return true;
}
}

View file

@ -72,6 +72,7 @@ public final class Unstable extends ExpansionSet {
cards.add(new SetCardInfo("Steamflogger Boss", 93, Rarity.RARE, mage.cards.s.SteamfloggerBoss.class));
cards.add(new SetCardInfo("Steel Squirrel", 162, Rarity.UNCOMMON, mage.cards.s.SteelSquirrel.class));
cards.add(new SetCardInfo("Summon the Pack", 74, Rarity.MYTHIC, mage.cards.s.SummonThePack.class));
cards.add(new SetCardInfo("Super-Duper Death Ray", 97, Rarity.UNCOMMON, mage.cards.s.SuperDuperDeathRay.class));
cards.add(new SetCardInfo("Swamp", 214, Rarity.LAND, mage.cards.basiclands.Swamp.class, new CardGraphicInfo(FrameStyle.UST_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("Sword of Dungeons & Dragons", 163, Rarity.MYTHIC, mage.cards.s.SwordOfDungeonsAndDragons.class));
cards.add(new SetCardInfo("Target Minotaur", "98a", Rarity.COMMON, mage.cards.t.TargetMinotaur.class, NON_FULL_USE_VARIOUS));