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

Go to the source code of this file.

Macros

#define USE_STATE   functionTemp[0]
 
#define VAR_MSG   varTable[0]
 
#define VAR_SKIP   varTable[1]
 

Functions

s32 N get_trigger_tattle (s32 tattleColliderID)
 
void N init (Npc *goombario)
 
void N try_cancel_tweester (Npc *goombario)
 
s32 N can_open_menus (Npc *goombario)
 
void N pre_battle (Npc *goombario)
 

Variables

SpeechBubbleDataSpeechBubblePtr
 
BSS s32 WorldTattleInteractionID
 
EvtScript EVS_WorldGoombario_TakeOut
 
EvtScript EVS_WorldGoombario_Update
 
EvtScript EVS_WorldGoombario_UseAbility
 
EvtScript EVS_WorldGoombario_PutAway
 

Macro Definition Documentation

◆ USE_STATE

#define USE_STATE   functionTemp[0]

◆ VAR_MSG

#define VAR_MSG   varTable[0]

◆ VAR_SKIP

#define VAR_SKIP   varTable[1]

Function Documentation

◆ get_trigger_tattle()

s32 N get_trigger_tattle ( s32 tattleColliderID)

Definition at line 62 of file goombario.c.

62 {
63 s32 i;
64
65 for (i = 0; i < MAX_TRIGGERS; i++) {
66 Trigger* trigger = get_trigger_by_id(i);
67
68 if (trigger != NULL
69 && trigger->flags & TRIGGER_WALL_PRESS_A
70 && trigger->location.colliderID == tattleColliderID
71 ) {
72 return trigger->tattleMsg;
73 }
74 }
75 return 0;
76}
@ TRIGGER_WALL_PRESS_A
Definition enums.h:2678
Trigger * get_trigger_by_id(s32 triggerID)
Definition trigger.c:276
#define MAX_TRIGGERS
Definition macros.h:92
union Trigger::@1 location

◆ init()

void N init ( Npc * goombario)

Definition at line 78 of file goombario.c.

78 {
79 goombario->collisionHeight = 24;
80 goombario->collisionDiameter = 20;
81}
s16 collisionDiameter
s16 collisionHeight

◆ try_cancel_tweester()

void N try_cancel_tweester ( Npc * goombario)

Definition at line 189 of file goombario.c.

189 {
192 goombario->flags = N(TweesterPhysicsPtr)->prevFlags;
193 N(TweesterPhysicsPtr)->state = TWEESTER_PARTNER_INIT;
195 }
196}
@ TWEESTER_PARTNER_INIT
Definition enums.h:2475
void partner_clear_player_tracking(Npc *partner)
Definition partners.c:2436
s32 flags
Entity * TweesterTouchingPartner
Definition 7B440.c:5

◆ can_open_menus()

s32 N can_open_menus ( Npc * goombario)

Definition at line 204 of file goombario.c.

204 {
206 return FALSE;
207 }
208
209 if ((goombario->flags & (NPC_FLAG_GROUNDED | NPC_FLAG_JUMPING)) != NPC_FLAG_GROUNDED) {
210 return FALSE;
211 }
212
213 return TRUE;
214}
@ PARTNER_ACTION_NONE
Definition enums.h:2932
@ NPC_FLAG_JUMPING
Definition enums.h:3009
@ NPC_FLAG_GROUNDED
Definition enums.h:3010
PartnerStatus gPartnerStatus
Definition partners.c:42

◆ pre_battle()

void N pre_battle ( Npc * goombario)

Definition at line 499 of file goombario.c.

499 {
500 PartnerStatus* partnerStatus = &gPartnerStatus;
501
502 if (partnerStatus->partnerActionState != PARTNER_ACTION_NONE) {
508 partnerStatus->actingPartner = PARTNER_NONE;
509 disable_npc_blur(goombario);
510 }
511
512 partnerStatus->actingPartner = PARTNER_GOOMBARIO;
513}
@ TIME_FREEZE_NONE
Definition enums.h:3464
@ PARTNER_NONE
Definition enums.h:2885
@ PARTNER_GOOMBARIO
Definition enums.h:2886
void disable_npc_blur(Npc *npc)
Definition npc.c:1088
s32 enable_player_input(void)
Definition 77480.c:998
void set_time_freeze_mode(s32)
Time freeze modes: 0: none 1: NPCs move, can't be interacted with 2: NPCs don't move,...
Definition main_loop.c:358
s32 cancel_current_message(void)
Definition msg_api.c:312

Variable Documentation

◆ SpeechBubblePtr

SpeechBubbleData* SpeechBubblePtr
extern

◆ WorldTattleInteractionID

BSS s32 WorldTattleInteractionID

Definition at line 18 of file goombario.c.

Referenced by check_input_use_partner().

◆ EVS_WorldGoombario_TakeOut

EvtScript EVS_WorldGoombario_TakeOut
Initial value:
= {
Call(N(TakeOut))
}
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Return
Kills the current EVT thread.
Definition macros.h:217

Definition at line 98 of file goombario.c.

98 {
99 Call(N(TakeOut))
100 Return
101 End
102};

◆ EVS_WorldGoombario_Update

EvtScript EVS_WorldGoombario_Update
Initial value:
= {
Call(N(Update))
}

Definition at line 198 of file goombario.c.

198 {
199 Call(N(Update))
200 Return
201 End
202};

◆ EVS_WorldGoombario_UseAbility

EvtScript EVS_WorldGoombario_UseAbility
Initial value:
= {
Call(N(SelectTattleMsg))
IfEq(LVar0, -1)
IfEq(LVar0, MSG_NONE)
Call(N(TattleEnd))
IfEq(LVar1, FALSE)
Call(SpeakToPlayer, NPC_PARTNER, ANIM_WorldGoombario_Talk, ANIM_WorldGoombario_Idle, 0, LVar0)
Wait(1)
Call(N(TattleEnd))
}
@ NPC_PARTNER
Definition enums.h:2528
#define SpeakToPlayer(ARGS...)
Definition msg_api.h:6
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar1
Definition macros.h:149
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define LVar0
Definition macros.h:148

Definition at line 457 of file goombario.c.

457 {
458 Call(N(SelectTattleMsg))
459 // abort without cleanup if failed to init
460 IfEq(LVar0, -1)
461 Return
462 EndIf
463 // abort if no tattle message is available
464 IfEq(LVar0, MSG_NONE)
465 Call(N(TattleEnd))
466 Return
467 EndIf
468 // show message if VAR_SKIP is FALSE
469 IfEq(LVar1, FALSE)
470 Call(SpeakToPlayer, NPC_PARTNER, ANIM_WorldGoombario_Talk, ANIM_WorldGoombario_Idle, 0, LVar0)
471 EndIf
472 Wait(1)
473 // cleanup
474 Call(N(TattleEnd))
475 Return
476 End
477};

◆ EVS_WorldGoombario_PutAway

EvtScript EVS_WorldGoombario_PutAway
Initial value:
= {
Call(N(PutAway))
}

Definition at line 493 of file goombario.c.

493 {
494 Call(N(PutAway))
495 Return
496 End
497};