diff --git a/Mage.Sets/src/mage/cards/b/BlastFurnaceHellkite.java b/Mage.Sets/src/mage/cards/b/BlastFurnaceHellkite.java new file mode 100644 index 0000000000..adde7cc821 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BlastFurnaceHellkite.java @@ -0,0 +1,73 @@ +package mage.cards.b; + +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.OfferingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BlastFurnaceHellkite extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledArtifactPermanent("artifact"); + private static final FilterPermanent filter2 = new FilterCreaturePermanent("creatures attacking your opponents"); + + public BlastFurnaceHellkite(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{R}{R}"); + + this.subtype.add(SubType.DRAGON); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Artifact offering + this.addAbility(new OfferingAbility(filter)); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Double strike + this.addAbility(DoubleStrikeAbility.getInstance()); + + // Creatures attacking your opponents have double strike. + this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect( + DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, filter2 + ))); + } + + private BlastFurnaceHellkite(final BlastFurnaceHellkite card) { + super(card); + } + + @Override + public BlastFurnaceHellkite copy() { + return new BlastFurnaceHellkite(this); + } +} + +enum BlastFurnaceHellkitePredicate implements ObjectSourcePlayerPredicate { + instance; + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + return game.getOpponents(input.getSource().getControllerId()) + .contains(game.getCombat().getDefenderId(input.getObject().getId())); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/p/PatronOfTheAkki.java b/Mage.Sets/src/mage/cards/p/PatronOfTheAkki.java index d7eaf93714..77af84f51e 100644 --- a/Mage.Sets/src/mage/cards/p/PatronOfTheAkki.java +++ b/Mage.Sets/src/mage/cards/p/PatronOfTheAkki.java @@ -1,7 +1,6 @@ package mage.cards.p; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.common.continuous.BoostControlledEffect; @@ -13,12 +12,17 @@ import mage.constants.Duration; import mage.constants.SubType; import mage.constants.SuperType; import mage.filter.StaticFilters; +import mage.filter.common.FilterControlledPermanent; + +import java.util.UUID; /** * @author LevelX2 */ public final class PatronOfTheAkki extends CardImpl { + private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.GOBLIN, "Goblin"); + public PatronOfTheAkki(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); addSuperType(SuperType.LEGENDARY); @@ -28,7 +32,7 @@ public final class PatronOfTheAkki extends CardImpl { this.toughness = new MageInt(5); // Goblin offering (You may cast this card any time you could cast an instant by sacrificing a Goblin and paying the difference in mana costs between this and the sacrificed Goblin. Mana cost includes color.) - this.addAbility(new OfferingAbility(SubType.GOBLIN)); + this.addAbility(new OfferingAbility(filter)); // Whenever Patron of the Akki attacks, creatures you control get +2/+0 until end of turn. this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(2, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false), false)); diff --git a/Mage.Sets/src/mage/cards/p/PatronOfTheKitsune.java b/Mage.Sets/src/mage/cards/p/PatronOfTheKitsune.java index f38aa3210c..cfe55b829a 100644 --- a/Mage.Sets/src/mage/cards/p/PatronOfTheKitsune.java +++ b/Mage.Sets/src/mage/cards/p/PatronOfTheKitsune.java @@ -1,7 +1,6 @@ package mage.cards.p; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksAllTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; @@ -11,14 +10,19 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.SuperType; +import mage.filter.common.FilterControlledPermanent; + +import java.util.UUID; /** * @author LevelX2 */ public final class PatronOfTheKitsune extends CardImpl { + private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.FOX, "Fox"); + public PatronOfTheKitsune(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SPIRIT); @@ -26,7 +30,7 @@ public final class PatronOfTheKitsune extends CardImpl { this.toughness = new MageInt(6); // Fox offering (You may cast this card any time you could cast an instant by sacrificing a Fox and paying the difference in mana costs between this and the sacrificed Fox. Mana cost includes color.) - this.addAbility(new OfferingAbility(SubType.FOX)); + this.addAbility(new OfferingAbility(filter)); // Whenever a creature attacks, you may gain 1 life. this.addAbility(new AttacksAllTriggeredAbility(new GainLifeEffect(1), true)); diff --git a/Mage.Sets/src/mage/cards/p/PatronOfTheMoon.java b/Mage.Sets/src/mage/cards/p/PatronOfTheMoon.java index ba83db280c..6d6d898643 100644 --- a/Mage.Sets/src/mage/cards/p/PatronOfTheMoon.java +++ b/Mage.Sets/src/mage/cards/p/PatronOfTheMoon.java @@ -1,7 +1,5 @@ - package mage.cards.p; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -13,19 +11,24 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.CardsImpl; import mage.constants.*; +import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterLandCard; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; import mage.target.common.TargetCardInHand; +import java.util.UUID; + /** * @author LevelX2 */ public final class PatronOfTheMoon extends CardImpl { + private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.MOONFOLK, "Moonfolk"); + public PatronOfTheMoon(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SPIRIT); @@ -33,7 +36,7 @@ public final class PatronOfTheMoon extends CardImpl { this.toughness = new MageInt(4); // Moonfolk offering (You may cast this card any time you could cast an instant by sacrificing a Moonfolk and paying the difference in mana costs between this and the sacrificed Moonfolk. Mana cost includes color.) - this.addAbility(new OfferingAbility(SubType.MOONFOLK)); + this.addAbility(new OfferingAbility(filter)); // Flying this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/cards/p/PatronOfTheNezumi.java b/Mage.Sets/src/mage/cards/p/PatronOfTheNezumi.java index 4dd6ea22a0..9294feba76 100644 --- a/Mage.Sets/src/mage/cards/p/PatronOfTheNezumi.java +++ b/Mage.Sets/src/mage/cards/p/PatronOfTheNezumi.java @@ -1,8 +1,5 @@ - package mage.cards.p; -import java.util.UUID; - import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -14,21 +11,25 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** * @author LevelX2 */ public final class PatronOfTheNezumi extends CardImpl { + private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.RAT, "Rat"); + public PatronOfTheNezumi(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SPIRIT); @@ -36,7 +37,7 @@ public final class PatronOfTheNezumi extends CardImpl { this.toughness = new MageInt(6); // Rat offering (You may cast this card any time you could cast an instant by sacrificing a Rat and paying the difference in mana costs between this and the sacrificed Rat. Mana cost includes color.) - this.addAbility(new OfferingAbility(SubType.RAT)); + this.addAbility(new OfferingAbility(filter)); // Whenever a permanent is put into an opponent's graveyard, that player loses 1 life. this.addAbility(new PatronOfTheNezumiTriggeredAbility(new LoseLifeTargetEffect(1))); @@ -90,4 +91,4 @@ class PatronOfTheNezumiTriggeredAbility extends TriggeredAbilityImpl { public PatronOfTheNezumiTriggeredAbility copy() { return new PatronOfTheNezumiTriggeredAbility(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/p/PatronOfTheOrochi.java b/Mage.Sets/src/mage/cards/p/PatronOfTheOrochi.java index e76e169bc8..f0cb40e973 100644 --- a/Mage.Sets/src/mage/cards/p/PatronOfTheOrochi.java +++ b/Mage.Sets/src/mage/cards/p/PatronOfTheOrochi.java @@ -1,7 +1,5 @@ - package mage.cards.p; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -13,20 +11,25 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** * @author LevelX2 */ public final class PatronOfTheOrochi extends CardImpl { + private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.SNAKE, "Snake"); + public PatronOfTheOrochi(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{6}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SPIRIT); @@ -36,11 +39,11 @@ public final class PatronOfTheOrochi extends CardImpl { // Snake offering (You may cast this card any time you could cast an instant // by sacrificing a Snake and paying the difference in mana costs between this // and the sacrificed Snake. Mana cost includes color.) - this.addAbility(new OfferingAbility(SubType.SNAKE)); + this.addAbility(new OfferingAbility(filter)); // {T}: Untap all Forests and all green creatures. Activate this ability only once each turn. this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new PatronOfTheOrochiEffect(), new TapSourceCost())); - + } private PatronOfTheOrochi(final PatronOfTheOrochi card) { @@ -56,11 +59,12 @@ public final class PatronOfTheOrochi extends CardImpl { class PatronOfTheOrochiEffect extends OneShotEffect { private static final FilterPermanent filter = new FilterPermanent(); + static { - filter.add(Predicates.or( SubType.FOREST.getPredicate(), - Predicates.and(CardType.CREATURE.getPredicate(), - new ColorPredicate(ObjectColor.GREEN)) - )); + filter.add(Predicates.or(SubType.FOREST.getPredicate(), + Predicates.and(CardType.CREATURE.getPredicate(), + new ColorPredicate(ObjectColor.GREEN)) + )); } public PatronOfTheOrochiEffect() { @@ -76,7 +80,7 @@ class PatronOfTheOrochiEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) { permanent.untap(game); } return true; @@ -88,5 +92,4 @@ class PatronOfTheOrochiEffect extends OneShotEffect { public PatronOfTheOrochiEffect copy() { return new PatronOfTheOrochiEffect(this); } - -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java b/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java index fcdf9a8b22..90f658c393 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWarCommander.java @@ -35,6 +35,7 @@ public final class TheBrothersWarCommander extends ExpansionSet { cards.add(new SetCardInfo("Bedevil", 121, Rarity.RARE, mage.cards.b.Bedevil.class)); cards.add(new SetCardInfo("Bident of Thassa", 80, Rarity.RARE, mage.cards.b.BidentOfThassa.class)); cards.add(new SetCardInfo("Blasphemous Act", 113, Rarity.RARE, mage.cards.b.BlasphemousAct.class)); + cards.add(new SetCardInfo("Blast-Furnace Hellkite", 12, Rarity.RARE, mage.cards.b.BlastFurnaceHellkite.class)); cards.add(new SetCardInfo("Bojuka Bog", 176, Rarity.COMMON, mage.cards.b.BojukaBog.class)); cards.add(new SetCardInfo("Bronze Guardian", 70, Rarity.RARE, mage.cards.b.BronzeGuardian.class)); cards.add(new SetCardInfo("Brudiclad, Telchor Engineer", 122, Rarity.RARE, mage.cards.b.BrudicladTelchorEngineer.class)); diff --git a/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java b/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java index 63f05309f1..0c38ace886 100644 --- a/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java @@ -12,12 +12,12 @@ import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.abilities.mana.ManaOptions; import mage.cards.Card; import mage.constants.*; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.TargetPermanent; import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; import mage.util.GameLog; @@ -48,15 +48,14 @@ import java.util.UUID; */ public class OfferingAbility extends StaticAbility implements AlternateManaPaymentAbility { - private FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + private final FilterControlledPermanent filter; /** * @param subtype name of the subtype that can be offered */ - public OfferingAbility(SubType subtype) { + public OfferingAbility(FilterControlledPermanent filter) { super(Zone.ALL, null); - filter.add(subtype.getPredicate()); - filter.setMessage(subtype.getDescription()); + this.filter = filter; this.addEffect(new OfferingAsThoughEffect()); } @@ -70,14 +69,16 @@ public class OfferingAbility extends StaticAbility implements AlternateManaPayme return new OfferingAbility(this); } - public FilterControlledCreaturePermanent getFilter() { + public FilterControlledPermanent getFilter() { return filter; } @Override public String getRule(boolean all) { - String subtype = filter.getMessage(); - return subtype + " offering (You may cast this card any time you could cast an instant by sacrificing a " + subtype + " and paying the difference in mana costs between this and the sacrificed " + subtype + ". Mana cost includes color.)"; + String message = filter.getMessage(); + return message + " offering (You may cast this card any time you could cast an instant by sacrificing " + + CardUtil.addArticle(message) + " and paying the difference in mana costs between this and the sacrificed " + + message + ". Mana cost includes color.)"; } @Override @@ -169,7 +170,7 @@ class OfferingAsThoughEffect extends AsThoughEffectImpl { if (game.inCheckPlayableState()) { return true; } - FilterControlledCreaturePermanent filter = ((OfferingAbility) source).getFilter(); + FilterControlledPermanent filter = ((OfferingAbility) source).getFilter(); Card spellToCast = game.getCard(source.getSourceId()); if (spellToCast == null) { return false; @@ -177,7 +178,7 @@ class OfferingAsThoughEffect extends AsThoughEffectImpl { Player player = game.getPlayer(source.getControllerId()); if (player != null && player.chooseUse(Outcome.Benefit, "Offer a " + filter.getMessage() + " to cast " + spellToCast.getName() + '?', source, game)) { - Target target = new TargetControlledCreaturePermanent(1, 1, filter, true); + Target target = new TargetPermanent(1, 1, filter, true); player.chooseTarget(Outcome.Sacrifice, target, source, game); if (!target.isChosen()) { return false; diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index edaa1ddd3e..f4c93cda5d 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -46261,7 +46261,7 @@ March of Progress|The Brothers' War Commander|8|R|{2}{U}|Sorcery|||Choose target Terisiare's Devastation|The Brothers' War Commander|9|R|{X}{2}{B}{B}|Sorcery|||You lose X life and create X tapped Powerstone tokens. Then all creatures get -1/-1 until end of turn for each artifact you control.| Wire Surgeons|The Brothers' War Commander|10|R|{4}{B}{B}|Creature - Human Artificer|6|5|Fear$Each artifact creature card in your graveyard has encore. Its encore cost is equal to its mana cost.| Wreck Hunter|The Brothers' War Commander|11|R|{B}{B}|Creature - Human Artificer|2|2|Flash$When Wreck Hunter enters the battlefield, choose target player. You create a tapped Powerstone token for each nonland card in that player's graveyard that was put there from the battlefield this turn.| -Blast-Furnace Hellkite|The Brothers' War Commander|12|R|{7}{R}{R}|Creature - Dragon|5|5|Goblin offering| +Blast-Furnace Hellkite|The Brothers' War Commander|12|R|{7}{R}{R}|Creature - Dragon|5|5|Artifact offering$Flying, double strike$Creatures attacking your opponents have double strike.| Farid, Enterprising Salvager|The Brothers' War Commander|13|R|{2}{R}|Legendary Creature - Human Soldier|3|3|Whenever a nontoken artifact you control is put into a graveyard from the battlefield, create a colorless artifact token named Scrap.${1}{R}, Sacrifice an artifact: Choose one --$* Put a +1/+1 counter on Farid. It gains haste until end of turn.$* Goad target creature.$* Discard a card, then draw a card.| Hexavus|The Brothers' War Commander|14|R|{6}|Artifact Creature - Construct|0|0|Flying$Hexavus enters the battlefield with six +1/+1 counters on it.${1}, Remove a +1/+1 counter from Hexavus: Put a flying counter on another target creature.${1}, Remove a counter from another creature you control: Put a +1/+1 counter on.| Kayla's Music Box|The Brothers' War Commander|15|R|{2}|Legendary Artifact|||{W}, {T}: Look at the top card of your library, then exile it face down.${T}: Until end of turn, you may play cards you own exiled with Kayla's Music Box.|