-
-
Notifications
You must be signed in to change notification settings - Fork 36
Legacy select format card support #1387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
54ccf7e
e22a50d
edda929
511a5cd
6437595
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| package tcgwars.logic.impl.gen8 | ||
|
|
||
| import tcgwars.logic.impl.gen5.DarkExplorers | ||
|
|
||
| import static tcgwars.logic.card.Type.* | ||
| import static tcgwars.logic.groovy.TcgBuilders.*; | ||
|
|
@@ -151,24 +152,24 @@ public enum AstralRadiance implements ImplOnlyCardInfo { | |
| CANCELING_COLOGNE_136, | ||
| CHOY_137, | ||
| CYLLENE_138, | ||
| DARK_PATCH_139, | ||
| DARK_PATCH_139 ("Dark Patch", "139", Rarity.UNCOMMON, [ITEM, TRAINER]), | ||
| ENERGY_LOTO_140, | ||
| FEATHER_BALL_141, | ||
| GAPEJAW_BOG_142, | ||
| GARDENIA_S_VIGOR_143, | ||
| GRANT_144, | ||
| GUTSY_PICKAXE_145, | ||
| HISUIAN_HEAVY_BALL_146, | ||
| HISUIAN_HEAVY_BALL_146 ("Hisuian Heavy Ball", "146", Rarity.UNCOMMON, [ITEM, TRAINER]), | ||
| IRIDA_147, | ||
| JUBILIFE_VILLAGE_148, | ||
| KAMADO_149, | ||
| ROXANNE_150, | ||
| SPICY_SEASONED_CURRY_151, | ||
| SUPEREFFECTIVE_GLASSES_152, | ||
| SUPEREFFECTIVE_GLASSES_152 ("Supereffective Glasses", "152", Rarity.UNCOMMON, [POKEMON_TOOL, ITEM, TRAINER]), | ||
| SWEET_HONEY_153, | ||
| SWITCH_CART_154, | ||
| TEMPLE_OF_SINNOH_155, | ||
| TREKKING_SHOES_156, | ||
| TEMPLE_OF_SINNOH_155 ("Temple of Sinnoh", "155", Rarity.UNCOMMON, [STADIUM, TRAINER]), | ||
| TREKKING_SHOES_156 ("Trekking Shoes", "156", Rarity.UNCOMMON, [ITEM, TRAINER]), | ||
| UNIDENTIFIED_FOSSIL_157, | ||
| WAIT_AND_SEE_TURBO_158, | ||
| ZISU_159, | ||
|
|
@@ -1829,13 +1830,8 @@ public enum AstralRadiance implements ImplOnlyCardInfo { | |
|
|
||
|
|
||
|
|
||
| case DARK_PATCH_139: return cardng (stub) { | ||
| // Attach a basic [D] Energy card from your discard pile to 1 of your Benched [D] Pokémon. | ||
| onPlay { | ||
| } | ||
| playRequirement{ | ||
| } | ||
| } | ||
| case DARK_PATCH_139: | ||
| return copy(DarkExplorers.DARK_PATCH_93, this) | ||
|
Comment on lines
+1833
to
+1834
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the new implementations this is now specified in cards/yaml files in "variantOf" field instead of the implementation files. Once that's specified then during the implementation discovery phase, it automatically receives the implementation of the variant. Then these lines should be deleted. Sorry, it's an undocumented new part of the engine. |
||
|
|
||
|
|
||
|
|
||
|
|
@@ -1899,13 +1895,26 @@ public enum AstralRadiance implements ImplOnlyCardInfo { | |
|
|
||
|
|
||
|
|
||
| case HISUIAN_HEAVY_BALL_146: return cardng (stub) { | ||
| // Look at your face-down Prize cards. You may reveal a Basic Pokémon you find there, put it into your hand, and put this Hisuian Heavy Ball in its place as a face-down Prize card. (If you don't reveal a Basic Pokémon, put this card in the discard pile.) Then, shuffle your face-down Prize cards. | ||
| onPlay { | ||
| } | ||
| playRequirement{ | ||
| } | ||
| } | ||
| case HISUIAN_HEAVY_BALL_146: | ||
| return itemCard (this) { | ||
| text "Look at your face-down Prize cards. You may reveal a Basic Pokémon you find there, put it into your hand, and put this Hisuian Heavy Ball in its place as a face-down Prize card. (If you don't reveal a Basic Pokémon, put this card in the discard pile.) Then, shuffle your face-down Prize cards.\nYou may play any number of Item cards during your turn." | ||
| onPlay { | ||
| my.prizeCardSet.showToMe("Your prizes") | ||
| if(my.prizeCardSet.has(BASIC)){ | ||
| def tar = my.prizeCardSet.filterByType(BASIC).select(min:0,"Replace $thisCard with one of your prizes?") | ||
| if(tar){ | ||
| tar.showToOpponent("Your opponent put this card in his hand") | ||
| my.hand.remove(thisCard) | ||
| my.prizeCardSet.set(my.prizeCardSet.indexOf(tar.first()), thisCard) | ||
| my.hand.add(tar.first()) | ||
| bc "Took $tar and shuffled $thisCard into prizes" | ||
| } | ||
| my.prizeCardSet.shuffle() | ||
| } | ||
| } | ||
| playRequirement{ | ||
| } | ||
| }; | ||
|
Comment on lines
+1898
to
+1917
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need go one step above, meaning that we are now using cardng structure instead with no metadata. |
||
|
|
||
|
|
||
|
|
||
|
|
@@ -1959,15 +1968,24 @@ public enum AstralRadiance implements ImplOnlyCardInfo { | |
|
|
||
|
|
||
|
|
||
| case SUPEREFFECTIVE_GLASSES_152: return cardng (stub) { | ||
| // When applying Weakness to damage from the attacks of the Pokémon this card is attached to done to your opponent's Active Pokémon, apply it as ×3. | ||
| onPlay {reason-> | ||
| } | ||
| onRemoveFromPlay { | ||
| } | ||
| allowAttach {to-> | ||
| } | ||
| } | ||
| case SUPEREFFECTIVE_GLASSES_152: | ||
| return pokemonTool (this) { | ||
| text "When applying Weakness to damage from the attacks of the Pokémon this card is attached to done to your opponent's Active Pokémon, apply it as ×3.\nYou may play any number of Item cards during your turn.\nAttach a Pokémon Tool to 1 of your Pokémon that doesn't already have a Pokémon Tool attached." | ||
| def eff | ||
| onPlay {reason-> | ||
| effect = delayed { | ||
| before APPLY_WEAKNESS, { | ||
| bg.dm().each{ | ||
| if(it.from==self && it.to.active){ | ||
| it.flags.add(DamageManager.DamageFlag.FORCE_X3_WEAKNESS) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| onRemoveFromPlay { | ||
| effect.unregister() | ||
| } | ||
| }; | ||
|
Comment on lines
+1971
to
+1988
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as before the structure must match cardng |
||
|
|
||
|
|
||
|
|
||
|
|
@@ -1991,23 +2009,48 @@ public enum AstralRadiance implements ImplOnlyCardInfo { | |
|
|
||
|
|
||
|
|
||
| case TEMPLE_OF_SINNOH_155: return cardng (stub) { | ||
| // All Special Energy attached to Pokémon (both yours and your opponent's) provide [C] Energy and have no other effect. | ||
| onPlay { | ||
| } | ||
| onRemoveFromPlay{ | ||
| } | ||
| } | ||
| case TEMPLE_OF_SINNOH_155: | ||
| return stadium (this) { | ||
| text "Each player's evolved Pokémon can use any attack from its previous Evolutions. (That player still needs the necessary Energy to use each attack.)" | ||
| def effect | ||
| onPlay { | ||
| prevent_energy_effect = delayed { | ||
| before null, null, Source.SRC_SPECIAL_ENERGY, { | ||
| if (self.active && self.checkSpecialConditionsForClassic()) { | ||
| prevent() | ||
| } | ||
| } | ||
| } | ||
| cancel_special_energy_type = getter (GET_ENERGY_TYPES) {holder-> | ||
| if(holder.effect.target != null && holder.effect.card.cardTypes.is(SPECIAL_ENERGY)) { | ||
| holder.object = [[C] as Set] | ||
| } | ||
| } | ||
| } | ||
| onRemoveFromPlay{ | ||
| prevent_energy_effect.unregister() | ||
| cancel_special_energy_type.unregister() | ||
| } | ||
| }; | ||
|
|
||
|
|
||
|
|
||
| case TREKKING_SHOES_156: return cardng (stub) { | ||
| // Look at the top card of your deck. You may put that card into your hand. If you don't, discard that card and draw a card. | ||
| onPlay { | ||
| } | ||
| playRequirement{ | ||
| } | ||
| } | ||
| case TREKKING_SHOES_156: | ||
| return itemCard (this) { | ||
| text "Look at the top card of your deck. You may put that card into your hand. If you don't, discard that card and draw a card.\nYou may play as many Item cards as you like during your turn (before your attack)." | ||
| onPlay { | ||
| my.deck.subList(0,1).showToMe("Top card of your deck") | ||
| if(confirm("Draw ${my.deck.subList(0,1).first()}?")){ | ||
| draw 1 | ||
| } else { | ||
| my.deck.subList(0,1).discard() | ||
| draw 1 | ||
| } | ||
| } | ||
| playRequirement{ | ||
| assert my.deck : "There is no more card in your deck" | ||
| } | ||
| }; | ||
|
|
||
|
|
||
|
|
||
|
|
@@ -2237,4 +2280,4 @@ public enum AstralRadiance implements ImplOnlyCardInfo { | |
| return null; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| package tcgwars.logic.impl.gen8 | ||
|
|
||
| import tcgwars.logic.impl.gen2.GymHeroes | ||
| import tcgwars.logic.impl.gen5.DarkExplorers | ||
|
|
||
| import static tcgwars.logic.card.HP.*; | ||
| import static tcgwars.logic.card.Type.*; | ||
| import static tcgwars.logic.card.CardType.*; | ||
|
|
@@ -160,15 +163,15 @@ public enum BrilliantStars implements ImplOnlyCardInfo { | |
| TORNADUS_126, | ||
| HAWLUCHA_127, | ||
| DRAMPA_V_128, | ||
| ACEROLA_S_PREMONITION_129, | ||
| ACEROLA_S_PREMONITION_129 ("Acerola's Premonition", "129", Rarity.UNCOMMON, [SUPPORTER, TRAINER]), | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metadata is now split to YAML files so this line should be reverted |
||
| BARRY_130, | ||
| BLUNDER_POLICY_131, | ||
| BOSS_S_ORDERS_132, | ||
| CAFE_MASTER_133, | ||
| CHEREN_S_CARE_134, | ||
| CHOICE_BELT_135, | ||
| CLEANSING_GLOVES_136, | ||
| COLLAPSED_STADIUM_137, | ||
| COLLAPSED_STADIUM_137 ("Collapsed Stadium", "137", Rarity.UNCOMMON, [TRAINER, STADIUM]), | ||
| CYNTHIA_S_AMBITION_138, | ||
| FRESH_WATER_SET_139, | ||
| FRIENDS_IN_GALAR_140, | ||
|
|
@@ -181,8 +184,8 @@ public enum BrilliantStars implements ImplOnlyCardInfo { | |
| PROFESSOR_S_RESEARCH_147, | ||
| ROSEANNE_S_BACKUP_148, | ||
| TEAM_YELL_S_CHEER_149, | ||
| ULTRA_BALL_150, | ||
| DOUBLE_TURBO_ENERGY_151, | ||
| ULTRA_BALL_150 ("Ultra Ball", "150", Rarity.UNCOMMON, [ITEM, TRAINER]), | ||
| DOUBLE_TURBO_ENERGY_151 ("Double Turbo Energy", "151", Rarity.UNCOMMON, [ENERGY, SPECIAL_ENERGY]), | ||
| SHAYMIN_V_152, | ||
| CHARIZARD_V_153, | ||
| CHARIZARD_V_154, | ||
|
|
@@ -1765,13 +1768,19 @@ public enum BrilliantStars implements ImplOnlyCardInfo { | |
|
|
||
|
|
||
|
|
||
| case ACEROLA_S_PREMONITION_129: return cardng (stub) { | ||
| // Your opponent reveals their hand, and you draw a card for each Trainer card you find there. | ||
| onPlay { | ||
| } | ||
| playRequirement{ | ||
| } | ||
| } | ||
| case ACEROLA_S_PREMONITION_129: | ||
| return supporter (this) { | ||
| text "Your opponent reveals their hand, and you draw a card for each Trainer card you find there.\nYou may play only 1 Supporter card during your turn." | ||
| onPlay { | ||
| def sel=opp.hand.showToMe("Opponent's hand").filterByType(ITEM) | ||
| if(sel){ | ||
| draw sel.size(), TargetPlayer.SELF | ||
| } | ||
| } | ||
| playRequirement{ | ||
| assert opp.hand | ||
| } | ||
| }; | ||
|
|
||
|
|
||
|
|
||
|
|
@@ -1843,13 +1852,8 @@ public enum BrilliantStars implements ImplOnlyCardInfo { | |
|
|
||
|
|
||
|
|
||
| case COLLAPSED_STADIUM_137: return cardng (stub) { | ||
| // Each player can't have more than 4 Benched Pokémon. If a player has 5 or more Benched Pokémon, they discard Benched Pokémon until they have 4 Pokémon on the Bench. The player who played this card discards first. If more than one effect changes the number of Benched Pokémon allowed, use the smaller number. | ||
| onPlay { | ||
| } | ||
| onRemoveFromPlay{ | ||
| } | ||
| } | ||
| case COLLAPSED_STADIUM_137: | ||
| return copy(GymHeroes.NARROW_GYM_124, this) | ||
|
Comment on lines
+1855
to
+1856
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be specified as a variant as well since it has the same text. |
||
|
|
||
|
|
||
|
|
||
|
|
@@ -1969,27 +1973,39 @@ public enum BrilliantStars implements ImplOnlyCardInfo { | |
|
|
||
|
|
||
|
|
||
| case ULTRA_BALL_150: return cardng (stub) { | ||
| // You can use this card only if you discard 2 other cards from your hand. Search your deck for a Pokémon, reveal it, and put it into your hand. Then, shuffle your deck. | ||
| onPlay { | ||
| } | ||
| playRequirement{ | ||
| } | ||
| } | ||
| case ULTRA_BALL_150: | ||
| return copy(DarkExplorers.ULTRA_BALL_102, this) | ||
|
|
||
|
|
||
|
|
||
| case DOUBLE_TURBO_ENERGY_151: return cardng (stub) { | ||
| // As long as this card is attached to a Pokémon, it provides [C][C] Energy. The attacks of the Pokémon this card is attached to do 20 less damage to your opponent's Pokémon (before applying Weakness and Resistance). | ||
| onPlay {reason-> | ||
| } | ||
| onRemoveFromPlay { | ||
| } | ||
| onMove {to-> | ||
| } | ||
| allowAttach {to-> | ||
| } | ||
| } | ||
| case DOUBLE_TURBO_ENERGY_151: | ||
| return specialEnergy (this, [[]]) { | ||
| text "As long as this card is attached to a Pokémon, it provides [C][C] Energy.\n" + | ||
| "The attacks of the Pokémon this card is attached to do 20 less damage to your opponent's Pokémon (before applying Weakness and Resistance)." | ||
| def ef | ||
| onPlay {reason-> | ||
| ef = delayed(){ | ||
| after PROCESS_ATTACK_EFFECTS, { | ||
| bg.dm().each { | ||
| if(it.from==self && it.dmg.value){ | ||
| it.dmg -= hp(20) | ||
| bc "Double Turbo Energy reduces damage" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| onRemoveFromPlay{ | ||
| ef.unregister() | ||
| } | ||
| getEnergyTypesOverride { | ||
| if (self) { | ||
| return [[C] as Set,[C] as Set] | ||
| } else { | ||
| return [[] as Set] | ||
| } | ||
| } | ||
| }; | ||
|
|
||
|
|
||
|
|
||
|
|
@@ -2136,4 +2152,4 @@ public enum BrilliantStars implements ImplOnlyCardInfo { | |
| return null; | ||
| } | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new implementations this is now specified in cards/yaml files in "variantOf" field instead of the implementation files. Once that's specified then during the implementation discovery phase, it automatically receives the implementation of the variant. Then these lines should be deleted. Sorry, it's an undocumented new part of the engine.