Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/data/wild/probabilities.asm
2009 views
1
DEF wild_chance_slot = 0
2
DEF wild_chance_total = 0
3
4
MACRO wild_chance
5
DEF wild_chance_total += \1
6
db wild_chance_total - 1
7
db wild_chance_slot * 2
8
DEF wild_chance_slot += 1
9
ENDM
10
11
WildMonEncounterSlotChances:
12
; There are 10 slots for wild pokemon, and this is the list that defines how common each of
13
; those 10 slots is. A random number is generated and then the cumulative chance value up to the current
14
; slot (included) is compared against that random number. If the random number is less than or equal
15
; to said cumulative value, then that slot is chosen.
16
table_width 2
17
wild_chance 51 ; 51/256 = 19.9% chance of slot 0
18
wild_chance 51 ; 51/256 = 19.9% chance of slot 1
19
wild_chance 39 ; 39/256 = 15.2% chance of slot 2
20
wild_chance 25 ; 25/256 = 9.8% chance of slot 3
21
wild_chance 25 ; 25/256 = 9.8% chance of slot 4
22
wild_chance 25 ; 25/256 = 9.8% chance of slot 5
23
wild_chance 13 ; 13/256 = 5.1% chance of slot 6
24
wild_chance 13 ; 13/256 = 5.1% chance of slot 7
25
wild_chance 11 ; 11/256 = 4.3% chance of slot 8
26
wild_chance 3 ; 3/256 = 1.2% chance of slot 9
27
assert_table_length NUM_WILDMONS
28
ASSERT wild_chance_total == 256, "WildMonEncounterSlotChances sum to {d:wild_chance_total}, not 256!"
29
30