Changed graveyard card count of Lord of Extinction to only count cards of players in range.

This commit is contained in:
LevelX2 2013-06-01 09:59:53 +02:00
parent 18ee3ce9ea
commit e3ee986c47

View file

@ -28,16 +28,16 @@
package mage.sets.alarareborn; package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity; import mage.Constants.Rarity;
import mage.Constants.Zone;
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.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.FilterCard;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
@ -58,7 +58,7 @@ public class LordOfExtinction extends CardImpl<LordOfExtinction> {
this.toughness = new MageInt(0); this.toughness = new MageInt(0);
// Lord of Extinction's power and toughness are each equal to the number of cards in all graveyards. // Lord of Extinction's power and toughness are each equal to the number of cards in all graveyards.
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new LordOfExtinctionDynamicCount(), Constants.Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new LordOfExtinctionDynamicCount(), Duration.WhileOnBattlefield)));
} }
public LordOfExtinction(final LordOfExtinction card) { public LordOfExtinction(final LordOfExtinction card) {
@ -76,10 +76,10 @@ class LordOfExtinctionDynamicCount implements DynamicValue {
@Override @Override
public int calculate(Game game, Ability sourceAbility) { public int calculate(Game game, Ability sourceAbility) {
int count = 0; int count = 0;
FilterCard cardsInAllGraveyards = new FilterCard(); for (UUID playerId : game.getPlayer(sourceAbility.getControllerId()).getInRange()) {
for (Player player : game.getPlayers().values()) { Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
count += player.getGraveyard().count(cardsInAllGraveyards, game); count += player.getGraveyard().size();
} }
} }
return count; return count;