Skip to content

Commit

Permalink
Merge pull request #95 from AnonymousRandomPerson/main
Browse files Browse the repository at this point in the history
Renamed HasTactic to IsTacticSet
  • Loading branch information
AnonymousRandomPerson authored Nov 23, 2024
2 parents 92733a2 + 4cd0444 commit 3dae333
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion asm/include/itcm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@
.public GetVisibilityRange
.public GetWindow
.public HasDropeyeStatus
.public HasTactic
.public InitMove
.public IqSkillIsEnabled
.public IsBagFull
.public IsChargingTwoTurnMove
.public IsMonster__0231A9D4
.public IsMonsterCornered
.public IsTacticSet
.public MemcpyFast
.public MemsetFast
.public OS_IRQTable
Expand Down
6 changes: 3 additions & 3 deletions asm/include/overlay_29_02300BF8.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
.public IsChargingAnyTwoTurnMove
.public IsCurrentTilesetBackground
.public IsExperienceLocked
.public IsTacticSet
.public ItemIsActive__022FF898
.public SECONDARY_TERRAIN_TYPES
.public ShouldMonsterRunAway
.public ov29_023008DC
.public HasTactic
.public ov29_0235171E
.public ov29_02352770
.public ov29_02352778
.public ov29_02352780
.public ov29_02352788
.public ov29_02352790
.public ov29_02352798
.public SECONDARY_TERRAIN_TYPES
.public ShouldMonsterRunAway
10 changes: 5 additions & 5 deletions asm/itcm.s
Original file line number Diff line number Diff line change
Expand Up @@ -2829,7 +2829,7 @@ AiMovement: ; 0x01FFA3C4
strb r2, [r8, #0x7e]
mov r1, #7
strb r2, [r8, #0x7f]
bl HasTactic
bl IsTacticSet
cmp r0, #0
beq _01FFA428
ldrsh r2, [r8, #0x12]
Expand All @@ -2847,7 +2847,7 @@ AiMovement: ; 0x01FFA3C4
_01FFA428:
mov r0, r4
mov r1, #9
bl HasTactic
bl IsTacticSet
cmp r0, #0
bne _01FFA44C
mov r0, r4
Expand Down Expand Up @@ -3439,7 +3439,7 @@ _01FFAC6C:
strh r5, [sl, #0x80]
strb r2, [sl, #0x7e]
str r3, [sl, #0x120 + AI_MOVEMENT_OFFSET]
bl HasTactic
bl IsTacticSet
cmp r0, #0
beq _01FFAD0C
mov r0, r4
Expand All @@ -3466,7 +3466,7 @@ _01FFAD0C:
_01FFAD14:
mov r0, r4
mov r1, #1
bl HasTactic
bl IsTacticSet
cmp r0, #0
bne _01FFAD7C
ldrb r0, [sl, #6]
Expand Down Expand Up @@ -4179,7 +4179,7 @@ ChooseAiMove: ; 0x01FFB658
_01FFB6CC:
mov r0, sl
mov r1, #8
bl HasTactic
bl IsTacticSet
cmp r0, #0
bne _01FFBD0C
ldrb r0, [r7, #0xd0]
Expand Down
2 changes: 1 addition & 1 deletion asm/overlay_29_02300BF8.s
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ ov29_02301594: ; 0x02301594
stmdb sp!, {r4, lr}
mov r4, r1
mov r1, #3
bl HasTactic
bl IsTacticSet
cmp r0, #0
cmpne r4, #0
movne r0, #1
Expand Down
6 changes: 3 additions & 3 deletions asm/overlay_29_023016A8.s
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@ CanSeeInvisibleMonsters: ; 0x02301EEC
ldmia sp!, {r3, pc}
arm_func_end CanSeeInvisibleMonsters

arm_func_start HasTactic
HasTactic: ; 0x02301F20
arm_func_start IsTacticSet
IsTacticSet: ; 0x02301F20
ldr r2, [r0, #0xb4]
ldrb r0, [r2, #7]
cmp r0, #0
Expand All @@ -781,7 +781,7 @@ _02301F40:
movne r0, #0
and r0, r0, #0xff
bx lr
arm_func_end HasTactic
arm_func_end IsTacticSet

arm_func_start HasDropeyeStatus
HasDropeyeStatus: ; 0x02301F50
Expand Down
6 changes: 3 additions & 3 deletions src/dungeon_ai_targeting.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "overlay_29_023000E4.h"

extern bool8 AbilityIsActive(struct entity *entity, enum ability_id ability_id);
extern bool8 HasTactic(struct entity *entity, enum tactic_id tactic);
extern bool8 IsTacticSet(struct entity *entity, enum tactic_id tactic);

bool8 ShouldMonsterRunAway(struct entity *pokemon)
{
Expand All @@ -28,10 +28,10 @@ bool8 ShouldMonsterRunAway(struct entity *pokemon)
return TRUE;
}

if (HasTactic(pokemon, TACTIC_GET_AWAY_FROM_HERE))
if (IsTacticSet(pokemon, TACTIC_GET_AWAY_FROM_HERE))
return TRUE;

if (HasTactic(pokemon, TACTIC_AVOID_TROUBLE))
if (IsTacticSet(pokemon, TACTIC_AVOID_TROUBLE))
{
s32 max_hp = pokemon_info->max_hp_stat + pokemon_info->max_hp_boost;
if (max_hp > 999)
Expand Down

0 comments on commit 3dae333

Please sign in to comment.