mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-07 14:50:15 +00:00
Actor Struct Changes (and a few related things) (#617)
* reformat header * type -> category * done for now i think * some more stuff * first -> head * focus * flag comment * ground -> floor * remove asm, name wrapper funcs * name func, format * review * targetPriority, format * git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "0305ec2c2" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "0305ec2c2" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * comment * review * feet flags * horse shadow
This commit is contained in:
parent
20206fba0d
commit
00a5edea71
697 changed files with 8157 additions and 7942 deletions
|
@ -34,7 +34,7 @@ static s32 sPlayerIsCaught = false;
|
|||
|
||||
const ActorInit En_Heishi1_InitVars = {
|
||||
0,
|
||||
ACTORTYPE_NPC,
|
||||
ACTORCAT_NPC,
|
||||
FLAGS,
|
||||
OBJECT_SD,
|
||||
sizeof(EnHeishi1),
|
||||
|
@ -167,13 +167,13 @@ void EnHeishi1_Walk(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
|
||||
pointPos += this->waypoint;
|
||||
|
||||
Math_ApproachF(&this->actor.posRot.pos.x, pointPos->x, 1.0f, this->moveSpeed);
|
||||
Math_ApproachF(&this->actor.posRot.pos.z, pointPos->z, 1.0f, this->moveSpeed);
|
||||
Math_ApproachF(&this->actor.world.pos.x, pointPos->x, 1.0f, this->moveSpeed);
|
||||
Math_ApproachF(&this->actor.world.pos.z, pointPos->z, 1.0f, this->moveSpeed);
|
||||
|
||||
Math_ApproachF(&this->moveSpeed, this->moveSpeedTarget, 1.0f, this->moveSpeedMax);
|
||||
|
||||
pathDiffX = pointPos->x - this->actor.posRot.pos.x;
|
||||
pathDiffZ = pointPos->z - this->actor.posRot.pos.z;
|
||||
pathDiffX = pointPos->x - this->actor.world.pos.x;
|
||||
pathDiffZ = pointPos->z - this->actor.world.pos.z;
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * 10430.378f), 3,
|
||||
this->bodyTurnSpeed, 0);
|
||||
|
||||
|
@ -237,14 +237,14 @@ void EnHeishi1_MoveToLink(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
Player* player = PLAYER;
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Math_ApproachF(&this->actor.posRot.pos.x, player->actor.posRot.pos.x, 1.0f, this->moveSpeed);
|
||||
Math_ApproachF(&this->actor.posRot.pos.z, player->actor.posRot.pos.z, 1.0f, this->moveSpeed);
|
||||
Math_ApproachF(&this->actor.world.pos.x, player->actor.world.pos.x, 1.0f, this->moveSpeed);
|
||||
Math_ApproachF(&this->actor.world.pos.z, player->actor.world.pos.z, 1.0f, this->moveSpeed);
|
||||
Math_ApproachF(&this->moveSpeed, 6.0f, 1.0f, 0.4f);
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, this->bodyTurnSpeed, 0);
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, this->bodyTurnSpeed, 0);
|
||||
Math_ApproachF(&this->bodyTurnSpeed, 3000.0f, 1.0f, 300.0f);
|
||||
Math_ApproachZeroF(&this->headAngle, 0.5f, 2000.0f);
|
||||
|
||||
if (this->actor.xzDistToLink < 70.0f) {
|
||||
if (this->actor.xzDistToPlayer < 70.0f) {
|
||||
this->actionFunc = EnHeishi1_SetupTurnTowardLink;
|
||||
}
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ void EnHeishi1_TurnTowardLink(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->type != 5) {
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, this->bodyTurnSpeed, 0);
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, this->bodyTurnSpeed, 0);
|
||||
Math_ApproachF(&this->bodyTurnSpeed, 3000.0f, 1.0f, 300.0f);
|
||||
Math_ApproachZeroF(&this->headAngle, 0.5f, 2000.0f);
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ void EnHeishi1_SetupWaitNight(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
void EnHeishi1_WaitNight(EnHeishi1* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->actor.xzDistToLink < 100.0f) {
|
||||
if (this->actor.xzDistToPlayer < 100.0f) {
|
||||
func_8010B680(globalCtx, 0x702D, &this->actor);
|
||||
func_80078884(NA_SE_SY_FOUND);
|
||||
// "Discovered!"
|
||||
|
@ -429,9 +429,9 @@ void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Vec3f searchBallMult = { 0.0f, 0.0f, 20.0f };
|
||||
Vec3f searchBallPos;
|
||||
|
||||
searchBallPos.x = this->actor.posRot.pos.x;
|
||||
searchBallPos.y = this->actor.posRot.pos.y + 60.0f;
|
||||
searchBallPos.z = this->actor.posRot.pos.z;
|
||||
searchBallPos.x = this->actor.world.pos.x;
|
||||
searchBallPos.y = this->actor.world.pos.y + 60.0f;
|
||||
searchBallPos.z = this->actor.world.pos.z;
|
||||
|
||||
Matrix_Push();
|
||||
Matrix_RotateY(((this->actor.shape.rot.y + this->headAngle) / 32768.0f) * M_PI, 0);
|
||||
|
@ -442,9 +442,9 @@ void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
EffectSsSolderSrchBall_Spawn(globalCtx, &searchBallPos, &searchBallVel, &searchBallAccel, 2,
|
||||
&this->linkDetected);
|
||||
|
||||
if (this->actor.xzDistToLink < 60.0f) {
|
||||
if (this->actor.xzDistToPlayer < 60.0f) {
|
||||
this->linkDetected = true;
|
||||
} else if (this->actor.xzDistToLink < 70.0f) {
|
||||
} else if (this->actor.xzDistToPlayer < 70.0f) {
|
||||
// this case probably exists to detect link making a jump sound
|
||||
// from slightly further away than the previous 60 unit check
|
||||
if (player->actor.velocity.y > -4.0f) {
|
||||
|
@ -463,7 +463,7 @@ void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (!(player->actor.velocity.y > -3.9f)) {
|
||||
this->linkDetected = false;
|
||||
// this 60 unit height check is so the player doesnt get caught when on the upper path
|
||||
if (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 60.0f) {
|
||||
if (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 60.0f) {
|
||||
func_80078884(NA_SE_SY_FOUND);
|
||||
// "Discovered!"
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 発見! ☆☆☆☆☆ \n" VT_RST);
|
||||
|
@ -500,11 +500,11 @@ void EnHeishi1_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHeishi1_OverrideLimbDraw, NULL,
|
||||
this);
|
||||
func_80033C30(&this->actor.posRot.pos, &matrixScale, 0xFF, globalCtx);
|
||||
func_80033C30(&this->actor.world.pos, &matrixScale, 0xFF, globalCtx);
|
||||
|
||||
if ((this->path == BREG(1)) && (BREG(0) != 0)) {
|
||||
DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y + 100.0f, this->actor.posRot.pos.z,
|
||||
17000, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0,
|
||||
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y + 100.0f, this->actor.world.pos.z,
|
||||
17000, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0,
|
||||
255, 4, globalCtx->state.gfxCtx);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue