This commit is contained in:
BetaSteward 2010-11-12 04:19:11 +00:00
parent 19ae34969e
commit c61881e5df
9 changed files with 36 additions and 13 deletions

View file

@ -403,7 +403,7 @@ public class GameController implements GameCallback {
private void addCardsForTesting(Game game) {
try {
File f = new File(INIT_FILE_PATH);
Pattern pattern = Pattern.compile("([a-zA-Z]*):([\\w]*):([a-zA-Z ,.!\\d]*):([\\d]*)");
Pattern pattern = Pattern.compile("([a-zA-Z]*):([\\w]*):([a-zA-Z ,.!'\\d]*):([\\d]*)");
if (!f.exists()) {
logger.warning("Couldn't find init file: " + INIT_FILE_PATH);
return;

View file

@ -45,7 +45,7 @@ import mage.target.common.TargetCreaturePermanent;
public class AetherAdept extends CardImpl<AetherAdept> {
public AetherAdept(UUID ownerId) {
super(ownerId, 41, "Æther Adept", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
super(ownerId, 41, "AEther Adept", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
this.expansionSetCode = "M11";
this.subtype.add("Human");
this.subtype.add("Wizard");

View file

@ -141,8 +141,10 @@ public abstract class ActivatedAbilityImpl<T extends ActivatedAbilityImpl<T>> ex
if (!controlsAbility(playerId, game))
return false;
//20091005 - 602.5d/602.5e
if ((timing == TimingRule.INSTANT || game.canPlaySorcery(playerId)) && costs.canPay(sourceId, controllerId, game) && targets.canChoose(sourceId, playerId, game)) {
return true;
if (timing == TimingRule.INSTANT || game.canPlaySorcery(playerId)) {
if (costs.canPay(sourceId, controllerId, game) && targets.canChoose(sourceId, playerId, game)) {
return true;
}
}
return false;
}

View file

@ -29,7 +29,6 @@
package mage.abilities.costs.common;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.CostImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -63,7 +62,7 @@ public class PayLoyaltyCost extends CostImpl<PayLoyaltyCost> {
@Override
public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
Permanent planeswalker = game.getPermanent(sourceId);
if (planeswalker.getLoyalty().getValue() + amount > 0 && !planeswalker.isLoyaltyUsed()) {
if (planeswalker.getLoyalty().getValue() + amount >= 0 && !planeswalker.isLoyaltyUsed()) {
planeswalker.getLoyalty().boostValue(amount);
planeswalker.setLoyaltyUsed(true);
this.paid = true;

View file

@ -32,7 +32,7 @@ package mage.counters;
*
* @author BetaSteward_at_googlemail.com
*/
public class BoostCounter<T extends BoostCounter<T>> extends Counter<T> {
public abstract class BoostCounter<T extends BoostCounter<T>> extends Counter<T> {
protected int power;
protected int toughness;
@ -43,6 +43,12 @@ public class BoostCounter<T extends BoostCounter<T>> extends Counter<T> {
this.toughness = toughness;
}
public BoostCounter(final BoostCounter counter) {
super(counter);
this.power = counter.power;
this.toughness = counter.toughness;
}
public int getPower() {
return power;
}

View file

@ -43,4 +43,12 @@ public class MinusOneCounter extends BoostCounter<MinusOneCounter> {
this.count = amount;
}
public MinusOneCounter(final MinusOneCounter counter) {
super(counter);
}
@Override
public MinusOneCounter copy() {
return new MinusOneCounter(this);
}
}

View file

@ -42,4 +42,13 @@ public class PlusOneCounter extends BoostCounter<PlusOneCounter> {
super(1, 1);
this.count = amount;
}
public PlusOneCounter(final PlusOneCounter counter) {
super(counter);
}
@Override
public PlusOneCounter copy() {
return new PlusOneCounter(this);
}
}

View file

@ -83,6 +83,7 @@ import mage.players.PlayerList;
import mage.players.Players;
import mage.target.TargetPlayer;
import mage.util.Logging;
import mage.watchers.Watcher;
public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializable {
@ -156,6 +157,10 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
for (Card card: cards) {
card.setOwnerId(ownerId);
gameCards.put(card.getId(), card);
for (Watcher watcher: card.getWatchers()) {
watcher.setControllerId(ownerId);
state.getWatchers().add(watcher);
}
}
}

View file

@ -155,12 +155,6 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
this.left = false;
this.passed = false;
this.passedTurn = false;
for (Card card: library.getCards(game)) {
for (Watcher watcher: card.getWatchers()) {
watcher.setControllerId(playerId);
game.getState().getWatchers().add(watcher);
}
}
findRange(game);
}