label TTC actors

This commit is contained in:
Banjo Kazooie
2023-01-31 13:47:47 -06:00
parent 0be5904e28
commit e05358d82f
36 changed files with 208 additions and 179 deletions

253
src/TTC/ch/blubber.c Normal file
View File

@@ -0,0 +1,253 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028E668(f32[3], f32, f32, f32);
extern void func_8028FA34(s32, Actor*);
extern s32 func_802E0970(s32, f32, f32, f32, s32, s32, f32[3]);
typedef struct {
u8 unk0[0xE];
s16 unkE;
f32 throw_target_position[3];
s32 throw_target_radius;
NodeProp* unk20;
s32 unk24;
}ActorLocal_Blubber;
void func_803878CC(Actor *this);
void TTC_func_80387CF4(Actor *this);
Actor *func_80387D6C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_8038C4E0[] = {
{0x00, 0.0f},
{0xB5, 2.0f},
{0xB6, 2.0f},
{0xB6, 2.0f},
{0xB7, 1.4f},
{0xB8, 0.8f}
};
ActorInfo TTC_D_8038C510 = {
MARKER_A3_BLUBBER, ACTOR_115_BLUBBER, ASSET_370_MODEL_BLUBBER,
0x1, D_8038C4E0,
func_803878CC, TTC_func_80387CF4, func_80387D6C,
0, 0x399, 1.8f, 0
};
/* .code */
void func_80387490(Actor *this){
ActorLocal_Blubber *local = (ActorLocal_Blubber *)&this->local;
animctrl_setTransitionDuration(this->animctrl, 0.2f);
this->initialized = TRUE;
local->unk20 = func_80304C38(ACTOR_2B_GOLD_BULLION_THROW_TARGET, this);
if(local->unk20){
nodeprop_getPosition(local->unk20, local->throw_target_position);
local->throw_target_radius = nodeprop_getRadius(local->unk20);
}
local->unk24 = 4;
func_8032A82C(this, 0x14C);
}
void func_80387520(ActorMarker *caller, enum asset_e text_id, s32 arg1){
Actor *this = marker_getActor(caller);
ActorLocal_Blubber *local = (ActorLocal_Blubber*)&this->local;
if(text_id == 0xa0d || text_id == 0xa2a){
local->unk24 = 0;
}
else{
func_80328B8C(this, 2, 0, 1);
}
}
void func_80387574(ActorMarker *caller, enum asset_e text_id, s32 arg1){
f32 sp24[3];
if(nodeProp_findPositionFromActorId(0x14b, sp24)){
jiggySpawn(JIGGY_14_TTC_BLUBBER, sp24);
__spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2]));
}
}
void func_803875D4(ActorMarker *marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, marker));
enum asset_e text_id;
func_80328A84(this, 4);
actor_loopAnimation(this);
this->unk28 = 0.0f;
if(!mapSpecificFlags_get(2)) {
text_id = jiggyscore_isCollected(JIGGY_14_TTC_BLUBBER) ? 0xa2a : 0xa0d;
func_80311480( text_id, 0xf, this->position, this->marker, func_80387520, func_80387574);
mapSpecificFlags_set(2, TRUE);
}
}
void func_80387678(Actor *this){
if( !mapSpecificFlags_get(1) ) return;
if( mapSpecificFlags_get(3) ) return;
this->yaw_ideal = (f32) func_80329784(this);
mapSpecificFlags_set(3, TRUE);
func_8028F918(2);
timed_setCameraToNode(0.0f, 4);
timedFunc_set_1(1.0f, (GenMethod_1)func_803875D4, (s32)this->marker);
func_80328B8C(this, 1, 0.0f, 1);
}
void func_8038771C(Actor *this){
if( !func_80329030(this, 0)
&& func_80329480(this)
){
func_80328CEC(this, (s32)this->yaw_ideal, 120, 180);
}
}
void func_80387774(Actor **this_ptr){
ActorLocal_Blubber *local = (ActorLocal_Blubber *)&(*this_ptr)->local;
func_8028F364(local->throw_target_position, local->throw_target_radius, 100.0f, ACTOR_2A_GOLD_BULLION, this_ptr);
if( func_80329530(*this_ptr, 200)
&& carriedObj_getMarkerId() == MARKER_37_GOLD_BULLION
&& func_8028FC34()
){
func_8028FA34(!mapSpecificFlags_get(0)? 0x149 : 0x14a, *this_ptr);
(*this_ptr)->unk138_24 = TRUE;
}
}
void func_80387830(Actor *this , f32 arg1, f32 arg2){
if( actor_animationIsAt(this, arg1)
|| actor_animationIsAt(this, arg2)
){
this->unk10_12 = func_802E0970(0x26, 0.75f, 0.85f, 0.05f, 11000, this->unk10_12, this->position);
}
}
void func_803878CC(Actor * this){
ActorLocal_Blubber *local;
this->marker->propPtr->unk8_3 = TRUE;
func_8028E668(this->position, 90.0f, -10.0f, 110.0f);
if(!mapSpecificFlags_get(1) && !func_80329530(this, 2500))
return;
if(!this->unk16C_4){
if(this->state == 3){
func_80328B8C(this, 2, 0.0f, 1);
}
this->unk16C_4 = TRUE;
}//L80387970
if(func_80329530(this, 250) && !func_80329530(this, 80)
&& !this->unk138_24
&& item_getCount(ITEM_18_GOLD_BULLIONS) == 0
){
func_80311480(0xa0b, 0xe, this->position, this->marker, func_80387520, NULL);
this->unk138_24 = TRUE;
func_80328AC8(this, 3);
}
if( mapSpecificFlags_get(0)
&& !this->unk138_23
){
if(item_getCount(ITEM_18_GOLD_BULLIONS) == 0)
func_80311480(0xa0c, 4, NULL, NULL, NULL, NULL);
this->unk138_23 = TRUE;
this->unk138_24 = TRUE;
}//L80387A54
switch(this->state){//D_8038CD40
case 1:// 80387A84
if(!this->initialized){
actor_collisionOff(this);
func_80387490(this);
}
func_80387774(&this);
if(func_80328BD4(this, 2, 0.0f, 1, 0.007f))
break;
func_80328FB0(this, 3.0f);
func_8038771C(this);
func_80387830(this, 0.14f, 0.68f);
func_80387678(this);
break;
case 2:// 80387B10
func_80387774(&this);
if( actor_animationIsAt(this, 0.99f)
&& func_80328BD4(this, 1, 0.0f, 1, 0.78f)
){
this->unk28 = 4.0f;
break;
}
if(actor_animationIsAt(this, 0.3f)){
FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.95f, 17000, this->position, 1250, 2500);
}
if(actor_animationIsAt(this, 0.53f)){
FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.93f, 17000, this->position, 1250, 2500);
}
if(actor_animationIsAt(this, 0.72f)){
FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.91f, 17000, this->position, 1250, 2500);
}
func_80387678(this);
break;
case 3:
break;
case 4:// 80387C04
{
func_80328FB0(this, 3.0f);
local = (ActorLocal_Blubber*)&this->local;
if(actor_animationIsAt(this, 0.99f) && !local->unk24){
func_80328A84(this, 5);
this->unk28 = 8.0f;
}
}
if(actor_animationIsAt(this, 0.3f) && !func_803114B0()){
FUNC_8030E624(SFX_8C_BOGGY_WAHEY, 1.0f, 27000);
}
if(actor_animationIsAt(this, 0.28f) ||
(actor_animationIsAt(this, 0.78f) && !func_803114B0())
){
FUNC_8030E624(SFX_80_YUMYUM_CLACK, 0.9f, 13000);
}
break;
case 5:// 80387CD4
local = (ActorLocal_Blubber*)&this->local;
func_8032A95C(this, local->unkE, 0x21c);
break;
}
}
void TTC_func_80387CF4(Actor *this){
func_80343DEC(this);
if(0.99 <= this->unk48){
func_8028F918(0);
func_80324E88(0.0f);
marker_despawn(this->marker);
}
func_80387830(this, 0.5f, 0.97f);
}
Actor *func_80387D6C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
func_8033A45C(4, 0);
return func_80325888(marker, gfx, mtx, vtx);
}

