mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Some minor changes/formatting.
This commit is contained in:
parent
fe2ff3cc35
commit
9b10da0551
12 changed files with 99 additions and 78 deletions
|
|
@ -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|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -142,10 +141,15 @@ public class AlternativeCostSourceAbility extends StaticAbility<AlternativeCostS
|
||||||
if (rule != null) {
|
if (rule != null) {
|
||||||
return rule;
|
return rule;
|
||||||
}
|
}
|
||||||
|
// If you control a Swamp, you may pay 4 life rather than pay Snuff Out's mana cost.
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
if (condition != null) {
|
if (condition != null) {
|
||||||
sb.append(condition.toString());
|
sb.append(condition.toString());
|
||||||
|
if (alternateCosts.size() > 1) {
|
||||||
sb.append(", rather than pay {source}'s mana cost, ");
|
sb.append(", rather than pay {source}'s mana cost, ");
|
||||||
|
} else {
|
||||||
|
sb.append(", you may ");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sb.append("You may ");
|
sb.append("You may ");
|
||||||
}
|
}
|
||||||
|
|
@ -160,7 +164,7 @@ public class AlternativeCostSourceAbility extends StaticAbility<AlternativeCostS
|
||||||
}
|
}
|
||||||
++numberCosts;
|
++numberCosts;
|
||||||
}
|
}
|
||||||
if (condition == null) {
|
if (condition == null || alternateCosts.size() == 1) {
|
||||||
sb.append(" rather than pay {source}'s mana cost");
|
sb.append(" rather than pay {source}'s mana cost");
|
||||||
}
|
}
|
||||||
sb.append(".");
|
sb.append(".");
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
Player controller = game.getPlayer(controllerId);
|
||||||
|
if (controller != null) {
|
||||||
if (targets.choose(Outcome.ReturnToHand, controllerId, sourceId, game)) {
|
if (targets.choose(Outcome.ReturnToHand, controllerId, sourceId, game)) {
|
||||||
for (UUID targetId: targets.get(0).getTargets()) {
|
for (UUID targetId: targets.get(0).getTargets()) {
|
||||||
Permanent permanent = game.getPermanent(targetId);
|
Permanent permanent = game.getPermanent(targetId);
|
||||||
if (permanent == null) {
|
if (permanent == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
paid |= permanent.moveToZone(Zone.HAND, sourceId, game, false);
|
paid |= controller.moveCardToHandWithInfo(permanent, sourceId, game, Zone.HAND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return paid;
|
return paid;
|
||||||
|
|
|
||||||
|
|
@ -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());
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue