aroymart

Untitled

Apr 9th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. =====================
  2. Booster packs intro
  3. =====================
  4.  
  5. When the game wants to generate a booster pack, it requires 1 piece of information, which booster pack type to generate. There are 29 different booster data items. They begin here: https://github.com/pret/poketcg/blob/master/src/engine/boosters.asm#L558
  6.  
  7. ==========
  8. Pack Data
  9. ===========
  10. Here is an unbiased colosseum pack:
  11.  
  12. 1) db $00 ;booster rarity table index + Set
  13. 2) dw GenerateEndingEnergy ; energy or energy generation function
  14.  
  15. ; Card Type Chances
  16. 3) db $14 ; Grass Type Chance
  17. 4) db $14 ; Fire Type Chance
  18. 5) db $14 ; Water Type Chance
  19. 6) db $14 ; Lightning Type Chance
  20. 7) db $14 ; Fighting Type Chance
  21. 8) db $14 ; Psychic Type Chance
  22. 9) db $14 ; Colorless Type Chance
  23. 10) db $14 ; Trainer Card Chance
  24. 11) db $00 ; Energy Card Chance
  25.  
  26. Line 1: which item on the booster rarity table to use. I learned very recently that this is also the set (Colosseum, Lab, etc)
  27. Line 2: this can have 3 types of values.
  28. $0000: this means no energy is generated for the end of this pack
  29. An energy: this means that one of that energy will be attached to the end of the pack
  30. Other (A function): It will run a function to see what energy to supply. The functions are as follows
  31. GenerateEndingEnergy: generates 1 random energy.
  32. GenerateEnergyBoosterLightningFire: generates a pack of only Lightning and Fire energies.
  33. GenerateEnergyBoosterWaterFighting: generates a pack of only Water and Fighting energies.
  34. GenerateEnergyBoosterGrassPsychic: generates a pack of only Grass and Psychic energies.
  35. GenerateRandomEnergyBoosterPack: generates a pack of only random energies.
  36. Lines 3-11: The chance of each type of card being pulled in the pack.
  37.  
  38.  
  39. ======Booster Rarity Table======
  40. starting at 0, the first value in the pack data points to one of these 4.
  41. db $01, $05, $03, $01 ; other, commons, uncommons, rares
  42. db $01, $05, $03, $01 ; other, commons, uncommons, rares
  43. db $00, $06, $03, $01 ; other, commons, uncommons, rares
  44. db $00, $06, $03, $01 ; other, commons, uncommons, rares
  45.  
  46. the first byte is how many energies are generated, second is how many commons, etc.
  47. it is unclear why there are duplicates. Additionally, the game doesn't read the first byte, it just figures out how many energies to add from how many cards are already in the pack.
  48.  
  49.  
  50. ======Card Types======
  51.  
  52. As a small aside, the card types are a bit different than normal "types."
  53. there are a total of 9 types.
  54. 0-6) Each pokemon is separated into normal types. (However the Value/Order is different. I.e. fire the type's value is $00, while in booster code it's turned into $01)
  55. 7) All trainers are given the value 7. There are other unknown values that are turned into 7 on the conversion table
  56. 8) All energies of every type are given the value 8
  57.  
  58. ==================
  59. Generating a card
  60. ==================
  61.  
  62. 1) Create a list of all cards that match the current set and rarity. i.e. all rare Colosseums, all common Laboratories, etc)
  63. 2) Adds together the chance bytes from the table IF: the byte isn't zero and there's at least one card that matches that card type
  64. 3) Generate a random number from 0 to the total calculated in the last step.
  65. 4) Decide the type
  66. -
Add Comment
Please, Sign In to add comment