Decompile Player (#387)

* Setup player decomp

* Decompile z_player.c and z_player_lib.c

* Decompile remaining z_player.c functions

* Various player improvements

* Player progress (some non matchings and .data migrated)

* Player progress (reposition data and fix some non matchings)

* Cleanup, improve and document parts of z_player_lib.c/z_player.c

* Fix player renames in z_en_st.c

* Fix missing open/close disps in z_player.c

* Minor player fixes

* Address player comments
This commit is contained in:
Roman971
2020-09-19 03:45:39 +02:00
committed by GitHub
parent b29c268f37
commit 14191307e9
686 changed files with 16334 additions and 39630 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
gSaveContext.infTable[29] = 1;
}
func_8008ECAC(globalCtx, player);
Player_SetEquipmentData(globalCtx, player);
globalCtx->pauseCtx.unk_238 = 10;
}
+1 -1
View File
@@ -27,7 +27,7 @@ void func_800A9F6C(f32 a, u8 b, u8 c, u8 d) {
}
}
void func_800AA000(float a, u8 b, u8 c, u8 d) {
void func_800AA000(f32 a, u8 b, u8 c, u8 d) {
s32 temp1;
s32 temp2;
s32 i;
+3 -3
View File
@@ -10,7 +10,7 @@ static u32 sRandFloat;
/**
* Gets the next integer in the sequence of pseudo-random numbers.
*/
u32 Math_Rand_Next() {
u32 Math_Rand_Next(void) {
return sRandInt = (sRandInt * 1664525) + 1013904223;
}
@@ -26,7 +26,7 @@ void Math_Rand_Seed(u32 seed) {
* the next integer and masking it to an IEEE-754 compliant floating-point number
* between 1.0f and 2.0f, returning the result subtract 1.0f.
*/
f32 Math_Rand_ZeroOne() {
f32 Math_Rand_ZeroOne(void) {
sRandInt = (sRandInt * 1664525) + 1013904223;
sRandFloat = ((sRandInt >> 9) | 0x3F800000);
return *((f32*)&sRandFloat) - 1.0f;
@@ -36,7 +36,7 @@ f32 Math_Rand_ZeroOne() {
* Returns a pseudo-random floating-point number between -0.5f and 0.5f by the same
* manner in which Math_Rand_ZeroOne generates its result.
*/
f32 Math_Rand_Centered() {
f32 Math_Rand_Centered(void) {
sRandInt = (sRandInt * 1664525) + 1013904223;
sRandFloat = ((sRandInt >> 9) | 0x3F800000);
return *((f32*)&sRandFloat) - 1.5f;
+58 -48
View File
@@ -213,7 +213,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext*
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s")
#endif
void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, UNK_PTR arg3, s32 arg4, UNK_PTR arg5) {
void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, Vec3f* arg3, s32 arg4, Vec3f* arg5) {
if (arg1 == arg2) {
Matrix_MultVec3f(arg3, &actor->unk_CC[0]);
} else if (arg1 == arg4) {
@@ -667,7 +667,7 @@ void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
titleCtx->delayA = titleCtx->delayB = titleCtx->unk_E = titleCtx->unk_C = 0;
}
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s16 arg3, s16 arg4,
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 arg3, s16 arg4,
u8 arg5, u8 arg6) {
titleCtx->texture = texture;
titleCtx->unk_4 = arg3;
@@ -678,7 +678,7 @@ void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx
titleCtx->delayB = 0;
}
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s32 arg3, s32 arg4,
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 arg3, s32 arg4,
s32 arg5, s32 arg6, s32 arg7) {
Scene* loadedScene = globalCtx->loadedScene;
u32 size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart;
@@ -886,9 +886,9 @@ void func_8002D9A4(Actor* actor, f32 arg1) {
actor->velocity.y = -Math_Sins(actor->posRot.rot.x) * arg1;
}
void func_8002D9F8(Actor* actor, UNK_PTR arg1) {
void func_8002D9F8(Actor* actor, SkelAnime* skelAnime) {
Vec3f sp1C;
func_800A54FC(arg1, &sp1C, actor->shape.rot.y);
func_800A54FC(skelAnime, &sp1C, actor->shape.rot.y);
actor->posRot.pos.x += sp1C.x * actor->scale.x;
actor->posRot.pos.y += sp1C.y * actor->scale.y;
actor->posRot.pos.z += sp1C.z * actor->scale.z;
@@ -984,16 +984,19 @@ s32 func_8002DD78(Player* player) {
s32 func_8002DDA8(GlobalContext* globalCtx) {
Player* player = PLAYER;
return (player->stateFlags1 & 0x800) || func_8002DD78(player);
}
s32 func_8002DDE4(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->stateFlags2 & 0x8;
}
s32 func_8002DDF4(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->stateFlags2 & 0x1000;
}
@@ -1015,32 +1018,34 @@ void func_8002DE74(GlobalContext* globalCtx, Player* player) {
}
}
void func_8002DECC(GlobalContext* globalCtx, Player* player, Actor* actor) {
player->rideActor = actor;
void func_8002DECC(GlobalContext* globalCtx, Player* player, Actor* horse) {
player->rideActor = horse;
player->stateFlags1 |= 0x800000;
actor->child = &player->actor;
horse->child = &player->actor;
}
s32 func_8002DEEC(Player* player) {
return (player->stateFlags1 & 0x20000080) || player->action;
return (player->stateFlags1 & 0x20000080) || (player->csMode != 0);
}
void func_8002DF18(GlobalContext* globalCtx, Player* player) {
func_8006DC68(globalCtx, player);
}
u32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 newAction) {
s32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 csMode) {
Player* player = PLAYER;
player->action = newAction;
player->csMode = csMode;
player->unk_448 = actor;
player->unk_46A = 0;
return 1;
}
s32 func_8002DF54(GlobalContext* globalCtx, Actor* actor, u8 arg2) {
s32 func_8002DF54(GlobalContext* globalCtx, Actor* actor, u8 csMode) {
Player* player = PLAYER;
func_8002DF38(globalCtx, actor, arg2);
func_8002DF38(globalCtx, actor, csMode);
player->unk_46A = 1;
return 1;
@@ -1475,30 +1480,30 @@ u32 func_8002F194(Actor* actor, GlobalContext* globalCtx) {
return 0;
}
s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u32 arg4) {
s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u32 exchangeItemId) {
Player* player = PLAYER;
// This is convoluted but it seems like it must be a single if statement to match
if ((player->actor.flags & 0x100) || ((arg4 != 0) && func_8008E988(globalCtx)) ||
if ((player->actor.flags & 0x100) || ((exchangeItemId != EXCH_ITEM_NONE) && Player_InCsMode(globalCtx)) ||
((actor->unk_10C == 0) &&
((arg3 < fabsf(actor->yDistFromLink)) || (player->targetActorDistance < actor->xzDistFromLink) ||
(arg2 < actor->xzDistFromLink)))) {
return 0;
}
player->naviTargetActor = actor;
player->targetActor = actor;
player->targetActorDistance = actor->xzDistFromLink;
player->exchangeItemId = arg4;
player->exchangeItemId = exchangeItemId;
return 1;
}
s32 func_8002F298(Actor* actor, GlobalContext* globalCtx, f32 arg2, u32 arg3) {
return func_8002F1C4(actor, globalCtx, arg2, arg2, arg3);
s32 func_8002F298(Actor* actor, GlobalContext* globalCtx, f32 arg2, u32 exchangeItemId) {
return func_8002F1C4(actor, globalCtx, arg2, arg2, exchangeItemId);
}
s32 func_8002F2CC(Actor* actor, GlobalContext* globalCtx, f32 arg2) {
return func_8002F298(actor, globalCtx, arg2, 0);
return func_8002F298(actor, globalCtx, arg2, EXCH_ITEM_NONE);
}
s32 func_8002F2F4(Actor* actor, GlobalContext* globalCtx) {
@@ -1516,6 +1521,7 @@ u32 func_8002F334(Actor* actor, GlobalContext* globalCtx) {
s8 func_8002F368(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->exchangeItemId;
}
@@ -1538,20 +1544,20 @@ u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) {
s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) {
Player* player = PLAYER;
s16 var;
s32 abs_var;
s16 yawDiff;
s32 absYawDiff;
if (!(player->stateFlags1 & 0x3C7080) && func_8008F29C(player) < 0) {
if ((((player->heldActor != NULL) || (actor == player->naviTargetActor)) && (getItemId > 0) &&
(getItemId < 0x7E)) ||
if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) {
if ((((player->heldActor != NULL) || (actor == player->targetActor)) && (getItemId > GI_NONE) &&
(getItemId < GI_MAX)) ||
(!(player->stateFlags1 & 0x20000800))) {
if ((actor->xzDistFromLink < xzRange) && (fabsf(actor->yDistFromLink) < yRange)) {
var = actor->yawTowardsLink - player->actor.shape.rot.y;
abs_var = ABS(var);
if ((getItemId != 0) || (player->getItemDirection < abs_var)) {
yawDiff = actor->yawTowardsLink - player->actor.shape.rot.y;
absYawDiff = ABS(yawDiff);
if ((getItemId != GI_NONE) || (player->getItemDirection < absYawDiff)) {
player->getItemId = getItemId;
player->interactRangeActor = actor;
player->getItemDirection = abs_var;
player->getItemDirection = absYawDiff;
return 1;
}
}
@@ -1566,7 +1572,7 @@ void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId) {
}
void func_8002F580(Actor* actor, GlobalContext* globalCtx) {
func_8002F554(actor, globalCtx, 0);
func_8002F554(actor, globalCtx, GI_NONE);
}
u32 Actor_HasNoParent(Actor* actor, GlobalContext* globalCtx) {
@@ -1607,11 +1613,11 @@ u32 Actor_HasChild(GlobalContext* globalCtx, Actor* actor) {
}
}
u32 func_8002F63C(GlobalContext* globalCtx, Actor* actor, s32 arg2) {
u32 func_8002F63C(GlobalContext* globalCtx, Actor* horse, s32 arg2) {
Player* player = PLAYER;
if (!(player->stateFlags1 & 0x003C7880)) {
player->rideActor = actor;
player->rideActor = horse;
player->unk_43C = arg2;
return 1;
}
@@ -1629,6 +1635,7 @@ u32 Actor_HasNoChild(GlobalContext* globalCtx, Actor* actor) {
void func_8002F698(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6) {
Player* player = PLAYER;
player->unk_8A0 = arg6;
player->unk_8A1 = arg5;
player->unk_8A2 = arg3;
@@ -1712,7 +1719,7 @@ void func_8002F994(Actor* actor, s32 arg1) {
}
}
s32 func_8002F9EC(GlobalContext* globalCtx, Actor* actor, UNK_TYPE arg2, UNK_TYPE arg3, UNK_TYPE arg4) {
s32 func_8002F9EC(GlobalContext* globalCtx, Actor* actor, CollisionPoly* arg2, u32 arg3, Vec3f* arg4) {
if (func_80041D4C(&globalCtx->colCtx, arg2, arg3) == 8) {
globalCtx->unk_11D30[0] = 1;
func_8005DFAC(globalCtx, 0, arg4);
@@ -2028,7 +2035,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) {
}
if ((player->stateFlags1 & 0x40) && ((player->actor.textId & 0xFF00) != 0x600)) {
sp74 = player->naviTargetActor;
sp74 = player->targetActor;
}
for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, sp80++) {
@@ -2053,7 +2060,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) {
Actor_Kill(actor);
actor = actor->next;
} else if ((unkFlag && !(actor->flags & unkFlag)) ||
(!unkFlag && unkCondition && (sp74 != actor) && (actor != player->navi) &&
(!unkFlag && unkCondition && (sp74 != actor) && (actor != player->naviActor) &&
(actor != player->heldActor) && (&player->actor != actor->parent))) {
func_80061E8C(&actor->colChkInfo);
actor = actor->next;
@@ -2415,7 +2422,7 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) {
if ((HREG(64) != 1) || (HREG(72) != 0)) {
if (globalCtx->actorCtx.unk_03 != 0) {
func_8003115C(globalCtx, invisibleActorCounter, invisibleActors);
if ((globalCtx->csCtx.state != 0) || func_8008E988(globalCtx)) {
if ((globalCtx->csCtx.state != 0) || Player_InCsMode(globalCtx)) {
func_800304B0(globalCtx);
}
}
@@ -2800,12 +2807,12 @@ void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCt
for (i = 0; i < nbTransitionActors; i++) {
if (transitionActor->id >= 0) {
if (((transitionActor->frontRoom >= 0) &&
((transitionActor->frontRoom == globalCtx->roomCtx.curRoom.num) ||
(transitionActor->frontRoom == globalCtx->roomCtx.prevRoom.num))) ||
((transitionActor->backRoom >= 0) &&
((transitionActor->backRoom == globalCtx->roomCtx.curRoom.num) ||
(transitionActor->backRoom == globalCtx->roomCtx.prevRoom.num)))) {
if (((transitionActor->sides[0].room >= 0) &&
((transitionActor->sides[0].room == globalCtx->roomCtx.curRoom.num) ||
(transitionActor->sides[0].room == globalCtx->roomCtx.prevRoom.num))) ||
((transitionActor->sides[1].room >= 0) &&
((transitionActor->sides[1].room == globalCtx->roomCtx.curRoom.num) ||
(transitionActor->sides[1].room == globalCtx->roomCtx.prevRoom.num)))) {
Actor_Spawn(actorCtx, globalCtx, (s16)(transitionActor->id & 0x1FFF), transitionActor->pos.x,
transitionActor->pos.y, transitionActor->pos.z, 0, transitionActor->rotY, 0,
(i << 0xA) + transitionActor->params);
@@ -2955,7 +2962,7 @@ Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** a
D_8015BBF0 = D_8015BBF4 = FLT_MAX;
D_8015BBF8 = 0x7FFFFFFF;
if (!func_8008E988(globalCtx)) {
if (!Player_InCsMode(globalCtx)) {
entry = &D_801160A0[0];
actorCtx->targetCtx.unk_90 = NULL;
@@ -3376,6 +3383,7 @@ s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) {
s32 func_80033A84(GlobalContext* globalCtx, Actor* actor) {
Player* player = PLAYER;
if ((player->stateFlags1 & 0x10) && (actor->unk_10C != 0)) {
return 1;
} else {
@@ -3385,6 +3393,7 @@ s32 func_80033A84(GlobalContext* globalCtx, Actor* actor) {
s32 func_80033AB8(GlobalContext* globalCtx, Actor* actor) {
Player* player = PLAYER;
if ((player->stateFlags1 & 0x10) && (actor->unk_10C == 0)) {
return 1;
} else {
@@ -3904,6 +3913,7 @@ s32 func_80035124(Actor* actor, GlobalContext* globalCtx) {
u8 func_800353E8(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->unk_845;
}
@@ -4007,11 +4017,11 @@ void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag) {
actor->unk_116 = 0x04;
} else if (colBody->acHitItem->toucher.flags & 0x8000) {
actor->unk_116 = 0x08;
} else if ((colBody->acHitItem->toucher.flags << 0xF) < 0) {
} else if (colBody->acHitItem->toucher.flags & 0x10000) {
actor->unk_116 = 0x10;
} else if (colBody->acHitItem->toucher.flags & 0x2000) {
actor->unk_116 = 0x20;
} else if ((colBody->acHitItem->toucher.flags << 0xC) < 0) {
} else if (colBody->acHitItem->toucher.flags & 0x80000) {
if (freezeFlag) {
actor->freezeTimer = colBody->acHitItem->toucher.damage;
}
@@ -4107,9 +4117,9 @@ void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2) {
if (actor->floorPoly != NULL) {
floorPoly = actor->floorPoly;
sp44 = floorPoly->norm.x * (1.f / 32767);
sp40 = floorPoly->norm.y * (1.f / 32767);
sp3C = floorPoly->norm.z * (1.f / 32767);
sp44 = floorPoly->norm.x * (1.0f / 32767);
sp40 = floorPoly->norm.y * (1.0f / 32767);
sp3C = floorPoly->norm.z * (1.0f / 32767);
sp38 = Math_Sins(arg1);
sp34 = Math_Coss(arg1);
+10 -10
View File
@@ -1907,9 +1907,9 @@ s32 func_80043D18(Camera* camera, Vec3f* arg1, struct_80043D18* arg2) {
arg2->unk_24 = sp44;
}
arg2->unk_0C.x = arg2->unk_18->norm.x * (1.f / 32767);
arg2->unk_0C.y = arg2->unk_18->norm.y * (1.f / 32767);
arg2->unk_0C.z = arg2->unk_18->norm.z * (1.f / 32767);
arg2->unk_0C.x = arg2->unk_18->norm.x * (1.0f / 32767.0f);
arg2->unk_0C.y = arg2->unk_18->norm.y * (1.0f / 32767.0f);
arg2->unk_0C.z = arg2->unk_18->norm.z * (1.0f / 32767.0f);
arg2->unk_00.x = arg2->unk_0C.x + sp68.x;
arg2->unk_00.y = arg2->unk_0C.y + sp68.y;
arg2->unk_00.z = arg2->unk_0C.z + sp68.z;
@@ -1965,9 +1965,9 @@ f32 func_80044434(Camera* camera, Vec3f* arg1, Vec3f* arg2, s32* arg3) {
arg1->z = 0.0f;
arg1->y = 1.0f;
} else {
arg1->x = sp28->norm.x * (1.f / 32767);
arg1->y = sp28->norm.y * (1.f / 32767);
arg1->z = sp28->norm.z * (1.f / 32767);
arg1->x = sp28->norm.x * (1.f / 32767.0f);
arg1->y = sp28->norm.y * (1.f / 32767.0f);
arg1->z = sp28->norm.z * (1.f / 32767.0f);
}
return temp_ret;
@@ -3369,7 +3369,7 @@ void func_80059EC8(Camera* camera) {
player->actor.freezeTimer = 0;
player->stateFlags1 &= ~0x20000000;
if (player->action != 0) {
if (player->csMode != 0) {
func_8002DF54(camera->globalCtx, &player->actor, 7);
osSyncPrintf("camera: player demo end!!\n");
}
@@ -3545,8 +3545,8 @@ s32 Camera_ChangeMode(Camera* camera, s16 mode, u8 arg2) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ChangeMode.s")
#endif
void func_8005A444(Camera* camera, s16 arg1) {
Camera_ChangeMode(camera, arg1, 0);
s32 func_8005A444(Camera* camera, s16 arg1) {
return Camera_ChangeMode(camera, arg1, 0);
}
s32 func_8005A470(Camera* camera, s16 arg1) {
@@ -3927,7 +3927,7 @@ Vec3f* func_8005AFB4(Vec3f* dst, Camera* camera) {
}
void Camera_SetCameraData(Camera* camera, s16 arg1, CutsceneCameraPoint* atPoints, CutsceneCameraPoint* eyePoints,
s16 relativeToPlayer, s16 arg5) {
s16 relativeToPlayer, s16 arg5, s32 arg6) {
if (arg1 & 0x1) {
camera->atPoints = atPoints;
}
+1 -1
View File
@@ -54,7 +54,7 @@ void func_800636C0() {
// Called when free movement is active.
// 8011D394 to enable camera debugger
void func_8006375C(s32 arg0, s32 arg1, float* d_80855320) {
void func_8006375C(s32 arg0, s32 arg1, const char* text) {
}
// Copy Camera Debugger Text
+4 -4
View File
@@ -258,7 +258,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
break;
case 15:
if (sp3F != 0) {
TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->getItemModel, 0xA0, 0x78,
TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->giObjectSegment, 0xA0, 0x78,
0x90, 0x18, 0x14);
}
break;
@@ -882,9 +882,9 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
break;
case 71:
gSaveContext.equips.equipment |= 0x0100;
func_8008ECAC(globalCtx, player);
Player_SetEquipmentData(globalCtx, player);
gSaveContext.equips.equipment |= 0x1000;
func_8008ECAC(globalCtx, player);
Player_SetEquipmentData(globalCtx, player);
globalCtx->linkAgeOnLoad = 1;
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
@@ -1925,7 +1925,7 @@ void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) {
u8 i;
if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE) && !func_8008E988(globalCtx)) {
if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE) && !Player_InCsMode(globalCtx)) {
gSaveContext.cutsceneIndex = 0xFFFD;
}
+2 -2
View File
@@ -1,7 +1,7 @@
#include <ultra64.h>
#include <global.h>
u16 sReactionTextIds[][9] = {
u16 sReactionTextIds[][PLAYER_MASK_MAX] = {
{ 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 },
{ 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B },
{ 0x0000, 0x7128, 0x712B, 0x7128, 0x7128, 0x7129, 0x7128, 0x712B, 0x7128 },
@@ -65,6 +65,6 @@ u16 sReactionTextIds[][9] = {
};
u16 Text_GetFaceReaction(GlobalContext* globalCtx, u32 reactionSet) {
u8 currentMask = func_8008F080(globalCtx);
u8 currentMask = Player_GetMask(globalCtx);
return sReactionTextIds[reactionSet][currentMask];
}
+5 -11
View File
@@ -167,20 +167,14 @@ s32 func_80077C6C(f32* pValue, f32 target, f32 incrStep, f32 decrStep) {
return 0;
}
typedef struct {
/* 0x00 */ char unk_00[0x14];
/* 0x14 */ s8 unk_14;
/* 0x14 */ s8 unk_15;
} struct_80077D10;
void func_80077D10(f32* arg0, s16* arg1, Input* input) {
f32 relX = input->rel.in.x;
f32 relY = input->rel.in.y;
void func_80077D10(f32* arg0, s16* arg1, struct_80077D10* arg2) {
f32 var1 = arg2->unk_14;
f32 var2 = arg2->unk_15;
*arg0 = sqrtf(SQ(var1) + SQ(var2));
*arg0 = sqrtf(SQ(relX) + SQ(relY));
*arg0 = (60.0f < *arg0) ? 60.0f : *arg0;
*arg1 = atan2s(var2, -var1);
*arg1 = atan2s(relY, -relX);
}
s16 Math_Rand_S16Offset(s16 base, s16 range) {
+2 -4
View File
@@ -176,7 +176,7 @@ s32 func_80078E84(GlobalContext* globalCtx) {
if (interfaceCtx->unk_226 <= 0) {
interfaceCtx->unk_226 = 0;
globalCtx->unk_11D58(globalCtx, -(gSaveContext.health + 1));
globalCtx->damagePlayer(globalCtx, -(gSaveContext.health + 1));
return 1;
}
}
@@ -381,8 +381,6 @@ void Health_Draw(GlobalContext* globalCtx) {
CLOSE_DISPS(gfxCtx, "../z_lifemeter.c", 606);
}
u32 Health_IsCritical(void);
void Health_HandleCriticalAlarm(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
@@ -391,7 +389,7 @@ void Health_HandleCriticalAlarm(GlobalContext* globalCtx) {
if (interfaceCtx->unk_22A <= 0) {
interfaceCtx->unk_22A = 0;
interfaceCtx->unk_22C = 0;
if (!func_8008E988(globalCtx) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
if (!Player_InCsMode(globalCtx) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
Health_IsCritical() && !Gameplay_InCsMode(globalCtx)) {
func_80078884(NA_SE_SY_HITPOINT_ALARM);
}
+14 -14
View File
@@ -1240,8 +1240,8 @@ void Interface_InitHorsebackArchery(GlobalContext* globalCtx) {
}
void func_800849EC(GlobalContext* globalCtx) {
gSaveContext.equipment |= gBitFlags[2] << gEquipShifts[0];
gSaveContext.equipment ^= 8 << gEquipShifts[0];
gSaveContext.equipment |= gBitFlags[2] << gEquipShifts[EQUIP_SWORD];
gSaveContext.equipment ^= 8 << gEquipShifts[EQUIP_SWORD];
if (gBitFlags[3] & gSaveContext.equipment) {
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KNIFE;
@@ -1380,7 +1380,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
gSaveContext.equipment |= gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD];
if (item == ITEM_SWORD_BGS) {
gSaveContext.bgsHitsLeft = 8;
gSaveContext.swordHealth = 8;
if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF) {
gSaveContext.equipment ^= 8 << gEquipShifts[EQUIP_SWORD];
@@ -1997,24 +1997,24 @@ s32 Inventory_HasSpecificBottle(u8 bottleItem) {
}
}
void Inventory_UpdateBottleItem(GlobalContext* globalCtx, u8 item, u8 cButton) {
osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, cButton,
gSaveContext.equips.cButtonSlots[cButton - 1],
gSaveContext.items[gSaveContext.equips.cButtonSlots[cButton - 1]]);
void Inventory_UpdateBottleItem(GlobalContext* globalCtx, u8 item, u8 button) {
osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, button,
gSaveContext.equips.cButtonSlots[button - 1],
gSaveContext.items[gSaveContext.equips.cButtonSlots[button - 1]]);
// Special case to only empty half of a Lon Lon Milk Bottle
if ((gSaveContext.items[gSaveContext.equips.cButtonSlots[cButton - 1]] == ITEM_MILK_BOTTLE) &&
if ((gSaveContext.items[gSaveContext.equips.cButtonSlots[button - 1]] == ITEM_MILK_BOTTLE) &&
(item == ITEM_BOTTLE)) {
item = ITEM_MILK_HALF;
}
gSaveContext.items[gSaveContext.equips.cButtonSlots[cButton - 1]] = item;
gSaveContext.equips.buttonItems[cButton] = item;
gSaveContext.items[gSaveContext.equips.cButtonSlots[button - 1]] = item;
gSaveContext.equips.buttonItems[button] = item;
Interface_LoadItemIcon1(globalCtx, cButton);
Interface_LoadItemIcon1(globalCtx, button);
globalCtx->pauseCtx.unk_23E = item;
gSaveContext.buttonStatus[cButton] = BTN_ENABLED;
gSaveContext.buttonStatus[button] = BTN_ENABLED;
}
s32 Inventory_ConsumeFairy(GlobalContext* globalCtx) {
@@ -3605,7 +3605,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
gSaveContext.timer1State = 10;
if (D_80125A5C != 0) {
gSaveContext.health = 0;
globalCtx->unk_11D58(globalCtx, -(gSaveContext.health + 2));
globalCtx->damagePlayer(globalCtx, -(gSaveContext.health + 2));
}
D_80125A5C = 0;
} else if (gSaveContext.timer1Value > 60) {
@@ -4156,7 +4156,7 @@ void Interface_Update(GlobalContext* globalCtx) {
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (msgCtx->msgMode == 0) &&
(globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->transitionMode == 0) &&
((globalCtx->csCtx.state == 0) || !func_8008E988(globalCtx))) {
((globalCtx->csCtx.state == 0) || !Player_InCsMode(globalCtx))) {
if ((gSaveContext.magicAcquired != 0) && (gSaveContext.magicLevel == 0)) {
gSaveContext.magicLevel = gSaveContext.doubleMagic + 1;
gSaveContext.unk_13F0 = 8;
+7 -5
View File
@@ -178,7 +178,7 @@ void Gameplay_Destroy(GlobalContext* globalCtx) {
if (gSaveContext.linkAge != globalCtx->linkAgeOnLoad) {
Inventory_SwapAgeEquipment();
func_8008ECAC(globalCtx, player);
Player_SetEquipmentData(globalCtx, player);
}
func_80031C3C(&globalCtx->actorCtx, globalCtx);
@@ -925,7 +925,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) {
// Translates to: "Changing viewpoint is prohibited due to the kaleidoscope"
osSyncPrintf(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST);
} else if (func_8008E988(globalCtx)) {
} else if (Player_InCsMode(globalCtx)) {
// Translates to: "Changing viewpoint is prohibited during the cutscene"
osSyncPrintf(VT_FGCOL(CYAN) "デモ中につき視点変更を禁止しております\n" VT_RST);
} else if (YREG(15) == 0x10) {
@@ -1372,7 +1372,7 @@ void Gameplay_Main(GlobalContext* globalCtx) {
// original name: "Game_play_demo_mode_check"
s32 Gameplay_InCsMode(GlobalContext* globalCtx) {
return (globalCtx->csCtx.state != 0) || func_8008E988(globalCtx);
return (globalCtx->csCtx.state != 0) || Player_InCsMode(globalCtx);
}
f32 func_800BFCB8(GlobalContext* globalCtx, MtxF* mf, Vec3f* vec) {
@@ -1801,18 +1801,20 @@ s32 func_800C0D28(GlobalContext* globalCtx) {
s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) {
TransitionActorEntry* transitionActor;
s32 frontRoom;
if (actor->type != ACTORTYPE_DOOR) {
return 0;
}
transitionActor = &globalCtx->transitionActorList[(u16)actor->params >> 10];
frontRoom = transitionActor->sides[0].room;
if (transitionActor->backRoom == transitionActor->frontRoom) {
if (frontRoom == transitionActor->sides[1].room) {
return 0;
}
if (actor->room == transitionActor->frontRoom) {
if (frontRoom == actor->room) {
*yaw = actor->shape.rot.y;
} else {
*yaw = actor->shape.rot.y + 0x8000;
+12 -10
View File
@@ -1,24 +1,26 @@
#include <global.h>
#define FLAGS 0x06000035
void (*sPlayerCallInitFunc)(Actor* thisx, GlobalContext* globalCtx);
void (*sPlayerCallDestroyFunc)(Actor* thisx, GlobalContext* globalCtx);
void (*sPlayerCallUpdateFunc)(Actor* thisx, GlobalContext* globalCtx);
void (*sPlayerCallDrawFunc)(Actor* thisx, GlobalContext* globalCtx);
void func_80846CD8(Actor* thisx, GlobalContext* globalCtx);
void func_8084AB54(Actor* thisx, GlobalContext* globalCtx);
void func_80849EA8(Actor* thisx, GlobalContext* globalCtx);
void func_8084A5C4(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Destroy(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Update(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Draw(Actor* thisx, GlobalContext* globalCtx);
void Player_Init(Actor* thisx, GlobalContext* globalCtx);
void Player_Destroy(Actor* thisx, GlobalContext* globalCtx);
void Player_Update(Actor* thisx, GlobalContext* globalCtx);
void Player_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Player_InitVars = {
ACTOR_PLAYER,
ACTORTYPE_PLAYER,
0x6000035,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(Player),
(ActorFunc)PlayerCall_Init,
@@ -28,10 +30,10 @@ const ActorInit Player_InitVars = {
};
void PlayerCall_InitFuncPtrs() {
sPlayerCallInitFunc = KaleidoManager_GetRamAddr(func_80846CD8);
sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(func_8084AB54);
sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(func_80849EA8);
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(func_8084A5C4);
sPlayerCallInitFunc = KaleidoManager_GetRamAddr(Player_Init);
sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(Player_Destroy);
sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(Player_Update);
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(Player_Draw);
}
void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx) {
+1369 -399
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -519,8 +519,8 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
LOG_NUM("game_play->room_rom_address.num", globalCtx->nbRooms, "../z_room.c", 912);
for (j = 0; j < globalCtx->nbTransitionActors; j++) {
s8 frontRoom = transitionActor->frontRoom;
s8 backRoom = transitionActor->backRoom;
s8 frontRoom = transitionActor->sides[0].room;
s8 backRoom = transitionActor->sides[1].room;
u32 frontRoomSize = (frontRoom < 0) ? 0 : roomList[frontRoom].vromEnd - roomList[frontRoom].vromStart;
u32 backRoomSize = (backRoom < 0) ? 0 : roomList[backRoom].vromEnd - roomList[backRoom].vromStart;
u32 cumulRoomSize = (frontRoom != backRoom) ? frontRoomSize + backRoomSize : frontRoomSize;
@@ -599,7 +599,7 @@ s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) {
gSegments[3] = VIRTUAL_TO_PHYSICAL(roomCtx->unk_34);
Scene_ExecuteCommands(globalCtx, roomCtx->curRoom.segment);
func_8008E750(globalCtx, PLAYER);
Player_SetBootData(globalCtx, PLAYER);
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
return 1;
@@ -77,7 +77,7 @@ void ArmsHook_Wait(ArmsHook* this, GlobalContext* globalCtx) {
if (this->actor.parent == NULL) {
player = PLAYER;
// get correct timer length for hookshot or longshot
length = (player->heldItemActionParam == 0x10) ? 13 : 26;
length = (player->heldItemActionParam == PLAYER_AP_HOOKSHOT) ? 13 : 26;
ArmsHook_SetupAction(this, ArmsHook_Shoot);
func_8002D9A4(&this->actor, 20.0f);
@@ -111,8 +111,8 @@ void ArmsHook_DetachHookFromActor(ArmsHook* this) {
s32 ArmsHook_CheckForCancel(ArmsHook* this) {
Player* player = (Player*)this->actor.parent;
if (func_8008F104(player)) {
if ((player->unk_154 != player->heldItemActionParam) || ((player->actor.flags & 0x100)) ||
if (Player_HoldsHookshot(player)) {
if ((player->itemActionParam != player->heldItemActionParam) || ((player->actor.flags & 0x100)) ||
((player->stateFlags1 & 0x4000080))) {
this->timer = 0;
ArmsHook_DetachHookFromActor(this);
@@ -151,7 +151,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
f32 velocity;
s32 pad1;
if ((this->actor.parent == NULL) || (!func_8008F104(player))) {
if ((this->actor.parent == NULL) || (!Player_HoldsHookshot(player))) {
ArmsHook_DetachHookFromActor(this);
Actor_Kill(&this->actor);
return;
@@ -310,21 +310,21 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
f32 sp58;
if (player->actor.draw != NULL) {
if (player->unk_15D == 0xF) {
if (player->rightHandType == 15) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_arms_hook.c", 850);
if ((ArmsHook_Shoot != this->actionFunc) || (this->timer <= 0)) {
Matrix_MultVec3f(&D_80865B70, &this->unk_1E8);
Matrix_MultVec3f(&D_80865B88, &sp6C);
Matrix_MultVec3f(&D_80865B94, &sp60);
this->unk_1CC = 0;
this->hookInfo.active = 0;
} else {
Matrix_MultVec3f(&D_80865B7C, &this->unk_1E8);
Matrix_MultVec3f(&D_80865BA0, &sp6C);
Matrix_MultVec3f(&D_80865BAC, &sp60);
}
func_80090480(globalCtx, &this->collider.base, &this->unk_1CC, &sp6C, &sp60);
func_80090480(globalCtx, &this->collider, &this->hookInfo, &sp6C, &sp60);
func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(oGfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arms_hook.c", 895),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -11,8 +11,7 @@ typedef void (*ArmsHookActionFunc)(struct ArmsHook*, GlobalContext*);
typedef struct ArmsHook {
/* 0x0000 */ Actor actor;
/* 0x014C */ ColliderQuad collider;
/* 0x01CC */ s32 unk_1CC;
/* 0x01D0 */ char unk_1D0[0x18];
/* 0x01CC */ WeaponInfo hookInfo;
/* 0x01E8 */ Vec3f unk_1E8;
/* 0x01F4 */ Vec3f unk_1F4;
/* 0x0200 */ Actor* grabbed;
@@ -363,7 +363,7 @@ void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) {
if (this->unk_168 == 0) {
do {
} while (0);
func_8005A77C(globalCtx->cameraPtrs[0], (s16)this->unk_1B8);
func_8005A77C(globalCtx->cameraPtrs[0], this->unk_1B8);
func_8005ACFC(globalCtx->cameraPtrs[0], 4);
}
}
@@ -479,7 +479,7 @@ void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) {
this->unk_1D8 -= 1;
return;
}
if (!func_8008E988(globalCtx) && this->unk_1D8 > 0) {
if (!Player_InCsMode(globalCtx) && this->unk_1D8 > 0) {
this->unk_1D8 -= 1;
}
temp = this->collider.base.acFlags;
@@ -200,7 +200,7 @@ void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) {
static UNK_TYPE D_80881018 = 0;
Player* player = PLAYER;
if ((D_80880F30 == 0) && (func_8008E988(globalCtx) == 0)) {
if ((D_80880F30 == 0) && (!Player_InCsMode(globalCtx))) {
if (!Math_ApproxF(&this->dyna.actor.posRot.pos.x, this->dyna.actor.initPosRot.pos.x, 0.5f)) {
func_8002F974(&this->dyna.actor, NA_SE_EV_TRAP_OBJ_SLIDE - SFX_FLAG);
} else if (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) {
@@ -403,9 +403,10 @@ void func_808809E4(BgHakaTrap* this, GlobalContext* globalCtx, s16 arg2) {
func_8002DBD0(&this->dyna.actor, &sp18, &player->actor.posRot.pos);
if ((fabsf(sp18.x) < 70.0f) && (fabsf(sp18.y) < 100.0f) && (sp18.z < 500.0f) && (PLAYER->currentBoots != 1)) {
player->fanWindSpeed = ((500.0f - sp18.z) * 0.06f + 5.0f) * arg2 * (1.0f / 14848.0f) * (2.0f / 3.0f);
player->fanWindDirection = this->dyna.actor.shape.rot.y;
if ((fabsf(sp18.x) < 70.0f) && (fabsf(sp18.y) < 100.0f) && (sp18.z < 500.0f) &&
(PLAYER->currentBoots != PLAYER_BOOTS_IRON)) {
player->windSpeed = ((500.0f - sp18.z) * 0.06f + 5.0f) * arg2 * (1.0f / 14848.0f) * (2.0f / 3.0f);
player->windDirection = this->dyna.actor.shape.rot.y;
}
}
@@ -499,7 +499,7 @@ void BgHeavyBlock_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_heavy_block.c", 904);
if (BgHeavyBlock_LiftedUp == this->actionFunc) {
func_800D1694(player->unk_3B0.x, player->unk_3B0.y, player->unk_3B0.z, &thisx->shape.rot);
func_800D1694(player->leftHandPos.x, player->leftHandPos.y, player->leftHandPos.z, &thisx->shape.rot);
Matrix_Translate(-this->unk_164.x, -this->unk_164.y, -this->unk_164.z, MTXMODE_APPLY);
} else if ((thisx->gravity == 0.0f) && (BgHeavyBlock_Land == this->actionFunc)) {
func_800D1694(thisx->initPosRot.pos.x, thisx->initPosRot.pos.y, thisx->initPosRot.pos.z, &thisx->shape.rot);
@@ -90,7 +90,7 @@ void BgHidanDalm_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void BgHidanDalm_WaitInteraction(BgHidanDalm* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if ((this->collider.base.acFlags & 2) && !func_8008E988(globalCtx) &&
if ((this->collider.base.acFlags & 2) && !Player_InCsMode(globalCtx) &&
(player->swordAnimation == 22 || player->swordAnimation == 23)) {
this->collider.base.acFlags &= ~2;
if (this->collider.list[0].body.bumperFlags & 2 || this->collider.list[1].body.bumperFlags & 2) {
@@ -59,7 +59,7 @@ void BgMizuUzu_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_8089F788(BgMizuUzu* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
if (PLAYER->currentBoots == 1) {
if (PLAYER->currentBoots == PLAYER_BOOTS_IRON) {
func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
} else {
func_8003EC50(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
@@ -128,7 +128,7 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
globalCtx->nextEntranceIndex = entrances[destinationIdx];
DoorAna_SetupAction(this, DoorAna_GrabLink);
} else {
if (!func_8008E988(globalCtx) && !(player->stateFlags1 & 0x8800000) &&
if (!Player_InCsMode(globalCtx) && !(player->stateFlags1 & 0x8800000) &&
this->actor.xzDistFromLink <= 15.0f && -50.0f <= this->actor.yDistFromLink &&
this->actor.yDistFromLink <= 15.0f) {
player->stateFlags1 |= 0x80000000;
@@ -86,7 +86,7 @@ s32 func_80994750(DoorGerudo* this, GlobalContext* globalCtx) {
f32 temp_f0;
s16 rotYDiff;
if (!func_8008E988(globalCtx)) {
if (!Player_InCsMode(globalCtx)) {
temp_f0 = func_809946BC(globalCtx, this, 0.0f, 20.0f, 15.0f);
if (fabsf(temp_f0) < 40.0f) {
rotYDiff = player->actor.shape.rot.y - this->dyna.actor.shape.rot.y;
@@ -102,27 +102,26 @@ s32 func_80994750(DoorGerudo* this, GlobalContext* globalCtx) {
}
void func_8099485C(DoorGerudo* this, GlobalContext* globalCtx) {
s32 temp_v0;
Player* player;
if (this->unk_164 != 0) {
this->actionFunc = func_8099496C;
gSaveContext.dungeonKeys[gSaveContext.mapIndex] -= 1;
Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
} else {
temp_v0 = func_80994750(this, globalCtx);
if (temp_v0 != 0) {
player = PLAYER;
s32 direction = func_80994750(this, globalCtx);
if (direction != 0) {
Player* player = PLAYER;
if (gSaveContext.dungeonKeys[gSaveContext.mapIndex] <= 0) {
player->naviMessageId = -0x203;
} else if (!Flags_GetCollectible(globalCtx, (this->dyna.actor.params >> 8) & 0x1F)) {
player->naviMessageId = -0x225;
} else {
player->unk_42C = 2;
player->unk_42D = temp_v0;
player->unk_430 = &this->dyna.actor;
player->unk_42E = 10;
player->doorType = 2;
player->doorDirection = direction;
player->doorActor = &this->dyna.actor;
player->doorTimer = 10;
}
}
}
@@ -8,7 +8,9 @@ struct DoorShutter;
typedef struct DoorShutter {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x2C];
/* 0x014C */ char unk_14C[0x18];
/* 0x0164 */ s16 unk_164;
/* 0x0166 */ char unk_166[0x12];
} DoorShutter; // size = 0x0178
extern const ActorInit Door_Shutter_InitVars;
+2 -2
View File
@@ -173,7 +173,7 @@ s32 ElfMsg_GetMessageId(ElfMsg* this) {
void ElfMsg_CallNaviCuboid(ElfMsg* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
EnElf* navi = (EnElf*)player->navi;
EnElf* navi = (EnElf*)player->naviActor;
if ((fabsf(player->actor.posRot.pos.x - this->actor.posRot.pos.x) < (100.0f * this->actor.scale.x)) &&
(this->actor.posRot.pos.y <= player->actor.posRot.pos.y) &&
@@ -190,7 +190,7 @@ s32 ElfMsg_WithinXZDistance(Vec3f* pos1, Vec3f* pos2, f32 distance) {
void ElfMsg_CallNaviCylinder(ElfMsg* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
EnElf* navi = (EnElf*)player->navi;
EnElf* navi = (EnElf*)player->naviActor;
if (ElfMsg_WithinXZDistance(&player->actor.posRot.pos, &this->actor.posRot.pos, this->actor.scale.x * 100.0f) &&
(this->actor.posRot.pos.y <= player->actor.posRot.pos.y) &&
+1 -1
View File
@@ -246,7 +246,7 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) {
} else {
// if a lit stick touches the bomb, set timer to 100
// these bombs never have a timer over 70, so this isnt used
if ((this->timer > 100) && func_8008EF5C(globalCtx, &thisx->posRot.pos, 30.0f, 50.0f)) {
if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->posRot.pos, 30.0f, 50.0f)) {
this->timer = 100;
}
}
@@ -158,7 +158,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
}
}
} else {
if (func_8008EF5C(globalCtx, &this->actor.posRot.pos, 30.0f, 50.0f)) {
if (Player_IsBurningStickInRange(globalCtx, &this->actor.posRot.pos, 30.0f, 50.0f)) {
bombFlower =
(EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0);
@@ -347,7 +347,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
this->timer = 0;
} else {
// if a lit stick touches the bomb, set timer to 100
if ((this->timer > 100) && func_8008EF5C(globalCtx, &thisx->posRot.pos, 30.0f, 50.0f)) {
if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->posRot.pos, 30.0f, 50.0f)) {
this->timer = 100;
}
}
+1 -1
View File
@@ -251,7 +251,7 @@ void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_MultVec3f(&sMultVec1, &vec1);
Matrix_MultVec3f(&sMultVec2, &vec2);
if (func_80090480(globalCtx, &this->collider, &this->unk_1DC, &vec1, &vec2) != 0) {
if (func_80090480(globalCtx, &this->collider, &this->boomerangInfo, &vec1, &vec2) != 0) {
EffectBlure_AddVertex(Effect_GetByIndex(this->effectIndex), &vec1, &vec2);
}
+1 -1
View File
@@ -16,7 +16,7 @@ typedef struct EnBoom {
/* 0x01D4 */ u8 returnTimer; // returns to Link when 0
/* 0x01D5 */ u8 activeTimer; // increments once every update
/* 0x01D8 */ u32 effectIndex; // set by Effect_Add
/* 0x01DC */ Struct_80090480_arg2 unk_1DC;
/* 0x01DC */ WeaponInfo boomerangInfo;
/* 0x01F8 */ EnBoomActionFunc actionFunc;
} EnBoom; // size = 0x01FC
+3 -1
View File
@@ -8,7 +8,9 @@ struct EnBox;
typedef struct EnBox {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0xB0];
/* 0x014C */ char unk_14C[0xA8];
/* 0x01F4 */ s16 unk_1F4;
/* 0x01F6 */ char unk_1F6[0x06];
} EnBox; // size = 0x01FC
extern const ActorInit En_Box_InitVars;
+2 -2
View File
@@ -138,11 +138,11 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if ((&player->actor != this->collider.base.at) && (&player->actor != this->collider.base.ac) &&
(&player->actor != this->colliderQuad.base.at) && (player->invincibilityTimer <= 0)) {
if (player->invincibilityTimer < -0x27) {
if (player->invincibilityTimer < -39) {
player->invincibilityTimer = 0;
} else {
player->invincibilityTimer = 0;
globalCtx->unk_11D58(globalCtx, -4);
globalCtx->damagePlayer(globalCtx, -4);
}
}
func_8002F71C(globalCtx, &this->actor, 6.0f, tmp32, 6.0f);
+1 -1
View File
@@ -146,7 +146,7 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) {
this->unk_1D6.x = this->unk_1D0.y;
if (Math_Vec3f_DistXYZ(&playerPos, &this->unk_1DC) <= 12.0f) {
if (this->unk_1CC == 0) {
if (globalCtx->unk_11D4C(globalCtx, player) != 0) {
if (globalCtx->grabPlayer(globalCtx, player) != 0) {
this->unk_1CA = 0;
this->unk_1CC++;
if (this->actor.parent != NULL) {
+4 -1
View File
@@ -8,7 +8,10 @@ struct EnDoor;
typedef struct EnDoor {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x8C];
/* 0x014C */ char unk_14C[0x44];
/* 0x0190 */ u8 unk_190;
/* 0x0191 */ u8 unk_191;
/* 0x0192 */ char unk_192[0x46];
} EnDoor; // size = 0x01D8
extern const ActorInit En_Door_InitVars;
+3 -3
View File
@@ -149,7 +149,7 @@ void EnDs_OfferOddPotion(EnDs* this, GlobalContext* globalCtx) {
this->brewTimer = 60;
Flags_SetSwitch(globalCtx, 0x3F);
globalCtx->msgCtx.msgMode = 0x37;
player->exchangeItemId = 0;
player->exchangeItemId = EXCH_ITEM_NONE;
break;
case 1: // no
func_8010B720(globalCtx, 0x504C);
@@ -209,7 +209,7 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) {
s16 yawDiff;
if (func_8002F194(&this->actor, globalCtx) != 0) {
if (func_8002F368(globalCtx) == 8) {
if (func_8002F368(globalCtx) == EXCH_ITEM_ODD_MUSHROOM) {
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
player->actor.textId = 0x504A;
this->actionFunc = EnDs_OfferOddPotion;
@@ -229,7 +229,7 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) {
this->actor.textId = 0x5048;
if ((ABS(yawDiff) < 0x2151) && (this->actor.xzDistFromLink < 200.0f)) {
func_8002F298(this, globalCtx, 100.0f, 8);
func_8002F298(this, globalCtx, 100.0f, EXCH_ITEM_ODD_MUSHROOM);
this->unk_1E8 |= 1;
}
}
@@ -721,9 +721,9 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
EnFloormas_SetupLand(this);
} else if ((this->actor.yDistFromLink < -10.0f) && this->collider.base.maskA & 2 &&
} else if ((this->actor.yDistFromLink < -10.0f) && (this->collider.base.maskA & 2) &&
(&player->actor == this->collider.base.oc)) {
globalCtx->unk_11D4C(globalCtx, player);
globalCtx->grabPlayer(globalCtx, player);
EnFloormas_SetupGrabLink(this, player);
}
}
@@ -785,7 +785,7 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) {
} else {
func_8002F7DC(&player->actor, NA_SE_VO_LI_DAMAGE_S);
}
globalCtx->unk_11D58(globalCtx, -8);
globalCtx->damagePlayer(globalCtx, -8);
}
}
@@ -148,9 +148,9 @@ ShopItemEntry D_80A3C674[] = {
func_80A3BB6C },
{ 0x00DA, 0x0028, func_8002EBCC, 0x0064, 0x0001, 0x00AE, 0x0099, GI_WEIRD_EGG, func_80A3B2AC, func_80A3B968,
func_80A3BB6C },
{ 0x00DF, 0x002F, func_80A3C498, 0x2710, 0x0001, 0x00B4, 0x0085, GI_INVALID, func_80A3B308, func_80A3B9A4,
{ 0x00DF, 0x002F, func_80A3C498, 0x2710, 0x0001, 0x00B4, 0x0085, GI_NONE, func_80A3B308, func_80A3B9A4,
func_80A3BB6C },
{ 0x00DA, 0x0028, func_8002EBCC, 0x2710, 0x0001, 0x00B5, 0x0085, GI_INVALID, func_80A3B318, func_80A3B9D4,
{ 0x00DA, 0x0028, func_8002EBCC, 0x2710, 0x0001, 0x00B5, 0x0085, GI_NONE, func_80A3B318, func_80A3B9D4,
func_80A3BB6C },
{ 0x00D9, 0x0027, func_8002EBCC, 0x0064, 0x000A, 0x00BC, 0x008C, GI_BOMBCHUS_10, func_80A3B328, NULL,
func_80A3BC6C },
@@ -658,7 +658,7 @@ void func_80A3B780(GlobalContext* globalCtx, EnGirlA* this) {
void func_80A3B7BC(GlobalContext* globalCtx, EnGirlA* this) {
func_800849EC(globalCtx);
gSaveContext.bgsHitsLeft = 8;
gSaveContext.swordHealth = 8;
Rupees_ChangeBy(-this->unk_1C8);
}
@@ -868,7 +868,7 @@ s32 func_80A3BF54(EnGirlA* this, GlobalContext* globalCtx) {
if ((this->actor.params >= 30) && (this->actor.params < 38)) {
params = this->actor.params - 30;
if (INV_CONTENT(ITEM_WEIRD_EGG) == D_80A3C658[params]) {
if (INV_CONTENT(ITEM_TRADE_CHILD) == D_80A3C658[params]) {
func_80A3BEAC(globalCtx, this);
} else {
func_80A3BD8C(globalCtx, this);
+1 -1
View File
@@ -145,7 +145,7 @@ void func_80A4E648(EnGs* this, GlobalContext* globalCtx) {
func_8002F374(globalCtx, &this->actor, &sp26, &sp24);
if ((sp26 >= 0) && (sp26 <= SCREEN_WIDTH) && (sp24 >= 0) && (sp24 <= SCREEN_HEIGHT) && (this->unk_19C != 3)) {
if (func_8002F2CC(&this->actor, globalCtx, 40.0f) == 1) {
if (func_8008F080(globalCtx) == 8) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_TRUTH) {
this->actor.textId = 0x2054;
} else {
this->actor.textId = 0x2053;
@@ -350,7 +350,7 @@ void func_80A5399C(EnHeishi2* this, GlobalContext* globalCtx) {
var = 0;
if (gSaveContext.infTable[7] & 0x40) {
if (!(gSaveContext.infTable[7] & 0x80)) {
if (func_8008F080(globalCtx) == 1) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_KEATON) {
if (this->unk_309 == 0) {
this->actor.textId = 0x200A; // "Wha-ha-ha-hah! Do you think you're in disguise, Mr. Hero?"
} else {
@@ -401,19 +401,19 @@ void func_80A53AD4(EnHeishi2* this, GlobalContext* globalCtx) {
this->unk_300 = 6;
if (func_8002F194(&this->actor, globalCtx) != 0) {
exchangeItemId = func_8002F368(globalCtx);
if (exchangeItemId == 1) { // exchangeItemId = zelda's letter
if (exchangeItemId == EXCH_ITEM_LETTER_ZELDA) {
func_80078884(NA_SE_SY_CORRECT_CHIME);
player->actor.textId = 0x2010; // "Oh, this is...this is surely Princess Zelda's handwriting!"
this->unk_300 = 5;
this->actionFunc = func_80A53C0C;
} else if (exchangeItemId != 0) { // exchangeItemId != nothing
} else if (exchangeItemId != EXCH_ITEM_NONE) {
player->actor.textId = 0x200F; // "I don't want that!"
}
} else {
yawDiffTemp = this->actor.yawTowardsLink - this->actor.shape.rot.y;
yawDiff = ABS(yawDiffTemp);
if (!(120.0f < this->actor.xzDistFromLink) && (yawDiff < 0x4300)) {
func_8002F298(&this->actor, globalCtx, 100.0f, 1);
func_8002F298(&this->actor, globalCtx, 100.0f, EXCH_ITEM_LETTER_ZELDA);
}
}
}
@@ -539,7 +539,7 @@ void func_80A540C0(EnHeishi2* this, GlobalContext* globalCtx) {
case 0:
this->actor.textId = 0x2020; // "My boy will be very happy with this!.."
func_8010B720(globalCtx, this->actor.textId);
func_8008F08C(globalCtx);
Player_UnsetMask(globalCtx);
gSaveContext.infTable[7] |= 0x80;
gSaveContext.itemGetInf[3] |= 0x100;
Item_Give(globalCtx, ITEM_SOLD_OUT);
+31 -2
View File
@@ -7,10 +7,39 @@
struct EnHorse;
typedef struct EnHorse {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x2B0];
/* 0x000 */ Actor actor;
/* 0x014C */ s32 unk_14C;
/* 0x0150 */ char unk_150[0x0A0];
/* 0x01F0 */ u32 unk_1F0;
/* 0x01F4 */ char unk_1F4[0x01C];
/* 0x0210 */ s32 unk_210;
/* 0x0214 */ f32 unk_214;
/* 0x0218 */ char unk_218[0x040];
/* 0x0258 */ Vec3f unk_258;
/* 0x0264 */ char unk_264[0x198];
} EnHorse; // size = 0x03FC
#define EN_HORSE_CHECK_1(horseActor) \
(((horseActor)->unk_1F0 & 0x40) \
? true \
: false)
#define EN_HORSE_CHECK_2(horseActor) \
(((horseActor)->unk_1F0 & 0x100) \
? true \
: false)
#define EN_HORSE_CHECK_3(horseActor) \
(((horseActor)->unk_1F0 & 0x200) \
? true \
: false)
#define EN_HORSE_CHECK_4(horseActor) \
(((((horseActor)->unk_14C == 5) || ((horseActor)->unk_14C == 0) || ((horseActor)->unk_14C == 6)) && \
!((horseActor)->unk_1F0 & 0x80000) && !((horseActor)->unk_1F0 & 0x2000000)) \
? true \
: false)
extern const ActorInit En_Horse_InitVars;
#endif
+11 -8
View File
@@ -61,7 +61,7 @@ u16 EnKz_GetTextNoMaskChild(GlobalContext* globalCtx, EnKz* this) {
} else if (gSaveContext.eventChkInf[3] & 8) {
return 0x401C;
} else {
player->exchangeItemId = 0x1D;
player->exchangeItemId = EXCH_ITEM_LETTER_RUTO;
return 0x401A;
}
}
@@ -80,7 +80,7 @@ u16 EnKz_GetTextNoMaskAdult(GlobalContext* globalCtx, EnKz* this) {
return CHECK_QUEST_ITEM(QUEST_SONG_SERENADE) ? 0x4045 : 0x401A;
}
} else {
player->exchangeItemId = 0xC;
player->exchangeItemId = EXCH_ITEM_PRESCRIPTION;
return 0x4012;
}
}
@@ -219,8 +219,8 @@ void func_80A9CB18(EnKz* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (func_80A9C95C(globalCtx, this, &this->unk_1E0.unk_00, 340.0f, EnKz_GetText, func_80A9C6C0) != 0) {
if ((this->actor.textId == 0x401A) && (!(gSaveContext.eventChkInf[3] & 8))) {
if (func_8002F368(globalCtx) == 0x1D) {
if ((this->actor.textId == 0x401A) && !(gSaveContext.eventChkInf[3] & 8)) {
if (func_8002F368(globalCtx) == EXCH_ITEM_LETTER_RUTO) {
this->actor.textId = 0x401B;
this->sfxPlayed = false;
} else {
@@ -229,22 +229,25 @@ void func_80A9CB18(EnKz* this, GlobalContext* globalCtx) {
player->actor.textId = this->actor.textId;
return;
}
if (LINK_IS_ADULT) {
if ((INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_PRESCRIPTION) && (func_8002F368(globalCtx) == 0xC)) {
if ((INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_PRESCRIPTION) &&
(func_8002F368(globalCtx) == EXCH_ITEM_PRESCRIPTION)) {
this->actor.textId = 0x4014;
this->sfxPlayed = false;
player->actor.textId = this->actor.textId;
this->isTrading = true;
return;
}
this->isTrading = false;
if (gSaveContext.infTable[19] & 0x200) {
this->actor.textId = CHECK_QUEST_ITEM(QUEST_SONG_SERENADE) ? 0x4045 : 0x401A;
player->actor.textId = this->actor.textId;
return;
} else {
this->actor.textId = CHECK_OWNED_EQUIP(EQUIP_TUNIC, 2) ? 0x401F : 0x4012;
player->actor.textId = this->actor.textId;
}
this->actor.textId = CHECK_OWNED_EQUIP(EQUIP_TUNIC, 2) ? 0x401F : 0x4012;
player->actor.textId = this->actor.textId;
}
}
}
@@ -124,7 +124,7 @@ void func_80AB9210(EnNiwGirl* this, GlobalContext* globalCtx) {
this->actor.posRot.rot.y = this->actor.shape.rot.y;
// Only allow Link to talk to her when she is playing the jumping animation
if ((this->jumpTimer == 0) || (func_8008F080(globalCtx) != 0)) {
if ((this->jumpTimer == 0) || (Player_GetMask(globalCtx) != PLAYER_MASK_NONE)) {
this->jumpTimer = 60;
this->actionFunc = EnNiwGirl_Talk;
}
@@ -137,21 +137,21 @@ void EnNiwGirl_Talk(EnNiwGirl* this, GlobalContext* globalCtx) {
if ((gSaveContext.eventChkInf[8] & 1) && (this->unk_27A == 0)) {
this->actor.textId = 0x70EA;
}
switch (func_8008F080(globalCtx)) {
case 1:
switch (Player_GetMask(globalCtx)) {
case PLAYER_MASK_KEATON:
this->actor.textId = 0x7118;
break;
case 3:
case PLAYER_MASK_SPOOKY:
this->actor.textId = 0x7119;
break;
case 4:
case 6:
case 7:
case PLAYER_MASK_BUNNY:
case PLAYER_MASK_ZORA:
case PLAYER_MASK_GERUDO:
this->actor.textId = 0x711A;
break;
case 2:
case 5:
case 8:
case PLAYER_MASK_SKULL:
case PLAYER_MASK_GORON:
case PLAYER_MASK_TRUTH:
this->actor.textId = 0x711B;
break;
}
@@ -90,14 +90,15 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) {
(this->collider.base.acFlags & 2) || (this->collider.base.maskA & 2)) {
// Checking if the player is using a shield that reflects projectiles
// And if so, reflects the projectile on impact
if ((player->currentShield == 1) || ((player->currentShield == 2) && LINK_IS_ADULT)) {
if ((player->currentShield == PLAYER_SHIELD_DEKU) ||
((player->currentShield == PLAYER_SHIELD_HYLIAN) && LINK_IS_ADULT)) {
if ((this->collider.base.atFlags & 2) && (this->collider.base.atFlags & 0x10) &&
(this->collider.base.atFlags & 4)) {
this->collider.base.atFlags &= ~0x16;
this->collider.base.atFlags |= 0x08;
this->collider.body.toucher.flags = 2;
func_800D20CC(&player->mf_A20, &sp4C, 0);
func_800D20CC(&player->shieldMf, &sp4C, 0);
this->actor.posRot.rot.y = sp4C.y + 0x8000;
this->timer = 30;
return;
+2 -2
View File
@@ -1577,7 +1577,7 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) {
this->actor.floorPolySource; // necessary match, can't move this out of this block unfortunately
dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
if ((dynaActor != NULL) && (dynaActor->actor.id == ACTOR_BG_BDAN_OBJECTS) && (dynaActor->actor.params == 0) &&
(!func_8008E988(globalCtx)) && (globalCtx->msgCtx.unk_E300 == 0)) {
(!Player_InCsMode(globalCtx)) && (globalCtx->msgCtx.unk_E300 == 0)) {
func_80AEE02C(this);
globalCtx->csCtx.segment = &D_80AF10A4;
gSaveContext.cutsceneTrigger = 1;
@@ -1641,7 +1641,7 @@ s32 func_80AEE6D0(EnRu1* this, GlobalContext* globalCtx) {
s8 curRoomNum = globalCtx->roomCtx.curRoom.num;
if ((!(gSaveContext.infTable[20] & 0x10)) && (func_80AEB124(globalCtx) != 0)) {
if (func_8008E988(globalCtx) == 0) {
if (!Player_InCsMode(globalCtx)) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06004648, 1.0f, 0,
SkelAnime_GetFrameCount(&D_06004350.genericHeader), 0, -8.0f);
func_80AED600(this);
+1 -1
View File
@@ -77,7 +77,7 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, this->actor.scale.x);
this->actor.shape.rot.y += 0x400;
if (func_8008E988(globalCtx) == 0) {
if (!Player_InCsMode(globalCtx)) {
func_80AFB748(this, globalCtx);
if (this->collider.base.maskB & 0x1) {
+2 -2
View File
@@ -264,7 +264,7 @@ void EnSt_CheckBodyStickHit(EnSt* this, GlobalContext* globalCtx) {
ColliderBody* body = &this->colCylinder[0].body;
Player* player = PLAYER;
if (player->stickFlameTimer != 0) {
if (player->unk_860 != 0) {
body->bumper.flags |= 2;
this->colCylinder[1].body.bumper.flags &= ~2;
this->colCylinder[2].body.bumper.flags &= ~2;
@@ -358,7 +358,7 @@ s32 EnSt_CheckHitLink(EnSt* this, GlobalContext* globalCtx) {
}
this->gaveDamageSpinTimer = 30;
globalCtx->unk_11D58(globalCtx, -8);
globalCtx->damagePlayer(globalCtx, -8);
Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT);
func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.yawTowardsLink, 6.0f);
return true;
@@ -8,7 +8,7 @@
#define FLAGS 0x00000035
#define THIS ((EnTorch2*)thisx)
#define THIS ((Player*)thisx)
void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx);
void EnTorch2_Destroy(Actor* thisx, GlobalContext* globalCtx);
@@ -21,7 +21,7 @@ const ActorInit En_Torch2_InitVars = {
ACTORTYPE_BOSS,
FLAGS,
OBJECT_TORCH2,
sizeof(EnTorch2),
sizeof(Player),
(ActorFunc)EnTorch2_Init,
(ActorFunc)EnTorch2_Destroy,
(ActorFunc)EnTorch2_Update,
@@ -4,12 +4,7 @@
#include <ultra64.h>
#include <global.h>
struct EnTorch2;
typedef struct EnTorch2 {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x948];
} EnTorch2; // size = 0x0A94
// Uses the Player struct (from z64player.h)
extern const ActorInit En_Torch2_InitVars;
@@ -265,11 +265,9 @@ void EnWallmas_SetupStun(EnWallmas* this) {
}
void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) {
Vec3f* playerPos;
Player* player;
Player* player = PLAYER;
Vec3f* playerPos = &player->actor.posRot.pos;
player = PLAYER;
playerPos = &player->actor.posRot.pos;
this->actor.posRot.pos = *playerPos;
this->actor.groundY = player->actor.groundY;
this->actor.floorPoly = player->actor.floorPoly;
@@ -278,8 +276,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) {
this->timer--;
}
if (((s32)(player->stateFlags1 << 0xB) < 0) || ((s32)(player->stateFlags1 << 4) < 0) ||
((player->actor.bgCheckFlags & 1) == 0) ||
if ((player->stateFlags1 & 0x100000) || (player->stateFlags1 & 0x8000000) || !(player->actor.bgCheckFlags & 1) ||
((this->actor.params == 1) && (320.0f < Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, playerPos)))) {
func_800F8D04(NA_SE_EN_FALL_AIM);
this->timer = 0x82;
@@ -296,9 +293,10 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) {
void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (!func_8008E988(globalCtx) && (player->stateFlags2 & 0x10) == 0 && (player->invincibilityTimer >= 0) &&
if (!Player_InCsMode(globalCtx) && !(player->stateFlags2 & 0x10) && (player->invincibilityTimer >= 0) &&
(this->actor.xzDistFromLink < 30.0f) && (this->actor.yDistFromLink < -5.0f) &&
(-(f32)(player->unk_4DA + 0xA) < this->actor.yDistFromLink)) {
(-(f32)(player->cylinder.dim.height + 10) < this->actor.yDistFromLink)) {
EnWallmas_SetupTakePlayer(this, globalCtx);
}
}
@@ -396,9 +394,8 @@ void EnWallmas_Die(EnWallmas* this, GlobalContext* globalCtx) {
}
void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) {
Player* player;
Player* player = PLAYER;
player = PLAYER;
if (func_800A56C8(&this->skelAnime, 1.0f) != 0) {
if (LINK_IS_CHILD) {
func_8002F7DC(&this->actor, NA_SE_VO_LI_DAMAGE_S_KID);
@@ -167,7 +167,7 @@ void func_80B3A15C(EnWonderTalk2* this, GlobalContext* globalCtx) {
}
this->unk_158 = 0;
func_8002F1C4(&this->actor, globalCtx, this->unk_15C + 50.0f, 100.0f, 0);
func_8002F1C4(&this->actor, globalCtx, this->unk_15C + 50.0f, 100.0f, EXCH_ITEM_NONE);
}
}
}
+1 -1
View File
@@ -504,7 +504,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) {
case 1:
if ((func_8010BDBC(msgCtx) == 5) && (func_80106BC8(globalCtx) != 0)) {
this->actor.textId = 0xFFFF;
globalCtx->unk_11D5C(globalCtx, &this->actor);
globalCtx->talkWithPlayer(globalCtx, &this->actor);
func_8002F434(&this->actor, globalCtx, GI_LETTER_ZELDA, 120.0f, 10.0f);
globalCtx->msgCtx.msgMode = 0x36;
globalCtx->msgCtx.unk_E3E7 = 4;
+2 -2
View File
@@ -591,8 +591,8 @@ void EnZl2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
{
Player* player = PLAYER;
Matrix_Push();
if (player->unk_15D == 0xFF) {
Matrix_Put(&player->mf_A20);
if (player->rightHandType == 0xFF) {
Matrix_Put(&player->shieldMf);
Matrix_Translate(180.0f, 979.0f, -375.0f, MTXMODE_APPLY);
Matrix_RotateRPY(-0x5DE7, -0x53E9, 0x3333, MTXMODE_APPLY);
Matrix_Scale(1.2f, 1.2f, 1.2f, MTXMODE_APPLY);
@@ -52,6 +52,7 @@ void EndTitle_Draw(Actor* thisx, GlobalContext* globalCtx) {
EndTitle* this = THIS;
s32 frameCount = globalCtx->csCtx.frames;
Player* player = PLAYER;
mf = &player->mf_9E0;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_end_title.c", 403);
@@ -49,7 +49,7 @@ static s16 sDrawItemIndexes[] = {
static s16 sGetItemIds[] = {
GI_BOTTLE, GI_LETTER_RUTO, GI_SHIELD_HYLIAN, GI_QUIVER_40, GI_SCALE_SILVER, GI_SCALE_GOLD, GI_KEY_SMALL,
GI_ARROW_FIRE, GI_INVALID, GI_INVALID, GI_INVALID, GI_INVALID, GI_INVALID, GI_INVALID,
GI_ARROW_FIRE, GI_NONE, GI_NONE, GI_NONE, GI_NONE, GI_NONE, GI_NONE,
};
void ItemEtcetera_SetupAction(ItemEtcetera* this, ItemEtceteraActionFunc actionFunc) {
@@ -82,7 +82,7 @@ void MagicDark_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, thisx->scale.x);
} else if (this->unk_14C < 55) {
Actor_SetScale(&this->actor, thisx->scale.x * 0.9f);
Math_SmoothScaleMaxMinF(&this->unk_154, player->unk_90C, 0.5f, 3.0f, 1.0f);
Math_SmoothScaleMaxMinF(&this->unk_154, player->bodyPartsPos[0].y, 0.5f, 3.0f, 1.0f);
if (this->unk_14C >= 49) {
func_80B8772C(globalCtx, (54 - this->unk_14C) * 0.2f);
}
@@ -144,10 +144,9 @@ void MagicWind_Init(Actor* thisx, GlobalContext* globalCtx) {
case 1:
SkelCurve_SetAnim(&this->skelCurve, &sTransformUpdIdx, 60.0f, 0.0f, 60.0f, -1.0f);
MagicWind_SetupAction(this, MagicWind_Shrink);
// "Indicates start" = %s
// Means start
LOG_STRING("表示開始", "../z_magic_wind.c", 486);
func_8002F7DC(player, NA_SE_PL_MAGIC_WIND_WARP);
func_8002F7DC(&player->actor, NA_SE_PL_MAGIC_WIND_WARP);
break;
}
}
@@ -72,8 +72,8 @@ void OceffSpot_Destroy(Actor* thisx, GlobalContext* globalCtx) {
LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode1);
LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode2);
func_800876C8(globalCtx);
if (gSaveContext.nayrusLoveTimer && globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].length) {
player->unk_692 |= 0x40;
if ((gSaveContext.nayrusLoveTimer != 0) && (globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].length != 0)) {
player->stateFlags3 |= 0x40;
}
}
@@ -64,8 +64,8 @@ void OceffStorm_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Player* player = PLAYER;
func_800876C8(globalCtx);
if (gSaveContext.nayrusLoveTimer) {
player->unk_692 |= 0x40;
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= 0x40;
}
}
@@ -48,8 +48,8 @@ void OceffWipe_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Player* player = PLAYER;
func_800876C8(globalCtx);
if (gSaveContext.nayrusLoveTimer) {
player->unk_692 |= 0x40;
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= 0x40;
}
}
@@ -43,8 +43,8 @@ void OceffWipe2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Player* player = PLAYER;
func_800876C8(globalCtx);
if (gSaveContext.nayrusLoveTimer) {
player->unk_692 |= 0x40;
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= 0x40;
}
}
@@ -44,8 +44,8 @@ void OceffWipe3_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Player* player = PLAYER;
func_800876C8(globalCtx);
if (gSaveContext.nayrusLoveTimer) {
player->unk_692 |= 0x40;
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= 0x40;
}
}
@@ -172,9 +172,9 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) {
Actor_Kill(&this->actor);
} else {
if (!(120.0f < this->actor.xzDistFromLink) && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) {
cylinderPos.x = player->unk_95C.x + globalCtx->envCtx.unk_04.x * 0.16666667f;
cylinderPos.y = player->unk_95C.y - 30.0f + globalCtx->envCtx.unk_04.y * 0.16666667f;
cylinderPos.z = player->unk_95C.z + globalCtx->envCtx.unk_04.z * 0.16666667f;
cylinderPos.x = player->bodyPartsPos[7].x + globalCtx->envCtx.unk_04.x * 0.16666667f;
cylinderPos.y = player->bodyPartsPos[7].y - 30.0f + globalCtx->envCtx.unk_04.y * 0.16666667f;
cylinderPos.z = player->bodyPartsPos[7].z + globalCtx->envCtx.unk_04.z * 0.16666667f;
this->hitboxPos = cylinderPos;
File diff suppressed because it is too large Load Diff