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

@@ -1651,14 +1651,14 @@ segments:
follows_vram: core2 follows_vram: core2
exclusive_ram_id: overlay exclusive_ram_id: overlay
subsegments: subsegments:
- [0x104C0E0, c, code_0] #DONE - [0x104C0E0, c, ch/toots] #DONE
- [0x104C310, c, code_230] #DONE - [0x104C310, c, ch/ancientone] #DONE
- [0x104CE40, c, code_D60] #DONE - [0x104CE40, c, ch/gobi1] #DONE
- [0x104D650, c, code_1570] #DONE - [0x104D650, c, ch/gobi2] #DONE
- [0x104DF60, c, code_1E80] #DONE - [0x104DF60, c, ch/gobi3] #DONE
- [0x104E5B0, c, code_24D0] #DONE - [0x104E5B0, c, ch/gobirope] #DONE
- [0x104E810, c, code_2730] #DONE - [0x104E810, c, ch/gobirock] #DONE
- [0x104EC60, c, code_2B80] #DONE - [0x104EC60, c, ch/trunker] #DONE
- [0x104EFC0, c, code_2EE0] #DONE - [0x104EFC0, c, code_2EE0] #DONE
- [0x104F1A0, c, code_30C0] #DONE - [0x104F1A0, c, code_30C0] #DONE
- [0x104F710, c, code_3630] #DONE - [0x104F710, c, code_3630] #DONE
@@ -1678,20 +1678,20 @@ segments:
- [0x1053E90, c, code_7DB0] #DONE - [0x1053E90, c, code_7DB0] #DONE
- [0x10540A0, c, code_7FC0] #DONE - [0x10540A0, c, code_7FC0] #DONE
- [0x10540D0, c, code_7FF0] #DONE - [0x10540D0, c, code_7FF0] #DONE
- [0x1055210, c, code_9130] #DONE - [0x1055210, c, ch/mazectrl] #DONE
- [0x1055940, c, code_9860] #DONE - [0x1055940, c, ch/buriedpyramid] #DONE
- [0x1055C50, c, code_9B70] #DONE - [0x1055C50, c, code_9B70] #DONE
- [0x1055CF0, c, code_9C10] #DONE - [0x1055CF0, c, code_9C10] #DONE
- [0x1055E90, c, code_9DB0] #DONE - [0x1055E90, c, matchinggame] #DONE
- [0x1056570, c, code_A490] #DONE - [0x1056570, c, code_A490] #DONE
- [0x10568C0, .data, code_0] - [0x10568C0, .data, ch/toots]
- [0x1056910, .data, code_230] - [0x1056910, .data, ch/ancientone]
- [0x1056970, .data, code_D60] - [0x1056970, .data, ch/gobi1]
- [0x10569A0, .data, code_1570] - [0x10569A0, .data, ch/gobi2]
- [0x10569F0, .data, code_1E80] - [0x10569F0, .data, ch/gobi3]
- [0x1056A20, .data, code_24D0] - [0x1056A20, .data, ch/gobirope]
- [0x1056A50, .data, code_2730] - [0x1056A50, .data, ch/gobirock]
- [0x1056A80, .data, code_2B80] - [0x1056A80, .data, ch/trunker]
- [0x1056AB0, .data, code_2EE0] - [0x1056AB0, .data, code_2EE0]
- [0x1056AF0, .data, code_30C0] - [0x1056AF0, .data, code_30C0]
- [0x1056B90, .data, code_3630] - [0x1056B90, .data, code_3630]
@@ -1710,14 +1710,14 @@ segments:
- [0x1057030, .data, code_7DB0] - [0x1057030, .data, code_7DB0]
- [0x1057070, .data, code_7FC0] - [0x1057070, .data, code_7FC0]
- [0x10570D0, .data, code_7FF0] - [0x10570D0, .data, code_7FF0]
- [0x10572B0, .data, code_9130] - [0x10572B0, .data, ch/mazectrl]
- [0x1057310, .data, code_9860] - [0x1057310, .data, ch/buriedpyramid]
- [0x1057340, .data, code_9DB0] - [0x1057340, .data, matchinggame]
- [0x10573E0, .rodata, code_230] - [0x10573E0, .rodata, ch/ancientone]
- [0x1057400, .rodata, code_D60] - [0x1057400, .rodata, ch/gobi1]
- [0x1057410, .rodata, code_1570] - [0x1057410, .rodata, ch/gobi2]
- [0x1057430, .rodata, code_1E80] - [0x1057430, .rodata, ch/gobi3]
- [0x1057470, .rodata, code_2730] - [0x1057470, .rodata, ch/gobirock]
- [0x1057480, .rodata, code_30C0] - [0x1057480, .rodata, code_30C0]
- [0x1057490, .rodata, code_3BB0] - [0x1057490, .rodata, code_3BB0]
- [0x10574A0, .rodata, code_3D90] - [0x10574A0, .rodata, code_3D90]
@@ -1728,15 +1728,15 @@ segments:
- [0x10575E0, .rodata, code_7060] - [0x10575E0, .rodata, code_7060]
- [0x1057600, .rodata, code_7530] - [0x1057600, .rodata, code_7530]
- [0x1057630, .rodata, code_7FF0] - [0x1057630, .rodata, code_7FF0]
- [0x1057690, .rodata, code_9130] - [0x1057690, .rodata, ch/mazectrl]
- [0x10576B0, .rodata, code_9860] - [0x10576B0, .rodata, ch/buriedpyramid]
- [0x10576F0, .rodata, code_9DB0] - [0x10576F0, .rodata, matchinggame]
- [0x1057700, .rodata, code_A490] - [0x1057700, .rodata, code_A490]
- [0x1057710, .bss, bss_pad] - [0x1057710, .bss, bss_pad]
- [0x1057710, .bss, code_0] - [0x1057710, .bss, ch/toots]
- [0x1057710, .bss, code_D60] - [0x1057710, .bss, ch/gobi1]
- [0x1057710, .bss, code_1570] - [0x1057710, .bss, ch/gobi2]
- [0x1057710, .bss, code_2730] - [0x1057710, .bss, ch/gobirock]
- [0x1057710, .bss, code_4740] - [0x1057710, .bss, code_4740]
- [0x1057710, .bss, code_5570] - [0x1057710, .bss, code_5570]
- [0x1057710, .bss, code_61E0] - [0x1057710, .bss, code_61E0]
@@ -1744,7 +1744,7 @@ segments:
- [0x1057710, .bss, code_7D50] - [0x1057710, .bss, code_7D50]
- [0x1057710, .bss, code_7FF0] - [0x1057710, .bss, code_7FF0]
- [0x1057710, .bss, code_9C10] - [0x1057710, .bss, code_9C10]
- [0x1057710, .bss, code_9DB0] - [0x1057710, .bss, matchinggame]
- [0x1057710, .bss, code_A490] - [0x1057710, .bss, code_A490]
- name: MMM - name: MMM
dir: MMM dir: MMM
@@ -1801,7 +1801,7 @@ segments:
follows_vram: core2 follows_vram: core2
exclusive_ram_id: overlay exclusive_ram_id: overlay
subsegments: subsegments:
- [0x105D7E0, c, code_0] #DONE - [0x105D7E0, c, ch/clam] #DONE
- [0x105E880, c, code_10A0] #DONE - [0x105E880, c, code_10A0] #DONE
- [0x105F1B0, c, code_19D0] #DONE - [0x105F1B0, c, code_19D0] #DONE
- [0x105FEB0, c, code_26D0] #DONE - [0x105FEB0, c, code_26D0] #DONE
@@ -1811,7 +1811,7 @@ segments:
- [0x1060DB0, c, code_35D0] #DONE - [0x1060DB0, c, code_35D0] #DONE
- [0x1061610, c, code_3E30] #DONE - [0x1061610, c, code_3E30] #DONE
- [0x10633B0, c, ch/treasure] #DONE - [0x10633B0, c, ch/treasure] #DONE
- [0x10637A0, .data, code_0] - [0x10637A0, .data, ch/clam]
- [0x10638D0, .data, code_10A0] - [0x10638D0, .data, code_10A0]
- [0x1063930, .data, code_19D0] - [0x1063930, .data, code_19D0]
- [0x10639D0, .data, code_26D0] - [0x10639D0, .data, code_26D0]
@@ -1821,7 +1821,7 @@ segments:
- [0x1063C10, .data, code_35D0] - [0x1063C10, .data, code_35D0]
- [0x1063D70, .data, code_3E30] - [0x1063D70, .data, code_3E30]
- [0x1064080, .data, ch/treasure] - [0x1064080, .data, ch/treasure]
- [0x10640D0, .rodata, code_0] - [0x10640D0, .rodata, ch/clam]
- [0x1064130, .rodata, code_10A0] - [0x1064130, .rodata, code_10A0]
- [0x1064160, .rodata, code_19D0] - [0x1064160, .rodata, code_19D0]
- [0x1064180, .rodata, code_26D0] - [0x1064180, .rodata, code_26D0]

View File

