mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
[C13] Added 13 cards.
This commit is contained in:
parent
0ae4c7e455
commit
479a6afe09
32 changed files with 1831 additions and 37 deletions
|
|
@ -65,7 +65,7 @@ public class CopyTargetSpellEffect extends OneShotEffect<CopyTargetSpellEffect>
|
|||
if (activateMessage.startsWith(" casts ")) {
|
||||
activateMessage = activateMessage.substring(6);
|
||||
}
|
||||
game.informPlayers(player.getName() + " copies " + activateMessage);;
|
||||
game.informPlayers(player.getName() + " copies " + activateMessage);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -29,9 +29,11 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Outcome;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
|
@ -42,12 +44,17 @@ import mage.util.CardUtil;
|
|||
*/
|
||||
public class DrawCardAllEffect extends OneShotEffect<DrawCardAllEffect> {
|
||||
|
||||
protected int amount;
|
||||
protected DynamicValue amount;
|
||||
|
||||
public DrawCardAllEffect(int amount) {
|
||||
this(new StaticValue(amount));
|
||||
|
||||
}
|
||||
|
||||
public DrawCardAllEffect(DynamicValue amount) {
|
||||
super(Outcome.DrawCard);
|
||||
this.amount = amount;
|
||||
staticText = "Each player draws " + CardUtil.numberToText(amount) + " card" + (amount == 1?"":"s");
|
||||
staticText = "Each player draws " + CardUtil.numberToText(amount.toString()) + " card" + (amount.toString().equals("1")?"":"s");
|
||||
}
|
||||
|
||||
public DrawCardAllEffect(final DrawCardAllEffect effect) {
|
||||
|
|
@ -66,8 +73,9 @@ public class DrawCardAllEffect extends OneShotEffect<DrawCardAllEffect> {
|
|||
Player sourcePlayer = game.getPlayer(source.getControllerId());
|
||||
for (UUID playerId: sourcePlayer.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null)
|
||||
player.drawCards(amount, game);
|
||||
if (player != null) {
|
||||
player.drawCards(amount.calculate(game, source), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,18 +29,20 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import static mage.constants.Zone.BATTLEFIELD;
|
||||
import static mage.constants.Zone.EXILED;
|
||||
import static mage.constants.Zone.GRAVEYARD;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
|
|
@ -67,7 +69,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect<ReturnToHandTargetEf
|
|||
case BATTLEFIELD:
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
permanent.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
permanent.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
} else {
|
||||
result = false;
|
||||
}
|
||||
|
|
@ -75,7 +77,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect<ReturnToHandTargetEf
|
|||
case GRAVEYARD:
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
} else {
|
||||
result = false;
|
||||
}
|
||||
|
|
@ -83,7 +85,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect<ReturnToHandTargetEf
|
|||
case EXILED:
|
||||
card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
} else {
|
||||
result = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,24 +92,27 @@ public class MaximumHandSizeControllerEffect extends ContinuousEffectImpl<Maximu
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
switch(targetController) {
|
||||
case ANY:
|
||||
for (UUID playerId: controller.getInRange()) {
|
||||
setHandSize(game, playerId);
|
||||
}
|
||||
break;
|
||||
case OPPONENT:
|
||||
for (UUID playerId: game.getOpponents(source.getControllerId())) {
|
||||
setHandSize(game, playerId);
|
||||
}
|
||||
break;
|
||||
case YOU:
|
||||
setHandSize(game, source.getControllerId());
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
if (controller != null) {
|
||||
switch(targetController) {
|
||||
case ANY:
|
||||
for (UUID playerId: controller.getInRange()) {
|
||||
setHandSize(game, playerId);
|
||||
}
|
||||
break;
|
||||
case OPPONENT:
|
||||
for (UUID playerId: game.getOpponents(source.getControllerId())) {
|
||||
setHandSize(game, playerId);
|
||||
}
|
||||
break;
|
||||
case YOU:
|
||||
setHandSize(game, source.getControllerId());
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private void setHandSize(Game game, UUID playerId) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import mage.counters.common.ChargeCounter;
|
|||
import mage.counters.common.DespairCounter;
|
||||
import mage.counters.common.DevotionCounter;
|
||||
import mage.counters.common.DivinityCounter;
|
||||
import mage.counters.common.DoomCounter;
|
||||
import mage.counters.common.ElixirCounter;
|
||||
import mage.counters.common.EonCounter;
|
||||
import mage.counters.common.EyeballCounter;
|
||||
|
|
@ -88,6 +89,7 @@ public enum CounterType {
|
|||
DESPAIR(new DespairCounter().name),
|
||||
DEVOTION(new DevotionCounter().name),
|
||||
DIVINITY(new DivinityCounter().name),
|
||||
DOOM(new DoomCounter().name),
|
||||
ELIXIR(new ElixirCounter().name),
|
||||
EON(new EonCounter().name),
|
||||
EYEBALL(new EyeballCounter().name),
|
||||
|
|
@ -164,6 +166,8 @@ public enum CounterType {
|
|||
return new PoisonCounter(amount);
|
||||
case CHARGE:
|
||||
return new ChargeCounter(amount);
|
||||
case DOOM:
|
||||
return new DoomCounter(amount);
|
||||
case LORE:
|
||||
return new LoreCounter(amount);
|
||||
case LOYALTY:
|
||||
|
|
|
|||
49
Mage/src/mage/counters/common/DoomCounter.java
Normal file
49
Mage/src/mage/counters/common/DoomCounter.java
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* 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.counters.common;
|
||||
|
||||
import mage.counters.Counter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class DoomCounter extends Counter<DoomCounter> {
|
||||
|
||||
public DoomCounter() {
|
||||
this(1);
|
||||
}
|
||||
|
||||
public DoomCounter(int amount) {
|
||||
super("doom");
|
||||
this.count = amount;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue