Some minor changes/formatting.

This commit is contained in:
LevelX2 2014-02-26 12:34:58 +01:00
parent fe2ff3cc35
commit 9b10da0551
12 changed files with 99 additions and 78 deletions

View file

@ -192,6 +192,10 @@
|Generate|TOK:M10|Wolf| |Generate|TOK:M10|Wolf|
|Generate|TOK:M10|Zombie| |Generate|TOK:M10|Zombie|
|Generate|TOK:DDD|Beast 1|
|Generate|TOK:DDD|Beast 2|
|Generate|TOK:DDD|Elephant|
|Generate|TOK:ARB|Bird Soldier| |Generate|TOK:ARB|Bird Soldier|
|Generate|TOK:ARB|Lizard| |Generate|TOK:ARB|Lizard|
|Generate|TOK:ARB|Dragon| |Generate|TOK:ARB|Dragon|

View file

@ -31,9 +31,7 @@ import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.ReturnToHandTargetCost; import mage.abilities.costs.common.ReturnToHandTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
@ -120,10 +118,7 @@ class FloodtideSerpentReplacementEffect extends ReplacementEffectImpl<FloodtideS
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && event.getSourceId().equals(source.getSourceId())) { return event.getType() == GameEvent.EventType.DECLARE_ATTACKER && event.getSourceId().equals(source.getSourceId());
return true;
}
return false;
} }
@Override @Override

View file

