Implemented Beacon Bolt

This commit is contained in:
Evan Kranzler 2018-09-17 21:46:01 -04:00
parent a4476191bb
commit 7f51656b0a
5 changed files with 86 additions and 38 deletions

View file

@ -0,0 +1,39 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.InstantSorceryExileGraveyardCount;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.JumpStartAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
/**
*
* @author TheElk801
*/
public final class BeaconBolt extends CardImpl {
public BeaconBolt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{R}");
// Beacon Bolt deals damage to target creature equal to the total number of instant and sorcery cards you own in exile and in your graveyard.
this.getSpellAbility().addEffect(new DamageTargetEffect(
InstantSorceryExileGraveyardCount.instance
).setText("{this} deals damage to target creature equal to "
+ "the total number of instant and sorcery cards "
+ "you own in exile and in your graveyard"));
// Jump-start
this.addAbility(new JumpStartAbility(this));
}
public BeaconBolt(final BeaconBolt card) {
super(card);
}
@Override
public BeaconBolt copy() {
return new BeaconBolt(this);
}
}

View file

@ -6,6 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.InstantSorceryExileGraveyardCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
@ -40,7 +41,7 @@ public final class CracklingDrake extends CardImpl {
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetPowerSourceEffect(
new CracklingDrakeCount(), Duration.EndOfGame
InstantSorceryExileGraveyardCount.instance, Duration.EndOfGame
).setText("{this}'s power is equal to the total number "
+ "of instant and sorcery cards you own "
+ "in exile and in your graveyard.")

View file

@ -4,9 +4,8 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.InstantSorceryExileGraveyardCount;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
@ -17,9 +16,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.command.emblems.RalIzzetViceroyEmblem;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
@ -44,13 +41,11 @@ public final class RalIzzetViceroy extends CardImpl {
));
// -3: Ral, Izzet Viceroy deals damage to target creature equal to the total number of instant and sorcery cards you own in exile and in your graveyard.
Ability ability = new LoyaltyAbility(
new DamageTargetEffect(new RalIzzetViceroyCount())
.setText("{this} deals damage to target creature "
+ "equal to the total number of instant "
+ "and sorcery cards you own in exile "
+ "and in your graveyard"), -3
);
Ability ability = new LoyaltyAbility(new DamageTargetEffect(
InstantSorceryExileGraveyardCount.instance
).setText("{this} deals damage to target creature equal to "
+ "the total number of instant and sorcery cards "
+ "you own in exile and in your graveyard"), -3);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
@ -69,29 +64,3 @@ public final class RalIzzetViceroy extends CardImpl {
return new RalIzzetViceroy(this);
}
}
class RalIzzetViceroyCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Player player = game.getPlayer(sourceAbility.getControllerId());
if (player != null) {
return player.getGraveyard().count(
StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game
) + game.getExile().getExileZone(player.getId()).count(
StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game
);
}
return 0;
}
@Override
public RalIzzetViceroyCount copy() {
return new RalIzzetViceroyCount();
}
@Override
public String getMessage() {
return "";
}
}

View file

@ -31,6 +31,7 @@ public final class GuildsOfRavnica extends ExpansionSet {
cards.add(new SetCardInfo("Attendant of Vraska", 271, Rarity.UNCOMMON, mage.cards.a.AttendantOfVraska.class));
cards.add(new SetCardInfo("Aurelia, Exemplar of Justice", 153, Rarity.MYTHIC, mage.cards.a.AureliaExemplarOfJustice.class));
cards.add(new SetCardInfo("Barging Sergeant", 92, Rarity.COMMON, mage.cards.b.BargingSergeant.class));
cards.add(new SetCardInfo("Beacon Bolt", 154, Rarity.UNCOMMON, mage.cards.b.BeaconBolt.class));
cards.add(new SetCardInfo("Beast Whisperer", 123, Rarity.RARE, mage.cards.b.BeastWhisperer.class));
cards.add(new SetCardInfo("Blade Instructor", 1, Rarity.COMMON, mage.cards.b.BladeInstructor.class));
cards.add(new SetCardInfo("Blood Operative", 63, Rarity.RARE, mage.cards.b.BloodOperative.class));

View file

@ -0,0 +1,38 @@
package mage.abilities.dynamicvalue.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.game.Game;
import mage.filter.StaticFilters;
import mage.players.Player;
/**
* @author TheElk801
*/
public enum InstantSorceryExileGraveyardCount implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Player player = game.getPlayer(sourceAbility.getControllerId());
if (player != null) {
return player.getGraveyard().count(
StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game
) + game.getExile().getExileZone(player.getId()).count(
StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game
);
}
return 0;
}
@Override
public InstantSorceryExileGraveyardCount copy() {
return instance;
}
@Override
public String getMessage() {
return "";
}
}