mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-26 14:31:07 -04:00
ovl_player_actor: Dawn of a new PR (#1227)
* Rename Player_UpdateBottleHeld * Match func_808497A0 * func_80852290 NON_MATCHING * Match func_8083B3B4 * Params cleanup * Match func_8083FBC4 * sfxId cleanups and others * Fix declaration of functions from D_8085D990 * Change D_8085BE84 to be a 2D array * ARRAY_COUNT_2D * Match func_8085ADA0 * func_808426F0 nonmatching * Match func_80852290 * Match func_808426F0 Co-authored-by: engineer124 <engineer124engineer124@gmail.com> * Add notes to Player_SetDoAction * Name putAwayCountdown * rebase * Match func_80856918 * format * func_8084933C nonmatching small amount of boomerang documentation * Progress on moving data near where it is used * finish moving data * format * cleanup up remaining data * more match * Some minor cleanups * PlayerCsMode enum * func_80851F18 nonmatching * Fix unk_B10 * Purge ExchangeItemID enum * Rename `targetActor` to `talkActor` * Name `targetedActor` * PLAYER_LIMB_BUF_SIZE Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com> * Change SkelAnime Player functions to take a void pointer for the corresponding buffers * Use PlayerAnimationFrame on Player_DrawImpl * Match func_8082F1AC * Match func_8083D23C * cleanup * Match and clean up func_808373F8 * Match and document func_8083A98C * PLAYER_PARAMS macro and PlayerInitMode enum * Preliminary names for InitMode functions * Match func_8083C8E8 * remove redundant externs * Match func_8084933C * cleanup func_8084933C * Access D_8085BE84 directly instead of using a macro * Match func_8084AC84 * Fix boomearng typo * OK boomerang * cleanup func_8083D168 * untargetedRotY * this->unk_14E = ABS_ALT(var_v1); * GIFIELD macros * sort of a match * Match func_8084C16C Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com> * Use the same trick to match func_808573A4 * Add note on Deku spinning * Match func_8084D18C * Match func_80850D68 * Improve func_80832660 * Match func_80854EFC Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com> * Rename unk_B2A to getItemDrawId * Some cleanup * fix merge issues * format * minor anim docs * Match func_808553F4 * Cleanup func_808553F4 * func_8083D860 nonmatching * Match func_8083D860 * Defake func_80859BA8 * () * Add notes to PlayerAnimGroup enum * underwaterTimer Co-authored-by: engineer124 <engineer124engineer124@gmail.com> * some stateFlags cleaning * more stateFlags cleaning * some notes and minor cleanups * more general cleanups * Slightly less fake func_80832CAC * Document some melee weapon damage stuff * Mark lunge storage * Note PCS patch * match * add notes to bss * yeet extra indentation * add reloc as nonmatching to spec * floorSfxOffset * Player_GetFloorSfx * Player_GetFloorSfxByAge * Comments for AnimSfx dunctions * Name some AnimSfx functions * Name AnimSfx stuff * Some PlayerAgeProperties notes * use animflag defines * Player_SpawnExplosive * fix enum and some other minor fixes * Bit more misc. cleanup * Use OoT's version of func_808333CC * Note on quickspin buffer * Final nonmatching, func_80851F18 Co-authored-by: Synray <31429825+Synray@users.noreply.github.com> * RIP player.c * Name Player_StopHorizontalMovement * misc fixes * Actor_DeactivateLens * fixes * typos and tweaks * minor stuff * add names as comments on the animgoup array * Correct some function names and data type * add anim commets to ageproperties * some notes * De-fake func_80840F90 * Defake & clean up func_8085ADA0 * Improve func_80859BA8 * Enums in func_80852B28 * Name some secret-related things * 3 small things * stuff * Player_TalkWithPlayer * SurfaceType_GetFloorType * SurfaceType_GetWallFlags * and more bgcheck stuff * more bss naming * sPlayerControlInput * clean up func_80836F10 a bit * name the parameters of func_80835BF8 * door stuff * remove NON_MATCHING * remove D_8085D2B0 padding * Name some Player_Cutscene_ functions * various cleanups * format * remainingHopsCounter * some cleanups on the struct * Actor_RequestRumble * this->exchangeItemId = PLAYER_AP_NONE; * fix merge stuff * format * PlayerUnkAA5 * Name two cylinder-related functions * BSS * Add MagicConsume's enum, treat lensActive as bool * Update func_808332A0 based on better info * fix merge * fix merge issues * remove redundant comments * Name Player_AddQuake * ANIM_FLAG_UPDATE*_*Y * Format * AT_TYPE_ENEMY * fix merge issues * format * fix uintptr_ts * Rename * Name leftHandMf * fix merge issues * format * exchangeItemId <= PLAYER_IA_MINUS1 * getItemDrawIdPlusOne * currentActorCsIndex * <= PLAYER_IA_MINUS1 * fix merge issues * format * namefixer and bss * fix build * bombs parameters cleanup * bss * Fix building * fix building * Fix building * Fix building and cleanups * Pre-PR cleanup * really... * format * review * stateFlag Mistakes * 268 * 0.1f * z64door.h * fix cutscene stuff * bss * Update include/z64player.h Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * Update include/z64player.h Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * reiew * PR Review * collision * review * format and a few stuff i missed * EnBomExplosiveType * weekeventregconvert and eventinfconvert * more review * review * bss * review * re format sGetItemTable * Entangle PlayerMask and PlayerItemAction * a few extra cases i missed * bss * review * EnArrow stuff * ARROW_MAGIC_DEKU_BUBBLE * minor format * merge * fix bss * review * !ARROW_IS_ARROW * review * bool cleanup * fix merge * review * Player_StopCutscene * Player_RequestQuake * quakeIndex * Player_RequestQuakeAndRumble * knobDoor and slidingDoor * bss * fix * review * dog and float --------- Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com> Co-authored-by: engineer124 <engineer124engineer124@gmail.com> Co-authored-by: petrie911 <pmontag@PHYS-S129.iowa.uiowa.edu> Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com> Co-authored-by: Synray <31429825+Synray@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "stack.h"
|
||||
#include "stackcheck.h"
|
||||
|
||||
+38
-37
@@ -1374,7 +1374,7 @@ s32 func_800B724C(PlayState* play, Actor* actor, u8 csMode) {
|
||||
|
||||
player->csMode = csMode;
|
||||
player->unk_398 = actor;
|
||||
player->unk_3BA = 0;
|
||||
player->doorBgCamIndex = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1382,7 +1382,7 @@ s32 func_800B7298(PlayState* play, Actor* actor, u8 csMode) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (func_800B724C(play, actor, csMode)) {
|
||||
player->unk_3BA = 1;
|
||||
player->doorBgCamIndex = 1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -3490,49 +3490,50 @@ void Enemy_StartFinishingBlow(PlayState* play, Actor* actor) {
|
||||
}
|
||||
|
||||
// blinking routine
|
||||
s16 func_800BBAC0(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) {
|
||||
if (DECR(arg0[1]) == 0) {
|
||||
arg0[1] = Rand_S16Offset(arg1, arg2);
|
||||
s16 func_800BBAC0(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3) {
|
||||
if (DECR(info->blinkTimer) == 0) {
|
||||
info->blinkTimer = Rand_S16Offset(arg1, arg2);
|
||||
}
|
||||
|
||||
if (arg0[1] - arg3 > 0) {
|
||||
arg0[0] = 0;
|
||||
} else if ((arg0[1] - arg3 >= -1) || (arg0[1] < 2)) {
|
||||
arg0[0] = 1;
|
||||
if (info->blinkTimer - arg3 > 0) {
|
||||
info->eyeTexIndex = 0;
|
||||
} else if ((info->blinkTimer - arg3 >= -1) || (info->blinkTimer < 2)) {
|
||||
info->eyeTexIndex = 1;
|
||||
} else {
|
||||
arg0[0] = 2;
|
||||
info->eyeTexIndex = 2;
|
||||
}
|
||||
|
||||
return arg0[0];
|
||||
return info->eyeTexIndex;
|
||||
}
|
||||
|
||||
// blinking routine
|
||||
s16 func_800BBB74(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) {
|
||||
if (DECR(arg0[1]) == 0) {
|
||||
arg0[1] = Rand_S16Offset(arg1, arg2);
|
||||
s16 func_800BBB74(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3) {
|
||||
if (DECR(info->blinkTimer) == 0) {
|
||||
info->blinkTimer = Rand_S16Offset(arg1, arg2);
|
||||
}
|
||||
|
||||
if (arg0[1] - arg3 > 0) {
|
||||
arg0[0] = 0;
|
||||
} else if (arg0[1] - arg3 == 0) {
|
||||
arg0[0] = 1;
|
||||
if (info->blinkTimer - arg3 > 0) {
|
||||
info->eyeTexIndex = 0;
|
||||
} else if (info->blinkTimer - arg3 == 0) {
|
||||
info->eyeTexIndex = 1;
|
||||
} else {
|
||||
arg0[0] = 2;
|
||||
info->eyeTexIndex = 2;
|
||||
}
|
||||
|
||||
return arg0[0];
|
||||
return info->eyeTexIndex;
|
||||
}
|
||||
|
||||
// unused blinking routine
|
||||
s16 func_800BBC20(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) {
|
||||
if (DECR(arg0[1]) == 0) {
|
||||
arg0[1] = Rand_S16Offset(arg1, arg2);
|
||||
arg0[0]++;
|
||||
if ((arg0[0] % 3) == 0) {
|
||||
arg0[0] = (s32)(Rand_ZeroOne() * arg3) * 3;
|
||||
s16 func_800BBC20(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3) {
|
||||
if (DECR(info->blinkTimer) == 0) {
|
||||
info->blinkTimer = Rand_S16Offset(arg1, arg2);
|
||||
info->eyeTexIndex++;
|
||||
if ((info->eyeTexIndex % 3) == 0) {
|
||||
info->eyeTexIndex = (s32)(Rand_ZeroOne() * arg3) * 3;
|
||||
}
|
||||
}
|
||||
return arg0[0];
|
||||
|
||||
return info->eyeTexIndex;
|
||||
}
|
||||
|
||||
void Actor_SpawnBodyParts(Actor* actor, PlayState* play, s32 partParams, Gfx** dList) {
|
||||
@@ -3614,15 +3615,15 @@ void func_800BC154(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 act
|
||||
|
||||
// Damage flags for EnArrow
|
||||
u32 sArrowDmgFlags[] = {
|
||||
DMG_FIRE_ARROW, // ENARROW_0
|
||||
DMG_NORMAL_ARROW, // ENARROW_1
|
||||
DMG_NORMAL_ARROW, // ENARROW_2
|
||||
DMG_FIRE_ARROW, // ENARROW_3
|
||||
DMG_ICE_ARROW, // ENARROW_4
|
||||
DMG_LIGHT_ARROW, // ENARROW_5
|
||||
DMG_DEKU_NUT, // ENARROW_6
|
||||
DMG_DEKU_BUBBLE, // ENARROW_7
|
||||
DMG_DEKU_NUT, // ENARROW_8
|
||||
DMG_FIRE_ARROW, // ARROW_TYPE_NORMAL_LIT
|
||||
DMG_NORMAL_ARROW, // ARROW_TYPE_NORMAL_HORSE
|
||||
DMG_NORMAL_ARROW, // ARROW_TYPE_NORMAL
|
||||
DMG_FIRE_ARROW, // ARROW_TYPE_FIRE
|
||||
DMG_ICE_ARROW, // ARROW_TYPE_ICE
|
||||
DMG_LIGHT_ARROW, // ARROW_TYPE_LIGHT
|
||||
DMG_DEKU_NUT, // ARROW_TYPE_SLINGSHOT
|
||||
DMG_DEKU_BUBBLE, // ARROW_TYPE_DEKU_BUBBLE
|
||||
DMG_DEKU_NUT, // ARROW_TYPE_DEKU_NUT
|
||||
};
|
||||
|
||||
u32 Actor_GetArrowDmgFlags(s32 params) {
|
||||
@@ -4476,7 +4477,7 @@ s32 func_800BE184(PlayState* play, Actor* actor, f32 xzDist, s16 arg3, s16 arg4,
|
||||
s16 phi_v0 = BINANG_SUB(BINANG_ROT180(actor->yawTowardsPlayer), player->actor.shape.rot.y);
|
||||
s16 temp_t0 = actor->yawTowardsPlayer - arg5;
|
||||
|
||||
if ((actor->xzDistToPlayer <= xzDist) && (player->meleeWeaponState != 0)) {
|
||||
if ((actor->xzDistToPlayer <= xzDist) && (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0)) {
|
||||
if ((arg4 >= ABS_ALT(phi_v0)) && (arg3 >= ABS_ALT(temp_t0))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
+5
-5
@@ -465,13 +465,13 @@ s32 func_800CBA7C(Camera* camera) {
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800CBAAC(Camera* camera) {
|
||||
PlayerMeleeWeaponState func_800CBAAC(Camera* camera) {
|
||||
Actor* focalActor = camera->focalActor;
|
||||
|
||||
if (camera->focalActor == &GET_PLAYER(camera->play)->actor) {
|
||||
return ((Player*)focalActor)->meleeWeaponState;
|
||||
} else {
|
||||
return 0;
|
||||
return PLAYER_MELEE_WEAPON_STATE_0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,13 +506,13 @@ s32 func_800CBB88(Camera* camera) {
|
||||
Actor* focalActor = camera->focalActor;
|
||||
|
||||
if (camera->focalActor == &GET_PLAYER(camera->play)->actor) {
|
||||
if ((((Player*)focalActor)->meleeWeaponState != 0) &&
|
||||
if ((((Player*)focalActor)->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
|
||||
(((Player*)focalActor)->meleeWeaponAnimation == PLAYER_MWA_GORON_PUNCH_BUTT)) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
if ((((Player*)focalActor)->stateFlags2 & PLAYER_STATE2_20000) ||
|
||||
((((Player*)focalActor)->meleeWeaponState != 0) &&
|
||||
((((Player*)focalActor)->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
|
||||
(((Player*)focalActor)->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_KICK))) {
|
||||
return 1;
|
||||
}
|
||||
@@ -3958,7 +3958,7 @@ s32 Camera_Battle1(Camera* camera) {
|
||||
}
|
||||
|
||||
camera->roll = Camera_ScaledStepToCeilS(sp88, camera->roll, 0.06f, 5);
|
||||
if (func_800CBAAC(camera) != 0) {
|
||||
if (func_800CBAAC(camera) != PLAYER_MELEE_WEAPON_STATE_0) {
|
||||
phi_f12 = ((camera->play->state.frames & 8) != 0) ? roData->unk_20 - (roData->unk_20 * 0.5f) : roData->unk_20;
|
||||
} else {
|
||||
phi_f12 = ((gSaveContext.save.saveInfo.playerData.health <= 16) ? 0.8f : 1.0f) * (sp78 - (sp78 * 0.05f * spEC));
|
||||
|
||||
+36
-48
@@ -114,23 +114,17 @@ void EffectBlure_Init1(void* thisx, void* initParamsx) {
|
||||
EffectBlureInit1* initParams = (EffectBlureInit1*)initParamsx;
|
||||
|
||||
if ((this != NULL) && (initParams != NULL)) {
|
||||
s32 i;
|
||||
|
||||
EffectBlure_InitElements(this);
|
||||
this->p1StartColor.r = initParams->p1StartColor[0];
|
||||
this->p2StartColor.r = initParams->p2StartColor[0];
|
||||
this->p1EndColor.r = initParams->p1EndColor[0];
|
||||
this->p2EndColor.r = initParams->p2EndColor[0];
|
||||
this->p1StartColor.g = initParams->p1StartColor[1];
|
||||
this->p2StartColor.g = initParams->p2StartColor[1];
|
||||
this->p1EndColor.g = initParams->p1EndColor[1];
|
||||
this->p2EndColor.g = initParams->p2EndColor[1];
|
||||
this->p1StartColor.b = initParams->p1StartColor[2];
|
||||
this->p2StartColor.b = initParams->p2StartColor[2];
|
||||
this->p1EndColor.b = initParams->p1EndColor[2];
|
||||
this->p2EndColor.b = initParams->p2EndColor[2];
|
||||
this->p1StartColor.a = initParams->p1StartColor[3];
|
||||
this->p2StartColor.a = initParams->p2StartColor[3];
|
||||
this->p1EndColor.a = initParams->p1EndColor[3];
|
||||
this->p2EndColor.a = initParams->p2EndColor[3];
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
this->p1StartColor[i] = initParams->p1StartColor[i];
|
||||
this->p2StartColor[i] = initParams->p2StartColor[i];
|
||||
this->p1EndColor[i] = initParams->p1EndColor[i];
|
||||
this->p2EndColor[i] = initParams->p2EndColor[i];
|
||||
}
|
||||
|
||||
this->elemDuration = initParams->elemDuration;
|
||||
this->unkFlag = initParams->unkFlag;
|
||||
this->calcMode = initParams->calcMode;
|
||||
@@ -155,23 +149,17 @@ void EffectBlure_Init2(void* thisx, void* initParamsx) {
|
||||
EffectBlureInit2* initParams = (EffectBlureInit2*)initParamsx;
|
||||
|
||||
if ((this != NULL) && (initParams != NULL)) {
|
||||
s32 i;
|
||||
|
||||
EffectBlure_InitElements(this);
|
||||
this->p1StartColor.r = initParams->p1StartColor[0];
|
||||
this->p2StartColor.r = initParams->p2StartColor[0];
|
||||
this->p1EndColor.r = initParams->p1EndColor[0];
|
||||
this->p2EndColor.r = initParams->p2EndColor[0];
|
||||
this->p1StartColor.g = initParams->p1StartColor[1];
|
||||
this->p2StartColor.g = initParams->p2StartColor[1];
|
||||
this->p1EndColor.g = initParams->p1EndColor[1];
|
||||
this->p2EndColor.g = initParams->p2EndColor[1];
|
||||
this->p1StartColor.b = initParams->p1StartColor[2];
|
||||
this->p2StartColor.b = initParams->p2StartColor[2];
|
||||
this->p1EndColor.b = initParams->p1EndColor[2];
|
||||
this->p2EndColor.b = initParams->p2EndColor[2];
|
||||
this->p1StartColor.a = initParams->p1StartColor[3];
|
||||
this->p2StartColor.a = initParams->p2StartColor[3];
|
||||
this->p1EndColor.a = initParams->p1EndColor[3];
|
||||
this->p2EndColor.a = initParams->p2EndColor[3];
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
this->p1StartColor[i] = initParams->p1StartColor[i];
|
||||
this->p2StartColor[i] = initParams->p2StartColor[i];
|
||||
this->p1EndColor[i] = initParams->p1EndColor[i];
|
||||
this->p2EndColor[i] = initParams->p2EndColor[i];
|
||||
}
|
||||
|
||||
this->elemDuration = initParams->elemDuration;
|
||||
this->unkFlag = initParams->unkFlag;
|
||||
this->calcMode = initParams->calcMode;
|
||||
@@ -372,14 +360,14 @@ void EffectBlure_GetComputedValues(EffectBlure* this, s32 index, f32 ratio, Vec3
|
||||
color1->r = color1->g = color1->b = color1->a = 255;
|
||||
color2->r = color2->g = color2->b = color2->a = 255;
|
||||
} else {
|
||||
color1->r = func_800B0A24(this->p1StartColor.r, this->p1EndColor.r, ratio);
|
||||
color1->g = func_800B0A24(this->p1StartColor.g, this->p1EndColor.g, ratio);
|
||||
color1->b = func_800B0A24(this->p1StartColor.b, this->p1EndColor.b, ratio);
|
||||
color1->a = func_800B0A24(this->p1StartColor.a, this->p1EndColor.a, ratio);
|
||||
color2->r = func_800B0A24(this->p2StartColor.r, this->p2EndColor.r, ratio);
|
||||
color2->g = func_800B0A24(this->p2StartColor.g, this->p2EndColor.g, ratio);
|
||||
color2->b = func_800B0A24(this->p2StartColor.b, this->p2EndColor.b, ratio);
|
||||
color2->a = func_800B0A24(this->p2StartColor.a, this->p2EndColor.a, ratio);
|
||||
color1->r = func_800B0A24(this->p1StartColor[0], this->p1EndColor[0], ratio);
|
||||
color1->g = func_800B0A24(this->p1StartColor[1], this->p1EndColor[1], ratio);
|
||||
color1->b = func_800B0A24(this->p1StartColor[2], this->p1EndColor[2], ratio);
|
||||
color1->a = func_800B0A24(this->p1StartColor[3], this->p1EndColor[3], ratio);
|
||||
color2->r = func_800B0A24(this->p2StartColor[0], this->p2EndColor[0], ratio);
|
||||
color2->g = func_800B0A24(this->p2StartColor[1], this->p2EndColor[1], ratio);
|
||||
color2->b = func_800B0A24(this->p2StartColor[2], this->p2EndColor[2], ratio);
|
||||
color2->a = func_800B0A24(this->p2StartColor[3], this->p2EndColor[3], ratio);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -992,19 +980,19 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
|
||||
vtx[j].v.flag = 0;
|
||||
vtx[j].v.tc[0] = 0;
|
||||
vtx[j].v.tc[1] = 0;
|
||||
vtx[j].v.cn[0] = func_800B0A24(this->p1StartColor.r, this->p1EndColor.r, ratio);
|
||||
vtx[j].v.cn[1] = func_800B0A24(this->p1StartColor.g, this->p1EndColor.g, ratio);
|
||||
vtx[j].v.cn[2] = func_800B0A24(this->p1StartColor.b, this->p1EndColor.b, ratio);
|
||||
vtx[j].v.cn[3] = func_800B0A24(this->p1StartColor.a, this->p1EndColor.a, ratio);
|
||||
vtx[j].v.cn[0] = func_800B0A24(this->p1StartColor[0], this->p1EndColor[0], ratio);
|
||||
vtx[j].v.cn[1] = func_800B0A24(this->p1StartColor[1], this->p1EndColor[1], ratio);
|
||||
vtx[j].v.cn[2] = func_800B0A24(this->p1StartColor[2], this->p1EndColor[2], ratio);
|
||||
vtx[j].v.cn[3] = func_800B0A24(this->p1StartColor[3], this->p1EndColor[3], ratio);
|
||||
j++;
|
||||
|
||||
vtx[j].v.flag = 0;
|
||||
vtx[j].v.tc[0] = 0;
|
||||
vtx[j].v.tc[1] = 0;
|
||||
vtx[j].v.cn[0] = func_800B0A24(this->p2StartColor.r, this->p2EndColor.r, ratio);
|
||||
vtx[j].v.cn[1] = func_800B0A24(this->p2StartColor.g, this->p2EndColor.g, ratio);
|
||||
vtx[j].v.cn[2] = func_800B0A24(this->p2StartColor.b, this->p2EndColor.b, ratio);
|
||||
vtx[j].v.cn[3] = func_800B0A24(this->p2StartColor.a, this->p2EndColor.a, ratio);
|
||||
vtx[j].v.cn[0] = func_800B0A24(this->p2StartColor[0], this->p2EndColor[0], ratio);
|
||||
vtx[j].v.cn[1] = func_800B0A24(this->p2StartColor[1], this->p2EndColor[1], ratio);
|
||||
vtx[j].v.cn[2] = func_800B0A24(this->p2StartColor[2], this->p2EndColor[2], ratio);
|
||||
vtx[j].v.cn[3] = func_800B0A24(this->p2StartColor[3], this->p2EndColor[3], ratio);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,13 +69,13 @@ EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play) {
|
||||
do {
|
||||
doorIter = SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
door = (EnDoor*)doorIter;
|
||||
dist = Actor_WorldDistXYZToActor(actor, &door->dyna.actor);
|
||||
dist = Actor_WorldDistXYZToActor(actor, &door->knobDoor.dyna.actor);
|
||||
if (!isSetup || (dist < minDist)) {
|
||||
nearestDoor = door;
|
||||
minDist = dist;
|
||||
isSetup = true;
|
||||
}
|
||||
doorIter = door->dyna.actor.next;
|
||||
doorIter = door->knobDoor.dyna.actor.next;
|
||||
} while (doorIter != NULL);
|
||||
|
||||
if (1) {}
|
||||
@@ -134,16 +134,16 @@ void func_800F0BB4(EnHy* enHy, PlayState* play, EnDoor* door, s16 arg3, s16 arg4
|
||||
Vec3f offset;
|
||||
f32 phi_f0;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&door->dyna.actor, &offset, &enHy->actor.world.pos);
|
||||
Actor_OffsetOfPointInActorCoords(&door->knobDoor.dyna.actor, &offset, &enHy->actor.world.pos);
|
||||
phi_f0 = (offset.z >= 0.0f) ? 1.0f : -1.0f;
|
||||
animIndex = ((s8)phi_f0 < 0) ? 0 : 2;
|
||||
EnHy_ChangeObjectAndAnim(enHy, play, (animIndex == 0) ? arg3 : arg4);
|
||||
enHy->skelAnime.baseTransl = *enHy->skelAnime.jointTable;
|
||||
enHy->skelAnime.prevTransl = *enHy->skelAnime.jointTable;
|
||||
enHy->skelAnime.moveFlags |= (ANIM_FLAG_UPDATEY | ANIM_FLAG_1);
|
||||
enHy->skelAnime.moveFlags |= (ANIM_FLAG_UPDATE_Y | ANIM_FLAG_1);
|
||||
AnimationContext_SetMoveActor(play, &enHy->actor, &enHy->skelAnime, 1.0f);
|
||||
door->unk_1A1 = 1;
|
||||
door->animIndex = animIndex;
|
||||
door->knobDoor.playOpenAnim = true;
|
||||
door->knobDoor.animIndex = animIndex;
|
||||
}
|
||||
|
||||
s32 func_800F0CE4(EnHy* enHy, PlayState* play, ActorFunc draw, s16 arg3, s16 arg4, f32 arg5) {
|
||||
@@ -157,7 +157,7 @@ s32 func_800F0CE4(EnHy* enHy, PlayState* play, ActorFunc draw, s16 arg3, s16 arg
|
||||
if (door != NULL) {
|
||||
ret = true;
|
||||
func_800F0BB4(enHy, play, door, arg3, arg4);
|
||||
yaw = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->dyna.actor.world.pos);
|
||||
yaw = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->knobDoor.dyna.actor.world.pos);
|
||||
enHy->actor.world.pos.x += arg5 * Math_SinS(yaw);
|
||||
enHy->actor.world.pos.z += arg5 * Math_CosS(yaw);
|
||||
enHy->actor.world.rot.y = -yaw;
|
||||
@@ -179,7 +179,7 @@ s32 func_800F0DD4(EnHy* enHy, PlayState* play, s16 arg2, s16 arg3) {
|
||||
if (door != NULL) {
|
||||
ret = true;
|
||||
func_800F0BB4(enHy, play, door, arg2, arg3);
|
||||
enHy->actor.shape.rot.y = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->dyna.actor.world.pos);
|
||||
enHy->actor.shape.rot.y = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->knobDoor.dyna.actor.world.pos);
|
||||
enHy->actor.world.rot.y = enHy->actor.shape.rot.y;
|
||||
enHy->actor.gravity = 0.0f;
|
||||
enHy->actor.flags &= ~ACTOR_FLAG_1;
|
||||
|
||||
+2
-2
@@ -2327,8 +2327,8 @@ void Play_Init(GameState* thisx) {
|
||||
Camera_InitFocalActorSettings(&this->mainCamera, &player->actor);
|
||||
gDbgCamEnabled = false;
|
||||
|
||||
if ((player->actor.params & 0xFF) != 0xFF) {
|
||||
Camera_ChangeActorCsCamIndex(&this->mainCamera, player->actor.params & 0xFF);
|
||||
if (PLAYER_GET_BG_CAM_INDEX(&player->actor) != 0xFF) {
|
||||
Camera_ChangeActorCsCamIndex(&this->mainCamera, PLAYER_GET_BG_CAM_INDEX(&player->actor));
|
||||
}
|
||||
|
||||
CutsceneManager_StoreCamera(&this->mainCamera);
|
||||
|
||||
+31
-27
@@ -472,7 +472,7 @@ void func_80123140(PlayState* play, Player* player) {
|
||||
REG(39) = bootRegs[8];
|
||||
REG(43) = bootRegs[9];
|
||||
R_RUN_SPEED_LIMIT = bootRegs[10];
|
||||
REG(68) = bootRegs[11];
|
||||
REG(68) = bootRegs[11]; // gravity
|
||||
REG(69) = bootRegs[12];
|
||||
IREG(66) = bootRegs[13];
|
||||
IREG(67) = bootRegs[14];
|
||||
@@ -503,7 +503,7 @@ s32 Player_InBlockingCsMode(PlayState* play, Player* player) {
|
||||
s32 Player_InCsMode(PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
return Player_InBlockingCsMode(play, player) || player->unk_AA5 == 5;
|
||||
return Player_InBlockingCsMode(play, player) || (player->unk_AA5 == PLAYER_UNKAA5_5);
|
||||
}
|
||||
|
||||
s32 func_80123420(Player* player) {
|
||||
@@ -556,8 +556,8 @@ s32 func_801235DC(PlayState* play, f32 arg1, s16 arg2) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (player->stateFlags3 & PLAYER_STATE3_1000) {
|
||||
player->unk_B08[0] = arg1;
|
||||
player->unk_B08[1] += arg1 * 0.05f;
|
||||
player->unk_B08 = arg1;
|
||||
player->unk_B0C += arg1 * 0.05f;
|
||||
player->currentYaw = arg2;
|
||||
player->actor.home.rot.y = arg2;
|
||||
player->actor.shape.rot.y = arg2;
|
||||
@@ -659,7 +659,7 @@ u8 sActionModelGroups[PLAYER_IA_MAX] = {
|
||||
PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_KOKIRI
|
||||
PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_RAZOR
|
||||
PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_GILDED
|
||||
PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_IA_SWORD_GREAT_FAIRY
|
||||
PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_IA_SWORD_TWO_HANDED
|
||||
PLAYER_MODELGROUP_STICK, // PLAYER_IA_STICK
|
||||
PLAYER_MODELGROUP_ZORA_FINS, // PLAYER_IA_ZORA_FINS
|
||||
PLAYER_MODELGROUP_BOW, // PLAYER_IA_BOW
|
||||
@@ -1316,6 +1316,7 @@ void Player_UpdateBottleHeld(PlayState* play, Player* player, ItemId itemId, Pla
|
||||
player->itemAction = itemAction;
|
||||
}
|
||||
|
||||
// Player_Untarget / Player_StopTargeting?
|
||||
void func_80123DA4(Player* player) {
|
||||
player->targetedActor = NULL;
|
||||
player->stateFlags2 &= ~PLAYER_STATE2_2000;
|
||||
@@ -1445,7 +1446,7 @@ PlayerMeleeWeapon Player_GetMeleeWeaponHeld(Player* player) {
|
||||
|
||||
s32 Player_IsHoldingTwoHandedWeapon(Player* player) {
|
||||
// Relies on the itemActions for two-handed weapons being contiguous.
|
||||
if ((player->heldItemAction >= PLAYER_IA_SWORD_GREAT_FAIRY) && (player->heldItemAction <= PLAYER_IA_STICK)) {
|
||||
if ((player->heldItemAction >= PLAYER_IA_SWORD_TWO_HANDED) && (player->heldItemAction <= PLAYER_IA_STICK)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2038,7 +2039,7 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
|
||||
pos->x *= player->ageProperties->unk_08;
|
||||
pos->z *= player->ageProperties->unk_08;
|
||||
}
|
||||
if (!(player->skelAnime.moveFlags & ANIM_FLAG_4) || (player->skelAnime.moveFlags & ANIM_FLAG_UPDATEY)) {
|
||||
if (!(player->skelAnime.moveFlags & ANIM_FLAG_4) || (player->skelAnime.moveFlags & ANIM_FLAG_UPDATE_Y)) {
|
||||
pos->y *= player->ageProperties->unk_08;
|
||||
}
|
||||
}
|
||||
@@ -2552,14 +2553,16 @@ void func_8012669C(PlayState* play, Player* player, Vec3f* arg2, Vec3f* arg3) {
|
||||
Matrix_MultVec3f(arg2, &sp3C);
|
||||
Matrix_MultVec3f(arg3, &sp30);
|
||||
|
||||
if (player->meleeWeaponState != 0) {
|
||||
if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) {
|
||||
if (func_80126440(play, NULL, &player->meleeWeaponInfo[0], &sp3C, &sp30) &&
|
||||
(player->transformation != PLAYER_FORM_GORON) && (!(player->stateFlags1 & PLAYER_STATE1_400000))) {
|
||||
EffectBlure_AddVertex(Effect_GetByIndex(player->meleeWeaponEffectIndex[0]), &player->meleeWeaponInfo[0].tip,
|
||||
&player->meleeWeaponInfo[0].base);
|
||||
}
|
||||
if ((player->meleeWeaponState > 0) && ((player->meleeWeaponAnimation < PLAYER_MWA_SPIN_ATTACK_1H) ||
|
||||
(player->stateFlags2 & PLAYER_STATE2_20000))) {
|
||||
|
||||
if ((player->meleeWeaponState >= PLAYER_MELEE_WEAPON_STATE_1) &&
|
||||
((player->meleeWeaponAnimation < PLAYER_MWA_SPIN_ATTACK_1H) ||
|
||||
(player->stateFlags2 & PLAYER_STATE2_20000))) {
|
||||
Matrix_MultVec3f(&arg2[1], &sp3C);
|
||||
Matrix_MultVec3f(&arg3[1], &sp30);
|
||||
func_80126440(play, &player->meleeWeaponQuads[0], &player->meleeWeaponInfo[1], &sp3C, &sp30);
|
||||
@@ -2714,7 +2717,7 @@ void func_80126BD0(PlayState* play, Player* player, s32 arg2) {
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, D_801C0AB4[arg2]);
|
||||
|
||||
if (player->meleeWeaponState != 0) {
|
||||
if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) {
|
||||
if ((((player->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_LEFT)) && (arg2 == 0)) ||
|
||||
((player->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_COMBO) && (arg2 != 0))) {
|
||||
func_8012669C(play, player, D_801C0A00, D_801C09DC);
|
||||
@@ -3296,7 +3299,7 @@ s32 func_80128640(PlayState* play, Player* player, Gfx* dlist) {
|
||||
Matrix_Push();
|
||||
Matrix_Translate(-428.26f, 267.2f, -33.82f, MTXMODE_APPLY);
|
||||
Matrix_RotateZYX(-0x8000, 0, 0x4000, MTXMODE_APPLY);
|
||||
Matrix_Scale(1.0f, player->unk_B08[1], 1.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(1.0f, player->unk_B0C, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gDekuStickDL);
|
||||
@@ -3413,7 +3416,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
|
||||
3000.0f, // PLAYER_MELEEWEAPON_SWORD_KOKIRI
|
||||
3000.0f, // PLAYER_MELEEWEAPON_SWORD_RAZOR
|
||||
4000.0f, // PLAYER_MELEEWEAPON_SWORD_GILDED
|
||||
5500.0f, // PLAYER_MELEEWEAPON_SWORD_GREAT_FAIRY
|
||||
5500.0f, // PLAYER_MELEEWEAPON_SWORD_TWO_HANDED
|
||||
-1.0f, // PLAYER_MELEEWEAPON_STICK
|
||||
2500.0f, // PLAYER_MELEEWEAPON_ZORA_FINS
|
||||
};
|
||||
@@ -3421,19 +3424,19 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
|
||||
if ((player->transformation == PLAYER_FORM_FIERCE_DEITY) ||
|
||||
((player->transformation != PLAYER_FORM_ZORA) &&
|
||||
((player->itemAction == PLAYER_IA_STICK) ||
|
||||
((player->meleeWeaponState != 0) &&
|
||||
((player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
|
||||
(player->meleeWeaponAnimation != PLAYER_MWA_GORON_PUNCH_RIGHT) &&
|
||||
(player->meleeWeaponAnimation != PLAYER_MWA_GORON_PUNCH_BUTT))))) {
|
||||
if (player->itemAction == PLAYER_IA_STICK) {
|
||||
D_801C0994->x = player->unk_B08[1] * 5000.0f;
|
||||
D_801C0994->x = player->unk_B0C * 5000.0f;
|
||||
} else {
|
||||
D_801C0994->x = sMeleeWeaponLengths[Player_GetMeleeWeaponHeld(player)];
|
||||
}
|
||||
func_80126B8C(play, player);
|
||||
}
|
||||
|
||||
Matrix_Get(&player->mf_CC4);
|
||||
Matrix_MtxFToYXZRot(&player->mf_CC4, &player->leftHandWorld.rot, false);
|
||||
Matrix_Get(&player->leftHandMf);
|
||||
Matrix_MtxFToYXZRot(&player->leftHandMf, &player->leftHandWorld.rot, false);
|
||||
}
|
||||
}
|
||||
} else if (limbIndex == PLAYER_LIMB_RIGHT_HAND) {
|
||||
@@ -3458,18 +3461,18 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
|
||||
|
||||
Matrix_MultZero(&sp20C);
|
||||
temp_fv0 = Math_Vec3f_DistXYZ(sPlayerCurBodyPartPos, &sp20C);
|
||||
player->unk_B08[0] = temp_fv0 - 3.0f;
|
||||
player->unk_B08 = temp_fv0 - 3.0f;
|
||||
if (temp_fv0 < 3.0f) {
|
||||
player->unk_B08[0] = 0.0f;
|
||||
player->unk_B08 = 0.0f;
|
||||
} else {
|
||||
player->unk_B08[0] *= 1.6f;
|
||||
if (player->unk_B08[0] > 1.0f) {
|
||||
player->unk_B08[0] = 1.0f;
|
||||
player->unk_B08 *= 1.6f;
|
||||
if (player->unk_B08 > 1.0f) {
|
||||
player->unk_B08 = 1.0f;
|
||||
}
|
||||
}
|
||||
player->unk_B08[1] = -0.5f;
|
||||
player->unk_B0C = -0.5f;
|
||||
}
|
||||
Matrix_Scale(1.0f, player->unk_B08[0], 1.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(1.0f, player->unk_B08, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -3518,7 +3521,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
|
||||
Player_DrawHookshotReticle(play, player, 77600.0f);
|
||||
}
|
||||
}
|
||||
} else if (player->meleeWeaponState != 0) {
|
||||
} else if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) {
|
||||
if (player->meleeWeaponAnimation == PLAYER_MWA_GORON_PUNCH_RIGHT) {
|
||||
func_80126B8C(play, player);
|
||||
}
|
||||
@@ -3590,6 +3593,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
|
||||
for (i = 0; i < ARRAY_COUNT(sp178); i++) {
|
||||
Matrix_Push();
|
||||
Matrix_Scale(sp178[i].x, sp178[i].y, sp178[i].z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -3811,7 +3815,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
|
||||
&player->meleeWeaponInfo[0].base);
|
||||
}
|
||||
} else if (limbIndex == PLAYER_LIMB_RIGHT_SHIN) {
|
||||
if (player->meleeWeaponState != 0) {
|
||||
if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) {
|
||||
if ((player->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_KICK) ||
|
||||
(player->meleeWeaponAnimation == PLAYER_MWA_ZORA_JUMPKICK_START) ||
|
||||
(player->meleeWeaponAnimation == PLAYER_MWA_ZORA_JUMPKICK_FINISH)) {
|
||||
@@ -3819,7 +3823,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
|
||||
}
|
||||
}
|
||||
} else if (limbIndex == PLAYER_LIMB_WAIST) {
|
||||
if (player->meleeWeaponState != 0) {
|
||||
if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) {
|
||||
if (player->meleeWeaponAnimation == PLAYER_MWA_GORON_PUNCH_BUTT) {
|
||||
Math_Vec3f_Copy(&player->unk_AF0[1], &player->meleeWeaponInfo[0].base);
|
||||
func_8012669C(play, player, D_801C0A90, D_801C0A6C);
|
||||
|
||||
@@ -1944,7 +1944,7 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) {
|
||||
skelAnime->jointTable->x = skelAnime->baseTransl.x;
|
||||
skelAnime->prevTransl.z = skelAnime->jointTable->z;
|
||||
skelAnime->jointTable->z = skelAnime->baseTransl.z;
|
||||
if (skelAnime->moveFlags & ANIM_FLAG_UPDATEY) {
|
||||
if (skelAnime->moveFlags & ANIM_FLAG_UPDATE_Y) {
|
||||
if (skelAnime->moveFlags & ANIM_FLAG_NOMOVE) {
|
||||
diff->y = 0.0f;
|
||||
} else {
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ Vec3f gOneVec3f = { 1.0f, 1.0f, 1.0f };
|
||||
s32 D_801C5DBC[] = { 0, 1 }; // Unused
|
||||
|
||||
/**
|
||||
* Finds the first EnDoor instance with unk_1A4 == 5 and the specified switchFlag.
|
||||
* Finds the first EnDoor instance with doorType == ENDOOR_TYPE_5 and the specified switchFlag.
|
||||
*/
|
||||
EnDoor* SubS_FindDoor(PlayState* play, s32 switchFlag) {
|
||||
Actor* actor = NULL;
|
||||
@@ -29,7 +29,7 @@ EnDoor* SubS_FindDoor(PlayState* play, s32 switchFlag) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((door->unk_1A4 == 5) && (door->switchFlag == (u8)switchFlag)) {
|
||||
if ((door->doorType == ENDOOR_TYPE_5) && (door->switchFlag == (u8)switchFlag)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,6 +141,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
|
||||
if (this->timer != 0 && (this->collider.base.atFlags & AT_HIT) &&
|
||||
(this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4)) {
|
||||
Actor* touchedActor = this->collider.base.at;
|
||||
|
||||
if ((touchedActor->update != NULL) && (touchedActor->flags & (ACTOR_FLAG_200 | ACTOR_FLAG_400))) {
|
||||
if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) {
|
||||
ArmsHook_AttachHookToActor(this, touchedActor);
|
||||
|
||||
@@ -15,7 +15,7 @@ typedef struct ArmsHook {
|
||||
/* 0x1EC */ Vec3f unk1EC;
|
||||
/* 0x1F8 */ Actor* grabbed;
|
||||
/* 0x1FC */ Vec3f unk1FC;
|
||||
/* 0x208 */ UNK_TYPE1 unk208[0x2];
|
||||
/* 0x208 */ s8 unk_208;
|
||||
/* 0x20A */ s16 timer;
|
||||
/* 0x20C */ ArmsHookActionFunc actionFunc;
|
||||
} ArmsHook; // size = 0x210
|
||||
|
||||
@@ -321,8 +321,8 @@ void func_80B84610(BgDblueWaterfall* this, PlayState* play) {
|
||||
player->actor.world.pos.x += sp34.x;
|
||||
player->actor.world.pos.z += sp34.z;
|
||||
if (this && this && this) {}
|
||||
player->unk_B80 = 8.0f;
|
||||
player->unk_B84 = this->actor.yawTowardsPlayer;
|
||||
player->pushedSpeed = 8.0f;
|
||||
player->pushedYaw = this->actor.yawTowardsPlayer;
|
||||
}
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
|
||||
@@ -68,10 +68,10 @@ s8 func_80ACABA8(BgOpenShutter* this, PlayState* play) {
|
||||
f32 temp_fv0;
|
||||
s16 temp_v0;
|
||||
|
||||
if (!Player_InCsMode(play) && (this->dyna.actor.xzDistToPlayer < 100.0f)) {
|
||||
temp_fv0 = func_80ACAB10(play, &this->dyna.actor, 0.0f, 65.0f, 15.0f);
|
||||
if (!Player_InCsMode(play) && (this->slidingDoor.dyna.actor.xzDistToPlayer < 100.0f)) {
|
||||
temp_fv0 = func_80ACAB10(play, &this->slidingDoor.dyna.actor, 0.0f, 65.0f, 15.0f);
|
||||
if (fabsf(temp_fv0) < 50.0f) {
|
||||
temp_v0 = player->actor.shape.rot.y - this->dyna.actor.shape.rot.y;
|
||||
temp_v0 = player->actor.shape.rot.y - this->slidingDoor.dyna.actor.shape.rot.y;
|
||||
if (temp_fv0 > 0.0f) {
|
||||
temp_v0 = (0x8000 - temp_v0);
|
||||
}
|
||||
@@ -91,31 +91,32 @@ s8 func_80ACABA8(BgOpenShutter* this, PlayState* play) {
|
||||
void BgOpenShutter_Init(Actor* thisx, PlayState* play) {
|
||||
BgOpenShutter* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &object_open_obj_Colheader_001640);
|
||||
Actor_ProcessInitChain(&this->slidingDoor.dyna.actor, sInitChain);
|
||||
DynaPolyActor_Init(&this->slidingDoor.dyna, DYNA_TRANSFORM_POS);
|
||||
DynaPolyActor_LoadMesh(play, &this->slidingDoor.dyna, &object_open_obj_Colheader_001640);
|
||||
this->actionFunc = func_80ACAD88;
|
||||
}
|
||||
|
||||
void BgOpenShutter_Destroy(Actor* thisx, PlayState* play) {
|
||||
BgOpenShutter* this = THIS;
|
||||
s32 params = BGOPENSHUTTER_GET_A(thisx);
|
||||
s32 transition = DOOR_GET_TRANSITION_ID(thisx);
|
||||
|
||||
play->doorCtx.transitionActorList[params].id = -play->doorCtx.transitionActorList[params].id;
|
||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||
play->doorCtx.transitionActorList[transition].id = -play->doorCtx.transitionActorList[transition].id;
|
||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->slidingDoor.dyna.bgId);
|
||||
}
|
||||
|
||||
void func_80ACAD88(BgOpenShutter* this, PlayState* play) {
|
||||
s32 doorDirection;
|
||||
|
||||
if (this->unk_15C != 0) {
|
||||
if (this->slidingDoor.unk_15C != 0) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
|
||||
Camera_ChangeDoorCam(play->cameraPtrs[CAM_ID_MAIN], &this->dyna.actor, player->unk_3BA, 0.0f, 12, 15, 10);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
|
||||
Camera_ChangeDoorCam(play->cameraPtrs[CAM_ID_MAIN], &this->slidingDoor.dyna.actor, player->doorBgCamIndex, 0.0f,
|
||||
12, 15, 10);
|
||||
this->unk_164 = 0;
|
||||
this->actionFunc = func_80ACAE5C;
|
||||
this->dyna.actor.velocity.y = 0.0f;
|
||||
this->slidingDoor.dyna.actor.velocity.y = 0.0f;
|
||||
} else {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
@@ -123,20 +124,20 @@ void func_80ACAD88(BgOpenShutter* this, PlayState* play) {
|
||||
if (doorDirection > 0) {
|
||||
player->doorType = PLAYER_DOORTYPE_SLIDING;
|
||||
player->doorDirection = doorDirection;
|
||||
player->doorActor = &this->dyna.actor;
|
||||
player->doorActor = &this->slidingDoor.dyna.actor;
|
||||
func_80122F28(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80ACAE5C(BgOpenShutter* this, PlayState* play) {
|
||||
Math_StepToF(&this->dyna.actor.velocity.y, 15.0f, 3.0f);
|
||||
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f,
|
||||
this->dyna.actor.velocity.y)) {
|
||||
Math_StepToF(&this->slidingDoor.dyna.actor.velocity.y, 15.0f, 3.0f);
|
||||
if (Math_StepToF(&this->slidingDoor.dyna.actor.world.pos.y, this->slidingDoor.dyna.actor.home.pos.y + 120.0f,
|
||||
this->slidingDoor.dyna.actor.velocity.y)) {
|
||||
this->unk_164++;
|
||||
}
|
||||
if (this->unk_164 >= 10) {
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
|
||||
this->actionFunc = func_80ACAEF0;
|
||||
}
|
||||
}
|
||||
@@ -145,20 +146,22 @@ void func_80ACAEF0(BgOpenShutter* this, PlayState* play) {
|
||||
s32 pad;
|
||||
s16 quakeIndex;
|
||||
|
||||
Math_StepToF(&this->dyna.actor.velocity.y, 20.0f, 8.0f);
|
||||
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) {
|
||||
this->dyna.actor.floorHeight = this->dyna.actor.home.pos.y;
|
||||
Actor_SpawnFloorDustRing(play, &this->dyna.actor, &this->dyna.actor.world.pos, 60.0f, 10, 8.0f, 500, 10, true);
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND);
|
||||
Math_StepToF(&this->slidingDoor.dyna.actor.velocity.y, 20.0f, 8.0f);
|
||||
if (Math_StepToF(&this->slidingDoor.dyna.actor.world.pos.y, this->slidingDoor.dyna.actor.home.pos.y,
|
||||
this->slidingDoor.dyna.actor.velocity.y)) {
|
||||
this->slidingDoor.dyna.actor.floorHeight = this->slidingDoor.dyna.actor.home.pos.y;
|
||||
Actor_SpawnFloorDustRing(play, &this->slidingDoor.dyna.actor, &this->slidingDoor.dyna.actor.world.pos, 60.0f,
|
||||
10, 8.0f, 500, 10, true);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_BIGWALL_BOUND);
|
||||
|
||||
quakeIndex = Quake_Request(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3);
|
||||
Quake_SetSpeed(quakeIndex, -32536);
|
||||
Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0);
|
||||
Quake_SetDuration(quakeIndex, 10);
|
||||
|
||||
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||
Rumble_Request(this->slidingDoor.dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||
|
||||
this->unk_15C = 0;
|
||||
this->slidingDoor.unk_15C = 0;
|
||||
this->actionFunc = func_80ACAD88;
|
||||
}
|
||||
}
|
||||
@@ -172,14 +175,14 @@ void BgOpenShutter_Update(Actor* thisx, PlayState* play2) {
|
||||
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_124);
|
||||
if (play->csCtx.actorCues[cueChannel]->id == BGOPENSHUTTER_DOOR_OPEN) {
|
||||
if (this->actionFunc == func_80ACAD88) {
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
|
||||
this->actionFunc = func_80ACAE5C;
|
||||
this->dyna.actor.velocity.y = 0.0f;
|
||||
this->slidingDoor.dyna.actor.velocity.y = 0.0f;
|
||||
}
|
||||
this->unk_164 = 0;
|
||||
} else if (play->csCtx.actorCues[cueChannel]->id == BGOPENSHUTTER_DOOR_CLOSED) {
|
||||
if (this->actionFunc == func_80ACAE5C) {
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
|
||||
this->actionFunc = func_80ACAEF0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,14 @@
|
||||
#define Z_BG_OPEN_SHUTTER_H
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#define BGOPENSHUTTER_GET_A(thisx) ((u16)((thisx)->params) >> 0xA)
|
||||
#include "z64door.h"
|
||||
|
||||
struct BgOpenShutter;
|
||||
|
||||
typedef void (*BgOpenShutterActionFunc)(struct BgOpenShutter*, PlayState*);
|
||||
|
||||
typedef struct BgOpenShutter {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 0x15C */ s16 unk_15C;
|
||||
/* 0x000 */ SlidingDoorActor slidingDoor;
|
||||
/* 0x160 */ BgOpenShutterActionFunc actionFunc;
|
||||
/* 0x164 */ s32 unk_164;
|
||||
} BgOpenShutter; // size = 0x168
|
||||
|
||||
@@ -1842,16 +1842,16 @@ void Boss03_UpdateCollision(Boss03* this, PlayState* play) {
|
||||
for (i = 0; i < ARRAY_COUNT(sHeadJntSphElementsInit); i++) {
|
||||
if (this->headCollider.elements[i].info.toucherFlags & TOUCH_HIT) {
|
||||
this->headCollider.elements[i].info.toucherFlags &= ~TOUCH_HIT;
|
||||
player->unk_B84 = this->actor.shape.rot.y;
|
||||
player->unk_B80 = 20.0f;
|
||||
player->pushedYaw = this->actor.shape.rot.y;
|
||||
player->pushedSpeed = 20.0f;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sBodyJntSphElementsInit); i++) {
|
||||
if (this->bodyCollider.elements[i].info.toucherFlags & TOUCH_HIT) {
|
||||
this->bodyCollider.elements[i].info.toucherFlags &= ~TOUCH_HIT;
|
||||
player->unk_B84 = this->actor.shape.rot.y;
|
||||
player->unk_B80 = 20.0f;
|
||||
player->pushedYaw = this->actor.shape.rot.y;
|
||||
player->pushedSpeed = 20.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,15 +139,17 @@ void DoorShutter_SetupAction(DoorShutter* this, DoorShutterActionFunc actionFunc
|
||||
}
|
||||
|
||||
s32 func_808A0900(DoorShutter* this, PlayState* play) {
|
||||
TransitionActorEntry* transitionEntry = &play->doorCtx.transitionActorList[DOORSHUTTER_GET_FC00(&this->actor)];
|
||||
TransitionActorEntry* transitionEntry =
|
||||
&play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor)];
|
||||
s8 frontRoom = transitionEntry->sides[0].room;
|
||||
|
||||
if (frontRoom == transitionEntry->sides[1].room) {
|
||||
if (ABS_ALT(BINANG_SUB(this->actor.shape.rot.y, this->actor.yawTowardsPlayer)) < 0x4000) {
|
||||
if (ABS_ALT(BINANG_SUB(this->slidingDoor.dyna.actor.shape.rot.y,
|
||||
this->slidingDoor.dyna.actor.yawTowardsPlayer)) < 0x4000) {
|
||||
frontRoom = -1;
|
||||
}
|
||||
}
|
||||
return frontRoom == this->actor.room;
|
||||
return frontRoom == this->slidingDoor.dyna.actor.room;
|
||||
}
|
||||
|
||||
s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) {
|
||||
@@ -173,13 +175,13 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if (doorType == 1) {
|
||||
if (!Flags_GetClear(play, this->actor.room)) {
|
||||
if (!Flags_GetClear(play, this->slidingDoor.dyna.actor.room)) {
|
||||
DoorShutter_SetupAction(this, func_808A0F88);
|
||||
this->unk_168 = 1.0f;
|
||||
return true;
|
||||
}
|
||||
} else if ((doorType == 2) || (doorType == 7)) {
|
||||
if (!Flags_GetSwitch(play, DOORSHUTTER_GET_7F(&this->actor))) {
|
||||
if (!Flags_GetSwitch(play, DOORSHUTTER_GET_7F(&this->slidingDoor.dyna.actor))) {
|
||||
DoorShutter_SetupAction(this, func_808A1548);
|
||||
this->unk_168 = 1.0f;
|
||||
return true;
|
||||
@@ -201,8 +203,8 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
|
||||
s32 sp24;
|
||||
s32 i;
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
this->doorType = DOORSHUTTER_GET_380(&this->actor);
|
||||
Actor_ProcessInitChain(&this->slidingDoor.dyna.actor, sInitChain);
|
||||
this->doorType = DOORSHUTTER_GET_380(&this->slidingDoor.dyna.actor);
|
||||
sp24 = D_808A2240[this->doorType];
|
||||
|
||||
if (sp24 < 0) {
|
||||
@@ -216,7 +218,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
|
||||
|
||||
sp24 = shutterSceneInfo->index;
|
||||
if (sp24 == 6) {
|
||||
this->actor.flags |= ACTOR_FLAG_10000000;
|
||||
this->slidingDoor.dyna.actor.flags |= ACTOR_FLAG_10000000;
|
||||
}
|
||||
} else if (sp24 == 0) {
|
||||
BossDoorInfo* bossDoorInfo = &D_808A22A0[0];
|
||||
@@ -227,13 +229,13 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
|
||||
}
|
||||
}
|
||||
|
||||
this->unk_15E = bossDoorInfo->index;
|
||||
this->slidingDoor.unk_15E = bossDoorInfo->index;
|
||||
} else {
|
||||
this->actor.room = -1;
|
||||
this->slidingDoor.dyna.actor.room = -1;
|
||||
}
|
||||
|
||||
if ((this->requiredObjBankIndex = Object_GetIndex(&play->objectCtx, D_808A2180[sp24].objectId)) < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
Actor_Kill(&this->slidingDoor.dyna.actor);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -241,19 +243,19 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
|
||||
this->unk_163 = sp24;
|
||||
|
||||
if ((this->doorType == 4) || (this->doorType == 5)) {
|
||||
if (!Flags_GetSwitch(play, DOORSHUTTER_GET_7F(&this->actor))) {
|
||||
if (!Flags_GetSwitch(play, DOORSHUTTER_GET_7F(&this->slidingDoor.dyna.actor))) {
|
||||
this->unk_166 = 10;
|
||||
}
|
||||
}
|
||||
|
||||
Actor_SetFocus(&this->actor, 60.0f);
|
||||
Actor_SetFocus(&this->slidingDoor.dyna.actor, 60.0f);
|
||||
}
|
||||
|
||||
void DoorShutter_Destroy(Actor* thisx, PlayState* play) {
|
||||
DoorShutter* this = THIS;
|
||||
|
||||
if (this->actor.room >= 0) {
|
||||
s32 transitionActorId = DOORSHUTTER_GET_FC00(&this->actor);
|
||||
if (this->slidingDoor.dyna.actor.room >= 0) {
|
||||
s32 transitionActorId = DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor);
|
||||
|
||||
play->doorCtx.transitionActorList[transitionActorId].id =
|
||||
-play->doorCtx.transitionActorList[transitionActorId].id;
|
||||
@@ -263,8 +265,8 @@ void DoorShutter_Destroy(Actor* thisx, PlayState* play) {
|
||||
void DoorShutter_SetupType(DoorShutter* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex) &&
|
||||
(!R_PLAY_FILL_SCREEN_ON || (R_PLAY_FILL_SCREEN_ALPHA == 0))) {
|
||||
this->actor.objBankIndex = this->requiredObjBankIndex;
|
||||
this->actor.draw = DoorShutter_Draw;
|
||||
this->slidingDoor.dyna.actor.objBankIndex = this->requiredObjBankIndex;
|
||||
this->slidingDoor.dyna.actor.draw = DoorShutter_Draw;
|
||||
DoorShutter_SetupDoor(this, play);
|
||||
}
|
||||
}
|
||||
@@ -278,7 +280,7 @@ f32 func_808A0D90(PlayState* play, DoorShutter* this, f32 arg2, f32 arg3, f32 ar
|
||||
sp28.y = player->actor.world.pos.y + arg2;
|
||||
sp28.z = player->actor.world.pos.z;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp1C, &sp28);
|
||||
Actor_OffsetOfPointInActorCoords(&this->slidingDoor.dyna.actor, &sp1C, &sp28);
|
||||
|
||||
if ((arg3 < fabsf(sp1C.x)) || (arg4 < fabsf(sp1C.y))) {
|
||||
return FLT_MAX;
|
||||
@@ -294,7 +296,7 @@ s32 func_808A0E28(DoorShutter* this, PlayState* play) {
|
||||
f32 temp_f0 = func_808A0D90(play, this, 0.0f, shutterInfo->unk_0A, shutterInfo->unk_0B);
|
||||
|
||||
if (fabsf(temp_f0) < 50.0f) {
|
||||
s16 temp_v0_2 = BINANG_SUB(player->actor.shape.rot.y, this->actor.shape.rot.y);
|
||||
s16 temp_v0_2 = BINANG_SUB(player->actor.shape.rot.y, this->slidingDoor.dyna.actor.shape.rot.y);
|
||||
|
||||
if (temp_f0 > 0.0f) {
|
||||
temp_v0_2 = 0x8000 - temp_v0_2;
|
||||
@@ -309,8 +311,9 @@ s32 func_808A0E28(DoorShutter* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_808A0F88(DoorShutter* this, PlayState* play) {
|
||||
if (Flags_GetClear(play, this->actor.room) || Flags_GetClearTemp(play, this->actor.room)) {
|
||||
this->csId = this->actor.csId;
|
||||
if (Flags_GetClear(play, this->slidingDoor.dyna.actor.room) ||
|
||||
Flags_GetClearTemp(play, this->slidingDoor.dyna.actor.room)) {
|
||||
this->csId = this->slidingDoor.dyna.actor.csId;
|
||||
if (this->doorType == 7) {
|
||||
if (this->csId != CS_ID_NONE) {
|
||||
this->csId = CutsceneManager_GetAdditionalCsId(this->csId);
|
||||
@@ -318,8 +321,8 @@ void func_808A0F88(DoorShutter* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if (CutsceneManager_IsNext(this->csId)) {
|
||||
CutsceneManager_StartWithPlayerCs(this->csId, &this->actor);
|
||||
Flags_SetClear(play, this->actor.room);
|
||||
CutsceneManager_StartWithPlayerCs(this->csId, &this->slidingDoor.dyna.actor);
|
||||
Flags_SetClear(play, this->slidingDoor.dyna.actor.room);
|
||||
DoorShutter_SetupAction(this, func_808A1784);
|
||||
this->unk_167 = -1;
|
||||
} else {
|
||||
@@ -329,8 +332,8 @@ void func_808A0F88(DoorShutter* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
player->doorActor = &this->actor;
|
||||
this->actor.textId = 0x1801;
|
||||
player->doorActor = &this->slidingDoor.dyna.actor;
|
||||
this->slidingDoor.dyna.actor.textId = 0x1801;
|
||||
func_80122F28(player);
|
||||
}
|
||||
}
|
||||
@@ -339,16 +342,16 @@ void func_808A1080(DoorShutter* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_808A1090(DoorShutter* this, PlayState* play) {
|
||||
if (this->unk_15C != 0) {
|
||||
if (this->slidingDoor.unk_15C != 0) {
|
||||
DoorShutter_SetupAction(this, func_808A1684);
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->slidingDoor.dyna.actor.velocity.y = 0.0f;
|
||||
if (this->unk_166 != 0) {
|
||||
Flags_SetSwitch(play, DOORSHUTTER_GET_7F(&this->actor));
|
||||
Flags_SetSwitch(play, DOORSHUTTER_GET_7F(&this->slidingDoor.dyna.actor));
|
||||
if (this->doorType != 5) {
|
||||
gSaveContext.save.saveInfo.inventory.dungeonKeys[gSaveContext.mapIndex]--;
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
|
||||
} else {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -359,7 +362,7 @@ void func_808A1090(DoorShutter* this, PlayState* play) {
|
||||
|
||||
player->doorType = PLAYER_DOORTYPE_SLIDING;
|
||||
player->doorDirection = doorDirection;
|
||||
player->doorActor = &this->actor;
|
||||
player->doorActor = &this->slidingDoor.dyna.actor;
|
||||
|
||||
if (this->unk_163 == 7) {
|
||||
player->doorTimer = 12;
|
||||
@@ -368,20 +371,21 @@ void func_808A1090(DoorShutter* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if (this->doorType == 6) {
|
||||
if (gSaveContext.save.saveInfo.playerData.healthCapacity < (DOORSHUTTER_GET_1F(&this->actor) * 0x10)) {
|
||||
if (gSaveContext.save.saveInfo.playerData.healthCapacity <
|
||||
(DOORSHUTTER_GET_1F(&this->slidingDoor.dyna.actor) * 0x10)) {
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
this->actor.textId = 0x14FC;
|
||||
this->slidingDoor.dyna.actor.textId = 0x14FC;
|
||||
}
|
||||
} else if (this->unk_166 != 0) {
|
||||
if (this->doorType == 5) {
|
||||
if (!CHECK_DUNGEON_ITEM(DUNGEON_BOSS_KEY, gSaveContext.mapIndex)) {
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
this->actor.textId = 0x1803;
|
||||
this->slidingDoor.dyna.actor.textId = 0x1803;
|
||||
}
|
||||
player->doorTimer += 10;
|
||||
} else if (DUNGEON_KEY_COUNT(gSaveContext.mapIndex) <= 0) {
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
this->actor.textId = 0x1802;
|
||||
this->slidingDoor.dyna.actor.textId = 0x1802;
|
||||
} else {
|
||||
player->doorTimer += 10;
|
||||
}
|
||||
@@ -392,7 +396,7 @@ void func_808A1090(DoorShutter* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_808A1288(DoorShutter* this, PlayState* play) {
|
||||
if (this->actor.category == ACTORCAT_DOOR) {
|
||||
if (this->slidingDoor.dyna.actor.category == ACTORCAT_DOOR) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
s32 sp38 = this->unk_164;
|
||||
s32 sp34 = 0xF;
|
||||
@@ -406,17 +410,18 @@ void func_808A1288(DoorShutter* this, PlayState* play) {
|
||||
this->unk_164 = sp38;
|
||||
this->unk_168 = 0.0f;
|
||||
|
||||
Camera_ChangeDoorCam(play->cameraPtrs[CAM_ID_MAIN], &this->actor, player->unk_3BA, this->unk_168, 12, sp34, 10);
|
||||
Camera_ChangeDoorCam(play->cameraPtrs[CAM_ID_MAIN], &this->slidingDoor.dyna.actor, player->doorBgCamIndex,
|
||||
this->unk_168, 12, sp34, 10);
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_808A1340(DoorShutter* this, PlayState* play) {
|
||||
Vec3f sp2C;
|
||||
|
||||
if (this->actor.velocity.y == 0.0f) {
|
||||
if (this->slidingDoor.dyna.actor.velocity.y == 0.0f) {
|
||||
func_808A1288(this, play);
|
||||
if (this->unk_163 != 7) {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EV_SLIDE_DOOR_OPEN);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -424,20 +429,22 @@ s32 func_808A1340(DoorShutter* this, PlayState* play) {
|
||||
s32 pad;
|
||||
|
||||
if (this->unk_163 == 7) {
|
||||
func_800B9010(&this->actor, NA_SE_EV_IKANA_DOOR_OPEN - SFX_FLAG);
|
||||
func_800B9010(&this->slidingDoor.dyna.actor, NA_SE_EV_IKANA_DOOR_OPEN - SFX_FLAG);
|
||||
}
|
||||
|
||||
Lib_Vec3f_TranslateAndRotateY(&this->actor.home.pos, this->actor.shape.rot.y,
|
||||
Lib_Vec3f_TranslateAndRotateY(&this->slidingDoor.dyna.actor.home.pos, this->slidingDoor.dyna.actor.shape.rot.y,
|
||||
(this->unk_163 == 7) ? &D_808A22C4 : &D_808A22D0, &sp2C);
|
||||
Math_StepToF(&this->actor.velocity.y, 5.0f, 0.5f);
|
||||
Math_StepToF(&this->slidingDoor.dyna.actor.velocity.y, 5.0f, 0.5f);
|
||||
|
||||
if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &sp2C, this->actor.velocity.y) == 0.0f) {
|
||||
if (Math_Vec3f_StepToXZ(&this->slidingDoor.dyna.actor.world.pos, &sp2C,
|
||||
this->slidingDoor.dyna.actor.velocity.y) == 0.0f) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
Math_StepToF(&this->actor.velocity.y, 15.0f, 3.0f);
|
||||
Math_StepToF(&this->slidingDoor.dyna.actor.velocity.y, 15.0f, 3.0f);
|
||||
|
||||
if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 200.0f, this->actor.velocity.y)) {
|
||||
if (Math_StepToF(&this->slidingDoor.dyna.actor.world.pos.y, this->slidingDoor.dyna.actor.home.pos.y + 200.0f,
|
||||
this->slidingDoor.dyna.actor.velocity.y)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -449,13 +456,13 @@ s32 func_808A1478(DoorShutter* this, PlayState* play, f32 arg2) {
|
||||
|
||||
if (temp == this->unk_168) {
|
||||
if (arg2 == 1.0f) {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EV_METALDOOR_CLOSE);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_METALDOOR_CLOSE);
|
||||
} else {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EV_METALDOOR_OPEN);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_METALDOOR_OPEN);
|
||||
}
|
||||
|
||||
if ((this->csId != CS_ID_NONE) && (CutsceneManager_GetCurrentCsId() == this->csId)) {
|
||||
func_800B724C(play, &this->actor, PLAYER_CSMODE_1);
|
||||
func_800B724C(play, &this->slidingDoor.dyna.actor, PLAYER_CSMODE_1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,10 +474,10 @@ s32 func_808A1478(DoorShutter* this, PlayState* play, f32 arg2) {
|
||||
|
||||
void func_808A1548(DoorShutter* this, PlayState* play) {
|
||||
if (func_808A1478(this, play, 1.0f)) {
|
||||
if (Flags_GetSwitch(play, DOORSHUTTER_GET_7F(&this->actor))) {
|
||||
this->csId = this->actor.csId;
|
||||
if (Flags_GetSwitch(play, DOORSHUTTER_GET_7F(&this->slidingDoor.dyna.actor))) {
|
||||
this->csId = this->slidingDoor.dyna.actor.csId;
|
||||
if (CutsceneManager_IsNext(this->csId)) {
|
||||
CutsceneManager_StartWithPlayerCs(this->csId, &this->actor);
|
||||
CutsceneManager_StartWithPlayerCs(this->csId, &this->slidingDoor.dyna.actor);
|
||||
DoorShutter_SetupAction(this, func_808A1784);
|
||||
this->unk_167 = -1;
|
||||
} else {
|
||||
@@ -480,15 +487,15 @@ void func_808A1548(DoorShutter* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
player->doorActor = &this->actor;
|
||||
this->actor.textId = 0x1800;
|
||||
player->doorActor = &this->slidingDoor.dyna.actor;
|
||||
this->slidingDoor.dyna.actor.textId = 0x1800;
|
||||
func_80122F28(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_808A1618(DoorShutter* this, PlayState* play) {
|
||||
if ((this->unk_15C == 0) && !Flags_GetSwitch(play, DOORSHUTTER_GET_7F(&this->actor))) {
|
||||
if ((this->slidingDoor.unk_15C == 0) && !Flags_GetSwitch(play, DOORSHUTTER_GET_7F(&this->slidingDoor.dyna.actor))) {
|
||||
DoorShutter_SetupAction(this, func_808A1548);
|
||||
} else {
|
||||
func_808A1090(this, play);
|
||||
@@ -505,14 +512,14 @@ void func_808A1684(DoorShutter* this, PlayState* play) {
|
||||
phi_f0 = 50.0f;
|
||||
}
|
||||
|
||||
if (phi_f0 < this->actor.xzDistToPlayer) {
|
||||
if (phi_f0 < this->slidingDoor.dyna.actor.xzDistToPlayer) {
|
||||
if (this->unk_163 == 7) {
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->slidingDoor.dyna.actor.velocity.y = 0.0f;
|
||||
} else {
|
||||
if (DoorShutter_SetupDoor(this, play)) {
|
||||
this->actor.velocity.y = 30.0f;
|
||||
this->slidingDoor.dyna.actor.velocity.y = 30.0f;
|
||||
}
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
|
||||
}
|
||||
DoorShutter_SetupAction(this, func_808A1B48);
|
||||
}
|
||||
@@ -521,7 +528,7 @@ void func_808A1684(DoorShutter* this, PlayState* play) {
|
||||
|
||||
void func_808A1784(DoorShutter* this, PlayState* play) {
|
||||
if (this->unk_167 != 0) {
|
||||
if (func_800F22C4(this->csId, &this->actor) != 0) {
|
||||
if (func_800F22C4(this->csId, &this->slidingDoor.dyna.actor) != 0) {
|
||||
if (this->unk_167 < 0) {
|
||||
if ((play->state.frames % 2) != 0) {
|
||||
this->unk_167++;
|
||||
@@ -545,16 +552,18 @@ void func_808A1784(DoorShutter* this, PlayState* play) {
|
||||
|
||||
void func_808A1884(DoorShutter* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
s8 room = this->actor.room;
|
||||
s8 room = this->slidingDoor.dyna.actor.room;
|
||||
Vec3f sp44;
|
||||
|
||||
if (this->actor.room >= 0) {
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp44, &player->actor.world.pos);
|
||||
if (this->slidingDoor.dyna.actor.room >= 0) {
|
||||
Actor_OffsetOfPointInActorCoords(&this->slidingDoor.dyna.actor, &sp44, &player->actor.world.pos);
|
||||
|
||||
this->actor.room =
|
||||
play->doorCtx.transitionActorList[DOORSHUTTER_GET_FC00(&this->actor)].sides[(sp44.z < 0.0f) ? 0 : 1].room;
|
||||
this->slidingDoor.dyna.actor.room =
|
||||
play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor)]
|
||||
.sides[(sp44.z < 0.0f) ? 0 : 1]
|
||||
.room;
|
||||
|
||||
if (room != this->actor.room) {
|
||||
if (room != this->slidingDoor.dyna.actor.room) {
|
||||
Room temp = play->roomCtx.curRoom;
|
||||
|
||||
play->roomCtx.curRoom = play->roomCtx.prevRoom;
|
||||
@@ -564,8 +573,8 @@ void func_808A1884(DoorShutter* this, PlayState* play) {
|
||||
func_8012EBF8(play, &play->roomCtx);
|
||||
}
|
||||
|
||||
this->unk_15C = 0;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->slidingDoor.unk_15C = 0;
|
||||
this->slidingDoor.dyna.actor.velocity.y = 0.0f;
|
||||
|
||||
if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & PLAYER_STATE1_800)) {
|
||||
DoorShutter_SetupAction(this, func_808A1C50);
|
||||
@@ -580,20 +589,22 @@ void func_808A1884(DoorShutter* this, PlayState* play) {
|
||||
s32 func_808A1A70(DoorShutter* this) {
|
||||
if (this->unk_163 == 7) {
|
||||
if (this->unk_163 == 7) {
|
||||
func_800B9010(&this->actor, NA_SE_EV_IKANA_DOOR_CLOSE - SFX_FLAG);
|
||||
func_800B9010(&this->slidingDoor.dyna.actor, NA_SE_EV_IKANA_DOOR_CLOSE - SFX_FLAG);
|
||||
}
|
||||
|
||||
Math_StepToF(&this->actor.velocity.y, 5.0f, 0.5f);
|
||||
Math_StepToF(&this->slidingDoor.dyna.actor.velocity.y, 5.0f, 0.5f);
|
||||
|
||||
if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->actor.home.pos, this->actor.velocity.y) == 0.0f) {
|
||||
if (Math_Vec3f_StepToXZ(&this->slidingDoor.dyna.actor.world.pos, &this->slidingDoor.dyna.actor.home.pos,
|
||||
this->slidingDoor.dyna.actor.velocity.y) == 0.0f) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this->actor.velocity.y < 20.0f) {
|
||||
Math_StepToF(&this->actor.velocity.y, 20.0f, 8.0f);
|
||||
if (this->slidingDoor.dyna.actor.velocity.y < 20.0f) {
|
||||
Math_StepToF(&this->slidingDoor.dyna.actor.velocity.y, 20.0f, 8.0f);
|
||||
}
|
||||
|
||||
if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, this->actor.velocity.y)) {
|
||||
if (Math_StepToF(&this->slidingDoor.dyna.actor.world.pos.y, this->slidingDoor.dyna.actor.home.pos.y,
|
||||
this->slidingDoor.dyna.actor.velocity.y)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -604,18 +615,19 @@ void func_808A1B48(DoorShutter* this, PlayState* play) {
|
||||
s16 quakeIndex;
|
||||
|
||||
if (func_808A1A70(this)) {
|
||||
if (this->actor.velocity.y > 20.0f) {
|
||||
this->actor.floorHeight = this->actor.home.pos.y;
|
||||
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 45.0f, 10, 8.0f, 500, 10, 0);
|
||||
if (this->slidingDoor.dyna.actor.velocity.y > 20.0f) {
|
||||
this->slidingDoor.dyna.actor.floorHeight = this->slidingDoor.dyna.actor.home.pos.y;
|
||||
Actor_SpawnFloorDustRing(play, &this->slidingDoor.dyna.actor, &this->slidingDoor.dyna.actor.world.pos,
|
||||
45.0f, 10, 8.0f, 500, 10, 0);
|
||||
}
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EV_BIGWALL_BOUND);
|
||||
Actor_PlaySfx(&this->slidingDoor.dyna.actor, NA_SE_EV_BIGWALL_BOUND);
|
||||
|
||||
quakeIndex = Quake_Request(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3);
|
||||
Quake_SetSpeed(quakeIndex, -32536);
|
||||
Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0);
|
||||
Quake_SetDuration(quakeIndex, 10);
|
||||
|
||||
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||
Rumble_Request(this->slidingDoor.dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||
|
||||
func_808A1884(this, play);
|
||||
}
|
||||
@@ -639,7 +651,9 @@ void DoorShutter_Update(Actor* thisx, PlayState* play) {
|
||||
this->actionFunc(this, play);
|
||||
|
||||
if (this->unk_163 == 7) {
|
||||
this->actor.home.rot.z = Math_Vec3f_DistXZ(&this->actor.home.pos, &this->actor.world.pos) * -100.0f;
|
||||
this->slidingDoor.dyna.actor.home.rot.z =
|
||||
Math_Vec3f_DistXZ(&this->slidingDoor.dyna.actor.home.pos, &this->slidingDoor.dyna.actor.world.pos) *
|
||||
-100.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -652,8 +666,9 @@ s32 func_808A1D68(DoorShutter* this, PlayState* play) {
|
||||
return true;
|
||||
}
|
||||
|
||||
temp_a0 = BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &play->view.eye), this->actor.shape.rot.y);
|
||||
temp_a1 = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y);
|
||||
temp_a0 = BINANG_SUB(Actor_WorldYawTowardPoint(&this->slidingDoor.dyna.actor, &play->view.eye),
|
||||
this->slidingDoor.dyna.actor.shape.rot.y);
|
||||
temp_a1 = BINANG_SUB(this->slidingDoor.dyna.actor.yawTowardsPlayer, this->slidingDoor.dyna.actor.shape.rot.y);
|
||||
|
||||
temp_a0 = ABS_ALT(temp_a0);
|
||||
temp_a1 = ABS_ALT(temp_a1);
|
||||
@@ -678,26 +693,27 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
|
||||
|
||||
if (this->unk_164 == 7) {
|
||||
Matrix_Translate(0.0f, 64.96f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->actor.home.rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->slidingDoor.dyna.actor.home.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, -64.96f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if (sp44->unk_04 != 0) {
|
||||
TransitionActorEntry* transitionEntry =
|
||||
&play->doorCtx.transitionActorList[DOORSHUTTER_GET_FC00(&this->actor)];
|
||||
&play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor)];
|
||||
|
||||
if ((play->roomCtx.prevRoom.num >= 0) ||
|
||||
(transitionEntry->sides[0].room == transitionEntry->sides[1].room)) {
|
||||
s16 yaw = this->actor.shape.rot.y - Math_Vec3f_Yaw(&play->view.eye, &this->actor.world.pos);
|
||||
s16 yaw = this->slidingDoor.dyna.actor.shape.rot.y -
|
||||
Math_Vec3f_Yaw(&play->view.eye, &this->slidingDoor.dyna.actor.world.pos);
|
||||
|
||||
if (ABS_ALT(yaw) < 0x4000) {
|
||||
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
|
||||
}
|
||||
} else if (this->actor.room == transitionEntry->sides[0].room) {
|
||||
} else if (this->slidingDoor.dyna.actor.room == transitionEntry->sides[0].room) {
|
||||
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
|
||||
}
|
||||
} else if (this->doorType == 5) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_808A22DC[this->unk_15E]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_808A22DC[this->slidingDoor.unk_15E]));
|
||||
}
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define Z_DOOR_SHUTTER_H
|
||||
|
||||
#include "global.h"
|
||||
#include "z64door.h"
|
||||
|
||||
struct DoorShutter;
|
||||
|
||||
@@ -10,14 +11,10 @@ typedef void (*DoorShutterActionFunc)(struct DoorShutter*, PlayState*);
|
||||
#define DOORSHUTTER_GET_1F(thisx) ((thisx)->params & 0x1F)
|
||||
#define DOORSHUTTER_GET_7F(thisx) ((thisx)->params & 0x7F)
|
||||
#define DOORSHUTTER_GET_380(thisx) (((thisx)->params >> 7) & 7)
|
||||
#define DOORSHUTTER_GET_FC00(thisx) ((u16)(thisx)->params >> 0xA)
|
||||
|
||||
typedef struct DoorShutter {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x0144 */ UNK_TYPE1 unk144[0x18];
|
||||
/* 0x015C */ s16 unk_15C;
|
||||
/* 0x015E */ s16 unk_15E;
|
||||
/* 0x0160 */ s16 csId;
|
||||
/* 0x000 */ SlidingDoorActor slidingDoor;
|
||||
/* 0x160 */ s16 csId;
|
||||
/* 0x0162 */ u8 doorType;
|
||||
/* 0x0163 */ u8 unk_163;
|
||||
/* 0x0164 */ u8 unk_164;
|
||||
|
||||
@@ -7,7 +7,8 @@ struct DoorSpiral;
|
||||
|
||||
typedef struct DoorSpiral {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0xC];
|
||||
/* 0x144 */ u8 shouldClimb;
|
||||
/* 0x145 */ UNK_TYPE1 unk_145[0xB];
|
||||
} DoorSpiral; // size = 0x150
|
||||
|
||||
#endif // Z_DOOR_SPIRAL_H
|
||||
|
||||
@@ -326,7 +326,7 @@ void func_809199FC(Actor* thisx, PlayState* play2) {
|
||||
distanceTraveled = this->distanceTraveled;
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
|
||||
if (player->unk_B08[0] >= 0.85f) {
|
||||
if (player->unk_B08 >= 0.85f) {
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
|
||||
} else {
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 0);
|
||||
@@ -339,7 +339,7 @@ void func_809199FC(Actor* thisx, PlayState* play2) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (*distanceTraveled * 255.0f));
|
||||
|
||||
aux = 1.0f - SQ(*distanceTraveled);
|
||||
Matrix_Mult(&player->mf_CC4, MTXMODE_NEW);
|
||||
Matrix_Mult(&player->leftHandMf, MTXMODE_NEW);
|
||||
Matrix_Translate(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)),
|
||||
(initialPositions->y * (1.0f - *distanceTraveled)) + 320.0f,
|
||||
(initialPositions->z * (1.0f - *distanceTraveled)) + -20.0f, MTXMODE_APPLY);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* Description: Wave Created by Turtle Awakening
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_eff_kamejima_wave.h"
|
||||
#include "objects/object_kamejima/object_kamejima.h"
|
||||
|
||||
|
||||
@@ -422,8 +422,9 @@ void func_808B0894(EnAm* this, PlayState* play) {
|
||||
this->armosYaw = this->actor.yawTowardsPlayer;
|
||||
func_808B0208(this, play);
|
||||
if (this->explodeTimer == 1) {
|
||||
EnBom* bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 2, 0);
|
||||
EnBom* bomb =
|
||||
(EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, BOMB_EXPLOSIVE_TYPE_BOMB, 0, 2, BOMB_TYPE_BODY);
|
||||
if (bomb != NULL) {
|
||||
bomb->timer = 0;
|
||||
}
|
||||
|
||||
@@ -78,26 +78,26 @@ void EnArrow_Init(Actor* thisx, PlayState* play) {
|
||||
EnArrow* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
if (this->actor.params == -ENARROW_8) {
|
||||
if (this->actor.params == -ARROW_TYPE_DEKU_NUT) {
|
||||
this->unk_263 = 1;
|
||||
this->actor.params = ENARROW_8;
|
||||
this->actor.params = ARROW_TYPE_DEKU_NUT;
|
||||
}
|
||||
|
||||
if (this->actor.params < ENARROW_6) {
|
||||
if (ARROW_IS_ARROW(this->actor.params)) {
|
||||
SkelAnime_Init(play, &this->arrow.skelAnime, &gameplay_keep_Skel_014560, &gameplay_keep_Anim_0128BC,
|
||||
this->arrow.jointTable, this->arrow.jointTable, 5);
|
||||
if (this->actor.params < ENARROW_3) {
|
||||
if (this->actor.params == ENARROW_1) {
|
||||
if (this->actor.params < ARROW_TYPE_FIRE) {
|
||||
if (this->actor.params == ARROW_TYPE_NORMAL_HORSE) {
|
||||
D_8088C234.elemDuration = 4;
|
||||
} else {
|
||||
D_8088C234.elemDuration = 16;
|
||||
}
|
||||
Effect_Add(play, &this->unk_240, EFFECT_BLURE2, 0, 0, &D_8088C234);
|
||||
} else if (this->actor.params == ENARROW_3) {
|
||||
} else if (this->actor.params == ARROW_TYPE_FIRE) {
|
||||
Effect_Add(play, &this->unk_240, EFFECT_BLURE2, 0, 0, &D_8088C258);
|
||||
} else if (this->actor.params == ENARROW_4) {
|
||||
} else if (this->actor.params == ARROW_TYPE_ICE) {
|
||||
Effect_Add(play, &this->unk_240, EFFECT_BLURE2, 0, 0, &D_8088C27C);
|
||||
} else if (this->actor.params == ENARROW_5) {
|
||||
} else if (this->actor.params == ARROW_TYPE_LIGHT) {
|
||||
Effect_Add(play, &this->unk_240, EFFECT_BLURE2, 0, 0, &D_8088C2A0);
|
||||
}
|
||||
}
|
||||
@@ -105,20 +105,20 @@ void EnArrow_Init(Actor* thisx, PlayState* play) {
|
||||
Collider_InitQuad(play, &this->collider);
|
||||
Collider_SetQuad(play, &this->collider, &this->actor, &sQuadInit);
|
||||
|
||||
if (this->actor.params < ENARROW_6) {
|
||||
if (ARROW_IS_ARROW(this->actor.params)) {
|
||||
this->collider.info.toucherFlags &= ~(TOUCH_SFX_WOOD | TOUCH_SFX_HARD);
|
||||
this->collider.info.toucherFlags |= 0;
|
||||
}
|
||||
|
||||
if (this->actor.params < ENARROW_0) {
|
||||
if (this->actor.params < ARROW_TYPE_NORMAL_LIT) {
|
||||
this->collider.base.atFlags = (AT_TYPE_ENEMY | AT_ON);
|
||||
} else {
|
||||
this->collider.info.toucher.dmgFlags = Actor_GetArrowDmgFlags(this->actor.params);
|
||||
if (this->actor.params == ENARROW_8) {
|
||||
if (this->actor.params == ARROW_TYPE_DEKU_NUT) {
|
||||
this->collider.info.toucher.damage = 1;
|
||||
}
|
||||
|
||||
if (this->actor.params == ENARROW_7) {
|
||||
if (this->actor.params == ARROW_TYPE_DEKU_BUBBLE) {
|
||||
Actor_SetScale(&this->actor, 1.0f);
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ void EnArrow_Init(Actor* thisx, PlayState* play) {
|
||||
void EnArrow_Destroy(Actor* thisx, PlayState* play) {
|
||||
EnArrow* this = THIS;
|
||||
|
||||
if (this->actor.params < ENARROW_6) {
|
||||
if (ARROW_IS_ARROW(this->actor.params)) {
|
||||
Effect_Destroy(play, this->unk_240);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ void EnArrow_Destroy(Actor* thisx, PlayState* play) {
|
||||
this->unk_264->flags &= ~ACTOR_FLAG_8000;
|
||||
}
|
||||
|
||||
if ((this->actor.params >= ENARROW_3) && (this->actor.params < ENARROW_6) && (this->actor.child == NULL)) {
|
||||
if (ARROW_IS_MAGICAL(this->actor.params) && (this->actor.child == NULL)) {
|
||||
Magic_Reset(play);
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ void func_8088A594(EnArrow* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (this->actor.parent != NULL) {
|
||||
if (this->actor.params == ENARROW_7) {
|
||||
if (this->actor.params == ARROW_TYPE_DEKU_BUBBLE) {
|
||||
if (Math_SmoothStepToF(&this->bubble.unk_144, 16.0f, 0.07f, 1.8f, 0.0f) > 0.5f) {
|
||||
func_800B9010(&this->actor, NA_SE_PL_DEKUNUTS_BUBLE_BREATH - SFX_FLAG);
|
||||
return;
|
||||
@@ -166,8 +166,8 @@ void func_8088A594(EnArrow* this, PlayState* play) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ((this->actor.params != ENARROW_8) && (player->unk_D57 == 0)) {
|
||||
if (this->actor.params == ENARROW_7) {
|
||||
if ((this->actor.params != ARROW_TYPE_DEKU_NUT) && (player->unk_D57 == 0)) {
|
||||
if (this->actor.params == ARROW_TYPE_DEKU_BUBBLE) {
|
||||
Magic_Reset(play);
|
||||
}
|
||||
Actor_Kill(&this->actor);
|
||||
@@ -175,22 +175,22 @@ void func_8088A594(EnArrow* this, PlayState* play) {
|
||||
}
|
||||
|
||||
switch (this->actor.params) {
|
||||
case ENARROW_6:
|
||||
case ARROW_TYPE_SLINGSHOT:
|
||||
Player_PlaySfx(player, NA_SE_IT_SLING_SHOT);
|
||||
break;
|
||||
|
||||
case ENARROW_0:
|
||||
case ENARROW_1:
|
||||
case ENARROW_2:
|
||||
case ARROW_TYPE_NORMAL_LIT:
|
||||
case ARROW_TYPE_NORMAL_HORSE:
|
||||
case ARROW_TYPE_NORMAL:
|
||||
Player_PlaySfx(player, NA_SE_IT_ARROW_SHOT);
|
||||
break;
|
||||
|
||||
case ENARROW_3:
|
||||
case ENARROW_4:
|
||||
case ENARROW_5:
|
||||
case ARROW_TYPE_FIRE:
|
||||
case ARROW_TYPE_ICE:
|
||||
case ARROW_TYPE_LIGHT:
|
||||
Player_PlaySfx(player, NA_SE_IT_MAGIC_ARROW_SHOT);
|
||||
|
||||
case ENARROW_7:
|
||||
case ARROW_TYPE_DEKU_BUBBLE:
|
||||
Player_PlaySfx(player, NA_SE_PL_DEKUNUTS_FIRE);
|
||||
break;
|
||||
}
|
||||
@@ -198,13 +198,13 @@ void func_8088A594(EnArrow* this, PlayState* play) {
|
||||
this->actionFunc = func_8088ACE0;
|
||||
Math_Vec3f_Copy(&this->unk_228, &this->actor.world.pos);
|
||||
|
||||
if (this->actor.params == ENARROW_7) {
|
||||
if (this->actor.params == ARROW_TYPE_DEKU_BUBBLE) {
|
||||
this->bubble.unk_144 = CLAMP_MIN(this->bubble.unk_144, 3.5f);
|
||||
func_8088A514(this);
|
||||
this->unk_260 = 99;
|
||||
Magic_Reset(play);
|
||||
} else if (this->actor.params >= ENARROW_6) {
|
||||
if ((this->actor.params == ENARROW_8) && (this->actor.world.rot.x < 0)) {
|
||||
} else if (!ARROW_IS_ARROW(this->actor.params)) {
|
||||
if ((this->actor.params == ARROW_TYPE_DEKU_NUT) && (this->actor.world.rot.x < 0)) {
|
||||
Actor_SetScale(&this->actor, 0.009f);
|
||||
this->unk_260 = 40;
|
||||
} else {
|
||||
@@ -295,14 +295,14 @@ void func_8088AA98(EnArrow* this, PlayState* play) {
|
||||
EffectSsGRipple_Spawn(play, &sp44, 100, 500, 4);
|
||||
EffectSsGRipple_Spawn(play, &sp44, 100, 500, 8);
|
||||
|
||||
if ((this->actor.params == ENARROW_4) || (this->actor.params == ENARROW_3)) {
|
||||
if ((this->actor.params == ENARROW_4) && (func_8088B6B0 != this->actionFunc)) {
|
||||
if ((this->actor.params == ARROW_TYPE_ICE) || (this->actor.params == ARROW_TYPE_FIRE)) {
|
||||
if ((this->actor.params == ARROW_TYPE_ICE) && (func_8088B6B0 != this->actionFunc)) {
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_BG_ICEFLOE, sp44.x, sp44.y, sp44.z, 0, 0, 0, 300);
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
this->actor.params = ENARROW_2;
|
||||
this->actor.params = ARROW_TYPE_NORMAL;
|
||||
this->collider.info.toucher.dmgFlags = 0x20;
|
||||
|
||||
if (this->actor.child != NULL) {
|
||||
@@ -329,9 +329,9 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
|
||||
s32 sp50;
|
||||
|
||||
if ((DECR(this->unk_260) == 0) ||
|
||||
((this->actor.params == ENARROW_7) &&
|
||||
((this->actor.params == ARROW_TYPE_DEKU_BUBBLE) &&
|
||||
((this->unk_262 != 0) || (phi_a2 = (this->collider.base.atFlags & AT_HIT) != 0)))) {
|
||||
if (this->actor.params == ENARROW_7) {
|
||||
if (this->actor.params == ARROW_TYPE_DEKU_BUBBLE) {
|
||||
if (phi_a2 && (this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4) &&
|
||||
(this->collider.base.atFlags & AT_BOUNCED)) {
|
||||
if ((this->collider.base.at != NULL) && (this->collider.base.at->id != ACTOR_OBJ_SYOKUDAI)) {
|
||||
@@ -361,18 +361,18 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
sp50 =
|
||||
(this->actor.params != ENARROW_0) && (this->actor.params < ENARROW_8) && (this->collider.base.atFlags & AT_HIT);
|
||||
sp50 = (this->actor.params != ARROW_TYPE_NORMAL_LIT) && (this->actor.params < ARROW_TYPE_DEKU_NUT) &&
|
||||
(this->collider.base.atFlags & AT_HIT);
|
||||
|
||||
if (sp50 || (this->unk_262 != 0)) {
|
||||
if (this->actor.params >= ENARROW_6) {
|
||||
if (!ARROW_IS_ARROW(this->actor.params)) {
|
||||
if (sp50) {
|
||||
this->actor.world.pos.x = (this->actor.world.pos.x + this->actor.prevPos.x) * 0.5f;
|
||||
this->actor.world.pos.y = (this->actor.world.pos.y + this->actor.prevPos.y) * 0.5f;
|
||||
this->actor.world.pos.z = (this->actor.world.pos.z + this->actor.prevPos.z) * 0.5f;
|
||||
}
|
||||
|
||||
if (this->actor.params == ENARROW_8) {
|
||||
if (this->actor.params == ARROW_TYPE_DEKU_NUT) {
|
||||
R_TRANS_FADE_FLASH_ALPHA_STEP = -1;
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_M_FIRE1, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 0, 0, 0, this->actor.speed == 0.0f);
|
||||
@@ -408,12 +408,12 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
|
||||
} else if (this->unk_262 != 0) {
|
||||
this->actionFunc = func_8088B630;
|
||||
Animation_PlayOnce(&this->arrow.skelAnime, &gameplay_keep_Anim_0128BC);
|
||||
if (this->actor.params >= ENARROW_0) {
|
||||
if (this->actor.params >= ARROW_TYPE_NORMAL_LIT) {
|
||||
this->unk_260 = 60;
|
||||
} else {
|
||||
this->unk_260 = 20;
|
||||
}
|
||||
if ((this->actor.params >= ENARROW_3) && (this->actor.params < ENARROW_6)) {
|
||||
if (ARROW_IS_MAGICAL(this->actor.params)) {
|
||||
this->actor.draw = NULL;
|
||||
}
|
||||
Actor_PlaySfx(&this->actor, NA_SE_IT_ARROW_STICK_OBJ);
|
||||
@@ -422,7 +422,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
|
||||
}
|
||||
} else {
|
||||
func_8088AA98(this, play);
|
||||
if (this->actor.params == ENARROW_7) {
|
||||
if (this->actor.params == ARROW_TYPE_DEKU_BUBBLE) {
|
||||
if (this->bubble.unk_149 == 0) {
|
||||
sp78 = sqrtf(SQ(this->actor.speed) + SQ(this->actor.velocity.y));
|
||||
sp74 = Math_SinS(this->actor.world.rot.y) * this->actor.speed;
|
||||
@@ -473,7 +473,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
|
||||
this->actor.wallBgId = spA8;
|
||||
}
|
||||
|
||||
if (this->actor.params < ENARROW_6) {
|
||||
if (ARROW_IS_ARROW(this->actor.params)) {
|
||||
this->actor.shape.rot.x = Math_Atan2S_XY(this->actor.speed, -this->actor.velocity.y);
|
||||
}
|
||||
}
|
||||
@@ -540,21 +540,27 @@ void EnArrow_Update(Actor* thisx, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if ((this->unk_263 != 0) ||
|
||||
((this->actor.params >= ENARROW_0) && ((this->actor.params == ENARROW_7) || (player->unk_D57 != 0))) ||
|
||||
((this->actor.params >= ARROW_TYPE_NORMAL_LIT) &&
|
||||
((this->actor.params == ARROW_TYPE_DEKU_BUBBLE) || (player->unk_D57 != 0))) ||
|
||||
!Player_InBlockingCsMode(play, player)) {
|
||||
this->actionFunc(this, play);
|
||||
}
|
||||
|
||||
if ((this->actor.params >= ENARROW_3) && (this->actor.params < ENARROW_6)) {
|
||||
s16 sp44[] = { ACTOR_ARROW_FIRE, ACTOR_ARROW_ICE, ACTOR_ARROW_LIGHT };
|
||||
if (ARROW_IS_MAGICAL(this->actor.params)) {
|
||||
s16 sp44[] = {
|
||||
ACTOR_ARROW_FIRE, // ARROW_MAGIC_FIRE
|
||||
ACTOR_ARROW_ICE, // ARROW_MAGIC_ICE
|
||||
ACTOR_ARROW_LIGHT, // ARROW_MAGIC_LIGHT
|
||||
};
|
||||
|
||||
if (this->actor.child == NULL) {
|
||||
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, sp44[this->actor.params - ENARROW_3],
|
||||
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, sp44[ARROW_GET_MAGIC_FROM_TYPE(this->actor.params)],
|
||||
this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
|
||||
}
|
||||
} else if (this->actor.params == ENARROW_0) {
|
||||
} else if (this->actor.params == ARROW_TYPE_NORMAL_LIT) {
|
||||
func_800B0EB0(play, &this->unk_234, &D_8088C2CC, &D_8088C2D8, &D_8088C2E4, &D_8088C2E8, 100, 0, 8);
|
||||
}
|
||||
|
||||
Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.prevPos);
|
||||
}
|
||||
|
||||
@@ -579,8 +585,8 @@ void func_8088B88C(PlayState* play, EnArrow* this, EnArrowUnkStruct* arg2) {
|
||||
}
|
||||
Matrix_MultVec3f(&sp4C[0], &sp40);
|
||||
Matrix_MultVec3f(&sp4C[1], &sp34);
|
||||
if (this->actor.params < ENARROW_8) {
|
||||
sp30 = this->actor.params < ENARROW_6;
|
||||
if (this->actor.params < ARROW_TYPE_DEKU_NUT) {
|
||||
sp30 = ARROW_IS_ARROW(this->actor.params);
|
||||
if (this->unk_264 == NULL) {
|
||||
sp30 &= func_80126440(play, &this->collider, &this->unk_244, &sp40, &sp34);
|
||||
} else if (sp30 && (sp40.x == this->unk_244.tip.x) && (sp40.y == this->unk_244.tip.y) &&
|
||||
@@ -635,11 +641,11 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) {
|
||||
EnArrow* this = THIS;
|
||||
s32 phi_v0;
|
||||
|
||||
if (this->actor.params < ENARROW_6) {
|
||||
if (ARROW_IS_ARROW(this->actor.params)) {
|
||||
func_8012C28C(play->state.gfxCtx);
|
||||
SkelAnime_DrawLod(play, this->arrow.skelAnime.skeleton, this->arrow.skelAnime.jointTable, NULL, NULL,
|
||||
&this->actor, this->actor.projectedPos.z < 160.0f ? 0 : 1);
|
||||
} else if (this->actor.params == ENARROW_7) {
|
||||
} else if (this->actor.params == ARROW_TYPE_DEKU_BUBBLE) {
|
||||
s32 spA4 = 255 - (s32)(this->bubble.unk_144 * 4.0f);
|
||||
f32 spA0 = (this->actor.speed * 0.1f) + 1.0f;
|
||||
f32 sp9C = (1.0f / spA0);
|
||||
@@ -697,7 +703,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) {
|
||||
|
||||
gSPClearGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING);
|
||||
|
||||
if (this->actor.params == ENARROW_6) {
|
||||
if (this->actor.params == ARROW_TYPE_SLINGSHOT) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 255, sp63);
|
||||
sp5C = 50.0f;
|
||||
@@ -737,5 +743,6 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) {
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
func_8088B88C(play, this, &D_8088C2EC[0]);
|
||||
}
|
||||
|
||||
@@ -7,17 +7,30 @@ struct EnArrow;
|
||||
|
||||
typedef void (*EnArrowActionFunc)(struct EnArrow*, PlayState*);
|
||||
|
||||
enum {
|
||||
/* 0 */ ENARROW_0, // Lit arrow
|
||||
/* 1 */ ENARROW_1, // Horse arrow
|
||||
/* 2 */ ENARROW_2, // Normal arrow
|
||||
/* 3 */ ENARROW_3, // Fire arrow
|
||||
/* 4 */ ENARROW_4, // Ice arrow
|
||||
/* 5 */ ENARROW_5, // Light arrow
|
||||
/* 6 */ ENARROW_6, // ?
|
||||
/* 7 */ ENARROW_7, // Deku bubble
|
||||
/* 8 */ ENARROW_8, // Deku Nut
|
||||
};
|
||||
typedef enum ArrowType {
|
||||
/* 0 */ ARROW_TYPE_NORMAL_LIT, // Normal arrow lit on fire
|
||||
/* 1 */ ARROW_TYPE_NORMAL_HORSE, // Normal arrow shot while riding a horse
|
||||
/* 2 */ ARROW_TYPE_NORMAL,
|
||||
/* 3 */ ARROW_TYPE_FIRE,
|
||||
/* 4 */ ARROW_TYPE_ICE,
|
||||
/* 5 */ ARROW_TYPE_LIGHT,
|
||||
/* 6 */ ARROW_TYPE_SLINGSHOT,
|
||||
/* 7 */ ARROW_TYPE_DEKU_BUBBLE,
|
||||
/* 8 */ ARROW_TYPE_DEKU_NUT
|
||||
} ArrowType;
|
||||
|
||||
#define ARROW_IS_MAGICAL(arrowType) (((arrowType) >= ARROW_TYPE_FIRE) && ((arrowType) <= ARROW_TYPE_LIGHT))
|
||||
#define ARROW_GET_MAGIC_FROM_TYPE(arrowType) (s32)((arrowType) - ARROW_TYPE_FIRE)
|
||||
#define ARROW_IS_ARROW(arrowType) ((arrowType) < ARROW_TYPE_SLINGSHOT)
|
||||
|
||||
typedef enum ArrowMagic {
|
||||
/* -1 */ ARROW_MAGIC_INVALID = -1,
|
||||
/* 0 */ ARROW_MAGIC_FIRE = ARROW_GET_MAGIC_FROM_TYPE(ARROW_TYPE_FIRE),
|
||||
/* 1 */ ARROW_MAGIC_ICE = ARROW_GET_MAGIC_FROM_TYPE(ARROW_TYPE_ICE),
|
||||
/* 2 */ ARROW_MAGIC_LIGHT = ARROW_GET_MAGIC_FROM_TYPE(ARROW_TYPE_LIGHT),
|
||||
/* 3 */ ARROW_MAGIC_DEKU_BUBBLE // Only used in Player. Does not map to ARROW_TYPE_SLINGSHOT
|
||||
} ArrowMagic;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
|
||||
@@ -348,7 +348,7 @@ void EnBom_Explode(EnBom* this, PlayState* play) {
|
||||
|
||||
this->collider2.elements->dim.worldSphere.radius = D_80872E8C[this->isPowderKeg];
|
||||
if (this->timer == 7) {
|
||||
this->collider2.base.atFlags &= ~OC1_TYPE_1;
|
||||
this->collider2.base.atFlags &= ~AT_TYPE_ENEMY;
|
||||
}
|
||||
|
||||
if (this->actor.params == BOMB_TYPE_EXPLOSION) {
|
||||
|
||||
@@ -11,11 +11,17 @@ typedef void (*EnBomActionFunc)(struct EnBom*, PlayState*);
|
||||
#define ENBOM_GETZ_80(thisx) ((thisx)->shape.rot.z & 0x80)
|
||||
#define ENBOM_GETZ_FF00(thisx) (((thisx)->shape.rot.z & 0xFF00) >> 8)
|
||||
|
||||
typedef enum {
|
||||
typedef enum BombType {
|
||||
/* 0 */ BOMB_TYPE_BODY,
|
||||
/* 1 */ BOMB_TYPE_EXPLOSION,
|
||||
} BombType;
|
||||
|
||||
// Passed via x rotation
|
||||
typedef enum EnBomExplosiveType {
|
||||
/* 0 */ BOMB_EXPLOSIVE_TYPE_BOMB,
|
||||
/* 1 */ BOMB_EXPLOSIVE_TYPE_POWDER_KEG,
|
||||
} EnBomExplosiveType;
|
||||
|
||||
typedef struct EnBom {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ ColliderCylinder collider1;
|
||||
|
||||
@@ -326,7 +326,7 @@ void EnBomChu_Explode(EnBomChu* this, PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 0, 0, 0, 0);
|
||||
this->actor.world.pos.z, BOMB_EXPLOSIVE_TYPE_BOMB, 0, 0, BOMB_TYPE_BODY);
|
||||
|
||||
this->shouldTimerCountDown = true;
|
||||
this->isMoving = false;
|
||||
|
||||
@@ -164,7 +164,7 @@ void EnBoom_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_808A2918(EnBoom* this, PlayState* play) {
|
||||
Actor* sp7C;
|
||||
Actor* targetActor;
|
||||
Player* player = GET_PLAYER(play);
|
||||
s32 sp74;
|
||||
s16 sp72;
|
||||
@@ -175,25 +175,26 @@ void func_808A2918(EnBoom* this, PlayState* play) {
|
||||
f32 sp64;
|
||||
f32 distXYZ;
|
||||
|
||||
sp7C = this->player;
|
||||
targetActor = this->moveTo;
|
||||
|
||||
if (sp7C != NULL) {
|
||||
sp72 = Actor_WorldYawTowardPoint(&this->actor, &sp7C->focus.pos);
|
||||
if (targetActor != NULL) {
|
||||
sp72 = Actor_WorldYawTowardPoint(&this->actor, &targetActor->focus.pos);
|
||||
sp70 = this->actor.world.rot.y - sp72;
|
||||
sp6E = Actor_WorldPitchTowardPoint(&this->actor, &sp7C->focus.pos);
|
||||
sp6E = Actor_WorldPitchTowardPoint(&this->actor, &targetActor->focus.pos);
|
||||
sp6C = this->actor.world.rot.x - sp6E;
|
||||
|
||||
sp64 = (200.0f - Math_Vec3f_DistXYZ(&this->actor.world.pos, &sp7C->focus.pos)) * 0.005f;
|
||||
sp64 = (200.0f - Math_Vec3f_DistXYZ(&this->actor.world.pos, &targetActor->focus.pos)) * 0.005f;
|
||||
if (sp64 < 0.12f) {
|
||||
sp64 = 0.12f;
|
||||
}
|
||||
|
||||
if ((&player->actor != sp7C) && ((sp7C->update == NULL) || ((this->unk_1CF < 0) && (ABS_ALT(sp70) > 0x4000)))) {
|
||||
this->player = NULL;
|
||||
if ((&player->actor != targetActor) &&
|
||||
((targetActor->update == NULL) || ((this->unk_1CF < 0) && (ABS_ALT(sp70) > 0x4000)))) {
|
||||
this->moveTo = NULL;
|
||||
} else {
|
||||
if (this->unk_1CE != 0) {
|
||||
this->unk_1CE--;
|
||||
this->actor.world.rot.y += (this->actor.params == 0) ? 0x190 : -0x190;
|
||||
this->actor.world.rot.y += (this->actor.params == ZORA_BOOMERANG_LEFT) ? 0x190 : -0x190;
|
||||
} else {
|
||||
if (this->unk_1CF > 0) {
|
||||
this->unk_1CF--;
|
||||
@@ -242,7 +243,7 @@ void func_808A2918(EnBoom* this, PlayState* play) {
|
||||
if (sp74 != 0) {
|
||||
this->actor.world.rot.x = -this->actor.world.rot.x;
|
||||
this->actor.world.rot.y += 0x8000;
|
||||
this->player = &player->actor;
|
||||
this->moveTo = &player->actor;
|
||||
this->unk_1CC = 0;
|
||||
}
|
||||
}
|
||||
@@ -250,34 +251,34 @@ void func_808A2918(EnBoom* this, PlayState* play) {
|
||||
if (this->unk_1CC <= 16) {
|
||||
distXYZ = Math_Vec3f_DistXYZ(&this->actor.world.pos, &player->actor.focus.pos);
|
||||
|
||||
if (&player->actor != this->player) {
|
||||
if (this->player == 0) {
|
||||
if (&player->actor != this->moveTo) {
|
||||
if (this->moveTo == 0) {
|
||||
this->unk_1CE = 8;
|
||||
}
|
||||
this->player = &player->actor;
|
||||
this->moveTo = &player->actor;
|
||||
}
|
||||
|
||||
if (distXYZ < 40.0f) {
|
||||
sp7C = this->unk_1C8;
|
||||
if (sp7C != NULL) {
|
||||
Math_Vec3f_Copy(&sp7C->world.pos, &player->actor.world.pos);
|
||||
if (sp7C->id == ACTOR_EN_ITEM00) {
|
||||
sp7C->gravity = -0.9f;
|
||||
sp7C->bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH);
|
||||
targetActor = this->unk_1C8;
|
||||
if (targetActor != NULL) {
|
||||
Math_Vec3f_Copy(&targetActor->world.pos, &player->actor.world.pos);
|
||||
if (targetActor->id == ACTOR_EN_ITEM00) {
|
||||
targetActor->gravity = -0.9f;
|
||||
targetActor->bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH);
|
||||
} else {
|
||||
sp7C->flags &= ~ACTOR_FLAG_2000;
|
||||
targetActor->flags &= ~ACTOR_FLAG_2000;
|
||||
}
|
||||
}
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
sp7C = this->unk_1C8;
|
||||
if (sp7C != NULL) {
|
||||
if (sp7C->update == NULL) {
|
||||
targetActor = this->unk_1C8;
|
||||
if (targetActor != NULL) {
|
||||
if (targetActor->update == NULL) {
|
||||
this->unk_1C8 = NULL;
|
||||
} else {
|
||||
Math_Vec3f_Copy(&sp7C->world.pos, &this->actor.world.pos);
|
||||
Math_Vec3f_Copy(&targetActor->world.pos, &this->actor.world.pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -298,7 +299,7 @@ void EnBoom_Update(Actor* thisx, PlayState* play) {
|
||||
Actor_SetFocus(&this->actor, 0.0f);
|
||||
}
|
||||
|
||||
if (this->actor.params != 0) {
|
||||
if (this->actor.params != ZORA_BOOMERANG_LEFT) {
|
||||
this->unk_1CD--;
|
||||
} else {
|
||||
this->unk_1CD++;
|
||||
@@ -326,7 +327,7 @@ void EnBoom_Draw(Actor* thisx, PlayState* play) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
Matrix_RotateYS(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS((this->actor.params != 0) ? 0x1F40 : -0x1F40, MTXMODE_APPLY);
|
||||
Matrix_RotateZS((this->actor.params != ZORA_BOOMERANG_LEFT) ? 0x1F40 : -0x1F40, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->actor.world.rot.x, MTXMODE_APPLY);
|
||||
Matrix_MultVec3f(&sp58->unk_04, &sp4C);
|
||||
Matrix_MultVec3f(&sp58->unk_10, &sp40);
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ ZORA_BOOMERANG_LEFT,
|
||||
/* 1 */ ZORA_BOOMERANG_RIGHT
|
||||
} EnBoomType;
|
||||
|
||||
struct EnBoom;
|
||||
|
||||
typedef void (*EnBoomActionFunc)(struct EnBoom*, PlayState*);
|
||||
@@ -10,7 +15,7 @@ typedef void (*EnBoomActionFunc)(struct EnBoom*, PlayState*);
|
||||
typedef struct EnBoom {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ ColliderQuad collider;
|
||||
/* 0x1C4 */ Actor* player;
|
||||
/* 0x1C4 */ Actor* moveTo;
|
||||
/* 0x1C8 */ Actor* unk_1C8;
|
||||
/* 0x1CC */ u8 unk_1CC;
|
||||
/* 0x1CD */ u8 unk_1CD;
|
||||
|
||||
@@ -416,7 +416,7 @@ void EnButte_Update(Actor* thisx, PlayState* play) {
|
||||
this->unk_258 += 0x600;
|
||||
|
||||
if (ENBUTTE_GET_1(&this->actor) == ENBUTTE_1) {
|
||||
if (GET_PLAYER(play)->meleeWeaponState == 0) {
|
||||
if (GET_PLAYER(play)->meleeWeaponState == PLAYER_MELEE_WEAPON_STATE_0) {
|
||||
if (this->unk_252 > 0) {
|
||||
this->unk_252--;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,8 @@ void func_80AFE25C(EnColMan* this, PlayState* play) {
|
||||
CLEAR_TAG_SMALL_EXPLOSION);
|
||||
} else {
|
||||
EnBom* bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
|
||||
this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
BOMB_EXPLOSIVE_TYPE_BOMB, 0, 0, BOMB_TYPE_BODY);
|
||||
|
||||
if (bomb != NULL) {
|
||||
bomb->timer = 0;
|
||||
|
||||
@@ -438,8 +438,9 @@ s32 func_8089AE00(EnDinofos* this, PlayState* play) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((this->actor.xzDistToPlayer < 100.0f) && (player->meleeWeaponState != 0) && this->actor.isTargeted &&
|
||||
(Rand_ZeroOne() < 0.5f) && func_8089A968(this) && Player_IsFacingActor(&this->actor, 0x2000, play)) {
|
||||
if ((this->actor.xzDistToPlayer < 100.0f) && (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
|
||||
this->actor.isTargeted && (Rand_ZeroOne() < 0.5f) && func_8089A968(this) &&
|
||||
Player_IsFacingActor(&this->actor, 0x2000, play)) {
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
func_8089C024(this, 2);
|
||||
} else {
|
||||
|
||||
@@ -914,7 +914,8 @@ void func_808787B0(EnDodongo* this, PlayState* play) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
if (this->timer == 0) {
|
||||
EnBom* bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
|
||||
this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
BOMB_EXPLOSIVE_TYPE_BOMB, 0, 0, BOMB_TYPE_BODY);
|
||||
if (bomb != NULL) {
|
||||
bomb->timer = 0;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "objects/object_wdor03/object_wdor03.h"
|
||||
#include "objects/object_wdor04/object_wdor04.h"
|
||||
#include "objects/object_wdor05/object_wdor05.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
#include "objects/object_numa_obj/object_numa_obj.h"
|
||||
#include "objects/object_kaizoku_obj/object_kaizoku_obj.h"
|
||||
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
|
||||
@@ -387,21 +386,22 @@ static Gfx* D_808679A4[14][2] = {
|
||||
void EnDoor_Init(Actor* thisx, PlayState* play2) {
|
||||
PlayState* play = play2;
|
||||
s32 objectBankIndex;
|
||||
EnDoorInfo* objectInfo = sObjInfo;
|
||||
EnDoorInfo* objectInfo = &sObjInfo[0];
|
||||
EnDoor* this = THIS;
|
||||
s32 i;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
Actor_ProcessInitChain(&this->knobDoor.dyna.actor, sInitChain);
|
||||
|
||||
this->unk_1A4 = ENDOOR_GET_PARAMS_7(thisx);
|
||||
this->doorType = ENDOOR_GET_TYPE(thisx);
|
||||
|
||||
this->switchFlag = ENDOOR_GET_PARAMS_7F(thisx);
|
||||
if ((this->unk_1A4 == 7) && (this->switchFlag == 0)) {
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &gDoorCol);
|
||||
if ((this->doorType == ENDOOR_TYPE_7) && (this->switchFlag == 0)) {
|
||||
DynaPolyActor_Init(&this->knobDoor.dyna, 0);
|
||||
DynaPolyActor_LoadMesh(play, &this->knobDoor.dyna, &gDoorCol);
|
||||
}
|
||||
SkelAnime_Init(play, &this->skelAnime, &gDoorSkel, &gameplay_keep_Anim_020658, this->limbTable, this->limbTable, 5);
|
||||
if (this->unk_1A4 == 5) {
|
||||
SkelAnime_Init(play, &this->knobDoor.skelAnime, &gDoorSkel, &gameplay_keep_Anim_020658, this->limbTable,
|
||||
this->limbTable, DOOR_LIMB_MAX);
|
||||
if (this->doorType == ENDOOR_TYPE_5) {
|
||||
objectInfo = &sObjInfo[17 + this->switchFlag];
|
||||
} else {
|
||||
for (i = 0; i < ARRAY_COUNT(sObjInfo) - 34; i++, objectInfo++) {
|
||||
@@ -414,52 +414,53 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) {
|
||||
}
|
||||
}
|
||||
|
||||
this->dlIndex = objectInfo->dListIndex;
|
||||
this->knobDoor.dlIndex = objectInfo->dListIndex;
|
||||
objectBankIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId);
|
||||
if (objectBankIndex < 0) {
|
||||
objectInfo = &sObjInfo[15];
|
||||
objectBankIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId);
|
||||
if (objectBankIndex != 0) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
Actor_Kill(&this->knobDoor.dyna.actor);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this->requiredObjBankIndex = objectBankIndex;
|
||||
this->dlIndex = objectInfo->dListIndex; // Set twice?
|
||||
if (this->dyna.actor.objBankIndex == this->requiredObjBankIndex) {
|
||||
this->knobDoor.requiredObjBankIndex = objectBankIndex;
|
||||
this->knobDoor.dlIndex = objectInfo->dListIndex; // Set twice?
|
||||
if (this->knobDoor.dyna.actor.objBankIndex == this->knobDoor.requiredObjBankIndex) {
|
||||
func_80866A5C(this, play);
|
||||
} else {
|
||||
this->actionFunc = func_80866A5C;
|
||||
}
|
||||
Actor_SetFocus(&this->dyna.actor, 35.0f);
|
||||
Actor_SetFocus(&this->knobDoor.dyna.actor, 35.0f);
|
||||
}
|
||||
|
||||
void EnDoor_Destroy(Actor* thisx, PlayState* play) {
|
||||
EnDoor* this = (EnDoor*)thisx;
|
||||
|
||||
if (this->unk_1A4 != 7) {
|
||||
TransitionActorEntry* transitionEntry = &play->doorCtx.transitionActorList[(u16)this->dyna.actor.params >> 0xA];
|
||||
if (this->doorType != ENDOOR_TYPE_7) {
|
||||
TransitionActorEntry* transitionEntry =
|
||||
&play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&this->knobDoor.dyna.actor)];
|
||||
if (transitionEntry->id < 0) {
|
||||
transitionEntry->id = -transitionEntry->id;
|
||||
}
|
||||
} else if (this->switchFlag == 0) {
|
||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->knobDoor.dyna.bgId);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80866A5C(EnDoor* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex)) {
|
||||
this->dyna.actor.objBankIndex = this->requiredObjBankIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->knobDoor.requiredObjBankIndex)) {
|
||||
this->knobDoor.dyna.actor.objBankIndex = this->knobDoor.requiredObjBankIndex;
|
||||
this->actionFunc = func_80866B20;
|
||||
this->dyna.actor.world.rot.y = 0;
|
||||
if (this->unk_1A4 == 1) {
|
||||
this->knobDoor.dyna.actor.world.rot.y = 0;
|
||||
if (this->doorType == ENDOOR_TYPE_1) {
|
||||
if (!Flags_GetSwitch(play, this->switchFlag)) {
|
||||
this->unk_1A6 = 10;
|
||||
}
|
||||
} else if ((this->unk_1A4 == 4) &&
|
||||
(Actor_WorldDistXZToActor(&this->dyna.actor, &GET_PLAYER(play)->actor) > 120.0f)) {
|
||||
} else if ((this->doorType == ENDOOR_TYPE_4) &&
|
||||
(Actor_WorldDistXZToActor(&this->knobDoor.dyna.actor, &GET_PLAYER(play)->actor) > 120.0f)) {
|
||||
this->actionFunc = func_8086704C;
|
||||
this->dyna.actor.world.rot.y = -0x1800;
|
||||
this->knobDoor.dyna.actor.world.rot.y = -0x1800;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -468,28 +469,29 @@ void func_80866B20(EnDoor* this, PlayState* play) {
|
||||
static s32 D_80867BC0;
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (Actor_ProcessTalkRequest(&this->dyna.actor, &play->state) && (this->dyna.actor.textId == 0x1821)) {
|
||||
if (Actor_ProcessTalkRequest(&this->knobDoor.dyna.actor, &play->state) &&
|
||||
(this->knobDoor.dyna.actor.textId == 0x1821)) {
|
||||
D_80867BC0 = true;
|
||||
}
|
||||
if (this->unk_1A1 != 0) {
|
||||
if (this->knobDoor.playOpenAnim) {
|
||||
this->actionFunc = func_80867144;
|
||||
Animation_PlayOnceSetSpeed(&this->skelAnime, sAnimations[this->animIndex],
|
||||
Animation_PlayOnceSetSpeed(&this->knobDoor.skelAnime, sAnimations[this->knobDoor.animIndex],
|
||||
(player->stateFlags1 & PLAYER_STATE1_8000000) ? 0.75f : 1.5f);
|
||||
if (this->unk_1A6 != 0) {
|
||||
gSaveContext.save.saveInfo.inventory.dungeonKeys[gSaveContext.mapIndex]--;
|
||||
Flags_SetSwitch(play, this->switchFlag);
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
|
||||
Actor_PlaySfx(&this->knobDoor.dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
|
||||
}
|
||||
} else if (this->unk_1A7 != 0) {
|
||||
this->actionFunc = func_80866F94;
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DOOR_OPEN);
|
||||
Actor_PlaySfx(&this->knobDoor.dyna.actor, NA_SE_EV_DOOR_OPEN);
|
||||
} else if (!Player_InCsMode(play)) {
|
||||
Vec3f playerPosRelToDoor;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &playerPosRelToDoor, &player->actor.world.pos);
|
||||
Actor_OffsetOfPointInActorCoords(&this->knobDoor.dyna.actor, &playerPosRelToDoor, &player->actor.world.pos);
|
||||
if (D_80867BC0 || ((fabsf(playerPosRelToDoor.y) < 20.0f) && (fabsf(playerPosRelToDoor.x) < 20.0f) &&
|
||||
(fabsf(playerPosRelToDoor.z) < 50.0f))) {
|
||||
s16 yawDiff = player->actor.shape.rot.y - this->dyna.actor.shape.rot.y;
|
||||
s16 yawDiff = player->actor.shape.rot.y - this->knobDoor.dyna.actor.shape.rot.y;
|
||||
|
||||
if (playerPosRelToDoor.z > 0.0f) {
|
||||
yawDiff = (0x8000 - yawDiff);
|
||||
@@ -497,51 +499,52 @@ void func_80866B20(EnDoor* this, PlayState* play) {
|
||||
if (ABS_ALT(yawDiff) < 0x3000) {
|
||||
player->doorType = PLAYER_DOORTYPE_HANDLE;
|
||||
player->doorDirection = playerPosRelToDoor.z >= 0.0f ? 1.0f : -1.0f;
|
||||
player->doorActor = &this->dyna.actor;
|
||||
player->doorActor = &this->knobDoor.dyna.actor;
|
||||
if (this->unk_1A6 != 0) {
|
||||
if (gSaveContext.save.saveInfo.inventory.dungeonKeys[((void)0, gSaveContext.mapIndex)] <= 0) {
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
this->dyna.actor.textId = 0x1802;
|
||||
this->knobDoor.dyna.actor.textId = 0x1802;
|
||||
} else {
|
||||
player->doorTimer = 10;
|
||||
}
|
||||
} else if (this->unk_1A4 == 4) {
|
||||
} else if (this->doorType == ENDOOR_TYPE_4) {
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
this->dyna.actor.textId = 0x1800;
|
||||
} else if ((this->unk_1A4 == 0) || (this->unk_1A4 == 2) || (this->unk_1A4 == 3)) {
|
||||
this->knobDoor.dyna.actor.textId = 0x1800;
|
||||
} else if ((this->doorType == ENDOOR_TYPE_0) || (this->doorType == ENDOOR_TYPE_2) ||
|
||||
(this->doorType == ENDOOR_TYPE_3)) {
|
||||
s32 halfDaysDayBit = (play->actorCtx.halfDaysBit & HALFDAYBIT_DAWNS) >> 1;
|
||||
s32 halfDaysNightBit = play->actorCtx.halfDaysBit & HALFDAYBIT_NIGHTS;
|
||||
s16 temp_a2 = D_801AED48[this->switchFlag & 7];
|
||||
s32 textIdOffset = (this->switchFlag >> 3) & 0xF;
|
||||
|
||||
if (((this->unk_1A4 == 0) && !((halfDaysDayBit | halfDaysNightBit) & temp_a2)) ||
|
||||
((this->unk_1A4 == 2) && !(halfDaysNightBit & temp_a2)) ||
|
||||
((this->unk_1A4 == 3) && !(halfDaysDayBit & temp_a2))) {
|
||||
if (((this->doorType == ENDOOR_TYPE_0) && !((halfDaysDayBit | halfDaysNightBit) & temp_a2)) ||
|
||||
((this->doorType == ENDOOR_TYPE_2) && !(halfDaysNightBit & temp_a2)) ||
|
||||
((this->doorType == ENDOOR_TYPE_3) && !(halfDaysDayBit & temp_a2))) {
|
||||
s16 baseTextId = 0x182D;
|
||||
|
||||
if (this->unk_1A4 == 3) {
|
||||
if (this->doorType == ENDOOR_TYPE_3) {
|
||||
baseTextId = 0x180D;
|
||||
} else if (this->unk_1A4 == 2) {
|
||||
} else if (this->doorType == ENDOOR_TYPE_2) {
|
||||
baseTextId = 0x181D;
|
||||
}
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
this->dyna.actor.textId = baseTextId + textIdOffset;
|
||||
this->knobDoor.dyna.actor.textId = baseTextId + textIdOffset;
|
||||
}
|
||||
} else if ((this->unk_1A4 == 5) && (playerPosRelToDoor.z > 0.0f)) {
|
||||
} else if ((this->doorType == ENDOOR_TYPE_5) && (playerPosRelToDoor.z > 0.0f)) {
|
||||
ScheduleOutput scheduleOutput;
|
||||
|
||||
if (Schedule_RunScript(play, D_8086778C[this->switchFlag], &scheduleOutput)) {
|
||||
this->dyna.actor.textId = scheduleOutput.result + 0x1800;
|
||||
this->knobDoor.dyna.actor.textId = scheduleOutput.result + 0x1800;
|
||||
|
||||
player->doorType = ((this->dyna.actor.textId == 0x1821) && D_80867BC0)
|
||||
player->doorType = ((this->knobDoor.dyna.actor.textId == 0x1821) && D_80867BC0)
|
||||
? PLAYER_DOORTYPE_PROXIMITY
|
||||
: PLAYER_DOORTYPE_TALKING;
|
||||
}
|
||||
}
|
||||
func_80122F28(player);
|
||||
}
|
||||
} else if ((this->unk_1A4 == 4) && (this->dyna.actor.xzDistToPlayer > 240.0f)) {
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DOOR_OPEN);
|
||||
} else if ((this->doorType == ENDOOR_TYPE_4) && (this->knobDoor.dyna.actor.xzDistToPlayer > 240.0f)) {
|
||||
Actor_PlaySfx(&this->knobDoor.dyna.actor, NA_SE_EV_DOOR_OPEN);
|
||||
this->actionFunc = func_80867080;
|
||||
}
|
||||
}
|
||||
@@ -556,34 +559,34 @@ void func_80866F94(EnDoor* this, PlayState* play) {
|
||||
} else {
|
||||
direction = -1;
|
||||
}
|
||||
if (Math_ScaledStepToS(&this->dyna.actor.world.rot.y, direction * 0x3E80, 0x7D0)) {
|
||||
if (Math_ScaledStepToS(&this->knobDoor.dyna.actor.world.rot.y, direction * 0x3E80, 0x7D0)) {
|
||||
Math_StepToC(&this->unk_1A7, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0, 0x7D0)) {
|
||||
if (Math_ScaledStepToS(&this->knobDoor.dyna.actor.world.rot.y, 0, 0x7D0)) {
|
||||
this->actionFunc = func_80866B20;
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_AUTO_DOOR_CLOSE);
|
||||
Actor_PlaySfx(&this->knobDoor.dyna.actor, NA_SE_EV_AUTO_DOOR_CLOSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8086704C(EnDoor* this, PlayState* play) {
|
||||
if (this->dyna.actor.xzDistToPlayer < 120.0f) {
|
||||
if (this->knobDoor.dyna.actor.xzDistToPlayer < 120.0f) {
|
||||
this->actionFunc = func_808670F0;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80867080(EnDoor* this, PlayState* play) {
|
||||
if (this->dyna.actor.xzDistToPlayer < 120.0f) {
|
||||
if (this->knobDoor.dyna.actor.xzDistToPlayer < 120.0f) {
|
||||
this->actionFunc = func_808670F0;
|
||||
} else if (Math_ScaledStepToS(&this->dyna.actor.world.rot.y, -0x1800, 0x100)) {
|
||||
} else if (Math_ScaledStepToS(&this->knobDoor.dyna.actor.world.rot.y, -0x1800, 0x100)) {
|
||||
this->actionFunc = func_8086704C;
|
||||
}
|
||||
}
|
||||
|
||||
void func_808670F0(EnDoor* this, PlayState* play) {
|
||||
if (Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0, 0x700)) {
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DOOR_CLOSE);
|
||||
if (Math_ScaledStepToS(&this->knobDoor.dyna.actor.world.rot.y, 0, 0x700)) {
|
||||
Actor_PlaySfx(&this->knobDoor.dyna.actor, NA_SE_EV_DOOR_CLOSE);
|
||||
this->actionFunc = func_80866B20;
|
||||
}
|
||||
}
|
||||
@@ -593,19 +596,19 @@ void func_80867144(EnDoor* this, PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
if (DECR(this->unk_1A6) == 0) {
|
||||
if (SkelAnime_Update(&this->skelAnime) != 0) {
|
||||
if (SkelAnime_Update(&this->knobDoor.skelAnime)) {
|
||||
this->actionFunc = func_80866B20;
|
||||
this->unk_1A1 = 0;
|
||||
} else if (Animation_OnFrame(&this->skelAnime, sAnimOpenFrames[this->animIndex])) {
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_OC_DOOR_OPEN);
|
||||
if (this->skelAnime.playSpeed < 1.5f) {
|
||||
this->knobDoor.playOpenAnim = false;
|
||||
} else if (Animation_OnFrame(&this->knobDoor.skelAnime, sAnimOpenFrames[this->knobDoor.animIndex])) {
|
||||
Actor_PlaySfx(&this->knobDoor.dyna.actor, NA_SE_OC_DOOR_OPEN);
|
||||
if (this->knobDoor.skelAnime.playSpeed < 1.5f) {
|
||||
numEffects = (s32)(Rand_ZeroOne() * 30.0f) + 50;
|
||||
for (i = 0; i < numEffects; i++) {
|
||||
EffectSsBubble_Spawn(play, &this->dyna.actor.world.pos, 60.0, 100.0f, 50.0f, 0.15f);
|
||||
EffectSsBubble_Spawn(play, &this->knobDoor.dyna.actor.world.pos, 60.0, 100.0f, 50.0f, 0.15f);
|
||||
}
|
||||
}
|
||||
} else if (Animation_OnFrame(&this->skelAnime, sAnimCloseFrames[this->animIndex])) {
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DOOR_CLOSE);
|
||||
} else if (Animation_OnFrame(&this->knobDoor.skelAnime, sAnimCloseFrames[this->knobDoor.animIndex])) {
|
||||
Actor_PlaySfx(&this->knobDoor.dyna.actor, NA_SE_EV_DOOR_CLOSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -620,28 +623,28 @@ s32 EnDoor_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
TransitionActorEntry* transitionEntry;
|
||||
EnDoor* this = THIS;
|
||||
|
||||
if (limbIndex == 4) {
|
||||
Gfx** dl = D_808679A4[this->dlIndex];
|
||||
if (limbIndex == DOOR_LIMB_4) {
|
||||
Gfx** dl = D_808679A4[this->knobDoor.dlIndex];
|
||||
s16 temp;
|
||||
s32 dlIndex;
|
||||
|
||||
transitionEntry = NULL;
|
||||
|
||||
if (this->unk_1A4 != 7) {
|
||||
transitionEntry = &play->doorCtx.transitionActorList[(u16)this->dyna.actor.params >> 0xA];
|
||||
if (this->doorType != ENDOOR_TYPE_7) {
|
||||
transitionEntry = &play->doorCtx.transitionActorList[DOOR_GET_TRANSITION_ID(&this->knobDoor.dyna.actor)];
|
||||
}
|
||||
rot->z += this->dyna.actor.world.rot.y;
|
||||
if ((this->unk_1A4 == 7) || (play->roomCtx.prevRoom.num >= 0) ||
|
||||
rot->z += this->knobDoor.dyna.actor.world.rot.y;
|
||||
if ((this->doorType == ENDOOR_TYPE_7) || (play->roomCtx.prevRoom.num >= 0) ||
|
||||
(transitionEntry->sides[0].room == transitionEntry->sides[1].room)) {
|
||||
s32 pad;
|
||||
|
||||
temp = (this->dyna.actor.shape.rot.y + this->skelAnime.jointTable[3].z + rot->z) -
|
||||
Math_Vec3f_Yaw(&play->view.eye, &this->dyna.actor.world.pos);
|
||||
temp = (this->knobDoor.dyna.actor.shape.rot.y + this->knobDoor.skelAnime.jointTable[3].z + rot->z) -
|
||||
Math_Vec3f_Yaw(&play->view.eye, &this->knobDoor.dyna.actor.world.pos);
|
||||
*dList = (ABS_ALT(temp) < 0x4000) ? dl[0] : dl[1];
|
||||
|
||||
} else {
|
||||
dlIndex = 0;
|
||||
if (transitionEntry->sides[0].room != this->dyna.actor.room) {
|
||||
if (transitionEntry->sides[0].room != this->knobDoor.dyna.actor.room) {
|
||||
dlIndex = 1;
|
||||
}
|
||||
*dList = dl[dlIndex];
|
||||
@@ -653,17 +656,17 @@ s32 EnDoor_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
void EnDoor_Draw(Actor* thisx, PlayState* play) {
|
||||
EnDoor* this = THIS;
|
||||
|
||||
if (this->dyna.actor.objBankIndex == this->requiredObjBankIndex) {
|
||||
if (this->knobDoor.dyna.actor.objBankIndex == this->knobDoor.requiredObjBankIndex) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
if ((this->unk_1A4 == 7) && (this->switchFlag == 0)) {
|
||||
if ((this->doorType == ENDOOR_TYPE_7) && (this->switchFlag == 0)) {
|
||||
Gfx_DrawDListOpa(play, gameplay_keep_DL_0221B8);
|
||||
} else {
|
||||
func_8012C28C(play->state.gfxCtx);
|
||||
}
|
||||
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDoor_OverrideLimbDraw, NULL,
|
||||
&this->dyna.actor);
|
||||
if (this->dyna.actor.world.rot.y != 0) {
|
||||
if (this->dyna.actor.world.rot.y > 0) {
|
||||
SkelAnime_DrawOpa(play, this->knobDoor.skelAnime.skeleton, this->knobDoor.skelAnime.jointTable,
|
||||
EnDoor_OverrideLimbDraw, NULL, &this->knobDoor.dyna.actor);
|
||||
if (this->knobDoor.dyna.actor.world.rot.y != 0) {
|
||||
if (this->knobDoor.dyna.actor.world.rot.y > 0) {
|
||||
gSPDisplayList(POLY_OPA_DISP++, gDoorRightDL);
|
||||
} else {
|
||||
gSPDisplayList(POLY_OPA_DISP++, gDoorLeftDL);
|
||||
|
||||
@@ -2,27 +2,34 @@
|
||||
#define Z_EN_DOOR_H
|
||||
|
||||
#include "global.h"
|
||||
#include "z64door.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
struct EnDoor;
|
||||
|
||||
typedef void (*EnDoorActionFunc)(struct EnDoor*, PlayState*);
|
||||
|
||||
#define ENDOOR_GET_PARAMS_7(thisx) (((thisx)->params >> 7) & 7)
|
||||
#define ENDOOR_GET_TYPE(thisx) (((thisx)->params >> 7) & 7)
|
||||
#define ENDOOR_GET_PARAMS_7F(thisx) (((thisx)->params) & 0x7F)
|
||||
|
||||
typedef enum EnDoorType {
|
||||
/* 0 */ ENDOOR_TYPE_0,
|
||||
/* 1 */ ENDOOR_TYPE_1,
|
||||
/* 2 */ ENDOOR_TYPE_2,
|
||||
/* 3 */ ENDOOR_TYPE_3,
|
||||
/* 4 */ ENDOOR_TYPE_4,
|
||||
/* 5 */ ENDOOR_TYPE_5,
|
||||
/* 6 */ ENDOOR_TYPE_6,
|
||||
/* 7 */ ENDOOR_TYPE_7
|
||||
} EnDoorType;
|
||||
|
||||
typedef struct EnDoor {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 0x15C */ SkelAnime skelAnime;
|
||||
/* 0x1A0 */ u8 animIndex;
|
||||
/* 0x1A1 */ u8 unk_1A1;
|
||||
/* 0x1A2 */ s8 requiredObjBankIndex;
|
||||
/* 0x1A3 */ s8 dlIndex;
|
||||
/* 0x1A4 */ u8 unk_1A4;
|
||||
/* 0x000 */ KnobDoorActor knobDoor;
|
||||
/* 0x1A4 */ u8 doorType;
|
||||
/* 0x1A5 */ u8 switchFlag;
|
||||
/* 0x1A6 */ u8 unk_1A6;
|
||||
/* 0x1A7 */ s8 unk_1A7;
|
||||
/* 0x1A8 */ Vec3s limbTable[5];
|
||||
/* 0x1A8 */ Vec3s limbTable[DOOR_LIMB_MAX];
|
||||
/* 0x1C8 */ EnDoorActionFunc actionFunc;
|
||||
} EnDoor;
|
||||
|
||||
|
||||
@@ -92,9 +92,9 @@ void EnDoorEtc_Init(Actor* thisx, PlayState* play2) {
|
||||
s32 i;
|
||||
EnDoorEtc* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.shape.rot.x = -0x4000;
|
||||
Actor_ProcessInitChain(&this->knobDoor.dyna.actor, sInitChain);
|
||||
Actor_SetScale(&this->knobDoor.dyna.actor, 0.01f);
|
||||
this->knobDoor.dyna.actor.shape.rot.x = -0x4000;
|
||||
this->angle = 0;
|
||||
for (i = 0; i < 15; i++, objectInfo++) {
|
||||
if (play->sceneId == objectInfo->sceneId) {
|
||||
@@ -106,19 +106,19 @@ void EnDoorEtc_Init(Actor* thisx, PlayState* play2) {
|
||||
}
|
||||
objectIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId);
|
||||
if (objectIndex < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
Actor_Kill(&this->knobDoor.dyna.actor);
|
||||
} else {
|
||||
this->objectIndex = objectIndex;
|
||||
this->dListIndex = objectInfo->dListIndex;
|
||||
if (this->actor.objBankIndex == this->objectIndex) {
|
||||
this->knobDoor.requiredObjBankIndex = objectIndex;
|
||||
this->knobDoor.dlIndex = objectInfo->dListIndex;
|
||||
if (this->knobDoor.dyna.actor.objBankIndex == this->knobDoor.requiredObjBankIndex) {
|
||||
EnDoorEtc_WaitForObject(this, play);
|
||||
} else {
|
||||
this->actionFunc = EnDoorEtc_WaitForObject;
|
||||
}
|
||||
}
|
||||
Collider_InitCylinder(play, &this->collider);
|
||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
Collider_SetCylinder(play, &this->collider, &this->knobDoor.dyna.actor, &sCylinderInit);
|
||||
this->knobDoor.dyna.actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
}
|
||||
|
||||
void EnDoorEtc_Destroy(Actor* thisx, PlayState* play) {
|
||||
@@ -139,11 +139,11 @@ s32 EnDoorEtc_IsDistanceGreater(Vec3f* a, Vec3f* b, f32 c) {
|
||||
}
|
||||
|
||||
void EnDoorEtc_WaitForObject(EnDoorEtc* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_10;
|
||||
this->actor.objBankIndex = this->objectIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->knobDoor.requiredObjBankIndex)) {
|
||||
this->knobDoor.dyna.actor.flags &= ~ACTOR_FLAG_10;
|
||||
this->knobDoor.dyna.actor.objBankIndex = this->knobDoor.requiredObjBankIndex;
|
||||
this->actionFunc = func_80AC2354;
|
||||
this->actor.draw = EnDoorEtc_Draw;
|
||||
this->knobDoor.dyna.actor.draw = EnDoorEtc_Draw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,27 +175,28 @@ void func_80AC21A0(EnDoorEtc* this, PlayState* play) {
|
||||
s16 yawDiff;
|
||||
s32 yawDiffAbs;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &playerOffsetFromDoor, &player->actor.world.pos);
|
||||
if (this->unk_1A1 == 0) {
|
||||
Actor_OffsetOfPointInActorCoords(&this->knobDoor.dyna.actor, &playerOffsetFromDoor, &player->actor.world.pos);
|
||||
if (!this->knobDoor.playOpenAnim) {
|
||||
if ((!Player_InCsMode(play)) &&
|
||||
((fabsf(playerOffsetFromDoor.y) < 20.0f) && fabsf(playerOffsetFromDoor.x) < 20.0f) &&
|
||||
(fabsf(playerOffsetFromDoor.z) < 50.0f)) {
|
||||
yawDiff = player->actor.shape.rot.y - this->actor.shape.rot.y;
|
||||
yawDiff = player->actor.shape.rot.y - this->knobDoor.dyna.actor.shape.rot.y;
|
||||
if (playerOffsetFromDoor.z > 0.0f) {
|
||||
yawDiff = 0x8000 - yawDiff;
|
||||
}
|
||||
yawDiffAbs = ABS_ALT(yawDiff);
|
||||
if (yawDiffAbs < 0x3000) {
|
||||
player->doorDirection = (playerOffsetFromDoor.z >= 0.0f) ? 1.0f : -1.0f;
|
||||
player->doorActor = &this->actor;
|
||||
player->doorType = -1;
|
||||
player->doorActor = &this->knobDoor.dyna.actor;
|
||||
player->doorType = PLAYER_DOORTYPE_TALKING;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((this->actor.textId == 0x239B) && Flags_GetSwitch(play, ENDOORETC_GET_SWITCHFLAG(&this->actor))) {
|
||||
Flags_UnsetSwitch(play, ENDOORETC_GET_SWITCHFLAG(&this->actor));
|
||||
if ((this->knobDoor.dyna.actor.textId == 0x239B) &&
|
||||
Flags_GetSwitch(play, ENDOORETC_GET_SWITCHFLAG(&this->knobDoor.dyna.actor))) {
|
||||
Flags_UnsetSwitch(play, ENDOORETC_GET_SWITCHFLAG(&this->knobDoor.dyna.actor));
|
||||
this->actionFunc = func_80AC2154;
|
||||
this->actor.textId = 0x1800; // "It won't budge!"
|
||||
this->knobDoor.dyna.actor.textId = 0x1800; // "It won't budge!"
|
||||
this->unk_1F4 |= 1;
|
||||
this->timer = 0x5A;
|
||||
}
|
||||
@@ -206,18 +207,18 @@ void func_80AC2354(EnDoorEtc* this, PlayState* play) {
|
||||
|
||||
while (door != NULL) {
|
||||
if ((door->id != ACTOR_EN_DOOR) ||
|
||||
!EnDoorEtc_IsDistanceGreater(&door->world.pos, &this->actor.world.pos, 10.0f)) {
|
||||
!EnDoorEtc_IsDistanceGreater(&door->world.pos, &this->knobDoor.dyna.actor.world.pos, 10.0f)) {
|
||||
door = door->next;
|
||||
} else {
|
||||
this->actor.world.pos.x = door->world.pos.x;
|
||||
this->actor.world.pos.y = door->world.pos.y;
|
||||
this->actor.world.pos.z = door->world.pos.z;
|
||||
this->actor.shape.rot.y = door->shape.rot.y;
|
||||
this->actor.world.rot.y = door->world.rot.y;
|
||||
this->knobDoor.dyna.actor.world.pos.x = door->world.pos.x;
|
||||
this->knobDoor.dyna.actor.world.pos.y = door->world.pos.y;
|
||||
this->knobDoor.dyna.actor.world.pos.z = door->world.pos.z;
|
||||
this->knobDoor.dyna.actor.shape.rot.y = door->shape.rot.y;
|
||||
this->knobDoor.dyna.actor.world.rot.y = door->world.rot.y;
|
||||
Actor_Kill(door);
|
||||
this->actionFunc = func_80AC21A0;
|
||||
this->actor.textId = 0x239B;
|
||||
Actor_SetFocus(&this->actor, 70.0f);
|
||||
this->knobDoor.dyna.actor.textId = 0x239B;
|
||||
Actor_SetFocus(&this->knobDoor.dyna.actor, 70.0f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -229,7 +230,7 @@ void EnDoorEtc_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->actionFunc(this, play);
|
||||
if (this->unk_1F4 & 1) {
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
Collider_UpdateCylinder(&this->knobDoor.dyna.actor, &this->collider);
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define Z_EN_DOOR_ETC_H
|
||||
|
||||
#include "global.h"
|
||||
#include "z64door.h"
|
||||
|
||||
struct EnDoorEtc;
|
||||
|
||||
@@ -10,11 +11,7 @@ struct EnDoorEtc;
|
||||
typedef void (*EnDoorEtcActionFunc)(struct EnDoorEtc*, PlayState*);
|
||||
|
||||
typedef struct EnDoorEtc {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char pad_144[0x5D];
|
||||
/* 0x1A1 */ u8 unk_1A1;
|
||||
/* 0x1A2 */ s8 objectIndex;
|
||||
/* 0x1A3 */ u8 dListIndex; // Never read, inferred from ovl_En_Door
|
||||
/* 0x000 */ KnobDoorActor knobDoor;
|
||||
/* 0x1A4 */ s16 angle;
|
||||
/* 0x1A6 */ s16 timer;
|
||||
/* 0x1A8 */ ColliderCylinder collider;
|
||||
|
||||
@@ -1268,7 +1268,8 @@ void EnEgol_Update(Actor* thisx, PlayState* play) {
|
||||
// last argument is DMG_ZORA_BOOMERANG | DMG_HOOKSHOT | DMG_NORMAL_ARROW | DMG_FIRE_ARROW | DMG_ICE_ARROW |
|
||||
// DMG_LIGHT_ARROW | DMG_DEKU_BUBBLE
|
||||
|
||||
if ((projectile != NULL) && !((projectile->id == ACTOR_EN_ARROW) && (projectile->params == ENARROW_5))) {
|
||||
if ((projectile != NULL) &&
|
||||
!((projectile->id == ACTOR_EN_ARROW) && (projectile->params == ARROW_TYPE_LIGHT))) {
|
||||
this->eyelidRotTarget = 0xFA0;
|
||||
this->eyeShutTimer = 20;
|
||||
if (this->action == EYEGORE_ACTION_LASER) {
|
||||
|
||||
@@ -489,7 +489,7 @@ void EnFamos_SetupChase(EnFamos* this) {
|
||||
void EnFamos_Chase(EnFamos* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
Vec3f abovePlayerPos;
|
||||
u32 surfaceType;
|
||||
FloorProperty surfaceType;
|
||||
|
||||
EnFamos_UpdateBobbingHeight(this);
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x800);
|
||||
@@ -502,7 +502,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) {
|
||||
|
||||
surfaceType = SurfaceType_GetFloorProperty2(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId);
|
||||
if ((this->actor.xzDistToPlayer < 30.0f) && (this->actor.floorHeight > BGCHECK_Y_MIN) && // close enough
|
||||
(surfaceType != 0xC && surfaceType != 0xD)) {
|
||||
(surfaceType != FLOOR_PROPERTY_12 && surfaceType != FLOOR_PROPERTY_13)) {
|
||||
EnFamos_SetupAttackAim(this);
|
||||
|
||||
} else if ((Player_GetMask(play) == PLAYER_MASK_STONE) ||
|
||||
@@ -689,9 +689,9 @@ void EnFamos_DeathExplosion(EnFamos* this, PlayState* play) {
|
||||
this->actor.world.pos.x = randPlusMinusPoint5Scaled(5.0f) + this->targetDest.x;
|
||||
this->actor.world.pos.z = randPlusMinusPoint5Scaled(5.0f) + this->targetDest.z;
|
||||
if (this->stateTimer == 1) {
|
||||
EnBom* explosion =
|
||||
(EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, BOMB_TYPE_BODY);
|
||||
EnBom* explosion = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y + 40.0f, this->actor.world.pos.z,
|
||||
BOMB_EXPLOSIVE_TYPE_BOMB, 0, 0, BOMB_TYPE_BODY);
|
||||
if (explosion != NULL) {
|
||||
explosion->timer = 0; // instant explosion
|
||||
}
|
||||
|
||||
@@ -1949,25 +1949,25 @@ void EnFishing_DrawRod(PlayState* play) {
|
||||
D_8090CD34 = 0.0f;
|
||||
}
|
||||
|
||||
spC8 = player->unk_B08[1];
|
||||
Math_SmoothStepToF(&player->unk_B08[1], input->rel.stick_y * 0.02f, 0.3f, 5.0f, 0.0f);
|
||||
spC8 = player->unk_B08[1] - spC8;
|
||||
spC8 = player->unk_B0C;
|
||||
Math_SmoothStepToF(&player->unk_B0C, input->rel.stick_y * 0.02f, 0.3f, 5.0f, 0.0f);
|
||||
spC8 = player->unk_B0C - spC8;
|
||||
|
||||
spC4 = player->unk_B08[0];
|
||||
Math_SmoothStepToF(&player->unk_B08[0], input->rel.stick_x * 0.02f, 0.3f, 5.0f, 0.0f);
|
||||
spC4 = player->unk_B08[0] - spC4;
|
||||
spC4 = player->unk_B08;
|
||||
Math_SmoothStepToF(&player->unk_B08, input->rel.stick_x * 0.02f, 0.3f, 5.0f, 0.0f);
|
||||
spC4 = player->unk_B08 - spC4;
|
||||
|
||||
if (player->unk_B08[0] > 1.0f) {
|
||||
player->unk_B08[0] = 1.0f;
|
||||
if (player->unk_B08 > 1.0f) {
|
||||
player->unk_B08 = 1.0f;
|
||||
}
|
||||
if (player->unk_B08[1] > 1.0f) {
|
||||
player->unk_B08[1] = 1.0f;
|
||||
if (player->unk_B0C > 1.0f) {
|
||||
player->unk_B0C = 1.0f;
|
||||
}
|
||||
if (player->unk_B08[0] < -1.0f) {
|
||||
player->unk_B08[0] = -1.0f;
|
||||
if (player->unk_B08 < -1.0f) {
|
||||
player->unk_B08 = -1.0f;
|
||||
}
|
||||
if (player->unk_B08[1] < -1.0f) {
|
||||
player->unk_B08[1] = -1.0f;
|
||||
if (player->unk_B0C < -1.0f) {
|
||||
player->unk_B0C = -1.0f;
|
||||
}
|
||||
|
||||
Math_ApproachF(&D_8090CD28, spC4 * 70.0f * -0.01f, 1.0f, D_8090CD30);
|
||||
@@ -1976,8 +1976,8 @@ void EnFishing_DrawRod(PlayState* play) {
|
||||
Math_ApproachF(&D_8090CD34, 1.0f, 1.0f, 0.1f);
|
||||
Math_ApproachZeroF(&D_8090CD38, 1.0f, 0.05f);
|
||||
} else {
|
||||
Math_ApproachZeroF(&player->unk_B08[1], 1.0f, 0.1f);
|
||||
Math_ApproachZeroF(&player->unk_B08[0], 1.0f, 0.1f);
|
||||
Math_ApproachZeroF(&player->unk_B0C, 1.0f, 0.1f);
|
||||
Math_ApproachZeroF(&player->unk_B08, 1.0f, 0.1f);
|
||||
Math_ApproachF(&D_8090CD2C, (Math_SinS(D_809171FE * 3000) * 0.025f) + -0.03f, 1.0f, 0.05f);
|
||||
Math_ApproachZeroF(&D_8090CD28, 1.0f, 0.05f);
|
||||
|
||||
@@ -1994,7 +1994,7 @@ void EnFishing_DrawRod(PlayState* play) {
|
||||
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 155, 0, 255);
|
||||
|
||||
Matrix_Mult(&player->mf_CC4, MTXMODE_NEW);
|
||||
Matrix_Mult(&player->leftHandMf, MTXMODE_NEW);
|
||||
|
||||
if (sLinkAge != 1) {
|
||||
Matrix_Translate(0.0f, 400.0f, 0.0f, MTXMODE_APPLY);
|
||||
@@ -2009,11 +2009,11 @@ void EnFishing_DrawRod(PlayState* play) {
|
||||
}
|
||||
|
||||
Matrix_RotateXFApply(-0.6283185f);
|
||||
Matrix_RotateZF((player->unk_B08[0] * 0.5f) + 0.4712389f, MTXMODE_APPLY);
|
||||
Matrix_RotateZF((player->unk_B08 * 0.5f) + 0.4712389f, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply((D_8090CD40 + 20.0f) * 0.01f * M_PI);
|
||||
Matrix_Scale(0.70000005f, 0.70000005f, 0.70000005f, MTXMODE_APPLY);
|
||||
|
||||
spC0 = (D_8090CD3C * (((player->unk_B08[1] - 1.0f) * -0.25f) + 0.5f)) + (D_8090CD2C + D_8090CD38);
|
||||
spC0 = (D_8090CD3C * (((player->unk_B0C - 1.0f) * -0.25f) + 0.5f)) + (D_8090CD2C + D_8090CD38);
|
||||
|
||||
Matrix_Translate(0.0f, 0.0f, -1300.0f, MTXMODE_APPLY);
|
||||
|
||||
|
||||
@@ -1019,7 +1019,7 @@ s32 func_8094F904(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp55, D_80951A0C[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
|
||||
if ((door != NULL) && (door->knobDoor.dyna.actor.update != NULL)) {
|
||||
if (this->timePath != NULL) {
|
||||
sp4C = Lib_SegmentedToVirtual(this->timePath->points);
|
||||
Math_Vec3s_ToVec3f(&sp40, &sp4C[0]);
|
||||
@@ -1029,7 +1029,7 @@ s32 func_8094F904(EnGm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
this->actor.world.rot.y = Math_Vec3f_Yaw(&sp40, &sp34);
|
||||
Math_Vec3f_Copy(&this->actor.world.pos, &sp40);
|
||||
|
||||
if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, door->dyna.actor.shape.rot.y)) <= 0x4000) {
|
||||
if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, door->knobDoor.dyna.actor.shape.rot.y)) <= 0x4000) {
|
||||
this->unk_261 = -75;
|
||||
} else {
|
||||
this->unk_261 = 75;
|
||||
@@ -1450,7 +1450,7 @@ s32 func_80950804(EnGm* this, PlayState* play) {
|
||||
|
||||
door = func_8094DF90(play, this->unk_258);
|
||||
if (!SubS_InCsMode(play) && (this->timePathTimeSpeed != 0)) {
|
||||
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
|
||||
if ((door != NULL) && (door->knobDoor.dyna.actor.update != NULL)) {
|
||||
if ((this->unk_3BA / (f32)this->unk_3B8) <= 0.9f) {
|
||||
door->unk_1A7 = this->unk_261;
|
||||
} else {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "z_en_go.h"
|
||||
#include "z64quake.h"
|
||||
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
|
||||
#include "objects/object_oF1d_map/object_oF1d_map.h"
|
||||
#include "objects/object_hakugin_demo/object_hakugin_demo.h"
|
||||
#include "objects/object_taisou/object_taisou.h"
|
||||
@@ -1249,7 +1250,8 @@ s32 func_80A13E80(EnGo* this, PlayState* play) {
|
||||
func_80A12C48(this, play, 1);
|
||||
Lib_Vec3f_TranslateAndRotateY(&this->actor.world.pos, this->actor.shape.rot.y, &D_80A166A4, &sp48);
|
||||
gSaveContext.powderKegTimer = 2400;
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, sp48.x, sp48.y, sp48.z, 1, 0, 0, 0);
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, sp48.x, sp48.y, sp48.z, BOMB_EXPLOSIVE_TYPE_POWDER_KEG,
|
||||
0, 0, BOMB_TYPE_BODY);
|
||||
func_80A134B0(this, play, 1);
|
||||
this->unk_3C2 = 0;
|
||||
this->unk_3C0++;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_en_gs.h"
|
||||
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
|
||||
#include "objects/object_gs/object_gs.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
@@ -871,7 +872,7 @@ s32 func_809995A4(EnGs* this, PlayState* play) {
|
||||
|
||||
if (this->actor.playerHeightRel < -12000.0f) {
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 0, this->actor.world.rot.y, 0, 0);
|
||||
this->actor.world.pos.z, BOMB_EXPLOSIVE_TYPE_BOMB, this->actor.world.rot.y, 0, BOMB_TYPE_BODY);
|
||||
Actor_Kill(&this->actor);
|
||||
sp7C = 0;
|
||||
}
|
||||
|
||||
@@ -279,8 +279,8 @@ void func_80B22500(EnHakurock* this, PlayState* play) {
|
||||
} else if ((&player->actor == this->collider.base.oc) &&
|
||||
(player->stateFlags3 & (PLAYER_STATE3_1000 | PLAYER_STATE3_80000)) &&
|
||||
(player->linearVelocity > 8.0f)) {
|
||||
player->unk_B08[0] = player->linearVelocity = -5.0f;
|
||||
player->unk_B08[1] += (player->linearVelocity * 0.05f);
|
||||
player->unk_B08 = player->linearVelocity = -5.0f;
|
||||
player->unk_B0C += (player->linearVelocity * 0.05f);
|
||||
player->actor.velocity.y = 5.0f;
|
||||
player->currentYaw = player->actor.world.rot.y;
|
||||
player->actor.home.rot.y = player->actor.world.rot.y;
|
||||
|
||||
@@ -108,18 +108,6 @@ typedef struct {
|
||||
RaceWaypoint* waypoints;
|
||||
} RaceInfo;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ ENHORSE_ANIM_IDLE,
|
||||
/* 1 */ ENHORSE_ANIM_WHINNY,
|
||||
/* 2 */ ENHORSE_ANIM_STOPPING,
|
||||
/* 3 */ ENHORSE_ANIM_REARING,
|
||||
/* 4 */ ENHORSE_ANIM_WALK,
|
||||
/* 5 */ ENHORSE_ANIM_TROT,
|
||||
/* 6 */ ENHORSE_ANIM_GALLOP,
|
||||
/* 7 */ ENHORSE_ANIM_LOW_JUMP,
|
||||
/* 8 */ ENHORSE_ANIM_HIGH_JUMP
|
||||
} EnHorseAnimation;
|
||||
|
||||
static AnimationHeader* sEponaAnimations[] = {
|
||||
&object_horse_link_child_Anim_006D44, &object_horse_link_child_Anim_007468, &object_horse_link_child_Anim_005F64,
|
||||
&object_horse_link_child_Anim_004DE8, &object_horse_link_child_Anim_007D50, &object_horse_link_child_Anim_0043AC,
|
||||
|
||||
@@ -75,7 +75,7 @@ typedef enum EnHorseAction {
|
||||
/* 25 */ ENHORSE_ACTION_25
|
||||
} EnHorseAction;
|
||||
|
||||
typedef enum {
|
||||
typedef enum EnHorsePlayerDir {
|
||||
/* 0 */ PLAYER_DIR_FRONT_R,
|
||||
/* 1 */ PLAYER_DIR_FRONT_L,
|
||||
/* 2 */ PLAYER_DIR_BACK_R,
|
||||
@@ -84,7 +84,19 @@ typedef enum {
|
||||
/* 5 */ PLAYER_DIR_SIDE_L
|
||||
} EnHorsePlayerDir;
|
||||
|
||||
typedef enum {
|
||||
typedef enum EnHorseAnimation {
|
||||
/* 0 */ ENHORSE_ANIM_IDLE,
|
||||
/* 1 */ ENHORSE_ANIM_WHINNY,
|
||||
/* 2 */ ENHORSE_ANIM_STOPPING,
|
||||
/* 3 */ ENHORSE_ANIM_REARING,
|
||||
/* 4 */ ENHORSE_ANIM_WALK,
|
||||
/* 5 */ ENHORSE_ANIM_TROT,
|
||||
/* 6 */ ENHORSE_ANIM_GALLOP,
|
||||
/* 7 */ ENHORSE_ANIM_LOW_JUMP,
|
||||
/* 8 */ ENHORSE_ANIM_HIGH_JUMP
|
||||
} EnHorseAnimation;
|
||||
|
||||
typedef enum HorseType {
|
||||
/* 0 */ HORSE_TYPE_EPONA,
|
||||
/* 1 */ HORSE_TYPE_HNI,
|
||||
/* 2 */ HORSE_TYPE_2,
|
||||
|
||||
@@ -556,7 +556,7 @@ s32 func_80BF1DF4(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp55, D_80BF3318[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
|
||||
if ((door != NULL) && (door->knobDoor.dyna.actor.update != NULL)) {
|
||||
if (this->timePath != NULL) {
|
||||
sp4C = Lib_SegmentedToVirtual(this->timePath->points);
|
||||
Math_Vec3s_ToVec3f(&sp40, &sp4C[0]);
|
||||
@@ -566,7 +566,7 @@ s32 func_80BF1DF4(EnIg* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
this->actor.world.rot.y = Math_Vec3f_Yaw(&sp40, &sp34);
|
||||
Math_Vec3f_Copy(&this->actor.world.pos, &sp40);
|
||||
|
||||
if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, door->dyna.actor.shape.rot.y)) <= 0x4000) {
|
||||
if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, door->knobDoor.dyna.actor.shape.rot.y)) <= 0x4000) {
|
||||
this->unk_2A4 = -75;
|
||||
} else {
|
||||
this->unk_2A4 = 75;
|
||||
@@ -735,7 +735,7 @@ s32 func_80BF2470(EnIg* this, PlayState* play) {
|
||||
s32 pad;
|
||||
|
||||
if (!SubS_InCsMode(play) && (this->timePathTimeSpeed != 0)) {
|
||||
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
|
||||
if ((door != NULL) && (door->knobDoor.dyna.actor.update != NULL)) {
|
||||
if (((f32)this->unk_3E2 / this->unk_3E0) <= 0.9f) {
|
||||
door->unk_1A7 = this->unk_2A4;
|
||||
} else {
|
||||
|
||||
@@ -377,7 +377,7 @@ void EnJs_TakeMask(s32 itemActions, s32 childType) {
|
||||
s32 temp = 0;
|
||||
|
||||
if ((childType >= 0) && (childType < 9)) {
|
||||
itemActions -= PLAYER_IA_MASK_TRUTH;
|
||||
itemActions -= PLAYER_IA_MASK_MIN;
|
||||
childType *= 3;
|
||||
if (itemActions < 8) {
|
||||
masksGivenOnMoon[childType] |= 1 << itemActions;
|
||||
@@ -543,7 +543,7 @@ void func_80969748(EnJs* this, PlayState* play) {
|
||||
}
|
||||
if (itemAction > PLAYER_IA_NONE) {
|
||||
Message_CloseTextbox(play);
|
||||
if ((itemAction >= PLAYER_IA_MASK_TRUTH) && (itemAction <= PLAYER_IA_MASK_GIANT)) {
|
||||
if ((itemAction >= PLAYER_IA_MASK_MIN) && (itemAction < PLAYER_IA_MASK_TRANSFORMATION_MIN)) {
|
||||
EnJs_TakeMask(itemAction, ENJS_GET_TYPE(&this->actor));
|
||||
Inventory_UnequipItem(itemAction - 4);
|
||||
if (!func_809692A8(ENJS_GET_TYPE(&this->actor))) {
|
||||
@@ -551,7 +551,7 @@ void func_80969748(EnJs* this, PlayState* play) {
|
||||
} else {
|
||||
player->actor.textId = 0x2213;
|
||||
}
|
||||
} else if ((itemAction >= PLAYER_IA_MASK_FIERCE_DEITY) && (itemAction <= PLAYER_IA_MASK_DEKU)) {
|
||||
} else if ((itemAction >= PLAYER_IA_MASK_TRANSFORMATION_MIN) && (itemAction <= PLAYER_IA_MASK_MAX)) {
|
||||
player->actor.textId = 0x2211;
|
||||
} else {
|
||||
player->actor.textId = 0x2210;
|
||||
@@ -692,7 +692,7 @@ void func_80969C54(EnJs* this, PlayState* play) {
|
||||
|
||||
if (itemAction > PLAYER_IA_NONE) {
|
||||
Message_CloseTextbox(play);
|
||||
if ((itemAction >= PLAYER_IA_MASK_TRUTH) && (itemAction <= PLAYER_IA_MASK_GIANT)) {
|
||||
if ((itemAction >= PLAYER_IA_MASK_MIN) && (itemAction < PLAYER_IA_MASK_TRANSFORMATION_MIN)) {
|
||||
EnJs_TakeMask(itemAction, ENJS_GET_TYPE(&this->actor));
|
||||
Inventory_UnequipItem(itemAction - 4);
|
||||
if (!func_809692A8(ENJS_GET_TYPE(&this->actor))) {
|
||||
@@ -700,7 +700,7 @@ void func_80969C54(EnJs* this, PlayState* play) {
|
||||
} else {
|
||||
player->actor.textId = 0x2222;
|
||||
}
|
||||
} else if ((itemAction >= PLAYER_IA_MASK_FIERCE_DEITY) && (itemAction <= PLAYER_IA_MASK_DEKU)) {
|
||||
} else if ((itemAction >= PLAYER_IA_MASK_TRANSFORMATION_MIN) && (itemAction <= PLAYER_IA_MASK_MAX)) {
|
||||
player->actor.textId = 0x2220;
|
||||
} else {
|
||||
player->actor.textId = 0x221D;
|
||||
|
||||
@@ -902,7 +902,8 @@ void func_80B872F4(EnKaizoku* this, PlayState* play) {
|
||||
if ((this->lookTimer == 0) && !func_80B85858(this, play) && !func_80B85A00(this, play, false)) {
|
||||
s16 yawDiff = this->picto.actor.yawTowardsPlayer - this->picto.actor.shape.rot.y;
|
||||
|
||||
if ((this->picto.actor.xzDistToPlayer < 100.0f) && (player->meleeWeaponState != 0) && (yawDiff >= 0x1F40)) {
|
||||
if ((this->picto.actor.xzDistToPlayer < 100.0f) && (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
|
||||
(yawDiff >= 0x1F40)) {
|
||||
this->picto.actor.shape.rot.y = this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer;
|
||||
func_80B88CD8(this);
|
||||
} else if (Actor_IsFacingPlayer(&this->picto.actor, 0xBB8)) {
|
||||
@@ -1285,7 +1286,8 @@ void func_80B88378(EnKaizoku* this, PlayState* play) {
|
||||
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
sp2A = ABS_ALT(player->actor.shape.rot.y - this->picto.actor.shape.rot.y);
|
||||
if (this->picto.actor.xzDistToPlayer < 150.0f && player->meleeWeaponState != 0 && sp2A >= 0x2000) {
|
||||
if ((this->picto.actor.xzDistToPlayer < 150.0f) && (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
|
||||
(sp2A >= 0x2000)) {
|
||||
this->picto.actor.shape.rot.y = this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer;
|
||||
if (Rand_ZeroOne() > 0.7f) {
|
||||
func_80B88CD8(this);
|
||||
@@ -1938,8 +1940,8 @@ void func_80B89A08(EnKaizoku* this, PlayState* play) {
|
||||
pos.z = this->bodyCollider.info.bumper.hitPos.z;
|
||||
|
||||
if (player->transformation != PLAYER_FORM_HUMAN) {
|
||||
player->unk_B84 = this->picto.actor.yawTowardsPlayer;
|
||||
player->unk_B80 = 15.0f;
|
||||
player->pushedYaw = this->picto.actor.yawTowardsPlayer;
|
||||
player->pushedSpeed = 15.0f;
|
||||
}
|
||||
|
||||
this->bodyCollider.base.acFlags &= ~AC_HIT;
|
||||
|
||||
@@ -359,8 +359,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((player->meleeWeaponState != 0) || (player->stateFlags3 & PLAYER_STATE3_8000000) ||
|
||||
(player->stateFlags2 & PLAYER_STATE2_80000)) {
|
||||
if ((player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) ||
|
||||
(player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
@@ -370,7 +370,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((player->meleeWeaponState != 0) || (player->stateFlags2 & PLAYER_STATE2_80000)) {
|
||||
if ((player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) ||
|
||||
(player->stateFlags2 & PLAYER_STATE2_80000)) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
@@ -380,8 +381,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((player->meleeWeaponState != 0) || (player->stateFlags3 & PLAYER_STATE3_8000000) ||
|
||||
(player->stateFlags2 & PLAYER_STATE2_80000)) {
|
||||
if ((player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) ||
|
||||
(player->stateFlags3 & PLAYER_STATE3_8000000) || (player->stateFlags2 & PLAYER_STATE2_80000)) {
|
||||
return 1;
|
||||
}
|
||||
this->unk_28E = 0;
|
||||
|
||||
@@ -144,7 +144,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play) {
|
||||
this->isCharging = false;
|
||||
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_23_02)) {
|
||||
player->unk_B08[0] = 1.0f;
|
||||
player->unk_B08 = 1.0f;
|
||||
this->collider.info.toucher.damage = sDamages[this->type + ENMTHUNDER_TYPE_MAX];
|
||||
this->subtype = ENMTHUNDER_SUBTYPE_SPIN_GREAT;
|
||||
if (this->type == ENMTHUNDER_TYPE_GREAT_FAIRY_SWORD) {
|
||||
@@ -155,7 +155,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play) {
|
||||
this->scaleTarget = 3;
|
||||
}
|
||||
} else {
|
||||
player->unk_B08[0] = 0.5f;
|
||||
player->unk_B08 = 0.5f;
|
||||
this->collider.info.toucher.damage = sDamages[this->type];
|
||||
this->subtype = ENMTHUNDER_SUBTYPE_SPIN_REGULAR;
|
||||
if (this->type == ENMTHUNDER_TYPE_GREAT_FAIRY_SWORD) {
|
||||
@@ -229,11 +229,11 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
Actor* child = this->actor.child;
|
||||
|
||||
this->unk1B0 = player->unk_B08[0];
|
||||
this->unk1B0 = player->unk_B08;
|
||||
this->actor.world.pos = player->bodyPartsPos[0];
|
||||
this->actor.shape.rot.y = player->actor.shape.rot.y + 0x8000;
|
||||
|
||||
if (!this->isCharging && (player->unk_B08[0] >= 0.1f)) {
|
||||
if (!this->isCharging && (player->unk_B08 >= 0.1f)) {
|
||||
if ((gSaveContext.magicState != MAGIC_STATE_IDLE) ||
|
||||
((ENMTHUNDER_GET_MAGIC_COST(&this->actor) != 0) &&
|
||||
!Magic_Consume(play, ENMTHUNDER_GET_MAGIC_COST(&this->actor), MAGIC_CONSUME_WAIT_PREVIEW))) {
|
||||
@@ -247,8 +247,8 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) {
|
||||
this->isCharging = true;
|
||||
}
|
||||
|
||||
if (player->unk_B08[0] >= 0.1f) {
|
||||
Rumble_Request(0.0f, (s32)(player->unk_B08[0] * 150.0f), 2, (s32)(player->unk_B08[0] * 150.0f));
|
||||
if (player->unk_B08 >= 0.1f) {
|
||||
Rumble_Request(0.0f, (s32)(player->unk_B08 * 150.0f), 2, (s32)(player->unk_B08 * 150.0f));
|
||||
}
|
||||
|
||||
if (player->stateFlags2 & PLAYER_STATE2_20000) {
|
||||
@@ -256,8 +256,8 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) {
|
||||
child->parent = NULL;
|
||||
}
|
||||
|
||||
if (player->unk_B08[0] <= 0.15f) {
|
||||
if ((player->unk_B08[0] >= 0.1f) && (player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H)) {
|
||||
if (player->unk_B08 <= 0.15f) {
|
||||
if ((player->unk_B08 >= 0.1f) && (player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H)) {
|
||||
AudioSfx_PlaySfx(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
AudioSfx_PlaySfx(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
@@ -273,7 +273,7 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) {
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP;
|
||||
}
|
||||
|
||||
if (player->unk_B08[0] < 0.85f) {
|
||||
if (player->unk_B08 < 0.85f) {
|
||||
this->collider.info.toucher.damage = sDamages[this->type];
|
||||
this->subtype = ENMTHUNDER_SUBTYPE_SPIN_REGULAR;
|
||||
if (this->type == ENMTHUNDER_TYPE_GREAT_FAIRY_SWORD) {
|
||||
@@ -320,26 +320,26 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player->unk_B08[0] > 0.15f) {
|
||||
if (player->unk_B08 > 0.15f) {
|
||||
this->chargingAlpha = 255;
|
||||
if (this->actor.child == NULL) {
|
||||
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EFF_DUST, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0,
|
||||
EFF_DUST_TYPE_SPIN_ATTACK_CHARGE);
|
||||
}
|
||||
this->adjustLightsArg1 += (((player->unk_B08[0] - 0.15f) * 1.5f) - this->adjustLightsArg1) * 0.5f;
|
||||
} else if (player->unk_B08[0] > .1f) {
|
||||
this->chargingAlpha = (s32)((player->unk_B08[0] - .1f) * 255.0f * 20.0f);
|
||||
this->lightColorFrac = (player->unk_B08[0] - .1f) * 10.0f;
|
||||
this->adjustLightsArg1 += (((player->unk_B08 - 0.15f) * 1.5f) - this->adjustLightsArg1) * 0.5f;
|
||||
} else if (player->unk_B08 > .1f) {
|
||||
this->chargingAlpha = (s32)((player->unk_B08 - .1f) * 255.0f * 20.0f);
|
||||
this->lightColorFrac = (player->unk_B08 - .1f) * 10.0f;
|
||||
} else {
|
||||
this->chargingAlpha = 0;
|
||||
}
|
||||
|
||||
if (player->unk_B08[0] > 0.85f) {
|
||||
if (player->unk_B08 > 0.85f) {
|
||||
func_8019F900(&player->actor.projectedPos, 2);
|
||||
} else if (player->unk_B08[0] > 0.15f) {
|
||||
} else if (player->unk_B08 > 0.15f) {
|
||||
func_8019F900(&player->actor.projectedPos, 1);
|
||||
} else if (player->unk_B08[0] > 0.1f) {
|
||||
} else if (player->unk_B08 > 0.1f) {
|
||||
func_8019F900(&player->actor.projectedPos, 0);
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) {
|
||||
break;
|
||||
}
|
||||
|
||||
Matrix_Mult(&player->mf_CC4, MTXMODE_NEW);
|
||||
Matrix_Mult(&player->leftHandMf, MTXMODE_NEW);
|
||||
|
||||
if (this->type == ENMTHUNDER_TYPE_GILDED_SWORD) {
|
||||
Matrix_Translate(0.0f, 220.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
@@ -491,11 +491,11 @@ s32 func_80B37B78(EnMaruta* this, PlayState* play) {
|
||||
s16 temp_v1 = BINANG_SUB(this->actor.yawTowardsPlayer, 0x8000);
|
||||
|
||||
temp_v1 = BINANG_SUB(temp_v1, player->actor.shape.rot.y);
|
||||
if ((ABS_ALT(temp_v1) < 0x1555) ||
|
||||
((player->meleeWeaponState != 0) && ((player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_SLASH_1H) ||
|
||||
(player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_COMBO_1H) ||
|
||||
(player->meleeWeaponAnimation == PLAYER_MWA_SPIN_ATTACK_1H) ||
|
||||
(player->meleeWeaponAnimation == PLAYER_MWA_BIG_SPIN_1H)))) {
|
||||
if ((ABS_ALT(temp_v1) < 0x1555) || ((player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
|
||||
((player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_SLASH_1H) ||
|
||||
(player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_COMBO_1H) ||
|
||||
(player->meleeWeaponAnimation == PLAYER_MWA_SPIN_ATTACK_1H) ||
|
||||
(player->meleeWeaponAnimation == PLAYER_MWA_BIG_SPIN_1H)))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Description: Seahorse
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_en_ot.h"
|
||||
#include "objects/object_ot/object_ot.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
@@ -660,8 +660,9 @@ void func_80898654(EnPeehat* this) {
|
||||
|
||||
void func_808986A4(EnPeehat* this, PlayState* play) {
|
||||
if (this->unk_2B0 == 5) {
|
||||
EnBom* bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0x602, 0);
|
||||
EnBom* bomb =
|
||||
(EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, BOMB_EXPLOSIVE_TYPE_BOMB, 0, 0x602, BOMB_TYPE_BODY);
|
||||
|
||||
if (bomb != NULL) {
|
||||
bomb->timer = 0;
|
||||
|
||||
@@ -1242,7 +1242,7 @@ s32 func_80AF9008(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
this->timePath = SubS_GetAdditionalPath(play, sp55, D_80AFB430[scheduleOutput->result]);
|
||||
}
|
||||
|
||||
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
|
||||
if ((door != NULL) && (door->knobDoor.dyna.actor.update != NULL)) {
|
||||
if (this->timePath != 0) {
|
||||
sp4C = Lib_SegmentedToVirtual(this->timePath->points);
|
||||
Math_Vec3s_ToVec3f(&sp40, &sp4C[0]);
|
||||
@@ -1251,7 +1251,7 @@ s32 func_80AF9008(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) {
|
||||
Math_Vec3f_Copy(&this->unk_278, &sp34);
|
||||
this->actor.world.rot.y = Math_Vec3f_Yaw(&sp40, &sp34);
|
||||
Math_Vec3f_Copy(&this->actor.world.pos, &sp40);
|
||||
temp = this->actor.world.rot.y - door->dyna.actor.shape.rot.y;
|
||||
temp = this->actor.world.rot.y - door->knobDoor.dyna.actor.shape.rot.y;
|
||||
if (ABS_ALT(temp) <= 0x4000) {
|
||||
this->unk_260 = -0x4B;
|
||||
} else {
|
||||
@@ -1704,7 +1704,7 @@ s32 func_80AF9D04(EnPm* this, PlayState* play) {
|
||||
f32 temp;
|
||||
|
||||
if (!SubS_InCsMode(play) && (this->timePathTimeSpeed != 0)) {
|
||||
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
|
||||
if ((door != NULL) && (door->knobDoor.dyna.actor.update != NULL)) {
|
||||
if (((f32)this->unk_36E / this->unk_36C) <= 0.9f) {
|
||||
door->unk_1A7 = this->unk_260;
|
||||
} else {
|
||||
|
||||
@@ -243,7 +243,8 @@ void EnPoSisters_MatchPlayerXZ(EnPoSisters* this, PlayState* play) {
|
||||
f32 dist;
|
||||
|
||||
if (this->megCloneId == POE_SISTERS_MEG_REAL || this->actionFunc != EnPoSisters_DamageFlinch) {
|
||||
if ((player->meleeWeaponState == 0 || player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) &&
|
||||
if ((player->meleeWeaponState == PLAYER_MELEE_WEAPON_STATE_0 ||
|
||||
player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) &&
|
||||
((player->actor.world.pos.y - player->actor.floorHeight) < 1.0f)) {
|
||||
Math_StepToF(&this->megDistToPlayer, 110.0f, 3.0f);
|
||||
} else {
|
||||
|
||||
@@ -740,8 +740,9 @@ void EnRat_Bounced(EnRat* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void EnRat_Explode(EnRat* this, PlayState* play) {
|
||||
EnBom* bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, BOMB_TYPE_BODY);
|
||||
EnBom* bomb =
|
||||
(EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, BOMB_EXPLOSIVE_TYPE_BOMB, 0, 0, BOMB_TYPE_BODY);
|
||||
|
||||
if (bomb != NULL) {
|
||||
bomb->timer = 0;
|
||||
|
||||
@@ -589,8 +589,8 @@ void func_80BF4AB8(EnRg* this, PlayState* play) {
|
||||
this->unk_326 = 0x28;
|
||||
if (player->stateFlags3 & PLAYER_STATE3_1000) {
|
||||
player->linearVelocity *= 0.5f;
|
||||
player->unk_B08[0] = player->linearVelocity;
|
||||
player->unk_B08[1] += player->linearVelocity * 0.05f;
|
||||
player->unk_B08 = player->linearVelocity;
|
||||
player->unk_B0C += player->linearVelocity * 0.05f;
|
||||
if (BINANG_SUB(this->actor.yawTowardsPlayer, player->currentYaw) > 0) {
|
||||
player->currentYaw += 0x2000;
|
||||
} else {
|
||||
|
||||
@@ -93,11 +93,11 @@ void EnStream_SuckPlayer(EnStream* this, PlayState* play) {
|
||||
this->actor.scale.y) != EN_STREAM_PLAYER_OUTSIDE_RANGE) {
|
||||
xzDist = sqrtf(SQ(posDifference.x) + SQ(posDifference.z));
|
||||
yDistWithOffset = player->actor.world.pos.y - (this->actor.world.pos.y - 90.0f);
|
||||
player->unk_B84 = Math_Atan2S(-posDifference.x, -posDifference.z);
|
||||
player->pushedYaw = Math_Atan2S(-posDifference.x, -posDifference.z);
|
||||
if (xzDist > 3.0f) {
|
||||
Math_SmoothStepToF(&player->unk_B80, 3.0f, 0.5f, xzDist, 0.0f);
|
||||
Math_SmoothStepToF(&player->pushedSpeed, 3.0f, 0.5f, xzDist, 0.0f);
|
||||
} else {
|
||||
player->unk_B80 = 0.0f;
|
||||
player->pushedSpeed = 0.0f;
|
||||
Math_SmoothStepToF(&player->actor.world.pos.x, this->actor.world.pos.x, 0.5f, 3.0f, 0.0f);
|
||||
Math_SmoothStepToF(&player->actor.world.pos.z, this->actor.world.pos.z, 0.5f, 3.0f, 0.0f);
|
||||
}
|
||||
|
||||
@@ -589,13 +589,13 @@ s32 func_80A3F384(EnTest3* this, PlayState* play) {
|
||||
EnDoor* door = (EnDoor*)func_80A3F2BC(play, this, ACTOR_EN_DOOR, ACTORCAT_DOOR, 55.0f, 20.0f);
|
||||
Vec3f offset;
|
||||
|
||||
if ((door != NULL) && (door->unk_1A1 == 0) &&
|
||||
((player->doorType == 0) || (&door->dyna.actor != player->doorActor)) &&
|
||||
Actor_ActorAIsFacingActorB(&this->player.actor, &door->dyna.actor, 0x3000)) {
|
||||
Actor_OffsetOfPointInActorCoords(&door->dyna.actor, &offset, &this->player.actor.world.pos);
|
||||
this->player.doorType = 1;
|
||||
if ((door != NULL) && !door->knobDoor.playOpenAnim &&
|
||||
((player->doorType == PLAYER_DOORTYPE_NONE) || (&door->knobDoor.dyna.actor != player->doorActor)) &&
|
||||
Actor_ActorAIsFacingActorB(&this->player.actor, &door->knobDoor.dyna.actor, 0x3000)) {
|
||||
Actor_OffsetOfPointInActorCoords(&door->knobDoor.dyna.actor, &offset, &this->player.actor.world.pos);
|
||||
this->player.doorType = PLAYER_DOORTYPE_HANDLE;
|
||||
this->player.doorDirection = (offset.z >= 0.0f) ? 1.0f : -1.0f;
|
||||
this->player.doorActor = &door->dyna.actor;
|
||||
this->player.doorActor = &door->knobDoor.dyna.actor;
|
||||
this->player.csId = CS_ID_NONE;
|
||||
return true;
|
||||
}
|
||||
@@ -1103,7 +1103,7 @@ s32 EnTest3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
pos->z *= this->player.ageProperties->unk_08;
|
||||
}
|
||||
if (!(this->player.skelAnime.moveFlags & ANIM_FLAG_4) ||
|
||||
(this->player.skelAnime.moveFlags & ANIM_FLAG_UPDATEY)) {
|
||||
(this->player.skelAnime.moveFlags & ANIM_FLAG_UPDATE_Y)) {
|
||||
pos->y *= this->player.ageProperties->unk_08;
|
||||
}
|
||||
pos->y -= this->player.unk_AB8;
|
||||
@@ -1176,8 +1176,8 @@ void EnTest3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList1, Gfx** dL
|
||||
leftHandActor->world.rot.y = this->player.actor.shape.rot.y + this->player.leftHandWorld.rot.y;
|
||||
leftHandActor->shape.rot.y = leftHandActor->world.rot.y;
|
||||
} else {
|
||||
Matrix_Get(&this->player.mf_CC4);
|
||||
Matrix_MtxFToYXZRot(&this->player.mf_CC4, &this->player.leftHandWorld.rot, false);
|
||||
Matrix_Get(&this->player.leftHandMf);
|
||||
Matrix_MtxFToYXZRot(&this->player.leftHandMf, &this->player.leftHandWorld.rot, false);
|
||||
func_80126B8C(play, &this->player);
|
||||
}
|
||||
|
||||
|
||||
@@ -471,7 +471,7 @@ s32 func_80AECE60(EnTk* this, PlayState* play) {
|
||||
if ((door != NULL) && (this->unk_2CA & 0x400)) {
|
||||
Vec3f sp5C;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp5C, &door->dyna.actor.world.pos);
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp5C, &door->knobDoor.dyna.actor.world.pos);
|
||||
door->unk_1A7 = 2;
|
||||
if (sp5C.z < -20.0f) {
|
||||
this->unk_2CA &= ~0x400;
|
||||
|
||||
@@ -214,7 +214,7 @@ void func_80BA383C(EnToto* this, PlayState* play) {
|
||||
}
|
||||
Animation_PlayOnce(&this->skelAnime, D_80BA5078[this->unk2B4]);
|
||||
}
|
||||
func_800BBB74(this->unk260, 0x14, 0x50, 3);
|
||||
func_800BBB74(&this->blinkInfo, 20, 80, 3);
|
||||
}
|
||||
|
||||
void func_80BA3930(EnToto* this, PlayState* play) {
|
||||
@@ -316,7 +316,7 @@ void func_80BA3D38(EnToto* this, PlayState* play) {
|
||||
this->text = ENTOTO_WEEK_EVENT_FLAGS ? D_80BA50BC : D_80BA5088;
|
||||
func_80BA4C0C(this, play);
|
||||
play->actorCtx.flags |= ACTORCTX_FLAG_5;
|
||||
this->unk260[0] = 0;
|
||||
this->blinkInfo.eyeTexIndex = 0;
|
||||
}
|
||||
|
||||
void func_80BA3DBC(EnToto* this, PlayState* play) {
|
||||
@@ -586,6 +586,7 @@ s32 func_80BA47E0(EnToto* this, PlayState* play) {
|
||||
for (i = 0; i < ARRAY_COUNT(D_80BA50DC); i++) {
|
||||
if (gSaveContext.save.playerForm != (i + 1) && (D_80BA5128[i] & this->unk2B3)) {
|
||||
Math_Vec3s_ToVec3f(&spawnPos, &D_80BA50DC[i].unk6);
|
||||
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_PLAYER, spawnPos.x, spawnPos.y, spawnPos.z, i + 2, 0, 0,
|
||||
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_F) | 0xFFFFF000);
|
||||
}
|
||||
@@ -728,7 +729,7 @@ void EnToto_Draw(Actor* thisx, PlayState* play) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
func_8012C28C(play->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sp4C[this->unk260[0]]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sp4C[this->blinkInfo.eyeTexIndex]));
|
||||
Scene_SetRenderModeXlu(play, 0, 1);
|
||||
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL,
|
||||
NULL, &this->actor);
|
||||
|
||||
@@ -26,7 +26,7 @@ typedef struct EnToto {
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ Vec3s jointTable[18];
|
||||
/* 0x1F4 */ Vec3s morphTable[18];
|
||||
/* 0x260 */ s16 unk260[2];
|
||||
/* 0x260 */ BlinkInfo blinkInfo;
|
||||
/* 0x264 */ ColliderCylinder collider;
|
||||
/* 0x2B0 */ u8 actionFuncIndex;
|
||||
/* 0x2B1 */ u8 unk2B1;
|
||||
|
||||
@@ -391,8 +391,9 @@ void func_808CCCF0(EnVm* this, PlayState* play) {
|
||||
|
||||
this->unk_214--;
|
||||
if (this->unk_214 == 1) {
|
||||
EnBom* bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0x6FF, 0);
|
||||
EnBom* bomb =
|
||||
(EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, BOMB_EXPLOSIVE_TYPE_BOMB, 0, 0x6FF, BOMB_TYPE_BODY);
|
||||
|
||||
if (bomb != NULL) {
|
||||
bomb->timer = 0;
|
||||
|
||||
@@ -616,7 +616,8 @@ void func_80991280(EnWf* this, PlayState* play) {
|
||||
|
||||
if (!func_8099408C(play, this) && !func_80990948(play, this, 0)) {
|
||||
phi_v1 = ABS_ALT(BINANG_SUB(player->actor.shape.rot.y, this->actor.shape.rot.y));
|
||||
if ((this->actor.xzDistToPlayer < 80.0f) && (player->meleeWeaponState != 0) && (phi_v1 >= 0x1F40)) {
|
||||
if ((this->actor.xzDistToPlayer < 80.0f) && (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
|
||||
(phi_v1 >= 0x1F40)) {
|
||||
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
func_80991948(this);
|
||||
@@ -666,7 +667,8 @@ void func_8099149C(EnWf* this, PlayState* play) {
|
||||
|
||||
sp28 = ABS_ALT(BINANG_SUB(player->actor.shape.rot.y, this->actor.shape.rot.y));
|
||||
|
||||
if ((this->actor.xzDistToPlayer < (150.0f + sp2C)) && (player->meleeWeaponState != 0) && (sp28 >= 0x1F40)) {
|
||||
if ((this->actor.xzDistToPlayer < (150.0f + sp2C)) &&
|
||||
(player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) && (sp28 >= 0x1F40)) {
|
||||
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
if (Rand_ZeroOne() > 0.7f) {
|
||||
|
||||
@@ -184,8 +184,8 @@ void func_80B9C5E8(ObjHunsui* this, PlayState* play) {
|
||||
Math_ApproachF(&this->unk_1A0, 3.0f, 1.0f, 1.0f);
|
||||
Math_ApproachF(&this->unk_19C, this->unk_1A0, 1.0f, 0.1f);
|
||||
}
|
||||
player->unk_B84 = this->unk_1A4;
|
||||
player->unk_B80 = this->unk_19C;
|
||||
player->pushedYaw = this->unk_1A4;
|
||||
player->pushedSpeed = this->unk_19C;
|
||||
}
|
||||
} else {
|
||||
if (this->unk_172 & 8) {
|
||||
|
||||
+20188
-1287
File diff suppressed because it is too large
Load Diff
@@ -58,7 +58,7 @@ u32 EffectSsGSplash_Init(PlayState* play, u32 index, EffectSs* this, void* initP
|
||||
this->rType = initParams->type;
|
||||
} else {
|
||||
switch (initParams->type) {
|
||||
case 0:
|
||||
case EFFSSGSPLASH_TYPE_0:
|
||||
this->rgPrimColorR = 255;
|
||||
this->rgPrimColorG = 255;
|
||||
this->rgPrimColorB = 255;
|
||||
@@ -67,9 +67,9 @@ u32 EffectSsGSplash_Init(PlayState* play, u32 index, EffectSs* this, void* initP
|
||||
this->rgEnvColorG = 255;
|
||||
this->rgEnvColorB = 255;
|
||||
this->rgEnvColorA = 200;
|
||||
this->rType = 0;
|
||||
this->rType = EFFSSGSPLASH_TYPE_0;
|
||||
break;
|
||||
case 1:
|
||||
case EFFSSGSPLASH_TYPE_1:
|
||||
this->rgPrimColorR = 255;
|
||||
this->rgPrimColorG = 255;
|
||||
this->rgPrimColorB = 255;
|
||||
@@ -78,9 +78,9 @@ u32 EffectSsGSplash_Init(PlayState* play, u32 index, EffectSs* this, void* initP
|
||||
this->rgEnvColorG = 255;
|
||||
this->rgEnvColorB = 255;
|
||||
this->rgEnvColorA = 255;
|
||||
this->rType = 1;
|
||||
this->rType = EFFSSGSPLASH_TYPE_1;
|
||||
break;
|
||||
case 2:
|
||||
case EFFSSGSPLASH_TYPE_2:
|
||||
this->rgPrimColorR = 255;
|
||||
this->rgPrimColorG = 255;
|
||||
this->rgPrimColorB = 255;
|
||||
@@ -89,7 +89,7 @@ u32 EffectSsGSplash_Init(PlayState* play, u32 index, EffectSs* this, void* initP
|
||||
this->rgEnvColorG = 255;
|
||||
this->rgEnvColorB = 255;
|
||||
this->rgEnvColorA = 200;
|
||||
this->rType = 2;
|
||||
this->rType = EFFSSGSPLASH_TYPE_2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ void EffectSsGSplash_Draw(PlayState* play, u32 index, EffectSs* this) {
|
||||
s16 texIndex;
|
||||
|
||||
switch (this->rType) {
|
||||
case 0:
|
||||
case EFFSSGSPLASH_TYPE_0:
|
||||
texIndex = this->rgTexIndex / 100;
|
||||
if (texIndex > 7) {
|
||||
texIndex = 7;
|
||||
@@ -108,7 +108,7 @@ void EffectSsGSplash_Draw(PlayState* play, u32 index, EffectSs* this) {
|
||||
EffectSs_DrawGEffect(play, this, waterSplashTextures[texIndex]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case EFFSSGSPLASH_TYPE_1:
|
||||
texIndex = this->rgTexIndex / 100;
|
||||
if (texIndex > 7) {
|
||||
texIndex = 7;
|
||||
@@ -116,7 +116,7 @@ void EffectSsGSplash_Draw(PlayState* play, u32 index, EffectSs* this) {
|
||||
EffectSs_DrawGEffect(play, this, waterSplashTextures[texIndex]);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case EFFSSGSPLASH_TYPE_2:
|
||||
texIndex = this->rgTexIndex / 100;
|
||||
if (texIndex > 7) {
|
||||
texIndex = 7;
|
||||
@@ -129,7 +129,7 @@ void EffectSsGSplash_Draw(PlayState* play, u32 index, EffectSs* this) {
|
||||
void EffectSsGSplash_Update(PlayState* play, u32 index, EffectSs* this) {
|
||||
Vec3f newSplashPos;
|
||||
|
||||
if ((this->rType == 1) && (this->life == 5)) {
|
||||
if ((this->rType == EFFSSGSPLASH_TYPE_1) && (this->life == 5)) {
|
||||
newSplashPos = this->pos;
|
||||
newSplashPos.y += ((this->rgScale * 20) * 0.002f);
|
||||
EffectSsGSplash_Spawn(play, &newSplashPos, 0, 0, 2, this->rgScale / 2);
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
typedef enum EffSsGSplashType {
|
||||
/* 0 */ EFFSSGSPLASH_TYPE_0,
|
||||
/* 1 */ EFFSSGSPLASH_TYPE_1,
|
||||
/* 2 */ EFFSSGSPLASH_TYPE_2
|
||||
} EffSsGSplashType;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3f pos;
|
||||
/* 0x0C */ u8 type;
|
||||
|
||||
Reference in New Issue
Block a user