mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
[VOW] Implemented Rending Flame
This commit is contained in:
parent
8c97b47b21
commit
5203714d07
6 changed files with 91 additions and 0 deletions
73
Mage.Sets/src/mage/cards/r/RendingFlame.java
Normal file
73
Mage.Sets/src/mage/cards/r/RendingFlame.java
Normal file
|
@ -0,0 +1,73 @@
|
|||
package mage.cards.r;
|
||||
|
||||
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.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreatureOrPlaneswalker;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class RendingFlame extends CardImpl {
|
||||
|
||||
public RendingFlame(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
|
||||
|
||||
// Rending Flame deals 5 damage to target creature or planeswalker. If that permanent is a Spirit, Rending Flame also deals 2 damage to that permanent's controller.
|
||||
this.getSpellAbility().addEffect(new RendingFlameEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker());
|
||||
}
|
||||
|
||||
private RendingFlame(final RendingFlame card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RendingFlame copy() {
|
||||
return new RendingFlame(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RendingFlameEffect extends OneShotEffect {
|
||||
|
||||
RendingFlameEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "{this} deals 5 damage to target creature or planeswalker. " +
|
||||
"If that permanent is a Spirit, {this} also deals 2 damage to that permanent's controller";
|
||||
}
|
||||
|
||||
private RendingFlameEffect(final RendingFlameEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RendingFlameEffect copy() {
|
||||
return new RendingFlameEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
permanent.damage(5, source, game);
|
||||
if (!permanent.hasSubtype(SubType.SPIRIT, game)) {
|
||||
return true;
|
||||
}
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
player.damage(2, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -61,6 +61,7 @@ public final class InnistradCrimsonVow extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Overcharged Amalgam", 71, Rarity.RARE, mage.cards.o.OverchargedAmalgam.class));
|
||||
cards.add(new SetCardInfo("Path of Peril", 124, Rarity.RARE, mage.cards.p.PathOfPeril.class));
|
||||
cards.add(new SetCardInfo("Plains", 268, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Rending Flame", 175, Rarity.UNCOMMON, mage.cards.r.RendingFlame.class));
|
||||
cards.add(new SetCardInfo("Rot-Tide Gargantua", 129, Rarity.COMMON, mage.cards.r.RotTideGargantua.class));
|
||||
cards.add(new SetCardInfo("Shattered Sanctum", 264, Rarity.RARE, mage.cards.s.ShatteredSanctum.class));
|
||||
cards.add(new SetCardInfo("Sorin the Mirthless", 131, Rarity.MYTHIC, mage.cards.s.SorinTheMirthless.class));
|
||||
|
|
|
@ -3308,6 +3308,11 @@ public class TestPlayer implements Player {
|
|||
computerPlayer.exchangeLife(player, source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damage(int damage, Ability source, Game game) {
|
||||
return computerPlayer.damage(damage, source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damage(int damage, UUID attackerId, Ability source, Game game) {
|
||||
return computerPlayer.damage(damage, attackerId, source, game);
|
||||
|
|
|
@ -147,6 +147,11 @@ public class PlayerStub implements Player {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damage(int damage, Ability source, Game game) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damage(int damage, UUID attackerId, Ability source, Game game, boolean combatDamage, boolean preventable) {
|
||||
return 0;
|
||||
|
|
|
@ -127,6 +127,8 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
|
||||
void exchangeLife(Player player, Ability source, Game game);
|
||||
|
||||
int damage(int damage, Ability source, Game game);
|
||||
|
||||
int damage(int damage, UUID attackerId, Ability source, Game game);
|
||||
|
||||
int damage(int damage, UUID attackerId, Ability source, Game game, boolean combatDamage, boolean preventable);
|
||||
|
|
|
@ -2121,6 +2121,11 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damage(int damage, Ability source, Game game) {
|
||||
return doDamage(damage, source.getSourceId(), source, game, false, true, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damage(int damage, UUID attackerId, Ability source, Game game) {
|
||||
return doDamage(damage, attackerId, source, game, false, true, null);
|
||||
|
|
Loading…
Reference in a new issue