mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-21 06:21:16 +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
|
@ -17,7 +17,7 @@ void EnPart_Draw(Actor* thisx, GlobalContext* globalCtx);
|
|||
|
||||
const ActorInit En_Part_InitVars = {
|
||||
ACTOR_EN_PART,
|
||||
ACTORTYPE_ITEMACTION,
|
||||
ACTORCAT_ITEMACTION,
|
||||
FLAGS,
|
||||
OBJECT_GAMEPLAY_KEEP,
|
||||
sizeof(EnPart),
|
||||
|
@ -46,7 +46,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) {
|
|||
f32 sign = 1.0f;
|
||||
|
||||
this->action = 1;
|
||||
this->actor.posRot.rot.y = Rand_ZeroOne() * 20000.0f;
|
||||
this->actor.world.rot.y = Rand_ZeroOne() * 20000.0f;
|
||||
|
||||
switch (this->actor.params) {
|
||||
case 0:
|
||||
|
@ -60,14 +60,14 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) {
|
|||
this->timer = 400;
|
||||
case 12:
|
||||
this->actor.speedXZ = Rand_CenteredFloat(6.0f);
|
||||
this->actor.initPosRot.pos = this->actor.posRot.pos;
|
||||
this->actor.home.pos = this->actor.world.pos;
|
||||
this->timer += 60;
|
||||
this->actor.velocity.y = Rand_ZeroOne() * 5.0f + 4.0f;
|
||||
this->actor.gravity = -0.6f - Rand_ZeroOne() * 0.5f;
|
||||
this->rotZSpeed = 0.15f;
|
||||
break;
|
||||
case 14:
|
||||
EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot.pos, 40, 0x8001, 0, -1);
|
||||
EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.world.pos, 40, 0x8001, 0, -1);
|
||||
case 1:
|
||||
case 4:
|
||||
case 9:
|
||||
|
@ -79,7 +79,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) {
|
|||
this->rotZSpeed = 0.15f;
|
||||
break;
|
||||
case 11:
|
||||
EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot.pos, 40, 0x8001, 0, -1);
|
||||
EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.world.pos, 40, 0x8001, 0, -1);
|
||||
case 3:
|
||||
this->actor.speedXZ = (Rand_ZeroOne() - 0.5f) * 3.0f;
|
||||
this->timer = (s16)(Rand_ZeroOne() * 17.0f) + 10;
|
||||
|
@ -91,7 +91,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) {
|
|||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
this->actor.posRot.rot.y = this->actor.parent->shape.rot.y;
|
||||
this->actor.world.rot.y = this->actor.parent->shape.rot.y;
|
||||
if (this->displayList == D_06015380) {
|
||||
sign = -1.0f;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) {
|
|||
this->actor.speedXZ = 6.0f * sign;
|
||||
this->actor.gravity = -1.2f;
|
||||
this->rotZSpeed = 0.15f * sign;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
|
||||
this->timer = 18;
|
||||
break;
|
||||
}
|
||||
|
@ -113,9 +113,9 @@ void func_80ACE13C(EnPart* this, GlobalContext* globalCtx) {
|
|||
Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
if ((this->actor.params == 12) || (this->actor.params == 13)) {
|
||||
func_8002E4B4(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 0x1D);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 0x1D);
|
||||
|
||||
if ((this->actor.bgCheckFlags & 1) || (this->actor.posRot.pos.y <= this->actor.groundY)) {
|
||||
if ((this->actor.bgCheckFlags & 1) || (this->actor.world.pos.y <= this->actor.floorHeight)) {
|
||||
this->action = 4;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.gravity = 0.0f;
|
||||
|
@ -131,22 +131,22 @@ void func_80ACE13C(EnPart* this, GlobalContext* globalCtx) {
|
|||
case 9:
|
||||
case 10:
|
||||
case 14:
|
||||
EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec,
|
||||
EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec,
|
||||
(s16)(this->actor.scale.y * 100.0f) * 40, 7, 255, 255, 255, 255, 0, 255, 0, 1, 9,
|
||||
true);
|
||||
break;
|
||||
case 3:
|
||||
case 11:
|
||||
EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec,
|
||||
EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec,
|
||||
(s16)(this->actor.scale.y * 100.0f) * 40, 7, 255, 255, 255, 255, 0, 0, 255, 1, 9,
|
||||
true);
|
||||
break;
|
||||
case 4:
|
||||
for (i = 7; i >= 0; i--) {
|
||||
pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(60.0f);
|
||||
pos.y = this->actor.posRot.pos.y + this->actor.shape.unk_08 * this->actor.scale.y +
|
||||
pos.x = this->actor.world.pos.x + Rand_CenteredFloat(60.0f);
|
||||
pos.y = this->actor.world.pos.y + this->actor.shape.yOffset * this->actor.scale.y +
|
||||
Rand_CenteredFloat(50.0f);
|
||||
pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(60.0f);
|
||||
pos.z = this->actor.world.pos.z + Rand_CenteredFloat(60.0f);
|
||||
velocity.y = Rand_ZeroOne() + 1.0f;
|
||||
EffectSsDtBubble_SpawnColorProfile(globalCtx, &pos, &velocity, &accel, Rand_S16Offset(80, 100), 25,
|
||||
0, true);
|
||||
|
@ -157,9 +157,9 @@ void func_80ACE13C(EnPart* this, GlobalContext* globalCtx) {
|
|||
case 7:
|
||||
case 8:
|
||||
for (i = 4; i >= 0; i--) {
|
||||
pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(25.0f);
|
||||
pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(40.0f);
|
||||
pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(25.0f);
|
||||
pos.x = this->actor.world.pos.x + Rand_CenteredFloat(25.0f);
|
||||
pos.y = this->actor.world.pos.y + Rand_CenteredFloat(40.0f);
|
||||
pos.z = this->actor.world.pos.z + Rand_CenteredFloat(25.0f);
|
||||
EffectSsDeadDb_Spawn(globalCtx, &pos, &zeroVec, &zeroVec, 40, 7, 255, 255, 255, 255, 0, 0, 255, 1,
|
||||
9, true);
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ void func_80ACE5C8(EnPart* this, GlobalContext* globalCtx) {
|
|||
Vec3f velocity = { 0.0f, 8.0f, 0.0f };
|
||||
Vec3f accel = { 0.0f, -1.5f, 0.0f };
|
||||
|
||||
if (sqrt(this->actor.xyzDistToLinkSq) <= 40.0f) {
|
||||
if (sqrt(this->actor.xyzDistToPlayerSq) <= 40.0f) {
|
||||
u8 prevInvincibilityTimer = player->invincibilityTimer;
|
||||
if (player->invincibilityTimer <= 0) {
|
||||
if (player->invincibilityTimer <= -40) {
|
||||
|
@ -198,15 +198,15 @@ void func_80ACE5C8(EnPart* this, GlobalContext* globalCtx) {
|
|||
globalCtx->damagePlayer(globalCtx, -8);
|
||||
}
|
||||
}
|
||||
func_8002F71C(globalCtx, this->actor.parent, (650.0f - this->actor.parent->xzDistToLink) * 0.04f + 4.0f,
|
||||
this->actor.parent->posRot.rot.y, 8.0f);
|
||||
func_8002F71C(globalCtx, this->actor.parent, (650.0f - this->actor.parent->xzDistToPlayer) * 0.04f + 4.0f,
|
||||
this->actor.parent->world.rot.y, 8.0f);
|
||||
player->invincibilityTimer = prevInvincibilityTimer;
|
||||
this->timer = 1;
|
||||
}
|
||||
|
||||
func_80033480(globalCtx, &this->actor.posRot.pos, 0.0f, 1, 300, 150, 1);
|
||||
func_80033480(globalCtx, &this->actor.world.pos, 0.0f, 1, 300, 150, 1);
|
||||
velocity.x = Rand_CenteredFloat(16.0f);
|
||||
EffectSsHahen_Spawn(globalCtx, &this->actor.posRot.pos, &velocity, &accel, 20,
|
||||
EffectSsHahen_Spawn(globalCtx, &this->actor.world.pos, &velocity, &accel, 20,
|
||||
(s32)((Rand_ZeroOne() * 5.0f + 12.0f) * 2), -1, 10, NULL);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MONBLIN_GNDWAVE - SFX_FLAG);
|
||||
}
|
||||
|
@ -216,19 +216,19 @@ void func_80ACE7E8(EnPart* this, GlobalContext* globalCtx) {
|
|||
Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
if ((this->actor.parent == NULL) || (this->actor.parent->update == NULL)) {
|
||||
EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec,
|
||||
EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec,
|
||||
(s16)(this->actor.scale.y * 100.0f) * 40, 7, 255, 255, 255, 255, 0, 255, 0, 1, 9, true);
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
f32 diffsSum = Math_SmoothStepToF(&this->actor.posRot.pos.x, this->actor.initPosRot.pos.x, 1.0f, 5.0f, 0.0f);
|
||||
diffsSum += Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 1.0f, 5.0f, 0.0f);
|
||||
diffsSum += Math_SmoothStepToF(&this->actor.posRot.pos.z, this->actor.initPosRot.pos.z, 1.0f, 5.0f, 0.0f);
|
||||
f32 diffsSum = Math_SmoothStepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 1.0f, 5.0f, 0.0f);
|
||||
diffsSum += Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 1.0f, 5.0f, 0.0f);
|
||||
diffsSum += Math_SmoothStepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 1.0f, 5.0f, 0.0f);
|
||||
diffsSum += Math_SmoothStepToF(&this->rotZ, 0.0f, 1.0f, 0.25f, 0.0f);
|
||||
if (diffsSum == 0.0f) {
|
||||
this->actor.parent->initPosRot.rot.x--;
|
||||
this->actor.parent->home.rot.x--;
|
||||
this->timer--;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_DAMAGE);
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ void EnPart_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_MoveForward(&this->actor);
|
||||
|
||||
if ((this->actor.params > 4 && this->actor.params < 9) || this->actor.params < 0) {
|
||||
func_8002E4B4(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 5);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 5);
|
||||
if (this->actor.params >= 0) {
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
|
||||
if (thisx->bgCheckFlags & 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue