diff options
author | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2018-02-07 00:40:17 -0500 |
---|---|---|
committer | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2018-02-07 00:40:17 -0500 |
commit | 0e448936b5f77561f8bb55f3e0d27e7ed5a64c99 (patch) | |
tree | 7c529306c92bcc3e482ef4e0ac89ec941bdc4097 /src/field/wild_encounter.c | |
parent | 51ade392bf16ae4c87a18f8965b8e650fe983d03 (diff) | |
parent | a395cd7e53ed33634eef4df22814da4ba96a3357 (diff) |
Merge branch 'master' of https://github.com/pret/pokeruby
Diffstat (limited to 'src/field/wild_encounter.c')
-rw-r--r-- | src/field/wild_encounter.c | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/src/field/wild_encounter.c b/src/field/wild_encounter.c index 79542422e..19778e29b 100644 --- a/src/field/wild_encounter.c +++ b/src/field/wild_encounter.c @@ -3698,13 +3698,13 @@ const u16 gRoute119WaterTileData[] = extern u16 gSpecialVar_Result; extern u8 S_RepelWoreOff[]; -EWRAM_DATA static u8 sWildEncountersDisabled = 0; +EWRAM_DATA u8 sWildEncountersDisabled = 0; EWRAM_DATA static u32 sFeebasRngValue = 0; #define NUM_FEEBAS_SPOTS 6 -static u16 FeebasRandom(void); -static void FeebasSeedRng(u16 seed); +u16 FeebasRandom(void); +void FeebasSeedRng(u16 seed); static bool8 IsWildLevelAllowedByRepel(u8 level); static void ApplyFluteEncounterRateMod(u32 *encRate); @@ -3791,17 +3791,30 @@ static bool8 CheckFeebas(void) return FALSE; } -static u16 FeebasRandom(void) +u16 FeebasRandom(void) { sFeebasRngValue = 12345 + 0x41C64E6D * sFeebasRngValue; return sFeebasRngValue >> 16; } -static void FeebasSeedRng(u16 seed) +void FeebasSeedRng(u16 seed) { sFeebasRngValue = seed; } +#if DEBUG +u16 debug_sub_8092344(u8 arg0) +{ + if (arg0 == 0) + return 131; + if (arg0 == 1) + return 167; + if (arg0 == 2) + return 149; + return 0; +} +#endif + static u8 ChooseWildMonIndex_Land(void) { u8 rand = Random() % 100; @@ -4042,6 +4055,24 @@ static bool8 DoWildEncounterRateDiceRoll(u16 encounterRate) return FALSE; } +#if DEBUG +u16 debug_sub_809283C(u16 attempts) +{ + u16 retval = 0; + u16 i = 0; + + while (i < attempts) + { + if (DoWildEncounterRateDiceRoll(320) == TRUE) + retval++; + + i++; + } + + return retval; +} +#endif + static bool8 DoWildEncounterTest(u32 encounterRate, bool8 ignoreAbility) { encounterRate *= 16; |