mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 17:34:20 +01:00
Merge pull request #1691 from AsparagusEduardo/item_sitrus
Sitrus Berry Gen4+ heal. Credit to SBird1337
This commit is contained in:
commit
7f5204a09f
@ -17,6 +17,7 @@
|
||||
#define I_KEY_FOSSILS GEN_7 // In Gen4+, all Gen 3 fossils became regular items.
|
||||
#define I_KEY_ESCAPE_ROPE GEN_7 // In Gen8, Escape Rope became a Key Item. Keep in mind, this will make it free to buy in marts.
|
||||
#define I_LEGACY_HEALING_ITEMS GEN_7 // In Gen7+, certain healing items recover less HP than they used to.
|
||||
#define I_SITRUS_BERRY_HEAL GEN_7 // In Gen4+, Sitrus Berry was changed from healing 30 HP to healing 25% of Max HP.
|
||||
|
||||
// Ball config
|
||||
#define I_LURE_BALL_MODIFIER GEN_7 // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3.
|
||||
|
@ -58,6 +58,7 @@
|
||||
#define ITEM6_HEAL_HP_FULL ((u8) -1)
|
||||
#define ITEM6_HEAL_HP_HALF ((u8) -2)
|
||||
#define ITEM6_HEAL_HP_LVL_UP ((u8) -3)
|
||||
#define ITEM6_HEAL_HP_QUARTER ((u8) -4)
|
||||
|
||||
// Special PP recovery amounts for ITEM4_HEAL_PP
|
||||
#define ITEM6_HEAL_PP_FULL 0x7F
|
||||
|
@ -1852,8 +1852,13 @@ const struct Item gItems[] =
|
||||
.name = _("Sitrus Berry"),
|
||||
.itemId = ITEM_SITRUS_BERRY,
|
||||
.price = 20,
|
||||
#if defined(BATTLE_ENGINE) && I_SITRUS_BERRY_HEAL >= GEN_4
|
||||
.holdEffect = HOLD_EFFECT_RESTORE_PCT_HP,
|
||||
.holdEffectParam = 25,
|
||||
#else
|
||||
.holdEffect = HOLD_EFFECT_RESTORE_HP,
|
||||
.holdEffectParam = 30,
|
||||
#endif
|
||||
.description = sSitrusBerryDesc,
|
||||
.pocket = POCKET_BERRIES,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
|
@ -440,7 +440,11 @@ const u8 gItemEffect_LumBerry[6] = {
|
||||
|
||||
const u8 gItemEffect_SitrusBerry[7] = {
|
||||
[4] = ITEM4_HEAL_HP,
|
||||
#if I_SITRUS_BERRY_HEAL >= GEN_4
|
||||
[6] = ITEM6_HEAL_HP_QUARTER,
|
||||
#else
|
||||
[6] = 30, // Amount of HP to recover
|
||||
#endif
|
||||
};
|
||||
|
||||
#define EV_BERRY_FRIENDSHIP_CHANGE \
|
||||
|
@ -4989,6 +4989,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
case ITEM6_HEAL_HP_LVL_UP:
|
||||
dataUnsigned = gBattleScripting.levelUpHP;
|
||||
break;
|
||||
case ITEM6_HEAL_HP_QUARTER:
|
||||
dataUnsigned = GetMonData(mon, MON_DATA_MAX_HP, NULL) / 4;
|
||||
if (dataUnsigned == 0)
|
||||
dataUnsigned = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
// Only restore HP if not at max health
|
||||
|
Loading…
x
Reference in New Issue
Block a user