Decomped CheckVariousStatuses2

This commit is contained in:
AnonymousRandomPerson 2024-12-01 19:29:40 -06:00
parent 8651de0425
commit 2d3d79927a
12 changed files with 288 additions and 277 deletions

View File

@ -1,5 +1,4 @@
#pragma once
.public CheckVariousStatuses
.public CopyStringFromId
.public DUNGEON_PTR
.public GetActiveTeamMember
@ -8,14 +7,11 @@
.public GetNameRaw
.public GetNameWithGender
.public IsBlinded
.public IsChargingAnyTwoTurnMove
.public ov29_02300D00
.public StringFromId
.public ov29_0234B0B4
.public ov29_023527C0
.public ov29_023527D0
.public ShouldMonsterRunAway
.public strcpy
.public StringFromId
.public sub_02024FB8
.public sub_02056084
.public sub_02058534

View File

@ -0,0 +1,6 @@
#pragma once
.public CheckVariousStatuses2
.public IsBlinded
.public IsChargingAnyTwoTurnMove
.public ShouldMonsterRunAway
.public ov29_02300D00

View File

@ -690,237 +690,3 @@ ov29_023007DC: ; 0x023007DC
.align 2, 0
_02300814: .word 0x000003E7
arm_func_end ov29_023007DC
arm_func_start CheckVariousStatuses2
CheckVariousStatuses2: ; 0x02300818
stmdb sp!, {r3, r4, r5, lr}
mov r5, r0
cmp r1, #0
ldr r4, [r5, #0xb4]
beq _02300840
mov r1, #1
bl IsBlinded
cmp r0, #0
movne r0, #1
ldmneia sp!, {r3, r4, r5, pc}
_02300840:
ldrb r0, [r4, #0xbd]
cmp r0, #1
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #5
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #3
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xd0]
cmp r0, #3
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #7
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xc4]
cmp r0, #3
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #4
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
mov r0, r5
bl CheckVariousStatuses
cmp r0, #0
movne r0, #1
ldmneia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xc4]
cmp r0, #6
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
#ifdef JAPAN
ldrb r0, [r4, #0x104]
#else
ldrb r0, [r4, #0x105]
#endif
cmp r0, #0
movne r0, #1
moveq r0, #0
and r0, r0, #0xff
ldmia sp!, {r3, r4, r5, pc}
arm_func_end CheckVariousStatuses2
arm_func_start ov29_023008DC
ov29_023008DC: ; 0x023008DC
stmdb sp!, {r3, r4, r5, lr}
mov r5, r0
cmp r1, #0
ldr r4, [r5, #0xb4]
beq _02300904
mov r1, #1
bl IsBlinded
cmp r0, #0
movne r0, #1
ldmneia sp!, {r3, r4, r5, pc}
_02300904:
ldrb r0, [r4, #0xbd]
cmp r0, #1
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #5
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #3
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xd0]
cmp r0, #3
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #7
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xc4]
cmp r0, #3
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #4
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
mov r0, r5
bl ov29_02300D00
cmp r0, #0
movne r0, #1
ldmneia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xc4]
cmp r0, #6
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
#ifdef JAPAN
ldrb r0, [r4, #0x104]
#else
ldrb r0, [r4, #0x105]
#endif
cmp r0, #0
movne r0, #1
moveq r0, #0
and r0, r0, #0xff
ldmia sp!, {r3, r4, r5, pc}
arm_func_end ov29_023008DC
arm_func_start ov29_023009A0
ov29_023009A0: ; 0x023009A0
stmdb sp!, {r4, lr}
mov r1, #0
mov r4, r0
bl IsChargingAnyTwoTurnMove
cmp r0, #0
movne r0, #1
ldmneia sp!, {r4, pc}
mov r0, r4
mov r1, #0
bl CheckVariousStatuses2
ldmia sp!, {r4, pc}
arm_func_end ov29_023009A0
arm_func_start ov29_023009CC
ov29_023009CC: ; 0x023009CC
stmdb sp!, {r3, r4, r5, lr}
mov r5, r0
ldr r4, [r5, #0xb4]
mov r1, #0
bl IsChargingAnyTwoTurnMove
cmp r0, #0
movne r0, #0
ldmneia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xbd]
cmp r0, #4
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #3
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
mov r0, r5
bl ShouldMonsterRunAway
cmp r0, #0
movne r0, #0
ldmneia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xf3]
cmp r0, #1
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r3, [r4, #0xc4]
cmp r3, #6
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r3, #1
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r2, [r4, #0xd0]
cmp r2, #2
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r1, [r4, #0xbd]
cmp r1, #1
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xef]
cmp r0, #1
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r1, #5
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r2, #1
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r3, #3
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r3, #4
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xf1]
cmp r0, #2
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xd8]
cmp r0, #2
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
mov r0, r5
mov r1, #1
bl IsBlinded
cmp r0, #0
movne r0, #0
ldmneia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xd0]
cmp r0, #7
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #3
movne r0, #1
moveq r0, #0
and r0, r0, #0xff
ldmia sp!, {r3, r4, r5, pc}
arm_func_end ov29_023009CC
arm_func_start ov29_02300B04
ov29_02300B04: ; 0x02300B04
ldr r1, [r0, #0xb4]
ldrb r0, [r1, #0xbd]
cmp r0, #1
cmpne r0, #5
cmpne r0, #3
beq _02300B30
ldrb r0, [r1, #0xc4]
add r0, r0, #0xff
and r0, r0, #0xff
cmp r0, #6
bhi _02300B38
_02300B30:
mov r0, #0
bx lr
_02300B38:
mov r0, #1
bx lr
arm_func_end ov29_02300B04

180
asm/overlay_29_023008DC.s Normal file
View File

@ -0,0 +1,180 @@
.include "asm/macros.inc"
.include "overlay_29_023008DC.inc"
.text
arm_func_start ov29_023008DC
ov29_023008DC: ; 0x023008DC
stmdb sp!, {r3, r4, r5, lr}
mov r5, r0
cmp r1, #0
ldr r4, [r5, #0xb4]
beq _02300904
mov r1, #1
bl IsBlinded
cmp r0, #0
movne r0, #1
ldmneia sp!, {r3, r4, r5, pc}
_02300904:
ldrb r0, [r4, #0xbd]
cmp r0, #1
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #5
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #3
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xd0]
cmp r0, #3
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #7
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xc4]
cmp r0, #3
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #4
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
mov r0, r5
bl ov29_02300D00
cmp r0, #0
movne r0, #1
ldmneia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xc4]
cmp r0, #6
moveq r0, #1
ldmeqia sp!, {r3, r4, r5, pc}
#ifdef JAPAN
ldrb r0, [r4, #0x104]
#else
ldrb r0, [r4, #0x105]
#endif
cmp r0, #0
movne r0, #1
moveq r0, #0
and r0, r0, #0xff
ldmia sp!, {r3, r4, r5, pc}
arm_func_end ov29_023008DC
arm_func_start ov29_023009A0
ov29_023009A0: ; 0x023009A0
stmdb sp!, {r4, lr}
mov r1, #0
mov r4, r0
bl IsChargingAnyTwoTurnMove
cmp r0, #0
movne r0, #1
ldmneia sp!, {r4, pc}
mov r0, r4
mov r1, #0
bl CheckVariousStatuses2
ldmia sp!, {r4, pc}
arm_func_end ov29_023009A0
arm_func_start ov29_023009CC
ov29_023009CC: ; 0x023009CC
stmdb sp!, {r3, r4, r5, lr}
mov r5, r0
ldr r4, [r5, #0xb4]
mov r1, #0
bl IsChargingAnyTwoTurnMove
cmp r0, #0
movne r0, #0
ldmneia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xbd]
cmp r0, #4
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #3
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
mov r0, r5
bl ShouldMonsterRunAway
cmp r0, #0
movne r0, #0
ldmneia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xf3]
cmp r0, #1
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r3, [r4, #0xc4]
cmp r3, #6
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r3, #1
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r2, [r4, #0xd0]
cmp r2, #2
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r1, [r4, #0xbd]
cmp r1, #1
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xef]
cmp r0, #1
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r1, #5
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r2, #1
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r3, #3
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r3, #4
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xf1]
cmp r0, #2
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xd8]
cmp r0, #2
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
mov r0, r5
mov r1, #1
bl IsBlinded
cmp r0, #0
movne r0, #0
ldmneia sp!, {r3, r4, r5, pc}
ldrb r0, [r4, #0xd0]
cmp r0, #7
moveq r0, #0
ldmeqia sp!, {r3, r4, r5, pc}
cmp r0, #3
movne r0, #1
moveq r0, #0
and r0, r0, #0xff
ldmia sp!, {r3, r4, r5, pc}
arm_func_end ov29_023009CC
arm_func_start ov29_02300B04
ov29_02300B04: ; 0x02300B04
ldr r1, [r0, #0xb4]
ldrb r0, [r1, #0xbd]
cmp r0, #1
cmpne r0, #5
cmpne r0, #3
beq _02300B30
ldrb r0, [r1, #0xc4]
add r0, r0, #0xff
and r0, r0, #0xff
cmp r0, #6
bhi _02300B38
_02300B30:
mov r0, #0
bx lr
_02300B38:
mov r0, #1
bx lr
arm_func_end ov29_02300B04

View File

@ -1,11 +1,13 @@
#ifndef PMDSKY_DUNGEON_CAPABILITIES_H
#define PMDSKY_DUNGEON_CAPABILITIES_H
#include "dungeon.h"
#include "dungeon_mode.h"
// Returns 0 if none of these conditions holds for the given entity: is a rescue client,
// doesn't gain experience (a mission client/story teammate?), is a terrified non-team-leader,
// meets any of the conditions in CheckVariousStatuses2 (with blind_check = 0), is charging a two-turn move.
bool8 CheckVariousConditions(struct entity *pokemon);
// Returns false if none of these conditions holds for the given entity:
// blinded (checked only if blind_check == true),
// asleep, frozen, paused, infatuated, wrapping, wrapped, biding, petrified, or terrified.
// entity: Entity pointer
// blind_check: If true, return true if entity is blinded
bool8 CheckVariousStatuses2(struct entity *entity, bool8 blind_check);
#endif //PMDSKY_DUNGEON_CAPABILITIES_H

View File

@ -0,0 +1,11 @@
#ifndef PMDSKY_DUNGEON_CAPABILITIES_1_H
#define PMDSKY_DUNGEON_CAPABILITIES_1_H
#include "dungeon_mode.h"
// Returns 0 if none of these conditions holds for the given entity: is a rescue client,
// doesn't gain experience (a mission client/story teammate?), is a terrified non-team-leader,
// meets any of the conditions in CheckVariousStatuses2 (with blind_check = 0), is charging a two-turn move.
bool8 CheckVariousConditions(struct entity *pokemon);
#endif //PMDSKY_DUNGEON_CAPABILITIES_H

View File

@ -130,6 +130,11 @@ struct action_data {
s16 field_0x12;
};
struct sleep_class_status {
u8 sleep; // 0xBD: STATUS_SLEEP if 1
u8 sleep_turns; // 0xBE: Turns left for the status in statuses::sleep
};
struct frozen_class_status {
u8 freeze; // 0x0: STATUS_FROZEN if 1
// 0x4: Controls the animation that plays when taking damage from the constriction status.
@ -157,6 +162,11 @@ struct curse_class_status {
u8 curse_damage_countdown;
};
struct blinker_class_status {
u8 blinded; // 0x0: STATUS_BLINKER if 1
u8 blinded_turns; // 0x1: Turns left for the status in statuses::blinded
};
// Monster info
struct monster {
// 0x0: flags: 2-byte bitfield
@ -246,8 +256,7 @@ struct monster {
// 0xB8: Tracks the damage taken to deal when bide status ends. Max 0x3E7 (999).
u32 bide_damage_tally;
enum monster_behavior monster_behavior : 8; // 0xBC
u8 sleep; // 0xBD: STATUS_SLEEP if 1
u8 sleep_turns; // 0xBE: Turns left for the status in statuses::sleep
struct sleep_class_status sleep_class_status; // 0xBD
u8 burn; // 0xBF: STATUS_BURN if 1
u8 burn_turns; // 0xC0: Turns left for the status in statuses::burn
// 0xC1: Turns left until residual damage for the status in statuses::burn, if applicable
@ -257,10 +266,8 @@ struct monster {
// will deal. There is no noticable difference because the table this value is looked up
// on is filled with 0x6
u8 badly_poisoned_damage_count;
// 0xC4
struct frozen_class_status frozen_class_status;
// 0xD0
struct cringe_class_status cringe_class_status;
struct frozen_class_status frozen_class_status; // 0xC4
struct cringe_class_status cringe_class_status; // 0xD0
u8 bide; // 0xD2: STATUS_BIDE if 1
u8 bide_turns; // 0xD3: Turns left for the status in statuses::bide
u8 bide_move_slot; // 0xD4: Slot in the user's move list
@ -268,8 +275,7 @@ struct monster {
u8 reflect_turns; // 0xD6: Turns left for the status in statuses::reflect
// 0xD7: Turns left until residual healing for the status in statuses::reflect, if applicable
u8 reflect_damage_countdown;
// 0xD8
struct curse_class_status curse_class_status;
struct curse_class_status curse_class_status; // 0xD8
u8 leech_seed; // 0xE0: STATUS_LEECH_SEED if 1
u8 field_0xe1;
u8 field_0xe2;
@ -290,8 +296,7 @@ struct monster {
u8 long_toss; // 0xEE: STATUS_LONG_TOSS if 1
u8 invisible; // 0xEF: STATUS_INVISIBLE if 1
u8 invisible_turns; // 0xF0: Turns left for the status in statuses::invisible
u8 blinded; // 0xF1: STATUS_BLINKER if 1
u8 blinded_turns; // 0xF2: Turns left for the status in statuses::blinded
struct blinker_class_status blinker_class_status; // 0xF1
u8 muzzled; // 0xF3: STATUS_MUZZLED if 1
u8 muzzled_turns; // 0xF4: Turns left for the status in statuses::muzzled
u8 miracle_eye; // 0xF5: STATUS_MIRACLE_EYE if 1

View File

@ -3625,15 +3625,23 @@ enum status_id {
STATUS_STAIR_SPOTTER = 101, // Can locate stairs
};
#define SLEEP_STATUS_SLEEP (STATUS_SLEEP - STATUS_SLEEP + 1) // 1
#define SLEEP_STATUS_NIGHTMARE (STATUS_NAPPING - STATUS_NIGHTMARE + 1) // 3
#define SLEEP_STATUS_NAPPING (STATUS_NAPPING - STATUS_SLEEP + 1) // 5
#define FREEZE_STATUS_WRAP (STATUS_PETRIFIED - STATUS_WRAP + 1) // 3
#define FREEZE_STATUS_WRAPPED (STATUS_PETRIFIED - STATUS_WRAPPED + 1) // 4
#define FREEZE_STATUS_PETRIFIED (STATUS_PETRIFIED - STATUS_FROZEN + 1) // 6
#define CRINGE_STATUS_CONFUSED (STATUS_CONFUSED - STATUS_CRINGE + 1) // 2
#define CRINGE_STATUS_CONFUSED (STATUS_CONFUSED - STATUS_CRINGE + 1) // 2
#define CRINGE_STATUS_PAUSED (STATUS_PAUSED - STATUS_CRINGE + 1) // 3
#define CRINGE_STATUS_INFATUATED (STATUS_INFATUATED - STATUS_CRINGE + 1) // 7
#define CURSED_STATUS_DECOY (STATUS_DECOY - STATUS_CURSED + 1) // 2
#define CURSED_STATUS_DECOY (STATUS_DECOY - STATUS_CURSED + 1) // 2
#define CURSED_STATUS_GASTRO_ACID (STATUS_GASTRO_ACID - STATUS_CURSED + 1) // 4
#define BLINKER_STATUS_BLINKER (STATUS_BLINKER - STATUS_BLINKER + 1) // 1
// Mission type on a floor
enum mission_type {
MISSION_RESCUE_CLIENT = 0,

View File

@ -269,6 +269,8 @@ Overlay OVY_29
Object src/overlay_29_023000E4.o
Object asm/overlay_29_02300108.o
Object src/dungeon_capabilities.o
Object asm/overlay_29_023008DC.o
Object src/dungeon_capabilities_1.o
Object asm/overlay_29_02300BF8.o
Object src/dungeon_ai_targeting.o
Object asm/overlay_29_023016A8.o

View File

@ -1,6 +1,6 @@
#include "dungeon_ai.h"
#include "dg_random.h"
#include "dungeon_capabilities.h"
#include "dungeon_capabilities_1.h"
#include "dungeon_util.h"
#include "dungeon_util_1.h"

View File

@ -1,39 +1,35 @@
#include "dungeon_capabilities.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_util.h"
#include "joined_at_checks.h"
extern bool8 CheckVariousStatuses2(struct entity *pokemon, bool8 check_blinker);
extern bool8 CheckVariousStatuses(struct entity *pokemon);
extern bool8 IsChargingAnyTwoTurnMove(struct entity *pokemon, bool8 check_charge);
extern bool8 IsBlinded(struct entity *entity, bool8 check_held_item);
extern bool8 CheckVariousStatuses(struct entity *entity);
bool8 CheckVariousConditions(struct entity *pokemon)
bool8 CheckVariousStatuses2(struct entity *entity, bool8 blind_check)
{
struct monster *pokemon_info = GetEntInfo(pokemon);
struct monster *pokemon_info = GetEntInfo(entity);
if (pokemon_info->monster_behavior == BEHAVIOR_RESCUE_TARGET)
if ((blind_check && IsBlinded(entity, TRUE)))
return TRUE;
if (IsExperienceLocked(pokemon_info))
if (pokemon_info->sleep_class_status.sleep == SLEEP_STATUS_SLEEP)
return TRUE;
if (!pokemon_info->is_team_leader && ShouldMonsterRunAway(pokemon))
if (pokemon_info->sleep_class_status.sleep == SLEEP_STATUS_NAPPING)
return TRUE;
if (CheckVariousStatuses2(pokemon, FALSE))
if (pokemon_info->sleep_class_status.sleep == SLEEP_STATUS_NIGHTMARE)
return TRUE;
if (CheckVariousStatuses(pokemon))
if (pokemon_info->cringe_class_status.cringe == CRINGE_STATUS_PAUSED)
return TRUE;
if (IsChargingAnyTwoTurnMove(pokemon, FALSE))
if (pokemon_info->cringe_class_status.cringe == CRINGE_STATUS_INFATUATED)
return TRUE;
if (pokemon_info->frozen_class_status.freeze == FREEZE_STATUS_WRAPPED)
return TRUE;
if (pokemon_info->frozen_class_status.freeze == FREEZE_STATUS_WRAP)
return TRUE;
if (CheckVariousStatuses(entity))
return TRUE;
if (pokemon_info->frozen_class_status.freeze == FREEZE_STATUS_PETRIFIED)
return TRUE;
if (pokemon_info->terrified_turns != 0)
return TRUE;
return FALSE;
}

View File

@ -0,0 +1,39 @@
#include "dungeon_capabilities_1.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_capabilities.h"
#include "dungeon_util.h"
#include "joined_at_checks.h"
extern bool8 CheckVariousStatuses(struct entity *pokemon);
extern bool8 IsChargingAnyTwoTurnMove(struct entity *pokemon, bool8 check_charge);
bool8 CheckVariousConditions(struct entity *pokemon)
{
struct monster *pokemon_info = GetEntInfo(pokemon);
if (pokemon_info->monster_behavior == BEHAVIOR_RESCUE_TARGET)
return TRUE;
if (IsExperienceLocked(pokemon_info))
return TRUE;
if (!pokemon_info->is_team_leader && ShouldMonsterRunAway(pokemon))
return TRUE;
if (CheckVariousStatuses2(pokemon, FALSE))
return TRUE;
if (CheckVariousStatuses(pokemon))
return TRUE;
if (IsChargingAnyTwoTurnMove(pokemon, FALSE))
return TRUE;
if (pokemon_info->frozen_class_status.freeze == FREEZE_STATUS_WRAPPED)
return TRUE;
if (pokemon_info->frozen_class_status.freeze == FREEZE_STATUS_WRAP)
return TRUE;
return FALSE;
}