summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2013-12-16 13:11:08 -0600
committerMarcus Huderle <huderlem@gmail.com>2013-12-16 13:11:08 -0600
commit15a70e280904fe221daf7bdb1f6d5d17e0ff61e6 (patch)
treed52e675fa41921482a07295df5df03b0540d57e8
parente86650ae776f0d5779e013dcc62d1c0f3dc2b002 (diff)
WildMonEncounterSlotChances INCBIN.
-rwxr-xr-xmain.asm19
1 files changed, 16 insertions, 3 deletions
diff --git a/main.asm b/main.asm
index 900da757..cea754cd 100755
--- a/main.asm
+++ b/main.asm
@@ -33903,7 +33903,7 @@ Func_13870: ; 13870 (4:7870)
jr nc, .asm_13912
ld a, [H_RAND2] ; $FF00+$d4
ld b, a
- ld hl, Unknown_13918 ; $7918
+ ld hl, WildMonEncounterSlotChances ; $7918
.asm_138d0
ld a, [hli]
cp b
@@ -33949,8 +33949,21 @@ Func_13870: ; 13870 (4:7870)
xor a
ret
-Unknown_13918: ; 13918 (4:7918)
-INCBIN "baserom.gbc",$13918,$1392c - $13918
+WildMonEncounterSlotChances: ; 13918 (4:7918)
+; There are 10 slots for wild pokemon, and this is the table that defines how common each of
+; those 10 slots is. A random number is generated and then the first byte of each pair in this
+; table is compared against that random number. If the random number is less than or equal
+; to the first byte, then that slot is chosen. The second byte is double the slot number.
+ db $32, $00 ; 51/256 = 19.9% chance of slot 0
+ db $65, $02 ; 51/256 = 19.9% chance of slot 1
+ db $8C, $04 ; 39/256 = 15.2% chance of slot 2
+ db $A5, $06 ; 25/256 = 9.8% chance of slot 3
+ db $BE, $08 ; 25/256 = 9.8% chance of slot 4
+ db $D7, $0A ; 25/256 = 9.8% chance of slot 5
+ db $E4, $0C ; 13/256 = 5.1% chance of slot 6
+ db $F1, $0E ; 13/256 = 5.1% chance of slot 7
+ db $FC, $10 ; 11/256 = 4.3% chance of slot 8
+ db $FF, $12 ; 3/256 = 1.2% chance of slot 9
Func_1392c: ; 1392c (4:792c)
ld a, [H_WHOSETURN] ; $FF00+$f3