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|Zombie|
|Generate|TOK:DDD|Beast 1|
|Generate|TOK:DDD|Beast 2|
|Generate|TOK:DDD|Elephant|
|Generate|TOK:ARB|Bird Soldier|
|Generate|TOK:ARB|Lizard|
|Generate|TOK:ARB|Dragon|

View file

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

View file

@ -68,11 +68,16 @@ public class SkeletalVampire extends CardImpl<SkeletalVampire> {
this.color.setBlack(true);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Flying
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)));
// {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.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false)));
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))));
}
@ -87,6 +92,7 @@ public class SkeletalVampire extends CardImpl<SkeletalVampire> {
}
class BatToken extends Token {
BatToken() {
super("Bat", "1/1 black Bat creature token with flying");
cardType.add(CardType.CREATURE);
@ -95,5 +101,7 @@ class BatToken extends Token {
power = new MageInt(1);
toughness = new MageInt(1);
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());
this.addAbility(ability);
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) {

View file

@ -77,6 +77,8 @@ class BeastToken_44 extends Token {
subtype.add("Beast");
power = 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
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.costs;
import java.util.Iterator;
@ -142,10 +141,15 @@ public class AlternativeCostSourceAbility extends StaticAbility<AlternativeCostS
if (rule != null) {
return rule;
}
// If you control a Swamp, you may pay 4 life rather than pay Snuff Out's mana cost.
StringBuilder sb = new StringBuilder();
if (condition != null) {
sb.append(condition.toString());
if (alternateCosts.size() > 1) {
sb.append(", rather than pay {source}'s mana cost, ");
} else {
sb.append(", you may ");
}
} else {
sb.append("You may ");
}
@ -160,7 +164,7 @@ public class AlternativeCostSourceAbility extends StaticAbility<AlternativeCostS
}
++numberCosts;
}
if (condition == null) {
if (condition == null || alternateCosts.size() == 1) {
sb.append(" rather than pay {source}'s mana cost");
}
sb.append(".");

View file

@ -29,12 +29,13 @@
package mage.abilities.costs.common;
import java.util.UUID;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.costs.CostImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
/**
@ -46,9 +47,9 @@ public class ReturnToHandTargetCost extends CostImpl<ReturnToHandTargetCost> {
public ReturnToHandTargetCost(TargetControlledPermanent target) {
this.addTarget(target);
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 {
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
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
Player controller = game.getPlayer(controllerId);
if (controller != null) {
if (targets.choose(Outcome.ReturnToHand, controllerId, sourceId, game)) {
for (UUID targetId: targets.get(0).getTargets()) {
Permanent permanent = game.getPermanent(targetId);
if (permanent == null) {
return false;
}
paid |= permanent.moveToZone(Zone.HAND, sourceId, game, false);
paid |= controller.moveCardToHandWithInfo(permanent, sourceId, game, Zone.HAND);
}
}
}
return paid;

View file

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

View file

@ -38,12 +38,12 @@ import mage.counters.Counter;
public class ArrowheadCounter extends Counter<ArrowheadCounter> {
public ArrowheadCounter() {
super("Arrowhead");
super("arrowhead");
this.count = 1;
}
public ArrowheadCounter(int amount) {
super("Arrowhead");
super("arrowhead");
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 transient Stack<Integer> savedStates = new Stack<Integer>();
private transient Object customData;
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 PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource();
protected Map<UUID, Card> gameCards = new HashMap<UUID, Card>();
protected Map<Zone,HashMap<UUID, MageObject>> lki = new EnumMap<Zone, HashMap<UUID, MageObject>>(Zone.class);
protected Map<Zone,HashMap<UUID, MageObject>> shortLivingLKI = new EnumMap<Zone, HashMap<UUID, MageObject>>(Zone.class);
protected Map<UUID, Card> gameCards = new HashMap<>();
protected Map<Zone,HashMap<UUID, MageObject>> lki = new EnumMap<>(Zone.class);
protected Map<Zone,HashMap<UUID, MageObject>> shortLivingLKI = new EnumMap<>(Zone.class);
protected GameState state;
private transient Stack<Integer> savedStates = new Stack<>();
protected transient GameStates gameStates = new GameStates();
protected Date startTime;
protected Date endTime;
protected UUID startingPlayerId;
protected UUID winnerId;
protected transient GameStates gameStates = new GameStates();
protected RangeOfInfluence range;
protected int freeMulligans;
protected Map<UUID, Integer> usedFreeMulligans = new LinkedHashMap<UUID, Integer>();
protected Map<UUID, Integer> usedFreeMulligans = new LinkedHashMap<>();
protected MultiplayerAttackOption attackOption;
protected GameOptions gameOptions;
protected String startMessage;

View file

@ -28,9 +28,9 @@
package mage.game.permanent.token;
import mage.constants.CardType;
import mage.MageInt;
import mage.ObjectColor;
import mage.constants.CardType;
/**
*
@ -45,6 +45,8 @@ public class ElephantToken extends Token {
subtype.add("Elephant");
power = 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
public void leave() {
this.passed = true;
this.abort();
this.loses = true;
this.left = true;
this.abort();
//20100423 - 800.4a
this.hand.clear();
this.graveyard.clear();