mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Merge branch 'master' of https://github.com/magefree/mage
This commit is contained in:
commit
fd4c032414
8 changed files with 497 additions and 18 deletions
|
@ -192,7 +192,6 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
public void update(TournamentView tournament) {
|
||||
|
||||
if (!firstInitDone) {
|
||||
Component c = this.getParent();
|
||||
while (c != null && !(c instanceof TournamentPane)) {
|
||||
|
@ -689,7 +688,7 @@ class UpdateTournamentTask extends SwingWorker<Void, TournamentView> {
|
|||
|
||||
@Override
|
||||
protected void process(List<TournamentView> view) {
|
||||
if (view != null) { // if user disconnects, view can be null for a short time
|
||||
if (view != null && view.size() > 0) { // if user disconnects, view can be null for a short time
|
||||
panel.update(view.get(0));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import mage.cards.decks.Deck;
|
||||
import mage.constants.ManaType;
|
||||
import mage.game.Table;
|
||||
import mage.game.tournament.TournamentPlayer;
|
||||
import mage.interfaces.callback.ClientCallback;
|
||||
import mage.players.net.UserData;
|
||||
import mage.server.draft.DraftSession;
|
||||
|
@ -73,7 +74,7 @@ public class User {
|
|||
private final Map<UUID, TournamentSession> constructing;
|
||||
private final Map<UUID, Deck> sideboarding;
|
||||
private final List<UUID> watchedGames;
|
||||
|
||||
private final ArrayList<UUID> tablesToRemove = new ArrayList<>();
|
||||
private String sessionId;
|
||||
private String info;
|
||||
private Date lastActivity;
|
||||
|
@ -365,28 +366,37 @@ public class User {
|
|||
disconnectInfo = new StringBuilder(" (discon. ").append(getDisconnectDuration()).append(")").toString();
|
||||
}
|
||||
int draft = 0, match = 0, sideboard = 0, tournament = 0, construct = 0;
|
||||
|
||||
for (Map.Entry<UUID, Table> tableEntry : tables.entrySet()) {
|
||||
if (tableEntry != null) {
|
||||
Table table = tableEntry.getValue();
|
||||
if (table != null) {
|
||||
if (table.isTournament()) {
|
||||
if (!table.getTournament().getPlayer(tableEntry.getKey()).isEliminated()) {
|
||||
switch (table.getState()) {
|
||||
case CONSTRUCTING:
|
||||
construct++;
|
||||
break;
|
||||
case DRAFTING:
|
||||
draft++;
|
||||
break;
|
||||
case DUELING:
|
||||
tournament++;
|
||||
break;
|
||||
}
|
||||
if (!isConnected()) {
|
||||
table.getTournament().getPlayer(tableEntry.getKey()).setDisconnectInfo(disconnectInfo);
|
||||
if (tableEntry.getKey() != null) {
|
||||
TournamentPlayer tournamentPlayer = table.getTournament().getPlayer(tableEntry.getKey());
|
||||
if (tournamentPlayer != null && !tournamentPlayer.isEliminated()) {
|
||||
switch (table.getState()) {
|
||||
case CONSTRUCTING:
|
||||
construct++;
|
||||
break;
|
||||
case DRAFTING:
|
||||
draft++;
|
||||
break;
|
||||
case DUELING:
|
||||
tournament++;
|
||||
break;
|
||||
}
|
||||
if (!isConnected()) {
|
||||
table.getTournament().getPlayer(tableEntry.getKey()).setDisconnectInfo(disconnectInfo);
|
||||
} else {
|
||||
table.getTournament().getPlayer(tableEntry.getKey()).setDisconnectInfo("");
|
||||
}
|
||||
} else {
|
||||
table.getTournament().getPlayer(tableEntry.getKey()).setDisconnectInfo("");
|
||||
tablesToRemove.add(tableEntry.getKey());
|
||||
logger.error(getName() + " tournament player missing - tournamentId:" + table.getId(), null);
|
||||
}
|
||||
} else {
|
||||
logger.error(getName() + " tournament key missing - tournamentId: " + table.getId(), null);
|
||||
}
|
||||
} else {
|
||||
switch (table.getState()) {
|
||||
|
@ -401,6 +411,12 @@ public class User {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!tablesToRemove.isEmpty()) {
|
||||
for (UUID tableKey : tablesToRemove) {
|
||||
tables.remove(tableKey);
|
||||
}
|
||||
tablesToRemove.clear();
|
||||
}
|
||||
if (match > 0) {
|
||||
sb.append("Match: ").append(match).append(" ");
|
||||
}
|
||||
|
|
80
Mage.Sets/src/mage/sets/judgment/SolitaryConfinement.java
Normal file
80
Mage.Sets/src/mage/sets/judgment/SolitaryConfinement.java
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 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.judgment;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.DiscardTargetCost;
|
||||
import mage.abilities.effects.common.PreventAllDamageToControllerEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
|
||||
import mage.abilities.effects.common.SkipDrawStepEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityControllerEffect;
|
||||
import mage.abilities.keyword.ShroudAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public class SolitaryConfinement extends CardImpl {
|
||||
|
||||
public SolitaryConfinement(UUID ownerId) {
|
||||
super(ownerId, 24, "Solitary Confinement", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||
this.expansionSetCode = "JUD";
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
// At the beginning of your upkeep, sacrifice Solitary Confinement unless you discard a card.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand())), TargetController.YOU, false));
|
||||
|
||||
// Skip your draw step.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect()));
|
||||
|
||||
// You have shroud.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControllerEffect(ShroudAbility.getInstance())));
|
||||
|
||||
// Prevent all damage that would be dealt to you.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventAllDamageToControllerEffect(Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
public SolitaryConfinement(final SolitaryConfinement card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SolitaryConfinement copy() {
|
||||
return new SolitaryConfinement(this);
|
||||
}
|
||||
}
|
121
Mage.Sets/src/mage/sets/onslaught/WordsOfWar.java
Normal file
121
Mage.Sets/src/mage/sets/onslaught/WordsOfWar.java
Normal file
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* 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.onslaught;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public class WordsOfWar extends CardImpl {
|
||||
|
||||
public WordsOfWar(UUID ownerId) {
|
||||
super(ownerId, 244, "Words of War", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
|
||||
this.expansionSetCode = "ONS";
|
||||
|
||||
this.color.setRed(true);
|
||||
|
||||
// {1}: The next time you would draw a card this turn, Words of War deals 2 damage to target creature or player instead.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new WordsOfWarEffect(), new GenericManaCost(1));
|
||||
ability.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public WordsOfWar(final WordsOfWar card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WordsOfWar copy() {
|
||||
return new WordsOfWar(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WordsOfWarEffect extends ReplacementEffectImpl {
|
||||
|
||||
WordsOfWarEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.Damage);
|
||||
staticText = "The next time you would draw a card this turn, Words of War deals 2 damage to target creature or player instead.";
|
||||
}
|
||||
|
||||
WordsOfWarEffect(final WordsOfWarEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WordsOfWarEffect copy() {
|
||||
return new WordsOfWarEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
player.damage(2, source.getSourceId(), game, false, true);
|
||||
used = true;
|
||||
return true;
|
||||
}
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.damage(2, source.getSourceId(), game, false, true);
|
||||
used = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return event.getType() == EventType.DRAW_CARD && source.getControllerId().equals(event.getPlayerId()) && used == false;
|
||||
}
|
||||
}
|
62
Mage.Sets/src/mage/sets/tempest/MirrisGuile.java
Normal file
62
Mage.Sets/src/mage/sets/tempest/MirrisGuile.java
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* 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.UUID;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.common.LookLibraryControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public class MirrisGuile extends CardImpl {
|
||||
|
||||
public MirrisGuile(UUID ownerId) {
|
||||
super(ownerId, 130, "Mirri's Guile", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}");
|
||||
this.expansionSetCode = "TMP";
|
||||
|
||||
this.color.setGreen(true);
|
||||
|
||||
// At the beginning of your upkeep, you may look at the top three cards of your library, then put them back in any order.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LookLibraryControllerEffect(3), TargetController.YOU, true));
|
||||
}
|
||||
|
||||
public MirrisGuile(final MirrisGuile card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MirrisGuile copy() {
|
||||
return new MirrisGuile(this);
|
||||
}
|
||||
}
|
104
Mage.Sets/src/mage/sets/urzasdestiny/Replenish.java
Normal file
104
Mage.Sets/src/mage/sets/urzasdestiny/Replenish.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* 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.urzasdestiny;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public class Replenish extends CardImpl {
|
||||
|
||||
public Replenish(UUID ownerId) {
|
||||
super(ownerId, 15, "Replenish", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}");
|
||||
this.expansionSetCode = "UDS";
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Return all enchantment cards from your graveyard to the battlefield.
|
||||
this.getSpellAbility().addEffect(new ReplenishEffect());
|
||||
}
|
||||
|
||||
public Replenish(final Replenish card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Replenish copy() {
|
||||
return new Replenish(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ReplenishEffect extends OneShotEffect {
|
||||
|
||||
ReplenishEffect() {
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.staticText = "Return all enchantment cards from your graveyard to the battlefield";
|
||||
}
|
||||
|
||||
ReplenishEffect(final ReplenishEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReplenishEffect copy() {
|
||||
return new ReplenishEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
List<Card> cards = new ArrayList<>(0);
|
||||
for (UUID cardId : player.getGraveyard()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null && card.getCardType().contains(CardType.ENCHANTMENT)) {
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
for (Card card : cards) {
|
||||
player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
95
Mage.Sets/src/mage/sets/visions/CityOfSolitude.java
Normal file
95
Mage.Sets/src/mage/sets/visions/CityOfSolitude.java
Normal file
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* 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.visions;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public class CityOfSolitude extends CardImpl {
|
||||
|
||||
public CityOfSolitude(UUID ownerId) {
|
||||
super(ownerId, 52, "City of Solitude", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
|
||||
this.expansionSetCode = "VIS";
|
||||
|
||||
this.color.setGreen(true);
|
||||
|
||||
// Players can cast spells and activate abilities only during their own turns.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CityOfSolitudeEffect()));
|
||||
}
|
||||
|
||||
public CityOfSolitude(final CityOfSolitude card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CityOfSolitude copy() {
|
||||
return new CityOfSolitude(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CityOfSolitudeEffect extends ContinuousRuleModifiyingEffectImpl {
|
||||
|
||||
CityOfSolitudeEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = "Players can cast spells and activate abilities only during their own turns";
|
||||
}
|
||||
|
||||
CityOfSolitudeEffect(final CityOfSolitudeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return (event.getType() == EventType.CAST_SPELL || event.getType() == EventType.ACTIVATE_ABILITY) && !game.getActivePlayerId().equals(event.getPlayerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CityOfSolitudeEffect copy() {
|
||||
return new CityOfSolitudeEffect(this);
|
||||
}
|
||||
}
|
|
@ -45,6 +45,8 @@ since 1.3.0-2014-07-19
|
|||
git log 75eb0bdfdf36ba83dd5a3e2c6a204ceb186c9d5e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
|
||||
since 1.3.0-2014-07-30
|
||||
git log 69ce53e6e8036bf01bdd090e8785f4d63c486d1e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
|
||||
since 1.3.0-2014-08-11
|
||||
git log 709dc83ae6fd6778e5b52e5176a978f1c6fda3b7..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue