2#include "sprite/npc/WorldGoombario.h"
4#include "../src/world/partners.h"
5#include "message_ids.h"
8#define NAMESPACE world_goombario
12BSS s32 N(HadSpeechPrompt);
13BSS s32 N(HadInteractPrompt);
19BSS s32 N(IsTattleActive);
21s32 N(EntityTattles)[][2] = {
70 && trigger->
location.colliderID == tattleColliderID
79 goombario->collisionHeight = 24;
80 goombario->collisionDiameter = 20;
83API_CALLABLE(N(TakeOut)) {
84 Npc* goombario = script->owner2.npc;
106API_CALLABLE(N(Update)) {
108 Npc* npc = script->owner2.npc;
109 f32 sinAngle, cosAngle, liftoffVelocity;
121 if (entity == NULL) {
127 switch (N(TweesterPhysicsPtr)->state) {
129 N(TweesterPhysicsPtr)->state = 1;
130 N(TweesterPhysicsPtr)->prevFlags = npc->
flags;
133 N(TweesterPhysicsPtr)->angularVel = 6.0f;
134 N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f;
135 N(TweesterPhysicsPtr)->countdown = 120;
137 npc->
flags &= ~NPC_FLAG_GRAVITY;
141 npc->
pos.
x = entity->
pos.
x + (sinAngle * N(TweesterPhysicsPtr)->radius);
142 npc->
pos.
z = entity->
pos.
z - (cosAngle * N(TweesterPhysicsPtr)->radius);
143 N(TweesterPhysicsPtr)->angle =
clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel);
145 if (N(TweesterPhysicsPtr)->radius > 20.0f) {
146 N(TweesterPhysicsPtr)->radius--;
147 }
else if (N(TweesterPhysicsPtr)->radius < 19.0f) {
148 N(TweesterPhysicsPtr)->radius++;
151 liftoffVelocity =
sin_rad(
DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f;
152 N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f;
154 if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) {
155 N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f;
158 npc->
pos.
y += liftoffVelocity;
161 N(TweesterPhysicsPtr)->angularVel += 0.8;
163 if (N(TweesterPhysicsPtr)->angularVel > 40.0f) {
164 N(TweesterPhysicsPtr)->angularVel = 40.0f;
167 if (--N(TweesterPhysicsPtr)->countdown == 0) {
168 N(TweesterPhysicsPtr)->state++;
172 npc->
flags = N(TweesterPhysicsPtr)->prevFlags;
173 N(TweesterPhysicsPtr)->countdown = 30;
174 N(TweesterPhysicsPtr)->state++;
180 if (--N(TweesterPhysicsPtr)->countdown == 0) {
192 goombario->
flags = N(TweesterPhysicsPtr)->prevFlags;
216API_CALLABLE(N(SelectTattleMsg)) {
218 Npc* goombario = script->owner2.npc;
225 #define USE_STATE functionTemp[0]
226 #define VAR_MSG varTable[0]
227 #define VAR_SKIP varTable[1]
229 USE_TATTLE_INIT = 40,
230 USE_TATTLE_DELAY = 41,
231 USE_TATTLE_FACE_PLAYER = 0,
232 USE_TATTLE_CHOOSE = 1,
233 USE_TATTLE_FORCE_MAP = 10,
234 USE_TATTLE_FORCE_NPC = 20,
239 N(IsTattleActive) = FALSE;
240 N(HadSpeechPrompt) = FALSE;
241 N(HadInteractPrompt) = FALSE;
243 N(HadSpeechPrompt) = TRUE;
247 N(HadInteractPrompt) = TRUE;
249 script->USE_STATE = USE_TATTLE_INIT;
252 switch (script->USE_STATE) {
253 case USE_TATTLE_INIT:
259 script->VAR_MSG = -1;
264 script->VAR_MSG = -1;
268 script->functionTemp[1] = 3;
270 N(IsTattleActive) = TRUE;
274 case USE_TATTLE_DELAY:
275 if (script->functionTemp[1] != 0) {
276 script->functionTemp[1]--;
279 script->VAR_MSG = -1;
281 N(IsTattleActive) = FALSE;
284 script->USE_STATE = USE_TATTLE_FACE_PLAYER;
287 case USE_TATTLE_FACE_PLAYER:
289 playerStatus->
flags &= ~PS_FLAG_HAS_CONVERSATION_NPC;
290 goombario->
curAnim = ANIM_WorldGoombario_Idle;
294 if (N(HadSpeechPrompt)) {
296 script->USE_STATE = USE_TATTLE_FORCE_NPC;
299 script->USE_STATE = USE_TATTLE_CHOOSE;
301 case USE_TATTLE_CHOOSE:
307 for (i = 0; N(EntityTattles)[i][0] != -1; i++) {
308 if (N(EntityTattles)[i][0] != entityType) {
311 switch (entityType) {
315 msgID = MSG_EntityTattle_HammerBlock2_CanBreak;
321 msgID = MSG_EntityTattle_HammerBlock3_CanBreak;
326 msgID = MSG_EntityTattle_WoodenCrate_SpinJump;
328 msgID = MSG_EntityTattle_WoodenCrate_TornadoJump;
333 msgID = MSG_EntityTattle_BoardedFloor_SpinJump;
335 msgID = MSG_EntityTattle_BoardedFloor_TornadoJump;
340 msgID = MSG_EntityTattle_BigSwitch_TornadoJump;
345 msgID = MSG_EntityTattle_FloorSwitch_TornadoJump;
350 msgID = MSG_EntityTattle_JackInTheBox_TornadoJump;
355 msgID = MSG_EntityTattle_EmptyChest;
360 script->VAR_MSG = msgID;
362 script->VAR_MSG = N(EntityTattles)[i][1];
364 script->VAR_SKIP = FALSE;
373 if (enemyTattleMsg != 0) {
374 msgID = enemyTattleMsg;
376 script->VAR_MSG = ((s32(*)(void))msgID)();
378 script->VAR_MSG = msgID;
379 script->VAR_SKIP = FALSE;
386 if (N(HadInteractPrompt)) {
387 script->VAR_MSG = MSG_EntityTattle_Interact;
388 script->VAR_SKIP = FALSE;
399 if (msgID == MSG_NONE) {
404 script->VAR_MSG = ((s32(*)(void))msgID)();
406 script->VAR_MSG = msgID;
407 script->VAR_SKIP = FALSE;
411 script->VAR_MSG = msgID;
412 script->VAR_SKIP = TRUE;
417 switch (script->USE_STATE) {
418 case USE_TATTLE_FORCE_MAP:
422 script->VAR_MSG = ((s32(*)(void))msgID)();
424 script->VAR_MSG = msgID;
425 script->VAR_SKIP = FALSE;
430 case USE_TATTLE_FORCE_NPC:
432 if (npcMsgID != MSG_NONE) {
433 script->VAR_MSG = npcMsgID;
434 script->VAR_SKIP = FALSE;
442API_CALLABLE(N(TattleEnd)) {
447 if (N(IsTattleActive)) {
448 N(IsTattleActive) = FALSE;
458 Call(N(SelectTattleMsg))
479API_CALLABLE(N(PutAway)) {
480 Npc* goombario = script->owner2.npc;
@ ENTITY_TYPE_HAMMER1_BLOCK
@ ENTITY_TYPE_TRUMPET_PLANT
@ ENTITY_TYPE_SINGLE_TRIGGER_BLOCK
@ ENTITY_TYPE_BELLBELL_PLANT
@ ENTITY_TYPE_SCRIPT_SPRING
@ ENTITY_TYPE_PINK_FLOWER
@ ENTITY_TYPE_BOMBABLE_ROCK
@ ENTITY_TYPE_RED_ARROW_SIGNS
@ ENTITY_TYPE_HAMMER3_BLOCK
@ ENTITY_TYPE_HUGE_BLUE_SWITCH
@ ENTITY_TYPE_BLUE_SWITCH
@ ENTITY_TYPE_GREEN_STOMP_SWITCH
@ ENTITY_TYPE_CYMBAL_PLANT
@ ENTITY_TYPE_HAMMER2_BLOCK
@ ENTITY_TYPE_HAMMER3_BLOCK_TINY
@ ENTITY_TYPE_MULTI_COIN_BRICK
@ ENTITY_TYPE_SIMPLE_SPRING
@ ENTITY_TYPE_SPINNING_FLOWER
@ ENTITY_TYPE_PADLOCK_RED_FACE
@ ENTITY_TYPE_BRICK_BLOCK
@ ENTITY_TYPE_HAMMER2_BLOCK_TINY
@ ENTITY_TYPE_MULTI_TRIGGER_BLOCK
@ ENTITY_TYPE_HAMMER1_BLOCK_TINY
@ ENTITY_TYPE_PADLOCK_RED_FRAME
@ ENTITY_TYPE_PADLOCK_BLUE_FACE
@ ENTITY_TYPE_BLUE_WARP_PIPE
@ ENTITY_TYPE_YELLOW_BLOCK
@ ENTITY_TYPE_BOARDED_FLOOR
@ ENTITY_TYPE_WOODEN_CRATE
@ ENTITY_TYPE_STAR_BOX_LAUNCHER
@ PA_FLAG_SPEECH_PROMPT_AVAILABLE
(...) prompt
@ PA_FLAG_INTERACT_PROMPT_AVAILABLE
! prompt
@ NPC_FLAG_IGNORE_WORLD_COLLISION
@ NPC_FLAG_IGNORE_PLAYER_COLLISION
@ NPC_FLAG_IGNORE_CAMERA_FOR_YAW
Entity * get_entity_by_index(s32 index)
Trigger * get_trigger_by_id(s32 triggerID)
void disable_npc_blur(Npc *npc)
void partner_walking_update_motion(Npc *partner)
void partner_clear_player_tracking(Npc *partner)
s32 disable_player_input(void)
void partner_walking_update_player_tracking(Npc *partner)
void close_status_bar(void)
s32 enable_player_input(void)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
u32 get_entity_type(s32 arg0)
void partner_walking_enable(Npc *partner, s32 val)
void set_time_freeze_mode(s32)
Time freeze modes: 0: none 1: NPCs move, can't be interacted with 2: NPCs don't move,...
void sin_cos_rad(f32 rad, f32 *outSinTheta, f32 *outCosTheta)
s32 cancel_current_message(void)
#define SpeakToPlayer(ARGS...)
Enemy * get_enemy(s32 npcID)
Looks for an enemy matching the specified npcID.
Npc * get_npc_unsafe(s32 npcID)
s32 partner_init_get_out(Npc *npc)
s32 partner_init_put_away(Npc *partner)
s32 partner_put_away(Npc *partner)
s32 partner_get_out(Npc *partner)
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define COLLISION_WITH_ENTITY_BIT
#define EndIf
Marks the end of an if statement or an else block.
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define COLLISION_WITH_NPC_BIT
#define Return
Kills the current EVT thread.
union MapSettings::@48 tattle
MapSettings * get_current_map_settings(void)
union Trigger::@1 location
Entity * TweesterTouchingPartner
PartnerStatus gPartnerStatus
PlayerStatus gPlayerStatus
EvtScript EVS_WorldGoombario_UseAbility
EvtScript EVS_WorldGoombario_TakeOut
s32 N can_open_menus(Npc *goombario)
BSS s32 WorldTattleInteractionID
s32 N get_trigger_tattle(s32 tattleColliderID)
EvtScript EVS_WorldGoombario_Update
void N pre_battle(Npc *goombario)
SpeechBubbleData * SpeechBubblePtr
void N try_cancel_tweester(Npc *goombario)
void N init(Npc *goombario)
EvtScript EVS_WorldGoombario_PutAway