Finish EnNutsball documentation (#2763)

* Finish `EnNutsball` documentation

* Rename things
This commit is contained in:
Jordan Longstaff
2026-05-31 11:47:06 -04:00
committed by GitHub
parent e560ff093a
commit aa1a86708f
@@ -29,8 +29,8 @@ void EnNutsball_Destroy(Actor* thisx, PlayState* play);
void EnNutsball_Update(Actor* thisx, PlayState* play);
void EnNutsball_Draw(Actor* thisx, PlayState* play);
void func_80ABBB34(EnNutsball* this, PlayState* play);
void func_80ABBBA8(EnNutsball* this, PlayState* play);
void EnNutsball_WaitForObject(EnNutsball* this, PlayState* play);
void EnNutsball_Projectile(EnNutsball* this, PlayState* play);
ActorProfile En_Nutsball_Profile = {
/**/ ACTOR_EN_NUTSBALL,
@@ -84,7 +84,7 @@ void EnNutsball_Init(Actor* thisx, PlayState* play) {
if (this->requiredObjectSlot < 0) {
Actor_Kill(&this->actor);
} else {
this->actionFunc = func_80ABBB34;
this->actionFunc = EnNutsball_WaitForObject;
}
}
@@ -94,21 +94,21 @@ void EnNutsball_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
}
void func_80ABBB34(EnNutsball* this, PlayState* play) {
void EnNutsball_WaitForObject(EnNutsball* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
this->actor.objectSlot = this->requiredObjectSlot;
this->actor.draw = EnNutsball_Draw;
this->actor.shape.rot.y = 0;
this->timer = 30;
this->actionFunc = func_80ABBBA8;
this->actionFunc = EnNutsball_Projectile;
this->actor.speed = 10.0f;
}
}
void func_80ABBBA8(EnNutsball* this, PlayState* play) {
void EnNutsball_Projectile(EnNutsball* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Vec3s sp4C;
Vec3f sp40;
Vec3s shieldRot;
Vec3f impactPos;
this->timer--;
@@ -131,18 +131,18 @@ void func_80ABBBA8(EnNutsball* this, PlayState* play) {
this->collider.base.atFlags |= AT_TYPE_PLAYER;
this->collider.elem.atDmgInfo.dmgFlags = DMG_DEKU_STICK;
Matrix_MtxFToYXZRotS(&player->shieldMf, &sp4C, 0);
this->actor.world.rot.y = sp4C.y + 0x8000;
Matrix_MtxFToYXZRotS(&player->shieldMf, &shieldRot, 0);
this->actor.world.rot.y = shieldRot.y + 0x8000;
this->timer = 30;
return;
}
}
sp40.x = this->actor.world.pos.x;
sp40.y = this->actor.world.pos.y + 4;
sp40.z = this->actor.world.pos.z;
impactPos.x = this->actor.world.pos.x;
impactPos.y = this->actor.world.pos.y + 4;
impactPos.z = this->actor.world.pos.z;
EffectSsHahen_SpawnBurst(play, &sp40, 6.0f, 0, 7, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
EffectSsHahen_SpawnBurst(play, &impactPos, 6.0f, 0, 7, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK);
Actor_Kill(&this->actor);
} else {
@@ -158,7 +158,7 @@ void EnNutsball_Update(Actor* thisx, PlayState* play) {
s32 pad;
if (!(player->stateFlags1 & (PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29)) ||
(this->actionFunc == func_80ABBB34)) {
(this->actionFunc == EnNutsball_WaitForObject)) {
this->actionFunc(this, play);
Actor_MoveXZGravity(&this->actor);