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

Go to the source code of this file.

Variables

s32 DoorModelsSwingCCW [3]
 
s32 DoorModelsSwingCW [3]
 
EvtScript EnterWalk
 
EvtScript EnterWalkShort
 
EvtScript EnterWalkCustom
 
EvtScript EnterPostPipe
 
EvtScript EnterSavePoint
 
EvtScript ExitWalk
 
EvtScript ExitSingleDoor
 
EvtScript EnterSingleDoor
 
EvtScript ExitSplitSingleDoor
 
EvtScript EnterSplitSingleDoor
 
EvtScript ExitDoubleDoor
 
EvtScript EnterDoubleDoor
 
EvtScript ExitSplitDoubleDoor
 
EvtScript EnterSplitDoubleDoor
 
EvtScript BaseExitDoor
 
EvtScript BaseEnterDoor
 

Variable Documentation

◆ DoorModelsSwingCCW

s32 DoorModelsSwingCCW[3]
extern

Definition at line 67 of file script_list.c.

◆ DoorModelsSwingCW

s32 DoorModelsSwingCW[3]
extern

Definition at line 66 of file script_list.c.

◆ EnterWalk

EvtScript EnterWalk
Initial value:
= {
Call(ShortenPartnerTetherDistance)
Call(CheckUsingRideablePartner)
IfEq(LVarA, 0)
Call(TeleportPartnerToPlayer)
Set(LVar0, 0)
Set(LVarC, 1)
Set(LVar4, 15)
Call(ResetPartnerTetherDistance)
}
ApiStatus func_802D2148(Evt *script, b32 isInitialCall)
ApiStatus UseEntryHeading(Evt *script, b32 isInitialCall)
ApiStatus PlayerMoveTo(Evt *script, b32 isInitialCall)
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define LVarF
Definition macros.h:163
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define LVarC
Definition macros.h:160
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define LVar4
Definition macros.h:152
#define LVar3
Definition macros.h:151
#define LVar0
Definition macros.h:148
#define Exec(EVT_SOURCE)
Launches a new thread.
Definition macros.h:455
#define Return
Kills the current EVT thread.
Definition macros.h:217

Definition at line 198 of file enter_exit.c.

198 {
199 Call(ShortenPartnerTetherDistance)
200 Call(CheckUsingRideablePartner)
201 Call(UseEntryHeading, 60, 15)
202 IfEq(LVarA, 0)
203 Call(TeleportPartnerToPlayer)
205 Else
206 Set(LVarF, LVar0)
207 Set(LVar0, 0)
208 Set(LVarC, 1)
209 Set(LVar4, 15)
211 Set(LVar0, LVarF)
212 EndIf
213 Exec(LVar0)
215 Call(ResetPartnerTetherDistance)
216 Return
217 End
218};

◆ EnterWalkShort

EvtScript EnterWalkShort
Initial value:
= {
Call(ShortenPartnerTetherDistance)
Call(CheckUsingRideablePartner)
IfEq(LVarA, 0)
Call(TeleportPartnerToPlayer)
Set(LVar0, 0)
Set(LVarC, 1)
Set(LVar4, 15)
Call(ResetPartnerTetherDistance)
}

Definition at line 220 of file enter_exit.c.

220 {
221 Call(ShortenPartnerTetherDistance)
222 Call(CheckUsingRideablePartner)
223 Call(UseEntryHeading, 40, 15)
224 IfEq(LVarA, 0)
225 Call(TeleportPartnerToPlayer)
227 Else
228 Set(LVarF, LVar0)
229 Set(LVar0, 0)
230 Set(LVarC, 1)
231 Set(LVar4, 15)
233 Set(LVar0, LVarF)
234 EndIf
235 Exec(LVar0)
237 Call(ResetPartnerTetherDistance)
238 Return
239 End
240};

◆ EnterWalkCustom

EvtScript EnterWalkCustom
Initial value:
= {
Call(ShortenPartnerTetherDistance)
Call(CheckUsingRideablePartner)
IfEq(LVarA, 0)
Call(TeleportPartnerToPlayer)
Set(LVar0, 0)
Set(LVarC, 1)
Call(ResetPartnerTetherDistance)
}

Definition at line 242 of file enter_exit.c.

242 {
243 Call(ShortenPartnerTetherDistance)
244 Call(CheckUsingRideablePartner)
246 IfEq(LVarA, 0)
247 Call(TeleportPartnerToPlayer)
249 Else
250 Set(LVarF, LVar0)
251 Set(LVar0, 0)
252 Set(LVarC, 1)
254 Set(LVar0, LVarF)
255 EndIf
256 Exec(LVar0)
258 Call(ResetPartnerTetherDistance)
259 Return
260 End
261};