@@ -1634,8 +1634,8 @@ enum actor_e
ACTOR_12E_GOBI_1 = 0x12E, ACTOR_12E_GOBI_1 = 0x12E,
ACTOR_12F_GOBI_ROPE, ACTOR_12F_GOBI_ROPE,
ACTOR_130_GOBI_ROCK,
ACTOR_131_GOBI_2 = 0x131, ACTOR_131_GOBI_2,
ACTOR_132_TRUNKER, ACTOR_132_TRUNKER,
ACTOR_133_FLIBBIT_RED, ACTOR_133_FLIBBIT_RED,
ACTOR_134_BUZZBOMB, ACTOR_134_BUZZBOMB,
@@ -2603,9 +2603,9 @@ enum asset_e
ASSET_379_MODEL_SIRSLUSH_HAT, ASSET_379_MODEL_SIRSLUSH_HAT,
ASSET_37A_MODEL_TINY_SNOWBALL, ASSET_37A_MODEL_TINY_SNOWBALL,
// 37b Snowball Fragment // 37b Snowball Fragment
// 37c Yum-Yum Large Shell Fragment ASSET_37C_MODEL_CLAM_LARGE_SHELL_PIECE = 0x37C,
// 37d Yum-Yum Eye ASSET_37D_MODEL_CLAM_EYE,
// 37e Yum-Yum Small Shell Fragment ASSET_37E_MODEL_CLAM_SMALL_SHELL_PIECE,
// 37f (White Dot?) // 37f (White Dot?)
ASSET_380_MODEL_PINK_EGG_LARGEST = 0x380, ASSET_380_MODEL_PINK_EGG_LARGEST = 0x380,
ASSET_381_MODEL_PINK_EGG_LARGE, ASSET_381_MODEL_PINK_EGG_LARGE,
@@ -2711,7 +2711,7 @@ enum asset_e
ASSET_3E1_MODEL_RUBEES_EGG_POT = 0x3E1, ASSET_3E1_MODEL_RUBEES_EGG_POT = 0x3E1,
ASSET_3E2_MODEL_GV_KAZOOIE_TARGET = 0x3E2, ASSET_3E2_MODEL_GV_KAZOOIE_TARGET = 0x3E2,
ASSET_3E3_MODEL_GOBI_ROPE, ASSET_3E3_MODEL_GOBI_ROPE,
// 3e4 GV Gobi's Rock ASSET_3E4_MODEL_GOBI_ROCK,
// 3e5 GV Hand Shadow // 3e5 GV Hand Shadow
// 3e6 GV Jinxy Head 2 // 3e6 GV Jinxy Head 2
ASSET_3E7_MODEL_MAGIC_CARPET_SHADOW = 0x3e7, ASSET_3E7_MODEL_MAGIC_CARPET_SHADOW = 0x3e7,
@@ -3810,8 +3810,8 @@ enum marker_e{
MARKER_BC_GOBI_1 = 0xBC, MARKER_BC_GOBI_1 = 0xBC,
MARKER_BD_GOBI_ROPE, MARKER_BD_GOBI_ROPE,
MARKER_BE_GOBI_ROCK,
MARKER_BF_GOBI_2 = 0xBF, MARKER_BF_GOBI_2,
MARKER_C0_TRUNKER, MARKER_C0_TRUNKER,
MARKER_C1_FLIBBIT_RED, MARKER_C1_FLIBBIT_RED,
MARKER_C2_BUZZBOMB, MARKER_C2_BUZZBOMB,

View File

@@ -10,25 +10,25 @@ typedef struct {
u32 unk4_30:31; u32 unk4_30:31;
f32 unk10[3]; f32 unk10[3];
f32 unk1C; f32 unk1C;
}ActorLocal_GV_230; }ActorLocal_chAncientOne;
#define LOCAL_GV_230(s) ((ActorLocal_GV_230 *)&s->local) #define LOCAL_CH_ANCIENT_ONE(s) ((ActorLocal_chAncientOne *)&s->local)
void chancientone_update(Actor *this); void chAncientOne_update(Actor *this);
Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); Actor *chAncientOne_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */ /* .data */
s16 GV_D_80390C20[4] = {5, 6, 7, 8}; s16 GV_D_80390C20[4] = {5, 6, 7, 8};
ActorMarker *D_80390C28[5] = {NULL}; ActorMarker *D_80390C28[5] = {NULL};
ActorAnimationInfo GV_D_80390C3C[] = { ActorAnimationInfo chAncientOneAnimations[] = {
{0, 0.0f}, {0, 0.0f},
{0, 0.0f}, {0, 0.0f},
{ASSET_ED_ANIM_ANCIENT_ONE, 2.0f}, {ASSET_ED_ANIM_ANCIENT_ONE, 2.0f},
{ASSET_ED_ANIM_ANCIENT_ONE, 33000000.f} {ASSET_ED_ANIM_ANCIENT_ONE, 33000000.f}
}; };
ActorInfo D_80390C5C = { MARKER_F4_ANCIENT_ONE, ACTOR_147_ANCIENT_ONE, ASSET_3E8_MODEL_ANCIENT_ONE, ActorInfo chAncientOne = { MARKER_F4_ANCIENT_ONE, ACTOR_147_ANCIENT_ONE, ASSET_3E8_MODEL_ANCIENT_ONE,
0x1, GV_D_80390C3C, 0x1, chAncientOneAnimations,
chancientone_update, func_80326224, chancientone_draw, chAncientOne_update, func_80326224, chAncientOne_draw,
0, 0x100, 0.0f, 0 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]; f32 sp44[3];
s32 sp40; s32 sp40;
s32 sp38; s32 sp38;
@@ -122,7 +122,7 @@ void chancientone_update(Actor *this){
if(D_80390C28[this->unkF4_8 - 1]) if(D_80390C28[this->unkF4_8 - 1])
return; return;
LOCAL_GV_230(this)->unk1C = this->position_y; LOCAL_CH_ANCIENT_ONE(this)->unk1C = this->position_y;
this->position_y -= 1100.0f; this->position_y -= 1100.0f;
D_80390C28[this->unkF4_8 - 1] = this->marker; D_80390C28[this->unkF4_8 - 1] = this->marker;
if(this->unkF4_8 != 1){ if(this->unkF4_8 != 1){
@@ -136,14 +136,14 @@ void chancientone_update(Actor *this){
switch(this->state){ switch(this->state){
case 1: //L803869E4 case 1: //L803869E4
player_getPosition(sp44); player_getPosition(sp44);
sp44[0] -= LOCAL_GV_230(this)->unk10[0]; sp44[0] -= LOCAL_CH_ANCIENT_ONE(this)->unk10[0];
sp44[1] -= LOCAL_GV_230(this)->unk10[1]; sp44[1] -= LOCAL_CH_ANCIENT_ONE(this)->unk10[1];
sp44[2] -= LOCAL_GV_230(this)->unk10[2]; sp44[2] -= LOCAL_CH_ANCIENT_ONE(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; 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_GV_230(this)->unk1C <= this->position_y){ if(LOCAL_CH_ANCIENT_ONE(this)->unk1C <= this->position_y){
this->position_y = LOCAL_GV_230(this)->unk1C; this->position_y = LOCAL_CH_ANCIENT_ONE(this)->unk1C;
if( sp40 == (LOCAL_GV_230(this)->unk4_31 ^ 1)){ 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_GV_230(this)->unk4_30){ 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); func_8025A6EC(COMUSIC_2B_DING_B, 28000);
for(sp38= 7; sp38< 0xC && mapSpecificFlags_get(sp38);sp38++); for(sp38= 7; sp38< 0xC && mapSpecificFlags_get(sp38);sp38++);
mapSpecificFlags_set(sp38, TRUE); mapSpecificFlags_set(sp38, TRUE);
@@ -177,7 +177,7 @@ void chancientone_update(Actor *this){
} }
else{//L80386C64 else{//L80386C64
sp38 = func_8023DB5C() & 0xF; 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_y += 18.0;
this->position_x += (sp38 & 1) ? 0x17 : -0x17; this->position_x += (sp38 & 1) ? 0x17 : -0x17;
this->position_z += (sp38 & 2) ? 0xC : -0xC; this->position_z += (sp38 & 2) ? 0xC : -0xC;
@@ -185,16 +185,16 @@ void chancientone_update(Actor *this){
if(sp38 == 6){ 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)); __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)); __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 }//L80386D80
} }
if(LOCAL_GV_230(this)->unk1C <= this->position_y){ if(LOCAL_CH_ANCIENT_ONE(this)->unk1C <= this->position_y){
func_80244C78(2); func_80244C78(2);
timedFunc_set_0(0.5f, func_803867CC); timedFunc_set_0(0.5f, func_803867CC);
} }
}//L80386DB0 }//L80386DB0
LOCAL_GV_230(this)->unk4_31 = sp40; LOCAL_CH_ANCIENT_ONE(this)->unk4_31 = sp40;
break; break;
case 2: //L80386DCC case 2: //L80386DCC
if(actor_animationIsAt(this, 0.999f)){ if(actor_animationIsAt(this, 0.999f)){
@@ -203,7 +203,7 @@ void chancientone_update(Actor *this){
} }
break; break;
case 3: //L80386E04 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; this->position_y -= 10.0;
} }
else{ else{
@@ -214,7 +214,7 @@ void chancientone_update(Actor *this){
}//L80386E60 }//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); Actor *this = marker_getActor(this_marker);
int sp58; int sp58;
s32 sp4C[3]; s32 sp4C[3];
@@ -234,25 +234,25 @@ Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **v
sp4C[1] += 1100; sp4C[1] += 1100;
sp40[1] += 1100; sp40[1] += 1100;
sp34[1] += 1100; sp34[1] += 1100;
LOCAL_GV_230(this)->unk0[0] = (sp4C[0] - sp40[0]); LOCAL_CH_ANCIENT_ONE(this)->unk0[0] = (sp4C[0] - sp40[0]);
LOCAL_GV_230(this)->unk0[1] = (sp4C[1] - sp40[1]); LOCAL_CH_ANCIENT_ONE(this)->unk0[1] = (sp4C[1] - sp40[1]);
LOCAL_GV_230(this)->unk0[2] = (sp4C[2] - sp40[2]); LOCAL_CH_ANCIENT_ONE(this)->unk0[2] = (sp4C[2] - sp40[2]);
player_getPosition(sp28); player_getPosition(sp28);
sp28[0] -= sp40[0]; sp28[0] -= sp40[0];
sp28[1] -= sp40[1]; sp28[1] -= sp40[1];
sp28[2] -= sp40[2]; 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]) 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_GV_230(this)->unk4_31 = FALSE; LOCAL_CH_ANCIENT_ONE(this)->unk4_31 = FALSE;
else 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_CH_ANCIENT_ONE(this)->unk10[0] = (f32)sp40[0];
LOCAL_GV_230(this)->unk10[1] = (f32)sp40[1]; LOCAL_CH_ANCIENT_ONE(this)->unk10[1] = (f32)sp40[1];
LOCAL_GV_230(this)->unk10[2] = (f32)sp40[2]; LOCAL_CH_ANCIENT_ONE(this)->unk10[2] = (f32)sp40[2];
tmp_v0 = (sp34[1]- sp40[1]); 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; this->initialized = TRUE;
} }
return this; 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 unkC;
f32 unk10; f32 unk10;
f32 unk14; 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); Actor *chgobi1_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */ /* .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, 0, NULL,
NULL, func_80387408, chgobi1_draw, NULL, chGobi1_update, chgobi1_draw,
0, 0x533, 0.0f, 0 0, 0x533, 0.0f, 0
}; };
@@ -33,8 +33,8 @@ struct {
/* .code */ /* .code */
void GV_func_80387150(Actor *this, s32 next_state){ void chGobi1_setState(Actor *this, s32 next_state){
ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local; ActorLocal_chGobi1 *local = (ActorLocal_chGobi1 *)&this->local;
this->state = next_state; this->state = next_state;
GV_D_80391A40.unk0 = FALSE; GV_D_80391A40.unk0 = FALSE;
@@ -87,8 +87,8 @@ s32 func_80387360(void){
} }
void func_8038736C(Actor *this){ void func_8038736C(Actor *this){
ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local; ActorLocal_chGobi1 *local = (ActorLocal_chGobi1 *)&this->local;
GV_func_80387150(this, 0); chGobi1_setState(this, 0);
func_8030DA44(local->unk0[0]); func_8030DA44(local->unk0[0]);
func_8030DA44(local->unk0[1]); 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; ActorMarker *marker = this->marker;
ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local; ActorLocal_chGobi1 *local = (ActorLocal_chGobi1 *)&this->local;
s32 sp6C = 0; s32 sp6C = 0;
f32 tick; //sp68; f32 tick; //sp68;
int i; int i;
@@ -129,7 +129,7 @@ void func_80387408(Actor *this){
local->unk14 = 0.0f; local->unk14 = 0.0f;
this->unk1C[0] = 0.0f; this->unk1C[0] = 0.0f;
this->unk1C[1] = 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)){ if(jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1) && ! func_803203FC(1)){
marker_despawn(this->marker); marker_despawn(this->marker);
} }
@@ -166,7 +166,7 @@ void func_80387408(Actor *this){
} }
if(this->state == 1 || this->state == 2){ if(this->state == 1 || this->state == 2){
if(func_80388D78()) if(chGobiRock_isDestroyed())
sp6C = 3; sp6C = 3;
} }
@@ -229,5 +229,5 @@ void func_80387408(Actor *this){
this->unk1C[0] = 0.0f; this->unk1C[0] = 0.0f;
if(sp6C) if(sp6C)
GV_func_80387150(this, sp6C); chGobi1_setState(this, sp6C);
} }

