- Converted "At the beginning of the end step, sacrifice CARDNAME.", can be targeted by Stifle

This commit is contained in:
swordshine
2013-08-08 03:17:59 +00:00
parent f689d44f01
commit 61d1786a00
2 changed files with 14 additions and 15 deletions

View File

@@ -2,7 +2,8 @@ Name:Sneak Attack
ManaCost:3 R
Types:Enchantment
A:AB$ ChangeZone | Cost$ R | Origin$ Hand | Destination$ Battlefield | ChangeType$ Creature.YouCtrl | SubAbility$ DBPump | RememberChanged$ True | ForgetOtherRemembered$ True | SpellDescription$ You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice the creature at the beginning of the next end step.
SVar:DBPump:DB$ Pump | KW$ Haste & HIDDEN At the beginning of the end step, sacrifice CARDNAME. | Defined$ Remembered | SubAbility$ DBCleanup
SVar:DBPump:DB$ Pump | KW$ Haste | Defined$ Remembered | Permanent$ True | SubAbility$ DBPump2
SVar:DBPump2:DB$ Pump | Defined$ Remembered | KW$ HIDDEN At the beginning of the end step, sacrifice CARDNAME. | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:NonStackingEffect:True
SVar:RemAIDeck:True

View File

@@ -18,6 +18,7 @@
package forge.game.phase;
import forge.Card;
import forge.card.ability.AbilityFactory;
import forge.card.mana.ManaCost;
import forge.card.spellability.Ability;
import forge.card.spellability.SpellAbility;
@@ -58,21 +59,18 @@ public class EndOfTurn extends Phase {
for (final Card c : game.getCardsIn(ZoneType.Battlefield)) {
if (!c.isFaceDown() && c.hasKeyword("At the beginning of the end step, sacrifice CARDNAME.")) {
final Card card = c;
final SpellAbility sac = new Ability(card, ManaCost.ZERO) {
@Override
public void resolve() {
final Card current = game.getCardState(card);
if (current.isInPlay()) {
game.getAction().sacrifice(current, null);
}
}
};
final StringBuilder sb = new StringBuilder();
sb.append("Sacrifice ").append(card);
sac.setStackDescription(sb.toString());
sac.setDescription(sb.toString());
String sb = "At the beginning of the end step, sacrifice CARDNAME.";
String effect = "AB$ Sacrifice | Cost$ 0 | SacValid$ Self";
game.getStack().addSimultaneousStackEntry(sac);
SpellAbility ability = AbilityFactory.getAbility(effect, card);
ability.setActivatingPlayer(card.getController());
ability.setDescription(sb);
ability.setStackDescription(sb);
ability.setTrigger(true);
final int amount = card.getKeywordAmount("At the beginning of the end step, sacrifice CARDNAME.");
for (int i = 0; i < amount; i++) {
game.getStack().addSimultaneousStackEntry(ability);
}
}
if (!c.isFaceDown() && c.hasKeyword("At the beginning of the end step, exile CARDNAME.")) {