mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
Fixes Triple Kick effect and Z move damage calc
minor correction to the z-move fix Add comment to EFFECT_TRIPLE_KICK
This commit is contained in:
parent
3cee3b18c8
commit
5a384f9090
@ -820,47 +820,47 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness,
|
||||
else
|
||||
dmg = (critDmg + normalDmg * (critChance - 1)) / critChance;
|
||||
|
||||
// Handle dynamic move damage
|
||||
switch (gBattleMoves[move].effect)
|
||||
if (!gBattleStruct->zmove.active)
|
||||
{
|
||||
case EFFECT_LEVEL_DAMAGE:
|
||||
case EFFECT_PSYWAVE:
|
||||
dmg = gBattleMons[battlerAtk].level * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1);
|
||||
break;
|
||||
case EFFECT_DRAGON_RAGE:
|
||||
dmg = 40 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1);
|
||||
break;
|
||||
case EFFECT_SONICBOOM:
|
||||
dmg = 20 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1);
|
||||
break;
|
||||
case EFFECT_MULTI_HIT:
|
||||
dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 5 : 3);
|
||||
break;
|
||||
case EFFECT_TRIPLE_KICK:
|
||||
dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 6 : 5);
|
||||
break;
|
||||
case EFFECT_ENDEAVOR:
|
||||
// If target has less HP than user, Endeavor does no damage
|
||||
dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp);
|
||||
break;
|
||||
case EFFECT_SUPER_FANG:
|
||||
dmg = (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND
|
||||
? max(2, gBattleMons[battlerDef].hp * 3 / 4)
|
||||
: max(1, gBattleMons[battlerDef].hp / 2));
|
||||
break;
|
||||
case EFFECT_FINAL_GAMBIT:
|
||||
dmg = gBattleMons[battlerAtk].hp;
|
||||
break;
|
||||
// Handle dynamic move damage
|
||||
switch (gBattleMoves[move].effect)
|
||||
{
|
||||
case EFFECT_LEVEL_DAMAGE:
|
||||
case EFFECT_PSYWAVE:
|
||||
dmg = gBattleMons[battlerAtk].level * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1);
|
||||
break;
|
||||
case EFFECT_DRAGON_RAGE:
|
||||
dmg = 40 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1);
|
||||
break;
|
||||
case EFFECT_SONICBOOM:
|
||||
dmg = 20 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1);
|
||||
break;
|
||||
case EFFECT_MULTI_HIT:
|
||||
dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 5 : 3);
|
||||
break;
|
||||
case EFFECT_ENDEAVOR:
|
||||
// If target has less HP than user, Endeavor does no damage
|
||||
dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp);
|
||||
break;
|
||||
case EFFECT_SUPER_FANG:
|
||||
dmg = (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND
|
||||
? max(2, gBattleMons[battlerDef].hp * 3 / 4)
|
||||
: max(1, gBattleMons[battlerDef].hp / 2));
|
||||
break;
|
||||
case EFFECT_FINAL_GAMBIT:
|
||||
dmg = gBattleMons[battlerAtk].hp;
|
||||
break;
|
||||
}
|
||||
|
||||
// Handle other multi-strike moves
|
||||
if (gBattleMoves[move].flags & FLAG_TWO_STRIKES)
|
||||
dmg *= 2;
|
||||
else if (gBattleMoves[move].flags & FLAG_THREE_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH))
|
||||
dmg *= 3;
|
||||
|
||||
if (dmg == 0)
|
||||
dmg = 1;
|
||||
}
|
||||
|
||||
// Handle other multi-strike moves
|
||||
if (gBattleMoves[move].flags & FLAG_TWO_STRIKES)
|
||||
dmg *= 2;
|
||||
else if (gBattleMoves[move].flags & FLAG_THREE_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH))
|
||||
dmg *= 3;
|
||||
|
||||
if (dmg == 0)
|
||||
dmg = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -6783,7 +6783,7 @@ static bool32 GetMentalHerbEffect(u8 battlerId)
|
||||
static u8 TryConsumeMirrorHerb(u8 battlerId, bool32 execute)
|
||||
{
|
||||
u8 effect = 0;
|
||||
|
||||
|
||||
if (gProtectStructs[battlerId].eatMirrorHerb) {
|
||||
gLastUsedItem = gBattleMons[battlerId].item;
|
||||
gBattleScripting.savedBattler = gBattlerAttacker;
|
||||
@ -8584,7 +8584,10 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
|
||||
basePower = gBattleStruct->presentBasePower;
|
||||
break;
|
||||
case EFFECT_TRIPLE_KICK:
|
||||
basePower *= (4 - gMultiHitCounter);
|
||||
if (gMultiHitCounter == 0) // Calc damage with max BP for move consideration
|
||||
basePower *= 6;
|
||||
else
|
||||
basePower *= (4 - gMultiHitCounter);
|
||||
break;
|
||||
case EFFECT_SPIT_UP:
|
||||
basePower = 100 * gDisableStructs[battlerAtk].stockpileCounter;
|
||||
|
Loading…
Reference in New Issue
Block a user