Merge origin/master

This commit is contained in:
fireshoes 2015-06-25 12:16:46 -05:00
commit 9741d34e1e
18 changed files with 1414 additions and 1210 deletions

View file

@ -61,6 +61,7 @@ import mage.util.CardUtil;
public class DaxosOfMeletis extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with power 3 or greater");
static {
filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 2));
}
@ -119,7 +120,7 @@ class DaxosOfMeletisEffect extends OneShotEffect {
Card card = damagedPlayer.getLibrary().getFromTop(game);
if (card != null) {
// move card to exile
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
// player gains life
int cmc = card.getManaCost().convertedManaCost();
if (cmc > 0) {
@ -172,7 +173,7 @@ class DaxosOfMeletisCastFromExileEffect extends AsThoughEffectImpl {
@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
if (sourceId.equals(cardId)) {
if (sourceId.equals(cardId) && source.getControllerId().equals(affectedControllerId)) {
ExileZone exileZone = game.getState().getExile().getExileZone(exileId);
return exileZone != null && exileZone.contains(cardId);
}
@ -202,7 +203,10 @@ class DaxosOfMeletisSpendAnyManaEffect extends AsThoughEffectImpl {
}
@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
return sourceId.equals(getTargetPointer().getFirst(game, source));
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
return source.getControllerId().equals(affectedControllerId)
&& objectId == ((FixedTarget) getTargetPointer()).getTarget()
&& ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId)
&& game.getState().getZone(objectId).equals(Zone.STACK);
}
}

View file

@ -44,7 +44,6 @@ import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.players.PlayerList;
import mage.target.Target;
import mage.target.common.TargetNonlandPermanent;
@ -58,7 +57,6 @@ public class CouncilsJudgment extends CardImpl {
super(ownerId, 20, "Council's Judgment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{W}{W}");
this.expansionSetCode = "VMA";
// Will of the council - Starting with you, each player votes for a nonland permanent you don't control. Exile each permanent with the most votes or tied for most votes.
this.getSpellAbility().addEffect(new CouncilsJudgmentEffect());
}
@ -74,21 +72,21 @@ public class CouncilsJudgment extends CardImpl {
}
class CouncilsJudgmentEffect extends OneShotEffect {
CouncilsJudgmentEffect() {
super(Outcome.Exile);
this.staticText = "<i>Will of the council</i> — Starting with you, each player votes for a nonland permanent you don't control. Exile each permanent with the most votes or tied for most votes";
}
CouncilsJudgmentEffect(final CouncilsJudgmentEffect effect) {
super(effect);
}
@Override
public CouncilsJudgmentEffect copy() {
return new CouncilsJudgmentEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
@ -98,13 +96,9 @@ class CouncilsJudgmentEffect extends OneShotEffect {
FilterNonlandPermanent filter = new FilterNonlandPermanent("a nonland permanent " + controller.getLogName() + " doesn't control");
filter.add(Predicates.not(new ControllerIdPredicate(controller.getId())));
//Players each choose a legal permanent
PlayerList playerList = game.getState().getPlayerList().copy();
while (!playerList.get().equals(controller.getId()) && controller.isInGame()) {
playerList.getNext();
}
do {
Player player = game.getPlayer(playerList.get());
if (player != null && player.isInGame()) {
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
Target target = new TargetNonlandPermanent(filter);
target.setNotTarget(true);
if (player.choose(Outcome.Exile, target, source.getSourceId(), game)) {
@ -116,8 +110,7 @@ class CouncilsJudgmentEffect extends OneShotEffect {
maxCount = count;
}
chosenCards.put(permanent, count);
}
else {
} else {
if (maxCount == 0) {
maxCount = 1;
}
@ -127,7 +120,8 @@ class CouncilsJudgmentEffect extends OneShotEffect {
}
}
}
} while (playerList.getNextInRange(controller, game) != controller && controller.isInGame());
}
//Exile the card(s) with the most votes.
for (Entry<Permanent, Integer> entry : chosenCards.entrySet()) {
if (entry.getValue() == maxCount) {

View file

@ -63,42 +63,42 @@ public class PleaForPower extends CardImpl {
}
class PleaForPowerEffect extends OneShotEffect {
PleaForPowerEffect() {
super(Outcome.Benefit);
this.staticText = "<i>Will of the council</i> — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards";
}
PleaForPowerEffect(final PleaForPowerEffect effect) {
super(effect);
}
@Override
public PleaForPowerEffect copy() {
return new PleaForPowerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int timeCount = 0;
int knowledgeCount = 0;
for (UUID playerId : controller.getInRange()) {
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player.chooseUse(Outcome.ExtraTurn, "Choose time?", game)) {
timeCount++;
game.informPlayers(player.getLogName() + " has chosen: time");
}
else {
knowledgeCount++;
game.informPlayers(player.getLogName() + " has chosen: knowledge");
if (player != null) {
if (player.chooseUse(Outcome.ExtraTurn, "Choose time?", game)) {
timeCount++;
game.informPlayers(player.getLogName() + " has chosen: time");
} else {
knowledgeCount++;
game.informPlayers(player.getLogName() + " has chosen: knowledge");
}
}
}
if (timeCount > knowledgeCount) {
new AddExtraTurnControllerEffect().apply(game, source);
}
else {
} else {
controller.drawCards(3, game);
}
return true;