Updated AI to use non-dynamax HP (Leech Seed, Nightmare, Trap Damage, Hail, Sandstorm
This commit is contained in:
parent
6e1d4b4409
commit
ca101e9952
3 changed files with 9 additions and 9 deletions
|
@ -62,7 +62,7 @@ bool32 IsGigantamaxed(u16 battlerId);
|
||||||
void ApplyDynamaxHPMultiplier(u32 battler, struct Pokemon* mon);
|
void ApplyDynamaxHPMultiplier(u32 battler, struct Pokemon* mon);
|
||||||
void PrepareBattlerForDynamax(u16 battlerId);
|
void PrepareBattlerForDynamax(u16 battlerId);
|
||||||
u16 GetNonDynamaxHP(u16 battlerId);
|
u16 GetNonDynamaxHP(u16 battlerId);
|
||||||
u16 GetNonDynamaxMaxHP(u16 battlerId);
|
u16 GetNonDynamaxMaxHP(u32 battlerId);
|
||||||
void UndoDynamax(u16 battlerId);
|
void UndoDynamax(u16 battlerId);
|
||||||
bool32 IsMoveBlockedByMaxGuard(u16 move);
|
bool32 IsMoveBlockedByMaxGuard(u16 move);
|
||||||
bool32 IsMoveBlockedByDynamax(u16 move);
|
bool32 IsMoveBlockedByDynamax(u16 move);
|
||||||
|
|
|
@ -2397,7 +2397,7 @@ static u32 GetLeechSeedDamage(u32 battlerId)
|
||||||
if ((gStatuses3[battlerId] & STATUS3_LEECHSEED)
|
if ((gStatuses3[battlerId] & STATUS3_LEECHSEED)
|
||||||
&& gBattleMons[gStatuses3[battlerId] & STATUS3_LEECHSEED_BATTLER].hp != 0)
|
&& gBattleMons[gStatuses3[battlerId] & STATUS3_LEECHSEED_BATTLER].hp != 0)
|
||||||
{
|
{
|
||||||
damage = gBattleMons[battlerId].maxHP / 8;
|
damage = GetNonDynamaxMaxHP(battlerId) / 8;
|
||||||
if (damage == 0)
|
if (damage == 0)
|
||||||
damage = 1;
|
damage = 1;
|
||||||
}
|
}
|
||||||
|
@ -2409,7 +2409,7 @@ static u32 GetNightmareDamage(u32 battlerId)
|
||||||
u32 damage = 0;
|
u32 damage = 0;
|
||||||
if ((gBattleMons[battlerId].status2 & STATUS2_NIGHTMARE) && gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
if ((gBattleMons[battlerId].status2 & STATUS2_NIGHTMARE) && gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
||||||
{
|
{
|
||||||
damage = gBattleMons[battlerId].maxHP / 4;
|
damage = GetNonDynamaxMaxHP(battlerId) / 4;
|
||||||
if (damage == 0)
|
if (damage == 0)
|
||||||
damage = 1;
|
damage = 1;
|
||||||
}
|
}
|
||||||
|
@ -2421,7 +2421,7 @@ static u32 GetCurseDamage(u32 battlerId)
|
||||||
u32 damage = 0;
|
u32 damage = 0;
|
||||||
if (gBattleMons[battlerId].status2 & STATUS2_CURSED)
|
if (gBattleMons[battlerId].status2 & STATUS2_CURSED)
|
||||||
{
|
{
|
||||||
damage = gBattleMons[battlerId].maxHP / 4;
|
damage = GetNonDynamaxMaxHP(battlerId) / 4;
|
||||||
if (damage == 0)
|
if (damage == 0)
|
||||||
damage = 1;
|
damage = 1;
|
||||||
}
|
}
|
||||||
|
@ -2436,9 +2436,9 @@ static u32 GetTrapDamage(u32 battlerId)
|
||||||
if (gBattleMons[battlerId].status2 & STATUS2_WRAPPED)
|
if (gBattleMons[battlerId].status2 & STATUS2_WRAPPED)
|
||||||
{
|
{
|
||||||
if (holdEffect == HOLD_EFFECT_BINDING_BAND)
|
if (holdEffect == HOLD_EFFECT_BINDING_BAND)
|
||||||
damage = gBattleMons[battlerId].maxHP / (B_BINDING_DAMAGE >= GEN_6 ? 6 : 8);
|
damage = GetNonDynamaxMaxHP(battlerId) / (B_BINDING_DAMAGE >= GEN_6 ? 6 : 8);
|
||||||
else
|
else
|
||||||
damage = gBattleMons[battlerId].maxHP / (B_BINDING_DAMAGE >= GEN_6 ? 8 : 16);
|
damage = GetNonDynamaxMaxHP(battlerId) / (B_BINDING_DAMAGE >= GEN_6 ? 8 : 16);
|
||||||
|
|
||||||
if (damage == 0)
|
if (damage == 0)
|
||||||
damage = 1;
|
damage = 1;
|
||||||
|
@ -2509,7 +2509,7 @@ static u32 GetWeatherDamage(u32 battlerId)
|
||||||
&& !(gStatuses3[battlerId] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER))
|
&& !(gStatuses3[battlerId] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER))
|
||||||
&& holdEffect != HOLD_EFFECT_SAFETY_GOGGLES)
|
&& holdEffect != HOLD_EFFECT_SAFETY_GOGGLES)
|
||||||
{
|
{
|
||||||
damage = gBattleMons[battlerId].maxHP / 16;
|
damage = GetNonDynamaxMaxHP(battlerId) / 16;
|
||||||
if (damage == 0)
|
if (damage == 0)
|
||||||
damage = 1;
|
damage = 1;
|
||||||
}
|
}
|
||||||
|
@ -2520,7 +2520,7 @@ static u32 GetWeatherDamage(u32 battlerId)
|
||||||
&& !(gStatuses3[battlerId] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER))
|
&& !(gStatuses3[battlerId] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER))
|
||||||
&& holdEffect != HOLD_EFFECT_SAFETY_GOGGLES)
|
&& holdEffect != HOLD_EFFECT_SAFETY_GOGGLES)
|
||||||
{
|
{
|
||||||
damage = gBattleMons[battlerId].maxHP / 16;
|
damage = GetNonDynamaxMaxHP(battlerId) / 16;
|
||||||
if (damage == 0)
|
if (damage == 0)
|
||||||
damage = 1;
|
damage = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,7 +184,7 @@ u16 GetNonDynamaxHP(u16 battlerId)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the non-Dynamax Max HP of a Pokemon.
|
// Returns the non-Dynamax Max HP of a Pokemon.
|
||||||
u16 GetNonDynamaxMaxHP(u16 battlerId)
|
u16 GetNonDynamaxMaxHP(u32 battlerId)
|
||||||
{
|
{
|
||||||
if (!IsDynamaxed(battlerId) || gBattleMons[battlerId].species == SPECIES_SHEDINJA)
|
if (!IsDynamaxed(battlerId) || gBattleMons[battlerId].species == SPECIES_SHEDINJA)
|
||||||
return gBattleMons[battlerId].maxHP;
|
return gBattleMons[battlerId].maxHP;
|
||||||
|
|
Loading…
Reference in a new issue