diff options
author | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2018-02-17 22:03:02 -0500 |
---|---|---|
committer | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2018-02-17 22:03:02 -0500 |
commit | de302527c3eb7fae0c09236b6d405ea64f579845 (patch) | |
tree | b692c7e99ed61fd558f59feed5a77f768cb05744 /src/field/wild_encounter.c | |
parent | 08a79136313ec5d82d1e62f3c9bcd2c9967a9e89 (diff) | |
parent | 28987bb1cd0e6864257ff0434508dddcddb22e98 (diff) |
Merge branch 'master' of https://github.com/pret/pokeruby into evobjmv
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; |