116
src/TTC/ch/leaky.c Normal file
View File

@@ -0,0 +1,116 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028E668(f32 [3], f32, f32, f32);
extern void func_8028F9DC(s32);
extern void func_803272D0(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *));
void chLeaky_update(Actor *this);
/* .data */
ActorAnimationInfo D_8038C700[] = {
{0x000, 0.0f},
{0x239, 2.5f},
{0x239, 2.5f}
};
ActorInfo D_8038C718 = {
MARKER_33_LEAKY, ACTOR_1E_LEAKY, ASSET_51A_MODEL_LEAKY,
0x1, D_8038C700,
chLeaky_update, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
/* .code */
bool TTC_func_80388F70(Actor *this){
return this->modelCacheIndex == ACTOR_56_SHRAPNEL;
}
void func_80388F88(void){
static f32 D_8038C73C[3] = {2500.0f, 250.0f, 4600.0f};
func_803272D0(D_8038C73C, 2000.0f, 2, TTC_func_80388F70);
}
void chLeaky_update(Actor *this) {
void *temp_v0_2;
func_8028E668(this->position, 100.0f, -20.0f, 100.0f);
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = FALSE;
if (levelSpecificFlags_get(5) != 0) {
levelSpecificFlags_set(5, 0);
timedFunc_set_1(0.5f, (GenMethod_1)func_8025A70C, COMUSIC_2D_PUZZLE_SOLVED_FANFARE);
}
if (levelSpecificFlags_get(2) != 0) {
temp_v0_2 = func_8034C5AC(300);
if (temp_v0_2 != 0) {
func_8034E71C(temp_v0_2, -600, 0.0f);
}
this->state = 2;
} else {
this->state = 1;
}
}
if( this->state == 1
&& !this->unk138_24
&& func_80329530(this, 250) && !func_80329530(this, 160)
&& !func_8028ECAC()
&& func_80311480(0xA1A, 0, NULL, NULL, NULL, NULL)
){
this->unk138_24 = TRUE;
}
if (func_803114B0() == 0) {
if (actor_animationIsAt(this, 0.83f)) {
func_8030E878(0x109, randf2(0.775f, 0.825f), 22000, this->position, 400.0f, 1000.0f);
return;
}
if (actor_animationIsAt(this, 0.01f)) {
func_8030E878(0x109, randf2(1.025f, 1.075f), 18000, this->position, 400.0f, 1000.0f);
return;
}
if( actor_animationIsAt(this, 0.15f)
|| actor_animationIsAt(this, 0.34f)
|| actor_animationIsAt(this, 0.53f)
|| actor_animationIsAt(this, 0.66f)
){
func_8030E878(0x109, randf2(1.225f, 1.275f), 14000, this->position, 400.0f, 1000.0f);
}
}
}
void __chLeaky_startCutscene(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
Struct73s *temp_v0;
func_80328A84(this, 2);
temp_v0 = func_8034C5AC(300);
if(temp_v0 != NULL){
func_8034E7B8(temp_v0, -600, 4.0f, 2, 10.0f);
}
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.5f, 7);
timedFunc_set_0(1.0f, func_80388F88);
func_80324E38(2.5f, 0);
timedFunc_set_1(2.5f, func_8028F9DC, 2);
timedFunc_set_3(2.5f, (GenMethod_3)func_802E4078, MAP_A_TTC_SANDCASTLE, 0, 0);
func_803228D8();
}
bool chLeaky_eggCollision(ActorMarker *marker){
Actor *this = marker_getActor(marker);
if(levelSpecificFlags_get(2))
return TRUE;
func_8025A70C(COMUSIC_2B_DING_B);
this->unk38_31++;
if(this->unk38_31 < 2)
return TRUE;
levelSpecificFlags_set(2, TRUE);
levelSpecificFlags_set(5, TRUE);
func_80311480(ASSET_A28_TEXT_LEAKY_DONE, 0x2a, this->position, this->marker, __chLeaky_startCutscene, NULL);
return TRUE;
}

