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
}