mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-11 03:39:59 +00:00
z_obj_lift
: doc remaining funcs and field (#1440)
* `z_obj_lift`: doc funcs and field doc remaining funcs and field in `z_obj_lift` * `z_obj_lift`: shakeVec->shakeOrientation * removed space from copy-paste of field name
This commit is contained in:
parent
1666517f47
commit
39e4e63b4d
2 changed files with 33 additions and 33 deletions
|
@ -16,13 +16,13 @@ void ObjLift_Destroy(Actor* thisx, PlayState* play);
|
||||||
void ObjLift_Update(Actor* thisx, PlayState* play);
|
void ObjLift_Update(Actor* thisx, PlayState* play);
|
||||||
void ObjLift_Draw(Actor* thisx, PlayState* play);
|
void ObjLift_Draw(Actor* thisx, PlayState* play);
|
||||||
|
|
||||||
void func_80B9651C(ObjLift* this);
|
void ObjLift_SetupWait(ObjLift* this);
|
||||||
void func_80B9664C(ObjLift* this);
|
void ObjLift_SetupShake(ObjLift* this);
|
||||||
void func_80B967C0(ObjLift* this);
|
void ObjLift_SetupFall(ObjLift* this);
|
||||||
|
|
||||||
void func_80B96560(ObjLift* this, PlayState* play);
|
void ObjLift_Wait(ObjLift* this, PlayState* play);
|
||||||
void func_80B96678(ObjLift* this, PlayState* play);
|
void ObjLift_Shake(ObjLift* this, PlayState* play);
|
||||||
void func_80B96840(ObjLift* this, PlayState* play);
|
void ObjLift_Fall(ObjLift* this, PlayState* play);
|
||||||
|
|
||||||
ActorInit Obj_Lift_InitVars = {
|
ActorInit Obj_Lift_InitVars = {
|
||||||
ACTOR_OBJ_LIFT,
|
ACTOR_OBJ_LIFT,
|
||||||
|
@ -76,7 +76,7 @@ void ObjLift_InitDynaPoly(ObjLift* this, PlayState* play, CollisionHeader* colli
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B96160(ObjLift* this, PlayState* play) {
|
void ObjLift_SpawnFragments(ObjLift* this, PlayState* play) {
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
Vec3f velocity;
|
Vec3f velocity;
|
||||||
Vec3f* temp_s3;
|
Vec3f* temp_s3;
|
||||||
|
@ -116,10 +116,10 @@ void ObjLift_Init(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
Actor_SetScale(&this->dyna.actor, sScales[(this->dyna.actor.params >> 1) & 1]);
|
Actor_SetScale(&this->dyna.actor, sScales[(this->dyna.actor.params >> 1) & 1]);
|
||||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||||
this->unk_168.x = Rand_ZeroOne() * 65535.5f;
|
this->shakeOrientation.x = Rand_ZeroOne() * 65535.5f;
|
||||||
this->unk_168.y = Rand_ZeroOne() * 65535.5f;
|
this->shakeOrientation.y = Rand_ZeroOne() * 65535.5f;
|
||||||
this->unk_168.z = Rand_ZeroOne() * 65535.5f;
|
this->shakeOrientation.z = Rand_ZeroOne() * 65535.5f;
|
||||||
func_80B9651C(this);
|
ObjLift_SetupWait(this);
|
||||||
osSyncPrintf("(Dungeon Lift)(arg_data 0x%04x)\n", this->dyna.actor.params);
|
osSyncPrintf("(Dungeon Lift)(arg_data 0x%04x)\n", this->dyna.actor.params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,25 +129,25 @@ void ObjLift_Destroy(Actor* thisx, PlayState* play) {
|
||||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B9651C(ObjLift* this) {
|
void ObjLift_SetupWait(ObjLift* this) {
|
||||||
this->timer = sFallTimerDurations[(this->dyna.actor.params >> 8) & 7];
|
this->timer = sFallTimerDurations[(this->dyna.actor.params >> 8) & 7];
|
||||||
ObjLift_SetupAction(this, func_80B96560);
|
ObjLift_SetupAction(this, ObjLift_Wait);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B96560(ObjLift* this, PlayState* play) {
|
void ObjLift_Wait(ObjLift* this, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
s32 quakeIndex;
|
s32 quakeIndex;
|
||||||
|
|
||||||
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
|
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
|
||||||
if (this->timer <= 0) {
|
if (this->timer <= 0) {
|
||||||
if (((this->dyna.actor.params >> 8) & 7) == 7) {
|
if (((this->dyna.actor.params >> 8) & 7) == 7) {
|
||||||
func_80B967C0(this);
|
ObjLift_SetupFall(this);
|
||||||
} else {
|
} else {
|
||||||
quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_1);
|
quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_1);
|
||||||
Quake_SetSpeed(quakeIndex, 10000);
|
Quake_SetSpeed(quakeIndex, 10000);
|
||||||
Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0);
|
Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0);
|
||||||
Quake_SetDuration(quakeIndex, 20);
|
Quake_SetDuration(quakeIndex, 20);
|
||||||
func_80B9664C(this);
|
ObjLift_SetupShake(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -155,25 +155,25 @@ void func_80B96560(ObjLift* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B9664C(ObjLift* this) {
|
void ObjLift_SetupShake(ObjLift* this) {
|
||||||
this->timer = 20;
|
this->timer = 20;
|
||||||
ObjLift_SetupAction(this, func_80B96678);
|
ObjLift_SetupAction(this, ObjLift_Shake);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B96678(ObjLift* this, PlayState* play) {
|
void ObjLift_Shake(ObjLift* this, PlayState* play) {
|
||||||
if (this->timer <= 0) {
|
if (this->timer <= 0) {
|
||||||
func_80B967C0(this);
|
ObjLift_SetupFall(this);
|
||||||
} else {
|
} else {
|
||||||
this->unk_168.x += 10000;
|
this->shakeOrientation.x += 10000;
|
||||||
this->dyna.actor.world.rot.x = (s16)(Math_SinS(this->unk_168.x) * 300.0f) + this->dyna.actor.home.rot.x;
|
this->dyna.actor.world.rot.x = (s16)(Math_SinS(this->shakeOrientation.x) * 300.0f) + this->dyna.actor.home.rot.x;
|
||||||
this->dyna.actor.world.rot.z = (s16)(Math_CosS(this->unk_168.x) * 300.0f) + this->dyna.actor.home.rot.z;
|
this->dyna.actor.world.rot.z = (s16)(Math_CosS(this->shakeOrientation.x) * 300.0f) + this->dyna.actor.home.rot.z;
|
||||||
this->dyna.actor.shape.rot.x = this->dyna.actor.world.rot.x;
|
this->dyna.actor.shape.rot.x = this->dyna.actor.world.rot.x;
|
||||||
this->dyna.actor.shape.rot.z = this->dyna.actor.world.rot.z;
|
this->dyna.actor.shape.rot.z = this->dyna.actor.world.rot.z;
|
||||||
this->unk_168.y += 18000;
|
this->shakeOrientation.y += 18000;
|
||||||
this->dyna.actor.world.pos.y = Math_SinS(this->unk_168.y) + this->dyna.actor.home.pos.y;
|
this->dyna.actor.world.pos.y = Math_SinS(this->shakeOrientation.y) + this->dyna.actor.home.pos.y;
|
||||||
this->unk_168.z += 18000;
|
this->shakeOrientation.z += 18000;
|
||||||
this->dyna.actor.world.pos.x = Math_SinS(this->unk_168.z) * 3.0f + this->dyna.actor.home.pos.x;
|
this->dyna.actor.world.pos.x = Math_SinS(this->shakeOrientation.z) * 3.0f + this->dyna.actor.home.pos.x;
|
||||||
this->dyna.actor.world.pos.z = Math_CosS(this->unk_168.z) * 3.0f + this->dyna.actor.home.pos.z;
|
this->dyna.actor.world.pos.z = Math_CosS(this->shakeOrientation.z) * 3.0f + this->dyna.actor.home.pos.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((this->timer & 3) == 3) {
|
if ((this->timer & 3) == 3) {
|
||||||
|
@ -181,13 +181,13 @@ void func_80B96678(ObjLift* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B967C0(ObjLift* this) {
|
void ObjLift_SetupFall(ObjLift* this) {
|
||||||
ObjLift_SetupAction(this, func_80B96840);
|
ObjLift_SetupAction(this, ObjLift_Fall);
|
||||||
Math_Vec3f_Copy(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos);
|
Math_Vec3f_Copy(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos);
|
||||||
this->dyna.actor.shape.rot = this->dyna.actor.world.rot = this->dyna.actor.home.rot;
|
this->dyna.actor.shape.rot = this->dyna.actor.world.rot = this->dyna.actor.home.rot;
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B96840(ObjLift* this, PlayState* play) {
|
void ObjLift_Fall(ObjLift* this, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
s32 bgId;
|
s32 bgId;
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
|
@ -200,7 +200,7 @@ void func_80B96840(ObjLift* this, PlayState* play) {
|
||||||
|
|
||||||
if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >=
|
if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >=
|
||||||
(sMaxFallDistances[(this->dyna.actor.params >> 1) & 1] - 0.001f)) {
|
(sMaxFallDistances[(this->dyna.actor.params >> 1) & 1] - 0.001f)) {
|
||||||
func_80B96160(this, play);
|
ObjLift_SpawnFragments(this, play);
|
||||||
SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK);
|
SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK);
|
||||||
Flags_SetSwitch(play, (this->dyna.actor.params >> 2) & 0x3F);
|
Flags_SetSwitch(play, (this->dyna.actor.params >> 2) & 0x3F);
|
||||||
Actor_Kill(&this->dyna.actor);
|
Actor_Kill(&this->dyna.actor);
|
||||||
|
|
|
@ -11,7 +11,7 @@ typedef void (*ObjLiftActionFunc)(struct ObjLift*, PlayState*);
|
||||||
typedef struct ObjLift {
|
typedef struct ObjLift {
|
||||||
/* 0x0000 */ DynaPolyActor dyna;
|
/* 0x0000 */ DynaPolyActor dyna;
|
||||||
/* 0x0164 */ ObjLiftActionFunc actionFunc;
|
/* 0x0164 */ ObjLiftActionFunc actionFunc;
|
||||||
/* 0x0168 */ Vec3s unk_168;
|
/* 0x0168 */ Vec3s shakeOrientation;
|
||||||
/* 0x016E */ s16 timer;
|
/* 0x016E */ s16 timer;
|
||||||
} ObjLift; // size = 0x0170
|
} ObjLift; // size = 0x0170
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue