1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 14:20:11 +00:00

Docs for the Anime part of SkelAnime (#517)

* Darkmeiro decompilation

Bg_Gnd_Darkmeiro decompiled, matched, and documented.

* give this a shot

* fix conflict

* one more try

* could be useful

* whoops

* ZAP2 stuff

* ZAP why

* ZAP again

* more names

* so many names

* we got subsystems now

* slight cleanup

* merge part 2

* new naming scheme

* slight adjustment

* no limit

* syms maybe

* step one

* OK, it's fixed

* table

* some names and such

* comments**

* update zap

* gitkeep to please jenkins

* ZAP

* fixer

* fixer2

* fixer3

* zap

Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: fig <fig02srl@gmail.com>
This commit is contained in:
petrie911 2020-12-29 16:46:46 -06:00 committed by GitHub
parent e4d88bf942
commit 2dfa188706
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1187 changed files with 5434 additions and 5367 deletions

View file

@ -161,8 +161,7 @@ void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx) {
thisx->params &= 0xFF;
this->blinkState = 0;
this->unkFloat = 10.0f;
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A458, &D_0600B6D4, this->limbDrawTbl,
this->transitionDrawTbl, 24);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A458, &D_0600B6D4, this->jointTable, this->morphTable, 24);
Collider_InitCylinder(globalCtx, &this->bodyCollider);
Collider_SetCylinder(globalCtx, &this->bodyCollider, thisx, &sBodyCylInit);
Collider_InitTris(globalCtx, &this->blockCollider);
@ -270,7 +269,7 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) {
}
void EnGeldB_SetupWait(EnGeldB* this) {
SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, &D_0600ADF8, 0.0f);
Animation_PlayOnceSetSpeed(&this->skelAnime, &D_0600ADF8, 0.0f);
this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 120.0f;
this->timer = 10;
this->invisible = true;
@ -293,7 +292,7 @@ void EnGeldB_Wait(EnGeldB* this, GlobalContext* globalCtx) {
}
if (this->actor.bgCheckFlags & 2) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN);
this->skelAnime.animPlaybackSpeed = 1.0f;
this->skelAnime.playSpeed = 1.0f;
this->actor.posRot.pos.y = this->actor.groundY;
this->actor.flags |= 1;
this->actor.posRot2.pos = this->actor.posRot.pos;
@ -302,13 +301,13 @@ void EnGeldB_Wait(EnGeldB* this, GlobalContext* globalCtx) {
func_80033260(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
func_80033260(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
}
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (SkelAnime_Update(&this->skelAnime)) {
EnGeldB_SetupReady(this);
}
}
void EnGeldB_SetupFlee(EnGeldB* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_0600ADF8, -2.0f, SkelAnime_GetFrameCount(&D_0600ADF8), 0.0f, 3, -4.0f);
Animation_Change(&this->skelAnime, &D_0600ADF8, -2.0f, Animation_GetLastFrame(&D_0600ADF8), 0.0f, 3, -4.0f);
this->timer = 20;
this->invisible = false;
this->actionState = GELDB_WAIT;
@ -317,15 +316,15 @@ void EnGeldB_SetupFlee(EnGeldB* this) {
}
void EnGeldB_Flee(EnGeldB* this, GlobalContext* globalCtx) {
if (this->skelAnime.animCurrentFrame == 10.0f) {
if (this->skelAnime.curFrame == 10.0f) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP);
}
if (this->skelAnime.animCurrentFrame == 2.0f) {
if (this->skelAnime.curFrame == 2.0f) {
this->actor.gravity = 0.0f;
func_80033260(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
func_80033260(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
}
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (SkelAnime_Update(&this->skelAnime)) {
Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.groundY + 300.0f, 1.0f, 20.5f, 0.0f);
this->timer--;
if (this->timer == 0) {
@ -335,7 +334,7 @@ void EnGeldB_Flee(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupReady(EnGeldB* this) {
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0600B6D4, -4.0f);
Animation_MorphToLoop(&this->skelAnime, &D_0600B6D4, -4.0f);
this->actionState = GELDB_READY;
this->timer = Rand_ZeroOne() * 10.0f + 5.0f;
this->actor.speedXZ = 0.0f;
@ -348,7 +347,7 @@ void EnGeldB_Ready(EnGeldB* this, GlobalContext* globalCtx) {
s32 pad;
s16 angleToLink;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->lookTimer != 0) {
angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y - this->headRot.y;
if (ABS(angleToLink) > 0x2000) {
@ -399,7 +398,7 @@ void EnGeldB_Ready(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupAdvance(EnGeldB* this, GlobalContext* globalCtx) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060024E8, 1.0f, 0.0f, SkelAnime_GetFrameCount(&D_060024E8), 1, -4.0f);
Animation_Change(&this->skelAnime, &D_060024E8, 1.0f, 0.0f, Animation_GetLastFrame(&D_060024E8), 1, -4.0f);
this->actionState = GELDB_ADVANCE;
EnGeldB_SetupAction(this, EnGeldB_Advance);
}
@ -424,7 +423,7 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) {
} else {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 6.65f, 0.0f);
}
this->skelAnime.animPlaybackSpeed = this->actor.speedXZ * 0.125f;
this->skelAnime.playSpeed = this->actor.speedXZ * 0.125f;
facingAngletoLink = player->actor.shape.rot.y - this->actor.shape.rot.y;
facingAngletoLink = ABS(facingAngletoLink);
if ((this->actor.xzDistFromLink < 150.0f) && (player->swordState != 0) && (facingAngletoLink >= 0x1F40)) {
@ -434,11 +433,11 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) {
return;
}
}
thisKeyFrame = (s32)this->skelAnime.animCurrentFrame;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
playSpeed = ABS(this->skelAnime.animPlaybackSpeed);
prevKeyFrame = (s32)(this->skelAnime.animCurrentFrame - playSpeed);
playSpeed = ABS(this->skelAnime.animPlaybackSpeed); // yes it does this twice.
thisKeyFrame = (s32)this->skelAnime.curFrame;
SkelAnime_Update(&this->skelAnime);
playSpeed = ABS(this->skelAnime.playSpeed);
prevKeyFrame = (s32)(this->skelAnime.curFrame - playSpeed);
playSpeed = ABS(this->skelAnime.playSpeed); // yes it does this twice.
if (!func_8002E084(&this->actor, 0x11C7)) {
if (Rand_ZeroOne() > 0.5f) {
EnGeldB_SetupCircle(this);
@ -472,7 +471,7 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) {
if ((globalCtx->gameplayFrames & 0x5F) == 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_BREATH);
}
if ((thisKeyFrame != (s32)this->skelAnime.animCurrentFrame) &&
if ((thisKeyFrame != (s32)this->skelAnime.curFrame) &&
((prevKeyFrame < 0 && (s32)playSpeed + thisKeyFrame > 0) ||
(prevKeyFrame < 4 && (s32)playSpeed + thisKeyFrame > 4))) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_LAND);
@ -482,7 +481,7 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupRollForward(EnGeldB* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06001390, -1.0f, SkelAnime_GetFrameCount(&D_06001390), 0.0f, 2, -3.0f);
Animation_Change(&this->skelAnime, &D_06001390, -1.0f, Animation_GetLastFrame(&D_06001390), 0.0f, 2, -3.0f);
this->timer = 0;
this->invisible = true;
this->actionState = GELDB_ROLL_FORWARD;
@ -496,7 +495,7 @@ void EnGeldB_RollForward(EnGeldB* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
s16 facingAngleToLink = player->actor.shape.rot.y - this->actor.shape.rot.y;
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (SkelAnime_Update(&this->skelAnime)) {
this->invisible = false;
this->actor.speedXZ = 0.0f;
if (!func_8002E084(&this->actor, 0x1554)) {
@ -518,7 +517,7 @@ void EnGeldB_RollForward(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupPivot(EnGeldB* this) {
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0600A814, -4.0f);
Animation_MorphToLoop(&this->skelAnime, &D_0600A814, -4.0f);
this->actionState = GELDB_PIVOT;
EnGeldB_SetupAction(this, EnGeldB_Pivot);
}
@ -539,8 +538,8 @@ void EnGeldB_Pivot(EnGeldB* this, GlobalContext* globalCtx) {
playSpeed = turnRate * 0.5f;
playSpeed = CLAMP_MIN(playSpeed, -1.0f);
}
this->skelAnime.animPlaybackSpeed = -playSpeed;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
this->skelAnime.playSpeed = -playSpeed;
SkelAnime_Update(&this->skelAnime);
if (func_8002E084(&this->actor, 30 * 0x10000 / 360)) {
if (Rand_ZeroOne() > 0.8f) {
EnGeldB_SetupCircle(this);
@ -555,10 +554,10 @@ void EnGeldB_Pivot(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupCircle(EnGeldB* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, SkelAnime_GetFrameCount(&D_0600A814), 1, 0.0f);
Animation_Change(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600A814), 1, 0.0f);
this->actor.speedXZ = Rand_CenteredFloat(12.0f);
this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->skelAnime.animPlaybackSpeed = -this->actor.speedXZ * 0.5f;
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
this->timer = Rand_ZeroOne() * 30.0f + 30.0f;
this->actionState = GELDB_CIRCLE;
this->approachRate = 0.0f;
@ -623,18 +622,18 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) {
this->actor.posRot.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate;
}
if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) {
this->skelAnime.animPlaybackSpeed = -this->actor.speedXZ * 0.5f;
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
} else {
this->skelAnime.animPlaybackSpeed = -this->approachRate * 0.5f;
this->skelAnime.playSpeed = -this->approachRate * 0.5f;
}
this->skelAnime.animPlaybackSpeed = CLAMP(this->skelAnime.animPlaybackSpeed, -3.0f, 3.0f);
this->skelAnime.playSpeed = CLAMP(this->skelAnime.playSpeed, -3.0f, 3.0f);
thisKeyFrame = this->skelAnime.animCurrentFrame;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
thisKeyFrame = this->skelAnime.curFrame;
SkelAnime_Update(&this->skelAnime);
prevKeyFrame = this->skelAnime.animCurrentFrame - ABS(this->skelAnime.animPlaybackSpeed);
nextKeyFrame = (s32)ABS(this->skelAnime.animPlaybackSpeed) + thisKeyFrame;
if ((thisKeyFrame != (s32)this->skelAnime.animCurrentFrame) &&
prevKeyFrame = this->skelAnime.curFrame - ABS(this->skelAnime.playSpeed);
nextKeyFrame = (s32)ABS(this->skelAnime.playSpeed) + thisKeyFrame;
if ((thisKeyFrame != (s32)this->skelAnime.curFrame) &&
((prevKeyFrame < 0 && 0 < nextKeyFrame) || (prevKeyFrame < 5 && 5 < nextKeyFrame))) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_LAND);
}
@ -658,7 +657,7 @@ void EnGeldB_SetupSpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
s16 sp3E;
Player* player = PLAYER;
SkelAnime_ChangeAnim(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, SkelAnime_GetFrameCount(&D_0600A814), 1, 0.0f);
Animation_Change(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600A814), 1, 0.0f);
sp3E = player->actor.shape.rot.y;
if (Math_SinS(sp3E - this->actor.shape.rot.y) > 0.0f) {
this->actor.speedXZ = -10.0f;
@ -669,7 +668,7 @@ void EnGeldB_SetupSpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
} else {
this->actor.speedXZ = -10.0f;
}
this->skelAnime.animPlaybackSpeed = -this->actor.speedXZ * 0.5f;
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->timer = 6;
this->approachRate = 0.0f;
@ -717,16 +716,16 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
this->actor.posRot.pos.z += Math_CosS(this->actor.yawTowardsLink) * this->approachRate;
}
if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) {
this->skelAnime.animPlaybackSpeed = -this->actor.speedXZ * 0.5f;
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
} else {
this->skelAnime.animPlaybackSpeed = -this->approachRate * 0.5f;
this->skelAnime.playSpeed = -this->approachRate * 0.5f;
}
this->skelAnime.animPlaybackSpeed = CLAMP(this->skelAnime.animPlaybackSpeed, -3.0f, 3.0f);
thisKeyFrame = this->skelAnime.animCurrentFrame;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
lastKeyFrame = this->skelAnime.animCurrentFrame - ABS(this->skelAnime.animPlaybackSpeed);
nextKeyFrame = (s32)ABS(this->skelAnime.animPlaybackSpeed) + thisKeyFrame;
if ((thisKeyFrame != (s32)this->skelAnime.animCurrentFrame) &&
this->skelAnime.playSpeed = CLAMP(this->skelAnime.playSpeed, -3.0f, 3.0f);
thisKeyFrame = this->skelAnime.curFrame;
SkelAnime_Update(&this->skelAnime);
lastKeyFrame = this->skelAnime.curFrame - ABS(this->skelAnime.playSpeed);
nextKeyFrame = (s32)ABS(this->skelAnime.playSpeed) + thisKeyFrame;
if ((thisKeyFrame != (s32)this->skelAnime.curFrame) &&
((lastKeyFrame < 0 && 0 < nextKeyFrame) || (lastKeyFrame < 5 && 5 < nextKeyFrame))) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_LAND);
}
@ -753,7 +752,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupSlash(EnGeldB* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060003CC);
Animation_PlayOnce(&this->skelAnime, &D_060003CC);
this->swordCollider.base.atFlags &= ~4;
this->actionState = GELDB_SLASH;
this->spinAttackState = 0;
@ -771,17 +770,17 @@ void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) {
angleToLink = ABS(angleToLink);
this->actor.speedXZ = 0.0f;
if ((s32)this->skelAnime.animCurrentFrame == 1) {
if ((s32)this->skelAnime.curFrame == 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_ATTACK);
this->swordState = 1;
} else if ((s32)this->skelAnime.animCurrentFrame == 6) {
} else if ((s32)this->skelAnime.curFrame == 6) {
this->swordState = -1;
}
if (this->swordCollider.base.atFlags & 4) {
this->swordState = -1;
this->swordCollider.base.atFlags &= ~6;
EnGeldB_SetupRollBack(this);
} else if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
} else if (SkelAnime_Update(&this->skelAnime)) {
if (!func_8002E084(&this->actor, 0x1554)) {
EnGeldB_SetupReady(this);
this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f;
@ -810,7 +809,7 @@ void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupSpinAttack(EnGeldB* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06000F5C, 1.0f, 0.0f, SkelAnime_GetFrameCount(&D_06000F5C), 3, 0.0f);
Animation_Change(&this->skelAnime, &D_06000F5C, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000F5C), 3, 0.0f);
this->swordCollider.base.atFlags &= ~6;
this->actionState = GELDB_SPIN_ATTACK;
this->spinAttackState = 0;
@ -827,7 +826,7 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) {
if (this->swordCollider.base.atFlags & 4) {
this->swordCollider.base.atFlags &= ~6;
this->spinAttackState = 1;
this->skelAnime.animPlaybackSpeed = 1.5f;
this->skelAnime.playSpeed = 1.5f;
} else if (this->swordCollider.base.atFlags & 2) {
this->swordCollider.base.atFlags &= ~2;
if (&player->actor == this->swordCollider.base.at) {
@ -842,20 +841,20 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) {
}
}
}
if ((s32)this->skelAnime.animCurrentFrame < 9) {
if ((s32)this->skelAnime.curFrame < 9) {
this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink;
} else if ((s32)this->skelAnime.animCurrentFrame == 13) {
} else if ((s32)this->skelAnime.curFrame == 13) {
func_80033260(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
func_80033260(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0);
this->swordState = 1;
this->actor.speedXZ = 10.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_ATTACK);
} else if ((s32)this->skelAnime.animCurrentFrame == 21) {
} else if ((s32)this->skelAnime.curFrame == 21) {
this->actor.speedXZ = 0.0f;
} else if ((s32)this->skelAnime.animCurrentFrame == 24) {
} else if ((s32)this->skelAnime.curFrame == 24) {
this->swordState = -1;
}
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) && (this->spinAttackState < 2)) {
if (SkelAnime_Update(&this->skelAnime) && (this->spinAttackState < 2)) {
if (!func_8002E084(&this->actor, 0x1554)) {
EnGeldB_SetupReady(this);
this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f;
@ -890,7 +889,7 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupRollBack(EnGeldB* this) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06001390, -3.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001390, -3.0f);
this->timer = 0;
this->invisible = true;
this->actionState = GELDB_ROLL_BACK;
@ -901,7 +900,7 @@ void EnGeldB_SetupRollBack(EnGeldB* this) {
}
void EnGeldB_RollBack(EnGeldB* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (SkelAnime_Update(&this->skelAnime)) {
if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistFromLink < 170.0f) &&
(this->actor.xzDistFromLink > 140.0f) && (Rand_ZeroOne() < 0.2f)) {
EnGeldB_SetupSpinAttack(this);
@ -921,7 +920,7 @@ void EnGeldB_SetupStunned(EnGeldB* this) {
this->actor.speedXZ = 0.0f;
}
if ((this->damageEffect != GELDB_DAMAGE_FREEZE) || (this->actionState == GELDB_SPIN_ATTACK)) {
SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, &D_06002280, 0.0f);
Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06002280, 0.0f);
}
if (this->damageEffect == GELDB_DAMAGE_FREEZE) {
this->iceTimer = 36;
@ -951,7 +950,7 @@ void EnGeldB_Stunned(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupDamaged(EnGeldB* this) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06002280, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &D_06002280, -4.0f);
if (this->actor.bgCheckFlags & 1) {
this->invisible = false;
this->actor.speedXZ = -4.0f;
@ -979,7 +978,7 @@ void EnGeldB_Damaged(EnGeldB* this, GlobalContext* globalCtx) {
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x1194, 0);
if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0) &&
SkelAnime_FrameUpdateMatrix(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
angleToWall = this->actor.wallPolyRot - this->actor.shape.rot.y;
if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistFromLink < 90.0f)) {
EnGeldB_SetupJump(this);
@ -995,7 +994,7 @@ void EnGeldB_Damaged(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupJump(EnGeldB* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06001390, -1.0f, SkelAnime_GetFrameCount(&D_06001390), 0.0f, 2, -3.0f);
Animation_Change(&this->skelAnime, &D_06001390, -1.0f, Animation_GetLastFrame(&D_06001390), 0.0f, 2, -3.0f);
this->timer = 0;
this->invisible = false;
this->actionState = GELDB_JUMP;
@ -1012,7 +1011,7 @@ void EnGeldB_Jump(EnGeldB* this, GlobalContext* globalCtx) {
func_800355B8(globalCtx, &this->rightFootPos);
func_800355B8(globalCtx, &this->leftFootPos);
}
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) && (this->actor.bgCheckFlags & 3)) {
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 3)) {
this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink;
this->actor.shape.rot.x = 0;
this->actor.speedXZ = 0.0f;
@ -1029,14 +1028,14 @@ void EnGeldB_Jump(EnGeldB* this, GlobalContext* globalCtx) {
void EnGeldB_SetupBlock(EnGeldB* this) {
f32 lastFrame;
lastFrame = SkelAnime_GetFrameCount(&D_06001578);
lastFrame = Animation_GetLastFrame(&D_06001578);
if (this->swordState != 0) {
this->swordState = -1;
}
this->actor.speedXZ = 0.0f;
this->actionState = GELDB_BLOCK;
this->timer = (s32)Rand_CenteredFloat(10.0f) + 10;
SkelAnime_ChangeAnim(&this->skelAnime, &D_06001578, 0.0f, 0.0f, lastFrame, 2, 0.0f);
Animation_Change(&this->skelAnime, &D_06001578, 0.0f, 0.0f, lastFrame, 2, 0.0f);
EnGeldB_SetupAction(this, EnGeldB_Block);
}
@ -1049,9 +1048,9 @@ void EnGeldB_Block(EnGeldB* this, GlobalContext* globalCtx) {
if (this->timer != 0) {
this->timer--;
} else {
this->skelAnime.animPlaybackSpeed = 1.0f;
this->skelAnime.playSpeed = 1.0f;
}
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (SkelAnime_Update(&this->skelAnime)) {
angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y;
if ((ABS(angleToLink) <= 0x4000) && (this->actor.xzDistFromLink < 40.0f) &&
(ABS(this->actor.yDistFromLink) < 50.0f)) {
@ -1097,7 +1096,7 @@ void EnGeldB_SetupSidestep(EnGeldB* this, GlobalContext* globalCtx) {
s16 linkAngle;
Player* player;
SkelAnime_ChangeAnim(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, SkelAnime_GetFrameCount(&D_0600A814), 1, 0.0f);
Animation_Change(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600A814), 1, 0.0f);
player = PLAYER;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 1);
linkAngle = player->actor.shape.rot.y;
@ -1108,7 +1107,7 @@ void EnGeldB_SetupSidestep(EnGeldB* this, GlobalContext* globalCtx) {
} else {
this->actor.speedXZ = Rand_CenteredFloat(12.0f);
}
this->skelAnime.animPlaybackSpeed = -this->actor.speedXZ * 0.5f;
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
this->approachRate = 0.0f;
this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3FFF;
this->timer = Rand_ZeroOne() * 10.0f + 5.0f;
@ -1171,16 +1170,16 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
this->actor.posRot.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate;
}
if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) {
this->skelAnime.animPlaybackSpeed = -this->actor.speedXZ * 0.5f;
this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f;
} else {
this->skelAnime.animPlaybackSpeed = -this->approachRate * 0.5f;
this->skelAnime.playSpeed = -this->approachRate * 0.5f;
}
this->skelAnime.animPlaybackSpeed = CLAMP(this->skelAnime.animPlaybackSpeed, -3.0f, 3.0f);
thisKeyFrame = this->skelAnime.animCurrentFrame;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
prevKeyFrame = this->skelAnime.animCurrentFrame - ABS(this->skelAnime.animPlaybackSpeed);
this->skelAnime.playSpeed = CLAMP(this->skelAnime.playSpeed, -3.0f, 3.0f);
thisKeyFrame = this->skelAnime.curFrame;
SkelAnime_Update(&this->skelAnime);
prevKeyFrame = this->skelAnime.curFrame - ABS(this->skelAnime.playSpeed);
playSpeed = ((void) 0, ABS(this->skelAnime.animPlaybackSpeed)); // Needed to match for some reason
playSpeed = ((void)0, ABS(this->skelAnime.playSpeed)); // Needed to match for some reason
if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0)) {
if (--this->timer == 0) {
@ -1211,7 +1210,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
}
}
}
if ((thisKeyFrame != (s32)this->skelAnime.animCurrentFrame) &&
if ((thisKeyFrame != (s32)this->skelAnime.curFrame) &&
(((prevKeyFrame < 0) && (((s32)playSpeed + thisKeyFrame) > 0)) ||
((prevKeyFrame < 5) && (((s32)playSpeed + thisKeyFrame) > 5)))) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_LAND);
@ -1223,7 +1222,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
}
void EnGeldB_SetupDefeated(EnGeldB* this) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06001E10, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001E10, -4.0f);
this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink;
if (this->actor.bgCheckFlags & 1) {
this->invisible = false;
@ -1245,9 +1244,9 @@ void EnGeldB_Defeated(EnGeldB* this, GlobalContext* globalCtx) {
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
this->invisible = false;
}
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (SkelAnime_Update(&this->skelAnime)) {
EnGeldB_SetupFlee(this);
} else if ((s32)this->skelAnime.animCurrentFrame == 10) {
} else if ((s32)this->skelAnime.curFrame == 10) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN);
func_800F5B58();
}
@ -1330,7 +1329,7 @@ void EnGeldB_Update(Actor* thisx, GlobalContext* globalCtx) {
((this->actor.dmgEffectTimer == 0) || !(this->actor.dmgEffectParams & 0x4000))) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base);
}
if ((this->actionState == GELDB_BLOCK) && (this->skelAnime.animCurrentFrame == 0.0f)) {
if ((this->actionState == GELDB_BLOCK) && (this->skelAnime.curFrame == 0.0f)) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->blockCollider.base);
}
if (this->swordState > 0) {
@ -1366,7 +1365,7 @@ s32 EnGeldB_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
gDPSetEnvColor(POLY_OPA_DISP++, 140, 0, 0, 255);
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_geldB.c", 2529);
return 0;
return false;
}
void EnGeldB_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
@ -1469,9 +1468,9 @@ void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_geldB.c", 2672);
if (1) {}
if ((this->spinAttackState >= 2) && SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if ((this->spinAttackState >= 2) && SkelAnime_Update(&this->skelAnime)) {
if (this->spinAttackState == 2) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06000F5C, 0.5f, 0.0f, 12.0f, 3, 4.0f);
Animation_Change(&this->skelAnime, &D_06000F5C, 0.5f, 0.0f, 12.0f, 3, 4.0f);
this->spinAttackState++;
thisx->posRot.rot.y = thisx->shape.rot.y = thisx->yawTowardsLink;
} else {
@ -1493,7 +1492,7 @@ void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx) {
if ((this->actionState != GELDB_WAIT) || !this->invisible) {
func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeDLists[this->blinkState]));
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnGeldB_OverrideLimbDraw, EnGeldB_PostLimbDraw, this);
if (this->actionState == GELDB_BLOCK) {
s32 i;

View file

@ -12,8 +12,8 @@ typedef struct EnGeldB {
/* 0x0000 */ Actor actor;
/* 0x014C */ Vec3s bodyPartsPos[10];
/* 0x0188 */ SkelAnime skelAnime;
/* 0x01CC */ Vec3s limbDrawTbl[24];
/* 0x025C */ Vec3s transitionDrawTbl[24];
/* 0x01CC */ Vec3s jointTable[24];
/* 0x025C */ Vec3s morphTable[24];
/* 0x02EC */ s32 actionState;
/* 0x02F0 */ char unk_2F0[4];
/* 0x02F4 */ EnGeldBActionFunc actionFunc;