[STX] fixed Star Pupil not adding counters (fixes #7744)

This commit is contained in:
Evan Kranzler 2021-04-15 09:45:12 -04:00
parent aea59275d9
commit 29f7555ac3
3 changed files with 36 additions and 2 deletions

View file

@ -75,7 +75,7 @@ class SpitefulSquadEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent sourcePermanent = source.getSourcePermanentOrLKI(game);
Permanent sourcePermanent = (Permanent) getValue("permanentLeftBattlefield");
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (sourcePermanent == null || permanent == null) {
return false;

View file

@ -71,7 +71,7 @@ class StarPupilEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent sourcePermanent = source.getSourcePermanentOrLKI(game);
Permanent sourcePermanent = (Permanent) getValue("permanentLeftBattlefield");
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (sourcePermanent == null || permanent == null) {
return false;

View file

@ -0,0 +1,34 @@
package org.mage.test.cards.single.stx;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author TheElk801
*/
public class StarPupilTest extends CardTestPlayerBase {
private static final String pupil = "Star Pupil";
private static final String murder = "Murder";
private static final String lion = "Silvercoat Lion";
@Test
public void testPupil() {
addCard(Zone.BATTLEFIELD, playerA, "Scrubland", 4);
addCard(Zone.BATTLEFIELD, playerA, lion);
addCard(Zone.HAND, playerA, pupil);
addCard(Zone.HAND, playerA, murder);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, pupil);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, murder, pupil);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertCounterCount(lion, CounterType.P1P1, 1);
}
}