diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-02-07 00:55:50 -0500 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-02-07 00:55:50 -0500 |
commit | c28d691ff2821adcf43600a308d523fd609e12e2 (patch) | |
tree | 5cfe618a442bb4a67b4aaef0c7f2c27d4bd3eedb /src/field/wild_encounter.c | |
parent | 19b0a0f3e05c73b84e5afaffb83080474774e918 (diff) | |
parent | 6eaadfc62e89a25c2de674aebf69f077c491580f (diff) |
Merge branch 'master' into fix_nonmatching
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; |