Merge pull request #3570 from tool4ever/fix31

Fix NPE
This commit is contained in:
kevlahnota
2023-08-01 01:47:55 +08:00
committed by GitHub
7 changed files with 10 additions and 13 deletions

View File

@@ -86,12 +86,6 @@ public class CounterEffect extends SpellAbilityEffect {
sas = getTargetSpells(sa);
}
if (sa.hasParam("ForgetOtherTargets")) {
if (sa.getParam("ForgetOtherTargets").equals("True")) {
sa.getHostCard().clearRemembered();
}
}
Map<AbilityKey, Object> params = AbilityKey.newMap();
CardZoneTable table = new CardZoneTable();
for (final SpellAbility tgtSA : sas) {
@@ -102,6 +96,9 @@ public class CounterEffect extends SpellAbilityEffect {
if (sa.hasParam("RememberCounteredCMC")) {
sa.getHostCard().addRemembered(Integer.valueOf(tgtSACard.getCMC()));
}
if (sa.hasParam("RememberForCounter")) {
sa.getHostCard().addRemembered(tgtSACard);
}
if (tgtSA.isSpell() && !CardFactoryUtil.isCounterableBy(tgtSACard, sa)) {
continue;

View File

@@ -128,7 +128,7 @@ public class DigUntilEffect extends SpellAbilityEffect {
boolean shuffle = sa.hasParam("Shuffle");
final boolean optional = sa.hasParam("Optional");
final boolean optionalFound = sa.hasParam("OptionalFoundMove");
boolean sequential = digSite == ZoneType.Library && revealedDest.equals(foundDest);
boolean sequential = digSite == ZoneType.Library && revealedDest != null && revealedDest.equals(foundDest);
CardZoneTable table = new CardZoneTable();
boolean combatChanged = false;

View File

@@ -8,7 +8,7 @@ SVar:Planeswalker:DB$ Pump | ValidTgts$ Planeswalker | TgtPrompt$ Select up to o
SVar:Land:DB$ Pump | ValidTgts$ Land | TgtPrompt$ Select up to one target land | TargetMin$ 0 | TargetMax$ 1 | IsCurse$ True | SubAbility$ DBExile | StackDescription$ None
SVar:DBExile:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | Defined$ Targeted | SubAbility$ DBRepeatPlayer | Imprint$ True
SVar:DBRepeatPlayer:DB$ RepeatEach | RepeatPlayers$ ImprintedController | RepeatSubAbility$ DBRepeatCard | SubAbility$ DBCleanup | SpellDescription$ For each permanent exiled this way, its controller reveals cards from the top of their library until they reveal a card that shares a card type with it, puts that card onto the battlefield, then shuffles.
SVar:DBRepeatCard:DB$ RepeatEach | RepeatCards$ Card.IsImprinted+RememberedPlayerCtrl | Zone$ Exile | ChooseOrder$ RememberedPlayer | RepeatSubAbility$ DBDigUntil
SVar:DBRepeatCard:DB$ RepeatEach | DefinedCards$ ImprintedLKI.RememberedPlayerCtrl | ChooseOrder$ RememberedPlayer | RepeatSubAbility$ DBDigUntil
SVar:DBDigUntil:DB$ DigUntil | Valid$ Card.sharesCardTypeWith RememberedLKI | FoundDestination$ Battlefield | Defined$ RememberedController | Shuffle$ True | RevealedDestination$ Library | RevealedLibraryPosition$ -1
SVar:DBCleanup:DB$ Cleanup | ClearImprinted$ True
Oracle:Exile up to one target artifact, up to one target creature, up to one target enchantment, up to one target planeswalker, and/or up to one target land. For each permanent exiled this way, its controller reveals cards from the top of their library until they reveal a card that shares a card type with it, puts that card onto the battlefield, then shuffles.

View File

@@ -5,7 +5,7 @@ PT:3/2
K:Flash
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigCharm | TriggerDescription$ When CARDNAME enters the battlefield, ABILITY
SVar:TrigCharm:DB$ Charm | MinCharmNum$ 0 | CharmNum$ 1 | Choices$ DBCounter,DBDestroy
SVar:DBCounter:DB$ Counter | TargetType$ Spell,Activated,Triggered | TgtPrompt$ Select target spell or ability | ValidTgts$ Card,Emblem | SubAbility$ DBDraw | SpellDescription$ Counter target spell, activated ability, or triggered ability. Its controller draws a card.
SVar:DBCounter:DB$ Counter | TargetType$ Spell,Activated,Triggered | TgtPrompt$ Select target spell or ability | ValidTgts$ Card,Emblem | RememberForCounter$ True | SubAbility$ DBDraw | SpellDescription$ Counter target spell, activated ability, or triggered ability. Its controller draws a card.
SVar:DBDestroy:DB$ Destroy | ValidTgts$ Creature.Other,Planeswalker.Other | TgtPrompt$ Select another target creature or planeswalker | AlwaysRemember$ True | RememberLKI$ True | SubAbility$ DBDraw | SpellDescription$ Destroy another target creature or planeswalker. Its controller draws a card.
SVar:DBDraw:DB$ Draw | Defined$ RememberedController | NumCards$ 1 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True

View File

@@ -1,6 +1,6 @@
Name:Glorious Gale
ManaCost:1 U
Types:Instant
A:SP$ Counter | Cost$ 1 U | TargetType$ Spell | TgtPrompt$ Select target creature spell | RememberCountered$ True | ValidTgts$ Card.Creature | SubAbility$ TrigTempt | SpellDescription$ Counter target creature spell. If it was a legendary spell, the Ring tempts you.
A:SP$ Counter | Cost$ 1 U | TargetType$ Spell | TgtPrompt$ Select target creature spell | ValidTgts$ Card.Creature | SubAbility$ TrigTempt | SpellDescription$ Counter target creature spell. If it was a legendary spell, the Ring tempts you.
SVar:TrigTempt:DB$ RingTemptsYou | ConditionDefined$ Targeted | ConditionPresent$ Spell.Legendary
Oracle:Counter target creature spell. If it was a legendary spell, the Ring tempts you.

View File

@@ -4,7 +4,7 @@ Types:Creature Naga Wizard
PT:3/3
K:Morph:4 U U
T:Mode$ TurnFaceUp | ValidCard$ Card.Self | Execute$ TrigCounter | TriggerZones$ Battlefield | TriggerDescription$ When CARDNAME is turned face up, counter target spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. You may cast that card without paying its mana cost as long as it remains exiled.
SVar:TrigCounter:DB$ Counter | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | RememberCountered$ True | ForgetOtherTargets$ True | Destination$ Exile | SubAbility$ DBEffect
SVar:TrigCounter:DB$ Counter | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | RememberCountered$ True | Destination$ Exile | SubAbility$ DBEffect
SVar:DBEffect:DB$ Effect | RememberObjects$ Remembered | StaticAbilities$ STPlay | Duration$ Permanent | ForgetOnMoved$ Exile | SubAbility$ DBCleanup
SVar:STPlay:Mode$ Continuous | MayPlay$ True | MayPlayWithoutManaCost$ True | EffectZone$ Command | Affected$ Card.IsRemembered+nonLand | AffectedZone$ Exile | Description$ You may cast cards without paying their mana cost as long as they remain exiled.
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True

View File

@@ -1,8 +1,8 @@
Name:Lobotomy
ManaCost:2 U B
Types:Sorcery
A:SP$ RevealHand | Cost$ 2 U B | ValidTgts$ Player | SubAbility$ ChooseCard | StackDescription$ SpellDescription | SpellDescription$ Target player reveals their hand.
SVar:ChooseCard:DB$ ChooseCard | Choices$ Card.nonBasic+TargetedPlayerCtrl+inZoneHand | ChoiceZone$ Hand | SubAbility$ ExileYard | RememberChosen$ True | ForgetOtherTargets$ True | SpellDescription$ Target player reveals their hand, then you choose a card other than a basic land card from it. Search that player's graveyard, hand, and library for all cards with the same name as the chosen card and exile them. Then that player shuffles.
A:SP$ RevealHand | Cost$ 2 U B | ValidTgts$ Player | SubAbility$ ChooseCard | StackDescription$ SpellDescription | SpellDescription$ Target player reveals their hand,
SVar:ChooseCard:DB$ ChooseCard | Choices$ Card.nonBasic+TargetedPlayerCtrl+inZoneHand | ChoiceZone$ Hand | SubAbility$ ExileYard | RememberChosen$ True | ForgetOtherTargets$ True | SpellDescription$ then you choose a card other than a basic land card from it. Search that player's graveyard, hand, and library for all cards with the same name as the chosen card and exile them. Then that player shuffles.
SVar:ExileYard:DB$ ChangeZoneAll | Origin$ Graveyard | Destination$ Exile | Defined$ Targeted | ChangeType$ Remembered.sameName | SubAbility$ ExileHand | StackDescription$ None
SVar:ExileHand:DB$ ChangeZone | Origin$ Hand | Destination$ Exile | DefinedPlayer$ Targeted | ChangeType$ Remembered.sameName | ChangeNum$ NumInHand | Chooser$ You | SubAbility$ ExileLib | AlreadyRevealed$ True | StackDescription$ None
SVar:ExileLib:DB$ ChangeZone | Origin$ Library | Destination$ Exile | DefinedPlayer$ Targeted | ChangeType$ Remembered.sameName | ChangeNum$ NumInLib | Chooser$ You | Search$ True | Shuffle$ True | SubAbility$ DBCleanup | StackDescription$ None