mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-06-02 22:15:20 -05:00
Allow other species to have Shedinja HP handling (#9135)
This commit is contained in:
parent
60eeba987f
commit
f851f3b8bf
|
|
@ -61,6 +61,7 @@
|
|||
#define P_ONLY_OBTAINABLE_SHINIES FALSE // If TRUE, Pokémon encountered in the Battle Pyramid or while catching is disabled won't be Shiny.
|
||||
#define P_NO_SHINIES_WITHOUT_POKEBALLS FALSE // If TRUE, Pokémon encountered when the player is out of Poké Balls won't be Shiny.
|
||||
#define P_SHOW_DYNAMIC_TYPES FALSE // If TRUE, all moves with dynamic type changes will be reflected as their current type in battle/summary screens instead of just select ones like in vanilla.
|
||||
#define P_BASE_HP_1_SHEDINJA_HANDLING FALSE // If TRUE, all species with 1 Base HP will have their handling match Shedinja's.
|
||||
|
||||
// Learnset helper toggles
|
||||
#define P_LEARNSET_HELPER_TEACHABLE TRUE // If FALSE, make sure to remove teachable_learnset.h from your .gitignore file. If TRUE, teachable_learnsets.h will be populated by tools/learnset_helpers/make_teachables.py using the included JSON files based on available TMs and tutors.
|
||||
|
|
|
|||
|
|
@ -943,5 +943,6 @@ bool32 IsSpeciesOfType(u32 species, enum Type type);
|
|||
struct BoxPokemon *GetSelectedBoxMonFromPcOrParty(void);
|
||||
u32 GiveScriptedMonToPlayer(struct Pokemon *mon, u8 slot);
|
||||
void ChangePokemonNicknameWithCallback(void (*callback)(void));
|
||||
bool32 HasShedinjaHPHandling(u32 species);
|
||||
|
||||
#endif // GUARD_POKEMON_H
|
||||
|
|
|
|||
|
|
@ -2132,7 +2132,7 @@ static void CalcDomeMonStats(const struct TrainerMon *fmon, int level, u8 ivs, i
|
|||
evs[i] = 0;
|
||||
}
|
||||
|
||||
if (fmon->species == SPECIES_SHEDINJA)
|
||||
if (HasShedinjaHPHandling(fmon->species))
|
||||
{
|
||||
stats[STAT_HP] = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,8 +131,10 @@ bool32 IsGigantamaxed(enum BattlerId battler)
|
|||
// Applies the HP Multiplier for Dynamaxed Pokemon and Raid Bosses.
|
||||
void ApplyDynamaxHPMultiplier(struct Pokemon* mon)
|
||||
{
|
||||
if (GetMonData(mon, MON_DATA_SPECIES) == SPECIES_SHEDINJA)
|
||||
if (HasShedinjaHPHandling(GetMonData(mon, MON_DATA_SPECIES)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
uq4_12_t multiplier = GetDynamaxLevelHPMultiplier(GetMonData(mon, MON_DATA_DYNAMAX_LEVEL), FALSE);
|
||||
|
|
@ -146,8 +148,10 @@ void ApplyDynamaxHPMultiplier(struct Pokemon* mon)
|
|||
// Returns the non-Dynamax HP of a Pokemon.
|
||||
u32 GetNonDynamaxHP(enum BattlerId battler)
|
||||
{
|
||||
if (GetActiveGimmick(battler) != GIMMICK_DYNAMAX || gBattleMons[battler].species == SPECIES_SHEDINJA)
|
||||
if (GetActiveGimmick(battler) != GIMMICK_DYNAMAX || HasShedinjaHPHandling(gBattleMons[battler].species))
|
||||
{
|
||||
return gBattleMons[battler].hp;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct Pokemon *mon = GetBattlerMon(battler);
|
||||
|
|
@ -160,8 +164,10 @@ u32 GetNonDynamaxHP(enum BattlerId battler)
|
|||
// Returns the non-Dynamax Max HP of a Pokemon.
|
||||
u32 GetNonDynamaxMaxHP(enum BattlerId battler)
|
||||
{
|
||||
if (GetActiveGimmick(battler) != GIMMICK_DYNAMAX || gBattleMons[battler].species == SPECIES_SHEDINJA)
|
||||
if (GetActiveGimmick(battler) != GIMMICK_DYNAMAX || HasShedinjaHPHandling(gBattleMons[battler].species))
|
||||
{
|
||||
return gBattleMons[battler].maxHP;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct Pokemon *mon = GetBattlerMon(battler);
|
||||
|
|
|
|||
|
|
@ -4744,7 +4744,7 @@ static void GetMedicineItemEffectMessage(enum Item item, u32 statusCured)
|
|||
|
||||
static bool32 NotUsingHPEVItemOnShedinja(struct Pokemon *mon, enum Item item)
|
||||
{
|
||||
if (GetItemEffectType(item) == ITEM_EFFECT_HP_EV && GetMonData(mon, MON_DATA_SPECIES) == SPECIES_SHEDINJA)
|
||||
if (GetItemEffectType(item) == ITEM_EFFECT_HP_EV && HasShedinjaHPHandling(GetMonData(mon, MON_DATA_SPECIES)))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -5243,7 +5243,7 @@ static u16 ItemEffectToMonEv(struct Pokemon *mon, u8 effectType)
|
|||
switch (effectType)
|
||||
{
|
||||
case ITEM_EFFECT_HP_EV:
|
||||
if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_SHEDINJA)
|
||||
if (!HasShedinjaHPHandling(GetMonData(mon, MON_DATA_SPECIES)))
|
||||
return GetMonData(mon, MON_DATA_HP_EV);
|
||||
break;
|
||||
case ITEM_EFFECT_ATK_EV:
|
||||
|
|
|
|||
|
|
@ -1855,7 +1855,7 @@ void CalculateMonStats(struct Pokemon *mon)
|
|||
return;
|
||||
#endif
|
||||
|
||||
if (species == SPECIES_SHEDINJA)
|
||||
if (HasShedinjaHPHandling(species))
|
||||
{
|
||||
newMaxHP = 1;
|
||||
}
|
||||
|
|
@ -7445,3 +7445,12 @@ void ChangePokemonNicknameWithCallback(void (*callback)(void))
|
|||
GetBoxMonData(boxMon, MON_DATA_NICKNAME, gStringVar2);
|
||||
DoNamingScreen(NAMING_SCREEN_NICKNAME, gStringVar2, GetBoxMonData(boxMon, MON_DATA_SPECIES), GetBoxMonGender(boxMon), GetBoxMonData(boxMon, MON_DATA_PERSONALITY), callback);
|
||||
}
|
||||
|
||||
bool32 HasShedinjaHPHandling(u32 species)
|
||||
{
|
||||
if (species == SPECIES_SHEDINJA)
|
||||
return TRUE;
|
||||
if (P_BASE_HP_1_SHEDINJA_HANDLING && GetSpeciesBaseHP(species) == 1)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user