diff --git a/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/card/arcane/ManaSymbols.java b/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/card/arcane/ManaSymbols.java index a4103da1c44..1bd26d72e15 100644 --- a/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/card/arcane/ManaSymbols.java +++ b/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/card/arcane/ManaSymbols.java @@ -25,7 +25,7 @@ public class ManaSymbols { private static final String[] sets = {"DIS", "GPT", "RAV", "MRD", "10E", "HOP", "ALA", "CFX", "ARB", "ZEN", "WWK", "ROE", "SOM", "M10", "M11", - "MBS", "DDF", "DST", "EVE", "APC", "NPH"}; + "MBS", "DDF", "DST", "EVE", "APC", "NPH", "TMP", "CHK"}; static public void loadImages() { diff --git a/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java b/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java index 92a5db048b0..474138d3a3f 100644 --- a/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java +++ b/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java @@ -13,13 +13,14 @@ import static org.mage.plugins.card.dl.DownloadJob.toFile; public class GathererSets implements Iterable { private static final File outDir = new File("plugins/images/sets"); - private static final String[] symbols = {"DIS", "DST", "GPT", "RAV", "MRD", "10E", "HOP", "EVE", "APC"}; + private static final String[] symbols = {"DIS", "DST", "GPT", "RAV", "MRD", "10E", "HOP", "EVE", "APC", "TMP", "CHK"}; private static final String[] withMythics = {"ALA", "CFX", "ARB", "ZEN", "WWK", "ROE", "SOM", "M10", "M11", "DDF", "MBS", "NPH"}; private static final HashMap symbolsReplacements = new HashMap(); static { symbolsReplacements.put("CFX", "CON"); symbolsReplacements.put("APC", "AP"); + symbolsReplacements.put("TMP", "TE"); } @Override diff --git a/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java b/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java new file mode 100644 index 00000000000..df46153f788 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java @@ -0,0 +1,26 @@ +package mage.sets; + +import mage.Constants; +import mage.cards.ExpansionSet; + +import java.util.GregorianCalendar; + +public class ChampionsOfKamigawa extends ExpansionSet { + private static final ChampionsOfKamigawa fINSTANCE = new ChampionsOfKamigawa(); + + public static ChampionsOfKamigawa getInstance() { + return fINSTANCE; + } + + private ChampionsOfKamigawa() { + super("Champions of Kamigawa", "CHK", "", "mage.sets.championsofkamigawa", new GregorianCalendar(2004, 9, 1).getTime(), Constants.SetType.EXPANSION); + this.blockName = "Champions of Kamigawa"; + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } + +} diff --git a/Mage.Sets/src/mage/sets/Sets.java b/Mage.Sets/src/mage/sets/Sets.java index 159ac4af353..d8f72c2b1c2 100644 --- a/Mage.Sets/src/mage/sets/Sets.java +++ b/Mage.Sets/src/mage/sets/Sets.java @@ -66,6 +66,7 @@ public class Sets extends HashMap { cards = new ArrayList(); this.addSet(AlaraReborn.getInstance()); this.addSet(Apocalypse.getInstance()); + this.addSet(ChampionsOfKamigawa.getInstance()); this.addSet(Conflux.getInstance()); this.addSet(Darksteel.getInstance()); this.addSet(Dissension.getInstance()); @@ -84,6 +85,7 @@ public class Sets extends HashMap { this.addSet(ShardsOfAlara.getInstance()); this.addSet(ScarsOfMirrodin.getInstance()); this.addSet(Tenth.getInstance()); + this.addSet(Tempest.getInstance()); this.addSet(Worldwake.getInstance()); this.addSet(Zendikar.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/Tempest.java b/Mage.Sets/src/mage/sets/Tempest.java new file mode 100644 index 00000000000..1434d07c68e --- /dev/null +++ b/Mage.Sets/src/mage/sets/Tempest.java @@ -0,0 +1,24 @@ +package mage.sets; + +import mage.Constants; +import mage.cards.ExpansionSet; + +import java.util.GregorianCalendar; + +public class Tempest extends ExpansionSet { + private static final Tempest fINSTANCE = new Tempest(); + + public static Tempest getInstance() { + return fINSTANCE; + } + + private Tempest() { + super("Tempest", "TMP", "", "mage.sets.tempest", new GregorianCalendar(1997, 9, 1).getTime(), Constants.SetType.EXPANSION); + this.hasBoosters = true; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + } +} diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/GhostlyPrison.java b/Mage.Sets/src/mage/sets/championsofkamigawa/GhostlyPrison.java new file mode 100644 index 00000000000..93adac4ab74 --- /dev/null +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/GhostlyPrison.java @@ -0,0 +1,126 @@ +/* + * 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.sets.championsofkamigawa; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author Loki + */ +public class GhostlyPrison extends CardImpl { + + public GhostlyPrison (UUID ownerId) { + super(ownerId, 10, "Ghostly Prison", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + this.expansionSetCode = "CHK"; + this.color.setWhite(true); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GhostlyPrisonReplacementEffect())); + } + + public GhostlyPrison (final GhostlyPrison card) { + super(card); + } + + @Override + public GhostlyPrison copy() { + return new GhostlyPrison(this); + } + +} + +class GhostlyPrisonReplacementEffect extends ReplacementEffectImpl { + + private static final String effectText = "Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you"; + + GhostlyPrisonReplacementEffect ( ) { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Neutral); + } + + GhostlyPrisonReplacementEffect ( GhostlyPrisonReplacementEffect effect ) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + throw new UnsupportedOperationException("Not supported."); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) { + Player player = game.getPlayer(event.getPlayerId()); + + if ( player != null ) { + ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}"); + if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) && + player.chooseUse(Constants.Outcome.Neutral, "Pay {2} to declare attacker?", game) ) + { + propagandaTax.pay(game, this.getId(), event.getPlayerId(), false); + + if ( propagandaTax.isPaid() ) { + return false; + } + } + } + return true; + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER ) { + return true; + } + return false; + } + + @Override + public GhostlyPrisonReplacementEffect copy() { + return new GhostlyPrisonReplacementEffect(this); + } + + @Override + public String getText(Ability source) { + return effectText; + } +} + diff --git a/Mage.Sets/src/mage/sets/tempest/Propaganda.java b/Mage.Sets/src/mage/sets/tempest/Propaganda.java new file mode 100644 index 00000000000..ddc615803a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Propaganda.java @@ -0,0 +1,126 @@ +/* + * 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.sets.tempest; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author Loki + */ +public class Propaganda extends CardImpl { + + public Propaganda (UUID ownerId) { + super(ownerId, 80, "Propaganda", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "TMP"; + this.color.setBlue(true); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PropagandaReplacementEffect())); + } + + public Propaganda (final Propaganda card) { + super(card); + } + + @Override + public Propaganda copy() { + return new Propaganda(this); + } +} + +class PropagandaReplacementEffect extends ReplacementEffectImpl { + + private static final String effectText = "Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you"; + + PropagandaReplacementEffect ( ) { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Neutral); + } + + PropagandaReplacementEffect ( PropagandaReplacementEffect effect ) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + throw new UnsupportedOperationException("Not supported."); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) { + Player player = game.getPlayer(event.getPlayerId()); + + if ( player != null ) { + ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}"); + if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) && + player.chooseUse(Constants.Outcome.Neutral, "Pay {2} to declare attacker?", game) ) + { + propagandaTax.pay(game, this.getId(), event.getPlayerId(), false); + + if ( propagandaTax.isPaid() ) { + return false; + } + } + } + return true; + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER ) { + return true; + } + return false; + } + + @Override + public PropagandaReplacementEffect copy() { + return new PropagandaReplacementEffect(this); + } + + @Override + public String getText(Ability source) { + return effectText; + } +} diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index bf4c34ef416..354aa4bdbec 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -236,6 +236,8 @@ $knownSets{'MRD'} = 'mirrodin'; $knownSets{'DDF'} = 'elspethvstezzeret'; $knownSets{'MBS'} = 'mirrodinbesieged'; $knownSets{'NPH'} = 'newphyrexia'; +$knownSets{'TMP'} = 'tempest'; +$knownSets{'CHK'} = 'championsofkamigawa'; my %raritiesConversion; $raritiesConversion{'C'} = 'COMMON';