summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/battle_ai.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/battle_ai.c b/src/battle_ai.c
index 1b703679d..7c9b7f17e 100644
--- a/src/battle_ai.c
+++ b/src/battle_ai.c
@@ -1329,3 +1329,40 @@ void BattleAICmd_unk_32(void)
void BattleAICmd_unk_33(void)
{}
+
+void BattleAICmd_if_status_in_party(void)
+{
+ struct Pokemon *party;
+ int i;
+ u32 statusToCompareTo;
+
+ if (gAIScriptPtr[1] == USER)
+ {
+ party = gEnemyParty;
+ }
+ else if (0)
+ {
+ // what is going on here?
+ follow_jump:
+ gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6);
+ return;
+ }
+ else
+ {
+ party = gPlayerParty;
+ }
+
+ statusToCompareTo = AIScriptRead32(gAIScriptPtr + 2);
+
+ for (i = 0; i < 6; i++)
+ {
+ u16 species = GetMonData(&party[i], MON_DATA_SPECIES);
+ u16 hp = GetMonData(&party[i], MON_DATA_HP);
+ u32 status = GetMonData(&party[i], MON_DATA_STATUS);
+
+ if (species != SPECIES_NONE && species != SPECIES_EGG && hp != 0 && status == statusToCompareTo)
+ goto follow_jump;
+ }
+
+ gAIScriptPtr += 10;
+}