summaryrefslogtreecommitdiff
path: root/src/engine/boosters.asm
blob: d0c4ebc73024ed82e379c27d4b02d591d4e7d45a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
GenerateBoosterPack: ; 1e1c4 (7:61c4)
	push hl
	push bc
	push de
	ld [wBoosterDataIndex], a
.noCardsFoundLoop
	call InitBoosterData
	call GenerateBoosterEnergy
	call GenerateBoosterCard
	jr c, .noCardsFoundLoop
	call CopyBoosterEnergiesToBooster
	call AddBoosterCardsToCollection
	pop de
	pop bc
	pop hl
	ret

GenerateBoosterCard: ; 1e1df (7:61df)
	ld a, STAR
	ld [wBoosterCurrRarity], a
.generateCardLoop
	call FindCurrRarityChance
	ld a, [hl]
	or a
	jr z, .noMoreOfCurrentRarity
	call FindCardsInSetAndRarity
	call FindTotalTypeChances
	or a
	jr z, .noValidCards
	call Random
	call DetermineBoosterCardType
	call FindBoosterCard
	call UpdateBoosterCardTypesChanceByte
	call AddCardToBoosterList
	call FindCurrRarityChance
	dec [hl]
	jr .generateCardLoop
.noMoreOfCurrentRarity
	ld a, [wBoosterCurrRarity]
	dec a
	ld [wBoosterCurrRarity], a
	bit 7, a
	jr z, .generateCardLoop
	or a
	ret
.noValidCards
	rst $38
	scf
	ret

FindCurrRarityChance: ; 1e219 (7:6219)
	push bc
	ld hl, wBoosterDataCommonAmount
	ld a, [wBoosterCurrRarity]
	ld c, a
	ld b, $0
	add hl, bc
	pop bc
	ret

FindCardsInSetAndRarity: ; 1e226 (7:6226)
	ld c, BOOSTER_CARD_TYPE_AMOUNT
	ld hl, wBoosterAmountOfCardTypeTable
	xor a
.deleteTypeTableLoop
	ld [hli], a
	dec c
	jr nz, .deleteTypeTableLoop
	xor a
	ld hl, wBoosterViableCardList
	ld [hl], a
	ld de, $1
.checkCardViableLoop
	push de
	ld a, e
	ld [wBoosterTempData], a
	call CheckByteInWramZeroed
	jr c, .finishedWithCurrentCard
	call CheckCardViable
	jr c, .finishedWithCurrentCard
	ld a, [wBoosterCurrentCardType]
	call GetCardType
	push af
	push hl
	ld c, a
	ld b, $00
	ld hl, wBoosterAmountOfCardTypeTable
	add hl, bc
	inc [hl]
	pop hl
	ld a, [wBoosterTempData]
	ld [hli], a
	pop af
	ld [hli], a
	xor a
	ld [hl], a
.finishedWithCurrentCard
	pop de
	inc e
	ld a, e
	cp NUM_CARDS + 1
	jr c, .checkCardViableLoop
	ret

CheckCardViable: ; 1e268 (7:6268)
	push bc
	ld a, e
	call GetCardHeader
	ld [wBoosterCurrentCardType], a
	ld a, b
	ld [wBoosterCurrentCardRarity], a
	ld a, c
	ld [wBoosterCurrentCardSet], a
	ld a, [wBoosterCurrentCardRarity]
	ld c, a
	ld a, [wBoosterCurrRarity]
	cp c
	jr nz, .invalidCard
	ld a, [wBoosterCurrentCardType]
	call GetCardType
	cp BOOSTER_CARD_TYPE_ENERGY
	jr z, .returnValidCard
	ld a, [wBoosterCurrentCardSet]
	swap a
	and $0f
	ld c, a
	ld a, [wBoosterDataCurrSet]
	cp c
	jr nz, .invalidCard
.returnValidCard
	or a
	jr .return
.invalidCard
	scf
.return
	pop bc
	ret

GetCardType: ; 1e2a0 (7:62a0)
	push hl
	push bc
	ld hl, CardTypeTable
	cp $11
	jr nc, .skipToTypeLoad
	ld c, a
	ld b, $00
	add hl, bc
.skipToTypeLoad
	ld a, [hl]
	pop bc
	pop hl
	ret

