Merge branch '1836-npe-at-forge-game-gameaction-sacrificedestroy-gameaction-java-1709' into 'master'

Resolve "NPE at forge.game.GameAction.sacrificeDestroy(GameAction.java:1709)"

Closes #1836

See merge request core-developers/forge!4699
This commit is contained in:
Michael Kamensky
2021-05-15 12:40:13 +00:00
11 changed files with 14 additions and 24 deletions

View File

@@ -1699,7 +1699,7 @@ public class GameAction {
} }
final Card newCard = moveToGraveyard(c, cause, null); final Card newCard = moveToGraveyard(c, cause, null);
if (table != null) { if (table != null && newCard != null && newCard.getZone() != null) {
table.put(ZoneType.Battlefield, newCard.getZone().getZoneType(), newCard); table.put(ZoneType.Battlefield, newCard.getZone().getZoneType(), newCard);
} }

View File

@@ -5,6 +5,5 @@ PT:3/4
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ Whenever CARDNAME attacks or blocks, destroy it at end of combat. T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ Whenever CARDNAME attacks or blocks, destroy it at end of combat.
T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelTrig | Secondary$ True | TriggerDescription$ Whenever CARDNAME attacks or blocks, destroy it at end of combat. T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelTrig | Secondary$ True | TriggerDescription$ Whenever CARDNAME attacks or blocks, destroy it at end of combat.
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Destroy CARDNAME at end of combat. SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Destroy CARDNAME at end of combat.
SVar:TrigSacrifice:DB$ Destroy | Defined$ Self SVar:TrigSacrifice:DB$ Destroy | Defined$ DelayTriggerRememberedLKI
SVar:Picture:http://www.wizards.com/global/images/magic/general/ceremonial_guard.jpg
Oracle:When Ceremonial Guard attacks or blocks, destroy it at end of combat. Oracle:When Ceremonial Guard attacks or blocks, destroy it at end of combat.

View File

@@ -5,7 +5,6 @@ PT:7/4
K:Trample K:Trample
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ When CARDNAME attacks, sacrifice it at end of combat. T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ When CARDNAME attacks, sacrifice it at end of combat.
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat. SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat.
SVar:TrigSacrifice:DB$ Sacrifice | Defined$ Self SVar:TrigSacrifice:DB$ SacrificeAll | Defined$ DelayTriggerRememberedLKI
SVar:SacrificeEndCombat:True SVar:SacrificeEndCombat:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/crumbling_colossus.jpg
Oracle:Trample (This creature can deal excess combat damage to the player or planeswalker it's attacking.)\nWhen Crumbling Colossus attacks, sacrifice it at end of combat. Oracle:Trample (This creature can deal excess combat damage to the player or planeswalker it's attacking.)\nWhen Crumbling Colossus attacks, sacrifice it at end of combat.

View File

@@ -5,8 +5,7 @@ K:Enchant creature
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Creature | AILogic$ Pump A:SP$ Attach | Cost$ 1 U | ValidTgts$ Creature | AILogic$ Pump
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 3 | AddToughness$ 3 | Description$ Enchanted creature gets +3/+3. S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 3 | AddToughness$ 3 | Description$ Enchanted creature gets +3/+3.
T:Mode$ Attacks | ValidCard$ Card.AttachedBy | TriggerZones$ Battlefield | Execute$ DelayedTrig | TriggerDescription$ When enchanted creature attacks or blocks, sacrifice CARDNAME at the beginning of the next cleanup step. T:Mode$ Attacks | ValidCard$ Card.AttachedBy | TriggerZones$ Battlefield | Execute$ DelayedTrig | TriggerDescription$ When enchanted creature attacks or blocks, sacrifice CARDNAME at the beginning of the next cleanup step.
T:Mode$ Blocks | ValidCard$ Card.AttachedBy | TriggerZones$ Battlefield| Execute$ DelayedTrig | Secondary$ True | TriggerDescription$ When enchanted creature attacks or blocks, sacrifice CARDNAME at the beginning of the next cleanup step. T:Mode$ Blocks | ValidCard$ Card.AttachedBy | TriggerZones$ Battlefield | Execute$ DelayedTrig | Secondary$ True | TriggerDescription$ When enchanted creature attacks or blocks, sacrifice CARDNAME at the beginning of the next cleanup step.
SVar:DelayedTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Cleanup | ValidPlayer$ Player | Execute$ TrigSac | TriggerDescription$ Sacrifice CARDNAME. SVar:DelayedTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Cleanup | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME.
SVar:TrigSac:DB$Sacrifice | Defined$ Self SVar:TrigSacrifice:DB$ SacrificeAll | Defined$ DelayTriggerRememberedLKI
SVar:Picture:http://www.wizards.com/global/images/magic/general/cunning.jpg
Oracle:Enchant creature\nEnchanted creature gets +3/+3.\nWhen enchanted creature attacks or blocks, sacrifice Cunning at the beginning of the next cleanup step. Oracle:Enchant creature\nEnchanted creature gets +3/+3.\nWhen enchanted creature attacks or blocks, sacrifice Cunning at the beginning of the next cleanup step.

