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

Go to the source code of this file.

Functions

void N ShyGuyWanderAI_14 (Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territoryPtr)
 
void N ShyGuyWanderAI_15 (Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
 
void N ShyGuyWanderAI_16 (Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
 
void N ShyGuyWanderAI_17 (Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
 

Function Documentation

◆ ShyGuyWanderAI_14()

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

Definition at line 4 of file ShyGuyWanderAI.inc.c.

4 {
5 Enemy* enemy = script->owner1.enemy;
6 Npc* npc = get_npc_unsafe(enemy->npcID);
7
8 npc->moveSpeed *= 0.6;
9 npc->curAnim = enemy->animList[12];
10 npc->duration = 5;
11 script->functionTemp[0] = 0xF;
12}
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

◆ ShyGuyWanderAI_15()

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

Definition at line 14 of file ShyGuyWanderAI.inc.c.

14 {
15 Enemy* enemy = script->owner1.enemy;
16 Npc* npc = get_npc_unsafe((s32) enemy->npcID);
17 f32 yaw = npc->yaw;
18
19 if (ai_check_fwd_collisions(npc, npc->moveSpeed, &yaw, NULL, NULL, NULL) == 0) {
20 npc_move_heading(npc, npc->moveSpeed, npc->yaw);
21 }
22
23 npc->duration--;
24 if (npc->duration == 0) {
25 npc->moveSpeed *= 0.6;
26
27 npc->curAnim = enemy->animList[11];
28 npc->duration = 10;
29 script->functionTemp[0] = 16;
30 }
31}
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

◆ ShyGuyWanderAI_16()

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

Definition at line 33 of file ShyGuyWanderAI.inc.c.

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

◆ ShyGuyWanderAI_17()

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

Definition at line 49 of file ShyGuyWanderAI.inc.c.

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