CardTypeTable:  ; 1e2b1 (7:62b1)
	db BOOSTER_CARD_TYPE_FIRE
	db BOOSTER_CARD_TYPE_GRASS
	db BOOSTER_CARD_TYPE_LIGHTNING
	db BOOSTER_CARD_TYPE_WATER
	db BOOSTER_CARD_TYPE_FIGHTING
	db BOOSTER_CARD_TYPE_PSYCHIC
	db BOOSTER_CARD_TYPE_COLORLESS
	db BOOSTER_CARD_TYPE_TRAINER
	db BOOSTER_CARD_TYPE_ENERGY
	db BOOSTER_CARD_TYPE_ENERGY
	db BOOSTER_CARD_TYPE_ENERGY
	db BOOSTER_CARD_TYPE_ENERGY
	db BOOSTER_CARD_TYPE_ENERGY
	db BOOSTER_CARD_TYPE_ENERGY
	db BOOSTER_CARD_TYPE_ENERGY
	db BOOSTER_CARD_TYPE_TRAINER
	db BOOSTER_CARD_TYPE_TRAINER

FindTotalTypeChances: ; 1e2c2 (7:62c2)
	ld c, BOOSTER_CARD_TYPE_AMOUNT
	xor a
	ld hl, wBoosterTempTypeChanceTable
.deleteTempTypeChanceTableLoop
	ld [hli], a
	dec c
	jr nz, .deleteTempTypeChanceTableLoop
	ld [wd4ca], a
	ld bc, $00
.checkIfTypeIsValid
	push bc
	ld hl, wBoosterAmountOfCardTypeTable
	add hl, bc
	ld a, [hl]
	or a
	jr z, .amountOfTypeOrChanceZero
	ld hl, wBoosterDataTypeChanceData
	add hl, bc
	ld a, [hl]
	or a
	jr z, .amountOfTypeOrChanceZero
	ld hl, wBoosterTempTypeChanceTable
	add hl, bc
	ld [hl], a
	ld a, [wd4ca]
	add [hl]
	ld [wd4ca], a
.amountOfTypeOrChanceZero
	pop bc
	inc c
	ld a, c
	cp $09
	jr c, .checkIfTypeIsValid
	ld a, [wd4ca]
	ret

DetermineBoosterCardType: ; 1e2fa (7:62fa)
	ld [wd4ca], a
	ld c, $00
	ld hl, wBoosterTempTypeChanceTable
.loopThroughCardTypes
	ld a, [hl]
	or a
	jr z, .skipNoChanceType
	ld a, [wd4ca]
	sub [hl]
	ld [wd4ca], a
	jr c, .foundCardType
.skipNoChanceType
	inc hl
	inc c
	ld a, c
	cp a, BOOSTER_CARD_TYPE_AMOUNT
	jr c, .loopThroughCardTypes
	ld a, $08
.foundCardType
	ld a, c
	ld [wBoosterSelectedCardType], a
	ret

FindBoosterCard: ; 1e31d (7:631d)
	ld a, [wBoosterSelectedCardType]
	ld c, a
	ld b, $00
	ld hl, wBoosterAmountOfCardTypeTable
	add hl, bc
	ld a, [hl]
	call Random
	ld [wd4ca], a
	ld hl, wBoosterViableCardList
.findMatchingCardLoop
	ld a, [hli]
	or a
	jr z, .noValidCardFound
	ld [wBoosterTempData], a
	ld a, [wBoosterSelectedCardType]
	cp [hl]
	jr nz, .cardIncorrectType
	ld a, [wd4ca]
	or a
	jr z, .returnWithCurrentCard
	dec a
	ld [wd4ca], a
.cardIncorrectType
	inc hl
	jr .findMatchingCardLoop
.returnWithCurrentCard
	or a
	ret
.noValidCardFound
	rst $38
	scf
	ret

;lowers the chance of getting the same type multiple times
UpdateBoosterCardTypesChanceByte: ; 1e350 (7:6350)
	push hl
	push bc
	ld a, [wBoosterSelectedCardType]
	ld c, a
	ld b, $00
	ld hl, wBoosterDataTypeChanceData
	add hl, bc
	ld a,[wBoosterDataAveragedChance]
	ld c, a
	ld a, [hl]
	sub c
	ld [hl], a
	jr z, .chanceLessThanOne
	jr nc, .stillSomeChanceLeft
.chanceLessThanOne
	ld a, $01
	ld [hl], a
.stillSomeChanceLeft
	pop bc
	pop hl
	ret

