Some minor changes / formatting.

This commit is contained in:
LevelX2 2014-01-28 13:48:40 +01:00
parent 51965b4bad
commit 19679c9f6e
5 changed files with 30 additions and 32 deletions

View file

@ -1617,7 +1617,6 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
* 3. get card colors as chosen starting from most rated card * 3. get card colors as chosen starting from most rated card
*/ */
protected List<ColoredManaSymbol> chooseDeckColorsIfPossible() { protected List<ColoredManaSymbol> chooseDeckColorsIfPossible() {
log.warn(this.getName() + " choose Deck Colors.");
if (pickedCards.size() > 2) { if (pickedCards.size() > 2) {
// sort by score and color mana symbol count in descending order // sort by score and color mana symbol count in descending order
Collections.sort(pickedCards, new Comparator<PickedCard>() { Collections.sort(pickedCards, new Comparator<PickedCard>() {

View file

@ -100,7 +100,7 @@ public class RateCard {
if (effect.getOutcome().equals(Outcome.DestroyPermanent)) { if (effect.getOutcome().equals(Outcome.DestroyPermanent)) {
for (Target target : ability.getTargets()) { for (Target target : ability.getTargets()) {
if (target instanceof TargetCreaturePermanent) { if (target instanceof TargetCreaturePermanent) {
log.info("Found destroyer: " + card.getName()); log.debug("Found destroyer: " + card.getName());
return 1; return 1;
} }
} }

View file

@ -25,13 +25,11 @@
* 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.sets.commander; package mage.sets.commander;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
@ -69,13 +67,13 @@ public class KaaliaOfTheVast extends CardImpl<KaaliaOfTheVast> {
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Whenever Kaalia of the Vast attacks an opponent, you may put an Angel, Demon, or Dragon creature card // Whenever Kaalia of the Vast attacks an opponent, you may put an Angel, Demon, or Dragon creature card
// from your hand onto the battlefield tapped and attacking that opponent. // from your hand onto the battlefield tapped and attacking that opponent.
this.addAbility(new KaaliaOfTheVastAttacksAbility()); this.addAbility(new KaaliaOfTheVastAttacksAbility());
} }
public KaaliaOfTheVast(final KaaliaOfTheVast card) { public KaaliaOfTheVast(final KaaliaOfTheVast card) {
@ -90,29 +88,29 @@ public class KaaliaOfTheVast extends CardImpl<KaaliaOfTheVast> {
} }
class KaaliaOfTheVastAttacksAbility extends TriggeredAbilityImpl<KaaliaOfTheVastAttacksAbility> { class KaaliaOfTheVastAttacksAbility extends TriggeredAbilityImpl<KaaliaOfTheVastAttacksAbility> {
public KaaliaOfTheVastAttacksAbility() { public KaaliaOfTheVastAttacksAbility() {
super(Zone.BATTLEFIELD, new KaaliaOfTheVastEffect(), false); super(Zone.BATTLEFIELD, new KaaliaOfTheVastEffect(), false);
} }
public KaaliaOfTheVastAttacksAbility(final KaaliaOfTheVastAttacksAbility ability) { public KaaliaOfTheVastAttacksAbility(final KaaliaOfTheVastAttacksAbility ability) {
super(ability); super(ability);
} }
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
Player opponent = game.getPlayer(event.getTargetId()); Player opponent = game.getPlayer(event.getTargetId());
if( opponent != null ) { if (opponent != null) {
return true; return true;
} }
} }
return false; return false;
} }
@Override @Override
public String getRule() { public String getRule() {
return "Whenever {this} attacks an opponent, you may put an Angel, Demon, or Dragon creature card from your hand onto the battlefield tapped and attacking that opponent."; return "Whenever {this} attacks an opponent, you may put an Angel, Demon, or Dragon creature card from your hand onto the battlefield tapped and attacking that opponent.";
} }
@Override @Override
@ -150,8 +148,8 @@ class KaaliaOfTheVastEffect extends OneShotEffect<KaaliaOfTheVastEffect> {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, "Put an Angel, Demon, or Dragon creature card from your hand onto the battlefield tapped and attacking?", game)) { if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, "Put an Angel, Demon, or Dragon creature card from your hand onto the battlefield tapped and attacking?", game)) {
return false; return false;
} }
TargetCardInHand target = new TargetCardInHand(filter); TargetCardInHand target = new TargetCardInHand(filter);
if (target.canChoose(player.getId(), game) && target.choose(getOutcome(), player.getId(), source.getSourceId(), game)) { if (target.canChoose(player.getId(), game) && target.choose(getOutcome(), player.getId(), source.getSourceId(), game)) {
if (target.getTargets().size() > 0) { if (target.getTargets().size() > 0) {
@ -159,11 +157,15 @@ class KaaliaOfTheVastEffect extends OneShotEffect<KaaliaOfTheVastEffect> {
Card card = game.getCard(cardId); Card card = game.getCard(cardId);
if (card != null && game.getCombat() != null) { if (card != null && game.getCombat() != null) {
UUID defenderId = game.getCombat().getDefendingPlayerId(source.getSourceId(), game); UUID defenderId = game.getCombat().getDefendingPlayerId(source.getSourceId(), game);
if(defenderId != null) { if (defenderId != null) {
player.getHand().remove(card); player.getHand().remove(card);
card.moveToZone(Zone.BATTLEFIELD, source.getId(), game, true); player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
game.getCombat().declareAttacker(card.getId(), defenderId, game); Permanent creature = game.getPermanent(cardId);
return true; if (creature != null) {
game.getCombat().declareAttacker(card.getId(), defenderId, game);
return true;
}
} }
} }
} }

View file

@ -55,10 +55,7 @@ class IntimidateEffect extends RestrictionEffect<IntimidateEffect> implements Ma
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getAbilities().containsKey(IntimidateAbility.getInstance().getId())) { return permanent.getAbilities().containsKey(IntimidateAbility.getInstance().getId());
return true;
}
return false;
} }
@Override @Override

View file

@ -70,9 +70,9 @@ public abstract class DraftCube {
private static final Logger logger = Logger.getLogger(DraftCube.class); private static final Logger logger = Logger.getLogger(DraftCube.class);
private static Random rnd = new Random(); private static final Random rnd = new Random();
private String name; private final String name;
private int boosterSize = 15; private final int boosterSize = 15;
protected List<CardIdentity> cubeCards = new ArrayList<CardIdentity>(); protected List<CardIdentity> cubeCards = new ArrayList<CardIdentity>();
protected List<CardIdentity> leftCubeCards = new ArrayList<CardIdentity>(); protected List<CardIdentity> leftCubeCards = new ArrayList<CardIdentity>();
@ -118,7 +118,7 @@ public abstract class DraftCube {
booster.add(cardInfo.getCard()); booster.add(cardInfo.getCard());
done = true; done = true;
} else { } else {
logger.error(new StringBuilder(this.getName()).append(" - Card not found: ").append(cardId.getName()).append(":").append(cardId.extension)); logger.warn(new StringBuilder(this.getName()).append(" - Card not found: ").append(cardId.getName()).append(":").append(cardId.extension));
notValid++; notValid++;
} }
} else { } else {