◆ EnterPostPipe

EvtScript EnterPostPipe
Initial value:
= {
Call(ShortenPartnerTetherDistance)
Call(CheckUsingRideablePartner)
Call(EnterPlayerPostPipe)
Call(ResetPartnerTetherDistance)
}
ApiStatus DisablePlayerPhysics(Evt *script, b32 isInitialCall)
Disables player physics if disable is TRUE, enables it if FALSE.

Definition at line 263 of file enter_exit.c.

263 {
265 Call(ShortenPartnerTetherDistance)
266 Call(CheckUsingRideablePartner)
267 Call(EnterPlayerPostPipe)
268 Call(ResetPartnerTetherDistance)
270 Return
271 End
272};

◆ EnterSavePoint

EvtScript EnterSavePoint
Initial value:
= {
Call(ShortenPartnerTetherDistance)
Call(SetPlayerPositionFromSaveData)
Call(ResetPartnerTetherDistance)
}
@ NPC_PARTNER
Definition enums.h:2528
ApiStatus ClearPartnerMoveHistory(Evt *script, b32 isInitialCall)

Definition at line 274 of file enter_exit.c.

274 {
275 Call(ShortenPartnerTetherDistance)
276 Call(SetPlayerPositionFromSaveData)
278 Call(ResetPartnerTetherDistance)
279 Return
280 End
281};

◆ ExitWalk

EvtScript ExitWalk
Initial value:
= {
Call(ShortenPartnerTetherDistance)
Call(CheckUsingRideablePartner)
IfEq(LVarA, 0)
Set(LVar0, 0)
Set(LVarC, 0)
Set(LVar4, 15)
Call(ResetPartnerTetherDistance)
}
ApiStatus DisablePlayerInput(Evt *script, b32 isInitialCall)
Disables player and partner input, and disables the status menu.

Definition at line 283 of file enter_exit.c.

283 {
285 Call(ShortenPartnerTetherDistance)
286 Call(CheckUsingRideablePartner)
287 IfEq(LVarA, 0)
289 Else
290 Set(LVar0, 0)
291 Set(LVarC, 0)
292 Set(LVar4, 15)
294 EndIf
295 Call(ResetPartnerTetherDistance)
296 Return
297 End
298};

◆ ExitSingleDoor

EvtScript ExitSingleDoor
Initial value:
= {
Call(SetupSingleDoor)
}
EvtScript BaseExitDoor
Definition enter_exit.c:356

Definition at line 300 of file enter_exit.c.

300 {
301 Call(SetupSingleDoor)
303 Return
304 End
305};

◆ EnterSingleDoor

EvtScript EnterSingleDoor
Initial value:
= {
Call(SetupSingleDoor)
}
EvtScript BaseEnterDoor
Definition enter_exit.c:406

Definition at line 307 of file enter_exit.c.

307 {
308 Call(SetupSingleDoor)
310 Return
311 End
312};

◆ ExitSplitSingleDoor

EvtScript ExitSplitSingleDoor
Initial value:
= {
Call(SetupSplitSingleDoor)
}

Definition at line 314 of file enter_exit.c.

314 {
315 Call(SetupSplitSingleDoor)
317 Return
318 End
319};

◆ EnterSplitSingleDoor

EvtScript EnterSplitSingleDoor
Initial value:
= {
Call(SetupSplitSingleDoor)
}

Definition at line 321 of file enter_exit.c.

321 {
322 Call(SetupSplitSingleDoor)
324 Return
325 End
326};

◆ ExitDoubleDoor

EvtScript ExitDoubleDoor
Initial value:
= {
Call(SetupDoubleDoors)
}

Definition at line 328 of file enter_exit.c.

328 {
329 Call(SetupDoubleDoors)
331 Return
332 End
333};

◆ EnterDoubleDoor

EvtScript EnterDoubleDoor
Initial value:
= {
Call(SetupDoubleDoors)
}

Definition at line 335 of file enter_exit.c.

335 {
336 Call(SetupDoubleDoors)
338 Return
339 End
340};

◆ ExitSplitDoubleDoor

EvtScript ExitSplitDoubleDoor
Initial value:
= {
Call(SetupSplitDoubleDoors)
}

Definition at line 342 of file enter_exit.c.

342 {
343 Call(SetupSplitDoubleDoors)
345 Return
346 End
347};

◆ EnterSplitDoubleDoor