GenerateBoosterEnergy: ; 1e3db (7:63db)
	ld hl, wBoosterDataEnergyFunctionPointer + 1
	ld a, [hld]
	or a
	jr z, .noFunctionPointer
	ld l, [hl]
	ld h, a
	jp hl
.noFunctionPointer
	ld a, [hl]
	or a
	ret z
	push af
	call AddBoosterEnergyToWram
	pop af
	ret

AddBoosterEnergyToWram: ; 1e380 (7:6380)
	ld [wBoosterTempData], a
	call AddCardToBoosterEnergies
	ret

GenerateEndingEnergy: ; 1e387 (7:6387)
	ld a, $06
	call Random
	add a, $01
	jr AddBoosterEnergyToWram

GenerateRandomEnergyBoosterPack:  ; 1e390 (7:6390)
	ld a, $0a
.generateEnergyLoop
	push af
	call GenerateEndingEnergy
	pop af
	dec a
	jr nz, .generateEnergyLoop
	jr ZeroBoosterRarityData

GenerateEnergyBoosterLightningFire:  ; 1e39c (7:639c)
	ld hl, EnergyBoosterLightningFireData
	jr CreateEnergyBooster

GenerateEnergyBoosterWaterFighting:  ; 1e3a1 (7:63a1)
	ld hl, EnergyBoosterWaterFightingData
	jr CreateEnergyBooster

GenerateEnergyBoosterGrassPsychic:  ; 1e3a6 (7:63a6)
	ld hl, EnergyBoosterGrassPsychicData
	jr CreateEnergyBooster

CreateEnergyBooster:  ; 1e3ab (7:63ab)
	ld b, $02
.addTwoEnergiesToBoosterLoop
	ld c, $05
.addEnergyToBoosterLoop
	push hl
	push bc
	ld a, [hl]
	call AddBoosterEnergyToWram
	pop bc
	pop hl
	dec c
	jr nz, .addEnergyToBoosterLoop
	inc hl
	dec b
	jr nz, .addTwoEnergiesToBoosterLoop
ZeroBoosterRarityData:
	xor a
	ld [wBoosterDataCommonAmount], a
	ld [wBoosterDataUncommonAmount], a
	ld [wBoosterDataRareAmount], a
	ret

EnergyBoosterLightningFireData:
	db LIGHTNING_ENERGY, FIRE_ENERGY
EnergyBoosterWaterFightingData:
	db WATER_ENERGY, FIGHTING_ENERGY
EnergyBoosterGrassPsychicData:
	db GRASS_ENERGY, PSYCHIC_ENERGY

AddCardToBoosterEnergies: ; 1e3cf (7:63cf)
	push hl
	ld hl, wPlayerDeck + $b
	call CopyToFirstEmptyByte
	call AddBoosterCardToTempCardCollection
	pop hl
	ret

AddCardToBoosterList: ; 1e3db (7:63db)
	push hl
	ld hl, wPlayerDeck
	call CopyToFirstEmptyByte
	call AddBoosterCardToTempCardCollection
	pop hl
	ret

CopyToFirstEmptyByte: ; 1e3e7 (7:63e7)
	ld a, [hli]
	or a
	jr nz, CopyToFirstEmptyByte
	dec hl
	ld a, [wBoosterTempData]
	ld [hli], a
	xor a
	ld [hl], a
	ret

CopyBoosterEnergiesToBooster: ; 1e3f3 (7:63f3)
	push hl
	ld hl, wPlayerDeck + $b
.loopThroughExtraCards
	ld a, [hli]
	or a
	jr z, .endOfCards
	ld [wBoosterTempData], a
	push hl
	ld hl, wPlayerDeck
	call CopyToFirstEmptyByte
	pop hl
	jr .loopThroughExtraCards
.endOfCards
	pop hl
	ret

AddBoosterCardsToCollection:; 1e40a (7:640a)
	push hl
	ld hl, wPlayerDeck
.addCardsLoop
	ld a, [hli]
	or a
	jr z, .noCardsLeft
	call AddCardToCollection
	jr .addCardsLoop
.noCardsLeft
	pop hl
	ret

AddBoosterCardToTempCardCollection: ; 1e419 (7:6419)
	push hl
	ld h, wTempCardCollection >> 8
	ld a, [wBoosterTempData]
	ld l, a
	inc [hl]
	pop hl
	ret

