1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-31 17:00:10 -09:00

Implemented Justice Strike

This commit is contained in:
Evan Kranzler 2018-09-17 20:52:21 -04:00
parent 2d3649cc4b
commit a4476191bb
2 changed files with 63 additions and 0 deletions
Mage.Sets/src/mage

View file

@ -0,0 +1,62 @@
package mage.cards.j;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
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.target.common.TargetCreaturePermanent;
/**
*
* @author TheElk801
*/
public final class JusticeStrike extends CardImpl {
public JusticeStrike(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}{W}");
// Target creature deals damage to itself equal to its power.
this.getSpellAbility().addEffect(new JusticeStrikeEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
public JusticeStrike(final JusticeStrike card) {
super(card);
}
@Override
public JusticeStrike copy() {
return new JusticeStrike(this);
}
}
class JusticeStrikeEffect extends OneShotEffect {
public JusticeStrikeEffect() {
super(Outcome.Benefit);
this.staticText = "Target creature deals damage to itself equal to its power.";
}
public JusticeStrikeEffect(final JusticeStrikeEffect effect) {
super(effect);
}
@Override
public JusticeStrikeEffect copy() {
return new JusticeStrikeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
return permanent.damage(permanent.getPower().getValue(), permanent.getId(), game, false, true) > 0;
}
}

View file

@ -106,6 +106,7 @@ public final class GuildsOfRavnica extends ExpansionSet {
cards.add(new SetCardInfo("Izzet Guildgate", 252, Rarity.COMMON, mage.cards.i.IzzetGuildgate.class));
cards.add(new SetCardInfo("Izzet Locket", 238, Rarity.COMMON, mage.cards.i.IzzetLocket.class));
cards.add(new SetCardInfo("Join Shields", 181, Rarity.UNCOMMON, mage.cards.j.JoinShields.class));
cards.add(new SetCardInfo("Justice Strike", 182, Rarity.UNCOMMON, mage.cards.j.JusticeStrike.class));
cards.add(new SetCardInfo("Knight of Autumn", 183, Rarity.RARE, mage.cards.k.KnightOfAutumn.class));
cards.add(new SetCardInfo("Lava Coil", 108, Rarity.UNCOMMON, mage.cards.l.LavaCoil.class));
cards.add(new SetCardInfo("Lazav, the Multifarious", 184, Rarity.MYTHIC, mage.cards.l.LazavTheMultifarious.class));