Skip to content

Commit

Permalink
Fix Boneyard Scourge triggering from itself dying (Card-Forge#4924)
Browse files Browse the repository at this point in the history
  • Loading branch information
tool4ever authored Mar 31, 2024
1 parent 7254b26 commit 247ec8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils;
import forge.game.card.Card;
import forge.game.card.CardCollectionView;
import forge.game.card.CardLists;
import forge.game.card.CardPredicates;
import forge.game.spellability.SpellAbility;
Expand Down Expand Up @@ -99,6 +100,14 @@ public final boolean performTest(final Map<AbilityKey, Object> runParams) {
}
}

if ("Battlefield".equals(getParam("Origin")) && getActiveZone() != null && getActiveZone().contains(ZoneType.Graveyard)) {
// extra check for Boneyard Scourge
CardCollectionView lastState = (CardCollectionView) runParams.get(AbilityKey.LastStateGraveyard);
if (!lastState.contains(getHostCard())) {
return false;
}
}

if (hasParam("ValidCard")) {
Card moved = (Card) runParams.get(AbilityKey.Card);

Expand Down
2 changes: 1 addition & 1 deletion forge-gui/res/cardsfolder/b/boneyard_scourge.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ManaCost:2 B B
Types:Creature Zombie Dragon
PT:4/3
K:Flying
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Dragon.YouCtrl | IsPresent$ Card.StrictlySelf+inZoneGraveyard | PresentZone$ Graveyard | TriggerZones$ Graveyard | Execute$ TrigReturn | TriggerDescription$ Whenever a Dragon you control dies while CARDNAME is in your graveyard, you may pay {1}{B}. If you do, return CARDNAME from your graveyard to the battlefield.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Dragon.YouCtrl | TriggerZones$ Graveyard | Execute$ TrigReturn | TriggerDescription$ Whenever a Dragon you control dies while CARDNAME is in your graveyard, you may pay {1}{B}. If you do, return CARDNAME from your graveyard to the battlefield.
SVar:TrigReturn:AB$ ChangeZone | Cost$ 1 B | Defined$ Self | Origin$ Graveyard | Destination$ Battlefield
SVar:SacMe:1
SVar:DiscardMe:1
Expand Down

0 comments on commit 247ec8c

Please sign in to comment.