En_Syateki_Dekunuts (Shooting Gallery Deku Scrub) OK (#716)

* Import data to C

* EnSyatekiDekunuts_Init OK

* EnSyatekiDekunuts_Destroy OK

* func_80A2BE54 OK

* func_80A2BF18 OK

* func_80A2BFC4 OK

* func_80A2C0F8 OK

* func_80A2C150 and func_80A2C168 OK

* func_80A2C1AC OK and better match on func_80A2BFC4

* func_80A2C208 OK

* func_80A2C27C OK

* func_80A2C2E0 and func_80A2C33C OK

* func_80A2C3F0 OK

* func_80A2C478 and func_80A2C48C OK

* EnSyatekiDekunuts_Update OK

* func_80A2C4D0 OK

* func_80A2C5DC OK

* EnSyatekiDekunuts_Draw OK

* func_80A2C8A0 OK

* Use generated reloc and minor cleanup

* Use object symbols

* Last bit of cleanup

* Use limb enum values for all syateki actors I've worked on

* M_PI / 4
This commit is contained in:
Tom Overton 2022-03-25 20:07:25 -07:00 committed by GitHub
parent acd84bda77
commit 3986732c5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 403 additions and 64 deletions

3
spec
View File

@ -2667,8 +2667,7 @@ beginseg
name "ovl_En_Syateki_Dekunuts"
compress
include "build/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.o"
include "build/data/ovl_En_Syateki_Dekunuts/ovl_En_Syateki_Dekunuts.data.o"
include "build/data/ovl_En_Syateki_Dekunuts/ovl_En_Syateki_Dekunuts.reloc.o"
include "build/src/overlays/actors/ovl_En_Syateki_Dekunuts/ovl_En_Syateki_Dekunuts_reloc.o"
endseg
beginseg

View File

@ -83,16 +83,14 @@ void EnSyatekiCrow_Init(Actor* thisx, GlobalContext* globalCtx2) {
EnSyatekiCrow* this = THIS;
Path* path;
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
s32 temp;
s32 i;
path = syatekiMan->path;
while (path->unk2 != 0) {
path = &globalCtx->setupPathList[path->unk1];
}
temp = 0;
while (temp < EN_SYATEKI_CROW_GET_PARAM_FF00(&this->actor)) {
temp++;
for (i = 0; i < EN_SYATEKI_CROW_GET_PARAM_FF00(&this->actor); i++) {
path = &globalCtx->setupPathList[path->unk1];
}
@ -292,10 +290,10 @@ s32 EnSyatekiCrow_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx*
Actor* thisx) {
EnSyatekiCrow* this = THIS;
if (limbIndex == 7) {
rot->y += (s16)(3072.0f * sin_rad(this->skelAnime.curFrame * 0.7853982f));
} else if (limbIndex == 8) {
rot->y += (s16)(5120.0f * sin_rad((this->skelAnime.curFrame + 2.5f) * 0.7853982f));
if (limbIndex == OBJECT_CROW_LIMB_07) {
rot->y += (s16)(3072.0f * sin_rad(this->skelAnime.curFrame * (M_PI / 4)));
} else if (limbIndex == OBJECT_CROW_LIMB_08) {
rot->y += (s16)(5120.0f * sin_rad((this->skelAnime.curFrame + 2.5f) * (M_PI / 4)));
}
return false;
@ -305,10 +303,11 @@ void EnSyatekiCrow_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** d
EnSyatekiCrow* this = THIS;
Vec3f* sp1C;
if (limbIndex == 2) {
if (limbIndex == OBJECT_CROW_LIMB_02) {
Matrix_MultiplyVector3fByState(&D_809CB0D8, &this->unk_144[0]);
this->unk_144[0].y -= 20.0f;
} else if ((limbIndex == 4) || (limbIndex == 6) || (limbIndex == 8)) {
} else if ((limbIndex == OBJECT_CROW_LIMB_04) || (limbIndex == OBJECT_CROW_LIMB_06) ||
(limbIndex == OBJECT_CROW_LIMB_08)) {
sp1C = &this->unk_144[(limbIndex >> 1) - 1];
Matrix_MultiplyVector3fByState(&D_809CB050, sp1C);
sp1C->y -= 20.0f;

View File

@ -5,6 +5,9 @@
*/
#include "z_en_syateki_dekunuts.h"
#include "overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_dekunuts/object_dekunuts.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_8000000)
@ -15,16 +18,23 @@ void EnSyatekiDekunuts_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnSyatekiDekunuts_Update(Actor* thisx, GlobalContext* globalCtx);
void EnSyatekiDekunuts_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80A2BE54(EnSyatekiDekunuts* this);
void func_80A2BF18(EnSyatekiDekunuts* this, GlobalContext* globalCtx);
void func_80A2BFC4(EnSyatekiDekunuts* this);
void func_80A2C0F8(EnSyatekiDekunuts* this, GlobalContext* globalCtx);
void func_80A2C150(EnSyatekiDekunuts* this);
void func_80A2C168(EnSyatekiDekunuts* this, GlobalContext* globalCtx);
void func_80A2C1AC(EnSyatekiDekunuts* this);
void func_80A2C208(EnSyatekiDekunuts* this, GlobalContext* globalCtx);
void func_80A2C27C(EnSyatekiDekunuts* this);
void func_80A2C2E0(EnSyatekiDekunuts* this, GlobalContext* globalCtx);
void func_80A2C33C(EnSyatekiDekunuts* this, GlobalContext* globalCtx);
void func_80A2C3AC(EnSyatekiDekunuts* this);
void func_80A2C3F0(EnSyatekiDekunuts* this, GlobalContext* globalCtx);
void func_80A2C478(EnSyatekiDekunuts* this);
void func_80A2C48C(EnSyatekiDekunuts* this, GlobalContext* globalCtx);
void func_80A2C5DC(EnSyatekiDekunuts* this, GlobalContext* globalCtx);
#if 0
const ActorInit En_Syateki_Dekunuts_InitVars = {
ACTOR_EN_SYATEKI_DEKUNUTS,
ACTORCAT_ENEMY,
@ -37,69 +47,390 @@ const ActorInit En_Syateki_Dekunuts_InitVars = {
(ActorFunc)EnSyatekiDekunuts_Draw,
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80A2CAB0 = {
{ COLTYPE_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_HIT6,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_1,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0xF7CFFFFF, 0x00, 0x00 },
TOUCH_NONE | TOUCH_SFX_NORMAL,
BUMP_ON,
OCELEM_NONE,
},
{ 48, 80, 0, { 0, 0, 0 } },
};
// static InitChainEntry sInitChain[] = {
static InitChainEntry D_80A2CB90[] = {
static Cylinder16 D_80A2CADC[] = { { 24, 40, 0, { 0, 0, 0 } } };
static AnimationInfo sAnimations[] = {
{ &object_dekunuts_Anim_003180, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
{ &object_dekunuts_Anim_002A5C, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
{ &object_dekunuts_Anim_00326C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -1.0f },
{ &object_dekunuts_Anim_002FA4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -1.0f },
{ &object_dekunuts_Anim_00259C, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
{ &object_dekunuts_Anim_002BD4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
{ &object_dekunuts_Anim_002DD4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
};
static InitChainEntry sInitChain[] = {
ICHAIN_S8(hintId, 77, ICHAIN_CONTINUE),
ICHAIN_F32(gravity, 0, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 2600, ICHAIN_STOP),
};
#endif
void EnSyatekiDekunuts_Init(Actor* thisx, GlobalContext* globalCtx2) {
static s32 D_80A2CB9C = 1;
EnSyatekiDekunuts* this = THIS;
GlobalContext* globalCtx = globalCtx2;
s32 phi_v0;
Path* path;
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
s32 i;
extern ColliderCylinderInit D_80A2CAB0;
extern InitChainEntry D_80A2CB90[];
path = syatekiMan->path;
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
extern UNK_TYPE D_06001E50;
extern UNK_TYPE D_06002A5C;
extern UNK_TYPE D_06003180;
if (EN_SYATEKI_DEKUNUTS_GET_PARAM_F(&this->actor) == 1) {
Actor_SetScale(&this->actor, 0.01f);
this->collider.dim = D_80A2CADC[0];
phi_v0 = 3;
} else {
Actor_SetScale(&this->actor, 0.02f);
phi_v0 = 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/EnSyatekiDekunuts_Init.s")
while (path->unk2 != phi_v0) {
path = &globalCtx->setupPathList[path->unk1];
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/EnSyatekiDekunuts_Destroy.s")
for (i = 0; i < EN_SYATEKI_DEKUNUTS_GET_PARAM_FF00(&this->actor); i++) {
path = &globalCtx->setupPathList[path->unk1];
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2BE54.s")
if (D_80A2CB9C == 1) {
this->unk_1EC = 1;
D_80A2CB9C = 0;
} else {
this->unk_1EC = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2BF18.s")
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &object_dekunuts_Skel_002468, &object_dekunuts_Anim_002A5C,
this->jointTable, this->morphTable, 10);
if (path == NULL) {
Actor_MarkForDeath(&this->actor);
return;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2BFC4.s")
this->unk_1E4 = Lib_SegmentedToVirtual(path->points);
this->unk_1E8 = EN_SYATEKI_DEKUNUTS_GET_PARAM_F0(&this->actor);
this->unk_1EA = path->count;
this->unk_1D8 = 0;
this->unk_1DC = 0;
this->unk_1DA = 0;
func_80A2BE54(this);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C0F8.s")
void EnSyatekiDekunuts_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnSyatekiDekunuts* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C150.s")
Collider_DestroyCylinder(globalCtx, &this->collider);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C168.s")
void func_80A2BE54(EnSyatekiDekunuts* this) {
Animation_PlayOnceSetSpeed(&this->skelAnime, &object_dekunuts_Anim_003180, 0.0f);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C1AC.s")
this->actor.speedXZ = 0.0f;
this->actor.world = this->actor.home;
this->actor.prevPos = this->actor.home.pos;
this->actor.shape.rot = this->actor.world.rot;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C208.s")
this->unk_1D8 = 0;
this->unk_1DC = 0;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C27C.s")
if (EN_SYATEKI_DEKUNUTS_GET_PARAM_F(&this->actor) != 1) {
this->unk_1E2 = 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C2E0.s")
this->actionFunc = func_80A2BF18;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C33C.s")
void func_80A2BF18(EnSyatekiDekunuts* this, GlobalContext* globalCtx) {
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C3AC.s")
if ((syatekiMan->unk_26A == 1) && (this->unk_1E2 == 1) && ((syatekiMan->unk_272 & (1 << this->unk_1E8)) != 0)) {
func_80A2BFC4(this);
} else if (syatekiMan->unk_26A != 1) {
this->unk_1E2 = 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C3F0.s")
if ((syatekiMan->unk_272 == 0) && (syatekiMan->unk_274 == 0) &&
(EN_SYATEKI_DEKUNUTS_GET_PARAM_F(&this->actor) != 1)) {
this->unk_1E2 = 1;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C478.s")
void func_80A2BFC4(EnSyatekiDekunuts* this) {
Vec3f sp14;
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C48C.s")
this->unk_1D8 = 0;
sp14.x = this->unk_1E4[this->unk_1E8].x;
sp14.y = this->unk_1E4[this->unk_1E8].y;
sp14.z = this->unk_1E4[this->unk_1E8].z;
this->actor.world.pos = this->actor.prevPos = sp14;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->unk_1EE = 140 - (syatekiMan->unk_27C * 20);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C4D0.s")
if ((syatekiMan->unk_27C & 1) != 0) {
this->unk_1F0 = 1;
this->unk_1F2 = 0;
} else {
this->unk_1F0 = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C5DC.s")
this->actionFunc = func_80A2C0F8;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/EnSyatekiDekunuts_Update.s")
void func_80A2C0F8(EnSyatekiDekunuts* this, GlobalContext* globalCtx) {
EnSyatekiMan* syatekiMan;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/func_80A2C8A0.s")
if (this->unk_1DA > 20) {
syatekiMan = (EnSyatekiMan*)this->actor.parent;
Actor_PlaySfxAtPos(&syatekiMan->actor, NA_SE_EN_NUTS_DAMAGE);
this->unk_1DA = 0;
func_80A2C150(this);
} else {
this->unk_1DA++;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Dekunuts/EnSyatekiDekunuts_Draw.s")
void func_80A2C150(EnSyatekiDekunuts* this) {
this->unk_1D8 = 0;
this->actionFunc = func_80A2C168;
}
void func_80A2C168(EnSyatekiDekunuts* this, GlobalContext* globalCtx) {
if (this->unk_1DA > 20) {
func_80A2C1AC(this);
this->unk_1DA = 0;
} else {
this->unk_1DA++;
}
}
void func_80A2C1AC(EnSyatekiDekunuts* this) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actionFunc = func_80A2C208;
}
void func_80A2C208(EnSyatekiDekunuts* this, GlobalContext* globalCtx) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
func_80A2C27C(this);
}
if (this->unk_1F0 == 1) {
Math_SmoothStepToS(&this->unk_1F2, -0x8000, 5, 0x1000, 0x100);
}
this->unk_1D8++;
}
void func_80A2C27C(EnSyatekiDekunuts* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
if (EN_SYATEKI_DEKUNUTS_GET_PARAM_F(&this->actor) != 1) {
this->actionFunc = func_80A2C2E0;
} else {
this->actionFunc = func_80A2C33C;
}
}
void func_80A2C2E0(EnSyatekiDekunuts* this, GlobalContext* globalCtx) {
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
if ((this->unk_1EE < this->unk_1D8) || (syatekiMan->unk_26A != 1)) {
func_80A2C3AC(this);
}
this->unk_1D8++;
}
void func_80A2C33C(EnSyatekiDekunuts* this, GlobalContext* globalCtx) {
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
if ((gSaveContext.unk_3DE0[1] <= 0) || (syatekiMan->unk_26A != 1)) {
func_80A2C3AC(this);
}
if (this->unk_1D8 < 11) {
this->unk_1D8++;
}
}
void func_80A2C3AC(EnSyatekiDekunuts* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
this->actionFunc = func_80A2C3F0;
}
void func_80A2C3F0(EnSyatekiDekunuts* this, GlobalContext* globalCtx) {
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
if (syatekiMan->unk_26A == 1) {
if (this->unk_1D8 > 160 && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_1D8 = 0;
func_80A2C150(this);
} else {
this->unk_1D8++;
}
} else {
func_80A2C478(this);
}
}
void func_80A2C478(EnSyatekiDekunuts* this) {
this->actionFunc = func_80A2C48C;
}
void func_80A2C48C(EnSyatekiDekunuts* this, GlobalContext* globalCtx) {
if (this->unk_1DA > 20) {
func_80A2BE54(this);
this->unk_1DA = 0;
} else {
this->unk_1DA++;
}
}
void func_80A2C4D0(EnSyatekiDekunuts* this, GlobalContext* globalCtx) {
static Vec3f D_80A2CBA0 = { 0.0f, 20.0f, 0.0f };
static Vec3f D_80A2CBAC = { 0.0f, 0.0f, 0.0f };
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
if (EN_SYATEKI_DEKUNUTS_GET_PARAM_F(&this->actor) == 1) {
EffectSsExtra_Spawn(globalCtx, &this->actor.world.pos, &D_80A2CBA0, &D_80A2CBAC, 5, 2);
syatekiMan->unk_280 += 100;
syatekiMan->unk_26E++;
} else {
EffectSsExtra_Spawn(globalCtx, &this->actor.world.pos, &D_80A2CBA0, &D_80A2CBAC, 5, 0);
syatekiMan->unk_280 += 30;
syatekiMan->unk_278++;
}
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE);
this->unk_1E2 = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
this->unk_1D8 = 160;
this->actionFunc = func_80A2C5DC;
}
void func_80A2C5DC(EnSyatekiDekunuts* this, GlobalContext* globalCtx) {
static Color_RGBA8 D_80A2CBB8 = { 255, 255, 255, 255 };
static Color_RGBA8 D_80A2CBBC = { 150, 150, 150, 0 };
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if (this->unk_1D8 == 160) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DEAD);
this->unk_1D8--;
} else if (this->unk_1D8 < 160) {
Vec3f sp40;
sp40.x = this->actor.world.pos.x;
sp40.y = this->actor.world.pos.y + 18.0f;
sp40.z = this->actor.world.pos.z;
EffectSsDeadDb_Spawn(globalCtx, &sp40, &gZeroVec3f, &gZeroVec3f, &D_80A2CBB8, &D_80A2CBBC, 200, 0, 13);
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_EXTINCT);
sp40.y = this->actor.world.pos.y + 10.0f;
EffectSsHahen_SpawnBurst(globalCtx, &sp40, 3.0f, 0, 12, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
if (EN_SYATEKI_DEKUNUTS_GET_PARAM_F(&this->actor) != 1) {
syatekiMan->unk_272 &= ~(1 << this->unk_1E8);
}
func_80A2BE54(this);
}
} else if (this->unk_1D8 < 160) {
this->unk_1D8--;
}
}
void EnSyatekiDekunuts_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnSyatekiDekunuts* this = THIS;
this->actionFunc(this, globalCtx);
if ((this->actionFunc != func_80A2BF18) && (this->unk_1D8 < this->unk_1EE) && (this->unk_1D8 > 10)) {
if ((this->collider.base.acFlags & AC_HIT) && (this->unk_1E2 == 1)) {
if (EN_SYATEKI_DEKUNUTS_GET_PARAM_F(&this->actor) == 1) {
func_801A3098(NA_BGM_GET_ITEM | 0x900);
} else {
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
}
this->collider.base.acFlags &= ~AC_HIT;
func_80A2C4D0(this, globalCtx);
}
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
} else {
this->collider.base.acFlags &= ~AC_HIT;
}
SkelAnime_Update(&this->skelAnime);
}
s32 EnSyatekiDekunuts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* thisx) {
EnSyatekiDekunuts* this = THIS;
if ((limbIndex == OBJECT_DEKUNUTS_LIMB_03) && (this->unk_1F0 == 1)) {
rot->z += this->unk_1F2;
}
return false;
}
void EnSyatekiDekunuts_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnSyatekiDekunuts* this = THIS;
Vec3f temp_f20;
s32 i;
if (this->actionFunc != func_80A2BF18) {
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
EnSyatekiDekunuts_OverrideLimbDraw, NULL, &this->actor);
}
if (this->unk_1EC == 1) {
for (i = 0; i < this->unk_1EA; i++) {
temp_f20.x = this->unk_1E4[i].x;
temp_f20.y = this->unk_1E4[i].y;
temp_f20.z = this->unk_1E4[i].z;
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
Matrix_InsertTranslation(temp_f20.x, temp_f20.y, temp_f20.z, MTXMODE_NEW);
Matrix_Scale(0.02f, 0.02f, 0.02f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, &object_dekunuts_DL_001E50);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
}
}

View File

@ -3,15 +3,34 @@
#include "global.h"
#define EN_SYATEKI_DEKUNUTS_GET_PARAM_F(thisx) ((thisx)->params & 0xF)
#define EN_SYATEKI_DEKUNUTS_GET_PARAM_F0(thisx) (((thisx)->params & 0xF0) >> 4)
#define EN_SYATEKI_DEKUNUTS_GET_PARAM_FF00(thisx) (((thisx)->params & 0xFF00) >> 8)
struct EnSyatekiDekunuts;
typedef void (*EnSyatekiDekunutsActionFunc)(struct EnSyatekiDekunuts*, GlobalContext*);
typedef struct EnSyatekiDekunuts {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x44];
/* 0x0188 */ EnSyatekiDekunutsActionFunc actionFunc;
/* 0x018C */ char unk_18C[0xE4];
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ EnSyatekiDekunutsActionFunc actionFunc;
/* 0x18C */ ColliderCylinder collider;
/* 0x1D8 */ s16 unk_1D8;
/* 0x1DA */ s16 unk_1DA;
/* 0x1CD */ s16 unk_1DC;
/* 0x1DE */ UNK_TYPE1 unk_1DE[0x4];
/* 0x1E2 */ s16 unk_1E2;
/* 0x1E4 */ Vec3s* unk_1E4;
/* 0x1E8 */ s16 unk_1E8;
/* 0x1EA */ s16 unk_1EA;
/* 0x1EC */ s16 unk_1EC;
/* 0x1EE */ s16 unk_1EE;
/* 0x1F0 */ s16 unk_1F0;
/* 0x1F2 */ s16 unk_1F2;
/* 0x1F4 */ Vec3s jointTable[10];
/* 0x230 */ Vec3s morphTable[10];
/* 0x26C */ UNK_TYPE1 unk_26C[0x4];
} EnSyatekiDekunuts; // size = 0x270
extern const ActorInit En_Syateki_Dekunuts_InitVars;

View File

@ -145,16 +145,14 @@ void EnSyatekiWf_Init(Actor* thisx, GlobalContext* globalCtx) {
EnSyatekiWf* this = THIS;
Path* path;
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
s32 temp;
s32 i;
path = syatekiMan->path;
while (path->unk2 != 2) {
path = &globalCtx->setupPathList[path->unk1];
}
temp = 0;
while (temp < EN_SYATEKI_WF_GET_PARAM_FF00(&this->actor)) {
temp++;
for (i = 0; i < EN_SYATEKI_WF_GET_PARAM_FF00(&this->actor); i++) {
path = &globalCtx->setupPathList[path->unk1];
}
@ -463,7 +461,7 @@ void EnSyatekiWf_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi
Vec3f sp18;
Collider_UpdateSpheres(limbIndex, &this->unk_34C);
if (limbIndex == 6) {
if (limbIndex == OBJECT_WF_2_LIMB_06) {
Matrix_MultiplyVector3fByState(&D_80A20FD0, &sp18);
this->unk_300.dim.pos.x = sp18.x;
this->unk_300.dim.pos.y = sp18.y;

View File

@ -10081,7 +10081,7 @@
0x80A2C4D0:("func_80A2C4D0",),
0x80A2C5DC:("func_80A2C5DC",),
0x80A2C78C:("EnSyatekiDekunuts_Update",),
0x80A2C8A0:("func_80A2C8A0",),
0x80A2C8A0:("EnSyatekiDekunuts_OverrideLimbDraw",),
0x80A2C8E8:("EnSyatekiDekunuts_Draw",),
0x80A2CD10:("ElfMsg3_SetupAction",),
0x80A2CD1C:("func_80A2CD1C",),

View File

@ -1651,13 +1651,6 @@ D_0600D640 = 0x0600D640;
D_06006C18 = 0x06006C18;
D_0600D640 = 0x0600D640;
// ovl_En_Syateki_Dekunuts
D_06001E50 = 0x06001E50;
D_06002468 = 0x06002468;
D_06002A5C = 0x06002A5C;
D_06003180 = 0x06003180;
// ovl_En_Syateki_Okuta
D_060033D0 = 0x060033D0;