Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
Sentinel.inc.c
Go to the documentation of this file.
1#include "Sentinel.h"
2#include "world/partners.h"
3#include "sprite/player.h"
4
6
7EvtScript N(EVS_NpcAuxAI_Sentinel) = {
10 Return
11 End
12};
13
14MobileAISettings N(AISettings_Sentinel) = {
15 .moveSpeed = 1.5f,
16 .moveTime = 90,
17 .waitTime = 30,
18 .alertRadius = 240.0f,
19 .playerSearchInterval = 1,
20 .chaseSpeed = 5.3f,
21 .chaseTurnRate = 180,
22 .chaseUpdateInterval = 1,
23 .chaseRadius = 240.0f,
24 .unk_AI_2C = 1,
25};
26
27EvtScript N(EVS_NpcAI_Sentinel) = {
28 Call(SetSelfVar, 0, 0)
29 Call(SetSelfVar, 5, -650)
30 Call(SetSelfVar, 6, 30)
31 Call(SetSelfVar, 1, 600)
32 Call(N(SentinelAI_Main), Ref(N(AISettings_Sentinel)))
34 Wait(2)
35 Label(20)
41 Wait(1)
42 Goto(20)
43 EndIf
50 Add(LVar1, 20)
51 Add(LVar2, 2)
54 Call(SetNpcAnimation, NPC_SELF, ANIM_Sentinel_Anim08)
55 Wait(10)
56 Call(SetPlayerAnimation, ANIM_MarioW2_Flail)
57 Wait(10)
59 Thread
60 Loop(100)
62 Add(LVar1, 1)
65 Add(LVar1, 1)
67 Wait(1)
70 Thread
81 Wait(30)
82 Call(GotoMap, Ref("dgb_00"), dgb_00_ENTRY_2)
83 Wait(100)
84 Return
85 End
86};
87
88EvtScript N(EVS_UnusedSentinelOnHit) = {
99 Return
100 End
101};
102
103EvtScript N(EVS_UnusedSentinelDefeat) = {
111 Return
112 End
113};
114
115NpcSettings N(NpcSettings_Sentinel) = {
116 .height = 38,
117 .radius = 32,
118 .level = ACTOR_LEVEL_NONE,
119 .otherAI = &N(EVS_NpcAuxAI_Sentinel),
120 .ai = &N(EVS_NpcAI_Sentinel),
121};
Bytecode EvtScript[]
@ dgb_00_ENTRY_2
Definition entrances.h:776
@ PARTNER_ANIM_TALK
Definition enums.h:3421
@ ENEMY_ANIM_INDEX_HIT
Definition enums.h:3433
@ ENCOUNTER_TRIGGER_JUMP
Definition enums.h:269
@ ENCOUNTER_TRIGGER_HAMMER
Definition enums.h:271
@ ENCOUNTER_TRIGGER_NONE
Definition enums.h:268
@ ENCOUNTER_TRIGGER_PARTNER
Definition enums.h:273
@ ENEMY_FLAG_IGNORE_HAMMER
Definition enums.h:4547
@ ENEMY_FLAG_IGNORE_PARTNER
Definition enums.h:4549
@ ENEMY_FLAG_SKIP_BATTLE
Definition enums.h:4541
@ ENEMY_FLAG_IGNORE_SPIN
Definition enums.h:4550
@ ENEMY_FLAG_IGNORE_TOUCH
Definition enums.h:4545
@ ENEMY_FLAG_CANT_INTERACT
Definition enums.h:4548
@ ENEMY_FLAG_IGNORE_JUMP
Definition enums.h:4546
@ SOUND_ID_TRIGGER_CHANGE_SOUND
Definition enums.h:532
@ NPC_SELF
Definition enums.h:2526
@ NPC_PARTNER
Definition enums.h:2528
@ TIME_FREEZE_PARTIAL
Definition enums.h:3465
@ SOUND_LRAW_SENTINEL_ALARM
Definition enums.h:1126
@ SOUND_SENTINEL_PICKUP
Definition enums.h:1081
@ OUTCOME_PLAYER_WON
Definition enums.h:1902
@ OUTCOME_PLAYER_LOST
Definition enums.h:1903
@ OUTCOME_PLAYER_FLED
Definition enums.h:1904
@ ACTION_STATE_IDLE
Definition enums.h:2426
@ NPC_FLAG_JUMPING
Definition enums.h:3009
@ NPC_FLAG_IGNORE_PLAYER_COLLISION
Definition enums.h:3006
@ NPC_FLAG_DONT_UPDATE_SHADOW_Y
Definition enums.h:3008
@ EVT_GROUP_NEVER_PAUSE
Definition evt.h:142
ApiStatus SetPlayerPos(Evt *script, b32 isInitialCall)
Sets the player position.
ApiStatus SetTimeFreezeMode(Evt *script, b32 isInitialCall)
ApiStatus DisablePartnerAI(Evt *script, b32 isInitialCall)
ApiStatus GotoMap(Evt *script, b32 isInitialCall)
Makes the player go to the given map and at the given entrance.
ApiStatus SetPlayerAnimation(Evt *script, b32 isInitialCall)
ApiStatus DisablePlayerInput(Evt *script, b32 isInitialCall)
Disables player and partner input, and disables the status menu.
ApiStatus GetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus SetNpcAnimation(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerActionState(Evt *script, b32 isInitialCall)
ApiStatus SetSelfEnemyFlagBits(Evt *script, b32 isInitialCall)
ApiStatus GetSelfAnimationFromTable(Evt *script, b32 isInitialCall)
ApiStatus DoNpcDefeat(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus NpcJump0(Evt *script, b32 isInitialCall)
ApiStatus GetOwnerEncounterTrigger(Evt *script, b32 isInitialCall)
ApiStatus func_80045838(Evt *script, b32 isInitialCall)
ApiStatus DisablePlayerPhysics(Evt *script, b32 isInitialCall)
Disables player physics if disable is TRUE, enables it if FALSE.
ApiStatus SetSelfVar(Evt *script, b32 isInitialCall)
ApiStatus SetNpcFlagBits(Evt *script, b32 isInitialCall)
ApiStatus InterruptUsePartner(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerPos(Evt *script, b32 isInitialCall)
ApiStatus GetBattleOutcome(Evt *script, b32 isInitialCall)
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:319
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:341
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar5
Definition macros.h:153
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define SetGroup(GROUP)
Sets the current thread's group. Group value meanings are currently not known.
Definition macros.h:519
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar4
Definition macros.h:152
#define LVar3
Definition macros.h:151
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217
EvtScript EVS_NpcHitRecoil
Definition 38F00.c:13