forked from External/mage
* Spellheart Chimera - Fixed that variable power was not calculated in zones other than battlefield.
This commit is contained in:
parent
0739a5826e
commit
18be5e33e2
3 changed files with 16 additions and 14 deletions
|
|
@ -29,16 +29,14 @@ package mage.sets.newphyrexia;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
|
|
@ -105,7 +103,7 @@ class LifesFinaleEffect extends OneShotEffect {
|
|||
for (UUID targetId : targets) {
|
||||
Card card = opponent.getLibrary().remove(targetId, game);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
|
||||
player.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,11 +79,12 @@ public class SwarmOfRats extends CardImpl<SwarmOfRats> {
|
|||
class SwarmOfRatsEffect extends ContinuousEffectImpl<SwarmOfRatsEffect> {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Rats you control");
|
||||
|
||||
static{
|
||||
filter.add(new SubtypePredicate("Rat"));
|
||||
}
|
||||
|
||||
private DynamicValue amount;
|
||||
private final DynamicValue amount;
|
||||
|
||||
public SwarmOfRatsEffect() {
|
||||
super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
|
|
@ -103,18 +104,20 @@ class SpellheartChimeraEffect extends ContinuousEffectImpl<SpellheartChimeraEffe
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent target = game.getPermanent(source.getSourceId());
|
||||
if (target != null) {
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null || sourceCard != null) {
|
||||
int number = 0;
|
||||
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
number = player.getGraveyard().count(filter, game);
|
||||
}
|
||||
|
||||
target.getPower().setValue(number);
|
||||
if (sourcePermanent != null) {
|
||||
sourcePermanent.getPower().setValue(number);
|
||||
} else {
|
||||
sourceCard.getPower().setValue(number);
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue