mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-30 16:11:06 +01:00
ripen & hp restoring berries
This commit is contained in:
parent
73a7800f72
commit
f046a25ce0
@ -7461,6 +7461,11 @@ BattleScript_WhiteHerbRet::
|
|||||||
return
|
return
|
||||||
|
|
||||||
BattleScript_ItemHealHP_RemoveItemRet::
|
BattleScript_ItemHealHP_RemoveItemRet::
|
||||||
|
jumpifability BS_SCRIPTING, ABILITY_RIPEN, BattleScript_ItemHealHP_RemoveItemRet_AbilityPopUp
|
||||||
|
goto BattleScript_ItemHealHP_RemoveItemRet_Anim
|
||||||
|
BattleScript_ItemHealHP_RemoveItemRet_AbilityPopUp:
|
||||||
|
call BattleScript_AbilityPopUp
|
||||||
|
BattleScript_ItemHealHP_RemoveItemRet_Anim:
|
||||||
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
|
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
|
||||||
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
||||||
waitmessage 0x40
|
waitmessage 0x40
|
||||||
@ -7470,6 +7475,11 @@ BattleScript_ItemHealHP_RemoveItemRet::
|
|||||||
removeitem BS_SCRIPTING
|
removeitem BS_SCRIPTING
|
||||||
return
|
return
|
||||||
BattleScript_ItemHealHP_RemoveItemEnd2::
|
BattleScript_ItemHealHP_RemoveItemEnd2::
|
||||||
|
jumpifability BS_ATTACKER, ABILITY_RIPEN BattleScript_ItemHealHP_RemoveItemEnd2_AbilityPopUp
|
||||||
|
goto BattleScript_ItemHealHP_RemoveItemEnd2_Anim
|
||||||
|
BattleScript_ItemHealHP_RemoveItemEnd2_AbilityPopUp:
|
||||||
|
call BattleScript_AbilityPopUp
|
||||||
|
BattleScript_ItemHealHP_RemoveItemEnd2_Anim:
|
||||||
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
|
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
|
||||||
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
||||||
waitmessage 0x40
|
waitmessage 0x40
|
||||||
|
@ -5073,6 +5073,7 @@ static u8 RandomStatRaiseBerry(u32 battlerId, u32 itemId)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// berries, berry juice
|
||||||
static u8 ItemHealHp(u32 battlerId, u32 itemId, bool32 end2, bool32 percentHeal)
|
static u8 ItemHealHp(u32 battlerId, u32 itemId, bool32 end2, bool32 percentHeal)
|
||||||
{
|
{
|
||||||
if (HasEnoughHpToEatBerry(battlerId, 2, itemId))
|
if (HasEnoughHpToEatBerry(battlerId, 2, itemId))
|
||||||
@ -5082,6 +5083,11 @@ static u8 ItemHealHp(u32 battlerId, u32 itemId, bool32 end2, bool32 percentHeal)
|
|||||||
else
|
else
|
||||||
gBattleMoveDamage = GetBattlerHoldEffectParam(battlerId) * -1;
|
gBattleMoveDamage = GetBattlerHoldEffectParam(battlerId) * -1;
|
||||||
|
|
||||||
|
// check ripen
|
||||||
|
if (ItemId_GetPocket(itemId) == POCKET_BERRIES && GetBattlerAbility(battlerId) == ABILITY_RIPEN)
|
||||||
|
gBattleMoveDamage *= 2;
|
||||||
|
|
||||||
|
gBattlerAbility = battlerId; // in SWSH, berry juice shows ability pop up but has no effect. This is mimicked here
|
||||||
if (end2)
|
if (end2)
|
||||||
{
|
{
|
||||||
BattleScriptExecute(BattleScript_ItemHealHP_RemoveItemEnd2);
|
BattleScriptExecute(BattleScript_ItemHealHP_RemoveItemEnd2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user