Skip to content

Commit

Permalink
Fix BDSP Unown form rand call location (#278)
Browse files Browse the repository at this point in the history
Fixes #248
  • Loading branch information
Lincoln-LM authored Oct 27, 2022
1 parent 1edea7f commit 188371c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Source/Core/Gen8/Generators/WildGenerator8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ std::vector<WildState> WildGenerator8::generate(u64 seed0, u64 seed1, const Enco
WildState state(initialAdvances + cnt);
Xorshift gen(rng);
u8 slotPercent = gen.next<0, 100>();
if (encounterArea.getLocation() > 222 && encounterArea.getLocation() < 244)
{ // Unown form call
gen.next(); // gen.next<0,1>() for F/R/I/E/N/D, gen.next<0,2>() for !/?, gen.next<0,20>() otherwise
}
gen.advance(84);
switch (encounter)
{
Expand Down Expand Up @@ -112,11 +116,6 @@ std::vector<WildState> WildGenerator8::generate(u64 seed0, u64 seed1, const Enco

state.setAbility(gen.next() % 2);

if (encounterArea.getLocation() > 222 && encounterArea.getLocation() < 244)
{ // TODO: add unown check
u32 unownForm = gen.next() % 28; // Form call
}

if (genderRatio == 255)
{
state.setGender(2);
Expand Down

0 comments on commit 188371c

Please sign in to comment.