mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
[ORI] Renown - Fixed that renown was not applied again after creature left and returned to battlefield.
This commit is contained in:
parent
bb2a7a25b2
commit
9c53e7f984
2 changed files with 89 additions and 16 deletions
|
|
@ -27,9 +27,12 @@
|
|||
*/
|
||||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
|
@ -114,6 +117,7 @@ public class RenownTest extends CardTestPlayerBase {
|
|||
assertLife(playerB, 17);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test renown > 1
|
||||
*/
|
||||
|
|
@ -139,4 +143,72 @@ public class RenownTest extends CardTestPlayerBase {
|
|||
assertLife(playerB, 4);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test renown is gone after zone change
|
||||
*
|
||||
* /**
|
||||
* Test renown is gone after zone change
|
||||
*/
|
||||
@Test
|
||||
public void testRenownGoneAfterZoneChange() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 6);
|
||||
// Trample
|
||||
// Renown 2
|
||||
addCard(Zone.HAND, playerA, "Rhox Maulers"); // 4/4
|
||||
addCard(Zone.HAND, playerA, "Cloudshift"); // 4/4
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rhox Maulers");
|
||||
castSpell(5, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cloudshift", "Rhox Maulers");
|
||||
|
||||
attack(3, playerA, "Rhox Maulers"); // 4 damage
|
||||
attack(5, playerA, "Rhox Maulers"); // 6 damage
|
||||
attack(7, playerA, "Rhox Maulers"); // 4 damage
|
||||
|
||||
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 6);
|
||||
|
||||
assertPowerToughness(playerA, "Rhox Maulers", 4, 4);
|
||||
Permanent rhoxMaulers = getPermanent("Rhox Maulers", playerA);
|
||||
Assert.assertEquals("may not be renown", false, rhoxMaulers.isRenown());
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Test renown can be gained again after zone change
|
||||
*/
|
||||
@Test
|
||||
public void testRenownGainedGainAfterZoneChange() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
// Renown 1
|
||||
// As long as Goblin Glory Chaser is renowned, it has menace.
|
||||
addCard(Zone.HAND, playerA, "Goblin Glory Chaser"); // 1/1 {R}
|
||||
addCard(Zone.HAND, playerA, "Cloudshift");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Goblin Glory Chaser");
|
||||
castSpell(5, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cloudshift", "Goblin Glory Chaser");
|
||||
|
||||
attack(3, playerA, "Goblin Glory Chaser"); // 1 damage
|
||||
attack(5, playerA, "Goblin Glory Chaser"); // 2 damage
|
||||
attack(7, playerA, "Goblin Glory Chaser"); // 1 damage
|
||||
attack(9, playerA, "Goblin Glory Chaser"); // 2 damage
|
||||
|
||||
setStopAt(9, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
Permanent goblin = getPermanent("Goblin Glory Chaser", playerA);
|
||||
Assert.assertEquals("has has renown", true, goblin.isRenown());
|
||||
assertAbility(playerA, "Goblin Glory Chaser", new MenaceAbility(), true);
|
||||
assertPowerToughness(playerA, "Goblin Glory Chaser", 2, 2);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 14);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ public class RenownAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkInterveningIfClause(Game game) {
|
||||
return getSourceObject(game) != null && !((Permanent) getSourceObject(game)).isRenown();
|
||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(getSourceId());
|
||||
return sourcePermanent != null && !sourcePermanent.isRenown();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue