Fix chooseCardsToDiscardFrom

This commit is contained in:
tool4EvEr
2022-05-05 22:13:30 +02:00
parent 50e068e047
commit 11195e64d2
9 changed files with 11 additions and 21 deletions

View File

@@ -3,6 +3,6 @@ ManaCost:2
Types:Artifact
A:AB$ PeekAndReveal | Cost$ 4 T | NoPeek$ True | RememberRevealed$ True | SubAbility$ DBCandlesChangeZone | SpellDescription$ Reveal the top card of your library.
SVar:DBCandlesChangeZone:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Graveyard | ConditionDefined$ Remembered | ConditionPresent$ Card.sharesNameWith YourGraveyard | SubAbility$ DBCandlesDraw | StackDescription$ If it has the same name as a card in their graveyard, they put it into their graveyard. | SpellDescription$ If it has the same name as a card in your graveyard, put it into your graveyard.
SVar:DBCandlesDraw:DB$ Draw | ConditionDefined$ Remembered | ConditionPresent$ Card.sharesNameWith YourGraveyard | ConditionCompare$ EQ0 | SubAbility$ DBCandlesCleanup | StackDescription$ Otherwise, they draw a card. | SpellDescription$ Otherwise, draw a card.
SVar:DBCandlesDraw:DB$ Draw | ConditionDefined$ Remembered | ConditionPresent$ Card.sharesNameWith YourGraveyard | ConditionCompare$ EQ0 | SubAbility$ DBCandlesCleanup | StackDescription$ Otherwise, they draw a card. | SpellDescription$ Otherwise, draw a card.
SVar:DBCandlesCleanup:DB$ Cleanup | ClearRemembered$ True
Oracle:{4}, {T}: Reveal the top card of your library. If it has the same name as a card in your graveyard, put it into your graveyard. Otherwise, draw a card.

View File

@@ -5,6 +5,6 @@ PT:3/3
S:Mode$ Continuous | Affected$ Permanent.Dwarf+Other+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Other Dwarves you control get +1/+1.
S:Mode$ Continuous | Affected$ Creature.Vehicle+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Each Vehicle you control gets +1/+1 as long as it's a creature.
T:Mode$ Taps | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigDig | TriggerDescription$ Whenever CARDNAME becomes tapped, you may pay {X}. If you do, reveal the top X cards of your library, put all Dwarf and Vehicle cards from among them into your hand, then put the rest on the bottom of your library in a random order.
SVar:TrigDig:AB$Dig | Cost$ X | DigNum$ X | Reveal$ True | ChangeNum$ All | DestinationZone$ Hand | DestinationZone2$ Library | LibraryPosition$ -1 | RestRandomOrder$ True | ChangeValid$ Dwarf,Vehicle | AILogic$ PayXButSaveMana.3
SVar:TrigDig:AB $Dig | Cost$ X | DigNum$ X | Reveal$ True | ChangeNum$ All | DestinationZone$ Hand | DestinationZone2$ Library | LibraryPosition$ -1 | RestRandomOrder$ True | ChangeValid$ Dwarf,Vehicle | AILogic$ PayXButSaveMana.3
SVar:X:Count$xPaid
Oracle:Other Dwarves you control get +1/+1.\nEach Vehicle you control gets +1/+1 as long as it's a creature.\nWhenever Depala, Pilot Exemplar becomes tapped, you may pay {X}. If you do, reveal the top X cards of your library, put all Dwarf and Vehicle cards from among them into your hand, then put the rest on the bottom of your library in a random order.

View File

@@ -1,7 +1,7 @@
Name:Epiphany at the Drownyard
ManaCost:X U
Types:Instant
A:SP$ PeekAndReveal | Cost$ X U | PeekAmount$ Y | RememberRevealed$ True | NoPeek$ True | SubAbility$ DBTwoPiles | AILogic$ PayX | SpellDescription$ Reveal the top X plus one cards of your library and separate them into two piles. An opponent chooses one of those piles. Put that pile into your hand and the other into your graveyard.
A:SP$ PeekAndReveal | Cost$ X U | PeekAmount$ Y | RememberRevealed$ True | NoPeek$ True | SubAbility$ DBTwoPiles | SpellDescription$ Reveal the top X plus one cards of your library and separate them into two piles. An opponent chooses one of those piles. Put that pile into your hand and the other into your graveyard.
SVar:DBTwoPiles:DB$ TwoPiles | Chooser$ Opponent | DefinedCards$ Remembered | Separator$ You | ChosenPile$ DBHand | UnchosenPile$ DBGrave | AILogic$ Worst
SVar:DBHand:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand | SubAbility$ DBCleanup
SVar:DBGrave:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Graveyard | SubAbility$ DBCleanup

View File

@@ -2,5 +2,5 @@ Name:Orcish Spy
ManaCost:R
Types:Creature Orc Rogue
PT:1/1
A:AB$ PeekAndReveal | Cost$ T | ValidTgts$ Player | PeekAmount$ 3 | NoReveal$ True | AILogic$ Never | SpellDescription$ Look at the top three cards of target player's library.
A:AB$ PeekAndReveal | Cost$ T | ValidTgts$ Player | PeekAmount$ 3 | NoReveal$ True | SpellDescription$ Look at the top three cards of target player's library.
Oracle:{T}: Look at the top three cards of target player's library.

View File

@@ -1,7 +1,7 @@
Name:Prophecy
ManaCost:W
Types:Sorcery
A:SP$ Dig | ValidTgts$ Opponent | NoPeek$ True | RememberRevealed$ True | SubAbility$ DBGainLife | SpellDescription$ Reveal the top card of target opponent's library. If it's a land, you gain 1 life. Then that player shuffles. Draw a card at the beginning of the next turn's upkeep.
A:SP$ PeekAndReveal | ValidTgts$ Opponent | NoPeek$ True | RememberRevealed$ True | SubAbility$ DBGainLife | SpellDescription$ Reveal the top card of target opponent's library. If it's a land, you gain 1 life. Then that player shuffles. Draw a card at the beginning of the next turn's upkeep.
SVar:DBGainLife:DB$ GainLife | LifeAmount$ 1 | ConditionDefined$ Remembered | ConditionPresent$ Card.Land | ConditionCompare$ GE1 | SubAbility$ DBShuffle
SVar:DBShuffle:DB$ Shuffle | Defined$ ParentTarget | SubAbility$ DelTrigSlowtrip
SVar:DelTrigSlowtrip:DB$ DelayedTrigger | NextTurn$ True | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Player | Execute$ DrawSlowtrip | TriggerDescription$ Draw a card at the beginning of the next turn's upkeep.

View File

@@ -1,7 +1,7 @@
Name:Visions
ManaCost:W
Types:Sorcery
A:SP$ Dig | ValidTgts$ Player | PeekAmount$ 5 | NoReveal$ True | SubAbility$ DBShuffle | SpellDescription$ Look at the top five cards of target player's library. You may then have that player shuffle that library.
A:SP$ PeekAndReveal | ValidTgts$ Player | PeekAmount$ 5 | NoReveal$ True | SubAbility$ DBShuffle | SpellDescription$ Look at the top five cards of target player's library. You may then have that player shuffle that library.
SVar:DBShuffle:DB$ Shuffle | Defined$ Targeted | Optional$ True
AI:RemoveDeck:All
Oracle:Look at the top five cards of target player's library. You may then have that player shuffle that library.

View File

@@ -1,7 +1,7 @@
Name:Wand of Denial
ManaCost:2
Types:Artifact
A:AB$ Dig | Cost$ T | ValidTgts$ Player | NoReveal$ True | RememberPeeked$ True | SubAbility$ DBChangeZone | StackDescription$ SpellDescription | SpellDescription$ Look at the top card of target player's library. If it's a nonland card, you may pay 2 life. If you do, put it into that player's graveyard.
A:AB$ PeekAndReveal | Cost$ T | ValidTgts$ Player | NoReveal$ True | RememberPeeked$ True | SubAbility$ DBChangeZone | StackDescription$ SpellDescription | SpellDescription$ Look at the top card of target player's library. If it's a nonland card, you may pay 2 life. If you do, put it into that player's graveyard.
SVar:DBChangeZone:DB$ Mill | Defined$ Targeted | NumCards$ 1 | ConditionDefined$ Remembered | ConditionPresent$ Card.nonLand | ConditionCompare$ GE1 | UnlessPayer$ You | UnlessCost$ PayLife<2> | UnlessSwitched$ True | StackDescription$ None | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
AI:RemoveDeck:All

View File

@@ -1114,23 +1114,13 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
@Override
public CardCollectionView chooseCardsToDiscardFrom(final Player p, final SpellAbility sa,
final CardCollection valid, final int min, final int max) {
if (GuiBase.getInterface().isLibgdxPort()) {
boolean optional = min == 0;
tempShowCards(valid);
GameEntityViewMap<Card, CardView> gameCacheDiscard = GameEntityView.getMap(valid);
List<CardView> views = getGui().many(String.format(localizer.getMessage("lblChooseMinCardToDiscard"), optional ? max : min),
localizer.getMessage("lblDiscarded"), min, max, gameCacheDiscard.getTrackableKeys(), null);
endTempShowCards();
final CardCollection choices = new CardCollection();
gameCacheDiscard.addToList(views, choices);
return choices;
}
boolean optional = min == 0;
if (p != player) {
tempShowCards(valid);
GameEntityViewMap<Card, CardView> gameCacheDiscard = GameEntityView.getMap(valid);
List<CardView> views = getGui().many(String.format(localizer.getMessage("lblChooseMinCardToDiscard"), min),
localizer.getMessage("lblDiscarded"), min, min, gameCacheDiscard.getTrackableKeys(), null);
List<CardView> views = getGui().many(String.format(localizer.getMessage("lblChooseMinCardToDiscard"), optional ? max : min),
localizer.getMessage("lblDiscarded"), min, max, gameCacheDiscard.getTrackableKeys(), null);
endTempShowCards();
final CardCollection choices = new CardCollection();
gameCacheDiscard.addToList(views, choices);