mirror of
https://github.com/correl/mage.git
synced 2025-01-11 11:05:23 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
f5d16a930f
7 changed files with 200 additions and 22 deletions
70
Mage.Sets/src/mage/cards/a/AmateurAuteur.java
Normal file
70
Mage.Sets/src/mage/cards/a/AmateurAuteur.java
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* 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.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.common.TargetEnchantmentPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class AmateurAuteur extends CardImpl {
|
||||
|
||||
public AmateurAuteur(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Sacrifice Amateur Auteur: Destroy target enchantment.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetEnchantmentPermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public AmateurAuteur(final AmateurAuteur card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AmateurAuteur copy() {
|
||||
return new AmateurAuteur(this);
|
||||
}
|
||||
}
|
65
Mage.Sets/src/mage/cards/t/TargetMinotaur.java
Normal file
65
Mage.Sets/src/mage/cards/t/TargetMinotaur.java
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* 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.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.ProwessAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class TargetMinotaur extends CardImpl {
|
||||
|
||||
public TargetMinotaur(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
|
||||
this.subtype.add(SubType.MINOTAUR);
|
||||
this.subtype.add(SubType.WARRIOR);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Prowess
|
||||
this.addAbility(new ProwessAbility());
|
||||
|
||||
}
|
||||
|
||||
public TargetMinotaur(final TargetMinotaur card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TargetMinotaur copy() {
|
||||
return new TargetMinotaur(this);
|
||||
}
|
||||
}
|
|
@ -47,6 +47,8 @@ public class Unstable extends ExpansionSet {
|
|||
|
||||
private Unstable() {
|
||||
super("Unstable", "UST", ExpansionSet.buildDate(2017, 12, 8), SetType.JOKESET);
|
||||
|
||||
cards.add(new SetCardInfo("Amateur Auteur", 3, Rarity.COMMON, mage.cards.a.AmateurAuteur.class));
|
||||
cards.add(new SetCardInfo("As Luck Would Have It", 102, Rarity.RARE, mage.cards.a.AsLuckWouldHaveIt.class));
|
||||
cards.add(new SetCardInfo("Crow Storm", 31, Rarity.UNCOMMON, mage.cards.c.CrowStorm.class));
|
||||
cards.add(new SetCardInfo("Forest", 216, Rarity.LAND, mage.cards.basiclands.Forest.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false)));
|
||||
|
@ -56,6 +58,6 @@ public class Unstable extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Plains", 212, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false)));
|
||||
cards.add(new SetCardInfo("Swamp", 214, Rarity.LAND, mage.cards.basiclands.Swamp.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false)));
|
||||
cards.add(new SetCardInfo("Sword of Dungeons and Dragons", 1, Rarity.MYTHIC, mage.cards.s.SwordOfDungeonsAndDragons.class));
|
||||
|
||||
cards.add(new SetCardInfo("Target Minotaur", 98, Rarity.COMMON, mage.cards.t.TargetMinotaur.class));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ public class TxtDeckImporterTest {
|
|||
|
||||
@Test
|
||||
public void testImportWithBlankLineAboveSideboard() {
|
||||
TxtDeckImporter importer = new TxtDeckImporter();
|
||||
TxtDeckImporter importer = new TxtDeckImporter(false);
|
||||
|
||||
CardInfo card;
|
||||
DeckCardLists deck = new DeckCardLists();
|
||||
|
|
|
@ -29,19 +29,48 @@ package mage.cards.decks.importer;
|
|||
|
||||
import mage.cards.decks.DeckCardLists;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class DeckImporterUtil {
|
||||
|
||||
public static final String[] SIDEBOARD_MARKS = new String[]{"//sideboard", "sb: "};
|
||||
|
||||
public static boolean haveSideboardSection(String file){
|
||||
// search for sideboard section:
|
||||
// or //sideboard
|
||||
// or SB: 1 card name -- special deckstats.net
|
||||
|
||||
File f = new File(file);
|
||||
try (Scanner scanner = new Scanner(f)) {
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.nextLine().trim().toLowerCase();
|
||||
|
||||
for(String mark: SIDEBOARD_MARKS){
|
||||
if (line.startsWith(mark)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore error, deckimporter will process it
|
||||
}
|
||||
|
||||
// not found
|
||||
return false;
|
||||
}
|
||||
|
||||
public static DeckImporter getDeckImporter(String file) {
|
||||
if (file.toLowerCase().endsWith("dec")) {
|
||||
return new DecDeckImporter();
|
||||
} else if (file.toLowerCase().endsWith("mwdeck")) {
|
||||
return new MWSDeckImporter();
|
||||
} else if (file.toLowerCase().endsWith("txt")) {
|
||||
return new TxtDeckImporter();
|
||||
return new TxtDeckImporter(haveSideboardSection(file));
|
||||
} else if (file.toLowerCase().endsWith("dck")) {
|
||||
return new DckDeckImporter();
|
||||
} else if (file.toLowerCase().endsWith("dek")) {
|
||||
|
|
|
@ -47,45 +47,55 @@ public class TxtDeckImporter extends DeckImporter {
|
|||
public static final Set<String> IGNORE_NAMES = new HashSet<>(Arrays.asList(SET_VALUES));
|
||||
|
||||
private boolean sideboard = false;
|
||||
private boolean switchSideboardByEmptyLine = true;
|
||||
private boolean switchSideboardByEmptyLine = true; // all cards after first empty line will be sideboard (like mtgo format)
|
||||
private int nonEmptyLinesTotal = 0;
|
||||
|
||||
public TxtDeckImporter(boolean haveSideboardSection){
|
||||
if(haveSideboardSection){
|
||||
switchSideboardByEmptyLine = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readLine(String line, DeckCardLists deckList) {
|
||||
|
||||
line = line.trim();
|
||||
|
||||
// switch sideboard by commands
|
||||
// process comment:
|
||||
// skip or force to sideboard
|
||||
String commentString = line.toLowerCase();
|
||||
if (commentString.startsWith("//")){
|
||||
// use start, not contains (card names may contain commands like "Legerdemain")
|
||||
|
||||
if (commentString.startsWith("//sideboard")) {
|
||||
sideboard = true;
|
||||
} else if (commentString.startsWith("//main")) {
|
||||
sideboard = false;
|
||||
|
||||
// if there are commands mode (see deckstats.net format) then disable empty line switcher
|
||||
if (nonEmptyLinesTotal == 0){
|
||||
switchSideboardByEmptyLine = false;
|
||||
}
|
||||
}
|
||||
|
||||
// skip comment line
|
||||
return;
|
||||
}
|
||||
|
||||
// switch sideboard by empty line
|
||||
if (switchSideboardByEmptyLine && line.isEmpty() && nonEmptyLinesTotal > 0) {
|
||||
if(sideboard){
|
||||
sbMessage.append("Found empty line at ").append(lineCount).append(", but sideboard already used. Use //main, //sideboard switcher OR empty line to devide your cards.").append('\n');
|
||||
}
|
||||
sideboard = true;
|
||||
return;
|
||||
} else {
|
||||
nonEmptyLinesTotal++;
|
||||
// remove inner card comments from text line: 2 Blinding Fog #some text (like deckstats format)
|
||||
int commentDelim = line.indexOf('#');
|
||||
if(commentDelim >= 0){
|
||||
line = line.substring(0, commentDelim).trim();
|
||||
}
|
||||
|
||||
// single line sideboard cards see https://deckstats.net/
|
||||
// switch sideboard by empty line
|
||||
if (switchSideboardByEmptyLine && line.isEmpty() && nonEmptyLinesTotal > 0) {
|
||||
if(!sideboard){
|
||||
sideboard = true;
|
||||
}else{
|
||||
sbMessage.append("Found empty line at ").append(lineCount).append(", but sideboard already used. Use //sideboard switcher OR one empty line to devide your cards.").append('\n');
|
||||
}
|
||||
|
||||
// skip empty line
|
||||
return;
|
||||
}
|
||||
|
||||
nonEmptyLinesTotal++;
|
||||
|
||||
// single line sideboard card from deckstats.net
|
||||
// SB: 3 Carnage Tyrant
|
||||
boolean singleLineSideBoard = false;
|
||||
if (line.startsWith("SB:")){
|
||||
|
|
|
@ -32702,6 +32702,7 @@ Ghalta, Primal Hunger|Rivals of Ixalan|130|R|{10}{G}{G}|Legendary Creature - Eld
|
|||
Storm the Vault|Rivals of Ixalan|173|R|{2}{U}{R}|Legendary Enchantment|||Whenever one or more creatures you control deal combat damage to a player, create a colorless Treasure artifact token with "{T}, Sacrifice this artifact: Add one mana of any color to your mana pool."$At the beginning of your end step, if you control five or more artifacts, transform Storm the Vault.|
|
||||
Vault of Catlacan|Rivals of Ixalan|173|R||Legendary Land|||<i>(Transforms from Storm the Vault.)</i>${T}: Add one mana of any color to your mana pool.${T}: Add {U} to your mana pool for each artifact you control.|
|
||||
The Immortal Sun|Rivals of Ixalan|180|M|{6}|Legendary Artifact|||Players can't activate loyalty abilities of planeswalkers.$At the beginning of your draw step, draw an additional card.$Spells you cast cost {1} less to cast.$Creatures you control get +1/+1.|
|
||||
Amateur Auteur|Unstable|3|C|{1}{W}|Creature - Human|2|2|Sacrifice Amateur Auteur: Destroy target enchantment.|
|
||||
Angelic Rocket|Unstable|139|R|{8}|Host Creature - Angel|4|4|Flying$When this creature enters the battlefield, you may destroy target nonland permanent.|
|
||||
As Luck Would Have It|Unstable|102|R|{G}|Enchantment|||Hexproof$Whenever you roll a die, put a number of luck counters on As Luck Would Have It equal to the result. Then is there are 100 or more luck counters on As Luck Would Have It, you win the game. (Count both rolls if you reroll a die.)|
|
||||
Baron Von Count|Unstable|127|M|{1}{B}{R}|Legendary Creature - Human Villain|3|3|Baron Von Count enters the battlefield with a doom counter on "5."$Whenever you cast a spell with the indicated numeral in its mana cost, text box, power, or toughness, move the doom counter one numeral to the left.$When the doom counter moves from "1," destroy target player and put that doom counter on "5."|
|
||||
|
@ -32754,6 +32755,7 @@ Stinging Scorpion|Unstable|72|C|{4}{B}|Host Creature - Scorpion|3|2|When this cr
|
|||
Summon the Pack|Unstable|74|M|{7}{B}|Sorcery|||Open a sealed Magic booster pack, reveal the cards, and put all creature cards revealed this way onto the battlefield under your control. They're Zombies in addition to their other types. (Remove those cards from your deck before beginning a new game)|
|
||||
Swamp|Unstable|214|C||Basic Land - Swamp|||B|
|
||||
Sword of Dungeons and Dragons|Unstable|1|M|{3}|Artifact - Equipment|||Equipped creature gets +2/+2 and has protection from Rogues and from Clerics.$Whenever equipped creature deals combat damage to a player, create a 4/4 gold Dragon creature token with flying and roll a d20. If you roll a 20, repeat this process.$Equip {2}|
|
||||
Target Minotaur|Unstable|98|C|{1}{R}|Creature - Minotaur Warrior|2|1|Prowess|
|
||||
The Big Idea|Unstable|76|R|{4}{R}{R}|Legendary Creature - Brainiac Villain|4|4|2{BR}{BR}, T: Roll a six-sided dice. Create a number of 1/1 red Brainiac creature tokens equal to the result. $Tap three untapped Brainiacs you control: The next time you would roll a six-sided die, instead roll two six-sided dice and use the total of those results.|
|
||||
Time Out|Unstable|48|C|{4}{U}|Instant|||Roll a six-sided die. Put target nonland permanent into its owner's library just beneath the top X cards of that library, where X is the result.|
|
||||
Voracious Vacuum|Unstable|164|C|{3}|Host Creature - Construct|1|1|When this creature enters the battlefield, put a +1/+1 counter on target creature.|
|
||||
|
|
Loading…
Reference in a new issue