Overworld effects (#245)

* Snow Cloak's overworld effect. (reduces the chance of encountering wild Pokémon on Snow by 50%)

* Quick Feet's overworld effect. (reduces the chance of encountering wild Pokémon by 50%)

* No Guard's overworld effect. (raises the chance of encountering wild Pokémon by 50%)

* Honey Gather.

* Checks if honey is defined.

* Applied review changes.

* Fixed pointer reference

* Applied requested changes.

* Using weather constants.
This commit is contained in:
Eduardo Alvaro Quezada D'Ottone 2020-04-15 08:45:07 -04:00 committed by GitHub
parent 4c473d057e
commit 81617eb577
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions

View file

@ -11030,6 +11030,19 @@ static void Cmd_pickup(void)
heldItem = GetBattlePyramidPickupItemId();
SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &heldItem);
}
#if (defined ITEM_HONEY)
else if (ability == ABILITY_HONEY_GATHER
&& species != 0
&& species != SPECIES_EGG
&& heldItem == ITEM_NONE)
{
if ((lvlDivBy10 + 1 ) * 5 > Random() % 100)
{
heldItem = ITEM_HONEY;
SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &heldItem);
}
}
#endif
}
}
else
@ -11070,6 +11083,19 @@ static void Cmd_pickup(void)
}
}
}
#if (defined ITEM_HONEY)
else if (ability == ABILITY_HONEY_GATHER
&& species != 0
&& species != SPECIES_EGG
&& heldItem == ITEM_NONE)
{
if ((lvlDivBy10 + 1 ) * 5 > Random() % 100)
{
heldItem = ITEM_HONEY;
SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &heldItem);
}
}
#endif
}
}

View file

@ -496,6 +496,12 @@ static bool8 DoWildEncounterRateTest(u32 encounterRate, bool8 ignoreAbility)
encounterRate *= 2;
else if (ability == ABILITY_SAND_VEIL && gSaveBlock1Ptr->weather == WEATHER_SANDSTORM)
encounterRate /= 2;
else if (ability == ABILITY_SNOW_CLOAK && gSaveBlock1Ptr->weather == WEATHER_SNOW)
encounterRate /= 2;
else if (ability == ABILITY_QUICK_FEET)
encounterRate /= 2;
else if (ability == ABILITY_NO_GUARD)
encounterRate = encounterRate * 3 / 2;
}
if (encounterRate > 2880)
encounterRate = 2880;