CheckByteInWramZeroed: ; 1e423 (7:6423)
	push hl
	ld h, wTempCardCollection >> 8
	ld a, [wBoosterTempData]
	ld l, a
	ld a, [hl]
	pop hl
	cp $01
	ccf
	ret

;clears wPlayerDeck and wTempCardCollection
;copies rarity amounts to ram and averages them into wBoosterDataAveragedChance
InitBoosterData: ; 1e430 (7:6430)
	ld c, $16
	ld hl, wPlayerDeck
	xor a
.clearPlayerDeckLoop
	ld [hli], a
	dec c
	jr nz, .clearPlayerDeckLoop
	ld c, $00
	ld hl, wTempCardCollection
	xor a
.clearTempCardCollectionLoop
	ld [hli], a
	dec c
	jr nz, .clearTempCardCollectionLoop
	call FindBoosterDataPointer
	ld de, wBoosterDataCurrSet
	ld bc, $c
	call CopyDataHLtoDE
	call LoadRarityAmountsToWram
	ld bc, $0
	ld d, BOOSTER_CARD_TYPE_AMOUNT
	ld e, $0
	ld hl, wBoosterDataTypeChanceData
.addChanceBytesLoop
	ld a, [hli]
	or a
	jr z, .skipChanceByte
	add c
	ld c, a
	inc e
.skipChanceByte
	dec d
	jr nz, .addChanceBytesLoop
	call DivideBCbyDE
	ld a, c
	ld [wBoosterDataAveragedChance], a
	ret

FindBoosterDataPointer: ; 1e46f (7:646f)
	push bc
	ld a, [wBoosterDataIndex]
	add a
	ld c, a
	ld b, $0
	ld hl, BoosterData_PtrTbl
	add hl, bc
	ld a, [hli]
	ld h, [hl]
	ld l, a
	pop bc
	ret

BoosterData_PtrTbl: ; 1e480 (7:6480)
	dw PackColoNeutral
	dw PackColoGrass
	dw PackColoFire
	dw PackColoWater
	dw PackColoLightning
	dw PackColoFighting
	dw PackColoTrainer
	dw PackEvoNeutral
	dw PackEvoGrass
	dw PackEvoNeutralFireEnergy
	dw PackEvoWater
	dw PackEvoFighting
	dw PackEvoPsychic
	dw PackEvoTrainer
	dw PackMysteryNeutral
	dw PackMysteryGrassColorless
	dw PackMysteryWaterColorless
	dw PackLightningColorless
	dw PackMysteryFightingColorless
	dw PackMysteryTrainerColorless
	dw PackLabTrainerLessFighting
	dw PackLabGrass
	dw PackLabWater
	dw PackLabPsychic
	dw PackLabTrainer
	dw PackEnergyLightningFire
	dw PackEnergyWaterFighting
	dw PackEnergyGrassPsychic
	dw PackRandomEnergies

LoadRarityAmountsToWram: ; 1e4ba (7:64ba)
	ld a, [wBoosterDataCurrSet]
	add a
	add a
	ld c, a
	ld b, $00
	ld hl, BoosterSetRarityAmountTable
	add hl, bc
	inc hl
	ld a, [hli]
	ld [wBoosterDataCommonAmount], a
	ld a, [hli]
	ld [wBoosterDataUncommonAmount], a
	ld a, [hli]
	ld [wBoosterDataRareAmount], a
	ret

BoosterSetRarityAmountTable: ; 1e4d4 (7::64d4)
	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

PackColoNeutral:: ; 1e4e4 (7:64e4)
	db COLOSSEUM >> 4 ; booster pack set
	dw GenerateEndingEnergy ; energy or energy generation function

; Card Type Chances
	db $14 ; Grass Type Chance
	db $14 ; Fire Type Chance
	db $14 ; Water Type Chance
	db $14 ; Lightning Type Chance
	db $14 ; Fighting Type Chance
	db $14 ; Psychic Type Chance
	db $14 ; Colorless Type Chance
	db $14 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackColoGrass:: ; 1e4f0 (7:64f0)
	db COLOSSEUM >> 4 ; booster pack set
	dw GRASS_ENERGY  ; energy or energy generation function

; Card Type Chances
	db $30 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackColoFire:: ; 1e4fc (7:64fc)
	db COLOSSEUM >> 4 ; booster pack set
	dw FIRE_ENERGY  ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $30 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackColoWater:: ; 1e508 (7:6508)
	db COLOSSEUM >> 4 ; booster pack set
	dw WATER_ENERGY ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $30 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackColoLightning:: ; 1e514 (7:6514)
	db COLOSSEUM >> 4 ; booster pack set
	dw LIGHTNING_ENERGY ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $30 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackColoFighting:: ; 1e520 (7:6520)
	db COLOSSEUM >> 4 ; booster pack set
	dw FIGHTING_ENERGY ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $30 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackColoTrainer:: ; 1e52c (7:652c)
	db COLOSSEUM >> 4 ; booster pack set
	dw GenerateEndingEnergy ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $30 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackEvoNeutral:: ; 1e538 (7:6538)
	db EVOLUTION >> 4 ; booster pack set
	dw GenerateEndingEnergy ; energy or energy generation function

; Card Type Chances
	db $14 ; Grass Type Chance
	db $14 ; Fire Type Chance
	db $14 ; Water Type Chance
	db $14 ; Lightning Type Chance
	db $14 ; Fighting Type Chance
	db $14 ; Psychic Type Chance
	db $14 ; Colorless Type Chance
	db $14 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackEvoGrass:: ; 1e544 (7:6544)
	db EVOLUTION >> 4 ; booster pack set
	dw GRASS_ENERGY ; energy or energy generation function

; Card Type Chances
	db $30 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackEvoNeutralFireEnergy:: ; 1e550 (7:6550)
	db EVOLUTION >> 4 ; booster pack set
	dw FIRE_ENERGY ; energy or energy generation function

; Card Type Chances
	db $14 ; Grass Type Chance
	db $14 ; Fire Type Chance
	db $14 ; Water Type Chance
	db $14 ; Lightning Type Chance
	db $14 ; Fighting Type Chance
	db $14 ; Psychic Type Chance
	db $14 ; Colorless Type Chance
	db $14 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackEvoWater:: ; 1e55c (7:655c)
	db EVOLUTION >> 4 ; booster pack set
	dw WATER_ENERGY ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $30 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackEvoFighting:: ; 1e568 (7:6568)
	db EVOLUTION >> 4 ; booster pack set
	dw FIGHTING_ENERGY ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $30 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackEvoPsychic:: ; 1e574 (7:6574)
	db EVOLUTION >> 4 ; booster pack set
	dw PSYCHIC_ENERGY ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $30 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackEvoTrainer:: ; 1e580 (7:6580)
	db EVOLUTION >> 4 ; booster pack set
	dw GenerateEndingEnergy ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $30 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackMysteryNeutral:: ; 1e58c (7:658c)
	db MYSTERY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $11 ; Grass Type Chance
	db $11 ; Fire Type Chance
	db $11 ; Water Type Chance
	db $11 ; Lightning Type Chance
	db $11 ; Fighting Type Chance
	db $11 ; Psychic Type Chance
	db $11 ; Colorless Type Chance
	db $11 ; Trainer Card Chance
	db $11 ; Energy Card Chance

PackMysteryGrassColorless:: ; 1e598 (7:6598)
	db MYSTERY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $30 ; Grass Type Chance
	db $0C ; Fire Type Chance
	db $0C ; Water Type Chance
	db $0C ; Lightning Type Chance
	db $0C ; Fighting Type Chance
	db $0C ; Psychic Type Chance
	db $16 ; Colorless Type Chance
	db $0C ; Trainer Card Chance
	db $0C ; Energy Card Chance

PackMysteryWaterColorless:: ; 1e5a4 (7:65a4)
	db MYSTERY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $0C ; Grass Type Chance
	db $0C ; Fire Type Chance
	db $30 ; Water Type Chance
	db $0C ; Lightning Type Chance
	db $0C ; Fighting Type Chance
	db $0C ; Psychic Type Chance
	db $16 ; Colorless Type Chance
	db $0C ; Trainer Card Chance
	db $0C ; Energy Card Chance

PackLightningColorless:: ; 1e5b0 (7:65b0)
	db MYSTERY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $0C ; Grass Type Chance
	db $0C ; Fire Type Chance
	db $0C ; Water Type Chance
	db $30 ; Lightning Type Chance
	db $0C ; Fighting Type Chance
	db $0C ; Psychic Type Chance
	db $16 ; Colorless Type Chance
	db $0C ; Trainer Card Chance
	db $0C ; Energy Card Chance