View File

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

View File

@@ -2,23 +2,23 @@
#include "functions.h" #include "functions.h"
#include "variables.h" #include "variables.h"
void chgobi3_setState(Actor *this, s32 next_state); void chGobi3_setState(Actor *this, s32 next_state);
void chgobi3_update(Actor *this); void chGobi3_update(Actor *this);
Actor *chgobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); Actor *chGobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */ /* .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, 0, NULL,
NULL, chgobi3_update, chgobi3_draw, NULL, chGobi3_update, chGobi3_draw,
0, 0, 0.0f, 0 0, 0, 0.0f, 0
}; };
/* .code */ /* .code */
void func_80388270(Actor *this){ void __chGobi3_func_80388270(Actor *this){
func_8028F428(2, this->marker); func_8028F428(2, this->marker);
} }
void func_80388298(Actor *this){ void __chGobi3_spawnHoneyComb(Actor *this){
s32 pad24; s32 pad24;
f32 sp18[3]; f32 sp18[3];
TUPLE_ASSIGN(sp18, -6885.0f, 2383.0f, 1335.0f); TUPLE_ASSIGN(sp18, -6885.0f, 2383.0f, 1335.0f);
@@ -27,9 +27,9 @@ void func_80388298(Actor *this){
func_802C937C(0xd, sp18); 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); 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);
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); 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) if(next_state == 1)
actor_collisionOff(this); actor_collisionOff(this);
@@ -63,16 +63,16 @@ void chgobi3_setState(Actor *this, s32 next_state){
if(next_state == 3){ if(next_state == 3){
func_80324E38(0.0f, 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_setCameraToNode(0.1f, 0x12);
timed_playSfx(0.2f, SFX_4C_LIP_SMACK, 1.0f, 32000); 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); func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 1.0f);
} }
if(next_state == 5){ if(next_state == 5){
func_80335924(this->unk148, 0xd9, 0.5f, 4.0f); 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){ if(next_state == 4){
@@ -92,7 +92,7 @@ void chgobi3_setState(Actor *this, s32 next_state){
this->state = 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); Actor *this = marker_getActor(this_marker);
if(this->state == 0 || this->state == 1) return this; 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); 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); Actor *this = marker_getActor(this_marker);
enum hitbox_e hitbox; enum hitbox_e hitbox;
hitbox = player_getActiveHitbox(NULL); hitbox = player_getActiveHitbox(NULL);
if(hitbox == HITBOX_1_BEAK_BUSTER){ if(hitbox == HITBOX_1_BEAK_BUSTER){
if(this->state == 2) if(this->state == 2)
chgobi3_setState(this, 3); chGobi3_setState(this, 3);
} }
else if(hitbox == HITBOX_A_FAST_FALLING){ else if(hitbox == HITBOX_A_FAST_FALLING){
this->unk1C[0] = 1.0f; this->unk1C[0] = 1.0f;
} }
} }
void chgobi3_update(Actor *this){ void chGobi3_update(Actor *this){
if(!this->unk16C_4){ if(!this->unk16C_4){
this->unk16C_4 = TRUE; 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[0] = 0.0f;
this->unk1C[1] = 0.0f; this->unk1C[1] = 0.0f;
chgobi3_setState(this, 1); chGobi3_setState(this, 1);
if(honeycombscore_get(HONEYCOMB_C_GV_GOBI_3)) if(honeycombscore_get(HONEYCOMB_C_GV_GOBI_3))
marker_despawn(this->marker); marker_despawn(this->marker);
return; return;
@@ -128,29 +128,29 @@ void chgobi3_update(Actor *this){
if(this->state == 1){ if(this->state == 1){
if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2)) if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2))
chgobi3_setState(this, 2); chGobi3_setState(this, 2);
} }
if(this->state == 2){ if(this->state == 2){
if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0){ if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0){
chgobi3_setState(this, 7); chGobi3_setState(this, 7);
} }
} }
if(this->state == 3){ if(this->state == 3){
if(func_80335794(this->unk148) > 0) if(func_80335794(this->unk148) > 0)
chgobi3_setState(this, 5); chGobi3_setState(this, 5);
} }
if(this->state == 4){ if(this->state == 4){
func_80326224(this); func_80326224(this);
if(timedFuncQueue_is_empty()) if(timedFuncQueue_is_empty())
chgobi3_setState(this, 6); chGobi3_setState(this, 6);
} }
if(this->state == 7){ if(this->state == 7){
if(func_80335794(this->unk148) > 0) if(func_80335794(this->unk148) > 0)
chgobi3_setState(this, 2); chGobi3_setState(this, 2);
} }
this->unk1C[1] = this->unk1C[0]; this->unk1C[1] = this->unk1C[0];

View File

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

View File

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

View File

@@ -11,22 +11,22 @@ typedef struct {
f32 unk8; f32 unk8;
} ActorLocal_GVMazeCtrl; } ActorLocal_GVMazeCtrl;
void __chmazectrl_setState(Actor *this, s32 next_state); void __chMazeCtrl_setState(Actor *this, s32 next_state);
void chmazectrl_update(Actor *this); void chMazeCtrl_update(Actor *this);
/* .data */ /* .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, 0, NULL,
chmazectrl_update, 0x0, func_80325340, chMazeCtrl_update, 0x0, func_80325340,
0, 0, 0.0f, 0 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 */ /* .code */
void func_8038F520(f32 arg0){ 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); Struct6Ds *tmp_v0 = func_8034C528(0x19A);
if(tmp_v0 != NULL){ if(tmp_v0 != NULL){
func_8034DDF0(tmp_v0, D_803915E4, D_803915F0, arg0, 1); func_8034DDF0(tmp_v0, D_803915E4, D_803915F0, arg0, 1);
@@ -34,25 +34,27 @@ void func_8038F520(f32 arg0){
} }
void func_8038F56C(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); Struct6Ds *tmp_v0 = func_8034C528(0x19A);
if(tmp_v0 != NULL){ if(tmp_v0 != NULL){
func_8034DDF0(tmp_v0, D_803915FC, D_80391608, arg0, 1); 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); 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){ if(this->state == 2){
comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 0, 30000); comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 0, 30000);
item_set(ITEM_6_HOURGLASS, FALSE); 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]; f32 plyr_pos[3];
Struct6Ds *tmp_v0; Struct6Ds *tmp_v0;
ActorLocal_GVMazeCtrl *local; ActorLocal_GVMazeCtrl *local;
@@ -97,8 +99,8 @@ void __chmazectrl_setState(Actor *this, s32 next_state){
if(next_state == 3){ if(next_state == 3){
func_80324E38(0.0f, 3); func_80324E38(0.0f, 3);
timedFunc_set_2(0.0f, (GenMethod_2)func_8025A6EC, COMUSIC_3E_SANDYBUTT_FAILURE, 0x7FFF); 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(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(2.0f, (GenMethod_2)__chMazeCtrl_markerSetState, reinterpret_cast(s32, this->marker), 4);
}//L8038F850 }//L8038F850
if(next_state == 4){ if(next_state == 4){
@@ -140,7 +142,7 @@ void __chmazectrl_setState(Actor *this, s32 next_state){
this->state = next_state; this->state = next_state;
} }
void chmazectrl_update(Actor *this){ void chMazeCtrl_update(Actor *this){
f32 sp3C[3]; f32 sp3C[3];
Struct6Ds *sp38; Struct6Ds *sp38;
f32 sp34; f32 sp34;
@@ -150,7 +152,7 @@ void chmazectrl_update(Actor *this){
sp34 = time_getDelta(); sp34 = time_getDelta();
if(!this->unk16C_4){ if(!this->unk16C_4){
this->unk16C_4 = TRUE; this->unk16C_4 = TRUE;
this->marker->unk30 = __chmazectrl_8038F5E4; this->marker->unk30 = __chMazeCtrl_8038F5E4;
if(this->state == 2){ if(this->state == 2){
comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 30000, 30000); comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 30000, 30000);
item_set(ITEM_6_HOURGLASS, TRUE); item_set(ITEM_6_HOURGLASS, TRUE);
@@ -159,7 +161,7 @@ void chmazectrl_update(Actor *this){
func_8038F56C(0.0f); func_8038F56C(0.0f);
local->unk4 = 0; local->unk4 = 0;
this->state = 0; this->state = 0;
__chmazectrl_setState(this, 1); __chMazeCtrl_setState(this, 1);
local->unk8 = 1.0f; local->unk8 = 1.0f;
}//L8038FA8C }//L8038FA8C
if(jiggyscore_isCollected(JIGGY_41_GV_MAZE)) if(jiggyscore_isCollected(JIGGY_41_GV_MAZE))
@@ -170,7 +172,7 @@ void chmazectrl_update(Actor *this){
if(this->state == 1){ if(this->state == 1){
sp38 = func_8034C528(0x191); sp38 = func_8034C528(0x191);
if(sp38 != NULL && func_8034DC80(sp38, sp3C)){ if(sp38 != NULL && func_8034DC80(sp38, sp3C)){
__chmazectrl_setState(this, 2); __chMazeCtrl_setState(this, 2);
} }
if( !levelSpecificFlags_get(0x15) if( !levelSpecificFlags_get(0x15)
&& func_8025773C(&local->unk8, sp34) && func_8025773C(&local->unk8, sp34)
@@ -182,25 +184,25 @@ void chmazectrl_update(Actor *this){
if(this->state == 2){ if(this->state == 2){
if( sp3C[0] <= -1750.0f && 80.0f <= sp3C[2] && sp3C[2] <= 350.0f){ if( sp3C[0] <= -1750.0f && 80.0f <= sp3C[2] && sp3C[2] <= 350.0f){
__chmazectrl_setState(this, 5); __chMazeCtrl_setState(this, 5);
} }
else{ else{
if(item_empty(ITEM_6_HOURGLASS)){ if(item_empty(ITEM_6_HOURGLASS)){
__chmazectrl_setState(this, 3); __chMazeCtrl_setState(this, 3);
} }
} }
}//L8038FBBC }//L8038FBBC
if(this->state == 5){ if(this->state == 5){
if(-1700.0f < sp3C[0]){ if(-1700.0f < sp3C[0]){
__chmazectrl_setState(this, 2); __chMazeCtrl_setState(this, 2);
} }
} }
if(this->state == 4){ if(this->state == 4){
sp30 = func_8034C528(0x190); sp30 = func_8034C528(0x190);
if(sp30 != NULL && func_8034DC78(sp30)){ 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); void chtoots_update(Actor *this);
/* .data */ /* .data */
ActorAnimationInfo GV_D_80390BD0[] = { ActorAnimationInfo chTootsAnimations[] = {
{0x000, 0.0f}, {0x000, 0.0f},
{ASSET_162_ANIM_TOOTS_IDLE, 5.0f}, {ASSET_162_ANIM_TOOTS_IDLE, 5.0f},
{ASSET_162_ANIM_TOOTS_IDLE, 2.5f}, {ASSET_162_ANIM_TOOTS_IDLE, 2.5f},
{ASSET_164_ANIM_TOOTS_SING, 1.0f} {ASSET_164_ANIM_TOOTS_SING, 1.0f}
}; };
ActorInfo D_80390BF0 = { MARKER_1F4_TOOTS, ACTOR_1E4_TOOTS, ASSET_434_MODEL_TOOTS, ActorInfo chToots = { MARKER_1F4_TOOTS, ACTOR_1E4_TOOTS, ASSET_434_MODEL_TOOTS,
0x1, GV_D_80390BD0, 0x1, chTootsAnimations,
chtoots_update, func_80326224, func_80325888, chtoots_update, func_80326224, func_80325888,
2000, 0, 0.5f, 0 2000, 0, 0.5f, 0
}; };

View File

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

View File

@@ -43,7 +43,7 @@ ActorInfo D_8039123C = { 0xBB, 0x287, 0x3E6,
/* .code */ /* .code */
void func_8038C760(Actor *this, s32 arg1){ void func_8038C760(Actor *this, s32 arg1){
ActorLocal_GV_6370 *local = (ActorLocal_GV_6370 *)&this->local; 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.7f, 28000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.9f, 29000); FUNC_8030E624(SFX_3F6_UNKNOWN, 0.9f, 29000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000); 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_8032BC3C(Actor *, f32);
extern void func_80343E20(s32, s32, f32, s32); extern void func_80343E20(s32, s32, f32, s32);
extern ActorInfo D_80390BF0; extern ActorInfo chToots;
extern ActorInfo D_80390C5C; extern ActorInfo chAncientOne;
extern ActorInfo D_80390C80; extern ActorInfo Gobi1;
extern ActorInfo D_80390D30; extern ActorInfo chGobiRope;
extern ActorInfo D_80390D60; extern ActorInfo chGobiRock;
extern ActorInfo GV_D_80390CB0; extern ActorInfo chGobi2;
extern ActorInfo D_80390D00; extern ActorInfo chGobi3;
extern ActorInfo D_80390D90; extern ActorInfo chTrunker;
extern ActorInfo GV_D_80390DD0; extern ActorInfo GV_D_80390DD0;
extern ActorInfo GV_D_80390E30; extern ActorInfo GV_D_80390E30;
extern ActorInfo D_80390E54; extern ActorInfo D_80390E54;
@@ -40,8 +40,8 @@ extern ActorInfo GV_D_80391390;
extern ActorInfo D_803913B4; extern ActorInfo D_803913B4;
extern ActorInfo D_80390F40; extern ActorInfo D_80390F40;
extern ActorInfo D_80391494; extern ActorInfo D_80391494;
extern ActorInfo D_803915C0; extern ActorInfo chMazeCtrl;
extern ActorInfo D_80391620; extern ActorInfo chBuriedPyramid;
extern ActorInfo D_803914B8; extern ActorInfo D_803914B8;
extern ActorInfo D_803914DC; extern ActorInfo D_803914DC;
extern ActorInfo GV_D_80391500; extern ActorInfo GV_D_80391500;
@@ -467,14 +467,14 @@ void func_8038F130(UNK_TYPE(s32) arg0, ActorMarker *arg1){
void GV_func_8038F154(void) void GV_func_8038F154(void)
{ {
spawnableActorList_add(&D_80390BF0, actor_new, 0X180); spawnableActorList_add(&chToots, actor_new, 0X180);
spawnableActorList_add(&D_80390C5C, actor_new, 0X58A); spawnableActorList_add(&chAncientOne, actor_new, 0X58A);
spawnableActorList_add(&D_80390C80, actor_new, 0X9A8); spawnableActorList_add(&Gobi1, actor_new, 0X9A8);
spawnableActorList_add(&D_80390D30, actor_new, 0X880); spawnableActorList_add(&chGobiRope, actor_new, 0X880);
spawnableActorList_add(&D_80390D60, actor_new, 0X80); spawnableActorList_add(&chGobiRock, actor_new, 0X80);
spawnableActorList_add(&GV_D_80390CB0, actor_new, 0XDA8); spawnableActorList_add(&chGobi2, actor_new, 0XDA8);
spawnableActorList_add(&D_80390D00, actor_new, 0X9A8); spawnableActorList_add(&chGobi3, actor_new, 0X9A8);
spawnableActorList_add(&D_80390D90, actor_new, 0XD80); spawnableActorList_add(&chTrunker, actor_new, 0XD80);
spawnableActorList_add(&GV_D_80390DD0, actor_new, 0X4004); spawnableActorList_add(&GV_D_80390DD0, actor_new, 0X4004);
spawnableActorList_add(&GV_D_80390E30, actor_new, 0X448); spawnableActorList_add(&GV_D_80390E30, actor_new, 0X448);
spawnableActorList_add(&D_80390E54, actor_new, 0X48); 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_803913B4, actor_new, 0X500);
spawnableActorList_add(&D_80390F40, actor_new, 0); spawnableActorList_add(&D_80390F40, actor_new, 0);
spawnableActorList_add(&D_80391494, actor_new, 0X408); spawnableActorList_add(&D_80391494, actor_new, 0X408);
spawnableActorList_add(&D_803915C0, actor_new, 0); spawnableActorList_add(&chMazeCtrl, actor_new, 0);
spawnableActorList_add(&D_80391620, actor_new, 0X400); spawnableActorList_add(&chBuriedPyramid, actor_new, 0X400);
spawnableActorList_add(&D_803914B8, actor_new, 0X400); spawnableActorList_add(&D_803914B8, actor_new, 0X400);
spawnableActorList_add(&D_803914DC, actor_new, 0X400); spawnableActorList_add(&D_803914DC, actor_new, 0X400);
spawnableActorList_add(&GV_D_80391500, 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 }, {0x19F, 7, 0 },
{0x000, 0, 0 }, {0x000, 0, 0 },
}; };
f32 GV_D_803916D8[3] = {0.0f, 100.0f, 0.0f};
/*.bss */ /*.bss */
struct { struct {
Struct_GV_9DB0_1 *tile1_0; Struct_GV_9DB0_1 *tile_a;
Struct_GV_9DB0_1 *tile2_4; Struct_GV_9DB0_1 *tile_b;
u8 matchCnt_8;//match_count u8 match_count;//match_count
u8 state_9; u8 state;
//u8 padA[0x2]; //u8 padA[0x2];
f32 unkC; f32 unkC;
ActorMarker *unk10; ActorMarker *mummy_marker;
}D_80391AE0; }matchingGame;
/* .code */ /* .code */
Struct_GV_9DB0_1 * func_803901A0(s32 arg0){ Struct_GV_9DB0_1 * func_803901A0(s32 arg0){
@@ -62,12 +61,12 @@ void func_80390218(void *arg0){
func_8030E6D4(SFX_7F_HEAVYDOOR_SLAM); func_8030E6D4(SFX_7F_HEAVYDOOR_SLAM);
} }
void func_80390248(void){ void __matchingGame_spawnJIggy(void){
jiggySpawn(JIGGY_40_GV_MATCHING_GAME, GV_D_803916D8); static f32 jiggy_position[3] = {0.0f, 100.0f, 0.0f};
jiggySpawn(JIGGY_40_GV_MATCHING_GAME, jiggy_position);
} }
//matchingGame_setState void __matchingGame_setState(s32 next_state){
void func_80390270(s32 next_state){
if(next_state == 2){ if(next_state == 2){
item_set(ITEM_6_HOURGLASS, 1); item_set(ITEM_6_HOURGLASS, 1);
if(func_803203FC(2)) if(func_803203FC(2))
@@ -75,7 +74,7 @@ void func_80390270(s32 next_state){
else else
item_set(ITEM_0_HOURGLASS_TIMER, 5999); item_set(ITEM_0_HOURGLASS_TIMER, 5999);
} }
if(D_80391AE0.state_9 == 2){ if(matchingGame.state == 2){
item_set(ITEM_6_HOURGLASS, 0); item_set(ITEM_6_HOURGLASS, 0);
} }
@@ -96,74 +95,74 @@ void func_80390270(s32 next_state){
} }
else{ else{
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff); func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff);
if(D_80391AE0.unk10){ if(matchingGame.mummy_marker){
func_8035D490(D_80391AE0.unk10); func_8035D490(matchingGame.mummy_marker);
} }
func_80324E38(0.5f, 3); func_80324E38(0.5f, 3);
timed_setCameraToNode(1.5f, 2); timed_setCameraToNode(1.5f, 2);
timedFunc_set_0(1.7f, func_80390248); timedFunc_set_0(1.7f, __matchingGame_spawnJIggy);
func_80324E88(4.0f); func_80324E88(4.0f);
func_80324E38(4.0f, 0); func_80324E38(4.0f, 0);
} }
}//L803903D8 }//L803903D8
D_80391AE0.state_9 = next_state; matchingGame.state = next_state;
} }
//matchingGame_reset //matchingGame_reset
void func_803903EC(void){ void gv_matchingGame_reset(void){
func_80390270(0); __matchingGame_setState(0);
} }
//matchingGame_init //matchingGame_init
void func_8039040C(void){ void gv_matchingGame_init(void){
Actor *actor; Actor *actor;
D_80391AE0.state_9 = 0; matchingGame.state = 0;
if(map_get() == MAP_13_GV_MEMORY_GAME){ if(map_get() == MAP_13_GV_MEMORY_GAME){
if( !jiggyscore_isSpawned(JIGGY_40_GV_MATCHING_GAME) //jiggy is collected if( !jiggyscore_isSpawned(JIGGY_40_GV_MATCHING_GAME) //jiggy is collected
|| func_803203FC(2) //in FF minigame || func_803203FC(2) //in FF minigame
){ ){
D_80391AE0.matchCnt_8 = 0; matchingGame.match_count = 0;
D_80391AE0.tile1_0 = NULL; matchingGame.tile_a = NULL;
D_80391AE0.tile2_4 = NULL; matchingGame.tile_b = NULL;
D_80391AE0.state_9 = 1; matchingGame.state = 1;
D_80391AE0.unkC = 0.0f; matchingGame.unkC = 0.0f;
actor = actorArray_findActorFromActorId(0x34f); actor = actorArray_findActorFromActorId(ACTOR_34F_MUMMUM);
if(actor){ if(actor){
D_80391AE0.unk10 = actor->marker; matchingGame.mummy_marker = actor->marker;
} }
else{ else{
D_80391AE0.unk10 = NULL; matchingGame.mummy_marker = NULL;
} }
} }
} }
} }
void func_803904A8(void){ void gv_matchingGame_update(void){
f32 sp5C; f32 dt;
f32 sp50[3]; f32 player_position[3];
s32 sp4C; s32 sp4C;
Struct6Ds *sp48; Struct6Ds *sp48;
Struct_GV_9DB0_1 * sp44; Struct_GV_9DB0_1 * sp44;
f32 sp38[3]; f32 sp38[3];
f32 pad34; f32 pad34;
sp5C = time_getDelta(); dt = time_getDelta();
if(!D_80391AE0.state_9) if(!matchingGame.state)
return; return;
if(D_80391AE0.unk10 && !D_80391AE0.unk10->unk5C){ if(matchingGame.mummy_marker && !matchingGame.mummy_marker->unk5C){
D_80391AE0.unk10 = NULL; 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()){ if( player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER && func_8028F20C()){
player_getPosition(sp50); player_getPosition(player_position);
sp4C = func_8033F3E8(mapModel_getModel(0), sp50, 0x190, 0x1a0); sp4C = func_8033F3E8(mapModel_getModel(0), player_position, 0x190, 0x1a0);
if(sp4C){ if(sp4C){
sp48 = func_8034C528(sp4C); sp48 = func_8034C528(sp4C);
if(D_80391AE0.state_9 == 1){ if(matchingGame.state == 1){
func_80390270(2); __matchingGame_setState(2);
} }
if(func_8034DC78(sp48) != 1){ if(func_8034DC78(sp48) != 1){
sp44 = func_803901A0(sp4C); sp44 = func_803901A0(sp4C);
@@ -171,68 +170,68 @@ void func_803904A8(void){
func_8034E25C(sp48, func_80390218); func_8034E25C(sp48, func_80390218);
func_8034E120(sp48, 0.0f, 180.0f, 0.7f, 1); func_8034E120(sp48, 0.0f, 180.0f, 0.7f, 1);
D_80391AE0.tile2_4 = D_80391AE0.tile1_0; matchingGame.tile_b = matchingGame.tile_a;
D_80391AE0.tile1_0 = sp44; matchingGame.tile_a = sp44;
sp44->unk4 = sp48; sp44->unk4 = sp48;
if(D_80391AE0.unk10){ if(matchingGame.mummy_marker){
func_8035D4F0(D_80391AE0.unk10, sp4C); func_8035D4F0(matchingGame.mummy_marker, sp4C);
} }
} }
} }
} }
}//L80390608 }//L80390608
if(D_80391AE0.tile1_0 && D_80391AE0.tile2_4){ if(matchingGame.tile_a && matchingGame.tile_b){
s32 sp48; s32 sp48;
if( func_8034DC78(D_80391AE0.tile1_0->unk4) == 1 && func_8034DC78(D_80391AE0.tile2_4->unk4) == 1){ if( func_8034DC78(matchingGame.tile_a->unk4) == 1 && func_8034DC78(matchingGame.tile_b->unk4) == 1){
if(0.0f < D_80391AE0.unkC){ if(0.0f < matchingGame.unkC){
if(0.6 < D_80391AE0.unkC && D_80391AE0.unkC - sp5C <= 0.6){ if(0.6 < matchingGame.unkC && matchingGame.unkC - dt <= 0.6){
func_8025A6EC(COMUSIC_2C_BUZZER, 0x7fff); func_8025A6EC(COMUSIC_2C_BUZZER, 0x7fff);
}//L803906AC }//L803906AC
D_80391AE0.unkC -= sp5C; matchingGame.unkC -= dt;
if(D_80391AE0.unkC <= 0.0f){ if(matchingGame.unkC <= 0.0f){
func_8034E254(D_80391AE0.tile1_0->unk4, 0); func_8034E254(matchingGame.tile_a->unk4, 0);
func_8034E25C(D_80391AE0.tile1_0->unk4, 0); func_8034E25C(matchingGame.tile_a->unk4, 0);
func_8034E120(D_80391AE0.tile1_0->unk4, 180.0f, 0.0f, 0.5f, 2); func_8034E120(matchingGame.tile_a->unk4, 180.0f, 0.0f, 0.5f, 2);
func_8034E120(D_80391AE0.tile2_4->unk4, 180.0f, 0.0f, 0.5f, 2); func_8034E120(matchingGame.tile_b->unk4, 180.0f, 0.0f, 0.5f, 2);
player_getPosition(sp38); player_getPosition(sp38);
sp48 = func_8033F3E8(mapModel_getModel(0), sp38, 0x190, 0x1a0); 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); func_8028F66C(BS_INTR_14);
} }
D_80391AE0.tile1_0 = D_80391AE0.tile2_4 = NULL; matchingGame.tile_a = matchingGame.tile_b = NULL;
} }
}//L80390788 }//L80390788
else{ else{
if(D_80391AE0.tile2_4->unk2 == D_80391AE0.tile1_0->unk2){ if(matchingGame.tile_b->unk2 == matchingGame.tile_a->unk2){
D_80391AE0.matchCnt_8++; matchingGame.match_count++;
if(D_80391AE0.matchCnt_8 == 8){ if(matchingGame.match_count == 8){
func_80390270(4); //end game state __matchingGame_setState(4); //end game state
} }
else{ else{
func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff); func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff);
} }
D_80391AE0.tile1_0 = D_80391AE0.tile2_4 = NULL; matchingGame.tile_a = matchingGame.tile_b = NULL;
}//L803907E4 }//L803907E4
else{ else{
D_80391AE0.unkC = 1.0f; matchingGame.unkC = 1.0f;
} }
}//L803907EC }//L803907EC
}//L803907F0 }//L803907F0
}//L803907F0 }//L803907F0
if( D_80391AE0.state_9 == 1 if( matchingGame.state == 1
&& func_803203FC(2) && func_803203FC(2)
&& func_803203FC(3) && func_803203FC(3)
){ ){
func_80390270(2); __matchingGame_setState(2);
} }
if(D_80391AE0.state_9 == 2){ if(matchingGame.state == 2){
if(D_80391AE0.tile1_0 == NULL || D_80391AE0.tile2_4 == NULL){ if(matchingGame.tile_a == NULL || matchingGame.tile_b == NULL){
if(item_empty(ITEM_6_HOURGLASS)){ if(item_empty(ITEM_6_HOURGLASS)){
func_80390270(3); __matchingGame_setState(3);
} }
} }
} }

View File

@@ -6,26 +6,26 @@ extern void func_802C4218(s32, s32, s32, s32);
extern f32 func_80257204(f32, f32, f32, f32); extern f32 func_80257204(f32, f32, f32, f32);
extern ActorProp * func_80320EB0(ActorMarker *, f32, s32); extern ActorProp * func_80320EB0(ActorMarker *, f32, s32);
void func_80386FDC(Actor *this); void chClam_update(Actor *this);
/* .data */ /* .data */
ActorAnimationInfo D_8038C3B0[] = { ActorAnimationInfo chClamAnimations[] = {
{0x00, 0.0f}, {0x00, 0.0f},
{0xAA, 2.0f}, {0xAA, 2.0f},
{0x24, 1.0f}, {0x24, 1.0f},
{0xAB, 0.6f} {0xAB, 0.6f}
}; };
ActorInfo D_8038C3D0 = { ActorInfo chClam = {
MARKER_15_CLAM, ACTOR_69_CLAM, ASSET_351_MODEL_CLAM, MARKER_15_CLAM, ACTOR_69_CLAM, ASSET_351_MODEL_CLAM,
0x1, D_8038C3B0, 0x1, chClamAnimations,
func_80386FDC, func_80326224, func_80325888, chClam_update, func_80326224, func_80325888,
4500, 0x366, 1.6f, 0 4500, 0x366, 1.6f, 0
}; };
/* .code */ /* .code */
void TTC_func_803863F0(enum sfx_e sfx_id, f32 arg1, s32 arg2, f32 position[3], f32 arg4, f32 arg5){ void __chClam_func_803863F0(enum sfx_e sfx_id, f32 arg1, s32 arg2, f32 position[3], f32 arg4, f32 arg5){
if(func_803114B0()){ if(func_803114B0()){
arg2 -= 10000; arg2 -= 10000;
if(arg2 < 0) if(arg2 < 0)
@@ -34,49 +34,49 @@ void TTC_func_803863F0(enum sfx_e sfx_id, f32 arg1, s32 arg2, f32 position[3], f
func_8030E878(sfx_id, arg1, arg2, position, arg4, arg5); func_8030E878(sfx_id, arg1, arg2, position, arg4, arg5);
} }
void func_80386454(Actor *this){ void __chClam_func_80386454(Actor *this){
func_80328B8C(this, 1, 0.01f, 1); func_80328B8C(this, 1, 0.01f, 1);
actor_loopAnimation(this); actor_loopAnimation(this);
animctrl_setDuration(this->animctrl, randf2(1.9f, 2.1f)); animctrl_setDuration(this->animctrl, randf2(1.9f, 2.1f));
} }
bool TTC_func_803864B0(Actor *this, f32 arg1) { bool __chClam_updateTarget(Actor *this, f32 arg1) {
f32 sp5C; f32 egg_dist;
f32 sp58; f32 red_feather_dist;
f32 pad; f32 pad;
Actor *sp50; Actor *red_feather;
Actor *sp4C; Actor *egg;
f32 phi_f2; f32 phi_f2;
f32 sp3C[3]; f32 target_position[3];
s32 sp38; s32 sp38;
sp50 = actorArray_findClosestActorFromActorId(this->position, 0x52, -1, &sp5C); red_feather = actorArray_findClosestActorFromActorId(this->position, ACTOR_52_BLUE_EGG, -1, &egg_dist);
sp4C = actorArray_findClosestActorFromActorId(this->position, 0x129, -1, &sp58); egg = actorArray_findClosestActorFromActorId(this->position, ACTOR_129_RED_FEATHER, -1, &red_feather_dist);
sp38 = 0; sp38 = 0;
if( (sp58 < sp5C) if( (red_feather_dist < egg_dist)
&& (sp58 < 16000.0f) && (red_feather_dist < 16000.0f)
&& (sp4C != 0) && (egg != 0)
&& func_80307258(sp4C->position, this->unk10_25 - 1, this->unk10_18 - 1) != -1 && func_80307258(egg->position, this->unk10_25 - 1, this->unk10_18 - 1) != -1
) { ) {
sp3C[0] = sp4C->position[0]; target_position[0] = egg->position[0];
sp3C[1] = sp4C->position[1]; target_position[1] = egg->position[1];
sp3C[2] = sp4C->position[2]; target_position[2] = egg->position[2];
phi_f2 = sp58; phi_f2 = red_feather_dist;
} }
else if( else if(
(sp5C < sp58) (egg_dist < red_feather_dist)
&& (sp5C < 16000.0f) && (egg_dist < 16000.0f)
&& (sp50 != 0) && (red_feather != 0)
&& func_80307258(sp50->position, this->unk10_25 - 1, this->unk10_18 - 1) != -1 && func_80307258(red_feather->position, this->unk10_25 - 1, this->unk10_18 - 1) != -1
){ ){
sp3C[0] = sp50->position[0]; target_position[0] = red_feather->position[0];
sp3C[1] = sp50->position[1]; target_position[1] = red_feather->position[1];
sp3C[2] = sp50->position[2]; target_position[2] = red_feather->position[2];
phi_f2 = sp5C; phi_f2 = egg_dist;
} }
else if ((func_80329530(this, 0x4B0) != 0) && (func_803292E0(this) != 0)) { else if ((func_80329530(this, 1200) != 0) && (func_803292E0(this) != 0)) {
phi_f2 = gu_sqrtf((f32) func_8032970C(this)); phi_f2 = gu_sqrtf((f32) func_8032970C(this));
player_getPosition(sp3C); player_getPosition(target_position);
sp38 = 1; sp38 = 1;
} }
else{ else{
@@ -84,19 +84,19 @@ bool TTC_func_803864B0(Actor *this, f32 arg1) {
} }
this->unk28 = phi_f2 / arg1; this->unk28 = phi_f2 / arg1;
this->yaw_ideal = func_80257204(this->position[0], this->position[2], sp3C[0], sp3C[2]); this->yaw_ideal = func_80257204(this->position[0], this->position[2], target_position[0], target_position[2]);
if ((func_803203FC(UNKFLAGS1_C1_IN_FINAL_CHARACTER_PARADE) ? 0 : 0x11) < this->unk28) { if ((func_803203FC(UNKFLAGS1_C1_IN_FINAL_CHARACTER_PARADE) ? 0 : 0x11) < this->unk28) {
this->unk28 = (func_803203FC(UNKFLAGS1_C1_IN_FINAL_CHARACTER_PARADE) != 0) ? 0.0f : 17.0f; this->unk28 = (func_803203FC(UNKFLAGS1_C1_IN_FINAL_CHARACTER_PARADE) != 0) ? 0.0f : 17.0f;
} else if (sp38 == 0) { } else if (sp38 == 0) {
TTC_func_803863F0(SFX_AE_YUMYUM_TALKING, randf2(0.9f, 1.0f), 22000, this->position, 500.0f, 2000.0f); __chClam_func_803863F0(SFX_AE_YUMYUM_TALKING, randf2(0.9f, 1.0f), 22000, this->position, 500.0f, 2000.0f);
} }
return 1; return TRUE;
} }
bool func_80386760(Actor *this, s32 arg1) { bool __chClam_rotateTowardTarget(Actor *this, s32 arg1) {
f32 temp_f0_2; f32 temp_f0_2;
s32 sp24; s32 position;
s32 sp2C; s32 sp2C;
if(this->unk10_25 == 0) return FALSE; if(this->unk10_25 == 0) return FALSE;
@@ -104,7 +104,7 @@ bool func_80386760(Actor *this, s32 arg1) {
animctrl_setDuration(this->animctrl, 1.0f); animctrl_setDuration(this->animctrl, 1.0f);
sp2C = (s32) ((f64) (60.0f / (f32) func_8033DD90()) * 0.5); sp2C = (s32) ((f64) (60.0f / (f32) func_8033DD90()) * 0.5);
if ((this->unk1C[0] != 0.0f) || !TTC_func_803864B0(this, sp2C)) { if ((this->unk1C[0] != 0.0f) || !__chClam_updateTarget(this, sp2C)) {
if (((f64) animctrl_getAnimTimer(this->animctrl) < 0.1) && ((f64) randf() < 0.5)) { if (((f64) animctrl_getAnimTimer(this->animctrl) < 0.1) && ((f64) randf() < 0.5)) {
if (this->unk1C[0] != 0.0f) { if (this->unk1C[0] != 0.0f) {
arg1 *= 2; arg1 *= 2;
@@ -136,7 +136,7 @@ bool func_80386760(Actor *this, s32 arg1) {
} }
void func_80386A9C(ParticleEmitter *pCtrl, f32 position[3]){ void __chClam_particalEmitterInit(ParticleEmitter *pCtrl, f32 position[3]){
particleEmitter_setPosition(pCtrl, position); particleEmitter_setPosition(pCtrl, position);
func_802EF9F8(pCtrl, 0.7f); func_802EF9F8(pCtrl, 0.7f);
func_802EFA18(pCtrl, 3); func_802EFA18(pCtrl, 3);
@@ -148,7 +148,7 @@ void func_80386A9C(ParticleEmitter *pCtrl, f32 position[3]){
func_802EFA70(pCtrl, 2); func_802EFA70(pCtrl, 2);
} }
void TTC_func_80386B54(f32 position[3], s32 count){ void __chClam_emitLargeShellParticles(f32 position[3], s32 count){
static struct41s D_8038C3F4 = { static struct41s D_8038C3F4 = {
{{-50.0f, 750.0f, -50.0f}, {120.0f, 900.0f, 120.0f}}, {{-50.0f, 750.0f, -50.0f}, {120.0f, 900.0f, 120.0f}},
{{ 0.0f, -1800.0f, 0.0f}, { 0.0f, -1800.0f, 0.0f}} {{ 0.0f, -1800.0f, 0.0f}, { 0.0f, -1800.0f, 0.0f}}
@@ -156,15 +156,15 @@ void TTC_func_80386B54(f32 position[3], s32 count){
ParticleEmitter *pCtrl; ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count); pCtrl = partEmitList_pushNew(count);
func_80386A9C(pCtrl, position); __chClam_particalEmitterInit(pCtrl, position);
particleEmitter_setModel(pCtrl, 0x37c); particleEmitter_setModel(pCtrl, ASSET_37C_MODEL_CLAM_LARGE_SHELL_PIECE);
particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C3F4); particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C3F4);
func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f);
func_802EFB70(pCtrl, 1.0f, 1.0f); func_802EFB70(pCtrl, 1.0f, 1.0f);
particleEmitter_emitN(pCtrl, count); particleEmitter_emitN(pCtrl, count);
} }
void func_80386C08(f32 position[3], s32 count){ void __chClam_emitEyeParticles(f32 position[3], s32 count){
static struct41s D_8038C424 = { static struct41s D_8038C424 = {
{{-80.0f, 400.0f, -80.0f}, {160.0f, 860.0f, 160.0f}}, {{-80.0f, 400.0f, -80.0f}, {160.0f, 860.0f, 160.0f}},
{{ 0.0f, -1400.0f, 0.0f}, { 0.0f, -1400.0f, 0.0f}} {{ 0.0f, -1400.0f, 0.0f}, { 0.0f, -1400.0f, 0.0f}}
@@ -172,15 +172,15 @@ void func_80386C08(f32 position[3], s32 count){
ParticleEmitter *pCtrl; ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count); pCtrl = partEmitList_pushNew(count);
func_80386A9C(pCtrl, position); __chClam_particalEmitterInit(pCtrl, position);
particleEmitter_setModel(pCtrl, 0x37d); particleEmitter_setModel(pCtrl, ASSET_37D_MODEL_CLAM_EYE);
particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C424); particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C424);
func_802EFE24(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); func_802EFE24(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
func_802EFB70(pCtrl, 1.0f, 1.0f); func_802EFB70(pCtrl, 1.0f, 1.0f);
particleEmitter_emitN(pCtrl, count); particleEmitter_emitN(pCtrl, count);
} }
void func_80386CBC(f32 position[3], s32 count){ void __chClam_emitSmallShellParticles(f32 position[3], s32 count){
static struct41s D_8038C454 = { static struct41s D_8038C454 = {
{{-200.0f, 850.0f, -200.0f}, {400.0f, 1000.0f, 400.0f}}, {{-200.0f, 850.0f, -200.0f}, {400.0f, 1000.0f, 400.0f}},
{{ 0.0f, -1800.0f, 0.0f}, { 0.0f, -1800.0f, 0.0f}} {{ 0.0f, -1800.0f, 0.0f}, { 0.0f, -1800.0f, 0.0f}}
@@ -188,15 +188,15 @@ void func_80386CBC(f32 position[3], s32 count){
ParticleEmitter *pCtrl; ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count); pCtrl = partEmitList_pushNew(count);
func_80386A9C(pCtrl, position); __chClam_particalEmitterInit(pCtrl, position);
particleEmitter_setModel(pCtrl, 0x37E); particleEmitter_setModel(pCtrl, ASSET_37E_MODEL_CLAM_SMALL_SHELL_PIECE);
particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C454); particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C454);
func_802EFE24(pCtrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f); func_802EFE24(pCtrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f);
func_802EFB70(pCtrl, 0.5f, 0.8f); func_802EFB70(pCtrl, 0.5f, 0.8f);
particleEmitter_emitN(pCtrl, count); particleEmitter_emitN(pCtrl, count);
} }
void TTC_func_80386D68(f32 position[3], enum asset_e sprite_id, s32 count){ void __chClam_emitEatenCollectableParticles(f32 position[3], enum asset_e sprite_id, s32 count){
static struct31s D_8038C484 = { static struct31s D_8038C484 = {
{0.2f, 0.35f}, {0.2f, 0.35f},
{0.0f, 0.0f}, {0.0f, 0.0f},
@@ -221,31 +221,31 @@ void TTC_func_80386D68(f32 position[3], enum asset_e sprite_id, s32 count){
particleEmitter_emitN(pCtrl, count); particleEmitter_emitN(pCtrl, count);
} }
void func_80386DF4(ActorMarker *this_marker, ActorMarker *other_marker){ void __chClam_takeDamage(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this; Actor *this;
this = marker_getActor(this_marker); this = marker_getActor(this_marker);
this->marker->collidable = FALSE; this->marker->collidable = FALSE;
this->unk138_27 = TRUE; this->unk138_27 = TRUE;
TTC_func_803863F0(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 26000, this->position, 1500.0f, 2000.0f); __chClam_func_803863F0(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 26000, this->position, 1500.0f, 2000.0f);
TTC_func_803863F0(SFX_115_BUZZBOMB_DEATH, 1.2f, 26000, this->position, 1500.0f, 2000.0f); __chClam_func_803863F0(SFX_115_BUZZBOMB_DEATH, 1.2f, 26000, this->position, 1500.0f, 2000.0f);
TTC_func_80386B54(this->position, 2); __chClam_emitLargeShellParticles(this->position, 2);
func_80386C08(this->position, 2); __chClam_emitEyeParticles(this->position, 2);
func_80386CBC(this->position, 0xC); __chClam_emitSmallShellParticles(this->position, 0xC);
func_803115C4(0xa14); func_803115C4(0xa14);
marker_despawn(this->marker); marker_despawn(this->marker);
} }
void func_80386EDC(s32 this, enum item_e item_id){ void __chClam_playerDropsItem(s32 index, enum item_e item_id){
f32 sp24[3]; f32 position[3];
player_getPosition(sp24); player_getPosition(position);
func_802C8F70(randf2(0.0f, 359.0f)); func_802C8F70(randf2(0.0f, 359.0f));
__spawnQueue_add_4((GenMethod_4)func_802C4218, this, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); __spawnQueue_add_4((GenMethod_4)func_802C4218, index, reinterpret_cast(s32, position[0]), reinterpret_cast(s32, position[1]), reinterpret_cast(s32, position[2]));
item_dec(item_id); item_dec(item_id);
} }
void func_80386F44(ActorMarker *this_marker, ActorMarker *other_marker){ void __chClam_attackOther(ActorMarker *this_marker, ActorMarker *other_marker){
if(func_80297C6C() == 3) return; if(func_80297C6C() == 3) return;
@@ -254,13 +254,13 @@ void func_80386F44(ActorMarker *this_marker, ActorMarker *other_marker){
} }
if(item_getCount(ITEM_D_EGGS) != 0) if(item_getCount(ITEM_D_EGGS) != 0)
func_80386EDC(0xe, ITEM_D_EGGS); __chClam_playerDropsItem(0xe, ITEM_D_EGGS);
if(item_getCount(ITEM_F_RED_FEATHER) != 0) if(item_getCount(ITEM_F_RED_FEATHER) != 0)
func_80386EDC(0xf, ITEM_F_RED_FEATHER); __chClam_playerDropsItem(0xf, ITEM_F_RED_FEATHER);
} }
void func_80386FDC(Actor *this){ void chClam_update(Actor *this){
ActorProp *sp4C = func_80320EB0(this->marker, 30.0f, 1); ActorProp *sp4C = func_80320EB0(this->marker, 30.0f, 1);
f32 sp48; f32 sp48;
s32 sp44; s32 sp44;
@@ -273,7 +273,7 @@ void func_80386FDC(Actor *this){
if(!this->unk16C_4){ if(!this->unk16C_4){
this->unk16C_4 = TRUE; this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, NULL, func_80386F44, func_80386DF4); marker_setCollisionScripts(this->marker, NULL, __chClam_attackOther, __chClam_takeDamage);
} }
if(this->state != 3){ if(this->state != 3){
@@ -297,11 +297,11 @@ void func_80386FDC(Actor *this){
switch(this->state){ switch(this->state){
case 1://L80387170 case 1://L80387170
if(func_80386760(this, 140)){ if(__chClam_rotateTowardTarget(this, 140)){
func_80328B8C(this, 2, 0.01f, 1); func_80328B8C(this, 2, 0.01f, 1);
actor_playAnimationOnce(this); actor_playAnimationOnce(this);
animctrl_setDuration(this->animctrl, 1.0f); animctrl_setDuration(this->animctrl, 1.0f);
TTC_func_803863F0(SFX_3F2_UNKNOWN, randf2(1.0f, 1.1f), 22000, this->position, 1500.0f, 2000.0f); __chClam_func_803863F0(SFX_3F2_UNKNOWN, randf2(1.0f, 1.1f), 22000, this->position, 1500.0f, 2000.0f);
} }
else{ else{
animctrl_setDuration(this->animctrl, 2.0f); animctrl_setDuration(this->animctrl, 2.0f);
@@ -312,13 +312,13 @@ void func_80386FDC(Actor *this){
this->position_y += this->velocity_y; this->position_y += this->velocity_y;
this->velocity_y += -5.0f; this->velocity_y += -5.0f;
if(actor_animationIsAt(this, 0.63f)){ if(actor_animationIsAt(this, 0.63f)){
TTC_func_803863F0(SFX_80_YUMYUM_CLACK, 1.0f, 20000, this->position, 1500.0f, 2000.0f); __chClam_func_803863F0(SFX_80_YUMYUM_CLACK, 1.0f, 20000, this->position, 1500.0f, 2000.0f);
} }
if(this->position_y <= sp48){ if(this->position_y <= sp48){
this->position_y = sp48; this->position_y = sp48;
if(actor_animationIsAt(this, 0.99f) || 0.98 < animctrl_getAnimTimer(this->animctrl)){ if(actor_animationIsAt(this, 0.99f) || 0.98 < animctrl_getAnimTimer(this->animctrl)){
func_80386454(this); __chClam_func_80386454(this);
} }
} }
else{//L803872D4 else{//L803872D4
@@ -334,12 +334,12 @@ void func_80386FDC(Actor *this){
} }
if(3.0f <= this->velocity_x){ if(3.0f <= this->velocity_x){
func_80386454(this); __chClam_func_80386454(this);
break; break;
} }
if(actor_animationIsAt(this, 0.8f) && 2.0f == this->velocity_x){ if(actor_animationIsAt(this, 0.8f) && 2.0f == this->velocity_x){
TTC_func_803863F0(SFX_4B_GULPING, randf2(0.8f, 0.9f), 22000, this->position, 700.0f, 2000.0f); __chClam_func_803863F0(SFX_4B_GULPING, randf2(0.8f, 0.9f), 22000, this->position, 700.0f, 2000.0f);
break; break;
}//L803873C4 }//L803873C4
@@ -347,15 +347,15 @@ void func_80386FDC(Actor *this){
if(!this->marker->unk14_21) break; if(!this->marker->unk14_21) break;
TTC_func_803863F0(SFX_4C_LIP_SMACK, 1.0f, 20000, this->position, 500.0f, 2000.0f); __chClam_func_803863F0(SFX_4C_LIP_SMACK, 1.0f, 20000, this->position, 500.0f, 2000.0f);
func_8034A174(this->marker->unk44, 5, sp38); func_8034A174(this->marker->unk44, 5, sp38);
switch(this->unk38_31){ switch(this->unk38_31){
case 0x60: case MARKER_60_BLUE_EGG_COLLECTABLE:
TTC_func_80386D68(sp38, ASSET_718_SPRITE_SPARKLE_WHITE_2, 8); __chClam_emitEatenCollectableParticles(sp38, ASSET_718_SPRITE_SPARKLE_WHITE_2, 8);
break; break;
case 0xb5: case MARKER_B5_RED_FEATHER_COLLECTABLE:
TTC_func_80386D68(sp38, ASSET_715_SPRITE_SPARKLE_RED, 8); __chClam_emitEatenCollectableParticles(sp38, ASSET_715_SPRITE_SPARKLE_RED, 8);
break; break;
} }
break; break;

View File

@@ -4,7 +4,7 @@
#include "prop.h" #include "prop.h"
#include "SnS.h" #include "SnS.h"
extern ActorInfo D_8038C3D0; extern ActorInfo chClam;
extern ActorInfo TTC_D_8038C510; extern ActorInfo TTC_D_8038C510;
extern ActorInfo D_8038C580; extern ActorInfo D_8038C580;
extern ActorInfo D_8038C5E0; extern ActorInfo D_8038C5E0;
@@ -108,7 +108,7 @@ void TTC_func_80388AC0(void)
spawnableActorList_add(&D_8038C694, actor_new, 0X400); spawnableActorList_add(&D_8038C694, actor_new, 0X400);
spawnableActorList_add(&D_8038C6B8, actor_new, 0X400); spawnableActorList_add(&D_8038C6B8, actor_new, 0X400);
spawnableActorList_add(&D_8038C6DC, actor_new, 0X400); spawnableActorList_add(&D_8038C6DC, actor_new, 0X400);
spawnableActorList_add(&D_8038C3D0, actor_new, 0X2000041); spawnableActorList_add(&chClam, actor_new, 0X2000041);
} }
void TTC_func_80388C78(Actor *this){ void TTC_func_80388C78(Actor *this){

View File

@@ -185,21 +185,21 @@ void __overlay_gv_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; }
void func_80322A94(void){ void func_80322A94(void){
func_8038FF60(); func_8038FF60();
func_803900F8(); func_803900F8();
func_803903EC(); //gv_matchingGame_reset gv_matchingGame_reset(); //gv_matchingGame_reset
func_803909EC(); func_803909EC();
} }
void func_80322ACC(void){ void func_80322ACC(void){
func_8038FF68(); func_8038FF68();
func_80390100(); func_80390100();
func_8039040C(); //gv_matchingGame_init gv_matchingGame_init(); //gv_matchingGame_init
func_803909F4(); func_803909F4();
} }
void __overlay_gv_update(void){ void __overlay_gv_update(void){
func_8038FFF4(); func_8038FFF4();
func_80390138(); func_80390138();
func_803904A8(); //gv_matchingGame_update gv_matchingGame_update(); //gv_matchingGame_update
func_80390A94(); func_80390A94();
} }