From b793367d4dbff133a0e6251aa7ee2fde8209a306 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 6 Sep 2017 10:23:37 -0400 Subject: [PATCH 1/3] Fixed Kalastria Highborn --- .../src/mage/cards/k/KalastriaHighborn.java | 94 +++++++++---------- 1 file changed, 44 insertions(+), 50 deletions(-) diff --git a/Mage.Sets/src/mage/cards/k/KalastriaHighborn.java b/Mage.Sets/src/mage/cards/k/KalastriaHighborn.java index b1f72d57315..34bef1325d0 100644 --- a/Mage.Sets/src/mage/cards/k/KalastriaHighborn.java +++ b/Mage.Sets/src/mage/cards/k/KalastriaHighborn.java @@ -29,37 +29,48 @@ package mage.cards.k; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.GainLifeEffect; -import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.SubType; -import mage.constants.Zone; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; 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.players.Player; import mage.target.TargetPlayer; /** * - * @author maurer.it_at_gmail.com + * @author maurer.it_at_gmail.com, TheElk801 */ public class KalastriaHighborn extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Vampire you control"); + + static { + filter.add(new SubtypePredicate(SubType.VAMPIRE)); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + public KalastriaHighborn(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}"); this.subtype.add("Vampire"); this.subtype.add("Shaman"); this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new KalastriaHighbornTriggeredAbility()); + Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(new DoIfCostPaid(new LoseGainEffect(), new ManaCostsImpl("{B}")), false, filter); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); } public KalastriaHighborn(final KalastriaHighborn card) { @@ -72,52 +83,35 @@ public class KalastriaHighborn extends CardImpl { } } -class KalastriaHighbornTriggeredAbility extends TriggeredAbilityImpl { - KalastriaHighbornTriggeredAbility ( ) { - super(Zone.ALL, new LoseLifeTargetEffect(2), false); - this.addCost(new ManaCostsImpl("{B}")); - this.addTarget(new TargetPlayer()); - this.getEffects().add(new GainLifeEffect(2)); +class LoseGainEffect extends OneShotEffect { + + LoseGainEffect() { + super(Outcome.Benefit); + this.staticText = "target player loses 2 life and you gain 2 life"; } - KalastriaHighbornTriggeredAbility ( KalastriaHighbornTriggeredAbility ability ) { - super(ability); + LoseGainEffect(final LoseGainEffect effect) { + super(effect); } @Override - public KalastriaHighbornTriggeredAbility copy() { - return new KalastriaHighbornTriggeredAbility(this); + public LoseGainEffect copy() { + return new LoseGainEffect(this); } @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.ZONE_CHANGE; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - // ayrat: make sure Kalastria Highborn is on battlefield - if (game.getPermanent(this.getSourceId()) == null) { - // or it is being removed - if (game.getLastKnownInformation(this.getSourceId(), Zone.BATTLEFIELD) == null) { - return false; - } - } - - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - Permanent permanent = zEvent.getTarget(); - - return permanent != null && - zEvent.getToZone() == Zone.GRAVEYARD && - zEvent.getFromZone() == Zone.BATTLEFIELD && - (permanent.getControllerId().equals(this.getControllerId()) && - permanent.hasSubtype(SubType.VAMPIRE, game) || permanent.getId().equals(this.getSourceId())); - } - - @Override - public String getRule() { - return "Whenever {this} or another Vampire you control is put" - + " into a graveyard from the battlefield, you may pay {B}. If you" - + " do, target player loses 2 life and you gain 2 life."; + public boolean apply(Game game, Ability source) { + Player you = game.getPlayer(source.getControllerId()); + Player them = game.getPlayer(source.getFirstTarget()); + if (you == null && them == null) { + return false; + } + if (you != null) { + you.gainLife(2, game); + } + if (them != null) { + them.loseLife(2, game, false); + } + return true; } } From 2b74c6b4d2cc9a1c1a3c2d73c57f293eabf994c4 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 6 Sep 2017 10:44:00 -0400 Subject: [PATCH 2/3] updated XLN spoiler --- Utils/mtg-cards-data.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 0339c0f04fe..5e47d07ab70 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -32379,6 +32379,7 @@ Sunbird's Invocation|Ixalan|165|R|{5}{R}|Enchantment|||Whenever you cast a spell Drover of the Mighty|Ixalan|167|U|{1}{G}|Creature - Human Druid|1|1|Drover of the Mighty gets +2/+2 as long as you control a Dinosaur.${T}: Add one mana of any color to your mana pool.| Tilonalli's Skinshifter|Ixalan|170|R|{2}{R}|Creature - Human Shaman|0|1|Whenever Tilonalli's Skinshifter attacks, it becomes a copy of another target nonlegendary attacking creature until end of turn.| Unfriendly Fire|Ixalan|172|C|{4}{R}|Instant|||Unfriendly Fire deals 4 damage to target creature or player.| +Wily Goblin|Ixalan|174|U|{R}{R}|Creature - Goblin Pirate|1|1|When Wily Goblin enters the battlefield, create a colorless Treasure artifact token with "{T}, Sacrifice this artifact: Add one mana of any color to your mana pool."| Carnage Tyrant|Ixalan|179|M|{4}{G}{G}|Creature - Dinosaur|7|6|Carnage Tyrant can't be countered.$Trample, hexproof| Deathgorge Scavenger|Ixalan|???|R|???|Creature - Dinosaur|3|2|Whenever Deathgorge Scavenger enters the battlefield or attacks, you may exile target card from a graveyard. If a creature card is exiled this way, you may gain 2 life. If a noncreature card is exiled this way, Deathgorge Scavenger gets +1/+1 until end of turn.| Deeproot Champion|Ixalan|185|R|{1}{G}|Creature - Merfolk Shaman|1|1|Whenever you cast a noncreature spell, put a +1/+1 counter on Deeproot Champion.| @@ -32386,10 +32387,12 @@ Emperor's Vanguard|Ixalan|189|R|{3}{G}|Creature - Human Scout|4|3|Whenever Emper Kumena's Speaker|Ixalan|196|U|{G}|Creature - Merfolk|1|1|Kumena's Speaker gets +1/+1 as long as you control another Merfolk or an Island.| Old-Growth Dryads|Ixalan|199|R|{G}|Creature - Dryad|3|3|When Old-Growth Dryads enters the battlefield, each opponent may search his or her library for a basic land card, put it onto the battlefield tapped, then shuffle his or her library.| Ripjaw Raptor|Ixalan|203|R|{2}{G}{G}|Creature - Dinosaur|4|5|Enrage — Whenever Ripjaw Raptor is dealt damage, draw a card.| +Savage Stomp|Ixalan|205|U|{2}{G}|Sorcery|||Savage Stomp cost {2} less to cast if it targets a Dinosaur you control.$Put a +1/+1 counter on target creature you control. Then that creature fights target creature you don't control.| Shapers' Sanctuary|Ixalan|206|R|{G}|Enchantment|||Whenever a creature you control becomes the target of a spell or ability an opponent controls, you may draw a card.| Tishana's Wayfinder|Ixalan|211|C|{2}{G}|Creature - Merfolk Scout|2|2|When Tishana's Wayfinder enters the battlefield, it explores.| Verdant Sun's Avatar|Ixalan|213|R|{5}{G}{G}|Creature - Dinosaur Avatar|5|5|When Verdant Sun's Avatar or another creature enters the battlefield under your control, you gain life equal to that creature's toughness.| Waker of the Wilds|Ixalan|215|R|{2}{G}{G}|Creature - Merfolk Shaman|3|3|{X}{G}{G}: Put X +1/+1 counters on target land you control. That land becomes a 0/0 Elemental creature with haste. It's still a land.| +Wildgrowth Walker|Ixalan|216|U|{1}{G}|Creature - Elemental|1|3|Whenever a creature you control explores, put a +1/+1 counter on Wildgrowth Walker and you gain 3 life.| Admiral Beckett Brass|Ixalan|217|M|{1}{U}{B}{R}|Legendary Creature - Human Pirate|3|3|Other Pirates you control get +1/+1.$At the beginning of your end step, gain control of target nonland permanent controlled by a player who was dealt damage by three or more Pirates this turn.| Belligerent Brontodon|Ixalan|218|U|{5}{G}{W}|Creature - Dinosaur|4|6|Each creature you control assigns combats damage equal to its toughness rather than its power.| Call to the Feast|Ixalan|219|U|{2}{W}{B}|Sorcery|||Create three 1/1 white Vampire creature tokens with lifelink.| From 039900fda45fe0c72b7717c137aeabde4d559e9e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 6 Sep 2017 10:51:14 -0400 Subject: [PATCH 3/3] updated XLN spoiler --- Utils/mtg-cards-data.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 5e47d07ab70..2820ecda21d 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -32346,11 +32346,14 @@ Deadeye Quartermaster|Ixalan|50|U|{3}{U}|Creature - Human Pirate|2|2|When Deadey Deeproot Waters|Ixalan|51|U|{2}{U}|Enchantment|||Whenever you cast a Merfolk spell, create a 1/1 blue Merfolk creature token with hexproof.| Dreamcaller Siren|Ixalan|54|R|{2}{U}{U}|Creature - Siren Pirate|3|3|Flash$Flying$Dreamcaller Siren can only block creatures with flying.$When Dreamcaller Siren enters the battlefield, if you control another Pirate, tap up to two nonland permanents.| Entrancing Melody|Ixalan|55|R|{X}{U}{U}|Instant|||Gain control of target creature with converted mana cost X.| +Favorable Winds|Ixalan|56|U|{1}{U}|Enchantment|||Creatures you control with flying get +1/+1.| Herald of Secret Streams|Ixalan|59|R|{3}{U}|Creature - Merfolk Warrior|2|3|Creatures you control with +1/+1 counters on them can't be blocked.| Headwater Sentries|Ixalan|58|C|{3}{U}|Creature - Merfolk Warrior|2|5|| Jace, Cunning Castaway|Ixalan|60|M|{1}{U}{U}|Legendary Planeswalker - Jace|||+1: Whenever one or more creatures you control deal combat damage to a player this turn, draw a card, then discard a card.$-2: Create a 2/2 blue Illusion creature token with "When this creature becomes the target of a spell, sacrifice it."$-5: Create two tokens that are copies of Jace, Cunning Castaway, except they're not legendary.| Kopala, Warden of Waves|Ixalan|61|R|{1}{U}{U}|Legendary Creature - Merfolk Wizard|2|2|Spells your opponents cast that target a Merfolk you control cost {2} more to cast.$Abilities your opponents activate that target a Merfolk you control cost {2} more to activate.| +Storm Fleet Aerialist|Ixalan|63|U|{1}{U}|Creature - Human Pirate|1|2|Flying$Raid - Storm Fleet Aerialist enters the battlefield with a +1/+1 counter on it if you attacked with a creature this turn.| Overflowing Insight|Ixalan|64|M|{4}{U}{U}{U}|Sorcery|||Target player draws seven cards.| +Opt|Ixalan|65|C|{U}|Instant|||Scry 1.$Draw a card.| Prosperous Pirates|Ixalan|69|C|{4}{U}|Creature - Human Pirate|3|4|When Prosperous Pirates enters the battlefield, create two colorless Treasure artifact tokens with "{T}, Sacrifice this artifact: Add one mana of any color to your mana pool."| River's Rebuke|Ixalan|71|R|{4}{U}{U}|Sorcery|||Return all nonland permanents target player controls to their owner's hand.| Siren Stormtamer|Ixalan|79|U|{U}|Creature - Siren Pirate Wizard|Flying${U}, Sacrifice Siren Stormtamer: Counter target spell or ability that targets you or a creature you control.| @@ -32359,6 +32362,7 @@ Boneyard Parley|Ixalan|94|M|{5}{B}{B}|Sorcery|||Exile up to five target creature Deadeye Tormentor|Ixalan|98|C|{2}{B}|Creature - Human Pirate|2|2|Raid — When Deadeye Tormentor enters the battlefield, if you attacked with a creature this turn, target opponent discards a card.| Deadeye Tracker|Ixalan|99|R|{B}|Creature - Human Pirate|1|1|{1}{B}, {T}: Exile two target cards from an opponent's graveyard. Deadeye Tracker explores.| Deathless Ancient|Ixalan|100|U|{4}{B}{B}|Creature - Vampire Knight|4|4|Flying$Tap three untapped Vampires you control: Return Deathless Ancient from your graveyard to your hand.| +Duress|Ixalan|105|C|{B}|Sorcery|||Target opponent reveals his or her hand. You choose a noncreature, nonland card from it. That player discards that card.| Fathom Fleet Captain|Ixalan|106|R|{1}{B}|Creature - Human Pirate|2|1|Menace$Whenever Fathom Fleet Captain attacks, if you control another nontoken Pirate, you may pay {2}. If you do, creature a 2/2 black Pirate creature token with menace.| Kitesail Freebooter|Ixalan|110|U|{1}{B}|Creature - Human Pirate|1|2|Flying$When Kitesail Freebooter enters the battlefield, target opponent reveals his or her hand. You choose a noncreature, nonland card from it. Exile that card until Kitesail Freebooter leaves the battlefield.| Queen's Bay Soldier|Ixalan|115|C|{1}{B}|Creature - Vampire Soldier|2|2|| @@ -32374,6 +32378,7 @@ Captain Lannery Storm|Ixalan|136|R|{2}{R}|Legendary Creature - Human Pirate|2|2| Lightning Strike|Ixalan|149|U|{1}{R}|Instant|||Lightning Strike deals 3 damage to target creature or player.| Rowdy Crew|Ixalan|159|M|{2}{R}{R}|Creature - Human Pirate|3|3|Trample$When Rowdy Crew enters the battlefield, draw three cards, then discard two cards at random. If two cards that share a card type are discarded this way, put two +1/+1 counters on Rowdy Crew.| Star of Extinction|Ixalan|161|M|{5}{R}{R}|Sorcery|||Destroy target land. Star of Extinction deals 20 damage to each creature and each planeswalker.| +Storm Fleet Arsonist|Ixalan|162|U|{4}{R}|Creature - Orc Pirate|4|4|Raid - When Storm Fleet Arsonist enters the battlefield, if you attacked with a creature this turn, target opponent sacrifices a permanent.| Sun-Crowned Hunters|Ixalan|164|C|{4}{R}{R}|Creature - Dinosaur|5|4|Enrage — Whenever Sun-Crowned Hunters is dealt damage, it deals 3 damage to target opponent.| Sunbird's Invocation|Ixalan|165|R|{5}{R}|Enchantment|||Whenever you cast a spell from your hand, reveal the top X cards of your library, where X is that spell's converted mana cost. You may cast a card revealed this way with converted mana cost X or less without paying its mana cost. Put the rest on the bottom of your library in a random order.| Drover of the Mighty|Ixalan|167|U|{1}{G}|Creature - Human Druid|1|1|Drover of the Mighty gets +2/+2 as long as you control a Dinosaur.${T}: Add one mana of any color to your mana pool.| @@ -32389,6 +32394,7 @@ Old-Growth Dryads|Ixalan|199|R|{G}|Creature - Dryad|3|3|When Old-Growth Dryads e Ripjaw Raptor|Ixalan|203|R|{2}{G}{G}|Creature - Dinosaur|4|5|Enrage — Whenever Ripjaw Raptor is dealt damage, draw a card.| Savage Stomp|Ixalan|205|U|{2}{G}|Sorcery|||Savage Stomp cost {2} less to cast if it targets a Dinosaur you control.$Put a +1/+1 counter on target creature you control. Then that creature fights target creature you don't control.| Shapers' Sanctuary|Ixalan|206|R|{G}|Enchantment|||Whenever a creature you control becomes the target of a spell or ability an opponent controls, you may draw a card.| +Slice in Twain|Ixalan|207|U|{2}{G}{G}|Instant|||Destroy target artifact or enchantment.$Draw a card.| Tishana's Wayfinder|Ixalan|211|C|{2}{G}|Creature - Merfolk Scout|2|2|When Tishana's Wayfinder enters the battlefield, it explores.| Verdant Sun's Avatar|Ixalan|213|R|{5}{G}{G}|Creature - Dinosaur Avatar|5|5|When Verdant Sun's Avatar or another creature enters the battlefield under your control, you gain life equal to that creature's toughness.| Waker of the Wilds|Ixalan|215|R|{2}{G}{G}|Creature - Merfolk Shaman|3|3|{X}{G}{G}: Put X +1/+1 counters on target land you control. That land becomes a 0/0 Elemental creature with haste. It's still a land.| @@ -32403,6 +32409,7 @@ Hostage Taker|Ixalan|223|R|{2}{U}{B}|Creature - Human Pirate|2|3|When Hostage Ta Huatli, Warrior Poet|Ixalan|224|M|{3}{R}{W}|Legendary Planeswalker - Huatli|||+2: You gain life equal to the greatest power among creatures you control.$0: Create a 3/3 green Dinosaur creature token with trample.$-X: Huatli, Warrior Poet deals X damage divided as you choose among any number of target creatures. Creatures dealt damage this way can't block this turn.| Marauding Looter|Ixalan|225|U|{2}{U}{R}|Creature - Human Pirate|4|3|Raid - At the beginning of your end step, if you attacked with a creature this turn, you may draw a card. If you do, discard a card.| Raging Swordtooth|Ixalan|226|U|{3}{R}{G}|Creature - Dinosaur|5|5|Trample$When Raging Swordtooth enters the battlefield, it deals 1 damage to each other creature.| +Regisaur Alpha|Ixalan|227|R|{3}{R}{G}|Creature - Dinosaur|4|4|Other Dinosaurs you control have haste.$When Regisaur Alpha enters the battlefield, create a 3/3 green Dinosaur creature token with trample.| Shapers of Nature|Ixalan|228|U|{1}{G}{U}|Creature - Merfolk Shaman|3|3|{3}{G}: Put a +1/+1 counter on target creature.${2}{U}, Remove a +1/+1 counter from a creature you control: Draw a card.| Tishana, Voice of Thunder|Ixalan|230|M|{5}{G}{U}|Legendary Creature - Merfolk Shaman|*|*|Tishana, Voice of Thunder's power and toughness are each equal to the number of cards in your hand.$You have no maximum hand size.$When Tishana enters the battlefield, draw a card for each creature you control.| Conqueror's Galleon|Ixalan|234|R|{4}|Artifact - Vehicle|2|10|When Conqueror's Galleon attacks, exile it at the end of combat, then return it to the battlefield transformed under your control.$Crew 4|