@ -68,11 +68,16 @@ public class SkeletalVampire extends CardImpl<SkeletalVampire> {
this.color.setBlack(true); this.color.setBlack(true);
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// When Skeletal Vampire enters the battlefield, put two 1/1 black Bat creature tokens with flying onto the battlefield.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new BatToken(), 2))); this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new BatToken(), 2)));
// {3}{B}{B}, Sacrifice a Bat: Put two 1/1 black Bat creature tokens with flying onto the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new BatToken(), 2), new ManaCostsImpl("{3}{B}{B}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new BatToken(), 2), new ManaCostsImpl("{3}{B}{B}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false))); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false)));
this.addAbility(ability); this.addAbility(ability);
// Sacrifice a Bat: Regenerate Skeletal Vampire.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false)))); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false))));
} }
@ -87,6 +92,7 @@ public class SkeletalVampire extends CardImpl<SkeletalVampire> {
} }
class BatToken extends Token { class BatToken extends Token {
BatToken() { BatToken() {
super("Bat", "1/1 black Bat creature token with flying"); super("Bat", "1/1 black Bat creature token with flying");
cardType.add(CardType.CREATURE); cardType.add(CardType.CREATURE);
@ -95,5 +101,7 @@ class BatToken extends Token {
power = new MageInt(1); power = new MageInt(1);
toughness = new MageInt(1); toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
this.setOriginalExpansionSetCode("MMA");
} }
} }

View file

@ -62,7 +62,7 @@ public class Enslave extends CardImpl<Enslave> {
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect()));
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new EnslaveEffect(), TargetController.YOU, false)); this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new EnslaveEffect(), TargetController.YOU, false, false));
} }
public Enslave (final Enslave card) { public Enslave (final Enslave card) {

View file

@ -77,6 +77,8 @@ class BeastToken_44 extends Token {
subtype.add("Beast"); subtype.add("Beast");
power = new MageInt(4); power = new MageInt(4);
toughness = new MageInt(4); toughness = new MageInt(4);
// to get an image for the token
this.setOriginalExpansionSetCode("ZEN");
} }
} }

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.abilities.costs; package mage.abilities.costs;
import java.util.Iterator; import java.util.Iterator;
@ -78,15 +77,15 @@ public class AlternativeCostSourceAbility extends StaticAbility<AlternativeCostS
} }
public AlternativeCostSourceAbility(final AlternativeCostSourceAbility ability) { public AlternativeCostSourceAbility(final AlternativeCostSourceAbility ability) {
super(ability); super(ability);
this.alternateCosts = ability.alternateCosts; this.alternateCosts = ability.alternateCosts;
this.condition = ability.condition; this.condition = ability.condition;
this.rule = ability.rule; this.rule = ability.rule;
} }
@Override @Override
public AlternativeCostSourceAbility copy() { public AlternativeCostSourceAbility copy() {
return new AlternativeCostSourceAbility(this); return new AlternativeCostSourceAbility(this);
} }
@Override @Override
@ -105,7 +104,7 @@ public class AlternativeCostSourceAbility extends StaticAbility<AlternativeCostS
if (player.chooseUse(Outcome.Detriment, "Pay alternative costs?", game)) { if (player.chooseUse(Outcome.Detriment, "Pay alternative costs?", game)) {
ability.getManaCostsToPay().clear(); ability.getManaCostsToPay().clear();
ability.getCosts().clear(); ability.getCosts().clear();
for (AlternativeCost2 alternateCost: alternateCosts) { for (AlternativeCost2 alternateCost : alternateCosts) {
alternateCost.activate(); alternateCost.activate();
for (Iterator it = ((Costs) alternateCost).iterator(); it.hasNext();) { for (Iterator it = ((Costs) alternateCost).iterator(); it.hasNext();) {
Cost cost = (Cost) it.next(); Cost cost = (Cost) it.next();
@ -124,8 +123,8 @@ public class AlternativeCostSourceAbility extends StaticAbility<AlternativeCostS
@Override @Override
public boolean isActivated() { public boolean isActivated() {
for (AlternativeCost2 cost: alternateCosts) { for (AlternativeCost2 cost : alternateCosts) {
if(cost.isActivated()) { if (cost.isActivated()) {
return true; return true;
} }
} }
@ -142,31 +141,36 @@ public class AlternativeCostSourceAbility extends StaticAbility<AlternativeCostS
if (rule != null) { if (rule != null) {
return rule; return rule;
} }
StringBuilder sb = new StringBuilder(); // If you control a Swamp, you may pay 4 life rather than pay Snuff Out's mana cost.
if (condition != null) { StringBuilder sb = new StringBuilder();
sb.append(condition.toString()); if (condition != null) {
sb.append(", rather than pay {source}'s mana cost, "); sb.append(condition.toString());
} else { if (alternateCosts.size() > 1) {
sb.append("You may "); sb.append(", rather than pay {source}'s mana cost, ");
} } else {
int numberCosts = 0; sb.append(", you may ");
String remarkText = ""; }
for (AlternativeCost2 alternativeCost: alternateCosts) { } else {
if (numberCosts == 0) { sb.append("You may ");
sb.append(alternativeCost.getText(false)); }
remarkText = alternativeCost.getReminderText(); int numberCosts = 0;
} else { String remarkText = "";
sb.append(" and ").append(alternativeCost.getText(true)); for (AlternativeCost2 alternativeCost : alternateCosts) {
} if (numberCosts == 0) {
++numberCosts; sb.append(alternativeCost.getText(false));
} remarkText = alternativeCost.getReminderText();
if (condition == null) { } else {
sb.append(" rather than pay {source}'s mana cost"); sb.append(" and ").append(alternativeCost.getText(true));
} }
sb.append("."); ++numberCosts;
if (numberCosts == 1 && remarkText != null) { }
if (condition == null || alternateCosts.size() == 1) {
sb.append(" rather than pay {source}'s mana cost");
}
sb.append(".");
if (numberCosts == 1 && remarkText != null) {
sb.append(" ").append(remarkText); sb.append(" ").append(remarkText);
} }
return sb.toString(); return sb.toString();
} }
} }

View file

@ -29,12 +29,13 @@
package mage.abilities.costs.common; package mage.abilities.costs.common;
import java.util.UUID; import java.util.UUID;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.costs.CostImpl; import mage.abilities.costs.CostImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
/** /**
@ -46,9 +47,9 @@ public class ReturnToHandTargetCost extends CostImpl<ReturnToHandTargetCost> {
public ReturnToHandTargetCost(TargetControlledPermanent target) { public ReturnToHandTargetCost(TargetControlledPermanent target) {
this.addTarget(target); this.addTarget(target);
if (target.getMaxNumberOfTargets() > 1 && target.getMaxNumberOfTargets() == target.getNumberOfTargets()) { if (target.getMaxNumberOfTargets() > 1 && target.getMaxNumberOfTargets() == target.getNumberOfTargets()) {
this.text = "return " + target.getMaxNumberOfTargets() + " " + target.getTargetName() + " you control to it's owner's hand"; this.text = new StringBuilder("return ").append(target.getMaxNumberOfTargets()).append(" ").append(target.getTargetName()).append(" you control to it's owner's hand").toString();
} else { } else {
this.text = "return " + target.getTargetName() + " you control to it's owner's hand"; this.text = new StringBuilder("return ").append(target.getTargetName()).append(" you control to it's owner's hand").toString();
} }
} }
@ -58,13 +59,16 @@ public class ReturnToHandTargetCost extends CostImpl<ReturnToHandTargetCost> {
@Override @Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
if (targets.choose(Outcome.ReturnToHand, controllerId, sourceId, game)) { Player controller = game.getPlayer(controllerId);
for (UUID targetId: targets.get(0).getTargets()) { if (controller != null) {
Permanent permanent = game.getPermanent(targetId); if (targets.choose(Outcome.ReturnToHand, controllerId, sourceId, game)) {
if (permanent == null) { for (UUID targetId: targets.get(0).getTargets()) {
return false; Permanent permanent = game.getPermanent(targetId);
if (permanent == null) {
return false;
}
paid |= controller.moveCardToHandWithInfo(permanent, sourceId, game, Zone.HAND);
} }
paid |= permanent.moveToZone(Zone.HAND, sourceId, game, false);
} }
} }
return paid; return paid;

View file

@ -114,7 +114,7 @@ public class SacrificeAllEffect extends OneShotEffect<SacrificeAllEffect> {
if (amount.toString().equals("X")) { if (amount.toString().equals("X")) {
sb.append(amount.toString()); sb.append(amount.toString());
} else { } else {
sb.append(CardUtil.numberToText(amount.toString())); sb.append(CardUtil.numberToText(amount.toString(), "a"));
} }
sb.append(" "); sb.append(" ");
sb.append(filter.getMessage()); sb.append(filter.getMessage());

View file

@ -38,12 +38,12 @@ import mage.counters.Counter;
public class ArrowheadCounter extends Counter<ArrowheadCounter> { public class ArrowheadCounter extends Counter<ArrowheadCounter> {
public ArrowheadCounter() { public ArrowheadCounter() {
super("Arrowhead"); super("arrowhead");
this.count = 1; this.count = 1;
} }
public ArrowheadCounter(int amount) { public ArrowheadCounter(int amount) {
super("Arrowhead"); super("arrowhead");
this.count = amount; this.count = amount;
} }
} }

View file

@ -146,7 +146,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
private static Random rnd = new Random(); private static Random rnd = new Random();
private transient Stack<Integer> savedStates = new Stack<Integer>();
private transient Object customData; private transient Object customData;
protected boolean simulation = false; protected boolean simulation = false;
@ -155,20 +155,22 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
protected transient TableEventSource tableEventSource = new TableEventSource(); protected transient TableEventSource tableEventSource = new TableEventSource();
protected transient PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); protected transient PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource();
protected Map<UUID, Card> gameCards = new HashMap<UUID, Card>(); protected Map<UUID, Card> gameCards = new HashMap<>();
protected Map<Zone,HashMap<UUID, MageObject>> lki = new EnumMap<Zone, HashMap<UUID, MageObject>>(Zone.class); protected Map<Zone,HashMap<UUID, MageObject>> lki = new EnumMap<>(Zone.class);
protected Map<Zone,HashMap<UUID, MageObject>> shortLivingLKI = new EnumMap<Zone, HashMap<UUID, MageObject>>(Zone.class); protected Map<Zone,HashMap<UUID, MageObject>> shortLivingLKI = new EnumMap<>(Zone.class);
protected GameState state; protected GameState state;
private transient Stack<Integer> savedStates = new Stack<>();
protected transient GameStates gameStates = new GameStates();
protected Date startTime; protected Date startTime;
protected Date endTime; protected Date endTime;
protected UUID startingPlayerId; protected UUID startingPlayerId;
protected UUID winnerId; protected UUID winnerId;
protected transient GameStates gameStates = new GameStates();
protected RangeOfInfluence range; protected RangeOfInfluence range;
protected int freeMulligans; protected int freeMulligans;
protected Map<UUID, Integer> usedFreeMulligans = new LinkedHashMap<UUID, Integer>(); protected Map<UUID, Integer> usedFreeMulligans = new LinkedHashMap<>();
protected MultiplayerAttackOption attackOption; protected MultiplayerAttackOption attackOption;
protected GameOptions gameOptions; protected GameOptions gameOptions;
protected String startMessage; protected String startMessage;

View file

@ -28,9 +28,9 @@
package mage.game.permanent.token; package mage.game.permanent.token;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.ObjectColor; import mage.ObjectColor;
import mage.constants.CardType;
/** /**
* *
@ -45,6 +45,8 @@ public class ElephantToken extends Token {
subtype.add("Elephant"); subtype.add("Elephant");
power = new MageInt(3); power = new MageInt(3);
toughness = new MageInt(3); toughness = new MageInt(3);
this.setOriginalExpansionSetCode("DDD");
} }
} }

View file

@ -1485,9 +1485,9 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
@Override @Override
public void leave() { public void leave() {
this.passed = true; this.passed = true;
this.abort();
this.loses = true; this.loses = true;
this.left = true; this.left = true;
this.abort();
//20100423 - 800.4a //20100423 - 800.4a
this.hand.clear(); this.hand.clear();
this.graveyard.clear(); this.graveyard.clear();