diff --git a/asm/include/overlay_29_022EBC74.inc b/asm/include/overlay_29_022EBC98.inc similarity index 100% rename from asm/include/overlay_29_022EBC74.inc rename to asm/include/overlay_29_022EBC98.inc diff --git a/asm/overlay_29_022EBC74.s b/asm/overlay_29_022EBC98.s similarity index 50% rename from asm/overlay_29_022EBC74.s rename to asm/overlay_29_022EBC98.s index 27e1c0a2..bdd41d93 100644 --- a/asm/overlay_29_022EBC74.s +++ b/asm/overlay_29_022EBC98.s @@ -1,21 +1,8 @@ .include "asm/macros.inc" - .include "overlay_29_022EBC74.inc" + .include "overlay_29_022EBC98.inc" .text - arm_func_start SetActionStruggle -SetActionStruggle: ; 0x022EBC74 - stmdb sp!, {r3, r4, r5, lr} - mov r4, r1 - mov r1, #0x17 - mov r5, r0 - bl SetMonsterActionFields - cmp r4, #0xff - andne r0, r4, #7 - strneb r0, [r5, #2] - ldmia sp!, {r3, r4, r5, pc} - arm_func_end SetActionStruggle - arm_func_start SetActionUseMovePlayer SetActionUseMovePlayer: ; 0x022EBC98 stmdb sp!, {r4, r5, r6, lr} diff --git a/include/overlay_29_022EBC50.h b/include/overlay_29_022EBC50.h index ae2fbf2b..59da685e 100644 --- a/include/overlay_29_022EBC50.h +++ b/include/overlay_29_022EBC50.h @@ -5,5 +5,7 @@ // Sets a monster's action to action::ACTION_REGULAR_ATTACK, with a specified direction. void SetActionRegularAttack(struct action_data *monster_action, u8 direction); +// Sets a monster's action to action::ACTION_STRUGGLE, with a specified direction. +void SetActionStruggle(struct action_data *monster_action, u8 direction); #endif //PMDSKY_OVERLAY_29_022EBC50_H diff --git a/main.lsf b/main.lsf index b93318d2..635ded56 100644 --- a/main.lsf +++ b/main.lsf @@ -374,7 +374,7 @@ Overlay OVY_29 Object src/dungeon_action.o Object asm/overlay_29_022EB44C.o Object src/overlay_29_022EBC50.o - Object asm/overlay_29_022EBC74.o + Object asm/overlay_29_022EBC98.o Object src/dungeon_action_helper.o Object asm/overlay_29_022EBCE8.o Object src/overlay_29_022EC608.o diff --git a/src/dungeon_ai_itcm.c b/src/dungeon_ai_itcm.c index 7c82e0ae..8e2f086f 100644 --- a/src/dungeon_ai_itcm.c +++ b/src/dungeon_ai_itcm.c @@ -23,7 +23,6 @@ #define REGULAR_ATTACK_INDEX 4 -extern void SetActionStruggle(struct action_data *monster_action, u8 direction); extern bool8 CanAiUseMove(struct entity *monster, u32 move_index, bool8 extra_checks); extern u8 GetMoveAiWeight(struct move *move); diff --git a/src/overlay_29_022EBC50.c b/src/overlay_29_022EBC50.c index 31bccf3b..738115a2 100644 --- a/src/overlay_29_022EBC50.c +++ b/src/overlay_29_022EBC50.c @@ -7,3 +7,10 @@ void SetActionRegularAttack(struct action_data *monster_action, u8 direction) if (direction != DIR_NONE_UNSIGNED) monster_action->direction = direction & DIRECTION_MASK; } + +void SetActionStruggle(struct action_data *monster_action, u8 direction) +{ + SetMonsterActionFields(monster_action, ACTION_STRUGGLE); + if (direction != DIR_NONE_UNSIGNED) + monster_action->direction = direction & DIRECTION_MASK; +}