GV/ch documentation

This commit is contained in:
Banjo Kazooie
2023-01-22 23:34:04 -06:00
parent caf02e0232
commit da9a0109b5
19 changed files with 469 additions and 466 deletions

View File

@@ -10,25 +10,25 @@ typedef struct {
u32 unk4_30:31;
f32 unk10[3];
f32 unk1C;
}ActorLocal_GV_230;
#define LOCAL_GV_230(s) ((ActorLocal_GV_230 *)&s->local)
}ActorLocal_chAncientOne;
#define LOCAL_CH_ANCIENT_ONE(s) ((ActorLocal_chAncientOne *)&s->local)
void chancientone_update(Actor *this);
Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void chAncientOne_update(Actor *this);
Actor *chAncientOne_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
s16 GV_D_80390C20[4] = {5, 6, 7, 8};
ActorMarker *D_80390C28[5] = {NULL};
ActorAnimationInfo GV_D_80390C3C[] = {
ActorAnimationInfo chAncientOneAnimations[] = {
{0, 0.0f},
{0, 0.0f},
{ASSET_ED_ANIM_ANCIENT_ONE, 2.0f},
{ASSET_ED_ANIM_ANCIENT_ONE, 33000000.f}
};
ActorInfo D_80390C5C = { MARKER_F4_ANCIENT_ONE, ACTOR_147_ANCIENT_ONE, ASSET_3E8_MODEL_ANCIENT_ONE,
0x1, GV_D_80390C3C,
chancientone_update, func_80326224, chancientone_draw,
ActorInfo chAncientOne = { MARKER_F4_ANCIENT_ONE, ACTOR_147_ANCIENT_ONE, ASSET_3E8_MODEL_ANCIENT_ONE,
0x1, chAncientOneAnimations,
chAncientOne_update, func_80326224, chAncientOne_draw,
0, 0x100, 0.0f, 0
};
@@ -103,7 +103,7 @@ void func_80386850(ActorMarker *caller_marker, enum asset_e text_id, s32 arg2){
}
}
void chancientone_update(Actor *this){
void chAncientOne_update(Actor *this){
f32 sp44[3];
s32 sp40;
s32 sp38;
@@ -122,7 +122,7 @@ void chancientone_update(Actor *this){
if(D_80390C28[this->unkF4_8 - 1])
return;
LOCAL_GV_230(this)->unk1C = this->position_y;
LOCAL_CH_ANCIENT_ONE(this)->unk1C = this->position_y;
this->position_y -= 1100.0f;
D_80390C28[this->unkF4_8 - 1] = this->marker;
if(this->unkF4_8 != 1){
@@ -136,14 +136,14 @@ void chancientone_update(Actor *this){
switch(this->state){
case 1: //L803869E4
player_getPosition(sp44);
sp44[0] -= LOCAL_GV_230(this)->unk10[0];
sp44[1] -= LOCAL_GV_230(this)->unk10[1];
sp44[2] -= LOCAL_GV_230(this)->unk10[2];
sp40 = (0.0f <= sp44[0]*LOCAL_GV_230(this)->unk0[0] + sp44[1]*LOCAL_GV_230(this)->unk0[1] + sp44[2]*LOCAL_GV_230(this)->unk0[2]) ? 0 : 1;
if(LOCAL_GV_230(this)->unk1C <= this->position_y){
this->position_y = LOCAL_GV_230(this)->unk1C;
if( sp40 == (LOCAL_GV_230(this)->unk4_31 ^ 1)){
if((sp44[0]*sp44[0] + sp44[1]*sp44[1] + sp44[2]*sp44[2]) < (f32)LOCAL_GV_230(this)->unk4_30){
sp44[0] -= LOCAL_CH_ANCIENT_ONE(this)->unk10[0];
sp44[1] -= LOCAL_CH_ANCIENT_ONE(this)->unk10[1];
sp44[2] -= LOCAL_CH_ANCIENT_ONE(this)->unk10[2];
sp40 = (0.0f <= sp44[0]*LOCAL_CH_ANCIENT_ONE(this)->unk0[0] + sp44[1]*LOCAL_CH_ANCIENT_ONE(this)->unk0[1] + sp44[2]*LOCAL_CH_ANCIENT_ONE(this)->unk0[2]) ? 0 : 1;
if(LOCAL_CH_ANCIENT_ONE(this)->unk1C <= this->position_y){
this->position_y = LOCAL_CH_ANCIENT_ONE(this)->unk1C;
if( sp40 == (LOCAL_CH_ANCIENT_ONE(this)->unk4_31 ^ 1)){
if((sp44[0]*sp44[0] + sp44[1]*sp44[1] + sp44[2]*sp44[2]) < (f32)LOCAL_CH_ANCIENT_ONE(this)->unk4_30){
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
for(sp38= 7; sp38< 0xC && mapSpecificFlags_get(sp38);sp38++);
mapSpecificFlags_set(sp38, TRUE);
@@ -177,7 +177,7 @@ void chancientone_update(Actor *this){
}
else{//L80386C64
sp38 = func_8023DB5C() & 0xF;
sp34 = LOCAL_GV_230(this)->unk1C + 40.0f;
sp34 = LOCAL_CH_ANCIENT_ONE(this)->unk1C + 40.0f;
this->position_y += 18.0;
this->position_x += (sp38 & 1) ? 0x17 : -0x17;
this->position_z += (sp38 & 2) ? 0xC : -0xC;
@@ -185,16 +185,16 @@ void chancientone_update(Actor *this){
if(sp38 == 6){
__spawnQueue_add_4((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z));
}
if(sp38 == 4 && this->position_y < LOCAL_GV_230(this)->unk1C - 600.0f){
if(sp38 == 4 && this->position_y < LOCAL_CH_ANCIENT_ONE(this)->unk1C - 600.0f){
__spawnQueue_add_4((GenMethod_4)func_802C4140, 0x11f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z));
}//L80386D80
}
if(LOCAL_GV_230(this)->unk1C <= this->position_y){
if(LOCAL_CH_ANCIENT_ONE(this)->unk1C <= this->position_y){
func_80244C78(2);
timedFunc_set_0(0.5f, func_803867CC);
}
}//L80386DB0
LOCAL_GV_230(this)->unk4_31 = sp40;
LOCAL_CH_ANCIENT_ONE(this)->unk4_31 = sp40;
break;
case 2: //L80386DCC
if(actor_animationIsAt(this, 0.999f)){
@@ -203,7 +203,7 @@ void chancientone_update(Actor *this){
}
break;
case 3: //L80386E04
if(LOCAL_GV_230(this)->unk1C - 1100.0f < this->position_y){
if(LOCAL_CH_ANCIENT_ONE(this)->unk1C - 1100.0f < this->position_y){
this->position_y -= 10.0;
}
else{
@@ -214,7 +214,7 @@ void chancientone_update(Actor *this){
}//L80386E60
}
Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *chAncientOne_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
int sp58;
s32 sp4C[3];
@@ -234,25 +234,25 @@ Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **v
sp4C[1] += 1100;
sp40[1] += 1100;
sp34[1] += 1100;
LOCAL_GV_230(this)->unk0[0] = (sp4C[0] - sp40[0]);
LOCAL_GV_230(this)->unk0[1] = (sp4C[1] - sp40[1]);
LOCAL_GV_230(this)->unk0[2] = (sp4C[2] - sp40[2]);
LOCAL_CH_ANCIENT_ONE(this)->unk0[0] = (sp4C[0] - sp40[0]);
LOCAL_CH_ANCIENT_ONE(this)->unk0[1] = (sp4C[1] - sp40[1]);
LOCAL_CH_ANCIENT_ONE(this)->unk0[2] = (sp4C[2] - sp40[2]);
player_getPosition(sp28);
sp28[0] -= sp40[0];
sp28[1] -= sp40[1];
sp28[2] -= sp40[2];
if(0.0f <= sp28[0] *LOCAL_GV_230(this)->unk0[0] + sp28[1]*LOCAL_GV_230(this)->unk0[1] + sp28[2]*LOCAL_GV_230(this)->unk0[2])
LOCAL_GV_230(this)->unk4_31 = FALSE;
if(0.0f <= sp28[0] *LOCAL_CH_ANCIENT_ONE(this)->unk0[0] + sp28[1]*LOCAL_CH_ANCIENT_ONE(this)->unk0[1] + sp28[2]*LOCAL_CH_ANCIENT_ONE(this)->unk0[2])
LOCAL_CH_ANCIENT_ONE(this)->unk4_31 = FALSE;
else
LOCAL_GV_230(this)->unk4_31 = TRUE;
LOCAL_CH_ANCIENT_ONE(this)->unk4_31 = TRUE;
LOCAL_GV_230(this)->unk10[0] = (f32)sp40[0];
LOCAL_GV_230(this)->unk10[1] = (f32)sp40[1];
LOCAL_GV_230(this)->unk10[2] = (f32)sp40[2];
LOCAL_CH_ANCIENT_ONE(this)->unk10[0] = (f32)sp40[0];
LOCAL_CH_ANCIENT_ONE(this)->unk10[1] = (f32)sp40[1];
LOCAL_CH_ANCIENT_ONE(this)->unk10[2] = (f32)sp40[2];
tmp_v0 = (sp34[1]- sp40[1]);
LOCAL_GV_230(this)->unk4_30 = (s32)(0.95*(f32)(tmp_v0*tmp_v0));
LOCAL_CH_ANCIENT_ONE(this)->unk4_30 = (s32)(0.95*(f32)(tmp_v0*tmp_v0));
this->initialized = TRUE;
}
return this;

80
src/GV/ch/buriedpyramid.c Normal file
View File

@@ -0,0 +1,80 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
f32 transistion_timer;
s32 raised_state;
}ActorLocal_chBuriedPyramid;
void chBuriedPyramid_update(Actor *this);
Actor *chBuriedPyramid_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo chBuriedPyramid = { MARKER_1D4_SANDYBUTT_PYRAMID, ACTOR_31D_SANDYBUTT_PYRAMID, ASSET_56B_MODEL_SANDYBUTT_PYRAMID,
0, NULL,
chBuriedPyramid_update, NULL, chBuriedPyramid_draw,
0, 0, 0.0f, 0
};
/* .code */
void __chBuriedPyramid_setState(Actor *this, s32 next_state){
s32 sp1C;
if(next_state == 2){
sp1C = func_802F9AA8(SFX_3EC_CCW_DOOR_OPENING);
func_802F9DB8(sp1C, 0.7f, 0.9f, 0.03f);
func_802F9F80(sp1C, 0.3f, 2.4f, 0.3f);
func_802FA060(sp1C, 32000, 32000, 0.0f);
}
this->state = next_state;
}
Actor *chBuriedPyramid_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
ActorLocal_chBuriedPyramid *local = (ActorLocal_chBuriedPyramid *)&this->local;
if(local->raised_state == 0){
return func_80325340(this_marker, gfx, mtx, vtx);
}
else{
return func_80325888(this_marker, gfx, mtx, vtx);
}
}
void chBuriedPyramid_setRaisedAmount(ActorMarker *this_marker, s32 arg1){
Actor *this = marker_getActor(this_marker);
ActorLocal_chBuriedPyramid *local = (ActorLocal_chBuriedPyramid *)&this->local;
local->transistion_timer = 0.0f;
local->raised_state = arg1;
__chBuriedPyramid_setState(this, 2);
}
void chBuriedPyramid_update(Actor *this){
ActorLocal_chBuriedPyramid *local = (ActorLocal_chBuriedPyramid *)&this->local;
f32 max;
f32 min;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
local->raised_state = func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2);
this->position_x = 67.0f;
this->position_y = (local->raised_state/3.0)*1050.0 + 1375.0;
this->position_z = 400.0f;
__chBuriedPyramid_setState(this, 1);
}//L8038FE48
if(this->state == 2){
local->transistion_timer += time_getDelta()/3.0f;
if(1.0f < local->transistion_timer)
local->transistion_timer = 1.0f;
min = ((local->raised_state - 1)/3.0)*1050.0 + 1375.0;
max = (local->raised_state/3.0)*1050.0 + 1375.0;
this->position_y = local->transistion_timer*(max - min) + min;
if(1.0f == local->transistion_timer)
__chBuriedPyramid_setState(this, 1);
}//L8038FF48
}

View File

@@ -12,15 +12,15 @@ typedef struct {
f32 unkC;
f32 unk10;
f32 unk14;
}ActorLocal_GV_D60;
}ActorLocal_chGobi1;
void func_80387408(Actor *this);
void chGobi1_update(Actor *this);
Actor *chgobi1_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390C80 = { MARKER_BC_GOBI_1, ACTOR_12E_GOBI_1, ASSET_3E0_MODEL_GOBI,
ActorInfo Gobi1 = { MARKER_BC_GOBI_1, ACTOR_12E_GOBI_1, ASSET_3E0_MODEL_GOBI,
0, NULL,
NULL, func_80387408, chgobi1_draw,
NULL, chGobi1_update, chgobi1_draw,
0, 0x533, 0.0f, 0
};
@@ -33,8 +33,8 @@ struct {
/* .code */
void GV_func_80387150(Actor *this, s32 next_state){
ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local;
void chGobi1_setState(Actor *this, s32 next_state){
ActorLocal_chGobi1 *local = (ActorLocal_chGobi1 *)&this->local;
this->state = next_state;
GV_D_80391A40.unk0 = FALSE;
@@ -87,8 +87,8 @@ s32 func_80387360(void){
}
void func_8038736C(Actor *this){
ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local;
GV_func_80387150(this, 0);
ActorLocal_chGobi1 *local = (ActorLocal_chGobi1 *)&this->local;
chGobi1_setState(this, 0);
func_8030DA44(local->unk0[0]);
func_8030DA44(local->unk0[1]);
}
@@ -102,9 +102,9 @@ void func_803873B0(ActorMarker *this_marker, ActorMarker *other_marker){
}
}
void func_80387408(Actor *this){
void chGobi1_update(Actor *this){
ActorMarker *marker = this->marker;
ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local;
ActorLocal_chGobi1 *local = (ActorLocal_chGobi1 *)&this->local;
s32 sp6C = 0;
f32 tick; //sp68;
int i;
@@ -129,7 +129,7 @@ void func_80387408(Actor *this){
local->unk14 = 0.0f;
this->unk1C[0] = 0.0f;
this->unk1C[1] = 0.0f;
GV_func_80387150(this, 1);
chGobi1_setState(this, 1);
if(jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1) && ! func_803203FC(1)){
marker_despawn(this->marker);
}
@@ -166,7 +166,7 @@ void func_80387408(Actor *this){
}
if(this->state == 1 || this->state == 2){
if(func_80388D78())
if(chGobiRock_isDestroyed())
sp6C = 3;
}
@@ -229,5 +229,5 @@ void func_80387408(Actor *this){
this->unk1C[0] = 0.0f;
if(sp6C)
GV_func_80387150(this, sp6C);
chGobi1_setState(this, sp6C);
}

View File

@@ -8,25 +8,23 @@ typedef struct {
BKModelBin *unk8;
}ActorLocal_Gobi2;
void chgobi2_setState(Actor *this, s32 next_state);
void chgobi2_update(Actor *this);
Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void chGobi2_setState(Actor *this, s32 next_state);
void chGobi2_update(Actor *this);
Actor *chGobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo GV_D_80390CB0 = { MARKER_BF_GOBI_2, ACTOR_131_GOBI_2, ASSET_3E0_MODEL_GOBI,
ActorInfo chGobi2 = { MARKER_BF_GOBI_2, ACTOR_131_GOBI_2, ASSET_3E0_MODEL_GOBI,
0x0, NULL,
NULL, chgobi2_update, chgobi2_draw,
NULL, chGobi2_update, chGobi2_draw,
0, 0x533, 0.0f, 0
};
f32 D_80390CD4[3] = {1475.0f, 442.0f, 8870.0f};
f32 chgobi2_jiggy_position[3] = {1150.0f, 1150.0f, 9200.0f}; //jiggy spawn position
f32 D_80390CEC[3] = {1145.0f, 443.0f, 9197.0f};
/* .bss */
u8 D_80391A50;
/* .code */
void GV_func_80387960(void){
static f32 D_80390CD4[3] = {1475.0f, 442.0f, 8870.0f};
func_8028F490(D_80390CD4);
}
@@ -34,18 +32,19 @@ void func_80387984(ActorMarker *this){
mapSpecificFlags_set(0xC, 1);
}
void __chgobi2_spawnJIggy(void){
jiggySpawn(JIGGY_45_GV_GOBI_2, chgobi2_jiggy_position);
void __chGobi2_spawnJIggy(void){
static f32 jiggy_position[3] = {1150.0f, 1150.0f, 9200.0f};
jiggySpawn(JIGGY_45_GV_GOBI_2, jiggy_position);
}
void func_803879D4(ActorMarker *this_marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker));
chgobi2_setState(this, 4);
chGobi2_setState(this, 4);
}
void GV_func_80387A00(ActorMarker *this_marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker));
chgobi2_setState(this, 7);
chGobi2_setState(this, 7);
}
void func_80387A2C(ActorMarker *caller, enum asset_e text_id, s32 arg2){
@@ -55,13 +54,15 @@ void func_80387A2C(ActorMarker *caller, enum asset_e text_id, s32 arg2){
timed_playSfx(1.8f, SFX_2C_PULLING_NOISE, 1.0f, 32000);
timed_playSfx(2.5f, SFX_2C_PULLING_NOISE, 1.1f, 32000);
timed_setCameraToNode(3.0f, 0xd);
timedFunc_set_0(3.5f, __chgobi2_spawnJIggy);
timedFunc_set_0(3.5f, __chGobi2_spawnJIggy);
func_80324E88(6.0f);
timedFunc_set_1(6.0f, (GenMethod_1) GV_func_80387A00, reinterpret_cast(s32, caller));
func_80324E38(6.0f, 0);
}
void chgobi2_setState(Actor *this, s32 next_state){
void chGobi2_setState(Actor *this, s32 next_state){
static f32 D_80390CEC[3] = {1145.0f, 443.0f, 9197.0f};
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
if(next_state == 1)
@@ -114,7 +115,7 @@ void chgobi2_setState(Actor *this, s32 next_state){
this->state = next_state;
}
Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *chGobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
f32 sp3C[3];
@@ -142,16 +143,16 @@ Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
}
void __chgobi2_80387EFC(Actor *this){
void __chGobi2_80387EFC(Actor *this){
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
chgobi2_setState(this, 0);
chGobi2_setState(this, 0);
func_80335874(local->unk4);
assetcache_release(local->unk8);
}
void __chgobi2_ow(ActorMarker *this_marker, ActorMarker *other_marker){
void __chGobi2_ow(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
enum hitbox_e hitbox;
hitbox = player_getActiveHitbox(NULL);
@@ -162,7 +163,7 @@ void __chgobi2_ow(ActorMarker *this_marker, ActorMarker *other_marker){
}
}
void chgobi2_update(Actor *this){
void chGobi2_update(Actor *this){
ActorMarker *sp34;
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
f32 sp2C;
@@ -171,14 +172,14 @@ void chgobi2_update(Actor *this){
sp2C = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, __chgobi2_ow, NULL, NULL);
sp34->unk30 = __chgobi2_80387EFC;
marker_setCollisionScripts(this->marker, __chGobi2_ow, NULL, NULL);
sp34->unk30 = __chGobi2_80387EFC;
local->unk4 = func_803358B4();
local->unk8 = (BKModelBin*) assetcache_get(ASSET_3F3_MODEL_GOBI_SPIT);
D_80391A50 = 0;
this->unk1C[0] = 0.0f;
this->unk1C[1] = 0.0f;
chgobi2_setState(this, 1);
chGobi2_setState(this, 1);
if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2))
marker_despawn(this->marker);
return;
@@ -186,15 +187,15 @@ void chgobi2_update(Actor *this){
if(this->state == 1){
if(jiggyscore_isCollected(JIGGY_44_GV_GOBI_1))
chgobi2_setState(this, 2);
chGobi2_setState(this, 2);
}
if(this->state == 2){
if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0){
chgobi2_setState(this, 8);
chGobi2_setState(this, 8);
}
else if(D_80391A50){
chgobi2_setState(this, 3);
chGobi2_setState(this, 3);
}
}//L80388114
@@ -212,13 +213,13 @@ void chgobi2_update(Actor *this){
if(this->state == 4){
func_80335A94(local->unk4, sp2C, 1);
if(func_80335794(this->unk148) > 0){
chgobi2_setState(this, 5);
chGobi2_setState(this, 5);
}
}
if(this->state == 5){
if(func_80335794(this->unk148) > 0){
chgobi2_setState(this, 6);
chGobi2_setState(this, 6);
}
}
@@ -228,7 +229,7 @@ void chgobi2_update(Actor *this){
if(this->state == 8){
if(func_80335794(this->unk148) > 0){
chgobi2_setState(this, 2);
chGobi2_setState(this, 2);
}
}
D_80391A50 = FALSE;

View File

@@ -2,23 +2,23 @@
#include "functions.h"
#include "variables.h"
void chgobi3_setState(Actor *this, s32 next_state);
void chgobi3_update(Actor *this);
Actor *chgobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void chGobi3_setState(Actor *this, s32 next_state);
void chGobi3_update(Actor *this);
Actor *chGobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390D00 = { MARKER_C3_GOBI_3, ACTOR_135_GOBI_3, ASSET_3E0_MODEL_GOBI,
ActorInfo chGobi3 = { MARKER_C3_GOBI_3, ACTOR_135_GOBI_3, ASSET_3E0_MODEL_GOBI,
0, NULL,
NULL, chgobi3_update, chgobi3_draw,
NULL, chGobi3_update, chGobi3_draw,
0, 0, 0.0f, 0
};
/* .code */
void func_80388270(Actor *this){
void __chGobi3_func_80388270(Actor *this){
func_8028F428(2, this->marker);
}
void func_80388298(Actor *this){
void __chGobi3_spawnHoneyComb(Actor *this){
s32 pad24;
f32 sp18[3];
TUPLE_ASSIGN(sp18, -6885.0f, 2383.0f, 1335.0f);
@@ -27,9 +27,9 @@ void func_80388298(Actor *this){
func_802C937C(0xd, sp18);
}
void func_803882F0(ActorMarker *caller, enum asset_e text_id, s32 arg2){
void __chGobi3_runaway(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
chgobi3_setState(this, 4);
chGobi3_setState(this, 4);
timed_playSfx(0.0f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
timed_playSfx(0.0f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
@@ -48,7 +48,7 @@ void func_803882F0(ActorMarker *caller, enum asset_e text_id, s32 arg2){
func_80324E38(3.0f, 0);
}
void chgobi3_setState(Actor *this, s32 next_state){
void chGobi3_setState(Actor *this, s32 next_state){
if(next_state == 1)
actor_collisionOff(this);
@@ -63,16 +63,16 @@ void chgobi3_setState(Actor *this, s32 next_state){
if(next_state == 3){
func_80324E38(0.0f, 3);
timedFunc_set_1(0.02f, (GenMethod_1)func_80388270, (s32)this);
timedFunc_set_1(0.02f, (GenMethod_1)__chGobi3_func_80388270, (s32)this);
timed_setCameraToNode(0.1f, 0x12);
timed_playSfx(0.2f, SFX_4C_LIP_SMACK, 1.0f, 32000);
timedFunc_set_1(0.2f, (GenMethod_1)func_80388298, (s32)this);
timedFunc_set_1(0.2f, (GenMethod_1)__chGobi3_spawnHoneyComb, (s32)this);
func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 1.0f);
}
if(next_state == 5){
func_80335924(this->unk148, 0xd9, 0.5f, 4.0f);
func_80311480(ASSET_A77_TEXT_GOBI3_DONE, 0xe, this->position, this->marker, func_803882F0, NULL);
func_80311480(ASSET_A77_TEXT_GOBI3_DONE, 0xe, this->position, this->marker, __chGobi3_runaway, NULL);
}
if(next_state == 4){
@@ -92,7 +92,7 @@ void chgobi3_setState(Actor *this, s32 next_state){
this->state = next_state;
}
Actor *chgobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *chGobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
if(this->state == 0 || this->state == 1) return this;
@@ -100,27 +100,27 @@ Actor *chgobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
return func_80325888(this_marker, gfx, mtx, vtx);
}
void chgobi3_ow(ActorMarker *this_marker, ActorMarker *other_marker){
void chGobi3_ow(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
enum hitbox_e hitbox;
hitbox = player_getActiveHitbox(NULL);
if(hitbox == HITBOX_1_BEAK_BUSTER){
if(this->state == 2)
chgobi3_setState(this, 3);
chGobi3_setState(this, 3);
}
else if(hitbox == HITBOX_A_FAST_FALLING){
this->unk1C[0] = 1.0f;
}
}
void chgobi3_update(Actor *this){
void chGobi3_update(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, chgobi3_ow, NULL, NULL);
marker_setCollisionScripts(this->marker, chGobi3_ow, NULL, NULL);
this->unk1C[0] = 0.0f;
this->unk1C[1] = 0.0f;
chgobi3_setState(this, 1);
chGobi3_setState(this, 1);
if(honeycombscore_get(HONEYCOMB_C_GV_GOBI_3))
marker_despawn(this->marker);
return;
@@ -128,29 +128,29 @@ void chgobi3_update(Actor *this){
if(this->state == 1){
if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2))
chgobi3_setState(this, 2);
chGobi3_setState(this, 2);
}
if(this->state == 2){
if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0){
chgobi3_setState(this, 7);
chGobi3_setState(this, 7);
}
}
if(this->state == 3){
if(func_80335794(this->unk148) > 0)
chgobi3_setState(this, 5);
chGobi3_setState(this, 5);
}
if(this->state == 4){
func_80326224(this);
if(timedFuncQueue_is_empty())
chgobi3_setState(this, 6);
chGobi3_setState(this, 6);
}
if(this->state == 7){
if(func_80335794(this->unk148) > 0)
chgobi3_setState(this, 2);
chGobi3_setState(this, 2);
}
this->unk1C[1] = this->unk1C[0];

View File

@@ -9,34 +9,33 @@ typedef struct {
ParticleEmitter *unkC;
ParticleEmitter *unk10;
f32 unk14;
}ActorLocal_GV_2730;
}ActorLocal_chGobiRock;
void func_80388DC8(Actor *this);
Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void chGobiRock_update(Actor *this);
Actor *chGobiRock_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390D60 = { 0xBE, 0x130, 0x3E4,
ActorInfo chGobiRock = { MARKER_BE_GOBI_ROCK, ACTOR_130_GOBI_ROCK, ASSET_3E4_MODEL_GOBI_ROCK,
0, NULL,
func_80388DC8, func_80326224, func_80388C64,
chGobiRock_update, func_80326224, chGobiRock_draw,
0, 0x533, 0.0f, 0
};
f32 D_80390D84[3] = {5644.0f, 2930.0f, -3258.0f};
/*.bss */
u8 GV_D_80391A60;
u8 chGobiRockDestroyed;
/* .code */
void func_80388B20(Actor *this, s32 next_state){
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
void __chGobiRock_setState(Actor *this, s32 next_state){
ActorLocal_chGobiRock *local = (ActorLocal_chGobiRock *)&this->local;
this->state = next_state;
local->unk14 = 0.0f;
GV_D_80391A60 = FALSE;
chGobiRockDestroyed = FALSE;
if(this->state == 2){
this->marker->propPtr->unk8_3 = FALSE;
local->unk14 = 2.6f;
GV_D_80391A60 = TRUE;
chGobiRockDestroyed = TRUE;
func_8028F428(2, this->marker);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.3f, 9000);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.5f, 9000);
@@ -51,15 +50,15 @@ void func_80388B20(Actor *this, s32 next_state){
}
}
void func_80388C24(ActorMarker *this_marker, ActorMarker *other_marker){
void __chGobiRock_destroy(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if(this->state == 1)
func_80388B20(this, 2);
__chGobiRock_setState(this, 2);
}
Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *chGobiRock_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
ActorLocal_chGobiRock *local = (ActorLocal_chGobiRock *)&this->local;
f32 sp3C[3];
func_802EF3A8(local->unkC, gfx, mtx, vtx);
@@ -78,39 +77,41 @@ Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
}
s32 func_80388D78(void){
return GV_D_80391A60;
bool chGobiRock_isDestroyed(void){
return chGobiRockDestroyed;
}
void func_80388D84(Actor *this){
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
func_80388B20(this, 0);
void chGobiRock_free(Actor *this){
ActorLocal_chGobiRock *local = (ActorLocal_chGobiRock *)&this->local;
__chGobiRock_setState(this, 0);
func_802EF684(local->unkC);
func_802EF684(local->unk10);
}
void func_80388DC8(Actor *this){
void chGobiRock_update(Actor *this){
static f32 jiggy_position[3] = {5644.0f, 2930.0f, -3258.0f};
ActorMarker *sp34 = this->marker;
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
ActorLocal_chGobiRock *local = (ActorLocal_chGobiRock *)&this->local;
f32 sp2C;
Actor *sp28;
f32 sp24 = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
sp34->unk30 = func_80388D84;
sp34->unk30 = chGobiRock_free;
sp34->propPtr->unk8_3 = TRUE;
marker_setCollisionScripts(this->marker, NULL, NULL, func_80388C24);
marker_setCollisionScripts(this->marker, NULL, NULL, __chGobiRock_destroy);
local->unkC = particleEmitter_new(20);
local->unk10 = particleEmitter_new(30);
GV_D_80391A60 = FALSE;
chGobiRockDestroyed = FALSE;
sp28 = actorArray_findClosestActorFromActorId(this->position, ACTOR_12E_GOBI_1, -1, &sp2C);
if(sp28){
this->position_x = sp28->position_x;
this->position_y = sp28->position_y;
this->position_z = sp28->position_z;
}
func_80388B20(this, 1);
__chGobiRock_setState(this, 1);
if(jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1) && !func_803203FC(1)){
marker_despawn(this->marker);
}
@@ -119,7 +120,7 @@ void func_80388DC8(Actor *this){
particleEmitter_update(local->unkC);
particleEmitter_update(local->unk10);
if(func_8025773C(&local->unk14, sp24)){
jiggySpawn(JIGGY_44_GV_GOBI_1, D_80390D84);
jiggySpawn(JIGGY_44_GV_GOBI_1, jiggy_position);
func_802BB3DC(0, 60.0f, 0.65f);
}
if(this->state == 2){

View File

@@ -3,17 +3,17 @@
#include "variables.h"
void chgobirope_update(Actor *this);
void chGobiRope_update(Actor *this);
/* .data */
ActorInfo D_80390D30 = { MARKER_BD_GOBI_ROPE, ACTOR_12F_GOBI_ROPE, ASSET_3E3_MODEL_GOBI_ROPE,
ActorInfo chGobiRope = { MARKER_BD_GOBI_ROPE, ACTOR_12F_GOBI_ROPE, ASSET_3E3_MODEL_GOBI_ROPE,
0, NULL,
chgobirope_update, func_80326224, func_80325888,
chGobiRope_update, func_80326224, func_80325888,
0, 0x533, 0.0f, 0
};
/* .code */
void chgobirope_setState(Actor *this, s32 next_state){
void chGobiRope_setState(Actor *this, s32 next_state){
this->state = next_state;
if(this->state == 1){
@@ -34,7 +34,7 @@ void chgobirope_setState(Actor *this, s32 next_state){
}
}
void chgobirope_update(Actor *this){
void chGobiRope_update(Actor *this){
Actor *sp2C;
f32 sp28;
if(!this->unk16C_4){
@@ -47,7 +47,7 @@ void chgobirope_update(Actor *this){
this->position_y = sp2C->position_y;
this->position_z = sp2C->position_z;
}
chgobirope_setState(this, 1);
chGobiRope_setState(this, 1);
if( jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1)
&& !func_803203FC(1)
){
@@ -57,20 +57,20 @@ void chgobirope_update(Actor *this){
else{
if(this->state == 1 || this->state == 2){
if(this->state == 1 && func_80387354()){
chgobirope_setState(this, 2);
chGobiRope_setState(this, 2);
}
else{
if(func_80387360())
chgobirope_setState(this, 4);
chGobiRope_setState(this, 4);
}
}//L80388AB4
if(this->state == 2){
if(func_80335794(this->unk148) > 0)
chgobirope_setState(this, 1);
chGobiRope_setState(this, 1);
}
if(this->state == 3){
if(func_80335794(this->unk148) > 0)
chgobirope_setState(this, 4);
chGobiRope_setState(this, 4);
}
}
}

View File

@@ -11,22 +11,22 @@ typedef struct {
f32 unk8;
} ActorLocal_GVMazeCtrl;
void __chmazectrl_setState(Actor *this, s32 next_state);
void chmazectrl_update(Actor *this);
void __chMazeCtrl_setState(Actor *this, s32 next_state);
void chMazeCtrl_update(Actor *this);
/* .data */
ActorInfo D_803915C0 = { MARKER_1CD_GV_MAZE_CTRL, ACTOR_319_GV_MAZE_CTRL, 0x0,
ActorInfo chMazeCtrl = { MARKER_1CD_GV_MAZE_CTRL, ACTOR_319_GV_MAZE_CTRL, 0x0,
0, NULL,
chmazectrl_update, 0x0, func_80325340,
chMazeCtrl_update, 0x0, func_80325340,
0, 0, 0.0f, 0
};
f32 D_803915E4[3] = {460.0f, 1400.0f, 0.0f};
f32 D_803915F0[3] = {0.0f, 0.0f, 0.0f};
f32 D_803915FC[3] = {0.0f, 0.0f, 0.0f};
f32 D_80391608[3] = {460.0f, 1400.0f, 0.0f};
/* .code */
void func_8038F520(f32 arg0){
static f32 D_803915E4[3] = {460.0f, 1400.0f, 0.0f};
static f32 D_803915F0[3] = {0.0f, 0.0f, 0.0f};
Struct6Ds *tmp_v0 = func_8034C528(0x19A);
if(tmp_v0 != NULL){
func_8034DDF0(tmp_v0, D_803915E4, D_803915F0, arg0, 1);
@@ -34,25 +34,27 @@ void func_8038F520(f32 arg0){
}
void func_8038F56C(f32 arg0){
static f32 D_803915FC[3] = {0.0f, 0.0f, 0.0f};
static f32 D_80391608[3] = {460.0f, 1400.0f, 0.0f};
Struct6Ds *tmp_v0 = func_8034C528(0x19A);
if(tmp_v0 != NULL){
func_8034DDF0(tmp_v0, D_803915FC, D_80391608, arg0, 1);
}
}
void __chmazectrl_markerSetState(ActorMarker *this_marker, s32 arg1){
void __chMazeCtrl_markerSetState(ActorMarker *this_marker, s32 arg1){
Actor *this = marker_getActor(this_marker);
__chmazectrl_setState(this, arg1);
__chMazeCtrl_setState(this, arg1);
}
void __chmazectrl_8038F5E4(Actor *this){
void __chMazeCtrl_8038F5E4(Actor *this){
if(this->state == 2){
comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 0, 30000);
item_set(ITEM_6_HOURGLASS, FALSE);
}
}
void __chmazectrl_setState(Actor *this, s32 next_state){
void __chMazeCtrl_setState(Actor *this, s32 next_state){
f32 plyr_pos[3];
Struct6Ds *tmp_v0;
ActorLocal_GVMazeCtrl *local;
@@ -97,8 +99,8 @@ void __chmazectrl_setState(Actor *this, s32 next_state){
if(next_state == 3){
func_80324E38(0.0f, 3);
timedFunc_set_2(0.0f, (GenMethod_2)func_8025A6EC, COMUSIC_3E_SANDYBUTT_FAILURE, 0x7FFF);
timedFunc_set_2(1.0f, (GenMethod_2)__chmazectrl_markerSetState, reinterpret_cast(s32, this->marker), 6);
timedFunc_set_2(2.0f, (GenMethod_2)__chmazectrl_markerSetState, reinterpret_cast(s32, this->marker), 4);
timedFunc_set_2(1.0f, (GenMethod_2)__chMazeCtrl_markerSetState, reinterpret_cast(s32, this->marker), 6);
timedFunc_set_2(2.0f, (GenMethod_2)__chMazeCtrl_markerSetState, reinterpret_cast(s32, this->marker), 4);
}//L8038F850
if(next_state == 4){
@@ -140,7 +142,7 @@ void __chmazectrl_setState(Actor *this, s32 next_state){
this->state = next_state;
}
void chmazectrl_update(Actor *this){
void chMazeCtrl_update(Actor *this){
f32 sp3C[3];
Struct6Ds *sp38;
f32 sp34;
@@ -150,7 +152,7 @@ void chmazectrl_update(Actor *this){
sp34 = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->unk30 = __chmazectrl_8038F5E4;
this->marker->unk30 = __chMazeCtrl_8038F5E4;
if(this->state == 2){
comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 30000, 30000);
item_set(ITEM_6_HOURGLASS, TRUE);
@@ -159,7 +161,7 @@ void chmazectrl_update(Actor *this){
func_8038F56C(0.0f);
local->unk4 = 0;
this->state = 0;
__chmazectrl_setState(this, 1);
__chMazeCtrl_setState(this, 1);
local->unk8 = 1.0f;
}//L8038FA8C
if(jiggyscore_isCollected(JIGGY_41_GV_MAZE))
@@ -170,7 +172,7 @@ void chmazectrl_update(Actor *this){
if(this->state == 1){
sp38 = func_8034C528(0x191);
if(sp38 != NULL && func_8034DC80(sp38, sp3C)){
__chmazectrl_setState(this, 2);
__chMazeCtrl_setState(this, 2);
}
if( !levelSpecificFlags_get(0x15)
&& func_8025773C(&local->unk8, sp34)
@@ -182,25 +184,25 @@ void chmazectrl_update(Actor *this){
if(this->state == 2){
if( sp3C[0] <= -1750.0f && 80.0f <= sp3C[2] && sp3C[2] <= 350.0f){
__chmazectrl_setState(this, 5);
__chMazeCtrl_setState(this, 5);
}
else{
if(item_empty(ITEM_6_HOURGLASS)){
__chmazectrl_setState(this, 3);
__chMazeCtrl_setState(this, 3);
}
}
}//L8038FBBC
if(this->state == 5){
if(-1700.0f < sp3C[0]){
__chmazectrl_setState(this, 2);
__chMazeCtrl_setState(this, 2);
}
}
if(this->state == 4){
sp30 = func_8034C528(0x190);
if(sp30 != NULL && func_8034DC78(sp30)){
__chmazectrl_setState(this, 0);
__chMazeCtrl_setState(this, 0);
}
}
}

View File

@@ -5,15 +5,15 @@
void chtoots_update(Actor *this);
/* .data */
ActorAnimationInfo GV_D_80390BD0[] = {
ActorAnimationInfo chTootsAnimations[] = {
{0x000, 0.0f},
{ASSET_162_ANIM_TOOTS_IDLE, 5.0f},
{ASSET_162_ANIM_TOOTS_IDLE, 2.5f},
{ASSET_164_ANIM_TOOTS_SING, 1.0f}
};
ActorInfo D_80390BF0 = { MARKER_1F4_TOOTS, ACTOR_1E4_TOOTS, ASSET_434_MODEL_TOOTS,
0x1, GV_D_80390BD0,
ActorInfo chToots = { MARKER_1F4_TOOTS, ACTOR_1E4_TOOTS, ASSET_434_MODEL_TOOTS,
0x1, chTootsAnimations,
chtoots_update, func_80326224, func_80325888,
2000, 0, 0.5f, 0
};

View File

@@ -3,19 +3,19 @@
#include "variables.h"
void func_80389144(Actor *this);
Actor *func_80389050(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void chTrucker_update(Actor *this);
Actor *chTrucker_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390D90 = {
ActorInfo chTrunker = {
MARKER_C0_TRUNKER, ACTOR_132_TRUNKER, ASSET_3DF_MODEL_TRUNKER,
0, NULL,
func_80389144, NULL, func_80389050,
chTrucker_update, NULL, chTrucker_draw,
0, 0x599, 2.0f, 0
};
/* .code */
void GV_func_80388F70(Actor *this, s32 next_state){
void __chTrucker_setState(Actor *this, s32 next_state){
this->state = next_state;
if(this->state == 1){
func_80335924(this->unk148, ASSET_FE_ANIM_TRUCKER_SHORT, 0.1f, 2.5f);
@@ -33,7 +33,7 @@ void GV_func_80388F70(Actor *this, s32 next_state){
}
}
Actor *func_80389050(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *chTrucker_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
f32 sp38[3];
f32 sp2C[3];
@@ -53,7 +53,7 @@ Actor *func_80389050(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
}
void func_80389144(Actor *this){
void chTrucker_update(Actor *this){
ActorMarker *marker = this->marker;
s32 sp28 = 0;
if(!this->unk16C_4){
@@ -62,10 +62,10 @@ void func_80389144(Actor *this){
actor_collisionOff(this);
mapSpecificFlags_set(0xC, FALSE);
if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2) && !func_803203FC(1)){
GV_func_80388F70(this, 3);
__chTrucker_setState(this, 3);
}
else{//L803891CC
GV_func_80388F70(this, 1);
__chTrucker_setState(this, 1);
}
}//L803891D8
if( this->state == 1
@@ -87,5 +87,5 @@ void func_80389144(Actor *this){
}
if(sp28)
GV_func_80388F70(this, sp28);
__chTrucker_setState(this, sp28);
}

View File

@@ -43,7 +43,7 @@ ActorInfo D_8039123C = { 0xBB, 0x287, 0x3E6,
/* .code */
void func_8038C760(Actor *this, s32 arg1){
ActorLocal_GV_6370 *local = (ActorLocal_GV_6370 *)&this->local;
func_8038FD50(local->unk14, arg1);
chBuriedPyramid_setRaisedAmount(local->unk14, arg1);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 28000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.9f, 29000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000);

View File

@@ -11,14 +11,14 @@ extern Actor *func_80325F2C(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx
extern void func_8032BC3C(Actor *, f32);
extern void func_80343E20(s32, s32, f32, s32);
extern ActorInfo D_80390BF0;
extern ActorInfo D_80390C5C;
extern ActorInfo D_80390C80;
extern ActorInfo D_80390D30;
extern ActorInfo D_80390D60;
extern ActorInfo GV_D_80390CB0;
extern ActorInfo D_80390D00;
extern ActorInfo D_80390D90;
extern ActorInfo chToots;
extern ActorInfo chAncientOne;
extern ActorInfo Gobi1;
extern ActorInfo chGobiRope;
extern ActorInfo chGobiRock;
extern ActorInfo chGobi2;
extern ActorInfo chGobi3;
extern ActorInfo chTrunker;
extern ActorInfo GV_D_80390DD0;
extern ActorInfo GV_D_80390E30;
extern ActorInfo D_80390E54;
@@ -40,8 +40,8 @@ extern ActorInfo GV_D_80391390;
extern ActorInfo D_803913B4;
extern ActorInfo D_80390F40;
extern ActorInfo D_80391494;
extern ActorInfo D_803915C0;
extern ActorInfo D_80391620;
extern ActorInfo chMazeCtrl;
extern ActorInfo chBuriedPyramid;
extern ActorInfo D_803914B8;
extern ActorInfo D_803914DC;
extern ActorInfo GV_D_80391500;
@@ -467,14 +467,14 @@ void func_8038F130(UNK_TYPE(s32) arg0, ActorMarker *arg1){
void GV_func_8038F154(void)
{
spawnableActorList_add(&D_80390BF0, actor_new, 0X180);
spawnableActorList_add(&D_80390C5C, actor_new, 0X58A);
spawnableActorList_add(&D_80390C80, actor_new, 0X9A8);
spawnableActorList_add(&D_80390D30, actor_new, 0X880);
spawnableActorList_add(&D_80390D60, actor_new, 0X80);
spawnableActorList_add(&GV_D_80390CB0, actor_new, 0XDA8);
spawnableActorList_add(&D_80390D00, actor_new, 0X9A8);
spawnableActorList_add(&D_80390D90, actor_new, 0XD80);
spawnableActorList_add(&chToots, actor_new, 0X180);
spawnableActorList_add(&chAncientOne, actor_new, 0X58A);
spawnableActorList_add(&Gobi1, actor_new, 0X9A8);
spawnableActorList_add(&chGobiRope, actor_new, 0X880);
spawnableActorList_add(&chGobiRock, actor_new, 0X80);
spawnableActorList_add(&chGobi2, actor_new, 0XDA8);
spawnableActorList_add(&chGobi3, actor_new, 0X9A8);
spawnableActorList_add(&chTrunker, actor_new, 0XD80);
spawnableActorList_add(&GV_D_80390DD0, actor_new, 0X4004);
spawnableActorList_add(&GV_D_80390E30, actor_new, 0X448);
spawnableActorList_add(&D_80390E54, actor_new, 0X48);
@@ -496,8 +496,8 @@ void GV_func_8038F154(void)
spawnableActorList_add(&D_803913B4, actor_new, 0X500);
spawnableActorList_add(&D_80390F40, actor_new, 0);
spawnableActorList_add(&D_80391494, actor_new, 0X408);
spawnableActorList_add(&D_803915C0, actor_new, 0);
spawnableActorList_add(&D_80391620, actor_new, 0X400);
spawnableActorList_add(&chMazeCtrl, actor_new, 0);
spawnableActorList_add(&chBuriedPyramid, actor_new, 0X400);
spawnableActorList_add(&D_803914B8, actor_new, 0X400);
spawnableActorList_add(&D_803914DC, actor_new, 0X400);
spawnableActorList_add(&GV_D_80391500, actor_new, 0X400);

View File

@@ -1,80 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
f32 unk0;
s32 unk4;
}ActorLocal_GV_9860;
void func_8038FD8C(Actor *this);
Actor *func_8038FCF4(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80391620 = { MARKER_1D4_SANDYBUTT_PYRAMID, ACTOR_31D_SANDYBUTT_PYRAMID, ASSET_56B_MODEL_SANDYBUTT_PYRAMID,
0, NULL,
func_8038FD8C, NULL, func_8038FCF4,
0, 0, 0.0f, 0
};
/* .code */
void func_8038FC50(Actor *this, s32 next_state){
s32 sp1C;
if(next_state == 2){
sp1C = func_802F9AA8(SFX_3EC_CCW_DOOR_OPENING);
func_802F9DB8(sp1C, 0.7f, 0.9f, 0.03f);
func_802F9F80(sp1C, 0.3f, 2.4f, 0.3f);
func_802FA060(sp1C, 32000, 32000, 0.0f);
}
this->state = next_state;
}
Actor *func_8038FCF4(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
ActorLocal_GV_9860 *local = (ActorLocal_GV_9860 *)&this->local;
if(local->unk4 == 0){
return func_80325340(this_marker, gfx, mtx, vtx);
}
else{
return func_80325888(this_marker, gfx, mtx, vtx);
}
}
void func_8038FD50(ActorMarker *this_marker, s32 arg1){
Actor *this = marker_getActor(this_marker);
ActorLocal_GV_9860 *local = (ActorLocal_GV_9860 *)&this->local;
local->unk0 = 0.0f;
local->unk4 = arg1;
func_8038FC50(this, 2);
}
void func_8038FD8C(Actor *this){
ActorLocal_GV_9860 *local = (ActorLocal_GV_9860 *)&this->local;
f32 tmp_f2;
f32 tmp_f0;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
local->unk4 = func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2);
this->position_x = 67.0f;
this->position_y = (local->unk4/3.0)*1050.0 + 1375.0;
this->position_z = 400.0f;
func_8038FC50(this, 1);
}//L8038FE48
if(this->state == 2){
local->unk0 += time_getDelta()/3.0f;
if(1.0f < local->unk0)
local->unk0 = 1.0f;
tmp_f0 = ((local->unk4 - 1)/3.0)*1050.0 + 1375.0;
tmp_f2 = (local->unk4/3.0)*1050.0 + 1375.0;
this->position_y = local->unk0*(tmp_f2 - tmp_f0) + tmp_f0;
if(1.0f == local->unk0)
func_8038FC50(this, 1);
}//L8038FF48
}

View File

@@ -30,18 +30,17 @@ Struct_GV_9DB0_1 D_80391650[] = {
{0x19F, 7, 0 },
{0x000, 0, 0 },
};
f32 GV_D_803916D8[3] = {0.0f, 100.0f, 0.0f};
/*.bss */
struct {
Struct_GV_9DB0_1 *tile1_0;
Struct_GV_9DB0_1 *tile2_4;
u8 matchCnt_8;//match_count
u8 state_9;
Struct_GV_9DB0_1 *tile_a;
Struct_GV_9DB0_1 *tile_b;
u8 match_count;//match_count
u8 state;
//u8 padA[0x2];
f32 unkC;
ActorMarker *unk10;
}D_80391AE0;
ActorMarker *mummy_marker;
}matchingGame;
/* .code */
Struct_GV_9DB0_1 * func_803901A0(s32 arg0){
@@ -62,12 +61,12 @@ void func_80390218(void *arg0){
func_8030E6D4(SFX_7F_HEAVYDOOR_SLAM);
}
void func_80390248(void){
jiggySpawn(JIGGY_40_GV_MATCHING_GAME, GV_D_803916D8);
void __matchingGame_spawnJIggy(void){
static f32 jiggy_position[3] = {0.0f, 100.0f, 0.0f};
jiggySpawn(JIGGY_40_GV_MATCHING_GAME, jiggy_position);
}
//matchingGame_setState
void func_80390270(s32 next_state){
void __matchingGame_setState(s32 next_state){
if(next_state == 2){
item_set(ITEM_6_HOURGLASS, 1);
if(func_803203FC(2))
@@ -75,7 +74,7 @@ void func_80390270(s32 next_state){
else
item_set(ITEM_0_HOURGLASS_TIMER, 5999);
}
if(D_80391AE0.state_9 == 2){
if(matchingGame.state == 2){
item_set(ITEM_6_HOURGLASS, 0);
}
@@ -96,74 +95,74 @@ void func_80390270(s32 next_state){
}
else{
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff);
if(D_80391AE0.unk10){
func_8035D490(D_80391AE0.unk10);
if(matchingGame.mummy_marker){
func_8035D490(matchingGame.mummy_marker);
}
func_80324E38(0.5f, 3);
timed_setCameraToNode(1.5f, 2);
timedFunc_set_0(1.7f, func_80390248);
timedFunc_set_0(1.7f, __matchingGame_spawnJIggy);
func_80324E88(4.0f);
func_80324E38(4.0f, 0);
}
}//L803903D8
D_80391AE0.state_9 = next_state;
matchingGame.state = next_state;
}
//matchingGame_reset
void func_803903EC(void){
func_80390270(0);
void gv_matchingGame_reset(void){
__matchingGame_setState(0);
}
//matchingGame_init
void func_8039040C(void){
void gv_matchingGame_init(void){
Actor *actor;
D_80391AE0.state_9 = 0;
matchingGame.state = 0;
if(map_get() == MAP_13_GV_MEMORY_GAME){
if( !jiggyscore_isSpawned(JIGGY_40_GV_MATCHING_GAME) //jiggy is collected
|| func_803203FC(2) //in FF minigame
){
D_80391AE0.matchCnt_8 = 0;
D_80391AE0.tile1_0 = NULL;
D_80391AE0.tile2_4 = NULL;
D_80391AE0.state_9 = 1;
D_80391AE0.unkC = 0.0f;
actor = actorArray_findActorFromActorId(0x34f);
matchingGame.match_count = 0;
matchingGame.tile_a = NULL;
matchingGame.tile_b = NULL;
matchingGame.state = 1;
matchingGame.unkC = 0.0f;
actor = actorArray_findActorFromActorId(ACTOR_34F_MUMMUM);
if(actor){
D_80391AE0.unk10 = actor->marker;
matchingGame.mummy_marker = actor->marker;
}
else{
D_80391AE0.unk10 = NULL;
matchingGame.mummy_marker = NULL;
}
}
}
}
void func_803904A8(void){
f32 sp5C;
f32 sp50[3];
void gv_matchingGame_update(void){
f32 dt;
f32 player_position[3];
s32 sp4C;
Struct6Ds *sp48;
Struct_GV_9DB0_1 * sp44;
f32 sp38[3];
f32 pad34;
sp5C = time_getDelta();
if(!D_80391AE0.state_9)
dt = time_getDelta();
if(!matchingGame.state)
return;
if(D_80391AE0.unk10 && !D_80391AE0.unk10->unk5C){
D_80391AE0.unk10 = NULL;
if(matchingGame.mummy_marker && !matchingGame.mummy_marker->unk5C){
matchingGame.mummy_marker = NULL;
}
if(D_80391AE0.tile1_0 == NULL || D_80391AE0.tile2_4 == NULL){
if(matchingGame.tile_a == NULL || matchingGame.tile_b == NULL){
if( player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER && func_8028F20C()){
player_getPosition(sp50);
sp4C = func_8033F3E8(mapModel_getModel(0), sp50, 0x190, 0x1a0);
player_getPosition(player_position);
sp4C = func_8033F3E8(mapModel_getModel(0), player_position, 0x190, 0x1a0);
if(sp4C){
sp48 = func_8034C528(sp4C);
if(D_80391AE0.state_9 == 1){
func_80390270(2);
if(matchingGame.state == 1){
__matchingGame_setState(2);
}
if(func_8034DC78(sp48) != 1){
sp44 = func_803901A0(sp4C);
@@ -171,68 +170,68 @@ void func_803904A8(void){
func_8034E25C(sp48, func_80390218);
func_8034E120(sp48, 0.0f, 180.0f, 0.7f, 1);
D_80391AE0.tile2_4 = D_80391AE0.tile1_0;
D_80391AE0.tile1_0 = sp44;
matchingGame.tile_b = matchingGame.tile_a;
matchingGame.tile_a = sp44;
sp44->unk4 = sp48;
if(D_80391AE0.unk10){
func_8035D4F0(D_80391AE0.unk10, sp4C);
if(matchingGame.mummy_marker){
func_8035D4F0(matchingGame.mummy_marker, sp4C);
}
}
}
}
}//L80390608
if(D_80391AE0.tile1_0 && D_80391AE0.tile2_4){
if(matchingGame.tile_a && matchingGame.tile_b){
s32 sp48;
if( func_8034DC78(D_80391AE0.tile1_0->unk4) == 1 && func_8034DC78(D_80391AE0.tile2_4->unk4) == 1){
if(0.0f < D_80391AE0.unkC){
if(0.6 < D_80391AE0.unkC && D_80391AE0.unkC - sp5C <= 0.6){
if( func_8034DC78(matchingGame.tile_a->unk4) == 1 && func_8034DC78(matchingGame.tile_b->unk4) == 1){
if(0.0f < matchingGame.unkC){
if(0.6 < matchingGame.unkC && matchingGame.unkC - dt <= 0.6){
func_8025A6EC(COMUSIC_2C_BUZZER, 0x7fff);
}//L803906AC
D_80391AE0.unkC -= sp5C;
if(D_80391AE0.unkC <= 0.0f){
func_8034E254(D_80391AE0.tile1_0->unk4, 0);
func_8034E25C(D_80391AE0.tile1_0->unk4, 0);
func_8034E120(D_80391AE0.tile1_0->unk4, 180.0f, 0.0f, 0.5f, 2);
func_8034E120(D_80391AE0.tile2_4->unk4, 180.0f, 0.0f, 0.5f, 2);
matchingGame.unkC -= dt;
if(matchingGame.unkC <= 0.0f){
func_8034E254(matchingGame.tile_a->unk4, 0);
func_8034E25C(matchingGame.tile_a->unk4, 0);
func_8034E120(matchingGame.tile_a->unk4, 180.0f, 0.0f, 0.5f, 2);
func_8034E120(matchingGame.tile_b->unk4, 180.0f, 0.0f, 0.5f, 2);
player_getPosition(sp38);
sp48 = func_8033F3E8(mapModel_getModel(0), sp38, 0x190, 0x1a0);
if(sp48 == D_80391AE0.tile1_0->unk0 || sp48 == D_80391AE0.tile2_4->unk0){
if(sp48 == matchingGame.tile_a->unk0 || sp48 == matchingGame.tile_b->unk0){
func_8028F66C(BS_INTR_14);
}
D_80391AE0.tile1_0 = D_80391AE0.tile2_4 = NULL;
matchingGame.tile_a = matchingGame.tile_b = NULL;
}
}//L80390788
else{
if(D_80391AE0.tile2_4->unk2 == D_80391AE0.tile1_0->unk2){
D_80391AE0.matchCnt_8++;
if(D_80391AE0.matchCnt_8 == 8){
func_80390270(4); //end game state
if(matchingGame.tile_b->unk2 == matchingGame.tile_a->unk2){
matchingGame.match_count++;
if(matchingGame.match_count == 8){
__matchingGame_setState(4); //end game state
}
else{
func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff);
}
D_80391AE0.tile1_0 = D_80391AE0.tile2_4 = NULL;
matchingGame.tile_a = matchingGame.tile_b = NULL;
}//L803907E4
else{
D_80391AE0.unkC = 1.0f;
matchingGame.unkC = 1.0f;
}
}//L803907EC
}//L803907F0
}//L803907F0
if( D_80391AE0.state_9 == 1
if( matchingGame.state == 1
&& func_803203FC(2)
&& func_803203FC(3)
){
func_80390270(2);
__matchingGame_setState(2);
}
if(D_80391AE0.state_9 == 2){
if(D_80391AE0.tile1_0 == NULL || D_80391AE0.tile2_4 == NULL){
if(matchingGame.state == 2){
if(matchingGame.tile_a == NULL || matchingGame.tile_b == NULL){
if(item_empty(ITEM_6_HOURGLASS)){
func_80390270(3);
__matchingGame_setState(3);
}
}
}