mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-19 09:54:19 +01:00
oran berry doesnt activate when mons is kill
This commit is contained in:
parent
52c63cd671
commit
fc510a6b44
@ -4199,12 +4199,13 @@ enum
|
|||||||
// second argument is 1/X of current hp compared to max hp
|
// second argument is 1/X of current hp compared to max hp
|
||||||
static bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId)
|
static bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId)
|
||||||
{
|
{
|
||||||
|
if (gBattleMons[battlerId].hp == 0)
|
||||||
|
return FALSE;
|
||||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / hpFraction)
|
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / hpFraction)
|
||||||
{
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
|
||||||
else if (hpFraction <= 4 && GetBattlerAbility(battlerId) == ABILITY_GLUTTONY && ItemId_GetPocket(itemId) == POCKET_BERRIES
|
if (hpFraction <= 4 && GetBattlerAbility(battlerId) == ABILITY_GLUTTONY && ItemId_GetPocket(itemId) == POCKET_BERRIES
|
||||||
&& gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / 2)
|
&& gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / 2)
|
||||||
{
|
{
|
||||||
RecordAbilityBattle(battlerId, ABILITY_GLUTTONY);
|
RecordAbilityBattle(battlerId, ABILITY_GLUTTONY);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user