EvtScript EnterSplitDoubleDoor
Initial value:
= {
Call(SetupSplitDoubleDoors)
}

Definition at line 349 of file enter_exit.c.

349 {
350 Call(SetupSplitDoubleDoors)
352 Return
353 End
354};

◆ BaseExitDoor

EvtScript BaseExitDoor

Definition at line 356 of file enter_exit.c.

356 {
359 Call(ShortenPartnerTetherDistance)
360 Set(LVar9, LVar0)
361 Call(GetEntryCoords, LVar0, LVarC, LVarD, LVarE, LVarB)
362 Add(LVarB, 180)
366 Call(MakeLerp, 0, 80, 10, EASING_LINEAR)
367 Label(0)
370 Loop(0)
372 IfEq(LVarA, -1)
374 EndIf
375 Call(RotateModel, LVarA, LVar0, 0, 1, 0)
376 EndLoop
378 Loop(0)
380 IfEq(LVarA, -1)
382 EndIf
383 Call(RotateModel, LVarA, LVar0, 0, -1, 0)
384 EndLoop
385 Wait(1)
386 IfNe(LVar1, 0)
387 Goto(0)
388 EndIf
390 Call(CheckUsingRideablePartner)
391 IfEq(LVarA, 0)
393 Else
394 Set(LVar0, 0)
395 Set(LVarC, 0)
396 Set(LVar4, 15)
398 EndIf
399 Call(ResetPartnerTetherDistance)
402 Return
403 End
404};
@ COLLIDER_FLAGS_UPPER_MASK
Definition enums.h:4692
@ EASING_LINEAR
Definition enums.h:510
@ SOUND_DOOR_OPEN
Definition enums.h:1693
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
ApiStatus RotateModel(Evt *script, b32 isInitialCall)
Rotates the model the given amount on the selected axis.
ApiStatus UpdateLerp(Evt *script, b32 isInitialCall)
ApiStatus UseExitHeading(Evt *script, b32 isInitialCall)
ApiStatus MakeLerp(Evt *script, b32 isInitialCall)
ApiStatus InterpPlayerYaw(Evt *script, b32 isInitialCall)
ApiStatus ModifyColliderFlags(Evt *script, b32 isInitialCall)
Set flags for collider + siblings + children.
ApiStatus PlaySoundAt(Evt *script, b32 isInitialCall)
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define UseBuf(INT_PTR)
Loads a s32 pointer for use with subsequent EVT_BUF_READ commands.
Definition macros.h:389
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define BufRead1(VAR)
Consumes the next s32 from the buffer and stores it in the given variable.
Definition macros.h:392
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#define LVar2
Definition macros.h:150
#define LVarD
Definition macros.h:161
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LVar9
Definition macros.h:157
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVarE
Definition macros.h:162

◆ BaseEnterDoor

EvtScript BaseEnterDoor

Definition at line 406 of file enter_exit.c.

406 {
408 Call(ShortenPartnerTetherDistance)
410 Loop(0)
412 IfEq(LVarA, -1)
414 EndIf
415 Call(RotateModel, LVarA, -80, 0, 1, 0)
416 EndLoop
418 Loop(0)
420 IfEq(LVarA, -1)
422 EndIf
423 Call(RotateModel, LVarA, -80, 0, -1, 0)
424 EndLoop
425 Call(GetEntryCoords, LVar0, LVar7, LVar8, LVar9, LVarB)
427 Call(CheckUsingRideablePartner)
428 IfEq(LVarA, 0)
429 Call(TeleportPartnerToPlayer)
430 Call(PlayerMoveToDoor, 10)
431 Else
432 Set(LVar0, 1)
433 Set(LVarC, 1)
434 Set(LVar4, 15)
436 EndIf
437 Thread
438 Wait(8)
441 Call(MakeLerp, -80, 0, 10, EASING_LINEAR)
442 Label(0)
445 Loop(0)
447 IfEq(LVarA, -1)
449 EndIf
450 Call(RotateModel, LVarA, LVar0, 0, 1, 0)
451 EndLoop
453 Loop(0)
455 IfEq(LVarA, -1)
457 EndIf
458 Call(RotateModel, LVarA, LVar0, 0, -1, 0)
459 EndLoop
460 Wait(1)
461 IfNe(LVar1, 0)
462 Goto(0)
463 EndIf
464 Call(ResetPartnerTetherDistance)
466 Return
467 End
468};
@ SOUND_DOOR_CLOSE
Definition enums.h:1694
#define LVar7
Definition macros.h:155
#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 LVar8
Definition macros.h:156