mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
* Cryptoplasm - Fixed that the copied creature did not have the triggered ability (fixes #1367).
This commit is contained in:
parent
684cb2d472
commit
b30a6c4b15
3 changed files with 25 additions and 7 deletions
|
@ -112,7 +112,7 @@ class TheMimeoplasmEffect extends OneShotEffect {
|
|||
Cards cardsToExile = new CardsImpl();
|
||||
cardsToExile.add(cardToCopy);
|
||||
cardsToExile.add(cardForCounters);
|
||||
controller.moveCards(cardsToExile, Zone.GRAVEYARD, Zone.EXILED, source, game);
|
||||
controller.moveCards(cardsToExile, Zone.EXILED, source, game);
|
||||
CopyEffect copyEffect = new CopyEffect(Duration.Custom, cardToCopy, source.getSourceId());
|
||||
game.addEffect(copyEffect, source);
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(cardForCounters.getPower().getValue()), game);
|
||||
|
|
|
@ -33,7 +33,6 @@ import mage.MageObject;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CopyEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
@ -102,8 +101,7 @@ class CryptoplasmEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, final Ability source) {
|
||||
Permanent creatureToCopy = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (creatureToCopy != null) {
|
||||
CopyEffect effect = new CopyEffect(creatureToCopy, source.getSourceId());
|
||||
effect.setApplier(new ApplyToPermanent() {
|
||||
ApplyToPermanent applier = new ApplyToPermanent() {
|
||||
@Override
|
||||
public Boolean apply(Game game, Permanent permanent) {
|
||||
Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true);
|
||||
|
@ -120,9 +118,8 @@ class CryptoplasmEffect extends OneShotEffect {
|
|||
return true;
|
||||
}
|
||||
|
||||
});
|
||||
game.addEffect(effect, source);
|
||||
|
||||
};
|
||||
game.copyPermanent(creatureToCopy, source.getSourceId(), source, applier);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -114,4 +114,25 @@ public class CryptoplasmTest extends CardTestPlayerBase {
|
|||
assertLife(playerB, 16);
|
||||
assertLife(playerA, 25);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTransformMultipleTime() {
|
||||
// At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Cryptoplasm", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // 6/4
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Craw Wurm", 1); // 6/4
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptoplasm");
|
||||
addTarget(playerA, "Silvercoat Lion");
|
||||
addTarget(playerA, "Craw Wurm");
|
||||
setStopAt(5, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 0);
|
||||
assertPermanentCount(playerA, "Craw Wurm", 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue