mirror of
https://github.com/zeldaret/oot.git
synced 2024-12-27 23:36:22 +00:00
[Doc] actor En_Skb (Stalchild) (#1299)
* en_skb stalchild actor doc * missed a sneaky one * rename Main to DecideNextAction * action state rename and become enum * tweak bodybreak comment * rename SPAWNING to BURIED * rename to headlessWalkYawOffset * rename hitboxActive to enableATCollision * use bools for enableATCollision * formatting * move EnSkbActionState out of header * rename enableATCollision -> setColliderAT * remove unnecessary prototypes * renaming per review, settle on breakFlags
This commit is contained in:
parent
423fec9f79
commit
3122143f96
2 changed files with 126 additions and 112 deletions
|
@ -1,31 +1,44 @@
|
|||
/*
|
||||
* File: z_en_skb.c
|
||||
* Overlay: ovl_En_Skb
|
||||
* Description: Stalchild
|
||||
*/
|
||||
|
||||
#include "z_en_skb.h"
|
||||
#include "overlays/actors/ovl_En_Encount1/z_en_encount1.h"
|
||||
#include "assets/objects/object_skb/object_skb.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4)
|
||||
|
||||
typedef enum {
|
||||
SKB_BEHAVIOR_BURIED,
|
||||
SKB_BEHAVIOR_DYING,
|
||||
SKB_BEHAVIOR_DAMAGED,
|
||||
SKB_BEHAVIOR_ATTACKING,
|
||||
SKB_BEHAVIOR_WALKING,
|
||||
SKB_BEHAVIOR_RECOILING,
|
||||
SKB_BEHAVIOR_STUNNED
|
||||
} StalchildBehavior;
|
||||
|
||||
void EnSkb_Init(Actor* thisx, PlayState* play);
|
||||
void EnSkb_Destroy(Actor* thisx, PlayState* play);
|
||||
void EnSkb_Update(Actor* thisx, PlayState* play);
|
||||
void EnSkb_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_80AFCD60(EnSkb* this);
|
||||
void func_80AFCDF8(EnSkb* this);
|
||||
void func_80AFCE5C(EnSkb* this, PlayState* play);
|
||||
void func_80AFCF48(EnSkb* this);
|
||||
void func_80AFCFF0(EnSkb* this, PlayState* play);
|
||||
void func_80AFD0A4(EnSkb* this);
|
||||
void EnSkb_Advance(EnSkb* this, PlayState* play);
|
||||
void func_80AFD33C(EnSkb* this);
|
||||
void EnSkb_SetupAttack(EnSkb* this, PlayState* play);
|
||||
void func_80AFD47C(EnSkb* this);
|
||||
void func_80AFD508(EnSkb* this, PlayState* play);
|
||||
void EnSkb_SetupStunned(EnSkb* this);
|
||||
void func_80AFD59C(EnSkb* this, PlayState* play);
|
||||
void func_80AFD6CC(EnSkb* this, PlayState* play);
|
||||
void func_80AFD7B4(EnSkb* this, PlayState* play);
|
||||
void func_80AFD880(EnSkb* this, PlayState* play);
|
||||
void func_80AFD968(EnSkb* this, PlayState* play);
|
||||
void EnSkb_SetupRiseFromGround(EnSkb* this);
|
||||
void EnSkb_RiseFromGround(EnSkb* this, PlayState* play);
|
||||
void EnSkb_SetupDespawn(EnSkb* this);
|
||||
void EnSkb_Despawn(EnSkb* this, PlayState* play);
|
||||
void EnSkb_SetupWalkForward(EnSkb* this);
|
||||
void EnSkb_WalkForward(EnSkb* this, PlayState* play);
|
||||
void EnSkb_SetupAttack(EnSkb* this);
|
||||
void EnSkb_Attack(EnSkb* this, PlayState* play);
|
||||
void EnSkb_SetupRecoil(EnSkb* this);
|
||||
void EnSkb_Recoil(EnSkb* this, PlayState* play);
|
||||
void EnSkb_Stunned(EnSkb* this, PlayState* play);
|
||||
void EnSkb_TakeDamage(EnSkb* this, PlayState* play);
|
||||
void EnSkb_SetupDeath(EnSkb* this, PlayState* play);
|
||||
void EnSkb_Death(EnSkb* this, PlayState* play);
|
||||
|
||||
static ColliderJntSphElementInit sJntSphElementsInit[2] = {
|
||||
{
|
||||
|
@ -142,8 +155,8 @@ static InitChainEntry sInitChain[] = {
|
|||
|
||||
void EnSkb_Init(Actor* thisx, PlayState* play) {
|
||||
EnSkb* this = (EnSkb*)thisx;
|
||||
s16 paramOffsetBody;
|
||||
s16 paramOffsetArm;
|
||||
s16 armOffset;
|
||||
s16 bodyOffset;
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
this->actor.colChkInfo.damageTable = &sDamageTable;
|
||||
|
@ -160,16 +173,16 @@ void EnSkb_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItem);
|
||||
Actor_SetScale(&this->actor, ((this->actor.params * 0.1f) + 1.0f) * 0.01f);
|
||||
|
||||
paramOffsetBody = this->actor.params + 0xA;
|
||||
this->collider.elements[0].dim.worldSphere.radius = paramOffsetBody;
|
||||
this->collider.elements[0].dim.modelSphere.radius = paramOffsetBody;
|
||||
armOffset = this->actor.params + 0xA;
|
||||
this->collider.elements[0].dim.worldSphere.radius = armOffset;
|
||||
this->collider.elements[0].dim.modelSphere.radius = armOffset;
|
||||
if (1) {};
|
||||
paramOffsetArm = (this->actor.params * 2) + 0x14;
|
||||
this->collider.elements[1].dim.worldSphere.radius = paramOffsetArm;
|
||||
this->collider.elements[1].dim.modelSphere.radius = paramOffsetArm;
|
||||
bodyOffset = (this->actor.params * 2) + 0x14;
|
||||
this->collider.elements[1].dim.worldSphere.radius = bodyOffset;
|
||||
this->collider.elements[1].dim.modelSphere.radius = bodyOffset;
|
||||
this->actor.home.pos = this->actor.world.pos;
|
||||
this->actor.floorHeight = this->actor.world.pos.y;
|
||||
func_80AFCDF8(this);
|
||||
EnSkb_SetupRiseFromGround(this);
|
||||
}
|
||||
|
||||
void EnSkb_Destroy(Actor* thisx, PlayState* play) {
|
||||
|
@ -187,26 +200,26 @@ void EnSkb_Destroy(Actor* thisx, PlayState* play) {
|
|||
Collider_DestroyJntSph(play, &this->collider);
|
||||
}
|
||||
|
||||
void func_80AFCD60(EnSkb* this) {
|
||||
void EnSkb_DecideNextAction(EnSkb* this) {
|
||||
if (IS_DAY) {
|
||||
func_80AFCF48(this);
|
||||
EnSkb_SetupDespawn(this);
|
||||
} else if (Actor_IsFacingPlayer(&this->actor, 0x11C7) &&
|
||||
(this->actor.xzDistToPlayer < (60.0f + (this->actor.params * 6.0f)))) {
|
||||
func_80AFD33C(this);
|
||||
EnSkb_SetupAttack(this);
|
||||
} else {
|
||||
func_80AFD0A4(this);
|
||||
EnSkb_SetupWalkForward(this);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AFCDF8(EnSkb* this) {
|
||||
void EnSkb_SetupRiseFromGround(EnSkb* this) {
|
||||
Animation_PlayOnceSetSpeed(&this->skelAnime, &gStalchildUncurlingAnim, 1.0f);
|
||||
this->unk_280 = 0;
|
||||
this->actionState = SKB_BEHAVIOR_BURIED;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_APPEAR);
|
||||
EnSkb_SetupAction(this, func_80AFCE5C);
|
||||
EnSkb_SetupAction(this, EnSkb_RiseFromGround);
|
||||
}
|
||||
|
||||
void func_80AFCE5C(EnSkb* this, PlayState* play) {
|
||||
void EnSkb_RiseFromGround(EnSkb* this, PlayState* play) {
|
||||
if (this->skelAnime.curFrame < 4.0f) {
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
|
||||
|
@ -219,22 +232,22 @@ void func_80AFCE5C(EnSkb* this, PlayState* play) {
|
|||
EnSkb_SpawnDebris(play, this, &this->actor.world.pos);
|
||||
}
|
||||
if ((SkelAnime_Update(&this->skelAnime) != 0) && (0.0f == this->actor.shape.yOffset)) {
|
||||
func_80AFCD60(this);
|
||||
EnSkb_DecideNextAction(this);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AFCF48(EnSkb* this) {
|
||||
void EnSkb_SetupDespawn(EnSkb* this) {
|
||||
Animation_Change(&this->skelAnime, &gStalchildUncurlingAnim, -1.0f,
|
||||
Animation_GetLastFrame(&gStalchildUncurlingAnim), 0.0f, ANIMMODE_ONCE, -4.0f);
|
||||
this->unk_280 = 0;
|
||||
this->unk_281 = 0;
|
||||
this->actionState = SKB_BEHAVIOR_BURIED;
|
||||
this->setColliderAT = false;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
|
||||
EnSkb_SetupAction(this, func_80AFCFF0);
|
||||
EnSkb_SetupAction(this, EnSkb_Despawn);
|
||||
}
|
||||
|
||||
void func_80AFCFF0(EnSkb* this, PlayState* play) {
|
||||
void EnSkb_Despawn(EnSkb* this, PlayState* play) {
|
||||
if ((Math_SmoothStepToF(&this->actor.shape.yOffset, -8000.0f, 1.0f, 500.0f, 0.0f) != 0.0f) &&
|
||||
(play->gameplayFrames & 1)) {
|
||||
EnSkb_SpawnDebris(play, this, &this->actor.world.pos);
|
||||
|
@ -245,25 +258,25 @@ void func_80AFCFF0(EnSkb* this, PlayState* play) {
|
|||
}
|
||||
}
|
||||
|
||||
void func_80AFD0A4(EnSkb* this) {
|
||||
void EnSkb_SetupWalkForward(EnSkb* this) {
|
||||
Animation_Change(&this->skelAnime, &gStalchildWalkingAnim, 0.96000004f, 0.0f,
|
||||
Animation_GetLastFrame(&gStalchildWalkingAnim), ANIMMODE_LOOP, -4.0f);
|
||||
this->unk_280 = 4;
|
||||
this->unk_288 = 0;
|
||||
this->actionState = SKB_BEHAVIOR_WALKING;
|
||||
this->headlessYawOffset = 0;
|
||||
this->actor.speedXZ = this->actor.scale.y * 160.0f;
|
||||
EnSkb_SetupAction(this, EnSkb_Advance);
|
||||
EnSkb_SetupAction(this, EnSkb_WalkForward);
|
||||
}
|
||||
|
||||
void EnSkb_Advance(EnSkb* this, PlayState* play) {
|
||||
void EnSkb_WalkForward(EnSkb* this, PlayState* play) {
|
||||
s32 thisKeyFrame;
|
||||
s32 prevKeyFrame;
|
||||
f32 playSpeed;
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if ((this->unk_283 != 0) && ((play->gameplayFrames & 0xF) == 0)) {
|
||||
this->unk_288 = Rand_CenteredFloat(50000.0f);
|
||||
if ((this->breakFlags != 0) && ((play->gameplayFrames & 0xF) == 0)) {
|
||||
this->headlessYawOffset = Rand_CenteredFloat(50000.0f);
|
||||
}
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, (this->actor.yawTowardsPlayer + this->unk_288), 1, 0x2EE, 0);
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, (this->actor.yawTowardsPlayer + this->headlessYawOffset), 1, 0x2EE, 0);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
thisKeyFrame = this->skelAnime.curFrame;
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
@ -286,52 +299,52 @@ void EnSkb_Advance(EnSkb* this, PlayState* play) {
|
|||
}
|
||||
}
|
||||
if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 800.0f || IS_DAY) {
|
||||
func_80AFCF48(this);
|
||||
EnSkb_SetupDespawn(this);
|
||||
} else if (Actor_IsFacingPlayer(&this->actor, 0x11C7) &&
|
||||
(this->actor.xzDistToPlayer < (60.0f + (this->actor.params * 6.0f)))) {
|
||||
func_80AFD33C(this);
|
||||
EnSkb_SetupAttack(this);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AFD33C(EnSkb* this) {
|
||||
void EnSkb_SetupAttack(EnSkb* this) {
|
||||
Animation_Change(&this->skelAnime, &gStalchildAttackingAnim, 0.6f, 0.0f,
|
||||
Animation_GetLastFrame(&gStalchildAttackingAnim), ANIMMODE_ONCE_INTERP, 4.0f);
|
||||
this->collider.base.atFlags &= ~AT_BOUNCED;
|
||||
this->unk_280 = 3;
|
||||
this->actionState = SKB_BEHAVIOR_ATTACKING;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
EnSkb_SetupAction(this, EnSkb_SetupAttack);
|
||||
EnSkb_SetupAction(this, EnSkb_Attack);
|
||||
}
|
||||
|
||||
void EnSkb_SetupAttack(EnSkb* this, PlayState* play) {
|
||||
void EnSkb_Attack(EnSkb* this, PlayState* play) {
|
||||
s32 frameData;
|
||||
|
||||
frameData = this->skelAnime.curFrame;
|
||||
if (frameData == 3) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK);
|
||||
this->unk_281 = 1;
|
||||
this->setColliderAT = true;
|
||||
} else if (frameData == 6) {
|
||||
this->unk_281 = 0;
|
||||
this->setColliderAT = false;
|
||||
}
|
||||
if (this->collider.base.atFlags & AT_BOUNCED) {
|
||||
this->collider.base.atFlags &= ~(AT_HIT | AT_BOUNCED);
|
||||
func_80AFD47C(this);
|
||||
EnSkb_SetupRecoil(this);
|
||||
} else if (SkelAnime_Update(&this->skelAnime) != 0) {
|
||||
func_80AFCD60(this);
|
||||
EnSkb_DecideNextAction(this);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AFD47C(EnSkb* this) {
|
||||
void EnSkb_SetupRecoil(EnSkb* this) {
|
||||
Animation_Change(&this->skelAnime, &gStalchildAttackingAnim, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f,
|
||||
ANIMMODE_ONCE_INTERP, 0.0f);
|
||||
this->collider.base.atFlags &= ~AT_BOUNCED;
|
||||
this->unk_280 = 5;
|
||||
this->unk_281 = 0;
|
||||
EnSkb_SetupAction(this, func_80AFD508);
|
||||
this->actionState = SKB_BEHAVIOR_RECOILING;
|
||||
this->setColliderAT = false;
|
||||
EnSkb_SetupAction(this, EnSkb_Recoil);
|
||||
}
|
||||
|
||||
void func_80AFD508(EnSkb* this, PlayState* play) {
|
||||
void EnSkb_Recoil(EnSkb* this, PlayState* play) {
|
||||
if (SkelAnime_Update(&this->skelAnime) != 0) {
|
||||
func_80AFCD60(this);
|
||||
EnSkb_DecideNextAction(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -340,12 +353,12 @@ void EnSkb_SetupStunned(EnSkb* this) {
|
|||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
|
||||
this->unk_281 = 0;
|
||||
this->unk_280 = 6;
|
||||
EnSkb_SetupAction(this, func_80AFD59C);
|
||||
this->setColliderAT = false;
|
||||
this->actionState = SKB_BEHAVIOR_STUNNED;
|
||||
EnSkb_SetupAction(this, EnSkb_Stunned);
|
||||
}
|
||||
|
||||
void func_80AFD59C(EnSkb* this, PlayState* play) {
|
||||
void EnSkb_Stunned(EnSkb* this, PlayState* play) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
|
@ -356,32 +369,32 @@ void func_80AFD59C(EnSkb* this, PlayState* play) {
|
|||
}
|
||||
if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
if (this->actor.colChkInfo.health == 0) {
|
||||
func_80AFD7B4(this, play);
|
||||
EnSkb_SetupDeath(this, play);
|
||||
} else {
|
||||
func_80AFCD60(this);
|
||||
EnSkb_DecideNextAction(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AFD644(EnSkb* this) {
|
||||
void EnSkb_SetupTakeDamage(EnSkb* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gStalchildDamagedAnim, -4.0f);
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = -4.0f;
|
||||
}
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE);
|
||||
this->unk_280 = 2;
|
||||
EnSkb_SetupAction(this, func_80AFD6CC);
|
||||
this->actionState = SKB_BEHAVIOR_DAMAGED;
|
||||
EnSkb_SetupAction(this, EnSkb_TakeDamage);
|
||||
}
|
||||
|
||||
void func_80AFD6CC(EnSkb* this, PlayState* play) {
|
||||
void EnSkb_TakeDamage(EnSkb* this, PlayState* play) {
|
||||
// this cast is likely not real, but allows for a match
|
||||
u8* new_var;
|
||||
|
||||
new_var = &this->unk_283;
|
||||
if ((this->unk_283 != 1) || BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, play, 1)) {
|
||||
new_var = &this->breakFlags;
|
||||
if ((this->breakFlags != 1) || BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, play, 1)) {
|
||||
if ((*new_var) != 0) {
|
||||
this->unk_283 = (*new_var) | 2;
|
||||
this->breakFlags = (*new_var) | 2;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.speedXZ = 0;
|
||||
|
@ -394,27 +407,27 @@ void func_80AFD6CC(EnSkb* this, PlayState* play) {
|
|||
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x1194, 0);
|
||||
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
func_80AFCD60(this);
|
||||
EnSkb_DecideNextAction(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AFD7B4(EnSkb* this, PlayState* play) {
|
||||
void EnSkb_SetupDeath(EnSkb* this, PlayState* play) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gStalchildDyingAnim, -4.0f);
|
||||
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = -6.0f;
|
||||
}
|
||||
this->unk_280 = 1;
|
||||
this->actionState = SKB_BEHAVIOR_DYING;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
BodyBreak_Alloc(&this->bodyBreak, 18, play);
|
||||
this->unk_283 |= 4;
|
||||
this->breakFlags |= 4;
|
||||
EffectSsDeadSound_SpawnStationary(play, &this->actor.projectedPos, NA_SE_EN_STALKID_DEAD, 1, 1, 0x28);
|
||||
EnSkb_SetupAction(this, func_80AFD880);
|
||||
EnSkb_SetupAction(this, EnSkb_Death);
|
||||
}
|
||||
|
||||
void func_80AFD880(EnSkb* this, PlayState* play) {
|
||||
void EnSkb_Death(EnSkb* this, PlayState* play) {
|
||||
if (BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, play, 1)) {
|
||||
if (this->actor.scale.x == 0.01f) {
|
||||
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x10);
|
||||
|
@ -426,39 +439,40 @@ void func_80AFD880(EnSkb* this, PlayState* play) {
|
|||
Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_RED);
|
||||
}
|
||||
|
||||
this->unk_283 |= 8;
|
||||
this->breakFlags |= 8;
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AFD968(EnSkb* this, PlayState* play) {
|
||||
void EnSkb_CheckDamage(EnSkb* this, PlayState* play) {
|
||||
s16 pad;
|
||||
s32 i;
|
||||
Vec3f flamePos;
|
||||
s16 scale;
|
||||
s16 phi_v1;
|
||||
s16 colorFilterDuration;
|
||||
Player* player;
|
||||
|
||||
if ((this->unk_280 != 1) && (this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) &&
|
||||
if ((this->actionState != SKB_BEHAVIOR_DYING) &&
|
||||
(this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) &&
|
||||
(this->actor.yDistToWater >= 40.0f)) {
|
||||
this->actor.colChkInfo.health = 0;
|
||||
this->unk_281 = 0;
|
||||
func_80AFD7B4(this, play);
|
||||
} else if (this->unk_280 >= 3) {
|
||||
this->setColliderAT = false;
|
||||
EnSkb_SetupDeath(this, play);
|
||||
} else if (this->actionState >= SKB_BEHAVIOR_ATTACKING) {
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
if (this->actor.colChkInfo.damageEffect != 6) {
|
||||
this->unk_282 = this->actor.colChkInfo.damageEffect;
|
||||
this->lastDamageEffect = this->actor.colChkInfo.damageEffect;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.elements[1].info, true);
|
||||
this->unk_281 = 0;
|
||||
this->setColliderAT = false;
|
||||
if (this->actor.colChkInfo.damageEffect == 1) {
|
||||
if (this->unk_280 != 6) {
|
||||
if (this->actionState != SKB_BEHAVIOR_STUNNED) {
|
||||
Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 0x50);
|
||||
Actor_ApplyDamage(&this->actor);
|
||||
EnSkb_SetupStunned(this);
|
||||
}
|
||||
} else {
|
||||
phi_v1 = 8;
|
||||
colorFilterDuration = 8;
|
||||
if (this->actor.colChkInfo.damageEffect == 7) {
|
||||
scale = this->actor.scale.y * 7500.0f;
|
||||
for (i = 4; i >= 0; i--) {
|
||||
|
@ -468,15 +482,15 @@ void func_80AFD968(EnSkb* this, PlayState* play) {
|
|||
flamePos.y += (Rand_ZeroOne() * 25.0f);
|
||||
EffectSsEnFire_SpawnVec3f(play, &this->actor, &flamePos, scale, 0, 0, -1);
|
||||
}
|
||||
phi_v1 = 25;
|
||||
colorFilterDuration = 25;
|
||||
}
|
||||
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, phi_v1);
|
||||
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, colorFilterDuration);
|
||||
if (!Actor_ApplyDamage(&this->actor)) {
|
||||
func_80AFD7B4(this, play);
|
||||
EnSkb_SetupDeath(this, play);
|
||||
return;
|
||||
}
|
||||
player = GET_PLAYER(play);
|
||||
if (this->unk_283 == 0) {
|
||||
if (this->breakFlags == 0) {
|
||||
if ((this->actor.colChkInfo.damageEffect == 0xD) ||
|
||||
((this->actor.colChkInfo.damageEffect == 0xE) &&
|
||||
((player->meleeWeaponAnimation >= PLAYER_MWA_RIGHT_SLASH_1H &&
|
||||
|
@ -484,10 +498,10 @@ void func_80AFD968(EnSkb* this, PlayState* play) {
|
|||
(player->meleeWeaponAnimation == PLAYER_MWA_BACKSLASH_RIGHT ||
|
||||
player->meleeWeaponAnimation == PLAYER_MWA_BACKSLASH_LEFT)))) {
|
||||
BodyBreak_Alloc(&this->bodyBreak, 2, play);
|
||||
this->unk_283 = 1;
|
||||
this->breakFlags = 1; // setup for head bodybreak
|
||||
}
|
||||
}
|
||||
func_80AFD644(this);
|
||||
EnSkb_SetupTakeDamage(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -498,7 +512,7 @@ void EnSkb_Update(Actor* thisx, PlayState* play) {
|
|||
EnSkb* this = (EnSkb*)thisx;
|
||||
s32 pad;
|
||||
|
||||
func_80AFD968(this, play);
|
||||
EnSkb_CheckDamage(this, play);
|
||||
Actor_MoveForward(&this->actor);
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 15.0f, 30.0f, 60.0f,
|
||||
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
|
||||
|
@ -506,11 +520,11 @@ void EnSkb_Update(Actor* thisx, PlayState* play) {
|
|||
this->actionFunc(this, play);
|
||||
this->actor.focus.pos = this->actor.world.pos;
|
||||
this->actor.focus.pos.y += (3000.0f * this->actor.scale.y);
|
||||
if (this->unk_281 != 0) {
|
||||
if (this->setColliderAT) {
|
||||
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
|
||||
}
|
||||
|
||||
if (this->unk_280 >= 3) {
|
||||
if (this->actionState >= SKB_BEHAVIOR_ATTACKING) {
|
||||
if ((this->actor.colorFilterTimer == 0) || ((this->actor.colorFilterParams & 0x4000) == 0)) {
|
||||
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
||||
|
@ -525,7 +539,7 @@ s32 EnSkb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
|
|||
s16 pad[2];
|
||||
|
||||
if (limbIndex == 11) {
|
||||
if ((this->unk_283 & 2) == 0) {
|
||||
if ((this->breakFlags & 2) == 0) { // head limb, head is still attached
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_skb.c", 972);
|
||||
color = ABS((s16)(Math_SinS(play->gameplayFrames * 0x1770) * 95.0f)) + 160;
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
@ -534,7 +548,7 @@ s32 EnSkb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
|
|||
} else {
|
||||
*dList = NULL;
|
||||
}
|
||||
} else if ((limbIndex == 12) && ((this->unk_283 & 2) != 0)) {
|
||||
} else if ((limbIndex == 12) && ((this->breakFlags & 2) != 0)) { // jaw limb, don't draw if headless
|
||||
*dList = NULL;
|
||||
}
|
||||
return 0;
|
||||
|
@ -545,9 +559,9 @@ void EnSkb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
|
|||
|
||||
Collider_UpdateSpheres(limbIndex, &this->collider);
|
||||
|
||||
if ((this->unk_283 ^ 1) == 0) {
|
||||
if ((this->breakFlags ^ 1) == 0) {
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 11, 12, 18, dList, BODYBREAK_OBJECT_DEFAULT);
|
||||
} else if ((this->unk_283 ^ (this->unk_283 | 4)) == 0) {
|
||||
} else if ((this->breakFlags ^ (this->breakFlags | 4)) == 0) {
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 18, 18, dList, BODYBREAK_OBJECT_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,12 +13,12 @@ typedef struct EnSkb {
|
|||
/* 0x014C */ SkelAnime skelAnime;
|
||||
/* 0x0190 */ Vec3s jointTable[20];
|
||||
/* 0x0208 */ Vec3s morphTable[20];
|
||||
/* 0x0280 */ u8 unk_280;
|
||||
/* 0x0281 */ u8 unk_281;
|
||||
/* 0x0282 */ u8 unk_282;
|
||||
/* 0x0283 */ u8 unk_283;
|
||||
/* 0x0280 */ u8 actionState;
|
||||
/* 0x0281 */ u8 setColliderAT;
|
||||
/* 0x0282 */ u8 lastDamageEffect;
|
||||
/* 0x0283 */ u8 breakFlags;
|
||||
/* 0x0284 */ EnSkbActionFunc actionFunc;
|
||||
/* 0x0288 */ s16 unk_288;
|
||||
/* 0x0288 */ s16 headlessYawOffset;
|
||||
/* 0x028C */ BodyBreak bodyBreak;
|
||||
/* 0x02A4 */ ColliderJntSph collider;
|
||||
/* 0x02C4 */ ColliderJntSphElement colliderItem[2];
|
||||
|
|
Loading…
Reference in a new issue