Bottle Params (#1328)

* bottle param docs

* none to any

* reorder

* macro use

* PR Review

* brackets
This commit is contained in:
engineer124
2023-08-02 11:27:03 +10:00
committed by GitHub
parent fa30dea28d
commit 253209d722
32 changed files with 437 additions and 315 deletions
+4 -2
View File
@@ -4,6 +4,7 @@
#include "z64rumble.h"
#include "z64shrink_window.h"
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
void CutsceneHandler_DoNothing(PlayState* play, CutsceneContext* csCtx);
void CutsceneHandler_StartManual(PlayState* play, CutsceneContext* csCtx);
@@ -816,8 +817,9 @@ void CutsceneCmd_GiveTatlToPlayer(PlayState* play, CutsceneContext* csCtx, CsCmd
if (player->tatlActor != NULL) {
return;
}
player->tatlActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, player->actor.world.pos.x,
player->actor.world.pos.y, player->actor.world.pos.z, 0, 0, 0, 0);
player->tatlActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, player->actor.world.pos.x, player->actor.world.pos.y,
player->actor.world.pos.z, 0, 0, 0, FAIRY_PARAMS(FAIRY_TYPE_0, false, 0));
}
}
}
+4 -3
View File
@@ -1,6 +1,7 @@
#include "global.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_gi_hearts/object_gi_hearts.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "overlays/actors/ovl_En_Elforg/z_en_elforg.h"
#define FLAGS 0x00000000
@@ -929,7 +930,7 @@ Actor* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, u32 params) {
newParamFF = params & 0xFF;
if (newParamFF == ITEM00_FLEXIBLE) {
spawnedActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f,
spawnPos->z, 0, 0, 0, ((((param7F00 >> 8) & 0x7F) << 9) & 0xFE00) | 0x102);
spawnPos->z, 0, 0, 0, FAIRY_PARAMS(FAIRY_TYPE_2, true, param7F00 >> 8));
if (!Flags_GetCollectible(play, (param7F00 >> 8) & 0x7F)) {
SoundSource_PlaySfxAtFixedWorldPos(play, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY);
}
@@ -990,7 +991,7 @@ Actor* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s32 params) {
if ((((params & 0xFF) == ITEM00_FLEXIBLE) || ((params & 0xFF) == ITEM00_BIG_FAIRY)) && (param10000 == 0)) {
if ((params & 0xFF) == ITEM00_FLEXIBLE) {
spawnedActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f,
spawnPos->z, 0, 0, 0, ((((param7F00 >> 8) & 0x7F) << 9) & 0xFE00) | 0x102);
spawnPos->z, 0, 0, 0, FAIRY_PARAMS(FAIRY_TYPE_2, true, param7F00 >> 8));
} else {
spawnedActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELFORG, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0, 0,
@@ -1373,7 +1374,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP
if (dropId == ITEM00_FLEXIBLE) {
if (gSaveContext.save.saveInfo.playerData.health <= 0x10) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0,
2);
FAIRY_PARAMS(FAIRY_TYPE_2, false, 0));
SoundSource_PlaySfxAtFixedWorldPos(play, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY);
return;
}
@@ -12,6 +12,7 @@
*/
#include "z_bg_sinkai_kabe.h"
#include "overlays/actors/ovl_En_Ot/z_en_ot.h"
#include "objects/object_sinkai_kabe/object_sinkai_kabe.h"
#define FLAGS (ACTOR_FLAG_10)
@@ -99,8 +100,8 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) {
pos.z += (Math_CosS(this->dyna.actor.world.rot.y + 0x8000) * 500.0f);
if (shouldSpawnSeahorse) {
Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_OT, pos.x, pos.y, pos.z, 0,
this->dyna.actor.shape.rot.y, 0, 0x4000, this->dyna.actor.csId,
this->dyna.actor.halfDaysBits, NULL);
this->dyna.actor.shape.rot.y, 0, SEAHORSE_PARAMS(SEAHORSE_TYPE_1, 0, 0),
this->dyna.actor.csId, this->dyna.actor.halfDaysBits, NULL);
}
Actor_Kill(&this->dyna.actor);
@@ -5,6 +5,7 @@
*/
#include "z_en_butte.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "objects/gameplay_keep/gameplay_keep.h"
@@ -164,8 +165,8 @@ void EnButte_Init(Actor* thisx, PlayState* play) {
s32 pad;
EnButte* this = THIS;
if (ENBUTTE_GET(&this->actor) == ENBUTTE_MINUS1) {
this->actor.params = ENBUTTE_0;
if (BUTTERFLY_GET(&this->actor) == BUTTERFLY_MINUS1) {
this->actor.params = BUTTERFLY_0;
}
this->actor.world.rot.y = Rand_Next();
@@ -173,7 +174,7 @@ void EnButte_Init(Actor* thisx, PlayState* play) {
this->actor.shape.rot.y = this->actor.world.rot.y;
Actor_ProcessInitChain(&this->actor, sInitChain);
if ((ENBUTTE_GET_1(&this->actor) & 0xFF) == ENBUTTE_1) {
if ((BUTTERFLY_GET_1(&this->actor) & 0xFF) == BUTTERFLY_1) {
this->actor.uncullZoneScale = 200.0f;
}
@@ -286,7 +287,7 @@ void func_8091C794(EnButte* this, PlayState* play) {
func_8091C0A0(this, &D_8091D324[this->unk_24E]);
}
if ((ENBUTTE_GET_1(&this->actor) == ENBUTTE_1) && (player->heldItemAction == PLAYER_IA_DEKU_STICK) &&
if ((BUTTERFLY_GET_1(&this->actor) == BUTTERFLY_1) && (player->heldItemAction == PLAYER_IA_DEKU_STICK) &&
(this->unk_252 <= 0) &&
((Math3D_XZDistanceSquared(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z) < SQ(120.0f)) ||
@@ -381,7 +382,7 @@ void func_8091CFB4(EnButte* this, PlayState* play) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 60, NA_SE_EV_BUTTERFRY_TO_FAIRY);
} else if (this->unk_24C == 4) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.focus.pos.x, this->actor.focus.pos.y,
this->actor.focus.pos.z, 0, this->actor.shape.rot.y, 0, 2);
this->actor.focus.pos.z, 0, this->actor.shape.rot.y, 0, FAIRY_PARAMS(FAIRY_TYPE_2, false, 0));
this->unk_250 = 0;
} else if (this->unk_24C <= 0) {
func_8091D070(this);
@@ -415,7 +416,7 @@ void EnButte_Update(Actor* thisx, PlayState* play) {
this->unk_256 += 0x1000;
this->unk_258 += 0x600;
if (ENBUTTE_GET_1(&this->actor) == ENBUTTE_1) {
if (BUTTERFLY_GET_1(&this->actor) == BUTTERFLY_1) {
if (GET_PLAYER(play)->meleeWeaponState == PLAYER_MELEE_WEAPON_STATE_0) {
if (this->unk_252 > 0) {
this->unk_252--;
@@ -450,7 +451,7 @@ void EnButte_Draw(Actor* thisx, PlayState* play) {
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL);
}
if ((ENBUTTE_GET_1(&this->actor) == ENBUTTE_1) && (this->actionFunc == func_8091CFB4)) {
if ((BUTTERFLY_GET_1(&this->actor) == BUTTERFLY_1) && (this->actionFunc == func_8091CFB4)) {
func_8091C178(this, play);
}
}
@@ -8,12 +8,14 @@ struct EnButte;
typedef void (*EnButteActionFunc)(struct EnButte*, PlayState*);
#define ENBUTTE_GET(thisx) ((thisx)->params)
#define ENBUTTE_GET_1(thisx) ((thisx)->params & 1)
#define BUTTERFLY_GET(thisx) ((thisx)->params)
#define BUTTERFLY_GET_1(thisx) ((thisx)->params & 1)
#define ENBUTTE_MINUS1 -1
#define ENBUTTE_0 0
#define ENBUTTE_1 1
#define BUTTERFLY_MINUS1 -1
#define BUTTERFLY_0 0
#define BUTTERFLY_1 1
#define BUTTERFLY_PARAMS(param) (param)
typedef struct EnButte {
/* 0x000 */ Actor actor;
+64 -60
View File
@@ -25,11 +25,11 @@ void func_80B3D3F8(EnDnp* this, PlayState* play);
void func_80B3D558(EnDnp* this, PlayState* play);
typedef enum {
/* 0 */ EN_DNP_EYE_OPEN,
/* 1 */ EN_DNP_EYE_HALF,
/* 2 */ EN_DNP_EYE_CLOSED,
/* 3 */ EN_DNP_EYE_ANGRY,
/* 4 */ EN_DNP_EYE_MAX
/* 0 */ DEKU_PRINCESS_EYE_OPEN,
/* 1 */ DEKU_PRINCESS_EYE_HALF,
/* 2 */ DEKU_PRINCESS_EYE_CLOSED,
/* 3 */ DEKU_PRINCESS_EYE_ANGRY,
/* 4 */ DEKU_PRINCESS_EYE_MAX
} EnDnpEyeIndex;
ActorInit En_Dnp_InitVars = {
@@ -67,33 +67,33 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
typedef enum {
/* -1 */ EN_DNP_ANIM_NONE = -1,
/* 0 */ EN_DNP_ANIM_JUMP_KICK, // Can be triggered by a cutscene, but no cutscene in the final game does so
/* 1 */ EN_DNP_ANIM_HURRY,
/* 2 */ EN_DNP_ANIM_CUTSCENE_HURRY,
/* 3 */ EN_DNP_ANIM_HURRY_END,
/* 4 */ EN_DNP_ANIM_SCOLD, // Unused
/* 5 */ EN_DNP_ANIM_LAUGH_START,
/* 6 */ EN_DNP_ANIM_LAUGH_LOOP,
/* 7 */ EN_DNP_ANIM_TURN_AROUND,
/* 8 */ EN_DNP_ANIM_BOW,
/* 9 */ EN_DNP_ANIM_RUN, // Unused
/* 10 */ EN_DNP_ANIM_THINK_START,
/* 11 */ EN_DNP_ANIM_THINK_LOOP,
/* 12 */ EN_DNP_ANIM_ARMS_TOGETHER_START,
/* 13 */ EN_DNP_ANIM_ARMS_TOGETHER_LOOP,
/* 14 */ EN_DNP_ANIM_GREETING,
/* 15 */ EN_DNP_ANIM_IDLE,
/* 16 */ EN_DNP_ANIM_CUTSCENE_IDLE,
/* 17 */ EN_DNP_ANIM_UNUSED_WALK, // Unused
/* 18 */ EN_DNP_ANIM_WALK, // Can be triggered by a cutscene, but no cutscene in the final game does so
/* 19 */ EN_DNP_ANIM_ANGRY_START,
/* 20 */ EN_DNP_ANIM_ANGRY_LOOP,
/* 21 */ EN_DNP_ANIM_JUMP,
/* 22 */ EN_DNP_ANIM_BOUNCE_START,
/* 23 */ EN_DNP_ANIM_BOUNCE_LOOP,
/* 24 */ EN_DNP_ANIM_GLARE_START,
/* 25 */ EN_DNP_ANIM_GLARE_LOOP
/* -1 */ DEKU_PRINCESS_ANIM_NONE = -1,
/* 0 */ DEKU_PRINCESS_ANIM_JUMP_KICK, // Can be triggered by a cutscene, but no cutscene in the final game does so
/* 1 */ DEKU_PRINCESS_ANIM_HURRY,
/* 2 */ DEKU_PRINCESS_ANIM_CUTSCENE_HURRY,
/* 3 */ DEKU_PRINCESS_ANIM_HURRY_END,
/* 4 */ DEKU_PRINCESS_ANIM_SCOLD, // Unused
/* 5 */ DEKU_PRINCESS_ANIM_LAUGH_START,
/* 6 */ DEKU_PRINCESS_ANIM_LAUGH_LOOP,
/* 7 */ DEKU_PRINCESS_ANIM_TURN_AROUND,
/* 8 */ DEKU_PRINCESS_ANIM_BOW,
/* 9 */ DEKU_PRINCESS_ANIM_RUN, // Unused
/* 10 */ DEKU_PRINCESS_ANIM_THINK_START,
/* 11 */ DEKU_PRINCESS_ANIM_THINK_LOOP,
/* 12 */ DEKU_PRINCESS_ANIM_ARMS_TOGETHER_START,
/* 13 */ DEKU_PRINCESS_ANIM_ARMS_TOGETHER_LOOP,
/* 14 */ DEKU_PRINCESS_ANIM_GREETING,
/* 15 */ DEKU_PRINCESS_ANIM_IDLE,
/* 16 */ DEKU_PRINCESS_ANIM_CUTSCENE_IDLE,
/* 17 */ DEKU_PRINCESS_ANIM_UNUSED_WALK, // Unused
/* 18 */ DEKU_PRINCESS_ANIM_WALK, // Can be triggered by a cutscene, but no cutscene in the final game does so
/* 19 */ DEKU_PRINCESS_ANIM_ANGRY_START,
/* 20 */ DEKU_PRINCESS_ANIM_ANGRY_LOOP,
/* 21 */ DEKU_PRINCESS_ANIM_JUMP,
/* 22 */ DEKU_PRINCESS_ANIM_BOUNCE_START,
/* 23 */ DEKU_PRINCESS_ANIM_BOUNCE_LOOP,
/* 24 */ DEKU_PRINCESS_ANIM_GLARE_START,
/* 25 */ DEKU_PRINCESS_ANIM_GLARE_LOOP
} EnDnpAnimation;
static AnimationInfoS sAnimationInfo[] = {
@@ -130,39 +130,40 @@ static s32 D_80B3DE58[] = {
};
s32 func_80B3CA20(EnDnp* this) {
if ((this->animIndex == EN_DNP_ANIM_CUTSCENE_HURRY) || (this->animIndex == EN_DNP_ANIM_RUN)) {
if ((this->animIndex == DEKU_PRINCESS_ANIM_CUTSCENE_HURRY) || (this->animIndex == DEKU_PRINCESS_ANIM_RUN)) {
if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 5.0f) ||
Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_TURN);
}
} else if ((this->animIndex == EN_DNP_ANIM_GLARE_START) || (this->animIndex == EN_DNP_ANIM_TURN_AROUND)) {
} else if ((this->animIndex == DEKU_PRINCESS_ANIM_GLARE_START) ||
(this->animIndex == DEKU_PRINCESS_ANIM_TURN_AROUND)) {
if (Animation_OnFrame(&this->skelAnime, 1.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_TURN);
}
} else if (this->animIndex == EN_DNP_ANIM_GREETING) {
} else if (this->animIndex == DEKU_PRINCESS_ANIM_GREETING) {
if (Animation_OnFrame(&this->skelAnime, 7.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_GREET);
}
if (Animation_OnFrame(&this->skelAnime, 22.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_GREET2);
}
} else if (this->animIndex == EN_DNP_ANIM_BOW) {
} else if (this->animIndex == DEKU_PRINCESS_ANIM_BOW) {
if (Animation_OnFrame(&this->skelAnime, 9.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_GREET);
}
if (Animation_OnFrame(&this->skelAnime, 18.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_GREET2);
}
} else if ((this->animIndex == EN_DNP_ANIM_UNUSED_WALK) && (this->animIndex == EN_DNP_ANIM_WALK)) {
} else if ((this->animIndex == DEKU_PRINCESS_ANIM_UNUSED_WALK) && (this->animIndex == DEKU_PRINCESS_ANIM_WALK)) {
//! @bug: Impossible to reach, && should be an ||
if (Animation_OnFrame(&this->skelAnime, 7.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_WALK);
}
} else if (this->animIndex == EN_DNP_ANIM_JUMP) {
} else if (this->animIndex == DEKU_PRINCESS_ANIM_JUMP) {
if (Animation_OnFrame(&this->skelAnime, 17.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_WALK);
}
} else if (this->animIndex == EN_DNP_ANIM_BOUNCE_LOOP) {
} else if (this->animIndex == DEKU_PRINCESS_ANIM_BOUNCE_LOOP) {
if (Animation_OnFrame(&this->skelAnime, 3.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_WALK);
}
@@ -194,9 +195,9 @@ void func_80B3CC80(EnDnp* this, PlayState* play) {
void func_80B3CD1C(EnDnp* this) {
if ((this->unk_322 & 0x80) && (DECR(this->blinkTimer) == 0)) {
this->eyeIndex++;
if (this->eyeIndex >= EN_DNP_EYE_MAX) {
if (this->eyeIndex >= DEKU_PRINCESS_EYE_MAX) {
this->blinkTimer = Rand_S16Offset(30, 30);
this->eyeIndex = EN_DNP_EYE_OPEN;
this->eyeIndex = DEKU_PRINCESS_EYE_OPEN;
}
}
}
@@ -287,11 +288,11 @@ s32 func_80B3D044(EnDnp* this, PlayState* play) {
void func_80B3D11C(EnDnp* this, PlayState* play) {
static s32 sCsAnimations[] = {
EN_DNP_ANIM_JUMP_KICK, EN_DNP_ANIM_CUTSCENE_IDLE, EN_DNP_ANIM_GREETING,
EN_DNP_ANIM_THINK_START, EN_DNP_ANIM_WALK, EN_DNP_ANIM_ARMS_TOGETHER_START,
EN_DNP_ANIM_LAUGH_START, EN_DNP_ANIM_TURN_AROUND, EN_DNP_ANIM_CUTSCENE_HURRY,
EN_DNP_ANIM_ANGRY_START, EN_DNP_ANIM_JUMP, EN_DNP_ANIM_BOUNCE_START,
EN_DNP_ANIM_GLARE_START, EN_DNP_ANIM_BOW,
DEKU_PRINCESS_ANIM_JUMP_KICK, DEKU_PRINCESS_ANIM_CUTSCENE_IDLE, DEKU_PRINCESS_ANIM_GREETING,
DEKU_PRINCESS_ANIM_THINK_START, DEKU_PRINCESS_ANIM_WALK, DEKU_PRINCESS_ANIM_ARMS_TOGETHER_START,
DEKU_PRINCESS_ANIM_LAUGH_START, DEKU_PRINCESS_ANIM_TURN_AROUND, DEKU_PRINCESS_ANIM_CUTSCENE_HURRY,
DEKU_PRINCESS_ANIM_ANGRY_START, DEKU_PRINCESS_ANIM_JUMP, DEKU_PRINCESS_ANIM_BOUNCE_START,
DEKU_PRINCESS_ANIM_GLARE_START, DEKU_PRINCESS_ANIM_BOW,
};
s32 cueChannel;
s32 cueId;
@@ -306,27 +307,30 @@ void func_80B3D11C(EnDnp* this, PlayState* play) {
cueId = play->csCtx.actorCues[cueChannel]->id;
if (this->cueId != (u8)cueId) {
EnDnp_ChangeAnim(this, sCsAnimations[cueId]);
if (this->animIndex == EN_DNP_ANIM_CUTSCENE_IDLE) {
if (this->animIndex == DEKU_PRINCESS_ANIM_CUTSCENE_IDLE) {
this->unk_322 |= 8;
} else {
this->unk_322 &= ~8;
}
if (this->animIndex == EN_DNP_ANIM_ANGRY_START) {
if (this->animIndex == DEKU_PRINCESS_ANIM_ANGRY_START) {
Actor_PlaySfx(&this->actor, NA_SE_VO_DHVO04);
}
if (this->animIndex == EN_DNP_ANIM_GLARE_START) {
if (this->animIndex == DEKU_PRINCESS_ANIM_GLARE_START) {
this->unk_322 &= ~0x80;
this->eyeIndex = EN_DNP_EYE_ANGRY;
this->eyeIndex = DEKU_PRINCESS_EYE_ANGRY;
this->blinkTimer = 0;
}
}
this->cueId = cueId;
if (((this->animIndex == EN_DNP_ANIM_THINK_START) || (this->animIndex == EN_DNP_ANIM_ARMS_TOGETHER_START) ||
(this->animIndex == EN_DNP_ANIM_LAUGH_START) || (this->animIndex == EN_DNP_ANIM_ANGRY_START) ||
(this->animIndex == EN_DNP_ANIM_BOUNCE_START) || (this->animIndex == EN_DNP_ANIM_GLARE_START)) &&
if (((this->animIndex == DEKU_PRINCESS_ANIM_THINK_START) ||
(this->animIndex == DEKU_PRINCESS_ANIM_ARMS_TOGETHER_START) ||
(this->animIndex == DEKU_PRINCESS_ANIM_LAUGH_START) ||
(this->animIndex == DEKU_PRINCESS_ANIM_ANGRY_START) ||
(this->animIndex == DEKU_PRINCESS_ANIM_BOUNCE_START) ||
(this->animIndex == DEKU_PRINCESS_ANIM_GLARE_START)) &&
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
EnDnp_ChangeAnim(this, this->animIndex + 1);
}
@@ -401,32 +405,32 @@ void EnDnp_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 16.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gDekuPrincessSkel, NULL, this->jointTable, this->morphTable,
DEKU_PRINCESS_LIMB_MAX);
this->animIndex = EN_DNP_ANIM_NONE;
EnDnp_ChangeAnim(this, EN_DNP_ANIM_IDLE);
this->animIndex = DEKU_PRINCESS_ANIM_NONE;
EnDnp_ChangeAnim(this, DEKU_PRINCESS_ANIM_IDLE);
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
this->unk_322 = 0;
this->actor.targetMode = 0;
this->unk_322 |= (0x100 | 0x80 | 0x10);
this->actor.gravity = -1.0f;
if (EN_DNP_GET_TYPE(&this->actor) == EN_DNP_TYPE_RELEASED_FROM_BOTTLE) {
if (DEKU_PRINCESS_GET_TYPE(&this->actor) == DEKU_PRINCESS_TYPE_RELEASED_FROM_BOTTLE) {
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, 0.00085000007f);
Actor_SetScale(&this->actor, 0.85f * 0.001f);
SubS_SetOfferMode(&this->unk_322, SUBS_OFFER_MODE_NONE, SUBS_OFFER_MODE_MASK);
this->actor.shape.rot.x = 0;
this->actor.world.rot.x = this->actor.shape.rot.x;
this->actor.csId = 16;
this->actionFunc = func_80B3D47C;
} else if (((EN_DNP_GET_TYPE(&this->actor) == EN_DNP_TYPE_WOODFALL_TEMPLE) &&
} else if (((DEKU_PRINCESS_GET_TYPE(&this->actor) == DEKU_PRINCESS_TYPE_WOODFALL_TEMPLE) &&
!Inventory_HasItemInBottle(ITEM_DEKU_PRINCESS) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_23_20)) ||
((EN_DNP_GET_TYPE(&this->actor) == EN_DNP_TYPE_DEKU_KINGS_CHAMBER) &&
((DEKU_PRINCESS_GET_TYPE(&this->actor) == DEKU_PRINCESS_TYPE_DEKU_KINGS_CHAMBER) &&
CHECK_WEEKEVENTREG(WEEKEVENTREG_23_20))) {
Actor_SetScale(&this->actor, 0.0085f);
SubS_SetOfferMode(&this->unk_322, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK);
this->unk_322 |= 0x400;
if ((play->sceneId == SCENE_MITURIN) && CHECK_WEEKEVENTREG(WEEKEVENTREG_29_40)) {
this->unk_322 |= 0x20;
EnDnp_ChangeAnim(this, EN_DNP_ANIM_HURRY);
EnDnp_ChangeAnim(this, DEKU_PRINCESS_ANIM_HURRY);
}
this->actionFunc = func_80B3D2D4;
} else {
+6 -4
View File
@@ -8,12 +8,14 @@ struct EnDnp;
typedef void (*EnDnpActionFunc)(struct EnDnp*, PlayState*);
#define EN_DNP_GET_TYPE(thisx) ((thisx)->params & 7)
#define DEKU_PRINCESS_GET_TYPE(thisx) ((thisx)->params & 7)
#define DEKU_PRINCESS_PARAMS(type) ((type) & 7)
typedef enum {
/* 0 */ EN_DNP_TYPE_WOODFALL_TEMPLE,
/* 1 */ EN_DNP_TYPE_RELEASED_FROM_BOTTLE,
/* 2 */ EN_DNP_TYPE_DEKU_KINGS_CHAMBER
/* 0 */ DEKU_PRINCESS_TYPE_WOODFALL_TEMPLE,
/* 1 */ DEKU_PRINCESS_TYPE_RELEASED_FROM_BOTTLE,
/* 2 */ DEKU_PRINCESS_TYPE_DEKU_KINGS_CHAMBER
} EnDnpType;
typedef struct EnDnp {
@@ -5,6 +5,7 @@
*/
#include "z_en_dragon.h"
#include "overlays/actors/ovl_En_Ot/z_en_ot.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
@@ -682,7 +683,8 @@ void EnDragon_Dead(EnDragon* this, PlayState* play) {
seahorsePos.y += -100.0f + BREG(33);
seahorsePos.z += (Math_CosS((this->actor.parent->world.rot.y + 0x8000)) * (500.0f + BREG(38)));
if (Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_OT, seahorsePos.x, seahorsePos.y,
seahorsePos.z, 0, this->actor.shape.rot.y, 0, 0x4000, this->actor.csId,
seahorsePos.z, 0, this->actor.shape.rot.y, 0,
SEAHORSE_PARAMS(SEAHORSE_TYPE_1, 0, 0), this->actor.csId,
this->actor.halfDaysBits, NULL)) {
SET_WEEKEVENTREG(WEEKEVENTREG_13_01);
switch (this->pythonIndex) {
+24 -21
View File
@@ -298,7 +298,7 @@ void func_8088CC48(EnElf* this, PlayState* play) {
func_8088CBAC(this, play);
this->unk_25C = 0;
this->disappearTimer = 240;
if ((this->fairyFlags & 0x400) && Flags_GetCollectible(play, this->unk_260)) {
if ((this->fairyFlags & 0x400) && Flags_GetCollectible(play, this->collectibleFlag)) {
Actor_Kill(&this->actor);
}
}
@@ -320,7 +320,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) {
EnElf* this = THIS;
Player* player = GET_PLAYER(play);
s32 colorConfig;
s32 params;
s32 fairyType;
Actor_ProcessInitChain(thisx, sInitChain);
SkelAnime_Init(play, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140, this->jointTable,
@@ -340,15 +340,15 @@ void EnElf_Init(Actor* thisx, PlayState* play2) {
this->unk_240 = 0.0f;
colorConfig = 0;
this->unk_260 = ENELF_GET_FE00(&this->actor);
params = ENELF_GET_F(&this->actor);
if (thisx->params & 0x100) {
this->collectibleFlag = FAIRY_GET_COLLECTIBLE_FLAG(&this->actor);
fairyType = FAIRY_GET_TYPE(&this->actor);
if (FAIRY_GET_BOOL_PARAM(thisx)) {
this->fairyFlags |= 0x400;
}
this->actor.params = params;
switch (params) {
case 0:
this->actor.params = fairyType;
switch (fairyType) {
case FAIRY_TYPE_0:
thisx->room = -1;
EnElf_SetupAction(this, func_8088E850);
func_8088C51C(this, 0);
@@ -364,7 +364,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) {
this->unk_266 = QuestHint_GetTatlTextId(play);
break;
case 1:
case FAIRY_TYPE_1:
colorConfig = -1;
gSaveContext.jinxTimer = 0;
EnElf_SetupAction(this, func_8088E0F0);
@@ -376,7 +376,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) {
this->unk_250 = 0.0f;
break;
case 5:
case FAIRY_TYPE_5:
colorConfig = -1;
EnElf_SetupAction(this, func_8088E484);
this->unk_254 = 0.0f;
@@ -387,7 +387,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) {
this->unk_250 = 7.0f;
break;
case 7:
case FAIRY_TYPE_7:
this->fairyFlags |= 0x200;
thisx->shape.shadowDraw = ActorShadow_DrawWhiteCircle;
this->fairyFlags |= 0x100;
@@ -397,7 +397,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) {
func_8088CC48(this, play);
break;
case 2:
case FAIRY_TYPE_2:
this->fairyFlags |= 0x100;
colorConfig = -1;
this->fairyFlags |= 0x800;
@@ -406,7 +406,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) {
func_8088CC48(this, play);
break;
case 6:
case FAIRY_TYPE_6:
colorConfig = -1;
this->fairyFlags |= 0x800;
this->fairyFlags |= 0x2000;
@@ -414,25 +414,25 @@ void EnElf_Init(Actor* thisx, PlayState* play2) {
func_8088CC48(this, play);
break;
case 9:
case FAIRY_TYPE_9:
this->fairyFlags |= 0x1000;
case 10:
case FAIRY_TYPE_10:
colorConfig = -2;
func_8088CC48(this, play);
break;
case 8:
case FAIRY_TYPE_8:
Actor_Kill(thisx);
return;
case 3:
case FAIRY_TYPE_3:
colorConfig = Rand_ZeroFloat(11.99f) + 1.0f;
EnElf_SetupAction(this, func_8088E018);
func_8088C51C(this, 0);
break;
case 4:
case FAIRY_TYPE_4:
EnElf_SetupAction(this, func_8088E0E0);
func_8088C51C(this, 6);
this->fairyFlags |= 8;
@@ -441,10 +441,13 @@ void EnElf_Init(Actor* thisx, PlayState* play2) {
for (i = 0; i < 8; i++) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, thisx->world.pos.x, thisx->world.pos.y - 30.0f,
thisx->world.pos.z, 0, 0, 0, 6);
thisx->world.pos.z, 0, 0, 0, FAIRY_PARAMS(FAIRY_TYPE_6, false, 0));
}
}
break;
default:
break;
}
this->unk_23C = 3.0f;
@@ -659,7 +662,7 @@ void func_8088DD34(EnElf* this, PlayState* play) {
func_8088D9BC(this, play);
if (Actor_HasParent(&this->actor, play)) {
if (this->fairyFlags & 0x400) {
Flags_SetCollectible(play, this->unk_260);
Flags_SetCollectible(play, this->collectibleFlag);
}
Actor_Kill(&this->actor);
return;
@@ -689,7 +692,7 @@ void func_8088DD34(EnElf* this, PlayState* play) {
this->unk_246 = 0;
EnElf_SetupAction(this, func_8088E0F0);
if (this->fairyFlags & 0x400) {
Flags_SetCollectible(play, this->unk_260);
Flags_SetCollectible(play, this->collectibleFlag);
}
return;
}
+20 -14
View File
@@ -8,8 +8,25 @@ struct EnElf;
typedef void (*EnElfActionFunc)(struct EnElf*, PlayState*);
typedef void (*EnElfUnkFunc)(struct EnElf*, PlayState*);
#define ENELF_GET_F(thisx) ((thisx)->params & 0xF)
#define ENELF_GET_FE00(thisx) (((thisx)->params & 0xFE00) >> 9)
#define FAIRY_GET_TYPE(thisx) ((thisx)->params & 0xF)
#define FAIRY_GET_BOOL_PARAM(thisx) ((thisx)->params & 0x100)
#define FAIRY_GET_COLLECTIBLE_FLAG(thisx) (((thisx)->params & 0xFE00) >> 9)
#define FAIRY_PARAMS(type, boolParam, collectibleFlag) (((type) /* & 0xF */) | (((boolParam) & 0x1) << 8) | ((((collectibleFlag) & 0x7F) << 9) & 0xFE00))
typedef enum {
/* 0x0 */ FAIRY_TYPE_0,
/* 0x1 */ FAIRY_TYPE_1,
/* 0x2 */ FAIRY_TYPE_2,
/* 0x3 */ FAIRY_TYPE_3,
/* 0x4 */ FAIRY_TYPE_4,
/* 0x5 */ FAIRY_TYPE_5,
/* 0x6 */ FAIRY_TYPE_6,
/* 0x7 */ FAIRY_TYPE_7,
/* 0x8 */ FAIRY_TYPE_8,
/* 0x9 */ FAIRY_TYPE_9,
/* 0xA */ FAIRY_TYPE_10
} FairyType;
typedef struct EnElf {
/* 0x000 */ Actor actor;
@@ -39,7 +56,7 @@ typedef struct EnElf {
/* 0x25A */ u16 timer;
/* 0x25C */ s16 unk_25C;
/* 0x25E */ s16 disappearTimer;
/* 0x260 */ s16 unk_260;
/* 0x260 */ s16 collectibleFlag;
/* 0x262 */ u16 fairyFlags;
/* 0x264 */ u16 unk_264;
/* 0x266 */ u16 unk_266;
@@ -49,15 +66,4 @@ typedef struct EnElf {
/* 0x270 */ EnElfActionFunc actionFunc;
} EnElf; // size = 0x274
typedef enum {
/* 0 */ ENELF_TYPE_0,
/* 1 */ ENELF_TYPE_1,
/* 2 */ ENELF_TYPE_2,
/* 3 */ ENELF_TYPE_3,
/* 4 */ ENELF_TYPE_4,
/* 5 */ ENELF_TYPE_5,
/* 6 */ ENELF_TYPE_6,
/* 7 */ ENELF_TYPE_7
} FairyType;
#endif // Z_EN_ELF_H
@@ -14,6 +14,8 @@ typedef enum {
/* 2 */ ENFISH_2
} EnFishParam;
#define FISH_PARAMS(param) (param)
typedef struct EnFish {
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderJntSph collider;
+2 -1
View File
@@ -2062,7 +2062,8 @@ void EnGo_Frozen(EnGo* this, PlayState* play) {
Actor* actorCollidedWith = this->colliderCylinder.base.ac;
if ((this->actionFlags & ENGO_FLAG_HIT_BY_OTHER) &&
(((actorCollidedWith != NULL) && (actorCollidedWith->id == ACTOR_OBJ_AQUA) && AQUA_HOT(actorCollidedWith)) ||
(((actorCollidedWith != NULL) && (actorCollidedWith->id == ACTOR_OBJ_AQUA) &&
(AQUA_GET_TYPE(actorCollidedWith) != AQUA_TYPE_COLD)) ||
(this->actor.colChkInfo.damageEffect == ENGO_DMGEFF_FIRE))) {
this->actionFunc = EnGo_AwaitThaw;
}
+5 -2
View File
@@ -6,6 +6,7 @@
#include "z_en_gs.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "objects/object_gs/object_gs.h"
#include "objects/gameplay_keep/gameplay_keep.h"
@@ -282,7 +283,8 @@ void func_8099807C(EnGs* this, PlayState* play) {
case OCARINA_SONG_EPONAS:
if (!Flags_GetSwitch(play, this->unk_196)) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.world.pos.x,
this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, 2);
this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0,
FAIRY_PARAMS(FAIRY_TYPE_2, false, 0));
Actor_PlaySfx(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY);
Flags_SetSwitch(play, this->unk_196);
}
@@ -291,7 +293,8 @@ void func_8099807C(EnGs* this, PlayState* play) {
case OCARINA_SONG_STORMS:
if (!Flags_GetSwitch(play, this->unk_196)) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.world.pos.x,
this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, 7);
this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0,
FAIRY_PARAMS(FAIRY_TYPE_7, false, 0));
Actor_PlaySfx(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY);
Flags_SetSwitch(play, this->unk_196);
}
@@ -9,6 +9,8 @@ typedef void (*EnInsectActionFunc)(struct EnInsect*, PlayState*);
#define ENINSECT_GET_1(thisx) ((thisx)->params & 1)
#define ENINSECT_PARAMS(param) (param)
typedef struct EnInsect {
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderJntSph collider;
+4 -2
View File
@@ -10,6 +10,7 @@
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_ishi/object_ishi.h"
#include "overlays/actors/ovl_En_Insect/z_en_insect.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_800000)
@@ -353,8 +354,9 @@ void func_8095E204(EnIshi* this, PlayState* play) {
for (i = 0; i < 3; i++) {
if (Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_INSECT, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1,
this->actor.csId, this->actor.halfDaysBits, NULL) == NULL) {
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0,
ENINSECT_PARAMS(true), this->actor.csId, this->actor.halfDaysBits,
NULL) == NULL) {
break;
}
}
+6 -5
View File
@@ -9,6 +9,7 @@
#include "objects/object_kusa/object_kusa.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "overlays/actors/ovl_En_Insect/z_en_insect.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_800000)
@@ -251,8 +252,8 @@ void EnKusa_DropCollectible(EnKusa* this, PlayState* play) {
}
} else if (KUSA_GET_TYPE(&this->actor) == ENKUSA_TYPE_REGROWING_GRASS) {
Item_DropCollectible(play, &this->actor.world.pos, 3);
} else {
collectible = func_800A8150(KUSA_GET_PARAM_3F(&this->actor));
} else { // ENKUSA_TYPE_GRASS_2
collectible = func_800A8150(KUSA_GET_PARAM_FC(&this->actor));
if (collectible >= 0) {
collectableParams = KUSA_GET_COLLECTIBLE_ID(&this->actor);
Item_DropCollectible(play, &this->actor.world.pos, (collectableParams << 8) | collectible);
@@ -327,9 +328,9 @@ void EnKusa_SpawnBugs(EnKusa* this, PlayState* play) {
u32 numBugs;
for (numBugs = 0; numBugs < 3; numBugs++) {
Actor* bug = Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_INSECT, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1,
this->actor.csId, this->actor.halfDaysBits, 0);
Actor* bug = Actor_SpawnAsChildAndCutscene(
&play->actorCtx, play, ACTOR_EN_INSECT, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, ENINSECT_PARAMS(true), this->actor.csId, this->actor.halfDaysBits, 0);
if (bug == NULL) {
break;
+26 -9
View File
@@ -7,6 +7,19 @@ struct EnKusa;
typedef void (*EnKusaActionFunc)(struct EnKusa*, PlayState*);
#define KUSA_GET_TYPE(thisx)((thisx)->params & 0x3)
// `ENKUSA_TYPE_BUSH` and `ENKUSA_TYPE_GRASS`
#define KUSA_GET_RAND_COLLECTIBLE_ID(thisx) (((thisx)->params >> 8) & 0xF)
#define KUSA_GET_PARAM_0C(thisx) (((thisx)->params >> 12) & 1)
// `ENKUSA_TYPE_REGROWING_GRASS`, `ENKUSA_TYPE_BUSH` and `ENKUSA_TYPE_GRASS`
#define KUSA_SHOULD_SPAWN_BUGS(thisx) (((thisx)->params >> 4) & 1)
// `ENKUSA_TYPE_GRASS_2`
#define KUSA_GET_COLLECTIBLE_ID(thisx) (((thisx)->params >> 8) & 0x7F)
#define KUSA_GET_PARAM_FC(thisx) (((thisx)->params >> 2) & 0x3F)
typedef enum {
/* 0 */ ENKUSA_TYPE_BUSH,
/* 1 */ ENKUSA_TYPE_REGROWING_GRASS,
@@ -14,6 +27,19 @@ typedef enum {
/* 3 */ ENKUSA_TYPE_GRASS_2
} EnKusaType;
#define KUSA_BUSH_PARAMS(spawnBugs, randCollectibleId, param0C) \
((ENKUSA_TYPE_BUSH & 0x3) | (((spawnBugs) & 1) << 4) | (((randCollectibleId) & 0xF) << 8) | (((param0C) & 1) << 12))
#define KUSA_REGROWING_GRASS_PARAMS(spawnBugs) \
((ENKUSA_TYPE_REGROWING_GRASS & 0x3) | (((spawnBugs) & 1) << 4))
#define KUSA_GRASS_PARAMS(spawnBugs, randCollectibleId, param0C) \
((ENKUSA_TYPE_GRASS & 0x3) | (((spawnBugs) & 1) << 4) | (((randCollectibleId) & 0xF) << 8) | (((param0C) & 1) << 12))
#define KUSA_GRASS_2_PARAMS(paramFC, collectibleId) \
((ENKUSA_TYPE_GRASS_2 & 0x3) | (((paramFC) & 0x3F) << 2) | (((collectibleId) & 0x7F) << 8))
typedef struct EnKusa {
/* 0x000 */ Actor actor;
/* 0x144 */ EnKusaActionFunc actionFunc;
@@ -25,13 +51,4 @@ typedef struct EnKusa {
/* 0x198 */ u8 isInWater;
} EnKusa; // size = 0x19C
#define KUSA_GET_COLLECTIBLE_ID(thisx) (((thisx)->params >> 8) & 0x7F)
#define KUSA_GET_RAND_COLLECTIBLE_ID(thisx) (((thisx)->params >> 8) & 0xF)
#define KUSA_SHOULD_SPAWN_BUGS(thisx) (((thisx)->params >> 0x4) & 1)
#define KUSA_GET_PARAM_0C(thisx) (((thisx)->params >> 0xC) & 0x1)
#define KUSA_GET_PARAM_3F(thisx) (((thisx)->params >> 0x2) & 0x3F)
#define KUSA_GET_TYPE(thisx)((thisx)->params & 0x3)
#endif // Z_EN_KUSA_H
@@ -103,7 +103,11 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 20, ICHAIN_STOP),
};
static f32 D_80A6BA14[] = { 0.06f, 0.1f, 0.13f };
f32 D_80A6BA14[] = {
0.06f, // ENMUSHI2_0
0.1f, // ENMUSHI2_1
0.13f, // ENMUSHI2_2
};
void func_80A687A0(EnMushi2* this) {
MtxF* matrix = Matrix_GetCurrent();
@@ -743,7 +747,7 @@ void EnMushi2_Init(Actor* thisx, PlayState* play) {
s32 sp3C;
Actor_ProcessInitChain(&this->actor, sInitChain);
if (!ENMUSHI2_GET_3(&this->actor)) {
if (ENMUSHI2_GET_3(&this->actor) == ENMUSHI2_0) {
func_80A68A78(this, play);
}
this->actor.shape.rot.y += Rand_S16Offset(-2000, 4000);
@@ -759,7 +763,8 @@ void EnMushi2_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.mass = 30;
sp3C = func_80A69EE4(this, play);
if ((sp3C == 0) && func_80A68860(this, play) && func_80A68910(this, play) && !ENMUSHI2_GET_3(&this->actor)) {
if ((sp3C == 0) && func_80A68860(this, play) && func_80A68910(this, play) &&
(ENMUSHI2_GET_3(&this->actor) == ENMUSHI2_0)) {
func_80A6A024(this);
}
@@ -9,6 +9,14 @@ typedef void (*EnMushi2ActionFunc)(struct EnMushi2*, PlayState*);
#define ENMUSHI2_GET_3(thisx) ((thisx)->params & 3)
#define ENMUSHI2_PARAMS(param) ((param) & 3)
typedef enum {
/* 0 */ ENMUSHI2_0,
/* 1 */ ENMUSHI2_1,
/* 2 */ ENMUSHI2_2
} EnMush2Param;
typedef struct {
/* 0x0 */ s16 unk_00;
/* 0x2 */ s16 unk_02;
+35 -31
View File
@@ -106,9 +106,9 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_STOP),
};
void func_80B5B2E0(PlayState* play, Vec3f* pos, s16 params, Vec3f* vec, s32* index) {
void func_80B5B2E0(PlayState* play, Vec3f* pos, s16 pathIndex, Vec3f* vec, s32* index) {
s32 i;
Path* path = &play->setupPathList[params];
Path* path = &play->setupPathList[pathIndex];
f32 dist;
Vec3f sp58;
Vec3f sp4C;
@@ -117,7 +117,7 @@ void func_80B5B2E0(PlayState* play, Vec3f* pos, s16 params, Vec3f* vec, s32* ind
for (i = 0; i < path->count; i++) {
Math_Vec3s_ToVec3f(&sp58, &((Vec3s*)Lib_SegmentedToVirtual(path->points))[i]);
dist = Math_Vec3f_DistXYZ(pos, &sp58);
if (dist < minDist) {
if (minDist > dist) {
minDist = dist;
Math_Vec3f_Copy(&sp4C, &sp58);
*index = i;
@@ -137,8 +137,8 @@ void EnOt_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
this->unk_388 = 0;
this->unk_33C = ENOT_GET_C000(&this->actor);
if (this->unk_33C == 0) {
this->type = SEAHORSE_GET_TYPE(&this->actor);
if (this->type == SEAHORSE_TYPE_0) {
D_80B5E880 = this;
this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON;
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
@@ -155,7 +155,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) {
Animation_GetLastFrame(&sAnimations[0].animation->common) * Rand_ZeroOne(),
Animation_GetLastFrame(&sAnimations[0].animation->common), sAnimations[0].mode,
sAnimations[0].morphFrames);
this->unk_346 = ENOT_GET_7F(&this->actor);
this->pathIndex = SEAHORSE_GET_PATH_INDEX(&this->actor);
this->unk_344 = this->actor.world.rot.z;
this->actor.world.rot.z = 0;
this->actor.shape.rot.z = 0;
@@ -169,10 +169,10 @@ void EnOt_Init(Actor* thisx, PlayState* play) {
this->unk_744.g = 200;
this->unk_744.b = 80;
switch (ENOT_GET_C000(&this->actor)) {
case 1:
switch (SEAHORSE_GET_TYPE(&this->actor)) {
case SEAHORSE_TYPE_1:
D_80B5E884 = this;
Actor_SetScale(&this->actor, 0.012999999f);
Actor_SetScale(&this->actor, 1.3f * 0.01f);
switch (this->unk_344) {
case 0:
@@ -185,7 +185,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) {
Math_Vec3f_Sum(&this->actor.world.pos, &sp64, &sp64);
this->unk_360 = (EnOt*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_OT, sp64.x, sp64.y, sp64.z,
0, BINANG_ROT180(this->actor.shape.rot.y), 1,
ENOT_GET_3FFF(&this->actor) | 0x8000);
SEAHORSE_PARAMS_PARTNER(&this->actor, SEAHORSE_TYPE_2));
if (this->unk_360 != NULL) {
this->unk_360->unk_360 = this;
this->unk_3A0 = 0;
@@ -223,7 +223,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) {
}
break;
case 2:
case SEAHORSE_TYPE_2:
D_80B5E888 = this;
switch (this->unk_344) {
@@ -248,7 +248,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) {
break;
case 1:
Actor_SetScale(&this->actor, 0.012999999f);
Actor_SetScale(&this->actor, 1.3f * 0.01f);
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_84_10)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_32_01)) {
func_80B5C244(this, play);
@@ -262,7 +262,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) {
}
break;
case 3:
case SEAHORSE_TYPE_3:
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_26_08)) {
this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON;
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
@@ -276,6 +276,9 @@ void EnOt_Init(Actor* thisx, PlayState* play) {
Actor_Kill(&this->actor);
}
break;
default:
break;
}
}
@@ -407,7 +410,7 @@ void func_80B5C25C(EnOt* this, PlayState* play) {
this->unk_32C |= 0x80;
}
if ((this->unk_33C == 2) && (this->unk_32C & 0x80) && (this->unk_360->unk_32C & 0x80)) {
if ((this->type == SEAHORSE_TYPE_2) && (this->unk_32C & 0x80) && (this->unk_360->unk_32C & 0x80)) {
this->unk_32C |= 0x100;
this->unk_360->unk_32C |= 0x100;
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 2, &this->animIndex);
@@ -501,7 +504,7 @@ void func_80B5C6DC(EnOt* this, PlayState* play) {
sp3E = Actor_WorldYawTowardPoint(&player->actor, &this->unk_394);
Matrix_RotateYS(BINANG_ADD(sp3E, 0x4000), MTXMODE_NEW);
if (this->unk_33C == 2) {
if (this->type == SEAHORSE_TYPE_2) {
Matrix_MultVecZ(26.259998f, &sp30);
} else {
if (this->unk_73C == 0) {
@@ -527,7 +530,7 @@ void func_80B5C6DC(EnOt* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.world.pos.x, this->unk_348.x, 1.0f, 2.0f, 0.01f);
Math_SmoothStepToF(&this->actor.world.pos.z, this->unk_348.z, 1.0f, 2.0f, 0.01f);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0xE38, 0x38E);
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_84_10) && (this->unk_33C == 1)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_84_10) && (this->type == SEAHORSE_TYPE_1)) {
this->actor.textId = 0;
this->unk_384 = 1;
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
@@ -581,9 +584,9 @@ void func_80B5C9D0(EnOt* this, PlayState* play) {
}
void func_80B5CA30(EnOt* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.scale.x, 0.012999999f, 0.7f, 0.0001f, 0.01f);
Math_SmoothStepToF(&this->actor.scale.x, 1.3f * 0.01f, 0.7f, 0.0001f, 0.01f);
Actor_SetScale(&this->actor, this->actor.scale.x);
if (this->actor.scale.x == 0.012999999f) {
if (this->actor.scale.x == 1.3f * 0.01f) {
this->unk_360->unk_32C |= 0x1000;
this->unk_360->unk_360 = this;
func_80B5C9A8(this, play);
@@ -596,9 +599,9 @@ void func_80B5CAD0(EnOt* this, PlayState* play) {
}
void func_80B5CB0C(EnOt* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.scale.x, 0.012999999f, 0.7f, 0.0001f, 0.01f);
Math_SmoothStepToF(&this->actor.scale.x, 1.3f * 0.01f, 0.7f, 0.0001f, 0.01f);
Actor_SetScale(&this->actor, this->actor.scale.x);
if (this->actor.scale.x == 0.012999999f) {
if (this->actor.scale.x == 1.3f * 0.01f) {
this->unk_32C |= 0x800;
func_80B5CE6C(this, play);
}
@@ -708,7 +711,7 @@ void func_80B5CEC8(EnOt* this, PlayState* play) {
}
}
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_84_10) && (ENOT_GET_C000(&this->actor) == 1)) {
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_84_10) && (SEAHORSE_GET_TYPE(&this->actor) == 1)) {
if ((fabsf(this->actor.xzDistToPlayer) <= 130.0f) && (fabsf(this->actor.playerHeightRel) <= 130.0f)) {
player->unk_B2B = 29;
}
@@ -753,14 +756,14 @@ void func_80B5D160(EnOt* this, PlayState* play) {
if (temp == 0) {
switch (this->unk_384) {
case 0:
if ((this->unk_33C != 1) && (this->unk_33C == 2)) {
if ((this->type != SEAHORSE_TYPE_1) && (this->type == SEAHORSE_TYPE_2)) {
if (this->unk_32C & 1) {
if (this->unk_32C & 4) {
phi_a1 = 0x106A;
} else {
phi_a1 = 0x1069;
}
} else if (Flags_GetSwitch(play, ENOT_GET_3F80(&this->actor))) {
} else if (Flags_GetSwitch(play, SEAHORSE_GET_SWITCH_FLAG(&this->actor))) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_23_10)) {
phi_a1 = 0x106C;
} else {
@@ -883,10 +886,10 @@ s32 EnOt_ActorPathing_UpdateActorInfo(PlayState* play, ActorPathing* actorPath)
}
void func_80B5D648(EnOt* this, PlayState* play) {
func_80B5B2E0(play, &this->actor.world.pos, this->unk_346, &this->unk_348, &this->unk_340);
func_80B5B2E0(play, &this->actor.world.pos, this->pathIndex, &this->unk_348, &this->unk_340);
Math_Vec3f_Copy(&this->unk_330, &this->actor.world.pos);
SubS_ActorPathing_Init(play, &this->unk_330, &this->actor, &this->actorPath, play->setupPathList, this->unk_346, 0,
0, this->unk_340, 0);
SubS_ActorPathing_Init(play, &this->unk_330, &this->actor, &this->actorPath, play->setupPathList, this->pathIndex,
0, 0, this->unk_340, 0);
this->unk_32C = 0;
this->actorPath.pointOffset.x = 0.0f;
this->actorPath.pointOffset.y = 0.0f;
@@ -896,7 +899,7 @@ void func_80B5D648(EnOt* this, PlayState* play) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIndex);
this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON;
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
Flags_SetSwitch(play, ENOT_GET_3F80(&this->actor));
Flags_SetSwitch(play, SEAHORSE_GET_SWITCH_FLAG(&this->actor));
this->actionFunc = func_80B5D750;
}
@@ -996,10 +999,11 @@ void func_80B5DB6C(Actor* thisx, PlayState* play) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_25_04)) {
Vec3f sp50;
func_80B5B2E0(play, &this->actor.world.pos, ENOT_GET_7F(&this->actor), &sp50, &this->unk_340);
func_80B5B2E0(play, &this->actor.world.pos, SEAHORSE_GET_PATH_INDEX(&this->actor), &sp50, &this->unk_340);
if (Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_OT, sp50.x, sp50.y, sp50.z, 0,
this->actor.shape.rot.y, 1, ENOT_GET_3FFF(&this->actor) | 0x8000,
this->actor.csId, this->actor.halfDaysBits, NULL) != NULL) {
this->actor.shape.rot.y, 1,
SEAHORSE_PARAMS_PARTNER(&this->actor, SEAHORSE_TYPE_2), this->actor.csId,
this->actor.halfDaysBits, NULL) != NULL) {
this->unk_32C |= 8;
}
} else if (D_80B5E888 != NULL) {
@@ -1015,7 +1019,7 @@ void func_80B5DB6C(Actor* thisx, PlayState* play) {
EnOt* temp = D_80B5E888;
temp->unk_32C |= 8;
temp->unk_346 = ENOT_GET_7F(&this->actor);
temp->pathIndex = SEAHORSE_GET_PATH_INDEX(&this->actor);
temp->actor.params = this->actor.params;
temp->actor.csId = this->actor.csId;
this->unk_32C |= 8;

Some files were not shown because too many files have changed in this diff Show More