View File

@@ -6,7 +6,6 @@ K:Flying
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ Whenever CARDNAME attacks or blocks, sacrifice it at end of combat. T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ Whenever CARDNAME attacks or blocks, sacrifice it at end of combat.
T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelTrig | Secondary$ True | TriggerDescription$ Whenever CARDNAME attacks or blocks, sacrifice it at end of combat. T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelTrig | Secondary$ True | TriggerDescription$ Whenever CARDNAME attacks or blocks, sacrifice it at end of combat.
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat. SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat.
SVar:TrigSacrifice:DB$Sacrifice | Defined$ Self SVar:TrigSacrifice:DB$ SacrificeAll | Defined$ DelayTriggerRememberedLKI
SVar:SacrificeEndCombat:True SVar:SacrificeEndCombat:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/fog_elemental.jpg
Oracle:Flying (This creature can't be blocked except by creatures with flying or reach.)\nWhen Fog Elemental attacks or blocks, sacrifice it at end of combat. Oracle:Flying (This creature can't be blocked except by creatures with flying or reach.)\nWhen Fog Elemental attacks or blocks, sacrifice it at end of combat.

View File

@@ -6,10 +6,9 @@ K:Trample
K:CARDNAME can't block. K:CARDNAME can't block.
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ When CARDNAME attacks, sacrifice it at end of combat. T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ When CARDNAME attacks, sacrifice it at end of combat.
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat. SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat.
SVar:TrigSacrifice:DB$Sacrifice | Defined$ Self SVar:TrigSacrifice:DB$ SacrificeAll | Defined$ DelayTriggerRememberedLKI
SVar:SacrificeEndCombat:True SVar:SacrificeEndCombat:True
A:AB$ Pump | Cost$ tapXType<1/Creature> | NumAtt$ +X | SpellDescription$ CARDNAME gets +X/+0 until end of turn, where X is the power of the creature tapped this way. A:AB$ Pump | Cost$ tapXType<1/Creature> | NumAtt$ +X | SpellDescription$ CARDNAME gets +X/+0 until end of turn, where X is the power of the creature tapped this way.
SVar:X:Tapped$CardPower SVar:X:Tapped$CardPower
AI:RemoveDeck:All AI:RemoveDeck:All
SVar:Picture:http://www.wizards.com/global/images/magic/general/keldon_battlewagon.jpg
Oracle:Trample\nKeldon Battlewagon can't block.\nWhen Keldon Battlewagon attacks, sacrifice it at end of combat.\nTap an untapped creature you control: Keldon Battlewagon gets +X/+0 until end of turn, where X is the power of the creature tapped this way. Oracle:Trample\nKeldon Battlewagon can't block.\nWhen Keldon Battlewagon attacks, sacrifice it at end of combat.\nTap an untapped creature you control: Keldon Battlewagon gets +X/+0 until end of turn, where X is the power of the creature tapped this way.

View File

@@ -5,8 +5,7 @@ PT:4/4
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ When CARDNAME attacks or blocks, sacrifice it at end of combat. T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ When CARDNAME attacks or blocks, sacrifice it at end of combat.
T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelTrig | Secondary$ True | TriggerDescription$ Whenever CARDNAME attacks or blocks, sacrifice it at end of combat. T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelTrig | Secondary$ True | TriggerDescription$ Whenever CARDNAME attacks or blocks, sacrifice it at end of combat.
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat. SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat.
SVar:TrigSacrifice:DB$ Sacrifice | Defined$ Self SVar:TrigSacrifice:DB$ SacrificeAll | Defined$ DelayTriggerRememberedLKI
SVar:SacrificeEndCombat:True SVar:SacrificeEndCombat:True
AI:RemoveDeck:All AI:RemoveDeck:All
SVar:Picture:http://www.wizards.com/global/images/magic/general/mardu_blazebringer.jpg
Oracle:When Mardu Blazebringer attacks or blocks, sacrifice it at end of combat. Oracle:When Mardu Blazebringer attacks or blocks, sacrifice it at end of combat.

View File

@@ -6,7 +6,6 @@ K:Trample
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ Whenever CARDNAME attacks or blocks, sacrifice it at end of combat. T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ Whenever CARDNAME attacks or blocks, sacrifice it at end of combat.
T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelTrig | Secondary$ True | TriggerDescription$ Whenever CARDNAME attacks or blocks, sacrifice it at end of combat. T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelTrig | Secondary$ True | TriggerDescription$ Whenever CARDNAME attacks or blocks, sacrifice it at end of combat.
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat. SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat.
SVar:TrigSacrifice:DB$Sacrifice | Defined$ Self SVar:TrigSacrifice:DB$ SacrificeAll | Defined$ DelayTriggerRememberedLKI
SVar:SacrificeEndCombat:True SVar:SacrificeEndCombat:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/runaway_carriage.jpg
Oracle:Trample\nWhen Runaway Carriage attacks or blocks, sacrifice it at end of combat. Oracle:Trample\nWhen Runaway Carriage attacks or blocks, sacrifice it at end of combat.

View File