346
src/TTC/ch/nipper.c Normal file
View File

@@ -0,0 +1,346 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_80388434(Actor *this);
Actor *func_80387EB0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_8038C540[] = {
{0x00, 0.0f},
{0xC0, 2.0f},
{0xBD, 1.5f},
{0xBF, 1.2f},
{0xBE, 1.3f},
{0xC0, 2.0f},
{0x133, 3.0f},
{0x00, 0.0f}
};
ActorInfo D_8038C580 = {
MARKER_A5_NIPPER, ACTOR_117_NIPPER, ASSET_3D5_MODEL_NIPPER,
0x1, D_8038C540,
func_80388434, func_80326224, func_80387EB0,
0, 0x299, 10.0f, 0
};
/* .code */
void func_80387DC0(f32 *position, s32 count) {
static s32 D_8038C5A4[3] = {180, 180, 180};
static struct31s D_8038C5B0 = {
{0.1f, 0.5f},
{1.4f, 2.8f},
{0.0f, 0.01f},
{0.5f, 1.4f},
0.0f, 0.01f
};
ParticleEmitter *pCtrl;
pCtrl = partEmitMgr_newEmitter(count);
pCtrl = pCtrl;
particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST);
particleEmitter_setRGB(pCtrl, D_8038C5A4);
particleEmitter_setStartingFrameRange(pCtrl, 0, 7);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-10.0f, -5.0f, -10.0f,
10.0f, 10.0f, 10.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-40.0f, 10.0f, -40.0f,
40.0f, 40.0f, 40.0f
);
func_802EFB98(pCtrl, &D_8038C5B0);
particleEmitter_emitN(pCtrl, count);
}
Actor *func_80387EB0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Actor *this;
this = marker_getActor(marker);
func_8033A45C(3, (this->state == 7)? 0 : 1);
return func_80325888(marker, gfx, mtx, vtx);
}
void TTC_func_80387F18(Actor *this) {
func_80328AEC(this, 3);
this->unk1C[0] = 0.0f;
switch((s32)this->unk60){
case 0x78:
animctrl_setDuration(this->animctrl, 1.2f);
break;
case 0x50:
animctrl_setDuration(this->animctrl, 1.05f);
break;
case 0x28:
animctrl_setDuration(this->animctrl, 0.9f);
break;
}
}
void TTC_func_80387FB0(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this;
this = marker_getActor(caller);
TTC_func_80387F18(this);
func_802BAE4C();
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, -1, 300);
}
void TTC_func_80387FF4(Actor *this) {
s32 i;
func_80328B8C(this, 4, 0.01f, 1);
actor_playAnimationOnce(this);
for(i = 0; i < 3; i ++){
FUNC_8030E8B4(SFX_79_TICKER_DEATH, 0.5f, 17000, this->position, 1500, 3000);
};
}
bool func_80388088(Actor *this){
f32 sp2C;
f32 sp20[3];
bool out;
sp2C = this->yaw - func_80329784(this);
player_getPosition(sp20);
if(sp20[0] < -5680.0f){
return FALSE;
}
return (-35.0f < sp2C && sp2C < 35.0f) ? TRUE : FALSE;
}
bool func_8038812C(Actor *this){
return (func_80329530(this, 1300) && func_80388088(this)) ? TRUE : FALSE;
}
void func_80388178(ActorMarker *this_marker, ActorMarker *other_marker) {
Actor *this;
s32 i;
this = marker_getActor(this_marker);
func_8032B4DC(this, other_marker, 7);
if (this->unk60 == 40.0f) {
func_80328B8C(this, 6, 0.01f, 1);
actor_playAnimationOnce(this);
for(i = 0; i < 3; i++){
FUNC_8030E8B4(SFX_78_EAGLECRY, 0.7f, 20000, this->position, 1500, 3000);
};
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 0, 300);
func_8025AABC(0x12);
func_8032BB88(this, -1, 300);
func_802BAFE4(0x1C);
return;
}
if (this->unk60 == 80.0f) {
TTC_func_80387FF4(this);
this->unk60 = 40.0f;
return;
}
TTC_func_80387FF4(this);
this->unk60 = 80.0f;
func_80311480(0xA10, 4, NULL, NULL, NULL, NULL);
return;
}
bool func_803882E4(ActorMarker * this_marker, ActorMarker * other_marker){
if(this_marker->unk40_31 == 1){
this_marker->unk14_20 = 0x16C;
}
else{
this_marker->unk14_20 = MARKER_A5_NIPPER;
}
return TRUE;
}
void func_80388344(ActorMarker * this_marker, ActorMarker *other_marker){
Actor *this;
if(other_marker->unk14_20 == 1){
this = marker_getActor(this_marker);
if( !mapSpecificFlags_get(7)
&& this->unk138_24
&& func_80311480(0xa0f, 0, NULL, NULL, NULL, NULL)
){
mapSpecificFlags_set(7, TRUE);
}
}
}
void func_803883C8(ActorMarker * this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if( !this->unk138_23
&& this->unk138_24
&& func_80311480(0xa11, 0, NULL, NULL, NULL, NULL)
){
this->unk138_23 = TRUE;
}
}
void func_80388434(Actor *this){
f32 sp4C[3];
s32 sp48;
s32 sp44;
f32 sp38[3];
s32 temp_v0;
player_getPosition(sp38);
sp44 = func_80309D58(sp38, 1);
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->velocity_x = sp44;
func_8032BC18(this);
}
if(this->state != 7){
// sp30 = sp44;
if(0.0f == this->velocity_x && sp44){
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, -1, 5000);
func_8032BB88(this, 0, 4000);
func_8024BD08(0);
}
else if(!sp44 && 0.0f != this->velocity_x){
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 0, 300);
func_8025AABC(COMUSIC_12_TTC_NIPPER);
func_8032BB88(this, -1, 300);
func_8024BD08(1);
}
this->velocity_x = sp44;
}//L80388554
switch(this->state){
case 1:// L80388578
if(!this->initialized){
animctrl_setTransitionDuration(this->animctrl, 0.35f);
func_80328B8C(this, 1, 0.01f, 1);
this->unk60 = 120.0f;
this->marker->propPtr->unk8_3 = TRUE;
marker_setCollisionScripts(this->marker, func_803883C8, func_80388344, func_80388178);
func_803300C0(this->marker, func_803882E4);
this->initialized = TRUE;
}//L8038860C
if(func_8038812C(this)){
temp_v0 = func_8028ECAC();
if( !this->unk138_24
&& temp_v0 != 1
&& temp_v0 != 10
){
func_80328B8C(this, 5, 0.01f, 1);
if(func_80311480(0xa0e, 0xf, this->position, this->marker, TTC_func_80387FB0, NULL)){
this->unk138_24 = TRUE;
}
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 5000, 300);
set_camera_to_node(11);
}
else{//L803886B0
TTC_func_80387F18(this);
}
break;
}
//L803886C0
if( actor_animationIsAt(this, 0.2f)
|| actor_animationIsAt(this, 0.2f)
|| actor_animationIsAt(this, 0.6f)
|| actor_animationIsAt(this, 0.7f)
){
FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 0x5dc, 0xbb8);
}
break;
case 2:// L8038872C
if(!func_8038812C(this)){
func_80328AEC(this, 1);
break;
}
if(this->unk60 <= this->unk38_31){
TTC_func_80387F18(this);
break;
}
this->unk38_31++;
break;
case 3:// L803887B4
if(actor_animationIsAt(this, 0.5f) && this->marker->unk14_21){
func_8034A174(this->marker->unk44, 6, sp4C);
func_80387DC0(sp4C, 2);
}
else if(actor_animationIsAt(this, 0.95f) && this->marker->unk14_21){//L80388800
func_8034A174(this->marker->unk44, 5, sp4C);
func_80387DC0(sp4C, 2);
}//L80388848
if(actor_animationIsAt(this, 0.99f)){
this->unk1C[0] += 1.0f;
}
if(2.0f <= this->unk1C[0]){
func_80328AEC(this, 2);
this->unk38_31 = 0;
break;
}
if( actor_animationIsAt(this, 0.5f)
|| actor_animationIsAt(this, 0.95f)
){
for(sp48 = 0; sp48 < 3; sp48++){
FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 1500, 3000);
}
}
break;
case 4:// L80388910
if(actor_animationIsAt(this, 0.99f)){
TTC_func_80387F18(this);
}
break;
case 5:// L80388938
if( actor_animationIsAt(this, 0.2f)
|| actor_animationIsAt(this, 0.2f)
|| actor_animationIsAt(this, 0.6f)
|| actor_animationIsAt(this, 0.7f)
){
FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 0x5dc, 0xbb8);
}
break;
case 6:// L803889A8
this->marker->collidable = FALSE;
if(actor_animationIsAt(this, 0.6f)){
FUNC_8030E8B4(SFX_7C_CHEBOOF, 0.9f, 20000, this->position, 1500, 3000);
break;
}
if(actor_animationIsAt(this, 0.99f)){
func_80328B8C(this, 7, 0.01f, 1);
}
break;
case 7:// L80388A20
this->marker->collidable = FALSE;
break;
}//L80388A30
}
bool func_80388A44(s16 arg0[3]){
f32 sp1C[3];
Actor *nipper;
sp1C[0] = (f32) arg0[0];
sp1C[1] = (f32) arg0[1];
sp1C[2] = (f32) arg0[2];
nipper = actorArray_findClosestActorFromActorId(sp1C, ACTOR_117_NIPPER, -1, NULL);
return nipper->state == 7;
}

