Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =====================
- Booster packs intro
- =====================
- 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
- ==========
- Pack Data
- ===========
- Here is an unbiased colosseum pack:
- 1) db $00 ;booster rarity table index + Set
- 2) dw GenerateEndingEnergy ; energy or energy generation function
- ; Card Type Chances
- 3) db $14 ; Grass Type Chance
- 4) db $14 ; Fire Type Chance
- 5) db $14 ; Water Type Chance
- 6) db $14 ; Lightning Type Chance
- 7) db $14 ; Fighting Type Chance
- 8) db $14 ; Psychic Type Chance
- 9) db $14 ; Colorless Type Chance
- 10) db $14 ; Trainer Card Chance
- 11) db $00 ; Energy Card Chance
- Line 1: which item on the booster rarity table to use. I learned very recently that this is also the set (Colosseum, Lab, etc)
- Line 2: this can have 3 types of values.
- $0000: this means no energy is generated for the end of this pack
- An energy: this means that one of that energy will be attached to the end of the pack
- Other (A function): It will run a function to see what energy to supply. The functions are as follows
- GenerateEndingEnergy: generates 1 random energy.
- GenerateEnergyBoosterLightningFire: generates a pack of only Lightning and Fire energies.
- GenerateEnergyBoosterWaterFighting: generates a pack of only Water and Fighting energies.
- GenerateEnergyBoosterGrassPsychic: generates a pack of only Grass and Psychic energies.
- GenerateRandomEnergyBoosterPack: generates a pack of only random energies.
- Lines 3-11: The chance of each type of card being pulled in the pack.
- ======Booster Rarity Table======
- starting at 0, the first value in the pack data points to one of these 4.
- db $01, $05, $03, $01 ; other, commons, uncommons, rares
- db $01, $05, $03, $01 ; other, commons, uncommons, rares
- db $00, $06, $03, $01 ; other, commons, uncommons, rares
- db $00, $06, $03, $01 ; other, commons, uncommons, rares
- the first byte is how many energies are generated, second is how many commons, etc.
- 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.
- ======Card Types======
- As a small aside, the card types are a bit different than normal "types."
- there are a total of 9 types.
- 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)
- 7) All trainers are given the value 7. There are other unknown values that are turned into 7 on the conversion table
- 8) All energies of every type are given the value 8
- ==================
- Generating a card
- ==================
- 1) Create a list of all cards that match the current set and rarity. i.e. all rare Colosseums, all common Laboratories, etc)
- 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
- 3) Generate a random number from 0 to the total calculated in the last step.
- 4) Decide the type
- -
Add Comment
Please, Sign In to add comment