mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32: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;
|
package org.mage.test.cards.abilities.keywords;
|
||||||
|
|
||||||
|
import mage.abilities.keyword.MenaceAbility;
|
||||||
import mage.abilities.keyword.VigilanceAbility;
|
import mage.abilities.keyword.VigilanceAbility;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
|
@ -50,17 +53,17 @@ public class RenownTest extends CardTestPlayerBase {
|
||||||
attack(3, playerA, "Knight of the Pilgrim's Road"); // 3 damage
|
attack(3, playerA, "Knight of the Pilgrim's Road"); // 3 damage
|
||||||
attack(5, playerA, "Knight of the Pilgrim's Road"); // 4 damage
|
attack(5, playerA, "Knight of the Pilgrim's Road"); // 4 damage
|
||||||
attack(7, playerA, "Knight of the Pilgrim's Road"); // 4 damage
|
attack(7, playerA, "Knight of the Pilgrim's Road"); // 4 damage
|
||||||
|
|
||||||
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN);
|
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
assertPowerToughness(playerA, "Knight of the Pilgrim's Road", 4, 3);
|
assertPowerToughness(playerA, "Knight of the Pilgrim's Road", 4, 3);
|
||||||
|
|
||||||
assertLife(playerA, 20);
|
assertLife(playerA, 20);
|
||||||
assertLife(playerB, 9);
|
assertLife(playerB, 9);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test renown trigger
|
* Test renown trigger
|
||||||
*/
|
*/
|
||||||
|
|
@ -76,19 +79,19 @@ public class RenownTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
attack(3, playerA, "Relic Seeker"); // 2 damage
|
attack(3, playerA, "Relic Seeker"); // 2 damage
|
||||||
attack(5, playerA, "Relic Seeker"); // 3 damage
|
attack(5, playerA, "Relic Seeker"); // 3 damage
|
||||||
|
|
||||||
setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);
|
setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
assertPowerToughness(playerA, "Relic Seeker", 3, 3);
|
assertPowerToughness(playerA, "Relic Seeker", 3, 3);
|
||||||
assertHandCount(playerA, "Veteran's Sidearm", 1);
|
assertHandCount(playerA, "Veteran's Sidearm", 1);
|
||||||
|
|
||||||
assertLife(playerA, 20);
|
assertLife(playerA, 20);
|
||||||
assertLife(playerB, 15);
|
assertLife(playerB, 15);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test renown state
|
* Test renown state
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -102,18 +105,19 @@ public class RenownTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
attack(3, playerA, "Honored Hierarch"); // 1 damage
|
attack(3, playerA, "Honored Hierarch"); // 1 damage
|
||||||
attack(5, playerA, "Honored Hierarch"); // 2 damage
|
attack(5, playerA, "Honored Hierarch"); // 2 damage
|
||||||
|
|
||||||
setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);
|
setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
assertPowerToughness(playerA, "Honored Hierarch", 2, 2);
|
assertPowerToughness(playerA, "Honored Hierarch", 2, 2);
|
||||||
assertTapped("Honored Hierarch", false);
|
assertTapped("Honored Hierarch", false);
|
||||||
assertAbility(playerA, "Honored Hierarch", VigilanceAbility.getInstance(), true);
|
assertAbility(playerA, "Honored Hierarch", VigilanceAbility.getInstance(), true);
|
||||||
|
|
||||||
assertLife(playerA, 20);
|
assertLife(playerA, 20);
|
||||||
assertLife(playerB, 17);
|
assertLife(playerB, 17);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test renown > 1
|
* Test renown > 1
|
||||||
*/
|
*/
|
||||||
|
|
@ -121,7 +125,7 @@ public class RenownTest extends CardTestPlayerBase {
|
||||||
public void testRhoxMaulers() {
|
public void testRhoxMaulers() {
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 5);
|
addCard(Zone.BATTLEFIELD, playerA, "Forest", 5);
|
||||||
// Trample
|
// Trample
|
||||||
// Renown 2
|
// Renown 2
|
||||||
addCard(Zone.HAND, playerA, "Rhox Maulers"); // 4/4
|
addCard(Zone.HAND, playerA, "Rhox Maulers"); // 4/4
|
||||||
|
|
||||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rhox Maulers");
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rhox Maulers");
|
||||||
|
|
@ -129,14 +133,82 @@ public class RenownTest extends CardTestPlayerBase {
|
||||||
attack(3, playerA, "Rhox Maulers"); // 4 damage
|
attack(3, playerA, "Rhox Maulers"); // 4 damage
|
||||||
attack(5, playerA, "Rhox Maulers"); // 6 damage
|
attack(5, playerA, "Rhox Maulers"); // 6 damage
|
||||||
attack(7, playerA, "Rhox Maulers"); // 6 damage
|
attack(7, playerA, "Rhox Maulers"); // 6 damage
|
||||||
|
|
||||||
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN);
|
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
assertPowerToughness(playerA, "Rhox Maulers", 6, 6);
|
assertPowerToughness(playerA, "Rhox Maulers", 6, 6);
|
||||||
|
|
||||||
assertLife(playerA, 20);
|
assertLife(playerA, 20);
|
||||||
assertLife(playerB, 4);
|
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
|
@Override
|
||||||
public boolean checkInterveningIfClause(Game game) {
|
public boolean checkInterveningIfClause(Game game) {
|
||||||
return getSourceObject(game) != null && !((Permanent) getSourceObject(game)).isRenown();
|
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(getSourceId());
|
||||||
|
return sourcePermanent != null && !sourcePermanent.isRenown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue