mirror of https://github.com/zeldaret/mm.git
[Doc] Actor En_Bee - Giant Bee (#1089)
* all functions matching * initial cleanup * tatl hint * clean up + SFX * SFX * more SFX * func_800B3030 * SFX FIX * castings * clean up * array of Vec3f * for loop fix (Thanks @Maide) * ACTORCAT_ITEMACTION * docs for giant bee actor * tidy up * run format.sh * rename idle anim to flying * address review comments for names * make format check happy * wrap modulo in parens Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * clearer cast to f32 Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * comments to object xml * Update src/overlays/actors/ovl_En_Bee/z_en_bee.c Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * Update src/overlays/actors/ovl_En_Bee/z_en_bee.c Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * better names for some temp variables Co-authored-by: sonicdcer <alejandro.asenjo88@gmail.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
This commit is contained in:
parent
8e6843f04e
commit
d745cccf87
|
@ -1,28 +1,38 @@
|
|||
<Root>
|
||||
<!-- Object for Bee -->
|
||||
<File Name="object_bee" Segment="6">
|
||||
<Animation Name="object_bee_Anim_00005C" Offset="0x5C" />
|
||||
<DList Name="object_bee_DL_000550" Offset="0x550" />
|
||||
<DList Name="object_bee_DL_000780" Offset="0x780" />
|
||||
<DList Name="object_bee_DL_000848" Offset="0x848" />
|
||||
<DList Name="object_bee_DL_000918" Offset="0x918" />
|
||||
<DList Name="object_bee_DL_0009D0" Offset="0x9D0" />
|
||||
<Texture Name="object_bee_TLUT_000A88" OutName="tlut_000A88" Format="rgba16" Width="4" Height="4" Offset="0xA88" />
|
||||
<Texture Name="object_bee_TLUT_000AA8" OutName="tlut_000AA8" Format="rgba16" Width="4" Height="4" Offset="0xAA8" />
|
||||
<Texture Name="object_bee_TLUT_000AC8" OutName="tlut_000AC8" Format="rgba16" Width="4" Height="4" Offset="0xAC8" />
|
||||
<Texture Name="object_bee_TLUT_000AE8" OutName="tlut_000AE8" Format="rgba16" Width="4" Height="4" Offset="0xAE8" />
|
||||
<Texture Name="object_bee_Tex_000B08" OutName="tex_000B08" Format="ci4" Width="32" Height="32" Offset="0xB08" />
|
||||
<Texture Name="object_bee_Tex_000D08" OutName="tex_000D08" Format="ci4" Width="32" Height="32" Offset="0xD08" />
|
||||
<Texture Name="object_bee_Tex_000F08" OutName="tex_000F08" Format="ci4" Width="32" Height="32" Offset="0xF08" />
|
||||
<Texture Name="object_bee_Tex_001108" OutName="tex_001108" Format="ci4" Width="32" Height="32" Offset="0x1108" />
|
||||
<Limb Name="object_bee_Standardlimb_001308" Type="Standard" EnumName="OBJECT_BEE_LIMB_01" Offset="0x1308" />
|
||||
<Limb Name="object_bee_Standardlimb_001314" Type="Standard" EnumName="OBJECT_BEE_LIMB_02" Offset="0x1314" />
|
||||
<Limb Name="object_bee_Standardlimb_001320" Type="Standard" EnumName="OBJECT_BEE_LIMB_03" Offset="0x1320" />
|
||||
<Limb Name="object_bee_Standardlimb_00132C" Type="Standard" EnumName="OBJECT_BEE_LIMB_04" Offset="0x132C" />
|
||||
<Limb Name="object_bee_Standardlimb_001338" Type="Standard" EnumName="OBJECT_BEE_LIMB_05" Offset="0x1338" />
|
||||
<Limb Name="object_bee_Standardlimb_001344" Type="Standard" EnumName="OBJECT_BEE_LIMB_06" Offset="0x1344" />
|
||||
<Limb Name="object_bee_Standardlimb_001350" Type="Standard" EnumName="OBJECT_BEE_LIMB_07" Offset="0x1350" />
|
||||
<Limb Name="object_bee_Standardlimb_00135C" Type="Standard" EnumName="OBJECT_BEE_LIMB_08" Offset="0x135C" />
|
||||
<Limb Name="object_bee_Standardlimb_001368" Type="Standard" EnumName="OBJECT_BEE_LIMB_09" Offset="0x1368" />
|
||||
<Skeleton Name="object_bee_Skel_001398" Type="Normal" LimbType="Standard" LimbNone="OBJECT_BEE_LIMB_NONE" LimbMax="OBJECT_BEE_LIMB_MAX" EnumName="ObjectBeeLimb" Offset="0x1398" />
|
||||
<!-- Bee Animations -->
|
||||
<Animation Name="gBeeFlyingAnim" Offset="0x5C" />
|
||||
|
||||
<!-- Bee Limb DisplayLists -->
|
||||
<DList Name="gBeeBodyDL" Offset="0x550" />
|
||||
<DList Name="gBeeHeadDL" Offset="0x780" />
|
||||
<DList Name="gBeeAntennaeDL" Offset="0x848" />
|
||||
<DList Name="gBeeRightWingDL" Offset="0x918" />
|
||||
<DList Name="gBeeLeftWingDL" Offset="0x9D0" />
|
||||
|
||||
<!-- Bee Textures -->
|
||||
<Texture Name="gBeeWingTLUT" OutName="bee_wing_tlut" Format="rgba16" Width="4" Height="4" Offset="0xA88" />
|
||||
<Texture Name="gBeeHeadTLUT" OutName="bee_head_tlut" Format="rgba16" Width="4" Height="4" Offset="0xAA8" />
|
||||
<Texture Name="gBeeBodyTLUT" OutName="bee_body_tlut" Format="rgba16" Width="4" Height="4" Offset="0xAC8" />
|
||||
<Texture Name="gBeeAntennaeTLUT" OutName="bee_antennae_tlut" Format="rgba16" Width="4" Height="4" Offset="0xAE8" />
|
||||
<Texture Name="gBeeWingTex" OutName="bee_wing" Format="ci4" Width="32" Height="32" Offset="0xB08" />
|
||||
<Texture Name="gBeeHeadTex" OutName="bee_head" Format="ci4" Width="32" Height="32" Offset="0xD08" />
|
||||
<Texture Name="gBeeBodyTex" OutName="bee_body" Format="ci4" Width="32" Height="32" Offset="0xF08" />
|
||||
<Texture Name="gBeeAntennaeTex" OutName="bee_antennae" Format="ci4" Width="32" Height="32" Offset="0x1108" />
|
||||
|
||||
<!-- Bee Limbs -->
|
||||
<Limb Name="gBeeRootLimb" Type="Standard" EnumName="OBJECT_BEE_LIMB_ROOT" Offset="0x1308" />
|
||||
<Limb Name="gBeeWingsRootLimb" Type="Standard" EnumName="OBJECT_BEE_LIMB_WINGS_ROOT" Offset="0x1314" />
|
||||
<Limb Name="gBeeLeftWingRootLimb" Type="Standard" EnumName="OBJECT_BEE_LIMB_LEFT_WING_ROOT" Offset="0x1320" />
|
||||
<Limb Name="gBeeLeftWingLimb" Type="Standard" EnumName="OBJECT_BEE_LIMB_LEFT_WING" Offset="0x132C" />
|
||||
<Limb Name="gBeeRightWingRootLimb" Type="Standard" EnumName="OBJECT_BEE_LIMB_RIGHT_WING_ROOT" Offset="0x1338" />
|
||||
<Limb Name="gBeeRightWingLimb" Type="Standard" EnumName="OBJECT_BEE_LIMB_RIGHT_WING" Offset="0x1344" />
|
||||
<Limb Name="gBeeBodyLimb" Type="Standard" EnumName="OBJECT_BEE_LIMB_BODY" Offset="0x1350" />
|
||||
<Limb Name="gBeeAntennaeLimb" Type="Standard" EnumName="OBJECT_BEE_LIMB_ANTENNAE" Offset="0x135C" />
|
||||
<Limb Name="gBeeHeadLimb" Type="Standard" EnumName="OBJECT_BEE_LIMB_HEAD" Offset="0x1368" />
|
||||
|
||||
<!-- Bee Skeleton -->
|
||||
<Skeleton Name="gBeeSkel" Type="Normal" LimbType="Standard" LimbNone="OBJECT_BEE_LIMB_NONE" LimbMax="OBJECT_BEE_LIMB_MAX" EnumName="ObjectBeeLimb" Offset="0x1398" />
|
||||
</File>
|
||||
</Root>
|
||||
|
|
|
@ -31,7 +31,7 @@ const ActorInit Dm_Char09_InitVars = {
|
|||
};
|
||||
|
||||
static AnimationInfo sAnimationInfo[] = {
|
||||
{ &object_bee_Anim_00005C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
|
||||
{ &gBeeFlyingAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
|
||||
};
|
||||
|
||||
void DmChar09_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 animIndex) {
|
||||
|
@ -53,8 +53,8 @@ void DmChar09_Init(Actor* thisx, PlayState* play) {
|
|||
DmChar09* this = THIS;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f);
|
||||
SkelAnime_Init(play, &this->skelAnime, &object_bee_Skel_001398, &object_bee_Anim_00005C, this->jointTable,
|
||||
this->morphTable, OBJECT_BEE_LIMB_MAX);
|
||||
SkelAnime_Init(play, &this->skelAnime, &gBeeSkel, &gBeeFlyingAnim, this->jointTable, this->morphTable,
|
||||
OBJECT_BEE_LIMB_MAX);
|
||||
DmChar09_ChangeAnim(&this->skelAnime, sAnimationInfo, 0);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->unk_228 = Rand_ZeroOne() * 65535.0f;
|
||||
|
|
|
@ -15,12 +15,12 @@ void EnBee_Destroy(Actor* thisx, PlayState* play);
|
|||
void EnBee_Update(Actor* thisx, PlayState* play);
|
||||
void EnBee_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_80B5A9E8(EnBee* this, PlayState* play);
|
||||
void func_80B5AC3C(EnBee* this, PlayState* play);
|
||||
void func_80B5A854(EnBee* this);
|
||||
void func_80B5ABC4(EnBee* this);
|
||||
void EnBee_SetupFlyIdle(EnBee* this);
|
||||
void EnBee_FlyIdle(EnBee* this, PlayState* play);
|
||||
void EnBee_SetupAttack(EnBee* this);
|
||||
void EnBee_Attack(EnBee* this, PlayState* play);
|
||||
|
||||
s32 D_80B5B1F0 = 0;
|
||||
s32 sNumLoadedBees = 0;
|
||||
|
||||
const ActorInit En_Bee_InitVars = {
|
||||
ACTOR_EN_BEE,
|
||||
|
@ -94,14 +94,14 @@ void EnBee_Init(Actor* thisx, PlayState* play) {
|
|||
|
||||
this->actor.colChkInfo.mass = 10;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f);
|
||||
SkelAnime_Init(play, &this->skelAnime, &object_bee_Skel_001398, &object_bee_Anim_00005C, this->morphTable,
|
||||
this->jointTable, OBJECT_BEE_LIMB_MAX);
|
||||
SkelAnime_Init(play, &this->skelAnime, &gBeeSkel, &gBeeFlyingAnim, this->morphTable, this->jointTable,
|
||||
OBJECT_BEE_LIMB_MAX);
|
||||
this->actor.colChkInfo.health = 1;
|
||||
this->actor.colChkInfo.damageTable = &sDamageTable;
|
||||
this->actor.targetMode = 6;
|
||||
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->unk_218 = D_80B5B1F0;
|
||||
D_80B5B1F0++;
|
||||
this->instanceId = sNumLoadedBees;
|
||||
sNumLoadedBees++;
|
||||
this->actor.shape.shadowScale = 12.0f;
|
||||
|
||||
if (ActorCutscene_GetCurrentIndex() != -1) {
|
||||
|
@ -109,7 +109,7 @@ void EnBee_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
this->actor.hintId = TATL_HINT_ID_GIANT_BEE;
|
||||
func_80B5A854(this);
|
||||
EnBee_SetupFlyIdle(this);
|
||||
}
|
||||
|
||||
void EnBee_Destroy(Actor* thisx, PlayState* play) {
|
||||
|
@ -118,121 +118,122 @@ void EnBee_Destroy(Actor* thisx, PlayState* play) {
|
|||
Collider_DestroyCylinder(play, &this->collider);
|
||||
}
|
||||
|
||||
void func_80B5A854(EnBee* this) {
|
||||
void EnBee_SetupFlyIdle(EnBee* this) {
|
||||
s32 pad;
|
||||
Vec3f sp48;
|
||||
s16 sp46;
|
||||
Vec3f tempPos;
|
||||
s16 yawOffset;
|
||||
|
||||
Animation_Change(&this->skelAnime, &object_bee_Anim_00005C, 1.0f, 0.0f,
|
||||
Animation_GetLastFrame(&object_bee_Anim_00005C), 0, -10.0f);
|
||||
Math_Vec3f_Copy(&sp48, &this->actor.home.pos);
|
||||
Animation_Change(&this->skelAnime, &gBeeFlyingAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gBeeFlyingAnim), 0, -10.0f);
|
||||
Math_Vec3f_Copy(&tempPos, &this->actor.home.pos);
|
||||
|
||||
sp46 = (this->unk_218 * 0x700) + 0x2000;
|
||||
sp48.x += Math_SinS(sp46) * 50.0f;
|
||||
sp48.y = Rand_ZeroFloat(50.0f) + (this->actor.floorHeight + 30.0f);
|
||||
sp48.z += Math_CosS(sp46) * 50.0f;
|
||||
yawOffset = (this->instanceId * 0x700) + 0x2000;
|
||||
tempPos.x += Math_SinS(yawOffset) * 50.0f;
|
||||
tempPos.y = Rand_ZeroFloat(50.0f) + (this->actor.floorHeight + 30.0f);
|
||||
tempPos.z += Math_CosS(yawOffset) * 50.0f;
|
||||
|
||||
Math_Vec3f_Copy(&this->unk_21C[0], &sp48);
|
||||
Math_Vec3f_Copy(&sp48, &this->actor.home.pos);
|
||||
Math_Vec3f_Copy(&this->targetPos[0], &tempPos);
|
||||
Math_Vec3f_Copy(&tempPos, &this->actor.home.pos);
|
||||
|
||||
sp48.x += Math_SinS(sp46 - 0x4000) * 50.0f;
|
||||
sp48.y = Rand_ZeroFloat(50.0f) + (this->actor.floorHeight + 30.0f);
|
||||
sp48.z += Math_CosS(sp46 - 0x4000) * 50.0f;
|
||||
tempPos.x += Math_SinS(yawOffset - 0x4000) * 50.0f;
|
||||
tempPos.y = Rand_ZeroFloat(50.0f) + (this->actor.floorHeight + 30.0f);
|
||||
tempPos.z += Math_CosS(yawOffset - 0x4000) * 50.0f;
|
||||
|
||||
Math_Vec3f_Copy(&this->unk_21C[1], &sp48);
|
||||
Math_Vec3f_Copy(&this->targetPos[1], &tempPos);
|
||||
|
||||
this->unk_204 = Rand_S16Offset(0x14, 0x1E);
|
||||
this->unk_208 = 0;
|
||||
this->actionFunc = func_80B5A9E8;
|
||||
this->attackDelayTimer = Rand_S16Offset(20, 30);
|
||||
this->isHostile = false;
|
||||
this->actionFunc = EnBee_FlyIdle;
|
||||
}
|
||||
|
||||
void func_80B5A9E8(EnBee* this, PlayState* play) {
|
||||
Vec3f sp3C;
|
||||
void EnBee_FlyIdle(EnBee* this, PlayState* play) {
|
||||
Vec3f nextPos;
|
||||
s32 pad[2];
|
||||
|
||||
if ((this->actor.category != ACTORCAT_ENEMY) && (ActorCutscene_GetCurrentIndex() == -1)) {
|
||||
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
|
||||
}
|
||||
|
||||
Math_Vec3f_Copy(&sp3C, &this->unk_21C[this->unk_214]);
|
||||
sp3C.x += Math_SinS(this->unk_20C) * 30.0f;
|
||||
sp3C.z += Math_CosS(this->unk_20C) * 30.0f;
|
||||
Math_Vec3f_Copy(&nextPos, &this->targetPos[this->posIndex]);
|
||||
nextPos.x += Math_SinS(this->targetYaw) * 30.0f;
|
||||
nextPos.z += Math_CosS(this->targetYaw) * 30.0f;
|
||||
|
||||
if (!(this->unk_218 & 1)) {
|
||||
this->unk_20C += (s16)((s32)randPlusMinusPoint5Scaled(1000.0f) + 4000);
|
||||
if ((this->instanceId % 2) == 0) {
|
||||
this->targetYaw += (s16)((s32)randPlusMinusPoint5Scaled(1000.0f) + 4000);
|
||||
} else {
|
||||
this->unk_20C -= (s16)((s32)randPlusMinusPoint5Scaled(1000.0f) + 4000);
|
||||
this->targetYaw -= (s16)((s32)randPlusMinusPoint5Scaled(1000.0f) + 4000);
|
||||
}
|
||||
|
||||
this->unk_210 += 1000;
|
||||
this->actor.velocity.y = Math_SinS(this->unk_210);
|
||||
this->flightHoverOffset += 1000;
|
||||
this->actor.velocity.y = Math_SinS(this->flightHoverOffset);
|
||||
|
||||
if (this->unk_20C > 0x10000) {
|
||||
this->unk_20C = 0;
|
||||
this->unk_214++;
|
||||
this->unk_214 &= 1;
|
||||
if (this->targetYaw > 0x10000) {
|
||||
this->targetYaw = 0;
|
||||
this->posIndex++;
|
||||
this->posIndex &= 1;
|
||||
}
|
||||
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp3C), 1, 0x7D0, 0);
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &nextPos), 1, 0x7D0, 0);
|
||||
Math_ApproachF(&this->actor.speedXZ, 3.0f, 0.3f, 1.0f);
|
||||
|
||||
if ((this->unk_204 == 0) && (this->actor.params != 0)) {
|
||||
func_80B5ABC4(this);
|
||||
if ((this->attackDelayTimer == 0) && (this->actor.params != BEE_BEHAVIOR_IDLE)) {
|
||||
EnBee_SetupAttack(this);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80B5ABC4(EnBee* this) {
|
||||
Animation_Change(&this->skelAnime, &object_bee_Anim_00005C, 1.0f, 0.0f,
|
||||
Animation_GetLastFrame(&object_bee_Anim_00005C), 0, -10.0f);
|
||||
this->unk_208 = 1;
|
||||
this->actionFunc = func_80B5AC3C;
|
||||
void EnBee_SetupAttack(EnBee* this) {
|
||||
Animation_Change(&this->skelAnime, &gBeeFlyingAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gBeeFlyingAnim), 0, -10.0f);
|
||||
this->isHostile = true;
|
||||
this->actionFunc = EnBee_Attack;
|
||||
}
|
||||
|
||||
void func_80B5AC3C(EnBee* this, PlayState* play) {
|
||||
void EnBee_Attack(EnBee* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
Vec3f sp88;
|
||||
f32 rnd;
|
||||
f32 phi_fs1;
|
||||
Vec3f nextPos;
|
||||
f32 rand;
|
||||
f32 yawOffset;
|
||||
s32 i;
|
||||
|
||||
Math_Vec3f_Copy(&sp88, &player->actor.world.pos);
|
||||
phi_fs1 = (this->unk_218 * 0x700) + 0x2000;
|
||||
Math_Vec3f_Copy(&nextPos, &player->actor.world.pos);
|
||||
yawOffset = (this->instanceId * 0x700) + 0x2000;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
rnd = randPlusMinusPoint5Scaled(20.0f);
|
||||
sp88.x += Math_SinS((this->actor.yawTowardsPlayer + ((f32)this->unk_20C)) + phi_fs1) * (rnd + 30.0f);
|
||||
sp88.y = (Math_SinS(this->unk_210) * 10.0f) + (player->actor.floorHeight + 40.0f);
|
||||
rnd = randPlusMinusPoint5Scaled(20.0f);
|
||||
sp88.z += Math_CosS((f32)this->actor.yawTowardsPlayer + this->unk_20C + phi_fs1) * (rnd + 30.0f);
|
||||
Math_Vec3f_Copy(&this->unk_21C[i], &sp88);
|
||||
phi_fs1 -= 16384.0f;
|
||||
rand = randPlusMinusPoint5Scaled(20.0f);
|
||||
nextPos.x += Math_SinS((f32)this->actor.yawTowardsPlayer + this->targetYaw + yawOffset) * (rand + 30.0f);
|
||||
nextPos.y = (Math_SinS(this->flightHoverOffset) * 10.0f) + (player->actor.floorHeight + 40.0f);
|
||||
rand = randPlusMinusPoint5Scaled(20.0f);
|
||||
|
||||
nextPos.z += Math_CosS((f32)this->actor.yawTowardsPlayer + this->targetYaw + yawOffset) * (rand + 30.0f);
|
||||
Math_Vec3f_Copy(&this->targetPos[i], &nextPos);
|
||||
yawOffset -= 0x4000;
|
||||
}
|
||||
|
||||
Math_Vec3f_Copy(&sp88, &this->unk_21C[this->unk_214]);
|
||||
Math_Vec3f_Copy(&nextPos, &this->targetPos[this->posIndex]);
|
||||
|
||||
if (!(this->unk_218 & 1)) {
|
||||
this->unk_20C += (this->unk_218 * 0x700) + (s32)randPlusMinusPoint5Scaled((this->unk_218 * 0x700) * 0.5f);
|
||||
if ((this->instanceId % 2) == 0) {
|
||||
this->targetYaw +=
|
||||
(this->instanceId * 0x700) + (s32)randPlusMinusPoint5Scaled((this->instanceId * 0x700) * 0.5f);
|
||||
} else {
|
||||
this->unk_20C -= (this->unk_218 * 0x700) + (s32)randPlusMinusPoint5Scaled((this->unk_218 * 0x700) * 0.5f);
|
||||
this->targetYaw -=
|
||||
(this->instanceId * 0x700) + (s32)randPlusMinusPoint5Scaled((this->instanceId * 0x700) * 0.5f);
|
||||
}
|
||||
|
||||
this->unk_210 += (s32)randPlusMinusPoint5Scaled(500.0f) + 1000;
|
||||
this->flightHoverOffset += (s32)randPlusMinusPoint5Scaled(500.0f) + 1000;
|
||||
|
||||
if (this->unk_20C > 0x10000) {
|
||||
this->unk_20C = 0;
|
||||
this->unk_214++;
|
||||
this->unk_214 &= 1;
|
||||
if (this->targetYaw > 0x10000) {
|
||||
this->targetYaw = 0;
|
||||
this->posIndex++;
|
||||
this->posIndex &= 1;
|
||||
}
|
||||
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp88), 1, 0x1388, 0);
|
||||
Math_ApproachF(&this->actor.world.pos.y, sp88.y, 0.3f, 3.0f);
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &nextPos), 1, 0x1388, 0);
|
||||
Math_ApproachF(&this->actor.world.pos.y, nextPos.y, 0.3f, 3.0f);
|
||||
Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 1.0f);
|
||||
}
|
||||
|
||||
void func_80B5AF80(EnBee* this, PlayState* play) {
|
||||
if ((this->unk_206 == 0) && (this->collider.base.atFlags & AC_HIT)) {
|
||||
void EnBee_UpdateDamage(EnBee* this, PlayState* play) {
|
||||
if ((this->sfxHitTimer == 0) && (this->collider.base.atFlags & AT_HIT)) {
|
||||
AudioSfx_StopByPosAndId(&this->actor.projectedPos, NA_SE_EN_BEE_FLY - SFX_FLAG);
|
||||
this->unk_206 = 5;
|
||||
this->sfxHitTimer = 5;
|
||||
}
|
||||
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
|
@ -253,16 +254,16 @@ void EnBee_Update(Actor* thisx, PlayState* play) {
|
|||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->actor.category == ACTORCAT_ENEMY) {
|
||||
if (this->unk_204 != 0) {
|
||||
this->unk_204--;
|
||||
if (this->attackDelayTimer != 0) {
|
||||
this->attackDelayTimer--;
|
||||
}
|
||||
if (this->unk_206 != 0) {
|
||||
this->unk_206--;
|
||||
if (this->sfxHitTimer != 0) {
|
||||
this->sfxHitTimer--;
|
||||
}
|
||||
}
|
||||
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BEE_FLY - SFX_FLAG);
|
||||
func_80B5AF80(this, play);
|
||||
EnBee_UpdateDamage(this, play);
|
||||
Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot);
|
||||
Actor_SetFocus(&this->actor, 0.0f);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
|
|
|
@ -8,20 +8,25 @@ struct EnBee;
|
|||
|
||||
typedef void (*EnBeeActionFunc)(struct EnBee*, PlayState*);
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ BEE_BEHAVIOR_IDLE = 0,
|
||||
/* 1 */ BEE_BEHAVIOR_ATTACK,
|
||||
} BeeBehaviorType;
|
||||
|
||||
typedef struct EnBee {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ Vec3s morphTable[OBJECT_BEE_LIMB_MAX];
|
||||
/* 0x1C4 */ Vec3s jointTable[OBJECT_BEE_LIMB_MAX];
|
||||
/* 0x200 */ EnBeeActionFunc actionFunc;
|
||||
/* 0x204 */ s16 unk_204;
|
||||
/* 0x206 */ s16 unk_206;
|
||||
/* 0x208 */ s16 unk_208;
|
||||
/* 0x20C */ s32 unk_20C;
|
||||
/* 0x210 */ s32 unk_210;
|
||||
/* 0x214 */ s32 unk_214;
|
||||
/* 0x218 */ s32 unk_218;
|
||||
/* 0x21C */ Vec3f unk_21C[2];
|
||||
/* 0x204 */ s16 attackDelayTimer;
|
||||
/* 0x206 */ s16 sfxHitTimer;
|
||||
/* 0x208 */ s16 isHostile; // set and not used
|
||||
/* 0x20C */ s32 targetYaw;
|
||||
/* 0x210 */ s32 flightHoverOffset;
|
||||
/* 0x214 */ s32 posIndex;
|
||||
/* 0x218 */ s32 instanceId;
|
||||
/* 0x21C */ Vec3f targetPos[2];
|
||||
/* 0x234 */ UNK_TYPE1 pad234[8];
|
||||
/* 0x23C */ ColliderCylinder collider;
|
||||
} EnBee; // size = 0x288
|
||||
|
|
Loading…
Reference in New Issue