Renamed IsMonsterCornered

This commit is contained in:
AnonymousRandomPerson
2026-01-31 22:43:34 -05:00
parent b7e554692c
commit 4aa593bf63
3 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
#include "dungeon_mode.h"
// True if the given monster is cornered (it can't move in any direction)
bool8 IsMonsterCornered(struct entity *monster);
bool8 CanMonsterMoveOrSwapWithAllyInAnyDirection(struct entity *monster);
// Checks if the given monster can move in the specified direction. Includes if an allied or neutral monster is standing on an adjacent tile, as the monsters can swap places.
// Returns false if an enemy monster is standing on the target tile
bool8 CanMonsterMoveOrSwapWithAllyInDirection(struct entity *monster, s32 direction);

View File

@@ -38,7 +38,7 @@ void ChooseAiMove(struct entity *monster)
if (!AreMovesEnabled(DUNGEON_PTR[0]->gen_info.fixed_room_id) ||
MonsterCannotAttack(monster, FALSE) ||
ShouldMonsterRunAwayAndShowEffect(monster, TRUE) ||
GetEntInfo(monster)->monster_behavior == BEHAVIOR_FLEEING_OUTLAW && IsMonsterCornered(monster) ||
GetEntInfo(monster)->monster_behavior == BEHAVIOR_FLEEING_OUTLAW && CanMonsterMoveOrSwapWithAllyInAnyDirection(monster) ||
IsTacticSet(monster, TACTIC_KEEP_YOUR_DISTANCE) ||
(pokemon_info->cringe_class_status.cringe == STATUS_CRINGE_CONFUSED && DungeonRandOutcome__022EAB20(AI_CONFUSED_NO_ATTACK_CHANCE)))
return;
@@ -327,7 +327,7 @@ asm void ChooseAiMove(struct entity *monster)
cmp r0, #3
bne _01FFB6CC
mov r0, r10
bl IsMonsterCornered
bl CanMonsterMoveOrSwapWithAllyInAnyDirection
cmp r0, #0
bne _01FFBD0C
_01FFB6CC:

View File

@@ -16,7 +16,7 @@
#include "secondary_terrain_types.h"
#include "targeting.h"
bool8 IsMonsterCornered(struct entity *monster)
bool8 CanMonsterMoveOrSwapWithAllyInAnyDirection(struct entity *monster)
{
for (u8 i = 0; i < NUM_DIRECTIONS; i++)
{