mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-05 02:40:56 +01:00
AI handle Belch
This commit is contained in:
parent
a001faeced
commit
9bc55246bc
@ -245,10 +245,10 @@
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_user_doesnt_go param0:req, param1:req
|
||||
.macro if_cant_use_belch battler:req, ptr:req
|
||||
.byte 0x29
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.byte \battler
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro nullsub_2A
|
||||
|
@ -248,6 +248,11 @@ AI_CheckBadMove_CheckEffect: @ 82DC045
|
||||
if_effect EFFECT_NOBLE_ROAR, AI_CBM_NobleRoar
|
||||
if_effect EFFECT_SHELL_SMASH, AI_CBM_ShellSmash
|
||||
if_effect EFFECT_LAST_RESORT, AI_CBM_LastResort
|
||||
if_effect EFFECT_BELCH, AI_CBM_Belch
|
||||
end
|
||||
|
||||
AI_CBM_Belch:
|
||||
if_cant_use_belch AI_USER, Score_Minus10
|
||||
end
|
||||
|
||||
AI_CBM_LastResort:
|
||||
|
@ -93,8 +93,8 @@ static void BattleAICmd_get_how_powerful_move_is(void);
|
||||
static void BattleAICmd_get_last_used_battler_move(void);
|
||||
static void BattleAICmd_if_equal_(void);
|
||||
static void BattleAICmd_if_not_equal_(void);
|
||||
void BattleAICmd_if_user_goes(void);
|
||||
static void BattleAICmd_if_user_doesnt_go(void);
|
||||
static void BattleAICmd_if_user_goes(void);
|
||||
static void BattleAICmd_if_cant_use_belch(void);
|
||||
static void BattleAICmd_nullsub_2A(void);
|
||||
static void BattleAICmd_nullsub_2B(void);
|
||||
static void BattleAICmd_count_usable_party_mons(void);
|
||||
@ -213,7 +213,7 @@ static const BattleAICmdFunc sBattleAICmdTable[] =
|
||||
BattleAICmd_if_equal_, // 0x26
|
||||
BattleAICmd_if_not_equal_, // 0x27
|
||||
BattleAICmd_if_user_goes, // 0x28
|
||||
BattleAICmd_if_user_doesnt_go, // 0x29
|
||||
BattleAICmd_if_cant_use_belch, // 0x29
|
||||
BattleAICmd_nullsub_2A, // 0x2A
|
||||
BattleAICmd_nullsub_2B, // 0x2B
|
||||
BattleAICmd_count_usable_party_mons, // 0x2C
|
||||
@ -1436,7 +1436,7 @@ static void BattleAICmd_if_not_equal_(void) // Same as if_not_equal.
|
||||
gAIScriptPtr += 6;
|
||||
}
|
||||
|
||||
void BattleAICmd_if_user_goes(void)
|
||||
static void BattleAICmd_if_user_goes(void)
|
||||
{
|
||||
u32 fasterAI = 0, fasterPlayer = 0, i;
|
||||
s8 prioAI, prioPlayer;
|
||||
@ -1482,12 +1482,6 @@ void BattleAICmd_if_user_goes(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void BattleAICmd_if_user_doesnt_go(void)
|
||||
{
|
||||
// To be changed. Not needed since the above does the same.
|
||||
gAIScriptPtr += 6;
|
||||
}
|
||||
|
||||
static void BattleAICmd_nullsub_2A(void)
|
||||
{
|
||||
}
|
||||
@ -2680,3 +2674,13 @@ static void BattleAICmd_if_ai_can_go_down(void)
|
||||
|
||||
gAIScriptPtr += 5;
|
||||
}
|
||||
|
||||
static void BattleAICmd_if_cant_use_belch(void)
|
||||
{
|
||||
u32 battler = BattleAI_GetWantedBattler(gAIScriptPtr[1]);
|
||||
|
||||
if (gBattleStruct->ateBerry[battler & BIT_SIDE] & gBitTable[gBattlerPartyIndexes[battler]])
|
||||
gAIScriptPtr += 6;
|
||||
else
|
||||
gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user