245
src/TTC/ch/treasurehunt.c Normal file
View File

@@ -0,0 +1,245 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern f32 func_80309724(f32[3]);
extern void func_8028F45C(s32, f32[3]);
typedef struct {
s32 unk0;
}ActorLocal_TreasureHunt;
void TTC_func_80389E90(Actor *this);
Actor *func_8038A0D0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
extern u32 D_8037DCB4;
/* .data */
f32 D_8038C820[6][3] = {
{2904.0f, 2458.0f, -7351.0f},
{-7007.0f, 2013.0f, 401.0f},
{-3388.0f, 1519.0f, 5939.0f},
{1399.0f, 1519.0f, 6126.0f},
{5953.0f, 1819.0f, 56.0f},
{7667.0f, 717.0f, 1676.0f}
};
f32 D_8038C868[6] = { 300.0f, 180.0f, 220.0f, 270.0f, 330.0f, 255.0f};
s32 D_8038C880[6] = {0x6E, 0xD2, 0x10E, 0x145, 0x14A, 0};
s32 D_8038C898[6] = {
ACTOR_53_RED_ARROW,
ACTOR_53_RED_ARROW,
ACTOR_53_RED_ARROW,
ACTOR_53_RED_ARROW,
ACTOR_54_RED_QUESTION_MARK,
0x46
}; //enum actor_e
ActorInfo D_8038C8B0 = {
MARKER_62_RED_ARROW, ACTOR_53_RED_ARROW, ASSET_3E9_MODEL_RED_ARROW,
0, NULL,
TTC_func_80389E90, func_80326224, func_8038A0D0,
0, 0x400, 0.0f, 0
};
ActorInfo D_8038C8D4 = {
MARKER_63_RED_QUESTION_MARK, ACTOR_54_RED_QUESTION_MARK, ASSET_3EB_MODEL_RED_QUESTION_MARK,
0, NULL,
TTC_func_80389E90, func_80326224, func_8038A0D0,
0, 0x400, 0.0f, 0
};
ActorInfo D_8038C8F8 = {
MARKER_64_RED_X, ACTOR_55_RED_X, ASSET_3EA_MODEL_RED_X,
0, NULL,
TTC_func_80389E90, func_80326224, func_8038A0D0,
0, 0x400, 0.0f, 0
};
s32 D_8038C91C[3] = {160, 120, 20};
struct31s D_8038C928 = {
{1.1f, 1.5f},
{4.0f, 4.6f},
{0.0f, 0.01f},
{0.5f, 1.0f},
0.0f, 0.01f
};
struct42s D_8038C950 = {
{{-230.0f, 30.0f, -230.0f}, {230.0f, 110.0f, 230.0f}},
{{-60.0f, 0.0f, -60.0f}, {60.0f, 30.0f, 60.0f}},
};
/* .code */
bool TTC_func_803899C0(void) {
enum comusic_e phi_a0;
s32 phi_a1;
if (player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER) {
phi_a0 = COMUSIC_2B_DING_B;
phi_a1 = 28000;
if (D_8037DCB4 == 5) {
phi_a0 = COMUSIC_2D_PUZZLE_SOLVED_FANFARE;
phi_a1 = 0x7FFF;
}
func_8025A6EC(phi_a0, phi_a1);
return TRUE;
}
return FALSE;
}
void func_80389A1C(void) {
Actor *actor;
ActorLocal_TreasureHunt *local;
actor = func_8032813C(0x55, D_8038C820[D_8037DCB4], 0);
local = (ActorLocal_TreasureHunt *)&actor->local;
actor->yaw = D_8038C868[D_8037DCB4];
local->unk0 = D_8037DCB4;
actor->unk60 = 0.0f;
actor->state = 0;
}
void func_80389A9C(void) {
Actor *actor;
ActorLocal_TreasureHunt *local;
s32 actor_id;
actor = func_8032813C((D_8038C898 - 1)[D_8037DCB4], D_8038C820[D_8037DCB4 - 1], 0);
local = (ActorLocal_TreasureHunt *)&actor->local;
actor->yaw = D_8038C880[D_8037DCB4 - 1];
local->unk0 = D_8037DCB4;
actor->unk60 = 0.0f;
actor->state = 0;
}
void func_80389B38(s32 arg0){
if(D_8037DCB4 == arg0 && TTC_func_803899C0()){
if(arg0 == 0 && !jiggyscore_isCollected(JIGGY_11_TTC_RED_X)){
func_80311480(0xA18, 4, NULL, NULL, NULL, NULL);
}
else if(arg0 == 4){
func_80311480(0xA19, 4, NULL, NULL, NULL, NULL);
}
D_8037DCB4++;
__spawnQueue_add_0(func_80389A9C);
__spawnQueue_add_0(func_80389A1C);
}
}
void TTC_func_80389BFC(ActorMarker *this, ActorMarker *arg1){\
func_80389B38(0);
}
void func_80389C24(ActorMarker *this, ActorMarker *arg1){\
func_80389B38(1);
}
void func_80389C4C(ActorMarker *this, ActorMarker *arg1){\
func_80389B38(2);
}
void func_80389C74(ActorMarker *this, ActorMarker *arg1){\
func_80389B38(3);
}
void func_80389C9C(ActorMarker *this, ActorMarker *arg1){\
func_80389B38(4);
}
void func_80389CC4(s16 arg0[3], s32 arg1){
static ParticleEmitter *D_8038D700;
static f32 D_8038D708[3];
if(D_8037DCB4 == 5 && TTC_func_803899C0()){
D_8038D708[0] = (f32)arg0[0];
D_8038D708[1] = (f32)arg0[1];
D_8038D708[2] = (f32)arg0[2];
D_8038D708[1] = func_80309724(D_8038D708);
__spawnQueue_add_4((GenMethod_4)func_802C4140, 0xF4, reinterpret_cast(s32, D_8038D708[0]), reinterpret_cast(s32, D_8038D708[1]), reinterpret_cast(s32, D_8038D708[2]));
D_8038D700 = partEmitMgr_newEmitter(3);
particleEmitter_setRGB(D_8038D700, D_8038C91C);
particleEmitter_setSprite(D_8038D700, ASSET_700_SPRITE_DUST);
particleEmitter_setStartingFrameRange(D_8038D700, 0, 7);
particleEmitter_setPosition(D_8038D700, D_8038D708);
particleEmitter_setPositionAndVelocityRanges(D_8038D700, &D_8038C950);
func_802EFB98(D_8038D700, &D_8038C928);
particleEmitter_emitN(D_8038D700, 5);
D_8038D708[2] += 300.0f;
gcpausemenu_80314AC8(0);
timedFunc_set_2(0.1f, (GenMethod_2) func_8028F45C, 9, (s32)&D_8038D708);
timedFunc_set_1(0.1f, (GenMethod_1) gcpausemenu_80314AC8, 1);
func_80311480(ASSET_A17_TEXT_BURIED_TREASURE_SPAWNED, 4, NULL, NULL, NULL, NULL);
D_8037DCB4++;
}//L80389E70
}
void ttc_resetTresureHunt(void){
D_8037DCB4 = 0;
}
void TTC_func_80389E90(Actor *this){
f32 tick = time_getDelta();
ActorLocal_TreasureHunt *local = (ActorLocal_TreasureHunt*)&this->local;
f64 tmp_f12;
if(!this->initialized){
actor_collisionOff(this);
this->marker->collidable = FALSE;
this->initialized = TRUE;
}
switch(this->state){
case 0://L80389F20
this->unk60 = MIN(255.0, this->unk60 + tick*150.0);
if(255.0 == this->unk60){
this->state = 1;
}
break;
case 1://L80389F94
if(local->unk0 < D_8037DCB4){
this->state = 2;
}
break;
case 2://L80389FC4
this->unk60 = MAX(0.0, this->unk60 - tick*((this->marker->modelId == ASSET_3EA_MODEL_RED_X)? 200.0 : 150.0));
if(0.0 == this->unk60)
marker_despawn(this->marker);
break;
}//L8038A094
actor_setOpacity(this, (s32)this->unk60);
this->depth_mode = 2;
}
Actor *func_8038A0D0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
f32 sp4C[3];
f32 sp40[3];
f32 sp3C;
f32 sp38;
Actor *actor;
actor = marker_getActorAndRotation(marker, sp4C);
switch(marker->modelId){
case ASSET_3E9_MODEL_RED_ARROW://L8038A12C
sp3C = 1.0f;
sp38 = 8.0f;
break;
case ASSET_3EB_MODEL_RED_QUESTION_MARK: //L8038A14C
sp3C = 1.0f;
sp38 = 8.0f;
break;
case ASSET_3EA_MODEL_RED_X://L8038A164
sp3C = (((ActorLocal_TreasureHunt *)&actor->local)->unk0 == 5)? 0.8f : 0.4f;
sp38 = 4.0f;
break;
}//L8038A1A0
sp40[0] = actor->position[0];
sp40[1] = actor->position[1] + sp38;
sp40[2] = actor->position[2];
func_8032AA58(actor, sp3C);
modelRender_preDraw(func_803253A0, actor);
modelRender_draw(gfx, mtx, sp40, sp4C, sp3C, NULL, func_80330B1C(marker));
return actor;
}