EnDekubaba OK and documented, object_dekubaba documented, EnKarebaba documented (#1088)

* OK, struct documented

* Data imported, update spec

* Name data

* Name all functions and variables

* Document object

* Bit more documentation

* Document Karebaba

* Add note to object_dekubaba

* Bit more cleanup

* Review

* Shadow

* Review

* Rename functions, add hit enum

* Figured out the enum

* Review

* MarkForDeath -> Kill
This commit is contained in:
EllipticEllipsis 2023-02-21 17:30:09 +00:00 committed by GitHub
parent 38edda8508
commit 9297e6dd52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 1718 additions and 543 deletions

View File

@ -1,27 +1,40 @@
<Root>
<!-- Deku Baba and withered Deku Baba assets. Identical to OoT -->
<File Name="object_dekubaba" Segment="6">
<Animation Name="object_dekubaba_Anim_000208" Offset="0x208" />
<Animation Name="object_dekubaba_Anim_0002B8" Offset="0x2B8" />
<DList Name="object_dekubaba_DL_000580" Offset="0x580" />
<DList Name="object_dekubaba_DL_000B68" Offset="0xB68" />
<DList Name="object_dekubaba_DL_0010F0" Offset="0x10F0" />
<DList Name="object_dekubaba_DL_001330" Offset="0x1330" />
<DList Name="object_dekubaba_DL_001628" Offset="0x1628" />
<DList Name="object_dekubaba_DL_001828" Offset="0x1828" />
<Texture Name="object_dekubaba_Tex_0018D0" OutName="tex_0018D0" Format="rgba16" Width="16" Height="32" Offset="0x18D0" />
<Texture Name="object_dekubaba_Tex_001CD0" OutName="tex_001CD0" Format="rgba16" Width="32" Height="32" Offset="0x1CD0" />
<Texture Name="object_dekubaba_Tex_0024D0" OutName="tex_0024D0" Format="rgba16" Width="16" Height="32" Offset="0x24D0" />
<Texture Name="object_dekubaba_Tex_0028D0" OutName="tex_0028D0" Format="rgba16" Width="8" Height="8" Offset="0x28D0" />
<Texture Name="object_dekubaba_Tex_002950" OutName="tex_002950" Format="rgba16" Width="8" Height="8" Offset="0x2950" />
<Limb Name="object_dekubaba_Standardlimb_0029D0" Type="Standard" EnumName="OBJECT_DEKUBABA_LIMB_01" Offset="0x29D0" />
<Limb Name="object_dekubaba_Standardlimb_0029DC" Type="Standard" EnumName="OBJECT_DEKUBABA_LIMB_02" Offset="0x29DC" />
<Limb Name="object_dekubaba_Standardlimb_0029E8" Type="Standard" EnumName="OBJECT_DEKUBABA_LIMB_03" Offset="0x29E8" />
<Limb Name="object_dekubaba_Standardlimb_0029F4" Type="Standard" EnumName="OBJECT_DEKUBABA_LIMB_04" Offset="0x29F4" />
<Limb Name="object_dekubaba_Standardlimb_002A00" Type="Standard" EnumName="OBJECT_DEKUBABA_LIMB_05" Offset="0x2A00" />
<Limb Name="object_dekubaba_Standardlimb_002A0C" Type="Standard" EnumName="OBJECT_DEKUBABA_LIMB_06" Offset="0x2A0C" />
<Limb Name="object_dekubaba_Standardlimb_002A18" Type="Standard" EnumName="OBJECT_DEKUBABA_LIMB_07" Offset="0x2A18" />
<Skeleton Name="object_dekubaba_Skel_002A40" Type="Normal" LimbType="Standard" LimbNone="OBJECT_DEKUBABA_LIMB_NONE" LimbMax="OBJECT_DEKUBABA_LIMB_MAX" EnumName="ObjectDekubabaLimb" Offset="0x2A40" />
<DList Name="object_dekubaba_DL_003070" Offset="0x3070" />
<Texture Name="object_dekubaba_Tex_0031C0" OutName="tex_0031C0" Format="rgba16" Width="32" Height="32" Offset="0x31C0" />
<!-- Deku Baba animations -->
<Animation Name="gDekuBabaPauseChompAnim" Offset="0x208"/>
<Animation Name="gDekuBabaFastChompAnim" Offset="0x2B8"/>
<!-- Deku Baba body DLists (not all are limb DLists) -->
<DList Name="gDekuBabaLowerJawDL" Offset="0x580"/>
<DList Name="gDekuBabaUpperJawDL" Offset="0xB68"/>
<DList Name="gDekuBabaBaseLeavesDL" Offset="0x10F0"/>
<DList Name="gDekuBabaStemTopDL" Offset="0x1330"/>
<DList Name="gDekuBabaStemMiddleDL" Offset="0x1628"/>
<DList Name="gDekuBabaStemBaseDL" Offset="0x1828"/>
<!-- Deku Baba body textures -->
<Texture Name="gDekuBabaJawOuterTex" OutName="deku_baba_jaw_outer" Format="rgba16" Width="16" Height="32" Offset="0x18D0"/>
<Texture Name="gDekuBabaJawInnerTex" OutName="deku_baba_jaw_inner" Format="rgba16" Width="32" Height="32" Offset="0x1CD0"/>
<Texture Name="gDekuBabaLeafTex" OutName="deku_baba_leaf" Format="rgba16" Width="16" Height="32" Offset="0x24D0"/>
<Texture Name="gDekuBabaBulbTex" OutName="deku_baba_bulb" Format="rgba16" Width="8" Height="8" Offset="0x28D0"/>
<Texture Name="gDekuBabaStemTex" OutName="deku_baba_stem" Format="rgba16" Width="8" Height="8" Offset="0x2950"/>
<!-- Deku Baba limbs (upper/lower is only based on the "tongue" being in the lower) -->
<Limb Name="gDekuBabaRootLimb" Type="Standard" EnumName="DEKUBABA_LIMB_ROOT" Offset="0x29D0" />
<Limb Name="gDekuBabaUpperJawRootLimb" Type="Standard" EnumName="DEKUBABA_LIMB_UPPER_JAW_ROOT" Offset="0x29DC" />
<Limb Name="gDekuBabaUpperJawRooWrappertLimb" Type="Standard" EnumName="DEKUBABA_LIMB_UPPER_JAW_WRAPPER" Offset="0x29E8" />
<Limb Name="gDekuBabaUpperJawLimb" Type="Standard" EnumName="DEKUBABA_LIMB_UPPER_JAW" Offset="0x29F4" />
<Limb Name="gDekuBabaLowerJawRootLimb" Type="Standard" EnumName="DEKUBABA_LIMB_LOWER_JAW_ROOT" Offset="0x2A00" />
<Limb Name="gDekuBabaLowerJawWrapperLimb" Type="Standard" EnumName="DEKUBABA_LIMB_LOWER_JAW_WRAPPER" Offset="0x2A0C" />
<Limb Name="gDekuBabaLowerJawLimb" Type="Standard" EnumName="DEKUBABA_LIMB_LOWER_JAW" Offset="0x2A18" />
<!-- Deku Baba skeleton (only used for jaws) -->
<Skeleton Name="gDekuBabaSkel" Type="Normal" LimbType="Standard" LimbNone="DEKUBABA_LIMB_NONE" LimbMax="DEKUBABA_LIMB_MAX" EnumName="DekuBabaLimb" Offset="0x2A40" />
<!-- Deku Baba stick drop -->
<DList Name="gDekuBabaStickDropDL" Offset="0x3070"/>
<Texture Name="gDekuBabaStickDropTex" OutName="deku_baba_stick_drop" Format="rgba16" Width="32" Height="32" Offset="0x31C0"/>
</File>
</Root>

3
spec
View File

@ -963,8 +963,7 @@ beginseg
name "ovl_En_Dekubaba"
compress
include "build/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.o"
include "build/data/ovl_En_Dekubaba/ovl_En_Dekubaba.data.o"
include "build/data/ovl_En_Dekubaba/ovl_En_Dekubaba.reloc.o"
include "build/src/overlays/actors/ovl_En_Dekubaba/ovl_En_Dekubaba_reloc.o"
endseg
beginseg

File diff suppressed because it is too large Load Diff

View File

@ -2,16 +2,35 @@
#define Z_EN_DEKUBABA_H
#include "global.h"
#include "objects/object_dekubaba/object_dekubaba.h"
struct EnDekubaba;
typedef void (*EnDekubabaActionFunc)(struct EnDekubaba*, PlayState*);
typedef enum {
/* 0 */ DEKUBABA_NORMAL,
/* 1 */ DEKUBABA_BIG
} DekuBabaType;
typedef struct EnDekubaba {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x44];
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ EnDekubabaActionFunc actionFunc;
/* 0x18C */ char unk_18C[0x290];
/* 0x18C */ u8 drawDmgEffType;
/* 0x18E */ s16 timer;
/* 0x190 */ s16 targetSwayAngle;
/* 0x192 */ s16 stemSectionAngle[3];
/* 0x198 */ Vec3s jointTable[DEKUBABA_LIMB_MAX];
/* 0x1C8 */ Vec3s morphTable[DEKUBABA_LIMB_MAX];
/* 0x1F8 */ f32 size;
/* 0x1FC */ f32 drawDmgEffAlpha;
/* 0x200 */ f32 drawDmgEffScale;
/* 0x204 */ f32 drawDmgEffFrozenSteamScale;
/* 0x208 */ Vec3f bodyPartsPos[4];
/* 0x238 */ CollisionPoly* boundFloor;
/* 0x23C */ ColliderJntSph collider;
/* 0x25C */ ColliderJntSphElement colliderElements[7];
} EnDekubaba; // size = 0x41C
#endif // Z_EN_DEKUBABA_H

View File

@ -1,13 +1,12 @@
/*
* File: z_en_karebaba.c
* Overlay: ovl_En_Karebaba
* Description: Wilted Deku Baba
* Description: Wilted Deku Baba and Mini Baba
*/
#include "z_en_karebaba.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_dekubaba/object_dekubaba.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
@ -18,27 +17,26 @@ void EnKarebaba_Destroy(Actor* thisx, PlayState* play);
void EnKarebaba_Update(Actor* thisx, PlayState* play2);
void EnKarebaba_Draw(Actor* thisx, PlayState* play);
void func_808F155C(EnKarebaba* this);
void func_808F15B0(EnKarebaba* this, PlayState* play);
void func_808F1648(EnKarebaba* this);
void func_808F169C(EnKarebaba* this, PlayState* play);
void func_808F16FC(EnKarebaba* this);
void func_808F1778(EnKarebaba* this, PlayState* play);
void func_808F1878(EnKarebaba* this);
void func_808F190C(EnKarebaba* this, PlayState* play);
void func_808F1A3C(EnKarebaba* this);
void func_808F1A58(EnKarebaba* this, PlayState* play);
void func_808F1BF8(EnKarebaba* this);
void func_808F1C84(EnKarebaba* this, PlayState* play);
void func_808F1FAC(EnKarebaba* this);
void func_808F200C(EnKarebaba* this, PlayState* play);
void func_808F20FC(EnKarebaba* this, PlayState* play);
void func_808F21A4(EnKarebaba* this, PlayState* play);
void func_808F220C(EnKarebaba* this);
void func_808F228C(EnKarebaba* this, PlayState* play);
void func_808F238C(EnKarebaba* this);
void func_808F241C(EnKarebaba* this, PlayState* play);
void func_808F254C(EnKarebaba* this, PlayState* play);
void EnKarebaba_SetupGrow(EnKarebaba* this);
void EnKarebaba_Grow(EnKarebaba* this, PlayState* play);
void EnKarebaba_SetupIdle(EnKarebaba* this);
void EnKarebaba_Idle(EnKarebaba* this, PlayState* play);
void EnKarebaba_SetupAwaken(EnKarebaba* this);
void EnKarebaba_Awaken(EnKarebaba* this, PlayState* play);
void EnKarebaba_SetupUpright(EnKarebaba* this);
void EnKarebaba_Upright(EnKarebaba* this, PlayState* play);
void EnKarebaba_SetupSpin(EnKarebaba* this);
void EnKarebaba_Spin(EnKarebaba* this, PlayState* play);
void EnKarebaba_SetupDying(EnKarebaba* this);
void EnKarebaba_Dying(EnKarebaba* this, PlayState* play);
void EnKarebaba_SetupShrinkDie(EnKarebaba* this);
void EnKarebaba_ShrinkDie(EnKarebaba* this, PlayState* play);
void EnKarebaba_SetupDeadItemDrop(EnKarebaba* this, PlayState* play);
void EnKarebaba_DeadItemDrop(EnKarebaba* this, PlayState* play);
void EnKarebaba_SetupRetract(EnKarebaba* this);
void EnKarebaba_Retract(EnKarebaba* this, PlayState* play);
void EnKarebaba_SetupDead(EnKarebaba* this);
void EnKarebaba_Dead(EnKarebaba* this, PlayState* play);
ActorInit En_Karebaba_InitVars = {
ACTOR_EN_KAREBABA,
@ -52,7 +50,7 @@ ActorInit En_Karebaba_InitVars = {
(ActorFunc)EnKarebaba_Draw,
};
static ColliderCylinderInit sCylinderInit1 = {
static ColliderCylinderInit sHurtCylinderInit = {
{
COLTYPE_HARD,
AT_NONE,
@ -72,7 +70,7 @@ static ColliderCylinderInit sCylinderInit1 = {
{ 7, 25, 0, { 0, 0, 0 } },
};
static ColliderCylinderInit sCylinderInit2 = {
static ColliderCylinderInit sAttackCylinderInit = {
{
COLTYPE_HARD,
AT_ON | AT_TYPE_ENEMY,
@ -94,39 +92,47 @@ static ColliderCylinderInit sCylinderInit2 = {
static CollisionCheckInfoInit sColChkInfoInit = { 1, 15, 80, MASS_HEAVY };
typedef enum {
/* 0x0 */ KAREBABA_DMGEFF_NONE,
/* 0x2 */ KAREBABA_DMGEFF_FIRE = 2,
/* 0x3 */ KAREBABA_DMGEFF_ICE,
/* 0x4 */ KAREBABA_DMGEFF_LIGHT,
/* 0x5 */ KAREBABA_DMGEFF_ELECTRIC,
} DekuBabaDamageEffect;
static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0x0),
/* Deku Stick */ DMG_ENTRY(3, 0x0),
/* Horse trample */ DMG_ENTRY(1, 0x0),
/* Explosives */ DMG_ENTRY(1, 0x0),
/* Zora boomerang */ DMG_ENTRY(1, 0x0),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0),
/* Hookshot */ DMG_ENTRY(1, 0x0),
/* Goron punch */ DMG_ENTRY(2, 0x0),
/* Sword */ DMG_ENTRY(1, 0x0),
/* Goron pound */ DMG_ENTRY(1, 0x0),
/* Fire arrow */ DMG_ENTRY(1, 0x2),
/* Ice arrow */ DMG_ENTRY(2, 0x3),
/* Light arrow */ DMG_ENTRY(2, 0x4),
/* Goron spikes */ DMG_ENTRY(1, 0x0),
/* Deku spin */ DMG_ENTRY(1, 0x0),
/* Deku bubble */ DMG_ENTRY(1, 0x0),
/* Deku launch */ DMG_ENTRY(2, 0x0),
/* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0),
/* Zora barrier */ DMG_ENTRY(1, 0x5),
/* Normal shield */ DMG_ENTRY(0, 0x0),
/* Light ray */ DMG_ENTRY(0, 0x0),
/* Thrown object */ DMG_ENTRY(1, 0x0),
/* Zora punch */ DMG_ENTRY(1, 0x0),
/* Spin attack */ DMG_ENTRY(1, 0x0),
/* Sword beam */ DMG_ENTRY(0, 0x0),
/* Normal Roll */ DMG_ENTRY(0, 0x0),
/* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0),
/* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0),
/* Powder Keg */ DMG_ENTRY(1, 0x0),
/* Deku Nut */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* Deku Stick */ DMG_ENTRY(3, KAREBABA_DMGEFF_NONE),
/* Horse trample */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Explosives */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Zora boomerang */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Normal arrow */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* UNK_DMG_0x06 */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* Hookshot */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Goron punch */ DMG_ENTRY(2, KAREBABA_DMGEFF_NONE),
/* Sword */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Goron pound */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Fire arrow */ DMG_ENTRY(1, KAREBABA_DMGEFF_FIRE),
/* Ice arrow */ DMG_ENTRY(2, KAREBABA_DMGEFF_ICE),
/* Light arrow */ DMG_ENTRY(2, KAREBABA_DMGEFF_LIGHT),
/* Goron spikes */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Deku spin */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Deku bubble */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Deku launch */ DMG_ENTRY(2, KAREBABA_DMGEFF_NONE),
/* UNK_DMG_0x12 */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* Zora barrier */ DMG_ENTRY(1, KAREBABA_DMGEFF_ELECTRIC),
/* Normal shield */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* Light ray */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* Thrown object */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Zora punch */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Spin attack */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
/* Sword beam */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* Normal Roll */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* UNK_DMG_0x1B */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* UNK_DMG_0x1C */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* Unblockable */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* UNK_DMG_0x1E */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE),
/* Powder Keg */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE),
};
static InitChainEntry sInitChain[] = {
@ -134,211 +140,208 @@ static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 1, ICHAIN_STOP),
};
Color_RGBA8 D_808F2E28 = { 0, 0, 0, 0 };
Gfx* D_808F2E2C[] = { object_dekubaba_DL_001330, object_dekubaba_DL_001628, object_dekubaba_DL_001828 };
void EnKarebaba_Init(Actor* thisx, PlayState* play) {
EnKarebaba* this = THIS;
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f);
SkelAnime_Init(play, &this->skelAnime, &object_dekubaba_Skel_002A40, &object_dekubaba_Anim_0002B8, this->jointTable,
this->morphTable, 8);
SkelAnime_Init(play, &this->skelAnime, &gDekuBabaSkel, &gDekuBabaFastChompAnim, this->jointTable, this->morphTable,
DEKUBABA_LIMB_MAX);
Collider_InitAndSetCylinder(play, &this->collider2, &this->actor, &sCylinderInit1);
Collider_UpdateCylinder(&this->actor, &this->collider2);
Collider_InitAndSetCylinder(play, &this->collider1, &this->actor, &sCylinderInit2);
Collider_UpdateCylinder(&this->actor, &this->collider1);
Collider_InitAndSetCylinder(play, &this->hurtCollider, &this->actor, &sHurtCylinderInit);
Collider_UpdateCylinder(&this->actor, &this->hurtCollider);
Collider_InitAndSetCylinder(play, &this->attackCollider, &this->actor, &sAttackCylinderInit);
Collider_UpdateCylinder(&this->actor, &this->attackCollider);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
this->unk_22C = NULL;
if (this->actor.params == ENKAREBABA_2) {
this->boundFloor = NULL;
if (this->actor.params == KAREBABA_MINI) {
this->actor.hintId = TATL_HINT_ID_MINI_BABA;
} else {
this->actor.hintId = TATL_HINT_ID_WILTED_DEKU_BABA;
}
if (this->actor.params == ENKAREBABA_0) {
func_808F155C(this);
EnKarebaba_SetupGrow(this);
} else {
func_808F1648(this);
EnKarebaba_SetupIdle(this);
}
}
void EnKarebaba_Destroy(Actor* thisx, PlayState* play) {
EnKarebaba* this = THIS;
Collider_DestroyCylinder(play, &this->collider2);
Collider_DestroyCylinder(play, &this->collider1);
Collider_DestroyCylinder(play, &this->hurtCollider);
Collider_DestroyCylinder(play, &this->attackCollider);
}
void func_808F1374(EnKarebaba* this, PlayState* play) {
s32 phi_a3;
void EnKarebaba_SpawnIceEffects(EnKarebaba* this, PlayState* play) {
s32 limbPosCount;
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->drawDmgEffAlpha = 0.0f;
if (this->actor.params == ENKAREBABA_2) {
phi_a3 = 1;
if (this->actor.params == KAREBABA_MINI) {
limbPosCount = 1;
} else {
phi_a3 = 4;
limbPosCount = 4;
}
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, phi_a3, 4, 0.3f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, limbPosCount, 4, 0.3f, 0.2f);
}
}
void func_808F13FC(EnKarebaba* this, PlayState* play) {
if (this->actor.colChkInfo.damageEffect == 2) {
void EnKarebaba_SetDamageEffects(EnKarebaba* this, PlayState* play) {
if (this->actor.colChkInfo.damageEffect == KAREBABA_DMGEFF_FIRE) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->drawDmgEffScale = 0.75f;
this->drawDmgEffAlpha = 3.0f;
} else if (this->actor.colChkInfo.damageEffect == 4) {
} else if (this->actor.colChkInfo.damageEffect == KAREBABA_DMGEFF_LIGHT) {
this->drawDmgEffScale = 0.75f;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_LIGHT_ORBS;
this->drawDmgEffAlpha = 3.0f;
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->collider2.info.bumper.hitPos.x,
this->collider2.info.bumper.hitPos.y, this->collider2.info.bumper.hitPos.z, 0, 0, 0,
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->hurtCollider.info.bumper.hitPos.x,
this->hurtCollider.info.bumper.hitPos.y, this->hurtCollider.info.bumper.hitPos.z, 0, 0, 0,
CLEAR_TAG_SMALL_LIGHT_RAYS);
} else if (this->actor.colChkInfo.damageEffect == 3) {
} else if (this->actor.colChkInfo.damageEffect == KAREBABA_DMGEFF_ICE) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX;
this->drawDmgEffScale = 0.75f;
this->drawDmgEffAlpha = 1.0f;
this->drawDmgEffFrozenSteamScale = 1.125f;
} else if (this->actor.colChkInfo.damageEffect == 5) {
} else if (this->actor.colChkInfo.damageEffect == KAREBABA_DMGEFF_ELECTRIC) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_MEDIUM;
this->drawDmgEffScale = 0.75f;
this->drawDmgEffAlpha = 3.0f;
}
}
void func_808F152C(EnKarebaba* this) {
this->collider2.dim.radius = 7;
this->collider2.dim.height = 25;
this->collider2.base.colType = COLTYPE_HARD;
this->collider2.base.acFlags |= AC_HARD;
this->collider1.dim.height = 25;
void EnKarebaba_ResetColliders(EnKarebaba* this) {
this->hurtCollider.dim.radius = 7;
this->hurtCollider.dim.height = 25;
this->hurtCollider.base.colType = COLTYPE_HARD;
this->hurtCollider.base.acFlags |= AC_HARD;
this->attackCollider.dim.height = 25;
}
void func_808F155C(EnKarebaba* this) {
void EnKarebaba_SetupGrow(EnKarebaba* this) {
Actor_SetScale(&this->actor, 0.0f);
this->actor.shape.rot.x = -0x4000;
this->unk_1EE = 0;
this->timer = 0;
this->actor.world.pos.y = this->actor.home.pos.y + 14.0f;
this->actionFunc = func_808F15B0;
this->actionFunc = EnKarebaba_Grow;
}
void func_808F15B0(EnKarebaba* this, PlayState* play) {
f32 sp1C;
void EnKarebaba_Grow(EnKarebaba* this, PlayState* play) {
f32 scale;
this->unk_1EE++;
sp1C = this->unk_1EE * 0.05f;
Actor_SetScale(&this->actor, 0.005f * sp1C);
this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * sp1C);
if (this->unk_1EE == 20) {
func_808F1648(this);
this->timer++;
scale = this->timer * 0.05f;
Actor_SetScale(&this->actor, 0.005f * scale);
this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * scale);
if (this->timer == 20) {
EnKarebaba_SetupIdle(this);
}
}
void func_808F1648(EnKarebaba* this) {
void EnKarebaba_SetupIdle(EnKarebaba* this) {
Actor_SetScale(&this->actor, 0.005f);
this->actor.shape.rot.x = -0x4000;
this->actor.world.pos.y = this->actor.home.pos.y + 14.0f;
this->actionFunc = func_808F169C;
this->actionFunc = EnKarebaba_Idle;
}
void func_808F169C(EnKarebaba* this, PlayState* play) {
void EnKarebaba_Idle(EnKarebaba* this, PlayState* play) {
if ((this->actor.xzDistToPlayer < 200.0f) && (fabsf(this->actor.playerHeightRel) < 30.0f)) {
func_808F16FC(this);
EnKarebaba_SetupAwaken(this);
}
}
void func_808F16FC(EnKarebaba* this) {
Animation_Change(&this->skelAnime, &object_dekubaba_Anim_0002B8, 4.0f, 0.0f,
Animation_GetLastFrame(&object_dekubaba_Anim_0002B8), ANIMMODE_LOOP, -3.0f);
void EnKarebaba_SetupAwaken(EnKarebaba* this) {
Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, 4.0f, 0.0f,
Animation_GetLastFrame(&gDekuBabaFastChompAnim), ANIMMODE_LOOP, -3.0f);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_WAKEUP);
this->actionFunc = func_808F1778;
this->actionFunc = EnKarebaba_Awaken;
}
void func_808F1778(EnKarebaba* this, PlayState* play) {
void EnKarebaba_Awaken(EnKarebaba* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.0005f) && (this->actor.params == ENKAREBABA_2)) {
func_808F1878(this);
if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.0005f) && (this->actor.params == KAREBABA_MINI)) {
EnKarebaba_SetupUpright(this);
}
this->actor.scale.z = this->actor.scale.x;
this->actor.scale.y = this->actor.scale.x;
this->actor.scale.y = this->actor.scale.z = this->actor.scale.x;
if ((this->actor.params == ENKAREBABA_1) &&
Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 60.0f, 5.0f)) {
func_808F1878(this);
EnKarebaba_SetupUpright(this);
}
this->actor.shape.rot.y += 0x1999;
this->actor.shape.rot.y += 0x10000 / 10;
EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL);
}
void func_808F1878(EnKarebaba* this) {
if (this->actionFunc != func_808F1A58) {
void EnKarebaba_SetupUpright(EnKarebaba* this) {
if (this->actionFunc != EnKarebaba_Spin) {
Actor_SetScale(&this->actor, 0.01f);
this->collider2.base.colType = COLTYPE_HIT6;
this->collider2.base.acFlags &= ~AC_HARD;
this->collider2.dim.radius = 15;
this->hurtCollider.base.colType = COLTYPE_HIT6;
this->hurtCollider.base.acFlags &= ~AC_HARD;
this->hurtCollider.dim.radius = 15;
if (this->actor.params == ENKAREBABA_1) {
this->collider2.dim.height = 80;
this->collider1.dim.height = 80;
this->hurtCollider.dim.height = 80;
this->attackCollider.dim.height = 80;
} else {
this->collider2.dim.height = 35;
this->collider1.dim.height = 35;
this->hurtCollider.dim.height = 35;
this->attackCollider.dim.height = 35;
}
}
this->unk_1EE = 40;
this->actionFunc = func_808F190C;
this->timer = 40;
this->actionFunc = EnKarebaba_Upright;
}
void func_808F190C(EnKarebaba* this, PlayState* play) {
void EnKarebaba_Upright(EnKarebaba* this, PlayState* play) {
Player* player = GET_PLAYER(play);
SkelAnime_Update(&this->skelAnime);
if (this->unk_1EE != 0) {
this->unk_1EE--;
if (this->timer != 0) {
this->timer--;
}
if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH);
}
if (this->collider2.base.acFlags & AC_HIT) {
func_808F13FC(this, play);
if (this->hurtCollider.base.acFlags & AC_HIT) {
EnKarebaba_SetDamageEffects(this, play);
if (this->actor.params == ENKAREBABA_1) {
func_808F1BF8(this);
EnKarebaba_SetupDying(this);
} else {
func_808F1FAC(this);
EnKarebaba_SetupShrinkDie(this);
}
Enemy_StartFinishingBlow(play, &this->actor);
} else if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 240.0f) {
func_808F220C(this);
} else if ((this->unk_1EE == 0) && (this->actor.params == ENKAREBABA_1)) {
func_808F1A3C(this);
EnKarebaba_SetupRetract(this);
} else if ((this->timer == 0) && (this->actor.params == ENKAREBABA_1)) {
EnKarebaba_SetupSpin(this);
}
}
void func_808F1A3C(EnKarebaba* this) {
this->unk_1EE = 40;
this->actionFunc = func_808F1A58;
void EnKarebaba_SetupSpin(EnKarebaba* this) {
this->timer = 40;
this->actionFunc = EnKarebaba_Spin;
}
void func_808F1A58(EnKarebaba* this, PlayState* play) {
s32 phi_v0;
f32 sp28;
void EnKarebaba_Spin(EnKarebaba* this, PlayState* play) {
s32 temp; // Used for cylinder radius and shape rotations
f32 headDistHorizontal;
if (this->unk_1EE != 0) {
this->unk_1EE--;
if (this->timer != 0) {
this->timer--;
}
SkelAnime_Update(&this->skelAnime);
@ -347,66 +350,66 @@ void func_808F1A58(EnKarebaba* this, PlayState* play) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH);
}
phi_v0 = 20 - this->unk_1EE;
phi_v0 = 20 - ABS_ALT(phi_v0);
if (phi_v0 > 10) {
phi_v0 = 10;
temp = 20 - this->timer;
temp = 20 - ABS_ALT(temp);
if (temp > 10) {
temp = 10;
}
this->collider1.dim.radius = sCylinderInit2.dim.radius + (phi_v0 * 2);
this->actor.shape.rot.x = 0xC000 - (phi_v0 << 8);
this->actor.shape.rot.y += phi_v0 * 0x2C0;
this->attackCollider.dim.radius = sAttackCylinderInit.dim.radius + (temp * 2);
this->actor.shape.rot.x = 0xC000 - temp * 0x100;
this->actor.shape.rot.y += temp * 0x2C0;
this->actor.world.pos.y = (Math_SinS(this->actor.shape.rot.x) * -60.0f) + this->actor.home.pos.y;
sp28 = Math_CosS(this->actor.shape.rot.x) * 60.0f;
this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y) * sp28) + this->actor.home.pos.x;
this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y) * sp28) + this->actor.home.pos.z;
headDistHorizontal = Math_CosS(this->actor.shape.rot.x) * 60.0f;
this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y) * headDistHorizontal) + this->actor.home.pos.x;
this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y) * headDistHorizontal) + this->actor.home.pos.z;
if (this->collider2.base.acFlags & AC_HIT) {
func_808F13FC(this, play);
func_808F1BF8(this);
if (this->hurtCollider.base.acFlags & AC_HIT) {
EnKarebaba_SetDamageEffects(this, play);
EnKarebaba_SetupDying(this);
Enemy_StartFinishingBlow(play, &this->actor);
} else if (this->unk_1EE == 0) {
func_808F1878(this);
} else if (this->timer == 0) {
EnKarebaba_SetupUpright(this);
}
}
void func_808F1BF8(EnKarebaba* this) {
void EnKarebaba_SetupDying(EnKarebaba* this) {
if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->unk_1EE = 0;
this->timer = 0;
this->actor.gravity = -0.8f;
this->actor.velocity.y = 4.0f;
this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
this->actor.speedXZ = 3.0f;
} else {
this->unk_1EE = 3;
this->timer = 3;
}
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_JR_DEAD);
this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20);
this->actionFunc = func_808F1C84;
this->actionFunc = EnKarebaba_Dying;
}
void func_808F1C84(EnKarebaba* this, PlayState* play) {
void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) {
s32 i;
Vec3f sp78;
f32 temp_f20;
f32 temp_f22;
f32 temp_f24;
Vec3f dustPos;
f32 xIncr;
f32 zIncr;
f32 yIncr;
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->unk_1EE--;
if (this->unk_1EE == 0) {
this->timer--;
if (this->timer == 0) {
this->actor.gravity = -0.8f;
this->actor.speedXZ = 3.0f;
this->actor.velocity.y = 4.0f;
this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
func_808F1374(this, play);
EnKarebaba_SpawnIceEffects(this, play);
}
} else {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f);
if (this->unk_1EE == 0) {
if (this->timer == 0) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C);
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL);
@ -422,156 +425,155 @@ void func_808F1C84(EnKarebaba* this, PlayState* play) {
if (this->actor.bgCheckFlags & 2) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK);
this->unk_1EE = 1;
this->timer = 1;
}
} else if (this->unk_1EE == 1) {
Math_Vec3f_Copy(&sp78, &this->actor.world.pos);
} else if (this->timer == 1) {
Math_Vec3f_Copy(&dustPos, &this->actor.world.pos);
temp_f24 = Math_SinS(this->actor.shape.rot.x) * 20.0f;
temp_f20 = (-20.0f * Math_CosS(this->actor.shape.rot.x)) * Math_SinS(this->actor.shape.rot.y);
temp_f22 = (-20.0f * Math_CosS(this->actor.shape.rot.x)) * Math_CosS(this->actor.shape.rot.y);
yIncr = Math_SinS(this->actor.shape.rot.x) * 20.0f;
xIncr = -20.0f * Math_CosS(this->actor.shape.rot.x) * Math_SinS(this->actor.shape.rot.y);
zIncr = -20.0f * Math_CosS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y);
for (i = 0; i < 4; i++) {
func_800B1210(play, &sp78, &gZeroVec3f, &gZeroVec3f, 500, 50);
sp78.x += temp_f20;
sp78.y += temp_f24;
sp78.z += temp_f22;
func_800B1210(play, &dustPos, &gZeroVec3f, &gZeroVec3f, 500, 50);
dustPos.x += xIncr;
dustPos.y += yIncr;
dustPos.z += zIncr;
}
func_800B1210(play, &this->actor.home.pos, &gZeroVec3f, &gZeroVec3f, 500, 100);
func_808F20FC(this, play);
EnKarebaba_SetupDeadItemDrop(this, play);
}
}
}
void func_808F1FAC(EnKarebaba* this) {
void EnKarebaba_SetupShrinkDie(EnKarebaba* this) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_JR_DEAD);
this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20);
this->actor.flags &= ~ACTOR_FLAG_1;
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->unk_1EE = 3;
this->timer = 3;
}
this->actionFunc = func_808F200C;
this->actionFunc = EnKarebaba_ShrinkDie;
}
void func_808F200C(EnKarebaba* this, PlayState* play) {
void EnKarebaba_ShrinkDie(EnKarebaba* this, PlayState* play) {
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->unk_1EE--;
if (this->unk_1EE == 0) {
func_808F1374(this, play);
this->timer--;
if (this->timer == 0) {
EnKarebaba_SpawnIceEffects(this, play);
}
} else {
if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0005f)) {
Item_DropCollectible(play, &this->actor.world.pos, ITEM00_NUTS_1);
func_808F238C(this);
EnKarebaba_SetupDead(this);
} else {
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL);
Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 1.0f);
}
this->actor.scale.y = this->actor.scale.x;
this->actor.scale.z = this->actor.scale.x;
this->actor.scale.z = this->actor.scale.y = this->actor.scale.x;
}
}
void func_808F20FC(EnKarebaba* this, PlayState* play) {
void EnKarebaba_SetupDeadItemDrop(EnKarebaba* this, PlayState* play) {
Actor_SetScale(&this->actor, 0.03f);
this->actor.shape.rot.x -= 0x4000;
this->actor.shape.yOffset = 1000.0f;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.shape.shadowScale = 3.0f;
func_800BC154(play, &play->actorCtx, &this->actor, 8);
this->unk_1EE = 200;
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_MISC);
this->timer = 200;
this->actor.flags &= ~ACTOR_FLAG_20;
this->drawDmgEffAlpha = 0.0f;
this->actionFunc = func_808F21A4;
this->actionFunc = EnKarebaba_DeadItemDrop;
}
void func_808F21A4(EnKarebaba* this, PlayState* play) {
if (this->unk_1EE != 0) {
this->unk_1EE--;
void EnKarebaba_DeadItemDrop(EnKarebaba* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
if (Actor_HasParent(&this->actor, play) || (this->unk_1EE == 0)) {
func_808F238C(this);
if (Actor_HasParent(&this->actor, play) || (this->timer == 0)) {
EnKarebaba_SetupDead(this);
} else {
Actor_PickUpNearby(&this->actor, play, GI_STICKS_1);
}
}
void func_808F220C(EnKarebaba* this) {
Animation_Change(&this->skelAnime, &object_dekubaba_Anim_0002B8, -3.0f,
Animation_GetLastFrame(&object_dekubaba_Anim_0002B8), 0.0f, ANIMMODE_ONCE, -3.0f);
func_808F152C(this);
this->actionFunc = func_808F228C;
void EnKarebaba_SetupRetract(EnKarebaba* this) {
Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, -3.0f, Animation_GetLastFrame(&gDekuBabaFastChompAnim),
0.0f, ANIMMODE_ONCE, -3.0f);
EnKarebaba_ResetColliders(this);
this->actionFunc = EnKarebaba_Retract;
}
void func_808F228C(EnKarebaba* this, PlayState* play) {
void EnKarebaba_Retract(EnKarebaba* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (Math_StepToF(&this->actor.scale.x, 0.005f, 0.0005f) && (this->actor.params == ENKAREBABA_2)) {
func_808F1648(this);
if (Math_StepToF(&this->actor.scale.x, 0.005f, 0.0005f) && (this->actor.params == KAREBABA_MINI)) {
EnKarebaba_SetupIdle(this);
}
this->actor.scale.z = this->actor.scale.x;
this->actor.scale.y = this->actor.scale.x;
this->actor.scale.y = this->actor.scale.z = this->actor.scale.x;
if ((this->actor.params == ENKAREBABA_1) &&
Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 14.0f, 5.0f)) {
func_808F1648(this);
EnKarebaba_SetupIdle(this);
}
this->actor.shape.rot.y += 0x1999;
this->actor.shape.rot.y += 0x10000 / 10;
EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL);
}
void func_808F238C(EnKarebaba* this) {
Animation_Change(&this->skelAnime, &object_dekubaba_Anim_0002B8, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f);
func_808F152C(this);
void EnKarebaba_SetupDead(EnKarebaba* this) {
Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f);
EnKarebaba_ResetColliders(this);
this->actor.shape.rot.x = -0x4000;
this->unk_1EE = 200;
this->timer = 200;
this->actor.parent = NULL;
this->actor.shape.shadowScale = 0.0f;
this->drawDmgEffAlpha = 0.0f;
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
this->actionFunc = func_808F254C;
this->actionFunc = EnKarebaba_Dead;
}
void func_808F241C(EnKarebaba* this, PlayState* play) {
f32 sp1C;
void EnKarebaba_Regrow(EnKarebaba* this, PlayState* play) {
f32 scale;
this->unk_1EE++;
sp1C = this->unk_1EE * 0.05f;
Actor_SetScale(&this->actor, 0.005f * sp1C);
this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * sp1C);
this->timer++;
scale = this->timer * 0.05f;
Actor_SetScale(&this->actor, 0.005f * scale);
this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * scale);
if (this->unk_1EE == 20) {
if (this->timer == 20) {
this->actor.flags &= ~ACTOR_FLAG_10;
this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_4);
if (this->actor.params == ENKAREBABA_1) {
func_800BC154(play, &play->actorCtx, &this->actor, 5);
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
}
func_808F1648(this);
EnKarebaba_SetupIdle(this);
}
}
void func_808F24F8(EnKarebaba* this) {
void EnKarebaba_SetupRegrow(EnKarebaba* this) {
this->actor.shape.yOffset = 0.0f;
this->actor.shape.shadowScale = 22.0f;
this->collider1.dim.radius = sCylinderInit2.dim.radius;
this->attackCollider.dim.radius = sAttackCylinderInit.dim.radius;
Actor_SetScale(&this->actor, 0.0f);
this->actionFunc = func_808F241C;
this->actionFunc = EnKarebaba_Regrow;
}
void func_808F254C(EnKarebaba* this, PlayState* play) {
void EnKarebaba_Dead(EnKarebaba* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (this->unk_1EE != 0) {
this->unk_1EE--;
if (this->timer != 0) {
this->timer--;
}
if (this->unk_1EE == 0) {
func_808F24F8(this);
if (this->timer == 0) {
EnKarebaba_SetupRegrow(this);
}
}
@ -591,30 +593,30 @@ void EnKarebaba_Update(Actor* thisx, PlayState* play2) {
} else {
this->drawDmgEffScale = this->drawDmgEffScale;
}
} else if (!Math_StepToF(&this->drawDmgEffFrozenSteamScale, 0.75f, 0.01875f)) {
} else if (!Math_StepToF(&this->drawDmgEffFrozenSteamScale, 0.75f, 0.75f / 40)) {
func_800B9010(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG);
}
}
if (this->actionFunc != func_808F254C) {
if (this->actionFunc == func_808F1C84) {
if (this->actionFunc != EnKarebaba_Dead) {
if (this->actionFunc == EnKarebaba_Dying) {
Actor_MoveWithGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 15.0f, 10.0f, 5);
} else {
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4);
if (this->unk_22C == 0) {
this->unk_22C = this->actor.floorPoly;
if (this->boundFloor == 0) {
this->boundFloor = this->actor.floorPoly;
}
}
if ((this->actionFunc != func_808F1C84) && (this->actionFunc != func_808F200C) &&
(this->actionFunc != func_808F21A4)) {
if ((this->actionFunc != func_808F241C) && (this->actionFunc != func_808F15B0)) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider1.base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider2.base);
if ((this->actionFunc != EnKarebaba_Dying) && (this->actionFunc != EnKarebaba_ShrinkDie) &&
(this->actionFunc != EnKarebaba_DeadItemDrop)) {
if ((this->actionFunc != EnKarebaba_Regrow) && (this->actionFunc != EnKarebaba_Grow)) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->attackCollider.base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->hurtCollider.base);
}
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->attackCollider.base);
Actor_SetFocus(&this->actor, (this->actor.scale.x * 10.0f) / 0.01f);
max = this->actor.home.pos.y + 40.0f;
@ -625,8 +627,8 @@ void EnKarebaba_Update(Actor* thisx, PlayState* play2) {
}
}
void func_808F280C(EnKarebaba* this, PlayState* play) {
MtxF sp40;
void EnKarebaba_DrawShadow(EnKarebaba* this, PlayState* play) {
MtxF mf;
OPEN_DISPS(play->state.gfxCtx);
@ -634,10 +636,9 @@ void func_808F280C(EnKarebaba* this, PlayState* play) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 255);
func_800C0094(this->unk_22C, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, &sp40);
Matrix_Mult(&sp40, MTXMODE_NEW);
func_800C0094(this->boundFloor, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, &mf);
Matrix_Mult(&mf, MTXMODE_NEW);
Matrix_Scale(0.15f, 1.0f, 0.15f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL);
@ -645,53 +646,53 @@ void func_808F280C(EnKarebaba* this, PlayState* play) {
}
void EnKarebaba_Draw(Actor* thisx, PlayState* play) {
static Color_RGBA8 sFogColor = { 0, 0, 0, 0 };
static Gfx* sStemDLists[] = { gDekuBabaStemTopDL, gDekuBabaStemMiddleDL, gDekuBabaStemBaseDL };
EnKarebaba* this = THIS;
s32 i;
s32 sp94;
s32 stemSections;
s16 limbCount;
f32 sp8C = 0.01f;
f32 scale = 0.01f;
OPEN_DISPS(play->state.gfxCtx);
func_8012C28C(play->state.gfxCtx);
Math_Vec3f_Copy(this->limbPos, &this->actor.world.pos);
Math_Vec3f_Copy(this->bodyPartsPos, &this->actor.world.pos);
if (this->actionFunc == func_808F21A4) {
if ((this->unk_1EE > 40) || (this->unk_1EE & 1)) {
if (this->actionFunc == EnKarebaba_DeadItemDrop) {
if ((this->timer > 40) || (this->timer & 1)) {
Matrix_Translate(0.0f, 0.0f, 200.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++, object_dekubaba_DL_003070);
gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStickDropDL);
}
} else if (this->actionFunc != func_808F254C) {
func_800AE2A0(play, &D_808F2E28, 1, 2);
} else if (this->actionFunc != EnKarebaba_Dead) {
func_800AE2A0(play, &sFogColor, 1, 2);
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL);
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
if ((this->actionFunc == func_808F241C) || (this->actionFunc == func_808F200C) ||
(this->actionFunc == func_808F15B0)) {
sp8C = this->unk_1EE * 0.0005f;
if ((this->actionFunc == EnKarebaba_Regrow) || (this->actionFunc == EnKarebaba_ShrinkDie) ||
(this->actionFunc == EnKarebaba_Grow)) {
scale = this->timer * 0.0005f;
}
Matrix_Scale(sp8C, sp8C, sp8C, MTXMODE_APPLY);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
Matrix_RotateZYX(this->actor.shape.rot.x, this->actor.shape.rot.y, 0, MTXMODE_APPLY);
if (this->actor.params == ENKAREBABA_2) {
sp94 = 1;
} else if (this->actionFunc == func_808F1C84) {
sp94 = 2;
if (this->actor.params == KAREBABA_MINI) {
stemSections = 1;
} else if (this->actionFunc == EnKarebaba_Dying) {
stemSections = 2;
} else {
sp94 = 3;
stemSections = 3;
}
for (i = 0; i < sp94; i++) {
for (i = 0; i < stemSections; i++) {
Matrix_Translate(0.0f, 0.0f, -2000.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++, D_808F2E2C[i]);
gSPDisplayList(POLY_OPA_DISP++, sStemDLists[i]);
Matrix_MultZero(&this->limbPos[1 + i]);
if ((i == 0) && (this->actionFunc == func_808F1C84)) {
Matrix_MultZero(&this->bodyPartsPos[1 + i]);
if ((i == 0) && (this->actionFunc == EnKarebaba_Dying)) {
Matrix_MultZero(&this->actor.focus.pos);
}
}
@ -699,41 +700,39 @@ void EnKarebaba_Draw(Actor* thisx, PlayState* play) {
func_800AE5A0(play);
}
func_800AE2A0(play, &D_808F2E28, 1, 2);
func_800AE2A0(play, &sFogColor, 1, 2);
Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW);
if (this->actionFunc != func_808F15B0) {
sp8C = 0.01f;
if (this->actionFunc != EnKarebaba_Grow) {
scale = 0.01f;
}
Matrix_Scale(sp8C, sp8C, sp8C, MTXMODE_APPLY);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
Matrix_RotateYS(this->actor.home.rot.y, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, object_dekubaba_DL_0010F0);
gSPDisplayList(POLY_OPA_DISP++, gDekuBabaBaseLeavesDL);
if (this->actionFunc == func_808F1C84) {
if (this->actionFunc == EnKarebaba_Dying) {
Matrix_RotateZYX(-0x4000, this->actor.shape.rot.y - this->actor.home.rot.y, 0, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, object_dekubaba_DL_001828);
gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStemBaseDL);
Matrix_MultZero(&this->limbPos[3]);
Matrix_MultZero(&this->bodyPartsPos[3]);
}
func_800AE5A0(play);
if (this->actor.params == ENKAREBABA_2) {
if (this->actor.params == KAREBABA_MINI) {
limbCount = 1;
} else {
limbCount = ARRAY_COUNT(this->limbPos);
limbCount = ARRAY_COUNT(this->bodyPartsPos);
}
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, limbCount, this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, limbCount, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
if (this->unk_22C != 0) {
func_808F280C(this, play);
if (this->boundFloor != 0) {
EnKarebaba_DrawShadow(this, play);
}
CLOSE_DISPS(play->state.gfxCtx);

View File

@ -2,32 +2,33 @@
#define Z_EN_KAREBABA_H
#include "global.h"
#include "objects/object_dekubaba/object_dekubaba.h"
struct EnKarebaba;
typedef void (*EnKarebabaActionFunc)(struct EnKarebaba*, PlayState*);
enum {
/* 0 */ ENKAREBABA_0,
/* 1 */ ENKAREBABA_1,
/* 2 */ ENKAREBABA_2,
};
typedef enum {
/* 0 */ ENKAREBABA_0, // Unused, always shrinks and drops a Deku Nut
/* 1 */ ENKAREBABA_1, // Drops sticks (Only type OoT has)
/* 2 */ KAREBABA_MINI,
} KarebabaType;
typedef struct EnKarebaba {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ EnKarebabaActionFunc actionFunc;
/* 0x18C */ Vec3s jointTable[8];
/* 0x1BC */ Vec3s morphTable[8];
/* 0x18C */ Vec3s jointTable[DEKUBABA_LIMB_MAX];
/* 0x1BC */ Vec3s morphTable[DEKUBABA_LIMB_MAX];
/* 0x1EC */ u8 drawDmgEffType;
/* 0x1EE */ s16 unk_1EE;
/* 0x1EE */ s16 timer;
/* 0x1F0 */ f32 drawDmgEffAlpha;
/* 0x1F4 */ f32 drawDmgEffScale;
/* 0x1F8 */ f32 drawDmgEffFrozenSteamScale;
/* 0x1FC */ Vec3f limbPos[4];
/* 0x22C */ CollisionPoly* unk_22C;
/* 0x230 */ ColliderCylinder collider1;
/* 0x27C */ ColliderCylinder collider2;
/* 0x1FC */ Vec3f bodyPartsPos[4];
/* 0x22C */ CollisionPoly* boundFloor;
/* 0x230 */ ColliderCylinder attackCollider;
/* 0x27C */ ColliderCylinder hurtCollider;
} EnKarebaba; // size = 0x2C8
#endif // Z_EN_KAREBABA_H

View File

@ -5901,48 +5901,48 @@
0x808B0F98:("EnAm_Draw",),
0x808B1330:("EnDekubaba_Init",),
0x808B1504:("EnDekubaba_Destroy",),
0x808B1530:("func_808B1530",),
0x808B15B8:("func_808B15B8",),
0x808B16BC:("func_808B16BC",),
0x808B1798:("func_808B1798",),
0x808B1814:("func_808B1814",),
0x808B18A8:("func_808B18A8",),
0x808B1B14:("func_808B1B14",),
0x808B1BC0:("func_808B1BC0",),
0x808B1CF0:("func_808B1CF0",),
0x808B2158:("func_808B2158",),
0x808B2240:("func_808B2240",),
0x808B2608:("func_808B2608",),
0x808B2660:("func_808B2660",),
0x808B2890:("func_808B2890",),
0x808B28B4:("func_808B28B4",),
0x808B2980:("func_808B2980",),
0x808B29C4:("func_808B29C4",),
0x808B2C40:("func_808B2C40",),
0x808B2CB8:("func_808B2CB8",),
0x808B3044:("func_808B3044",),
0x808B3078:("func_808B3078",),
0x808B3170:("func_808B3170",),
0x808B3280:("func_808B3280",),
0x808B3390:("func_808B3390",),
0x808B3404:("func_808B3404",),
0x808B3768:("func_808B3768",),
0x808B37E8:("func_808B37E8",),
0x808B39AC:("func_808B39AC",),
0x808B3B48:("func_808B3B48",),
0x808B3BE4:("func_808B3BE4",),
0x808B3C50:("func_808B3C50",),
0x808B3D74:("func_808B3D74",),
0x808B3DA8:("func_808B3DA8",),
0x808B3E40:("func_808B3E40",),
0x808B3EE8:("func_808B3EE8",),
0x808B3F50:("func_808B3F50",),
0x808B1530:("EnDekubaba_DisableHitboxes",),
0x808B15B8:("EnDekubaba_UpdateHeadPosition",),
0x808B16BC:("EnDekubaba_SetFireLightEffects",),
0x808B1798:("EnDekubaba_SetFrozenEffects",),
0x808B1814:("EnDekubaba_SpawnIceEffects",),
0x808B18A8:("EnDekubaba_SetupWait",),
0x808B1B14:("EnDekubaba_Wait",),
0x808B1BC0:("EnDekubaba_SetupGrow",),
0x808B1CF0:("EnDekubaba_Grow",),
0x808B2158:("EnDekubaba_SetupRetract",),
0x808B2240:("EnDekubaba_Retract",),
0x808B2608:("EnDekubaba_SetupDecideLunge",),
0x808B2660:("EnDekubaba_DecideLunge",),
0x808B2890:("EnDekubaba_SetupPrepareLunge",),
0x808B28B4:("EnDekubaba_PrepareLunge",),
0x808B2980:("EnDekubaba_SetupLunge",),
0x808B29C4:("EnDekubaba_Lunge",),
0x808B2C40:("EnDekubaba_SetupPullBack",),
0x808B2CB8:("EnDekubaba_PullBack",),
0x808B3044:("EnDekubaba_SetupRecover",),
0x808B3078:("EnDekubaba_Recover",),
0x808B3170:("EnDekubaba_SetupHit",),
0x808B3280:("EnDekubaba_Hit",),
0x808B3390:("EnDekubaba_SetupPrunedSomersaultDie",),
0x808B3404:("EnDekubaba_PrunedSomersaultDie",),
0x808B3768:("EnDekubaba_SetupShrinkDie",),
0x808B37E8:("EnDekubaba_ShrinkDie",),
0x808B39AC:("EnDekubaba_SetupStunnedVertical",),
0x808B3B48:("EnDekubaba_StunnedVertical",),
0x808B3BE4:("EnDekubaba_SetupSway",),
0x808B3C50:("EnDekubaba_Sway",),
0x808B3D74:("EnDekubaba_SetupFrozen",),
0x808B3DA8:("EnDekubaba_Frozen",),
0x808B3E40:("EnDekubaba_SetupDeadStickDrop",),
0x808B3EE8:("EnDekubaba_DeadStickDrop",),
0x808B3F50:("EnDekubaba_UpdateDamage",),
0x808B42FC:("EnDekubaba_Update",),
0x808B4548:("func_808B4548",),
0x808B465C:("func_808B465C",),
0x808B48FC:("func_808B48FC",),
0x808B49C8:("func_808B49C8",),
0x808B4ABC:("func_808B4ABC",),
0x808B4548:("EnDekubaba_DrawStemRetracted",),
0x808B465C:("EnDekubaba_DrawStemExtended",),
0x808B48FC:("EnDekubaba_DrawStemBasePruned",),
0x808B49C8:("EnDekubaba_DrawShadow",),
0x808B4ABC:("EnDekubaba_PostLimbDraw",),
0x808B4AF8:("EnDekubaba_Draw",),
0x808B5230:("EnMFire1_Init",),
0x808B5294:("EnMFire1_Destroy",),
@ -6675,33 +6675,33 @@
0x808ED3F4:("func_808ED3F4",),
0x808F1200:("EnKarebaba_Init",),
0x808F1334:("EnKarebaba_Destroy",),
0x808F1374:("func_808F1374",),
0x808F13FC:("func_808F13FC",),
0x808F152C:("func_808F152C",),
0x808F155C:("func_808F155C",),
0x808F15B0:("func_808F15B0",),
0x808F1648:("func_808F1648",),
0x808F169C:("func_808F169C",),
0x808F16FC:("func_808F16FC",),
0x808F1778:("func_808F1778",),
0x808F1878:("func_808F1878",),
0x808F190C:("func_808F190C",),
0x808F1A3C:("func_808F1A3C",),
0x808F1A58:("func_808F1A58",),
0x808F1BF8:("func_808F1BF8",),
0x808F1C84:("func_808F1C84",),
0x808F1FAC:("func_808F1FAC",),
0x808F200C:("func_808F200C",),
0x808F20FC:("func_808F20FC",),
0x808F21A4:("func_808F21A4",),
0x808F220C:("func_808F220C",),
0x808F228C:("func_808F228C",),
0x808F238C:("func_808F238C",),
0x808F241C:("func_808F241C",),
0x808F24F8:("func_808F24F8",),
0x808F254C:("func_808F254C",),
0x808F1374:("EnKarebaba_SpawnIceEffects",),
0x808F13FC:("EnKarebaba_SetDamageEffects",),
0x808F152C:("EnKarebaba_ResetColliders",),
0x808F155C:("EnKarebaba_SetupGrow",),
0x808F15B0:("EnKarebaba_Grow",),
0x808F1648:("EnKarebaba_SetupIdle",),
0x808F169C:("EnKarebaba_Idle",),
0x808F16FC:("EnKarebaba_SetupAwaken",),
0x808F1778:("EnKarebaba_Awaken",),
0x808F1878:("EnKarebaba_SetupUpright",),
0x808F190C:("EnKarebaba_Upright",),
0x808F1A3C:("EnKarebaba_SetupSpin",),
0x808F1A58:("EnKarebaba_Spin",),
0x808F1BF8:("EnKarebaba_SetupDying",),
0x808F1C84:("EnKarebaba_Dying",),
0x808F1FAC:("EnKarebaba_SetupShrinkDie",),
0x808F200C:("EnKarebaba_ShrinkDie",),
0x808F20FC:("EnKarebaba_SetupDeadItemDrop",),
0x808F21A4:("EnKarebaba_DeadItemDrop",),
0x808F220C:("EnKarebaba_SetupRetract",),
0x808F228C:("EnKarebaba_Retract",),
0x808F238C:("EnKarebaba_SetupDead",),
0x808F241C:("EnKarebaba_Regrow",),
0x808F24F8:("EnKarebaba_SetupRegrow",),
0x808F254C:("EnKarebaba_Dead",),
0x808F25A4:("EnKarebaba_Update",),
0x808F280C:("func_808F280C",),
0x808F280C:("EnKarebaba_DrawShadow",),
0x808F28F8:("EnKarebaba_Draw",),
0x808F30B0:("EnIn_ChangeAnim",),
0x808F3178:("func_808F3178",),

View File

@ -6431,15 +6431,15 @@
0x808B11B0:("D_808B11B0","f32","",0x4),
0x808B11B4:("D_808B11B4","f32","",0x4),
0x808B11B8:("D_808B11B8","f32","",0x4),
0x808B4D40:("En_Dekubaba_InitVars","UNK_TYPE1","",0x1),
0x808B4D60:("D_808B4D60","UNK_TYPE1","",0x1),
0x808B4E5C:("D_808B4E5C","UNK_TYPE1","",0x1),
0x808B4E6C:("D_808B4E6C","UNK_TYPE1","",0x1),
0x808B4E74:("D_808B4E74","UNK_TYPE1","",0x1),
0x808B4E94:("D_808B4E94","UNK_TYPE1","",0x1),
0x808B4E98:("D_808B4E98","UNK_TYPE1","",0x1),
0x808B4E9C:("D_808B4E9C","UNK_TYPE1","",0x1),
0x808B4EA0:("D_808B4EA0","UNK_PTR","",0x4),
0x808B4D40:("En_Dekubaba_InitVars","ActorInit","",0x20),
0x808B4D60:("sJntSphElementsInit","ColliderJntSphElementInit","[7]",0xFC),
0x808B4E5C:("sJntSphInit","ColliderJntSphInit","",0x10),
0x808B4E6C:("sColChkInfoInit","CollisionCheckInfoInit","",0x4),
0x808B4E74:("sDamageTable","DamageTable","",0x20),
0x808B4E94:("sInitChain","InitChainEntry","[1]",0x4),
0x808B4E98:("sDustPrimColor","Color_RGBA8","",0x4),
0x808B4E9C:("sDustEnvColor","Color_RGBA8","",0x4),
0x808B4EA0:("sStemDLists","Gfx*","[3]",0xC),
0x808B4EB0:("D_808B4EB0","f32","",0x4),
0x808B4EB4:("D_808B4EB4","f32","",0x4),
0x808B4EB8:("D_808B4EB8","f32","",0x4),
@ -7197,8 +7197,8 @@
0x808F2DF8:("D_808F2DF8","UNK_TYPE1","",0x1),
0x808F2E00:("D_808F2E00","UNK_TYPE1","",0x1),
0x808F2E20:("D_808F2E20","UNK_TYPE1","",0x1),
0x808F2E28:("D_808F2E28","UNK_TYPE1","",0x1),
0x808F2E2C:("D_808F2E2C","UNK_PTR","",0x4),
0x808F2E28:("sFogColor","Color_RGBA8","",0x4),
0x808F2E2C:("sStemDLists","Gfx*","[3]",0xC),
0x808F2E40:("D_808F2E40","f32","",0x4),
0x808F2E44:("D_808F2E44","f32","",0x4),
0x808F2E48:("D_808F2E48","f32","",0x4),

View File

@ -780,16 +780,6 @@ D_0600CB2C = 0x0600CB2C;
D_0600CB84 = 0x0600CB84;
D_0600CBC0 = 0x0600CBC0;
// ovl_En_Dekubaba
D_06000208 = 0x06000208;
D_060002B8 = 0x060002B8;
D_060010F0 = 0x060010F0;
D_06001330 = 0x06001330;
D_06001828 = 0x06001828;
D_06002A40 = 0x06002A40;
D_06003070 = 0x06003070;
// ovl_En_Dnh
D_06002950 = 0x06002950;