mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
Fix Angel of Jubilation.
The Angel now properly only restricts the sacrifice of creatures.
This commit is contained in:
parent
e7a2277252
commit
43205b6f46
11 changed files with 246 additions and 38 deletions
|
|
@ -58,5 +58,122 @@ public class AngelOfJubilationTest extends CardTestPlayerBase {
|
|||
assertPowerToughness(playerA, "Devout Chaplain", 2, 2);
|
||||
assertPowerToughness(playerA, "Corpse Traders", 3, 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOpponentCantSacrificeCreatures() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Angel of Jubilation");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Nantuko Husk");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Corpse Traders");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Sacrifice a creature: {this} gets +2/+2 until end of turn.");
|
||||
playerB.addChoice("Corpse Traders");
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPowerToughness(playerB, "Nantuko Husk", 2, 2);
|
||||
assertPermanentCount(playerB, "Corpse Traders", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOpponentCanSacrificeNonCreaturePermanents() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Angel of Jubilation");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Savannah Lions");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Barrin, Master Wizard");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Nantuko Husk");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Island", 4);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Food Chain");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{2},Sacrifice a permanent you control: Return target creature to its owner's hand.");
|
||||
playerB.addChoice("Food Chain");
|
||||
playerA.addTarget("Angel of Jubilation");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Angel of Jubilation", 0);
|
||||
assertPermanentCount(playerB, "Food Chain", 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOpponentCantSacrificeCreaturesAsPartOfPermanentsOptions() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Angel of Jubilation");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Barrin, Master Wizard");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Nantuko Husk");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Llanowar Elves", 2);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{2},Sacrifice a permanent you control: Return target creature to its owner's hand.");
|
||||
playerB.addChoice("Nantuko Husk");
|
||||
playerA.addTarget("Angel of Jubilation");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Angel of Jubilation", 1);
|
||||
assertPermanentCount(playerB, "Nantuko Husk", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOpponentCantSacrificeAll() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Angel of Jubilation");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Nantuko Husk");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Corpse Traders");
|
||||
addCard(Zone.HAND, playerB, "Soulblast");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 6);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Soulblast", playerA);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
|
||||
assertPermanentCount(playerB, "Nantuko Husk", 1);
|
||||
assertPermanentCount(playerB, "Corpse Traders", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOpponentCantSacrificeCreatureSource() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Angel of Jubilation");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Children of Korlis");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Sacrifice {this}: You gain life equal to the life you've lost this turn.");
|
||||
playerB.addChoice("Skirk Prospector");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerB, "Children of Korlis", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOpponentCanSacrificeAllLands() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Angel of Jubilation");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Tomb of Urami");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 4);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{2}{B}{B},{T}, Sacrifice all lands you control: Put a legendary 5/5 black Demon Spirit creature token with flying named Urami onto the battlefield.");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerB, "Swamp", 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOpponentCanSacrificeNonCreatureSource() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Angel of Jubilation");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Tundra");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Wasteland");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}, Sacrifice {this}: Destroy target nonbasic land.");
|
||||
playerB.addTarget("Tundra");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Tundra", 0);
|
||||
assertPermanentCount(playerB, "Wasteland", 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1731,13 +1731,18 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canPaySacrificeCost() {
|
||||
return computerPlayer.canPaySacrificeCost();
|
||||
public boolean canPaySacrificeCost(Permanent permanent, UUID sourceId, UUID controllerId, Game game) {
|
||||
return computerPlayer.canPaySacrificeCost(permanent, sourceId, controllerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterPermanent getSacrificeCostFilter() {
|
||||
return computerPlayer.getSacrificeCostFilter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCanPaySacrificeCost(boolean canPaySacrificeCost) {
|
||||
computerPlayer.setCanPaySacrificeCost(canPaySacrificeCost);
|
||||
public void setCanPaySacrificeCostFilter(FilterPermanent permanent) {
|
||||
computerPlayer.setCanPaySacrificeCostFilter(permanent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -61,6 +62,7 @@ import mage.constants.RangeOfInfluence;
|
|||
import mage.constants.Zone;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.Counters;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.Graveyard;
|
||||
import mage.game.Table;
|
||||
|
|
@ -208,16 +210,19 @@ public class PlayerStub implements Player {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCanPaySacrificeCost(boolean canPaySacrificeCost) {
|
||||
@Override
|
||||
public void setCanPaySacrificeCostFilter(FilterPermanent filter) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPaySacrificeCost() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public FilterPermanent getSacrificeCostFilter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPaySacrificeCost(Permanent permanent, UUID sourceId, UUID controllerId, Game game) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public void setLifeTotalCanChange(boolean lifeTotalCanChange) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue