Merge branch 'magefree/master'

This commit is contained in:
Samuel Sandeen 2016-09-10 17:47:40 -04:00
commit 3ac80b45f3
45 changed files with 338 additions and 62 deletions

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<groupId>org.mage</groupId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-common</artifactId>

View file

@ -40,8 +40,8 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
*/
public final static int MAGE_VERSION_MAJOR = 1;
public final static int MAGE_VERSION_MINOR = 4;
public final static int MAGE_VERSION_PATCH = 14;
public final static String MAGE_VERSION_MINOR_PATCH = "v0";
public final static int MAGE_VERSION_PATCH = 15;
public final static String MAGE_VERSION_MINOR_PATCH = "v1";
public final static String MAGE_VERSION_INFO = "";
private final int major;

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-counter-plugin</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-plugins</artifactId>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<groupId>org.mage</groupId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-deck-constructed</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-deck-limited</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-game-commanderduel</artifactId>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-game-commanderfreeforall</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-game-freeforall</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-game-momirduel</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-game-tinyleadersduel</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-game-twoplayerduel</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-player-ai-draftbot</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-player-ai-ma</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-player-ai</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-player-ai-mcts</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-player-aiminimax</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-player-human</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-tournament-boosterdraft</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-tournament-constructed</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-tournament-sealed</artifactId>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-server-plugins</artifactId>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-server</artifactId>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<groupId>org.mage</groupId>

View file

@ -0,0 +1,197 @@
/*
* 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.conspiracytakethecrown;
import java.util.HashSet;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.watchers.Watcher;
/**
*
* @author maxlebedev
*/
public class LeovoldEmissaryOfTrest extends CardImpl {
public LeovoldEmissaryOfTrest(UUID ownerId) {
super(ownerId, 77, "Leovold, Emissary of Trest", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{B}{G}{U}");
this.expansionSetCode = "CN2";
this.supertype.add("Legendary");
this.subtype.add("Elf");
this.subtype.add("Advisor");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Each opponent can't draw more than one card each turn. (Based on SpiritOfTheLabyrinth)
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeovoldEmissaryOfTrestEffect()), new LeovoldEmissaryOfTrestWatcher());
// Whenever you or a permanent you control becomes the target of a spell or ability an opponent controls, you may draw a card.
this.addAbility(new LeovoldEmissaryOfTrestTriggeredAbility());
}
public LeovoldEmissaryOfTrest(final LeovoldEmissaryOfTrest card) {
super(card);
}
@Override
public LeovoldEmissaryOfTrest copy() {
return new LeovoldEmissaryOfTrest(this);
}
}
class LeovoldEmissaryOfTrestWatcher extends Watcher {
private final HashSet<UUID> playersThatDrewCard;
public LeovoldEmissaryOfTrestWatcher() {
super("DrewCard", WatcherScope.GAME);
this.playersThatDrewCard = new HashSet<>();
}
public LeovoldEmissaryOfTrestWatcher(final LeovoldEmissaryOfTrestWatcher watcher) {
super(watcher);
this.playersThatDrewCard = new HashSet<>();
playersThatDrewCard.addAll(watcher.playersThatDrewCard);
}
@Override
public LeovoldEmissaryOfTrestWatcher copy() {
return new LeovoldEmissaryOfTrestWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DREW_CARD ) {
if (!playersThatDrewCard.contains(event.getPlayerId())) {
playersThatDrewCard.add(event.getPlayerId());
}
}
}
@Override
public void reset() {
super.reset();
playersThatDrewCard.clear();
}
public boolean hasPlayerDrewCardThisTurn(UUID playerId) {
return playersThatDrewCard.contains(playerId);
}
}
class LeovoldEmissaryOfTrestEffect extends ContinuousRuleModifyingEffectImpl {
public LeovoldEmissaryOfTrestEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment, false, false);
staticText = "Each opponent can't draw more than one card each turn";
}
public LeovoldEmissaryOfTrestEffect(final LeovoldEmissaryOfTrestEffect effect) {
super(effect);
}
@Override
public LeovoldEmissaryOfTrestEffect copy() {
return new LeovoldEmissaryOfTrestEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DRAW_CARD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
LeovoldEmissaryOfTrestWatcher watcher = (LeovoldEmissaryOfTrestWatcher) game.getState().getWatchers().get("DrewCard");
Player controller = game.getPlayer(source.getControllerId());
return watcher != null && controller != null && watcher.hasPlayerDrewCardThisTurn(event.getPlayerId())
&& game.isOpponent(controller, event.getPlayerId());
}
}
class LeovoldEmissaryOfTrestTriggeredAbility extends TriggeredAbilityImpl {
LeovoldEmissaryOfTrestTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), true);
}
LeovoldEmissaryOfTrestTriggeredAbility(final LeovoldEmissaryOfTrestTriggeredAbility ability) {
super(ability);
}
@Override
public LeovoldEmissaryOfTrestTriggeredAbility copy() {
return new LeovoldEmissaryOfTrestTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.TARGETED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Player controller = game.getPlayer(this.getControllerId());
Player targetter = game.getPlayer(event.getPlayerId());
if (controller != null && targetter != null && !controller.getId().equals(targetter.getId())) {
if (event.getTargetId().equals(controller.getId())) {
return true;
}
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
if (permanent != null && this.getControllerId().equals(permanent.getControllerId())) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever you or a permanent you control becomes the target of a spell or ability an opponent controls, you may draw a card.";
}
}

View file

@ -65,6 +65,8 @@ public class UlrichUncontestedAlpha extends CardImpl {
this.subtype.add("Werewolf");
this.power = new MageInt(6);
this.toughness = new MageInt(6);
this.color.setRed(true);
this.color.setGreen(true);
// this card is the second face of double-faced card
this.nightCard = true;

View file

@ -109,7 +109,7 @@ class ShapesharerEffect extends OneShotEffect {
if (copyTo != null) {
Permanent copyFrom = game.getPermanentOrLKIBattlefield(ability.getTargets().get(1).getFirstTarget());
if (copyFrom != null) {
game.copyPermanent(Duration.EndOfTurn, copyFrom, copyTo.getId(), ability, new EmptyApplyToPermanent());
game.copyPermanent(Duration.UntilYourNextTurn, copyFrom, copyTo.getId(), ability, new EmptyApplyToPermanent());
}
}
return true;

View file

@ -57,7 +57,8 @@ public class VernalEquinox extends CardImpl {
this.expansionSetCode = "MMQ";
// Any player may cast creature and enchantment cards as though they had flash.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CastAsThoughItHadFlashAllEffect(Duration.WhileOnBattlefield, filter)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CastAsThoughItHadFlashAllEffect(Duration.WhileOnBattlefield, filter, true)));
}
public VernalEquinox(final VernalEquinox card) {

View file

@ -83,8 +83,8 @@ class HissingQuagmireToken extends Token {
super("", "2/2 black and green Elemental creature with deathtouch");
cardType.add(CardType.CREATURE);
subtype.add("Elemental");
color.setRed(true);
color.setWhite(true);
color.setBlack(true);
color.setGreen(true);
power = new MageInt(2);
toughness = new MageInt(2);
addAbility(DeathtouchAbility.getInstance());

View file

@ -70,7 +70,7 @@ public class MassMutiny extends CardImpl {
Player opponent = game.getPlayer(opponentId);
if (opponent != null) {
ability.getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature from opponent " + opponent.getLogName());
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature from opponent " + opponent.getName());
filter.add(new ControllerIdPredicate(opponentId));
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
ability.addTarget(target);

View file

@ -94,15 +94,14 @@ class NykthosShrineToNyxManaAbility extends ManaAbility {
public List<Mana> getNetMana(Game game) {
netMana.clear();
if (game != null) {
for (String colorChoice :ChoiceColor.colorChoices) {
netMana.add(((NykthosDynamicManaEffect)this.getEffects().get(0)).computeMana(colorChoice, game, this));
for (String colorChoice : ChoiceColor.colorChoices) {
netMana.add(((NykthosDynamicManaEffect) this.getEffects().get(0)).computeMana(colorChoice, game, this));
}
}
return netMana;
}
}
class NykthosDynamicManaEffect extends ManaEffect {
private final Mana computedMana;
@ -132,7 +131,7 @@ class NykthosDynamicManaEffect extends ManaEffect {
if (controller.choose(outcome, choice, game)) {
computeMana(choice.getChoice(), game, source);
checkToFirePossibleEvents(computedMana, game, source);
game.getPlayer(source.getControllerId()).getManaPool().addMana(computedMana, game, source);
controller.getManaPool().addMana(computedMana, game, source);
return true;
}
}
@ -145,10 +144,9 @@ class NykthosDynamicManaEffect extends ManaEffect {
return null;
}
public Mana computeMana(String color, Game game, Ability source){
public Mana computeMana(String color, Game game, Ability source) {
this.computedMana.clear();
if (color !=null && !color.isEmpty()) {
if (color != null && !color.isEmpty()) {
switch (color) {
case "Red":
computedMana.setRed(new DevotionCount(ColoredManaSymbol.R).calculate(game, source, this));

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<groupId>org.mage</groupId>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage-tests</artifactId>

View file

@ -0,0 +1,64 @@
/*
* 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 org.mage.test.cards.abilities.oneshot.damage;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class RuneflareTrapTest extends CardTestPlayerBase {
/**
* Runeflare Trap counts the starting hand as card draw for the purpose of
* enabling its alternative casting cost, which allows for a turn 1 cast for
* 1 red mana dealing up to 7 damage.
*/
@Test
public void testDamageFromInstantToPlayer() {
// If an opponent drew three or more cards this turn, you may pay {R} rather than pay Runeflare Trap's mana cost.
// Runeflare Trap deals damage to target player equal to the number of cards in that player's hand.
addCard(Zone.HAND, playerB, "Runeflare Trap");
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Runeflare Trap", playerA);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertHandCount(playerB, "Runeflare Trap", 1);
}
}

View file

@ -5,7 +5,7 @@
<parent>
<artifactId>mage-root</artifactId>
<groupId>org.mage</groupId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
</parent>
<artifactId>mage</artifactId>

View file

@ -24,15 +24,13 @@
* 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.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
/**
* Checks if permanent was paid tribute to as it entered the battlefield
*
@ -42,7 +40,8 @@ public class TributeNotPaidCondition implements Condition {
private static TributeNotPaidCondition fInstance = null;
private TributeNotPaidCondition() {}
private TributeNotPaidCondition() {
}
public static Condition getInstance() {
if (fInstance == null) {
@ -53,9 +52,9 @@ public class TributeNotPaidCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Object tribute = game.getState().getValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString());
Object tribute = game.getState().getValue("tributeValue" + source.getSourceId());
if (tribute != null) {
return ((String)tribute).equals("no");
return ((String) tribute).equals("no");
}
return false;
}

View file

@ -36,7 +36,6 @@ import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import mage.filter.FilterCard;
@ -110,7 +109,7 @@ public class CardsImpl extends LinkedHashSet<UUID> implements Cards, Serializabl
@Override
public Card getRandom(Game game) {
if (this.size() == 0) {
if (this.isEmpty()) {
return null;
}
UUID[] cards = this.toArray(new UUID[this.size()]);

View file

@ -38,13 +38,13 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import mage.cards.Card;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.util.RandomUtil;
/**
*
@ -52,6 +52,7 @@ import mage.util.RandomUtil;
*/
public class Library implements Serializable {
private static Random rnd = new Random();
private boolean emptyDraw;
private final Deque<UUID> library = new ArrayDeque<>();
private final UUID playerId;
@ -74,7 +75,7 @@ public class Library implements Serializable {
public void shuffle() {
UUID[] shuffled = library.toArray(new UUID[0]);
for (int n = shuffled.length - 1; n > 0; n--) {
int r = RandomUtil.nextInt(n);
int r = rnd.nextInt(n);
UUID temp = shuffled[n];
shuffled[n] = shuffled[r];
shuffled[r] = temp;

View file

@ -8,17 +8,17 @@ import java.util.concurrent.ThreadLocalRandom;
*/
public class RandomUtil {
private static ThreadLocalRandom random = ThreadLocalRandom.current();
private final static ThreadLocalRandom random = ThreadLocalRandom.current();
public static Random getRandom(){
public static Random getRandom() {
return random;
}
public static int nextInt(){
public static int nextInt() {
return random.nextInt();
}
public static int nextInt(int max){
public static int nextInt(int max) {
return random.nextInt(max);
}

View file

@ -29655,10 +29655,12 @@ Thirsting Axe|Eldritch Moon|202|U|{3}|Artifact - Equipment|||Equipped creature g
Geier Reach Sanitarium|Eldritch Moon|203|R||Legendary Land|||{T}: Add {C} to your mana pool.${2}, {T}: Each player draws a card, then discards a card.|
Hanweir Battlements|Eldritch Moon|204|R||Land|||{T}: Add {C} to your mana pool.${R},{T}: Target creature gains haste until end of turn.${3}{R}{R},{T}: If you both own and control Hanweir Battlements and a creature named Hanweir Garrison, exile them, then meld them into Hanweir, the Writhing Township.|
Nephalia Academy|Eldritch Moon|205|U||Land|||If a spell or ability an opponent controls causes you to discard a card, you may reveal that card and put it on top of your library instead of putting it anywhere else.${T}: Add {C} to your mana pool.|
Acrobatic Maneuver|Kaladesh|1|C|{2}{W}|Instant|||Exile target creature you control, then return that card to the battlefield under its owner's control.$Draw a card.|
Aerial Responder|Kaladesh|2|U|{1}{W}{W}|Creature - Dwarf Soldier|2|3|Flying, vigilance, lifelink|
Aetherstorm Roc|Kaladesh|3|R|{2}{W}{W}|Creature - Bird|3|3|Flying$Whenever Aetherstorm Roc or another creature enters the battlefield under your control, you get {E} <i>(an energy counter)</i>.$Whenever Aetherstorm Roc attacks, you may pay {E}{E}. If you do, put a +1/+1 creature on it and tap up to one target creature defending player controls.|
Angel of Invention|Kaladesh|4|M|{3}{W}{W}|Creature - Angel|2|1|Flying, vigilance, lifelink$Fabricate 2 <i>(When this creature enters the battlefield, put two +1/+1 counters on it or create two 1/1 colorless Servo artifact creature tokens.)</i>$Other creatures you control get +1/+1.|
Cataclysmic Gearhulk|Kaladesh|9|M|{3}{W}{W}|Artifact Creature - Construct|4|5|Vigilance$When Cataclysmic Gearhulk enters the battlefield, each player chooses from among the non-land permanents he or she controls an artifact, a creature, an enchantment, and a planeswalker, then sacrifices the rest.|
Fragmentize|Kaladesh|14|C|{W}|Sorcery|||Destroy target artifact or enchantment with converted mana cost 4 or less.|
Glint-Sleeve Artisan|Kaladesh|17|C|{2}{W}|Creature - Dwarf Artificer|2|2|Fabricate 1 <i>(When this creature enters the battlefield, put a +1/+1 counter on it or create a 1/1 colorless Servo artifact creature token.)</i>|
Master Trinketcrafter|Kaladesh|21|R|{2}{W}|Creature - Dwarf Artificer|3|2|Servo and Thopter creatures you control get +1/+1.${3}{W}: Create a 1/1 colorless Servo artifact creature token.|
Propeller Pioneer|Kaladesh|24|C|{3}{W}|Creature - Human Artificer|2|1|Flying$Fabricate 1 <i>(When this creature enters the battlefield, put a +1/+1 counter on it or create a 1/1 colorless Servo artifact creature token.)</i>|
@ -29681,6 +29683,7 @@ Fortuitous Find|Kaladesh|81|C|{2}{B}|Sorcery|||Choose one or both &mdash; Return
Gonti, Lord of Luxury|Kaladesh|84|R|{2}{B}{B}|Legendary Creature - Aetherborn Rogue|2|3|Deathtouch$When Gonti, Lord of Luxury enters the battlefield, look at the top four cards of target opponent's library, exile one of them face down, then put the rest on the bottom of that library in a random order. For as long as that card remains exiled, you may look at it, you may cast it, and you may spend mana as though it were mana of any type to cast it.|
Live Fast|Kaladesh|87|C|{2}{B}|Sorcery|||You draw two cards, lose 2 life, and gain {E}{E} <i>(two energy counters)</i>.|
Lost Legacy|Kaladesh|88|R|{1}{B}{B}|Sorcery|||Name a nonartifact, nonland card. Search target player's graveyard, hand, and library for any number of cards with that name and exile them. That player shuffles his or her library, then draws a card for each card exiled from hand this way.|
Midnight Oil|Kaladesh|92|{R}|{2}{B}{B}|Enchantment|||Midnight Oil enters the battlefield with seven time counters on it.$At the beginning of your draw step, draw an additional card, then remove two time counters from Midnight Oil.$Your maximum hand size is equal to the number of time counters on Midnight Oil.$Whenever you discard a card, you lose 1 life.|
Morbid Curiosity|Kaladesh|94|U|{1}{B}{B}|Sorcery|||As an additional cost to cast Morbid Curiosity, sacrifice an artifact or creature.$Draw cards equal to the converted mana cost of the sacrificed permanent.|
Noxious Gearhulk|Kaladesh|96|M|{4}{B}{B}|Artifact Creature - Construct|5|4|Menace$When Noxious Gearhulk enters the battlefield, you may destroy another target creature. If a creature is destroyed this way, you gain life equal to its toughness.|
Ovalchase Daredevil|Kaladesh|97|U|{3}{B}|Creature - Human Pilot|4|2|Whenever an artifact enters the battlefield under your control, you may return Ovalchase Daredevil from your graveyard to your hand.|
@ -29698,11 +29701,13 @@ Start Your Engines|Kaladesh|135|U|{3}{R}|Sorcery|||Vehicles you control becomes
Territorial Devourer|Kaladesh|136|R|{3}{R}|Creature - Gremlin|2|2|Trample $Whenever you gain one or more {E} <i>(energy counters)</i>, Territorial Devourer gets +2/+2 until end of turn.|
Terror of the Fairgrounds|Kaladesh|137|C|{3}{R}|Creature - Gremlin|5|2||
Thriving Grubs|Kaladesh|138|C|{1}{R}|Creature - Gremlin|2|1|When Thriving Grubs enters the battlefield, you get {E}{E} <i>(two energy counters)</i>.$Whenever Thriving Grubs attacks, you may pay {E}{E}. If you do, put a +1/+1 counter on it.|
Welding Sparks|Kaladesh|140|C|{2}{R}|Instant|||Welding Sparks deals X damage to target creature, where X is 3 plus the number of artifacts you control.|
Arborback Stomper|Kaladesh|142|U|{3}{G}{G}|Creature - Beast|5|4|Trample$When Arborback Stomper enters the battlefield, you gain 5 life.|
Architect of the Untamed|Kaladesh|143|R|{2}{G}|Creature - Elf Artificer Druid|2|3|Whenever a land enters the battlefiend under your control, you get {E} <i>(an energy counter)</i>.$Pay {E}{E}{E}{E}{E}{E}{E}{E}: Create a 6/6 colorless Beast artifact creature token.|
Armorcraft Judge|Kaladesh|144|U|{3}{G}|Creature - Elf Artificer|3|3|When Armorcraft Judge enters the battlefield, draw a card for each creature you control with a +1/+1 counter on it.|
Bristling Hydra|Kaladesh|147|R|{2}{G}{G}|Creature - Hydra|4|3|When Bristling Hydra enters the battlefield, you get {E}{E}{E} <i>(three energy counters)</i>.$Pay {E}{E}{E}: Put a +1/+1 count on Bristling Hydra. It gains hexproof until end of turn.|
Cultivator of Blades|Kaladesh|151|R|{3}{G}{G}|Creature - Elf Artificer|1|1|Fabricate 2$Whenever Cultivator of Blades attacks, you may have other attacking creatures get +X/+X until end of turn, where X is Cultivator of Blades's power.|
Dubious Challenge|Kaladesh|152|R|{3}{G}|Sorcery|||Look at the top ten cards of your library, exile up to two creature cards from among them, then shuffle your library. Target opponent may choose one of the exiled cards and put it onto the battlefield under his or her control. Put the rest onto the battlefield under your control.|
Ghirapur Guide|Kaladesh|156|U|{2}{G}|Creature - Elf Scout|3|2|{2}{G}: Target creature you control can't be blocked by creatures with power 2 or less this turn.|
Larger Than Life|Kaladesh|160|C|{1}{G}|Sorcery|||Target creature gets +4/+4 and gains trample until end of turn.|
Longtusk Cub|Kaladesh|161|U|{1}{G}|Creature - Cat|2|2|Whenever Longtusk Cub deals combat damage to a player, you get {E}{E} <i>(two energy counters)</i>.$Pay {E}{E}: Put a +1/+1 counter on Longtusk Cub.|
@ -29710,10 +29715,12 @@ Nissa, Vital Force|Kaladesh|163|M|{3}{G}{G}|Planeswalker - Nissa|||+1: Untap tar
Thriving Rhino|Kaladesh|171|C|{2}{G}|Creature - Rhino|2|3|When Thriving Rhino enters the battlefield, you get {E}{E} <i>(two energy counters)</i>.$Whenever Thriving Rhino attacks, you may pay {E}{E}. If you do, put a +1/+1 counter on it.|
Verdurous Gearhulk|Kaladesh|172|M|{3}{G}{G}|Artifact Creature - Construct|4|4|Trample$When Verdurous Gearhulk enters the battlefield, distribute four +1/+1 counters among any number of target creatures you control.|
Wildest Dreams|Kaladesh|174|R|{X}{X}{G}|Sorcery|||Return X target cards from your graveyard to your hand.$Exile Wildest Dreams.|
Cloudblazer|Kaladesh|176|U|{3}{W}{U}|Creature - Human Scout|2|2|Flying$When Cloudblazer enters the battlefield, you gain 2 life and draw two cards.|
Depala, Pilot Exemplar|Kaladesh|178|R|{1}{R}{W}|Legendary Creature - Dwarf Pilot|3|3|Other Dwarves you control get +1/+1.$Each Vehicle you control gets +1/+1 as long as it's a creature.$Whenever Depala, Pilot Exemplar becomes tapped, you may pay {X}. If you do, reveal the top X cards of your library, put all Dwarf and Vehicle cards from among them into your hand, then put the rest on the bottom of your library in a random order.|
Kambal, Consul of Allocation|Kaladesh|183|R|{1}{W}{B}|Legendary Creature - Human Advisor|2|3|Whenever an opponent casts a noncreature spell, that player loses 2 life and you gain 2 life.|
Rashmi, Eternities Crafter|Kaladesh|184|M|{2}{G}{U}|Legendary Creature - Elf Druid|2|3|Whenever you cast your first spell each turn, reveal the top card of your library. If it's a nonland card with converted mana cost less than that spell's, you may cast it without paying its mana cost. If you don't cast the revealed card, put it into your hand. |
Saheeli Rai|Kaladesh|186|M|{1}{U}{R}|Planeswalker - Saheeli|3|+1: Scry 1. Saheeli Rai deals 1 damage to each opponent.$-2: Create a token that's a copy of target artifact or creature you control, except it's an artifact in addition to its other types. That token gains haste. Exile it at the beginning of the next end step.$-7: Search your library for up to three artifact cards with different names, put them onto the battlefield, then shuffle your library.|
Unlicensed Disintegration|Kaladesh|187|U|{1}{B}{R}|Instant|||Destroy target creature. If you control an artifact, Unlicensed Disintegration deals 3 damage to that creature's controller.|
Voltaic Brawler|Kaladesh|189|U|{R}{G}|Creature - Human Warrior|3|2|When Voltaic Brawler enters the battlefield, you get {E}{E} <i>(two energy counters)</i>.$Whenever Voltaic Brawler attacks, you may pay {E}. If you do, it gets +1/+1 and gains trample until end of turn.|
Aetherflux Reservoir|Kaladesh|192|R|{4}|Artifact|||Whenever you cast a spell, you gain 1 life for each spell you've cast this turn.$Pay 50 life: Aetherflux Reservoir deals 50 damage to target creature or player.|
Aetherworks Marvel|Kaladesh|193|M|{4}|Legendary Artifact|||Whenever a permanent you control is put into a graveyard, you get {E} <i>(an energy counter)</i>.${T}, Pay {E}{E}{E}{E}{E}{E}: Look at the top six cards of your library. You may cast a card from among them without paying its mana cost. Put the rest on the bottom of your library in a random order.|
@ -29723,6 +29730,7 @@ Cogworker's Puzzleknot|Kaladesh|201|C|{2}|Artifact|||When Cogworker's Puzzleknot
Cultivator's Caravan|Kaladesh|203|R|{3}|Artifact - Vehicle|5|5|{T}: Add one mana of any color to your mana pool.$Crew 3 <i>(Tap any number of creatures you control with total power 3 or more: This Vehicle becomes an artifact creature until end of turn.)</i>|
Decoction Module|Kaladesh|205|U|{2}|Artifact|||Whenever a creature enters the battlefield under your control, you get {E} <i>(an energy counter)</i>.${4}, {T}: Return target creature you control to its owner's hand.|
Demolition Stomper|Kaladesh|206|U|{6}|Artifact - Vehicle|10|7|Demolition Stomper can't be blocked by creature with power 2 or less.$Crew 5 <i>(Tap any number of creatures you control with total power 5 or more: This Vehicle becomes an artifact creature until end of turn.)</i>|
Dynavolt Tower|Kaladesh|208|R|{3}|Artifact|||Whenever you cast an instant or sorcery spell, you get {E}{E} <i>(two energy counters)</i>.${T}, Pay {E}{E}{E}{E}{E}: Dynavolt Tower deals 3 damage to target creature or player.|
Fabrication Module|Kaladesh|211|U|{3}|Artifact|||Whenever you get one or more {E} <i>(energy counters)</i>, put a +1/+1 counter on target creature you control.${4}, {T}: You get {E}.|
Filigree Familiar|Kaladesh|212|U|{3}|Artifact Creature - Fox|2|2|When Filigree Familiar enters the battlefield, you gain 2 life.$When Filigree Familiar dies, draw a card.|
Fireforger's Puzzleknot|Kaladesh|213|C|{2}|Artifact|||When Fireforger's Puzzleknot enters the battlefield, it deals 1 damage to target creature or player.${2}{R}, Sacrifice Fireforger's Puzzleknot: It deals 1 damage to target creature or player.|
@ -29736,6 +29744,7 @@ Ovalchase Dragster|Kaladesh|225|U|{4}|Artifact - Vehicle|6|1|Trample, haste$Crew
Panharmonicon|Kaladesh|226|R|{4}|Artifact|||If an artifact or creature entering the battlefield causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time.|
Sky Skiff|Kaladesh|233|C|{2}|Artifact - Vehicle|2|3|Flying$Crew 1 <i>(Tap any number of creatures you control with total power 1 or more: This Vehicle becomes an artifact creature until end of turn.)</i>|
Skysovereign, Consul Flagship|Kaladesh|234|M|{5}|Legendary Artifact - Vehicle|6|5|Flying$Whenever Skysovereign, Consul Flagship enters the battlefield or attacks, it deals 3 damage to target creature or planeswalker an opponent controls.$Crew 3 <i>(Tap any number of creatures you control with total power 3 or more: This Vehicle becomes an artifact creature until end of turn.)</i>|
Smuggler's Copter|Kaladesh|235|R|{2}|Artifact - Vehicle|3|3|Flying$Whenever Smuggler's Copter attacks or blocks, you may draw a card. If you do, discard a card.$Crew 1 <i>(Tap any number of creatures you control with total power 1 or more: This Vehicle becomes an artifact creature until end of turn.)</i>|
Whirlermaker|Kaladesh|239|U|{3}|Artifact|||{4}, {T}: Create a 1/1 colorless Thopter artifact creature token with flying.|
Woodweaver's Puzzleknot|Kaladesh|240|C|{2}|Artifact|||When Woodweaver's Puzzleknot enters the battlefield, you gain 3 life and get {E}{E}{E} <i>(three energy counters)</i>.${2}{G}, Sacrifice Woodweaver's Puzzleknot: You gain 3 life and get {E}{E}{E}.|
Aether Hub|Kaladesh|242|U||Land|||When Aether Hub enters the battlefield, you get {E} <i>(an energy counter)</i>.${T}: Add {C} to your mana pool.${T}, Pay {E}: Add one mana of any color to your mana pool.|

View file

@ -93,6 +93,12 @@ git log 80f4ab770b78b7a7211490ff961ee90998bdc01c..head --diff-filter=A --name-st
since 1.4.13v3
git log 7c2eaf9510b1b49fecc28f5c8e68d5377c7a7e3e..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
since 1.4.14v0
git log 7c2eaf9510b1b49fecc28f5c8e68d5377c7a7e3e..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
since 1.4.15v0
git log 79f8617cd3c997d89770094d7a44294b0a48731f..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
3. Copy added_cards.txt to trunk\Utils folder
4. Run script:
> perl extract_in_wiki_format.perl

View file

@ -6,7 +6,7 @@
<groupId>org.mage</groupId>
<artifactId>mage-root</artifactId>
<version>1.4.14</version>
<version>1.4.15</version>
<packaging>pom</packaging>
<name>Mage Root</name>
<description>Mage Root POM</description>
@ -83,7 +83,7 @@
</repositories>
<properties>
<mage-version>1.4.14</mage-version>
<mage-version>1.4.15</mage-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>