Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
ShyGuyPatrolAI.inc.c File Reference

Go to the source code of this file.

Functions

void N ShyGuyPatrolAI_14 (Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territoryPtr)
 
void N ShyGuyPatrolAI_15 (Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
 
void N ShyGuyPatrolAI_16 (Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
 
void N ShyGuyPatrolAI_17 (Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
 

Function Documentation

◆ ShyGuyPatrolAI_14()

void N ShyGuyPatrolAI_14 ( Evt * script,
MobileAISettings * aiSettings,
EnemyDetectVolume * territoryPtr )

Definition at line 6 of file ShyGuyPatrolAI.inc.c.

6 {
7 Enemy* enemy = script->owner1.enemy;
8 Npc* npc = get_npc_unsafe(enemy->npcID);
9
10 npc->moveSpeed *= 0.6;
11 npc->curAnim = enemy->animList[12];
12 npc->duration = 5;
13 script->functionTemp[0] = 0xF;
14}
union Evt::@8 owner1
Initially -1.
s16 npcID
Definition npc.h:300
s32 * animList
Definition npc.h:341
Npc * get_npc_unsafe(s32 npcID)
Definition npc.c:995
Definition npc.h:294
AnimID curAnim
f32 moveSpeed
s16 duration

◆ ShyGuyPatrolAI_15()

void N ShyGuyPatrolAI_15 ( Evt * script,
MobileAISettings * aiSettings,
EnemyDetectVolume * territory )

Definition at line 16 of file ShyGuyPatrolAI.inc.c.

16 {
17 Enemy* enemy = script->owner1.enemy;
18 Npc* npc = get_npc_unsafe((s32) enemy->npcID);
19 f32 yaw = npc->yaw;
20
21 if (ai_check_fwd_collisions(npc, npc->moveSpeed, &yaw, NULL, NULL, NULL) == 0) {
22 npc_move_heading(npc, npc->moveSpeed, npc->yaw);
23 }
24
25 npc->duration--;
26 if (npc->duration == 0) {
27 npc->moveSpeed *= 0.6;
28
29 npc->curAnim = enemy->animList[11];
30 npc->duration = 10;
31 script->functionTemp[0] = 16;
32 }
33}
s32 ai_check_fwd_collisions(Npc *npc, f32 arg1, f32 *arg2, f32 *arg3, f32 *arg4, f32 *arg5)
Definition 25AF0.c:22
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
Definition npc.c:986

◆ ShyGuyPatrolAI_16()

void N ShyGuyPatrolAI_16 ( Evt * script,
MobileAISettings * aiSettings,
EnemyDetectVolume * territory )

Definition at line 35 of file ShyGuyPatrolAI.inc.c.

35 {
36 Enemy* enemy = script->owner1.enemy;
37 Npc* npc = get_npc_unsafe(enemy->npcID);
38 f32 yaw = npc->yaw;
39
40 if (ai_check_fwd_collisions(npc, npc->moveSpeed, &yaw, NULL, NULL, NULL) == 0) {
41 npc_move_heading(npc, npc->moveSpeed, npc->yaw);
42 }
43
44 npc->duration--;
45 if (npc->duration == 0) {
46 npc->duration = 30;
47 script->functionTemp[0] = 17;
48 }
49}

◆ ShyGuyPatrolAI_17()

void N ShyGuyPatrolAI_17 ( Evt * script,
MobileAISettings * aiSettings,
EnemyDetectVolume * territory )

Definition at line 51 of file ShyGuyPatrolAI.inc.c.

51 {
52 Enemy* enemy = script->owner1.enemy;
53 Npc* npc = get_npc_unsafe(enemy->npcID);
54
55 npc->duration--;
56 if (npc->duration == 0) {
58 script->functionTemp[0] = 0;
59 }
60}
@ ENEMY_ANIM_INDEX_IDLE
Definition enums.h:3426