Implemented Gravitic Punch

This commit is contained in:
Evan Kranzler 2018-09-19 17:06:20 -04:00
parent 79813d1224
commit 4f4408b6a8
2 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,73 @@
package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.JumpStartAbility;
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.TargetPlayer;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author TheElk801
*/
public final class GraviticPunch extends CardImpl {
public GraviticPunch(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
// Target creature you control deals damage equal to its power to target player.
this.getSpellAbility().addEffect(new GraviticPunchEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetPlayer());
// Jump-start
this.addAbility(new JumpStartAbility(this));
}
public GraviticPunch(final GraviticPunch card) {
super(card);
}
@Override
public GraviticPunch copy() {
return new GraviticPunch(this);
}
}
class GraviticPunchEffect extends OneShotEffect {
public GraviticPunchEffect() {
super(Outcome.Benefit);
this.staticText = "Target creature you control deals damage "
+ "equal to its power to target player.";
}
public GraviticPunchEffect(final GraviticPunchEffect effect) {
super(effect);
}
@Override
public GraviticPunchEffect copy() {
return new GraviticPunchEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent controlledCreature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
Player player = game.getPlayer(source.getTargets().get(1).getFirstTarget());
if (player == null || controlledCreature == null) {
return false;
}
player.damage(controlledCreature.getPower().getValue(), controlledCreature.getId(), game, false, true);
return true;
}
}

View file

@ -117,6 +117,7 @@ public final class GuildsOfRavnica extends ExpansionSet {
cards.add(new SetCardInfo("Golgari Locket", 237, Rarity.COMMON, mage.cards.g.GolgariLocket.class));
cards.add(new SetCardInfo("Golgari Raiders", 130, Rarity.UNCOMMON, mage.cards.g.GolgariRaiders.class));
cards.add(new SetCardInfo("Grappling Sundew", 131, Rarity.UNCOMMON, mage.cards.g.GrapplingSundew.class));
cards.add(new SetCardInfo("Gravitic Punch", 105, Rarity.COMMON, mage.cards.g.GraviticPunch.class));
cards.add(new SetCardInfo("Gruesome Menagerie", 71, Rarity.RARE, mage.cards.g.GruesomeMenagerie.class));
cards.add(new SetCardInfo("Guild Summit", 41, Rarity.UNCOMMON, mage.cards.g.GuildSummit.class));
cards.add(new SetCardInfo("Haazda Marshal", 13, Rarity.UNCOMMON, mage.cards.h.HaazdaMarshal.class));