Make AI see Loaded Dice hold effect for multi hit moves that strike 5… (#4622)
* Make AI see Loaded Dice hold effect for multi hit moves that strike 5 times * Update battle_ai_util.c
This commit is contained in:
parent
c129423a69
commit
4f1df84acf
2 changed files with 23 additions and 5 deletions
|
@ -552,9 +552,14 @@ s32 AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u8 *typeEffectivenes
|
|||
dmg = gMovesInfo[move].argument * (aiData->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1);
|
||||
break;
|
||||
case EFFECT_MULTI_HIT:
|
||||
dmg *= (aiData->abilities[battlerAtk] == ABILITY_SKILL_LINK
|
||||
&& !(move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)
|
||||
? 5 : 3);
|
||||
if (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)
|
||||
dmg *= 3;
|
||||
else if (aiData->abilities[battlerAtk] == ABILITY_SKILL_LINK)
|
||||
dmg *= 5;
|
||||
else if (aiData->holdEffects[battlerAtk] == HOLD_EFFECT_LOADED_DICE)
|
||||
dmg *= 4;
|
||||
else
|
||||
dmg *= 3;
|
||||
break;
|
||||
case EFFECT_ENDEAVOR:
|
||||
// If target has less HP than user, Endeavor does no damage
|
||||
|
|
|
@ -46,3 +46,16 @@ AI_SINGLE_BATTLE_TEST("AI will choose a priority move if it is slower then the t
|
|||
MESSAGE("Foe Wobbuffet fainted!");
|
||||
}
|
||||
}
|
||||
|
||||
AI_SINGLE_BATTLE_TEST("AI sees Loaded Dice damage increase from multi hit moves")
|
||||
{
|
||||
GIVEN {
|
||||
AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT);
|
||||
PLAYER(SPECIES_WOBBUFFET) { HP(44); }
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LOADED_DICE); Moves(MOVE_SEED_BOMB, MOVE_BULLET_SEED); }
|
||||
} WHEN {
|
||||
TURN { EXPECT_MOVE(opponent, MOVE_BULLET_SEED); }
|
||||
} SCENE {
|
||||
MESSAGE("Wobbuffet fainted!");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue