From 58f35d1407054b4cc0f46692905672bb9f39c4f5 Mon Sep 17 00:00:00 2001 From: spjspj Date: Thu, 31 Aug 2017 08:55:59 +1000 Subject: [PATCH 1/3] mtg-cards-data.txt --- Utils/mtg-cards-data.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 1159e57987..db9b2c4db5 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -31789,7 +31789,7 @@ Black Market|Commander 2017|98|R|{3}{B}{B}|Enchantment|||Whenever a creature die Blood Artist|Commander 2017|99|U|{1}{B}|Creature - Vampire|0|1|Whenever Blood Artist or another creature dies, target player loses 1 life and you gain 1 life.| Blood Tribute|Commander 2017|100|R|{4}{B}{B}|Sorcery|||Kicker — Tap an untapped Vampire you control.$Target opponent loses half his or her life, rounded up. If Blood Tribute was kicked, you gain life equal to the life lost this way.| Bloodhusk Ritualist|Commander 2017|101|U|{2}{B}|Creature - Vampire Shaman|2|2|Multikicker {B}$When Bloodhusk Ritualist enters the battlefield, target opponent discards a card for each time it was kicked.| -Bloodlost of Vaasgoth|Commander 2017|102|M|{3}{B}{B}|Creature - Vampire Warrior|3|3|Bloodthirst 3$Flying$Whenever you cast a Vampire creature spell, it gains bloodthirst 3.| +Bloodlord of Vaasgoth|Commander 2017|102|M|{3}{B}{B}|Creature - Vampire Warrior|3|3|Bloodthirst 3$Flying$Whenever you cast a Vampire creature spell, it gains bloodthirst 3.| Butcher of Malakir|Commander 2017|103|R|{5}{B}{B}|Creature - Vampire Warrior|5|4|Flying$Whenever Butcher of Malakir or another creature you control dies, each opponent sacrifices a creature.| Captivating Vampire|Commander 2017|104|R|{1}{B}{B}|Creature - Vampire|2|2|Other Vampire creature you control get +1/+1.$Tap five untapped Vampires you control: Gain control of target creature. It becomes a Vampire in addition to its other types.| Consuming Vapors|Commander 2017|105|R|{3}{B}|Sorcery|||Target player sacrifices a creature. You gain life equal to that creature's toughness.$Rebound| @@ -32459,4 +32459,4 @@ Mountain|Duel Decks: Mind vs. Might|61|L||Basic Land - Mountain|||{T}: Add {R} t Mountain|Duel Decks: Mind vs. Might|62|L||Basic Land - Mountain|||{T}: Add {R} to your mana pool.| Forest|Duel Decks: Mind vs. Might|63|L||Basic Land - Forest|||{T}: Add {G} to your mana pool.| Forest|Duel Decks: Mind vs. Might|64|L||Basic Land - Forest|||{T}: Add {G} to your mana pool.| -Forest|Duel Decks: Mind vs. Might|65|L||Basic Land - Forest|||{T}: Add {G} to your mana pool.| \ No newline at end of file +Forest|Duel Decks: Mind vs. Might|65|L||Basic Land - Forest|||{T}: Add {G} to your mana pool.| From 930cf8ab1782f9f1cd1a6cb98bf526661c5e8321 Mon Sep 17 00:00:00 2001 From: spjspj Date: Thu, 31 Aug 2017 23:19:04 +1000 Subject: [PATCH 2/3] Implement 2 cards (XLN) --- .../src/mage/cards/u/UnclaimedTerritory.java | 139 ++++++++++++++++++ .../src/mage/cards/u/UnfriendlyFire.java | 59 ++++++++ Mage.Sets/src/mage/sets/Ixalan.java | 2 + 3 files changed, 200 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/u/UnclaimedTerritory.java create mode 100644 Mage.Sets/src/mage/cards/u/UnfriendlyFire.java diff --git a/Mage.Sets/src/mage/cards/u/UnclaimedTerritory.java b/Mage.Sets/src/mage/cards/u/UnclaimedTerritory.java new file mode 100644 index 0000000000..d2dc2ab2d2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UnclaimedTerritory.java @@ -0,0 +1,139 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.u; + +import java.util.UUID; +import mage.ConditionalMana; +import mage.MageObject; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.abilities.mana.ConditionalAnyColorManaAbility; +import mage.abilities.mana.builder.ConditionalManaBuilder; +import mage.abilities.mana.conditional.CreatureCastManaCondition; +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.players.Player; + +/** + * + * @author spjspj + */ +public class UnclaimedTerritory extends CardImpl { + + public UnclaimedTerritory(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + // As Unclaimed Territory enters the battlefield, choose a creature type. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.Benefit))); + + // {T}: Add {C} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell of the chosen type. + this.addAbility(new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new UnclaimedTerritoryManaBuilder(), true)); + } + + public UnclaimedTerritory(final UnclaimedTerritory card) { + super(card); + } + + @Override + public UnclaimedTerritory copy() { + return new UnclaimedTerritory(this); + } +} + +class UnclaimedTerritoryManaBuilder extends ConditionalManaBuilder { + + SubType creatureType; + + @Override + public ConditionalManaBuilder setMana(Mana mana, Ability source, Game game) { + SubType value = (SubType) game.getState().getValue(source.getSourceId() + "_type"); + if (value != null) { + creatureType = value; + } + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + game.informPlayers(controller.getLogName() + " produces " + mana.toString() + " with " + sourceObject.getLogName() + + " (can only be spent to cast creatures of type " + creatureType + ")"); + } + return super.setMana(mana, source, game); + } + + @Override + public ConditionalMana build(Object... options) { + return new UnclaimedTerritoryConditionalMana(this.mana, creatureType); + } + + @Override + public String getRule() { + return "Spend this mana only to cast a creature spell of the chosen type"; + } +} + +class UnclaimedTerritoryConditionalMana extends ConditionalMana { + + public UnclaimedTerritoryConditionalMana(Mana mana, SubType creatureType) { + super(mana); + staticText = "Spend this mana only to cast a creature spell of the chosen type"; + addCondition(new UnclaimedTerritoryManaCondition(creatureType)); + } +} + +class UnclaimedTerritoryManaCondition extends CreatureCastManaCondition { + + SubType creatureType; + + UnclaimedTerritoryManaCondition(SubType creatureType) { + this.creatureType = creatureType; + } + + @Override + public boolean apply(Game game, Ability source, UUID originalId, Cost costToPay) { + // check: ... to cast a creature spell + if (super.apply(game, source)) { + // check: ... of the chosen type + MageObject object = game.getObject(source.getSourceId()); + if (creatureType != null && object.hasSubtype(creatureType, game)) { + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/u/UnfriendlyFire.java b/Mage.Sets/src/mage/cards/u/UnfriendlyFire.java new file mode 100644 index 0000000000..6026d6d579 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UnfriendlyFire.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.u; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author spjspj + */ +public class UnfriendlyFire extends CardImpl { + + public UnfriendlyFire(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}"); + + // Unfriendly Fire deals 4 damage to target creature or player. + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + } + + public UnfriendlyFire(final UnfriendlyFire card) { + super(card); + } + + @Override + public UnfriendlyFire copy() { + return new UnfriendlyFire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Ixalan.java b/Mage.Sets/src/mage/sets/Ixalan.java index f048635edd..72bfcbf648 100644 --- a/Mage.Sets/src/mage/sets/Ixalan.java +++ b/Mage.Sets/src/mage/sets/Ixalan.java @@ -46,6 +46,8 @@ public class Ixalan extends ExpansionSet { cards.add(new SetCardInfo("Sun-Crowned Hunters", 164, Rarity.COMMON, mage.cards.s.SunCrownedHunters.class)); cards.add(new SetCardInfo("Sunpetal Grove", 257, Rarity.RARE, mage.cards.s.SunpetalGrove.class)); cards.add(new SetCardInfo("Tishana's Wayfinder", 211, Rarity.COMMON, mage.cards.t.TishanasWayfinder.class)); + cards.add(new SetCardInfo("Unclaimed Territory", 258, Rarity.UNCOMMON, mage.cards.u.UnclaimedTerritory.class)); + cards.add(new SetCardInfo("Unfriendly Fire", 172, Rarity.COMMON, mage.cards.u.UnfriendlyFire.class)); cards.add(new SetCardInfo("Vanquisher's Banner", 251, Rarity.RARE, mage.cards.v.VanquishersBanner.class)); cards.add(new SetCardInfo("Verdant Sun's Avatar", 213, Rarity.RARE, mage.cards.v.VerdantSunsAvatar.class)); cards.add(new SetCardInfo("Vraska's Contempt", 129, Rarity.RARE, mage.cards.v.VraskasContempt.class)); From 669ae56d6fafb519b701e883a293c40a57bcd4da Mon Sep 17 00:00:00 2001 From: spjspj Date: Thu, 31 Aug 2017 23:27:11 +1000 Subject: [PATCH 3/3] Allow Dinosaur to be selected in creature type dialog --- Mage/src/main/java/mage/constants/SubType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index 48f4dc402f..514ae86c6f 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -102,7 +102,7 @@ public enum SubType { DEMON("Demon", SubTypeSet.CreatureType, false), DESERTER("Deserter", SubTypeSet.CreatureType, false), DEVIL("Devil", SubTypeSet.CreatureType, false), - DINOSAUR("Dinosaur", SubTypeSet.CreatureType, true), // only Grimlock right now, until Ixalan + DINOSAUR("Dinosaur", SubTypeSet.CreatureType, false), // With Ixalan now being spoiled, need this to be selectable DJINN("Djinn", SubTypeSet.CreatureType, false), DRAGON("Dragon", SubTypeSet.CreatureType, false), DRAKE("Drake", SubTypeSet.CreatureType, false),