1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 06:10:21 +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:
fig02 2021-01-18 16:04:04 -05:00 committed by GitHub
parent 20206fba0d
commit 00a5edea71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
697 changed files with 8157 additions and 7942 deletions

View file

@ -68,7 +68,7 @@ static DamageTable sDamageTable = {
const ActorInit En_Reeba_InitVars = {
ACTOR_EN_REEBA,
ACTORTYPE_MISC,
ACTORCAT_MISC,
FLAGS,
OBJECT_REEBA,
sizeof(EnReeba),
@ -107,9 +107,9 @@ void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 surfaceType;
this->actor.naviEnemyId = 0x47;
this->actor.unk_1F = 3;
this->actor.targetMode = 3;
this->actor.gravity = -3.5f;
this->actor.posRot2.pos = this->actor.posRot.pos;
this->actor.focus.pos = this->actor.world.pos;
SkelAnime_Init(globalCtx, &this->skelanime, &D_06001EE8, &D_060001E4, this->jointTable, this->morphTable, 18);
this->actor.colChkInfo.mass = MASS_HEAVY;
this->actor.colChkInfo.health = 4;
@ -126,15 +126,15 @@ void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.health = 20;
this->collider.info.toucher.effect = 4;
this->collider.info.toucher.damage = 16;
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY);
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY);
}
this->actor.shape.unk_08 = this->unk_284 = this->scale * -27500.0f;
ActorShape_Init(&this->actor.shape, this->actor.shape.unk_08, ActorShadow_DrawFunc_Circle, 0.0f);
this->actor.shape.yOffset = this->unk_284 = this->scale * -27500.0f;
ActorShape_Init(&this->actor.shape, this->actor.shape.yOffset, ActorShadow_DrawCircle, 0.0f);
this->actor.colChkInfo.damageTable = &sDamageTable;
func_8002E4B4(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D);
surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource);
surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
if ((surfaceType != 4) && (surfaceType != 7)) {
Actor_Kill(&this->actor);
@ -182,7 +182,7 @@ void func_80AE4F40(EnReeba* this, GlobalContext* globalCtx) {
}
this->actor.flags &= ~0x08000000;
this->actor.posRot.pos.y = this->actor.groundY;
this->actor.world.pos.y = this->actor.floorHeight;
if (this->isBig) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_BIG_APPEAR);
@ -200,34 +200,35 @@ void func_80AE5054(EnReeba* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
if ((globalCtx->gameplayFrames % 4) == 0) {
func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, this->actor.shape.unk_10, 1, 8.0f, 500, 10, 1);
func_80033260(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, 500, 10,
1);
}
if (this->unk_278 == 0) {
Math_ApproachF(&this->actor.shape.unk_10, 12.0f, 1.0f, 1.0f);
if (this->actor.shape.unk_08 < 0.0f) {
Math_ApproachZeroF(&this->actor.shape.unk_08, 1.0f, this->unk_288);
Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 1.0f, 1.0f);
if (this->actor.shape.yOffset < 0.0f) {
Math_ApproachZeroF(&this->actor.shape.yOffset, 1.0f, this->unk_288);
Math_ApproachF(&this->unk_288, 300.0f, 1.0f, 5.0f);
} else {
this->unk_288 = 0.0f;
this->actor.shape.unk_08 = 0.0f;
this->actor.shape.yOffset = 0.0f;
playerLinearVel = player->linearVelocity;
switch (this->unk_280) {
case 0:
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
break;
case 1:
this->actor.posRot.rot.y = this->actor.yawTowardsLink + (800.0f * playerLinearVel);
this->actor.world.rot.y = this->actor.yawTowardsPlayer + (800.0f * playerLinearVel);
break;
case 2:
case 3:
this->actor.posRot.rot.y =
this->actor.yawTowardsLink +
(player->actor.shape.rot.y - this->actor.yawTowardsLink) * (playerLinearVel * 0.15f);
this->actor.world.rot.y =
this->actor.yawTowardsPlayer +
(player->actor.shape.rot.y - this->actor.yawTowardsPlayer) * (playerLinearVel * 0.15f);
break;
case 4:
this->actor.posRot.rot.y = this->actor.yawTowardsLink - (800.0f * playerLinearVel);
this->actor.world.rot.y = this->actor.yawTowardsPlayer - (800.0f * playerLinearVel);
break;
}
@ -247,16 +248,16 @@ void func_80AE5270(EnReeba* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
if (this->actor.shape.unk_10 < 12.0f) {
Math_ApproachF(&this->actor.shape.unk_10, 12.0f, 3.0f, 1.0f);
if (this->actor.shape.shadowScale < 12.0f) {
Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 3.0f, 1.0f);
}
surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource);
surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
if ((surfaceType != 4) && (surfaceType != 7)) {
this->actor.speedXZ = 0.0f;
this->actionfunc = func_80AE5688;
} else if ((this->unk_272 == 0) || (this->actor.xzDistToLink < 30.0f) || (this->actor.xzDistToLink > 400.0f) ||
} else if ((this->unk_272 == 0) || (this->actor.xzDistToPlayer < 30.0f) || (this->actor.xzDistToPlayer > 400.0f) ||
(this->actor.bgCheckFlags & 8)) {
this->actionfunc = func_80AE5688;
} else if (this->unk_274 == 0) {
@ -278,21 +279,21 @@ void func_80AE53AC(EnReeba* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelanime);
if (this->actor.shape.unk_10 < 12.0f) {
Math_ApproachF(&this->actor.shape.unk_10, 12.0f, 3.0f, 1.0f);
if (this->actor.shape.shadowScale < 12.0f) {
Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 3.0f, 1.0f);
}
surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource);
surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
if (((surfaceType != 4) && (surfaceType != 7)) || (this->actor.xzDistToLink > 400.0f) ||
if (((surfaceType != 4) && (surfaceType != 7)) || (this->actor.xzDistToPlayer > 400.0f) ||
(this->actor.bgCheckFlags & 8)) {
this->actionfunc = func_80AE5688;
} else {
if ((this->actor.xzDistToLink < 70.0f) && (this->unk_270 == 0)) {
if ((this->actor.xzDistToPlayer < 70.0f) && (this->unk_270 == 0)) {
this->unk_270 = 30;
}
speed = (this->actor.xzDistToLink - 20.0f) / ((Rand_ZeroOne() * 50.0f) + 150.0f);
speed = (this->actor.xzDistToPlayer - 20.0f) / ((Rand_ZeroOne() * 50.0f) + 150.0f);
this->actor.speedXZ += speed * 1.8f;
if (this->actor.speedXZ >= 3.0f) {
this->actor.speedXZ = 3.0f;
@ -301,10 +302,10 @@ void func_80AE53AC(EnReeba* this, GlobalContext* globalCtx) {
this->actor.speedXZ = -3.0f;
}
yawDiff = (this->unk_270 == 0) ? this->actor.yawTowardsLink : -this->actor.yawTowardsLink;
yawDiff -= this->actor.posRot.rot.y;
yawDiff = (this->unk_270 == 0) ? this->actor.yawTowardsPlayer : -this->actor.yawTowardsPlayer;
yawDiff -= this->actor.world.rot.y;
yaw = (yawDiff > 0) ? ((yawDiff / 31.0f) + 10.0f) : ((yawDiff / 31.0f) - 10.0f);
this->actor.posRot.rot.y += yaw * 2.0f;
this->actor.world.rot.y += yaw * 2.0f;
if (this->unk_274 == 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_MOVE);
@ -334,17 +335,17 @@ void func_80AE5688(EnReeba* this, GlobalContext* globalCtx) {
}
void func_80AE56E0(EnReeba* this, GlobalContext* globalCtx) {
Math_ApproachZeroF(&this->actor.shape.unk_10, 1.0f, 0.3f);
Math_ApproachZeroF(&this->actor.shape.shadowScale, 1.0f, 0.3f);
Math_ApproachZeroF(&this->actor.speedXZ, 0.1f, 0.3f);
SkelAnime_Update(&this->skelanime);
if ((this->unk_284 + 10.0f) <= this->actor.shape.unk_08) {
if ((this->unk_284 + 10.0f) <= this->actor.shape.yOffset) {
if ((globalCtx->gameplayFrames % 4) == 0) {
func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, this->actor.shape.unk_10, 1, 8.0f, 500, 10,
1);
func_80033260(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, 500,
10, 1);
}
Math_ApproachF(&this->actor.shape.unk_08, this->unk_284, 1.0f, this->unk_288);
Math_ApproachF(&this->actor.shape.yOffset, this->unk_284, 1.0f, this->unk_288);
Math_ApproachF(&this->unk_288, 300.0f, 1.0f, 5.0f);
} else {
Actor_Kill(&this->actor);
@ -354,7 +355,7 @@ void func_80AE56E0(EnReeba* this, GlobalContext* globalCtx) {
void func_80AE57F0(EnReeba* this, GlobalContext* globalCtx) {
this->unk_276 = 14;
this->actor.speedXZ = -8.0f;
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8);
this->actionfunc = func_80AE5854;
}
@ -378,7 +379,7 @@ void func_80AE5854(EnReeba* this, GlobalContext* globalCtx) {
void func_80AE58EC(EnReeba* this, GlobalContext* globalCtx) {
this->unk_278 = 14;
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.speedXZ = -8.0f;
this->actor.flags |= 0x8000000;
this->actor.flags &= ~5;
@ -398,9 +399,9 @@ void func_80AE5938(EnReeba* this, GlobalContext* globalCtx) {
if ((this->unk_27E == 4) || (this->actor.colChkInfo.health != 0)) {
if (this->unk_27E == 2) {
pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(20.0f);
pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(20.0f);
pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(20.0f);
pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f);
pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f);
pos.z = this->actor.world.pos.z + Rand_CenteredFloat(20.0f);
scale = 3.0f;
if (this->isBig) {
@ -425,9 +426,9 @@ void func_80AE5A9C(EnReeba* this, GlobalContext* globalCtx) {
if (this->unk_278 != 0) {
if ((this->unk_27E == 2) && ((this->unk_278 & 0xF) == 0)) {
pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(20.0f);
pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(20.0f);
pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(20.0f);
pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f);
pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f);
pos.z = this->actor.world.pos.z + Rand_CenteredFloat(20.0f);
scale = 3.0f;
if (this->isBig) {
@ -445,7 +446,7 @@ void func_80AE5A9C(EnReeba* this, GlobalContext* globalCtx) {
void func_80AE5BC4(EnReeba* this, GlobalContext* globalCtx) {
this->actor.speedXZ = -8.0f;
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8);
this->unk_278 = 14;
this->actor.flags &= ~1;
@ -466,9 +467,9 @@ void func_80AE5C38(EnReeba* this, GlobalContext* globalCtx) {
Math_ApproachZeroF(&this->scale, 0.1f, 0.01f);
if (this->scale < 0.01f) {
pos.x = this->actor.posRot.pos.x;
pos.y = this->actor.posRot.pos.y;
pos.z = this->actor.posRot.pos.z;
pos.x = this->actor.world.pos.x;
pos.y = this->actor.world.pos.y;
pos.z = this->actor.world.pos.z;
velocity.y = 4.0f;
@ -604,14 +605,14 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) {
}
Actor_MoveForward(&this->actor);
func_8002E4B4(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D);
if (this->collider.base.atFlags & AT_BOUNCED) {
this->collider.base.atFlags &= ~AT_BOUNCED;
if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) {
this->actor.speedXZ = 8.0f;
this->actor.posRot.rot.y *= -1.0f;
this->actor.world.rot.y *= -1.0f;
this->unk_272 = 14;
this->actionfunc = func_80AE561C;
return;
@ -625,21 +626,21 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) {
}
}
this->actor.posRot2.pos = this->actor.posRot.pos;
this->actor.focus.pos = this->actor.world.pos;
if (!this->isBig) {
this->actor.posRot2.pos.y += 15.0f;
this->actor.focus.pos.y += 15.0f;
} else {
this->actor.posRot2.pos.y += 30.0f;
this->actor.focus.pos.y += 30.0f;
}
Collider_UpdateCylinder(&this->actor, &this->collider);
if ((this->actor.shape.unk_08 >= -700.0f) && (this->actor.colChkInfo.health > 0) &&
if ((this->actor.shape.yOffset >= -700.0f) && (this->actor.colChkInfo.health > 0) &&
(this->actionfunc != func_80AE56E0)) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (!(this->actor.shape.unk_08 < 0.0f)) {
if (!(this->actor.shape.yOffset < 0.0f)) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) {
@ -670,10 +671,10 @@ void EnReeba_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (BREG(0)) {
Vec3f debugPos;
debugPos.x = (Math_SinS(this->actor.posRot.rot.y) * 30.0f) + this->actor.posRot.pos.x;
debugPos.y = this->actor.posRot.pos.y + 20.0f;
debugPos.z = (Math_CosS(this->actor.posRot.rot.y) * 30.0f) + this->actor.posRot.pos.z;
DebugDisplay_AddObject(debugPos.x, debugPos.y, debugPos.z, this->actor.posRot.rot.x, this->actor.posRot.rot.y,
this->actor.posRot.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx);
debugPos.x = (Math_SinS(this->actor.world.rot.y) * 30.0f) + this->actor.world.pos.x;
debugPos.y = this->actor.world.pos.y + 20.0f;
debugPos.z = (Math_CosS(this->actor.world.rot.y) * 30.0f) + this->actor.world.pos.z;
DebugDisplay_AddObject(debugPos.x, debugPos.y, debugPos.z, this->actor.world.rot.x, this->actor.world.rot.y,
this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx);
}
}