mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
fix Skizzik to intervening if, add test
This commit is contained in:
parent
78edb6a65c
commit
8caa8ccee4
2 changed files with 61 additions and 6 deletions
|
|
@ -1,10 +1,11 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.effects.common.SacrificeSourceUnlessConditionEffect;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
|
|
@ -14,6 +15,8 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -29,14 +32,19 @@ public final class Skizzik extends CardImpl {
|
|||
|
||||
// Kicker {R}
|
||||
this.addAbility(new KickerAbility("{R}"));
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
// At the beginning of the end step, sacrifice Skizzik unless it was kicked.
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
new SacrificeSourceUnlessConditionEffect(KickedCondition.ONCE)
|
||||
.setText("if {this} wasn't kicked, sacrifice it"), TargetController.NEXT, false));
|
||||
|
||||
// At the beginning of the end step, if Skizzik wasn't kicked, sacrifice it.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfEndStepTriggeredAbility(new SacrificeSourceEffect(), TargetController.NEXT, false),
|
||||
new InvertCondition(KickedCondition.ONCE),
|
||||
"At the beginning of the end step, if {this} wasn't kicked, sacrifice it"
|
||||
));
|
||||
}
|
||||
|
||||
private Skizzik(final Skizzik card) {
|
||||
|
|
|
|||
|
|
@ -767,4 +767,51 @@ public class KickerTest extends CardTestPlayerBase {
|
|||
assertPowerToughness(playerA, scourge, 10, 10);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSkizzikNotKicked() {
|
||||
String skizzik = "Skizzik"; // 3R Creature 5/3 trample haste
|
||||
// Kicker {R} At the beginning of the end step, if Skizzik wasn’t kicked, sacrifice it.
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
|
||||
addCard(Zone.HAND, playerA, skizzik);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, skizzik);
|
||||
setChoice(playerA, false); // not kicked
|
||||
|
||||
attack(1, playerA, skizzik, playerB);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(2, PhaseStep.UPKEEP);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 15);
|
||||
assertPermanentCount(playerA, skizzik, 0);
|
||||
assertGraveyardCount(playerA, skizzik, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSkizzikKicked() {
|
||||
String skizzik = "Skizzik"; // 3R Creature 5/3 trample haste
|
||||
// Kicker {R} At the beginning of the end step, if Skizzik wasn’t kicked, sacrifice it.
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
|
||||
addCard(Zone.HAND, playerA, skizzik);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, skizzik);
|
||||
setChoice(playerA, true);
|
||||
|
||||
attack(1, playerA, skizzik, playerB);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(2, PhaseStep.UPKEEP);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 15);
|
||||
assertPermanentCount(playerA, skizzik, 1);
|
||||
assertGraveyardCount(playerA, skizzik, 0);
|
||||
assertTappedCount("Mountain", true, 5);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue