partners and notifications (#966)

* kooper cleanup

* second pass

* notifications

* goombario

* tweesters mostly

---------

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
This commit is contained in:
HailSanta 2023-03-06 02:44:48 -05:00 committed by GitHub
parent 31a49cbdb6
commit 5ba2b3a6bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 1098 additions and 1051 deletions

View File

@ -145,13 +145,6 @@ typedef struct DmaTable {
/* 0x08 */ u8* dest; /* 0x08 */ u8* dest;
} DmaTable; } DmaTable;
typedef struct UseItemStruct {
/* 0x00 */ u8* dmaStart;
/* 0x04 */ u8* dmaEnd;
/* 0x08 */ EvtScript* script;
/* 0x0C */ s32 unk_0C;
} UseItemStruct;
typedef struct PartnerData { typedef struct PartnerData {
/* 0x00 */ u8 enabled; /* 0x00 */ u8 enabled;
/* 0x01 */ s8 level; /* 0x01 */ s8 level;
@ -401,7 +394,7 @@ typedef struct Trigger {
/* */ void* varTablePtr[3]; /* */ void* varTablePtr[3];
/* */ }; /* */ };
/* 0x28 */ s32* itemList; /* 0x28 */ s32* itemList;
/* 0x2C */ s32 unk_tr_2C; // related to Goombario somehow, custom tattle perhaps? /* 0x2C */ s32 tattleMsg;
/* 0x30 */ u8 hasPlayerInteractPrompt; /* 0x30 */ u8 hasPlayerInteractPrompt;
/* 0x31 */ char unk_31[3]; /* 0x31 */ char unk_31[3];
/* 0x34 */ s32 runningScriptID; /* 0x34 */ s32 runningScriptID;
@ -416,7 +409,7 @@ typedef struct TriggerBlueprint {
/* 0x08 */ s32 colliderID; /* 0x08 */ s32 colliderID;
/* 0x0C */ s32 (*onActivateFunc)(struct Trigger*); /* 0x0C */ s32 (*onActivateFunc)(struct Trigger*);
/* 0x10 */ char unk_10[4]; /* 0x10 */ char unk_10[4];
/* 0x14 */ s32 unk_tr_2C; /* 0x14 */ s32 tattleMsg;
/* 0x18 */ s32 hasPlayerInteractPrompt; /* 0x18 */ s32 hasPlayerInteractPrompt;
/* 0x1C */ s32* itemList; /* 0x1C */ s32* itemList;
} TriggerBlueprint; // size = 0x20 } TriggerBlueprint; // size = 0x20
@ -1993,7 +1986,7 @@ typedef struct PlayerStatus {
/* 0x010 */ s16 blinkTimer; /* 0x010 */ s16 blinkTimer;
/* 0x012 */ s16 moveFrames; /* 0x012 */ s16 moveFrames;
/* 0x014 */ s8 enableCollisionOverlapsCheck; /* 0x014 */ s8 enableCollisionOverlapsCheck;
/* 0x015 */ s8 inputEnabledCounter; /* whether the C-up menu can appear */ /* 0x015 */ s8 inputDisabledCount; /* whether the C-up menu can appear */
/* 0x016 */ Vec3s lastGoodPosition; /* 0x016 */ Vec3s lastGoodPosition;
/* 0x01C */ Vec3f pushVelocity; /* 0x01C */ Vec3f pushVelocity;
/* 0x028 */ Vec3f position; /* 0x028 */ Vec3f position;
@ -2538,4 +2531,17 @@ typedef struct LavaPiranhaVine {
/* 0x1DC */ s32 numPoints; /* 0x1DC */ s32 numPoints;
} LavaPiranhaVine; } LavaPiranhaVine;
typedef struct SpeechBubbleData {
/* 0x00 */ Npc* encounteredNPC;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 yaw;
/* 0x14 */ f32 scale;
/* 0x18 */ s32 unk_18;
/* 0x1C */ f32 unk_1C; //lastPosY?
/* 0x20 */ s32 holdTime;
/* 0x24 */ char unk_24[6];
/* 0x2A */ u8 state;
/* 0x2B */ u8 brightness;
} SpeechBubbleData; /* size = 0x2C */
#endif #endif

View File

@ -3034,6 +3034,13 @@ enum JumpSubstate {
JUMP_SUBSTATE_1 = 1, JUMP_SUBSTATE_1 = 1,
}; };
enum TweesterPartnerStates {
TWEESTER_PARTNER_INIT = 0,
TWEESTER_PARTNER_ATTRACT = 1,
TWEESTER_PARTNER_HOLD = 2,
TWEESTER_PARTNER_RELEASE = 3,
};
enum LandOnSwitchSubstate { enum LandOnSwitchSubstate {
LANDING_ON_SWITCH_SUBSTATE_0 = 0, LANDING_ON_SWITCH_SUBSTATE_0 = 0,
LANDING_ON_SWITCH_SUBSTATE_1 = 1, LANDING_ON_SWITCH_SUBSTATE_1 = 1,
@ -3578,14 +3585,14 @@ enum PlayerStatusAnimFlags {
PA_FLAG_FORCE_USE_PARTNER = 0x00000008, ///< triggers partner use when set PA_FLAG_FORCE_USE_PARTNER = 0x00000008, ///< triggers partner use when set
PA_FLAG_INTERACT_PROMPT_AVAILABLE = 0x00000010, ///< ! prompt PA_FLAG_INTERACT_PROMPT_AVAILABLE = 0x00000010, ///< ! prompt
PA_FLAG_SPEECH_PROMPT_AVAILABLE = 0x00000020, ///< (...) prompt PA_FLAG_SPEECH_PROMPT_AVAILABLE = 0x00000020, ///< (...) prompt
PA_FLAG_40 = 0x00000040, PA_FLAG_PULSE_STONE_VISIBLE = 0x00000040, ///< The pulse stone icon is being shown
PA_FLAG_USING_PULSE_STONE = 0x00000080, PA_FLAG_USING_PULSE_STONE = 0x00000080,
PA_FLAG_100 = 0x00000100, PA_FLAG_ISPY_VISIBLE = 0x00000100, ///< The I Spy icon is being shown
PA_FLAG_RAISED_ARMS = 0x00000200, ///< Sets action state to ACTION_STATE_RAISE_ARMS on idle PA_FLAG_RAISED_ARMS = 0x00000200, ///< Sets action state to ACTION_STATE_RAISE_ARMS on idle
PA_FLAG_SHIVERING = 0x00000400, PA_FLAG_SHIVERING = 0x00000400,
PA_FLAG_OPENED_HIDDEN_PANEL = 0x00000800, PA_FLAG_OPENED_HIDDEN_PANEL = 0x00000800,
PA_FLAG_USING_PEACH_PHYSICS = 0x00001000, PA_FLAG_USING_PEACH_PHYSICS = 0x00001000,
PA_FLAG_INVISIBLE = 0x00002000, PA_FLAG_INVISIBLE = 0x00002000,
PA_FLAG_8BIT_MARIO = 0x00004000, PA_FLAG_8BIT_MARIO = 0x00004000,
PA_FLAG_NPC_COLLIDED = 0x00008000, PA_FLAG_NPC_COLLIDED = 0x00008000,
PA_FLAG_SPINNING = 0x00010000, PA_FLAG_SPINNING = 0x00010000,

View File

@ -752,12 +752,13 @@ void shim_create_audio_system_obfuscated(void);
void shim_load_engine_data_obfuscated(void); void shim_load_engine_data_obfuscated(void);
void shim_general_heap_create_obfuscated(void); void shim_general_heap_create_obfuscated(void);
void shim_battle_heap_create_obfuscated(void); void shim_battle_heap_create_obfuscated(void);
void func_802B7000_E225B0(void); void appendGfx_ispy_icon(void);
void func_802B70B4_E201C4(void); void interact_inspect_setup(void);
void func_802B7140(void); void interact_speech_setup(void);
void func_802B71C8(void); void pulse_stone_notification_setup(void);
void func_802B71D4(void); void appendGfx_speech_bubble(void);
void func_802B72C0_E22870(void); void appendGfx_pulse_stone_icon(void);
void ispy_notification_setup(void);
s32 lakilester_raycast_below(void); s32 lakilester_raycast_below(void);
void world_watt_sync_held_position(void); void world_watt_sync_held_position(void);
void func_802BFB44_323694(f32 arg0); void func_802BFB44_323694(f32 arg0);

View File

@ -148,11 +148,14 @@ extern UNK_TYPE D_800E92D8;
extern UNK_TYPE D_80147574; extern UNK_TYPE D_80147574;
extern s8 D_8014C248[]; extern s8 D_8014C248[];
extern UNK_FUN_PTR(PulseStoneNotificationCallback);
extern UNK_FUN_PTR(TalkNotificationCallback); extern UNK_FUN_PTR(TalkNotificationCallback);
extern UNK_FUN_PTR(InteractNotificationCallback);
extern UNK_FUN_PTR(ISpyNotificationCallback);
extern UNK_FUN_PTR(PulseStoneNotificationCallback);
extern Entity* TweesterTouchingPartner; extern Entity* TweesterTouchingPartner;
extern Entity* TweesterTouchingPlayer; extern Entity* TweesterTouchingPlayer;
extern UNK_FUN_PTR(InteractNotificationCallback);
extern s32 PrevPlayerDirection; extern s32 PrevPlayerDirection;
extern s32 PeachDisguiseNpcIndex; extern s32 PeachDisguiseNpcIndex;
extern s32 D_8010C980; extern s32 D_8010C980;

View File

@ -17,9 +17,8 @@
extern f32 D_800F7B48; extern f32 D_800F7B48;
extern s32 D_800F7B4C; extern s32 D_800F7B4C;
extern UNK_FUN_PTR(ISpyNotificationCallback);
extern s8 D_8015A57A; extern s8 D_8015A57A;
extern s32 GoombarioGetTattleID; extern s32 GoombarioTattleInteractionID;
s32 player_raycast_down(f32*, f32*, f32*, f32*); s32 player_raycast_down(f32*, f32*, f32*, f32*);
s32 player_raycast_up_corner(f32* x, f32* y, f32* z, f32* length); s32 player_raycast_up_corner(f32* x, f32* y, f32* z, f32* length);
@ -29,16 +28,16 @@ void phys_update_standard(void);
void phys_update_lava_reset(void); void phys_update_lava_reset(void);
void update_player_blink(void); void update_player_blink(void);
void check_for_ispy(void); void check_for_ispy(void);
void func_800E0330(void); void render_ispy_icon(void);
void check_for_pulse_stone(void); void check_for_pulse_stone(void);
void func_800E0374(void); void clear_ispy_icon(void);
void func_800E04D0(void); void render_pulse_stone_icon(void);
void func_800E0514(void); void clear_pulse_stone_icon(void);
void check_for_conversation_prompt(void); void check_for_conversation_prompt(void);
void func_800E0658(void); void render_conversation_prompt(void);
void func_800E069C(void); void clear_conversation_prompt(void);
void check_for_interactables(void); void check_for_interactables(void);
void func_800E0AD0(void); void render_interact_prompt(void);
void func_800E0B14(void); void func_800E0B14(void);
void update_partner_timers(void); void update_partner_timers(void);
void player_update_sprite(void); void player_update_sprite(void);
@ -78,7 +77,7 @@ s32 player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* outZ,
z = inputZ + cosTemp; z = inputZ + cosTemp;
length = inputLength; length = inputLength;
hitObjectID = player_raycast_down(&x, &y, &z, &length); hitObjectID = player_raycast_down(&x, &y, &z, &length);
ret = -1; ret = NO_COLLIDER;
if (hitObjectID >= 0 && length <= fabsf(*outLength)) { if (hitObjectID >= 0 && length <= fabsf(*outLength)) {
*hitRx = -gGameStatusPtr->playerGroundTraceAngles.x; *hitRx = -gGameStatusPtr->playerGroundTraceAngles.x;
*hitRz = -gGameStatusPtr->playerGroundTraceAngles.z; *hitRz = -gGameStatusPtr->playerGroundTraceAngles.z;
@ -190,7 +189,7 @@ s32 player_raycast_down(f32* x, f32* y, f32* z, f32* length) {
f32 hitNz; f32 hitNz;
s32 entityID, colliderID; s32 entityID, colliderID;
Entity* entity; Entity* entity;
s32 ret = -1; s32 ret = NO_COLLIDER;
hitDepth = *length; hitDepth = *length;
entityID = test_ray_entities(*x, *y, *z, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); entityID = test_ray_entities(*x, *y, *z, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);
@ -257,7 +256,7 @@ s32 player_raycast_up_corners(PlayerStatus* player, f32* posX, f32* posY, f32* p
startY = y; startY = y;
startZ = z + deltaZ; startZ = z + deltaZ;
ret = -1; ret = NO_COLLIDER;
hitID = player_raycast_up_corner(&startX, &startY, &startZ, &depth); hitID = player_raycast_up_corner(&startX, &startY, &startZ, &depth);
if (hitID < 0) { if (hitID < 0) {
@ -314,7 +313,7 @@ s32 player_raycast_up_corner(f32* x, f32* y, f32* z, f32* length) {
f32 sx2, sy2, sz2; f32 sx2, sy2, sz2;
f32 startX, startY, startZ; f32 startX, startY, startZ;
ret = -1; ret = NO_COLLIDER;
// needed to match // needed to match
sx2 = sx = *x; sx2 = sx = *x;
@ -371,7 +370,7 @@ s32 player_test_lateral_overlap(s32 mode, PlayerStatus* playerStatus, f32* x, f3
s32 ret; s32 ret;
radius = playerStatus->colliderDiameter * 0.5f; radius = playerStatus->colliderDiameter * 0.5f;
ret = -1; ret = NO_COLLIDER;
if (!(playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING))) { if (!(playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING))) {
height = playerStatus->colliderHeight * 0.286f; height = playerStatus->colliderHeight * 0.286f;
@ -423,7 +422,7 @@ s32 player_raycast_general(s32 mode, f32 startX, f32 startY, f32 startZ, f32 dir
entityID = test_ray_entities(startX, startY, startZ, dirX, dirY, dirZ, hitX, hitY, hitZ, hitDepth, hitNx, hitNy, entityID = test_ray_entities(startX, startY, startZ, dirX, dirY, dirZ, hitX, hitY, hitZ, hitDepth, hitNx, hitNy,
hitNz); hitNz);
ret = -1; ret = NO_COLLIDER;
if (entityID >= 0) { if (entityID >= 0) {
entity = get_entity_by_index(entityID); entity = get_entity_by_index(entityID);
if (entity->alpha < 255) { if (entity->alpha < 255) {
@ -496,7 +495,7 @@ s32 player_test_move_without_slipping(PlayerStatus* playerStatus, f32* x, f32* y
cosTheta = -cosTheta; cosTheta = -cosTheta;
hitDepth = depth; hitDepth = depth;
dx = radius * sinTheta; dx = radius * sinTheta;
ret = -1; ret = NO_COLLIDER;
raycastID = player_raycast_general(0, *x, *y + 0.1, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz); raycastID = player_raycast_general(0, *x, *y + 0.1, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);
if (raycastID >= 0 && hitDepth <= depth) { if (raycastID >= 0 && hitDepth <= depth) {
@ -551,7 +550,7 @@ s32 player_test_move_with_slipping(PlayerStatus* playerStatus, f32* x, f32* y, f
f32 targetDx, targetDz; f32 targetDx, targetDz;
f32 dx, dz; f32 dx, dz;
f32 depthDiff; f32 depthDiff;
s32 ret = -1; s32 ret = NO_COLLIDER;
height = 0.0f; height = 0.0f;
if (!(playerStatus->flags & (PS_FLAG_JUMPING | PS_FLAG_FALLING))) { if (!(playerStatus->flags & (PS_FLAG_JUMPING | PS_FLAG_FALLING))) {
@ -623,10 +622,10 @@ void update_player(void) {
} }
} }
collisionStatus->currentWall = -1; collisionStatus->currentWall = NO_COLLIDER;
collisionStatus->lastWallHammered = -1; collisionStatus->lastWallHammered = NO_COLLIDER;
collisionStatus->currentInspect = -1; collisionStatus->currentInspect = NO_COLLIDER;
collisionStatus->floorBelow = 1; collisionStatus->floorBelow = TRUE;
update_player_input(); update_player_input();
playerStatus->flags &= ~PS_FLAG_SPECIAL_LAND; playerStatus->flags &= ~PS_FLAG_SPECIAL_LAND;
@ -687,14 +686,14 @@ void check_input_use_partner(void) {
u32 actionState = playerStatus->actionState; u32 actionState = playerStatus->actionState;
if (!(playerStatus->animFlags & PA_FLAG_8BIT_MARIO) if (!(playerStatus->animFlags & PA_FLAG_8BIT_MARIO)
&& (playerStatus->animFlags & PA_FLAG_FORCE_USE_PARTNER || playerStatus->inputEnabledCounter == 0) && (playerStatus->animFlags & PA_FLAG_FORCE_USE_PARTNER || playerStatus->inputDisabledCount == 0)
&& (playerStatus->pressedButtons & BUTTON_C_DOWN && !(playerStatus->flags & PS_FLAG_NO_PARTNER_USAGE)) && (playerStatus->pressedButtons & BUTTON_C_DOWN && !(playerStatus->flags & PS_FLAG_NO_PARTNER_USAGE))
&& !(playerStatus->pressedButtons & BUTTON_B) && !(playerStatus->pressedButtons & BUTTON_B)
&& !(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) && !(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)
&& actionState <= ACTION_STATE_RUN && actionState <= ACTION_STATE_RUN
) { ) {
if (playerData->currentPartner == PARTNER_GOOMBARIO) { if (playerData->currentPartner == PARTNER_GOOMBARIO) {
GoombarioGetTattleID = playerStatus->interactingWithID; GoombarioTattleInteractionID = playerStatus->interactingWithID;
} }
partner_use_ability(); partner_use_ability();
} }
@ -775,9 +774,9 @@ void player_reset_data(void) {
playerStatus->position.z); playerStatus->position.z);
func_800E6B68(); func_800E6B68();
func_800E0B14(); func_800E0B14();
func_800E069C(); clear_conversation_prompt();
func_800E0514(); clear_pulse_stone_icon();
func_800E0374(); clear_ispy_icon();
func_800E5520(); func_800E5520();
} }
@ -952,18 +951,18 @@ s32 disable_player_input(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
playerStatus->flags |= PS_FLAG_INPUT_DISABLED; playerStatus->flags |= PS_FLAG_INPUT_DISABLED;
playerStatus->inputEnabledCounter++; playerStatus->inputDisabledCount++;
return playerStatus->inputEnabledCounter; return playerStatus->inputDisabledCount;
} }
s32 enable_player_input(void) { s32 enable_player_input(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
playerStatus->inputEnabledCounter--; playerStatus->inputDisabledCount--;
if (playerStatus->inputEnabledCounter == 0) { if (playerStatus->inputDisabledCount == 0) {
playerStatus->flags &= ~PS_FLAG_INPUT_DISABLED; playerStatus->flags &= ~PS_FLAG_INPUT_DISABLED;
} }
return playerStatus->inputEnabledCounter; return playerStatus->inputDisabledCount;
} }
void func_800E01DC(void) { void func_800E01DC(void) {
@ -987,10 +986,10 @@ s32 game_scripts_disabled(void) {
} }
void player_render_interact_prompts(void) { void player_render_interact_prompts(void) {
func_800E0658(); render_conversation_prompt();
func_800E0AD0(); render_interact_prompt();
func_800E04D0(); render_pulse_stone_icon();
func_800E0330(); render_ispy_icon();
} }
void check_for_ispy(void) { void check_for_ispy(void) {
@ -1000,7 +999,7 @@ void check_for_ispy(void) {
if (!(playerStatus->animFlags & if (!(playerStatus->animFlags &
(PA_FLAG_SPEECH_PROMPT_AVAILABLE | PA_FLAG_INTERACT_PROMPT_AVAILABLE))) { (PA_FLAG_SPEECH_PROMPT_AVAILABLE | PA_FLAG_INTERACT_PROMPT_AVAILABLE))) {
dma_copy(i_spy_ROM_START, i_spy_ROM_END, i_spy_VRAM_DEF); dma_copy(i_spy_ROM_START, i_spy_ROM_END, i_spy_VRAM_DEF);
ISpyNotificationCallback = func_802B72C0_E22870; ISpyNotificationCallback = ispy_notification_setup;
} }
} }
@ -1009,15 +1008,15 @@ void check_for_ispy(void) {
} }
} }
void func_800E0330(void) { void render_ispy_icon(void) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_100) && (ISpyNotificationCallback != NULL)) { if ((gPlayerStatusPtr->animFlags & PA_FLAG_ISPY_VISIBLE) && (ISpyNotificationCallback != NULL)) {
func_802B7000_E225B0(); appendGfx_ispy_icon();
} }
} }
void func_800E0374(void) { void clear_ispy_icon(void) {
ISpyNotificationCallback = NULL; ISpyNotificationCallback = NULL;
gPlayerStatusPtr->animFlags &= ~PA_FLAG_100; gPlayerStatusPtr->animFlags &= ~PA_FLAG_ISPY_VISIBLE;
} }
void check_for_pulse_stone(void) { void check_for_pulse_stone(void) {
@ -1025,7 +1024,7 @@ void check_for_pulse_stone(void) {
s32 dx, dy; s32 dx, dy;
if (PulseStoneNotificationCallback == NULL) { if (PulseStoneNotificationCallback == NULL) {
if (gPlayerStatus.animFlags & PA_FLAG_100) { if (gPlayerStatus.animFlags & PA_FLAG_ISPY_VISIBLE) {
return; return;
} }
@ -1039,17 +1038,17 @@ void check_for_pulse_stone(void) {
return; return;
} }
if (!(gPlayerStatus.animFlags & (PA_FLAG_USING_PULSE_STONE | PA_FLAG_40))) { if (!(gPlayerStatus.animFlags & (PA_FLAG_USING_PULSE_STONE | PA_FLAG_PULSE_STONE_VISIBLE))) {
return; return;
} }
if (gPlayerStatus.flags & PS_FLAG_PAUSED || gPlayerStatus.inputEnabledCounter) { if (gPlayerStatus.flags & PS_FLAG_PAUSED || gPlayerStatus.inputDisabledCount) {
return; return;
} }
if (!(gPlayerStatus.animFlags & (PA_FLAG_SPEECH_PROMPT_AVAILABLE | PA_FLAG_INTERACT_PROMPT_AVAILABLE))) { if (!(gPlayerStatus.animFlags & (PA_FLAG_SPEECH_PROMPT_AVAILABLE | PA_FLAG_INTERACT_PROMPT_AVAILABLE))) {
dma_copy(pulse_stone_ROM_START, pulse_stone_ROM_END, pulse_stone_VRAM_DEF); dma_copy(pulse_stone_ROM_START, pulse_stone_ROM_END, pulse_stone_VRAM_DEF);
PulseStoneNotificationCallback = func_802B7140; PulseStoneNotificationCallback = pulse_stone_notification_setup;
} }
} }
@ -1058,15 +1057,15 @@ void check_for_pulse_stone(void) {
} }
} }
void func_800E04D0(void) { void render_pulse_stone_icon(void) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_40) && (PulseStoneNotificationCallback != 0)) { if ((gPlayerStatusPtr->animFlags & PA_FLAG_PULSE_STONE_VISIBLE) && (PulseStoneNotificationCallback != NULL)) {
func_802B71D4(); appendGfx_pulse_stone_icon();
} }
} }
void func_800E0514(void) { void clear_pulse_stone_icon(void) {
PulseStoneNotificationCallback = NULL; PulseStoneNotificationCallback = NULL;
gPlayerStatusPtr->animFlags &= ~PA_FLAG_40; gPlayerStatusPtr->animFlags &= ~PA_FLAG_PULSE_STONE_VISIBLE;
} }
s32 has_valid_conversation_npc(void) { s32 has_valid_conversation_npc(void) {
@ -1083,19 +1082,19 @@ s32 has_valid_conversation_npc(void) {
} }
void check_for_conversation_prompt(void) { void check_for_conversation_prompt(void) {
if (gPlayerStatus.animFlags & PA_FLAG_100 || InteractNotificationCallback || PulseStoneNotificationCallback) { if (gPlayerStatus.animFlags & PA_FLAG_ISPY_VISIBLE || InteractNotificationCallback || PulseStoneNotificationCallback != NULL) {
return; return;
} }
if (TalkNotificationCallback == NULL) { if (TalkNotificationCallback == NULL) {
if (gPlayerStatus.inputEnabledCounter || gPlayerStatus.flags & PS_FLAG_PAUSED) { if (gPlayerStatus.inputDisabledCount || gPlayerStatus.flags & PS_FLAG_PAUSED) {
return; return;
} }
if (has_valid_conversation_npc()) { if (has_valid_conversation_npc()) {
TalkNotificationCallback = NULL; TalkNotificationCallback = NULL;
dma_copy(speech_bubble_ROM_START, speech_bubble_ROM_END, speech_bubble_VRAM_DEF); dma_copy(speech_bubble_ROM_START, speech_bubble_ROM_END, speech_bubble_VRAM_DEF);
TalkNotificationCallback = func_802B70B4_E201C4; TalkNotificationCallback = interact_speech_setup;
} else { } else {
TalkNotificationCallback = NULL; TalkNotificationCallback = NULL;
return; return;
@ -1107,13 +1106,13 @@ void check_for_conversation_prompt(void) {
} }
} }
void func_800E0658(void) { void render_conversation_prompt(void) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) && (TalkNotificationCallback != 0)) { if ((gPlayerStatusPtr->animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) && (TalkNotificationCallback != NULL)) {
func_802B71C8(); appendGfx_speech_bubble();
} }
} }
void func_800E069C(void) { void clear_conversation_prompt(void) {
TalkNotificationCallback = NULL; TalkNotificationCallback = NULL;
gPlayerStatusPtr->animFlags &= ~PA_FLAG_SPEECH_PROMPT_AVAILABLE; gPlayerStatusPtr->animFlags &= ~PA_FLAG_SPEECH_PROMPT_AVAILABLE;
} }
@ -1125,41 +1124,44 @@ void func_800E06C0(s32 arg0) {
s32 func_800E06D8(void) { s32 func_800E06D8(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
Npc* npc = playerStatus->encounteredNPC; Npc* npc = playerStatus->encounteredNPC;
s32 temp = playerStatus->interactingWithID; s32 interactingID = playerStatus->interactingWithID;
s32 wall; s32 currentWall;
if (playerStatus->timeInAir || playerStatus->inputEnabledCounter) { if (playerStatus->timeInAir != 0 || playerStatus->inputDisabledCount) {
return FALSE;
}
if (gCollisionStatus.currentWall == -1) {
return FALSE; return FALSE;
} }
if (playerStatus->flags & PS_FLAG_HAS_CONVERSATION_NPC && !(playerStatus->flags & PS_FLAG_INPUT_DISABLED) if (gCollisionStatus.currentWall == NO_COLLIDER) {
&& npc != NULL && npc->flags & NPC_FLAG_10000000) { return FALSE;
playerStatus->interactingWithID = -1; }
if (playerStatus->flags & PS_FLAG_HAS_CONVERSATION_NPC
&& !(playerStatus->flags & PS_FLAG_INPUT_DISABLED)
&& npc != NULL
&& npc->flags & NPC_FLAG_10000000
) {
playerStatus->interactingWithID = NO_COLLIDER;
return TRUE; return TRUE;
} }
wall = gCollisionStatus.currentWall; currentWall = gCollisionStatus.currentWall;
if (!(wall & COLLISION_WITH_ENTITY_BIT)) { if (!(currentWall & COLLISION_WITH_ENTITY_BIT)) {
if (!should_collider_allow_interact(wall)) { if (!should_collider_allow_interact(currentWall)) {
return FALSE; return FALSE;
} }
} else if (!phys_can_player_interact()) { } else if (!phys_can_player_interact()) {
playerStatus->interactingWithID = -1; playerStatus->interactingWithID = NO_COLLIDER;
return FALSE; return FALSE;
} else if (get_entity_type(wall) == ENTITY_TYPE_PUSH_BLOCK) { } else if (get_entity_type(currentWall) == ENTITY_TYPE_PUSH_BLOCK) {
return FALSE; return FALSE;
} }
if (temp == wall) { if (interactingID == currentWall) {
if (playerStatus->flags & PS_FLAG_INTERACTED) { if (playerStatus->flags & PS_FLAG_INTERACTED) {
return FALSE; return FALSE;
} }
} else { } else {
playerStatus->flags &= ~PS_FLAG_INTERACTED; playerStatus->flags &= ~PS_FLAG_INTERACTED;
} }
playerStatus->interactingWithID = -1; playerStatus->interactingWithID = NO_COLLIDER;
return TRUE; return TRUE;
} }
@ -1171,14 +1173,14 @@ void check_for_interactables(void) {
Npc* npc = gPlayerStatus.encounteredNPC; Npc* npc = gPlayerStatus.encounteredNPC;
s32 phi_s2; s32 phi_s2;
if ((playerStatus->animFlags & PA_FLAG_100) || TalkNotificationCallback || PulseStoneNotificationCallback) { if ((playerStatus->animFlags & PA_FLAG_ISPY_VISIBLE) || TalkNotificationCallback || PulseStoneNotificationCallback != NULL) {
return; return;
} }
if (InteractNotificationCallback == NULL) { if (InteractNotificationCallback == NULL) {
s32 curInteraction = gCollisionStatus.currentWall; s32 curInteraction = gCollisionStatus.currentWall;
if (playerStatus->inputEnabledCounter != 0) { if (playerStatus->inputDisabledCount != 0) {
if (gPlayerStatus.interactingWithID != curInteraction) { if (gPlayerStatus.interactingWithID != curInteraction) {
gPlayerStatus.interactingWithID = curInteraction; gPlayerStatus.interactingWithID = curInteraction;
} }
@ -1189,7 +1191,7 @@ void check_for_interactables(void) {
return; return;
} }
if (curInteraction == -1) { if (curInteraction == NO_COLLIDER) {
s32 floor = gCollisionStatus.currentFloor; s32 floor = gCollisionStatus.currentFloor;
if ((floor >= 0) && (floor & COLLISION_WITH_ENTITY_BIT)) { if ((floor >= 0) && (floor & COLLISION_WITH_ENTITY_BIT)) {
@ -1203,7 +1205,7 @@ void check_for_interactables(void) {
case ENTITY_TYPE_PUSH_BLOCK: case ENTITY_TYPE_PUSH_BLOCK:
case ENTITY_TYPE_CHEST: case ENTITY_TYPE_CHEST:
case ENTITY_TYPE_SIGNPOST: case ENTITY_TYPE_SIGNPOST:
curInteraction = -1; curInteraction = NO_COLLIDER;
break; break;
} }
} else if ( } else if (
@ -1217,7 +1219,7 @@ void check_for_interactables(void) {
} }
phi_s2 = 0; phi_s2 = 0;
} else { } else {
playerStatus->interactingWithID = -1; playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED; playerStatus->flags &= ~PS_FLAG_INTERACTED;
return; return;
} }
@ -1226,7 +1228,7 @@ void check_for_interactables(void) {
phi_s2 = 0; phi_s2 = 0;
if (!(curInteraction & COLLISION_WITH_NPC_BIT)) { if (!(curInteraction & COLLISION_WITH_NPC_BIT)) {
if (!should_collider_allow_interact(curInteraction)) { if (!should_collider_allow_interact(curInteraction)) {
playerStatus->interactingWithID = -1; playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED; playerStatus->flags &= ~PS_FLAG_INTERACTED;
return; return;
} }
@ -1234,7 +1236,7 @@ void check_for_interactables(void) {
} else { } else {
if (!phys_can_player_interact()) { if (!phys_can_player_interact()) {
phi_s2 = 1; phi_s2 = 1;
playerStatus->interactingWithID = -1; playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED; playerStatus->flags &= ~PS_FLAG_INTERACTED;
return; return;
} }
@ -1266,7 +1268,7 @@ void check_for_interactables(void) {
if (InteractNotificationCallback == NULL) { if (InteractNotificationCallback == NULL) {
dma_copy(inspect_icon_ROM_START, inspect_icon_ROM_END, inspect_icon_VRAM_DEF); dma_copy(inspect_icon_ROM_START, inspect_icon_ROM_END, inspect_icon_VRAM_DEF);
InteractNotificationCallback = func_802B70B4_E201C4; InteractNotificationCallback = interact_inspect_setup;
} }
@ -1275,11 +1277,11 @@ void check_for_interactables(void) {
} }
} }
void func_802B71E8_E202F8(void); void appendGfx_interact_prompt(void);
void func_800E0AD0(void) { void render_interact_prompt(void) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) && (InteractNotificationCallback != 0)) { if ((gPlayerStatusPtr->animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) && (InteractNotificationCallback != NULL)) {
func_802B71E8_E202F8(); appendGfx_interact_prompt();
} }
} }

View File

@ -269,12 +269,12 @@ block_17:
partner_disable_input(); partner_disable_input();
D_8010CCFA = 3; D_8010CCFA = 3;
D_8010CD00 = 1; D_8010CD00 = 1;
D_8010CCFE = playerStatus->inputEnabledCounter; D_8010CCFE = playerStatus->inputDisabledCount;
} }
break; break;
case 1: case 1:
flags = ~PS_FLAG_PAUSED; flags = ~PS_FLAG_PAUSED;
if ((func_800E6904() == 0) || is_picking_up_item() || D_8010CCFE < playerStatus->inputEnabledCounter) { if ((func_800E6904() == 0) || is_picking_up_item() || D_8010CCFE < playerStatus->inputDisabledCount) {
playerStatus->flags &= flags; playerStatus->flags &= flags;
enable_player_input(); enable_player_input();
partner_enable_input(); partner_enable_input();

View File

@ -2533,7 +2533,7 @@ void update_item_entity_temp(ItemEntity* itemEntity) {
actionState != ACTION_STATE_JUMP && actionState != ACTION_STATE_JUMP &&
actionState != ACTION_STATE_FALLING) || actionState != ACTION_STATE_FALLING) ||
!playerStatus->enableCollisionOverlapsCheck || !playerStatus->enableCollisionOverlapsCheck ||
playerStatus->inputEnabledCounter == 0) && playerStatus->inputDisabledCount == 0) &&
actionState != ACTION_STATE_LAUNCH && actionState != ACTION_STATE_LAUNCH &&
actionState != ACTION_STATE_RIDE && actionState != ACTION_STATE_RIDE &&
actionState != ACTION_STATE_IDLE && actionState != ACTION_STATE_IDLE &&

View File

@ -1,6 +1,8 @@
#include "common.h" #include "common.h"
s32 N(UnkAngleFunc1)(f32 angle) { // determines the 'brightness' of inspect and speech bubble icons as a function of angle,
// making them appear more three-dimensional.
s32 N(GetIconBrightnessForAngle)(f32 angle) {
s32 angleDiff; s32 angleDiff;
if (angle >= 270.0f) { if (angle >= 270.0f) {

View File

@ -63,85 +63,92 @@ void sprite_shading_set_light_source(u32 idx, s8 flags, f32 x, f32 y, f32 z, u8
void create_shading_palette(Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s32 alpha, s32 otherModeLBits) { void create_shading_palette(Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s32 alpha, s32 otherModeLBits) {
Camera* camera = &gCameras[gCurrentCameraID]; Camera* camera = &gCameras[gCurrentCameraID];
SpriteShadingLightSource* lightSource; SpriteShadingLightSource* lightSource;
f32 shadowX, shadowY, shadowZ; f32 shadowDirX, shadowDirY, shadowDirZ;
f32 sp54, sp58, sp5C; f32 posX, posY, posZ;
f32 sp60; f32 facingDir;
f32 sp64, var_f30, sp68; f32 Mxz, Myz, Mzz;
f32 shadowR, shadowG, shadowB; f32 shadowColorR, shadowColorG, shadowColorB;
f32 sp78, sp7C, sp80; f32 commonColorR, commonColorG, commonColorB;
f32 sp84, sp88, sp8C; f32 backColorR, backColorG, backColorB;
f32 sp90, sp94, sp98; f32 frontColorR, frontColorG, frontColorB;
f32 shadowIntensity;
f32 lightIntensity;
f32 intensityScale;
f32 temp_f10; f32 temp_f10;
f32 temp_f12;
f32 temp_f16; f32 temp_f16;
f32 temp3;
f32 distSq; f32 distSq;
f32 dx, dy, dz; f32 dx, dy, dz;
f32 temp_f6;
f32 var_f0_2;
f32 dist; f32 dist;
f32 intensityScale; f32 invDist;
f32 temp3;
f32 qx, qy, qz; f32 qx, qy, qz;
f32 wx, wy, wz; f32 wx, wy, wz;
f32 ex, ey, ez; f32 ex, ey, ez;
f32 Pxz, Pzz;
s32 i; s32 i;
shadowX = 0.0f; shadowDirX = 0.0f;
shadowY = 0.0f; shadowDirY = 0.0f;
shadowZ = 0.0f; shadowDirZ = 0.0f;
sp54 = mtx[3][0]; posX = mtx[3][0];
sp58 = mtx[3][1]; posY = mtx[3][1];
sp5C = mtx[3][2]; posZ = mtx[3][2];
Mxz = mtx[0][2];
Myz = mtx[1][2];
Mzz = mtx[2][2];
sp78 = 0.0f; commonColorR = 0.0f;
sp7C = 0.0f; commonColorG = 0.0f;
sp80 = 0.0f; commonColorB = 0.0f;
sp84 = 0.0f; backColorR = 0.0f;
sp88 = 0.0f; backColorG = 0.0f;
sp8C = 0.0f; backColorB = 0.0f;
sp64 = mtx[0][2]; frontColorR = 0.0f;
var_f30 = mtx[1][2]; frontColorG = 0.0f;
sp68 = mtx[2][2]; frontColorB = 0.0f;
sp90 = 0.0f; shadowColorR = gSpriteShadingProfile->ambientColor.r;
sp94 = 0.0f; shadowColorG = gSpriteShadingProfile->ambientColor.g;
sp98 = 0.0f; shadowColorB = gSpriteShadingProfile->ambientColor.b;
shadowR = gSpriteShadingProfile->ambientColor.r; Pxz = camera->perspectiveMatrix[0][2];
shadowG = gSpriteShadingProfile->ambientColor.g; Pzz = camera->perspectiveMatrix[2][2];
shadowB = gSpriteShadingProfile->ambientColor.b;
if (((-sp64 * camera->perspectiveMatrix[0][2]) + (sp68 * camera->perspectiveMatrix[2][2])) < 0.0f) { if ((-Mxz * Pxz + Mzz * Pzz) < 0.0f) {
sp60 = 1.0f; facingDir = 1.0f;
} else { } else {
sp60 = -1.0f; facingDir = -1.0f;
} }
for (i = 0; i < ARRAY_COUNT(gSpriteShadingProfile->sources); i++) { for (i = 0; i < ARRAY_COUNT(gSpriteShadingProfile->sources); i++) {
lightSource = &gSpriteShadingProfile->sources[i]; lightSource = &gSpriteShadingProfile->sources[i];
if (lightSource->flags & LIGHT_SOURCE_ENABLED) { if (lightSource->flags & LIGHT_SOURCE_ENABLED) {
dx = sp54 - lightSource->pos.x; dx = posX - lightSource->pos.x;
dy = sp58 - lightSource->pos.y; dy = posY - lightSource->pos.y;
dz = sp5C - lightSource->pos.z; dz = posZ - lightSource->pos.z;
distSq = SQ(dx) + SQ(dy) + SQ(dz); distSq = SQ(dx) + SQ(dy) + SQ(dz);
if (distSq != 0.0f) { if (distSq != 0.0f) {
dist = sqrtf(distSq); dist = sqrtf(distSq);
var_f0_2 = 1.0f / dist; invDist = 1.0f / dist;
} else { } else {
dist = 0.0f; dist = 0.0f;
var_f0_2 = 0.0f; invDist = 0.0f;
} }
dx *= var_f0_2; // normalize dx/dy/dz
dy *= var_f0_2; // they now form a normal vector pointing from light source to sprite
dz *= var_f0_2; dx *= invDist;
dy *= invDist;
dz *= invDist;
if ((lightSource->flags & LIGHT_SOURCE_LINEAR_FALLOFF)) { // apply falloff from light source
if (lightSource->flags & LIGHT_SOURCE_LINEAR_FALLOFF) {
if ((dist == 0.0f) && (lightSource->falloff == 0.0f)) { if ((dist == 0.0f) && (lightSource->falloff == 0.0f)) {
intensityScale = 1.0f; intensityScale = 1.0f;
} else { } else {
@ -150,112 +157,117 @@ void create_shading_palette(Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s3
dy *= intensityScale; dy *= intensityScale;
dz *= intensityScale; dz *= intensityScale;
} }
} else { } else if (lightSource->flags & LIGHT_SOURCE_QUADRATIC_FALLOFF) {
if ((lightSource->flags & LIGHT_SOURCE_QUADRATIC_FALLOFF) && (distSq != 0.0f || lightSource->falloff != 0.0f)) { if ((distSq == 0.0f) && (lightSource->falloff == 0.0f)) {
intensityScale = 1.0f;
} else {
intensityScale = 1.0f / (distSq * lightSource->falloff); intensityScale = 1.0f / (distSq * lightSource->falloff);
dx *= intensityScale; dx *= intensityScale;
dy *= intensityScale; dy *= intensityScale;
dz *= intensityScale; dz *= intensityScale;
} else {
intensityScale = 1.0f;
} }
} else {
intensityScale = 1.0f;
} }
if (intensityScale > 1.0f) { if (intensityScale > 1.0f) {
intensityScale = 1.0f; intensityScale = 1.0f;
} }
shadowX += dx;
shadowY += dy; shadowDirX += dx;
shadowZ += dz; shadowDirY += dy;
shadowDirZ += dz;
if (sp60 < 0.0f) { if (facingDir < 0.0f) {
ex = sp64; ex = Mxz;
ey = var_f30; ey = Myz;
ez = -sp68; ez = -Mzz;
} else { } else {
ex = -sp64; ex = -Mxz;
ey = var_f30; ey = Myz;
ez = sp68; ez = Mzz;
} }
temp_f10 = ex * dx + ey * dy + ez * dz; temp_f10 = ex * dx + ey * dy + ez * dz;
if (sp60 < 0.0f) { if (facingDir < 0.0f) {
wx = sp68; wx = Mzz;
wy = var_f30; wy = Myz;
wz = sp64; wz = Mxz;
} else { } else {
wx = -sp68; wx = -Mzz;
wy = var_f30; wy = Myz;
wz = -sp64; wz = -Mxz;
} }
temp3 = wx * dx + wy * dy + wz * dz; temp3 = wx * dx + wy * dy + wz * dz;
temp_f16 = temp3; temp_f16 = temp3;
temp_f12 = intensityScale * fabsf(temp_f10); shadowIntensity = intensityScale * fabsf(temp_f10);
temp_f6 = intensityScale * fabsf(temp_f16); lightIntensity = intensityScale * fabsf(temp_f16);
if (temp_f10 > 0.0f) { if (temp_f10 > 0.0f) {
sp78 += lightSource->rgb.r * temp_f12; commonColorR += lightSource->rgb.r * shadowIntensity;
sp7C += lightSource->rgb.g * temp_f12; commonColorG += lightSource->rgb.g * shadowIntensity;
sp80 += lightSource->rgb.b * temp_f12; commonColorB += lightSource->rgb.b * shadowIntensity;
if (temp_f16 > 0.0f) { if (temp_f16 > 0.0f) {
sp84 += lightSource->rgb.r * temp_f6; backColorR += lightSource->rgb.r * lightIntensity;
sp88 += lightSource->rgb.g * temp_f6; backColorG += lightSource->rgb.g * lightIntensity;
sp8C += lightSource->rgb.b * temp_f6; backColorB += lightSource->rgb.b * lightIntensity;
} else { } else {
sp90 += lightSource->rgb.r * temp_f6; frontColorR += lightSource->rgb.r * lightIntensity;
sp94 += lightSource->rgb.g * temp_f6; frontColorG += lightSource->rgb.g * lightIntensity;
sp98 += lightSource->rgb.b * temp_f6; frontColorB += lightSource->rgb.b * lightIntensity;
} }
} else { } else {
shadowR += lightSource->rgb.r * temp_f12; shadowColorR += lightSource->rgb.r * shadowIntensity;
shadowG += lightSource->rgb.g * temp_f12; shadowColorG += lightSource->rgb.g * shadowIntensity;
shadowB += lightSource->rgb.b * temp_f12; shadowColorB += lightSource->rgb.b * shadowIntensity;
if (temp_f16 > 0.0f) { if (temp_f16 > 0.0f) {
sp84 += lightSource->rgb.r * temp_f6; backColorR += lightSource->rgb.r * lightIntensity;
sp88 += lightSource->rgb.g * temp_f6; backColorG += lightSource->rgb.g * lightIntensity;
sp8C += lightSource->rgb.b * temp_f6; backColorB += lightSource->rgb.b * lightIntensity;
} else { } else {
sp90 += lightSource->rgb.r * temp_f6; frontColorR += lightSource->rgb.r * lightIntensity;
sp94 += lightSource->rgb.g * temp_f6; frontColorG += lightSource->rgb.g * lightIntensity;
sp98 += lightSource->rgb.b * temp_f6; frontColorB += lightSource->rgb.b * lightIntensity;
} }
} }
} }
} }
if (sp60 < 0.0f) { if (facingDir < 0.0f) {
qx = sp68; qx = Mzz;
qy = var_f30; qy = Myz;
qz = sp64; qz = Mxz;
} else { } else {
qx = -sp68; qx = -Mzz;
qy = var_f30; qy = Myz;
qz = -sp64; qz = -Mxz;
} }
if (qx * shadowX + qy * shadowY + qz * shadowZ > 0.0f) { if (qx * shadowDirX + qy * shadowDirY + qz * shadowDirZ > 0.0f) {
appendGfx_shading_palette( appendGfx_shading_palette(
mtx, mtx,
uls, ult, lrs, lrt, uls, ult, lrs, lrt,
alpha, alpha,
shadowX, shadowY, shadowZ, shadowDirX, shadowDirY, shadowDirZ,
shadowR, shadowG, shadowB, shadowColorR, shadowColorG, shadowColorB,
gSpriteShadingProfile->ambientColor.r + sp78 + sp84, gSpriteShadingProfile->ambientColor.r + commonColorR + backColorR,
gSpriteShadingProfile->ambientColor.g + sp7C + sp88, gSpriteShadingProfile->ambientColor.g + commonColorG + backColorG,
gSpriteShadingProfile->ambientColor.b + sp80 + sp8C, gSpriteShadingProfile->ambientColor.b + commonColorB + backColorB,
gSpriteShadingProfile->ambientPower, otherModeLBits gSpriteShadingProfile->ambientPower,
otherModeLBits
); );
} else { } else {
appendGfx_shading_palette( appendGfx_shading_palette(
mtx, mtx,
uls, ult, lrs, lrt, uls, ult, lrs, lrt,
alpha, alpha,
shadowX, shadowY, shadowZ, shadowDirX, shadowDirY, shadowDirZ,
shadowR, shadowG, shadowB, shadowColorR, shadowColorG, shadowColorB,
gSpriteShadingProfile->ambientColor.r + sp78 + sp90, gSpriteShadingProfile->ambientColor.r + commonColorR + frontColorR,
gSpriteShadingProfile->ambientColor.g + sp7C + sp94, gSpriteShadingProfile->ambientColor.g + commonColorG + frontColorG,
gSpriteShadingProfile->ambientColor.b + sp80 + sp98, gSpriteShadingProfile->ambientColor.b + commonColorB + frontColorB,
gSpriteShadingProfile->ambientPower, otherModeLBits gSpriteShadingProfile->ambientPower,
otherModeLBits
); );
} }
} }

View File

@ -16,7 +16,7 @@ void entity_Signpost_idle(Entity* entity) {
} }
} else { } else {
entity->flags &= ~ENTITY_FLAG_SHOWS_INSPECT_PROMPT; entity->flags &= ~ENTITY_FLAG_SHOWS_INSPECT_PROMPT;
playerStatus->interactingWithID = -1; playerStatus->interactingWithID = NO_COLLIDER;
} }
} }
@ -31,7 +31,7 @@ EntityBlueprint Entity_Signpost = {
.flags = ENTITY_FLAG_SQUARE_SHADOW | ENTITY_FLAG_400 | ENTITY_FLAG_FIXED_SHADOW_SIZE, .flags = ENTITY_FLAG_SQUARE_SHADOW | ENTITY_FLAG_400 | ENTITY_FLAG_FIXED_SHADOW_SIZE,
.typeDataSize = sizeof(SignpostData), .typeDataSize = sizeof(SignpostData),
.renderCommandList = Entity_Signpost_RenderScript, .renderCommandList = Entity_Signpost_RenderScript,
.modelAnimationNodes = 0x00000000, .modelAnimationNodes = NULL,
.fpInit = NULL, .fpInit = NULL,
.updateEntityScript = Entity_Signpost_Script, .updateEntityScript = Entity_Signpost_Script,
.fpHandleCollision = NULL, .fpHandleCollision = NULL,

View File

@ -211,7 +211,7 @@ void entity_Tweester_idle(Entity* entity) {
!is_picking_up_item() && !is_picking_up_item() &&
!(playerStatus->flags & PS_FLAG_PAUSED) && !(playerStatus->flags & PS_FLAG_PAUSED) &&
(playerData->currentPartner != PARTNER_GOOMBARIO || (playerData->currentPartner != PARTNER_GOOMBARIO ||
playerStatus->inputEnabledCounter == 0 || playerStatus->inputDisabledCount == 0 ||
playerStatus->actionState == ACTION_STATE_USE_TWEESTER playerStatus->actionState == ACTION_STATE_USE_TWEESTER
)) { )) {
entity_Tweester_move(entity); entity_Tweester_move(entity);

View File

@ -1029,7 +1029,7 @@ ApiStatus evt_handle_bind(Evt* script) {
bp.colliderID = evt_get_variable(script, colliderIDVar); bp.colliderID = evt_get_variable(script, colliderIDVar);
bp.varIndex = evt_get_variable_index(script, colliderIDVar); bp.varIndex = evt_get_variable_index(script, colliderIDVar);
bp.hasPlayerInteractPrompt = hasInteractPrompt; bp.hasPlayerInteractPrompt = hasInteractPrompt;
bp.unk_tr_2C = 0; bp.tattleMsg = 0;
bp.onActivateFunc = evt_trigger_on_activate_exec_script; bp.onActivateFunc = evt_trigger_on_activate_exec_script;
trigger = create_trigger(&bp); trigger = create_trigger(&bp);
@ -1149,7 +1149,7 @@ ApiStatus evt_handle_bind_lock(Evt* script) {
bp.varIndex = evt_get_variable_index(script, colliderIDVar); bp.varIndex = evt_get_variable_index(script, colliderIDVar);
bp.itemList = itemList; bp.itemList = itemList;
bp.onActivateFunc = evt_trigger_on_activate_lock; bp.onActivateFunc = evt_trigger_on_activate_lock;
bp.unk_tr_2C = triggerOut; bp.tattleMsg = triggerOut;
bp.hasPlayerInteractPrompt = hasInteractPrompt; bp.hasPlayerInteractPrompt = hasInteractPrompt;
trigger = create_trigger(&bp); trigger = create_trigger(&bp);

View File

@ -758,7 +758,7 @@ Trigger* bind_trigger(EvtScript* script, s32 flags, s32 triggerFlagIndex, s32 tr
bp.flags = flags | TRIGGER_SCRIPT_BOUND; bp.flags = flags | TRIGGER_SCRIPT_BOUND;
bp.colliderID = triggerFlagIndex; bp.colliderID = triggerFlagIndex;
bp.unk_tr_2C = 0; bp.tattleMsg = 0;
bp.onActivateFunc = evt_trigger_on_activate_exec_script; bp.onActivateFunc = evt_trigger_on_activate_exec_script;
bp.hasPlayerInteractPrompt = arg6; bp.hasPlayerInteractPrompt = arg6;

View File

@ -1,87 +1,83 @@
#include "common.h" #include "common.h"
typedef struct ISoyData { typedef struct ISpyNotification {
/* 0x00 */ Vec3f pos; /* 0x00 */ Vec3f pos;
/* 0x0C */ f32 scale; /* 0x0C */ f32 scale;
/* 0x10 */ s32 unk_10; /* 0x10 */ char unk_10[8];
/* 0x14 */ s32 unk_14;
/* 0x18 */ s32 time; /* 0x18 */ s32 time;
/* 0x1C */ s32 unk_1C; /* 0x1C */ char unk_1C[4];
/* 0x20 */ s32 flashCount; /* 0x20 */ s32 flashCount;
/* 0x24 */ s32 state; /* 0x24 */ s32 state;
/* 0x28 */ s32 alpha; /* 0x28 */ s32 alpha;
} ISoyData; } ISpyNotification;
enum { enum {
I_SPY_DELAY = 0, I_SPY_DELAY = 0, // icon waits to appear when entering map under certain conditions
I_SPY_1 = 1, I_SPY_APPEAR = 1, // icon appears
I_SPY_2 = 2, I_SPY_OVERSHOOT = 2, // icon scale overshoots before it begins animating
I_SPY_FADE_OUT = 3, I_SPY_ANIMATE = 3, // icon blinks for a second and a half and then vanishes
}; };
#include "i_spy.png.h" #include "ispy_icon.png.h"
#include "i_spy.png.inc.c" #include "ispy_icon.png.inc.c"
#include "i_spy.pal.inc.c" #include "ispy_icon.pal.inc.c"
#include "i_spy.2.pal.inc.c" #include "ispy_icon.2.pal.inc.c"
#include "i_spy.flash.pal.inc.c" #include "ispy_icon.3.pal.inc.c"
#include "i_spy_dlist.gfx.inc.c" #include "ispy_icon.gfx.inc.c"
BSS ISoyData D_802B7CB0; BSS ISpyNotification ISpyData;
ISpyNotification* ISpyPtr = &ISpyData;
ISoyData* D_802B7C78_E23228 = &D_802B7CB0; void ispy_notification_update(void);
extern void (*ISpyNotificationCallback)(void); void appendGfx_ispy_icon(void) {
void func_802B735C_E2290C(void);
void func_802B7000_E225B0(void) {
Matrix4f matrix1; Matrix4f matrix1;
Matrix4f matrix2; Matrix4f matrix2;
FoldImageRecPart foldImage; FoldImageRecPart foldImage;
s32 temp; s32 flashPhase;
if (gPlayerStatus.animFlags & PA_FLAG_100) { if (gPlayerStatus.animFlags & PA_FLAG_ISPY_VISIBLE) {
guScaleF(matrix1, D_802B7C78_E23228->scale, D_802B7C78_E23228->scale, D_802B7C78_E23228->scale); guScaleF(matrix1, ISpyPtr->scale, ISpyPtr->scale, ISpyPtr->scale);
guRotateF(matrix2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(matrix2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guMtxCatF(matrix1, matrix2, matrix1); guMtxCatF(matrix1, matrix2, matrix1);
guTranslateF(matrix2, D_802B7C78_E23228->pos.x, D_802B7C78_E23228->pos.y, D_802B7C78_E23228->pos.z); guTranslateF(matrix2, ISpyPtr->pos.x, ISpyPtr->pos.y, ISpyPtr->pos.z);
guMtxCatF(matrix1, matrix2, matrix2); guMtxCatF(matrix1, matrix2, matrix2);
guMtxF2L(matrix2, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(matrix2, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], 3); gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], 3);
gSPDisplayList(gMasterGfxPos++, D_802B7C00_E231B0); gSPDisplayList(gMasterGfxPos++, ispy_icon_gfx);
if (D_802B7C78_E23228->time < 47) { if (ISpyPtr->time < 47) {
D_802B7C78_E23228->flashCount++; ISpyPtr->flashCount++;
} }
temp = D_802B7C78_E23228->flashCount; flashPhase = ISpyPtr->flashCount;
temp = temp - (temp / 12) * 12; flashPhase = flashPhase - (flashPhase / 12) * 12;
switch (temp) { switch (flashPhase) {
case 0: case 0:
case 1: case 1:
case 2: case 2:
case 3: case 3:
foldImage.palette = D_802B7BA0_E23150; foldImage.palette = ispy_icon_1_pal;
break; break;
case 4: case 4:
case 5: case 5:
case 6: case 6:
case 7: case 7:
foldImage.palette = D_802B7BC0_E23170; foldImage.palette = ispy_icon_2_pal;
break; break;
case 8: case 8:
case 9: case 9:
case 10: case 10:
case 11: case 11:
foldImage.palette = D_802B7BE0_E23190; foldImage.palette = ispy_icon_3_pal;
break; break;
} }
fold_update(0, FOLD_TYPE_7, 255, 255, 255, D_802B7C78_E23228->alpha, 0); fold_update(0, FOLD_TYPE_7, 255, 255, 255, ISpyPtr->alpha, 0);
foldImage.raster = D_802B7580_E22B30; foldImage.raster = ispy_icon_img;
foldImage.width = 56; foldImage.width = ispy_icon_img_width;
foldImage.height = 56; foldImage.height = ispy_icon_img_height;
foldImage.xOffset = -28; foldImage.xOffset = -28;
foldImage.yOffset = 46; foldImage.yOffset = 46;
foldImage.opacity = 255; foldImage.opacity = 255;
@ -91,73 +87,73 @@ void func_802B7000_E225B0(void) {
} }
} }
void func_802B72C0_E22870(void) { void ispy_notification_setup(void) {
mem_clear(D_802B7C78_E23228, sizeof(*D_802B7C78_E23228)); mem_clear(ISpyPtr, sizeof(*ISpyPtr));
D_802B7C78_E23228->pos.x = gPlayerStatus.position.x; ISpyPtr->pos.x = gPlayerStatus.position.x;
D_802B7C78_E23228->pos.y = gPlayerStatus.position.y + gPlayerStatus.colliderHeight + 8.0f; ISpyPtr->pos.y = gPlayerStatus.position.y + gPlayerStatus.colliderHeight + 8.0f;
D_802B7C78_E23228->pos.z = gPlayerStatus.position.z; ISpyPtr->pos.z = gPlayerStatus.position.z;
D_802B7C78_E23228->alpha = 255; ISpyPtr->alpha = 255;
gPlayerStatus.animFlags |= PA_FLAG_100; gPlayerStatus.animFlags |= PA_FLAG_ISPY_VISIBLE;
ISpyNotificationCallback = &func_802B735C_E2290C; ISpyNotificationCallback = &ispy_notification_update;
} }
void func_802B735C_E2290C(void) { void ispy_notification_update(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus; PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus;
s32 cond; s32 cond;
D_802B7C78_E23228->pos.y += ISpyPtr->pos.y +=
(playerStatus->position.y + playerStatus->colliderHeight + 10.0f - D_802B7C78_E23228->pos.y) / 1.5f; (playerStatus->position.y + playerStatus->colliderHeight + 10.0f - ISpyPtr->pos.y) / 1.5f;
D_802B7C78_E23228->pos.x = playerStatus->position.x; ISpyPtr->pos.x = playerStatus->position.x;
D_802B7C78_E23228->pos.z = playerStatus->position.z; ISpyPtr->pos.z = playerStatus->position.z;
switch (D_802B7C78_E23228->state) { switch (ISpyPtr->state) {
case I_SPY_DELAY: case I_SPY_DELAY:
if (partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE && if (partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE
partnerActionStatus->actingPartner == PARTNER_LAKILESTER) && partnerActionStatus->actingPartner == PARTNER_LAKILESTER
{ ) {
cond = gGameStatusPtr->keepUsingPartnerOnMapChange; cond = gGameStatusPtr->keepUsingPartnerOnMapChange;
} else { } else {
cond = playerStatus->flags & (PS_FLAG_INPUT_DISABLED | PS_FLAG_NO_STATIC_COLLISION); cond = playerStatus->flags & (PS_FLAG_INPUT_DISABLED | PS_FLAG_NO_STATIC_COLLISION);
} }
if (!cond) { if (!cond) {
D_802B7C78_E23228->state++; ISpyPtr->state++;
} }
break; break;
case I_SPY_1: case I_SPY_APPEAR:
if (playerStatus->flags & PS_FLAG_PAUSED) { if (playerStatus->flags & PS_FLAG_PAUSED) {
D_802B7C78_E23228->state = I_SPY_FADE_OUT; ISpyPtr->state = I_SPY_ANIMATE;
return; return;
} }
if (D_802B7C78_E23228->time++ >= 16) { if (ISpyPtr->time++ >= 16) {
D_802B7C78_E23228->scale = 0.36f; ISpyPtr->scale = 0.36f;
D_802B7C78_E23228->state++; ISpyPtr->state++;
} }
break; break;
case I_SPY_2: case I_SPY_OVERSHOOT:
D_802B7C78_E23228->scale = 0.57f; ISpyPtr->scale = 0.57f;
D_802B7C78_E23228->state++; ISpyPtr->state++;
sfx_play_sound_at_player(SOUND_17B, SOUND_SPACE_MODE_0); sfx_play_sound_at_player(SOUND_17B, SOUND_SPACE_MODE_0);
break; break;
case I_SPY_FADE_OUT: case I_SPY_ANIMATE:
D_802B7C78_E23228->scale = 0.53f; ISpyPtr->scale = 0.53f;
if (D_802B7C78_E23228->time >= 47 || playerStatus->flags & PS_FLAG_PAUSED) { if (ISpyPtr->time >= 47 || playerStatus->flags & PS_FLAG_PAUSED) {
D_802B7C78_E23228->alpha -= 64; ISpyPtr->alpha -= 64;
if (D_802B7C78_E23228->alpha < 0) { if (ISpyPtr->alpha < 0) {
D_802B7C78_E23228->alpha = 0; ISpyPtr->alpha = 0;
D_802B7C78_E23228->time = 51; ISpyPtr->time = 51;
} }
} }
if (D_802B7C78_E23228->time++ > 50) { if (ISpyPtr->time++ > 50) {
gCurrentHiddenPanels.activateISpy = FALSE; gCurrentHiddenPanels.activateISpy = FALSE;
ISpyNotificationCallback = NULL; ISpyNotificationCallback = NULL;
playerStatus->animFlags &= ~PA_FLAG_100; playerStatus->animFlags &= ~PA_FLAG_ISPY_VISIBLE;
} }
break; break;
} }

View File

@ -4,79 +4,85 @@
typedef struct InspectIconData { typedef struct InspectIconData {
/* 0x00 */ Vec3f pos; /* 0x00 */ Vec3f pos;
/* 0x0C */ f32 unk_0C; /* 0x0C */ f32 yaw;
/* 0x10 */ f32 scale; /* 0x10 */ f32 scale;
/* 0x14 */ s32 unk_14; /* 0x14 */ s32 holdTime;
/* 0x18 */ s32 unk_18; /* 0x18 */ char unk_18[0x4];
/* 0x1C */ s32 unk_1C; /* 0x1C */ s32 alpha; // unused
/* 0x20 */ s8 unk_20; /* 0x20 */ char unk_20[0x1];
/* 0x21 */ s8 unk_21; /* 0x21 */ s8 iconBounceVel;
/* 0x22 */ s8 unk_22; /* 0x22 */ s8 iconBounceDir;
/* 0x23 */ u8 unk_23; /* 0x23 */ u8 state;
/* 0x24 */ u8 unk_24; /* 0x24 */ u8 brightness;
/* 0x25 */ char unk_25[0x3]; /* 0x25 */ char unk_25[0x3];
} InspectIconData; // size = 0x28 } InspectIconData; // size = 0x28
BSS InspectIconData D_802B7DA0; enum {
INSPECT_ICON_APPEAR = 0,
INSPECT_ICON_HOLD = 1,
INSPECT_ICON_IDLE = 2,
INSPECT_ICON_VANISH = 3,
};
#include "inspect_icon.png.h" #include "inspect_icon.png.h"
#include "inspect_icon.png.inc.c" #include "inspect_icon.png.inc.c"
#include "inspect_icon.pal.inc.c" #include "inspect_icon.pal.inc.c"
#include "inspect_icon_dlist.gfx.inc.c" #include "inspect_icon.gfx.inc.c"
InspectIconData* D_802B7CB8_E20DC8 = &D_802B7DA0; BSS InspectIconData InspectIcon;
InspectIconData* InspectIconPtr = &InspectIcon;
#include "common/UnkAngleFunc1.inc.c" #include "common/GetIconBrightnessForAngle.inc.c"
void func_802B7728_E20838(void); void interact_inspect_update(void);
void func_802B79C8_E20AD8(void); void interact_inspect_dismiss(void);
void func_802B70B4_E201C4(void) { void interact_inspect_setup(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
f32 new_var; f32 new_var;
if (playerStatus->animFlags & 0x10) { if (playerStatus->animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) {
mem_clear(D_802B7CB8_E20DC8, sizeof(*D_802B7CB8_E20DC8)); mem_clear(InspectIconPtr, sizeof(*InspectIconPtr));
D_8010C950 = -1; D_8010C950 = -1;
D_802B7CB8_E20DC8->pos.x = playerStatus->position.x; InspectIconPtr->pos.x = playerStatus->position.x;
D_802B7CB8_E20DC8->pos.y = playerStatus->position.y + playerStatus->colliderHeight + InspectIconPtr->pos.y = playerStatus->position.y + playerStatus->colliderHeight +
(!(playerStatus->animFlags & 0x1000) ? 8.0f : 2.0f); (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) ? 8.0f : 2.0f);
D_802B7CB8_E20DC8->pos.z = playerStatus->position.z; InspectIconPtr->pos.z = playerStatus->position.z;
D_802B7CB8_E20DC8->scale = 0.4f; InspectIconPtr->scale = 0.4f;
D_802B7CB8_E20DC8->unk_23 = 0; InspectIconPtr->state = INSPECT_ICON_APPEAR;
D_802B7CB8_E20DC8->unk_0C = -gCameras[gCurrentCameraID].currentYaw; InspectIconPtr->yaw = -gCameras[gCurrentCameraID].currentYaw;
InteractNotificationCallback = func_802B7728_E20838; InteractNotificationCallback = interact_inspect_update;
D_802B7CB8_E20DC8->unk_24 = 0xFF; InspectIconPtr->brightness = 255;
D_802B7CB8_E20DC8->unk_1C = 0xFF; InspectIconPtr->alpha = 255;
} }
} }
void func_802B71E8_E202F8(void) { void appendGfx_interact_prompt(void) {
FoldImageRecPart sp20; FoldImageRecPart sp20;
Matrix4f sp38, sp78; Matrix4f sp38, sp78;
if (gPlayerStatus.animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) { if (gPlayerStatus.animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) {
guScaleF(sp38, D_802B7CB8_E20DC8->scale, D_802B7CB8_E20DC8->scale, D_802B7CB8_E20DC8->scale); guScaleF(sp38, InspectIconPtr->scale, InspectIconPtr->scale, InspectIconPtr->scale);
guRotateF(sp78, D_802B7CB8_E20DC8->unk_0C - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp78, InspectIconPtr->yaw - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp38, sp78, sp38); guMtxCatF(sp38, sp78, sp38);
guTranslateF(sp78, D_802B7CB8_E20DC8->pos.x, D_802B7CB8_E20DC8->pos.y, D_802B7CB8_E20DC8->pos.z); guTranslateF(sp78, InspectIconPtr->pos.x, InspectIconPtr->pos.y, InspectIconPtr->pos.z);
guMtxCatF(sp38, sp78, sp78); guMtxCatF(sp38, sp78, sp78);
guMtxF2L(sp78, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp78, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, &D_802B7C40_E20D50); gSPDisplayList(gMasterGfxPos++, &inspect_icon_gfx);
sp20.raster = D_802B7A20_E20B30; sp20.raster = inspect_icon_img;
sp20.palette = D_802B7C20_E20D30; sp20.palette = inspect_icon_pal;
sp20.width = D_802B7A20_E20B30_width; sp20.width = inspect_icon_img_width;
sp20.height = D_802B7A20_E20B30_height; sp20.height = inspect_icon_img_height;
sp20.xOffset = -16; sp20.xOffset = -16;
sp20.yOffset = 26; sp20.yOffset = 26;
sp20.opacity = 255; sp20.opacity = 255;
fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0x440); fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0x440);
fold_update(0, FOLD_TYPE_6, fold_update(0, FOLD_TYPE_6,
D_802B7CB8_E20DC8->unk_24, D_802B7CB8_E20DC8->unk_24, D_802B7CB8_E20DC8->unk_24, 0xFF, 0x448); InspectIconPtr->brightness, InspectIconPtr->brightness, InspectIconPtr->brightness, 255, 0x448);
fold_appendGfx_component(0, &sp20, 0, sp78); fold_appendGfx_component(0, &sp20, 0, sp78);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
@ -84,13 +90,13 @@ void func_802B71E8_E202F8(void) {
} }
// similar to check_for_interactables // similar to check_for_interactables
s32 func_802B7450_E20560(void) { s32 should_continue_inspect(void) {
CollisionStatus* collisionStatus = &gCollisionStatus; CollisionStatus* collisionStatus = &gCollisionStatus;
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
s32 curInteraction = collisionStatus->currentWall; s32 curInteraction = collisionStatus->currentWall;
Npc* npc = playerStatus->encounteredNPC; Npc* npc = playerStatus->encounteredNPC;
if (curInteraction == -1) { if (curInteraction == NO_COLLIDER) {
s32 floor = gCollisionStatus.currentFloor; s32 floor = gCollisionStatus.currentFloor;
if (floor >= 0 && (floor & COLLISION_WITH_ENTITY_BIT)) { if (floor >= 0 && (floor & COLLISION_WITH_ENTITY_BIT)) {
@ -103,7 +109,7 @@ s32 func_802B7450_E20560(void) {
case ENTITY_TYPE_PUSH_BLOCK: case ENTITY_TYPE_PUSH_BLOCK:
case ENTITY_TYPE_CHEST: case ENTITY_TYPE_CHEST:
case ENTITY_TYPE_SIGNPOST: case ENTITY_TYPE_SIGNPOST:
curInteraction = -1; curInteraction = NO_COLLIDER;
break; break;
} }
} else if ( } else if (
@ -116,7 +122,7 @@ s32 func_802B7450_E20560(void) {
return TRUE; return TRUE;
} }
} else { } else {
playerStatus->interactingWithID = -1; playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED; playerStatus->flags &= ~PS_FLAG_INTERACTED;
return FALSE; return FALSE;
} }
@ -124,14 +130,14 @@ s32 func_802B7450_E20560(void) {
if (!(curInteraction & COLLISION_WITH_ENTITY_BIT)) { if (!(curInteraction & COLLISION_WITH_ENTITY_BIT)) {
if (!(curInteraction & COLLISION_WITH_NPC_BIT)) { if (!(curInteraction & COLLISION_WITH_NPC_BIT)) {
if (!should_collider_allow_interact(curInteraction)) { if (!should_collider_allow_interact(curInteraction)) {
playerStatus->interactingWithID = -1; playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED; playerStatus->flags &= ~PS_FLAG_INTERACTED;
return FALSE; return FALSE;
} }
} }
} else { } else {
if (!phys_can_player_interact()) { if (!phys_can_player_interact()) {
playerStatus->interactingWithID = -1; playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED; playerStatus->flags &= ~PS_FLAG_INTERACTED;
return FALSE; return FALSE;
} }
@ -149,113 +155,115 @@ s32 func_802B7450_E20560(void) {
return TRUE; return TRUE;
} }
void func_802B75E8_E206F8(void) { void update_inspect_icon_pos(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
f32 unk_21; f32 bounceDeltaY;
f32 yTemp; f32 playerHeadY;
f32 y; f32 lastPosY;
f32 delta; f32 delta;
D_802B7CB8_E20DC8->unk_21 += D_802B7CB8_E20DC8->unk_22; // this bouncing behavior is never seen because dir is never changed from zero
InspectIconPtr->iconBounceVel += InspectIconPtr->iconBounceDir;
if (D_802B7CB8_E20DC8->unk_21 > 4) { if (InspectIconPtr->iconBounceVel > 4) {
D_802B7CB8_E20DC8->unk_22 = -1; InspectIconPtr->iconBounceDir = -1;
D_802B7CB8_E20DC8->unk_21 = 4; InspectIconPtr->iconBounceVel = 4;
} }
if (D_802B7CB8_E20DC8->unk_21 < -4) { if (InspectIconPtr->iconBounceVel < -4) {
D_802B7CB8_E20DC8->unk_22 = 1; InspectIconPtr->iconBounceDir = 1;
D_802B7CB8_E20DC8->unk_21 = -4; InspectIconPtr->iconBounceVel = -4;
} }
delta = (playerStatus->position.x - D_802B7CB8_E20DC8->pos.x) * 0.666f; delta = (playerStatus->position.x - InspectIconPtr->pos.x) * 0.666f;
D_802B7CB8_E20DC8->pos.x += delta; InspectIconPtr->pos.x += delta;
delta = (playerStatus->position.z - D_802B7CB8_E20DC8->pos.z) * 0.666f; delta = (playerStatus->position.z - InspectIconPtr->pos.z) * 0.666f;
D_802B7CB8_E20DC8->pos.z += delta; InspectIconPtr->pos.z += delta;
yTemp = playerStatus->position.y + playerStatus->colliderHeight; playerHeadY = playerStatus->position.y + playerStatus->colliderHeight;
unk_21 = D_802B7CB8_E20DC8->unk_21; bounceDeltaY = InspectIconPtr->iconBounceVel;
y = D_802B7CB8_E20DC8->pos.y; lastPosY = InspectIconPtr->pos.y;
if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) { if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) {
delta = (yTemp + 8.0f + unk_21 - y) * 0.25f; delta = (playerHeadY + 8.0f + bounceDeltaY - lastPosY) * 0.25f;
} else { } else {
delta = (yTemp + 2.0f + unk_21 - y) * 0.25f; delta = (playerHeadY + 2.0f + bounceDeltaY - lastPosY) * 0.25f;
} }
D_802B7CB8_E20DC8->pos.y += delta; InspectIconPtr->pos.y += delta;
} }
void func_802B7728_E20838(void) { void interact_inspect_update(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
s32 var_s0 = 0xFF; s32 brightness = 255;
f32 scale; f32 angle;
s32 actionState; s32 actionState;
func_802B75E8_E206F8(); update_inspect_icon_pos();
switch (D_802B7CB8_E20DC8->unk_23) { switch (InspectIconPtr->state) {
case 0: case INSPECT_ICON_APPEAR:
D_802B7CB8_E20DC8->unk_0C = 0.0f; InspectIconPtr->yaw = 0.0f;
D_802B7CB8_E20DC8->scale += 0.05; InspectIconPtr->scale += 0.05;
if (D_802B7CB8_E20DC8->scale >= 0.55) { if (InspectIconPtr->scale >= 0.55) {
D_802B7CB8_E20DC8->scale = 0.55f; InspectIconPtr->scale = 0.55f;
D_802B7CB8_E20DC8->unk_23++; InspectIconPtr->state++;
D_802B7CB8_E20DC8->unk_14 = 12; InspectIconPtr->holdTime = 12;
} }
break; break;
case 1: case INSPECT_ICON_HOLD:
D_802B7CB8_E20DC8->unk_0C = 0.0f; InspectIconPtr->yaw = 0.0f;
D_802B7CB8_E20DC8->unk_14--; InspectIconPtr->holdTime--;
if (D_802B7CB8_E20DC8->unk_14 <= 0) { if (InspectIconPtr->holdTime <= 0) {
D_802B7CB8_E20DC8->unk_23++; InspectIconPtr->state++;
} }
break; break;
case 2: case INSPECT_ICON_IDLE:
scale = D_802B7CB8_E20DC8->unk_0C; angle = InspectIconPtr->yaw;
scale += 10.0f; angle += 10.0f;
if (scale >= 360.0f) { if (angle >= 360.0f) {
scale -= 360.0f; angle -= 360.0f;
} }
D_802B7CB8_E20DC8->unk_0C = scale; InspectIconPtr->yaw = angle;
var_s0 = N(UnkAngleFunc1)(scale); brightness = N(GetIconBrightnessForAngle)(angle);
break; break;
case 3: case INSPECT_ICON_VANISH:
scale = D_802B7CB8_E20DC8->unk_0C; angle = InspectIconPtr->yaw;
scale += 25.0f; angle += 25.0f;
if (scale >= 360.0f) { if (angle >= 360.0f) {
scale -= 360.0f; angle -= 360.0f;
} }
D_802B7CB8_E20DC8->unk_0C = scale; InspectIconPtr->yaw = angle;
D_802B7CB8_E20DC8->unk_1C -= 25; InspectIconPtr->alpha -= 25;
if (D_802B7CB8_E20DC8->unk_1C < 0) { if (InspectIconPtr->alpha < 0) {
D_802B7CB8_E20DC8->unk_1C = 0; InspectIconPtr->alpha = 0;
} }
if ((scale >= 70.0f && scale <= 110.0f) || (scale >= 250.0f && scale <= 290.0f)) { if ((angle >= 70.0f && angle <= 110.0f) || (angle >= 250.0f && angle <= 290.0f)) {
InteractNotificationCallback = func_802B79C8_E20AD8; // only dimiss when the icon is rotated away from view
InteractNotificationCallback = interact_inspect_dismiss;
} }
var_s0 = N(UnkAngleFunc1)(scale); brightness = N(GetIconBrightnessForAngle)(angle);
break; break;
} }
D_802B7CB8_E20DC8->unk_24 = var_s0; InspectIconPtr->brightness = brightness;
actionState = playerStatus->actionState; actionState = playerStatus->actionState;
if (!func_802B7450_E20560() || if (!should_continue_inspect()
(playerStatus->inputEnabledCounter != 0) || || (playerStatus->inputDisabledCount != 0)
(playerStatus->flags & PS_FLAG_PAUSED) || || (playerStatus->flags & PS_FLAG_PAUSED)
!(actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN)) || !(actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN)
{ ) {
D_802B7CB8_E20DC8->unk_23 = 3; InspectIconPtr->state = INSPECT_ICON_VANISH;
} }
if ((playerStatus->interactingWithID >= 0) && if ((playerStatus->interactingWithID >= 0)
(playerStatus->interactingWithID & 0x4000) && && (playerStatus->interactingWithID & COLLISION_WITH_ENTITY_BIT)
!(get_entity_by_index(playerStatus->interactingWithID)->flags & ENTITY_FLAG_SHOWS_INSPECT_PROMPT)) && !(get_entity_by_index(playerStatus->interactingWithID)->flags & ENTITY_FLAG_SHOWS_INSPECT_PROMPT)
{ ) {
D_802B7CB8_E20DC8->unk_23 = 3; InspectIconPtr->state = INSPECT_ICON_VANISH;
} }
} }
void func_802B79C8_E20AD8(void) { void interact_inspect_dismiss(void) {
func_802B75E8_E206F8(); update_inspect_icon_pos();
gPlayerStatusPtr->interactingWithID = -1; gPlayerStatusPtr->interactingWithID = NO_COLLIDER;
InteractNotificationCallback = NULL; InteractNotificationCallback = NULL;
gPlayerStatusPtr->encounteredNPC = NULL; gPlayerStatusPtr->encounteredNPC = NULL;
gPlayerStatusPtr->animFlags &= ~PA_FLAG_INTERACT_PROMPT_AVAILABLE; gPlayerStatusPtr->animFlags &= ~PA_FLAG_INTERACT_PROMPT_AVAILABLE;

View File

@ -4,140 +4,143 @@ typedef struct PulseStoneData {
/* 0x00 */ Vec3f pos; /* 0x00 */ Vec3f pos;
/* 0x0C */ f32 scale; /* 0x0C */ f32 scale;
/* 0x10 */ char unk_10[0x8]; /* 0x10 */ char unk_10[0x8];
/* 0x18 */ s32 unk_18; /* 0x18 */ s32 appearDelay;
/* 0x1C */ char unk_1C[0x4]; /* 0x1C */ char unk_1C[0x4];
/* 0x20 */ s32 unk_20; /* 0x20 */ s32 pingTime;
/* 0x24 */ s32 unk_24; /* 0x24 */ s32 state;
} PulseStoneData; // size = 0x28 } PulseStoneData; // size = 0x28
BSS PulseStoneData D_802B7D40; enum {
PULSE_STONE_APPEAR = 0, // icon appears
PULSE_STONE_OVERSHOOT = 1, // icon scale overshoots
PULSE_STONE_HOLD = 2, // icon reaches final size
};
#include "pulse_stone.png.h" #include "pulse_stone_icon.png.h"
#include "pulse_stone.png.inc.c" #include "pulse_stone_icon.png.inc.c"
#include "pulse_stone.pal.inc.c" #include "pulse_stone_icon.pal.inc.c"
#include "pulse_stone.flash.pal.inc.c" #include "pulse_stone_icon.flash.pal.inc.c"
#include "pulse_stone_dlist.gfx.inc.c" #include "pulse_stone_icon.gfx.inc.c"
PulseStoneData* D_802B7D18_E22588 = &D_802B7D40; BSS PulseStoneData PulseStoneNotification;
PulseStoneData* PulseStonePtr = &PulseStoneNotification;
void func_802B74F0(void); void pulse_stone_notification_update(void);
s32 func_802B7000_2(void) { s32 should_cancel_pulse_stone(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus; PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus;
s8 actionState = playerStatus->actionState; s8 actionState = playerStatus->actionState;
// could be written more clearly if these two condtions were inverted
if (actionState != ACTION_STATE_USE_TWEESTER) { if (actionState != ACTION_STATE_USE_TWEESTER) {
if (partnerActionStatus->partnerActionState != PARTNER_ACTION_USE || if (!(partnerActionStatus->partnerActionState == PARTNER_ACTION_USE
(partnerActionStatus->actingPartner != PARTNER_BOW && (partnerActionStatus->actingPartner == PARTNER_BOW || partnerActionStatus->actingPartner == PARTNER_PARAKARRY))
&& partnerActionStatus->actingPartner != PARTNER_PARAKARRY)) { ) {
return FALSE; return FALSE;
} }
} }
return TRUE; return TRUE;
} }
s32 func_802B704C(void) { s32 should_continue_pulse_stone(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
if (!is_starting_conversation()) { if (!is_starting_conversation()
if (!(playerStatus->flags & PS_FLAG_PAUSED)) { && !(playerStatus->flags & PS_FLAG_PAUSED)
if (playerStatus->animFlags & PA_FLAG_USING_PULSE_STONE) { && playerStatus->animFlags & PA_FLAG_USING_PULSE_STONE
if (!has_valid_conversation_npc()) { && !has_valid_conversation_npc()
if (!func_800E06D8()) { && !func_800E06D8()
s32 dx = abs((gGameStatusPtr->mapID % 7) - 2); ) {
s32 dy = gGameStatusPtr->mapID / 7; s32 dx = abs((gGameStatusPtr->mapID % 7) - 2);
s32 dy = gGameStatusPtr->mapID / 7;
if ((dx + dy) < 6) { if ((dx + dy) < 6) {
if (!func_802B7000_2()) { if (!should_cancel_pulse_stone()) {
dy = TRUE; // TODO required to set dy to 1 and return that dy = TRUE; // TODO required to set dy to 1 and return that
return dy; return TRUE;
}
}
}
}
} }
} }
} }
return FALSE; return FALSE;
} }
void func_802B7140(void) { void pulse_stone_notification_setup(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
mem_clear(D_802B7D18_E22588, sizeof(*D_802B7D18_E22588)); mem_clear(PulseStonePtr, sizeof(*PulseStonePtr));
D_802B7D18_E22588->pos.x = playerStatus->position.x; PulseStonePtr->pos.x = playerStatus->position.x;
D_802B7D18_E22588->pos.y = playerStatus->position.y + playerStatus->colliderHeight + 8.0f; PulseStonePtr->pos.y = playerStatus->position.y + playerStatus->colliderHeight + 8.0f;
D_802B7D18_E22588->pos.z = playerStatus->position.z; PulseStonePtr->pos.z = playerStatus->position.z;
playerStatus->animFlags |= PA_FLAG_40; playerStatus->animFlags |= PA_FLAG_PULSE_STONE_VISIBLE;
PulseStoneNotificationCallback = func_802B74F0; PulseStoneNotificationCallback = pulse_stone_notification_update;
} }
void func_802B71D4(void) { void appendGfx_pulse_stone_icon(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
Matrix4f sp18, sp58; Matrix4f sp18, sp58;
FoldImageRecPart part; FoldImageRecPart part;
s32 var_v1; s32 pingDelay;
s32 dx, dy; s32 dx, dy;
if (playerStatus->animFlags & PA_FLAG_40) { if (playerStatus->animFlags & PA_FLAG_PULSE_STONE_VISIBLE) {
guScaleF(sp18, D_802B7D18_E22588->scale, D_802B7D18_E22588->scale, D_802B7D18_E22588->scale); guScaleF(sp18, PulseStonePtr->scale, PulseStonePtr->scale, PulseStonePtr->scale);
guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp18, sp58, sp18); guMtxCatF(sp18, sp58, sp18);
guTranslateF(sp58, D_802B7D18_E22588->pos.x, D_802B7D18_E22588->pos.y, D_802B7D18_E22588->pos.z); guTranslateF(sp58, PulseStonePtr->pos.x, PulseStonePtr->pos.y, PulseStonePtr->pos.z);
guMtxCatF(sp18, sp58, sp58); guMtxCatF(sp18, sp58, sp58);
guMtxF2L(sp58, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp58, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, D_802B7CA0_E22510); gSPDisplayList(gMasterGfxPos++, pulse_stone_icon_gfx);
dx = abs((gGameStatusPtr->mapID % 7) - 2); dx = abs((gGameStatusPtr->mapID % 7) - 2);
dy = gGameStatusPtr->mapID / 7; dy = gGameStatusPtr->mapID / 7;
switch (dx + dy) { switch (dx + dy) {
case 0: case 0:
var_v1 = 4; pingDelay = 4;
break; break;
case 1: case 1:
var_v1 = 8; pingDelay = 8;
break; break;
case 2: case 2:
var_v1 = 16; pingDelay = 16;
break; break;
case 3: case 3:
var_v1 = 32; pingDelay = 32;
break; break;
case 4: case 4:
var_v1 = 64; pingDelay = 64;
break; break;
case 5: case 5:
var_v1 = 128; pingDelay = 128;
break; break;
default: default:
var_v1 = -1; pingDelay = -1;
D_802B7D18_E22588->unk_20 = 0; PulseStonePtr->pingTime = 0;
break; break;
} }
part.palette = D_802B7C60_E224D0; part.palette = pulse_stone_icon_1_pal;
if (var_v1 >= 0) { if (pingDelay >= 0) {
D_802B7D18_E22588->unk_20++; PulseStonePtr->pingTime++;
if (D_802B7D18_E22588->unk_20 >= var_v1 + 2) { if (PulseStonePtr->pingTime >= pingDelay + 2) {
D_802B7D18_E22588->unk_20 = 0; PulseStonePtr->pingTime = 0;
sfx_play_sound_at_player(SOUND_7D, SOUND_SPACE_MODE_0); sfx_play_sound_at_player(SOUND_7D, SOUND_SPACE_MODE_0);
} }
if (D_802B7D18_E22588->unk_20 < 2) { if (PulseStonePtr->pingTime < 2) {
part.palette = D_802B7C80_E224F0; part.palette = pulse_stone_icon_2_pal;
} else { } else {
part.palette = D_802B7C60_E224D0; part.palette = pulse_stone_icon_1_pal;
} }
} }
part.raster = D_802B7640_E21EB0; part.raster = pulse_stone_icon_img;
part.width = 56; part.width = pulse_stone_icon_img_width;
part.height = 56; part.height = pulse_stone_icon_img_height;
part.xOffset = -28; part.xOffset = -28;
part.yOffset = 46; part.yOffset = 46;
part.opacity = 255; part.opacity = 255;
@ -146,35 +149,35 @@ void func_802B71D4(void) {
} }
} }
void func_802B74F0(void) { void pulse_stone_notification_update(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
D_802B7D18_E22588->pos.y += PulseStonePtr->pos.y +=
((playerStatus->position.y + playerStatus->colliderHeight + 10.0f) - D_802B7D18_E22588->pos.y) / 1.5f; ((playerStatus->position.y + playerStatus->colliderHeight + 10.0f) - PulseStonePtr->pos.y) / 1.5f;
D_802B7D18_E22588->pos.x = playerStatus->position.x; PulseStonePtr->pos.x = playerStatus->position.x;
D_802B7D18_E22588->pos.z = playerStatus->position.z; PulseStonePtr->pos.z = playerStatus->position.z;
if (!func_802B704C()) { if (!should_continue_pulse_stone()) {
PulseStoneNotificationCallback = NULL; PulseStoneNotificationCallback = NULL;
playerStatus->animFlags &= ~PA_FLAG_40; playerStatus->animFlags &= ~PA_FLAG_PULSE_STONE_VISIBLE;
return; return;
} }
switch (D_802B7D18_E22588->unk_24) { switch (PulseStonePtr->state) {
case 0: case PULSE_STONE_APPEAR:
if (D_802B7D18_E22588->unk_18++ < 6) { if (PulseStonePtr->appearDelay++ < 6) {
break; break;
} }
D_802B7D18_E22588->scale = 0.36f; PulseStonePtr->scale = 0.36f;
D_802B7D18_E22588->unk_24++; PulseStonePtr->state++;
break; break;
case 1: case PULSE_STONE_OVERSHOOT:
D_802B7D18_E22588->scale = 0.57f; PulseStonePtr->scale = 0.57f;
D_802B7D18_E22588->unk_24++; PulseStonePtr->state++;
break; break;
case 2: case PULSE_STONE_HOLD:
D_802B7D18_E22588->scale = 0.53f; PulseStonePtr->scale = 0.53f;
D_802B7D18_E22588->unk_24++; PulseStonePtr->state++;
break; break;
} }
} }

View File

@ -2,158 +2,149 @@
#define NAMESPACE speech_bubble #define NAMESPACE speech_bubble
#include "common/UnkAngleFunc1.inc.c" enum {
SPEECH_BUBBLE_APPEAR = 0,
SPEECH_BUBBLE_HOLD = 1,
SPEECH_BUBBLE_IDLE = 2,
SPEECH_BUBBLE_VANISH = 3,
};
#include "speech_bubble.png.h" #include "speech_bubble.png.h"
typedef struct SpeechBubbleData {
/* 0x00 */ Npc* unk_00;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 scale;
/* 0x18 */ s32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ s32 unk_20;
/* 0x24 */ char unk_24[6];
/* 0x2A */ u8 unk_2A;
/* 0x2B */ u8 unk_2B;
} SpeechBubbleData; /* size = 0x2C */
BSS SpeechBubbleData D_802B79C0_E21870;
#include "speech_bubble.png.inc.c" #include "speech_bubble.png.inc.c"
#include "speech_bubble.pal.inc.c" #include "speech_bubble.pal.inc.c"
#include "speech_bubble_dlist.gfx.inc.c" #include "speech_bubble.gfx.inc.c"
SpeechBubbleData* D_802B79A8_E21858 = &D_802B79C0_E21870; BSS SpeechBubbleData SpeechBubble;
SpeechBubbleData* SpeechBubblePtr = &SpeechBubble;
void func_802B742C(void); #include "common/GetIconBrightnessForAngle.inc.c"
void func_802B70B4(void) { void interact_speech_update(void);
void interact_speech_setup(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
SpeechBubbleData* temp; SpeechBubbleData* temp;
Npc* npc; Npc* npc;
mem_clear(D_802B79A8_E21858, sizeof(*D_802B79A8_E21858)); mem_clear(SpeechBubblePtr, sizeof(*SpeechBubblePtr));
npc = playerStatus->encounteredNPC; npc = playerStatus->encounteredNPC;
D_802B79A8_E21858->unk_00 = npc; SpeechBubblePtr->encounteredNPC = npc;
D_802B79A8_E21858->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f; SpeechBubblePtr->pos.y = SpeechBubblePtr->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f;
D_802B79A8_E21858->pos.y = D_802B79A8_E21858->unk_1C; SpeechBubblePtr->pos.x = npc->pos.x;
D_802B79A8_E21858->pos.x = npc->pos.x; SpeechBubblePtr->pos.z = npc->pos.z;
D_802B79A8_E21858->pos.z = npc->pos.z; SpeechBubblePtr->unk_18 = 0;
D_802B79A8_E21858->unk_18 = 0; SpeechBubblePtr->state = 0;
D_802B79A8_E21858->unk_2A = 0; SpeechBubblePtr->scale = 0.1f;
D_802B79A8_E21858->scale = 0.1f; TalkNotificationCallback = interact_speech_update;
TalkNotificationCallback = func_802B742C;
playerStatus->animFlags |= PA_FLAG_SPEECH_PROMPT_AVAILABLE; playerStatus->animFlags |= PA_FLAG_SPEECH_PROMPT_AVAILABLE;
temp = D_802B79A8_E21858; temp = SpeechBubblePtr;
temp->unk_2A = 0; temp->state = 0;
temp->scale = 0.4f; temp->scale = 0.4f;
D_802B79A8_E21858->unk_10 = -gCameras[gCurrentCameraID].currentYaw; SpeechBubblePtr->yaw = -gCameras[gCurrentCameraID].currentYaw;
D_802B79A8_E21858->unk_2B = 255; SpeechBubblePtr->brightness = 255;
} }
void func_802B71C8(void) { void appendGfx_speech_bubble(void) {
FoldImageRecPart sp20; FoldImageRecPart foldImg;
Matrix4f sp38, sp78; Matrix4f mtxTemp, mtxTransform;
if (gPlayerStatus.animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) { if (gPlayerStatus.animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) {
guScaleF(sp38, D_802B79A8_E21858->scale, D_802B79A8_E21858->scale, D_802B79A8_E21858->scale); guScaleF(mtxTemp, SpeechBubblePtr->scale, SpeechBubblePtr->scale, SpeechBubblePtr->scale);
guRotateF(sp78, D_802B79A8_E21858->unk_10 - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(mtxTransform, SpeechBubblePtr->yaw - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp38, sp78, sp38); guMtxCatF(mtxTemp, mtxTransform, mtxTemp);
guTranslateF(sp78, D_802B79A8_E21858->pos.x, D_802B79A8_E21858->pos.y, D_802B79A8_E21858->pos.z); guTranslateF(mtxTransform, SpeechBubblePtr->pos.x, SpeechBubblePtr->pos.y, SpeechBubblePtr->pos.z);
guMtxCatF(sp38, sp78, sp78); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
guMtxF2L(sp78, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, &D_802B7930_E217E0); gSPDisplayList(gMasterGfxPos++, &speech_bubble_gfx);
sp20.raster = D_802B7710_E215C0; foldImg.raster = speech_bubble_img;
sp20.palette = D_802B7910_E217C0; foldImg.palette = speech_bubble_pal;
sp20.width = D_802B7710_E215C0_width; foldImg.width = speech_bubble_img_width;
sp20.height = D_802B7710_E215C0_height; foldImg.height = speech_bubble_img_height;
sp20.xOffset = -16; foldImg.xOffset = -16;
sp20.yOffset = 26; foldImg.yOffset = 26;
sp20.opacity = 255; foldImg.opacity = 255;
fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0x440); fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0x440);
fold_update(0, FOLD_TYPE_6, fold_update(0, FOLD_TYPE_6,
D_802B79A8_E21858->unk_2B, D_802B79A8_E21858->unk_2B, D_802B79A8_E21858->unk_2B, 0xFF, 0x440); SpeechBubblePtr->brightness, SpeechBubblePtr->brightness, SpeechBubblePtr->brightness, 255, 0x440);
fold_appendGfx_component(0, &sp20, 0x40, sp78); fold_appendGfx_component(0, &foldImg, 0x40, mtxTransform);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
} }
} }
void func_802B742C(void) { void interact_speech_update(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
s32 var_a2 = 255; s32 brightness = 255;
f32 unk10; f32 yaw;
Npc* npc; Npc* npc;
if (((playerStatus->flags & (PS_FLAG_HAS_CONVERSATION_NPC | PS_FLAG_ENTERING_BATTLE | PS_FLAG_PAUSED)) if (((playerStatus->flags & (PS_FLAG_HAS_CONVERSATION_NPC | PS_FLAG_ENTERING_BATTLE | PS_FLAG_PAUSED))
!= PS_FLAG_HAS_CONVERSATION_NPC) || != PS_FLAG_HAS_CONVERSATION_NPC)
(gEncounterState == ENCOUNTER_STATE_CONVERSATION) || || gEncounterState == ENCOUNTER_STATE_CONVERSATION
(playerStatus->animFlags & PA_FLAG_USING_WATT) || || playerStatus->animFlags & PA_FLAG_USING_WATT
(playerStatus->inputEnabledCounter != 0) || || playerStatus->inputDisabledCount != 0
(playerStatus->animFlags & PA_FLAG_SPINNING)) || playerStatus->animFlags & PA_FLAG_SPINNING
{ ) {
D_802B79A8_E21858->unk_2A = 3; SpeechBubblePtr->state = 3;
} }
switch (D_802B79A8_E21858->unk_2A) { switch (SpeechBubblePtr->state) {
case 0: case SPEECH_BUBBLE_APPEAR:
D_802B79A8_E21858->unk_10 = 0.0f; SpeechBubblePtr->yaw = 0.0f;
D_802B79A8_E21858->scale += 0.05; SpeechBubblePtr->scale += 0.05;
if (D_802B79A8_E21858->scale >= 0.55) { if (SpeechBubblePtr->scale >= 0.55) {
D_802B79A8_E21858->scale = 0.55f; SpeechBubblePtr->scale = 0.55f;
D_802B79A8_E21858->unk_2A++; SpeechBubblePtr->state++;
D_802B79A8_E21858->unk_20 = 12; SpeechBubblePtr->holdTime = 12;
} }
break; break;
case 1: case SPEECH_BUBBLE_HOLD:
D_802B79A8_E21858->unk_10 = 0.0f; SpeechBubblePtr->yaw = 0.0f;
D_802B79A8_E21858->unk_20--; SpeechBubblePtr->holdTime--;
if (D_802B79A8_E21858->unk_20 <= 0) { if (SpeechBubblePtr->holdTime <= 0) {
D_802B79A8_E21858->unk_2A++; SpeechBubblePtr->state++;
} }
break; break;
case 2: case SPEECH_BUBBLE_IDLE:
unk10 = D_802B79A8_E21858->unk_10; yaw = SpeechBubblePtr->yaw;
unk10 += 10.0f; yaw += 10.0f;
if (unk10 >= 360.0f) { if (yaw >= 360.0f) {
unk10 -= 360.0f; yaw -= 360.0f;
} }
D_802B79A8_E21858->unk_10 = unk10; SpeechBubblePtr->yaw = yaw;
var_a2 = N(UnkAngleFunc1)(unk10); brightness = N(GetIconBrightnessForAngle)(yaw);
break; break;
case 3: case SPEECH_BUBBLE_VANISH:
unk10 = D_802B79A8_E21858->unk_10; yaw = SpeechBubblePtr->yaw;
unk10 += 25.0f; yaw += 25.0f;
if (unk10 >= 360.0f) { if (yaw >= 360.0f) {
unk10 -= 360.0f; yaw -= 360.0f;
} }
D_802B79A8_E21858->unk_10 = unk10; SpeechBubblePtr->yaw = yaw;
if ((unk10 >= 70.0f && unk10 <= 110.0f) || (unk10 >= 250.0f && unk10 <= 290.0f)) { if ((yaw >= 70.0f && yaw <= 110.0f) || (yaw >= 250.0f && yaw <= 290.0f)) {
// only dimiss when the icon is rotated away from view
TalkNotificationCallback = NULL; TalkNotificationCallback = NULL;
playerStatus->encounteredNPC = NULL; playerStatus->encounteredNPC = NULL;
playerStatus->animFlags &= ~PA_FLAG_SPEECH_PROMPT_AVAILABLE; playerStatus->animFlags &= ~PA_FLAG_SPEECH_PROMPT_AVAILABLE;
return; return;
} }
var_a2 = N(UnkAngleFunc1)(unk10); brightness = N(GetIconBrightnessForAngle)(yaw);
break; break;
} }
D_802B79A8_E21858->unk_2B = var_a2; SpeechBubblePtr->brightness = brightness;
if (playerStatus->encounteredNPC != NULL) { if (playerStatus->encounteredNPC != NULL) {
if (playerStatus->encounteredNPC != D_802B79A8_E21858->unk_00) { if (playerStatus->encounteredNPC != SpeechBubblePtr->encounteredNPC) {
D_802B79A8_E21858->unk_00 = playerStatus->encounteredNPC; SpeechBubblePtr->encounteredNPC = playerStatus->encounteredNPC;
} }
} }
npc = D_802B79A8_E21858->unk_00; npc = SpeechBubblePtr->encounteredNPC;
D_802B79A8_E21858->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f; SpeechBubblePtr->pos.y = SpeechBubblePtr->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f;
D_802B79A8_E21858->pos.y = D_802B79A8_E21858->unk_1C; SpeechBubblePtr->pos.x = npc->pos.x;
D_802B79A8_E21858->pos.x = npc->pos.x; SpeechBubblePtr->pos.z = npc->pos.z;
D_802B79A8_E21858->pos.z = npc->pos.z;
} }

View File

@ -96,7 +96,7 @@ void state_step_battle(void) {
btl_save_world_cameras(); btl_save_world_cameras();
load_battle_section(); load_battle_section();
D_800A0904 = gPlayerStatusPtr->animFlags; D_800A0904 = gPlayerStatusPtr->animFlags;
gPlayerStatusPtr->animFlags &= ~PA_FLAG_40; gPlayerStatusPtr->animFlags &= ~PA_FLAG_PULSE_STONE_VISIBLE;
D_800A0908 = get_time_freeze_mode(); D_800A0908 = get_time_freeze_mode();
set_time_freeze_mode(TIME_FREEZE_NORMAL); set_time_freeze_mode(TIME_FREEZE_NORMAL);
gOverrideFlags &= ~GLOBAL_OVERRIDES_8; gOverrideFlags &= ~GLOBAL_OVERRIDES_8;

View File

@ -69,7 +69,7 @@ Trigger* create_trigger(TriggerBlueprint* bp) {
trigger->varIndex = bp->varIndex; trigger->varIndex = bp->varIndex;
trigger->location.colliderID = bp->colliderID; trigger->location.colliderID = bp->colliderID;
trigger->itemList = bp->itemList; trigger->itemList = bp->itemList;
trigger->unk_tr_2C = bp->unk_tr_2C; trigger->tattleMsg = bp->tattleMsg;
trigger->hasPlayerInteractPrompt = bp->hasPlayerInteractPrompt; trigger->hasPlayerInteractPrompt = bp->hasPlayerInteractPrompt;
trigger->onActivateFunc = bp->onActivateFunc; trigger->onActivateFunc = bp->onActivateFunc;

View File

@ -23,10 +23,10 @@ s32 action_update_ride(void) {
if (playerStatus->animFlags & PA_FLAG_RIDING_PARTNER) { if (playerStatus->animFlags & PA_FLAG_RIDING_PARTNER) {
if (partnerActionStatus->actingPartner == PARTNER_LAKILESTER) { if (partnerActionStatus->actingPartner == PARTNER_LAKILESTER) {
return func_802BD100_317020(oldFlags); return world_goombario_get_trigger_tattle(oldFlags);
} }
if (partnerActionStatus->actingPartner == PARTNER_SUSHIE) { if (partnerActionStatus->actingPartner == PARTNER_SUSHIE) {
return func_802BD100_317020(oldFlags); return world_goombario_get_trigger_tattle(oldFlags);
} }
} }

View File

@ -7,7 +7,7 @@ API_CALLABLE(N(UnkFunc11)) {
CollisionStatus* collisionStatus = &gCollisionStatus; CollisionStatus* collisionStatus = &gCollisionStatus;
if ((collisionStatus->pushingAgainstWall != pushableColliderID && playerStatus->actionState == ACTION_STATE_PUSHING_BLOCK) || if ((collisionStatus->pushingAgainstWall != pushableColliderID && playerStatus->actionState == ACTION_STATE_PUSHING_BLOCK) ||
playerStatus->enableCollisionOverlapsCheck || playerStatus->inputEnabledCounter) { playerStatus->enableCollisionOverlapsCheck || playerStatus->inputDisabledCount != 0) {
set_action_state(ACTION_STATE_IDLE); set_action_state(ACTION_STATE_IDLE);
script->varTable[0] = 0; script->varTable[0] = 0;
return ApiStatus_DONE2; return ApiStatus_DONE2;

View File

@ -106,8 +106,8 @@ ApiStatus func_802BD338_318088(Evt* script, s32 isInitialCall) {
} }
switch (BombetteTweesterPhysicsPtr->state) { switch (BombetteTweesterPhysicsPtr->state) {
case 0: case TWEESTER_PARTNER_INIT:
BombetteTweesterPhysicsPtr->state = 1; BombetteTweesterPhysicsPtr->state++;
BombetteTweesterPhysicsPtr->prevFlags = bombette->flags; BombetteTweesterPhysicsPtr->prevFlags = bombette->flags;
BombetteTweesterPhysicsPtr->radius = fabsf(dist2D(bombette->pos.x, bombette->pos.z, BombetteTweesterPhysicsPtr->radius = fabsf(dist2D(bombette->pos.x, bombette->pos.z,
entity->position.x, entity->position.z)); entity->position.x, entity->position.z));
@ -118,7 +118,7 @@ ApiStatus func_802BD338_318088(Evt* script, s32 isInitialCall) {
BombetteTweesterPhysicsPtr->countdown = 120; BombetteTweesterPhysicsPtr->countdown = 120;
bombette->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; bombette->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8;
bombette->flags &= ~NPC_FLAG_GRAVITY; bombette->flags &= ~NPC_FLAG_GRAVITY;
case 1: case TWEESTER_PARTNER_ATTRACT:
sin_cos_rad(DEG_TO_RAD(BombetteTweesterPhysicsPtr->angle), &sinAngle, &cosAngle); sin_cos_rad(DEG_TO_RAD(BombetteTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);
bombette->pos.x = entity->position.x + (sinAngle * BombetteTweesterPhysicsPtr->radius); bombette->pos.x = entity->position.x + (sinAngle * BombetteTweesterPhysicsPtr->radius);
bombette->pos.z = entity->position.z - (cosAngle * BombetteTweesterPhysicsPtr->radius); bombette->pos.z = entity->position.z - (cosAngle * BombetteTweesterPhysicsPtr->radius);
@ -149,17 +149,17 @@ ApiStatus func_802BD338_318088(Evt* script, s32 isInitialCall) {
BombetteTweesterPhysicsPtr->state++; BombetteTweesterPhysicsPtr->state++;
} }
break; break;
case 2: case TWEESTER_PARTNER_HOLD:
bombette->flags = BombetteTweesterPhysicsPtr->prevFlags; bombette->flags = BombetteTweesterPhysicsPtr->prevFlags;
BombetteTweesterPhysicsPtr->countdown = 0x1E; BombetteTweesterPhysicsPtr->countdown = 30;
BombetteTweesterPhysicsPtr->state++; BombetteTweesterPhysicsPtr->state++;
break; break;
case 3: case TWEESTER_PARTNER_RELEASE:
partner_walking_update_player_tracking(bombette); partner_walking_update_player_tracking(bombette);
partner_walking_update_motion(bombette); partner_walking_update_motion(bombette);
if (--BombetteTweesterPhysicsPtr->countdown == 0) { if (--BombetteTweesterPhysicsPtr->countdown == 0) {
BombetteTweesterPhysicsPtr->state = 0; BombetteTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
} }
break; break;
@ -177,7 +177,7 @@ void func_802BD6DC_31842C(Npc* npc) {
if (TweesterTouchingPartner != NULL) { if (TweesterTouchingPartner != NULL) {
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
npc->flags = BombetteTweesterPhysicsPtr->prevFlags; npc->flags = BombetteTweesterPhysicsPtr->prevFlags;
BombetteTweesterPhysicsPtr->state = 0; BombetteTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
partner_clear_player_tracking(npc); partner_clear_player_tracking(npc);
} }
} }
@ -226,11 +226,11 @@ ApiStatus func_802BD758_3184A8(Evt *evt, s32 isInitialCall) {
switch (evt->functionTemp[0]) { switch (evt->functionTemp[0]) {
case 20: case 20:
if ((playerStatus->inputEnabledCounter != 0) || (playerStatus->flags & PS_FLAG_JUMPING) || !(npc->flags & NPC_FLAG_GROUNDED)) { if ((playerStatus->inputDisabledCount != 0) || (playerStatus->flags & PS_FLAG_JUMPING) || !(npc->flags & NPC_FLAG_GROUNDED)) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
disable_player_input(); disable_player_input();
evt->functionTemp[3] = playerStatus->inputEnabledCounter; evt->functionTemp[3] = playerStatus->inputDisabledCount;
D_802BE92C = 1; D_802BE92C = 1;
D_802BE928 = 0; D_802BE928 = 0;
D_802BE930 = 0; D_802BE930 = 0;
@ -268,7 +268,7 @@ ApiStatus func_802BD758_3184A8(Evt *evt, s32 isInitialCall) {
if (npc->duration != 0) { if (npc->duration != 0) {
break; break;
} }
if (evt->functionTemp[3] < playerStatus->inputEnabledCounter) { if (evt->functionTemp[3] < playerStatus->inputDisabledCount) {
disable_npc_blur(npc); disable_npc_blur(npc);
temp_f0 = 0; temp_f0 = 0;
evt->functionTemp[(u8)temp_f0] = 7; evt->functionTemp[(u8)temp_f0] = 7;

View File

@ -61,8 +61,8 @@ ApiStatus BowUpdate(Evt* script, s32 isInitialCall) {
} }
switch (BowTweesterPhysicsPtr->state){ switch (BowTweesterPhysicsPtr->state){
case 0: case TWEESTER_PARTNER_INIT:
BowTweesterPhysicsPtr->state = 1; BowTweesterPhysicsPtr->state++;
BowTweesterPhysicsPtr->prevFlags = bow->flags; BowTweesterPhysicsPtr->prevFlags = bow->flags;
BowTweesterPhysicsPtr->radius = fabsf(dist2D(bow->pos.x, bow->pos.z, entity->position.x, entity->position.z)); BowTweesterPhysicsPtr->radius = fabsf(dist2D(bow->pos.x, bow->pos.z, entity->position.x, entity->position.z));
BowTweesterPhysicsPtr->angle = atan2(entity->position.x, entity->position.z, bow->pos.x, bow->pos.z); BowTweesterPhysicsPtr->angle = atan2(entity->position.x, entity->position.z, bow->pos.x, bow->pos.z);
@ -71,7 +71,7 @@ ApiStatus BowUpdate(Evt* script, s32 isInitialCall) {
BowTweesterPhysicsPtr->countdown = 120; BowTweesterPhysicsPtr->countdown = 120;
bow->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; bow->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8;
bow->flags &= ~NPC_FLAG_GRAVITY; bow->flags &= ~NPC_FLAG_GRAVITY;
case 1: case TWEESTER_PARTNER_ATTRACT:
sin_cos_rad(DEG_TO_RAD(BowTweesterPhysicsPtr->angle), &sinAngle, &cosAngle); sin_cos_rad(DEG_TO_RAD(BowTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);
bow->pos.x = entity->position.x + (sinAngle * BowTweesterPhysicsPtr->radius); bow->pos.x = entity->position.x + (sinAngle * BowTweesterPhysicsPtr->radius);
bow->pos.z = entity->position.z - (cosAngle * BowTweesterPhysicsPtr->radius); bow->pos.z = entity->position.z - (cosAngle * BowTweesterPhysicsPtr->radius);
@ -100,17 +100,17 @@ ApiStatus BowUpdate(Evt* script, s32 isInitialCall) {
BowTweesterPhysicsPtr->state++; BowTweesterPhysicsPtr->state++;
} }
break; break;
case 2: case TWEESTER_PARTNER_HOLD:
bow->flags = BowTweesterPhysicsPtr->prevFlags; bow->flags = BowTweesterPhysicsPtr->prevFlags;
BowTweesterPhysicsPtr->countdown = 30; BowTweesterPhysicsPtr->countdown = 30;
BowTweesterPhysicsPtr->state++; BowTweesterPhysicsPtr->state++;
break; break;
case 3: case TWEESTER_PARTNER_RELEASE:
partner_flying_update_player_tracking(bow); partner_flying_update_player_tracking(bow);
partner_flying_update_motion(bow); partner_flying_update_motion(bow);
if (--BowTweesterPhysicsPtr->countdown == 0) { if (--BowTweesterPhysicsPtr->countdown == 0) {
BowTweesterPhysicsPtr->state = 0; BowTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
} }
break; break;
@ -128,7 +128,7 @@ void func_802BD4FC_323E4C(Npc* bow) {
if (TweesterTouchingPartner != NULL) { if (TweesterTouchingPartner != NULL) {
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
bow->flags = BowTweesterPhysicsPtr->prevFlags; bow->flags = BowTweesterPhysicsPtr->prevFlags;
BowTweesterPhysicsPtr->state = 0; BowTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
partner_clear_player_tracking(bow); partner_clear_player_tracking(bow);
} }
} }
@ -184,7 +184,7 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) {
switch (script->functionTemp[0]) { switch (script->functionTemp[0]) {
case 40: case 40:
if (playerStatus->inputEnabledCounter) { if (playerStatus->inputDisabledCount) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -196,7 +196,7 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) {
break; break;
case 41: case 41:
if ((!func_800EA52C(PARTNER_BOW) || is_starting_conversation()) && if ((!func_800EA52C(PARTNER_BOW) || is_starting_conversation()) &&
script->functionTemp[2] < playerStatus->inputEnabledCounter script->functionTemp[2] < playerStatus->inputDisabledCount
&& D_802BE0C4) { && D_802BE0C4) {
enable_player_input(); enable_player_input();
@ -206,7 +206,7 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) {
} }
script->functionTemp[1]--; script->functionTemp[1]--;
if (script->functionTemp[1] == 0) { if (script->functionTemp[1] == 0) {
if (script->functionTemp[2] < playerStatus->inputEnabledCounter) { if (script->functionTemp[2] < playerStatus->inputDisabledCount) {
if (D_802BE0C4) { if (D_802BE0C4) {
enable_player_input(); enable_player_input();
D_802BE0C4 = FALSE; D_802BE0C4 = FALSE;
@ -315,13 +315,13 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) {
if (func_802BD540_323E90() < 0) { if (func_802BD540_323E90() < 0) {
script->functionTemp[0]++; script->functionTemp[0]++;
script->functionTemp[1] = 3; script->functionTemp[1] = 3;
script->functionTemp[2] = playerStatus->inputEnabledCounter; script->functionTemp[2] = playerStatus->inputDisabledCount;
} }
} }
break; break;
case 3: case 3:
if (script->functionTemp[1] == 0) { if (script->functionTemp[1] == 0) {
if (script->functionTemp[2] < playerStatus->inputEnabledCounter) { if (script->functionTemp[2] < playerStatus->inputDisabledCount) {
script->functionTemp[0] = 2; script->functionTemp[0] = 2;
break; break;
} }

View File

@ -7,7 +7,7 @@ void world_goombaria_init(Npc* goombaria) {
goombaria->collisionRadius = 20; goombaria->collisionRadius = 20;
} }
ApiStatus GoombariaTakeOut(Evt* script, s32 isInitialCall) { API_CALLABLE(GoombariaTakeOut) {
Npc* goombaria = script->owner2.npc; Npc* goombaria = script->owner2.npc;
if (isInitialCall) { if (isInitialCall) {
@ -17,7 +17,7 @@ ApiStatus GoombariaTakeOut(Evt* script, s32 isInitialCall) {
return partner_get_out(goombaria) ? ApiStatus_DONE1 : ApiStatus_BLOCK; return partner_get_out(goombaria) ? ApiStatus_DONE1 : ApiStatus_BLOCK;
} }
ApiStatus GoombariaUpdate(Evt* script, s32 isInitialCall) { API_CALLABLE(GoombariaUpdate) {
PlayerData* playerData = &gPlayerData; PlayerData* playerData = &gPlayerData;
Npc* goombaria = script->owner2.npc; Npc* goombaria = script->owner2.npc;
@ -32,11 +32,11 @@ ApiStatus GoombariaUpdate(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
} }
ApiStatus GoombariaUseAbility(Evt* script, s32 isInitialCall) { API_CALLABLE(GoombariaUseAbility) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus GoombariaPutAway(Evt* script, s32 isInitialCall) { API_CALLABLE(GoombariaPutAway) {
Npc* goombaria = script->owner2.npc; Npc* goombaria = script->owner2.npc;
if (isInitialCall) { if (isInitialCall) {
@ -46,25 +46,25 @@ ApiStatus GoombariaPutAway(Evt* script, s32 isInitialCall) {
return partner_put_away(goombaria) ? ApiStatus_DONE1 : ApiStatus_BLOCK; return partner_put_away(goombaria) ? ApiStatus_DONE1 : ApiStatus_BLOCK;
} }
EvtScript world_goombaria_take_out = { EvtScript EVS_WorldGoombariaTakeOut = {
EVT_CALL(GoombariaTakeOut) EVT_CALL(GoombariaTakeOut)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
EvtScript world_goombaria_update = { EvtScript EVS_WorldGoombariaUpdate = {
EVT_CALL(GoombariaUpdate) EVT_CALL(GoombariaUpdate)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
EvtScript world_goombaria_use_ability = { EvtScript EVS_WorldGoombariaUseAbility = {
EVT_CALL(GoombariaUseAbility) EVT_CALL(GoombariaUseAbility)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
EvtScript world_goombaria_put_away = { EvtScript EVS_WorldGoombariaPutAway = {
EVT_CALL(GoombariaPutAway) EVT_CALL(GoombariaPutAway)
EVT_RETURN EVT_RETURN
EVT_END EVT_END

View File

@ -6,9 +6,9 @@
void world_goombaria_init(Npc* partner); void world_goombaria_init(Npc* partner);
extern EvtScript world_goombaria_take_out; extern EvtScript EVS_WorldGoombariaTakeOut;
extern EvtScript world_goombaria_update; extern EvtScript EVS_WorldGoombariaUpdate;
extern EvtScript world_goombaria_use_ability; extern EvtScript EVS_WorldGoombariaUseAbility;
extern EvtScript world_goombaria_put_away; extern EvtScript EVS_WorldGoombariaPutAway;
#endif #endif

View File

@ -5,29 +5,16 @@
#include "message_ids.h" #include "message_ids.h"
#include "entity.h" #include "entity.h"
typedef struct SpeechBubbleData { extern SpeechBubbleData* SpeechBubblePtr;
/* 0x00 */ Npc* unk_00;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 scale;
/* 0x18 */ s32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ s32 unk_20;
/* 0x24 */ char unk_24[6];
/* 0x2A */ u8 unk_2A;
/* 0x2B */ u8 unk_2B;
} SpeechBubbleData; /* size = 0x2C */
extern SpeechBubbleData* D_802B79A8_E21858; BSS s32 TattleHadSpeechPrompt;
BSS s32 TattleHadInteractPrompt;
BSS s32 D_802BDF30; BSS Npc* TattleInteractNpc;
BSS s32 D_802BDF34; BSS s32 D_802BDF3C; // unused (padding?)
BSS Npc* D_802BDF38;
BSS s32 D_802BDF3C;
BSS TweesterPhysics GoombarioTweesterPhysics; BSS TweesterPhysics GoombarioTweesterPhysics;
BSS s32 D_802BDF5C; BSS s32 D_802BDF5C; // unused (padding?)
BSS s32 GoombarioGetTattleID; BSS s32 GoombarioTattleInteractionID;
BSS s32 D_802BDF64; BSS s32 WorldGoombarioTattleActive;
s32 EntityTattles[] = { s32 EntityTattles[] = {
ENTITY_TYPE_HAMMER1_BLOCK, MSG_EntityTattle_HammerBlock1_CanBreak, ENTITY_TYPE_HAMMER1_BLOCK, MSG_EntityTattle_HammerBlock1_CanBreak,
@ -54,8 +41,8 @@ s32 EntityTattles[] = {
ENTITY_TYPE_PADLOCK_RED_FRAME, MSG_EntityTattle_PadLock, ENTITY_TYPE_PADLOCK_RED_FRAME, MSG_EntityTattle_PadLock,
ENTITY_TYPE_PADLOCK_RED_FACE, MSG_EntityTattle_PadLock, ENTITY_TYPE_PADLOCK_RED_FACE, MSG_EntityTattle_PadLock,
ENTITY_TYPE_PADLOCK_BLUE_FACE, MSG_EntityTattle_PadLock, ENTITY_TYPE_PADLOCK_BLUE_FACE, MSG_EntityTattle_PadLock,
ENTITY_TYPE_SIGNPOST, MSG_EntityTattle_0012, ENTITY_TYPE_SIGNPOST, MSG_EntityTattle_SignPost,
ENTITY_TYPE_RED_ARROW_SIGNS, MSG_EntityTattle_Sign, ENTITY_TYPE_RED_ARROW_SIGNS, MSG_EntityTattle_ArrowSign,
ENTITY_TYPE_BOMBABLE_ROCK, MSG_EntityTattle_BombableRock, ENTITY_TYPE_BOMBABLE_ROCK, MSG_EntityTattle_BombableRock,
ENTITY_TYPE_CHEST, MSG_EntityTattle_Chest, ENTITY_TYPE_CHEST, MSG_EntityTattle_Chest,
ENTITY_TYPE_WOODEN_CRATE, MSG_EntityTattle_WoodenCrate_CantBreak, ENTITY_TYPE_WOODEN_CRATE, MSG_EntityTattle_WoodenCrate_CantBreak,
@ -70,14 +57,17 @@ s32 EntityTattles[] = {
-1 -1
}; };
s32 func_802BD100_317020(s32 arg0) { s32 world_goombario_get_trigger_tattle(s32 arg0) {
s32 i; s32 i;
for (i = 0; i < 0x40; i++) { for (i = 0; i < MAX_TRIGGERS; i++) {
Trigger* trigger = get_trigger_by_id(i); Trigger* trigger = get_trigger_by_id(i);
if (trigger != NULL && trigger->flags.flags & TRIGGER_WALL_PRESS_A && trigger->location.colliderID == arg0) { if (trigger != NULL
return trigger->unk_tr_2C; && trigger->flags.flags & TRIGGER_WALL_PRESS_A
&& trigger->location.colliderID == arg0
) {
return trigger->tattleMsg;
} }
} }
return 0; return 0;
@ -88,26 +78,30 @@ void world_goombario_init(Npc* goombario) {
goombario->collisionRadius = 20; goombario->collisionRadius = 20;
} }
ApiStatus func_802BD188_3170A8(Evt* script, s32 isInitialCall) { API_CALLABLE(WorldGoombarioTakeOut) {
Npc* goombario = script->owner2.npc; Npc* goombario = script->owner2.npc;
GoombarioGetTattleID = -1; GoombarioTattleInteractionID = -1;
if (isInitialCall) { if (isInitialCall) {
partner_init_get_out(goombario); partner_init_get_out(goombario);
} }
return partner_get_out(goombario) ? ApiStatus_DONE1 : ApiStatus_BLOCK; if (partner_get_out(goombario)) {
return ApiStatus_DONE1;
} else {
return ApiStatus_BLOCK;
}
} }
EvtScript world_goombario_take_out = { EvtScript EVS_GoombarioTakeOut = {
EVT_CALL(func_802BD188_3170A8) EVT_CALL(WorldGoombarioTakeOut)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
TweesterPhysics* GoombarioTweesterPhysicsPtr = &GoombarioTweesterPhysics; TweesterPhysics* GoombarioTweesterPhysicsPtr = &GoombarioTweesterPhysics;
s32 func_802BD1D0_3170F0(Evt* script, s32 isInitialCall) { API_CALLABLE(WorldGoombarioUpdate) {
PlayerData* playerData = &gPlayerData; PlayerData* playerData = &gPlayerData;
Npc* npc = script->owner2.npc; Npc* npc = script->owner2.npc;
f32 sinAngle, cosAngle, liftoffVelocity; f32 sinAngle, cosAngle, liftoffVelocity;
@ -182,7 +176,7 @@ s32 func_802BD1D0_3170F0(Evt* script, s32 isInitialCall) {
partner_walking_update_motion(npc); partner_walking_update_motion(npc);
if (--GoombarioTweesterPhysicsPtr->countdown == 0) { if (--GoombarioTweesterPhysicsPtr->countdown == 0) {
GoombarioTweesterPhysicsPtr->state = 0; GoombarioTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
} }
break; break;
@ -190,17 +184,17 @@ s32 func_802BD1D0_3170F0(Evt* script, s32 isInitialCall) {
return 0; return 0;
} }
EvtScript world_goombario_update = { EvtScript EVS_GoombarioUpdate = {
EVT_CALL(func_802BD1D0_3170F0) EVT_CALL(WorldGoombarioUpdate)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
void func_802BD564_317484(Npc* goombario) { void goombario_try_cancel_tweester(Npc* goombario) {
if (TweesterTouchingPartner) { if (TweesterTouchingPartner) {
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
goombario->flags = GoombarioTweesterPhysicsPtr->prevFlags; goombario->flags = GoombarioTweesterPhysicsPtr->prevFlags;
GoombarioTweesterPhysicsPtr->state = 0; GoombarioTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
partner_clear_player_tracking (goombario); partner_clear_player_tracking (goombario);
} }
} }
@ -221,72 +215,85 @@ s32 world_goombario_can_pause(Npc* goombario) {
return TRUE; return TRUE;
} }
ApiStatus func_802BD5D8_3174F8(Evt* script, s32 isInitialCall) { API_CALLABLE(WorldGoombarioSelectTattleMsg) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
Npc* goombario = script->owner2.npc; Npc* goombario = script->owner2.npc;
s32 msgID; s32 msgID;
s32 temp; // TODO required to match (this temp needs to be used in two places for different things) s32 temp; // TODO required to match (this temp needs to be used in two places for different things)
s32 v1; s32 npcMsgID;
s32 v0; s32 v0;
s32 i; s32 i;
#define USE_STATE functionTemp[0]
#define VAR_MSG varTable[0]
#define VAR_SKIP varTable[1]
enum {
USE_TATTLE_INIT = 40,
USE_TATTLE_DELAY = 41,
USE_TATTLE_FACE_PLAYER = 0,
USE_TATTLE_CHOOSE = 1,
USE_TATTLE_FORCE_MAP = 10,
USE_TATTLE_FORCE_NPC = 20,
};
if (isInitialCall) { if (isInitialCall) {
func_802BD564_317484(goombario); goombario_try_cancel_tweester(goombario);
D_802BDF64 = 0; WorldGoombarioTattleActive = FALSE;
D_802BDF30 = 0; TattleHadSpeechPrompt = FALSE;
D_802BDF34 = 0; TattleHadInteractPrompt = FALSE;
if (playerStatus->animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) { if (playerStatus->animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) {
D_802BDF30 = 1; TattleHadSpeechPrompt = TRUE;
D_802BDF38 = D_802B79A8_E21858->unk_00; TattleInteractNpc = SpeechBubblePtr->encounteredNPC;
} }
if (playerStatus->animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) { if (playerStatus->animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) {
D_802BDF34 = 1; TattleHadInteractPrompt = TRUE;
} }
script->functionTemp[0] = 40; script->USE_STATE = USE_TATTLE_INIT;
} }
switch (script->functionTemp[0]) { switch (script->USE_STATE) {
case 40: case USE_TATTLE_INIT:
if (!(goombario->flags & NPC_FLAG_GROUNDED) || playerStatus->inputEnabledCounter != 0) { if (!(goombario->flags & NPC_FLAG_GROUNDED) || playerStatus->inputDisabledCount != 0) {
script->varTable[0] = -1; script->VAR_MSG = -1;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
script->functionTemp[1] = 3; script->functionTemp[1] = 3;
disable_player_input(); disable_player_input();
D_802BDF64 = 1; WorldGoombarioTattleActive = TRUE;
script->functionTemp[2] = playerStatus->inputEnabledCounter; script->functionTemp[2] = playerStatus->inputDisabledCount;
script->functionTemp[0]++; script->USE_STATE++;
break; break;
case 41: case USE_TATTLE_DELAY:
if (script->functionTemp[1] != 0) { if (script->functionTemp[1] != 0) {
script->functionTemp[1]--; script->functionTemp[1]--;
} else { } else {
if (script->functionTemp[2] < playerStatus->inputEnabledCounter) { if (script->functionTemp[2] < playerStatus->inputDisabledCount) {
script->varTable[0] = -1; script->VAR_MSG = -1;
enable_player_input(); enable_player_input();
D_802BDF64 = 0; WorldGoombarioTattleActive = FALSE;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
script->functionTemp[0] = 0; script->USE_STATE = USE_TATTLE_FACE_PLAYER;
} }
break; break;
case 0: case USE_TATTLE_FACE_PLAYER:
set_time_freeze_mode(1); set_time_freeze_mode(1);
playerStatus->flags &= ~PS_FLAG_HAS_CONVERSATION_NPC; playerStatus->flags &= ~PS_FLAG_HAS_CONVERSATION_NPC;
goombario->currentAnim = 0x010001; goombario->currentAnim = ANIM_WorldGoombario_Idle;
goombario->yaw = clamp_angle(gCameras[CAM_DEFAULT].currentYaw + playerStatus->spriteFacingAngle - 90.0f); goombario->yaw = clamp_angle(gCameras[CAM_DEFAULT].currentYaw + playerStatus->spriteFacingAngle - 90.0f);
gPartnerActionStatus.partnerActionState = 1; gPartnerActionStatus.partnerActionState = PARTNER_ACTION_USE;
close_status_menu(); close_status_menu();
if (D_802BDF30 != 0) { if (TattleHadSpeechPrompt) {
script->varTable[0] = 0; script->VAR_MSG = 0;
script->functionTemp[0] = 20; script->USE_STATE = USE_TATTLE_FORCE_NPC;
break; break;
} }
script->functionTemp[0] = 1; script->USE_STATE = USE_TATTLE_CHOOSE;
/* fallthrough */ // fallthrough
case 1: case USE_TATTLE_CHOOSE:
if (GoombarioGetTattleID >= 0 && (GoombarioGetTattleID & 0x4000)) { // check for entity tattle
temp = get_entity_type(GoombarioGetTattleID); if (GoombarioTattleInteractionID >= 0 && (GoombarioTattleInteractionID & COLLISION_WITH_ENTITY_BIT)) {
temp = get_entity_type(GoombarioTattleInteractionID);
msgID = -1; msgID = -1;
do {} while (0); do {} while (0);
for (i = 0; EntityTattles[2 * i] != -1; i++) { for (i = 0; EntityTattles[2 * i] != -1; i++) {
@ -294,126 +301,129 @@ ApiStatus func_802BD5D8_3174F8(Evt* script, s32 isInitialCall) {
continue; continue;
} }
switch (temp) { switch (temp) {
case 22: case ENTITY_TYPE_HAMMER2_BLOCK:
case 25: case ENTITY_TYPE_HAMMER2_BLOCK_TINY:
if (gPlayerData.hammerLevel >= 1) { if (gPlayerData.hammerLevel >= 1) {
msgID = MSG_EntityTattle_HammerBlock2_CanBreak; msgID = MSG_EntityTattle_HammerBlock2_CanBreak;
} }
break; break;
case 23: case ENTITY_TYPE_HAMMER3_BLOCK:
case 26: case ENTITY_TYPE_HAMMER3_BLOCK_TINY:
if (gPlayerData.hammerLevel >= 2) { if (gPlayerData.hammerLevel >= 2) {
msgID = MSG_EntityTattle_HammerBlock3_CanBreak; msgID = MSG_EntityTattle_HammerBlock3_CanBreak;
} }
break; break;
case 36: case ENTITY_TYPE_WOODEN_CRATE:
if (gPlayerData.bootsLevel == 1) { if (gPlayerData.bootsLevel == 1) {
msgID = MSG_EntityTattle_WoodenCrate_SpinJump; msgID = MSG_EntityTattle_WoodenCrate_SpinJump;
} else if (gPlayerData.bootsLevel == 2) { } else if (gPlayerData.bootsLevel == 2) {
msgID = MSG_EntityTattle_WoodenCrate_TornadoJump; msgID = MSG_EntityTattle_WoodenCrate_TornadoJump;
} }
break; break;
case 37: case ENTITY_TYPE_BOARDED_FLOOR:
if (gPlayerData.bootsLevel == 1) { if (gPlayerData.bootsLevel == 1) {
msgID = MSG_EntityTattle_BoardedFloor_SpinJump; msgID = MSG_EntityTattle_BoardedFloor_SpinJump;
} else if (gPlayerData.bootsLevel == 2) { } else if (gPlayerData.bootsLevel == 2) {
msgID = MSG_EntityTattle_BoardedFloor_TornadoJump; msgID = MSG_EntityTattle_BoardedFloor_TornadoJump;
} }
break; break;
case 9: case ENTITY_TYPE_HUGE_BLUE_SWITCH:
if (gPlayerData.bootsLevel >= 2) { if (gPlayerData.bootsLevel >= 2) {
msgID = MSG_EntityTattle_BigSwitch_TornadoJump; msgID = MSG_EntityTattle_BigSwitch_TornadoJump;
} }
break; break;
case 10: case ENTITY_TYPE_GREEN_STOMP_SWITCH:
if (gPlayerData.bootsLevel >= 2) { if (gPlayerData.bootsLevel >= 2) {
msgID = MSG_EntityTattle_FloorSwitch_TornadoJump; msgID = MSG_EntityTattle_FloorSwitch_TornadoJump;
} }
break; break;
case 49: case ENTITY_TYPE_STAR_BOX_LAUCHER:
if (gPlayerData.bootsLevel >= 2) { if (gPlayerData.bootsLevel >= 2) {
msgID = MSG_EntityTattle_JackInTheBox_TornadoJump; msgID = MSG_EntityTattle_JackInTheBox_TornadoJump;
} }
break; break;
case 50: case ENTITY_TYPE_CHEST:
if (get_entity_by_index(GoombarioGetTattleID & 0x3FFF)->dataBuf.chest->itemID == -1) { if (get_entity_by_index(GoombarioTattleInteractionID & 0x3FFF)->dataBuf.chest->itemID == -1) {
msgID = MSG_EntityTattle_EmptyChest; msgID = MSG_EntityTattle_EmptyChest;
} }
break; break;
} }
if (msgID != -1) { if (msgID != -1) {
script->varTable[0] = msgID; script->VAR_MSG = msgID;
} else { } else {
script->varTable[0] = EntityTattles[2 * i + 1]; script->VAR_MSG = EntityTattles[2 * i + 1];
} }
script->varTable[1] = 0; script->VAR_SKIP = FALSE;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
} }
if (GoombarioGetTattleID >= 0 && (GoombarioGetTattleID & 0x2000)) { // check for NPC tattle
D_802BDF38 = get_npc_unsafe(GoombarioGetTattleID & 0x1FFF); if (GoombarioTattleInteractionID >= 0 && (GoombarioTattleInteractionID & COLLISION_WITH_NPC_BIT)) {
v0 = get_enemy(D_802BDF38->npcID)->tattleMsg; TattleInteractNpc = get_npc_unsafe(GoombarioTattleInteractionID & 0x1FFF);
v0 = get_enemy(TattleInteractNpc->npcID)->tattleMsg;
if (v0 != 0) { if (v0 != 0) {
msgID = v0; msgID = v0;
if (msgID < EVT_LIMIT) { if (msgID < EVT_LIMIT) {
script->varTable[0] = ((s32(*)(void))msgID)(); script->VAR_MSG = ((s32(*)(void))msgID)();
} else { } else {
script->varTable[0] = msgID; script->VAR_MSG = msgID;
script->varTable[1] = 0; script->VAR_SKIP = FALSE;
} }
} }
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
if (D_802BDF34 != 0) { // generic interact tattle
script->varTable[0] = MSG_EntityTattle_25; if (TattleHadInteractPrompt) {
script->varTable[1] = 0; script->VAR_MSG = MSG_EntityTattle_Interact;
script->VAR_SKIP = FALSE;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
temp = 0; // check for custom trigger tattle
if (GoombarioGetTattleID >= 0) { temp = MSG_NONE;
temp = func_802BD100_317020(GoombarioGetTattleID); if (GoombarioTattleInteractionID >= 0) {
} else { temp = world_goombario_get_trigger_tattle(GoombarioTattleInteractionID);
temp = 0;
} }
if (temp == 0) { // check map tattle
if (temp == MSG_NONE) {
msgID = get_current_map_settings()->tattle.msgID; msgID = get_current_map_settings()->tattle.msgID;
if (msgID != 0) { if (msgID != 0) {
if (msgID < EVT_LIMIT) { if (msgID < EVT_LIMIT) {
script->varTable[0] = ((s32(*)(void))msgID)(); // map uses a get_tattle function
script->VAR_MSG = ((s32(*)(void))msgID)();
} else { } else {
script->varTable[0] = msgID; script->VAR_MSG = msgID;
script->varTable[1] = 0; script->VAR_SKIP = FALSE;
} }
} }
} else { } else {
script->varTable[0] = temp; script->VAR_MSG = temp;
script->varTable[1] = 1; script->VAR_SKIP = TRUE;
} }
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
switch (script->functionTemp[0]) { switch (script->USE_STATE) {
case 10: case USE_TATTLE_FORCE_MAP:
msgID = get_current_map_settings()->tattle.msgID; msgID = get_current_map_settings()->tattle.msgID;
if (msgID != 0) { if (msgID != 0) {
if (msgID < EVT_LIMIT) { if (msgID < EVT_LIMIT) {
script->varTable[0] = ((s32(*)(void))msgID)(); script->VAR_MSG = ((s32(*)(void))msgID)();
} else { } else {
script->varTable[0] = msgID; script->VAR_MSG = msgID;
script->varTable[1] = 0; script->VAR_SKIP = FALSE;
} }
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
break; break;
case 20: case USE_TATTLE_FORCE_NPC:
v1 = get_enemy(D_802BDF38->npcID)->tattleMsg; npcMsgID = get_enemy(TattleInteractNpc->npcID)->tattleMsg;
if (v1 != 0) { if (npcMsgID != MSG_NONE) {
script->varTable[0] = v1; script->VAR_MSG = npcMsgID;
script->varTable[1] = 0; script->VAR_SKIP = FALSE;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
break; break;
@ -421,13 +431,13 @@ ApiStatus func_802BD5D8_3174F8(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
} }
ApiStatus func_802BDB30_317A50(Evt* script, s32 isInitialCall) { API_CALLABLE(WorldGoombarioTattleEnd) {
PartnerActionStatus* goombarioActionStatus = &gPartnerActionStatus; PartnerActionStatus* goombarioActionStatus = &gPartnerActionStatus;
set_time_freeze_mode(TIME_FREEZE_NORMAL); set_time_freeze_mode(TIME_FREEZE_NORMAL);
if (D_802BDF64 != 0) { if (WorldGoombarioTattleActive) {
D_802BDF64 = 0; WorldGoombarioTattleActive = FALSE;
enable_player_input(); enable_player_input();
} }
@ -436,37 +446,44 @@ ApiStatus func_802BDB30_317A50(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
EvtScript world_goombario_use_ability = { EvtScript EVS_GoombarioUseAbility = {
EVT_CALL(func_802BD5D8_3174F8) EVT_CALL(WorldGoombarioSelectTattleMsg)
// abort without cleanup if failed to init
EVT_IF_EQ(LVar0, -1) EVT_IF_EQ(LVar0, -1)
EVT_RETURN EVT_RETURN
EVT_END_IF EVT_END_IF
EVT_IF_EQ(LVar0, 0) // abort if no tattle message is available
EVT_CALL(func_802BDB30_317A50) EVT_IF_EQ(LVar0, MSG_NONE)
EVT_CALL(WorldGoombarioTattleEnd)
EVT_RETURN EVT_RETURN
EVT_END_IF EVT_END_IF
EVT_IF_EQ(LVar1, 0) // show message if VAR_SKIP is FALSE
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldGoombario_Talk, EVT_IF_EQ(LVar1, FALSE)
ANIM_WorldGoombario_Idle, 0, LVar0) EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldGoombario_Talk, ANIM_WorldGoombario_Idle, 0, LVar0)
EVT_END_IF EVT_END_IF
EVT_WAIT(1) EVT_WAIT(1)
EVT_CALL(func_802BDB30_317A50) // cleanup
EVT_CALL(WorldGoombarioTattleEnd)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
ApiStatus func_802BDB84(Evt* script, s32 isInitialCall) { API_CALLABLE(WorldGoombarioPutAway) {
Npc* goombario = script->owner2.npc; Npc* goombario = script->owner2.npc;
if (isInitialCall) { if (isInitialCall) {
partner_init_put_away(goombario); partner_init_put_away(goombario);
} }
return partner_put_away(goombario) ? ApiStatus_DONE1 : ApiStatus_BLOCK; if (partner_put_away(goombario)) {
return ApiStatus_DONE1;
} else {
return ApiStatus_BLOCK;
}
} }
EvtScript world_goombario_put_away = { EvtScript EVS_GoombarioPutAway = {
EVT_CALL(func_802BDB84) EVT_CALL(WorldGoombarioPutAway)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };

View File

@ -6,13 +6,13 @@
void world_goombario_init(Npc* partner); void world_goombario_init(Npc* partner);
s32 world_goombario_can_pause(Npc* partner); s32 world_goombario_can_pause(Npc* partner);
ApiStatus func_802BDB84(Evt* script, s32 isInitialCall); ApiStatus WorldGoombarioPutAway(Evt* script, s32 isInitialCall);
void world_goombario_pre_battle(Npc* partner); void world_goombario_pre_battle(Npc* partner);
s32 func_802BD100_317020(s32 arg0); s32 world_goombario_get_trigger_tattle(s32 arg0);
extern EvtScript world_goombario_take_out; extern EvtScript EVS_GoombarioTakeOut;
extern EvtScript world_goombario_update; extern EvtScript EVS_GoombarioUpdate;
extern EvtScript world_goombario_use_ability; extern EvtScript EVS_GoombarioUseAbility;
extern EvtScript world_goombario_put_away; extern EvtScript EVS_GoombarioPutAway;
#endif #endif

View File

@ -2,34 +2,37 @@
#include "goompa.h" #include "goompa.h"
#include "../src/world/partners.h" #include "../src/world/partners.h"
ApiStatus func_802BD14C_324A5C(Evt* script, s32 isInitialCall); API_CALLABLE(GoompaUpdate);
void world_goompa_init(Npc* partner) { void world_goompa_init(Npc* partner) {
partner->collisionHeight = 24; partner->collisionHeight = 24;
partner->collisionRadius = 20; partner->collisionRadius = 20;
} }
ApiStatus GoompaTakeOut(Evt* script, s32 isInitialCall) { API_CALLABLE(GoompaTakeOut) {
Npc* goompa = script->owner2.npc; Npc* goompa = script->owner2.npc;
if (isInitialCall) { if (isInitialCall) {
partner_init_get_out(goompa); partner_init_get_out(goompa);
} }
return partner_get_out(goompa) ? ApiStatus_DONE1 : ApiStatus_BLOCK; if (partner_get_out(goompa)) {
return ApiStatus_DONE1;
} else {
return ApiStatus_BLOCK;
}
} }
EvtScript world_goompa_take_out = { EvtScript EVS_WorldGoompaTakeOut = {
EVT_CALL(GoompaTakeOut) EVT_CALL(GoompaTakeOut)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
BSS TweesterPhysics GoompaTweesterPhysics; BSS TweesterPhysics GoompaTweesterPhysics;
TweesterPhysics* GoompaTweesterPhysicsPtr = &GoompaTweesterPhysics; TweesterPhysics* GoompaTweesterPhysicsPtr = &GoompaTweesterPhysics;
ApiStatus func_802BD14C_324A5C(Evt* script, s32 isInitialCall) { API_CALLABLE(GoompaUpdate) {
PlayerData* playerData = &gPlayerData; PlayerData* playerData = &gPlayerData;
Npc* goompa = script->owner2.npc; Npc* goompa = script->owner2.npc;
f32 sinAngle, cosAngle, liftoffVelocity; f32 sinAngle, cosAngle, liftoffVelocity;
@ -51,8 +54,8 @@ ApiStatus func_802BD14C_324A5C(Evt* script, s32 isInitialCall) {
} }
switch (GoompaTweesterPhysicsPtr->state) { switch (GoompaTweesterPhysicsPtr->state) {
case 0: case TWEESTER_PARTNER_INIT:
GoompaTweesterPhysicsPtr->state = 1; GoompaTweesterPhysicsPtr->state++;
GoompaTweesterPhysicsPtr->prevFlags = goompa->flags; GoompaTweesterPhysicsPtr->prevFlags = goompa->flags;
GoompaTweesterPhysicsPtr->radius = fabsf(dist2D(goompa->pos.x, goompa->pos.z, GoompaTweesterPhysicsPtr->radius = fabsf(dist2D(goompa->pos.x, goompa->pos.z,
entity->position.x, entity->position.z)); entity->position.x, entity->position.z));
@ -62,7 +65,7 @@ ApiStatus func_802BD14C_324A5C(Evt* script, s32 isInitialCall) {
GoompaTweesterPhysicsPtr->countdown = 120; GoompaTweesterPhysicsPtr->countdown = 120;
goompa->flags |= NPC_FLAG_8 | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_CAMERA_FOR_YAW; goompa->flags |= NPC_FLAG_8 | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_CAMERA_FOR_YAW;
goompa->flags &= ~NPC_FLAG_GRAVITY; goompa->flags &= ~NPC_FLAG_GRAVITY;
case 1: case TWEESTER_PARTNER_ATTRACT:
sin_cos_rad(DEG_TO_RAD(GoompaTweesterPhysicsPtr->angle), &sinAngle, &cosAngle); sin_cos_rad(DEG_TO_RAD(GoompaTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);
goompa->pos.x = entity->position.x + (sinAngle * GoompaTweesterPhysicsPtr->radius); goompa->pos.x = entity->position.x + (sinAngle * GoompaTweesterPhysicsPtr->radius);
goompa->pos.z = entity->position.z - (cosAngle * GoompaTweesterPhysicsPtr->radius); goompa->pos.z = entity->position.z - (cosAngle * GoompaTweesterPhysicsPtr->radius);
@ -93,17 +96,17 @@ ApiStatus func_802BD14C_324A5C(Evt* script, s32 isInitialCall) {
GoompaTweesterPhysicsPtr->state++; GoompaTweesterPhysicsPtr->state++;
} }
break; break;
case 2: case TWEESTER_PARTNER_HOLD:
goompa->flags = GoompaTweesterPhysicsPtr->prevFlags; goompa->flags = GoompaTweesterPhysicsPtr->prevFlags;
GoompaTweesterPhysicsPtr->countdown = 30; GoompaTweesterPhysicsPtr->countdown = 30;
GoompaTweesterPhysicsPtr->state++; GoompaTweesterPhysicsPtr->state++;
break; break;
case 3: case TWEESTER_PARTNER_RELEASE:
partner_walking_update_player_tracking(goompa); partner_walking_update_player_tracking(goompa);
partner_walking_update_motion(goompa); partner_walking_update_motion(goompa);
if (--GoompaTweesterPhysicsPtr->countdown == 0) { if (--GoompaTweesterPhysicsPtr->countdown == 0) {
GoompaTweesterPhysicsPtr->state = 0; GoompaTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
} }
break; break;
@ -111,42 +114,46 @@ ApiStatus func_802BD14C_324A5C(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
} }
EvtScript world_goompa_update = { EvtScript EVS_WorldGoompaUpdate = {
EVT_CALL(func_802BD14C_324A5C) EVT_CALL(GoompaUpdate)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
void func_802BD4E0_324DF0(Npc* goompa) { void goompa_try_cancel_tweester(Npc* goompa) {
if (TweesterTouchingPartner != NULL) { if (TweesterTouchingPartner != NULL) {
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
goompa->flags = GoompaTweesterPhysicsPtr->prevFlags; goompa->flags = GoompaTweesterPhysicsPtr->prevFlags;
GoompaTweesterPhysicsPtr->state = 0; GoompaTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
partner_clear_player_tracking(goompa); partner_clear_player_tracking(goompa);
} }
} }
ApiStatus GoompaUseAbility(Evt* script, s32 isInitialCall) { API_CALLABLE(GoompaUseAbility) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
EvtScript world_goompa_use_ability = { EvtScript EVS_WorldGoompaUseAbility = {
EVT_CALL(GoompaUseAbility) EVT_CALL(GoompaUseAbility)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
ApiStatus GoompaPutAway(Evt* script, s32 isInitialCall) { API_CALLABLE(GoompaPutAway) {
Npc* goompa = script->owner2.npc; Npc* goompa = script->owner2.npc;
if (isInitialCall) { if (isInitialCall) {
partner_init_put_away(goompa); partner_init_put_away(goompa);
} }
return partner_put_away(goompa) ? ApiStatus_DONE1 : ApiStatus_BLOCK; if (partner_put_away(goompa)) {
return ApiStatus_DONE1;
} else {
return ApiStatus_BLOCK;
}
} }
EvtScript world_goompa_put_away = { EvtScript EVS_WorldGoompaPutAway = {
EVT_CALL(GoompaPutAway) EVT_CALL(GoompaPutAway)
EVT_RETURN EVT_RETURN
EVT_END EVT_END

View File

@ -6,9 +6,9 @@
void world_goompa_init(Npc* partner); void world_goompa_init(Npc* partner);
extern EvtScript world_goompa_take_out; extern EvtScript EVS_WorldGoompaTakeOut;
extern EvtScript world_goompa_update; extern EvtScript EVS_WorldGoompaUpdate;
extern EvtScript world_goompa_use_ability; extern EvtScript EVS_WorldGoompaUseAbility;
extern EvtScript world_goompa_put_away; extern EvtScript EVS_WorldGoompaPutAway;
#endif #endif

View File

@ -118,8 +118,8 @@ API_CALLABLE(KooperUpdate) {
} }
switch (KooperTweesterPhysicsPtr->state) { switch (KooperTweesterPhysicsPtr->state) {
case 0: case TWEESTER_PARTNER_INIT:
KooperTweesterPhysicsPtr->state = 1; KooperTweesterPhysicsPtr->state++;
KooperTweesterPhysicsPtr->prevFlags = kooper->flags; KooperTweesterPhysicsPtr->prevFlags = kooper->flags;
KooperTweesterPhysicsPtr->radius = fabsf(dist2D(kooper->pos.x, kooper->pos.z, KooperTweesterPhysicsPtr->radius = fabsf(dist2D(kooper->pos.x, kooper->pos.z,
entity->position.x, entity->position.z)); entity->position.x, entity->position.z));
@ -129,7 +129,7 @@ API_CALLABLE(KooperUpdate) {
KooperTweesterPhysicsPtr->countdown = 120; KooperTweesterPhysicsPtr->countdown = 120;
kooper->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; kooper->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8;
kooper->flags &= ~NPC_FLAG_GRAVITY; kooper->flags &= ~NPC_FLAG_GRAVITY;
case 1: case TWEESTER_PARTNER_ATTRACT:
sin_cos_rad(DEG_TO_RAD(KooperTweesterPhysicsPtr->angle), &sinAngle, &cosAngle); sin_cos_rad(DEG_TO_RAD(KooperTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);
kooper->pos.x = entity->position.x + (sinAngle * KooperTweesterPhysicsPtr->radius); kooper->pos.x = entity->position.x + (sinAngle * KooperTweesterPhysicsPtr->radius);
@ -161,17 +161,17 @@ API_CALLABLE(KooperUpdate) {
KooperTweesterPhysicsPtr->state++; KooperTweesterPhysicsPtr->state++;
} }
break; break;
case 2: case TWEESTER_PARTNER_HOLD:
kooper->flags = KooperTweesterPhysicsPtr->prevFlags; kooper->flags = KooperTweesterPhysicsPtr->prevFlags;
KooperTweesterPhysicsPtr->countdown = 30; KooperTweesterPhysicsPtr->countdown = 30;
KooperTweesterPhysicsPtr->state++; KooperTweesterPhysicsPtr->state++;
break; break;
case 3: case TWEESTER_PARTNER_RELEASE:
partner_walking_update_player_tracking(kooper); partner_walking_update_player_tracking(kooper);
partner_walking_update_motion(kooper); partner_walking_update_motion(kooper);
if (--KooperTweesterPhysicsPtr->countdown == 0) { if (--KooperTweesterPhysicsPtr->countdown == 0) {
KooperTweesterPhysicsPtr->state = 0; KooperTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
} }
break; break;
@ -189,7 +189,7 @@ void kooper_try_cancel_tweester(Npc* kooper) {
if (TweesterTouchingPartner != NULL) { if (TweesterTouchingPartner != NULL) {
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
kooper->flags = KooperTweesterPhysicsPtr->prevFlags; kooper->flags = KooperTweesterPhysicsPtr->prevFlags;
KooperTweesterPhysicsPtr->state = 0; KooperTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
partner_clear_player_tracking(kooper); partner_clear_player_tracking(kooper);
} }
} }
@ -252,7 +252,7 @@ API_CALLABLE(KooperUseAbility) {
switch (script->USE_STATE) { switch (script->USE_STATE) {
case SHELL_TOSS_STATE_BEGIN: case SHELL_TOSS_STATE_BEGIN:
if (playerStatus->inputEnabledCounter != 0 if (playerStatus->inputDisabledCount != 0
|| playerStatus->timeInAir != 0 || playerStatus->timeInAir != 0
|| !(kooper->flags & NPC_FLAG_GROUNDED) || !(kooper->flags & NPC_FLAG_GROUNDED)
) { ) {
@ -260,7 +260,7 @@ API_CALLABLE(KooperUseAbility) {
} }
disable_player_input(); disable_player_input();
script->functionTemp[2] = playerStatus->inputEnabledCounter; script->functionTemp[2] = playerStatus->inputDisabledCount;
ShellTossControlsPlayer = TRUE; ShellTossControlsPlayer = TRUE;
ShellTossHitboxState = SHELL_TOSS_HITBOX_DISABLED; ShellTossHitboxState = SHELL_TOSS_HITBOX_DISABLED;
KooperHasItem = FALSE; KooperHasItem = FALSE;
@ -307,7 +307,7 @@ API_CALLABLE(KooperUseAbility) {
} }
disable_npc_blur(kooper); disable_npc_blur(kooper);
if (script->functionTemp[2] < playerStatus->inputEnabledCounter) { if (script->functionTemp[2] < playerStatus->inputDisabledCount) {
if (!(playerStatus->animFlags & PA_FLAG_CHANGING_MAP)) { if (!(playerStatus->animFlags & PA_FLAG_CHANGING_MAP)) {
suggest_player_anim_allow_backward(ANIM_Mario1_Idle); suggest_player_anim_allow_backward(ANIM_Mario1_Idle);
} else { } else {

View File

@ -102,8 +102,8 @@ ApiStatus func_802BD2D4_320E24(Evt* script, s32 isInitialCall) {
} }
switch (LakilesterTweesterPhysicsPtr->state) { switch (LakilesterTweesterPhysicsPtr->state) {
case 0: case TWEESTER_PARTNER_INIT:
LakilesterTweesterPhysicsPtr->state = 1; LakilesterTweesterPhysicsPtr->state++;
LakilesterTweesterPhysicsPtr->prevFlags = lakilester->flags; LakilesterTweesterPhysicsPtr->prevFlags = lakilester->flags;
LakilesterTweesterPhysicsPtr->radius = fabsf(dist2D(lakilester->pos.x, lakilester->pos.z, entity->position.x, entity->position.z)); LakilesterTweesterPhysicsPtr->radius = fabsf(dist2D(lakilester->pos.x, lakilester->pos.z, entity->position.x, entity->position.z));
LakilesterTweesterPhysicsPtr->angle = atan2(entity->position.x, entity->position.z, lakilester->pos.x, lakilester->pos.z); LakilesterTweesterPhysicsPtr->angle = atan2(entity->position.x, entity->position.z, lakilester->pos.x, lakilester->pos.z);
@ -112,7 +112,7 @@ ApiStatus func_802BD2D4_320E24(Evt* script, s32 isInitialCall) {
LakilesterTweesterPhysicsPtr->countdown = 120; LakilesterTweesterPhysicsPtr->countdown = 120;
lakilester->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; lakilester->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8;
lakilester->flags &= ~NPC_FLAG_GRAVITY; lakilester->flags &= ~NPC_FLAG_GRAVITY;
case 1: case TWEESTER_PARTNER_ATTRACT:
sin_cos_rad(DEG_TO_RAD(LakilesterTweesterPhysicsPtr->angle), &sinAngle, &cosAngle); sin_cos_rad(DEG_TO_RAD(LakilesterTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);
lakilester->pos.x = entity->position.x + (sinAngle * LakilesterTweesterPhysicsPtr->radius); lakilester->pos.x = entity->position.x + (sinAngle * LakilesterTweesterPhysicsPtr->radius);
lakilester->pos.z = entity->position.z - (cosAngle * LakilesterTweesterPhysicsPtr->radius); lakilester->pos.z = entity->position.z - (cosAngle * LakilesterTweesterPhysicsPtr->radius);
@ -143,17 +143,17 @@ ApiStatus func_802BD2D4_320E24(Evt* script, s32 isInitialCall) {
LakilesterTweesterPhysicsPtr->state++; LakilesterTweesterPhysicsPtr->state++;
} }
break; break;
case 2: case TWEESTER_PARTNER_HOLD:
lakilester->flags = LakilesterTweesterPhysicsPtr->prevFlags; lakilester->flags = LakilesterTweesterPhysicsPtr->prevFlags;
LakilesterTweesterPhysicsPtr->countdown = 30; LakilesterTweesterPhysicsPtr->countdown = 30;
LakilesterTweesterPhysicsPtr->state++; LakilesterTweesterPhysicsPtr->state++;
break; break;
case 3: case TWEESTER_PARTNER_RELEASE:
partner_flying_update_player_tracking(lakilester); partner_flying_update_player_tracking(lakilester);
partner_flying_update_motion(lakilester); partner_flying_update_motion(lakilester);
if (--LakilesterTweesterPhysicsPtr->countdown == 0) { if (--LakilesterTweesterPhysicsPtr->countdown == 0) {
LakilesterTweesterPhysicsPtr->state = 0; LakilesterTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
} }
break; break;
@ -167,11 +167,11 @@ EvtScript world_lakilester_update = {
EVT_END EVT_END
}; };
void func_802BD678_3211C8(Npc* npc) { void lakilester_try_cancel_tweester(Npc* npc) {
if (TweesterTouchingPartner != NULL) { if (TweesterTouchingPartner != NULL) {
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
npc->flags = LakilesterTweesterPhysicsPtr->prevFlags; npc->flags = LakilesterTweesterPhysicsPtr->prevFlags;
LakilesterTweesterPhysicsPtr->state = 0; LakilesterTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
partner_clear_player_tracking(npc); partner_clear_player_tracking(npc);
} }
} }
@ -270,13 +270,20 @@ s32 func_802BD99C_3214EC(Npc* partner, f32 yOffset, f32 zOffset) {
} }
void func_802BDA90_3215E0(Npc* lakilester) { void func_802BDA90_3215E0(Npc* lakilester) {
f32 temp_f20 = lakilester->collisionRadius * 0.8f; f32 radius = lakilester->collisionRadius * 0.8f;
f32 temp_f0 = clamp_angle(lakilester->yaw); f32 x, y, z, yaw;
f32 x = lakilester->pos.x;
f32 y = lakilester->moveToPos.y;
f32 z = lakilester->pos.z;
if (npc_test_move_complex_with_slipping(lakilester->collisionChannel, &x, &y, &z, 0.0f, temp_f0, lakilester->collisionHeight, temp_f20)) { // combine testing boilerplate
#define TEST_MOVE_AT_ANGLE(testFunc, angle) \
( \
yaw = clamp_angle(angle), \
x = lakilester->pos.x, \
y = lakilester->moveToPos.y, \
z = lakilester->pos.z, \
testFunc(lakilester->collisionChannel, &x, &y, &z, 0.0f, yaw, lakilester->collisionHeight, radius) \
)
if (TEST_MOVE_AT_ANGLE(npc_test_move_complex_with_slipping, lakilester->yaw)) {
lakilester->flags |= (NPC_FLAG_COLLDING_FORWARD_WITH_WORLD | NPC_FLAG_COLLDING_WITH_WORLD); lakilester->flags |= (NPC_FLAG_COLLDING_FORWARD_WITH_WORLD | NPC_FLAG_COLLDING_WITH_WORLD);
lakilester->currentWall = NpcHitQueryColliderID; lakilester->currentWall = NpcHitQueryColliderID;
lakilester->pos.x = x; lakilester->pos.x = x;
@ -285,12 +292,7 @@ void func_802BDA90_3215E0(Npc* lakilester) {
lakilester->flags &= ~(NPC_FLAG_COLLDING_FORWARD_WITH_WORLD | NPC_FLAG_COLLDING_WITH_WORLD); lakilester->flags &= ~(NPC_FLAG_COLLDING_FORWARD_WITH_WORLD | NPC_FLAG_COLLDING_WITH_WORLD);
} }
temp_f0 = clamp_angle(lakilester->yaw + 45.0f); if (TEST_MOVE_AT_ANGLE(npc_test_move_taller_with_slipping, lakilester->yaw + 45.0f)) {
x = lakilester->pos.x;
y = lakilester->moveToPos.y;
z = lakilester->pos.z;
if (npc_test_move_taller_with_slipping(lakilester->collisionChannel, &x, &y, &z, 0.0f, temp_f0, lakilester->collisionHeight, temp_f20)) {
lakilester->pos.x = x; lakilester->pos.x = x;
lakilester->pos.z = z; lakilester->pos.z = z;
lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD; lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
@ -298,12 +300,7 @@ void func_802BDA90_3215E0(Npc* lakilester) {
lakilester->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD; lakilester->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
} }
temp_f0 = clamp_angle(lakilester->yaw - 45.0f); if (TEST_MOVE_AT_ANGLE(npc_test_move_taller_with_slipping, lakilester->yaw - 45.0f)) {
x = lakilester->pos.x;
y = lakilester->moveToPos.y;
z = lakilester->pos.z;
if (npc_test_move_taller_with_slipping(lakilester->collisionChannel, &x, &y, &z, 0.0f, temp_f0, lakilester->collisionHeight, temp_f20)) {
lakilester->pos.x = x; lakilester->pos.x = x;
lakilester->pos.z = z; lakilester->pos.z = z;
lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD; lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
@ -311,12 +308,7 @@ void func_802BDA90_3215E0(Npc* lakilester) {
lakilester->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD; lakilester->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
} }
temp_f0 = clamp_angle(lakilester->yaw + 45.0f + 180.0f); if (TEST_MOVE_AT_ANGLE(npc_test_move_simple_with_slipping, lakilester->yaw + 45.0f + 180.0f)) {
x = lakilester->pos.x;
y = lakilester->moveToPos.y;
z = lakilester->pos.z;
if (npc_test_move_simple_with_slipping(lakilester->collisionChannel, &x, &y, &z, 0.0f, temp_f0, lakilester->collisionHeight, temp_f20)) {
lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD; lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
lakilester->pos.x = x; lakilester->pos.x = x;
lakilester->pos.z = z; lakilester->pos.z = z;
@ -324,12 +316,7 @@ void func_802BDA90_3215E0(Npc* lakilester) {
lakilester->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD; lakilester->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
} }
temp_f0 = clamp_angle(lakilester->yaw - 45.0f + 180.0f); if (TEST_MOVE_AT_ANGLE(npc_test_move_simple_with_slipping, lakilester->yaw - 45.0f + 180.0f)) {
x = lakilester->pos.x;
y = lakilester->moveToPos.y;
z = lakilester->pos.z;
if (npc_test_move_simple_with_slipping(lakilester->collisionChannel, &x, &y, &z, 0.0f, temp_f0, lakilester->collisionHeight, temp_f20)) {
lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD; lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
lakilester->pos.x = x; lakilester->pos.x = x;
lakilester->pos.z = z; lakilester->pos.z = z;
@ -535,7 +522,7 @@ s32 func_802BE6A0_3221F0(f32* arg0) {
&hitDirX, &hitDirZ); &hitDirX, &hitDirZ);
} }
ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { API_CALLABLE(LakilesterUseAbility) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus; PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus;
Camera* camera = &gCameras[CAM_DEFAULT]; Camera* camera = &gCameras[CAM_DEFAULT];
@ -548,15 +535,16 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
playerStatus->animFlags &= ~PA_FLAG_RIDING_PARTNER; playerStatus->animFlags &= ~PA_FLAG_RIDING_PARTNER;
if (isInitialCall) { if (isInitialCall) {
func_802BD678_3211C8(npc); lakilester_try_cancel_tweester(npc);
if (!(playerStatus->animFlags & PA_FLAG_CHANGING_MAP)) { if (!(playerStatus->animFlags & PA_FLAG_CHANGING_MAP)) {
npc->flags = npc->flags & ~PA_FLAG_40; npc->flags = npc->flags & ~PA_FLAG_PULSE_STONE_VISIBLE;
npc->moveToPos.x = npc->pos.x; npc->moveToPos.x = npc->pos.x;
npc->moveToPos.y = npc->pos.y; npc->moveToPos.y = npc->pos.y;
npc->moveToPos.z = npc->pos.z; npc->moveToPos.z = npc->pos.z;
if (gGameStatusPtr->keepUsingPartnerOnMapChange || if (gGameStatusPtr->keepUsingPartnerOnMapChange
(playerStatus->animFlags & PA_FLAG_PARTNER_USAGE_FORCED)) { || (playerStatus->animFlags & PA_FLAG_PARTNER_USAGE_FORCED)
) {
if (playerStatus->animFlags & PA_FLAG_PARTNER_USAGE_FORCED) { if (playerStatus->animFlags & PA_FLAG_PARTNER_USAGE_FORCED) {
playerStatus->animFlags &= ~PA_FLAG_PARTNER_USAGE_FORCED; playerStatus->animFlags &= ~PA_FLAG_PARTNER_USAGE_FORCED;
} }
@ -567,12 +555,12 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
if (partnerActionStatus->partnerAction_unk_1 == 0) { if (partnerActionStatus->partnerAction_unk_1 == 0) {
if (gGameStatusPtr->keepUsingPartnerOnMapChange == FALSE) { if (gGameStatusPtr->keepUsingPartnerOnMapChange == FALSE) {
if (playerStatus->actionState == ACTION_STATE_RIDE || if (playerStatus->actionState == ACTION_STATE_RIDE
playerStatus->actionState == ACTION_STATE_IDLE || || playerStatus->actionState == ACTION_STATE_IDLE
playerStatus->actionState == ACTION_STATE_WALK || || playerStatus->actionState == ACTION_STATE_WALK
playerStatus->actionState == ACTION_STATE_RUN || || playerStatus->actionState == ACTION_STATE_RUN
playerStatus->actionState == ACTION_STATE_FALLING) { || playerStatus->actionState == ACTION_STATE_FALLING
) {
playerStatus->flags |= PS_FLAG_PAUSE_DISABLED; playerStatus->flags |= PS_FLAG_PAUSE_DISABLED;
} else { } else {
return ApiStatus_DONE2; return ApiStatus_DONE2;
@ -622,7 +610,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
switch (D_802BFF14) { switch (D_802BFF14) {
case 40: case 40:
if (playerStatus->flags & PS_FLAG_HIT_FIRE || if (playerStatus->flags & PS_FLAG_HIT_FIRE ||
playerStatus->inputEnabledCounter) { playerStatus->inputDisabledCount) {
playerStatus->flags &= ~PS_FLAG_PAUSE_DISABLED; playerStatus->flags &= ~PS_FLAG_PAUSE_DISABLED;
return ApiStatus_DONE2; return ApiStatus_DONE2;
@ -643,7 +631,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
} }
if (playerStatus->animFlags & PA_FLAG_CHANGING_MAP) { if (playerStatus->animFlags & PA_FLAG_CHANGING_MAP) {
if (script->functionTemp[2] < playerStatus->inputEnabledCounter) { if (script->functionTemp[2] < playerStatus->inputDisabledCount) {
enable_player_input(); enable_player_input();
D_802BFF04 = 0; D_802BFF04 = 0;
} }
@ -652,7 +640,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
} }
if (script->functionTemp[1] == 0) { if (script->functionTemp[1] == 0) {
if (script->functionTemp[2] < playerStatus->inputEnabledCounter) { if (script->functionTemp[2] < playerStatus->inputDisabledCount) {
enable_player_input(); enable_player_input();
D_802BFF04 = 0; D_802BFF04 = 0;
playerStatus->flags &= ~PS_FLAG_PAUSE_DISABLED; playerStatus->flags &= ~PS_FLAG_PAUSE_DISABLED;
@ -919,8 +907,8 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
} }
EvtScript world_lakilester_use_ability = { EvtScript EVS_LakilesterUseAbility = {
EVT_CALL(func_802BE724_322274) EVT_CALL(LakilesterUseAbility)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };

View File

@ -10,7 +10,7 @@ void world_lakilester_post_battle(Npc*);
extern EvtScript world_lakilester_take_out; extern EvtScript world_lakilester_take_out;
extern EvtScript world_lakilester_update; extern EvtScript world_lakilester_update;
extern EvtScript world_lakilester_use_ability; extern EvtScript EVS_LakilesterUseAbility;
extern EvtScript world_lakilester_put_away; extern EvtScript world_lakilester_put_away;
extern EvtScript world_lakilester_while_riding; extern EvtScript world_lakilester_while_riding;

View File

@ -61,8 +61,8 @@ ApiStatus ParakarryUpdate(Evt* script, s32 isInitialCall) {
} }
switch (ParakarryTweesterPhysicsPtr->state) { switch (ParakarryTweesterPhysicsPtr->state) {
case 0: case TWEESTER_PARTNER_INIT:
ParakarryTweesterPhysicsPtr->state = 1; ParakarryTweesterPhysicsPtr->state++;
ParakarryTweesterPhysicsPtr->prevFlags = parakarry->flags; ParakarryTweesterPhysicsPtr->prevFlags = parakarry->flags;
ParakarryTweesterPhysicsPtr->radius = fabsf(dist2D(parakarry->pos.x, parakarry->pos.z, ParakarryTweesterPhysicsPtr->radius = fabsf(dist2D(parakarry->pos.x, parakarry->pos.z,
entity->position.x, entity->position.z)); entity->position.x, entity->position.z));
@ -73,7 +73,7 @@ ApiStatus ParakarryUpdate(Evt* script, s32 isInitialCall) {
ParakarryTweesterPhysicsPtr->countdown = 120; ParakarryTweesterPhysicsPtr->countdown = 120;
parakarry->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; parakarry->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8;
parakarry->flags &= ~NPC_FLAG_GRAVITY; parakarry->flags &= ~NPC_FLAG_GRAVITY;
case 1: case TWEESTER_PARTNER_ATTRACT:
sin_cos_rad(DEG_TO_RAD(ParakarryTweesterPhysicsPtr->angle), &sinAngle, &cosAngle); sin_cos_rad(DEG_TO_RAD(ParakarryTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);
parakarry->pos.x = entity->position.x + (sinAngle * ParakarryTweesterPhysicsPtr->radius); parakarry->pos.x = entity->position.x + (sinAngle * ParakarryTweesterPhysicsPtr->radius);
parakarry->pos.z = entity->position.z - (cosAngle * ParakarryTweesterPhysicsPtr->radius); parakarry->pos.z = entity->position.z - (cosAngle * ParakarryTweesterPhysicsPtr->radius);
@ -104,17 +104,17 @@ ApiStatus ParakarryUpdate(Evt* script, s32 isInitialCall) {
ParakarryTweesterPhysicsPtr->state++; ParakarryTweesterPhysicsPtr->state++;
} }
break; break;
case 2: case TWEESTER_PARTNER_HOLD:
parakarry->flags = ParakarryTweesterPhysicsPtr->prevFlags; parakarry->flags = ParakarryTweesterPhysicsPtr->prevFlags;
ParakarryTweesterPhysicsPtr->countdown = 30; ParakarryTweesterPhysicsPtr->countdown = 30;
ParakarryTweesterPhysicsPtr->state++; ParakarryTweesterPhysicsPtr->state++;
break; break;
case 3: case TWEESTER_PARTNER_RELEASE:
partner_flying_update_player_tracking(parakarry); partner_flying_update_player_tracking(parakarry);
partner_flying_update_motion(parakarry); partner_flying_update_motion(parakarry);
if (--ParakarryTweesterPhysicsPtr->countdown == 0) { if (--ParakarryTweesterPhysicsPtr->countdown == 0) {
ParakarryTweesterPhysicsPtr->state = 0; ParakarryTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
} }
break; break;
@ -132,7 +132,7 @@ void func_802BD514_319A84(Npc* parakarry) {
if (TweesterTouchingPartner) { if (TweesterTouchingPartner) {
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
parakarry->flags = ParakarryTweesterPhysicsPtr->prevFlags; parakarry->flags = ParakarryTweesterPhysicsPtr->prevFlags;
ParakarryTweesterPhysicsPtr->state = 0; ParakarryTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
partner_clear_player_tracking (parakarry); partner_clear_player_tracking (parakarry);
} }
} }
@ -207,16 +207,16 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) {
switch (D_802BEBC0_31CBE0) { switch (D_802BEBC0_31CBE0) {
case 40: case 40:
if (playerStatus->inputEnabledCounter == 0) { if (playerStatus->inputDisabledCount == 0) {
D_802BEBC4 = 3; D_802BEBC4 = 3;
D_802BEBC0_31CBE0 = 41; D_802BEBC0_31CBE0 = 41;
evt->functionTemp[2] = playerStatus->inputEnabledCounter; evt->functionTemp[2] = playerStatus->inputDisabledCount;
} else { } else {
goto block_end_return_ApiStatus_DONE2; // TODO remove this goto goto block_end_return_ApiStatus_DONE2; // TODO remove this goto
} }
case 41: case 41:
if (D_802BEBC4 == 0) { if (D_802BEBC4 == 0) {
if (evt->functionTemp[2] >= playerStatus->inputEnabledCounter) { if (evt->functionTemp[2] >= playerStatus->inputDisabledCount) {
if (func_800EA52C(PARTNER_PARAKARRY)) { if (func_800EA52C(PARTNER_PARAKARRY)) {
D_802BEBC0_31CBE0 = 30; D_802BEBC0_31CBE0 = 30;
break; break;
@ -233,7 +233,7 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) {
set_action_state(ACTION_STATE_RIDE); set_action_state(ACTION_STATE_RIDE);
disable_player_input(); disable_player_input();
disable_player_static_collisions(); disable_player_static_collisions();
evt->functionTemp[2] = playerStatus->inputEnabledCounter; evt->functionTemp[2] = playerStatus->inputDisabledCount;
D_802BEBB4 = 1; D_802BEBB4 = 1;
D_802BEBB8 = 1; D_802BEBB8 = 1;
D_802BEBB0 = 1; D_802BEBB0 = 1;
@ -271,7 +271,7 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) {
parakarry->pos.z += (parakarry->moveToPos.z - parakarry->pos.z) / parakarry->duration; parakarry->pos.z += (parakarry->moveToPos.z - parakarry->pos.z) / parakarry->duration;
parakarry->duration--; parakarry->duration--;
if (parakarry->duration != 0) { if (parakarry->duration != 0) {
if (evt->functionTemp[2] < playerStatus->inputEnabledCounter) { if (evt->functionTemp[2] < playerStatus->inputDisabledCount) {
disable_npc_blur(parakarry); disable_npc_blur(parakarry);
D_802BEBC0_31CBE0 = 0x16; D_802BEBC0_31CBE0 = 0x16;
} }

View File

@ -733,8 +733,8 @@ ApiStatus SushieUpdate(Evt* script, s32 isInitialCall) {
} }
switch (SushieTweesterPhysicsPtr->state) { switch (SushieTweesterPhysicsPtr->state) {
case 0: case TWEESTER_PARTNER_INIT:
SushieTweesterPhysicsPtr->state = 1; SushieTweesterPhysicsPtr->state++;
SushieTweesterPhysicsPtr->prevFlags = sushie->flags; SushieTweesterPhysicsPtr->prevFlags = sushie->flags;
SushieTweesterPhysicsPtr->radius = fabsf(dist2D(sushie->pos.x, sushie->pos.z, SushieTweesterPhysicsPtr->radius = fabsf(dist2D(sushie->pos.x, sushie->pos.z,
entity->position.x, entity->position.z)); entity->position.x, entity->position.z));
@ -744,7 +744,7 @@ ApiStatus SushieUpdate(Evt* script, s32 isInitialCall) {
SushieTweesterPhysicsPtr->countdown = 120; SushieTweesterPhysicsPtr->countdown = 120;
sushie->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; sushie->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8;
sushie->flags &= ~NPC_FLAG_GRAVITY; sushie->flags &= ~NPC_FLAG_GRAVITY;
case 1: case TWEESTER_PARTNER_ATTRACT:
sin_cos_rad(DEG_TO_RAD(SushieTweesterPhysicsPtr->angle), &sinAngle, &cosAngle); sin_cos_rad(DEG_TO_RAD(SushieTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);
sushie->pos.x = entity->position.x + (sinAngle * SushieTweesterPhysicsPtr->radius); sushie->pos.x = entity->position.x + (sinAngle * SushieTweesterPhysicsPtr->radius);
sushie->pos.z = entity->position.z - (cosAngle * SushieTweesterPhysicsPtr->radius); sushie->pos.z = entity->position.z - (cosAngle * SushieTweesterPhysicsPtr->radius);
@ -775,17 +775,17 @@ ApiStatus SushieUpdate(Evt* script, s32 isInitialCall) {
SushieTweesterPhysicsPtr->state++; SushieTweesterPhysicsPtr->state++;
} }
break; break;
case 2: case TWEESTER_PARTNER_HOLD:
sushie->flags = SushieTweesterPhysicsPtr->prevFlags; sushie->flags = SushieTweesterPhysicsPtr->prevFlags;
SushieTweesterPhysicsPtr->countdown = 30; SushieTweesterPhysicsPtr->countdown = 30;
SushieTweesterPhysicsPtr->state++; SushieTweesterPhysicsPtr->state++;
break; break;
case 3: case TWEESTER_PARTNER_RELEASE:
partner_walking_update_player_tracking(sushie); partner_walking_update_player_tracking(sushie);
partner_walking_update_motion(sushie); partner_walking_update_motion(sushie);
if (--SushieTweesterPhysicsPtr->countdown == 0) { if (--SushieTweesterPhysicsPtr->countdown == 0) {
SushieTweesterPhysicsPtr->state = 0; SushieTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
} }
break; break;
@ -804,7 +804,7 @@ void func_802BF920_320690(Npc* sushie) {
if (TweesterTouchingPartner != NULL) { if (TweesterTouchingPartner != NULL) {
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
sushie->flags = SushieTweesterPhysicsPtr->prevFlags; sushie->flags = SushieTweesterPhysicsPtr->prevFlags;
SushieTweesterPhysicsPtr->state = 0; SushieTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
partner_clear_player_tracking(sushie); partner_clear_player_tracking(sushie);
} }
} }

View File

@ -7,17 +7,21 @@ void world_twink_init(Npc* twink) {
twink->collisionRadius = 20; twink->collisionRadius = 20;
} }
ApiStatus TwinkTakeOut(Evt* script, s32 isInitialCall) { API_CALLABLE(TwinkTakeOut) {
Npc* twink = script->owner2.npc; Npc* twink = script->owner2.npc;
if (isInitialCall) { if (isInitialCall) {
partner_init_get_out(twink); partner_init_get_out(twink);
} }
return partner_get_out(twink) ? ApiStatus_DONE1 : ApiStatus_BLOCK; if(partner_get_out(twink)) {
return ApiStatus_DONE1;
} else {
return ApiStatus_BLOCK;
}
} }
ApiStatus TwinkUpdate(Evt* script, s32 isInitialCall) { API_CALLABLE(TwinkUpdate) {
PlayerData* playerData = &gPlayerData; PlayerData* playerData = &gPlayerData;
Npc* twink = script->owner2.npc; Npc* twink = script->owner2.npc;
@ -32,39 +36,43 @@ ApiStatus TwinkUpdate(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
} }
ApiStatus TwinkUseAbility(Evt* script, s32 isInitialCall) { API_CALLABLE(TwinkUseAbility) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus TwinkPutAway(Evt* script, s32 isInitialCall) { API_CALLABLE(TwinkPutAway) {
Npc* twink = script->owner2.npc; Npc* twink = script->owner2.npc;
if (isInitialCall) { if (isInitialCall) {
partner_init_put_away(twink); partner_init_put_away(twink);
} }
return partner_put_away(twink) ? ApiStatus_DONE1 : ApiStatus_BLOCK; if(partner_put_away(twink)) {
return ApiStatus_DONE1;
} else {
return ApiStatus_BLOCK;
}
} }
EvtScript world_twink_take_out = { EvtScript EVS_TwinkTakeOut = {
EVT_CALL(TwinkTakeOut) EVT_CALL(TwinkTakeOut)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
EvtScript world_twink_update = { EvtScript EVS_TwinkUpdate = {
EVT_CALL(TwinkUpdate) EVT_CALL(TwinkUpdate)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
EvtScript world_twink_use_ability = { EvtScript EVS_TwinkUseAbility = {
EVT_CALL(TwinkUseAbility) EVT_CALL(TwinkUseAbility)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };
EvtScript world_twink_put_away = { EvtScript EVS_TwinkPutAway = {
EVT_CALL(TwinkPutAway) EVT_CALL(TwinkPutAway)
EVT_RETURN EVT_RETURN
EVT_END EVT_END

View File

@ -6,9 +6,9 @@
void world_twink_init(Npc* partner); void world_twink_init(Npc* partner);
extern EvtScript world_twink_take_out; extern EvtScript EVS_TwinkTakeOut;
extern EvtScript world_twink_update; extern EvtScript EVS_TwinkUpdate;
extern EvtScript world_twink_use_ability; extern EvtScript EVS_TwinkUseAbility;
extern EvtScript world_twink_put_away; extern EvtScript EVS_TwinkPutAway;
#endif #endif

View File

@ -127,8 +127,8 @@ ApiStatus WattUpdate(Evt* script, s32 isInitialCall) {
} }
switch (WattTweesterPhysicsPtr->state) { switch (WattTweesterPhysicsPtr->state) {
case 0: case TWEESTER_PARTNER_INIT:
WattTweesterPhysicsPtr->state = 1; WattTweesterPhysicsPtr->state++;
WattTweesterPhysicsPtr->prevFlags = watt->flags; WattTweesterPhysicsPtr->prevFlags = watt->flags;
WattTweesterPhysicsPtr->radius = fabsf(dist2D(watt->pos.x, watt->pos.z, WattTweesterPhysicsPtr->radius = fabsf(dist2D(watt->pos.x, watt->pos.z,
entity->position.x, entity->position.z)); entity->position.x, entity->position.z));
@ -138,7 +138,7 @@ ApiStatus WattUpdate(Evt* script, s32 isInitialCall) {
WattTweesterPhysicsPtr->countdown = 120; WattTweesterPhysicsPtr->countdown = 120;
watt->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; watt->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8;
watt->flags &= ~NPC_FLAG_GRAVITY; watt->flags &= ~NPC_FLAG_GRAVITY;
case 1: case TWEESTER_PARTNER_ATTRACT:
sin_cos_rad(DEG_TO_RAD(WattTweesterPhysicsPtr->angle), &sinAngle, &cosAngle); sin_cos_rad(DEG_TO_RAD(WattTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);
watt->pos.x = (entity->position.x + (sinAngle * WattTweesterPhysicsPtr->radius)); watt->pos.x = (entity->position.x + (sinAngle * WattTweesterPhysicsPtr->radius));
watt->pos.z = (entity->position.z - (cosAngle * WattTweesterPhysicsPtr->radius)); watt->pos.z = (entity->position.z - (cosAngle * WattTweesterPhysicsPtr->radius));
@ -169,16 +169,16 @@ ApiStatus WattUpdate(Evt* script, s32 isInitialCall) {
WattTweesterPhysicsPtr->state++; WattTweesterPhysicsPtr->state++;
} }
break; break;
case 2: case TWEESTER_PARTNER_HOLD:
watt->flags = WattTweesterPhysicsPtr->prevFlags; watt->flags = WattTweesterPhysicsPtr->prevFlags;
WattTweesterPhysicsPtr->countdown = 30; WattTweesterPhysicsPtr->countdown = 30;
WattTweesterPhysicsPtr->state++; WattTweesterPhysicsPtr->state++;
break; break;
case 3: case TWEESTER_PARTNER_RELEASE:
partner_flying_update_player_tracking(watt); partner_flying_update_player_tracking(watt);
partner_flying_update_motion(watt); partner_flying_update_motion(watt);
if (--WattTweesterPhysicsPtr->countdown == 0) { if (--WattTweesterPhysicsPtr->countdown == 0) {
WattTweesterPhysicsPtr->state = 0; WattTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
} }
break; break;
@ -203,7 +203,7 @@ void func_802BD710_31D280(Npc* watt) {
if (TweesterTouchingPartner != NULL) { if (TweesterTouchingPartner != NULL) {
TweesterTouchingPartner = NULL; TweesterTouchingPartner = NULL;
watt->flags = WattTweesterPhysicsPtr->prevFlags; watt->flags = WattTweesterPhysicsPtr->prevFlags;
WattTweesterPhysicsPtr->state = 0; WattTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
partner_clear_player_tracking(watt); partner_clear_player_tracking(watt);
} }
} }
@ -249,16 +249,16 @@ ApiStatus func_802BD754_31D2C4(Evt* script, s32 isInitialCall) {
switch (D_802BE304) { switch (D_802BE304) {
case 40: case 40:
if (playerStatus->inputEnabledCounter != 0) { if (playerStatus->inputDisabledCount != 0) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
script->functionTemp[1] = 3; script->functionTemp[1] = 3;
D_802BE304 = 41; D_802BE304 = 41;
script->functionTemp[2] = playerStatus->inputEnabledCounter; script->functionTemp[2] = playerStatus->inputDisabledCount;
break; break;
case 41: case 41:
if (script->functionTemp[1] == 0) { if (script->functionTemp[1] == 0) {
if (script->functionTemp[2] >= playerStatus->inputEnabledCounter) { if (script->functionTemp[2] >= playerStatus->inputDisabledCount) {
if (!(playerStatus->animFlags & PA_FLAG_CHANGING_MAP)) { if (!(playerStatus->animFlags & PA_FLAG_CHANGING_MAP)) {
if (func_800EA52C(PARTNER_WATT)) { if (func_800EA52C(PARTNER_WATT)) {
if (!is_starting_conversation()) { if (!is_starting_conversation()) {
@ -435,7 +435,7 @@ void world_watt_post_battle(Npc* watt) {
} }
} }
ApiStatus func_802BDE88_31D9F8(Evt* script, s32 isInitialCall) { API_CALLABLE(WattRidingUpdate) {
PartnerActionStatus* wattActionStatus = &gPartnerActionStatus; PartnerActionStatus* wattActionStatus = &gPartnerActionStatus;
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
Npc* watt = get_npc_unsafe(NPC_PARTNER); Npc* watt = get_npc_unsafe(NPC_PARTNER);
@ -466,7 +466,7 @@ ApiStatus func_802BDE88_31D9F8(Evt* script, s32 isInitialCall) {
wattActionStatus->partnerActionState = PARTNER_ACTION_WATT_SHINE; wattActionStatus->partnerActionState = PARTNER_ACTION_WATT_SHINE;
wattActionStatus->actingPartner = PARTNER_WATT; wattActionStatus->actingPartner = PARTNER_WATT;
D_802BE308 = 0; D_802BE308 = 0;
script->functionTemp[0] += 1; script->functionTemp[0]++;
break; break;
case 1: case 1:
world_watt_sync_held_position(); world_watt_sync_held_position();
@ -544,7 +544,7 @@ void world_watt_sync_held_position(void) {
} }
EvtScript world_watt_while_riding = { EvtScript world_watt_while_riding = {
EVT_CALL(func_802BDE88_31D9F8) EVT_CALL(WattRidingUpdate)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };

View File

@ -119,6 +119,13 @@ void _use_partner_ability(void);
void partner_flying_follow_player(Npc*); void partner_flying_follow_player(Npc*);
void partner_move_to_goal(Npc*, s32); void partner_move_to_goal(Npc*, s32);
typedef struct UseItemStruct {
/* 0x00 */ u8* dmaStart;
/* 0x04 */ u8* dmaEnd;
/* 0x08 */ EvtScript* main;
/* 0x0C */ s32 unk_0C;
} UseItemStruct;
// Partner icons // Partner icons
HudScript* wPartnerHudScripts[] = { HudScript* wPartnerHudScripts[] = {
&HES_Partner0, &HES_Goombario, &HES_Kooper, &HES_Bombette, &HES_Partner0, &HES_Goombario, &HES_Kooper, &HES_Bombette,
@ -169,26 +176,26 @@ f32 D_800F8034 = 0.0f;
s16 D_800F8038 = 0; s16 D_800F8038 = 0;
s16 D_800F803A = 0; s16 D_800F803A = 0;
WorldPartner wPartners[12] = { WorldPartner wPartners[] = {
{}, // None [PARTNER_NONE] {
{ // blank
// Goombario },
[PARTNER_GOOMBARIO] {
.dmaStart = &world_partner_goombario_ROM_START, .dmaStart = &world_partner_goombario_ROM_START,
.dmaEnd = &world_partner_goombario_ROM_END, .dmaEnd = &world_partner_goombario_ROM_END,
.dmaDest = &world_partner_goombario_VRAM, .dmaDest = &world_partner_goombario_VRAM,
.isFlying = FALSE, .isFlying = FALSE,
.init = world_goombario_init, .init = world_goombario_init,
.takeOut = &world_goombario_take_out, .takeOut = &EVS_GoombarioTakeOut,
.update = &world_goombario_update, .update = &EVS_GoombarioUpdate,
.useAbility = &world_goombario_use_ability, .useAbility = &EVS_GoombarioUseAbility,
.putAway = &world_goombario_put_away, .putAway = &EVS_GoombarioPutAway,
.idle = ANIM_WorldGoombario_Idle, .idle = ANIM_WorldGoombario_Idle,
.canUseAbility = world_goombario_can_pause, .canUseAbility = world_goombario_can_pause,
.canPlayerPause = world_goombario_can_pause, .canPlayerPause = world_goombario_can_pause,
.preBattle = world_goombario_pre_battle, .preBattle = world_goombario_pre_battle,
}, },
{ [PARTNER_KOOPER] {
// Kooper
.dmaStart = &world_partner_kooper_ROM_START, .dmaStart = &world_partner_kooper_ROM_START,
.dmaEnd = &world_partner_kooper_ROM_END, .dmaEnd = &world_partner_kooper_ROM_END,
.dmaDest = &world_partner_kooper_VRAM, .dmaDest = &world_partner_kooper_VRAM,
@ -205,8 +212,7 @@ WorldPartner wPartners[12] = {
.preBattle = world_kooper_pre_battle, .preBattle = world_kooper_pre_battle,
.postBattle = world_kooper_post_battle, .postBattle = world_kooper_post_battle,
}, },
{ [PARTNER_BOMBETTE] {
// Bombette
.dmaStart = &world_partner_bombette_ROM_START, .dmaStart = &world_partner_bombette_ROM_START,
.dmaEnd = &world_partner_bombette_ROM_END, .dmaEnd = &world_partner_bombette_ROM_END,
.dmaDest = &world_partner_bombette_VRAM, .dmaDest = &world_partner_bombette_VRAM,
@ -222,8 +228,7 @@ WorldPartner wPartners[12] = {
.canPlayerPause = world_bombette_can_player_pause, .canPlayerPause = world_bombette_can_player_pause,
.preBattle = world_bombette_pre_battle, .preBattle = world_bombette_pre_battle,
}, },
{ [PARTNER_PARAKARRY] {
// Parakarry
.dmaStart = &world_partner_parakarry_ROM_START, .dmaStart = &world_partner_parakarry_ROM_START,
.dmaEnd = &world_partner_parakarry_ROM_END, .dmaEnd = &world_partner_parakarry_ROM_END,
.dmaDest = &world_partner_parakarry_VRAM, .dmaDest = &world_partner_parakarry_VRAM,
@ -238,21 +243,19 @@ WorldPartner wPartners[12] = {
.preBattle = world_parakarry_pre_battle, .preBattle = world_parakarry_pre_battle,
.postBattle = world_parakarry_post_battle, .postBattle = world_parakarry_post_battle,
}, },
{ [PARTNER_GOOMPA] {
// Goompa
.dmaStart = &world_partner_goompa_ROM_START, .dmaStart = &world_partner_goompa_ROM_START,
.dmaEnd = &world_partner_goompa_ROM_END, .dmaEnd = &world_partner_goompa_ROM_END,
.dmaDest = &world_partner_goompa_VRAM, .dmaDest = &world_partner_goompa_VRAM,
.isFlying = FALSE, .isFlying = FALSE,
.init = world_goompa_init, .init = world_goompa_init,
.takeOut = &world_goompa_take_out, .takeOut = &EVS_WorldGoompaTakeOut,
.update = &world_goompa_update, .update = &EVS_WorldGoompaUpdate,
.useAbility = &world_goompa_use_ability, .useAbility = &EVS_WorldGoompaUseAbility,
.putAway = &world_goompa_put_away, .putAway = &EVS_WorldGoompaPutAway,
.idle = ANIM_Goompa_Idle, .idle = ANIM_Goompa_Idle,
}, },
{ [PARTNER_WATT] {
// Watt
.dmaStart = &world_partner_watt_ROM_START, .dmaStart = &world_partner_watt_ROM_START,
.dmaEnd = &world_partner_watt_ROM_END, .dmaEnd = &world_partner_watt_ROM_END,
.dmaDest = &world_partner_watt_VRAM, .dmaDest = &world_partner_watt_VRAM,
@ -268,8 +271,7 @@ WorldPartner wPartners[12] = {
.postBattle = world_watt_post_battle, .postBattle = world_watt_post_battle,
.whileRiding = &world_watt_while_riding, .whileRiding = &world_watt_while_riding,
}, },
{ [PARTNER_SUSHIE] {
// Sushie
.dmaStart = &world_partner_sushie_ROM_START, .dmaStart = &world_partner_sushie_ROM_START,
.dmaEnd = &world_partner_sushie_ROM_END, .dmaEnd = &world_partner_sushie_ROM_END,
.dmaDest = &world_partner_sushie_VRAM, .dmaDest = &world_partner_sushie_VRAM,
@ -285,8 +287,7 @@ WorldPartner wPartners[12] = {
.postBattle = world_sushie_post_battle, .postBattle = world_sushie_post_battle,
.whileRiding = &world_sushie_while_riding, .whileRiding = &world_sushie_while_riding,
}, },
{ [PARTNER_LAKILESTER] {
// Lakilester
.dmaStart = &world_partner_lakilester_ROM_START, .dmaStart = &world_partner_lakilester_ROM_START,
.dmaEnd = &world_partner_lakilester_ROM_END, .dmaEnd = &world_partner_lakilester_ROM_END,
.dmaDest = &world_partner_lakilester_VRAM, .dmaDest = &world_partner_lakilester_VRAM,
@ -294,7 +295,7 @@ WorldPartner wPartners[12] = {
.init = world_lakilester_init, .init = world_lakilester_init,
.takeOut = &world_lakilester_take_out, .takeOut = &world_lakilester_take_out,
.update = &world_lakilester_update, .update = &world_lakilester_update,
.useAbility = &world_lakilester_use_ability, .useAbility = &EVS_LakilesterUseAbility,
.putAway = &world_lakilester_put_away, .putAway = &world_lakilester_put_away,
.idle = ANIM_WorldLakilester_Idle, .idle = ANIM_WorldLakilester_Idle,
.canPlayerPause = world_partner_can_player_pause_default, .canPlayerPause = world_partner_can_player_pause_default,
@ -302,8 +303,7 @@ WorldPartner wPartners[12] = {
.postBattle = world_lakilester_post_battle, .postBattle = world_lakilester_post_battle,
.whileRiding = &world_lakilester_while_riding, .whileRiding = &world_lakilester_while_riding,
}, },
{ [PARTNER_BOW] {
// Bow
.dmaStart = &world_partner_bow_ROM_START, .dmaStart = &world_partner_bow_ROM_START,
.dmaEnd = &world_partner_bow_ROM_END, .dmaEnd = &world_partner_bow_ROM_END,
.dmaDest = &world_partner_bow_VRAM, .dmaDest = &world_partner_bow_VRAM,
@ -318,32 +318,30 @@ WorldPartner wPartners[12] = {
.canPlayerPause = world_partner_can_player_pause_default, .canPlayerPause = world_partner_can_player_pause_default,
.preBattle = world_bow_pre_battle, .preBattle = world_bow_pre_battle,
}, },
{ [PARTNER_GOOMBARIA] {
// Goombaria
.dmaStart = &world_partner_goombaria_ROM_START, .dmaStart = &world_partner_goombaria_ROM_START,
.dmaEnd = &world_partner_goombaria_ROM_END, .dmaEnd = &world_partner_goombaria_ROM_END,
.dmaDest = &world_partner_goombaria_VRAM, .dmaDest = &world_partner_goombaria_VRAM,
.isFlying = FALSE, .isFlying = FALSE,
.init = world_goombaria_init, .init = world_goombaria_init,
.takeOut = &world_goombaria_take_out, .takeOut = &EVS_WorldGoombariaTakeOut,
.update = &world_goombaria_update, .update = &EVS_WorldGoombariaUpdate,
.useAbility = &world_goombaria_use_ability, .useAbility = &EVS_WorldGoombariaUseAbility,
.putAway = &world_goombaria_put_away, .putAway = &EVS_WorldGoombariaPutAway,
.idle = ANIM_Goombaria_Idle, .idle = ANIM_Goombaria_Idle,
.canUseAbility = partner_is_idle, .canUseAbility = partner_is_idle,
.canPlayerPause = partner_is_idle, .canPlayerPause = partner_is_idle,
}, },
{ [PARTNER_TWINK] {
// Twink
.dmaStart = &world_partner_twink_ROM_START, .dmaStart = &world_partner_twink_ROM_START,
.dmaEnd = &world_partner_twink_ROM_END, .dmaEnd = &world_partner_twink_ROM_END,
.dmaDest = &world_partner_twink_VRAM, .dmaDest = &world_partner_twink_VRAM,
.isFlying = TRUE, .isFlying = TRUE,
.init = world_twink_init, .init = world_twink_init,
.takeOut = &world_twink_take_out, .takeOut = &EVS_TwinkTakeOut,
.update = &world_twink_update, .update = &EVS_TwinkUpdate,
.useAbility = &world_twink_use_ability, .useAbility = &EVS_TwinkUseAbility,
.putAway = &world_twink_put_away, .putAway = &EVS_TwinkPutAway,
.idle = ANIM_Twink_Idle, .idle = ANIM_Twink_Idle,
.canUseAbility = partner_is_idle, .canUseAbility = partner_is_idle,
.canPlayerPause = partner_is_idle, .canPlayerPause = partner_is_idle,
@ -356,7 +354,7 @@ f32 wSavedPartnerPosZ = 0;
PartnerAnimations gPartnerAnimations[] = { PartnerAnimations gPartnerAnimations[] = {
[PARTNER_NONE] { [PARTNER_NONE] {
// all values are blank // blank
}, },
[PARTNER_GOOMBARIO] {{ [PARTNER_GOOMBARIO] {{
ANIM_WorldGoombario_Still, ANIM_WorldGoombario_Still,
@ -489,7 +487,7 @@ s32 use_consumable(s32 invSlot) {
D_8010CD20 = invSlot; D_8010CD20 = invSlot;
invSlot = gPlayerData.invItems[invSlot]; invSlot = gPlayerData.invItems[invSlot];
dma_copy(UseItemDmaArgs.dmaStart, UseItemDmaArgs.dmaEnd, world_use_item_VRAM); dma_copy(UseItemDmaArgs.dmaStart, UseItemDmaArgs.dmaEnd, world_use_item_VRAM);
script = start_script(UseItemDmaArgs.script, EVT_PRIORITY_1, 0); script = start_script(UseItemDmaArgs.main, EVT_PRIORITY_1, 0);
script->varTable[10] = invSlot; script->varTable[10] = invSlot;
return script->id; return script->id;
} }

View File

@ -3,7 +3,7 @@
typedef void (*PartnerFunc)(Npc* partner); typedef void (*PartnerFunc)(Npc* partner);
typedef s32 (*PartnerBoolFunc)(Npc* partner); typedef s32 (*PartnerBoolFunc)(Npc* partner);
typedef s32 (*PartnerUnkFunc)(Npc* partner, Npc* enemy); typedef s32 (*PartnerTesHitFunc)(Npc* partner, Npc* enemy);
typedef struct WorldPartner { typedef struct WorldPartner {
/* 0x00 */ void* dmaStart; /* 0x00 */ void* dmaStart;
@ -16,7 +16,7 @@ typedef struct WorldPartner {
/* 0x1C */ EvtScript* useAbility; /* 0x1C */ EvtScript* useAbility;
/* 0x20 */ EvtScript* putAway; /* 0x20 */ EvtScript* putAway;
/* 0x24 */ s32 idle; /* 0x24 */ s32 idle;
/* 0x28 */ PartnerUnkFunc testFirstStrike; /* 0x28 */ PartnerTesHitFunc testFirstStrike;
/* 0x2C */ PartnerBoolFunc canUseAbility; /* 0x2C */ PartnerBoolFunc canUseAbility;
/* 0x30 */ PartnerBoolFunc canPlayerPause; /* 0x30 */ PartnerBoolFunc canPlayerPause;
/* 0x34 */ PartnerFunc preBattle; /* 0x34 */ PartnerFunc preBattle;

View File

@ -813,7 +813,10 @@ if __name__ == "__main__":
shutil.rmtree(ROOT / f"assets/{version}", ignore_errors=True) shutil.rmtree(ROOT / f"assets/{version}", ignore_errors=True)
shutil.rmtree(ROOT / f"ver/{version}/assets", ignore_errors=True) shutil.rmtree(ROOT / f"ver/{version}/assets", ignore_errors=True)
shutil.rmtree(ROOT / f"ver/{version}/build", ignore_errors=True) shutil.rmtree(ROOT / f"ver/{version}/build", ignore_errors=True)
os.remove(ROOT / f"ver/{version}/.splat_cache") try:
os.remove(ROOT / f"ver/{version}/.splat_cache")
except OSError:
pass
extra_cflags = "" extra_cflags = ""
extra_cppflags = "" extra_cppflags = ""

View File

@ -5106,8 +5106,8 @@
- [0x1B, 0x000F, EntityTattle_FloorSwitch_TornadoJump] - [0x1B, 0x000F, EntityTattle_FloorSwitch_TornadoJump]
- [0x1B, 0x0010, EntityTattle_Pipe] - [0x1B, 0x0010, EntityTattle_Pipe]
- [0x1B, 0x0011, EntityTattle_PadLock] - [0x1B, 0x0011, EntityTattle_PadLock]
- [0x1B, 0x0012, EntityTattle_0012] - [0x1B, 0x0012, EntityTattle_SignPost]
- [0x1B, 0x0013, EntityTattle_Sign] - [0x1B, 0x0013, EntityTattle_ArrowSign]
- [0x1B, 0x0014, EntityTattle_BombableRock] - [0x1B, 0x0014, EntityTattle_BombableRock]
- [0x1B, 0x0015, EntityTattle_Chest] - [0x1B, 0x0015, EntityTattle_Chest]
- [0x1B, 0x0016, EntityTattle_EmptyChest] - [0x1B, 0x0016, EntityTattle_EmptyChest]
@ -5125,7 +5125,7 @@
- [0x1B, 0x0022, EntityTattle_Munchlesia] - [0x1B, 0x0022, EntityTattle_Munchlesia]
- [0x1B, 0x0023, EntityTattle_SpinningFlower] - [0x1B, 0x0023, EntityTattle_SpinningFlower]
- [0x1B, 0x0024, EntityTattle_BulbBush] - [0x1B, 0x0024, EntityTattle_BulbBush]
- [0x1B, 0x0025, EntityTattle_25] - [0x1B, 0x0025, EntityTattle_Interact]
- [0x1C, 0x0000, EnemyTattle_Goomba] - [0x1C, 0x0000, EnemyTattle_Goomba]
- [0x1C, 0x0001, EnemyTattle_SpikedGoomba] - [0x1C, 0x0001, EnemyTattle_SpikedGoomba]
- [0x1C, 0x0002, EnemyTattle_Paragoomba] - [0x1C, 0x0002, EnemyTattle_Paragoomba]

View File

@ -15571,7 +15571,7 @@ segments:
subsegments: subsegments:
- [0xE20B30, ci4, inspect_icon, 32, 32] - [0xE20B30, ci4, inspect_icon, 32, 32]
- [0xE20D30, palette, inspect_icon] - [0xE20D30, palette, inspect_icon]
- [0xE20D50, gfx, inspect_icon_dlist] - [0xE20D50, gfx, inspect_icon]
- [0xE20DC8] - [0xE20DC8]
- [0xE20DD0] - [0xE20DD0]
- type: code - type: code
@ -15587,7 +15587,7 @@ segments:
subsegments: subsegments:
- [0xE215C0, ci4, speech_bubble, 32, 32] - [0xE215C0, ci4, speech_bubble, 32, 32]
- [0xE217C0, palette, speech_bubble] - [0xE217C0, palette, speech_bubble]
- [0xE217E0, gfx, speech_bubble_dlist] - [0xE217E0, gfx, speech_bubble]
- [0xE21858] - [0xE21858]
- [0xE21860] - [0xE21860]
- type: code - type: code
@ -15601,10 +15601,10 @@ segments:
type: .data type: .data
name: pulse_stone name: pulse_stone
subsegments: subsegments:
- [0xE21EB0, ci4, pulse_stone, 56, 56] - [0xE21EB0, ci4, pulse_stone_icon, 56, 56]
- [0xE224D0, palette, pulse_stone] - [0xE224D0, palette, pulse_stone_icon]
- [0xE224F0, palette, pulse_stone.flash] - [0xE224F0, palette, pulse_stone_icon.flash]
- [0xE22510, gfx, pulse_stone_dlist] - [0xE22510, gfx, pulse_stone_icon]
- [0xE22588] - [0xE22588]
- [0xE22590] - [0xE22590]
- type: code - type: code
@ -15618,11 +15618,11 @@ segments:
type: .data type: .data
name: i_spy name: i_spy
subsegments: subsegments:
- [0xE22B30, ci4, i_spy, 56, 56] - [0xE22B30, ci4, ispy_icon, 56, 56]
- [0xE23150, palette, i_spy] - [0xE23150, palette, ispy_icon]
- [0xE23170, palette, i_spy.2] - [0xE23170, palette, ispy_icon.2]
- [0xE23190, palette, i_spy.flash] - [0xE23190, palette, ispy_icon.3]
- [0xE231B0, gfx, i_spy_dlist] - [0xE231B0, gfx, ispy_icon]
- [0xE23228] - [0xE23228]
- [0xE23230] - [0xE23230]
- type: code - type: code

View File

@ -2670,23 +2670,23 @@ func_800E01DC = 0x800E01DC; // type:func rom:0x7968C
func_800E0208 = 0x800E0208; // type:func rom:0x796B8 func_800E0208 = 0x800E0208; // type:func rom:0x796B8
player_render_interact_prompts = 0x800E0260; // type:func rom:0x79710 player_render_interact_prompts = 0x800E0260; // type:func rom:0x79710
check_for_ispy = 0x800E0294; // type:func rom:0x79744 check_for_ispy = 0x800E0294; // type:func rom:0x79744
func_800E0330 = 0x800E0330; // type:func rom:0x797E0 render_ispy_icon = 0x800E0330; // type:func rom:0x797E0
func_800E0374 = 0x800E0374; // type:func rom:0x79824 clear_ispy_icon = 0x800E0374; // type:func rom:0x79824
check_for_pulse_stone = 0x800E0398; // type:func rom:0x79848 check_for_pulse_stone = 0x800E0398; // type:func rom:0x79848
func_800E04D0 = 0x800E04D0; // type:func rom:0x79980 render_pulse_stone_icon = 0x800E04D0; // type:func rom:0x79980
func_800E0514 = 0x800E0514; // type:func rom:0x799C4 clear_pulse_stone_icon = 0x800E0514; // type:func rom:0x799C4
has_valid_conversation_npc = 0x800E0538; // type:func rom:0x799E8 has_valid_conversation_npc = 0x800E0538; // type:func rom:0x799E8
check_for_conversation_prompt = 0x800E0580; // type:func rom:0x79A30 check_for_conversation_prompt = 0x800E0580; // type:func rom:0x79A30
D_8009E6C8 = 0x8009E6C8; // type:data rom:0x79AC8 D_8009E6C8 = 0x8009E6C8; // type:data rom:0x79AC8
D_8009E6D0 = 0x8009E6D0; // type:data rom:0x79AD0 D_8009E6D0 = 0x8009E6D0; // type:data rom:0x79AD0
nuSiMesgBuf = 0x8009E6F0; // type:data rom:0x79AF0 nuSiMesgBuf = 0x8009E6F0; // type:data rom:0x79AF0
func_800E0658 = 0x800E0658; // type:func rom:0x79B08 render_conversation_prompt = 0x800E0658; // type:func rom:0x79B08
siMgrThread = 0x8009E710; // type:data rom:0x79B10 siMgrThread = 0x8009E710; // type:data rom:0x79B10
func_800E069C = 0x800E069C; // type:func rom:0x79B4C clear_conversation_prompt = 0x800E069C; // type:func rom:0x79B4C
func_800E06C0 = 0x800E06C0; // type:func rom:0x79B70 func_800E06C0 = 0x800E06C0; // type:func rom:0x79B70
func_800E06D8 = 0x800E06D8; // type:func rom:0x79B88 func_800E06D8 = 0x800E06D8; // type:func rom:0x79B88
check_for_interactables = 0x800E0818; // type:func rom:0x79CC8 check_for_interactables = 0x800E0818; // type:func rom:0x79CC8
func_800E0AD0 = 0x800E0AD0; // type:func rom:0x79F80 render_interact_prompt = 0x800E0AD0; // type:func rom:0x79F80
func_800E0B14 = 0x800E0B14; // type:func rom:0x79FC4 func_800E0B14 = 0x800E0B14; // type:func rom:0x79FC4
update_partner_timers = 0x800E0B38; // type:func rom:0x79FE8 update_partner_timers = 0x800E0B38; // type:func rom:0x79FE8
func_800E0B90 = 0x800E0B90; // type:func rom:0x7A040 func_800E0B90 = 0x800E0B90; // type:func rom:0x7A040
@ -7676,32 +7676,32 @@ shim_create_audio_system_obfuscated = 0x802B2000; // type:func rom:0x316F30
shim_load_engine_data_obfuscated = 0x802B203C; // type:func rom:0x316F6C shim_load_engine_data_obfuscated = 0x802B203C; // type:func rom:0x316F6C
shim_general_heap_create_obfuscated = 0x802B2078; // type:func rom:0x316FA8 shim_general_heap_create_obfuscated = 0x802B2078; // type:func rom:0x316FA8
shim_battle_heap_create_obfuscated = 0x802B20B4; // type:func rom:0x316FE4 shim_battle_heap_create_obfuscated = 0x802B20B4; // type:func rom:0x316FE4
func_802BD100_317020 = 0x802BD100; // type:func rom:0x317020 world_goombario_get_trigger_tattle = 0x802BD100; // type:func rom:0x317020
world_goombario_init = 0x802BD174; // type:func rom:0x317094 world_goombario_init = 0x802BD174; // type:func rom:0x317094
func_802BD188_3170A8 = 0x802BD188; // type:func rom:0x3170A8 WorldGoombarioTakeOut = 0x802BD188; // type:func rom:0x3170A8
func_802BD1D0_3170F0 = 0x802BD1D0; // type:func rom:0x3170F0 WorldGoombarioUpdate = 0x802BD1D0; // type:func rom:0x3170F0
func_802BD564_317484 = 0x802BD564; // type:func rom:0x317484 goombario_try_cancel_tweester = 0x802BD564; // type:func rom:0x317484
world_goombario_can_pause = 0x802BD5A8; // type:func rom:0x3174C8 world_goombario_can_pause = 0x802BD5A8; // type:func rom:0x3174C8
func_802BD5D8_3174F8 = 0x802BD5D8; // type:func rom:0x3174F8 WorldGoombarioSelectTattleMsg = 0x802BD5D8; // type:func rom:0x3174F8
func_802BDB30_317A50 = 0x802BDB30; // type:func rom:0x317A50 WorldGoombarioTattleEnd = 0x802BDB30; // type:func rom:0x317A50
func_802BDB84 = 0x802BDB84; // type:func rom:0x317AA4 WorldGoombarioPutAway = 0x802BDB84; // type:func rom:0x317AA4
world_goombario_pre_battle = 0x802BDBBC; // type:func rom:0x317ADC world_goombario_pre_battle = 0x802BDBBC; // type:func rom:0x317ADC
EntityTattles = 0x802BDC40; // type:data rom:0x317B60 EntityTattles = 0x802BDC40; // type:data rom:0x317B60
world_goombario_take_out = 0x802BDD6C; // type:data rom:0x317C8C EVS_GoombarioTakeOut = 0x802BDD6C; // type:data rom:0x317C8C
GoombarioTweesterPhysicsPtr = 0x802BDD88; // type:data rom:0x317CA8 GoombarioTweesterPhysicsPtr = 0x802BDD88; // type:data rom:0x317CA8
world_goombario_update = 0x802BDD8C; // type:data rom:0x317CAC EVS_GoombarioUpdate = 0x802BDD8C; // type:data rom:0x317CAC
world_goombario_use_ability = 0x802BDDA8; // type:data rom:0x317CC8 EVS_GoombarioUseAbility = 0x802BDDA8; // type:data rom:0x317CC8
world_goombario_put_away = 0x802BDE60; // type:data rom:0x317D80 EVS_GoombarioPutAway = 0x802BDE60; // type:data rom:0x317D80
D_802BDE80_317DA0 = 0x802BDE80; // type:data rom:0x317DA0 D_802BDE80_317DA0 = 0x802BDE80; // type:data rom:0x317DA0
jtbl_802BDE88_317DA8 = 0x802BDE88; // type:data rom:0x317DA8 jtbl_802BDE88_317DA8 = 0x802BDE88; // type:data rom:0x317DA8
func_802BD100_317E50 = 0x802BD100; // type:func rom:0x317E50 func_802BD100_317E50 = 0x802BD100; // type:func rom:0x317E50
D_802BDF34 = 0x802BDF34; // type:data rom:0x317E54 TattleHadInteractPrompt = 0x802BDF34; // type:data rom:0x317E54
D_802BDF38 = 0x802BDF38; // type:data rom:0x317E58 TattleInteractNpc = 0x802BDF38; // type:data rom:0x317E58
D_802BDF3C = 0x802BDF3C; // type:data rom:0x317E5C D_802BDF3C = 0x802BDF3C; // type:data rom:0x317E5C
GoombarioTweesterPhysics = 0x802BDF40; // type:data rom:0x317E60 GoombarioTweesterPhysics = 0x802BDF40; // type:data rom:0x317E60
D_802BDF5C = 0x802BDF5C; // type:data rom:0x317E7C D_802BDF5C = 0x802BDF5C; // type:data rom:0x317E7C
GoombarioGetTattleID = 0x802BDF60; // type:data rom:0x317E80 GoombarioTattleInteractionID = 0x802BDF60; // type:data rom:0x317E80
D_802BDF64 = 0x802BDF64; // type:data rom:0x317E84 WorldGoombarioTattleActive = 0x802BDF64; // type:data rom:0x317E84
world_bombette_init = 0x802BD2D8; // type:func rom:0x318028 world_bombette_init = 0x802BD2D8; // type:func rom:0x318028
func_802BD300_318050 = 0x802BD300; // type:func rom:0x318050 func_802BD300_318050 = 0x802BD300; // type:func rom:0x318050
func_802BD338_318088 = 0x802BD338; // type:func rom:0x318088 func_802BD338_318088 = 0x802BD338; // type:func rom:0x318088
@ -7797,7 +7797,7 @@ func_802BD754_31D2C4 = 0x802BD754; // type:func rom:0x31D2C4
WattPutAway = 0x802BDD0C; // type:func rom:0x31D87C WattPutAway = 0x802BDD0C; // type:func rom:0x31D87C
world_watt_pre_battle = 0x802BDD9C; // type:func rom:0x31D90C world_watt_pre_battle = 0x802BDD9C; // type:func rom:0x31D90C
world_watt_post_battle = 0x802BDE10; // type:func rom:0x31D980 world_watt_post_battle = 0x802BDE10; // type:func rom:0x31D980
func_802BDE88_31D9F8 = 0x802BDE88; // type:func rom:0x31D9F8 WattRidingUpdate = 0x802BDE88; // type:func rom:0x31D9F8
func_802BE014_31DB84 = 0x802BE014; // type:func rom:0x31DB84 func_802BE014_31DB84 = 0x802BE014; // type:func rom:0x31DB84
world_watt_sync_held_position = 0x802BE070; // type:func rom:0x31DBE0 world_watt_sync_held_position = 0x802BE070; // type:func rom:0x31DBE0
D_802BE250_31DDC0 = 0x802BE250; // type:data rom:0x31DDC0 D_802BE250_31DDC0 = 0x802BE250; // type:data rom:0x31DDC0
@ -7860,14 +7860,14 @@ SushieTweesterPhysics = 0x802BFF10; // type:data rom:0x320C80
world_lakilester_init = 0x802BD21C; // type:func rom:0x320D6C world_lakilester_init = 0x802BD21C; // type:func rom:0x320D6C
func_802BD29C_320DEC = 0x802BD29C; // type:func rom:0x320DEC func_802BD29C_320DEC = 0x802BD29C; // type:func rom:0x320DEC
func_802BD2D4_320E24 = 0x802BD2D4; // type:func rom:0x320E24 func_802BD2D4_320E24 = 0x802BD2D4; // type:func rom:0x320E24
func_802BD678_3211C8 = 0x802BD678; // type:func rom:0x3211C8 lakilester_try_cancel_tweester = 0x802BD678; // type:func rom:0x3211C8
func_802BD6BC_32120C = 0x802BD6BC; // type:func rom:0x32120C func_802BD6BC_32120C = 0x802BD6BC; // type:func rom:0x32120C
func_802BD7DC = 0x802BD7DC; // type:func rom:0x32132C func_802BD7DC = 0x802BD7DC; // type:func rom:0x32132C
func_802BD99C_3214EC = 0x802BD99C; // type:func rom:0x3214EC func_802BD99C_3214EC = 0x802BD99C; // type:func rom:0x3214EC
func_802BDA90_3215E0 = 0x802BDA90; // type:func rom:0x3215E0 func_802BDA90_3215E0 = 0x802BDA90; // type:func rom:0x3215E0
func_802BDDD8_321928 = 0x802BDDD8; // type:func rom:0x321928 func_802BDDD8_321928 = 0x802BDDD8; // type:func rom:0x321928
func_802BE6A0_3221F0 = 0x802BE6A0; // type:func rom:0x3221F0 func_802BE6A0_3221F0 = 0x802BE6A0; // type:func rom:0x3221F0
func_802BE724_322274 = 0x802BE724; // type:func rom:0x322274 LakilesterUseAbility = 0x802BE724; // type:func rom:0x322274
func_802BF4F0_323040 = 0x802BF4F0; // type:func rom:0x323040 func_802BF4F0_323040 = 0x802BF4F0; // type:func rom:0x323040
world_lakilester_pre_battle = 0x802BFA00; // type:func rom:0x323550 world_lakilester_pre_battle = 0x802BFA00; // type:func rom:0x323550
world_lakilester_post_battle = 0x802BFAA8; // type:func rom:0x3235F8 world_lakilester_post_battle = 0x802BFAA8; // type:func rom:0x3235F8
@ -7876,7 +7876,7 @@ func_802BFBA0_3236F0 = 0x802BFBA0; // type:func rom:0x3236F0
world_lakilester_take_out = 0x802BFE60; // type:data rom:0x3239B0 world_lakilester_take_out = 0x802BFE60; // type:data rom:0x3239B0
LakilesterTweesterPhysicsPtr = 0x802BFE7C; // type:data rom:0x3239CC LakilesterTweesterPhysicsPtr = 0x802BFE7C; // type:data rom:0x3239CC
world_lakilester_update = 0x802BFE80; // type:data rom:0x3239D0 world_lakilester_update = 0x802BFE80; // type:data rom:0x3239D0
world_lakilester_use_ability = 0x802BFE9C; // type:data rom:0x3239EC EVS_LakilesterUseAbility = 0x802BFE9C; // type:data rom:0x3239EC
world_lakilester_put_away = 0x802BFEB8; // type:data rom:0x323A08 world_lakilester_put_away = 0x802BFEB8; // type:data rom:0x323A08
world_lakilester_while_riding = 0x802BFED4; // type:data rom:0x323A24 world_lakilester_while_riding = 0x802BFED4; // type:data rom:0x323A24
D_802BFEF8_323A48 = 0x802BFEF8; // type:data rom:0x323A48 D_802BFEF8_323A48 = 0x802BFEF8; // type:data rom:0x323A48
@ -7913,34 +7913,34 @@ GoompaTakeOut = 0x802BD114; // type:func rom:0x324A24
D_802BE0E4 = 0x802BE0E4; // type:data rom:0x324A34 D_802BE0E4 = 0x802BE0E4; // type:data rom:0x324A34
D_802BE0E8 = 0x802BE0E8; // type:data rom:0x324A38 D_802BE0E8 = 0x802BE0E8; // type:data rom:0x324A38
D_802BE0EC = 0x802BE0EC; // type:data rom:0x324A3C D_802BE0EC = 0x802BE0EC; // type:data rom:0x324A3C
func_802BD14C_324A5C = 0x802BD14C; // type:func rom:0x324A5C GoompaUpdate = 0x802BD14C; // type:func rom:0x324A5C
func_802BD4E0_324DF0 = 0x802BD4E0; // type:func rom:0x324DF0 goompa_try_cancel_tweester = 0x802BD4E0; // type:func rom:0x324DF0
GoompaUseAbility = 0x802BD524; // type:func rom:0x324E34 GoompaUseAbility = 0x802BD524; // type:func rom:0x324E34
GoompaPutAway = 0x802BD52C; // type:func rom:0x324E3C GoompaPutAway = 0x802BD52C; // type:func rom:0x324E3C
world_goompa_take_out = 0x802BD570; // type:data rom:0x324E80 EVS_WorldGoompaTakeOut = 0x802BD570; // type:data rom:0x324E80
GoompaTweesterPhysicsPtr = 0x802BD58C; // type:data rom:0x324E9C GoompaTweesterPhysicsPtr = 0x802BD58C; // type:data rom:0x324E9C
world_goompa_update = 0x802BD590; // type:data rom:0x324EA0 EVS_WorldGoompaUpdate = 0x802BD590; // type:data rom:0x324EA0
world_goompa_use_ability = 0x802BD5AC; // type:data rom:0x324EBC EVS_WorldGoompaUseAbility = 0x802BD5AC; // type:data rom:0x324EBC
world_goompa_put_away = 0x802BD5C8; // type:data rom:0x324ED8 EVS_WorldGoompaPutAway = 0x802BD5C8; // type:data rom:0x324ED8
D_802BD5F0_324F00 = 0x802BD5F0; // type:data rom:0x324F00 D_802BD5F0_324F00 = 0x802BD5F0; // type:data rom:0x324F00
world_goombaria_init = 0x802BD100; // type:func rom:0x324F10 world_goombaria_init = 0x802BD100; // type:func rom:0x324F10
GoombariaTakeOut = 0x802BD114; // type:func rom:0x324F24 GoombariaTakeOut = 0x802BD114; // type:func rom:0x324F24
GoombariaUpdate = 0x802BD14C; // type:func rom:0x324F5C GoombariaUpdate = 0x802BD14C; // type:func rom:0x324F5C
GoombariaUseAbility = 0x802BD1AC; // type:func rom:0x324FBC GoombariaUseAbility = 0x802BD1AC; // type:func rom:0x324FBC
GoombariaPutAway = 0x802BD1B4; // type:func rom:0x324FC4 GoombariaPutAway = 0x802BD1B4; // type:func rom:0x324FC4
world_goombaria_take_out = 0x802BD1F0; // type:data rom:0x325000 EVS_WorldGoombariaTakeOut = 0x802BD1F0; // type:data rom:0x325000
world_goombaria_update = 0x802BD20C; // type:data rom:0x32501C EVS_WorldGoombariaUpdate = 0x802BD20C; // type:data rom:0x32501C
world_goombaria_use_ability = 0x802BD228; // type:data rom:0x325038 EVS_WorldGoombariaUseAbility = 0x802BD228; // type:data rom:0x325038
world_goombaria_put_away = 0x802BD244; // type:data rom:0x325054 EVS_WorldGoombariaPutAway = 0x802BD244; // type:data rom:0x325054
world_twink_init = 0x802BD100; // type:func rom:0x325070 world_twink_init = 0x802BD100; // type:func rom:0x325070
TwinkTakeOut = 0x802BD110; // type:func rom:0x325080 TwinkTakeOut = 0x802BD110; // type:func rom:0x325080
TwinkUpdate = 0x802BD148; // type:func rom:0x3250B8 TwinkUpdate = 0x802BD148; // type:func rom:0x3250B8
TwinkUseAbility = 0x802BD1A8; // type:func rom:0x325118 TwinkUseAbility = 0x802BD1A8; // type:func rom:0x325118
TwinkPutAway = 0x802BD1B0; // type:func rom:0x325120 TwinkPutAway = 0x802BD1B0; // type:func rom:0x325120
world_twink_take_out = 0x802BD1F0; // type:data rom:0x325160 EVS_TwinkTakeOut = 0x802BD1F0; // type:data rom:0x325160
world_twink_update = 0x802BD20C; // type:data rom:0x32517C EVS_TwinkUpdate = 0x802BD20C; // type:data rom:0x32517C
world_twink_use_ability = 0x802BD228; // type:data rom:0x325198 EVS_TwinkUseAbility = 0x802BD228; // type:data rom:0x325198
world_twink_put_away = 0x802BD244; // type:data rom:0x3251B4 EVS_TwinkPutAway = 0x802BD244; // type:data rom:0x3251B4
WorldItem_ShowUseSparkles = 0x802BD100; // type:func rom:0x3251D0 WorldItem_ShowUseSparkles = 0x802BD100; // type:func rom:0x3251D0
WorldItem_ShowHPGain = 0x802BD1AC; // type:func rom:0x32527C WorldItem_ShowHPGain = 0x802BD1AC; // type:func rom:0x32527C
WorldItem_ShowFPGain = 0x802BD26C; // type:func rom:0x32533C WorldItem_ShowFPGain = 0x802BD26C; // type:func rom:0x32533C
@ -25192,48 +25192,44 @@ gv_01_UpdateTexturePanSmooth = 0x802402E0; // type:func rom:0xE1E740
gv_01_UpdateTexturePanStepped = 0x80240404; // type:func rom:0xE1E864 gv_01_UpdateTexturePanStepped = 0x80240404; // type:func rom:0xE1E864
gv_01_FadeToTitleScreen = 0x802405EC; // type:func rom:0xE1EA4C gv_01_FadeToTitleScreen = 0x802405EC; // type:func rom:0xE1EA4C
gv_01_ChangeStateToTitleScreen = 0x80240688; // type:func rom:0xE1EAE8 gv_01_ChangeStateToTitleScreen = 0x80240688; // type:func rom:0xE1EAE8
inspect_icon_UnkAngleFunc1 = 0x802B7000; // type:func rom:0xE20110 inspect_icon_GetIconBrightnessForAngle = 0x802B7000; // type:func rom:0xE20110
func_802B70B4_E201C4 = 0x802B70B4; // type:func rom:0xE201C4 interact_inspect_setup = 0x802B70B4; // type:func rom:0xE201C4
func_802B71E8_E202F8 = 0x802B71E8; // type:func rom:0xE202F8 appendGfx_interact_prompt = 0x802B71E8; // type:func rom:0xE202F8
func_802B7450_E20560 = 0x802B7450; // type:func rom:0xE20560 should_continue_inspect = 0x802B7450; // type:func rom:0xE20560
func_802B75E8_E206F8 = 0x802B75E8; // type:func rom:0xE206F8 update_inspect_icon_pos = 0x802B75E8; // type:func rom:0xE206F8
func_802B7728_E20838 = 0x802B7728; // type:func rom:0xE20838 interact_inspect_update = 0x802B7728; // type:func rom:0xE20838
func_802B79C8_E20AD8 = 0x802B79C8; // type:func rom:0xE20AD8 interact_inspect_dismiss = 0x802B79C8; // type:func rom:0xE20AD8
D_802B7A20_E20B30 = 0x802B7A20; // type:data rom:0xE20B30 inspect_icon_img = 0x802B7A20; // type:data rom:0xE20B30
D_802B7C20_E20D30 = 0x802B7C20; // type:data rom:0xE20D30 inspect_icon_pal = 0x802B7C20; // type:data rom:0xE20D30
D_802B7C40_E20D50 = 0x802B7C40; // type:data rom:0xE20D50 inspect_icon_gfx = 0x802B7C40; // type:data rom:0xE20D50
D_802B7CB8_E20DC8 = 0x802B7CB8; // type:data rom:0xE20DC8 InspectIconPtr = 0x802B7CB8; // type:data rom:0xE20DC8
D_802B7D88_E20E98 = 0x802B7D88; // type:data rom:0xE20E98 speech_bubble_GetIconBrightnessForAngle = 0x802B7000; // type:func rom:0xE20EB0
D_802B7D90_E20EA0 = 0x802B7D90; // type:data rom:0xE20EA0 interact_speech_setup = 0x802B70B4; // type:func rom:0xE20F64
speech_bubble_UnkAngleFunc1 = 0x802B7000; // type:func rom:0xE20EB0 appendGfx_speech_bubble = 0x802B71C8; // type:func rom:0xE21078
func_802B70B4 = 0x802B70B4; // type:func rom:0xE20F64 interact_speech_update = 0x802B742C; // type:func rom:0xE212DC
func_802B71C8 = 0x802B71C8; // type:func rom:0xE21078 speech_bubble_img = 0x802B7710; // type:data rom:0xE215C0
func_802B742C = 0x802B742C; // type:func rom:0xE212DC speech_bubble_pal = 0x802B7910; // type:data rom:0xE217C0
D_802B7710_E215C0 = 0x802B7710; // type:data rom:0xE215C0 speech_bubble_gfx = 0x802B7930; // type:data rom:0xE217E0
D_802B7910_E217C0 = 0x802B7910; // type:data rom:0xE217C0 SpeechBubblePtr = 0x802B79A8; // type:data rom:0xE21858
D_802B7930_E217E0 = 0x802B7930; // type:data rom:0xE217E0 should_cancel_pulse_stone = 0x802B7000; // type:func rom:0xE21870
D_802B79A8_E21858 = 0x802B79A8; // type:data rom:0xE21858 should_continue_pulse_stone = 0x802B704C; // type:func rom:0xE218BC
D_802B79B0_E21860 = 0x802B79B0; // type:data rom:0xE21860 pulse_stone_notification_setup = 0x802B7140; // type:func rom:0xE219B0
D_802B79B8_E21868 = 0x802B79B8; // type:data rom:0xE21868 appendGfx_pulse_stone_icon = 0x802B71D4; // type:func rom:0xE21A44
func_802B7000_2 = 0x802B7000; // type:func rom:0xE21870 pulse_stone_notification_update = 0x802B74F0; // type:func rom:0xE21D60
func_802B704C = 0x802B704C; // type:func rom:0xE218BC pulse_stone_icon_img = 0x802B7640; // type:data rom:0xE21EB0
func_802B7140 = 0x802B7140; // type:func rom:0xE219B0 pulse_stone_icon_1_pal = 0x802B7C60; // type:data rom:0xE224D0
func_802B71D4 = 0x802B71D4; // type:func rom:0xE21A44 pulse_stone_icon_2_pal = 0x802B7C80; // type:data rom:0xE224F0
func_802B74F0 = 0x802B74F0; // type:func rom:0xE21D60 pulse_stone_icon_gfx = 0x802B7CA0; // type:data rom:0xE22510
D_802B7640_E21EB0 = 0x802B7640; // type:data rom:0xE21EB0 PulseStonePtr = 0x802B7D18; // type:data rom:0xE22588
D_802B7C60_E224D0 = 0x802B7C60; // type:data rom:0xE224D0 appendGfx_ispy_icon = 0x802B7000; // type:func rom:0xE225B0
D_802B7C80_E224F0 = 0x802B7C80; // type:data rom:0xE224F0 ispy_notification_setup = 0x802B72C0; // type:func rom:0xE22870
D_802B7CA0_E22510 = 0x802B7CA0; // type:data rom:0xE22510 ispy_notification_update = 0x802B735C; // type:func rom:0xE2290C
D_802B7D18_E22588 = 0x802B7D18; // type:data rom:0xE22588 ispy_icon_img = 0x802B7580; // type:data rom:0xE22B30
func_802B7000_E225B0 = 0x802B7000; // type:func rom:0xE225B0 ispy_icon_1_pal = 0x802B7BA0; // type:data rom:0xE23150
func_802B72C0_E22870 = 0x802B72C0; // type:func rom:0xE22870 ispy_icon_2_pal = 0x802B7BC0; // type:data rom:0xE23170
func_802B735C_E2290C = 0x802B735C; // type:func rom:0xE2290C ispy_icon_3_pal = 0x802B7BE0; // type:data rom:0xE23190
D_802B7580_E22B30 = 0x802B7580; // type:data rom:0xE22B30 ispy_icon_gfx = 0x802B7C00; // type:data rom:0xE231B0
D_802B7BA0_E23150 = 0x802B7BA0; // type:data rom:0xE23150 ISpyPtr = 0x802B7C78; // type:data rom:0xE23228
D_802B7BC0_E23170 = 0x802B7BC0; // type:data rom:0xE23170
D_802B7BE0_E23190 = 0x802B7BE0; // type:data rom:0xE23190
D_802B7C00_E231B0 = 0x802B7C00; // type:data rom:0xE231B0
D_802B7C78_E23228 = 0x802B7C78; // type:data rom:0xE23228
action_update_idle = 0x802B6000; // type:func rom:0xE23260 action_update_idle = 0x802B6000; // type:func rom:0xE23260
action_update_idle_peach = 0x802B61E4; // type:func rom:0xE23444 action_update_idle_peach = 0x802B61E4; // type:func rom:0xE23444
IdlePeachAnims = 0x802B6430; // type:data rom:0xE23690 IdlePeachAnims = 0x802B6430; // type:data rom:0xE23690
@ -27125,7 +27121,6 @@ D_802B6EF0 = 0x802B6EF0; // type:data
D_802B6EF4 = 0x802B6EF4; // type:data D_802B6EF4 = 0x802B6EF4; // type:data
D_802B7140 = 0x802B7140; // type:data D_802B7140 = 0x802B7140; // type:data
func_802B71E8 = 0x802B71E8; // func_802B71E8 = 0x802B71E8; //
D_802B79A8 = 0x802B79A8; // type:data
mdl_clearRenderTasks = 0x802B7E00; // type:data mdl_clearRenderTasks = 0x802B7E00; // type:data
D_802BCE20 = 0x802BCE20; // type:data D_802BCE20 = 0x802BCE20; // type:data
D_802BCE30 = 0x802BCE30; // type:data D_802BCE30 = 0x802BCE30; // type:data
@ -27133,7 +27128,7 @@ D_802BCE32 = 0x802BCE32; // type:data
D_802BCE34 = 0x802BCE34; // type:data D_802BCE34 = 0x802BCE34; // type:data
GoompaTweesterPhysics = 0x802BD600; // type:data GoompaTweesterPhysics = 0x802BD600; // type:data
goompa_802BD600 = 0x802BD600; // type:data goompa_802BD600 = 0x802BD600; // type:data
D_802BDF30 = 0x802BDF30; // type:data TattleHadSpeechPrompt = 0x802BDF30; // type:data
func_802BE070 = 0x802BE070; // func_802BE070 = 0x802BE070; //
D_802BE0C0 = 0x802BE0C0; // type:data D_802BE0C0 = 0x802BE0C0; // type:data
D_802BE300 = 0x802BE300; // type:data D_802BE300 = 0x802BE300; // type:data