mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
More corrections
This commit is contained in:
parent
48c04f936a
commit
2bf88502a7
@ -1513,13 +1513,6 @@ BattleScript_DefDown::
|
||||
BattleScript_DefDown_Ret:
|
||||
return
|
||||
|
||||
BattleScript_ReduceDefenseAndFlinch::
|
||||
modifybattlerstatstage BS_TARGET, STAT_DEF, DECREASE, 1, BattleScript_DefDownAndFlinch_Ret, ANIM_ON
|
||||
setmoveeffect MOVE_EFFECT_FLINCH
|
||||
seteffectprimary
|
||||
BattleScript_DefDownAndFlinch_Ret:
|
||||
return
|
||||
|
||||
BattleScript_EffectPurify:
|
||||
attackcanceler
|
||||
attackstring
|
||||
|
@ -471,7 +471,6 @@ extern const u8 BattleScript_SpikesActivates[];
|
||||
extern const u8 BattleScript_BerserkGeneRet[];
|
||||
extern const u8 BattleScript_TargetFormChangeWithStringNoPopup[];
|
||||
extern const u8 BattleScript_DefDown[];
|
||||
extern const u8 BattleScript_ReduceDefenseAndFlinch[];
|
||||
|
||||
// zmoves
|
||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||
|
@ -236,6 +236,6 @@ bool8 ChangeTypeBasedOnTerrain(u8 battlerId);
|
||||
void RemoveConfusionStatus(u8 battlerId);
|
||||
u8 GetBattlerGender(u8 battlerId);
|
||||
bool8 AreBattlersOfOppositeGender(u8 battler1, u8 battler2);
|
||||
u32 CalcMoveSecondaryEffectChance(u8 battlerId, u8 secondaryEffectChance);
|
||||
u32 CalcSecondaryEffectChance(u8 battlerId, u8 secondaryEffectChance);
|
||||
|
||||
#endif // GUARD_BATTLE_UTIL_H
|
||||
|
@ -2644,11 +2644,6 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
&& !(gBattleMons[battlerAtk].status1 & STATUS1_ANY)
|
||||
&& !(gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 & STATUS1_ANY))
|
||||
score -= 10;
|
||||
else if (gBattleMons[battlerAtk].status1 & STATUS1_ANY
|
||||
|| gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 & STATUS1_ANY
|
||||
|| AI_DATA->hpPercents[battlerAtk] >= 90
|
||||
|| AI_DATA->hpPercents[BATTLE_PARTNER(battlerAtk)] >= 90)
|
||||
score -= 9; // No point in healing, but should at least do it if there's nothing better or if it's afflicted by a status ailment.
|
||||
break;
|
||||
case EFFECT_TAKE_HEART:
|
||||
if ((!(gBattleMons[battlerAtk].status1 & STATUS1_ANY)
|
||||
|
@ -3864,8 +3864,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
break;
|
||||
case MOVE_EFFECT_TRIPLE_ARROWS:
|
||||
{
|
||||
u8 randomLowerDefenseChance = RandomPercentage(RNG_TRIPLE_ARROWS_DEFENSE_DOWN, CalcMoveSecondaryEffectChance(gBattlerAttacker, 50));
|
||||
u8 randomFlinchChance = RandomPercentage(RNG_TRIPLE_ARROWS_FLINCH, CalcMoveSecondaryEffectChance(gBattlerAttacker, 30));
|
||||
u8 randomLowerDefenseChance = RandomPercentage(RNG_TRIPLE_ARROWS_DEFENSE_DOWN, CalcSecondaryEffectChance(gBattlerAttacker, 50));
|
||||
u8 randomFlinchChance = RandomPercentage(RNG_TRIPLE_ARROWS_FLINCH, CalcSecondaryEffectChance(gBattlerAttacker, 30));
|
||||
|
||||
if (randomFlinchChance && battlerAbility != ABILITY_INNER_FOCUS && GetBattlerTurnOrderNum(gEffectBattler) > gCurrentTurnActionNumber)
|
||||
gBattleMons[gEffectBattler].status2 |= sStatusFlagsForMoveEffects[MOVE_EFFECT_FLINCH];
|
||||
@ -3892,7 +3892,7 @@ static void Cmd_seteffectwithchance(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
|
||||
u32 percentChance = CalcMoveSecondaryEffectChance(gBattlerAttacker, gBattleMoves[gCurrentMove].secondaryEffectChance);
|
||||
u32 percentChance = CalcSecondaryEffectChance(gBattlerAttacker, gBattleMoves[gCurrentMove].secondaryEffectChance);
|
||||
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
&& gBattleScripting.moveEffect)
|
||||
|
@ -10930,7 +10930,7 @@ bool8 AreBattlersOfOppositeGender(u8 battler1, u8 battler2)
|
||||
return (gender1 != MON_GENDERLESS && gender2 != MON_GENDERLESS && gender1 != gender2);
|
||||
}
|
||||
|
||||
u32 CalcMoveSecondaryEffectChance(u8 battlerId, u8 secondaryEffectChance)
|
||||
u32 CalcSecondaryEffectChance(u8 battlerId, u8 secondaryEffectChance)
|
||||
{
|
||||
if (GetBattlerAbility(battlerId) == ABILITY_SERENE_GRACE)
|
||||
secondaryEffectChance *= 2;
|
||||
|
Loading…
Reference in New Issue
Block a user