Merge pull request #114 from Northmoc/peekfix

PeekAndReveal stackDesc NPE fix
This commit is contained in:
Agetian
2022-04-21 21:18:41 +03:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -32,11 +32,12 @@ public class PeekAndRevealEffect extends SpellAbilityEffect {
final int numPeek = sa.hasParam("PeekAmount") ?
AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("PeekAmount"), sa) : 1;
final String verb = sa.hasParam("NoReveal") ? " looks at " : " reveals ";
final String defined = sa.getParam("Defined");
final String verb = sa.hasParam("NoReveal") || sa.hasParam("RevealOptional") ? " looks at " :
" reveals ";
final String defined = sa.getParamOrDefault("Defined", "their");
String whose;
if (defined.equals("Player")) {
whose = "each player's ";
whose = "each player's";
} else { // other else ifs for specific defined can be added above as needs arise
whose = Lang.joinHomogenous(getTargetPlayers(sa));
}

View File

@@ -3,7 +3,7 @@ ManaCost:U
Types:Snow Creature Human Wizard
PT:1/2
A:AB$ PeekAndReveal | Cost$ S T | PeekAmount$ 1 | RevealValid$ Snow | RevealOptional$ True | RememberRevealed$ True | SubAbility$ DBChangeZone | SpellDescription$ Look at the top card of your library. If it's a snow card, you may reveal it and put it into your hand.
SVar:DBChangeZone:DB$ ChangeZone | Defined$ TopOfLibrary | Origin$ Library | Destination$ Hand | ConditionDefined$ Remembered | ConditionPresent$ Snow | ConditionCompare$ EQ1 | SubAbility$ DBCleanup
SVar:DBChangeZone:DB$ ChangeZone | Defined$ TopOfLibrary | Origin$ Library | Destination$ Hand | ConditionDefined$ Remembered | ConditionPresent$ Snow | ConditionCompare$ EQ1 | SubAbility$ DBCleanup | StackDescription$ If it's a snow card, {p:You} may reveal it and put it into their hand.
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
DeckNeeds:Type$Snow
Oracle:{S}, {T}: Look at the top card of your library. If it's a snow card, you may reveal it and put it into your hand. ({S} can be paid with one mana from a snow source.)