The first commit

This commit is contained in:
Banjo Kazooie
2022-07-15 17:09:41 -05:00
commit dd13d34074
1087 changed files with 391897 additions and 0 deletions

153
src/TTC/ch/lockup.c Normal file
View File

@@ -0,0 +1,153 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_802EE6CC(f32[3], s32[4], s32[4], s32, f32, f32, s32, s32, s32);
typedef struct {
s32 unk0;
s32 unk4;
}ActorLocal_Lockup;
Actor *func_803894C0(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_80389600(Actor *this);
/* .data */
ActorAnimationInfo D_8038C760[] ={
{0, 0.0f},
{0xBC, 8000000.0f},
{0xBC, 4.0f},
{0xBC, 8000000.0f},
{0xBC, 1.4f},
{0xBC, 8000000.0f}
};
ActorInfo D_8038C790 = {
0xA4, 0x151, 0x3D4,
1, D_8038C760,
func_80389600, func_80326224, func_803894C0,
2500, 0x366, 0.0f, 0
};
ActorInfo D_8038C7B4 = {
0xF6, 0x152, 0x3D4,
1, D_8038C760,
func_80389600, func_80326224, func_803894C0,
2500, 0x366, 0.0f, 0
};
ActorInfo D_8038C7D8 = {
0xF7, 0x153, 0x3D4,
1, D_8038C760,
func_80389600, func_80326224, func_803894C0,
2500, 0x366, 0.0f, 0
};
s32 D_8038C7FC[4] = {120, 120, 120, 120};
s32 D_8038C80C[4] = {0,0,0,0};
/* .code */
Actor *func_803894C0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor * actor = marker_getActor(marker);
func_8033A45C(3, actor->unk38_31);
func_8033A45C(4, actor->unk38_31);
func_80325888(marker, gfx, mtx, vtx);
}
void func_80389530(Actor *this){
func_80328B8C(this, 1, 0.2f, 1);
this->marker->collidable = FALSE;
this->unk38_31 = 0;
FUNC_8030E8B4(SFX_6C_LOCKUP_CLOSING, 1.0f, 32000, this->position, 1250, 2500);
}
void func_8038959C(Actor *this){
func_80389468();
func_80328B8C(this, 2, 0.2f, 1);
this->unk38_31 = 1;
FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500);
}
void func_80389600(Actor *this){
ActorLocal_Lockup *local = (ActorLocal_Lockup *)&this->local;
s32 tmp_v1;
int i;
if( !this->unk138_24
&& this->unkF4_8 == 0xA
&& !jiggyscore_isCollected(JIGGY_13_TTC_LOCKUP)
&& func_80329530(this, 320)
&& !func_80329530(this, 160)
&& !func_8028ECAC()
&& func_80311480(0xA15, 0, NULL, NULL, NULL, NULL)
){
this->unk138_24 = 1;
}//L803896AC
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
}
switch(this->state){
case 1: //L803896F0
if(!this->initialized){
this->marker->propPtr->unk8_3 = TRUE;
func_80328B8C(this, 1, 0.2f, 1);
this->marker->collidable = FALSE;
this->unk38_31 = 0;
this->initialized = TRUE;
}//L80389758
local->unk0++;
tmp_v1 = (this->modelCacheIndex == 0x151) ? 0x1E :
(this->modelCacheIndex == 0x152) ? 0x14 :
(this->modelCacheIndex == 0x153) ? 0xA :
10000;
if(!(local->unk0 < tmp_v1)){
local->unk0 = 0;
func_8038959C(this);
}
break;
case 2: //L803897DC
if(actor_playerIsWithinDist(this, 400) && func_8028FB48(0x8000000)){
func_8028F428(0xA, this->marker);
}
if(actor_animationIsAt(this, 0.5f)){
func_80328B8C(this, 3, 0.5f, 1);
}
if(0.15 < animctrl_getAnimTimer(this->animctrl)){
this->marker->collidable = TRUE;
}
break;
case 3: //L80389864
local->unk4++;
tmp_v1 = (this->modelCacheIndex == 0x151) ? 0x1E :
(this->modelCacheIndex == 0x152) ? 0x14 :
(this->modelCacheIndex == 0x153) ? 0xA :
10000;
if(!(local->unk4 < tmp_v1)){
local->unk4 = 0;
func_80328B8C(this, 4, 0.5f, 1);
}
break;
case 4: //L803898F4
case 5: //L803898F4
if(this->marker->unk14_21 && actor_animationIsAt(this, 0.99f)){
func_80389530(this);
for(i = 5; i < 0xe; i++){
func_8034A174(this->marker->unk44, i, this->unk1C);
func_802EE6CC(this->unk1C, &D_8038C80C, &D_8038C7FC, 1, 0.4f, 50.0f, 0xb4, 0xa0, 0);
}
}
break;
}//L8038999C
}

94
src/TTC/ch/treasure.c Normal file
View File

@@ -0,0 +1,94 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void chtreasure_update(Actor *this);
/* .data */
ActorAnimationInfo gChTreasureAnim[]={
{0, 0.0f},
{ASSET_153_ANIM_BURIED_TREASURE_APPEAR, 2.0f},
{ASSET_166_ANIM_BURIED_TREASURE_BOUNCE, 0.33f},
{0, 0.0}
};
ActorInfo gChTreasureInfo = {
MARKER_DB_BURIED_TREASURE, ACTOR_F4_BURIED_TREASURE, ASSET_42C_MODEL_BURIED_TREASURE,
1, gChTreasureAnim,
chtreasure_update, func_80326224, func_80325888,
0, 0, 1.7f, 0
};
/* .code */
void __chtreasure_die(ActorMarker *marker, ActorMarker *otherMarker){
Actor *this = marker_getActor(marker);
func_802C3F04(func_802C4140, 0x4C, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2]));
func_802EE278(this, 3, 0xf, 0x3C, 0.2f, 1.2f);
func_803115C4(0xA19);
jiggySpawn(JIGGY_11_TTC_RED_X, this->position);
marker_despawn(marker);
}
void __chtreasure_updatePosition(Actor *this){
this->position[0] = this->unk1C[0];\
this->position[1] = this->unk1C[1];\
this->position[2] = this->unk1C[2];
this->position[0] += this->unk5C*cosf(this->unk60);
this->position[2] += this->unk5C*sinf(this->unk60);
this->unk60 += 2.0*time_getDelta()*this->unk5C/300.0;
if(2*M_PI <= this->unk60)
this->unk60 -= 2*M_PI;
this->yaw = this->unk60*180.0/M_PI;
}
void chtreasure_update(Actor *this){
f32 sp3C[3];
s16 sp34[3];
if(!this->initialized){
this->initialized = TRUE;
if(this->unkF4_8 == 1 && !func_803203FC(0xC1)){
marker_despawn(this->marker);
return;
}
actor_collisionOff(this);
this->scale = 0.5f;
this->unk60 = M_PI/2;
this->unk5C = 0.0f;
this->unk1C[0] = this->position[0];
this->unk1C[1] = this->position[1];
this->unk1C[2] = this->position[2];
actor_playAnimationOnce(this);
marker_setCollisionScripts(this->marker, NULL, NULL, __chtreasure_die);
}//L8038C214
__chtreasure_updatePosition(this);
func_8034A174(this->marker->unk44, 5, sp3C);
sp34[0] = (s16)sp3C[0];
sp34[1] = (s16)sp3C[1];
sp34[2] = (s16)sp3C[2];
sp34[1] += 50;
func_802F3BF4(sp34);
switch(this->state){
case 1://L8038C29C
this->unk5C = animctrl_getAnimTimer(this->animctrl) *300.0; //radius of 300.0f
if(animctrl_isStopped(this->animctrl)){
actor_loopAnimation(this);
func_80328AC8(this, 2);
this->marker->propPtr->unk8_3 = 1;
actor_collisionOn(this);
func_8030E878(SFX_3F2_UNKNOWN, randf2(1.2f, 1.3f), 20000, this->position, 200.0f, 1500.0f);
}
break;
case 2://L8038C344
if(actor_animationIsAt(this, 0.99f)){
func_8030E878(SFX_3F2_UNKNOWN, randf2(1.2f, 1.3f), 20000, this->position, 200.0f, 1500.0f);
}
break;
case 3:
break;
}//L8038C398
}

338
src/TTC/code_0.c Normal file
View File

