1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-17 13:24:45 +00:00

adjusting sub98 init structs across actors

This commit is contained in:
fig02 2020-03-31 05:00:04 -04:00
parent daa7877c96
commit 340fbd5a40
9 changed files with 48 additions and 50 deletions

View file

@ -47,7 +47,7 @@ void ArrowFire_Init(ArrowFire* this, GlobalContext* globalCtx) {
this->radius = 0;
this->unk_158 = 1.0f;
ArrowFire_SetupAction(&this->actor, ArrowFire_Charge);
Actor_SetScale(this, 0.01);
Actor_SetScale(this, 0.01f);
this->alpha = 0xA0;
this->timer = 0;
this->unk_15C = 0.0f;
@ -105,7 +105,7 @@ void ArrowFire_Hit(ArrowFire* this, GlobalContext* globalCtx) {
scale = 310.0f;
} else {
scale = this->actor.unk_F0;
scale = ((scale - 50.0f) * 0.33333334f) + 10.0f;
scale = ((scale - 50.0f) * (1.0f / 3.0f)) + 10.0f;
}
}
@ -114,7 +114,7 @@ void ArrowFire_Hit(ArrowFire* this, GlobalContext* globalCtx) {
this->timer -= 1;
if (this->timer >= 8) {
offset = ((this->timer - 8) * 0.041666668f);
offset = ((this->timer - 8) * (1.0f / 24.0f));
offset = SQ(offset);
this->radius = (((1.0f - offset) * scale) + 10.0f);
this->unk_158 += ((2.0f - this->unk_158) * 0.1f);
@ -158,7 +158,7 @@ void ArrowFire_Fly(ArrowFire* this, GlobalContext* globalCtx) {
// copy position and rotation from the attached 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) * 0.041666668f;
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f);
this->unk_158 = distanceScaled;
if (distanceScaled < 1.0f) {
this->unk_158 = 1.0f;

View file

@ -47,7 +47,7 @@ void ArrowIce_Init(ArrowIce* this, GlobalContext* globalCtx) {
this->radius = 0;
this->unk_160 = 1.0f;
ArrowIce_SetupAction(this, ArrowIce_Charge);
Actor_SetScale(&this->actor, 0.01);
Actor_SetScale(&this->actor, 0.01f);
this->alpha = 0x64;
this->timer = 0;
this->unk_164 = 0.0f;
@ -105,7 +105,7 @@ void ArrowIce_Hit(ArrowIce* this, GlobalContext* globalCtx) {
scale = 310.0f;
} else {
scale = this->actor.unk_F0;
scale = ((scale - 50.0f) * 0.33333334f) + 10.0f;
scale = ((scale - 50.0f) * (1.0f / 3.0f)) + 10.0f;
}
}
@ -114,7 +114,7 @@ void ArrowIce_Hit(ArrowIce* this, GlobalContext* globalCtx) {
this->timer -= 1;
if (this->timer >= 8) {
offset = ((this->timer - 8) * 0.041666668f);
offset = ((this->timer - 8) * (1.0f / 24.0f));
offset = SQ(offset);
this->radius = (((1.0f - offset) * scale) + 10.0f);
this->unk_160 += ((2.0f - this->unk_160) * 0.1f);
@ -158,7 +158,7 @@ void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx) {
// copy position and rotation from the attached 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) * 0.041666668f;
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f);
this->unk_160 = distanceScaled;
if (distanceScaled < 1.0f) {
this->unk_160 = 1.0f;
@ -167,7 +167,7 @@ void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx) {
if (arrow->hitWall & 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_ICE);
ArrowIce_SetupAction(this, &ArrowIce_Hit);
ArrowIce_SetupAction(this, ArrowIce_Hit);
this->timer = 32;
this->alpha = 0xFF;
} else if (arrow->timer < 34) {

View file

@ -47,7 +47,7 @@ void ArrowLight_Init(ArrowLight* this, GlobalContext* globalCtx) {
this->radius = 0;
this->unk_160 = 1.0f;
ArrowLight_SetupAction(this, ArrowLight_Charge);
Actor_SetScale(&this->actor, 0.01);
Actor_SetScale(&this->actor, 0.01f);
this->alpha = 0x82;
this->timer = 0;
this->unk_164 = 0.0f;
@ -105,7 +105,7 @@ void ArrowLight_Hit(ArrowLight* this, GlobalContext* globalCtx) {
scale = 310.0f;
} else {
scale = this->actor.unk_F0;
scale = ((scale - 50.0f) * 0.33333334f) + 10.0f;
scale = ((scale - 50.0f) * (1.0f / 3.0f)) + 10.0f;
}
}
@ -114,7 +114,7 @@ void ArrowLight_Hit(ArrowLight* this, GlobalContext* globalCtx) {
this->timer -= 1;
if (this->timer >= 8) {
offset = ((this->timer - 8) * 0.041666668f);
offset = ((this->timer - 8) * (1.0f / 24.0f));
offset = SQ(offset);
this->radius = (((1.0f - offset) * scale) + 10.0f);
this->unk_160 += ((2.0f - this->unk_160) * 0.1f);
@ -158,7 +158,7 @@ void ArrowLight_Fly(ArrowLight* this, GlobalContext* globalCtx) {
// copy position and rotation from the attached 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) * 0.041666668f;
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f);
this->unk_160 = distanceScaled;
if (distanceScaled < 1.0f) {
this->unk_160 = 1.0f;
@ -167,7 +167,7 @@ void ArrowLight_Fly(ArrowLight* this, GlobalContext* globalCtx) {
if (arrow->hitWall & 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_LIGHT);
ArrowLight_SetupAction(this, &ArrowLight_Hit);
ArrowLight_SetupAction(this, ArrowLight_Hit);
this->timer = 32;
this->alpha = 0xFF;
} else if (arrow->timer < 34) {

View file

@ -168,7 +168,7 @@ static ColliderCylinderInit colliderInit = {
0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000, 0x0001, 0x0000, 0x000A, 0x0046, 0x0000,
};
static SubActor98Init subActor98Init = {
static Sub98Init4 sub98Init = {
0x0A,
0x0023,
0x0064,
@ -202,7 +202,7 @@ static void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) {
ActorCollider_AllocCylinder(globalCtx, collision);
ActorCollider_InitCylinder(globalCtx, collision, thisx, &colliderInit);
ActorCollider_Cylinder_Update(thisx, collision);
func_80061ED4(&thisx->sub_98, 0, &subActor98Init);
func_80061ED4(&thisx->sub_98, 0, &sub98Init);
}
static void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx) {

View file

@ -41,17 +41,7 @@ static ColliderCylinderInit cylinderInit = {
0x0010, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000,
};
// There are multiple versions of sub98 init structs
// Keeping these local until z_collision_check is decompiled
typedef struct {
/* 0x00 */ u8 health;
/* 0x02 */ s16 unk_10;
/* 0x04 */ s16 unk_12;
/* 0x06 */ u16 unk_14;
/* 0x08 */ u8 mass;
} sub98Init;
static sub98Init sub98Data = {
static Sub98Init5 sub98Data = {
0x00, // health
0x0000, // unk_10
0x0000, // unk_12

View file

@ -1,15 +1,10 @@
#include <ultra64.h>
#include <global.h>
#include "z_en_tk.h"
/*
* File: z_en_tk.c
* Overlay: ovl_En_Tk
* Description: Dampe NPC from "Dampe's Heart-Pounding Gravedigging Tour"
*/
typedef struct {
/* 0x0000 */ u8 health; /* SubActorStruct98.health */
/* 0x0002 */ s16 h_2; /* SubActorStruct98.unk_10 */
/* 0x0004 */ s16 h_4; /* SubActorStruct98.unk_12 */
/* 0x0006 */ s16 h_6; /* SubActorStruct98.unk_14 */
/* 0x0008 */ u8 mass; /* SubActorStruct98.mass */
/* 0x000A */
} EnTk_SubActorStruct98Init;
#include "z_en_tk.h"
#define ROOM 0x00
#define FLAGS 0x00000009
@ -181,7 +176,7 @@ static ColliderCylinderInit D_80B1D508 = {
0x00, 0x00, 0x01, 0x00, 0x001E, 0x0034, 0x0000, 0x0000, 0x0000, 0x0000,
};
static EnTk_SubActorStruct98Init D_80B1D534 = {
static Sub98Init5 D_80B1D534 = {
0x00, 0x0000, 0x0000, 0x0000, 0xFF,
};

View file

@ -57,7 +57,12 @@ static ColliderCylinderInit colCylinderInit = {
0x00, 0x01, 0x01, 0x00, 0x001E, 0x0028, 0x0000, 0x0000, 0x0000, 0x0000,
};
static SubActor98Init subActor98Init = { 0x04, 0x001E, 0x0028, 0x96 };
static Sub98Init4 sub98Init = {
0x04,
0x001E,
0x0028,
0x96,
};
static ActorDamageChart damageChart = { {
{ 0x1, 0x0 }, { 0x0, 0x2 }, { 0x0, 0x1 }, { 0x0, 0x2 }, { 0x1, 0x0 }, { 0x0, 0x2 }, { 0x0, 0x2 }, { 0x1, 0x0 },
@ -96,7 +101,7 @@ static void EnWallmas_Init(EnWallmas* this, GlobalContext* globalCtx) {
ActorCollider_AllocCylinder(globalCtx, &this->colCylinder);
ActorCollider_InitCylinder(globalCtx, &this->colCylinder, &this->actor, &colCylinderInit);
func_80061ED4(&this->actor.sub_98, &damageChart, &subActor98Init);
func_80061ED4(&this->actor.sub_98, &damageChart, &sub98Init);
this2->switchFlag = (u8)(this2->actor.params >> 0x8);
this->actor.params = this->actor.params & 0xFF;