1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 23:10:22 +00:00

attchaedA/attachedB renamed to parent/child (#358)

* fix colliderinit typo

* rename parent/child

* cleanup

* forgot to change something in functions.h

* SpawnAsChild

* format
This commit is contained in:
fig02 2020-08-29 18:25:16 -04:00 committed by GitHub
parent 468c592792
commit 1f1b5e39f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
233 changed files with 584 additions and 585 deletions

View file

@ -74,29 +74,29 @@ void ArmsHook_Wait(ArmsHook* this, GlobalContext* globalCtx) {
Player* player;
s32 length;
if (this->actor.attachedA == NULL) {
if (this->actor.parent == NULL) {
player = PLAYER;
// get correct timer length for hookshot or longshot
length = (player->heldItemActionParam == 0x10) ? 13 : 26;
ArmsHook_SetupAction(this, ArmsHook_Shoot);
func_8002D9A4(&this->actor, 20.0f);
this->actor.attachedA = &PLAYER->actor;
this->actor.parent = &PLAYER->actor;
this->timer = length;
}
}
void func_80865044(ArmsHook* this) {
this->actor.attachedB = this->actor.attachedA;
this->actor.attachedA->attachedA = &this->actor;
this->actor.child = this->actor.parent;
this->actor.parent->parent = &this->actor;
}
s32 ArmsHook_AttachToPlayer(ArmsHook* this, Player* player) {
player->actor.attachedB = &this->actor;
player->actor.child = &this->actor;
player->heldActor = &this->actor;
if (this->actor.attachedB != NULL) {
player->actor.attachedA = NULL;
this->actor.attachedB = NULL;
if (this->actor.child != NULL) {
player->actor.parent = NULL;
this->actor.child = NULL;
return 1;
}
return 0;
@ -110,7 +110,7 @@ void ArmsHook_DetachHookFromActor(ArmsHook* this) {
}
s32 ArmsHook_CheckForCancel(ArmsHook* this) {
Player* player = (Player*)this->actor.attachedA;
Player* player = (Player*)this->actor.parent;
if (func_8008F104(player)) {
if ((player->unk_154 != player->heldItemActionParam) || ((player->actor.flags & 0x100)) ||
((player->stateFlags1 & 0x4000080))) {
@ -151,7 +151,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
f32 velocity;
s32 pad1;
if ((this->actor.attachedA == NULL) || (!func_8008F104(player))) {
if ((this->actor.parent == NULL) || (!func_8008F104(player))) {
ArmsHook_DetachHookFromActor(this);
Actor_Kill(&this->actor);
return;
@ -185,7 +185,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
grabbed = NULL;
this->grabbed = NULL;
} else {
if (this->actor.attachedB != NULL) {
if (this->actor.child != NULL) {
sp94 = func_8002DB48(this, grabbed);
sp90 =
sqrtf(SQ(this->grabbedDistDiff.x) + SQ(this->grabbedDistDiff.y) + SQ(this->grabbedDistDiff.z));
@ -203,7 +203,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
velocity = 0.0f;
phi_f16 = 0.0f;
} else {
if (this->actor.attachedB != NULL) {
if (this->actor.child != NULL) {
velocity = 30.0f;
} else {
if (grabbed != NULL) {
@ -223,7 +223,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
newPos.y = bodyDistDiffVec.y * velocity;
newPos.z = bodyDistDiffVec.z * velocity;
if (this->actor.attachedB == NULL) {
if (this->actor.child == NULL) {
if ((grabbed != NULL) && (grabbed->id == ACTOR_BG_SPOT06_OBJECTS)) {
Math_Vec3f_Diff(&grabbed->posRot.pos, &this->grabbedDistDiff, &this->actor.posRot.pos);
phi_f16 = 1.0f;

View file

@ -1,7 +1,7 @@
/*
* File: z_arrow_fire.c
* Overlay: ovl_Arrow_Fire
* Description: Fire Arrow. Spawned by and attached to a normal arrow.
* Description: Fire Arrow. Spawned as a child of a normal arrow.
*/
#include "z_arrow_fire.h"
@ -64,7 +64,7 @@ void ArrowFire_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void ArrowFire_Charge(ArrowFire* this, GlobalContext* globalCtx) {
EnArrow* arrow;
arrow = (EnArrow*)this->actor.attachedA;
arrow = (EnArrow*)this->actor.parent;
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
Actor_Kill(&this->actor);
return;
@ -73,14 +73,14 @@ void ArrowFire_Charge(ArrowFire* this, GlobalContext* globalCtx) {
if (this->radius < 10) {
this->radius += 1;
}
// copy position and rotation from the attached arrow
// copy position and rotation from arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_FIRE - SFX_FLAG);
// If arrow's attached is null, Link has fired the arrow
if (arrow->actor.attachedA == NULL) {
// if arrow has no parent, player has fired the arrow
if (arrow->actor.parent == NULL) {
this->unkPos = this->actor.posRot.pos;
this->radius = 10;
ArrowFire_SetupAction(this, ArrowFire_Fly);
@ -151,12 +151,12 @@ void ArrowFire_Fly(ArrowFire* this, GlobalContext* globalCtx) {
f32 distanceScaled;
s32 pad;
arrow = (EnArrow*)this->actor.attachedA;
arrow = (EnArrow*)this->actor.parent;
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
Actor_Kill(&this->actor);
return;
}
// copy position and rotation from the attached arrow
// copy position and rotation from arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f);
@ -200,7 +200,7 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx* dispRefs[4];
stateFrames = globalCtx->state.frames;
arrow = (EnArrow*)this->actor.attachedA;
arrow = (EnArrow*)this->actor.parent;
if (1) {}
if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) {

View file

@ -1,7 +1,7 @@
/*
* File: z_arrow_ice.c
* Overlay: ovl_Arrow_Ice
* Description: Ice Arrow. Spawned by and attached to a normal arrow.
* Description: Ice Arrow. Spawned as a child of a normal arrow.
*/
#include "z_arrow_ice.h"
@ -65,7 +65,7 @@ void ArrowIce_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void ArrowIce_Charge(ArrowIce* this, GlobalContext* globalCtx) {
EnArrow* arrow;
arrow = (EnArrow*)this->actor.attachedA;
arrow = (EnArrow*)this->actor.parent;
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
Actor_Kill(&this->actor);
return;
@ -74,14 +74,14 @@ void ArrowIce_Charge(ArrowIce* this, GlobalContext* globalCtx) {
if (this->radius < 10) {
this->radius += 1;
}
// copy position and rotation from the attached arrow
// copy position and rotation from arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_ICE - SFX_FLAG);
// If arrow's attached is null, Link has fired the arrow
if (arrow->actor.attachedA == NULL) {
// if arrow has no parent, player has fired the arrow
if (arrow->actor.parent == NULL) {
this->unkPos = this->actor.posRot.pos;
this->radius = 10;
ArrowIce_SetupAction(this, ArrowIce_Fly);
@ -152,12 +152,12 @@ void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx) {
f32 distanceScaled;
s32 pad;
arrow = (EnArrow*)this->actor.attachedA;
arrow = (EnArrow*)this->actor.parent;
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
Actor_Kill(&this->actor);
return;
}
// copy position and rotation from the attached arrow
// copy position and rotation from arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f);
@ -201,7 +201,7 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx* dispRefs[4];
stateFrames = globalCtx->state.frames;
arrow = (EnArrow*)this->actor.attachedA;
arrow = (EnArrow*)this->actor.parent;
if (1) {}
if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) {

View file

@ -1,7 +1,7 @@
/*
* File: z_arrow_light.c
* Overlay: ovl_Arrow_Light
* Description: Light Arrow. Spawned by and attached to a normal arrow.
* Description: Light Arrow. Spawned as a child of a normal arrow.
*/
#include "z_arrow_light.h"
@ -65,7 +65,7 @@ void ArrowLight_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void ArrowLight_Charge(ArrowLight* this, GlobalContext* globalCtx) {
EnArrow* arrow;
arrow = (EnArrow*)this->actor.attachedA;
arrow = (EnArrow*)this->actor.parent;
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
Actor_Kill(&this->actor);
return;
@ -74,14 +74,14 @@ void ArrowLight_Charge(ArrowLight* this, GlobalContext* globalCtx) {
if (this->radius < 10) {
this->radius += 1;
}
// copy position and rotation from the attached arrow
// copy position and rotation from arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_LIGHT - SFX_FLAG);
// If arrow's attached is null, Link has fired the arrow
if (arrow->actor.attachedA == NULL) {
// if arrow has no parent, player has fired the arrow
if (arrow->actor.parent == NULL) {
this->unkPos = this->actor.posRot.pos;
this->radius = 10;
ArrowLight_SetupAction(this, ArrowLight_Fly);
@ -152,12 +152,12 @@ void ArrowLight_Fly(ArrowLight* this, GlobalContext* globalCtx) {
f32 distanceScaled;
s32 pad;
arrow = (EnArrow*)this->actor.attachedA;
arrow = (EnArrow*)this->actor.parent;
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
Actor_Kill(&this->actor);
return;
}
// copy position and rotation from the attached arrow
// copy position and rotation from parent arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f);
@ -201,7 +201,7 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx* dispRefs[4];
stateFrames = globalCtx->state.frames;
arrow = (EnArrow*)this->actor.attachedA;
arrow = (EnArrow*)this->actor.parent;
if (1) {}
if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) {

View file

@ -121,10 +121,10 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = func_8086C6EC;
} else {
if (BgBdanObjects_GetContactRu1(this, 4)) {
if (Actor_SpawnAttached(&globalCtx->actorCtx, this, globalCtx, ACTOR_EN_BIGOKUTA,
thisx->initPosRot.pos.x, thisx->initPosRot.pos.y, thisx->initPosRot.pos.z, 0,
thisx->shape.rot.y + 0x8000, 0, 3) != NULL) {
thisx->attachedB->posRot.pos.z = thisx->attachedB->initPosRot.pos.z + 263.0f;
if (Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_EN_BIGOKUTA,
thisx->initPosRot.pos.x, thisx->initPosRot.pos.y, thisx->initPosRot.pos.z, 0,
thisx->shape.rot.y + 0x8000, 0, 3) != NULL) {
thisx->child->posRot.pos.z = thisx->child->initPosRot.pos.z + 263.0f;
}
thisx->posRot.rot.y = 0;
this->actionFunc = func_8086C618;
@ -228,9 +228,9 @@ void func_8086C29C(BgBdanObjects* this, GlobalContext* globalCtx) {
}
if (BgBdanObjects_GetContactRu1(this, 3)) {
Actor_SpawnAttached(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_EN_BIGOKUTA,
this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.y + 140.0f,
this->dyna.actor.posRot.pos.z, 0, this->dyna.actor.shape.rot.y + 0x8000, 0, 0);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_EN_BIGOKUTA,
this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.y + 140.0f,
this->dyna.actor.posRot.pos.z, 0, this->dyna.actor.shape.rot.y + 0x8000, 0, 0);
BgBdanObjects_SetContactRu1(this, 4);
this->unk_16A = 0xA;
this->actionFunc = func_8086C55C;
@ -247,9 +247,9 @@ void func_8086C3D8(BgBdanObjects* this, GlobalContext* globalCtx) {
this->dyna.actor.posRot.rot.y = 0;
this->unk_16A = 0x3C;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U);
this->dyna.actor.attachedB->posRot.pos.y = this->dyna.actor.posRot.pos.y + 140.0f;
this->dyna.actor.child->posRot.pos.y = this->dyna.actor.posRot.pos.y + 140.0f;
this->actionFunc = func_8086C5BC;
func_800800F8(globalCtx, 0xC08, -0x63, this->dyna.actor.attachedB, 0);
func_800800F8(globalCtx, 0xC08, -0x63, this->dyna.actor.child, 0);
player->actor.posRot.pos.x = -1130.0f;
player->actor.posRot.pos.y = -1025.0f;
player->actor.posRot.pos.z = -3500.0f;
@ -265,8 +265,8 @@ void func_8086C3D8(BgBdanObjects* this, GlobalContext* globalCtx) {
func_800AA000(0.0f, 0x78, 0x14, 0xA);
this->unk_16A = 0xB;
}
if (this->dyna.actor.attachedB != NULL) {
this->dyna.actor.attachedB->posRot.pos.y = this->dyna.actor.posRot.pos.y + 140.0f;
if (this->dyna.actor.child != NULL) {
this->dyna.actor.child->posRot.pos.y = this->dyna.actor.posRot.pos.y + 140.0f;
}
}
}
@ -287,11 +287,11 @@ void func_8086C5BC(BgBdanObjects* this, GlobalContext* globalCtx) {
this->unk_16A -= 1;
}
if (this->unk_16A == 0) {
if (this->dyna.actor.attachedB != NULL) {
if (this->dyna.actor.attachedB->params == 2) {
if (this->dyna.actor.child != NULL) {
if (this->dyna.actor.child->params == 2) {
this->actionFunc = func_8086C618;
} else if (this->dyna.actor.attachedB->params == 0) {
this->dyna.actor.attachedB->params = 1;
} else if (this->dyna.actor.child->params == 0) {
this->dyna.actor.child->params = 1;
}
}
}

View file

@ -60,7 +60,7 @@ void BgDdanKd_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
s32 sp24 = 0;
this->previousCollidingExplosion = NULL;
this->prevExplosive = NULL;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyInfo_SetActorMove(&this->dyna.actor, 1);
@ -86,26 +86,25 @@ void BgDdanKd_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void BgDdanKd_CheckForExplosions(BgDdanKd* this, GlobalContext* globalCtx) {
Actor* currentCollidingExplosion;
Actor* explosive;
currentCollidingExplosion = func_80033640(globalCtx, &this->collider);
if (currentCollidingExplosion != NULL) {
explosive = Actor_GetCollidedExplosive(globalCtx, &this->collider);
if (explosive != NULL) {
osSyncPrintf("dam %d\n", this->dyna.actor.colChkInfo.damage);
currentCollidingExplosion->params = 2;
explosive->params = 2;
}
if ((currentCollidingExplosion != NULL) && (this->previousCollidingExplosion != NULL) &&
(currentCollidingExplosion != this->previousCollidingExplosion) &&
(Math_Vec3f_DistXZ(&this->previousCollidingExplosionPos, &currentCollidingExplosion->posRot.pos) > 80.0f)) {
if ((explosive != NULL) && (this->prevExplosive != NULL) && (explosive != this->prevExplosive) &&
(Math_Vec3f_DistXZ(&this->prevExplosivePos, &explosive->posRot.pos) > 80.0f)) {
BgDdanKd_SetupAction(this, BgDdanKd_LowerStairs);
func_800800F8(globalCtx, 0xBEA, 0x3E7, this, 0);
} else {
if (this->timer != 0) {
this->timer -= 1;
} else {
this->previousCollidingExplosion = currentCollidingExplosion;
if (currentCollidingExplosion != NULL) {
this->prevExplosive = explosive;
if (explosive != NULL) {
this->timer = 13;
this->previousCollidingExplosionPos = currentCollidingExplosion->posRot.pos;
this->prevExplosivePos = explosive->posRot.pos;
}
}
Collider_CylinderUpdate(&this->dyna.actor, &this->collider);

View file

@ -10,9 +10,9 @@ typedef void (*BgDdanKdActionFunc)(struct BgDdanKd*, GlobalContext*);
typedef struct BgDdanKd {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ Actor* previousCollidingExplosion;
/* 0x0164 */ Actor* prevExplosive;
/* 0x0168 */ s16 timer;
/* 0x016C */ Vec3f previousCollidingExplosionPos;
/* 0x016C */ Vec3f prevExplosivePos;
/* 0x0178 */ ColliderCylinder collider;
/* 0x01C4 */ BgDdanKdActionFunc actionFunc;
} BgDdanKd; // size = 0x01C8

View file

@ -45,7 +45,7 @@ static ColliderCylinderInit sColCylinderInit1 = {
{ 50, 60, 280, { 0, 0, 0 } },
};
s16 slsAttached = false;
s16 sHasParent = false;
Color_RGBA8_n D_8087259C = { 100, 100, 100, 0 };
Color_RGBA8_n D_808725A0 = { 40, 40, 40, 0 };
@ -122,13 +122,12 @@ void BgDodoago_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx) {
Actor* attachedActor = func_80033640(globalCtx, &this->colliders[0].base);
Actor* explosive = Actor_GetCollidedExplosive(globalCtx, &this->colliders[0].base);
if (attachedActor != NULL) {
if (explosive != NULL) {
this->unk_164 =
(Math_Vec3f_Yaw(&this->dyna.actor.posRot.pos, &attachedActor->posRot.pos) >= this->dyna.actor.shape.rot.y)
? 1
: 0;
(Math_Vec3f_Yaw(&this->dyna.actor.posRot.pos, &explosive->posRot.pos) >= this->dyna.actor.shape.rot.y) ? 1
: 0;
if (((globalCtx->unk_11D30[0] == 0xFF) && (this->unk_164 == 1)) ||
((globalCtx->unk_11D30[1] == 0xFF) && (this->unk_164 == 0))) {
@ -148,9 +147,9 @@ void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx) {
return;
}
if (!slsAttached) {
this->dyna.actor.attachedA = attachedActor;
slsAttached = true;
if (!sHasParent) {
this->dyna.actor.parent = explosive;
sHasParent = true;
D_80872824 = 0x32;
}
} else {
@ -219,9 +218,11 @@ void func_80871FB8(BgDodoago* this, GlobalContext* globalCtx) {
if (Math_SmoothScaleMaxMinS(&this->dyna.actor.shape.rot.x, 0x1333, 0x6E - this->unk_164, 0x3E8, 0x32) == 0) {
BgDodoago_SetupAction(this, func_8087227C);
Audio_PlaySoundGeneral(NA_SE_EV_STONE_BOUND, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8);
Audio_PlaySoundGeneral(NA_SE_EV_STONE_BOUND, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
} else {
Audio_PlaySoundGeneral(NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8);
Audio_PlaySoundGeneral(NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &D_801333E0,
&D_801333E0, &D_801333E8);
}
}
@ -240,8 +241,8 @@ void BgDodoago_Update(Actor* thisx, GlobalContext* globalCtx) {
BgDodoago* this = THIS;
EnBom* bomb;
if (this->dyna.actor.attachedA == NULL) {
if ((s32)(this->colliders[1].base.maskA & 2) || (this->colliders[2].base.maskA & 2)) {
if (this->dyna.actor.parent == NULL) {
if ((s32)(this->colliders[1].base.maskA & 2) || (this->colliders[2].base.maskA & 2)) {
if ((s32)(this->colliders[1].base.maskA & 2)) {
bomb = (EnBom*)this->colliders[1].base.oc;
@ -251,7 +252,7 @@ void BgDodoago_Update(Actor* thisx, GlobalContext* globalCtx) {
this->colliders[1].base.maskA &= ~2;
this->colliders[2].base.maskA &= ~2;
if (bomb->actor.type == ACTORTYPE_EXPLOSIVES && bomb->actor.id == ACTOR_EN_BOM && bomb->actor.params == 0) {
this->dyna.actor.attachedA = &bomb->actor;
this->dyna.actor.parent = &bomb->actor;
bomb->timer = 50;
bomb->actor.speedXZ = 0.0f;
D_80872824 = 0;
@ -264,7 +265,7 @@ void BgDodoago_Update(Actor* thisx, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) {
D_808727C0[0]++;
} else {
this->dyna.actor.attachedA = NULL;
this->dyna.actor.parent = NULL;
}
}
}

View file

@ -323,8 +323,8 @@ void BgHeavyBlock_SpawnPieces(BgHeavyBlock* this, GlobalContext* globalCtx) {
void BgHeavyBlock_Wait(BgHeavyBlock* this, GlobalContext* globalCtx) {
s32 quakeIndex;
// if attached A is set, start onepointdemo (cutscene) and quake
if (func_8002F410(&this->dyna.actor, globalCtx)) {
// if block has a parent link has lifted it, start onepointdemo (cutscene) and quake
if (Actor_HasParent(&this->dyna.actor, globalCtx)) {
this->timer = 0;
switch (this->dyna.actor.params & 0xFF) {
@ -376,8 +376,8 @@ void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, GlobalContext* globalCtx) {
func_8002DF54(globalCtx, player, 8);
// if attachedA is NULL, link threw it
if (func_8002F5A0(&this->dyna.actor, globalCtx)) {
// if parent is NULL, link threw it
if (Actor_HasNoParent(&this->dyna.actor, globalCtx)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_HEAVY_THROW);
this->actionFunc = BgHeavyBlock_Fly;
}

View file

@ -51,8 +51,8 @@ void BgHidanFslift_Init(Actor* thisx, GlobalContext* globalCtx) {
DynaPolyInfo_SetActorMove(thisx, 1);
DynaPolyInfo_Alloc(&D_0600E1E8, &local_c);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c);
if (Actor_SpawnAttached(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_HSBLOCK, thisx->posRot.pos.x,
thisx->posRot.pos.y + 40.0f, thisx->posRot.pos.z + -28.0f, 0, 0, 0, 2) == NULL) {
if (Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_HSBLOCK, thisx->posRot.pos.x,
thisx->posRot.pos.y + 40.0f, thisx->posRot.pos.z + -28.0f, 0, 0, 0, 2) == NULL) {
Actor_Kill(thisx);
return;
}
@ -62,13 +62,13 @@ void BgHidanFslift_Init(Actor* thisx, GlobalContext* globalCtx) {
void func_80886F24(BgHidanFslift* this) {
Actor* thisx = &this->dyna.actor;
if (thisx->attachedB != NULL && thisx->attachedB->update != NULL) {
thisx->attachedB->posRot.pos.x = thisx->posRot.pos.x;
thisx->attachedB->posRot.pos.y = thisx->posRot.pos.y + 40.0f;
thisx->attachedB->posRot.pos.z = thisx->posRot.pos.z + -28.0f;
if (thisx->child != NULL && thisx->child->update != NULL) {
thisx->child->posRot.pos.x = thisx->posRot.pos.x;
thisx->child->posRot.pos.y = thisx->posRot.pos.y + 40.0f;
thisx->child->posRot.pos.z = thisx->posRot.pos.z + -28.0f;
return;
}
thisx->attachedB = NULL;
thisx->child = NULL;
}
void BgHidanFslift_Destroy(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -1,8 +1,8 @@
/*
* File: z_bg_spot17_bakudankabe.c
* Overlay: ovl_Bg_Spot17_Bakudankabe
* Description: Death Mountain Crater Bombable Wall
*/
* File: z_bg_spot17_bakudankabe.c
* Overlay: ovl_Bg_Spot17_Bakudankabe
* Description: Death Mountain Crater Bombable Wall
*/
#include "z_bg_spot17_bakudankabe.h"

View file

@ -58,7 +58,7 @@ void BgSpot18Futa_Update(Actor* thisx, GlobalContext* globalCtx) {
BgSpot18Futa* this = THIS;
s32 iVar1;
if (this->actor.attachedA == NULL) {
if (this->actor.parent == NULL) {
iVar1 = Math_ApproxF(&this->actor.scale.x, 0, 0.005);
if (iVar1 != 0) {

View file

@ -94,7 +94,7 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
gSaveContext.cutsceneTrigger = 1;
}
if (LINK_IS_CHILD || ((gSaveContext.eventChkInf[5] & 0x20))) {
if (func_8002F410(&this->actor, globalCtx) != 0) {
if (Actor_HasParent(&this->actor, globalCtx)) {
if (LINK_IS_CHILD) {
Item_Give(globalCtx, ITEM_SWORD_MASTER);
globalCtx->csCtx.segment = D_808BB2F0;
@ -104,7 +104,7 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
Audio_SetBGM(NA_BGM_STOP);
Audio_SetBGM(0x53);
gSaveContext.cutsceneTrigger = 1;
this->actor.attachedA = NULL;
this->actor.parent = NULL;
BgTokiSwd_SetupAction(this, func_808BB0AC);
} else {
if (func_8002E084(&this->actor, 0x2000) != 0) {
@ -124,8 +124,8 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx) {
Player* player;
// if attached is set, sword has been pulled/placed from the pedestal
if (func_8002F410(&this->actor, globalCtx) != 0) {
// if sword has a parent it has been pulled/placed from the pedestal
if (Actor_HasParent(&this->actor, globalCtx)) {
if (LINK_IS_CHILD) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_SWORD_PUTAWAY_STN);
this->actor.draw = NULL; // sword has been pulled, dont draw sword

View file

@ -310,7 +310,7 @@ void func_80985358(DemoIm* this, GlobalContext* globalCtx) {
f32 posY = this->actor.posRot.pos.y;
f32 posZ = this->actor.posRot.pos.z;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2);
}
void func_809853B4(DemoIm* this, GlobalContext* globalCtx) {
@ -319,8 +319,8 @@ void func_809853B4(DemoIm* this, GlobalContext* globalCtx) {
f32 playerY = player->actor.posRot.pos.y + 80.0f;
f32 playerZ = player->actor.posRot.pos.z;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, playerX, playerY, playerZ, 0,
0, 0, 0xD);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, playerX, playerY, playerZ, 0,
0, 0, 0xD);
Item_Give(globalCtx, GI_BOMBCHUS_5);
}
@ -440,8 +440,8 @@ void func_809858A8(void) {
}
void func_809858C8(DemoIm* this, GlobalContext* globalCtx) {
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x,
(kREG(17) + 24.0f) + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 6);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x,
(kREG(17) + 24.0f) + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 6);
}
void func_80985948(DemoIm* this, GlobalContext* globalCtx) {

View file

@ -223,7 +223,7 @@ void func_8098E86C(DemoSa* this, GlobalContext* globalCtx) {
f32 posY = posRot->y;
f32 posZ = posRot->z;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2);
}
void func_8098E8C8(DemoSa* this, GlobalContext* globalCtx) {
@ -232,8 +232,8 @@ void func_8098E8C8(DemoSa* this, GlobalContext* globalCtx) {
f32 posY = player->actor.posRot.pos.y + 80.0f;
f32 posZ = player->actor.posRot.pos.z;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0,
0xB);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0,
0xB);
Item_Give(globalCtx, ITEM_MEDALLION_FOREST);
}
@ -371,8 +371,8 @@ void func_8098EE08(void) {
}
void func_8098EE28(DemoSa* this, GlobalContext* globalCtx) {
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x,
(kREG(23) + 25.0f) + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 4);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x,
(kREG(23) + 25.0f) + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 4);
}
void func_8098EEA8(DemoSa* this, GlobalContext* globalCtx) {
@ -604,8 +604,8 @@ void func_8098F83C(DemoSa* this, GlobalContext* globalCtx) {
Vec3f* thisPos = &this->actor.posRot.pos;
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600B1A0, &D_0601113C, NULL, NULL, 0);
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, thisPos->x, thisPos->y, thisPos->z,
0, 0, 0, 3);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, thisPos->x, thisPos->y, thisPos->z,
0, 0, 0, 3);
this->action = 16;
this->drawConfig = 0;
this->actor.shape.unk_14 = 0;

View file

@ -116,8 +116,8 @@ void func_809B0524(EnAni* this, GlobalContext* globalCtx) {
}
void func_809B0558(EnAni* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx) != 0) {
this->actor.attachedA = NULL;
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
if (LINK_IS_CHILD) {
EnAni_SetupAction(this, func_809B04F0);
} else {

View file

@ -52,8 +52,8 @@ void EnAnubiceTag_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnAnubiceTag_SpawnAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) {
this->anubis =
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.yawTowardsLink, 0, 0);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.yawTowardsLink, 0, 0);
if (this->anubis != NULL) {
this->actionFunc = EnAnubiceTag_ManageAnubis;

View file

@ -65,9 +65,9 @@ void EnAttackNiw_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnAttackNiw_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnAttackNiw* this = THIS;
EnNiw* cucco = (EnNiw*)this->actor.attachedA;
EnNiw* cucco = (EnNiw*)this->actor.parent;
if (this->actor.attachedA != NULL) {
if (this->actor.parent != NULL) {
if ((cucco->actor.update != NULL) && (cucco->unk_296 > 0)) {
cucco->unk_296--;
}
@ -356,8 +356,8 @@ void EnAttackNiw_Update(Actor* thisx, GlobalContext* globalCtx) {
tmpf1 = 20.0f;
if (this->actor.xyzDistFromLinkSq < SQ(tmpf1)) {
cucco = (EnNiw*)this->actor.attachedA;
if ((this->actor.attachedA->update != NULL) && (this->actor.attachedA != NULL) && (cucco != NULL) &&
cucco = (EnNiw*)this->actor.parent;
if ((this->actor.parent->update != NULL) && (this->actor.parent != NULL) && (cucco != NULL) &&
(cucco->unk_26A == 0) && (player->invincibilityTimer == 0)) {
func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.posRot.rot.y, 0.0f, 0x10);
cucco->unk_26A = 0x46;

View file

@ -94,8 +94,8 @@ void EnBom_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnBom_Move(EnBom* this, GlobalContext* globalCtx) {
// if attached A is not null, the bomb hasnt been released yet
if (func_8002F410(&this->actor, globalCtx)) {
// if bomb has a parent actor, the bomb hasnt been released yet
if (Actor_HasParent(&this->actor, globalCtx)) {
EnBom_SetupAction(this, EnBom_WaitForRelease);
this->actor.room = -1;
return;
@ -134,8 +134,8 @@ void EnBom_Move(EnBom* this, GlobalContext* globalCtx) {
}
void EnBom_WaitForRelease(EnBom* this, GlobalContext* globalCtx) {
// if attachedA is NULL bomb has been released
if (func_8002F5A0(&this->actor, globalCtx)) {
// if parent is NULL bomb has been released
if (Actor_HasNoParent(&this->actor, globalCtx)) {
EnBom_SetupAction(this, EnBom_Move);
EnBom_Move(this, globalCtx);
}
@ -183,7 +183,7 @@ void EnBom_Explode(EnBom* this, GlobalContext* globalCtx) {
player = PLAYER;
if ((player->stateFlags1 & 0x800) && (player->heldActor == &this->actor)) {
player->actor.attachedB = NULL;
player->actor.child = NULL;
player->heldActor = NULL;
player->interactRangeActor = NULL;
player->stateFlags1 &= ~0x800;
@ -275,7 +275,7 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) {
effPos = thisx->posRot.pos;
effPos.y += 10.0f;
if (func_8002F410(thisx, globalCtx)) {
if (Actor_HasParent(thisx, globalCtx)) {
effPos.y += 30.0f;
}
@ -305,7 +305,7 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) {
Collider_CylinderUpdate(thisx, &this->bombCollider);
// if link is not holding the bomb anymore and bump conditions are met, subscribe to OC
if (!func_8002F410(thisx, globalCtx) && this->bumpOn) {
if (!Actor_HasParent(thisx, globalCtx) && this->bumpOn) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bombCollider.base);
}

View file

@ -125,7 +125,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
s32 pad2;
if (this->flowerBombScale >= 1.0f) {
if (func_8002F410(&this->actor, globalCtx)) {
if (Actor_HasParent(&this->actor, globalCtx)) {
bombFlower =
(EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0);
@ -136,10 +136,10 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
Audio_PlayActorSound2(&this->actor, NA_SE_PL_PULL_UP_ROCK);
this->actor.flags &= ~1;
} else {
player->actor.attachedB = NULL;
player->actor.child = NULL;
player->heldActor = NULL;
player->interactRangeActor = NULL;
this->actor.attachedA = NULL;
this->actor.parent = NULL;
player->stateFlags1 &= ~0x800;
}
} else if (this->bombCollider.base.acFlags & 2) {
@ -169,13 +169,13 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
this->flowerBombScale = 0.0f;
}
} else {
if (!func_8002F410(&this->actor, globalCtx)) {
if (!Actor_HasParent(&this->actor, globalCtx)) {
func_8002F580(&this->actor, globalCtx);
} else {
player->actor.attachedB = NULL;
player->actor.child = NULL;
player->heldActor = NULL;
player->interactRangeActor = NULL;
this->actor.attachedA = NULL;
this->actor.parent = NULL;
player->stateFlags1 &= ~0x800;
this->actor.posRot.pos = this->actor.initPosRot.pos;
}
@ -189,11 +189,11 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
}
}
if (func_8002F410(&this->actor, globalCtx)) {
player->actor.attachedB = NULL;
if (Actor_HasParent(&this->actor, globalCtx)) {
player->actor.child = NULL;
player->heldActor = NULL;
player->interactRangeActor = NULL;
this->actor.attachedA = NULL;
this->actor.parent = NULL;
player->stateFlags1 &= ~0x800;
this->actor.posRot.pos = this->actor.initPosRot.pos;
}
@ -201,7 +201,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
}
void EnBombf_Move(EnBombf* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx)) {
if (Actor_HasParent(&this->actor, globalCtx)) {
// setting flowerBombScale does not do anything in the context of a bomb that link picks up
// this and the assignment below are probably left overs
this->flowerBombScale = 0.0f;
@ -226,8 +226,8 @@ void EnBombf_Move(EnBombf* this, GlobalContext* globalCtx) {
}
void EnBombf_WaitForRelease(EnBombf* this, GlobalContext* globalCtx) {
// if attachedA is NULL bomb has been released
if (func_8002F5A0(&this->actor, globalCtx)) {
// if parent is NULL bomb has been released
if (Actor_HasNoParent(&this->actor, globalCtx)) {
EnBombf_SetupAction(this, EnBombf_Move);
EnBombf_Move(this, globalCtx);
} else {
@ -278,7 +278,7 @@ void EnBombf_Explode(EnBombf* this, GlobalContext* globalCtx) {
player = PLAYER;
if ((player->stateFlags1 & 0x800) && (player->heldActor == &this->actor)) {
player->actor.attachedB = NULL;
player->actor.child = NULL;
player->heldActor = NULL;
player->interactRangeActor = NULL;
player->stateFlags1 &= ~0x800;
@ -302,7 +302,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
this->timer--;
}
if ((!this->bumpOn) && (!func_8002F410(thisx, globalCtx)) &&
if ((!this->bumpOn) && (!Actor_HasParent(thisx, globalCtx)) &&
((thisx->xzDistFromLink >= 20.0f) || (ABS(thisx->yDistFromLink) >= 80.0f))) {
this->bumpOn = true;
}
@ -387,7 +387,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
effPos.y += 10.0f;
if (func_8002F410(thisx, globalCtx)) {
if (Actor_HasParent(thisx, globalCtx)) {
effPos.y += 30.0f;
}

View file

@ -121,8 +121,8 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
}
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_COW, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, 1);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_COW, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, 1);
this->unk_278 = Math_Rand_ZeroFloat(1000.0f) + 40.0f;
this->unk_27A = 0;
this->actor.unk_1F = 6;
@ -205,8 +205,8 @@ void func_809DF730(EnCow* this, GlobalContext* globalCtx) {
}
void func_809DF778(EnCow* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx)) {
this->actor.attachedA = NULL;
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
this->actionFunc = func_809DF730;
} else {
func_8002F434(&this->actor, globalCtx, GI_MILK, 10000.0f, 100.0f);

View file

@ -149,8 +149,8 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) {
if (globalCtx->unk_11D4C(globalCtx, player) != 0) {
this->unk_1CA = 0;
this->unk_1CC++;
if (this->actor.attachedA != NULL) {
this->actor.attachedA->params = 1;
if (this->actor.parent != NULL) {
this->actor.parent->params = 1;
}
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_GRIP);
}
@ -171,9 +171,9 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) {
this->unk_1D0.z = (((this->unk_1D0.z - this->actor.shape.rot.x) - this->unk_1CE) - this->unk_1D0.x);
} else {
if (player->stateFlags2 & 0x80) {
if (&this->actor == player->actor.attachedA) {
if (&this->actor == player->actor.parent) {
player->stateFlags2 &= ~0x80;
player->actor.attachedA = NULL;
player->actor.parent = NULL;
player->unk_850 = 200;
}
}
@ -209,9 +209,9 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) {
} else {
unkVar = ~0x80;
if (player->stateFlags2 & 0x80) {
if (&this->actor == player->actor.attachedA) {
if (&this->actor == player->actor.parent) {
player->stateFlags2 &= unkVar;
player->actor.attachedA = NULL;
player->actor.parent = NULL;
player->unk_850 = 200;
}
}
@ -231,9 +231,9 @@ void func_809ECF8C(EnDha* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (player->stateFlags2 & 0x80) {
if (&this->actor == player->actor.attachedA) {
if (&this->actor == player->actor.parent) {
player->stateFlags2 &= ~0x80;
player->actor.attachedA = NULL;
player->actor.parent = NULL;
player->unk_850 = 200;
}
}
@ -251,12 +251,12 @@ void EnDha_SetupDeath(EnDha* this) {
this->unk_1C0 = 8;
this->unk_1C8 = 300;
if (this->actor.attachedA != NULL) {
if (this->actor.attachedA->params != 0xA) {
if (this->actor.parent != NULL) {
if (this->actor.parent->params != 0xA) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_HAND_DEAD);
}
if (this->actor.attachedA->params <= 0) {
this->actor.attachedA->params--;
if (this->actor.parent->params <= 0) {
this->actor.parent->params--;
}
}
EnDha_SetupAction(this, EnDha_Die);
@ -268,9 +268,9 @@ void EnDha_Die(EnDha* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (player->stateFlags2 & 0x80) {
if (&this->actor == player->actor.attachedA) {
if (&this->actor == player->actor.parent) {
player->stateFlags2 &= ~0x80;
player->actor.attachedA = NULL;
player->actor.parent = NULL;
player->unk_850 = 200;
}
}
@ -287,8 +287,8 @@ void EnDha_Die(EnDha* this, GlobalContext* globalCtx) {
return;
}
this->unk_1C8--;
if (this->actor.attachedA != 0) {
if (this->actor.attachedA->params == 0xA) {
if (this->actor.parent != 0) {
if (this->actor.parent->params == 0xA) {
Actor_Kill(&this->actor);
return;
}
@ -321,8 +321,8 @@ void EnDha_UpdateHealth(EnDha* this, GlobalContext* globalCtx) {
}
}
}
if (this->actor.attachedA != NULL) {
if (this->actor.attachedA->params == 0xA) {
if (this->actor.parent != NULL) {
if (this->actor.parent->params == 0xA) {
EnDha_SetupDeath(this);
}
}
@ -334,8 +334,8 @@ void EnDha_Update(Actor* thisx, GlobalContext* globalCtx) {
colChkCtx = &globalCtx->colChkCtx;
if (this->actor.attachedA == NULL) {
this->actor.attachedA = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_DH, ACTORTYPE_ENEMY, 10000.0f);
if (this->actor.parent == NULL) {
this->actor.parent = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_DH, ACTORTYPE_ENEMY, 10000.0f);
}
EnDha_UpdateHealth(this, globalCtx);
this->actionFunc(this, globalCtx);

View file

@ -88,8 +88,8 @@ void EnDs_DisplayOddPotionText(EnDs* this, GlobalContext* globalCtx) {
}
void EnDs_GiveOddPotion(EnDs* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx) != 0) {
this->actor.attachedA = NULL;
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
this->actionFunc = EnDs_DisplayOddPotionText;
gSaveContext.timer2State = 0;
} else {
@ -169,8 +169,8 @@ int EnDs_CheckRupeesAndBottle() {
}
void EnDs_GiveBluePotion(EnDs* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx) != 0) {
this->actor.attachedA = NULL;
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
this->actionFunc = EnDs_Talk;
} else {
func_8002F434(&this->actor, globalCtx, GI_POTION_BLUE, 10000.0f, 50.0f);

View file

@ -67,8 +67,8 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_150 = 1;
} else {
phi_f12 = 200.99f;
if ((thisx->attachedA != NULL) && (thisx->attachedA->update != NULL)) {
phi_f12 = 200.99f + ((EnDivingGame*)thisx->attachedA)->unk_2AA * 10.0f;
if ((thisx->parent != NULL) && (thisx->parent->update != NULL)) {
phi_f12 = 200.99f + ((EnDivingGame*)thisx->parent)->unk_2AA * 10.0f;
}
temp_v0 = Math_Rand_ZeroFloat(phi_f12);
if ((temp_v0 >= 0) && (temp_v0 < 40)) {
@ -88,8 +88,8 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, this->unk_160);
this->rupeeValue = 500;
this->unk_150 = 3;
if ((thisx->attachedA != NULL) && (thisx->attachedA->update != NULL)) {
((EnDivingGame*)thisx->attachedA)->unk_2AA = 0;
if ((thisx->parent != NULL) && (thisx->parent->update != NULL)) {
((EnDivingGame*)thisx->parent)->unk_2AA = 0;
}
}
}
@ -201,8 +201,8 @@ void EnExRuppy_DropIntoWater(EnExRuppy* this, GlobalContext* globalCtx) {
Math_SmoothScaleMaxF(&this->actor.gravity, -2.0f, 0.3f, 1.0f);
EnExRuppy_SpawnSparkles(this, globalCtx, 2, 0);
func_80078884(NA_SE_EV_RAINBOW_SHOWER - SFX_FLAG);
if ((this->actor.attachedA != NULL) && (this->actor.attachedA->update != NULL) &&
(((((EnDivingGame*)this->actor.attachedA)->unk_296 == 0) || (this->actor.bgCheckFlags & 0x20)) ||
if ((this->actor.parent != NULL) && (this->actor.parent->update != NULL) &&
(((((EnDivingGame*)this->actor.parent)->unk_296 == 0) || (this->actor.bgCheckFlags & 0x20)) ||
(this->timer == 0))) {
this->isFalling = 1;
this->actor.speedXZ = 0.0f;
@ -219,8 +219,8 @@ void EnExRuppy_EnterWater(EnExRuppy* this, GlobalContext* globalCtx) {
s32 pad;
f32 temp_f2;
if (((this->actor.attachedA != NULL) && (this->actor.attachedA->update != NULL)) &&
(((EnDivingGame*)this->actor.attachedA)->unk_2A2 == 2)) {
if (((this->actor.parent != NULL) && (this->actor.parent->update != NULL)) &&
(((EnDivingGame*)this->actor.parent)->unk_2A2 == 2)) {
this->isFalling = 0;
this->actor.posRot.pos.x = ((Math_Rand_ZeroOne() - 0.5f) * 300.0f) + -260.0f;
this->actor.posRot.pos.y = ((Math_Rand_ZeroOne() - 0.5f) * 200.0f) + 370.0f;
@ -250,8 +250,8 @@ void EnExRuppy_Sink(EnExRuppy* this, GlobalContext* globalCtx) {
func_80078914(&this->actor.projectedPos, NA_SE_EV_BOMB_DROP_WATER);
this->actionFunc = func_80A0AD88;
}
if (((this->actor.attachedA != NULL) && (this->actor.attachedA->update != NULL) &&
((EnDivingGame*)this->actor.attachedA)->unk_29C == 0)) {
if (((this->actor.parent != NULL) && (this->actor.parent->update != NULL) &&
((EnDivingGame*)this->actor.parent)->unk_29C == 0)) {
this->timer = 20;
this->actionFunc = func_80A0AEE0;
}
@ -267,8 +267,8 @@ void func_80A0AD88(EnExRuppy* this, GlobalContext* globalCtx) {
this->timer = 10;
func_800293E4(globalCtx, &this->actor.posRot.pos, 0.0f, 5.0f, 5.0f, Math_Rand_ZeroFloat(0.03f) + 0.07f);
}
if (this->actor.attachedA != NULL) {
divingGame = this->actor.attachedA;
if (this->actor.parent != NULL) {
divingGame = this->actor.parent;
if (divingGame->actor.update != NULL) {
if (divingGame->unk_29C == 0) {
this->timer = 20;
@ -306,9 +306,9 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, GlobalContext* globalCtx) {
distToBlowUp = 30.0f;
}
if (this->actor.xyzDistFromLinkSq < SQ(distToBlowUp)) {
if (this->actor.attachedA != NULL) {
if (this->actor.attachedA->update != NULL) {
((EnDivingGame*)this->actor.attachedA)->transitionDrawTable[15].z = 1;
if (this->actor.parent != NULL) {
if (this->actor.parent->update != NULL) {
((EnDivingGame*)this->actor.parent)->transitionDrawTable[15].z = 1;
}
} else {
// That idiot! error

View file

@ -188,9 +188,9 @@ void func_80A0F6F8(EnFhgFire* this, GlobalContext* globalCtx) {
this->unk_150.x = 0x25;
this->actor.posRot.pos.y -= 200.0f;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE,
this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 500,
0, 0, 0x24);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE,
this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 500, 0,
0, 0x24);
tmpVec = D_80A117BC;
@ -216,15 +216,15 @@ void func_80A0F6F8(EnFhgFire* this, GlobalContext* globalCtx) {
randY = (Math_Rand_ZeroOne() < 0.5f) ? 0x1000 : 0;
for (i = 0; i < 8; i++) {
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE,
this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0,
(i * 8192) + randY, 0x4000, i + 0x64);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE,
this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0,
(i * 8192) + randY, 0x4000, i + 0x64);
}
for (i = 0; i < 8; i++) {
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE,
this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0,
(i * 8192) + randY, 0, 0x23);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE,
this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0,
(i * 8192) + randY, 0, 0x23);
}
}
@ -374,7 +374,7 @@ void func_80A10008(EnFhgFire* this, GlobalContext* globalCtx) {
Vec3f sp54;
osSyncPrintf("yari hikari 1\n");
horse = (EnfHG*)this->actor.attachedA;
horse = (EnfHG*)this->actor.parent;
if ((this->unk_156 % 2) != 0) {
Actor_SetScale(&this->actor, 6.0f);
} else {
@ -408,7 +408,7 @@ void func_80A10008(EnFhgFire* this, GlobalContext* globalCtx) {
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s")
void func_80A10F18(EnFhgFire* this, GlobalContext* globalCtx) {
EnfHG* horse = (EnfHG*)this->actor.attachedA;
EnfHG* horse = (EnfHG*)this->actor.parent;
f32 phi_f0;
s32 tmp;

View file

@ -93,7 +93,7 @@ extern AnimationHeader D_06009244;
void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) {
EnFloormas* this = THIS;
GlobalContext* gctx = globalCtx;
GlobalContext* globalCtx2 = globalCtx;
s32 invisble;
s32 pad;
@ -120,28 +120,28 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = EnFloormas_SmWait;
} else {
// spawn first small floormaster
this->actor.attachedA =
Actor_Spawn(&gctx->actorCtx, gctx, ACTOR_EN_FLOORMAS, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, 0, 0, 0, invisble + SPAWN_SMALL);
if (this->actor.attachedA == NULL) {
this->actor.parent =
Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, invisble + SPAWN_SMALL);
if (this->actor.parent == NULL) {
Actor_Kill(&this->actor);
return;
}
// spawn 2nd small floormaster
this->actor.attachedB =
Actor_Spawn(&gctx->actorCtx, gctx, ACTOR_EN_FLOORMAS, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, 0, 0, 0, invisble + SPAWN_SMALL);
if (this->actor.attachedB == NULL) {
Actor_Kill(this->actor.attachedA);
this->actor.child =
Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, invisble + SPAWN_SMALL);
if (this->actor.child == NULL) {
Actor_Kill(this->actor.parent);
Actor_Kill(&this->actor);
return;
}
// link floormasters together
this->actor.attachedA->attachedB = &this->actor;
this->actor.attachedA->attachedA = this->actor.attachedB;
this->actor.attachedB->attachedA = &this->actor;
this->actor.attachedB->attachedB = this->actor.attachedA;
this->actor.parent->child = &this->actor;
this->actor.parent->parent = this->actor.child;
this->actor.child->parent = &this->actor;
this->actor.child->child = this->actor.parent;
EnFloormas_SetupBigDecideAction(this);
}
}
@ -256,8 +256,8 @@ void EnFloormas_SetupSplit(EnFloormas* this) {
} else {
this->actor.draw = EnFloormas_Draw;
}
this->actor.shape.rot.y = this->actor.attachedA->shape.rot.y + 0x5555;
this->actor.posRot.pos = this->actor.attachedA->posRot.pos;
this->actor.shape.rot.y = this->actor.parent->shape.rot.y + 0x5555;
this->actor.posRot.pos = this->actor.parent->posRot.pos;
this->actor.params = 0x10;
SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, SkelAnime_GetFrameCount(&D_060019CC), 2, 0.0f);
this->collider.dim.radius = sCylinderInit.dim.radius * 0.6f;
@ -342,13 +342,13 @@ void EnFloormas_SetupMerge(EnFloormas* this) {
}
void EnFloormas_SetupSmWait(EnFloormas* this) {
EnFloormas* attachedA = (EnFloormas*)this->actor.attachedA;
EnFloormas* attachedB = (EnFloormas*)this->actor.attachedB;
EnFloormas* parent = (EnFloormas*)this->actor.parent;
EnFloormas* child = (EnFloormas*)this->actor.child;
// if this is the last remaining small floor master, kill all.
if ((attachedA->actionFunc == EnFloormas_SmWait) && (attachedB->actionFunc == EnFloormas_SmWait)) {
Actor_Kill(&attachedA->actor);
Actor_Kill(&attachedB->actor);
if ((parent->actionFunc == EnFloormas_SmWait) && (child->actionFunc == EnFloormas_SmWait)) {
Actor_Kill(&parent->actor);
Actor_Kill(&child->actor);
Actor_Kill(&this->actor);
return;
}
@ -398,8 +398,8 @@ void EnFloormas_Die(EnFloormas* this, GlobalContext* globalCtx) {
if (this->actor.scale.x > 0.004f) {
// split
this->actor.shape.rot.y = this->actor.yawTowardsLink + 0x8000;
EnFloormas_SetupSplit((EnFloormas*)this->actor.attachedB);
EnFloormas_SetupSplit((EnFloormas*)this->actor.attachedA);
EnFloormas_SetupSplit((EnFloormas*)this->actor.child);
EnFloormas_SetupSplit((EnFloormas*)this->actor.parent);
EnFloormas_SetupSplit(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SPLIT);
} else {
@ -678,10 +678,10 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) {
}
if (this->actor.params == MERGE_SLAVE) {
if (this->actor.attachedA->params == MERGE_MASTER) {
primaryFloormas = this->actor.attachedA;
} else if (this->actor.attachedB->params == MERGE_MASTER) {
primaryFloormas = this->actor.attachedB;
if (this->actor.parent->params == MERGE_MASTER) {
primaryFloormas = this->actor.parent;
} else if (this->actor.child->params == MERGE_MASTER) {
primaryFloormas = this->actor.child;
} else {
this->actor.params = 0x10;
return;
@ -730,8 +730,8 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) {
void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
EnFloormas* attachedA;
EnFloormas* attachedB;
EnFloormas* parent;
EnFloormas* child;
f32 yDelta;
f32 xzDelta;
@ -761,14 +761,14 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) {
// let go
if (!(player->stateFlags2 & 0x80) || (player->invincibilityTimer < 0)) {
attachedA = this->actor.attachedA;
attachedB = this->actor.attachedB;
parent = this->actor.parent;
child = this->actor.child;
if (((attachedA->actionFunc == EnFloormas_GrabLink) || attachedA->actionFunc == EnFloormas_SmWait) &&
(attachedB->actionFunc == EnFloormas_GrabLink || attachedB->actionFunc == EnFloormas_SmWait)) {
if (((parent->actionFunc == EnFloormas_GrabLink) || parent->actionFunc == EnFloormas_SmWait) &&
(child->actionFunc == EnFloormas_GrabLink || child->actionFunc == EnFloormas_SmWait)) {
attachedA->actor.params = MERGE_SLAVE;
attachedB->actor.params = MERGE_SLAVE;
parent->actor.params = MERGE_SLAVE;
child->actor.params = MERGE_SLAVE;
this->actor.params = MERGE_MASTER;
}
@ -796,10 +796,10 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx)
Actor* primFloormas;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if (this->actor.attachedA->params == MERGE_MASTER) {
primFloormas = this->actor.attachedA;
} else if (this->actor.attachedB->params == MERGE_MASTER) {
primFloormas = this->actor.attachedB;
if (this->actor.parent->params == MERGE_MASTER) {
primFloormas = this->actor.parent;
} else if (this->actor.child->params == MERGE_MASTER) {
primFloormas = this->actor.child;
} else {
if (this->actor.bgCheckFlags & 2) {
this->actor.params = 0x10;
@ -830,8 +830,8 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx)
}
void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) {
EnFloormas* attachedA;
EnFloormas* attachedB;
EnFloormas* parent;
EnFloormas* child;
s32 mergeCnt;
f32 prevScale;
f32 curScale;
@ -840,23 +840,23 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) {
DECR(this->smActionTimer);
attachedA = this->actor.attachedA;
attachedB = this->actor.attachedB;
parent = this->actor.parent;
child = this->actor.child;
if (this->smActionTimer == 0) {
if (attachedA->actionFunc != EnFloormas_SmWait) {
EnFloormas_SetupSmShrink(attachedA, globalCtx);
if (parent->actionFunc != EnFloormas_SmWait) {
EnFloormas_SetupSmShrink(parent, globalCtx);
}
if (attachedB->actionFunc != EnFloormas_SmWait) {
EnFloormas_SetupSmShrink(attachedB, globalCtx);
if (child->actionFunc != EnFloormas_SmWait) {
EnFloormas_SetupSmShrink(child, globalCtx);
}
} else {
if ((attachedA->actionFunc != EnFloormas_SmWait) && (attachedA->actionFunc != EnFloormas_SmShrink)) {
if ((parent->actionFunc != EnFloormas_SmWait) && (parent->actionFunc != EnFloormas_SmShrink)) {
mergeCnt++;
}
if ((attachedB->actionFunc != EnFloormas_SmWait) && (attachedB->actionFunc != EnFloormas_SmShrink)) {
if ((child->actionFunc != EnFloormas_SmWait) && (child->actionFunc != EnFloormas_SmShrink)) {
mergeCnt++;
}
}

View file

@ -43,7 +43,7 @@ void EnGanonOrgan_Update(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("ORGAN MOVE 1\n");
if (thisx->params == 1) {
dorf = (BossGanon*)thisx->attachedA;
dorf = (BossGanon*)thisx->parent;
if (dorf->organFadeTimer == 0) {
Actor_Kill(thisx);
}
@ -97,7 +97,7 @@ void EnGanonOrgan_Draw(Actor* thisx, GlobalContext* globalCtx) {
GraphicsContext* gfxCtx;
Gfx* dispRefs[4];
dorf = (BossGanon*)thisx->attachedA;
dorf = (BossGanon*)thisx->parent;
gfxCtx = globalCtx->state.gfxCtx;
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ganon_organ.c", 205);
osSyncPrintf("ORGAN DRAW 1\n");

View file

@ -116,8 +116,8 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) {
if (this->path == 3) {
for (i = 0; i < ARRAY_COUNT(sRupeePositions); i++) {
rupeePos = sRupeePositions[i];
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_EX_RUPPY, rupeePos.x,
rupeePos.y, rupeePos.z, 0, 0, 0, 3);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_EX_RUPPY, rupeePos.x, rupeePos.y,
rupeePos.z, 0, 0, 0, 3);
}
}

View file

@ -289,7 +289,7 @@ void func_80A53638(EnHeishi2* this, GlobalContext* globalCtx) {
if (ACTOR_BG_SPOT15_SAKU != actor->dyna.actor.id) {
actor = (BgSpot15Saku*)(actor->dyna.actor.next);
} else {
this->attachedGate = actor;
this->gate = actor;
actor->unk_168 = 1;
break;
}
@ -325,7 +325,7 @@ void func_80A53850(EnHeishi2* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
func_800C04D8(globalCtx, this->cameraId, &this->unk_280, &this->unk_28C);
gate = (BgSpot15Saku*)this->attachedGate;
gate = (BgSpot15Saku*)this->gate;
if ((this->unk_2F2[0] == 0) || (gate->unk_168 == 0)) {
Gameplay_ClearCamera(globalCtx, this->cameraId);
Gameplay_ChangeCameraStatus(globalCtx, 0, 7);
@ -453,10 +453,10 @@ void func_80A53D0C(EnHeishi2* this, GlobalContext* globalCtx) {
}
if (this->unk_2EC <= frameCount) {
while (gate != NULL) {
if (ACTOR_BG_GATE_SHUTTER != gate->dyna.actor.id) {
if (gate->dyna.actor.id != ACTOR_BG_GATE_SHUTTER) {
gate = (BgGateShutter*)gate->dyna.actor.next;
} else {
this->attachedGate = gate;
this->gate = gate;
gate->openingState = 1;
break;
}
@ -496,7 +496,7 @@ void func_80A53F30(EnHeishi2* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
func_800C04D8(globalCtx, this->cameraId, &this->unk_280, &this->unk_28C);
gate = (BgGateShutter*)this->attachedGate;
gate = (BgGateShutter*)this->gate;
if ((this->unk_2F2[0] == 0) || (gate->openingState == 0)) {
Gameplay_ClearCamera(globalCtx, this->cameraId);
Gameplay_ChangeCameraStatus(globalCtx, 0, 7);
@ -619,7 +619,7 @@ void func_80A543A0(EnHeishi2* this, GlobalContext* globalCtx) {
if (ACTOR_BG_GATE_SHUTTER != gate->dyna.actor.id) {
gate = (BgGateShutter*)(gate->dyna.actor.next);
} else {
this->attachedGate = gate;
this->gate = gate;
if (this->unk_30A != 2) {
gate->openingState = -1;
break;

View file

@ -43,7 +43,7 @@ typedef struct EnHeishi2 {
/* 0x030D */ char unk_30D;
/* 0x030E */ s16 unk_30E;
/* 0x0310 */ s16 cameraId;
/* 0x0314 */ Actor* attachedGate;
/* 0x0314 */ Actor* gate; // first BgGateShutter that can be found in the actor list
/* 0x0318 */ char unk_318[0x18];
/* 0x0330 */ MtxF mtxf_330;
/* 0x0370 */ char unk_370[0x28];

View file

@ -98,8 +98,8 @@ void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) {
}
}
EnHintnuts_SetupWait(this);
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_HINTNUTS, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.posRot.rot.y, 0, 0xA);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_HINTNUTS, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.posRot.rot.y, 0, 0xA);
}
}
@ -443,8 +443,8 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) {
Flags_SetClear(globalCtx, this->actor.room);
sPuzzleCounter = 3;
}
if (this->actor.attachedB != NULL) {
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this->actor.attachedB, ACTORTYPE_PROP);
if (this->actor.child != NULL) {
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this->actor.child, ACTORTYPE_PROP);
}
Actor_Kill(&this->actor);
}
@ -458,8 +458,8 @@ void EnHintnuts_Freeze(EnHintnuts* this, GlobalContext* globalCtx) {
}
if (this->animFlagAndTimer == 0) {
if (sPuzzleCounter == 3) {
if (this->actor.attachedB != NULL) {
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this->actor.attachedB, ACTORTYPE_PROP);
if (this->actor.child != NULL) {
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this->actor.child, ACTORTYPE_PROP);
}
this->animFlagAndTimer = 1;
} else if (sPuzzleCounter == -4) {

View file

@ -275,9 +275,9 @@ void func_80A7C5EC(EnInsect* this, GlobalContext* globalCtx) {
(this->unk_31A < 4)) {
Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y,
Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos), 2000);
} else if (this->actor.attachedB != NULL && &this->actor != this->actor.attachedB) {
} else if (this->actor.child != NULL && &this->actor != this->actor.child) {
Math_ApproxUpdateScaledS(&this->actor.posRot.rot.y,
Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.attachedB->posRot.pos), 2000);
Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.child->posRot.pos), 2000);
}
this->actor.shape.rot.y = this->actor.posRot.rot.y;
@ -713,10 +713,10 @@ void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx) {
EnInsect* this = THIS;
s32 phi_v0;
if (this->actor.attachedB != NULL) {
if (this->actor.attachedB->update == NULL) {
if (&this->actor != this->actor.attachedB) {
this->actor.attachedB = NULL;
if (this->actor.child != NULL) {
if (this->actor.child->update == NULL) {
if (&this->actor != this->actor.child) {
this->actor.child = NULL;
}
}
}
@ -758,8 +758,8 @@ void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx) {
func_8002E4B4(globalCtx, &this->actor, 8.0f, 5.0f, 0.0f, phi_v0);
}
if (func_8002F410(&this->actor, globalCtx) != 0) {
this->actor.attachedA = NULL;
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
phi_v0 = this->actor.params & 3;
if (phi_v0 == 2 || phi_v0 == 3) {

View file

@ -58,8 +58,8 @@ void EnJs_Init(Actor* thisx, GlobalContext* globalCtx) {
En_Js_SetupAction(this, func_80A89304);
this->unk_284 = 0;
this->actor.gravity = -1.0f;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_JSJUTAN, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_JSJUTAN, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0);
}
void EnJs_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@ -115,8 +115,8 @@ void func_80A8910C(EnJs* this, GlobalContext* globalCtx) {
}
void func_80A89160(EnJs* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx)) {
this->actor.attachedA = NULL;
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
En_Js_SetupAction(this, func_80A8910C);
} else {
func_8002F434(&this->actor, globalCtx, GI_BOMBCHUS_10, 10000.0f, 50.0f);

View file

@ -318,9 +318,9 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) {
if (LINK_IS_ADULT) {
if (!(gSaveContext.infTable[19] & 0x100)) {
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BG_ICE_SHELTER,
this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0,
0x04FF);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BG_ICE_SHELTER,
this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0,
0x04FF);
}
this->actionFunc = EnKz_Wait;
} else {
@ -409,8 +409,8 @@ void EnKz_SetupGetItem(EnKz* this, GlobalContext* globalCtx) {
f32 xzRange;
f32 yRange;
if (func_8002F410(this, globalCtx)) {
this->actor.attachedA = NULL;
if (Actor_HasParent(this, globalCtx)) {
this->actor.parent = NULL;
this->unk_1E0.unk_00 = 1;
this->actionFunc = EnKz_StartTimer;
} else {

View file

@ -84,8 +84,8 @@ void EnLight_UpdatePosRot(EnLight* this, GlobalContext* globalCtx) {
// update yaw for billboard effect
this->actor.shape.rot.y = func_8005A9F4(ACTIVE_CAM) + 0x8000;
if (this->actor.attachedA != NULL) {
Math_Vec3f_Copy(&this->actor.posRot.pos, &(this->actor.attachedA)->posRot.pos);
if (this->actor.parent != NULL) {
Math_Vec3f_Copy(&this->actor.posRot.pos, &(this->actor.parent)->posRot.pos);
this->actor.posRot.pos.y += 17.0f;
}

View file

@ -73,11 +73,11 @@ void EnLightbox_Update(Actor* thisx, GlobalContext* globalCtx) {
EnLightbox* this = THIS;
if (this->dyna.unk_162 != 0) {
if (func_8002F5A0(thisx, globalCtx)) {
if (Actor_HasNoParent(thisx, globalCtx)) {
this->dyna.unk_162 = 0;
}
} else {
if (func_8002F410(thisx, globalCtx)) {
if (Actor_HasParent(thisx, globalCtx)) {
this->dyna.unk_162++;
} else {
if (thisx->speedXZ) {

View file

@ -303,8 +303,8 @@ void func_80AA0D88(EnMa1* this, GlobalContext* globalCtx) {
}
void func_80AA0EA0(EnMa1* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx)) {
this->actor.attachedA = NULL;
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
this->actionFunc = func_80AA0EFC;
} else {
func_8002F434(&this->actor, globalCtx, GI_WEIRD_EGG, 120.0f, 10.0f);

View file

@ -601,8 +601,8 @@ void EnMd_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.01f);
this->actor.unk_1F = 6;
this->alpha = 255;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 3);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 3);
if (((globalCtx->sceneNum == SCENE_SPOT04) && !(gSaveContext.eventChkInf[0] & 0x10)) ||
((globalCtx->sceneNum == SCENE_SPOT04) && (gSaveContext.eventChkInf[0] & 0x10) &&

View file

@ -142,9 +142,9 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
}
void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx) != 0) { // if attached is set
if (Actor_HasParent(&this->actor, globalCtx)) {
Rupees_ChangeBy(-sPrices[BEANS_BOUGHT]);
this->actor.attachedA = NULL;
this->actor.parent = NULL;
this->actionFunc = EnMs_TalkAfterPurchase;
return;
}

View file

@ -68,7 +68,7 @@ void EnNiwGirl_Init(Actor* thisx, GlobalContext* globalCtx) {
vec1.x = vec1.y = 0.0f;
vec1.z = 50.0;
Matrix_MultVec3f(&vec1, &vec2);
this->chasedEnNiw = (EnNiw*)Actor_SpawnAttached(
this->chasedEnNiw = (EnNiw*)Actor_SpawnAsChild(
&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_NIW, this->actor.posRot.pos.x + vec2.x,
this->actor.posRot.pos.y + vec2.y, this->actor.posRot.pos.z + vec2.z, 0, this->actor.posRot.rot.y, 0, 0xA);
if (this->chasedEnNiw != NULL) {

View file

@ -1028,8 +1028,8 @@ void func_80AECCB0(EnRu1* this, GlobalContext* globalCtx) {
spawnX = ((kREG(1) + 12.0f) * Math_Sins(yawTowardsLink)) + pos->x;
spawnY = pos->y;
spawnZ = ((kREG(1) + 12.0f) * Math_Coss(yawTowardsLink)) + pos->z;
this->unk_278 = Actor_SpawnAttached(&globalCtx->actorCtx, this, globalCtx, ACTOR_DOOR_WARP1, spawnX, spawnY, spawnZ,
0, yawTowardsLink, 0, 5);
this->unk_278 = Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_DOOR_WARP1, spawnX, spawnY, spawnZ,
0, yawTowardsLink, 0, 5);
}
void func_80AECDA0(EnRu1* this, GlobalContext* globalCtx) {
@ -1595,7 +1595,7 @@ void func_80AEE488(EnRu1* this, GlobalContext* globalCtx) {
Actor* thisx = &this->actor;
s8 curRoomNum;
if (func_8002F410(thisx, globalCtx)) {
if (Actor_HasParent(thisx, globalCtx)) {
curRoomNum = globalCtx->roomCtx.curRoom.num;
this->roomNum3 = curRoomNum;
this->action = 31;
@ -1663,7 +1663,7 @@ void func_80AEE7C4(EnRu1* this, GlobalContext* globalCtx) {
Player* player;
f32* unk_370 = &this->unk_370;
if (func_8002F5A0(this, globalCtx)) {
if (Actor_HasNoParent(this, globalCtx)) {
frameCount = SkelAnime_GetFrameCount(&D_06006B9C.genericHeader);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06006B9C, 1.0f, 0, frameCount, 0, -8.0f);
func_80AED6DC(this, globalCtx);

View file

@ -252,7 +252,7 @@ void func_80AF29DC(EnRu2* this, GlobalContext* globalCtx) {
f32 posY = thisx->posRot.pos.y;
f32 posZ = thisx->posRot.pos.z;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2);
}
void func_80AF2A38(EnRu2* this, GlobalContext* globalCtx) {
@ -261,8 +261,7 @@ void func_80AF2A38(EnRu2* this, GlobalContext* globalCtx) {
f32 posY = player->actor.posRot.pos.y + 50.0f;
f32 posZ = player->actor.posRot.pos.z;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0,
10);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 10);
Item_Give(globalCtx, ITEM_MEDALLION_WATER);
}
@ -391,8 +390,8 @@ void func_80AF2E64() {
}
void func_80AF2E84(EnRu2* this, GlobalContext* globalCtx) {
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x,
kREG(19) + 24.0f + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 8);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x,
kREG(19) + 24.0f + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 8);
}
void func_80AF2F04(EnRu2* this, GlobalContext* globalCtx) {

View file

@ -513,11 +513,11 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) {
break;
}
case 2:
if (func_8002F410(this, globalCtx) != 0) {
if (Actor_HasParent(this, globalCtx)) {
func_800C078C(globalCtx, 0, this->unk_1E8);
Gameplay_ChangeCameraStatus(globalCtx, 0, 7);
Gameplay_ClearCamera(globalCtx, this->unk_1E8);
this->actor.attachedA = NULL;
this->actor.parent = NULL;
this->unk_1E2 += 1;
} else {
func_8002F434(this, globalCtx, GI_LETTER_ZELDA, 120.0f, 10.0f);

View file

@ -709,19 +709,19 @@ void func_80B4FFF0(EnZl2* this, GlobalContext* globalCtx) {
posY = this->actor.posRot.pos.y + (kREG(5) + -26.0f);
posZ = this->actor.posRot.pos.z;
Actor_SpawnAttached(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0,
0x4000, 0, 3);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0x4000,
0, 3);
this->unk_248 = 1;
}
}
void func_80B5008C(EnZl2* this) {
Actor* attachedB = this->actor.attachedB;
Actor* child = this->actor.child;
if (attachedB != NULL) {
attachedB->posRot.pos.x = this->actor.posRot.pos.x;
attachedB->posRot.pos.y = this->actor.posRot.pos.y + (kREG(5) + -26.0f);
attachedB->posRot.pos.z = this->actor.posRot.pos.z;
if (child != NULL) {
child->posRot.pos.x = this->actor.posRot.pos.x;
child->posRot.pos.y = this->actor.posRot.pos.y + (kREG(5) + -26.0f);
child->posRot.pos.z = this->actor.posRot.pos.z;
}
}
@ -751,8 +751,8 @@ void func_80B500E0(EnZl2* this, GlobalContext* globalCtx) {
}
void func_80B501C4(EnZl2* this, s32 alpha) {
if (this->actor.attachedB != NULL) {
((DoorWarp1*)this->actor.attachedB)->alpha = alpha;
if (this->actor.child != NULL) {
((DoorWarp1*)this->actor.child)->alpha = alpha;
}
}
@ -1200,12 +1200,12 @@ void func_80B512B8(EnZl2* this, GlobalContext* globalCtx) {
}
void func_80B51310(EnZl2* this, GlobalContext* globalCtx) {
Actor* attachedB;
Actor* child;
if (EnZl2_GetNpcAction(globalCtx, 0) == NULL) {
attachedB = this->actor.attachedB;
if (attachedB != NULL) {
Actor_Kill(attachedB);
child = this->actor.child;
if (child != NULL) {
Actor_Kill(child);
}
Actor_Kill(&this->actor);
}

View file

@ -58,7 +58,7 @@ void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80B85264(this, globalCtx);
func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
if (func_8002F410(&this->actor, globalCtx)) {
if (Actor_HasParent(&this->actor, globalCtx)) {
Flags_SetCollectible(globalCtx, 0x1F);
Actor_Kill(&this->actor);
} else {

View file

@ -117,7 +117,7 @@ void func_80B857D0(ItemEtcetera* this, GlobalContext* globalCtx) {
}
void func_80B85824(ItemEtcetera* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx) != 0) {
if (Actor_HasParent(&this->actor, globalCtx)) {
if ((this->actor.params & 0xFF) == 1) {
gSaveContext.eventChkInf[3] |= 2;
Flags_SetSwitch(globalCtx, 0xB);
@ -129,7 +129,7 @@ void func_80B85824(ItemEtcetera* this, GlobalContext* globalCtx) {
}
void func_80B858B4(ItemEtcetera* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx) != 0) {
if (Actor_HasParent(&this->actor, globalCtx)) {
if ((this->actor.params & 0xFF) == 1) {
gSaveContext.eventChkInf[3] |= 2;
Flags_SetSwitch(globalCtx, 0xB);

View file

@ -177,7 +177,7 @@ void ItemOcarina_StartSoTCutscene(ItemOcarina* this, GlobalContext* globalCtx) {
}
void ItemOcarina_WaitInWater(ItemOcarina* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx)) {
if (Actor_HasParent(&this->actor, globalCtx)) {
gSaveContext.eventChkInf[4] |= 8;
Flags_SetSwitch(globalCtx, 3);
this->actionFunc = ItemOcarina_StartSoTCutscene;

View file

@ -69,9 +69,9 @@ void func_80B93B68(ObjHsblock* this, GlobalContext* globalCtx, UNK_TYPE arg2, Dy
void func_80B93BF0(ObjHsblock* this, GlobalContext* globalCtx) {
if ((this->dyna.actor.params >> 5) & 1) {
Actor_SpawnAttached(&globalCtx->actorCtx, this, globalCtx, ACTOR_OBJ_ICE_POLY, this->dyna.actor.posRot.pos.x,
this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, this->dyna.actor.posRot.rot.x,
this->dyna.actor.posRot.rot.y, this->dyna.actor.posRot.rot.z, 1);
Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_OBJ_ICE_POLY, this->dyna.actor.posRot.pos.x,
this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, this->dyna.actor.posRot.rot.x,
this->dyna.actor.posRot.rot.y, this->dyna.actor.posRot.rot.z, 1);
}
}

View file

@ -67,9 +67,9 @@ void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx) {
spawnPos = &block->posVecs[typeIdx];
if (Actor_SpawnAttached(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_OSHIHIKI, spawnPos->x, spawnPos->y,
spawnPos->z, 0, block->rotY, 0,
((block->paramVal1 << 6) & 0xC0) | (block->paramVal2 & 0xF) | 0xFF00) == NULL) {
if (Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_OSHIHIKI, spawnPos->x, spawnPos->y,
spawnPos->z, 0, block->rotY, 0,
((block->paramVal1 << 6) & 0xC0) | (block->paramVal2 & 0xF) | 0xFF00) == NULL) {
// Push-pull block failure
osSyncPrintf(VT_COL(RED, WHITE));
osSyncPrintf(" : 押し引きブロック発生失敗(%s %d)\n", "../z_obj_makeoshihiki.c", 194);
@ -78,7 +78,7 @@ void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
if (block->unk_24[typeIdx] & 2) {
((ObjOshihiki*)thisx->attachedB)->unk_1BE = 1;
((ObjOshihiki*)thisx->child)->unk_1BE = 1;
}
thisx->posRot.rot.z = thisx->shape.rot.z = 0;
osSyncPrintf("(%s)(arg_data %04xF)(angleZ %d)\n", "../z_obj_makeoshihiki.c", thisx->params,
@ -94,7 +94,7 @@ void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) {
s32 cond2;
for (i = 0; i < 3; i++) {
if (Math3D_Vec3fDistSq(&thisx->attachedB->posRot.pos, &block->posVecs[i]) < 0.001f) {
if (Math3D_Vec3fDistSq(&thisx->child->posRot.pos, &block->posVecs[i]) < 0.001f) {
if (block->unk_24[i] & 1) {
if ((thisx->params >> 6) & 1) {
sfxCond1 = false;
@ -127,7 +127,7 @@ void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) {
sFlagSwitchFuncs[sFlags[i][1]](globalCtx, (thisx->params >> 8) & 0x3F);
if (block->unk_24[i] & 2) {
((ObjOshihiki*)thisx->attachedB)->unk_1BE = 1;
((ObjOshihiki*)thisx->child)->unk_1BE = 1;
}
break;