@@ -0,0 +1,338 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_802C4218(s32, s32, s32, s32);
extern f32 func_80257204(f32, f32, f32, f32);
extern ActorProp * func_80320EB0(ActorMarker *, f32, s32);
void func_80386FDC(Actor *this);
/* .data */
extern ActorAnimationInfo D_8038C3B0[];
extern ActorInfo D_8038C3D0 = {
MARKER_15_CLAM, ACTOR_69_CLAM, ASSET_351_MODEL_CLAM,
0x1, D_8038C3B0,
func_80386FDC, func_80326224, func_80325888,
4500, 0x366, 1.6f, 0
};
extern struct41s *D_8038C3F4;
extern struct41s *D_8038C424;
extern struct41s *D_8038C454;
extern struct31s *D_8038C484;
extern struct41s *D_8038C4AC;
/* .code */
void func_803863F0(enum sfx_e sfx_id, f32 arg1, s32 arg2, f32 position[3], f32 arg4, f32 arg5){
if(func_803114B0()){
arg2 -= 10000;
if(arg2 < 0)
arg2 = 0;
}
func_8030E878(sfx_id, arg1, arg2, position, arg4, arg5);
}
void func_80386454(Actor *this){
func_80328B8C(this, 1, 0.01f, 1);
actor_loopAnimation(this);
animctrl_setDuration(this->animctrl, randf2(1.9f, 2.1f));
}
bool func_803864B0(Actor *this, f32 arg1) {
f32 sp5C;
f32 sp58;
f32 pad;
Actor *sp50;
Actor *sp4C;
f32 phi_f2;
f32 sp3C[3];
s32 sp38;
sp50 = func_80326D68(this->position, 0x52, -1, &sp5C);
sp4C = func_80326D68(this->position, 0x129, -1, &sp58);
sp38 = 0;
if( (sp58 < sp5C)
&& (sp58 < 16000.0f)
&& (sp4C != 0)
&& func_80307258(sp4C->position, this->unk10_25 - 1, this->unk10_18 - 1) != -1
) {
sp3C[0] = sp4C->position[0];
sp3C[1] = sp4C->position[1];
sp3C[2] = sp4C->position[2];
phi_f2 = sp58;
}
else if(
(sp5C < sp58)
&& (sp5C < 16000.0f)
&& (sp50 != 0)
&& func_80307258(sp50->position, this->unk10_25 - 1, this->unk10_18 - 1) != -1
){
sp3C[0] = sp50->position[0];
sp3C[1] = sp50->position[1];
sp3C[2] = sp50->position[2];
phi_f2 = sp5C;
}
else if ((func_80329530(this, 0x4B0) != 0) && (func_803292E0(this) != 0)) {
phi_f2 = gu_sqrtf((f32) func_8032970C(this));
player_getPosition(sp3C);
sp38 = 1;
}
else{
return FALSE;
}
this->unk28 = phi_f2 / arg1;
this->yaw_moving = func_80257204(this->position[0], this->position[2], sp3C[0], sp3C[2]);
if ((func_803203FC(0xC1) ? 0 : 0x11) < this->unk28) {
this->unk28 = (func_803203FC(0xC1) != 0) ? 0.0f : 17.0f;
} else if (sp38 == 0) {
func_803863F0(SFX_AE_YUMYUM_TALKING, randf2(0.9f, 1.0f), 22000, this->position, 500.0f, 2000.0f);
}
return 1;
}
bool func_80386760(Actor *this, s32 arg1) {
f32 temp_f0_2;
s32 sp24;
s32 sp2C;
if(this->unk10_25 == 0) return FALSE;
animctrl_setDuration(this->animctrl, 1.0f);
sp2C = (s32) ((f64) (60.0f / (f32) func_8033DD90()) * 0.5);
if ((this->unk1C[0] != 0.0f) || !func_803864B0(this, sp2C)) {
if (((f64) animctrl_getAnimTimer(this->animctrl) < 0.1) && ((f64) randf() < 0.5)) {
if (this->unk1C[0] != 0.0f) {
arg1 *= 2;
this->unk28 = (f32) randi2(0, 0.5*(func_803203FC(0xC1) ? 0 : 0x11));
this->yaw_moving += (f32) randi2(-arg1, arg1);
} else if ((f64) randf() < 0.4) {
this->unk28 = 0.0f;
this->yaw_moving += (f32) randi2(-arg1, arg1);
} else {
this->unk28 = (f32) randi2(0.33 * (func_803203FC(0xC1) ? 0 : 0x11), func_803203FC(0xC1) ? 0 : 0x11);
this->yaw_moving = this->yaw;
}
this->unk1C[0] = 0.0f;
}
else{
this->unk1C[0] = 0.0f;
return FALSE;
}
}
temp_f0_2 = this->unk28 * sp2C;
this->velocity[1] = ((f32)(0.3*temp_f0_2) / sp2C) - (f32) ((s32) (sp2C * -5) / 2);
if (func_80329078(this, this->yaw_moving, temp_f0_2)) {
return TRUE;
}
this->unk1C[0] = 1.0f;
this->unk28 = 0.0f;
this->yaw_moving = this->yaw;
return FALSE;
}
void func_80386A9C(ParticleEmitter *pCtrl, f32 position[3]){
particleEmitter_setPosition(pCtrl, position);
func_802EF9F8(pCtrl, 0.7f);
func_802EFA18(pCtrl, 3);
func_802EFA20(pCtrl, 0.8f, 1.0f);
func_802EF9EC(pCtrl, 0x1f, 10000);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 3.5f, 3.5f);
func_802EFA5C(pCtrl, 0.0f, 0.65f);
func_802EFA70(pCtrl, 2);
}
void func_80386B54(f32 position[3], s32 count){
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
func_80386A9C(pCtrl, position);
particleEmitter_setModel(pCtrl, 0x37c);
particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C3F4);
func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f);
func_802EFB70(pCtrl, 1.0f, 1.0f);
particleEmitter_emitN(pCtrl, count);
}
void func_80386C08(f32 position[3], s32 count){
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
func_80386A9C(pCtrl, position);
particleEmitter_setModel(pCtrl, 0x37d);
particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C424);
func_802EFE24(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
func_802EFB70(pCtrl, 1.0f, 1.0f);
particleEmitter_emitN(pCtrl, count);
}
void func_80386CBC(f32 position[3], s32 count){
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
func_80386A9C(pCtrl, position);
particleEmitter_setModel(pCtrl, 0x37E);
particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C454);
func_802EFE24(pCtrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f);
func_802EFB70(pCtrl, 0.5f, 0.8f);
particleEmitter_emitN(pCtrl, count);
}
void func_80386D68(f32 position[3], enum asset_e sprite_id, s32 count){
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
particleEmitter_setSprite(pCtrl, sprite_id);
particleEmitter_setStartingFrameRange(pCtrl, 1, 6);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C4AC);
func_802EFB98(pCtrl, &D_8038C484);
particleEmitter_emitN(pCtrl, count);
}
void func_80386DF4(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this;
this = marker_getActor(this_marker);
this->marker->collidable = FALSE;
this->unk138_27 = TRUE;
func_803863F0(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 26000, this->position, 1500.0f, 2000.0f);
func_803863F0(SFX_115_BUZZBOMB_DEATH, 1.2f, 26000, this->position, 1500.0f, 2000.0f);
func_80386B54(this->position, 2);
func_80386C08(this->position, 2);
func_80386CBC(this->position, 0xC);
func_803115C4(0xa14);
marker_despawn(this->marker);
}
void func_80386EDC(s32 this, enum item_e item_id){
f32 sp24[3];
player_getPosition(sp24);
func_802C8F70(randf2(0.0f, 359.0f));
func_802C3F04(func_802C4218, this, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2]));
item_dec(item_id);
}
void func_80386F44(ActorMarker *this_marker, ActorMarker *other_marker){
if(func_80297C6C() == 3) return;
if( !mapSpecificFlags_get(5) && func_80311480(0xA14, 0, NULL, NULL, NULL, NULL)){
mapSpecificFlags_set(5, TRUE);
}
if(item_getCount(ITEM_D_EGGS) != 0)
func_80386EDC(0xe, ITEM_D_EGGS);
if(item_getCount(ITEM_F_RED_FEATHER) != 0)
func_80386EDC(0xf, ITEM_F_RED_FEATHER);
}
void func_80386FDC(Actor *this){
ActorProp *sp4C = func_80320EB0(this->marker, 30.0f, 1);
f32 sp48;
s32 sp44;
f32 sp38[3];
if(!this->initialized){
this->initialized = TRUE;
animctrl_setDuration(this->animctrl, 2.0f);
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, NULL, func_80386F44, func_80386DF4);
}
if(this->state != 3){
sp48 = func_80309724(this->position);
if(sp4C != NULL){
sp44 = sp4C->marker->unk14_20;
}
if(sp44 == 0x60 || sp44 == 0xb5){
if(this->position_y <= sp48 + 15.0f && sp48 - 15.0f <= this->position_y){
this->position_y = sp48;
this->unk38_31 = sp44;
func_80328B8C(this, 3, 0.01f, 1);
actor_loopAnimation(this);
this->velocity_x = 0.0f;
animctrl_setDuration(this->animctrl, 0.6f);
marker_despawn(sp4C->marker);
}
}//L80387140
}//L80387144
switch(this->state){
case 1://L80387170
if(func_80386760(this, 140)){
func_80328B8C(this, 2, 0.01f, 1);
actor_playAnimationOnce(this);
animctrl_setDuration(this->animctrl, 1.0f);
func_803863F0(SFX_3F2_UNKNOWN, randf2(1.0f, 1.1f), 22000, this->position, 1500.0f, 2000.0f);
}
else{
animctrl_setDuration(this->animctrl, 2.0f);
}
break;
case 2://L8038720C
this->position_y += this->velocity_y;
this->velocity_y += -5.0f;
if(actor_animationIsAt(this, 0.63f)){
func_803863F0(SFX_80_YUMYUM_CLACK, 1.0f, 20000, this->position, 1500.0f, 2000.0f);
}
if(this->position_y <= sp48){
this->position_y = sp48;
if(actor_animationIsAt(this, 0.99f) || 0.98 < animctrl_getAnimTimer(this->animctrl)){
func_80386454(this);
}
}
else{//L803872D4
if(!func_80329054(this, 0)){
this->unk1C[0] = 1.0f;
}
}
break;
case 3://L803872F0
if(actor_animationIsAt(this, 0.99f)){
this->velocity_x += 1.0f;
}
if(3.0f <= this->velocity_x){
func_80386454(this);
break;
}
if(actor_animationIsAt(this, 0.8f) && 2.0f == this->velocity_x){
func_803863F0(SFX_4B_GULPING, randf2(0.8f, 0.9f), 22000, this->position, 700.0f, 2000.0f);
break;
}//L803873C4
if(!actor_animationIsAt(this, 0.01f)) break;
if(!this->marker->unk14_21) break;
func_803863F0(SFX_4C_LIP_SMACK, 1.0f, 20000, this->position, 500.0f, 2000.0f);
func_8034A174(this->marker->unk44, 5, sp38);
switch(this->unk38_31){
case 0x60:
func_80386D68(sp38, ASSET_718_SPRITE_SPARKLE_WHITE_2, 8);
break;
case 0xb5:
func_80386D68(sp38, ASSET_715_SPRITE_SPARKLE_RED, 8);
break;
}
break;
}
func_80328FB0(this, 5.0f);
}

246
src/TTC/code_10A0.c Normal file
View File

@@ -0,0 +1,246 @@
#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 func_80387CF4(Actor *this);
Actor *func_80387D6C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
extern ActorAnimationInfo D_8038C4E0[];
extern ActorInfo D_8038C510 = {
MARKER_A3_BLUBBER, ACTOR_115_BLUBBER, ASSET_370_MODEL_BLUBBER,
0x1, D_8038C4E0,
func_803878CC, 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(func_80304E24(0x14b, sp24)){
jiggySpawn(JIGGY_14_TTC_BLUBBER, sp24);
func_802C3F04((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_moving = (f32) func_80329784(this);
mapSpecificFlags_set(3, TRUE);
func_8028F918(2);
timed_setCameraToNode(0.0f, 4);
timedFunc_set_1(1.0f, (TFQM1)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_moving, 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)
&& func_8028E88C() == 0x37
&& 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 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);
}

330
src/TTC/code_19D0.c Normal file
View File

@@ -0,0 +1,330 @@
#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 */
extern ActorAnimationInfo D_8038C540[];
extern 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
};
extern s32 D_8038C5A4[3];
extern struct31s D_8038C5B0;
/* .code */
void func_80387DC0(f32 *position, s32 count) {
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
pCtrl = pCtrl;
particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST);
func_802EFFA8(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 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 func_80387FB0(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this;
this = marker_getActor(caller);
func_80387F18(this);
func_802BAE4C();
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, -1, 300);
}
void 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) {
func_80387FF4(this);
this->unk60 = 40.0f;
return;
}
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 = 0xA5;
}
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, func_80387FB0, NULL)){
this->unk138_24 = TRUE;
}
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 5000, 300);
set_camera_to_node(11);
}
else{//L803886B0
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){
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)){
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 = func_80326D68(&sp1C, ACTOR_117_NIPPER, -1, NULL);
return nipper->state == 7;
}

173
src/TTC/code_26D0.c Normal file
View File

@@ -0,0 +1,173 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "prop.h"
#include "SnS.h"
extern ActorInfo D_8038C3D0;
extern ActorInfo D_8038C510;
extern ActorInfo D_8038C580;
extern ActorInfo D_8038C5E0;
extern ActorInfo D_8038C604;
extern ActorInfo D_8038C628;
extern ActorInfo D_8038C64C;
extern ActorInfo D_8038C670;
extern ActorInfo D_8038C694;
extern ActorInfo D_8038C6B8;
extern ActorInfo D_8038C6DC;
extern ActorInfo D_8038C718;
extern ActorInfo D_8038C790;
extern ActorInfo D_8038C7B4;
extern ActorInfo D_8038C7D8;
extern ActorInfo D_8038C8B0;
extern ActorInfo D_8038C8D4;
extern ActorInfo D_8038C8F8;
extern ActorInfo gChTreasureInfo;
void func_80388C78(Actor *this);
void func_80388CB8(Actor *this);
void func_80388D34(Actor *this);
void func_802D3D54(Actor *this);
void func_80388D8C(Actor *this);
/* .data */
extern ActorInfo D_8038C5E0 = {
0xA1, 0x10E, 0x3D2,
0x1, NULL,
func_802D3D54, func_80326224, func_80325E78,
0, 0, 0.0f, 0
};
extern ActorInfo D_8038C604 = {
MARKER_EA_LIGHTHOUSE_DOOR, ACTOR_13E_LIGHTHOUSE_DOOR, ASSET_3D6_MODEL_LIGHTHOUSE_DOOR,
0x1, NULL,
func_802D3D54, func_80326224, func_80325E78,
0, 0, 0.0f, 0
};
extern ActorInfo D_8038C628 = {
MARKER_167_SHARKFOOD_ISLAND, ACTOR_25C_SHARKFOOD_ISLAND, ASSET_50A_MODEL_SHARKFOOD_ISLAND,
0x1, NULL,
func_80388D8C, func_80326224, func_80325E78,
0, 0, 0.0f, 0
};
extern ActorInfo D_8038C64C = {
0x267, 0x2E2, 0x3BD,
0x1, NULL,
func_80388D34, func_80326224, func_80325E78,
0, 0, 0.0f, 0
};
extern ActorInfo D_8038C670 = {
0x26A, 0x2DF, 0x3BE,
0x1, NULL,
func_80388C78, func_80326224, func_80325E78,
0, 0, 0.0f, 0
};
extern ActorInfo D_8038C694 = {
0x268, 0x2E0, 0x3B6,
0x1, NULL,
func_80388C78, func_80326224, func_80325E78,
0, 0, 0.0f, 0
};
extern ActorInfo D_8038C6B8 = {
0x269, 0x2E1, 0x3B7,
0x1, NULL,
func_80388C78, func_80326224, func_80325E78,
0, 0, 0.0f, 0
};
extern ActorInfo D_8038C6DC = {
MARKER_1D5_PALM_TREE, ACTOR_31E_PALM_TREE, ASSET_3A9_MODEL_PALM_TREE,
0x1, NULL,
func_80388CB8, func_80326224, func_80325E78,
0, 0, 0.0f, 0
};
/* .code */
void func_80388AC0(void)
{
spawnableActorList_add(&D_8038C5E0, actor_new, 0);
spawnableActorList_add(&D_8038C604, actor_new, 0);
spawnableActorList_add(&D_8038C580, actor_new, 0X4100168);
spawnableActorList_add(&D_8038C510, actor_new, 0X4000101);
spawnableActorList_add(&D_8038C718, actor_new, 0X188);
spawnableActorList_add(&D_8038C790, actor_new, 0X148);
spawnableActorList_add(&D_8038C7B4, actor_new, 0X148);
spawnableActorList_add(&D_8038C7D8, actor_new, 0X148);
spawnableActorList_add(&D_8038C8B0, actor_new, 0X400);
spawnableActorList_add(&D_8038C8D4, actor_new, 0X400);
spawnableActorList_add(&D_8038C8F8, actor_new, 0X400);
spawnableActorList_add(&gChTreasureInfo, actor_new, 0X2000048);
spawnableActorList_add(&D_8038C628, actor_new, 0X8680);
spawnableActorList_add(&D_8038C64C, actor_new, 0X400);
spawnableActorList_add(&D_8038C670, actor_new, 0X20404);
spawnableActorList_add(&D_8038C694, actor_new, 0X400);
spawnableActorList_add(&D_8038C6B8, actor_new, 0X400);
spawnableActorList_add(&D_8038C6DC, actor_new, 0X400);
spawnableActorList_add(&D_8038C3D0, actor_new, 0X2000041);
}
void func_80388C78(Actor *this){
if(!this->initialized){
func_802D3D74(this);
this->initialized = TRUE;
}
}
void func_80388CB8(Actor *this){
if(!this->initialized){
func_802D3D74(this);
this->initialized = TRUE;
this->scale = 2.55f;
}
}
void func_80388D04(s32 arg0){
ActorMarker *marker = reinterpret_cast(ActorMarker *, arg0);
Actor *this = marker_getActor(marker);
spawn_child_actor(0x2df, &this);
}
void func_80388D34(Actor *this){
func_80388C78(this);
if(!this->unk16C_4){
func_802C3C88(func_80388D04, this->marker);
this->unk16C_4 = TRUE;
}
}
void func_80388D8C(Actor *this){
f32 sp1C[3];
if(!this->initialized){
func_802D3CE8(this);
this->initialized = TRUE;
this->position_x = 0.412*(8831.0f - this->position_x) + this->position_x;
this->position_z = 0.412*(13535.0f - this->position_z) + this->position_z;
this->yaw = 199.0f;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(sns_get_item_state(SNS_ITEM_EGG_PINK, TRUE)){
this->position_y = 700.0f;
}
else{
this->position_y = -1000.0f;
}
}//L80388E7C
if(this->position_y == 700.0f){
player_getPosition(sp1C);
if( 695.0f <= sp1C[1] && sp1C[1] < 1000.0f
&& (sp1C[0] - 5542.0f)*(sp1C[0] - 5542.0f) + (sp1C[2] - 8687.0f)*(sp1C[2] - 8687.0f) < 96100.0f
&& (sp1C[0] - 6837.0f)*(sp1C[0] - 6837.0f) + (sp1C[2] - 12714.0f)*(sp1C[2] - 12714.0f) < 17640000.0f
){
func_8031D04C(0x8f, 1);
}
}
}

121
src/TTC/code_2B80.c Normal file
View File

@@ -0,0 +1,121 @@
#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 func_80388FBC(Actor *this);
/* .data */
extern ActorAnimationInfo D_8038C700[];
extern ActorInfo D_8038C718 = {
MARKER_33_LEAKY, ACTOR_1E_LEAKY, ASSET_51A_MODEL_LEAKY,
0x1, D_8038C700,
func_80388FBC, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
extern f32 D_8038C73C[3];
/* .rodata */
extern f32 D_8038CDD0;
extern f32 D_8038CDD4;
extern f32 D_8038CDD8;
extern f32 D_8038CDDC;
extern f32 D_8038CDE0;
extern f32 D_8038CDE4;
/* .code */
bool func_80388F70(Actor *this){
return this->modelCacheIndex == 0x56;
}
void func_80388F88(void){
func_803272D0(D_8038C73C, 2000.0f, 2, func_80388F70);
}
void func_80388FBC(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, func_8025A70C, 0x2D);
}
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(D_8038CDD0, D_8038CDD4), 22000, this->position, 400.0f, 1000.0f);
return;
}
if (actor_animationIsAt(this, 0.01f)) {
func_8030E878(0x109, randf2(D_8038CDD8, D_8038CDDC), 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(D_8038CDE0, D_8038CDE4), 14000, this->position, 400.0f, 1000.0f);
}
}
}
void func_80389288(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
s32 temp_v0;
func_80328A84(this, 2);
temp_v0 = func_8034C5AC(300);
if(temp_v0){
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, (TFQM3)func_802E4078, MAP_A_TTC_SANDCASTLE, 0, 0);
func_803228D8();
}
bool func_80389364(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(0xa28, 0x2a, this->position, this->marker, func_80389288, NULL);
return TRUE;
}

29
src/TTC/code_3040.c Normal file
View File

@@ -0,0 +1,29 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern s32 D_80276CB0;
/* .data */
extern s32 D_8038C754;
/* .bss */
struct {
u8 pad0[4];
s32 unk4;
u8 pad8[4];
s32 unkC;
}D_8038D6F0;
/* .code */
void func_80389430(void){
if(getGameMode() != GAME_MODE_7_ATTRACT_DEMO){
func_8029CF48(2, 1, 0.0f);
}
}
void func_80389468(void){
if(D_8038D6F0.unk4 != D_8038C754 || D_8038D6F0.unkC != D_80276CB0){
func_80389430();
}
}

245
src/TTC/code_35D0.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 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,
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,
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,
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 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 && 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++;
func_802C3BF8(func_80389A9C);
func_802C3BF8(func_80389A1C);
}
}
void 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 && 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);
func_802C3F04((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 = partEmitList_pushNew(3);
func_802EFFA8(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;
func_80314AC8(0);
timedFunc_set_2(0.1f, (TFQM2) func_8028F45C, 9, (s32)&D_8038D708);
timedFunc_set_1(0.1f, (TFQM1) func_80314AC8, 1);
func_80311480(ASSET_A17_TEXT_BURIED_TREASURE_SPAWNED, 4, NULL, NULL, NULL, NULL);
D_8037DCB4++;
}//L80389E70
}
void func_80389E84(void){
D_8037DCB4 = 0;
}
void 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->unk124_9 = 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 = func_80325300(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);
func_8033A2D4(func_803253A0, actor);
func_803391A4(gfx, mtx, sp40, sp4C, sp3C, NULL, func_80330B1C(marker));
return actor;
}

587
src/TTC/code_3E30.c Normal file
View File

@@ -0,0 +1,587 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "SnS.h"
/* extern */
extern void func_802D6310(f32, enum map_e, s32, s32, enum bkprog_e);
/* .h */
void func_8038B5B4(void);
typedef struct {
u8 *unk0;
u8 unk4;
u8 unk5;
s16 unk6;
} struct_ttc_3E30_s;
typedef struct {
s16 unk0;
u8 unk2;
u8 unk3;
f32 unk4;
}Struct_TTC_3E30_1;
typedef struct {
s16 unk0;
s16 unk2;
}Struct_TTC_3E30_2;
s32 func_8038B778(void);
extern s32 D_8038C980;
extern Struct_TTC_3E30_1 D_8038C984[];
extern struct_ttc_3E30_s D_8038CA6C[];
extern u8 D_8038CC78;
extern Struct_TTC_3E30_2 D_8038CC7C[];
extern s32 D_8038CAD4;
extern struct_ttc_3E30_s D_8038CAD8[];
extern u8 D_8038CF0C[] = "j4663n86pink";
extern u8 D_8038CF1C[] = "knip68n3664j";
extern struct{
BKModel *unk0;
BKModel *unk4;
u8 unk8;
u8 unk9;
u8 unkA;
u8 padB[1];
f32 unkC;
u8 unk10;
} D_8038D720;
/* .code */
void func_8038A220( s32 arg0, BKVtxRef *vtx_ref, Vtx *vtx, s32 arg2){
vtx->v.ob[1] += 2;
}
void func_8038A23C( s32 arg0, BKVtxRef *vtx_ref, Vtx *vtx, s32 arg2){
vtx->v.ob[1] += 0xf0;
}
void func_8038A258(s32 arg0) {
if (arg0 == 1) {
if (func_803203FC(2)) {
item_set(ITEM_0_HOURGLASS_TIMER, 3000 - 1);
} else {
item_set(ITEM_0_HOURGLASS_TIMER, 6000 - 1);
}
item_set(ITEM_6_HOURGLASS, TRUE);
}
if (D_8038D720.unk10 == 1) {
item_set(ITEM_6_HOURGLASS, FALSE);
}
D_8038D720.unk10 = arg0;
}
Struct_TTC_3E30_1 *func_8038A2DC(s32 mesh_id) {
Struct_TTC_3E30_1 *i_ptr;
for(i_ptr = D_8038C984; i_ptr->unk0 != 0; i_ptr++){
if(i_ptr->unk0 == mesh_id){
return i_ptr;
}
}
return NULL;
}
void func_8038A328(void) {
Struct_TTC_3E30_1 *i_ptr;
for(i_ptr = D_8038C984; i_ptr->unk0 != 0; i_ptr++){
i_ptr->unk3 = 2;
i_ptr->unk4 = 0.0f;
}
mapSpecificFlags_set(1, FALSE);
}
#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038A37C.s")
void func_8038A5D8(Struct_TTC_3E30_1 *arg0, s32 arg1) {
s32 temp_v0;
temp_v0 = arg0->unk3;
arg0->unk3 = arg1;
arg0->unk4 = 0.0f;
if ((arg1 == 1) && (temp_v0 != arg1)) {
func_8025A6EC(COMUSIC_2C_BUZZER, 32000);
}
}
#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038A618.s")
#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038A7DC.s")
#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038AA2C.s")
void func_8038AB44(void){
D_8038C980 = func_8038B600();
}
u32 func_8038AB68(s32 arg0){
if(func_8031FF1C(0xAC + arg0)){
return 1 << arg0;
}
return 0;
}
void func_8038ABA0(u32 arg0){
int i;
func_80356520(0xC2);
if(arg0 & 0x400){
func_80356560(0xC5);
}
func_803204E4(0x78, 0);
for(i = 4; i < 0xb; i++){
if( arg0 & (1 << i)){
func_803204E4(0x93 + i, TRUE);
func_803204E4(0x78, TRUE);
}
else{
func_803204E4(0x93 + i, FALSE);
}
}
}
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038AC48.s")
#else
void func_8038AC48(Struct_TTC_3E30_1 *arg0) {
s32 sp3C;
s16 temp_a0;
s16 temp_v0;
s32 temp_s0;
s32 temp_s0_2;
s32 temp_s1;
s32 temp_s5;
s32 temp_t9;
s32 temp_v1;
s32 phi_s0;
u8 *phi_v0;
s32 phi_s0_2;
struct_ttc_3E30_s *phi_s2;
s32 phi_s1;
s32 phi_s7;
s32 phi_s1_2;
s32 phi_s1_3;
s32 phi_s7_2;
s32 phi_s1_4;
s32 phi_s1_5;
temp_s5 = func_803203FC(2);
sp3C = func_8038BD10(arg0);
phi_s7 = 0;
for(phi_s2 = &D_8038CA6C; phi_s2->unk0 != 0; phi_s2++){
phi_s0 = 1;
phi_s1_2 = 0;
if (D_8038D720.unk8 == 0) {
phi_s1_2 = 1;
}
phi_s1 = phi_s1_2;
phi_s1_5 = phi_s1_2;
if (temp_s5 == 0) {
do {
temp_s0 = phi_s0 + 1;
temp_s1 = phi_s1_5 | func_8038AB68(phi_s0);
phi_s0 = temp_s0;
phi_s1_4 = temp_s1;
phi_s1_5 = temp_s1;
} while (temp_s0 < 4);
phi_v0 = &D_8037DCC0;
phi_s0_2 = 0;
do {
phi_s1_3 = phi_s1_4;
if (*phi_v0 != 0) {
phi_s1_3 = phi_s1_4 | (0x10 << phi_s0_2);
}
temp_s0_2 = phi_s0_2 + 1;
phi_v0 += 1;
phi_s0_2 = temp_s0_2;
phi_s1 = phi_s1_3;
phi_s1_4 = phi_s1_3;
} while (temp_s0_2 != 7);
if (func_803203FC(0x78)) {
phi_s1 = phi_s1_3 | 0x800;
}
}
if ((phi_s2->unk4 & phi_s1) != 0) {
if ((func_8038BF68() != 0) && (temp_s5 == 0)) {
phi_s2->unk6 = 0;
func_8038A258(2);
}
temp_v0 = phi_s2->unk6;
if (arg0->unk2 == *(phi_s2->unk0 + temp_v0)) {
phi_s2->unk6 = (s16) (temp_v0 + 1);
if (func_8038BF68() != 0) {
phi_s2->unk6 = 0;
phi_s7_2 = 1;
} else {
if ((phi_s2->unk4 & 0xFFE) != 0) {
func_8038A258(2);
func_8038A5D8(arg0, 5);
} else {
func_8038A5D8(arg0, 3);
}
if (*(phi_s2->unk0 + phi_s2->unk6) == 0) {
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 32000);
if (temp_s5 != 0) {
item_set(ITEM_6_HOURGLASS, FALSE);
func_803204E4(3, 0);
func_803204E4(5, 1);
func_8038A258(2);
phi_s7_2 = 1;
} else {
temp_a0 = phi_s2->unk4;
if ((temp_a0 & 1) != 0) {
D_8038D720.unk8 = 2U;
D_8038D720.unkC = 0.0f;
mapSpecificFlags_set(1, TRUE);
func_80320004(0xFA, TRUE);
func_8030E2C4(D_8038D720.unk9);
func_8038A258(2);
} else if ((temp_a0 & 0xE) != 0) {
temp_t9 = (s32) (phi_s2 - &D_8038CA6C) >> 3;
func_8035644C(temp_t9 + 0xBD, 1);
temp_v1 = temp_t9 - 1;
switch (temp_v1) { /* irregular */
default:
break;
case 0:
func_80346448(ITEM_D_EGGS);
func_802FAFAC(ITEM_D_EGGS, COMUSIC_C_EGG_COLLECTED);
break;
case 1:
func_80346448(ITEM_F_RED_FEATHER);
func_802FAFAC(ITEM_F_RED_FEATHER, COMUSIC_B_RED_FEATHER_COLLECTED);
break;
case 2:
func_80346448(ITEM_10_GOLD_FEATHER);
func_802FAFAC(ITEM_10_GOLD_FEATHER, COMUSIC_14_GOLD_FEATHER_COLLECTED);
break;
}
} else {
if ((temp_a0 & 0xFF0) != 0) {
func_8038ABA0(temp_a0, 1);
}
}
phi_s7_2 = 1;
}
} else {
func_8025A6EC(COMUSIC_2B_DING_B, 0x6D60);
phi_s7_2 = 1;
}
}
} else if (sp3C != 0) {
phi_s7_2 = 1;
}
}
if ((func_8038BF68() == 0) && (phi_s7 == 0) && (D_8038D720.unk8 == 0)) {
func_8038A5D8(arg0, 1);
}
}
#endif
void func_8038AFC8(void){
struct_ttc_3E30_s *iPtr;
for(iPtr = D_8038CA6C; iPtr->unk0 != NULL; iPtr++){
iPtr->unk6 = 0;
}
if(func_803203FC(2))
strcpy(D_8038CA6C[0].unk0, D_8038CF0C);
else
strcpy(D_8038CA6C[0].unk0, D_8038CF1C);
func_8038B5B4();
}
void func_8038B04C(void){
if(D_8038D720.unk0){
func_8038A258(0);
func_8030DA44(D_8038D720.unk9);
func_8030DA44(D_8038D720.unkA);
}
}
void func_8038B094(void){
void *sp2C;
void *sp28;
if( map_get() == MAP_7_TTC_TREASURE_TROVE_COVE
&& levelSpecificFlags_get(0x2)
){
sp2C = func_8034C5AC(0x12C);
if(sp2C){
func_8034E71C(sp2C, -600, 0.0f);
}
}
D_8038D720.unk0 = 0;
if(map_get() != MAP_A_TTC_SANDCASTLE){
func_8038AB44();
}
else{
sp2C = func_8034C5AC(0x131);
sp28 = func_8034C5AC(0x12C);
if(levelSpecificFlags_get(5)){
func_8034E71C(sp2C, -500, 10.0f);
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.0f, 1);
func_80324E88(2.0f);
func_80324E38(2.0f, 0);
func_803228D8();
timedFunc_set_3(2.0f, (TFQM3) func_802E4078, MAP_7_TTC_TREASURE_TROVE_COVE, 1, 0);
}
else if(levelSpecificFlags_get(2) || func_803203FC(2)){
func_8034E71C(sp2C, -500, 0.0f);
}
else{
func_8034E71C(sp28, -500, 0.0f);
}//L8038B1EC
D_8038D720.unk0 = func_80309744(0);
D_8038D720.unk4 = func_80309744(1);
D_8038D720.unk8 = 0;
D_8038D720.unk10 = 0;
D_8038D720.unkC = 0.0f;
D_8038D720.unk9 = func_8030D90C();
func_8030DBB4(D_8038D720.unk9, 0.1f);
sfxsource_setSfxId(D_8038D720.unk9, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(D_8038D720.unk9, 3);
sfxsource_setSampleRate(D_8038D720.unk9, 28000);
D_8038D720.unkA = func_8030D90C();
sfxsource_setSfxId(D_8038D720.unkA, SFX_3_DULL_CANNON_SHOT);
func_8030DD14(D_8038D720.unkA, 3);
sfxsource_setSampleRate(D_8038D720.unkA, 0x7fff);
func_8038A328();
func_8038AFC8();
if( jiggyscore_isCollected(JIGGY_10_TTC_SANDCASTLE)
&& !func_803203FC(2)
){
func_8033F120(D_8038D720.unk4, 0x3C, func_8038A23C, 0);
D_8038D720.unk8 = 3;
}//L8038B2CC
func_8038AB44();
func_8038B5B4();
}//L8038B2E0
}
void func_8038B2F0(void) {
f32 sp2C[3];
s32 mesh_id;
f32 sp24;
u8 temp_v0;
Struct_TTC_3E30_1 *temp_v0_3;
sp24 = time_getDelta();
if (func_8038B778() == 3) {
func_802C5A3C(-1);
}
if (D_8038D720.unk0 != 0) {
func_8038AA2C();
player_getPosition(sp2C);
if ((D_8038D720.unk10 == 0) && func_803203FC(2) && func_803203FC(3)) {
func_8038A258(1);
}
if ((D_8038D720.unk10 == 1) && item_empty(ITEM_0_HOURGLASS_TIMER)) {
func_8038A258(2);
if (func_803203FC(2)) {
func_803204E4(3, FALSE);
func_803204E4(5, FALSE);
} else {
func_8028F66C(0xF);
}
}
if ((D_8038D720.unk8 == 0) || (D_8038D720.unk8 == 3)) {
if( (levelSpecificFlags_get(2) || func_803203FC(3))
&& (player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER)
&& func_8028F20C()
) {
mesh_id = func_8033F3C0(D_8038D720.unk0, sp2C);
if (mesh_id != 0) {
temp_v0_3 = func_8038A2DC(mesh_id);
if ((temp_v0_3 != NULL) && ((temp_v0_3->unk3 == 2) || (D_8038D720.unk8 == 3))) {
func_8038AC48(temp_v0_3);
if ((D_8038D720.unk8 == 0) && (D_8038D720.unk10 == 0) && (func_803203FC(2) == 0)) {
func_8038A258(1);
}
}
}
}
} else if (D_8038D720.unk8 == 2) {
D_8038D720.unkC = (f32) (D_8038D720.unkC + sp24);
func_8033F120(D_8038D720.unk4, 0x3C, func_8038A220, 0);
if (D_8038D720.unkC > 4.0f) {
D_8038D720.unk8 = 3;
func_8030E2C4(D_8038D720.unkA);
func_8030E394(D_8038D720.unk9);
}
}
}
}
bool func_8038B550(void){
return NOT(D_8038D720.unk8 < 2);
}
void func_8038B564(s32 arg0, s32 arg1, enum map_e map_id, s32 arg3, s32 arg4){
if(arg1 == D_8038CAD8[arg0].unk5){
func_802D6310(1.0f, map_id, arg3, arg4, 0);
}
}
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038B5B4.s")
#else
void func_8038B5B4(void) {
s32 i;
for(i = 0; D_8038CAD8[i].unk0 != NULL; i++){
D_8038CAD8[i].unk4 = 0;
}
D_8038CC78 = 0;
func_8038AB44();
}
#endif
#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038B600.s")
void func_8038B6D4(s32 arg0, s32 arg1, s32 arg2, enum bkprog_e prog_id, s32 prog_val, s32 prog_bit_size, enum bkprog_e arg6){
if( ((arg2 + 20 == D_8038CAD8[arg1].unk5) && func_803203FC(arg2))
|| arg0 == 3
){
func_80320044(prog_id, prog_val, prog_bit_size);
if(arg6){
func_80320004(arg6, TRUE);
}
}
}
void func_8038B750(s32 arg0){
func_80320044(0xfd, arg0, 2);
}
s32 func_8038B778(void){
return func_8031FF44(0xFD, 2);
}
void func_8038B79C(s32 arg0, s32 arg1, s32 arg2, enum item_e item_id, s32 item_diff, s32 item_val) {
if (((arg2 + 0x14) == D_8038CAD8[arg1].unk5) || (arg0 == 1)) {
if (item_diff != 0) {
func_803463D4(item_id, item_diff);
return;
}
item_set(item_id, item_val);
}
}
void func_8038B800(s32 arg0) {
struct_ttc_3E30_s *sp30;
s32 sp38;
sp30 = &D_8038CAD8[arg0];
sp38 = sp30->unk5 - 0x14;
sns_set_item_and_update_payload(sp30->unk5, 1, 1);
func_8038B564(arg0, 1, MAP_61_CCW_WINTER_NABNUTS_HOUSE, 0x83, 0x1B);
func_8038B564(arg0, 2, MAP_3F_RBB_CAPTAINS_CABIN, 0x84, 0x1C);
func_8038B564(arg0, 3, MAP_2C_MMM_BATHROOM, 0x85, 0x1D);
func_8038B564(arg0, 4, MAP_12_GV_GOBIS_VALLEY, 0x86, 0x1E);
func_8038B564(arg0, 5, MAP_7_TTC_TREASURE_TROVE_COVE, 0x87, 0x1F);
func_8038B564(arg0, 6, MAP_1D_MMM_CELLAR, 0x88, 0x20);
func_8038B564(arg0, 7, MAP_7F_FP_WOZZAS_CAVE, 0x89, 0x21);
if (sp30->unk5 >= 0x14) {
func_8030E58C(SFX_2B_BULL_MOO_1, 1.5f);
func_803204E4(0x65, 1);
func_803204E4(sp38, 1);
}
func_8038B6D4(0, arg0, 0x6C, 0x60, 5, 3, 0x33);
func_8038B6D4(0, arg0, 0x6D, 0x63, 7, 3, 0x34);
func_8038B6D4(0, arg0, 0x6E, 0x66, 8, 4, 0x35);
func_8038B6D4(0, arg0, 0x6F, 0x6A, 9, 4, 0x36);
func_8038B6D4(0, arg0, 0x70, 0x6E, 0xA, 4, 0x37);
func_8038B6D4(0, arg0, 0x71, 0x72, 0xC, 4, 0x38);
func_8038B6D4(0, arg0, 0x72, 0x76, 0xF, 4, 0x39);
func_8038B79C(0, arg0, 0x94, ITEM_15_HEALTH_TOTAL, 0, 8);
func_8038B79C(0, arg0, 0x77, ITEM_14_HEALTH, 0, item_getCount(ITEM_15_HEALTH_TOTAL));
func_8038B79C(0, arg0, 0x95, ITEM_1C_MUMBO_TOKEN, 0, 99);
if (sp38 == 0x81) {
func_80320004(0x53, 1);
func_80320004(0x54, 1);
}
func_8038B5B4();
}
void func_8038BB10(ActorMarker *caller, enum asset_e text_id, s32 arg2) {
if (arg2 == 1) {
func_8038B750(3);
func_8038B800(D_8038CAD4);
func_80311480(0xFBF, 0xC, NULL, NULL, NULL, NULL);
func_8033D0FC(func_802C5A30());
func_8033CFD4(func_802C5A30());
func_802C5A3C(-1);
return;
}
func_8038B5B4();
}
void func_8038BBA0(s32 arg0) {
s32 i;
if ((s32) D_8038CAD8[arg0].unk5 >= 0x14) {
if (func_803203FC(D_8038CAD8[arg0].unk5 - 0x14)) {
func_8038B5B4();
return;
}
for( i = 0; D_8038CC7C[i].unk0 != 0; i++){
if ((D_8038CAD8[arg0].unk5 >= D_8038CC7C[i].unk0) && (D_8038CC7C[i].unk2 >= D_8038CAD8[arg0].unk5)) {
switch (func_8038B778()) {
case 0:
func_8038B750(1);
func_8038B800(arg0);
func_8038B5B4();
return;
case 1:
func_8038B750(2);
func_8038B800(arg0);
func_8038B5B4();
func_80311480(0xFBE, 0xC, NULL, NULL, NULL, NULL);
return;
case 2:
D_8038CAD4 = arg0;
func_80311480(0xE38, 0xC, NULL, NULL, func_8038BB10, NULL);
return;
}
return;
}
}
}
func_8038B800(arg0);
func_8038B5B4();
}
extern f32 D_8038D68C;
extern f32 D_8038D690;
bool func_8038BD10(Struct_TTC_3E30_1 *arg0);
#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038BD10.s")
bool func_8038BF68(void){
return *(u8*)(D_8038CAD8[0].unk4 + (s32)D_8038CAD8[0].unk0) == 0;
}
int ttc_func_8038BF8C(void){
return func_8038B600() == D_8038C980;
}