PackMysteryFightingColorless:: ; 1e5bc (7:65bc)
	db MYSTERY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $0C ; Grass Type Chance
	db $0C ; Fire Type Chance
	db $0C ; Water Type Chance
	db $0C ; Lightning Type Chance
	db $30 ; Fighting Type Chance
	db $0C ; Psychic Type Chance
	db $16 ; Colorless Type Chance
	db $0C ; Trainer Card Chance
	db $0C ; Energy Card Chance

PackMysteryTrainerColorless:: ; 1e5c8 (7:65c8)
	db MYSTERY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $0C ; Grass Type Chance
	db $0C ; Fire Type Chance
	db $0C ; Water Type Chance
	db $0C ; Lightning Type Chance
	db $0C ; Fighting Type Chance
	db $0C ; Psychic Type Chance
	db $16 ; Colorless Type Chance
	db $30 ; Trainer Card Chance
	db $0C ; Energy Card Chance

PackLabTrainerLessFighting:: ; 1e5d4 (7:65d4)
	db LABORATORY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $14 ; Grass Type Chance
	db $14 ; Fire Type Chance
	db $14 ; Water Type Chance
	db $14 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $14 ; Psychic Type Chance
	db $14 ; Colorless Type Chance
	db $18 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackLabGrass:: ; 1e5e0 (7:65e0)
	db LABORATORY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $30 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackLabWater:: ; 1e5ec (7:65ec)
	db LABORATORY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $30 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackLabPsychic:: ; 1e5f8 (7:65f8)
	db LABORATORY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $30 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $10 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackLabTrainer:: ; 1e604 (7:6604)
	db LABORATORY >> 4 ; booster pack set
	dw $0000 ; energy or energy generation function

; Card Type Chances
	db $10 ; Grass Type Chance
	db $10 ; Fire Type Chance
	db $10 ; Water Type Chance
	db $10 ; Lightning Type Chance
	db $10 ; Fighting Type Chance
	db $10 ; Psychic Type Chance
	db $10 ; Colorless Type Chance
	db $30 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackEnergyLightningFire:: ; 1e610 (7:6610)
	db COLOSSEUM >> 4 ; booster pack set
	dw GenerateEnergyBoosterLightningFire ; energy or energy generation function

; Card Type Chances
	db $00 ; Grass Type Chance
	db $00 ; Fire Type Chance
	db $00 ; Water Type Chance
	db $00 ; Lightning Type Chance
	db $00 ; Fighting Type Chance
	db $00 ; Psychic Type Chance
	db $00 ; Colorless Type Chance
	db $00 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackEnergyWaterFighting:: ; 1e61c (7:661c)
	db COLOSSEUM >> 4 ; booster pack set
	dw GenerateEnergyBoosterWaterFighting ; energy or energy generation function

; Card Type Chances
	db $00 ; Grass Type Chance
	db $00 ; Fire Type Chance
	db $00 ; Water Type Chance
	db $00 ; Lightning Type Chance
	db $00 ; Fighting Type Chance
	db $00 ; Psychic Type Chance
	db $00 ; Colorless Type Chance
	db $00 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackEnergyGrassPsychic:: ; 1e628 (7:6628)
	db COLOSSEUM >> 4 ; booster pack set
	dw GenerateEnergyBoosterGrassPsychic ; energy or energy generation function

; Card Type Chances
	db $00 ; Grass Type Chance
	db $00 ; Fire Type Chance
	db $00 ; Water Type Chance
	db $00 ; Lightning Type Chance
	db $00 ; Fighting Type Chance
	db $00 ; Psychic Type Chance
	db $00 ; Colorless Type Chance
	db $00 ; Trainer Card Chance
	db $00 ; Energy Card Chance

PackRandomEnergies:: ; 1e634 (7:6634)
	db COLOSSEUM >> 4 ; booster pack set
	dw GenerateRandomEnergyBoosterPack ; energy or energy generation function

; Card Type Chances
	db $00 ; Grass Type Chance
	db $00 ; Fire Type Chance
	db $00 ; Water Type Chance
	db $00 ; Lightning Type Chance
	db $00 ; Fighting Type Chance
	db $00 ; Psychic Type Chance
	db $00 ; Colorless Type Chance
	db $00 ; Trainer Card Chance
	db $00 ; Energy Card Chance

	INCROM $1e640, $20000