@@ -6,7 +6,6 @@ K:Defender
K:Flying K:Flying
T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ When CARDNAME blocks, sacrifice it at end of combat. T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelTrig | TriggerDescription$ When CARDNAME blocks, sacrifice it at end of combat.
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Opponent | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat. SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Opponent | Execute$ TrigSacrifice | TriggerDescription$ Sacrifice CARDNAME at end of combat.
SVar:TrigSacrifice:DB$Sacrifice | Defined$ Self SVar:TrigSacrifice:DB$ SacrificeAll | Defined$ DelayTriggerRememberedLKI
SVar:SacrificeEndCombat:True SVar:SacrificeEndCombat:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/stoic_ephemera.jpg
Oracle:Defender (This creature can't attack.)\nFlying\nWhen Stoic Ephemera blocks, sacrifice it at end of combat. Oracle:Defender (This creature can't attack.)\nFlying\nWhen Stoic Ephemera blocks, sacrifice it at end of combat.

View File

@@ -5,9 +5,8 @@ PT:0/2
A:AB$ ChangeZone | Cost$ 2 U U T | ValidTgts$ Permanent.unenchanted | TgtPrompt$ Select target unenchanted permanent | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return target permanent that isn't enchanted to its owner's hand. A:AB$ ChangeZone | Cost$ 2 U U T | ValidTgts$ Permanent.unenchanted | TgtPrompt$ Select target unenchanted permanent | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return target permanent that isn't enchanted to its owner's hand.
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelayedTrig | TriggerDescription$ When CARDNAME attacks or blocks, at end of combat, sacrifice it and it deals 5 damage to you. T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ DelayedTrig | TriggerDescription$ When CARDNAME attacks or blocks, at end of combat, sacrifice it and it deals 5 damage to you.
T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelayedTrig | Secondary$ True | TriggerDescription$ When CARDNAME attacks or blocks, at end of combat, sacrifice it and it deals 5 damage to you. T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ DelayedTrig | Secondary$ True | TriggerDescription$ When CARDNAME attacks or blocks, at end of combat, sacrifice it and it deals 5 damage to you.
SVar:DelayedTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSac | TriggerDescription$ At end of combat, sacrifice CARDNAME and CARDNAME deals 5 damage to you. SVar:DelayedTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigSacrifice | TriggerDescription$ At end of combat, sacrifice CARDNAME and CARDNAME deals 5 damage to you.
SVar:TrigSac:DB$Sacrifice | Defined$ Self | SubAbility$ DBDamage SVar:TrigSacrifice:DB$ SacrificeAll | Defined$ DelayTriggerRememberedLKI | SubAbility$ DBDamage
SVar:DBDamage:DB$DealDamage | NumDmg$ 5 | Defined$ You SVar:DBDamage:DB$DealDamage | NumDmg$ 5 | Defined$ You
AI:RemoveDeck:All AI:RemoveDeck:All
SVar:Picture:http://www.wizards.com/global/images/magic/general/time_elemental.jpg
Oracle:When Time Elemental attacks or blocks, at end of combat, sacrifice it and it deals 5 damage to you.\n{2}{U}{U}, {T}: Return target permanent that isn't enchanted to its owner's hand. Oracle:When Time Elemental attacks or blocks, at end of combat, sacrifice it and it deals 5 damage to you.\n{2}{U}{U}, {T}: Return target permanent that isn't enchanted to its owner's hand.

View File

@@ -3,7 +3,6 @@ ManaCost:3
Types:Artifact Types:Artifact
A:AB$ Pump | Cost$ 4 | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ +X | SubAbility$ DBDelay | AILogic$ Berserk | SpellDescription$ Target creature gets +X/+0 until end of turn, where X is its power. Sacrifice CARDNAME at the beginning of the next end step. A:AB$ Pump | Cost$ 4 | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ +X | SubAbility$ DBDelay | AILogic$ Berserk | SpellDescription$ Target creature gets +X/+0 until end of turn, where X is its power. Sacrifice CARDNAME at the beginning of the next end step.
SVar:DBDelay:DB$ DelayedTrigger | Mode$ Phase | Phase$ End Of Turn | Execute$ TrigSac | TriggerDescription$ Sacrifice CARDNAME at the beginning of the next end step. SVar:DBDelay:DB$ DelayedTrigger | Mode$ Phase | Phase$ End Of Turn | Execute$ TrigSac | TriggerDescription$ Sacrifice CARDNAME at the beginning of the next end step.
SVar:TrigSac:DB$ SacrificeAll | Defined$ Self | Controller$ You SVar:TrigSac:DB$ SacrificeAll | Defined$ DelayTriggerRememberedLKI | Controller$ You
SVar:X:Targeted$CardPower SVar:X:Targeted$CardPower
SVar:Picture:http://www.wizards.com/global/images/magic/general/wine_of_blood_and_iron.jpg
Oracle:{4}: Target creature gets +X/+0 until end of turn, where X is its power. Sacrifice Wine of Blood and Iron at the beginning of the next end step. Oracle:{4}: Target creature gets +X/+0 until end of turn, where X is its power. Sacrifice Wine of Blood and Iron at the beginning of the next end step.