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;
} DmaTable;
typedef struct UseItemStruct {
/* 0x00 */ u8* dmaStart;
/* 0x04 */ u8* dmaEnd;
/* 0x08 */ EvtScript* script;
/* 0x0C */ s32 unk_0C;
} UseItemStruct;
typedef struct PartnerData {
/* 0x00 */ u8 enabled;
/* 0x01 */ s8 level;
@ -401,7 +394,7 @@ typedef struct Trigger {
/* */ void* varTablePtr[3];
/* */ };
/* 0x28 */ s32* itemList;
/* 0x2C */ s32 unk_tr_2C; // related to Goombario somehow, custom tattle perhaps?
/* 0x2C */ s32 tattleMsg;
/* 0x30 */ u8 hasPlayerInteractPrompt;
/* 0x31 */ char unk_31[3];
/* 0x34 */ s32 runningScriptID;
@ -416,7 +409,7 @@ typedef struct TriggerBlueprint {
/* 0x08 */ s32 colliderID;
/* 0x0C */ s32 (*onActivateFunc)(struct Trigger*);
/* 0x10 */ char unk_10[4];
/* 0x14 */ s32 unk_tr_2C;
/* 0x14 */ s32 tattleMsg;
/* 0x18 */ s32 hasPlayerInteractPrompt;
/* 0x1C */ s32* itemList;
} TriggerBlueprint; // size = 0x20
@ -1993,7 +1986,7 @@ typedef struct PlayerStatus {
/* 0x010 */ s16 blinkTimer;
/* 0x012 */ s16 moveFrames;
/* 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;
/* 0x01C */ Vec3f pushVelocity;
/* 0x028 */ Vec3f position;
@ -2538,4 +2531,17 @@ typedef struct LavaPiranhaVine {
/* 0x1DC */ s32 numPoints;
} 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

View File

@ -3034,6 +3034,13 @@ enum JumpSubstate {
JUMP_SUBSTATE_1 = 1,
};
enum TweesterPartnerStates {
TWEESTER_PARTNER_INIT = 0,
TWEESTER_PARTNER_ATTRACT = 1,
TWEESTER_PARTNER_HOLD = 2,
TWEESTER_PARTNER_RELEASE = 3,
};
enum LandOnSwitchSubstate {
LANDING_ON_SWITCH_SUBSTATE_0 = 0,
LANDING_ON_SWITCH_SUBSTATE_1 = 1,
@ -3578,9 +3585,9 @@ enum PlayerStatusAnimFlags {
PA_FLAG_FORCE_USE_PARTNER = 0x00000008, ///< triggers partner use when set
PA_FLAG_INTERACT_PROMPT_AVAILABLE = 0x00000010, ///< ! 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_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_SHIVERING = 0x00000400,
PA_FLAG_OPENED_HIDDEN_PANEL = 0x00000800,

View File

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

View File

@ -148,11 +148,14 @@ extern UNK_TYPE D_800E92D8;
extern UNK_TYPE D_80147574;
extern s8 D_8014C248[];
extern UNK_FUN_PTR(PulseStoneNotificationCallback);
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* TweesterTouchingPlayer;
extern UNK_FUN_PTR(InteractNotificationCallback);
extern s32 PrevPlayerDirection;
extern s32 PeachDisguiseNpcIndex;
extern s32 D_8010C980;

View File

@ -17,9 +17,8 @@
extern f32 D_800F7B48;
extern s32 D_800F7B4C;
extern UNK_FUN_PTR(ISpyNotificationCallback);
extern s8 D_8015A57A;
extern s32 GoombarioGetTattleID;
extern s32 GoombarioTattleInteractionID;
s32 player_raycast_down(f32*, f32*, f32*, f32*);
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 update_player_blink(void);
void check_for_ispy(void);
void func_800E0330(void);
void render_ispy_icon(void);
void check_for_pulse_stone(void);
void func_800E0374(void);
void func_800E04D0(void);
void func_800E0514(void);
void clear_ispy_icon(void);
void render_pulse_stone_icon(void);
void clear_pulse_stone_icon(void);
void check_for_conversation_prompt(void);
void func_800E0658(void);
void func_800E069C(void);
void render_conversation_prompt(void);
void clear_conversation_prompt(void);
void check_for_interactables(void);
void func_800E0AD0(void);
void render_interact_prompt(void);
void func_800E0B14(void);
void update_partner_timers(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;
length = inputLength;
hitObjectID = player_raycast_down(&x, &y, &z, &length);
ret = -1;
ret = NO_COLLIDER;
if (hitObjectID >= 0 && length <= fabsf(*outLength)) {
*hitRx = -gGameStatusPtr->playerGroundTraceAngles.x;
*hitRz = -gGameStatusPtr->playerGroundTraceAngles.z;
@ -190,7 +189,7 @@ s32 player_raycast_down(f32* x, f32* y, f32* z, f32* length) {
f32 hitNz;
s32 entityID, colliderID;
Entity* entity;
s32 ret = -1;
s32 ret = NO_COLLIDER;
hitDepth = *length;
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;
startZ = z + deltaZ;
ret = -1;
ret = NO_COLLIDER;
hitID = player_raycast_up_corner(&startX, &startY, &startZ, &depth);
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 startX, startY, startZ;
ret = -1;
ret = NO_COLLIDER;
// needed to match
sx2 = sx = *x;
@ -371,7 +370,7 @@ s32 player_test_lateral_overlap(s32 mode, PlayerStatus* playerStatus, f32* x, f3
s32 ret;
radius = playerStatus->colliderDiameter * 0.5f;
ret = -1;
ret = NO_COLLIDER;
if (!(playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING))) {
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,
hitNz);
ret = -1;
ret = NO_COLLIDER;
if (entityID >= 0) {
entity = get_entity_by_index(entityID);
if (entity->alpha < 255) {
@ -496,7 +495,7 @@ s32 player_test_move_without_slipping(PlayerStatus* playerStatus, f32* x, f32* y
cosTheta = -cosTheta;
hitDepth = depth;
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);
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 dx, dz;
f32 depthDiff;
s32 ret = -1;
s32 ret = NO_COLLIDER;
height = 0.0f;
if (!(playerStatus->flags & (PS_FLAG_JUMPING | PS_FLAG_FALLING))) {
@ -623,10 +622,10 @@ void update_player(void) {
}
}
collisionStatus->currentWall = -1;
collisionStatus->lastWallHammered = -1;
collisionStatus->currentInspect = -1;
collisionStatus->floorBelow = 1;
collisionStatus->currentWall = NO_COLLIDER;
collisionStatus->lastWallHammered = NO_COLLIDER;
collisionStatus->currentInspect = NO_COLLIDER;
collisionStatus->floorBelow = TRUE;
update_player_input();
playerStatus->flags &= ~PS_FLAG_SPECIAL_LAND;
@ -687,14 +686,14 @@ void check_input_use_partner(void) {
u32 actionState = playerStatus->actionState;
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_B)
&& !(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)
&& actionState <= ACTION_STATE_RUN
) {
if (playerData->currentPartner == PARTNER_GOOMBARIO) {
GoombarioGetTattleID = playerStatus->interactingWithID;
GoombarioTattleInteractionID = playerStatus->interactingWithID;
}
partner_use_ability();
}
@ -775,9 +774,9 @@ void player_reset_data(void) {
playerStatus->position.z);
func_800E6B68();
func_800E0B14();
func_800E069C();
func_800E0514();
func_800E0374();
clear_conversation_prompt();
clear_pulse_stone_icon();
clear_ispy_icon();
func_800E5520();
}
@ -952,18 +951,18 @@ s32 disable_player_input(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
playerStatus->flags |= PS_FLAG_INPUT_DISABLED;
playerStatus->inputEnabledCounter++;
return playerStatus->inputEnabledCounter;
playerStatus->inputDisabledCount++;
return playerStatus->inputDisabledCount;
}
s32 enable_player_input(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
playerStatus->inputEnabledCounter--;
if (playerStatus->inputEnabledCounter == 0) {
playerStatus->inputDisabledCount--;
if (playerStatus->inputDisabledCount == 0) {
playerStatus->flags &= ~PS_FLAG_INPUT_DISABLED;
}
return playerStatus->inputEnabledCounter;
return playerStatus->inputDisabledCount;
}
void func_800E01DC(void) {
@ -987,10 +986,10 @@ s32 game_scripts_disabled(void) {
}
void player_render_interact_prompts(void) {
func_800E0658();
func_800E0AD0();
func_800E04D0();
func_800E0330();
render_conversation_prompt();
render_interact_prompt();
render_pulse_stone_icon();
render_ispy_icon();
}
void check_for_ispy(void) {
@ -1000,7 +999,7 @@ void check_for_ispy(void) {
if (!(playerStatus->animFlags &
(PA_FLAG_SPEECH_PROMPT_AVAILABLE | PA_FLAG_INTERACT_PROMPT_AVAILABLE))) {
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) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_100) && (ISpyNotificationCallback != NULL)) {
func_802B7000_E225B0();
void render_ispy_icon(void) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_ISPY_VISIBLE) && (ISpyNotificationCallback != NULL)) {
appendGfx_ispy_icon();
}
}
void func_800E0374(void) {
void clear_ispy_icon(void) {
ISpyNotificationCallback = NULL;
gPlayerStatusPtr->animFlags &= ~PA_FLAG_100;
gPlayerStatusPtr->animFlags &= ~PA_FLAG_ISPY_VISIBLE;
}
void check_for_pulse_stone(void) {
@ -1025,7 +1024,7 @@ void check_for_pulse_stone(void) {
s32 dx, dy;
if (PulseStoneNotificationCallback == NULL) {
if (gPlayerStatus.animFlags & PA_FLAG_100) {
if (gPlayerStatus.animFlags & PA_FLAG_ISPY_VISIBLE) {
return;
}
@ -1039,17 +1038,17 @@ void check_for_pulse_stone(void) {
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;
}
if (gPlayerStatus.flags & PS_FLAG_PAUSED || gPlayerStatus.inputEnabledCounter) {
if (gPlayerStatus.flags & PS_FLAG_PAUSED || gPlayerStatus.inputDisabledCount) {
return;
}
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);
PulseStoneNotificationCallback = func_802B7140;
PulseStoneNotificationCallback = pulse_stone_notification_setup;
}
}
@ -1058,15 +1057,15 @@ void check_for_pulse_stone(void) {
}
}
void func_800E04D0(void) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_40) && (PulseStoneNotificationCallback != 0)) {
func_802B71D4();
void render_pulse_stone_icon(void) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_PULSE_STONE_VISIBLE) && (PulseStoneNotificationCallback != NULL)) {
appendGfx_pulse_stone_icon();
}
}
void func_800E0514(void) {
void clear_pulse_stone_icon(void) {
PulseStoneNotificationCallback = NULL;
gPlayerStatusPtr->animFlags &= ~PA_FLAG_40;
gPlayerStatusPtr->animFlags &= ~PA_FLAG_PULSE_STONE_VISIBLE;
}
s32 has_valid_conversation_npc(void) {
@ -1083,19 +1082,19 @@ s32 has_valid_conversation_npc(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;
}
if (TalkNotificationCallback == NULL) {
if (gPlayerStatus.inputEnabledCounter || gPlayerStatus.flags & PS_FLAG_PAUSED) {
if (gPlayerStatus.inputDisabledCount || gPlayerStatus.flags & PS_FLAG_PAUSED) {
return;
}
if (has_valid_conversation_npc()) {
TalkNotificationCallback = NULL;
dma_copy(speech_bubble_ROM_START, speech_bubble_ROM_END, speech_bubble_VRAM_DEF);
TalkNotificationCallback = func_802B70B4_E201C4;
TalkNotificationCallback = interact_speech_setup;
} else {
TalkNotificationCallback = NULL;
return;
@ -1107,13 +1106,13 @@ void check_for_conversation_prompt(void) {
}
}
void func_800E0658(void) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) && (TalkNotificationCallback != 0)) {
func_802B71C8();
void render_conversation_prompt(void) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) && (TalkNotificationCallback != NULL)) {
appendGfx_speech_bubble();
}
}
void func_800E069C(void) {
void clear_conversation_prompt(void) {
TalkNotificationCallback = NULL;
gPlayerStatusPtr->animFlags &= ~PA_FLAG_SPEECH_PROMPT_AVAILABLE;
}
@ -1125,41 +1124,44 @@ void func_800E06C0(s32 arg0) {
s32 func_800E06D8(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
Npc* npc = playerStatus->encounteredNPC;
s32 temp = playerStatus->interactingWithID;
s32 wall;
s32 interactingID = playerStatus->interactingWithID;
s32 currentWall;
if (playerStatus->timeInAir || playerStatus->inputEnabledCounter) {
if (playerStatus->timeInAir != 0 || playerStatus->inputDisabledCount) {
return FALSE;
}
if (gCollisionStatus.currentWall == -1) {
if (gCollisionStatus.currentWall == NO_COLLIDER) {
return FALSE;
}
if (playerStatus->flags & PS_FLAG_HAS_CONVERSATION_NPC && !(playerStatus->flags & PS_FLAG_INPUT_DISABLED)
&& npc != NULL && npc->flags & NPC_FLAG_10000000) {
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;
}
wall = gCollisionStatus.currentWall;
if (!(wall & COLLISION_WITH_ENTITY_BIT)) {
if (!should_collider_allow_interact(wall)) {
currentWall = gCollisionStatus.currentWall;
if (!(currentWall & COLLISION_WITH_ENTITY_BIT)) {
if (!should_collider_allow_interact(currentWall)) {
return FALSE;
}
} else if (!phys_can_player_interact()) {
playerStatus->interactingWithID = -1;
playerStatus->interactingWithID = NO_COLLIDER;
return FALSE;
} else if (get_entity_type(wall) == ENTITY_TYPE_PUSH_BLOCK) {
} else if (get_entity_type(currentWall) == ENTITY_TYPE_PUSH_BLOCK) {
return FALSE;
}
if (temp == wall) {
if (interactingID == currentWall) {
if (playerStatus->flags & PS_FLAG_INTERACTED) {
return FALSE;
}
} else {
playerStatus->flags &= ~PS_FLAG_INTERACTED;
}
playerStatus->interactingWithID = -1;
playerStatus->interactingWithID = NO_COLLIDER;
return TRUE;
}
@ -1171,14 +1173,14 @@ void check_for_interactables(void) {
Npc* npc = gPlayerStatus.encounteredNPC;
s32 phi_s2;
if ((playerStatus->animFlags & PA_FLAG_100) || TalkNotificationCallback || PulseStoneNotificationCallback) {
if ((playerStatus->animFlags & PA_FLAG_ISPY_VISIBLE) || TalkNotificationCallback || PulseStoneNotificationCallback != NULL) {
return;
}
if (InteractNotificationCallback == NULL) {
s32 curInteraction = gCollisionStatus.currentWall;
if (playerStatus->inputEnabledCounter != 0) {
if (playerStatus->inputDisabledCount != 0) {
if (gPlayerStatus.interactingWithID != curInteraction) {
gPlayerStatus.interactingWithID = curInteraction;
}
@ -1189,7 +1191,7 @@ void check_for_interactables(void) {
return;
}
if (curInteraction == -1) {
if (curInteraction == NO_COLLIDER) {
s32 floor = gCollisionStatus.currentFloor;
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_CHEST:
case ENTITY_TYPE_SIGNPOST:
curInteraction = -1;
curInteraction = NO_COLLIDER;
break;
}
} else if (
@ -1217,7 +1219,7 @@ void check_for_interactables(void) {
}
phi_s2 = 0;
} else {
playerStatus->interactingWithID = -1;
playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED;
return;
}
@ -1226,7 +1228,7 @@ void check_for_interactables(void) {
phi_s2 = 0;
if (!(curInteraction & COLLISION_WITH_NPC_BIT)) {
if (!should_collider_allow_interact(curInteraction)) {
playerStatus->interactingWithID = -1;
playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED;
return;
}
@ -1234,7 +1236,7 @@ void check_for_interactables(void) {
} else {
if (!phys_can_player_interact()) {
phi_s2 = 1;
playerStatus->interactingWithID = -1;
playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED;
return;
}
@ -1266,7 +1268,7 @@ void check_for_interactables(void) {
if (InteractNotificationCallback == NULL) {
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) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) && (InteractNotificationCallback != 0)) {
func_802B71E8_E202F8();
void render_interact_prompt(void) {
if ((gPlayerStatusPtr->animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) && (InteractNotificationCallback != NULL)) {
appendGfx_interact_prompt();
}
}

View File

@ -269,12 +269,12 @@ block_17:
partner_disable_input();
D_8010CCFA = 3;
D_8010CD00 = 1;
D_8010CCFE = playerStatus->inputEnabledCounter;
D_8010CCFE = playerStatus->inputDisabledCount;
}
break;
case 1:
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;
enable_player_input();
partner_enable_input();

View File

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

View File

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

View File

@ -16,7 +16,7 @@ void entity_Signpost_idle(Entity* entity) {
}
} else {
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,
.typeDataSize = sizeof(SignpostData),
.renderCommandList = Entity_Signpost_RenderScript,
.modelAnimationNodes = 0x00000000,
.modelAnimationNodes = NULL,
.fpInit = NULL,
.updateEntityScript = Entity_Signpost_Script,
.fpHandleCollision = NULL,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,158 +2,149 @@
#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"
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.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;
SpeechBubbleData* temp;
Npc* npc;
mem_clear(D_802B79A8_E21858, sizeof(*D_802B79A8_E21858));
mem_clear(SpeechBubblePtr, sizeof(*SpeechBubblePtr));
npc = playerStatus->encounteredNPC;
D_802B79A8_E21858->unk_00 = npc;
D_802B79A8_E21858->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f;
D_802B79A8_E21858->pos.y = D_802B79A8_E21858->unk_1C;
D_802B79A8_E21858->pos.x = npc->pos.x;
D_802B79A8_E21858->pos.z = npc->pos.z;
D_802B79A8_E21858->unk_18 = 0;
D_802B79A8_E21858->unk_2A = 0;
D_802B79A8_E21858->scale = 0.1f;
TalkNotificationCallback = func_802B742C;
SpeechBubblePtr->encounteredNPC = npc;
SpeechBubblePtr->pos.y = SpeechBubblePtr->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f;
SpeechBubblePtr->pos.x = npc->pos.x;
SpeechBubblePtr->pos.z = npc->pos.z;
SpeechBubblePtr->unk_18 = 0;
SpeechBubblePtr->state = 0;
SpeechBubblePtr->scale = 0.1f;
TalkNotificationCallback = interact_speech_update;
playerStatus->animFlags |= PA_FLAG_SPEECH_PROMPT_AVAILABLE;
temp = D_802B79A8_E21858;
temp->unk_2A = 0;
temp = SpeechBubblePtr;
temp->state = 0;
temp->scale = 0.4f;
D_802B79A8_E21858->unk_10 = -gCameras[gCurrentCameraID].currentYaw;
D_802B79A8_E21858->unk_2B = 255;
SpeechBubblePtr->yaw = -gCameras[gCurrentCameraID].currentYaw;
SpeechBubblePtr->brightness = 255;
}
void func_802B71C8(void) {
FoldImageRecPart sp20;
Matrix4f sp38, sp78;
void appendGfx_speech_bubble(void) {
FoldImageRecPart foldImg;
Matrix4f mtxTemp, mtxTransform;
if (gPlayerStatus.animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) {
guScaleF(sp38, D_802B79A8_E21858->scale, D_802B79A8_E21858->scale, D_802B79A8_E21858->scale);
guRotateF(sp78, D_802B79A8_E21858->unk_10 - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp38, sp78, sp38);
guTranslateF(sp78, D_802B79A8_E21858->pos.x, D_802B79A8_E21858->pos.y, D_802B79A8_E21858->pos.z);
guMtxCatF(sp38, sp78, sp78);
guMtxF2L(sp78, &gDisplayContext->matrixStack[gMatrixListPos]);
guScaleF(mtxTemp, SpeechBubblePtr->scale, SpeechBubblePtr->scale, SpeechBubblePtr->scale);
guRotateF(mtxTransform, SpeechBubblePtr->yaw - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guMtxCatF(mtxTemp, mtxTransform, mtxTemp);
guTranslateF(mtxTransform, SpeechBubblePtr->pos.x, SpeechBubblePtr->pos.y, SpeechBubblePtr->pos.z);
guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, &D_802B7930_E217E0);
gSPDisplayList(gMasterGfxPos++, &speech_bubble_gfx);
sp20.raster = D_802B7710_E215C0;
sp20.palette = D_802B7910_E217C0;
sp20.width = D_802B7710_E215C0_width;
sp20.height = D_802B7710_E215C0_height;
sp20.xOffset = -16;
sp20.yOffset = 26;
sp20.opacity = 255;
foldImg.raster = speech_bubble_img;
foldImg.palette = speech_bubble_pal;
foldImg.width = speech_bubble_img_width;
foldImg.height = speech_bubble_img_height;
foldImg.xOffset = -16;
foldImg.yOffset = 26;
foldImg.opacity = 255;
fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0x440);
fold_update(0, FOLD_TYPE_6,
D_802B79A8_E21858->unk_2B, D_802B79A8_E21858->unk_2B, D_802B79A8_E21858->unk_2B, 0xFF, 0x440);
fold_appendGfx_component(0, &sp20, 0x40, sp78);
SpeechBubblePtr->brightness, SpeechBubblePtr->brightness, SpeechBubblePtr->brightness, 255, 0x440);
fold_appendGfx_component(0, &foldImg, 0x40, mtxTransform);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
}
}
void func_802B742C(void) {
void interact_speech_update(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
s32 var_a2 = 255;
f32 unk10;
s32 brightness = 255;
f32 yaw;
Npc* npc;
if (((playerStatus->flags & (PS_FLAG_HAS_CONVERSATION_NPC | PS_FLAG_ENTERING_BATTLE | PS_FLAG_PAUSED))
!= PS_FLAG_HAS_CONVERSATION_NPC) ||
(gEncounterState == ENCOUNTER_STATE_CONVERSATION) ||
(playerStatus->animFlags & PA_FLAG_USING_WATT) ||
(playerStatus->inputEnabledCounter != 0) ||
(playerStatus->animFlags & PA_FLAG_SPINNING))
{
D_802B79A8_E21858->unk_2A = 3;
!= PS_FLAG_HAS_CONVERSATION_NPC)
|| gEncounterState == ENCOUNTER_STATE_CONVERSATION
|| playerStatus->animFlags & PA_FLAG_USING_WATT
|| playerStatus->inputDisabledCount != 0
|| playerStatus->animFlags & PA_FLAG_SPINNING
) {
SpeechBubblePtr->state = 3;
}
switch (D_802B79A8_E21858->unk_2A) {
case 0:
D_802B79A8_E21858->unk_10 = 0.0f;
D_802B79A8_E21858->scale += 0.05;
if (D_802B79A8_E21858->scale >= 0.55) {
D_802B79A8_E21858->scale = 0.55f;
D_802B79A8_E21858->unk_2A++;
D_802B79A8_E21858->unk_20 = 12;
switch (SpeechBubblePtr->state) {
case SPEECH_BUBBLE_APPEAR:
SpeechBubblePtr->yaw = 0.0f;
SpeechBubblePtr->scale += 0.05;
if (SpeechBubblePtr->scale >= 0.55) {
SpeechBubblePtr->scale = 0.55f;
SpeechBubblePtr->state++;
SpeechBubblePtr->holdTime = 12;
}
break;
case 1:
D_802B79A8_E21858->unk_10 = 0.0f;
D_802B79A8_E21858->unk_20--;
if (D_802B79A8_E21858->unk_20 <= 0) {
D_802B79A8_E21858->unk_2A++;
case SPEECH_BUBBLE_HOLD:
SpeechBubblePtr->yaw = 0.0f;
SpeechBubblePtr->holdTime--;
if (SpeechBubblePtr->holdTime <= 0) {
SpeechBubblePtr->state++;
}
break;
case 2:
unk10 = D_802B79A8_E21858->unk_10;
unk10 += 10.0f;
if (unk10 >= 360.0f) {
unk10 -= 360.0f;
case SPEECH_BUBBLE_IDLE:
yaw = SpeechBubblePtr->yaw;
yaw += 10.0f;
if (yaw >= 360.0f) {
yaw -= 360.0f;
}
D_802B79A8_E21858->unk_10 = unk10;
var_a2 = N(UnkAngleFunc1)(unk10);
SpeechBubblePtr->yaw = yaw;
brightness = N(GetIconBrightnessForAngle)(yaw);
break;
case 3:
unk10 = D_802B79A8_E21858->unk_10;
unk10 += 25.0f;
if (unk10 >= 360.0f) {
unk10 -= 360.0f;
case SPEECH_BUBBLE_VANISH:
yaw = SpeechBubblePtr->yaw;
yaw += 25.0f;
if (yaw >= 360.0f) {
yaw -= 360.0f;
}
D_802B79A8_E21858->unk_10 = unk10;
if ((unk10 >= 70.0f && unk10 <= 110.0f) || (unk10 >= 250.0f && unk10 <= 290.0f)) {
SpeechBubblePtr->yaw = yaw;
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;
playerStatus->encounteredNPC = NULL;
playerStatus->animFlags &= ~PA_FLAG_SPEECH_PROMPT_AVAILABLE;
return;
}
var_a2 = N(UnkAngleFunc1)(unk10);
brightness = N(GetIconBrightnessForAngle)(yaw);
break;
}
D_802B79A8_E21858->unk_2B = var_a2;
SpeechBubblePtr->brightness = brightness;
if (playerStatus->encounteredNPC != NULL) {
if (playerStatus->encounteredNPC != D_802B79A8_E21858->unk_00) {
D_802B79A8_E21858->unk_00 = playerStatus->encounteredNPC;
if (playerStatus->encounteredNPC != SpeechBubblePtr->encounteredNPC) {
SpeechBubblePtr->encounteredNPC = playerStatus->encounteredNPC;
}
}
npc = D_802B79A8_E21858->unk_00;
D_802B79A8_E21858->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f;
D_802B79A8_E21858->pos.y = D_802B79A8_E21858->unk_1C;
D_802B79A8_E21858->pos.x = npc->pos.x;
D_802B79A8_E21858->pos.z = npc->pos.z;
npc = SpeechBubblePtr->encounteredNPC;
SpeechBubblePtr->pos.y = SpeechBubblePtr->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f;
SpeechBubblePtr->pos.x = npc->pos.x;
SpeechBubblePtr->pos.z = npc->pos.z;
}

View File

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

View File

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

View File

@ -23,10 +23,10 @@ s32 action_update_ride(void) {
if (playerStatus->animFlags & PA_FLAG_RIDING_PARTNER) {
if (partnerActionStatus->actingPartner == PARTNER_LAKILESTER) {
return func_802BD100_317020(oldFlags);
return world_goombario_get_trigger_tattle(oldFlags);
}
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;
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);
script->varTable[0] = 0;
return ApiStatus_DONE2;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,13 +6,13 @@
void world_goombario_init(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);
s32 func_802BD100_317020(s32 arg0);
s32 world_goombario_get_trigger_tattle(s32 arg0);
extern EvtScript world_goombario_take_out;
extern EvtScript world_goombario_update;
extern EvtScript world_goombario_use_ability;
extern EvtScript world_goombario_put_away;
extern EvtScript EVS_GoombarioTakeOut;
extern EvtScript EVS_GoombarioUpdate;
extern EvtScript EVS_GoombarioUseAbility;
extern EvtScript EVS_GoombarioPutAway;
#endif

View File

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

View File

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

View File

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

View File

@ -102,8 +102,8 @@ ApiStatus func_802BD2D4_320E24(Evt* script, s32 isInitialCall) {
}
switch (LakilesterTweesterPhysicsPtr->state) {
case 0:
LakilesterTweesterPhysicsPtr->state = 1;
case TWEESTER_PARTNER_INIT:
LakilesterTweesterPhysicsPtr->state++;
LakilesterTweesterPhysicsPtr->prevFlags = lakilester->flags;
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);
@ -112,7 +112,7 @@ ApiStatus func_802BD2D4_320E24(Evt* script, s32 isInitialCall) {
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_GRAVITY;
case 1:
case TWEESTER_PARTNER_ATTRACT:
sin_cos_rad(DEG_TO_RAD(LakilesterTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);
lakilester->pos.x = entity->position.x + (sinAngle * 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++;
}
break;
case 2:
case TWEESTER_PARTNER_HOLD:
lakilester->flags = LakilesterTweesterPhysicsPtr->prevFlags;
LakilesterTweesterPhysicsPtr->countdown = 30;
LakilesterTweesterPhysicsPtr->state++;
break;
case 3:
case TWEESTER_PARTNER_RELEASE:
partner_flying_update_player_tracking(lakilester);
partner_flying_update_motion(lakilester);
if (--LakilesterTweesterPhysicsPtr->countdown == 0) {
LakilesterTweesterPhysicsPtr->state = 0;
LakilesterTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL;
}
break;
@ -167,11 +167,11 @@ EvtScript world_lakilester_update = {
EVT_END
};
void func_802BD678_3211C8(Npc* npc) {
void lakilester_try_cancel_tweester(Npc* npc) {
if (TweesterTouchingPartner != NULL) {
TweesterTouchingPartner = NULL;
npc->flags = LakilesterTweesterPhysicsPtr->prevFlags;
LakilesterTweesterPhysicsPtr->state = 0;
LakilesterTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
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) {
f32 temp_f20 = lakilester->collisionRadius * 0.8f;
f32 temp_f0 = clamp_angle(lakilester->yaw);
f32 x = lakilester->pos.x;
f32 y = lakilester->moveToPos.y;
f32 z = lakilester->pos.z;
f32 radius = lakilester->collisionRadius * 0.8f;
f32 x, y, z, yaw;
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->currentWall = NpcHitQueryColliderID;
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);
}
temp_f0 = clamp_angle(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)) {
if (TEST_MOVE_AT_ANGLE(npc_test_move_taller_with_slipping, lakilester->yaw + 45.0f)) {
lakilester->pos.x = x;
lakilester->pos.z = z;
lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
@ -298,12 +300,7 @@ void func_802BDA90_3215E0(Npc* lakilester) {
lakilester->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
}
temp_f0 = clamp_angle(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)) {
if (TEST_MOVE_AT_ANGLE(npc_test_move_taller_with_slipping, lakilester->yaw - 45.0f)) {
lakilester->pos.x = x;
lakilester->pos.z = z;
lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
@ -311,12 +308,7 @@ void func_802BDA90_3215E0(Npc* lakilester) {
lakilester->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
}
temp_f0 = clamp_angle(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)) {
if (TEST_MOVE_AT_ANGLE(npc_test_move_simple_with_slipping, lakilester->yaw + 45.0f + 180.0f)) {
lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
lakilester->pos.x = x;
lakilester->pos.z = z;
@ -324,12 +316,7 @@ void func_802BDA90_3215E0(Npc* lakilester) {
lakilester->flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
}
temp_f0 = clamp_angle(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)) {
if (TEST_MOVE_AT_ANGLE(npc_test_move_simple_with_slipping, lakilester->yaw - 45.0f + 180.0f)) {
lakilester->flags |= NPC_FLAG_COLLDING_WITH_WORLD;
lakilester->pos.x = x;
lakilester->pos.z = z;
@ -535,7 +522,7 @@ s32 func_802BE6A0_3221F0(f32* arg0) {
&hitDirX, &hitDirZ);
}
ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
API_CALLABLE(LakilesterUseAbility) {
PlayerStatus* playerStatus = &gPlayerStatus;
PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus;
Camera* camera = &gCameras[CAM_DEFAULT];
@ -548,15 +535,16 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
playerStatus->animFlags &= ~PA_FLAG_RIDING_PARTNER;
if (isInitialCall) {
func_802BD678_3211C8(npc);
lakilester_try_cancel_tweester(npc);
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.y = npc->pos.y;
npc->moveToPos.z = npc->pos.z;
if (gGameStatusPtr->keepUsingPartnerOnMapChange ||
(playerStatus->animFlags & PA_FLAG_PARTNER_USAGE_FORCED)) {
if (gGameStatusPtr->keepUsingPartnerOnMapChange
|| (playerStatus->animFlags & PA_FLAG_PARTNER_USAGE_FORCED)
) {
if (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 (gGameStatusPtr->keepUsingPartnerOnMapChange == FALSE) {
if (playerStatus->actionState == ACTION_STATE_RIDE ||
playerStatus->actionState == ACTION_STATE_IDLE ||
playerStatus->actionState == ACTION_STATE_WALK ||
playerStatus->actionState == ACTION_STATE_RUN ||
playerStatus->actionState == ACTION_STATE_FALLING) {
if (playerStatus->actionState == ACTION_STATE_RIDE
|| playerStatus->actionState == ACTION_STATE_IDLE
|| playerStatus->actionState == ACTION_STATE_WALK
|| playerStatus->actionState == ACTION_STATE_RUN
|| playerStatus->actionState == ACTION_STATE_FALLING
) {
playerStatus->flags |= PS_FLAG_PAUSE_DISABLED;
} else {
return ApiStatus_DONE2;
@ -622,7 +610,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
switch (D_802BFF14) {
case 40:
if (playerStatus->flags & PS_FLAG_HIT_FIRE ||
playerStatus->inputEnabledCounter) {
playerStatus->inputDisabledCount) {
playerStatus->flags &= ~PS_FLAG_PAUSE_DISABLED;
return ApiStatus_DONE2;
@ -643,7 +631,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
}
if (playerStatus->animFlags & PA_FLAG_CHANGING_MAP) {
if (script->functionTemp[2] < playerStatus->inputEnabledCounter) {
if (script->functionTemp[2] < playerStatus->inputDisabledCount) {
enable_player_input();
D_802BFF04 = 0;
}
@ -652,7 +640,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
}
if (script->functionTemp[1] == 0) {
if (script->functionTemp[2] < playerStatus->inputEnabledCounter) {
if (script->functionTemp[2] < playerStatus->inputDisabledCount) {
enable_player_input();
D_802BFF04 = 0;
playerStatus->flags &= ~PS_FLAG_PAUSE_DISABLED;
@ -919,8 +907,8 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) {
}
EvtScript world_lakilester_use_ability = {
EVT_CALL(func_802BE724_322274)
EvtScript EVS_LakilesterUseAbility = {
EVT_CALL(LakilesterUseAbility)
EVT_RETURN
EVT_END
};

View File

@ -10,7 +10,7 @@ void world_lakilester_post_battle(Npc*);
extern EvtScript world_lakilester_take_out;
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_while_riding;

View File

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

View File

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

View File

@ -7,17 +7,21 @@ void world_twink_init(Npc* twink) {
twink->collisionRadius = 20;
}
ApiStatus TwinkTakeOut(Evt* script, s32 isInitialCall) {
API_CALLABLE(TwinkTakeOut) {
Npc* twink = script->owner2.npc;
if (isInitialCall) {
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;
Npc* twink = script->owner2.npc;
@ -32,39 +36,43 @@ ApiStatus TwinkUpdate(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus TwinkUseAbility(Evt* script, s32 isInitialCall) {
API_CALLABLE(TwinkUseAbility) {
return ApiStatus_DONE2;
}
ApiStatus TwinkPutAway(Evt* script, s32 isInitialCall) {
API_CALLABLE(TwinkPutAway) {
Npc* twink = script->owner2.npc;
if (isInitialCall) {
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_RETURN
EVT_END
};
EvtScript world_twink_update = {
EvtScript EVS_TwinkUpdate = {
EVT_CALL(TwinkUpdate)
EVT_RETURN
EVT_END
};
EvtScript world_twink_use_ability = {
EvtScript EVS_TwinkUseAbility = {
EVT_CALL(TwinkUseAbility)
EVT_RETURN
EVT_END
};
EvtScript world_twink_put_away = {
EvtScript EVS_TwinkPutAway = {
EVT_CALL(TwinkPutAway)
EVT_RETURN
EVT_END

View File

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

View File

@ -127,8 +127,8 @@ ApiStatus WattUpdate(Evt* script, s32 isInitialCall) {
}
switch (WattTweesterPhysicsPtr->state) {
case 0:
WattTweesterPhysicsPtr->state = 1;
case TWEESTER_PARTNER_INIT:
WattTweesterPhysicsPtr->state++;
WattTweesterPhysicsPtr->prevFlags = watt->flags;
WattTweesterPhysicsPtr->radius = fabsf(dist2D(watt->pos.x, watt->pos.z,
entity->position.x, entity->position.z));
@ -138,7 +138,7 @@ ApiStatus WattUpdate(Evt* script, s32 isInitialCall) {
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_GRAVITY;
case 1:
case TWEESTER_PARTNER_ATTRACT:
sin_cos_rad(DEG_TO_RAD(WattTweesterPhysicsPtr->angle), &sinAngle, &cosAngle);
watt->pos.x = (entity->position.x + (sinAngle * WattTweesterPhysicsPtr->radius));
watt->pos.z = (entity->position.z - (cosAngle * WattTweesterPhysicsPtr->radius));
@ -169,16 +169,16 @@ ApiStatus WattUpdate(Evt* script, s32 isInitialCall) {
WattTweesterPhysicsPtr->state++;
}
break;
case 2:
case TWEESTER_PARTNER_HOLD:
watt->flags = WattTweesterPhysicsPtr->prevFlags;
WattTweesterPhysicsPtr->countdown = 30;
WattTweesterPhysicsPtr->state++;
break;
case 3:
case TWEESTER_PARTNER_RELEASE:
partner_flying_update_player_tracking(watt);
partner_flying_update_motion(watt);
if (--WattTweesterPhysicsPtr->countdown == 0) {
WattTweesterPhysicsPtr->state = 0;
WattTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
TweesterTouchingPartner = NULL;
}
break;
@ -203,7 +203,7 @@ void func_802BD710_31D280(Npc* watt) {
if (TweesterTouchingPartner != NULL) {
TweesterTouchingPartner = NULL;
watt->flags = WattTweesterPhysicsPtr->prevFlags;
WattTweesterPhysicsPtr->state = 0;
WattTweesterPhysicsPtr->state = TWEESTER_PARTNER_INIT;
partner_clear_player_tracking(watt);
}
}
@ -249,16 +249,16 @@ ApiStatus func_802BD754_31D2C4(Evt* script, s32 isInitialCall) {
switch (D_802BE304) {
case 40:
if (playerStatus->inputEnabledCounter != 0) {
if (playerStatus->inputDisabledCount != 0) {
return ApiStatus_DONE2;
}
script->functionTemp[1] = 3;
D_802BE304 = 41;
script->functionTemp[2] = playerStatus->inputEnabledCounter;
script->functionTemp[2] = playerStatus->inputDisabledCount;
break;
case 41:
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 (func_800EA52C(PARTNER_WATT)) {
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;
PlayerStatus* playerStatus = &gPlayerStatus;
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->actingPartner = PARTNER_WATT;
D_802BE308 = 0;
script->functionTemp[0] += 1;
script->functionTemp[0]++;
break;
case 1:
world_watt_sync_held_position();
@ -544,7 +544,7 @@ void world_watt_sync_held_position(void) {
}
EvtScript world_watt_while_riding = {
EVT_CALL(func_802BDE88_31D9F8)
EVT_CALL(WattRidingUpdate)
EVT_RETURN
EVT_END
};

View File

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

View File

@ -3,7 +3,7 @@
typedef void (*PartnerFunc)(Npc* partner);
typedef s32 (*PartnerBoolFunc)(Npc* partner);
typedef s32 (*PartnerUnkFunc)(Npc* partner, Npc* enemy);
typedef s32 (*PartnerTesHitFunc)(Npc* partner, Npc* enemy);
typedef struct WorldPartner {
/* 0x00 */ void* dmaStart;
@ -16,7 +16,7 @@ typedef struct WorldPartner {
/* 0x1C */ EvtScript* useAbility;
/* 0x20 */ EvtScript* putAway;
/* 0x24 */ s32 idle;
/* 0x28 */ PartnerUnkFunc testFirstStrike;
/* 0x28 */ PartnerTesHitFunc testFirstStrike;
/* 0x2C */ PartnerBoolFunc canUseAbility;
/* 0x30 */ PartnerBoolFunc canPlayerPause;
/* 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"ver/{version}/assets", ignore_errors=True)
shutil.rmtree(ROOT / f"ver/{version}/build", ignore_errors=True)
try:
os.remove(ROOT / f"ver/{version}/.splat_cache")
except OSError:
pass
extra_cflags = ""
extra_cppflags = ""

View File

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

View File

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

View File

@ -2670,23 +2670,23 @@ func_800E01DC = 0x800E01DC; // type:func rom:0x7968C
func_800E0208 = 0x800E0208; // type:func rom:0x796B8
player_render_interact_prompts = 0x800E0260; // type:func rom:0x79710
check_for_ispy = 0x800E0294; // type:func rom:0x79744
func_800E0330 = 0x800E0330; // type:func rom:0x797E0
func_800E0374 = 0x800E0374; // type:func rom:0x79824
render_ispy_icon = 0x800E0330; // type:func rom:0x797E0
clear_ispy_icon = 0x800E0374; // type:func rom:0x79824
check_for_pulse_stone = 0x800E0398; // type:func rom:0x79848
func_800E04D0 = 0x800E04D0; // type:func rom:0x79980
func_800E0514 = 0x800E0514; // type:func rom:0x799C4
render_pulse_stone_icon = 0x800E04D0; // type:func rom:0x79980
clear_pulse_stone_icon = 0x800E0514; // type:func rom:0x799C4
has_valid_conversation_npc = 0x800E0538; // type:func rom:0x799E8
check_for_conversation_prompt = 0x800E0580; // type:func rom:0x79A30
D_8009E6C8 = 0x8009E6C8; // type:data rom:0x79AC8
D_8009E6D0 = 0x8009E6D0; // type:data rom:0x79AD0
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
func_800E069C = 0x800E069C; // type:func rom:0x79B4C
clear_conversation_prompt = 0x800E069C; // type:func rom:0x79B4C
func_800E06C0 = 0x800E06C0; // type:func rom:0x79B70
func_800E06D8 = 0x800E06D8; // type:func rom:0x79B88
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
update_partner_timers = 0x800E0B38; // type:func rom:0x79FE8
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_general_heap_create_obfuscated = 0x802B2078; // type:func rom:0x316FA8
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
func_802BD188_3170A8 = 0x802BD188; // type:func rom:0x3170A8
func_802BD1D0_3170F0 = 0x802BD1D0; // type:func rom:0x3170F0
func_802BD564_317484 = 0x802BD564; // type:func rom:0x317484
WorldGoombarioTakeOut = 0x802BD188; // type:func rom:0x3170A8
WorldGoombarioUpdate = 0x802BD1D0; // type:func rom:0x3170F0
goombario_try_cancel_tweester = 0x802BD564; // type:func rom:0x317484
world_goombario_can_pause = 0x802BD5A8; // type:func rom:0x3174C8
func_802BD5D8_3174F8 = 0x802BD5D8; // type:func rom:0x3174F8
func_802BDB30_317A50 = 0x802BDB30; // type:func rom:0x317A50
func_802BDB84 = 0x802BDB84; // type:func rom:0x317AA4
WorldGoombarioSelectTattleMsg = 0x802BD5D8; // type:func rom:0x3174F8
WorldGoombarioTattleEnd = 0x802BDB30; // type:func rom:0x317A50
WorldGoombarioPutAway = 0x802BDB84; // type:func rom:0x317AA4
world_goombario_pre_battle = 0x802BDBBC; // type:func rom:0x317ADC
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
world_goombario_update = 0x802BDD8C; // type:data rom:0x317CAC
world_goombario_use_ability = 0x802BDDA8; // type:data rom:0x317CC8
world_goombario_put_away = 0x802BDE60; // type:data rom:0x317D80
EVS_GoombarioUpdate = 0x802BDD8C; // type:data rom:0x317CAC
EVS_GoombarioUseAbility = 0x802BDDA8; // type:data rom:0x317CC8
EVS_GoombarioPutAway = 0x802BDE60; // type:data rom:0x317D80
D_802BDE80_317DA0 = 0x802BDE80; // type:data rom:0x317DA0
jtbl_802BDE88_317DA8 = 0x802BDE88; // type:data rom:0x317DA8
func_802BD100_317E50 = 0x802BD100; // type:func rom:0x317E50
D_802BDF34 = 0x802BDF34; // type:data rom:0x317E54
D_802BDF38 = 0x802BDF38; // type:data rom:0x317E58
TattleHadInteractPrompt = 0x802BDF34; // type:data rom:0x317E54
TattleInteractNpc = 0x802BDF38; // type:data rom:0x317E58
D_802BDF3C = 0x802BDF3C; // type:data rom:0x317E5C
GoombarioTweesterPhysics = 0x802BDF40; // type:data rom:0x317E60
D_802BDF5C = 0x802BDF5C; // type:data rom:0x317E7C
GoombarioGetTattleID = 0x802BDF60; // type:data rom:0x317E80
D_802BDF64 = 0x802BDF64; // type:data rom:0x317E84
GoombarioTattleInteractionID = 0x802BDF60; // type:data rom:0x317E80
WorldGoombarioTattleActive = 0x802BDF64; // type:data rom:0x317E84
world_bombette_init = 0x802BD2D8; // type:func rom:0x318028
func_802BD300_318050 = 0x802BD300; // type:func rom:0x318050
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
world_watt_pre_battle = 0x802BDD9C; // type:func rom:0x31D90C
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
world_watt_sync_held_position = 0x802BE070; // type:func rom:0x31DBE0
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
func_802BD29C_320DEC = 0x802BD29C; // type:func rom:0x320DEC
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_802BD7DC = 0x802BD7DC; // type:func rom:0x32132C
func_802BD99C_3214EC = 0x802BD99C; // type:func rom:0x3214EC
func_802BDA90_3215E0 = 0x802BDA90; // type:func rom:0x3215E0
func_802BDDD8_321928 = 0x802BDDD8; // type:func rom:0x321928
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
world_lakilester_pre_battle = 0x802BFA00; // type:func rom:0x323550
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
LakilesterTweesterPhysicsPtr = 0x802BFE7C; // type:data rom:0x3239CC
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_while_riding = 0x802BFED4; // type:data rom:0x323A24
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_802BE0E8 = 0x802BE0E8; // type:data rom:0x324A38
D_802BE0EC = 0x802BE0EC; // type:data rom:0x324A3C
func_802BD14C_324A5C = 0x802BD14C; // type:func rom:0x324A5C
func_802BD4E0_324DF0 = 0x802BD4E0; // type:func rom:0x324DF0
GoompaUpdate = 0x802BD14C; // type:func rom:0x324A5C
goompa_try_cancel_tweester = 0x802BD4E0; // type:func rom:0x324DF0
GoompaUseAbility = 0x802BD524; // type:func rom:0x324E34
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
world_goompa_update = 0x802BD590; // type:data rom:0x324EA0
world_goompa_use_ability = 0x802BD5AC; // type:data rom:0x324EBC
world_goompa_put_away = 0x802BD5C8; // type:data rom:0x324ED8
EVS_WorldGoompaUpdate = 0x802BD590; // type:data rom:0x324EA0
EVS_WorldGoompaUseAbility = 0x802BD5AC; // type:data rom:0x324EBC
EVS_WorldGoompaPutAway = 0x802BD5C8; // type:data rom:0x324ED8
D_802BD5F0_324F00 = 0x802BD5F0; // type:data rom:0x324F00
world_goombaria_init = 0x802BD100; // type:func rom:0x324F10
GoombariaTakeOut = 0x802BD114; // type:func rom:0x324F24
GoombariaUpdate = 0x802BD14C; // type:func rom:0x324F5C
GoombariaUseAbility = 0x802BD1AC; // type:func rom:0x324FBC
GoombariaPutAway = 0x802BD1B4; // type:func rom:0x324FC4
world_goombaria_take_out = 0x802BD1F0; // type:data rom:0x325000
world_goombaria_update = 0x802BD20C; // type:data rom:0x32501C
world_goombaria_use_ability = 0x802BD228; // type:data rom:0x325038
world_goombaria_put_away = 0x802BD244; // type:data rom:0x325054
EVS_WorldGoombariaTakeOut = 0x802BD1F0; // type:data rom:0x325000
EVS_WorldGoombariaUpdate = 0x802BD20C; // type:data rom:0x32501C
EVS_WorldGoombariaUseAbility = 0x802BD228; // type:data rom:0x325038
EVS_WorldGoombariaPutAway = 0x802BD244; // type:data rom:0x325054
world_twink_init = 0x802BD100; // type:func rom:0x325070
TwinkTakeOut = 0x802BD110; // type:func rom:0x325080
TwinkUpdate = 0x802BD148; // type:func rom:0x3250B8
TwinkUseAbility = 0x802BD1A8; // type:func rom:0x325118
TwinkPutAway = 0x802BD1B0; // type:func rom:0x325120
world_twink_take_out = 0x802BD1F0; // type:data rom:0x325160
world_twink_update = 0x802BD20C; // type:data rom:0x32517C
world_twink_use_ability = 0x802BD228; // type:data rom:0x325198
world_twink_put_away = 0x802BD244; // type:data rom:0x3251B4
EVS_TwinkTakeOut = 0x802BD1F0; // type:data rom:0x325160
EVS_TwinkUpdate = 0x802BD20C; // type:data rom:0x32517C
EVS_TwinkUseAbility = 0x802BD228; // type:data rom:0x325198
EVS_TwinkPutAway = 0x802BD244; // type:data rom:0x3251B4
WorldItem_ShowUseSparkles = 0x802BD100; // type:func rom:0x3251D0
WorldItem_ShowHPGain = 0x802BD1AC; // type:func rom:0x32527C
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_FadeToTitleScreen = 0x802405EC; // type:func rom:0xE1EA4C
gv_01_ChangeStateToTitleScreen = 0x80240688; // type:func rom:0xE1EAE8
inspect_icon_UnkAngleFunc1 = 0x802B7000; // type:func rom:0xE20110
func_802B70B4_E201C4 = 0x802B70B4; // type:func rom:0xE201C4
func_802B71E8_E202F8 = 0x802B71E8; // type:func rom:0xE202F8
func_802B7450_E20560 = 0x802B7450; // type:func rom:0xE20560
func_802B75E8_E206F8 = 0x802B75E8; // type:func rom:0xE206F8
func_802B7728_E20838 = 0x802B7728; // type:func rom:0xE20838
func_802B79C8_E20AD8 = 0x802B79C8; // type:func rom:0xE20AD8
D_802B7A20_E20B30 = 0x802B7A20; // type:data rom:0xE20B30
D_802B7C20_E20D30 = 0x802B7C20; // type:data rom:0xE20D30
D_802B7C40_E20D50 = 0x802B7C40; // type:data rom:0xE20D50
D_802B7CB8_E20DC8 = 0x802B7CB8; // type:data rom:0xE20DC8
D_802B7D88_E20E98 = 0x802B7D88; // type:data rom:0xE20E98
D_802B7D90_E20EA0 = 0x802B7D90; // type:data rom:0xE20EA0
speech_bubble_UnkAngleFunc1 = 0x802B7000; // type:func rom:0xE20EB0
func_802B70B4 = 0x802B70B4; // type:func rom:0xE20F64
func_802B71C8 = 0x802B71C8; // type:func rom:0xE21078
func_802B742C = 0x802B742C; // type:func rom:0xE212DC
D_802B7710_E215C0 = 0x802B7710; // type:data rom:0xE215C0
D_802B7910_E217C0 = 0x802B7910; // type:data rom:0xE217C0
D_802B7930_E217E0 = 0x802B7930; // type:data rom:0xE217E0
D_802B79A8_E21858 = 0x802B79A8; // type:data rom:0xE21858
D_802B79B0_E21860 = 0x802B79B0; // type:data rom:0xE21860
D_802B79B8_E21868 = 0x802B79B8; // type:data rom:0xE21868
func_802B7000_2 = 0x802B7000; // type:func rom:0xE21870
func_802B704C = 0x802B704C; // type:func rom:0xE218BC
func_802B7140 = 0x802B7140; // type:func rom:0xE219B0
func_802B71D4 = 0x802B71D4; // type:func rom:0xE21A44
func_802B74F0 = 0x802B74F0; // type:func rom:0xE21D60
D_802B7640_E21EB0 = 0x802B7640; // type:data rom:0xE21EB0
D_802B7C60_E224D0 = 0x802B7C60; // type:data rom:0xE224D0
D_802B7C80_E224F0 = 0x802B7C80; // type:data rom:0xE224F0
D_802B7CA0_E22510 = 0x802B7CA0; // type:data rom:0xE22510
D_802B7D18_E22588 = 0x802B7D18; // type:data rom:0xE22588
func_802B7000_E225B0 = 0x802B7000; // type:func rom:0xE225B0
func_802B72C0_E22870 = 0x802B72C0; // type:func rom:0xE22870
func_802B735C_E2290C = 0x802B735C; // type:func rom:0xE2290C
D_802B7580_E22B30 = 0x802B7580; // type:data rom:0xE22B30
D_802B7BA0_E23150 = 0x802B7BA0; // type:data rom:0xE23150
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
inspect_icon_GetIconBrightnessForAngle = 0x802B7000; // type:func rom:0xE20110
interact_inspect_setup = 0x802B70B4; // type:func rom:0xE201C4
appendGfx_interact_prompt = 0x802B71E8; // type:func rom:0xE202F8
should_continue_inspect = 0x802B7450; // type:func rom:0xE20560
update_inspect_icon_pos = 0x802B75E8; // type:func rom:0xE206F8
interact_inspect_update = 0x802B7728; // type:func rom:0xE20838
interact_inspect_dismiss = 0x802B79C8; // type:func rom:0xE20AD8
inspect_icon_img = 0x802B7A20; // type:data rom:0xE20B30
inspect_icon_pal = 0x802B7C20; // type:data rom:0xE20D30
inspect_icon_gfx = 0x802B7C40; // type:data rom:0xE20D50
InspectIconPtr = 0x802B7CB8; // type:data rom:0xE20DC8
speech_bubble_GetIconBrightnessForAngle = 0x802B7000; // type:func rom:0xE20EB0
interact_speech_setup = 0x802B70B4; // type:func rom:0xE20F64
appendGfx_speech_bubble = 0x802B71C8; // type:func rom:0xE21078
interact_speech_update = 0x802B742C; // type:func rom:0xE212DC
speech_bubble_img = 0x802B7710; // type:data rom:0xE215C0
speech_bubble_pal = 0x802B7910; // type:data rom:0xE217C0
speech_bubble_gfx = 0x802B7930; // type:data rom:0xE217E0
SpeechBubblePtr = 0x802B79A8; // type:data rom:0xE21858
should_cancel_pulse_stone = 0x802B7000; // type:func rom:0xE21870
should_continue_pulse_stone = 0x802B704C; // type:func rom:0xE218BC
pulse_stone_notification_setup = 0x802B7140; // type:func rom:0xE219B0
appendGfx_pulse_stone_icon = 0x802B71D4; // type:func rom:0xE21A44
pulse_stone_notification_update = 0x802B74F0; // type:func rom:0xE21D60
pulse_stone_icon_img = 0x802B7640; // type:data rom:0xE21EB0
pulse_stone_icon_1_pal = 0x802B7C60; // type:data rom:0xE224D0
pulse_stone_icon_2_pal = 0x802B7C80; // type:data rom:0xE224F0
pulse_stone_icon_gfx = 0x802B7CA0; // type:data rom:0xE22510
PulseStonePtr = 0x802B7D18; // type:data rom:0xE22588
appendGfx_ispy_icon = 0x802B7000; // type:func rom:0xE225B0
ispy_notification_setup = 0x802B72C0; // type:func rom:0xE22870
ispy_notification_update = 0x802B735C; // type:func rom:0xE2290C
ispy_icon_img = 0x802B7580; // type:data rom:0xE22B30
ispy_icon_1_pal = 0x802B7BA0; // type:data rom:0xE23150
ispy_icon_2_pal = 0x802B7BC0; // type:data rom:0xE23170
ispy_icon_3_pal = 0x802B7BE0; // type:data rom:0xE23190
ispy_icon_gfx = 0x802B7C00; // type:data rom:0xE231B0
ISpyPtr = 0x802B7C78; // type:data rom:0xE23228
action_update_idle = 0x802B6000; // type:func rom:0xE23260
action_update_idle_peach = 0x802B61E4; // type:func rom:0xE23444
IdlePeachAnims = 0x802B6430; // type:data rom:0xE23690
@ -27125,7 +27121,6 @@ D_802B6EF0 = 0x802B6EF0; // type:data
D_802B6EF4 = 0x802B6EF4; // type:data
D_802B7140 = 0x802B7140; // type:data
func_802B71E8 = 0x802B71E8; //
D_802B79A8 = 0x802B79A8; // type:data
mdl_clearRenderTasks = 0x802B7E00; // type:data
D_802BCE20 = 0x802BCE20; // type:data
D_802BCE30 = 0x802BCE30; // type:data
@ -27133,7 +27128,7 @@ D_802BCE32 = 0x802BCE32; // type:data
D_802BCE34 = 0x802BCE34; // type:data
GoompaTweesterPhysics = 0x802BD600; // type:data
goompa_802BD600 = 0x802BD600; // type:data
D_802BDF30 = 0x802BDF30; // type:data
TattleHadSpeechPrompt = 0x802BDF30; // type:data
func_802BE070 = 0x802BE070; //
D_802BE0C0 = 0x802BE0C0; // type:data
D_802BE300 = 0x802BE300; // type:data