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

232
src/BGS/ch/croctus.c Normal file
View File

@@ -0,0 +1,232 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_80328748(ActorAnimCtrl *, f32, f32);
extern void func_8028F94C(s32, f32[3]);
extern void func_80324CFC(f32, enum comusic_e, s32);
extern void func_803289EC(Actor *, f32, s32);
extern void func_80326310(Actor *);
extern void actor_setOpacity(Actor *, s32);
extern void func_802C3D3C(void (*)(s32, s32), s32, s32);
extern void func_802BAFE4(s32 arg0);
void func_80387D18(ActorMarker *, u32);
Actor *func_8038860C(ActorMarker *, Gfx**, Mtx **, Vtx**);
void func_80387FD4(Actor *this);
/* .data */
s16 D_803907B0[4] = {0x15, 0x16, 0x17, 0x18};
ActorMarker *bgs_D_803907B8[5] = {NULL};
ActorAnimationInfo D_803907CC[] = {
{0x000, 0.0f},
{0x14B, 3.3e+7f},
{0x14B, 1.4f},
{0x14B, 3.3e+7f},
{0x14B, 1.4f},
{0x14B, 2.0f},
{0x14B, 2.0f}
};
ActorInfo D_80390804 ={MARKER_FC_CROCTUS, ACTOR_1FA_CROCTUS, ASSET_425_MODEL_CROCTUS,
1, D_803907CC,
func_80387FD4, func_80326224, func_8038860C,
0, 0, 0.0f, 0
};
/* .code */
void func_80387C90(Actor *arg0){
animctrl_setDuration(arg0->animctrl, 0.4 + 0.9999999999999999 * ((f32)(5 - arg0->unkF4_8) * 0.25));
}
void func_80387D18(ActorMarker * arg0, u32 arg1){
Actor* this;
Actor* nextActPtr;
this = marker_getActor(arg0);
nextActPtr = spawn_child_actor(0x6A, &this);
nextActPtr->state = 2;
nextActPtr->unkF4_8 = 0x8C;
nextActPtr->unk60 = 3.0f;
nextActPtr->unk38_31 = arg1;
if(arg0);
}
void *func_80387D90(ActorMarker * arg0){
ActorMarker *marker;
Actor* this;
f32 spawnPos[3];
marker = reinterpret_cast(ActorMarker *, arg0);
this = marker_getActor(marker);
spawnPos[0] = this->position_x;
spawnPos[1] = this->position_y;
spawnPos[2] = this->position_z;
marker->propPtr->unk8_3 = 0;
func_802BAFE4(0x19);
jiggySpawn(JIGGY_22_CROCTUS, spawnPos);
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF);
}
void func_80387E00(s32 arg0){
ActorMarker *marker = reinterpret_cast(ActorMarker *, arg0);
Actor * this = marker_getActor(marker);
func_803262E4(this);
func_802C3D3C(func_80387D18, reinterpret_cast(s32, marker), 0x1E);
}
void func_80387E40(ActorMarker * arg0){
Actor *thisActor = marker_getActor(arg0);
func_80326310(thisActor);
if(arg0);
}
void func_80387E68(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this;
if(text_id == 0xC86){
this = marker_getActor(caller);
timed_playSfx(0.4f, SFX_C9_PAUSEMENU_ENTER, 1.0f, 32000);
timed_playSfx(1.4f, SFX_C9_PAUSEMENU_ENTER, 1.0f, 32000);
func_80324CFC(0.4f, COMUSIC_43_ENTER_LEVEL_GLITTER, 22000);
func_80324D2C(4.5f, COMUSIC_43_ENTER_LEVEL_GLITTER);
func_80328B8C(this, 5, 0.79f, 1);
func_80326310(this);
bgs_D_803907B8[this->unkF4_8]->propPtr->unk8_4 = TRUE;
timedFunc_set_1(1.1f, func_80387E00, bgs_D_803907B8[this->unkF4_8]);
timed_setCameraToNode(0.8f, 9);
func_80324DBC(3.4f, 0xC87, 0xE, NULL, NULL, func_80387E68, NULL);
func_802C3D3C(&func_80387D18, this->marker, 0x46);
}
else{
func_80324E88(0.0f);
func_8028F918(0);
}
}
void func_80387FD4(Actor *this){
int j;
if(!this->unk16C_4){
if(jiggyscore_isCollected(JIGGY_22_CROCTUS)){
marker_despawn(this->marker);
return;
}
this->unk16C_4 = TRUE;
if(bgs_D_803907B8[this->unkF4_8 - 1] == 0){
bgs_D_803907B8[this->unkF4_8 - 1] = this->marker;
for(j = this->unkF4_8; j < 6; j++){
if(bgs_D_803907B8[j] != NULL){
bgs_D_803907B8[j]->propPtr->unk8_4 = FALSE;
actor_setOpacity(marker_getActor(bgs_D_803907B8[j]), 0);
}
}//L803880C8
for( j = this->unkF4_8 - 2; j >= 0 && bgs_D_803907B8[j] == NULL; j--);
if(j >= 0){
this->marker->propPtr->unk8_4 = FALSE;
actor_setOpacity(this, 0);
}
this->marker->propPtr->unk8_3 = TRUE;
}//L80388144
func_803289EC(this, 0.0f, 1);
this->unk60 = 0.0f;
return;
}//L80388160
if(this->unk38_31){
if ((this->state != 5) && (this->state != 6)) {
func_8025A6EC(COMUSIC_2B_DING_B, 28000); //TODO ISSUE HERE
if (this->unkF4_8 == 1) {
func_8028F94C(2, this->position);
func_80311480(0xC86, 0xE, this->position, this->marker, func_80387E68, NULL);
func_80328B8C(this, 6, 0.79f, 1);
} else {
timed_playSfx(0.4f, SFX_C9_PAUSEMENU_ENTER, 1.0f, 32000); //0.4f
timed_playSfx(1.4f, SFX_C9_PAUSEMENU_ENTER, 1.0f, 32000); //1.4f
func_80324CFC(0.4f, COMUSIC_43_ENTER_LEVEL_GLITTER, 22000);
func_80324D2C(4.5f, COMUSIC_43_ENTER_LEVEL_GLITTER);
func_80328B8C(this, 5, 0.79f, 1);
if (this->unkF4_8 == 5) {
timedFunc_set_1(0.9f, (TFQM1) func_80387E40, (s32) this->marker);
} else {
func_80326310(this);
}
if (this->unkF4_8 < 5) {
bgs_D_803907B8[this->unkF4_8]->propPtr->unk8_4 = TRUE;
timedFunc_set_1(1.1f, (TFQM1)func_80387E00, bgs_D_803907B8[this->unkF4_8]);
func_802BAFE4(D_803907B0[this->unkF4_8-1]);
} else {
timedFunc_set_1(0.8f, (TFQM1)func_80387D90, (s32) this->marker);
}
func_802C3D3C(&func_80387D18, this->marker, 0x46);
}
}
}//L80388348
switch(this->state){
case 1:// L80388370
this->unk60 += time_getDelta();
if(0.7 <= this->unk60){
func_80328B8C(this, 2, 0.0f, 1);
func_80387C90(this);
this->unk60 = 0.0f;
func_80324D54(0.1f, SFX_D0_GRIMLET_SQUEAK, 1.0f, 0x7530, this->position, 0.0f, 1800.0f);
}
break;
case 2:// L80388400
if(actor_animationIsAt(this, 0.62f)){
func_80328B8C(this, 3, 0.62f, 1);
}
break;
case 3:// L80388434
this->unk60 += time_getDelta();
if( this->unk60 >= 0.13 + 0.7/4 * (5 - this->unkF4_8)){
func_80328B8C(this, 4, 0.62f, 1);
func_80387C90(this);
this->unk60 = 0.0f;
func_80324D54(0.3f, 0x406, 1.0f, 0x55f0, this->position, 0.0f, 1800.0f);
}
break;
case 4:// L8038850C
if(actor_animationIsAt(this, 0.0f)){
func_80328B8C(this, 1, 0.0f, 1);
}
break;
case 5:// L80388538
func_80328748(this->animctrl, 0.79f, 0.97f);
if( actor_animationIsAt(this, 0.84f)
&& !animctrl_isPlayedForwards(this->animctrl)
&& func_802BB270()
){
func_8030E6A4(SFX_C8_CRUNCH, randf2(0.93f, 1.07f), 22000);
}
break;
case 6:// L803885B0
func_80328748(this->animctrl, 0.79f, 0.97f);
break;
}
}
void bgs_func_803885DC(void){
s32 i;
for(i = 0; i<5; i++)
bgs_D_803907B8[i] = 0;
}
Actor *func_8038860C(ActorMarker *this, Gfx** gdl, Mtx ** mptr, Vtx **vtx){
Actor *thisActor;
thisActor = marker_getActor(this);
func_8033A45C(1, thisActor->unkF4_8);
return func_80325888(this, gdl, mptr, vtx);
}

452
src/BGS/ch/flibbit.c Normal file
View File

@@ -0,0 +1,452 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
u8 unk0;
u8 unk1;
s16 unk2[3];
s16 unk8[3];
s16 unkE[3];
f32 unk14;
f32 unk18;
f32 unk1C[2];
// f32 unk20;
f32 unk24;
}ActorLocal_Flibbit;
extern f32 func_80309724(f32 *);
extern void func_80256E24(f32 [3], f32, f32, f32, f32, f32);
void chflibbit_update(Actor *this);
Actor *chflibbit_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390690 = {
0xC1, 0x133, 0x375,
0, NULL,
chflibbit_update, NULL, chflibbit_draw,
0, 0, 1.0f, 0
};
f32 D_803906B4[3] = {0.0f, 0.0f, 0.0f};
/* .code */
bool func_803863F0(Actor *this, f32 arg1[3], s32 arg2){
ActorLocal_Flibbit *local = (ActorLocal_Flibbit *)&this->local;
local->unk1 = arg2;
local->unk2[0] = this->position[0];\
local->unk2[1] = this->position[1];\
local->unk2[2] = this->position[2];
local->unk8[0] = arg1[0];
local->unk8[1] = arg1[1];
local->unk8[2] = arg1[2];
local->unk8[1] = func_80309724(arg1);
func_80335924(this->unk148, 0xdb, 0.2f,(arg2) ? randf2(0.7f, 0.8f) : randf2(0.75f, 0.85f));
func_80335A8C(this->unk148, 2);
func_80324D54(0.2f, 0x3f2, randf2(0.7f, 1.3f), randi2(0x61A8, 0x6978), this->position, 500.0f, 2500.0f);
return TRUE;
}
bool func_80386564(Actor *this){
f32 plyrPos[3]; //sp54
f32 sp48;
f32 sp44;
f32 sp40;
f32 sp3C[3]; //sp3C
f32 sp30[3]; //sp30
player_getPosition(plyrPos);
func_80258A4C(this->position, this->yaw - 90.0f, plyrPos, &sp48, &sp44, &sp40);
if(func_80329210(this, plyrPos)){
if((-0.7 <= sp40) && (sp40 <= 0.7)){
sp3C[0] = plyrPos[0] - this->position_x;
sp3C[1] = plyrPos[1] - this->position_y;
sp3C[2] = plyrPos[2] - this->position_z;
ml_vec3f_set_length(sp3C,180.0f);
sp30[0] = sp3C[0] + this->position_x;
sp30[1] = sp3C[1] + this->position_y;
sp30[2] = sp3C[2] + this->position_z;
if(func_80329210(this, sp30))
return func_803863F0(this, sp30, 1);
}
}
return 0;
}
s32 func_803866A4(Actor *this) {
f32 sp64[3];
f32 sp60;
f32 sp5C;
f32 sp58;
f32 sp4C[3];
ActorLocal_Flibbit *local = (ActorLocal_Flibbit *)&this->local;
f32 sp3C[3];
sp64[0] = (f32) local->unkE[0];
sp64[1] = (f32) local->unkE[1];
sp64[2] = (f32) local->unkE[2];
func_80258A4C(this->position, this->yaw - 90.0f, sp64, &sp60, &sp5C, &sp58);
if ((-0.9 <= sp58) && (sp58 <= 0.9)) {
if ((f64) sp60 > 216.0) {
sp4C[0] = sp64[0] - this->position[0];
sp4C[1] = sp64[1] - this->position[1];
sp4C[2] = sp64[2] - this->position[2];
ml_vec3f_set_length(sp4C, 180.0f);
sp3C[0] = this->position[0] + sp4C[0];
sp3C[1] = this->position[1] + sp4C[1];
sp3C[2] = this->position[2] + sp4C[2];
} else {
sp3C[0] = (f32) local->unkE[0];
sp3C[1] = (f32) local->unkE[1];
sp3C[2] = (f32) local->unkE[2];
}
if (func_80329210(this, sp3C) != 0) {
return func_803863F0(this, sp3C, 0);
}
}
return 0;
}
bool func_8038686C(Actor *this) {
f32 sp84[3];
f32 sp80;
f32 sp7C;
f32 sp78;
f32 *temp_s2;
f32 sp68[3];
f32 phi_f2;
int i;
player_getPosition(sp84);
func_80258A4C(this->position, this->yaw - 90.0f, sp84, &sp80, &sp7C, &sp78);
for(i = 0; i < 0xA; i++){
if (i < 5) {
if (sp78 > 0.0f) {
phi_f2 = randf2(10.0f, 90.0f) + this->yaw;
} else {
phi_f2 = randf2(-90.0f, -10.0f) + this->yaw;
}
} else {
phi_f2 = randf2(-110.0f, 110.0f) + this->yaw;
}
func_80256E24(sp68, 0.0f, phi_f2, 0.0f, 0.0f, 180.0f);
sp68[0] += this->position[0];
sp68[1] += this->position[1];
sp68[2] += this->position[2];
if (func_80329210(this, sp68)) {
return func_803863F0(this, sp68, 0);
}
}
return FALSE;
}
bool func_80386A34(Actor * this){
f32 plyrPos[3];
bool out;
if(func_803203FC(0xC1))
return 0;
player_getPosition(plyrPos);
if(func_80329210(this, plyrPos)){
if(!(out = func_80386564(this)) && (0.5 < randf ())){
return 0;
}
}else{
out = func_803866A4(this);
}
if(!out)
out = func_8038686C(this);
return out;
}
void func_80386AEC(Actor *this, s32 next_state) {
ActorLocal_Flibbit *local;
local = (ActorLocal_Flibbit *) &this->local;
local->unk1 = FALSE;
local->unk18 = 0.0f;
local->unk24 = 0.0f;
if (next_state == 1) {
func_80335924(this->unk148, ASSET_FA_ANIM_FLIBBIT_IDLE, 0.2f, randf2(1.0f, 2.0f));
func_80335A74(this->unk148, randf2(0.0f, 0.9f));
func_80335A8C(this->unk148, 1);
this->position[0] = (f32) local->unkE[0];
this->position[1] = (f32) local->unkE[1];
this->position[2] = (f32) local->unkE[2];
local->unk24 = randf2(1.0f, 3.0f);
}
if (next_state == 2){
if(!func_80386A34(this)) {
if (this->state != 3) {
next_state = 3;
func_80386AEC(this, next_state);
}
return;
}
}
if (next_state == 3) {
func_80335924(this->unk148, ASSET_FB_ANIM_FLIBBIT_TURN, 0.2f, 1.0f);
func_80335A74(this->unk148, randf2(0.0f, 1.0f));
func_80335A8C(this->unk148, 1);
local->unk24 = randf2(1.0f, 3.0f);
}
if (next_state == 4) {
func_80335924(this->unk148, ASSET_FA_ANIM_FLIBBIT_IDLE, 0.2f, randf2(1.0f, 2.0f));
func_80335A74(this->unk148, randf2(0.0f, 0.9f));
func_80335A8C(this->unk148, 1);
this->position[1] = func_80309724(this->position);
local->unk18 = 1.0f;
}
if (next_state == 5) {
FUNC_8030E8B4(SFX_8E_GRUNTLING_DAMAGE, 1.5f, 32200, this->position, 500, 2500);
func_80335924(this->unk148, ASSET_288_ANIM_FLIBBIT_OW, 0.1f, 0.65f);
func_80335A8C(this->unk148, 2);
this->position[1] = func_80309724(this->position);
local->unk18 = 1.0f;
}
if (next_state == 6) {
func_80335924(this->unk148, ASSET_112_ANIM_FLIBBIT_DIE, 0.2f, 0.4f);
FUNC_8030E8B4(SFX_115_BUZZBOMB_DEATH, 1.0f, 32200, this->position, 500, 2500);
this->marker->collidable = FALSE;
this->unk10_1 = FALSE;
local->unk14 = 1000.0f;
}
if (next_state == 7) {
func_80335924(this->unk148, ASSET_113_ANIM_FLIBBIT_DEAD, 0.2f, 1.0f);
func_80335A8C(this->unk148, 2);
FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 0.8f, 32200, this->position, 500, 2500);
}
if (next_state == 8) {
func_80326310(this);
}
this->state = next_state;
}
void func_80386E30(ActorMarker *this, ActorMarker *other){
Actor *thisActor = marker_getActor(this);
if(thisActor->state < 6){
func_80386AEC(thisActor, 4);
}
}
void func_80386E70(ActorMarker *this, ActorMarker *other){
Actor *thisActor = marker_getActor(this);
if(thisActor->state < 6){
func_80386AEC(thisActor, 5);
}
}
void func_80386EB0(ActorMarker *this, ActorMarker *other){
Actor *thisActor = marker_getActor(this);
if(thisActor->state < 6){
func_80386AEC(thisActor, 6);
}
}
Actor *chflibbit_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this;
ActorLocal_Flibbit *local;
s32 temp_a0;
int i;
f32 sp7C[3];
f32 phi_f2;
this = marker_getActor(marker);
local = (ActorLocal_Flibbit *)&this->local;
if (local->unk0){
if(((this->state == 1)) || (this->state == 3)) {
temp_a0 = func_803356A0(this->unk148);
for(i = 0; i < 2; i++){
if (0.1 <= local->unk1C[i]) {
phi_f2 = (f32) ((local->unk1C[i] - 0.1) / 0.1);
} else if (local->unk1C[i] >= 0.0f) {
phi_f2 = (f32) (1.0 - (local->unk1C[i] / 0.1));
} else {
phi_f2 = 1.0f;
}
sp7C[0] = 1.0f;
// sp7C[1] = 1.0f;
sp7C[2] = 1.0f;
sp7C[1] = (f32) (((f64) phi_f2 * 0.99) + 0.01);
func_8033A928(temp_a0, (i != 0)?0x2D :0x2E, sp7C);
}
}
}
func_80325888(marker, gfx, mtx, vtx);
local->unk0 = marker->unk14_21;
return this;
}
void chflibbit_update(Actor *this){
f32 player_position[3];
f32 spB0[3];
f32 player_distance;
ActorLocal_Flibbit *local = (ActorLocal_Flibbit *)&this->local;
f32 spA4 = time_getDelta();
f32 spA0;
f32 sp9C;
f32 sp98;
f32 sp94;
f32 sp90;
f32 sp84[3];
f32 temp_f12;
f32 sp7C;
f32 sp78;
f32 sp74;
f32 sp68[3];
f32 phi_f2;
f32 sp60;
f32 sp5C;
f32 sp58;
f32 sp4C[3];
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, func_80386E30, func_80386E70, func_80386EB0);
local->unk1C[0] = randf2(-2.0f, -1.0f);
local->unk1C[1] = randf2(-2.0f, -1.0f);
local->unkE[0] = (s16) this->position_x;
local->unkE[1] = (s16) this->position_y;
local->unkE[2] = (s16) this->position_z;
local->unkE[1] = func_80309724(this->position);
func_80386AEC(this, 1);
}
player_getPosition(player_position);
spB0[0] = player_position[0] - this->position[0];
spB0[1] = player_position[1] - this->position[1];
spB0[2] = player_position[2] - this->position[2];
player_distance = gu_sqrtf(spB0[0]*spB0[0] + spB0[1]*spB0[1] + spB0[2]*spB0[2]);
if(func_8025773C(&local->unk24, spA4)){
func_8030E878(0x3f0, randf2(0.9f, 1.1f), randi2(12000, 19000), this->position, 500.0f, 2500.0f);
local->unk24 = randf2(1.0f, 6.0f);
}//L80387274
local->unk1C[0] += spA4;
local->unk1C[0] = (0.2 < local->unk1C[0]) ? randf2(-3.0f, -1.0f) : local->unk1C[0];
local->unk1C[1] += spA4;
local->unk1C[1] = (0.2 < local->unk1C[1]) ? randf2(-3.0f, -1.0f) : local->unk1C[1];
if(this->state == 1){
if(func_80329210(this, player_position)){
func_80386AEC(this, 2);
return;
}
if(player_distance < 2000.0f){
func_80258A4C(this->position, this->yaw - 90.0f, player_position, &spA0, &sp9C, &sp98);
this->yaw += (sp98*90.0f) *spA4;
}
}//L803873D0
if(this->state == 2){
func_8033568C(this->unk148, &sp94, &sp90);
if(sp94 < 0.8 && 0.8 <= sp90){
func_8030E878(SFX_8_BANJO_LANDING_04, randf2(0.8f, 0.9f), randi2(25000, 27000), this->position, 100.0f, 1500.0f);
}//L8038747C
if(func_80335794(this->unk148) > 0){
sp84[0] = (f32)local->unkE[0];
sp84[1] = (f32)local->unkE[1];
sp84[2] = (f32)local->unkE[2];
if(ml_vec3f_distance(this->position, sp84) < 30.0f){
func_80386AEC(this, 1);
}
else{
func_80386AEC(this, 2);
}
}
else{//L80387514
if(0.2 <= sp90 && sp90 <= 0.8){
temp_f12 = ((sp90 - 0.2) / 0.60000000000000009);
this->position_x = local->unk2[0] + (local->unk8[0] - local->unk2[0])*temp_f12;
this->position_y = local->unk2[1] + (local->unk8[1] - local->unk2[1])*temp_f12;
this->position_z = local->unk2[2] + (local->unk8[2] - local->unk2[2])*temp_f12;
if(local->unk1){
if(sp90 <= 0.5){
phi_f2 = ((sp90 - 0.2)/0.3) * 70.0;
}
else{
phi_f2 = (1.0 - (sp90 - 0.5)/ 0.30000000000000004) *70.0;
}
this->position_y += phi_f2;
}//L80387684
sp68[0] = (f32)(local->unk8[0] - local->unk2[0]);
sp68[1] = (f32)(local->unk8[1] - local->unk2[1]);
sp68[2] = (f32)(local->unk8[2] - local->unk2[2]);
func_80258A4C(D_803906B4, this->yaw - 90.0f, sp68, &sp7C, &sp78, &sp74);
this->yaw += (sp74 * 220.0f * spA4);
}
}
}//L80387734
if (this->state == 3) {
func_80258A4C(this->position, this->yaw - 90.0f, player_position, &sp60, &sp5C, &sp58);
this->yaw += sp58 * 90.0f * spA4;
if ((-0.4 <= sp58) && (sp58 <= 0.4) && ((f64) randf() > 0.5)) {
func_80386AEC(this, 2);
}
if ((sp5C < 0.0f) && (randf() > 0.5)) {
func_80386AEC(this, 2);
}
}
if(this->state == 4 || this->state == 5){
if(func_8025773C(&local->unk18, spA4)){
func_80386AEC(this, 3);
}
}
if(this->state == 6){
sp4C[0] = this->position[0] - player_position[0];
sp4C[1] = this->position[1] - player_position[1];
sp4C[2] = this->position[2] - player_position[2];
sp4C[1] = 0.0f;
ml_vec3f_set_length(sp4C, 400.0f * spA4);
this->position[0] = this->position[0] + sp4C[0];
this->position[1] = this->position[1] + sp4C[1];
this->position[2] = this->position[2] + sp4C[2];
this->position_y += local->unk14*spA4;
local->unk14 -= 3000.0f*spA4;
if(this->position_y < func_80309724(this->position)){
this->position_y = func_80309724(this->position);
func_80386AEC(this, 7);
}
}
if(this->state == 7){
if(func_80335794(this->unk148) > 0)
func_80386AEC(this, 8);
}
}

216
src/BGS/ch/leafboat.c Normal file
View File

@@ -0,0 +1,216 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct chleafboat_s{
f32 unk0[3];
f32 unkC[3];
f32 unk18[3];
f32 unk24[3];
f32 unk30[3];
f32 unk3C[3];
f32 unk48[3];
f32 unk54[3];
f32 unk60[3];
f32 unk6C;
} ActorLocal_Leafboat;
void func_8038FD9C(Actor *this);
Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3);
/* .data section */
u8 D_80390DA0[6] = {0, 0, 0, 1, 1, 1};
ActorInfo D_80390DA8 = {0xDA, actor_leafboat, 0x30D,
0x01, NULL,
func_8038FD9C, func_8038FD9C, func_8038FD10,
0, 0, 0.0f, 0
};
/* .code section */
Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3){
Actor * thisActor;
thisActor = marker_getActor(this);
if((thisActor->unk1C_x != 0.0f) && (0x80 < thisActor->alpha_124_19)){
thisActor = func_80325888(this, gdl, mtx, arg3);
}
return thisActor;
}
void func_8038FD88(ActorMarker *this, u32 arg1){
this->unk3E_1 = 1;
}
void func_8038FD9C(Actor *this){
f32 sp64[3];
f32 sp58[3];
ActorLocal_Leafboat *local;
u8 tmp[6] = D_80390DA0;
f32 pad0;
f32 sp44;
f32 sp40;
f32 sp3C;
f32 sp38;
local = (ActorLocal_Leafboat *)&this->local;
if(!this->initialized){
this->initialized = TRUE;
marker_setCollisionScripts(this->marker, func_8038FD88, NULL, NULL);
local->unk6C = randf2(80.0f, 100.0f);
this->unk1C[0] = this->unk1C[1] = this->unk1C[2] = 0.0f;
local->unk0[0] = local->unk0[1] = local->unk0[2] = 0.0f;
local->unkC[0] = local->unkC[1] = local->unkC[2] = 0.0f;
local->unk18[0] = local->unk18[1] = local->unk18[2] = 0.0f;
local->unk24[0] = local->unk24[1] = local->unk24[2] = 0.0f;
local->unk30[0] = local->unk30[1] = local->unk30[2] = 0.0f;
local->unk3C[0] = local->unk3C[1] = local->unk3C[2] = 0.0f;
local->unk48[0] = local->unk48[1] = local->unk48[2] = 0.0f;
local->unk54[0] = this->position_x;
local->unk54[1] = this->position_y;
local->unk54[2] = this->position_z;
local->unk60[0] = this->pitch;
local->unk60[1] = this->yaw;
local->unk60[2] = this->roll;
this->unk60 = 0.0f;
this->velocity_x = 0.0f;
this->unk10_12 = 0;
}
this->position_x = local->unk54[0];
this->position_y = local->unk54[1];
this->position_z = local->unk54[2];
this->pitch = local->unk60[0];
this->yaw = local->unk60[1];
this->roll = local->unk60[2];
switch(this->state){
case 1:
if(this->marker->unk2C_2)
func_80326224(this);
this->marker->propPtr->unk8_3 = 1;
this->unk1C[0] = 1.0f;
this->alpha_124_19 = 0xff;
if(this->unk54 != 0.0f){
func_80328A84(this, 2);
}
break;
case 2:
if(this->marker->unk2C_2)
func_80326224(this);
this->marker->propPtr->unk8_3 = 1;
this->unk1C[0] = 1.0f;
if(15.0f <= this->velocity_x){
func_80328A84(this, 3);
this->velocity_x = 0.0f;
}
else{
if(!tmp[((s32)this->velocity_x)%6])
this->alpha_124_19 -= 0x55;
else
this->alpha_124_19 += 0x55;
this->velocity_x = this->velocity_x + 1.0f;
}
break;
case 3:
if (this->marker->unk2C_2) {
func_80326224(this);
}
this->marker->propPtr->unk8_3 = FALSE;
this->unk1C[0] = 0.0f;
this->alpha_124_19 = 0;
if (this->unk54 == 0.0f) {
func_80328A84(this, 4);
}
break;
case 4:
this->marker->propPtr->unk8_3 = 1;
this->unk1C[0] = 1.0f;
if (this->velocity[0] >= 15.0f) {
func_80328A84(this, 1);
this->velocity[0] = 0.0f;
} else {
if(tmp[5-(((s32)this->velocity_x)%6)]) {
this->alpha_124_19 += 0x55;
} else {
this->alpha_124_19 -= 0x55;
}
this->velocity[0] += 1.0f;
}
break;
}
local->unk54[0] = this->position_x;
local->unk54[1] = this->position_y;
local->unk54[2] = this->position_z;
local->unk60[0] = this->pitch;
local->unk60[1] = this->yaw;
local->unk60[2] = this->roll;
this->unk60 += time_getDelta();
_player_getPosition(&sp58);
if( func_80294660() == 0x100
&& func_8028F20C()
&& this->marker->unk3E_1
){
sp44 = local->unk54[0] - sp58[0];
sp40 = local->unk54[2] - sp58[2];
sp3C = cosf((local->unk60[1] * M_PI) / 180.0);
sp38 = sinf((local->unk60[1] * M_PI) / 180.0);
local->unkC[0] = -((sp44 * sp38) + (sp40 * sp3C)) / 8;
local->unkC[2] = ((sp44 * sp3C) - (sp40 * sp38)) / 8;
if(this->unk10_12){
if(local->unk24[1] < -20.0f){
local->unk30[1] = -7.0f;
}
}
else{
local->unk30[1] = -32.0f;
}
this->unk10_12 = 1;
} else {
local->unkC[0] = local->unkC[1] = local->unkC[2] = 0.0f;
if(!this->unk10_12){
if(local->unk24[1] > 5.0f){
local->unk30[1] = 0.0f;
}
}
else{
local->unk30[1] = 10.0f;
}
this->unk10_12 = 0;
}
this->marker->unk3E_1 = 0;
local->unk18[1] = 10 * sinf((((this->unk60 * local->unk6C) / 180.0) * RARE_PI));
this->unk1C[0] = 4.5 * cosf((((this->unk60 * local->unk6C) / 180.0) * RARE_PI));
this->unk1C[1] = 2*sinf((((this->unk60 * local->unk6C) / 180.0) * RARE_PI));
sp64[0] = local->unk3C[0] + local->unk24[0];
sp64[1] = local->unk3C[1] + local->unk24[1];
sp64[2] = local->unk3C[2] + local->unk24[2];
sp64[0] = sp64[0] + local->unk18[0];
sp64[1] = sp64[1] + local->unk18[1];
sp64[2] = sp64[2] + local->unk18[2];
this->position[0] = this->position[0] + sp64[0];
this->position[1] = this->position[1] + sp64[1];
this->position[2] = this->position[2] + sp64[2];
local->unk0[2] += (local->unkC[2] - local->unk0[2]) * 0.075;
local->unk0[0] += (local->unkC[0] - local->unk0[0]) * 0.075;
local->unk24[1] += (local->unk30[1] - local->unk24[1]) * 0.2;
sp64[0] = local->unk48[0] + this->unk1C[0];
sp64[1] = local->unk48[1] + this->unk1C[1];
sp64[2] = local->unk48[2] + this->unk1C[2];
sp64[0] = sp64[0] + local->unk0[0];
sp64[1] = sp64[1] + local->unk0[1];
sp64[2] = sp64[2] + local->unk0[2];
this->pitch += sp64[0];
this->yaw += sp64[1];
this->roll += sp64[2];
}

453
src/BGS/ch/mrvile.c Normal file
View File

@@ -0,0 +1,453 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "prop.h"
void func_80335A24(void *, u32, f32, f32);
void set_model_render_mode(u32);
Actor *chvile_draw(ActorMarker*, Gfx **, Mtx **, Vtx **);
void chvile_update(Actor *);
void func_8038BB40(ActorMarker *);
extern void func_80335A80(void *, f32);
extern bool func_80320C94(f32[3], f32[3], f32, f32[3], s32, u32);
extern bool chvilegame_find_closest_piece(ActorMarker *, f32[3], f32, f32[3]);
typedef struct chmrvile_s{
u8 unk0;
// u8 pad1[0x3];
BKModelBin *unk4; //yumblie_model
ActorMarker *game_marker; //game_marker
u8 unkC;
// u8 padD[0x3];
f32 unk10; //movement_speed
f32 unk14; //yumblie_eating_timer
f32 target_position[3]; //target_position
f32 unk24;
f32 unk28[3]; //target_rotation?
} ActorLocal_MrVile;
/* .data */
ActorInfo D_80390A70 = {0xC8, 0x13A, 0x373, 0x00, NULL,
chvile_update, NULL, chvile_draw,
0, 0, 0.0f, 0
};
f32 D_80390A94[7] = {0.0f, 0.8f, 0.9f, 1.0f, 0.9f, 0.95f, 1.0f};
/* .code */
void func_8038B9F0(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3, s32 arg4) {
f32 sp64[3];
f32 pad60;
f32 sp54[3];
f32 pad50;
f32 sp44[3];
f32 sp38[3];
f32 sp2C[3];
f32 var_f0;
sp44[0] = arg0[0];
sp44[1] = arg0[1] + arg2;
sp44[2] = arg0[2];
sp38[0] = arg1[0];
sp38[1] = arg1[1] + arg2;
sp38[2] = arg1[2];
sp2C[0] = sp38[0];
sp2C[1] = sp38[1];
sp2C[2] = sp38[2];
if (func_80320C94(sp44, sp38, arg3, sp54, 3, arg4)) {
sp64[0] = sp38[0] - sp2C[0];
sp64[1] = sp38[1] - sp2C[1];
sp64[2] = sp38[2] - sp2C[2];
var_f0 = sp54[0]*sp64[0] + sp54[1]*sp64[1] + sp54[2]*sp64[2];
if (var_f0 < 1.0f) {
var_f0 = 1.0f;
}
ml_vec3f_set_length(sp54, var_f0);
arg1[0] = arg1[0] + sp54[0];
arg1[1] = arg1[1] + sp54[1];
arg1[2] = arg1[2] + sp54[2];
}
}
void func_8038BB40(ActorMarker * arg0){
Actor *this;
ActorLocal_MrVile *local;
this = marker_getActor(arg0);
local = (ActorLocal_MrVile *)&this->local;
if(func_8038A9E0(local->game_marker) >= 3){
item_set(ITEM_14_HEALTH, 0);
func_8028F66C(0xF);
}
else{
item_dec(ITEM_14_HEALTH);
func_8028F590(4, arg0);
}
}
void func_8038BBA0(Actor *this, s32 arg1){
ActorLocal_MrVile *local;
local = (ActorLocal_MrVile *)&this->local;
local->unk14 = 0.0f;
if(arg1 == 101){
local->unk24 = 0.0f;
local->unk28[0] = local->unk28[1] = local->unk28[2] = 0.0f;
func_80335924(this->unk148, 0xe1, 0.10000000149f, 1.0f); //0xe1 = croc_idle
}
if(arg1 == 102){
if(local->unk24 < 100.0f){
local->unk24 = 100.0f;
};
func_80335A24(this->unk148, 0xe0, 0.1f, 0.5f); //0xe1 = croc_walk
}
if(arg1 == 103){
func_80335A24(this->unk148, 0x124, 0.1f, 0.5f); //0x124 = croc_munch
if(this->state == 4){
timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 0x61A8);
timedFunc_set_1(0.31f, func_8038BB40, this->marker);
}
else{
timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 0x61A8);
timed_playSfx(0.81f, SFX_4C_LIP_SMACK, 0.93f, 0x61A8);
timed_playSfx(1.31f, SFX_4C_LIP_SMACK, 0.91f, 0x61A8);
}
}
if(arg1 == 104){
local->unk14 = 1.0f;
timed_playSfx(randf2(1.2f, 1.3f), SFX_97_BLUBBER_BURPS, randf2(0.8f, 1.1f), randi2(25000, 32000));
}
local->unkC = arg1;
}
void func_8038BD84(Actor *this){
ActorLocal_MrVile *local;
local = (ActorLocal_MrVile *)&this->local;
local->unkC = 100;
local->unk10 = 0.0f;
local->unk14 = 0.0f;
local->unk24 = 0.0f;
local->target_position[0] = 0.0f;
local->target_position[1] = 0.0f;
local->target_position[2] = 0.0f;
local->unk28[0] = 0.0f;
local->unk28[1] = 0.0f;
local->unk28[2] = 0.0f;
func_8038BBA0(this, 101);
}
void func_8038BDD4(Actor *this) {
ActorLocal_MrVile *local;
f32 sp60[3];
f32 sp5C;
f32 sp58;
f32 sp54;
f32 sp50;
f32 sp44[3];
f32 temp_f0_3;
local = (ActorLocal_MrVile *)&this->local;
sp5C = time_getDelta();
sp60[0] = this->position[0];
sp60[1] = this->position[1];
sp60[2] = this->position[2];
func_8025773C(&local->unk14, sp5C);
if ((local->unkC == 102) || (local->unkC == 103) || (local->unkC == 104)) {
sp44[0] = 0.0f;
sp44[1] = 0.0f;
sp44[2] = local->unk24 * sp5C;
ml_vec3f_yaw_rotate_copy(sp44, sp44, this->yaw);
this->position[0] = this->position[0] + sp44[0];
this->position[1] = this->position[1] + sp44[1];
this->position[2] = this->position[2] + sp44[2];
this->pitch += local->unk28[0] * sp5C;
this->yaw += local->unk28[1] * sp5C;
this->roll += local->unk28[2] * sp5C;
func_80258A4C(this->position, this->yaw - 90.0f, local->target_position, &sp58, &sp54, &sp50);
if ((sp54 > 0.0f) && (sp58 > 200.0f)) {
local->unk24 += 100.0f * sp5C;
}
if ((sp54 < 0.0f) && (sp58 > 100.0f)) {
local->unk24 -= 100.0f * sp5C;
}
local->unk24 = (local->unk24 < 10.0f) ? 10.0f
: (local->unk10 < local->unk24) ? local->unk10
: local->unk24;
func_80335A80(this->unk148, (200.0f / local->unk24) * 0.5);
local->unk28[1] = sp50 * 200.0f;
temp_f0_3 = func_80309724(this->position);
if (temp_f0_3 > 125.0f) {
this->position[1] = 125.0f;
} else if (temp_f0_3 > 80.0f) {
this->position[1] = temp_f0_3;
} else {
this->position[1] = 0.0f;
}
}
if (this->position[1] > 100.0f) {
func_8038B9F0(&sp60, this->position, 90.0f, 70.0f, 0);
}
}
void func_8038C0C8(Actor * this, s32 next_state){
ActorLocal_MrVile *local;
local = (ActorLocal_MrVile *)&this->local;
if(next_state == 1)
func_8038BBA0(this, 101);
if(next_state == 2)
func_8038BBA0(this, 101);
if(next_state == 3)
func_8038BBA0(this, 102);
if(next_state == 4)
func_8038BBA0(this, 102);
if(next_state == 5){
local->target_position[0] = local->target_position[1] = local->target_position[2] = 0.0f;
func_8038BBA0(this, 102);
}
if(next_state == 6){
local->target_position[0] = local->target_position[1] = local->target_position[2] = 0.0f;
local->unk24 = 300.0f;
func_8038BBA0(this, 102);
}
this->state = next_state;
}
Actor *chvile_draw(ActorMarker *marker, Gfx **gfx, Mtx** mtx, Vtx **vtx){
Actor *this;
ActorLocal_MrVile *local;
f32 sp34[3];
this = func_80325888(marker, gfx, mtx, vtx);
local = (ActorLocal_MrVile *)&this->local;
if (
(local->unkC == 104) &&
(local->unk14 > 0.0f)
&& (this->marker->unk14_21)
) {
func_8034A174(func_80329934(), 5, &sp34);
sp34[1] -= 30.0f;
set_model_render_mode(1);
func_803391A4(gfx, mtx, &sp34, 0, local->unk14, 0, local->unk4);
}
return this;
}
//chvile_get_position
f32 *func_8038C284(ActorMarker *marker){
Actor *this;
this = marker_getActor(marker);
return this->position;
}
bool func_8038C2A8(ActorMarker *marker) {
f32 sp24[3];
Actor *this;
ActorLocal_MrVile *local;
this = marker_getActor(marker);
local = (ActorLocal_MrVile *)&this->local;
player_getPosition(&sp24);
if (this->state == 6) {
return ml_vec3f_distance(this->position, &sp24) < 150.0f;
}
return local->unk0 == 1;
}
bool func_8038C338(ActorMarker *marker){
Actor *this;
this = marker_getActor(marker);
return this->state == 1;
}
void chvile_free(Actor *this){
ActorLocal_MrVile *local;
local = (ActorLocal_MrVile *)&this->local;
assetcache_release(local->unk4);
}
void func_8038C384(ActorMarker *marker){
Actor *this;
this = marker_getActor(marker);
func_8038C0C8(this, 4);
}
void func_8038C3B0(ActorMarker *marker){
Actor *this;
this = marker_getActor(marker);
func_8038C0C8(this, 2);
}
void func_8038C3DC(ActorMarker *marker){
Actor *this;
this = marker_getActor(marker);
func_8038C0C8(this, 3);
}
void func_8038C408(ActorMarker *marker){
Actor *this;
this = marker_getActor(marker);
func_8038C0C8(this, 5);
}
void func_8038C434(ActorMarker *marker){
Actor *this;
this = marker_getActor(marker);
func_8038C0C8(this, 6);
}
void func_8038C460(ActorMarker *arg0){
func_8038C0C8(marker_getActor(arg0), 1);
}
void chvile_update(Actor *this) {
ActorLocal_MrVile *local;
bool var_v1;
f32 sp94;
f32 sp90;
f32 temp_a0;
f32 temp_f0;
f32 sp84;
f32 sp80;
f32 sp7C;
s32 temp_v0;
s32 i;
f32 sp70;
f32 sp6C;
f32 sp68;
f32 sp50;
f32 sp58[3];
local = (ActorLocal_MrVile *)&this->local;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->unk30 = chvile_free;
local->unk0 = 0;
local->unk4 = assetcache_get(0x3F6);
local->game_marker = NULL;
func_8038BD84(this);
func_8038C0C8(this, 1);
return;
}
if (local->game_marker == NULL) {
local->game_marker = func_80326D68(this->position, 0x138, -1, &sp90)->marker;
}
player_getPosition(&sp94);
sp90 = ml_vec3f_distance(this->position, &sp94);
if (sp90 <= 300.0f) {
local->unk0 = (local->unk0 == 0) ? 1 : 2;
} else if (sp90 > 300.0f) {
local->unk0 = 0U;
}
if (this->state == 2) {
func_80258A4C(this->position, this->yaw - 90.0f, &sp94, &sp84, &sp80, &sp7C);
if (((sp84 > 50.0f) && (0.05 < sp7C)) || (sp7C < -0.05)) {
this->yaw += sp7C * 20.0f;
} else {
func_8038C0C8(this, 1);
}
}
if (this->state == 3) {
var_v1 = chvilegame_find_closest_piece(local->game_marker, this->position, this->yaw, local->target_position) && mapSpecificFlags_get(6);
if (!var_v1) {
local->target_position[0] = 0.0f;
local->target_position[1] = 0.0f;
local->target_position[2] = 0.0f;
}
if (local->game_marker != NULL) {
temp_v0 = chvilegame_get_score_difference(local->game_marker);
if (temp_v0 >= 2) {
local->unk10 = 200.0f;
} else if (temp_v0 >= 0) {
local->unk10 = 310.0f;
} else if (temp_v0 >= -2) {
local->unk10 = 350.0f;
} else {
local->unk10 = 450.0f;
}
local->unk10 *= D_80390A94[func_8038A9E0(local->game_marker)];
}
if (func_8038A9E0(local->game_marker) < 7) {
func_80258A4C(this->position, this->yaw - 90.0f, local->target_position, &sp70, &sp6C, &sp68);
if (local->unkC == 102) {
if ((-0.8 < sp68) && (sp68 < 0.8) && (sp70 <= 150.0f) && var_v1) {
func_8038BBA0(this, 103);
}
}
if (local->unkC == 103) {
if (sp70 <= 50.0f) {
if (chvilegame_cpu_consume_piece(local->game_marker, local->target_position)) {
func_8038BBA0(this, 104);
} else {
func_8038BBA0(this, 102);
}
} else if (func_80335794(this->unk148) >= 3) {
func_8038BBA0(this, 102);
}
}
if ((local->unkC == 104) && (func_80335794(this->unk148) >= 3)) {
func_8038BBA0(this, 102);
}
}
}
if (this->state == 4) {
player_getPosition(local->target_position);
local->unk10 = 500.0f;
if ((local->unkC == 102) && (ml_vec3f_distance(this->position, local->target_position) < 200.0f)) {
func_8038BBA0(this, 103);
}
if ((local->unkC == 103) && (func_80335794(this->unk148) >= 2)) {
func_8038C0C8(this, 1);
}
}
if (this->state == 5) {
local->unk10 = 200.0f;
if (ml_vec3f_distance(this->position, local->target_position) < 100.0f) {
local->target_position[0] = randf2(-500.0f, 500.0f);
local->target_position[1] = 0.0f;
local->target_position[2] = randf2(-500.0f, 500.0f);
}
}
if ((this->state == 6)){
local->unk10 = 400.0f;
if((ml_vec3f_distance(this->position, local->target_position) < 100.0f) || (ml_vec3f_distance(&sp94, local->target_position) < 300.0f)) {
for(i = 0; i < 10; i++){
sp58[0] = randf2(-500.0f, 500.0f);
sp58[1] = 0.0f;
sp58[2] = randf2(-500.0f, 500.0f);
if ((i == 0) || (ml_vec3f_distance(&sp94, &sp58) > ml_vec3f_distance(&sp94, local->target_position))) {
local->target_position[0] = sp58[0];
local->target_position[1] = sp58[1];
local->target_position[2] = sp58[2];
}
};
}
}
func_8038BDD4(this);
if (this->state != 4) {
func_8028E668(this->position, 100.0f, -50.0f, 120.0f);
}
}

199
src/BGS/ch/tanktup.c Normal file
View File

@@ -0,0 +1,199 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "prop.h"
void func_80324E88(f32);
void timedFunc_set_2(f32, void(*)(s32, s32), s32, s32);
void func_8028E668(f32[3], f32, f32, f32);
extern void func_802C3E10(void(*arg0)(void), ActorMarker *, s32, s32);
void func_8038F6A4(Actor *);
/* .data */
ActorAnimationInfo D_80390C20[] = {
{0, 0.0f},
{0x101, 7.5f},
{0x102, 1.75f},
{0x107, 1.75f}
};
ActorInfo D_80390C40 = {0x6C, 0xE8, 0x3EE, 0x01, D_80390C20,
func_8038F6A4, func_80326224, func_80325888,
0, 0x80, 0.0f, 0
};
/* .code */
void func_8038F470(ActorMarker *this, s32 arg1, s32 arg2){
Actor* thisActor;
f32 pad;
Actor* sp24;
f32 sp18[3];
thisActor = marker_getActor(this);
sp18[0] = thisActor->position_x;
sp18[1] = thisActor->position_y;
sp18[2] = thisActor->position_z;
sp18[1] += 50.0f;
sp24 = func_8032813C(arg2 + 0xe9, sp18, (s32)thisActor->yaw);
func_80328B8C(sp24, arg1 + 1, 0, -1);
sp24->unk10_12 = arg2;
}
void func_8038F51C(Actor *this){
Actor * spawnPtr;
spawnPtr = func_80326D68(this->position, 0xe8, -1, 0);
spawnPtr->tanktup.unk0[this->unk10_12] = 1;
spawnPtr->tanktup.unk10 = 1;
}
s32 func_8038F570(s16 *arg0){
f32 pos[3];
Actor * spawnPtr;
pos[0] = (f32)arg0[0];
pos[1] = (f32)arg0[1];
pos[2] = (f32)arg0[2];
spawnPtr = func_80326D68(pos, 0xe8, -1, 0);
return spawnPtr->state == 3;
}
void func_8038F5E4(s32 arg0, s32 arg1, s32 arg2){
func_80324E88(0.0f);
}
void func_8038F610(Actor *this) {
f32 sp24[3];
func_8034A174(this->marker->unk44, 8, &sp24);
if (func_80258368(&sp24) != 0) {
func_8028E668(&sp24, 200.0f, -600.0f, 300.0f);
}
func_8034A174(this->marker->unk44, 7, &sp24);
if (func_80258368(&sp24) != 0) {
func_8028E668(&sp24, 200.0f, -600.0f, 200.0f);
}
}
extern f32 D_803911B0;
extern f32 D_803911B4;
void func_8028F94C(s32, f32[3]);
void func_8028F918(s32);
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/BGS/ch/tanktup/func_8038F6A4.s")
#else
void func_8038F6A4(Actor *this) {
f32 sp48[3];
s32 sp44;
f32 sp34[3];
Prop *temp_v0;
ActorLocal_TanktupBody * local = (ActorLocal_TanktupBody *)&this->local;
if(!this->initialized){
temp_v0 = func_80304C38(0x32B, this);
if (temp_v0 == NULL) {
local->unk18[0] = D_803911B0;
local->unk18[1] = 100.0f;
local->unk18[2] = D_803911B4;
} else {
nodeprop_getPosition(temp_v0, local->unk18);
}
this->unk138_24 = FALSE;
this->initialized = TRUE;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
this->scale = 1.0f;
for(sp44 = 0; sp44 < 4; sp44++){
if (local->unk0[sp44] == 0) {
func_802C3E10(&func_8038F470, this->marker, local->unk0[sp44], sp44);
}
}
}
switch(this->state){
case 1:
func_8038F610(this);
player_getPosition(&sp48);
if (!this->unk138_24) {
if( ml_vec3f_distance(local->unk18, &sp48) < 250.0f
&& ml_vec3f_distance(local->unk18, &sp48) > 80.0f
&& !func_8028ECAC()
&& player_getTransformation() == TRANSFORM_1_BANJO
) {
func_80311480(0xC7E, 0, NULL, NULL, NULL, NULL);
this->unk138_24 = TRUE;
}
}
if (local->unk10) {
func_80328B8C(this, 2, 0.0f, -1);
local->unk10 = 0;
local->unk14 = TRUE;
for(sp44 = 0; sp44 < 4; sp44++){
if(local->unk0[sp44] == 0){
local->unk14 = FALSE;
}
}
if(!this->unk138_23 && !local->unk14){
if(func_80311480(0xC80, 0, NULL, NULL, NULL, NULL))
this->unk138_23 = TRUE;
}
}
break;
case 2:
func_8038F610(this);
if (actor_animationIsAt(this, 0.6f) && local->unk14) {
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
func_8028F94C(2, local->unk18);
}
if (actor_animationIsAt(this, 0.99f)) {
if (!local->unk14) {
func_80328B8C(this, 1, 0.0f, -1);
}
else{
func_80328B8C(this, 3, 0.0f, -1);
actor_playAnimationOnce(this);
}
}
break;
case 3:
if (actor_animationIsAt(this, 0.1f) != 0) {
timed_setCameraToNode(0.0f, 0xD);
}
if (actor_animationIsAt(this, 0.55f) != 0) {
func_8030E624(0x797FF885U);
}
if (actor_animationIsAt(this, 0.4f) != 0) {
func_8034A174(this->marker->unk44, 6, sp34);
func_802C8F70(this->yaw);
sp34[1] -= 125.0f;
jiggySpawn(JIGGY_26_BGS_TANKTUP, sp34);
}
if (actor_animationIsAt(this, 0.9f) != 0) {
func_8028F918(0);
if (jiggyscore_isCollected(JIGGY_26_BGS_TANKTUP) == 0) {
func_80311480(0xC7F, 0xF, this->position, this->marker, func_8038F5E4, NULL);
}
else{
func_8038F5E4(this->marker, 0xC7F, -1);
}
}
break;
}
}
#endif

496
src/BGS/ch/yellowflibbit.c Normal file
View File

@@ -0,0 +1,496 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
u8 unk0;
u8 unk1;
u8 unk2;
u8 pad3[1];
s16 unk4[3];
s16 unkA[3];
s16 unk10[3];
u8 pad16[0x2];
f32 unk18;
f32 unk1C;
f32 unk20[2];
f32 unk28;
}ActorLocal_Yellow_Flibbit;
Actor *func_8038DE5C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx** vtx);
void func_8038E034(Actor *this);
/* .data */
ActorInfo D_80390AE0 = {
0xC5, 0x137, 0x385,
0, NULL,
func_8038E034, NULL, func_8038DE5C,
0, 0, 1.0f, 0
};
s32 D_80390B04[3] = {0xFF, 0xB3, 0};
f32 D_80390B10[3] = {0.0f, 0.0f, 0.0f};
/* .code */
void func_8038D1E0(Actor *this) {
ParticleEmitter *temp_s0;
temp_s0 = partEmitList_pushNew(4U);
particleEmitter_setSprite(temp_s0, ASSET_70E_SPRITE_SMOKE_2);
func_802EFA5C(temp_s0, 0.01f, 0.7f);
particleEmitter_setStartingFrameRange(temp_s0, 0, 7);
particleEmitter_setPosition(temp_s0, this->position);
func_802EFFA8(temp_s0, D_80390B04);
func_802EFB70(temp_s0, 1.0f, 1.5f);
func_802EFB84(temp_s0, 2.5f, 3.0f);
particleEmitter_setParticleVelocityRange(temp_s0, -70.0f, 50.0f, -70.0f, 70.0f, 100.0f, 70.0f);
func_802EFEC0(temp_s0, 3.0f, 4.0f);
particleEmitter_emitN(temp_s0, 4);
FUNC_8030E8B4(SFX_30_MAGIC_POOF, 1.0f, 25000, this->position, 500, 2500);
}
s32 func_8038D2F4(Actor *this, f32 *arg1, bool arg2) {
ActorLocal_Yellow_Flibbit *local;
local = (ActorLocal_Yellow_Flibbit *)&this->local;
local->unk1 = arg2;
local->unk4[0] = (s16) this->position[0];\
local->unk4[1] = (s16) this->position[1];\
local->unk4[2] = (s16) this->position[2];
local->unkA[0] = (s16) arg1[0];
local->unkA[1] = (s16) arg1[1];
local->unkA[2] = (s16) arg1[2];
local->unkA[1] = (s16) (s32) func_80309724(arg1);
func_80335924(this->unk148, ASSET_DB_ANIM_FLIBBIT_HOP, 0.2f, (arg2) ? randf2(0.7f, 0.8f) : randf2(0.7f, 0.8f));
func_80335A8C(this->unk148, 2);
func_80324D54(0.2f, SFX_3F2_UNKNOWN, randf2(0.7f, 1.3f), randi2(25000, 27000), this->position, 500.0f, 2500.0f);
return TRUE;
}
bool func_8038D468(Actor *this) {
f32 player_position[3];
f32 sp50;
f32 sp4C;
f32 sp48;
f32 sp3C[3];
f32 sp30[3];
player_getPosition(player_position);
func_80258A4C(this->position, this->yaw - 90.0f, player_position, &sp50, &sp4C, &sp48);
if (func_80329210(this, &player_position)) {
if ((-0.7 <= sp48) && (sp48 <= 0.7)) {
sp3C[0] = player_position[0] - this->position[0];
sp3C[1] = player_position[1] - this->position[1];
sp3C[2] = player_position[2] - this->position[2];
ml_vec3f_set_length(sp3C, 210.0f);
sp30[0] = this->position[0] + sp3C[0];
sp30[1] = this->position[1] + sp3C[1];
sp30[2] = this->position[2] + sp3C[2];
if (func_80329210(this, sp30)) {
return func_8038D2F4(this, sp30, 1);
}
}
}
return FALSE;
}
bool func_8038D5A8(Actor *this) {
f32 sp64[3];
f32 sp60;
f32 sp5C;
f32 sp58;
f32 sp4C[3];
ActorLocal_Yellow_Flibbit *local;
f32 sp3C[3];
local = (ActorLocal_Yellow_Flibbit *)&this->local;
sp64[0] = (f32) local->unk10[0];
sp64[1] = (f32) local->unk10[1];
sp64[2] = (f32) local->unk10[2];
func_80258A4C(this->position, this->yaw - 90.0f, sp64, &sp60, &sp5C, &sp58);
if ((-0.9 <= sp58) && (sp58 <= 0.9)) {
if (252.0 < sp60) {
sp4C[0] = sp64[0] - this->position[0];
sp4C[1] = sp64[1] - this->position[1];
sp4C[2] = sp64[2] - this->position[2];
ml_vec3f_set_length(sp4C, 210.0f);
sp3C[0] = this->position[0] + sp4C[0];
sp3C[1] = this->position[1] + sp4C[1];
sp3C[2] = this->position[2] + sp4C[2];
} else {
sp3C[0] = (f32) local->unk10[0];
sp3C[1] = (f32) local->unk10[1];
sp3C[2] = (f32) local->unk10[2];
}
if (func_80329210(this, sp3C) != 0) {
return func_8038D2F4(this, sp3C, 0);
}
}
return FALSE;
}
s32 func_8038D768(Actor *this) {
f32 player_position[3];
f32 sp80;
f32 sp7C;
f32 sp78;
s32 var_s1;
f32 sp68[3];
f32 var_f2;
player_getPosition(player_position);
func_80258A4C(this->position, this->yaw - 90.0f, player_position, &sp80, &sp7C, &sp78);
for(var_s1 = 0; var_s1 != 10; var_s1++){
if (var_s1 < 5) {
if (sp78 > 0.0f) {
var_f2 = randf2(10.0f, 90.0f) + this->yaw;
} else {
var_f2 = randf2(-90.0f, -10.0f) + this->yaw;
}
} else {
var_f2 = randf2(-110.0f, 110.0f) + this->yaw;
}
func_80256E24(sp68, 0.0f, var_f2, 0.0f, 0.0f, 210.0f);
sp68[0] = this->position[0] + sp68[0];
sp68[1] = this->position[1] + sp68[1];
sp68[2] = this->position[2] + sp68[2];
if (func_80329210(this, sp68)) {
return func_8038D2F4(this, sp68, 0);
}
}
return FALSE;
}
bool func_8038D930(Actor *this) {
f32 player_position[3];
s32 var_v1;
player_getPosition(player_position);
if (func_80329210(this, &player_position)) {
var_v1 = func_8038D468(this);
if (var_v1 == 0) {
if (randf() > 0.5) {
return FALSE;
}
}
}
else{
var_v1 = func_8038D5A8(this);
}
if (var_v1 == 0) {
var_v1 = func_8038D768(this);
}
return var_v1;
}
void func_8038D9D0(Actor *this, s32 next_state) {
ActorLocal_Yellow_Flibbit *local;
local = (ActorLocal_Yellow_Flibbit *)&this->local;
local->unk1 = 0;
local->unk1C = 0.0f;
local->unk28 = 0.0f;
if (next_state == 1) {
if (this->state != 0) {
func_8038CEB8();
func_8038D1E0(this);
}
actor_collisionOff(this);
}
if (next_state == 2) {
func_8038CE88();
func_8038D1E0(this);
local->unk1C = 0.5f;
}
if (next_state == 3) {
func_80335924(this->unk148, ASSET_FA_ANIM_FLIBBIT_IDLE, 0.2f, randf2(1.0f, 2.0f));
func_80335A74(this->unk148, randf2(0.0f, 0.9));
func_80335A8C(this->unk148, 1);
actor_collisionOn(this);
this->position[0] = (f32) local->unk10[0];
this->position[1] = (f32) local->unk10[1];
this->position[2] = (f32) local->unk10[2];
local->unk28 = randf2(1.0f, 3.0f);
}
if (next_state == 5) {
if (mapSpecificFlags_get(0x10)) {
func_8038D9D0(this, 4);
return;
}
if (!func_8038D930(this)){
if ((this->state != 6)) {
func_8038D9D0(this, 6);
}
return;
}
}
if (next_state == 6) {
func_80335924(this->unk148, ASSET_FB_ANIM_FLIBBIT_TURN, 0.2f, 1.0f);
func_80335A74(this->unk148, randf2(0.0f, 1.0f));
func_80335A8C(this->unk148, 1);
local->unk28 = randf2(1.0f, 3.0f);
}
if (next_state == 7) {
func_80335924(this->unk148, ASSET_FA_ANIM_FLIBBIT_IDLE, 0.2f, randf2(1.0f, 2.0f));
func_80335A74(this->unk148, randf2(0.0f, 0.9));
func_80335A8C(this->unk148, 1);
this->position[1] = func_80309724(this->position);
local->unk1C = 1.0f;
}
if (next_state == 8) {
FUNC_8030E8B4(SFX_8E_GRUNTLING_DAMAGE, 1.5f, 32200, this->position, 500, 2500);
func_80335924(this->unk148, ASSET_288_ANIM_FLIBBIT_OW, 0.1f, 0.65f);
func_80335A8C(this->unk148, 2);
this->position[1] = func_80309724(this->position);
local->unk1C = 1.0f;
}
if (next_state == 9) {
func_80335924(this->unk148, ASSET_112_ANIM_FLIBBIT_DIE, 0.2f, 0.4f);
FUNC_8030E8B4(SFX_115_BUZZBOMB_DEATH, 1.0f, 32200, this->position, 500, 2500);
this->marker->collidable = FALSE;
this->unk10_1 = FALSE;
func_8038CEA0();
local->unk18 = 1000.0f;
}
if (next_state == 0xA) {
func_80335924(this->unk148, ASSET_113_ANIM_FLIBBIT_DEAD, 0.2f, 1.0f);
func_80335A8C(this->unk148, 2);
FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 0.8f, 32200, this->position, 500, 2500);
}
if (next_state == 0xB) {
func_80326310(this);
}
this->state = next_state;
}
void func_8038DD9C(ActorMarker *marker, ActorMarker *other_marker){
Actor *this;
this = marker_getActor(marker);
if(this->state < 9){
func_8038D9D0(this, 7);
}
}
void func_8038DDDC(ActorMarker *marker, ActorMarker *other_marker){
Actor *this;
this = marker_getActor(marker);
if(this->state < 9){
func_8038D9D0(this, 8);
}
}
void func_8038DE1C(ActorMarker *marker, ActorMarker *other_marker){
Actor *this;
this = marker_getActor(marker);
if(this->state < 9){
func_8038D9D0(this, 9);
}
}
Actor *func_8038DE5C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Actor *this;
ActorLocal_Yellow_Flibbit *local;
s32 var_s0;
f32 var_f2;
f32 sp7C[3];
s32 temp_a0_2;
this = marker_getActor(marker);
local = (ActorLocal_Yellow_Flibbit *)&this->local;
if (this->state < 3) {
return this;
}
if (local->unk0 && ((this->state == 3) || (this->state == 6))) {
temp_a0_2 = func_803356A0(this->unk148);
for(var_s0 = 0; var_s0 < 2; var_s0++){
if (0.1 <= local->unk20[var_s0]) {
var_f2 = (f32) ((local->unk20[var_s0] - 0.1) / 0.1);
} else if (local->unk20[var_s0] >= 0.0f) {
var_f2 = (f32) (1.0 - (local->unk20[var_s0] / 0.1));
} else {
var_f2 = 1.0f;
}
sp7C[0] = 1.0f;
sp7C[1] = var_f2 * 0.99 + 0.01;
sp7C[2] = 1.0f;
func_8033A928(temp_a0_2, (var_s0 != 0) ? 0x2D : 0x2E, sp7C);
};
}
func_80325888(marker, gfx, mtx, vtx);
local->unk0 = marker->unk14_21;
return this;
}
void func_8038E034(Actor *this) {
f32 spB4[3];
f32 spA8[3];
f32 spA4;
ActorLocal_Yellow_Flibbit *local = (ActorLocal_Yellow_Flibbit *)&this->local;
f32 sp9C;
f32 sp98;
f32 sp94;
f32 sp90;
f32 sp8C;
f32 sp88;
f32 sp7C[3];
f32 temp_f12;
f32 sp74;
f32 sp70;
f32 sp6C;
f32 sp60[3];
f32 sp5C;
f32 sp58;
f32 sp54;
f32 sp48[3];
sp9C = time_getDelta();
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, &func_8038DD9C, &func_8038DDDC, &func_8038DE1C);
local->unk2 = 0U;
local->unk20[0] = randf2(-2.0f, -1.0f);
local->unk20[1] = randf2(-2.0f, -1.0f);
local->unk10[0] = (s16) (s32) this->position[0];
local->unk10[1] = (s16) (s32) this->position[1];
local->unk10[2] = (s16) (s32) this->position[2];
func_8038D9D0(this, 1);
if (jiggyscore_isSpawned(JIGGY_24_BGS_FLIBBITS) != 0) {
marker_despawn(this->marker);
}
return;
}
if (!local->unk2) {
local->unk2 = TRUE;
func_8038CED0();
}
player_getPosition(spB4);
spA8[0] = spB4[0] - this->position[0];
spA8[1] = spB4[1] - this->position[1];
spA8[2] = spB4[2] - this->position[2];
spA4 = gu_sqrtf(spA8[0]*spA8[0] + spA8[1]*spA8[1] + spA8[2]*spA8[2]);
if (func_8025773C(&local->unk28, sp9C) != 0) {
func_8030E878(0x3F0, randf2(0.9f, 1.1f), randi2(12000, 19000), this->position, 500.0f, 2500.0f);
local->unk28 = randf2(1.0f, 6.0f);
}
local->unk20[0] += sp9C;
local->unk20[0] = (0.2 < (f64) local->unk20[0]) ? randf2(-3.0f, -1.0f) : local->unk20[0];
local->unk20[1] += sp9C;
local->unk20[1] = (0.2 < (f64) local->unk20[1]) ? randf2(-3.0f, -1.0f) : local->unk20[1];
if(this->state == 1){
if(mapSpecificFlags_getClear(0x12)){
func_8038D9D0(this, 2);
return;
}
if(spA4 < 2000.0f){
func_80258A4C(this->position, this->yaw - 90.0f, spB4, &sp98, &sp94, &sp90);
this->yaw += (sp90*90.0f) *sp9C;
}
}
if(this->state == 2){
if(func_8025773C(&local->unk1C, sp9C)){
func_8038D9D0(this, 3);
}
}
if(this->state == 3){
if (func_80329210(this, spB4)) {
func_8038D9D0(this, 5);
} else {
func_8038D9D0(this, 1);
}
}
if(this->state == 4){
if(!mapSpecificFlags_get(0x10))
func_8038D9D0(this, 5);
}
if (this->state == 5) {
func_8033568C(this->unk148, &sp8C, &sp88);
if (sp8C < 0.8 && 0.8 <= sp88) {
func_8030E878(SFX_8_BANJO_LANDING_04, randf2(0.8f, 0.9f), randi2(0x61A8, 0x6978), this->position, 100.0f, 1500.0f);
}
if (func_80335794(this->unk148) > 0) {
sp7C[0] = (f32) local->unk10[0];
sp7C[1] = (f32) local->unk10[1];
sp7C[2] = (f32) local->unk10[2];
if (ml_vec3f_distance(this->position, sp7C) < 30.0f) {
func_8038D9D0(this, 1);
} else {
func_8038D9D0(this, 5);
}
} else {
if ((0.2 <= sp88) && (sp88 <= 0.8)) {
temp_f12 = ((sp88 - 0.2) / 0.60000000000000009);
this->position_x = local->unk4[0] + (local->unkA[0] - local->unk4[0])*temp_f12;
this->position_y = local->unk4[1] + (local->unkA[1] - local->unk4[1])*temp_f12;
this->position_z = local->unk4[2] + (local->unkA[2] - local->unk4[2])*temp_f12;
if (local->unk1 != 0) {
if (sp88 <= 0.5) {
this->position[1] = (f32) ((f64) this->position[1] + ((sp88 / 0.5) * 70.0));
} else {
this->position[1] = (f32) ((f64) this->position[1] + ((1.0 - ((sp88 - 0.5) / 0.5)) * 70.0));
}
}
sp60[0] = (f32) (local->unkA[0] - local->unk4[0]);
sp60[1] = (f32) (local->unkA[1] - local->unk4[1]);
sp60[2] = (f32) (local->unkA[2] - local->unk4[2]);
func_80258A4C(D_80390B10, this->yaw - 90.0f, sp60, &sp74, &sp70, &sp6C);
this->yaw += sp6C * 220.0f * sp9C;
}
}
}
if (this->state == 6) {
func_80258A4C(this->position, this->yaw - 90.0f, spB4, &sp5C, &sp58, &sp54);
this->yaw += sp54 * 90.0f * sp9C;
if ((-0.4 <= sp54) && (sp54 <= 0.4) && ((f64) randf() > 0.5)) {
func_8038D9D0(this, 5);
}
if ((sp58 < 0.0f) && (randf() > 0.5)) {
func_8038D9D0(this, 5);
}
}
if(this->state == 7 || this->state == 8){
if(func_8025773C(&local->unk1C, sp9C)){
func_8038D9D0(this, 6);
}
}
if(this->state == 9){
sp48[0] = this->position[0] - spB4[0];
sp48[1] = this->position[1] - spB4[1];
sp48[2] = this->position[2] - spB4[2];
sp48[1] = 0.0f;
ml_vec3f_set_length(sp48, 400.0f * sp9C);
this->position[0] = this->position[0] + sp48[0];
this->position[1] = this->position[1] + sp48[1];
this->position[2] = this->position[2] + sp48[2];
this->position_y += local->unk18*sp9C;
local->unk18 -= 3000.0f*sp9C;
if(this->position_y < func_80309724(this->position)){
this->position_y = func_80309724(this->position);
func_8038D9D0(this, 10);
}
}
if(this->state == 10){
if(func_80335794(this->unk148) > 0){
func_8038D9D0(this, 11);
}
}
}

216
src/BGS/ch/yumblie.c Normal file
View File

@@ -0,0 +1,216 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "prop.h"
extern void func_803253A0(Actor *);
extern void func_80325794(ActorMarker *);
extern f32 randf (void);
enum chyumblie_state_e{
YUMBLIE_STATE_1_UNDER_GROUND = 1,
YUMBLIE_STATE_2_APPEAR,
YUMBLIE_STATE_3_ABOVE_GROUND,
YUMBLIE_STATE_4_DISAPPEAR,
YUMBLIE_STATE_5_BEING_EATEN,
};
typedef struct chyumblie_s{
f32 unk0;
u8 unk4;
u8 pad7[3];
f32 unk8; //wait_timer
ActorMarker *game_marker;
} ActorLocal_Yumblie;
void chyumblie_set_state(Actor*, enum chyumblie_state_e);
void chyumblie_update(Actor *);
Actor *chyumblie_draw(ActorMarker *this, Gfx **gfx, Mtx** mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390A40 = {0xC7, actor_yumblie, 0x3F6, 0x00, NULL,
chyumblie_update, NULL, chyumblie_draw,
0, 0, 0.0f, 0
};
/* .code */
bool func_8038B160(Actor *this){
ActorLocal_Yumblie *local;
s32 temp_v0;
local = (ActorLocal_Yumblie *)&this->local;
temp_v0 = func_8038A9E0(local->game_marker);
if ((temp_v0 == 1) || (temp_v0 == 4))
return FALSE;
if ((temp_v0 == 2) || (temp_v0 == 5))
return (0.7 <= randf ()) ? TRUE : FALSE;
return (randf () >= 0.5)? TRUE : FALSE;
}
void chyumblie_set_state(Actor* this, enum chyumblie_state_e next_state){
ActorLocal_Yumblie *s0;
s0 = (ActorLocal_Yumblie *)&this->local;
s0->unk8 = 0;
if(next_state == 1){
s0->unk8 = randf2(1.0f, 10.0f);
}
if(next_state == 2){
this->yaw = randf2(0.0f, 360.0f);
s0->unk4 = func_8038B160(this);
func_8038AC54(s0->game_marker, this->marker, this->position, s0->unk4);
func_80335924(this->unk148, (s0->unk4)? ASSET_128_ANIM_GRUMBLIE_APPEAR : ASSET_125_ANIM_YUMBLIE_APPEAR, 0.0f, 1.5f);
func_80335A8C(this->unk148, 2);
}
if(next_state == 3){
s0->unk8 = randf2(5.0f, 10.0f);
func_80335924(this->unk148, (s0->unk4)? ASSET_12A_ANIM_GRUMBLIE_IDLE : ASSET_127_ANIM_YUMBLIE_IDLE, 0.1f, randf2(0.5f, 1.0f));
func_80335A8C(this->unk148, 1);
if(s0->unk4){
func_8030E6A4(SFX_C4_TWINKLY_MUNCHER_GRR,randf2(1.0f, 1.2), 30000);
}else{
func_8030E878(SFX_C3_HEGH,randf2(1.0f, 1.2), 30000, this->position, 500.0f, 3000.0f);
}
}
if(next_state == 4){
chvilegame_remove_piece(s0->game_marker, this->marker);
func_80335924(this->unk148, (s0->unk4)? ASSET_129_ANIM_GRUMBLIE_HIDE : ASSET_126_ANIM_YUMBLIE_HIDE, 0.1f, 0.5f);
func_80335A8C(this->unk148, 2);
}
if(next_state == 5){
s0->unk8 = randf2(10.0f, 20.0f);
chvilegame_remove_piece(s0->game_marker, this->marker);
func_8030E878((s0->unk4)? SFX_C4_TWINKLY_MUNCHER_GRR: SFX_C3_HEGH, 1.4f, 32000, this->position, 500.0f, 3000.0f);
}
this->state = next_state;
}
bool chyumblie_is_edible(ActorMarker * arg0){
volatile Actor* actPtr;
actPtr = marker_getActor(arg0);
return (actPtr->state >= 2) && (actPtr->state < 5);
}
Actor *chyumblie_draw(ActorMarker *this, Gfx **gfx, Mtx** mtx, Vtx **vtx){
Actor *thisActor;
ActorLocal_Yumblie *sp40;
f32 sp44[3];
f32 sp38[3];
thisActor = marker_getActor(this);
sp40 = (ActorLocal_Yumblie *)&thisActor->local;
if ( thisActor->state < 2 || thisActor->state > 4){
thisActor->marker->unk14_21 = 0;
return thisActor;
}
func_8033A2D4(func_803253A0, thisActor, sp40);
func_8033A2E8(func_80325794, this);
sp44[0] = thisActor->position_x;
sp44[1] = thisActor->position_y + sp40->unk0*75.0f;
sp44[2] = thisActor->position_z;
sp38[0] = thisActor->pitch;
sp38[1] = thisActor->yaw;
sp38[2] = thisActor->roll;
if(sp40->unk4 && sp40->game_marker){
func_803391A4(gfx, mtx, sp44, sp38, 1.0f, NULL, chvilegame_get_grumblie_model(sp40->game_marker));
}
else{
func_803391A4(gfx, mtx, sp44, sp38, 1.0f, NULL, func_80330B1C(this));
}
return thisActor;
}
bool func_8038B684(ActorMarker * arg0){
Actor* actPtr = marker_getActor(arg0);
if( actPtr->state < 5){
chyumblie_set_state(actPtr, YUMBLIE_STATE_5_BEING_EATEN);
return TRUE;
}
return FALSE;
}
void chyumblie_update(Actor *this){
ActorLocal_Yumblie *s0;
f32 sp50;
f32 sp4C;
f32 sp48;
s32 pad44;
f32 tmp;
s0 = (ActorLocal_Yumblie *)&this->local;
sp4C = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = 1;
s0->unk0 = 0.0f;
s0->unk4 = 0;
s0->game_marker = NULL;
chyumblie_set_state(this, YUMBLIE_STATE_1_UNDER_GROUND);
return;
}
if(s0->game_marker == NULL){
s0->game_marker = func_80326D68(this->position, 0x138, -1, &sp48)->marker;
}
sp50 = func_80335684(this->unk148);
if(this->state == YUMBLIE_STATE_1_UNDER_GROUND){
if(func_8025773C(&s0->unk8, sp4C)){
if(mapSpecificFlags_get(6) && (12 > chvilegame_get_piece_count(s0->game_marker))){
chyumblie_set_state(this, YUMBLIE_STATE_2_APPEAR);
}
else{
chyumblie_set_state(this, YUMBLIE_STATE_1_UNDER_GROUND);
}
}
}
if(this->state == YUMBLIE_STATE_2_APPEAR){
tmp = s0->unk0;
if(s0->unk4){
if(sp50 <= 0.3){
s0->unk0 = sp50/0.3;
}
}else{
if(sp50 <= 0.6){
s0->unk0 = sp50/0.6;
}
}
if((tmp < 0.5) && (0.5 <= s0->unk0)){
func_8030E878(SFX_C5_TWINKLY_POP, randf2(1.0f, 1.2f), 30000, this->position, 500.0f, 3000.0f);
}
if( 0 < func_80335794(this->unk148)){
s0->unk0 = 1.0f;
chyumblie_set_state(this,YUMBLIE_STATE_3_ABOVE_GROUND);
}
}
if(this->state == YUMBLIE_STATE_3_ABOVE_GROUND){
if( func_8025773C(&s0->unk8,sp4C) || !mapSpecificFlags_get(6) ){
chyumblie_set_state(this,YUMBLIE_STATE_4_DISAPPEAR);
}
}
if(this->state == YUMBLIE_STATE_4_DISAPPEAR){
if(sp50 >= 0.25 )
s0->unk0 -= 2.0f*(f64)sp4C;
if(0.0f >= s0->unk0){
s0->unk0 = 0.0f;
chyumblie_set_state(this,YUMBLIE_STATE_1_UNDER_GROUND);
}
}
if(this->state == YUMBLIE_STATE_5_BEING_EATEN){
if( func_8025773C(&s0->unk8,sp4C)){
chyumblie_set_state(this,YUMBLIE_STATE_1_UNDER_GROUND);
}
}
}

105
src/BGS/code_3030.c Normal file
View File

@@ -0,0 +1,105 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
s32 unk0;
ActorMarker *unk4; //tiptup_marker
f32 unk8;
s32 unkC;
}ActorLocal_BGS_3030;
void func_80389668(Actor *this);
Actor *func_80389610(ActorMarker *marker, Gfx **, Mtx **, Vtx**);
/* .data */
ActorInfo D_80390880 = { 0x019B, 0x27B, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0};
ActorInfo D_803908A4 = { 0x019C, 0x27C, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0};
ActorInfo D_803908C8 = { 0x019D, 0x27D, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0};
ActorInfo D_803908EC = { 0x019E, 0x27E, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0};
ActorInfo D_80390910 = { 0x019F, 0x27F, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0};
ActorInfo D_80390934 = { 0x01A0, 0x280, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0};
/* .code */
void func_80389420(ActorMarker *marker) {
Actor *this;
this = marker_getActor(marker);
func_8030E878(SFX_C5_TWINKLY_POP, randf2(1.0f, 1.2f), 25000, this->position, 500.0f, 3000.0f);
}
void func_80389488(Actor *this, s32 next_state) {
ActorLocal_BGS_3030 *local;
local = (ActorLocal_BGS_3030 *)&this->local;
if (next_state == 1) {
func_80335924(this->unk148, 0x12D, 0.2f, randf2(2.0f, 2.5f));
func_80335A74(this->unk148, randf2(0.0f, 1.0f));
}
if (next_state == 2) {
func_80335924(this->unk148, 0x12E, 0.1f, 1.6666666f);
timed_playSfx(0.8333333, SFX_86_TIPTUP_CHORUS_AH, local->unk8, 0x7FFF);
}
if (next_state == 3) {
func_8030E6A4(SFX_86_TIPTUP_CHORUS_AH, local->unk8, 0x7FFF);
func_80335924(this->unk148, 0x12F, 0.1f, 1.75f);
func_80335800(this->unk148, 0.9f, func_80389420, (s32)this->marker);
if (local->unk4 != NULL) {
func_80388E94(local->unk4, local->unk0);
}
}
this->state = next_state;
}
void func_803895D0(ActorMarker *marker, ActorMarker *other_marker){
Actor *this;
this = marker_getActor(marker);
if(this->state != 3){
func_80389488(this, 3);
}
}
Actor *func_80389610(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
func_8033A45C(4, marker->unk14_20 - 0x19A);
return func_80325888(marker, gfx, mtx, vtx);
}
void func_80389668(Actor *this) {
ActorLocal_BGS_3030 *local;
f32 sp30;
Actor *temp_v0_2;
local = (ActorLocal_BGS_3030 *)&this->local;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
marker_setCollisionScripts(this->marker, NULL, func_803895D0, NULL);
local->unk0 = 1;
local->unkC = 0;
local->unk4 = NULL;
local->unk8 = 1.0f;
func_80389488(this, 1);
if (jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP) && !func_803203FC(2) && !func_803203FC(1)) {
marker_despawn(this->marker);
}
return;
}
local->unkC++;
if (local->unkC == 2) {
temp_v0_2 = func_80326D68(this->position, 0x27A, -1, &sp30);
local->unk4 = (temp_v0_2 != NULL) ? temp_v0_2->marker : NULL;
if (local->unk4 != NULL) {
func_80388FFC(local->unk4, &local->unk0, &local->unk8);
}
}
if (this->state == 1) {
if (local->unk4 != NULL && (func_80388E70(local->unk4) == local->unk0)) {
func_80389488(this, 2);
}
}
if (((this->state == 2) || (this->state == 3)) && (func_80335794(this->unk148) > 0)) {
func_80389488(this, 1);
}
}

646
src/BGS/code_3420.c Normal file
View File

@@ -0,0 +1,646 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern f32 func_80256AB4(f32, f32, f32, f32);
extern f32 func_8025715C(f32, f32);
extern f32 *func_8038C284(ActorMarker *);
extern void func_802C8F7C(f32);
extern void func_802FDCB8(s32);
enum chvilegame_piece_type_e {
YUMBLIE,
GRUMBLIE
};
struct vilegame_piece{
enum chvilegame_piece_type_e type;
f32 position[3];
ActorMarker *marker; //yumblie ptr;
};
typedef struct {
u8 current_type;
// u8 pad1[3];
vector(struct vilegame_piece) *game_pieces;
BKModelBin *grumblie_model_bin;
u8 unkC;
u8 unkD;
u8 player_score;
u8 vile_score;
f32 type_change_timer;
ActorMarker *vile_marker;
}ActorLocal_BGS_3420;
void func_8038A068(Actor *this, s32 next_state);
void chvilegame_update(Actor *this);
/* .data */
ActorInfo D_80390960 = {0xC6, 0x138, 0, 0, NULL, chvilegame_update, NULL, func_80325340, 0, 0, 0.0f, 0};
enum asset_e D_80390984[] = { 0, 0xC66, 0xC68, 0xC6A, 0xC92, 0xC93, 0xC94, 0};
enum asset_e D_803909A4[] = { 0, 0xC67, 0xC69, 0, 0xC95, 0xC96, 0xC97};
enum asset_e D_803909C0[] = { 0, 0xC6E, 0xC6F, 0, 0xC95, 0xC96, 0xC97};
enum asset_e D_803909DC[] = {0xC65, 0xC65, 0xC65, 0xC8F, 0, 0, 0};
enum asset_e D_803909F8[] = {0xC64, 0, 0, 0xC8E, 0, 0, 0, 0};
enum asset_e D_80390A18[] = {0xC6D, 0xC70, 0xC71, 0xC8E, 0, 0, 0, 0};
/* .code */
bool func_80389810(f32 arg0[3]) {
if (func_8028ECAC() != BSGROUP_7_CROC_ATTACK) {
return FALSE;
}
func_8028E9C4(2, arg0);
return TRUE;
}
void func_80389850(Actor *this, s32 arg1) {
ActorLocal_BGS_3420 *local;
Actor *vile;
f32 sp94[3];
f32 sp88[3];
f32 sp7C[3];
s32 var_s0;
s32 var_v0;
local = (ActorLocal_BGS_3420 *)&this->local;
vile = marker_getActor(local->vile_marker);
if (arg1 != 0) {
if (gu_sqrtf(this->position[0]*this->position[0] + this->position[1]*this->position[1] + this->position[2]*this->position[2]) < 800.0f) {
sp7C[0] = 0.0f;
sp7C[1] = 150.0f;
sp7C[2] = 300.0f;
ml_vec3f_yaw_rotate_copy(sp7C, sp7C, vile->yaw);
sp94[0] = vile->position[0] + sp7C[0];
sp94[1] = vile->position[1] + sp7C[1];
sp94[2] = vile->position[2] + sp7C[2];
func_802C8F70(vile->yaw);
jiggySpawn(JIGGY_28_BGS_MR_VILE, sp94);
} else {
sp7C[0] = 0.0f - vile->position[0];
sp7C[1] = 0.0f;
sp7C[2] = 0.0f - vile->position[2];
ml_vec3f_set_length(sp7C, 150.0f);
sp7C[1] = 75.0f;
sp94[0] = vile->position[0] + sp7C[0];
sp94[1] = vile->position[1] + sp7C[1];
sp94[2] = vile->position[2] + sp7C[2];
func_802C8F70(func_8025715C(sp7C[0], sp7C[2]));
jiggySpawn(JIGGY_28_BGS_MR_VILE, sp94);
}
}
for(var_s0 = 2; var_s0 != 0x3C; var_s0++){
var_v0 = ((var_s0 & 1)) ? -(var_s0 / 2) * 0xA : (var_s0 / 2) * 0xA;
sp7C[0] = 0.0f;
sp7C[1] = 600.0f;
sp7C[2] = 1200.0f;
ml_vec3f_yaw_rotate_copy(sp7C, sp7C, vile->yaw + var_v0);
sp94[0] = vile->position[0] + sp7C[0];
sp94[1] = vile->position[1] + sp7C[1];
sp94[2] = vile->position[2] + sp7C[2];
sp88[0] = -30.0f;
sp88[1] = vile->yaw + var_v0;
sp88[2] = 0.0f;
sp7C[2] = 0.0f;
sp7C[1] = sp94[1];
sp7C[0] = 0.0f;
if(ml_vec3f_distance(sp94, sp7C) <= 1000.0f){
break;
}
}
func_802BAE6C(sp94, sp88);
}
void func_80389B48(ActorMarker *marker, enum asset_e text_id, s32 arg2){
Actor *this;
this = marker_getActor(marker);
if(arg2 == 1){
func_8038A068(this, 4);
}
else{
func_8038A068(this, 3);
}
}
void func_80389B98(ActorMarker *marker, enum asset_e text_id, s32 arg2){
Actor *this;
this = marker_getActor(marker);
func_8038A068(this, 1);
}
void func_80389BC8(ActorMarker *marker, enum asset_e text_id, s32 arg2){
Actor *this;
this = marker_getActor(marker);
func_8038A068(this, 5);
}
void func_80389BF8(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
Actor *this;
ActorLocal_BGS_3420 *local;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
func_80324E88(0.0f);
func_80324E38(0.0f, 0);
local->unkC--;
func_8038A068(this, 7);
}
void func_80389C58(ActorMarker *marker) {
Actor *this;
ActorLocal_BGS_3420 *local;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
func_80389850(this, 0);
func_80311480(D_80390984[local->unkC], 0xF, func_8038C284(local->vile_marker), this->marker, func_80389BF8, NULL);
}
void func_80389CD8(ActorMarker *marker, enum asset_e text_id, s32 arg2){
Actor *this;
this = marker_getActor(marker);
func_80324E88(0.0f);
func_80324E38(0.0f, 0);
func_8038A068(this, 5);
}
void func_80389D20(ActorMarker *marker) {
Actor *this;
ActorLocal_BGS_3420 *local;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
func_80389850(this, 0);
if (local->unkC == local->unkD) {
func_80311480(D_803909A4[local->unkC], 0xF, func_8038C284(local->vile_marker), this->marker, func_80389CD8, NULL);
} else {
func_80311480(D_803909C0[local->unkC], 0xF, func_8038C284(local->vile_marker), this->marker, func_80389CD8, NULL);
}
func_80347A14(0);
}
void func_80389DF8(ActorMarker *marker, enum asset_e text_id, s32 arg2){
Actor *this;
this = marker_getActor(marker);
func_80324E88(0.0f);
func_80324E38(0.0f, 0);
func_8038A068(this, 1);
}
void func_80389E40(ActorMarker *marker) {
Actor *this;
ActorLocal_BGS_3420 *local;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
func_80389850(this, 1);
func_80311480(0xC6B, 0xF, func_8038C284(local->vile_marker), this->marker, func_80389DF8, NULL);
}
void func_80389EAC(ActorMarker *marker, enum asset_e text_id, s32 arg2){
Actor *this;
ActorLocal_BGS_3420 *local;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
func_80324E88(0.0f);
func_80324E38(0.0f, 0);
local->unkC = 3;
func_8038A068(this, 1);
}
void func_80389F08(ActorMarker *marker) {
Actor *vile;
Actor *this;
ActorLocal_BGS_3420 *local;
s32 i;
s32 var_s2;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
func_80389850(this, 0);
var_s2 = func_80326F58(0x49);
vile = marker_getActor(local->vile_marker);
if (var_s2 > 0) {
func_8025A6EC(COMUSIC_15_EXTRA_LIFE_COLLECTED, 0x7FF8);
}
for(i = 0; i < 3; i++){
if (var_s2 < 3) {
func_802C8F70(vile->yaw + (f32) (i * 30));
func_802C8F7C(2.0f);
func_802C937C(6, vile->position);
var_s2 += 1;
} else {
item_inc(ITEM_16_LIFE);
}
}
func_80311480(0xC98, 0xF, func_8038C284(local->vile_marker), this->marker, func_80389EAC, NULL);
}
void func_8038A044(void){
func_8025A58C(-1, 400);
}
void func_8038A068(Actor *this, s32 next_state) {
ActorLocal_BGS_3420 *local;
local = (ActorLocal_BGS_3420 *)&this->local;
mapSpecificFlags_set(6, FALSE);
if (next_state == 1) {
if (local->vile_marker != NULL) {
func_8038C408(local->vile_marker);
}
}
if (next_state == 2) {
func_8038C3B0(local->vile_marker);
if (local->unkC == 3) {
if (local->unkD >= 4) {
func_80311480(0xC91, 0xE, func_8038C284(local->vile_marker), this->marker, func_80389B48, NULL);
} else {
func_80311480((local->unkC == local->unkD) ? 0xC8D : 0xC90, 0xE, func_8038C284(local->vile_marker), this->marker, func_80389B48, NULL);
}
} else {
func_80311480((local->unkC == local->unkD) ? 0xC63 : 0xC6C, 0xE, func_8038C284(local->vile_marker), this->marker, func_80389B48, NULL);
}
}
if (next_state == 3) {
func_80311480(D_803909DC[local->unkC], 4, func_8038C284(local->vile_marker), this->marker, func_80389B98, NULL);
}
if (next_state == 4) {
if (local->unkC == local->unkD) {
func_80311480(D_803909F8[local->unkC], 0xE | ((D_803909F8[local->unkC] == 0xC8E) ? 1 : 0) | 0xE, func_8038C284(local->vile_marker), this->marker, func_80389BC8, NULL);
} else {
func_80311480(D_80390A18[local->unkC], 0xF , func_8038C284(local->vile_marker), this->marker, func_80389BC8, NULL);
}
func_80347A14(0);
}
if (next_state == 5) {
local->unkC++;
if (local->unkD < local->unkC) {
local->unkD = local->unkC;
}
if (local->unkC == 7) {
func_8038C434(local->vile_marker);
} else {
local->current_type = YUMBLIE;
local->player_score = 0;
local->vile_score = 0;
if (func_803203FC(2) != 0) {
local->type_change_timer = 5.0f;
} else {
local->type_change_timer = 10.0f;
}
item_set(ITEM_0_HOURGLASS_TIMER, 3600-1);
item_set(ITEM_6_HOURGLASS, TRUE);
mapSpecificFlags_set(6, TRUE);
func_8038C3DC(local->vile_marker);
func_8025A58C(0, 4000);
timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_55_BGS_MR_VILE, 28000);
}
}
if (this->state == 5) {
if (local->unkC != 7) {
item_set(ITEM_6_HOURGLASS, FALSE);
if ((next_state != 6) && (next_state != 8) && (next_state != 9)) {
func_8038A044();
}
}
func_8038C460(local->vile_marker);
func_80347A14(1);
}
if (next_state == 6) {
func_8038C3B0(local->vile_marker);
func_80324E38(0.0f, 3);
timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3C_MINIGAME_LOSS, 28000);
timedFunc_set_0(4.0f, func_8038A044);
timedFunc_set_1(4.0f, func_80389C58, (s32) this->marker);
}
if (next_state == 8) {
func_8038C3B0(local->vile_marker);
func_80324E38(0.0f, 3);
timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000);
timedFunc_set_0(3.0f, func_8038A044);
timedFunc_set_1(3.0f, func_80389D20, (s32) this->marker);
}
if (next_state == 9) {
func_8038C3B0(local->vile_marker);
func_80324E38(0.0f, 3);
timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000);
timedFunc_set_0(3.0f, func_8038A044);
timedFunc_set_1(3.0f, func_80389E40, (s32) this->marker);
}
if (next_state == 0xA) {
func_8038C3B0(local->vile_marker);
func_80324E38(0.5f, 3);
timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000);
timedFunc_set_1(3.0f, func_80389F08, (s32) this->marker);
}
if (next_state == 7) {
func_8038C384(local->vile_marker);
}
this->state = next_state;
}
void chvilegame_player_consume_piece(Actor *this) {
ActorLocal_BGS_3420 *local;
bool is_correct_type;
f32 sp44[3];
struct vilegame_piece *begin;
struct vilegame_piece *end;
struct vilegame_piece *i_ptr;
local = (ActorLocal_BGS_3420 *)&this->local;
begin = (struct vilegame_piece *)vector_getBegin(local->game_pieces);
end = (struct vilegame_piece *) vector_getEnd(local->game_pieces);
if ((end != begin) && func_80389810(sp44)){
sp44[1] = 0.0f;
for(i_ptr = begin; i_ptr < end; i_ptr++){
if ((ml_vec3f_distance(i_ptr->position, sp44) < 65.25) && chyumblie_is_edible(i_ptr->marker)) {
is_correct_type = ((local->current_type != YUMBLIE) && (i_ptr->type != YUMBLIE)) || (((local->current_type == YUMBLIE) && i_ptr->type == YUMBLIE));
if (is_correct_type) {
local->player_score++;
if (local->player_score == 35) {
item_inc(ITEM_16_LIFE);
func_8025A6EC(COMUSIC_15_EXTRA_LIFE_COLLECTED, 0x7FF8);
}
timedFunc_set_1(0.0f, func_802FDCB8, 0x1A);
timedFunc_set_1(0.5f, func_802FDCB8, 0x1A);
timedFunc_set_1(1.0f, func_802FDCB8, 0x1A);
}
func_8028F6B8(0x17, (i_ptr->type != YUMBLIE) ? 0x3F7 : 0x3F6);
if (!is_correct_type) {
func_8028F66C(0x18);
}
func_8038B684(i_ptr->marker);
return;
}
}
}
}
bool chvilegame_cpu_consume_piece(ActorMarker *marker, f32 position[3]) {
Actor *this;
ActorLocal_BGS_3420 *local;
struct vilegame_piece *begin;
struct vilegame_piece *end;
struct vilegame_piece *i_ptr;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
if (this->state != 5){
return FALSE;
}
begin = vector_getBegin(local->game_pieces);
end = vector_getEnd(local->game_pieces);
for(i_ptr = begin; i_ptr < end; i_ptr++){
if ((ml_vec3f_distance(i_ptr->position, position) < 50.0f) && func_8038B684(i_ptr->marker)) {
local->vile_score++;
timedFunc_set_1(0.0f, func_802FDCB8, 0x1B);
timedFunc_set_1(0.5f, func_802FDCB8, 0x1B);
timedFunc_set_1(1.0f, func_802FDCB8, 0x1B);
return TRUE;
}
}
return FALSE;
}
BKModelBin *chvilegame_get_grumblie_model(ActorMarker *marker){
Actor *this;
ActorLocal_BGS_3420 *local;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
return local->grumblie_model_bin;
}
s32 chvilegame_get_piece_count(ActorMarker *marker){
Actor *this;
ActorLocal_BGS_3420 *local;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
return vector_size(local->game_pieces);
}
s32 func_8038A9E0(ActorMarker *marker){
Actor *this;
ActorLocal_BGS_3420 *local;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
return local->unkC;
}
s32 chvilegame_get_score_difference(ActorMarker *marker){
Actor *this;
ActorLocal_BGS_3420 *local;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
return local->vile_score - local->player_score;
}
bool chvilegame_find_closest_piece(ActorMarker *marker, f32 position[0], f32 yaw, f32 dst[3]) {
f32 piece_direction[3];
f32 target_direction[3];
Actor *this;
ActorLocal_BGS_3420 *local;
struct vilegame_piece *closest_piece;
struct vilegame_piece *begin;
struct vilegame_piece *end;
struct vilegame_piece *i_ptr;
f32 distance;
f32 angle_diff;
this = marker_getActor(marker);
local = (ActorLocal_BGS_3420 *)&this->local;
target_direction[0] = 0.0f;
target_direction[1] = 0.0f;
target_direction[2] = 100.0f;
ml_vec3f_yaw_rotate_copy(target_direction, target_direction, yaw);
closest_piece = NULL;
begin = (struct vilegame_piece *) vector_getBegin(local->game_pieces);
end = (struct vilegame_piece *) vector_getEnd(local->game_pieces);
for(i_ptr = begin; i_ptr < end; i_ptr++){
if( ((local->current_type != YUMBLIE) && (i_ptr->type != YUMBLIE))
|| ((local->current_type == YUMBLIE) && (i_ptr->type == YUMBLIE))
){
piece_direction[0] = i_ptr->position[0] - position[0];
piece_direction[1] = i_ptr->position[1] - position[1];
piece_direction[2] = i_ptr->position[2] - position[2];
distance = ml_vec3f_distance(i_ptr->position, position);
angle_diff = func_80256AB4(target_direction[0], target_direction[2], piece_direction[0], piece_direction[2]);
if( (distance > 300.0f)
|| ((-0.8 < angle_diff) && (angle_diff < 0.8) && ((piece_direction[0]*target_direction[0] + piece_direction[1]*target_direction[1] + piece_direction[2]*target_direction[2]) >= 0.0f))
) {
if ((closest_piece == NULL) || (distance < ml_vec3f_distance(position, closest_piece->position))){
closest_piece = i_ptr;
}
}
}
}
if (closest_piece != NULL) {
dst[0] = closest_piece->position[0];
dst[1] = closest_piece->position[1];
dst[2] = closest_piece->position[2];
return TRUE;
}
return FALSE;
}
void chvilegame_new_piece(ActorMarker *game_marker, ActorMarker *piece_marker, f32 position[3], enum chvilegame_piece_type_e yumblie_type){
Actor *this;
ActorLocal_BGS_3420 *local;
struct vilegame_piece *temp_v0;
this = marker_getActor(game_marker);
local = (ActorLocal_BGS_3420 *)&this->local;
temp_v0 = (struct vilegame_piece *)vector_pushBackNew(&local->game_pieces);
temp_v0->type = yumblie_type;
temp_v0->marker = piece_marker;
temp_v0->position[0] = position[0];
temp_v0->position[1] = position[1];
temp_v0->position[2] = position[2];
temp_v0->position[1] = 0.0f;
}
void chvilegame_free(Actor *this){
ActorLocal_BGS_3420 *local;
local = (ActorLocal_BGS_3420 *)&this->local;
func_8038A068(this, 0);
vector_free(local->game_pieces);
assetcache_release(local->grumblie_model_bin);
}
void chvilegame_remove_piece(ActorMarker *game_marker, ActorMarker *piece_marker) {
Actor *this;
ActorLocal_BGS_3420 *local;
struct vilegame_piece *begin;
struct vilegame_piece *end;
struct vilegame_piece *i_ptr;
this = marker_getActor(game_marker);
local = (ActorLocal_BGS_3420 *)&this->local;
begin = (struct vilegame_piece *)vector_getBegin(local->game_pieces);
end = (struct vilegame_piece *)vector_getEnd(local->game_pieces);
for(i_ptr = begin; i_ptr < end; i_ptr++){
if (piece_marker == i_ptr->marker) {
vector_remove(local->game_pieces, i_ptr - begin);
return;
}
}
}
void chvilegame_update(Actor *this) {
ActorLocal_BGS_3420 *local;
f32 sp50;
f32 sp4C;
u8 temp_v0;
s32 sp30[6];
s32 sp2C;
sp50 = time_getDelta();
local = (ActorLocal_BGS_3420 *)&this->local;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->unk30 = &chvilegame_free;
local->game_pieces = vector_new(sizeof(struct vilegame_piece), 0x20);
local->grumblie_model_bin = assetcache_get(0x3F7);
local->unkC = 0;
local->vile_marker = NULL;
if (this->state == 0) {
local->unkD = 0;
} else {
this->state = 0;
}
if (jiggyscore_isSpawned(JIGGY_28_BGS_MR_VILE)) {
local->unkC = 3;
local->unkD = 3;
}
if (func_803203FC(2)) {
local->unkC = 2;
local->unkD = 3;
}
func_8038A068(this, 1);
return;
}
if (local->vile_marker == NULL) {
local->vile_marker = func_80326D68(this->position, 0x13A, -1, &sp4C)->marker;
}
if (this->state == 1) {
if (func_803203FC(2)) {
if (func_803203FC(3)) {
func_8038A068(this, 5);
}
} else if (func_8038C2A8(local->vile_marker)) {
func_8038A068(this, 2);
}
}
if (this->state == 5) {
if (local->unkC == 7) {
func_8024E55C(0, sp30);
if ((sp30[BUTTON_Z] > 0) && func_8038C2A8(local->vile_marker)) {
func_8038A068(this, 0xA);
}
} else {
chvilegame_player_consume_piece(this);
if ((local->unkC == 3) || (local->unkC == 6)) {
if (func_8025773C(&local->type_change_timer, sp50)) {
local->current_type = !local->current_type;
if (func_803203FC(2)) {
local->type_change_timer = 5.0f;
} else {
local->type_change_timer = 10.0f;
}
}
if (local->type_change_timer > 3.5) {
if (local->current_type != 0) {
func_803463D4(ITEM_1D_GRUMBLIE, FALSE);
} else {
func_803463D4(ITEM_1E_YUMBLIE, FALSE);
}
}
}
sp2C = item_getCount(ITEM_1A_PLAYER_VILE_SCORE);
item_set(ITEM_1A_PLAYER_VILE_SCORE, local->player_score);
item_set(ITEM_1B_VILE_VILE_SCORE, local->vile_score);
if ((sp2C != 0) && (local->player_score == 0)) {
func_802FA5D0();
}
if (item_empty(ITEM_6_HOURGLASS)) {
if (func_803203FC(2)) {
func_803204E4(3, 0);
func_803204E4(5, ( local->vile_score < local->player_score) ? TRUE : FALSE);
func_8038A068(this, 1);
} else if (local->vile_score < local->player_score) {
if (local->unkC == 3) {
func_8038A068(this, 9);
} else {
func_8038A068(this, 8);
}
} else {
func_8038A068(this, 6);
}
}
}
}
if ((this->state == 7) && (func_8038C338(local->vile_marker) != 0)) {
func_8038A068(this, 1);
}
}

94
src/BGS/code_9750.c Normal file
View File

@@ -0,0 +1,94 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_80324E88(f32);
void timedFunc_set_2(f32, void(*)(s32, s32), s32, s32);
void func_8028E668(f32[3], f32, f32, f32);
void func_8038FBF8(Actor *);
ActorAnimationInfo D_80390C70[3] = {
{0, 0.0f},
{0x103, 8000000.0f},
{0x103, 0.75f}
};
ActorInfo D_80390C88 = {0x6D, 0xE9, 0x3EF, 0x01, D_80390C70,
func_8038FBF8, func_80326224, func_80325888,
0, 0x166, 0.0f, 0
};
u8 pad_80390CCC[4] = {0};
ActorAnimationInfo D_80390CB0[3] = {
{0, 0.0f},
{0x104, 8000000.0f},
{0x104, 0.75f}
};
ActorInfo D_80390CC8 = {0x6D, 0xEA, 0x3F0, 0x01, D_80390CB0,
func_8038FBF8, func_80326224, func_80325888,
0, 0x166, 0.0f, 0
};
u8 pad_80390CEC[4] = {0};
ActorAnimationInfo D_80390CF0[3] = {
{0, 0.0f},
{0x105, 8000000.0f},
{0x105, 0.75f}
};
ActorInfo D_80390D08 = {0x6D, 0xEB, 0x3F1, 0x01, D_80390CF0,
func_8038FBF8, func_80326224, func_80325888,
0, 0x166, 0.0f, 0
};
u8 pad_80390C2C[4] = {0};
ActorAnimationInfo D_80390C30[3] = {
{0, 0.0f},
{0x106, 8000000.0f},
{0x106, 0.75f}
};
ActorInfo D_80390D48 = {0x6D, 0xEC, 0x3F2, 0x01, D_80390C30,
func_8038FBF8, func_80326224, func_80325888,
0, 0x166, 0.0f, 0
};
/* .code */
void func_8038FB40(ActorMarker *this, s32 arg1){
Actor * thisActor;
thisActor = marker_getActor(this);
func_80328A84(thisActor, 2);
actor_playAnimationOnce(thisActor);
FUNC_8030E624(SFX_A_BANJO_LANDING_05, 0.8f, 32750);
}
void func_8038FB84(ActorMarker *this, ActorMarker *other_marker){
Actor *thisActor;
thisActor = marker_getActor(this);
FUNC_8030E8B4( SFX_87_TANKTUP_OOOHW, 1.0f, 32750, thisActor->position, 1000, 3000);
timedFunc_set_2(0.65f, (TFQM2) func_8038FB40, (s32) this, (s32) other_marker);
func_8038F51C(thisActor);
this->collidable = 0;
}
void func_8038FBF8(Actor *this){
if(!this->initialized){
this->initialized = 1;
this->marker->propPtr->unk8_3 = 1;
marker_setCollisionScripts(this->marker, NULL, NULL, func_8038FB84);
}
if(this->state == 2){
if(animctrl_isAt(this->animctrl, 0.65f)){
func_8030E540(SFX_7C_CHEBOOF);
}
if(animctrl_isStopped(this->animctrl)){
marker_despawn(this->marker);
}
}
}

View File

@@ -0,0 +1,24 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038FCB0(Actor *);
/* .data */
ActorInfo D_80390D70 = {0xDC, actor_bigalligator, 0x397, 0x01, NULL,
func_8038FCB0, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
/* .code */
void func_8038FCB0(Actor *this){
if(this->initialized)
return;
this->marker->propPtr->unk8_3 = 1;
actor_collisionOff(this);
this->initialized = 1;
}

347
src/BGS/done/ch/code_2270.c Normal file
View File

@@ -0,0 +1,347 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_80324E88(f32);
void func_803888E4(Actor *this, s32 arg1);
typedef struct{
u32 unk0;
}Struct_BGS_2270_0s;
typedef struct ch_bgs_2270_s{
u32 unk0;
vector(Struct_BGS_2270_0s) *unk4;
u8 unk8;
u8 unk9;
u8 unkA;
u8 unkB;
f32 unkC;
} ActorLocal_BGS_2270;
void func_80389080(Actor *this);
Actor *func_80325888(ActorMarker *, Gfx **, Mtx **, Vtx **);
ActorInfo D_80390830 = {
0x19A, 0x27A, 0x3F8,
0, NULL,
func_80389080, NULL, func_80325888,
0, 0, 2.5f, 0
};
s16 D_80390854[] = {0, 0xC78, 0xC7A, 0xC7C}; //see again texts
s16 D_8039085C[] = {0, 0xC77, 0xC79, 0xC7B}; //success texts
u8 D_80390864[] = {3, 3, 5, 7}; //chchoirgame_sequence_length
f32 D_80390868[3] = {0.0f, 100.0f, -1020.0f}; //chchoirgame_jiggy_position
void func_80388660(ActorMarker *this){
func_803888E4(marker_getActor(this), 6);
}
void func_8038868C(void){
jiggySpawn(JIGGY_27_BGS_TIPTUP, D_80390868);
}
void func_803886B4(ActorMarker *this, s32 arg1){
Actor *thisActor;
ActorLocal_BGS_2270 *actLocalPtr;
Struct_BGS_2270_0s *tmpPtr;
thisActor = marker_getActor(this);
actLocalPtr = (ActorLocal_BGS_2270 *)&thisActor->local;
actLocalPtr->unkB = arg1;
if(arg1){
tmpPtr = vector_pushBackNew(&actLocalPtr->unk4);
tmpPtr->unk0 = arg1;
}
}
void func_803886F4(ActorMarker *this){
Actor *thisActor;
thisActor = marker_getActor(this);
item_set(ITEM_6_HOURGLASS, 1);
item_set(ITEM_0_HOURGLASS_TIMER, 30*60-1);
func_803888E4(thisActor, 5);
}
void func_8038873C(void){
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
}
void func_80388760(void){
func_8025A6EC(COMUSIC_2C_BUZZER, 28000);
}
void func_80388784(ActorMarker *this, s32 arg1, s32 arg2){
Actor *thisActor;
thisActor = marker_getActor(this);
switch(arg1){
case 0xc72:
case 0xc74:
func_803888E4(thisActor, 3);
break;
case 0xc78:
case 0xc7a:
case 0xc7c:
func_803888E4(thisActor, 4);
break;
case 0xc77:
case 0xc79:
func_80324E38(0.0f, 0);
func_803888E4(thisActor, 3);
break;
case 0xc7b:
timedFunc_set_0(0.0f, func_8038868C);
func_80324E88(2.5f);
func_80324E38(2.5f, 0);
break;
}
}
void func_80388848(ActorMarker *this){
Actor *thisActor;
ActorLocal_BGS_2270 *unqPtr;
s32 sp1C;
thisActor = marker_getActor(this);
unqPtr = (ActorLocal_BGS_2270 *)&thisActor->local;
sp1C = vector_size(unqPtr->unk4);
func_8038873C();
if(sp1C != ++unqPtr->unk0)
return;
if(func_803203FC(2)){
item_set(ITEM_6_HOURGLASS,0);
func_803204E4(3,0);
func_803204E4(5,1);
}
else{
func_80388660(thisActor->marker);
}
}
void func_803888E4(Actor *this, s32 arg1){
ActorLocal_BGS_2270 *unqPtr;
f32 sp54;
f32 tmpf;
s32 i;
s32 j;
s32 prev_member;
s32 rand2;
Struct_BGS_2270_0s *s1;
unqPtr = (ActorLocal_BGS_2270 *)&this->local;
this->state = arg1;
unqPtr->unkC = 0.0f;
if(this->state == 1){
func_80335924(this->unk148, ASSET_12B_ANIM_TIPTUP_IDLE, 1.0f, 9.0f);
unqPtr->unkC = randf2(5.0f, 15.0f);
}
if(this->state == 2){
func_80335924(this->unk148, ASSET_12B_ANIM_TIPTUP_IDLE, 1.0f, 9.0f);
unqPtr->unkC = randf2(5.0f, 15.0f);
if(!this->unk138_24){
this->unk138_24 = 1;
if(unqPtr->unkA == 0){
func_80311480(0xc72, 0xe, this->position, this->marker, func_80388784, 0);
}else{
func_80311480(0xc74, 0xf, this->position, this->marker, func_80388784, 0);
}
}
else{
func_80311480(D_80390854[unqPtr->unkA], 0xf, this->position, this->marker, func_80388784, 0);
}
}
if(this->state == 3){
unqPtr->unk0 = 0;
vector_clear(unqPtr->unk4);
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.5f, 0);
tmpf = 0.5f;
i = 0;
prev_member = 0;
for(; i < D_80390864[unqPtr->unkA]; i++){
tmpf += randf2(1.0f, 1.5f);
while((rand2 = randi2(1,7)) == prev_member);
timedFunc_set_2(tmpf, func_803886B4, this->marker, rand2);
timedFunc_set_2(tmpf + 0.1, func_803886B4, this->marker, 0);
prev_member = rand2;
}//L80388B7C
func_80324E88(tmpf += 2.5);
if(!unqPtr->unkA && !func_803203FC(2)){
func_80324DBC(tmpf + 0.5, 0xc73, 0xe, this->position, this->marker, func_80388784, 0);
unqPtr->unkA = 1;
}
func_80324E38(sp54 = tmpf + 0.6, 0);
if(func_803203FC(2)){
timedFunc_set_1(sp54, func_803886F4, this->marker);
}else{
this->state = 0x05;
}
mapSpecificFlags_set(0, 0);
}//L80388C6C
if(this->state == 4){
unqPtr->unk0 = 0;
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.5f, 0);
tmpf = 0.5f;
for(j = 0; j < vector_size(unqPtr->unk4); j++){
s1 = (Struct_BGS_2270_0s *)vector_at(unqPtr->unk4,j);
tmpf += randf2(1.0f, 1.5f);
timedFunc_set_2(tmpf, func_803886B4, this->marker, s1->unk0);
timedFunc_set_2(tmpf + 0.1, func_803886B4, this->marker, 0);
}
func_80324E88(tmpf += 2.5);
func_80324E38(tmpf + 0.6,0);
vector_clear(unqPtr->unk4);
this->state = 0x05;
}//L80388D8C
if(this->state == 6){
if(unqPtr->unkA == 3){
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
}
func_80324E38(0.5f, 3);
timed_setCameraToNode(1.5f, 1);
func_80324DBC(2.0f, D_8039085C[unqPtr->unkA++], 0xF, this->position, this->marker, func_80388784, 0);
}
}
void func_80388E44(ActorMarker *arg0, ActorMarker *arg1){
func_8028F428(2,arg0);
}
s32 func_80388E70(ActorMarker *this){
Actor *ptr;
ActorLocal_BGS_2270 *local;
ptr = marker_getActor(this);
local = (ActorLocal_BGS_2270 *)&ptr->local;
return local->unkB;
}
void func_80388E94(ActorMarker *this, s32 arg1){
Actor * thisActor;
ActorLocal_BGS_2270 *unqPtr;
Struct_BGS_2270_0s * tmp;
thisActor = marker_getActor(this);
unqPtr = (ActorLocal_BGS_2270 *)&thisActor->local;
if((s32)unqPtr->unk0 >= (s32) vector_size(unqPtr->unk4)){
if(!mapSpecificFlags_get(0) && func_80311480(0xc76, 0, 0, 0, 0, 0))
mapSpecificFlags_set(0,1);
}else{
tmp = (Struct_BGS_2270_0s *)vector_at(unqPtr->unk4, unqPtr->unk0);
if(arg1 == tmp->unk0){
timedFunc_set_1(0.5f, func_80388848, thisActor->marker);
}
else{
func_8028F55C(1, thisActor->marker);
timedFunc_set_0(0.5f, func_80388760);
if(!mapSpecificFlags_get(1) && !func_803203FC(2) && func_80311480(0xc75, 0, NULL, NULL, NULL, NULL))
mapSpecificFlags_set(1,TRUE);
}
}
}
void func_80388FC0(Actor *this){
ActorLocal_BGS_2270 *local;
local = (ActorLocal_BGS_2270 *)&this->local;
func_80320044(0, local->unkA, 2);
vector_free(local->unk4);
}
void func_80388FFC(ActorMarker *this, s32 *arg1, f32* arg2){
Actor *thisActor;
ActorLocal_BGS_2270 *localPtr;
thisActor = marker_getActor(this);
localPtr = (ActorLocal_BGS_2270 *)&thisActor->local;
*arg2 = 0.52 + (f64)localPtr->unk9 * 0.12;
localPtr->unk9++;
*arg1 = localPtr->unk9;
}
void func_80389080(Actor *this){
f32 sp44[3];
ActorLocal_BGS_2270 *unqPtr;
f32 sp3C;
f32 sp38;
f32 sp34;
f32 sp30;
unqPtr = (ActorLocal_BGS_2270 *)&this->local;
sp3C = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = 1;
this->marker->unk30 = func_80388FC0;
marker_setCollisionScripts(this->marker, func_80388E44, NULL, NULL);
unqPtr->unk0 = 0;
unqPtr->unk4 = vector_new(sizeof(Struct_BGS_2270_0s), 8);
unqPtr->unk8 = 0;
unqPtr->unk9 = 0;
unqPtr->unkA = func_8031FF44(0,2);
unqPtr->unkB = 0;
unqPtr->unkC = 0.0f;
if(func_803203FC(2)){
unqPtr->unkA = 3;
this->position_y = this->position_y - 300.0f;
}
func_803888E4(this, 1);
if(jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP) && !func_803203FC(2) && !func_803203FC(1))
marker_despawn(this->marker);
}
else{
player_getPosition(&sp44);
if(func_8033567C(this->unk148) == ASSET_12C_ANIM_TIPTUP_TAPPING && func_80335794(this->unk148) > 0){
func_80335924(this->unk148, ASSET_12B_ANIM_TIPTUP_IDLE, 1.0f, 9.0f);
unqPtr->unkC = randf2(5.0f, 15.0f);
}
if(func_8025773C(&unqPtr->unkC, sp3C)){
func_80335924(this->unk148, ASSET_12C_ANIM_TIPTUP_TAPPING, 1.0f, 4.0f);
}
func_80258A4C(this->position, this->yaw - 90.0f, &sp44, &sp38, &sp34, &sp30);
this->yaw = this->yaw + 5.0f*sp30;
if(this->state == 1){
if(func_803203FC(2)){
if(func_803203FC(3)){
func_80324E38(0.0f,0);
func_803888E4(this, 3);
}
}
else{
if(ml_vec3f_distance(this->position, &sp44) < 300.0f && player_getTransformation() == TRANSFORM_1_BANJO && !jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP)){
func_803888E4(this, 2);
}
}
}
if(this->state == 5){
if(func_803203FC(2)){
if(item_empty(ITEM_0_HOURGLASS_TIMER)){
item_set(ITEM_6_HOURGLASS,1);
func_803204E4(3,0);
func_803204E4(5,0);
}
} //L80389370
else{
if(ml_vec3f_distance(this->position, &sp44) >= 300.0f)
func_803888E4(this, 1);
}
}//L803893A0
if(this->state == 6){
if(ml_vec3f_distance(this->position, &sp44) < 300.0f && !unqPtr->unk8){
unqPtr->unk8 = 1;
func_80311480(0xc7d, 4, 0, 0, 0, 0);
}
}
}
}

203
src/BGS/done/ch/code_6730.c Normal file
View File

@@ -0,0 +1,203 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038CEE8(Actor *);
void func_8038CC08(Actor * arg0, u32 arg1);
void func_8025A58C(u32, u32);
void func_80324E88(f32);
ActorInfo D_80390AB0 = {0xC4, ACTOR_136_YELLOW_FLIBBIT_CONTROLLER, 0x00, 0x00, NULL,
func_8038CEE8, NULL, func_80325340,
0, 0, 0.0f, 0
};
f32 D_80390AD4[3] = {1985.0f, 200.0f, -1386.0f};
/* .bss */
u8 D_80391240[4];
/* .code */
void func_8038CB20(void){
jiggySpawn(JIGGY_24_BGS_FLIBBITS, D_80390AD4);
}
void func_8038CB48(ActorMarker *arg0, u32 arg1, u32 arg2){
Actor *actPtr = marker_getActor(arg0);
mapSpecificFlags_set(0x10, 0);
if(actPtr->state == 4){
func_8038CC08(actPtr,5);
}
else{
func_8038CC08(actPtr,3);
}
}
void func_8038CBB4(Actor * arg0){
if(!arg0->bgs_6730.unk4)
return;
func_8025A58C(-1, 400);
comusic_8025AB44(MUSIC_BGS_FLIBBIT_FIGHT,0, 400);
func_8025AABC(MUSIC_BGS_FLIBBIT_FIGHT);
arg0->bgs_6730.unk4 = 0;
}
void func_8038CC08(Actor * arg0, u32 arg1){
ActorLocal_BGS_6730 *s0;
s0 = &arg0->bgs_6730;
if(arg1 == 2){
func_8028F8F8(0x12, 1);
func_8028F8F8(0x1F, 0);
mapSpecificFlags_set(0x10, 1);
if(!func_8031FF1C(0x1B)){
func_80320004(0x1B, 1);
func_80311480(text_flibbits_meet, 0xf, arg0->position, arg0->marker, func_8038CB48, 0);
}else{
if(!arg0->bgs_6730.unk8){
func_80311480(text_flibbits_return, 0x4, arg0->position, arg0->marker, func_8038CB48, 0);
}
else{
func_8038CB48(arg0->marker, text_flibbits_return, 0);
return;
}
}
}
if(arg1 == 3){
s0->unk0 = 1;
if(!s0->unk4){
func_8025A58C(0, 400);
func_8025A6EC(MUSIC_BGS_FLIBBIT_FIGHT, 30000);
s0->unk4 = 1;
}
else{
comusic_8025AB44(MUSIC_BGS_FLIBBIT_FIGHT, 30000, 400);
}
}
if(arg0->state == 3){
func_8028F8F8(0x12, 0);
func_8028F8F8(0x1F, 1);
if(arg1 == 1){
if(s0->unk4){
comusic_8025AB44(MUSIC_BGS_FLIBBIT_FIGHT, 18000, 100);
}
}
else{
func_8038CBB4(arg0);
}
}
if(arg1 == 4){
func_80311480(text_flibbits_defeat, 0xf, arg0->position, arg0->marker, func_8038CB48, 0);
}
if(arg1 == 5){
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.0f, 0x27);
timedFunc_set_0(0.2f, func_8038CB20);
func_80324E88(3.0f);
func_80324E38(3.0f, 0);
arg1 = 6;
}
if(arg1 == 6){
func_8028F8F8(0x12, 0);
func_8028F8F8(0x1F, 1);
}
arg0->state = arg1;
}
void func_8038CE88(void){
D_80391240[0]++;
}
void func_8038CEA0(void){
D_80391240[1]++;
}
void func_8038CEB8(void){
D_80391240[2]++;
}
void func_8038CED0(void){
D_80391240[3]++;
}
void func_8038CEE8(Actor *this){
f32 sp34[3];
u32 sp28;
ActorLocal_BGS_6730 *bgs6730;
bgs6730 = &this->bgs_6730;
if(!this->unk16C_4){
this->unk16C_4 = 1;
bgs6730->unk0 = 0;
bgs6730->unk4 = 0;
bgs6730->unk8 = 0;
bgs6730->unkC = 0;
D_80391240[0] = 0;
D_80391240[1] = 0;
D_80391240[2] = 0;
D_80391240[3] = 0;
mapSpecificFlags_set(0x12, 0);
mapSpecificFlags_set(0x10, 0);
if(jiggyscore_isSpawned(JIGGY_24_BGS_FLIBBITS)){
func_8038CC08(this,6);
return;
}else{
func_8038CC08(this,1);
return;
}
}
if(D_80391240[0]>0){
bgs6730->unk8 += D_80391240[0];
bgs6730->unkC -= D_80391240[0];
D_80391240[0] = 0;
}
if(D_80391240[1]>0){
bgs6730->unk8 -= D_80391240[1];
D_80391240[1] = 0;
}
if(D_80391240[2]>0){
bgs6730->unk8 -= D_80391240[2];
bgs6730->unkC += D_80391240[2];
D_80391240[2] = 0;
}
if(D_80391240[3]>0){
bgs6730->unkC += D_80391240[3];
D_80391240[3] = 0;
}
player_getPosition(&sp34);
sp28 = (sp34[1] < 500.0f) && (func_80329210(this,sp34) != 0);
if(this->state == 1){
if(sp28 && ((bgs6730->unk8 > 0) || (bgs6730->unkC > 0)) && !func_8028FB48(0xe000)){
func_8038CC08(this,2);
}
else{
//L8038D0E0
if(bgs6730->unk4 && !bgs6730->unk8){
func_8038CBB4(this);
}
}
}
if(this->state == 3){
if(!sp28){
func_8038CC08(this, 1);
}else{
if(bgs6730->unk8 < 2 && bgs6730->unkC > 0){
mapSpecificFlags_set(0x12, 1);
}
}
}
if(this->state == 1 || this->state == 3){
if( (bgs6730->unk0)
&& !jiggyscore_isSpawned(JIGGY_24_BGS_FLIBBITS)
&& !bgs6730->unk8
&& !bgs6730->unkC
){
func_8038CC08(this, 4);
}
}
}

100
src/BGS/done/ch/code_8A60.c Normal file
View File

@@ -0,0 +1,100 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void timedFunc_set_0(f32, void (*)(void));
void func_8038EEA4(Actor *this);
void func_8038F06C(Actor *this);
ActorAnimationInfo D_80390B90[] = {
{0x00, 0.0f},
{0x00, 0.0f},
{0xD4, 0.15f},
{0xD5, 0.5f},
{0x00, 0.0f},
{0x00, 0.0f},
{0xD4, 0.15f},
{0xD5, 0.5f},
{0xD5, 1e+8f}
};
ActorInfo D_80390BD8 = {0xF5, 0x14E, 0x3F5, 1, D_80390B90, func_8038EEA4, func_80326224, func_80325888, 0, 0, 0.0f, 0};
ActorInfo D_80390BFC = {0xFD, 0x1FB, 0x3F5, 1, D_80390B90, func_8038F06C, func_80326224, func_80325888, 0, 0, 0.0f, 0};
void func_8038EE50(void){
f32 sp24[3];
if(func_80304E24(0x14d, sp24)){
jiggySpawn(JIGGY_20_BGS_ELEVATED_WALKWAY, sp24);
func_802C3F04(func_802C4140, 0x4C, *((u32 *) &sp24[0]), *((u32 *) &sp24[1]), *((u32 *) &sp24[2]));
}
}
void func_8038EEA4(Actor *this){
func_8038EA90();
if(mapSpecificFlags_get(7)){
mapSpecificFlags_set(7, 0);
if(!mapSpecificFlags_get(3) || (item_getCount(0) > 0)){
func_802D68F0(0x2D);
}
}
if(!mapSpecificFlags_get(5)){
func_802D4928(this, 1, 6, 7);
}
if(mapSpecificFlags_get(2)){
this->velocity_x = 0.0f;
mapSpecificFlags_set(3,0);
mapSpecificFlags_set(4,0);
mapSpecificFlags_set(1,0);
mapSpecificFlags_set(2,0);
}
if( this->velocity_x == 0.0f && mapSpecificFlags_get(1)){
this->velocity_x = 1.0f;
func_802BAFE4(0xc);
timedFunc_set_0(1.2f, func_8038EE50);
} //L8038EFB4
if( this->velocity_x != 0.0f && !mapSpecificFlags_get(3) && func_802BB270()){
mapSpecificFlags_set(3,1);
func_802D68F0(0x2D);
item_set(ITEM_6_HOURGLASS,1);
} //L8038EFB4
}
void func_8038F018(void){
f32 sp24[3];
if(func_80304E24(0x1fc, sp24)){
jiggySpawn(JIGGY_25_BGS_MAZE, sp24);
func_802C3F04(func_802C4140, 0x4C, *((u32 *) &sp24[0]), *((u32 *) &sp24[1]), *((u32 *) &sp24[2]));
}
}
void func_8038F06C(Actor *this){
func_8038EA90();
if(mapSpecificFlags_get(8)){
mapSpecificFlags_set(8, 0);
if(!mapSpecificFlags_get(0xC) || (item_getCount(0) > 0)){
func_802D68F0(0xA);
}
}
if(!mapSpecificFlags_get(9)){
func_802D4928(this, 0xA, 6, 7);
}
if(mapSpecificFlags_get(0xB)){
this->velocity_x = 0.0f;
mapSpecificFlags_set(0xC,0);
mapSpecificFlags_set(0xD,0);
mapSpecificFlags_set(0xA,0);
mapSpecificFlags_set(0xB,0);
}
if( this->velocity_x == 0.0f && mapSpecificFlags_get(0xA)){
this->velocity_x = 1.0f;
func_802BAFE4(0x1D);
timedFunc_set_0(1.2f, func_8038F018);
} //L8038EFB4
if( this->velocity_x != 0.0f && !mapSpecificFlags_get(0xC) && func_802BB270()){
mapSpecificFlags_set(0xC,1);
func_802D68F0(0xA);
item_set(ITEM_6_HOURGLASS,1);
} //L8038EFB4
}

125
src/BGS/done/ch/mudhut.c Normal file
View File

@@ -0,0 +1,125 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
/* TODO move declarations to respective headers*/
void func_8028F710(s32, f32);
void func_802C4218(u32,f32,f32,f32);
void func_80328A84(Actor *, u32);
/* local declarations */
Actor *func_8038EAD0(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3);
void func_8038EB4C(ActorMarker *);
void func_8038EB8C(Actor *this);
/* .data section */
ActorAnimationInfo D_80390B30[4] = {
{0, 0.0f},
{0, 0.0f},
{anim_mudhut_smashing, 0.25f},
{anim_mudhut_smashing, 1000000.0f}
};
u32 D_80390B50[6] = {0xA, 0xA, 0xB, 0xA, 0xA, 0xC};
ActorInfo D_80390B68 = {0xD5, ACTOR_C_MUD_HUT, ASSET_7D8_MODEL_MM_HUT_TOP, 0x01, D_80390B30,
func_8038EB8C, func_80326224, func_8038EAD0,
0, 0, 0.0f, 0
};
/* .code section */
void func_8038EA30(void){
if((getGameMode() != GAME_MODE_7_ATTRACT_DEMO) && (1.5 < func_8028E80C(2)) ){
func_8028F710(2, 1.5);
}
}
void func_8038EA90(void){
u32 sp1C;
osPiReadIo(0xD10, &sp1C);
if(sp1C = (u16)(sp1C-0x400)){
func_8038EA30();
}
}
Actor *func_8038EAD0(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3){
Actor *thisActor;
thisActor = marker_getActor(this);
func_8033A45C(1, thisActor->state == 1);
if(thisActor->state == 3)
return thisActor;
return func_80325888(this, gdl, mtx, arg3);
}
void func_8038EB4C(ActorMarker *this){
Actor *thisActor;
thisActor = marker_getActor(this);
thisActor = func_8032813C(ACTOR_D_WOOD_DEMOLISHED, thisActor->position, NULL);
thisActor = func_8032813C(ACTOR_4D_STEAM_2, thisActor->position, NULL);
if(this);
}
void func_8038EB8C(Actor *this){
f32 diffPos[3];
f32 plyrPos[3];
s32 tmp;
if(func_80334904() == 2){
if(!this->initialized){
this->marker->collidable = 0;
this->initialized = 1;
}
switch(this->state){
case 1:
this->marker->propPtr->unk8_3 = 1;
player_getPosition(&plyrPos);
diffPos[0] = plyrPos[0] - this->position_x;
diffPos[1] = plyrPos[1] - this->position_y;
diffPos[2] = plyrPos[2] - this->position_z;
if( (150.0f < diffPos[1])
&& (player_getActiveHitbox(this->marker) == HITBOX_1_BEAK_BUSTER)
&& (func_8028F20C())
&& (gu_sqrtf(diffPos[0]*diffPos[0] + diffPos[1]*diffPos[1] + diffPos[2]*diffPos[2]) < 350.f)
){
tmp = (s32)( (this->position_y - 600.f)/430.0f);
diffPos[0] = this->position_x;
diffPos[1] = this->position_y;
diffPos[2] = this->position_z;
diffPos[1] += 130.0;
FUNC_8030E8B4(SFX_5B_HEAVY_STUFF_FALLING, 1.0f, 28000, this->position, 0x12C, 0xBB8);
func_80328A84(this, 2);
this->marker->propPtr->unk8_3 = 0;
actor_playAnimationOnce(this);
if(tmp == 5){
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
}
func_802C3C88(func_8038EB4C, this->marker);
if(tmp < 5){
func_802C3F04(func_802C4218,D_80390B50[tmp], ((u32 *)diffPos)[0], ((u32 *)diffPos)[1], ((u32 *)diffPos)[2]);
} else {
jiggySpawn(JIGGY_23_BGS_HUTS, diffPos);
}
}
break;
case 2:
this->marker->propPtr->unk8_3 = 0;
if(0.99 < animctrl_getAnimTimer(this->animctrl)){
this->state = 3;
}
break;
case 3:
this->marker->propPtr->unk8_3 = 0;
break;
}
}
else{
}
}

119
src/BGS/done/ch/pinkegg.c Normal file
View File

@@ -0,0 +1,119 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct chpinkegg_s{
u32 unk0;
u32 unk4;
} ActorLocal_PinkEgg;
void chpinkegg_draw(ActorMarker *this, Gfx ** gdl, Mtx** mptr, u32 arg3);
void chpinkegg_collision(ActorMarker *this, ActorMarker *other_marker);
void chpinkegg_update(Actor *this);
u32 D_803906C0 = 0x5B;
enum actor_e D_803906C4[5] = {0xED, 0xEE, 0xEF, 0xF0, 0x00};
ActorAnimationInfo D_803906D8[4] = {
{0, 0.0f},
{0, 0.0f},
{0, 0.0f},
{0x10B, 2.0f}
};
ActorInfo D_803906F8 = {0x6E, 0x5B, 0x380, 0x01, D_803906D8,
chpinkegg_update, func_80326224, chpinkegg_draw,
0, 0x2CC, 6.0f, 0
};
ActorInfo D_8039071C = {0xD6, 0xED, 0x381, 0x01, D_803906D8,
chpinkegg_update, func_80326224, chpinkegg_draw,
0, 0x2CC, 5.0f, 0
};
ActorInfo D_80390740 = {0xD7, 0xEE, 0x382, 0x01, D_803906D8,
chpinkegg_update, func_80326224, chpinkegg_draw,
0, 0x2CC, 4.0f, 0
};
ActorInfo D_80390764 = {0xD8, 0xEF, 0x383, 0x01, D_803906D8,
chpinkegg_update, func_80326224, chpinkegg_draw,
0, 0x2CC, 3.0f, 0
};
ActorInfo D_80390788 = {0xD9, 0xF0, 0x384, 0x01, D_803906D8,
chpinkegg_update, func_80326224, chpinkegg_draw,
0, 0x2CC, 2.0f, 0
};
/* .code */
void chpinkegg_spawn_next(ActorMarker * arg0, u32 arg1){
ActorLocal_PinkEgg *local;
Actor *actorPtr;
Actor *unkActor;
actorPtr = marker_getActor(arg0);
local = (ActorLocal_PinkEgg *)&actorPtr->local;
unkActor = spawn_child_actor( D_803906C4[arg1], &actorPtr);
((ActorLocal_PinkEgg *) &unkActor->local)->unk0 = arg1 + 1;
((ActorLocal_PinkEgg *) &unkActor->local)->unk4 = 5;
unkActor->marker->collidable = 0;
}
void chpinkegg_draw(ActorMarker *this, Gfx ** gdl, Mtx** mptr, u32 arg3){
u32 sp18;
u32 t7;
t7 = marker_getActor(this)->state == 3;
func_8033A45C(1, (sp18 = t7) ^ 1);
func_8033A45C(2, sp18);
func_80325888(this, gdl, mptr, arg3);
}
void chpinkegg_collision(ActorMarker *this, ActorMarker *other_marker){
Actor *thisActor;
ActorLocal_PinkEgg *tmp;
thisActor = marker_getActor(this);
this->propPtr->unk8_3 = 0;
func_8030E510(SFX_AA_BGS_EGG_BREAKING_1, 28000);
func_80328A84(thisActor, 3);
actor_playAnimationOnce(thisActor);
this->collidable = 0;
thisActor->unk124_6 = 0;
if(D_803906C4[(tmp = (ActorLocal_PinkEgg *) &thisActor->local)->unk0] != 0){
func_802C3D3C(chpinkegg_spawn_next, thisActor->marker, tmp->unk0);
} else {
jiggySpawn(JIGGY_21_BGS_PINKEGG, thisActor->position);
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
}
}
void chpinkegg_update(Actor *this){
if(!this->initialized){
this->marker->propPtr->unk8_3 = 1;
marker_setCollisionScripts(this->marker, NULL, NULL, chpinkegg_collision);
this->initialized = 1;
}
switch(this->state){
case 1:
if(!((ActorLocal_PinkEgg *) &this->local)->unk4){
this->marker->collidable = 1;
func_80328A84(this,2);
}else{
((ActorLocal_PinkEgg *) &this->local)->unk4--;
}
break;
case 3:
if(animctrl_isStopped(this->animctrl)){
func_80326310(this);
if(this->alpha_124_19 < 0x60){
this->unk124_9 = 0x2;
}
}
break;
}
}

68
src/BGS/done/code_8DF0.c Normal file
View File

@@ -0,0 +1,68 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "prop.h"
extern ActorInfo D_80390804;
extern ActorInfo D_80390690;
extern ActorInfo D_803906F8;
extern ActorInfo D_8039071C;
extern ActorInfo D_80390740;
extern ActorInfo D_80390764;
extern ActorInfo D_80390788;
extern ActorInfo D_80390B68;
extern ActorInfo D_80390C40;
extern ActorInfo D_80390C88;
extern ActorInfo D_80390CC8;
extern ActorInfo D_80390D08;
extern ActorInfo D_80390D48;
extern ActorInfo D_80390AB0;
extern ActorInfo D_80390AE0;
extern ActorInfo D_80390960;
extern ActorInfo D_80390A40;
extern ActorInfo D_80390A70;
extern ActorInfo D_80390830;
extern ActorInfo D_80390880;
extern ActorInfo D_803908A4;
extern ActorInfo D_803908C8;
extern ActorInfo D_803908EC;
extern ActorInfo D_80390910;
extern ActorInfo D_80390934;
extern ActorInfo D_80390DA8;
extern ActorInfo D_80390D70;
extern ActorInfo D_80390BD8;
extern ActorInfo D_80390BFC;
void bgs_func_8038F1E0(void){//bgs_updateSpawnableActors
spawnableActorList_add(&D_80390804, actor_new, 0x00000088);//croctus
spawnableActorList_add(&D_80390690, actor_new, 0x020108A1); //flibbit
spawnableActorList_add(&D_803906F8, actor_new, 0x400); //pink_egg_largest
spawnableActorList_add(&D_8039071C, actor_new, 0x400); //pink_egg_large
spawnableActorList_add(&D_80390740, actor_new, 0x400); //pink_egg_medium
spawnableActorList_add(&D_80390764, actor_new, 0x400); //pink_egg_small
spawnableActorList_add(&D_80390788, actor_new, 0x400); //pink_egg_smallest
spawnableActorList_add(&D_80390B68, actor_new, 0); //mudhut_top
spawnableActorList_add(&D_80390C40, actor_new, 0x4000548);//tanktup
spawnableActorList_add(&D_80390C88, actor_new, 0x400042c);//tanktup_leg
spawnableActorList_add(&D_80390CC8, actor_new, 0x400042c);//tanktup_leg
spawnableActorList_add(&D_80390D08, actor_new, 0x400042c);//tanktup_leg
spawnableActorList_add(&D_80390D48, actor_new, 0x400042c);//tanktup_leg
spawnableActorList_add(&D_80390AB0, actor_new, 0x81);
spawnableActorList_add(&D_80390AE0, actor_new, 0x20108a1); //yellow_flibbit
spawnableActorList_add(&D_80390960, actor_new, 0);
spawnableActorList_add(&D_80390A40, actor_new, 0x880); //yumblie
spawnableActorList_add(&D_80390A70, actor_new, 0x9a2); //mr. vile
spawnableActorList_add(&D_80390830, actor_new, 0x888); //tiptup
spawnableActorList_add(&D_80390880, actor_new, 0x9a8); //tiptup_chiorMember
spawnableActorList_add(&D_803908A4, actor_new, 0x9a8); //tiptup_chiorMember
spawnableActorList_add(&D_803908C8, actor_new, 0x9a8); //tiptup_chiorMember
spawnableActorList_add(&D_803908EC, actor_new, 0x9a8); //tiptup_chiorMember
spawnableActorList_add(&D_80390910, actor_new, 0x9a8); //tiptup_chiorMember
spawnableActorList_add(&D_80390934, actor_new, 0x9a8); //tiptup_chiorMember
spawnableActorList_add(&D_80390DA8, actor_new, 0x4000); //leafboat
spawnableActorList_add(&D_80390D70, actor_new, 0x580); //bigAlligator
spawnableActorList_add(&D_80390BD8, actor_new, 8); //green_jiggy_switch
spawnableActorList_add(&D_80390BFC, actor_new, 8); //green_jiggy_switch
}

7
src/CC/CC.h Normal file
View File

@@ -0,0 +1,7 @@
#ifndef CC_H
#define CC_H
s32 func_80388010(void);
void func_8038803C(s32 arg0);
#endif

162
src/CC/ch/sawblade.c Normal file
View File

@@ -0,0 +1,162 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
f32 unk0;
f32 unk4;
}Struct_CC_3130_0;
typedef struct {
Struct_CC_3130_0 *unk0;
s32 unk4;
}ActorLocal_CC_3130;
void chSawblade_update(Actor *this);
/* .data */
Struct_CC_3130_0 D_80389C30[] = {
{ -80.0f, 0.4f},
{-160.0f, 0.6f},
{-240.0f, 0.8f},
{ 80.0f, 0.4f},
{ 160.0f, 0.6f},
{ 240.0f, 0.8f},
{ -80.0f, 0.4f},
{-160.0f, 0.6f},
{-240.0f, 0.8f},
{ 80.0f, 0.4f},
{ 160.0f, 0.6f},
{ 240.0f, 0.8f}
};
ActorInfo D_80389C90 = {
0x28, ACTOR_3D_CLANKER_SAWBLADE_PROPELLOR_1, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389CB4 = {
0x28, ACTOR_3E_CLANKER_SAWBLADE_PROPELLOR_2, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389CD8 = {
0x28, ACTOR_3F_CLANKER_SAWBLADE_PROPELLOR_3, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389CFC = {
0x28, ACTOR_40_CLANKER_SAWBLADE_PROPELLOR_4, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389D20 = {
0x28, ACTOR_41_CLANKER_SAWBLADE_PROPELLOR_5, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389D44 = {
0x28, ACTOR_42_CLANKER_SAWBLADE_PROPELLOR_6, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389D68 = {
0x28, ACTOR_290_CLANKER_SAWBLADE_PROPELLOR_7, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389D8C = {
0x28, ACTOR_291_CLANKER_SAWBLADE_PROPELLOR_8, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389DB0 = {
0x28, ACTOR_292_CLANKER_SAWBLADE_PROPELLOR_9, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389DD4 = {
0x28, ACTOR_293_CLANKER_SAWBLADE_PROPELLOR_10, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389DF8 = {
0x28, ACTOR_294_CLANKER_SAWBLADE_PROPELLOR_11, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389E1C = {
0x28, ACTOR_295_CLANKER_SAWBLADE_PROPELLOR_12, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR,
0, NULL,
chSawblade_update, NULL, func_80325888,
0, 0, 0.0f, 0
};
/* .code */
void func_80389520(ActorMarker *marker, ActorMarker *otherMarker){
FUNC_8030E624(SFX_65_METALLIC_SCRATCH, 1.0f, 30000);
}
void func_8038954C(ActorMarker *marker, ActorMarker *otherMarker){
Actor *actor = marker_getActor(marker);
ActorLocal_CC_3130 *local = (ActorLocal_CC_3130 *) &actor->local;
if(local->unk4 == 0){
FUNC_8030E624(SFX_20_METAL_CLANK_1, 1.0f, 30000);
}
local->unk4 = 2;
}
void chSawblade_update(Actor *this){
ActorLocal_CC_3130 *local = (ActorLocal_CC_3130 *)&this->local;
f32 tmp_f2;
f32 sp34 = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->roll = this->yaw;
this->yaw = 0.0f;
marker_setCollisionScripts(this->marker, func_80389520, NULL, func_8038954C);
local->unk0 = &D_80389C30[(this->modelCacheIndex < 0x43) ? this->modelCacheIndex - 0x3D : this->modelCacheIndex - 0x28A];
local->unk4 = 0;
func_80256C60(this->position, 100);
if(map_get() == MAP_21_CC_WITCH_SWITCH_ROOM){
this->position_z += 64.0f;
}
}//L80389660
tmp_f2 = this->roll;
this->roll += local->unk0->unk0 * sp34;
this->roll += (this->roll < 0.0f)? 360 : 0;
this->roll -= (this->roll >= 360.0f)? 360 : 0;
if( ( tmp_f2 < 90.0f && this->roll >= 90.0f )
|| ( tmp_f2 < 270.0f && this->roll >= 270.0f )
|| ( 90.0f < tmp_f2 && this->roll <= 90.0f )
|| ( 270.0f < tmp_f2 && this->roll <= 270.0f )
){//L80389790
func_8030E878(SFX_2_CLAW_SWIPE, local->unk0->unk4, 30000, this->position, 500.0f, 1000.0f);
}//L803897C8
if(local->unk4 > 0)
local->unk4--;
}

100
src/CC/ch/tooth.c Normal file
View File

@@ -0,0 +1,100 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_80333334(enum jiggy_e arg0);
typedef struct {
f32 position[3];//position
u8 level_flag;
u8 jiggy_id;
s16 open_model;
s16 closed_model;
//u8 pad12[0x2];
f32 jiggy_position[3];
} Struct_CC_1120_0;
typedef struct {
Struct_CC_1120_0 *unk0;
} ActorLocal_CC_1120;
void chTooth_update(Actor *);
/* .data */
Struct_CC_1120_0 D_80389B50[] = {
{ { 522.9976f, 1135.8192f, 5503.4833f}, LEVEL_FLAG_0_CC_TOKEN_TOOTH_OPEN, 0x00, ASSET_891_MODEL_CLANKER_TOKEN_TOOTH_OPEN, ASSET_892_MODEL_CLANKER_TOKEN_TOOTH_CLOSED, { 540.0f, 1627.0f, 6641.0f}},
{ {-713.4896f, 1135.8192f, 5152.913f}, LEVEL_FLAG_1_CC_JIGGY_TOOTH_OPEN, JIGGY_1B_CC_TOOTH, ASSET_893_MODEL_CLANKER_JIGGY_TOOTH_OPEN, ASSET_894_MODEL_CLANKER_JIGGY_TOOTH_CLOSED, {-700.0f, 1536.0f, 6268.0f}}
};
ActorInfo D_80389B90 = {
0x4E, ACTOR_101_CLANKER_TOKEN_TOOTH, ASSET_891_MODEL_CLANKER_TOKEN_TOOTH_OPEN,
0, NULL,
chTooth_update, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389BB4 = {
0x4F, ACTOR_102_CLANKER_JIGGY_TOOTH, ASSET_893_MODEL_CLANKER_JIGGY_TOOTH_OPEN,
0, NULL,
chTooth_update, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
/* .code */
extern void __chTooth_setState(Actor *this, s32 next_state){
ActorMarker *marker = this->marker;
ActorLocal_CC_1120 * local = (ActorLocal_CC_1120 *) &this->local;
this->state = next_state;
if(next_state == 2){
marker->modelId = local->unk0->open_model;
}
if(next_state == 1){
marker->modelId = local->unk0->closed_model;
}
}
extern void chTooth_update(Actor * this){
ActorMarker *marker = this->marker;
ActorLocal_CC_1120 * local = (ActorLocal_CC_1120 *) &this->local;
f32 sp24[3];
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker->propPtr->unk8_3 = 1;
local->unk0 = &D_80389B50[(this->modelCacheIndex == ACTOR_101_CLANKER_TOKEN_TOOTH) ? 0 : 1];
this->position[0] = local->unk0->position[0];
this->position[1] = local->unk0->position[1];
this->position[2] = local->unk0->position[2];
this->position[0] *= 1.25;
this->position[1] *= 1.25;
this->position[2] *= 1.25;
}//L80387660
if(this->state == 0){
if(levelSpecificFlags_get(local->unk0->level_flag)){
__chTooth_setState(this, 2);
}
else{
__chTooth_setState(this, 1);
}
}
else if(this->state == 2){//L803876B4
if(local->unk0->jiggy_id && !jiggyscore_isSpawned(local->unk0->jiggy_id)){
player_getPosition(sp24);
if(sp24[0] < 0.0f && 5400.0f < sp24[2]){
func_80333334(local->unk0->jiggy_id);
jiggySpawn(local->unk0->jiggy_id, local->unk0->jiggy_position);
}
else{//L8038774C
sp24[0] = local->unk0->jiggy_position[0];
sp24[1] = local->unk0->jiggy_position[1];
sp24[2] = local->unk0->jiggy_position[2];
sp24[1] = 1470.0f;
func_80333388(local->unk0->jiggy_id);
func_803331D8(local->unk0->jiggy_id, sp24);
}
}
}
}

142
src/CC/code_0.c Normal file
View File

@@ -0,0 +1,142 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
f32 unk0;
f32 unk4;
f32 unk8;
u8 unkC;
} ActorLocal_CC_0;
void func_803864D4(Actor *this);
/* .data */
ActorInfo D_80389AA0 = {
0x4B, 0x43, 0x890, 0, NULL,
func_803864D4, func_80326224 , func_80325888,
0, 0, 0.0f, 0
};
/* .rodata */
extern f32 D_80389EB0;
extern f32 D_80389EB4;
extern f64 D_80389EB8;
extern f64 D_80389EC0;
extern f64 D_80389EC8;
extern f64 D_80389ED0;
extern f64 D_80389ED8;
extern f64 D_80389EE0;
extern f64 D_80389EE8;
extern f64 D_80389EF0;
// 0000 3AC0: 45B1F800 3D4CCCCD 3FE3333333333333
// 0000 3AD0: 4056800000000000 4066800000000000
// 0000 3AE0: 400921FB54524550 3FB999999999999A
// 0000 3AF0: 4056800000000000 4066800000000000
// 0000 3B00: 400921FB54524550 0000000000000000
/* .code */
void func_803863F0(Actor *this, s32 next_state){
ActorLocal_CC_0 * local = (ActorLocal_CC_0 *)this->local;
if(this->state == 4){
func_80388ED4(0);
}
this->state = next_state;
local->unkC = 1;
local->unk0 = 0.0f;
local->unk4 = 0.0f;
local->unk8 = 0.0f;
if(1 == this->state){
local->unk4 = 2.0f;
}
if(this->state == 2){
func_80388ED4(1);
}
if(this->state == 3){
local->unk0 = 1.0f;
}
}
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/CC/code_0/func_803864D4.s")
#else
void func_803864D4(Actor *this){
ActorMarker *marker = this->marker;//sp5C;
ActorLocal_CC_0 * local = (ActorLocal_CC_0 *)this->local;
f32 sp4C[3];
f32 sp40[3];
f32 sp3C = time_getDelta();
f32 sp30[3];
f32 sp2C;
f32 sin_result;
if(!this->unk16C_4){
this->unk16C_4 = 1;
marker->propPtr->unk8_3 = 1;
func_803863F0(this, 1);
}//L80386530
func_80388B4C(&sp4C);
TUPLE_ASSIGN(sp40, 2640.0f, 5695.0f, -10.0f);
local->unk8 += sp3C;
if(func_8025773C(&local->unk4, sp3C)){
sp30[0] = sp4C[0] - sp40[0];
sp30[1] = 0.0f;
sp30[2] = sp4C[2] - sp40[2];
if(!func_80388CA0()){
local->unk4 = 2.0f;
}
else if(60.0f < gu_sqrtf(sp30[0]*sp30[0] + sp30[1]*sp30[1] + sp30[2]*sp30[2])){
local->unk4 = 0.05f;
}
else{
func_803863F0(this, 2);
}
}//L80386634
if(func_8025773C(&local->unk0, sp3C)){
func_803863F0(this, 4);
}
if(this->state == 2){
if(1.0 <= local->unk8)
func_803863F0(this, 3);
}//L803866B4
if(this->state == 4){
if(1.0 <= local->unk8)
func_803863F0(this, 1);
}//L80386714
if(this->state == 1){
TUPLE_COPY(this->position, sp4C);
}
else if(this->state == 2)
{//L80386734
sp2C = local->unk8*(f64)1;
if(local->unkC && 0.6 < sp2C){
FUNC_8030E8B4(SFX_91_METALLIC_SOUND, 1.0f, 32000, this->position, 100, 6000);
local->unkC = 0;
}//L80386798
sin_result = sinf(((sp2C*90.0)/180.0)*M_PI);
this->position_x = (sp40[0] - sp4C[0])*sin_result + sp4C[0];
this->position_y = (sp40[1] - sp4C[1])*sin_result + sp4C[1];
this->position_z = (sp40[2] - sp4C[2])*sin_result + sp4C[2];
}//L80386818
else if(this->state == 3){
TUPLE_COPY(this->position, sp40);
}
else if(this->state == 4){
sp2C = 1 - local->unk8*(f64)1;
if(local->unkC && sp2C < 0.1){
local->unkC = 0;
}//L8038688C
sin_result = sinf(((sp2C*90.0)/180.0)*M_PI);
this->position_x = (sp40[0] - sp4C[0])*sin_result + sp4C[0];
this->position_y = (sp40[1] - sp4C[1])*sin_result + sp4C[1];
this->position_z = (sp40[2] - sp4C[2])*sin_result + sp4C[2];
}//L80386904
}
#endif

172
src/CC/code_13C0.c Normal file
View File

@@ -0,0 +1,172 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "CC.h"
typedef struct{
void (*unk0)(s32 arg0);
u8 pad4[0x14];
s32 unk10;
u8 pad14[0x4];
f32 unk18[3];
u8 unk24[8];
}Struct_CC_13C0_0;
typedef struct{
s32 unk0;
s32 unk4;
s32 unk8;
f32 unkC;
}Struct_CC_13C0_1;
extern Struct_CC_13C0_0 D_8036E834[];
extern s32 D_80383568;
// Struct5Fs *, struct struct_68_s *, f32[3], f32[3], f32, BKModelBin*, Gfx**, Mtx**, Vtx**);
void func_803877B0(Struct_CC_13C0_1* arg0, void* arg1, f32 position[3], f32 rotation[3], f32 arg4, BKModelBin* modeL_ptr, Gfx** gfx, Mtx** mtx, Vtx **vtx) {
s32 temp_v0 = arg0->unk4;
if (temp_v0 == 3)
return;
if (temp_v0 == 0) {
func_8033A45C(1, 1);
} else if (temp_v0 == 1) {
func_8033A45C(1, 2);
} else if (temp_v0 == 2) {
func_8033A45C(1, 2);
rotation[2] += (arg0->unkC * 20.0f);
arg4 = arg4*(1.0f - arg0->unkC);
}
func_8033A45C(2, 0);
set_model_render_mode(1);
func_803391A4(gfx, mtx, position, rotation, arg4, NULL, modeL_ptr);
}
void func_803878AC(Struct_CC_13C0_1 *arg0, Struct68s *arg1, s32 arg2) {
arg0->unk4 = arg2;
arg0->unkC = 0.0f;
if ((arg2 == 2) || (arg2 == 3)) {
func_80351A04(arg1, 1);
}
}
void func_803878F0(Struct_CC_13C0_1 *arg0, Struct68s *arg1, s32 arg2) {
arg0->unk0 = arg2;
arg0->unk4 = 0;
arg0->unk8 = 0;
arg0 = arg0;
func_80351A14(arg1, (s32) func_803877B0);
func_803878AC(arg0, arg1, 0);
}
void func_80387940(Struct_CC_13C0_1 *arg0, Struct68s *arg1) {
func_803878F0(arg0, arg1, 1);
}
void func_80387960(Struct_CC_13C0_1 *arg0, Struct68s *arg1) {
func_803878F0(arg0, arg1, 2);
}
void func_80387980(Struct_CC_13C0_1 *arg0, Struct68s *arg1) {
func_803878F0(arg0, arg1, 3);
}
void func_803879A0(Struct_CC_13C0_1 *arg0, Struct68s *arg1) {
func_803878F0(arg0, arg1, 4);
}
void func_803879C0(Struct_CC_13C0_1 *arg0, Struct68s *arg1) {
func_803878F0(arg0, arg1, 5);
}
void func_803879E0(Struct_CC_13C0_1 *arg0, Struct68s *arg1) {
func_803878F0(arg0, arg1, 6);
}
void func_80387A00(Struct_CC_13C0_1 *arg0, Struct68s *arg1) {
func_803878F0(arg0, arg1, 7);
}
void func_80387A20(Struct_CC_13C0_1 *arg0, Struct68s *arg1) {
func_803878F0(arg0, arg1, 8);
}
void func_80387A40(Struct_CC_13C0_1* arg0, Struct68s* arg1, f32 arg2) {
s32 temp_v0;
f32 sp50[3];
f32 sp44[3];
f32 sp38[3];
f32 sp2C[3];
s32 sp28;
arg0->unkC += arg2;
temp_v0 = func_80388010();
if (temp_v0 == 0) {
func_803878AC(arg0, arg1, 3);
} else {
if (temp_v0 < arg0->unk0) {
func_803878AC(arg0, arg1, 0);
} else if (temp_v0 == arg0->unk0) {
func_803878AC(arg0, arg1, 1);
} else if ((arg0->unk0 < temp_v0) && ((arg0->unk4 != 2)) && (arg0->unk4 != 3)) {
func_803878AC(arg0, arg1, 2);
} else if ((arg0->unk4 == 2) && (arg0->unkC >= 1.0f)) {
func_803878AC(arg0, arg1, 3);
}
}
if ((arg0->unk4 == 0) || (arg0->unk4 == 1)) {
func_8035179C(arg1, sp38);
func_80351814(arg1, sp2C);
sp44[0] = 0.0f;
sp44[1] = 0.0f;
sp44[2] = 1.0f;
mlMtxIdent();
func_80252C08(NULL, sp2C, 1.0f, NULL);
func_8025235C(sp44, sp44);
player_getPosition(sp50);
sp50[1] += 50.0f;
sp50[0] -= sp38[0];
sp50[1] -= sp38[1];
sp50[2] -= sp38[2];
sp28 = ((sp50[0]*sp44[0] + sp50[1]*sp44[1] + sp50[2]*sp44[2]) >= 0.0f) ? 1 : -1;
if (sp28 == -arg0->unk8) {
if (gu_sqrtf(sp50[0]*sp50[0] + sp50[1]*sp50[1] + sp50[2] * sp50[2]) < (func_80351830(arg1) * 250.0f)) {
func_8038803C(arg0->unk0);
}
}
arg0->unk8 = sp28;
}
}
void func_80387CC0(void){
f32 sp1C[3];
s32 tmp_v0;
if(getGameMode() == GAME_MODE_7_ATTRACT_DEMO)
return;
func_8024C764(sp1C);
tmp_v0 = func_8023DB4C(0x7F);
if(tmp_v0 >= 0x40){
tmp_v0 = 0x7F - tmp_v0;
}
sp1C[2] += tmp_v0 + 0x94;
if(360.0f <= sp1C[2]){
sp1C[2] -= 360.0f;
}
func_8024CE18(sp1C);
}
void func_80387D4C(void){
u32 sp1C;
u32 tmp_v0;
osPiReadIo(0x504, &sp1C);
sp1C = (sp1C & 0xffff) + 0xffff5BA0;
if(sp1C){
func_80387CC0();
}
}

51
src/CC/code_19B0.c Normal file
View File

@@ -0,0 +1,51 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern ActorInfo D_80389AA0;
extern ActorInfo D_80389AD0;
extern ActorInfo D_80389B00;
extern ActorInfo D_80389B24;
extern ActorInfo D_80389B90;
extern ActorInfo D_80389BB4;
extern ActorInfo D_80389C90;
extern ActorInfo D_80389CB4;
extern ActorInfo D_80389CD8;
extern ActorInfo D_80389CFC;
extern ActorInfo D_80389D20;
extern ActorInfo D_80389D44;
extern ActorInfo D_80389D68;
extern ActorInfo D_80389D8C;
extern ActorInfo D_80389DB0;
extern ActorInfo D_80389DD4;
extern ActorInfo D_80389DF8;
extern ActorInfo D_80389E1C;
extern ActorInfo D_80389E44;
extern ActorInfo D_80389E68;
extern ActorInfo D_80389E8C;
void func_80387DA0(void)
{
spawnableActorList_add(&D_80389AA0, actor_new, 0X4080);
spawnableActorList_add(&D_80389E44, actor_new, 0X10080);
spawnableActorList_add(&D_80389E68, actor_new, 0X10080);
spawnableActorList_add(&D_80389E8C, actor_new, 0X10080);
spawnableActorList_add(&D_80389AD0, actor_new, 0X80);
spawnableActorList_add(&D_80389B00, actor_new, 0X80);
spawnableActorList_add(&D_80389B24, actor_new, 0X80);
spawnableActorList_add(&D_80389B90, actor_new, 0X80);
spawnableActorList_add(&D_80389BB4, actor_new, 0X80);
spawnableActorList_add(&D_80389C90, actor_new, 0X2488);
spawnableActorList_add(&D_80389CB4, actor_new, 0X2488);
spawnableActorList_add(&D_80389CD8, actor_new, 0X2488);
spawnableActorList_add(&D_80389CFC, actor_new, 0X2488);
spawnableActorList_add(&D_80389D20, actor_new, 0X2488);
spawnableActorList_add(&D_80389D44, actor_new, 0X2488);
spawnableActorList_add(&D_80389D68, actor_new, 0X2488);
spawnableActorList_add(&D_80389D8C, actor_new, 0X2488);
spawnableActorList_add(&D_80389DB0, actor_new, 0X2488);
spawnableActorList_add(&D_80389DD4, actor_new, 0X2488);
spawnableActorList_add(&D_80389DF8, actor_new, 0X2488);
spawnableActorList_add(&D_80389E1C, actor_new, 0X2488);
}

115
src/CC/code_1B90.c Normal file
View File

@@ -0,0 +1,115 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "CC.h"
/* .data */
f32 D_80389BF0[3] = {0.0f, 1300.0f, -2800.0f};
/* .bss */
extern struct {
u8 unk0;
u8 unk1;
//u8 pad2[2];
f32 unk4;
f32 unk8;
} D_80389F90;
/* .code */
void func_80387F80(void){
func_8034E71C(func_8034C5AC(0x131), 0x190, 0.0f);
}
void func_80387FB0(void){
item_set(ITEM_0_HOURGLASS_TIMER, 48*60 - 1);
item_set(ITEM_6_HOURGLASS, 1);
D_80389F90.unk1 = 1;
}
void func_80387FE8(void){
item_set(ITEM_6_HOURGLASS, 0);
D_80389F90.unk1 = 0;
}
s32 func_80388010(void){
if(D_80389F90.unk0 > 0 && D_80389F90.unk0 < 0xA){
return D_80389F90.unk0;
}
return 0;
}
void func_8038803C(s32 arg0){
if(arg0 == D_80389F90.unk0){
if(arg0 == 1){
func_80387FB0();
}
D_80389F90.unk0++;
if(D_80389F90.unk0 >= 9){
func_80387FE8();
D_80389F90.unk8 = 1.0f;
}
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
}
else{//L803880BC
func_8025A6EC(COMUSIC_2C_BUZZER, 28000);
}
}
void func_803880D4(void){
if(D_80389F90.unk0 != 0){
func_80387FE8();
}
}
void func_80388104(void){
D_80389F90.unk0 = 0;
if(map_get() == MAP_22_CC_INSIDE_CLANKER){
if(jiggyscore_isSpawned(JIGGY_1C_CC_RINGS)){
timedFunc_set_0(0.0f, func_80387F80);
}
else{
D_80389F90.unk0 = 1;
D_80389F90.unk1 = 0;
D_80389F90.unk8 = 0.0f;
D_80389F90.unk4 = 0.0f;
}
}
}
void func_8038817C(void){
f32 sp24[3];
f32 sp20 = time_getDelta();
s32 tmp_v0;
if(D_80389F90.unk0 != 0){
D_80389F90.unk4 += sp20;
player_getPosition(sp24);
if(func_8025773C(&D_80389F90.unk8, sp20)){
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
func_80324E38(0.0f, 3);
timed_setCameraToNode(2.0f, 0);
timedJiggySpawn(2.1f, JIGGY_1C_CC_RINGS, D_80389BF0);
func_80324E38(5.0f, 0);
func_80324E88(5.0f);
tmp_v0 = func_8034C5AC(0x131);
if(tmp_v0){
func_8034E78C(tmp_v0, 0x190, 12.0f);
}
D_80389F90.unk4 = 0.0f;
}//L80388264
if(!(D_80389F90.unk0 < 2) && D_80389F90.unk1 != 0){
if( (sp24[0] < -1100.0f && sp24[1] < -40.0f)
|| (1560.0f < sp24[0])
|| (2850.0f < sp24[2])
|| (sp24[2] < -3000.0f)
|| (D_80389F90.unk0 < 9 && item_empty(ITEM_6_HOURGLASS))
){
func_80387FE8();
func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 28000);
func_803880D4();
func_80388104();
}
}//L8038834C
}//L8038834C
}

440
src/CC/code_1F70.c Normal file
View File

@@ -0,0 +1,440 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern Struct60s *func_8028EF48(void);
extern void func_8030E9FC(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, f32 arg4[3], f32 arg5, f32 arg6);
extern void func_8030EA54(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, f32 arg4[3], f32 arg5, f32 arg6);
extern void func_8031CE28(s32, s32, f32);
void func_80324E88(f32);
extern int func_802E805C(BKCollisionList *, BKVertexList *, f32[3], s32, f32, s32, s32, s32, s32);
extern void func_80340200(s32, f32[3], s32, f32, s32, s32, BKVertexList *, s32);
extern void func_802E9118(BKCollisionList *, BKVertexList *, f32[3], s32, f32, s32, s32, f32, s32, s32, s32);
extern void func_802E9DD8(BKCollisionList *, BKVertexList *, f32[3], s32, f32, s32, f32, s32, s32);
extern int func_80340020(s32, f32[3], s32, f32, s32, BKVertexList *, f32[3], f32[3]);
extern void func_8033A670(s32, s32, f32[3]);
extern void func_8033A928(s32, s32, f32[3]);
extern void func_8033A9A8(s32, s32, f32[3]);
extern void func_8024C5CC(f32[3]);
extern void ml_vec3f_normalize(f32[3]);
extern void func_8033A45C(s32, s32);
extern void func_8033A238(s32);
extern void func_8033A450(s32);
extern void func_8028FAB0(f32[3]);
extern void func_802921D4(f32[3]);
/* .data */
f32 D_80389C00[3] = {5700.0f, 4300.0f, 0.0f};
f32 D_80389C0C[3] = {0.0f, 27.0f, 0.0f};
f32 D_80389C18[3] = {0.0f, -27.0f, 0.0f};
f32 D_80389C24[3] = {4000.0f, 3500.0f, 0.0f};
/* .bss */
struct {
s32 unk0;
u8 unk4;
//u8 pad5[0x3];
f32 unk8;
f32 unkC[3];
s32 unk18;
BKCollisionList *unk1C;
u8 unk20;
u8 unk21;
//u8 pad22[0x2];
BKModelBin * unk24;
f32 unk28[3];
s32 unk34;
f32 unk38;
f32 unk3C;
BKVertexList *unk40;
BKVertexList *unk44;
u8 unk48;
u8 unk49;
//u8 pad4A[2];
f32 unk4C;
s32 unk50;
f32 unk54;
}D_80389FA0;
s32 func_80388360(s32 arg0, s32 arg1, s32 arg2, s32 arg3){
s32 out_v0;
out_v0 = func_802E805C(D_80389FA0.unk1C, D_80389FA0.unk40, D_80389FA0.unk28, 0, 1.0f, arg0, arg1, arg2, arg3);
if(out_v0 && func_8029453C()){
func_80340200(D_80389FA0.unk18, D_80389FA0.unk28, 0, 1.0f, 0, out_v0, D_80389FA0.unk40, arg1);
}
return out_v0;
}
void func_80388428(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5){
func_802E9118(D_80389FA0.unk1C, D_80389FA0.unk40, D_80389FA0.unk28, 0, 1.0f, arg0, arg1, arg2, arg3, arg4, arg5);
}
void func_803884A8(s32 arg0, f32 arg1, s32 arg2, s32 arg3){
func_802E9DD8(D_80389FA0.unk1C, D_80389FA0.unk40, D_80389FA0.unk28, 0, 1.0f, arg0, arg1, arg2, arg3);
}
void func_80388518(s32 arg0){
s32 sp24;
if(D_80389FA0.unk21 == 2){
func_8030E394(D_80389FA0.unk4);
func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.6f, 20000);
func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 20000);
func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.9f, 20000);
func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 20000);
}//L80388594
sp24 = D_80389FA0.unk21;
D_80389FA0.unk21 = arg0;
D_80389FA0.unk38 = 0.0f;
if(D_80389FA0.unk21 == 1){
func_80335924(D_80389FA0.unk0, ASSET_C3_ANIM_CLANKER_IDLE, 0.0f, 10.0f);
}
if(D_80389FA0.unk21 == 2){
func_8030DD90(D_80389FA0.unk4, 0);
func_8030DBB4(D_80389FA0.unk4, 1.0f);
sfxsource_setSfxId(D_80389FA0.unk4, SFX_7D_ANCHOR_LIFTING);
func_8030DD14(D_80389FA0.unk4, 3);
sfxsource_setSampleRate(D_80389FA0.unk4, 27000);
func_8030E2C4(D_80389FA0.unk4);
}
if(D_80389FA0.unk21 == 3){
if(sp24 != 2){
func_80335924(D_80389FA0.unk0, ASSET_C3_ANIM_CLANKER_IDLE, 0.0f, 10.0f);
}
D_80389FA0.unk28[1] = 1100.0f;
}
}
void func_80388664(void) {
jiggySpawn(JIGGY_17_CC_CLANKER_RAISED, D_80389C00);
}
void func_8038868C(void) {
func_80324E38(0, 3);
timed_setCameraToNode(0, 0);
timed_setCameraToNode(5.5f, 1);
timed_setCameraToNode(7.0f, 2);
timed_setCameraToNode(12.5f, 3);
timedFunc_set_0(13.0f, &func_80388664);
timed_setCameraToNode(16.0f, 1);
if (jiggyscore_isCollected(JIGGY_17_CC_CLANKER_RAISED) == 0) {
func_80324DBC(18.0f, 0xD2C, 4, NULL, NULL, NULL, 0);
}
func_80324E88(18.0f);
func_80324E38(18.0f, 0);
}
void func_80388760(Gfx **gfx, Mtx **mtx, Vtx **vtx){
BKVertexList *tmp_v0;
s32 s1;
f32 spA4[3];
f32 sp98[3];
int i;
s32 tmp_s0;
f32 sp84[3];
s32 pad80;
f32 sp74[3];
f32 sp68[3];
f32 sp5C[3];
if(D_80389FA0.unk21 == 0)
return;
func_8024C5CC(sp98);
if(sp98[0] < -2600.0f || 11600.0f < sp98[0])
return;
s1 = func_803356A0(D_80389FA0.unk0);
func_8033A670(s1, 0x40, sp84);
for( i = 0; i < 3; i++){
sp84[i] = sp84[i] + (1.3 - sp84[i])*D_80389FA0.unk8;
}
func_8033A928(s1, 0x40, sp84);
if(D_80389FA0.unk21 == 1){
func_8033A9A8(s1, 0x44, D_80389C0C);
func_8033A9A8(s1, 0x45, D_80389C0C);
func_8033A9A8(s1, 0x46, D_80389C0C);
func_8033A9A8(s1, 0x47, D_80389C18);
func_8033A9A8(s1, 0x48, D_80389C18);
func_8033A9A8(s1, 0x49, D_80389C18);
}
player_getPosition(spA4);
for(i = 0; i < 2; i++){//L803888FC
func_8034A174(D_80389FA0.unk34, (i == 0) ? 0x10 : 0xf, sp74);
sp68[0] = spA4[0] - sp74[0];
sp68[1] = spA4[1] - sp74[1];
sp68[2] = spA4[2] - sp74[2];
ml_vec3f_normalize(sp68);
sp5C[0] = 0.0f;
sp5C[1] = sp68[2]*45.0f;
sp5C[2] = -sp68[1]*45.0f;
func_8033A9A8(s1, (i == 0)?0x42:0x43, sp5C);
}
tmp_v0 = D_80389FA0.unk40;
D_80389FA0.unk40 = D_80389FA0.unk44;
D_80389FA0.unk44 = tmp_v0;
func_8033A45C(1, (D_80389FA0.unk21 == 3) ? 1 : 0);
tmp_s0 = (sp98[0] < 100.0f)? 0 : 1;
func_8033A45C(2, 1);
func_8033A45C(3, 1);
func_8033A45C(4, tmp_s0);
func_8033A45C(5, tmp_s0);
func_8033A45C(6, tmp_s0);
func_8033A45C(7, tmp_s0);
func_8033A45C(8, tmp_s0);
if(tmp_s0){
tmp_s0 = (s32)(D_80389FA0.unk4C*3.99 + 1.0);
func_8033A45C(2, tmp_s0);
func_8033A45C(3, tmp_s0);
}
func_8033A238(s1);
func_8033A450(D_80389FA0.unk34);
func_8033A4C0(D_80389FA0.unk40);
set_model_render_mode(1);
func_803391A4(gfx, mtx, D_80389FA0.unk28, NULL, 1.0f, NULL, D_80389FA0.unk24);
if(func_80340020(D_80389FA0.unk18, D_80389FA0.unk28, 0, 1.0f, 0, D_80389FA0.unk40, spA4, spA4)){
func_8028FAB0(spA4);
func_802921D4(spA4);
}
}
void func_80388B4C(s32 arg0) {
func_8034A174(D_80389FA0.unk34, 5, arg0);
}
void func_80388B78(f32 arg0[3], f32 arg1[3]){
func_8034A174(D_80389FA0.unk34, 7, arg0);
func_8034A174(D_80389FA0.unk34, 8, arg1);
}
void func_80388BBC(f32 arg0[3], f32 arg1[3]){
func_8034A174(D_80389FA0.unk34, 9, arg0);
func_8034A174(D_80389FA0.unk34, 10, arg1);
}
void func_80388C00(s32 arg0, s32 arg1){
func_8031CD20(arg0, 0xb, 3);
}
void func_80388C28(s32 arg0, s32 arg1){
func_8031CD20(arg0, 0xb, 4);
}
void func_80388C50(s32 arg0, s32 arg1){
func_8031CD20(arg0, 0xb, 1);
}
void func_80388C78(s32 arg0, s32 arg1){
func_8031CD20(arg0, 0xb, 2);
}
int func_80388CA0(void){
return D_80389FA0.unk21 == 3;
}
void func_80388CB4(void){
if(D_80389FA0.unk21){
func_80335874(D_80389FA0.unk0);
func_8030DA44(D_80389FA0.unk4);
func_80340690(D_80389FA0.unk18);
func_8034A2A8(D_80389FA0.unk34);
if(func_8033A148(D_80389FA0.unk24) != D_80389FA0.unk40)
vtxList_free(D_80389FA0.unk40);
if(func_8033A148(D_80389FA0.unk24) != D_80389FA0.unk44)
vtxList_free(D_80389FA0.unk44);
assetcache_release((void *)D_80389FA0.unk24);
D_80389FA0.unk34 = NULL;
D_80389FA0.unk0 = NULL;
D_80389FA0.unk18 = NULL;
}
}
void func_80388D54(void){
D_80389FA0.unk21 = 0;
if(map_get() == MAP_B_CC_CLANKERS_CAVERN){
D_80389FA0.unk0 = func_803358B4();
D_80389FA0.unk4 = func_8030D90C();
D_80389FA0.unk8 = 1.0f;
D_80389FA0.unk18 = func_803406B0();
D_80389FA0.unk21 = 0;
D_80389FA0.unk24 = assetcache_get(ASSET_88E_MODEL_CLANKER_CHAIN);
D_80389FA0.unk1C = func_8033A084(D_80389FA0.unk24);
D_80389FA0.unk34 = func_8034A2C8();
D_80389FA0.unk3C = 1.0f;
D_80389FA0.unk40 = func_8033A148(D_80389FA0.unk24);
D_80389FA0.unk44 = vtxList_clone(D_80389FA0.unk40);
D_80389FA0.unk48 = 0;
D_80389FA0.unk49 = 0;
D_80389FA0.unk50 = 0;
D_80389FA0.unk4C = 0.0f;
D_80389FA0.unk54 = 1.0f;
D_80389FA0.unk28[0] = 5500.0f;
D_80389FA0.unk28[2] = 0.0f;
D_80389FA0.unk28[1] = 0.0f;
func_80320B24(func_80388360, func_80388428, func_803884A8);
if(!func_80304E24(0x3B, D_80389FA0.unkC)){
D_80389FA0.unkC[0] = 0.0f;
D_80389FA0.unkC[1] =-1e+06f;
D_80389FA0.unkC[2] = 0.0f;
}
if(jiggyscore_isSpawned(JIGGY_17_CC_CLANKER_RAISED)){
func_80388518(3);
}
else{
func_80388518(1);
}
}
}
void func_80388EA4(void){
if(D_80389FA0.unk21 == 1){
func_80388518(2);
}
}
void func_80388ED4(s32 arg0){
f32 sp1C[3];
func_8034A174(D_80389FA0.unk34, 5, sp1C);
if(arg0 != 0){
FUNC_8030E8B4(SFX_91_METALLIC_SOUND, 0.7f, 32675, sp1C, 100, 6000);
}
else{
FUNC_8030E8B4(SFX_82_METAL_BREAK, 0.9f, 24000, sp1C, 100, 6000);
}
D_80389FA0.unk8 = 1.0f;
}
void func_80388F4C(void){
f32 sp6C[3];
f32 sp68 = time_getDelta();
f32 sp64;
f32 sp60;
f32 sp54[3];
f32 sp48[3];
Struct60s *tmp_v0;
f32 pad[3];
func_80387D4C();
if(D_80389FA0.unk21 != 0 && func_80334904() == 2){
player_getPosition(sp6C);
D_80389FA0.unk20 = (ml_vec3f_distance(sp6C, D_80389FA0.unkC) < 200.0f);
D_80389FA0.unk38 += sp68;
sp64 = func_80335684(D_80389FA0.unk0);
func_80335A94(D_80389FA0.unk0, sp68, 1);
sp60 = func_80335684(D_80389FA0.unk0);
if(D_80389FA0.unk21 == 3){
func_8034A174(D_80389FA0.unk34, 5, sp54);
if(sp60 < sp64){
FUNC_8030E8B4(SFX_7E_CREAKY_DOOR_OPENING, 0.6f, 32300, sp54, 1000, 5000);
}//L80389058
if(sp64 < 0.3 && 0.3 <= sp60){
FUNC_8030E8B4(SFX_7E_CREAKY_DOOR_OPENING, 0.5f, 32300, sp54, 1000, 5000);
}
}//L8038909C
if(D_80389FA0.unk21 == 2){
D_80389FA0.unk28[1] += 100.0f*sp68;
}
if(0.0f < D_80389FA0.unk8){
D_80389FA0.unk8 -= sp68/2;
if(D_80389FA0.unk8 <= 0.0f)
D_80389FA0.unk8 = 0.0f;
}
if(D_80389FA0.unk21 == 1){
if(D_80389FA0.unk20 && func_8033567C(D_80389FA0.unk0) != ASSET_C4_ANIM_CLANKER_BITE){
func_80335924(D_80389FA0.unk0, ASSET_C4_ANIM_CLANKER_BITE, 1.0f, 10.0f);
if(!D_80389FA0.unk48){
func_80311480(0xd2b, 0xE, D_80389FA0.unk28, NULL, NULL, NULL);
D_80389FA0.unk48 = TRUE;
}
}//L8038918C
if(!D_80389FA0.unk20 && func_8033567C(D_80389FA0.unk0) == ASSET_C4_ANIM_CLANKER_BITE){
func_80335924(D_80389FA0.unk0, ASSET_C3_ANIM_CLANKER_IDLE, 1.0f, 10.0f);
}
}//L803891BC
if(D_80389FA0.unk21 == 2){
func_803114D0();
if(1100.0f <= D_80389FA0.unk28[1]){
func_80388518(3);
}
}//L803891F8
if(D_80389FA0.unk21 == 3){
func_8034A174(D_80389FA0.unk34, 6, sp48);
if(ml_vec3f_distance(sp48, sp6C) <= 130.0f && sp6C[1] - sp48[1] < 50.0f){
func_8031D04C(0x21, 1);
}
}//L80389260
if( D_80389FA0.unk21 == 3){
tmp_v0 = func_8028EF48();
if( tmp_v0 && !D_80389FA0.unk49
){
if(tmp_v0->unk8 & 2){
func_8031CE28(0x22, 5, 180.0f);
D_80389FA0.unk49++;
}
else if(tmp_v0->unk8 & 4){
func_8031CE28(0x22, 4, 0.0f);
D_80389FA0.unk49++;
}
}
}//L803892DC
if(func_8025773C(&D_80389FA0.unk3C, sp68)){
if(D_80389FA0.unk21 == 3){
func_8030E9FC(SFX_D0_GRIMLET_SQUEAK, 0.5f, 0.7f, 20000, D_80389C24, 2000.0f, 4000.0f);
}else{
func_8030EA54(SFX_D0_GRIMLET_SQUEAK, 0.5f, 0.7f, 20000, D_80389C24, 2000.0f, 4000.0f);
}//L80389384
D_80389FA0.unk3C = randf2(3.0f, 6.0f);
}//L803893A0
if(D_80389FA0.unk50 == 0){
if(func_8025773C(&D_80389FA0.unk54, sp68))
D_80389FA0.unk50 = 1;
}
if(D_80389FA0.unk50){
D_80389FA0.unk4C += D_80389FA0.unk50 * ((sp68 * 30.0)/4);
if(1.0f < D_80389FA0.unk4C){
D_80389FA0.unk50 = -1;
D_80389FA0.unk4C = 1.0f;
}
else if(D_80389FA0.unk4C < 0.0f){
D_80389FA0.unk50 = 0;
D_80389FA0.unk4C = 0.0f;
D_80389FA0.unk54 = randf2(0.1f, 7.0f);
}
}
}//L80389490
}
void func_803894A0(void){
if(D_80389FA0.unk34)
D_80389FA0.unk34 = func_8034A348(D_80389FA0.unk34);
if(D_80389FA0.unk0)
D_80389FA0.unk0 = defrag(D_80389FA0.unk0);
if(D_80389FA0.unk18)
D_80389FA0.unk18 = func_803406D4(D_80389FA0.unk18);
}

104
src/CC/code_3400.c Normal file
View File

@@ -0,0 +1,104 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
u8 *unk0;
f32 unk4;
s32 unk8;
} ActorLocal_CC_3400;
void func_80389900(Actor *this);
/* .data */
u8 D_80389E40[] = {3, 3, 2, 0};
ActorInfo D_80389E44 = {
0x1A9, 0x28C, 0x435,
0, NULL,
func_80389900, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389E68 = {
0x1A9, 0x28D, 0x436,
0, NULL,
func_80389900, NULL, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80389E8C = {
0x1A9, 0x28E, 0x437,
0, NULL,
func_80389900, NULL, func_80325888,
0, 0, 0.0f, 0
};
/* .code */
void func_803897F0(Actor *this, s32 next_state){
ActorLocal_CC_3400 *local = (ActorLocal_CC_3400 *) &this->local;
if(next_state == 3)
FUNC_8030E624(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 25000);
if(next_state == 2){
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, -1);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.9f, 29000);
local->unk4 = 0.0f;
}
if(next_state == 4){
marker_despawn(this->marker);
}
this->state = next_state;
}
void func_80389890(ActorMarker *marker, ActorMarker *other_marker){
func_8025A6EC(COMUSIC_2B_DING_B, -1);
}
void func_803898BC(ActorMarker *marker, ActorMarker *other_marker){
Actor *actor = marker_getActor(marker);
ActorLocal_CC_3400 *local = (ActorLocal_CC_3400 *) &actor->local;
if(actor->state == 1){
func_803897F0(actor, *local->unk0);
}
}
void func_80389900(Actor * this){
ActorLocal_CC_3400 *local = (ActorLocal_CC_3400 *) &this->local;
f32 sp20 = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = 1;
local->unk0 = &D_80389E40[this->modelCacheIndex - 0x28C];
local->unk8 = 0;
marker_setCollisionScripts(this->marker, NULL, func_80389890, func_803898BC);
func_803897F0(this, 1);
if(this->modelCacheIndex == 0x28E && jiggyscore_isSpawned(JIGGY_18_CC_BOLT)){
marker_despawn(this->marker);
}
return;
}//L803899D4
if(this->state == 1){
if(local->unk8){
func_803897F0(this, *local->unk0);
}
}//L80389A10
if(this->state == 3){
func_803897F0(this, 4);
}
if(this->state == 2){
local->unk4 += 250.0f*sp20;
this->position_y += 250.0f*sp20;
if(250.0f <= local->unk4){
func_803897F0(this, 4);
}
}
}

200
src/CC/code_530.c Normal file
View File

@@ -0,0 +1,200 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8030E730(s32, f32, s32);
void func_80388EA4(void);
typedef struct {
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
f32 unk4[3];
s16 unk10;
u8 pad12[2];
f32 unk14;
} ActorLocal_CC_530;
void func_80386B28(Actor* this);
/* .data */
ActorInfo D_80389AD0 = {
0x4A, 0x3C, 0x429, 0, NULL,
func_80386B28, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
f32 D_80389AF4[3] = {6200.0f, -2600.0f, 0.0f};
/* .code */
void func_80386920(Actor *this, s32 next_state){
ActorLocal_CC_530 *local = (ActorLocal_CC_530 *)&this->local;
f32 sp28[3];
s16 sp20[3];
local->unk14 = 0.0f;
if(this->state == 2 || this->state == 3 || this->state == 4){
func_8030E394(local->unk0);
}
if(next_state == 2 || next_state == 3 || next_state == 4){
func_8030DD90(local->unk0, 1);
func_8030DBB4(local->unk0, 0.3f);
sfxsource_setSfxId(local->unk0, 0x3ec);
func_8030DD14(local->unk0, 3);
sfxsource_setSampleRate(local->unk0, 28000);
func_8030E2C4(local->unk0);
}
if(next_state == 2 || next_state == 4){
func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff);
player_getPosition(&sp28);
TUPLE_COPY(sp20, sp28);
func_802F3A60(&sp20);
}
if(next_state == 4){
func_8038868C();
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF);
}
if(this->state == 4)
func_8030E730(0x7f, 0.7f, 0x7FFF);
this->state = next_state;
}
void func_80386AD0(ActorMarker *arg0, s32 arg1) {
Actor *actor = marker_getActor(arg0);
ActorLocal_CC_530 *local = (ActorLocal_CC_530 *)&actor->local;
local-> unk1 = 1;
}
void func_80386AF8(Actor *arg0) {
ActorLocal_CC_530 *local = (ActorLocal_CC_530 *)&arg0->local;
func_80386920(arg0, 0);
func_8030DA44(local->unk0);
}
void func_80386B28(Actor *this){
ActorMarker *marker = this->marker;
f32 sp58[3];
ActorLocal_CC_530 * local = (ActorLocal_CC_530 *)&this->local;
int temp_v0;
f32 sp44[3];
f32 sp38[3];
int temp_a0;
f32 tick = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = 1;
marker_setCollisionScripts(this->marker, NULL, func_80386AD0, NULL);
local->unk0 = func_8030D90C();
local->unk1 = 0;
local->unk2 = 0;
local->unk10 = this->pitch;
local->unk14 = 0.0f;
player_getPosition(&local->unk4);
local->unk3 = 3;
marker->unk30 = func_80386AF8;
marker->propPtr->unk8_3 = 1;
this->position_x = 5700.0f;
this->position_y = -2620.0f;
this->position_z = -20.0f;
if(jiggyscore_isSpawned(JIGGY_17_CC_CLANKER_RAISED)){
func_80386920(this, 5);
}
else{
func_80386920(this, 1);
}
}
else{//L80386C40
local->unk14 += tick;
player_getPosition(&sp58);
if(local->unk1 && ! local->unk2){
sp38[0] = 0.0f;
sp38[1] = 0.0f;
sp38[2] = -200.0f;
ml_vec3f_pitch_rotate_copy(&sp38, &sp38, this->pitch);
sp44[0] = local->unk4[0] - D_80389AF4[0];
sp44[1] = local->unk4[1] - D_80389AF4[1];
sp44[2] = local->unk4[2] - D_80389AF4[2];
temp_a0 = (0.0f <= sp44[0]*sp38[0] + sp44[1]*sp38[1] + sp44[2]*sp38[2]) ? 1 : -1;
TUPLE_ASSIGN(sp44,
sp58[0] - D_80389AF4[0],
sp58[1] - D_80389AF4[1],
sp58[2] - D_80389AF4[2]
);
temp_v0 = (0.0f <= sp44[0]*sp38[0] + sp44[1]*sp38[1] + sp44[2]*sp38[2]) ? 1 : -1;
if(temp_a0 != temp_v0){
local->unk2 = 1;
}
else{
local->unk2 = 0;
}
}
else{//L80386DA0
if(local->unk1){
local->unk2 = 2;
}
else{
local->unk2 = 0;
}
}//L80386DB4
local->unk1 = 0;
local->unk4[0] = sp58[0];
local->unk4[1] = sp58[1];
local->unk4[2] = sp58[2];
if(this->state == 0x1 && local->unk2 == 1){
if(--local->unk3 == 0){
func_80386920(this, 4);
}
else{
func_80386920(this, 2);
}
}//L80386E4C
if(this->state == 2){
if(1.0f <= local->unk14){
local->unk14 = 1.0f;
}
this->pitch = (f32)local->unk10 + 30.0f*local->unk14;
if(1.0f <= local->unk14){
func_80386920(this, 3);
}
}//L80386EC0
if(this->state == 3){
if(1.0f <= local->unk14){
local->unk14 = 1.0f;
}
this->pitch = (f32)local->unk10 + 30.0f*(1.0f - local->unk14);
if(1.0f <= local->unk14){
func_80386920(this, 1);
}
}//L80386F44
if(this->state == 4){
if(5.0f <= local->unk14){
local->unk14 = 5.0f;
}
this->pitch = (f32)local->unk10 + 180.0f*(local->unk14/5.0f);
if(5.0f <= local->unk14){
func_80386920(this, 5);
func_80388EA4();
}
}//L80386FC0
}
}

145
src/CC/code_BF0.c Normal file
View File

@@ -0,0 +1,145 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
s32 unk0;
s32 egg_count;
f32 unk8;
}ActorLocal_CC_BF0;
void func_803870F8(Actor *this);
/* .data */
extern ActorInfo D_80389B00 = {
MARKER_4C_CLANKER_TOKEN_TOOTH_EXT, ACTOR_44_CLANKER_TOKEN_TOOTH_EXTERIOR, ASSET_309_MODEL_CLANKER_TOKEN_TOOTH_EXTERIOR,
0, NULL,
func_803870F8, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
extern ActorInfo D_80389B24 = {
MARKER_4D_CLANKER_JIGGY_TOOTH_EXT, ACTOR_45_CLANKER_JIGGY_TOOTH_EXTERIOR, ASSET_30A_MODEL_CLANKER_JIGGY_TOOTH_EXTERIOR,
0, NULL,
func_803870F8, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
/* .bss */
u8 D_80389F80;
/* .code */
void func_80386FE0(Actor *this, s32 next_state){
ActorLocal_CC_BF0 *local = (ActorLocal_CC_BF0 *)&this->local;
s32 prev_state = this->state;
this->state = next_state;
local->unk8 = 0.0f;
if(this->state == 2){
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
}
else if(this->state == 3){
if(prev_state == 2){
levelSpecificFlags_set((local->unk0 == 1) ? 0 : 1, TRUE);
}
if(local->unk0 == 1){
this->yaw = -30.0f;
this->pitch = -90.0f;
this->roll = -5.0f;
}
else{
this->yaw = 30.0f;
this->pitch = 90.0f;
this->roll = 5.0f;
}
}
}
void func_803870E0(void) {
D_80389F80 = 0;
}
void func_803870EC(s32 arg0) {
D_80389F80 = arg0;
}
void func_803870F8(Actor *this){
ActorMarker *marker = this->marker;
f32 sp70[3];
ActorLocal_CC_BF0 *local = (ActorLocal_CC_BF0 *)&this->local;
f32 sp68 = time_getDelta();
f32 sp5C[3];
f32 sp50[3];
f32 temp_f2;
s32 flagCnt;
f32 sp3C[3];
if(!this->unk16C_4){
this->unk16C_4 = 1;
marker->propPtr->unk8_3 = 1;
this->pitch = 0.0f;
this->yaw = 0.0f;
this->roll = 0.0f;
local->unk0 = (marker->modelId == 0x309) ? 1 : 2;
local->egg_count = 0;
func_80386FE0(this, 1);
if(levelSpecificFlags_get((local->unk0 == 1)? LEVEL_FLAG_0_CC_TOKEN_TOOTH_OPEN: LEVEL_FLAG_1_CC_JIGGY_TOOTH_OPEN)){
func_80386FE0(this, 3);
}
}//L803871D8
player_getPosition(&sp70);
local->unk8 += sp68;
if(this->state == 2){
temp_f2 = local->unk8/1;
if(local->unk0 == 1){
this->yaw = -temp_f2*30.0f;
this->pitch = -temp_f2*90.0f;
this->roll = -temp_f2*5.0f;
}//L8038726C
else{
this->yaw = temp_f2*30.0f;
this->pitch = temp_f2*90.0f;
this->roll = temp_f2*5.0f;
}
}//L803872A0
if(local->unk0 == 1){
func_80388B78(&sp5C, &sp50);
}
else{
func_80388BBC(&sp5C, &sp50);
}//L803872D4
TUPLE_COPY(this->position, sp5C);
if(this->state == 1)
func_8028E668(&this->position, 290.0f, -10.0f, 150.0f);
if(this->state == 1 && D_80389F80 == local->unk0){
D_80389F80 = 0;
local->egg_count++;
if(local->egg_count == 3){
func_80386FE0(this, 2);
}else{
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
}
}
else if(this->state == 2 && 1.0f <= local->unk8){
flagCnt = levelSpecificFlags_get(LEVEL_FLAG_0_CC_TOKEN_TOOTH_OPEN) + levelSpecificFlags_get(LEVEL_FLAG_1_CC_JIGGY_TOOTH_OPEN);
if(!jiggyscore_isCollected(JIGGY_1B_CC_TOOTH)){
func_80311480((local->unk0 == 1)?
((flagCnt == 0)? 0xd30 : 0xd31) :
((flagCnt == 0)? 0xd2e : 0xd2f), 4, NULL, NULL, NULL, NULL);
}
func_80386FE0(this, 3);
}//L80387474
if(this->state == 3){
sp3C[0] = this->position_x;
sp3C[1] = this->position_y + 100;
sp3C[2] = this->position_z;
if(ml_vec3f_distance(&sp3C, &sp70) < 120.0f){
func_8031D04C(0x22, (local->unk0 == 1)? 7 : 6);
}
}//L80387500
}

37
src/CCW/code_0.c Normal file
View File

@@ -0,0 +1,37 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_803864B8(Actor *this);
extern ActorInfo D_8038EB50 = { 0x1AC, 0x298, 0x444, 0x0, NULL, func_803864B8, NULL, func_80325888, 0, 0, 0.0f, 0};
extern ActorInfo D_8038EB74 = { 0x1AC, 0x29A, 0x445, 0x0, NULL, func_803864B8, NULL, func_80325888, 0, 0, 0.0f, 0};
/* .code */
void func_803863F0(Actor *this, s32 next_state){
if(next_state == 2){
FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 1.0f, 32000, this->position, 500, 3000);
levelSpecificFlags_set(0x10, TRUE);
marker_despawn(this->marker);
}
this->state = next_state;
}
void func_80386468(ActorMarker* marker, ActorMarker *arg1) {
Actor* actor = marker_getActor(marker);
if (actor->state == 1 && map_get() == MAP_44_CCW_SUMMER) {
func_803863F0(actor, 2);
}
}
void func_803864B8(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
marker_setCollisionScripts(this->marker, NULL, NULL, func_80386468);
func_803863F0(this, 1);
if(levelSpecificFlags_get(0x10)){
marker_despawn(this->marker);
}
}
}

125
src/CCW/code_14B0.c Normal file
View File

@@ -0,0 +1,125 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8030DBFC(u8, f32, f32, f32);
extern void sfxsource_setSampleRate(u8, s32);
typedef struct{
s16 unk0;
u8 unk2;
u8 unk3;
s16 unk4;
}Struct_CCW_14B0_0;
typedef struct {
u8 unk0;
// u8 pad1[3];
Struct_CCW_14B0_0 *unk4;
f32 unk8;
f32 unkC[3];
f32 unk18[3];
}ActorLocal_CCW_14B0;
void func_80387A40(Actor *this);
/* .data */
extern Struct_CCW_14B0_0 D_8038EC00[];
extern ActorInfo D_8038EC14 = { 0x1AF, 0x29C, 0x446, 0x0, NULL, func_80387A40, NULL, func_80325888, 0, 0, 1.0f, 0};
/* .code */
void func_803878A0(Actor *this, s32 next_state) {
ActorLocal_CCW_14B0 *local = (ActorLocal_CCW_14B0 *)&this->local;
int i;
if (next_state == 1) {
if (func_8033567C(this->unk148) != 0x16F) {
func_80335924(this->unk148, 0x16F, 0.1f, 0.65f);
}
for(i = 0; i < 10; i++){
local->unkC[0] = randf2(-500.0f, 500.0f);
local->unkC[1] = randf2(400.0f, 900.0f);
local->unkC[2] = randf2(-400.0f, 700.0f);
if(ml_vec3f_distance(this->position, local->unkC) > 800.0f)
break;
}
local->unk8 = randf2(500.0f, 1000.0f);
}
this->state = next_state;
}
void func_80387A20(Actor *this){
ActorLocal_CCW_14B0 *local = (ActorLocal_CCW_14B0 *)&this->local;
func_8030DA44(local->unk0);
}
void func_80387A40(Actor *this) {
ActorLocal_CCW_14B0 *local;
f32 sp68;
f32 sp5C[3];
f32 sp58;
f32 sp54;
f32 sp50;
f32 sp44[3];
local = (ActorLocal_CCW_14B0 *)&this->local;
sp68 = time_getDelta();
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->unk30 = func_80387A20;
local->unk4 = &D_8038EC00[0];
while((local->unk4->unk0 != 0) && (map_get() != local->unk4->unk0)) {
local->unk4++;
}
local->unk0 = func_8030D90C();
local->unk18[0] = local->unk18[1] = local->unk18[2] = 0.0f;
sfxsource_setSfxId(local->unk0, 0x3FA);
func_8030DD14(local->unk0, 2);
func_8030DBB4(local->unk0, 0.9f);
sfxsource_setSampleRate(local->unk0, 0);
func_803878A0(this, 1);
return;
}
if (this->state == 1) {
sp5C[0] = local->unkC[0] - this->position[0];
sp5C[1] = local->unkC[1] - this->position[1];
sp5C[2] = local->unkC[2] - this->position[2];
if (ml_vec3f_distance(this->position, local->unkC) < 500.0f) {
ml_vec3f_set_length(sp5C, local->unk8 * 8.0f);
} else {
ml_vec3f_set_length(sp5C, local->unk8 * 2);
}
this->position[0] += (local->unk18[0] * sp68) + (sp5C[0] * sp68 * sp68);
this->position[1] += (local->unk18[1] * sp68) + (sp5C[1] * sp68 * sp68);
this->position[2] += (local->unk18[2] * sp68) + (sp5C[2] * sp68 * sp68);
local->unk18[0] += sp5C[0] * sp68;
local->unk18[1] += sp5C[1] * sp68;
local->unk18[2] += sp5C[2] * sp68;
if (local->unk8 < gu_sqrtf(local->unk18[0]*local->unk18[0] + local->unk18[1]*local->unk18[1] + local->unk18[2]*local->unk18[2])) {
ml_vec3f_set_length(local->unk18, local->unk8);
}
func_80258A4C(this->position, this->yaw - 90.0f, local->unkC, &sp58, &sp54, &sp50);
this->yaw += 140.0f * sp50 * sp68;
if (ml_vec3f_distance(this->position, local->unkC) < 100.0f) {
func_803878A0(this, 1);
}
}
if(this->position[0]);
func_8030DBFC(local->unk0, 0.8f, 0.9f, 0.05f);
func_8030DEB4(local->unk0, 500.0f, 1500.0f);
func_8030DF68(local->unk0, this->position);
func_8030E2C4(local->unk0);
sfxsource_setSampleRate(local->unk0, 2000.0f + 8000.0f*(gu_sqrtf(local->unk18[0]*local->unk18[0] + local->unk18[1]*local->unk18[1] + local->unk18[2]*local->unk18[2])/ local->unk8));
if (!mapSpecificFlags_get(local->unk4->unk2)) {
player_getPosition(sp44);
if (sp44[2] > -600.0f) {
if (!local->unk4->unk3 || !jiggyscore_isCollected(local->unk4->unk3) ) {
func_80311480(local->unk4->unk4, 4, NULL, NULL, NULL, NULL);
mapSpecificFlags_set(local->unk4->unk2, TRUE);
}
}
}
}

217
src/CCW/code_160.c Normal file
View File

@@ -0,0 +1,217 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
ActorMarker *unk0;
s32 unk4;
s32 unk8;
f32 unkC;
}ActorLocal_CCW_160;
void func_803865F4(Actor *this, s32 next_state);
void func_8038687C(Actor *this);
/* .data */
extern ActorInfo D_8038EBA0 = { 0x1AD, 0x299, 0x443, 0x0, NULL, func_8038687C, NULL, func_80325888, 0, 0, 0.0f, 0};
/* .code */
void func_80386550(ActorMarker *marker){
Actor *this;
ActorLocal_CCW_160 *local;
this = marker_getActor(marker);
local = (ActorLocal_CCW_160 *)&this->local;
this->unk124_11 = 2;
this->alpha_124_19 = 0xFF;
if (local->unk0 != NULL) {
actor_collisionOn(marker_getActor(local->unk0));
}
func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 28000);
}
void func_803865C4(ActorMarker* marker, enum asset_e text_id, s32 arg2) {
func_803865F4(marker_getActor(marker), 3);
}
void func_803865F4(Actor *this, s32 next_state) {
ActorLocal_CCW_160 *local;
local = (ActorLocal_CCW_160 *)&this->local;
local->unkC = 0.0f;
if (next_state == 2) {
if (!func_80320454(0xB5, 1)) {
func_80311480(0xCE2, 4, NULL, this->marker, func_803865C4, NULL);
} else {
func_80311480(0xCE3, 4, NULL, NULL, NULL, NULL);
func_803865F4(this, 3);
return;
}
}
if (next_state == 3) {
local->unkC = 0.1f;
func_8025A58C(0, 4000);
func_8025A6EC(COMUSIC_4B_CCW_ZUBBA_FIGHT, 30000);
}
if (next_state == 4) {
if (func_803203FC(2)) {
item_set(ITEM_6_HOURGLASS, FALSE);
func_803204E4(3, 0);
func_803204E4(5, 1);
} else {
func_80311480(0xCE4, 4, NULL, NULL, NULL, NULL);
func_8025A58C(-1, 400);
comusic_8025AB44(COMUSIC_4B_CCW_ZUBBA_FIGHT, 0, 400);
func_8025AABC(COMUSIC_4B_CCW_ZUBBA_FIGHT);
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
func_80324E38(0.0f, 3);
timed_setCameraToNode(2.0f, 4);
timedFunc_set_1(2.0f, (TFQM1)func_80386550, (s32) this->marker);
func_80324E88(4.0f);
func_80324E38(4.0f, 0);
}
}
this->state = next_state;
}
void func_803867C8(ActorMarker *marker){
Actor *this;
ActorLocal_CCW_160 *local;
this = marker_getActor(marker);
local = (ActorLocal_CCW_160 *)&this->local;
local->unk8++;
local->unk4--;
if(local->unk8 == 10){
func_803865F4(this, 4);
}
}
void func_80386814(ActorMarker *marker){
Actor *this;
ActorLocal_CCW_160 *local;
this = marker_getActor(marker);
local = (ActorLocal_CCW_160 *)&this->local;
local->unk4--;
}
void func_80386840(ActorMarker *marker, s32 *score, s32 *total){
Actor *this;
ActorLocal_CCW_160 *local;
this = marker_getActor(marker);
local = (ActorLocal_CCW_160 *)&this->local;
*score = local->unk8;
*total = 10;
}
void func_8038687C(Actor *this) {
ActorLocal_CCW_160 *local;
f32 sp88;
Actor *other;
f32 sp78[3];
f32 sp6C[3];
s32 pad68;
f32 sp5C[3];
s32 phi_s0;
f32 sp4C[3];
f32 sp40[3];
s32 phi_v0;
f32 tmp;
sp88 = time_getDelta();
local = (ActorLocal_CCW_160 *)&this->local;
if(!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
local->unk0 = 1;
local->unk4 = 0;
local->unk8 = 0;
local->unkC = 0.0f;
if (func_803203FC(2)) {
this->position_y -= 300.0f;
}
func_803865F4(this, 1);
return;
}
if ((s32)local->unk0 == 1) {
other = func_80326EEC(0x46);
if(func_803203FC(2)) {
local->unk0 = NULL;
if (other != NULL) {
actor_collisionOff(other);
other->position[1] -= 300.0f;
}
} else if (other != NULL) {
local->unk0 = other->marker;
actor_collisionOff(other);
if (jiggyscore_isCollected(JIGGY_4C_CCW_ZUBBAS) != 0) {
marker_despawn(local->unk0);
marker_despawn(this->marker);
}
} else {
marker_despawn(this->marker);
}
return;
}
if (local->unk0 != NULL) {
other = marker_getActor(local->unk0);
func_8024C5CC(sp78);
sp6C[0] = this->position[0] - sp78[0];
sp6C[1] = this->position[1] - sp78[1];
sp6C[2] = this->position[2] - sp78[2];
sp6C[1] = 0.0f;
ml_vec3f_set_length(sp6C, 20.0f);
other->position[0] = this->position[0] + sp6C[0];
other->position[1] = this->position[1] + sp6C[1];
other->position[2] = this->position[2] + sp6C[2];
}
if (func_8025773C(&local->unkC, sp88)) {
if ((local->unk4 < 3) && ((local->unk8 + local->unk4) < 10)) {
player_getPosition(sp5C);
for(phi_s0 = 0; phi_s0 < 20; phi_s0++){
sp4C[0] = randf2(-500.0f, 500.0f);
sp4C[1] = -100.0f;
sp4C[2] = randf2(-500.0f, 900.0f);
if(ml_vec3f_distance(this->position, sp4C) < 400.0f)
continue;
tmp = ml_vec3f_distance(sp5C, sp4C);
phi_v0 = (phi_s0 < 0xA) ? 500 : 200;
if(tmp < (f32) phi_v0)
continue;
if(func_8024DC04(sp4C[0], 0.0f, sp4C[2]))
break;
}
func_802C3F04(func_802C4140, 0x29B, reinterpret_cast(s32, sp4C[0]), reinterpret_cast(s32, sp4C[1]), reinterpret_cast(s32, sp4C[2]));
local->unk4++;
}
local->unkC = randf2(0.5 - ((local->unk8 / 10) * 0.4), 1.0 - ((local->unk8 / 10) * 0.8));
}
if (this->state == 1) {
if (func_803203FC(2) && func_803203FC(3)) {
item_set(ITEM_6_HOURGLASS, 1);
item_set(ITEM_0_HOURGLASS_TIMER, 1800 - 1);
func_803865F4(this, 3);
} else if ((local->unk0 != NULL) && (map_get() == MAP_5A_CCW_SUMMER_ZUBBA_HIVE)) {
player_getPosition(sp40);
if ((ml_vec3f_distance(this->position, sp40) < 300.0f) && (player_getTransformation() == TRANSFORM_1_BANJO)) {
func_803865F4(this, 2);
}
}
}
if ((this->state == 3) && func_803203FC(2) && item_empty(ITEM_0_HOURGLASS_TIMER)) {
item_set(ITEM_6_HOURGLASS, 0);
func_803204E4(3, 0);
func_803204E4(5, 0);
}
}

162
src/CCW/code_1B20.c Normal file
View File

@@ -0,0 +1,162 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
s16 unk0;
u8 unk2;
u8 unk3;
s16 unk4;
s16 unk6;
s16 unk8;
s16 unkA;
}Struct_CCW_1B20_0;
typedef struct{
Struct_CCW_1B20_0 *unk0;
}ActorLocal_CCW_1B20;
void func_80387F64(Actor *this, s32 next_state);
Actor *func_803882F4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_80388478(Actor *this);
/* .data */
extern Struct_CCW_1B20_0 D_8038EC40[4];
extern ActorInfo D_8038EC70 = { 0x1B0, 0x29D, 0x447, 0x0, NULL, func_80388478, NULL, func_803882F4, 0, 0, 1.0f, 0};
extern f32 D_8038EC94[3];
/* .code */
void func_80387F10() {
jiggySpawn(JIGGY_4D_CCW_FLOWER, D_8038EC94);
}
void func_80387F38(ActorMarker* marker, s32 arg1) {
func_80387F64(marker_getActor(marker), arg1);
}
void func_80387F64(Actor *this, s32 next_state){
ActorLocal_CCW_1B20 *local;
f32 phi_f22;
local = (ActorLocal_CCW_1B20 *)&this->local;
if (next_state == 1) {
this->marker->propPtr->unk8_3 = local->unk0->unk3;
func_80335924(this->unk148, local->unk0->unk0, 0.0f, 5.0f);
func_80335A8C(this->unk148, local->unk0->unk2);
}
if (next_state == 2) {
if (map_get() == MAP_43_CCW_SPRING) {
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
}
func_80320004(local->unk0->unk8, 1);
func_80335924(this->unk148, local->unk0->unk4, 0.0f, 6.0f);
func_80335A8C(this->unk148, 2);
if (map_get() == MAP_43_CCW_SPRING) {
func_80324E38(0.0f, 3);
}
timed_setCameraToNode(0.0f, 0);
for( phi_f22 = 0.0f; phi_f22 <= 1.0f; phi_f22 += 0.1) {
timed_playSfx(phi_f22 * 5.7, 0x2C, phi_f22 * 0.3 + 0.7, (s32) (32000.0f - phi_f22 * 5000.0f));
}
if (local->unk0->unkA != 0) {
timed_setCameraToNode(6.0f, 1);
timedFunc_set_0(6.1f, func_80387F10);
timedFunc_set_2(8.0f, func_80387F38, (s32) this->marker, 3);
} else {
if (map_get() == MAP_43_CCW_SPRING) {
func_80324E88(7.0f);
func_80324E38(7.0f, 0);
}
timedFunc_set_2(7.0f, func_80387F38, (s32) this->marker, 3);
}
}
if (next_state == 3) {
this->marker->propPtr->unk8_3 = TRUE;
func_80335924(this->unk148, local->unk0->unk6, 0.1f, 5.0f);
func_80335A8C(this->unk148, 1);
}
this->state = next_state;
}
bool func_80388260(ActorMarker *marker, s32 arg1){
return marker->unk40_31 != 1;
}
void func_80388278(ActorMarker *marker, ActorMarker *other_marker) {
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
}
void func_803882A4(ActorMarker* marker, ActorMarker *other_marker) {
Actor* actor = marker_getActor(marker);
if (map_get() == MAP_43_CCW_SPRING && actor->state == 1) {
func_80387F64(actor, 2);
}
}
Actor *func_803882F4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Actor *this;
s32 sp18;
this = marker_getActor(marker);
if ((this->state == 1) && !func_8031FF1C(0xE3)) {
return func_80325340(marker, gfx, mtx, vtx);
}
if ((func_8033567C(this->unk148) == 0x175) && (0.49 <= func_80335684(this->unk148))) {
sp18 = 1;
} else {
sp18 = 0;
}
sp18 = (func_8033567C(this->unk148) == 0x183)? 1 : sp18;
func_8033A45C(3, sp18);
func_8033A45C(4, sp18);
return func_80325888(marker, gfx, mtx, vtx);
}
void func_803883F4() {
Actor* actor = func_80326EEC(0x29D);
if (actor && actor->state == 1) {
func_80387F64(actor, 2);
}
}
bool func_80388438() {
Actor* actor = func_80326EEC(0x29D);
if (actor && actor->state == 2) {
return TRUE;
}
return FALSE;
}
void func_80388478(Actor *this) {
ActorLocal_CCW_1B20 *local;
local = (ActorLocal_CCW_1B20 *)&this->local;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
func_803300C0(this->marker, func_80388260);
marker_setCollisionScripts(this->marker, NULL, func_80388278, func_803882A4);
actor_collisionOn(this);
if (!jiggyscore_isSpawned(JIGGY_4D_CCW_FLOWER)) {
func_80320004(0xE5, FALSE);
}
for(local->unk0 = &D_8038EC40[0]; local->unk0 < D_8038EC40 + 3; local->unk0++){
if(!func_8031FF1C(local->unk0->unk8)){
break;
}
}
if (!func_8031FF1C(0xE3) && (map_get() != MAP_43_CCW_SPRING)) {
marker_despawn(this->marker);
}
else{
func_80387F64(this, 1);
}
}
}

34
src/CCW/code_21A0.c Normal file
View File

@@ -0,0 +1,34 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_803885F8(Actor *this);
/* .data */
extern ActorInfo D_8038ECA0 = {
0x1C2, 0x30B, 0x4E3,
0x0, NULL,
func_803885F8, NULL, func_80325888,
0, 0, 1.0f, 0
};
/* .code */
void func_80388590(Actor *this, s32 next_state){
if(next_state == 1){
func_80335924(this->unk148, 0x219, 0.0f, 1.0f);
func_80335A8C(this->unk148, 4);
}
this->state = next_state;
}
void func_803885F8(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(func_8031FF1C(0xe5)){
func_80388590(this, 1);
}
else{
marker_despawn(this->marker);
}
}
}

207
src/CCW/code_2270.c Normal file
View File

@@ -0,0 +1,207 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
s16 map_id;
s16 unk2;
s16 unk4;
s16 unk6;
}Struct_CCW_2270_0;
typedef struct{
Struct_CCW_2270_0 *unk0;
void *unk4;
void *unk8;
}ActorLocal_CCW_2270;
void func_8038868C(Actor *this, s32 next_state);
Actor *func_803889AC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_80388AA0(Actor *this);
/* .data */
extern Struct_CCW_2270_0 D_8038ECD0[];
extern ActorInfo D_8038ECE8 = { 0x1B1, 0x29E, ASSET_3E0_MODEL_GOBI, 0x0, NULL, func_80388AA0, func_80388AA0, func_803889AC, 0, 0, 1.0f, 0};
/* .code */
void func_80388660(ActorMarker* marker, s32 arg1) {
func_8038868C(marker_getActor(marker), arg1);
}
void func_8038868C(Actor *this, s32 next_state) {
ActorLocal_CCW_2270 *local;
local = (ActorLocal_CCW_2270*)&this->local;
if (next_state == 1) {
func_80335924(this->unk148, ASSET_F4_ANIM_GOBI_IDLE, 0.5f, 12.0f);
}
if (next_state == 2) {
if (local->unk0->unk4 != 0) {
func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL);
}
func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 3.0f);
func_80335A8C(this->unk148, 2);
func_80335924(local->unk4, ASSET_100_ANIM_GOBI_SPIT, 0.0f, 3.0f);
func_80335A8C(local->unk4, 2);
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.0f, (map_get() == MAP_44_CCW_SUMMER) ? 1 : 2);
timed_playSfx(0.05f, SFX_84_GOBI_CRYING, 1.1f, 32000);
timed_playSfx(0.8f, SFX_4B_GULPING, 0.8f, 28000);
timed_playSfx(1.4f, SFX_4B_GULPING, 0.8f, 28000);
timed_playSfx(2.0f, SFX_4B_GULPING, 0.8f, 28000);
timedFunc_set_2(3.2f, (TFQM2) func_80388660, (s32) this->marker, 3);
}
if (next_state == 3) {
func_803883F4();
}
if (next_state == 4) {
func_80335924(this->unk148, ASSET_176_ANIM_GOBI_YAWN, 0.5f, 4.0f);
func_80335A8C(this->unk148, 2);
func_80324E88(0.0f);
func_80324E38(0.0f, 0);
}
if (next_state == 5) {
if (local->unk0->unk6 != 0) {
func_80311480((s32) local->unk0->unk6, 4, NULL, NULL, NULL, NULL);
}
func_80335924(this->unk148, ASSET_FD_ANIM_GOBI2_GETTING_UP, 0.23f, 0.5f);
timed_setCameraToNode(0.0f, 3);
}
if (next_state == 6) {
func_80335924(this->unk148, ASSET_F8_ANIM_GOBI_RUNNING, 0.1f, 0.71f);
func_80335A8C(this->unk148, 1);
}
if (next_state == 7) {
func_80324E88(0.0f);
func_80324E38(0.0f, 0);
marker_despawn(this->marker);
}
this->state = next_state;
}
void func_8038894C(ActorMarker* marker, ActorMarker *other_marker) {
Actor* actor = marker_getActor(marker);
if (actor->state == 1) {
actor_collisionOff(actor);
timedFunc_set_2(0.5f, (TFQM2)func_80388660, (s32)actor->marker, 2);
}
}
Actor *func_803889AC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this;
ActorLocal_CCW_2270 *local;
f32 sp2C[3];
this = marker_getActor(marker);
local = (ActorLocal_CCW_2270*)&this->local;
if (this->state == 2) {
sp2C[0] = this->pitch;
sp2C[1] = this->yaw;
sp2C[2] = this->roll;
func_8033A238(func_803356A0(local->unk4, local));
set_model_render_mode(2);
func_803391A4(gfx, mtx, this->position, sp2C, 1.0f, NULL, local->unk8);
}
return func_80325888(marker, gfx, mtx, vtx);
}
void func_80388A70(Actor *this){
ActorLocal_CCW_2270 *local = (ActorLocal_CCW_2270*)&this->local;
func_80335874(local->unk4);
assetcache_release(local->unk8);
}
void func_80388AA0(Actor *this) {
ActorLocal_CCW_2270 *local;
f32 sp48[3];
f32 sp44;
f32 sp40;
local = (ActorLocal_CCW_2270*)&this->local;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
this->marker->unk30 = func_80388A70;
this->unk138_24 = FALSE;
local->unk4 = func_803358B4();
local->unk8 = assetcache_get(0x3F3);
marker_setCollisionScripts(this->marker, 0, func_8038894C, 0);
if(!jiggyscore_isSpawned(JIGGY_4D_CCW_FLOWER)) {
func_80320004(0xE5, 0);
}
local->unk0 = &D_8038ECD0[0];
while((local->unk0->map_id != 0) && (map_get() != local->unk0->map_id)) {
local->unk0++;
}
if( (map_get() == MAP_44_CCW_SUMMER) && func_8031FF1C(0xE3) && !func_8031FF1C(0xE4)) {
func_8038868C(this, 1);
} else if( (map_get() == MAP_45_CCW_AUTUMN) && func_8031FF1C(0xE4) && !func_8031FF1C(0xE5) ) {
func_8038868C(this, 1);
} else{
marker_despawn(this->marker);
}
return;
}
if(this->state == 1){
if (!this->unk138_24) {
player_getPosition(sp48);
if (ml_vec3f_distance(this->position, sp48) < 600.0f) {
if (local->unk0->unk2 != 0) {
func_80311480((s32) local->unk0->unk2, 4, NULL, NULL, NULL, NULL);
}
this->unk138_24 = TRUE;
}
}
}
if (this->state == 2) {
func_80335A94(local->unk4, time_getDelta(), 1);
}
if(this->state == 3){
if (!func_80388438()) {
if (map_get() == MAP_44_CCW_SUMMER) {
func_8038868C(this, 4);
} else {
func_8038868C(this, 5);
}
}
}
if (this->state == 4) {
if ((func_8033567C(this->unk148) == ASSET_176_ANIM_GOBI_YAWN) && (func_80335794(this->unk148) > 0)) {
func_80335924(this->unk148, ASSET_177_ANIM_GOBI_SLEEP, 0.1f, 4.0f);
func_80335A8C(this->unk148, 1);
}
if (func_8033567C(this->unk148) == ASSET_177_ANIM_GOBI_SLEEP) {
func_8033568C(this->unk148, &sp44, &sp40);
if ((sp44 < 0.1) && (0.1 <= (f64) sp40)) {
FUNC_8030E8B4(SFX_5E_BANJO_PHEWWW, 0.8f, 15000, this->position, 500, 1500);
}
if ((sp44 < 0.8) && (0.8 <= (f64) sp40)) {
FUNC_8030E8B4(SFX_5D_BANJO_RAAOWW, 0.8f, 15000, this->position, 500, 1500);
}
}
}
if (this->state == 5){
if(func_80335794(this->unk148) > 0) {
func_8038868C(this, 6);
}
}
if (this->state == 6) {
func_80326224(this);
if (0.99 < (f64) this->unk48) {
func_8038868C(this, 7);
}
}
}

170
src/CCW/code_2B00.c Normal file
View File

@@ -0,0 +1,170 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
}Struct_CCW_2B00_0;
void func_80389268(Actor *this);
void func_80388FD4(Actor *this);
/* .data */
Struct_CCW_2B00_0 D_8038ED10[] = {
{0, 0x40, 0, 5},
{0, 0x43, 1, 5},
{0, 0x44, 2, 5},
{0, 0x45, 3, 15}
};
ActorAnimationInfo D_8038ED20[] = {
{0, 0.0f},
{0, 0.0f},
{0, 0.0f},
{0, 0.0f},
{ASSET_D4_ANIM_SWITCH_DOWN, 0.5f},
{ASSET_D4_ANIM_SWITCH_DOWN, 100000000.0f}
};
ActorInfo D_8038ED50 = { 0x133, 0x1E3, 0x52E, 0x1, NULL, func_80389268, func_80326224, func_80325E78, 0, 0x4000, 0.0f, 0};
ActorInfo D_8038ED74 = { 0x132, 0x1E2, 0x4F5, 0x5, D_8038ED20, func_80388FD4, func_80326224, func_80325888, 0, 0, 0.0f, 0};
ActorInfo D_8038ED98 = { 0x131, 0x16D, 0x52E, 0x1, NULL, func_80389268, func_80326224, func_80325E78, 0, 0x4000, 0.0f, 0};
ActorInfo D_8038EDBC = { 0x130, 0x16C, 0x4F6, 0x5, D_8038ED20, func_80388FD4, func_80326224, func_80325888, 0, 0, 0.0f, 0};
ActorInfo D_8038EDE0 = { 0x12F, 0x16B, 0x52E, 0x1, NULL, func_80389268, func_80326224, func_80325E78, 0, 0x4000, 0.0f, 0};
ActorInfo D_8038EE04 = { 0x12E, 0x16A, 0x4F7, 0x5, D_8038ED20, func_80388FD4, func_80326224, func_80325888, 0, 0, 0.0f, 0};
ActorInfo D_8038EE28 = { 0x12D, 0x169, 0x52E, 0x1, NULL, func_80389268, func_80326224, func_80325E78, 0, 0x4000, 0.0f, 0};
ActorInfo D_8038EE4C = { 0x12C, 0x168, 0x4F8, 0x5, D_8038ED20, func_80388FD4, func_80326224, func_80325888, 0, 0, 0.0f, 0};
/* .code */
s32 func_80388EF0(Actor *this){
switch(this->marker->unk14_20){
case 0x133: //L80388F28
case 0x132: //L80388F28
return 0;
case 0x131: //L80388F30
case 0x130: //L80388F30
return 1;
case 0x12F: //L80388F38
case 0x12E: //L80388F38
return 2;
case 0x12D: //L80388F40
case 0x12C: //L80388F40
return 3;
default:
return 0;
}
}
void func_80388F50(ActorMarker *marker, ActorMarker *other_marker){
Actor *this;
this = marker_getActor(marker);
if ((func_8028ECAC() != 1) && !this->unk38_0) {
this->unk38_0 = TRUE;
actor_collisionOff(this);
func_80328B8C(this, 4, 0.0f, 1);
actor_playAnimationOnce(this);
func_8030E6D4(SFX_90_SWITCH_PRESS);
}
}
void func_80388FD4(Actor *this) {
if (!this->initialized) {
this->unk138_31 = this->unk124_0 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
this->unk10_12 = func_80388EF0(this);
this->initialized = TRUE;
}
if (!this->unk16C_4) {
if (func_8031FF1C(this->unk10_12 + 0x8B)) {
actor_playAnimationOnce(this);
func_80328B8C(this, 4, 0.999f, 1);
actor_collisionOff(this);
} else {
marker_setCollisionScripts(this->marker, 0, &func_80388F50, 0);
}
this->unk38_0 = FALSE;
this->unk16C_4 = TRUE;
}
if( (this->state == 4)
&& this->unk38_0
&& actor_animationIsAt(this, 0.999f)
){
func_802D6264(1.1f, 0x40, this->unk10_12 + 0x3C, 0x2B, D_8038ED10[this->unk10_12].unk3, this->unk10_12 + 0x8B);
func_80324E38(0.5f, 3);
timedFunc_set_2(1.1f, levelSpecificFlags_set, this->unk10_12 + 7, TRUE);
func_80324E38(5.6f, 0);
}
}
void func_803891B0(void* marker) {
Actor* actor = marker_getActor(reinterpret_cast(ActorMarker*, marker));
actor->unk44_31 = func_8030ED2C(SFX_3EC_CCW_DOOR_OPENING, 3);
func_8030DD90(actor->unk44_31, 0);
sfxsource_setSampleRate(actor->unk44_31, 0x2AF8);
func_8030DBB4(actor->unk44_31, 0.3f);
func_8030E2C4(actor->unk44_31);
}
void func_8038921C(void* marker) {
Actor* actor = marker_getActor(reinterpret_cast(ActorMarker*, marker));
func_8030E394(actor->unk44_31);
func_8030DA44(actor->unk44_31);
actor->unk44_31 = 0U;
FUNC_8030E624(SFX_6C_LOCKUP_CLOSING, 1.0f, 25000);
}
void func_80389268(Actor *this) {
ActorProp *temp_v1;
u32 temp_v0;
u32 temp_v1_2;
if(!this->initialized) {
this->unk58_2 = FALSE;
this->unk10_12 = func_80388EF0(this);
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
this->initialized = TRUE;
}
if (!this->unk16C_4) {
this->unk1C[0] = this->position[0];
this->unk1C[1] = this->position[1];
this->unk1C[2] = this->position[2];
this->unk1C[1] += 250.0f;
this->unk16C_4 = TRUE;
if (func_8031FF1C(this->unk10_12 + 0x8B)) {
func_80328A84(this, 3);
}
}
switch (this->state) { /* irregular */
case 1:
if (levelSpecificFlags_get(this->unk10_12 + 7)) {
timedFunc_set_1(0.05f, func_803891B0, (s32) this->marker);
timedFunc_set_1(4.0f, func_8038921C, (s32) this->marker);
func_80328A84(this, 2);
}
break;
case 2:
this->position[1] += 60.0f * time_getDelta();
if (this->unk1C[1] <= this->position[1]) {
levelSpecificFlags_set(this->unk10_12 + 7, FALSE);
func_80328A84(this, 3);
}
break;
case 3:
this->position[1] = this->unk1C[1];
break;
}
}

69
src/CCW/code_3050.c Normal file
View File

@@ -0,0 +1,69 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
Actor *func_8038954C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_803895F4(Actor *this);
/* .data */
extern ActorInfo D_8038EE70 = { 0x1B3, 0x2A0, 0x483, 0x0, NULL, func_803895F4, NULL, func_8038954C, 0, 0, 0.0f, 0};
/* .code */
void func_80389440(Actor *this, s32 next_state) {
void *temp_v0;
if (next_state == 2) {
func_8030E510(SFX_AA_BGS_EGG_BREAKING_1, 28000);
this->marker->propPtr->unk8_3 = FALSE;
func_80320004(0xE6, 1);
func_80335924(this->unk148, 0x187, 0.0f, 2.0f);
func_80335A8C(this->unk148, 2);
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.0f, 2);
func_80324E88(8.0f);
func_80324E38(8.0f, 0);
}
this->state = next_state;
}
void func_8038950C(ActorMarker* marker, ActorMarker* other_marker) {
Actor* actor = marker_getActor(marker);
if (actor->state == 1) {
func_80389440(actor, 2);
}
}
Actor *func_8038954C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Actor *this;
this = marker_getActor(marker);
if (this->state == 0)
return this;
func_8033A45C(3, (this->state < 2) ? 1 : 0);
func_8033A45C(4, (this->state < 2) ? 0 : 1);
return func_80325888(marker, gfx, mtx, vtx);
}
void func_803895F4(Actor *this) {
f32 sp2C;
f32 sp28;
if(!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
marker_setCollisionScripts(this->marker, NULL, NULL, &func_8038950C);
func_80389440(this, 1);
if ((func_8031FF1C(0xE6) != 0) || jiggyscore_isSpawned(JIGGY_49_CCW_EYRIE)) {
marker_despawn(this->marker);
}
return;
}
if (this->state == 2) {
func_8033568C(this->unk148, &sp2C, &sp28);
if ((sp2C < 0.5) && (sp28 >= 0.5)) {
func_80326310(this);
}
}
}

251
src/CCW/code_3310.c Normal file
View File

@@ -0,0 +1,251 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
f32 unk0;
s16 unk4;
f32 unk8;
s16 unkC;
}Struct_CCW_3310_1;
typedef struct {
s16 map_id;
s16 unk2;
s16 unk4;
s16 unk6;
Struct_CCW_3310_1 *unk8;
s16 unkC;
s16 unkE;
Struct_CCW_3310_1 *unk10;
s16 unk14;
// u8 pad16[2];
Struct_CCW_3310_1 *unk18;
s16 unk1C;
// u8 pad1E[0x2];
Struct_CCW_3310_1 *unk20;
u8 unk24;
u8 unk25;
s16 unk26;
s16 unk28;
// u8 pad2A[2];
}Struct_CCW_3310_0;
typedef struct {
Struct_CCW_3310_0 *unk0;
u8 unk4;
//u8 pad5[3];
Struct_CCW_3310_1 *unk8;
s32 unkC[3];
}ActorLocal_CCW_3310;
Actor *func_80389B24(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_80389BFC(Actor *this);
/* .data */
extern Struct_CCW_3310_1 D_8038F060[];
extern Struct_CCW_3310_0 D_8038F080[];
extern ActorInfo D_8038F130 = { 0x1B4, 0x2A1, 0x484, 0x0, NULL, func_80389BFC, NULL, func_80389B24, 0, 0, 0.0f, 0};
/* .bss */
extern f32 D_8038FDE0[3];
/* .code */
void func_80389700(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
func_80324E88(0.5f);
func_80324E38(0.5f, 0);
}
void func_80389740(ActorMarker *marker) {
Actor *this = marker_getActor(marker);
if (this->marker->unk14_21) {
func_802C3F04(func_802C4140, 0x30C, reinterpret_cast(s32, D_8038FDE0[0]), reinterpret_cast(s32, D_8038FDE0[1]), reinterpret_cast(s32, D_8038FDE0[2]));
}
}
void func_80389798() {
func_8030E6D4(SFX_18C_EYRIE_MAMA);
}
void func_803897B8(Actor *this, s32 next_state) {
ActorLocal_CCW_3310 *local;
local = (ActorLocal_CCW_3310 *)&this->local;
local->unk8 = NULL;
if (next_state == 1) {
if (local->unk0->unk6 != 0) {
func_80335924(this->unk148, local->unk0->unk6, 0.2f, 6.0f);
func_80335A8C(this->unk148, 1);
}
local->unk8 = local->unk0->unk8;
}
if ((this->state == 1) && (next_state == 2)) {
func_80320004(local->unk0->unk4, TRUE);
}
if (next_state == 5) {
func_8028F784(1);
func_80335924(this->unk148, local->unk0->unk26, 0.2f, 2.0f);
func_80335A8C(this->unk148, 2);
local->unk8 = &D_8038F060[0];
}
if (next_state == 2) {
func_80335924(this->unk148, local->unk0->unkE, 0.2f, 8.0f);
func_80335A8C(this->unk148, 2);
func_80324E38(0.5f, 3);
timed_setCameraToNode(0.5f, local->unk0->unk24);
func_80324E88(16.5f);
func_80324E38(16.5f, 0);
local->unk8 = local->unk0->unk10;
}
if (next_state == 3) {
actor_collisionOff(this);
func_80335924(this->unk148, local->unk0->unk14, 0.5f, 8.5f);
func_80335A8C(this->unk148, 2);
if (local->unk0->map_id == MAP_43_CCW_SPRING) {
func_80311480(0xCD6, 4, NULL, NULL, NULL, NULL);
func_8033579C(this->unk148, 0x3F266666, &func_80389798);
}
if (local->unk0->map_id == MAP_44_CCW_SUMMER) {
func_80311480(0xCD9, 4, NULL, NULL, NULL, NULL);
}
if (local->unk0->map_id == MAP_45_CCW_AUTUMN) {
func_80311480(0xCDB, 4, NULL, NULL, NULL, NULL);
}
local->unk8 = local->unk0->unk18;
}
if (next_state == 4) {
func_8028F784(0);
func_80335924(this->unk148, local->unk0->unk1C, 0.2f, 6.0f);
func_80335A8C(this->unk148, 1);
func_80335800(this->unk148, 0.2f, func_80389740, this->marker);
func_80335800(this->unk148, 0.3f, func_80389740, this->marker);
func_80335800(this->unk148, 0.4f, func_80389740, this->marker);
func_80335800(this->unk148, 0.72f, func_80389740, this->marker);
func_80335800(this->unk148, 0.82f, func_80389740, this->marker);
func_80335800(this->unk148, 0.92f, func_80389740, this->marker);
local->unk8 = local->unk0->unk20;
}
this->state = next_state;
}
Actor *func_80389B24(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this;
ActorLocal_CCW_3310 *local;
this = marker_getActor(marker);
local = (ActorLocal_CCW_3310 *)&this->local;
if( (this->state == 0)
|| ((this->state == 1) && (local->unk0->unk6 == 0))
) {
return this;
}
func_8033A45C(3, (this->state == 4) ? 2 : 1);
func_80325888(marker, gfx, mtx, vtx);
func_8034A174(func_80329934(), 5, D_8038FDE0);
return this;
}
void func_80389BD8(f32 dst[3]){
dst[0] = D_8038FDE0[0];
dst[1] = D_8038FDE0[1];
dst[2] = D_8038FDE0[2];
}
void func_80389BFC(Actor *this) {
Struct_CCW_3310_1 *iPtr;
ActorLocal_CCW_3310 *local;
f32 sp5C;
f32 sp58;
f32 sp4C[3];
local = (ActorLocal_CCW_3310 *)&this->local;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
this->unk138_24 = FALSE;
this->position[0] = -4900.0f;
this->position[1] = 4619.0f;
this->position[2] = 0.0f;
D_8038FDE0[0] = this->position[0];
D_8038FDE0[1] = this->position[1];
D_8038FDE0[2] = this->position[2];
if (this->state == 0) {
local->unk4 = 0U;
}
local->unk0 = &D_8038F080[0];
while(local->unk0->map_id != 0 && map_get() != local->unk0->map_id){
local->unk0++;
}
if ((local->unk0->unk2 != 0) && !func_8031FF1C(local->unk0->unk2)) {
marker_despawn(this->marker);
} else if (!func_8031FF1C(local->unk0->unk4)) {
func_803897B8(this, 1);
} else {
func_803897B8(this, 4);
}
if (jiggyscore_isSpawned(JIGGY_49_CCW_EYRIE) != 0) {
marker_despawn(this->marker);
}
return;
}
if (local->unk8) {
func_8033568C(this->unk148, &sp5C, &sp58);
for(iPtr = local->unk8; iPtr->unk0 > 0.0f; iPtr ++){
if ((sp5C < iPtr->unk0) && (iPtr->unk0 <= sp58)) {
func_8030E878((s32) iPtr->unk4, randf2(iPtr->unk8 - 0.05, iPtr->unk8 + 0.05), iPtr->unkC, this->position, 500.0f, 2500.0f);
}
}
}
if (this->state == 1) {
player_getPosition(sp4C);
if( !this->unk138_24
&& (local->unkC[2] >= 6500)
&& (sp4C[2] < 6500.0f)
&& (local->unk0->unk28 != 0)
){
this->unk138_24 = TRUE;
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.0f, local->unk0->unk24);
func_80324DBC(0.0f, local->unk0->unk28, 6, NULL, this->marker, func_80389700, NULL);
}
local->unkC[0] = (s32) sp4C[0];
local->unkC[1] = (s32) sp4C[1];
local->unkC[2] = (s32) sp4C[2];
if (item_getCount(ITEM_22_CATERPILLAR) == 0) {
func_8028F784(0);
}
if ((local->unk0->map_id != MAP_43_CCW_SPRING) && ((this->position[0] + 500.0f) < sp4C[0])) {
func_8028F364(this->position, 1110.0f, 200.0f, ACTOR_2A2_CATERPILLAR, &this);
if ((local->unk0->unkE != 0) && (func_8028E8C0() == ACTOR_2A2_CATERPILLAR) && (ml_vec3f_distance(this->position, sp4C) < 1010.0f) && (func_8028FC34() != 0)) {
func_8028FA54(D_8038FDE0);
if ((local->unk0->map_id == MAP_44_CCW_SUMMER) && (local->unk4 == 0)) {
func_80311480(0xCD8, 4, NULL, NULL, NULL, NULL);
}
local->unk4++;
if (local->unk4 < local->unk0->unk25) {
func_803897B8(this, 5);
} else {
func_803897B8(this, 2);
}
}
}
if (func_8031FF1C(local->unk0->unk4)) {
func_803897B8(this, local->unk0->unkC);
}
}
if ((this->state == 2) && (func_80335794(this->unk148) > 0)) {
func_803897B8(this, 3);
}
if ((this->state == 3) && (func_80335794(this->unk148) > 0)) {
func_803897B8(this, 4);
}
if ((this->state == 5) && (func_80335794(this->unk148) > 0)) {
func_803897B8(this, 1);
}
}

187
src/CCW/code_3DA0.c Normal file
View File

@@ -0,0 +1,187 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern ActorMarker *func_8028E86C(void);
extern void func_8028F7D4(f32, f32);
typedef struct {
f32 unk0[3];
f32 unkC[3];
f32 unk18[3];
f32 unk24;
} ActorLocal_Caterpillar;
void chcaterpillar_update(Actor *this);
Actor* chcaterpillar_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo chCaterpillar = {
MARKER_1B5_CATERPILLAR, ACTOR_2A2_CATERPILLAR, ASSET_485_MODEL_CATERPILLAR,
0x0, NULL,
chcaterpillar_update, NULL, chcaterpillar_draw,
0, 0, 1.0f, 0
};
/* .code */
f32 func_8038A190(Actor *this, f32 *arg1) {
f32 temp_f0;
f32 temp_f2;
temp_f0 = func_80309724(arg1);
temp_f2 = this->position[1];
if (((temp_f2 + 50.0f) < temp_f0) || (temp_f0 < (temp_f2 - 50.0f))) {
return temp_f2;
}
return temp_f0;
}
void chcaterpillar_setState(Actor *this, s32 next_state) {
ActorLocal_Caterpillar *local = (ActorLocal_Caterpillar *)&this->local;
if (next_state == 1) {
func_80335924(this->unk148, 0x18D, 0.0f, randf2(1.9f, 2.1f));
}
if (next_state == 2) {
func_8028F7D4(-25.0f, 90.0f);
func_80335924(this->unk148, 0x18E, 0.2f, 2.0f);
}
if (next_state == 3) {
func_80335924(this->unk148, 0x18E, 0.2f, 2.0f);
local->unkC[0] = this->position[0];
local->unkC[1] = this->position[1];
local->unkC[2] = this->position[2];
local->unk24 = 0.0f;
}
if (next_state == 4) {
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
marker_despawn(this->marker);
}
if (next_state == 5) {
actor_collisionOff(this);
}
this->state = next_state;
}
Actor* chcaterpillar_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if(this->state == 5){
return func_80325340(marker, gfx, mtx, vtx);
}
return func_80325888(marker, gfx, mtx, vtx);
}
void chcaterpillar_update(Actor *this){
bool sp8C;
ActorLocal_Caterpillar *local = (ActorLocal_Caterpillar *)&this->local;
f32 sp84;
enum map_e map_id;
f32 sp74[3];
f32 sp70;
f32 sp6C;
f32 sp68;
f32 sp64;
f32 sp60;
f32 sp54[3];
int i;
sp8C = func_8028E86C() == this->marker;
sp84 = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
local->unk0[0] = this->position[0];
local->unk0[1] = this->position[1];
local->unk0[2] = this->position[2];
if(sp8C){
chcaterpillar_setState(this, 2);
}
else{//L8038A408
map_id = map_get();
if ( !func_8031FF1C(BKPROG_E6_SPRING_EYRIE_HATCHED)
|| ( map_id == MAP_45_CCW_AUTUMN && !func_8031FF1C(BKPROG_E7_SUMMER_EYRIE_FED))
) {
chcaterpillar_setState(this, 5);
} else {
chcaterpillar_setState(this, 1);
}//L8038A45C
}
}//L8038A45C
if(this->state == 1){
func_8033568C(this->unk148, &sp64, &sp60);
player_getPosition(sp74);
if(ml_vec3f_distance(this->position, local->unk0) < 10.0f){
for(i = 0; i < 10; i++){
local->unk0[0] = randf2(-300.0f, 300.0f) + this->position_x;
local->unk0[1] = this->position_y;
local->unk0[2] = randf2(-300.0f, 300.0f) + this->position_z;
if( !(ml_vec3f_distance(local->unk0, this->position) < 50.0f) && func_80329210(this, local->unk0))
break;
}//L8038A544
if(i == 10){
local->unk0[0] = this->position[0];\
local->unk0[1] = this->position[1];\
local->unk0[2] = this->position[2];
}//L8038A564
if (i);
local->unk0[1] = func_8038A190(this, local->unk0);
}//L8038A570
if(sp64 <= 0.1 && 0.1 < sp60){
func_8030E878(SFX_AD_CATERPILLAR_SQUEAK, randf2(0.78f, 0.81f), 0x3a98, this->position, 500.0f, 1500.0f);
}//L8038A5EC
if(0.65 < sp60){
func_80258A4C(this->position, this->yaw - 90.0f, local->unk0, &sp70, &sp6C, &sp68);
this->yaw += (sp68*100.0f)*sp84;
}//L8038A668
if(sp60 <= 0.4){
sp54[1] = 0.0f;
sp54[2] = 0.0f;
sp54[0] = 65.0f;
ml_vec3f_yaw_rotate_copy(sp54, sp54, this->yaw - 90.0f);
this->position[0] += sp84*sp54[0];
this->position[2] += sp84*sp54[2];
if(this->marker->unk14_21){
this->position[1] = func_8038A190(this, this->position);
}
}//L8038A714
if(ml_vec3f_distance(this->position, sp74) < 50.0f){
func_8028F030(ACTOR_2A2_CATERPILLAR);
if(!func_803203FC(0xb2)){
func_80311480(0xcc7, 4, NULL, NULL, NULL, NULL);
func_803204E4(0xb2, TRUE);
}
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 25000, this->position, 0x1f4, 0x9c4);
marker_despawn(this->marker);
}
}//L8038A794
if(this->state == 2){
if(this->unk138_21){
func_8028F010(ACTOR_2A2_CATERPILLAR);
chcaterpillar_setState(this, 3);
}
else if(!sp8C){
func_8028F050(ACTOR_2A2_CATERPILLAR);
marker_despawn(this->marker);
}
}//L8038A804
if(this->state == 3){
func_80389BD8(local->unk18);
local->unk24 += 3.3333333333333335*sp84;
local->unk24 = (1.0 < local->unk24) ? 1.0 : local->unk24;
func_80255FE4(this->position, local->unkC, local->unk18, local->unk24);
this->position[1] += 50.0f*sinf(local->unk24*3.141592654);
if(1.0 == local->unk24){
chcaterpillar_setState(this, 4);
}
}//L8038A8FC
}

107
src/CCW/code_4530.c Normal file
View File

@@ -0,0 +1,107 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
f32 unk0;
f32 unk4;
s16 unk8;
s16 unkA;
}Struct_CCW_4530_0;
void func_8038A950(Actor *this, s32 next_state);
Actor *func_8038AA38(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038AA8C(Actor *this);
/* .data */
extern ActorInfo D_8038F190 = {
0x1B6, 0x2A3, 0x487,
0x0, NULL,
func_8038AA8C, NULL, func_8038AA38,
0, 0, 0.0f, 0
};
extern Struct_CCW_4530_0 D_8038F1B4[];
/* .code */
void func_8038A920(ActorMarker* marker, enum asset_e text_id, s32 arg2) {
func_8038A950(marker_getActor(marker), 3);
}
void func_8038A950(Actor *this, s32 next_state) {
if (next_state == 1) {
func_80335924(this->unk148, 0x199, 0.0f, 6.5f);
}
if (next_state == 2) {
func_80311480(0xCDC, 0xA, this->position, this->marker, func_8038A920, NULL);
}
if (next_state == 3) {
func_80335924(this->unk148, 0x19A, 0.0f, 7.0f);
func_80335A8C(this->unk148, 2);
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.0f, 0);
}
if (next_state == 4) {
mapSpecificFlags_set(5, 1);
marker_despawn(this->marker);
}
this->state = next_state;
}
Actor *func_8038AA38(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this;
this = marker_getActor(marker);
if(this->state == 0)
return this;
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038AA8C(Actor *this) {
f32 sp54[3];
f32 sp50;
f32 sp4C;
Struct_CCW_4530_0 *iPtr;
f32 sp44;
f32 sp40;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
mapSpecificFlags_set(5, FALSE);
if( (!func_8031FF1C(0xE8) || jiggyscore_isSpawned(JIGGY_49_CCW_EYRIE))
&& !func_803203FC(0x1F)
) {
marker_despawn(this->marker);
}
else{
func_8038A950(this, 1);
}
return;
}
if (this->state == 1) {
func_8033568C(this->unk148, &sp50, &sp4C);
if ((sp50 < 0.21) && (0.21 <= sp4C)) {
func_8030E878(0xA5, randf2(0.9f, 1.1f), 32000, this->position, 500.0f, 2500.0f);
}
if ((sp50 < 0.56) && (0.56 <= sp4C)) {
func_8030E878(0xA5, randf2(0.9f, 1.1f), 32000, this->position, 500.0f, 2500.0f);
}
player_getPosition(sp54);
if (ml_vec3f_distance(this->position, sp54) < 850.0f) {
func_8038A950(this, 2);
}
}
if (this->state == 3) {
func_8033568C(this->unk148, &sp44, &sp40);
for(iPtr = &D_8038F1B4[0]; iPtr->unk0 > 0.0f; iPtr++){
if ((sp44 < iPtr->unk0) && (iPtr->unk0 <= sp40)) {
func_8030E878(iPtr->unk8, iPtr->unk4, iPtr->unkA, this->position, 500.0f, 2500.0f);
}
}
if (func_80335794(this->unk148) > 0) {
func_8038A950(this, 4);
}
}
}

100
src/CCW/code_4960.c Normal file
View File

@@ -0,0 +1,100 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
f32 unk0;
f32 unk4;
s16 unk8;
s16 unkA;
}Struct_CCW_4960_0;
Actor *func_8038AE64(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038AEBC(Actor *this);
/* .data */
extern ActorInfo D_8038F230 = {
0x1C4, 0x30E, 0x487,
0x0, NULL,
func_8038AEBC, func_8038AEBC, func_8038AE64,
0, 0, 0.0f, 0
};
extern Struct_CCW_4960_0 D_8038F254[];
/* .code */
void func_8038AD50(Actor *this, s32 next_state) {
if (next_state == 2) {
func_80311480(0xCDD, 0, NULL, NULL, NULL, NULL);
if (this->state == 1) {
mapSpecificFlags_set(6, 0);
timed_setCameraToNode(0.0f, 1);
}
func_80335924(this->unk148, 0x21D, 0.2f, 0.5f);
func_80335A8C(this->unk148, 1);
}
if (next_state == 3) {
func_80335924(this->unk148, 0x21E, 0.2f, 2.0f);
func_80335A8C(this->unk148, 2);
}
if (next_state == 4) {
func_80324E88(0.0f);
func_80324E38(0.0f, 0);
marker_despawn(this->marker);
}
this->state = next_state;
}
Actor *func_8038AE64(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this;
this = marker_getActor(marker);
if(this->state < 2)
return this;
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038AEBC(Actor *this) {
Struct_CCW_4960_0 *iPtr;
f32 sp38;
f32 sp34;
f32 sp30;
f32 sp2C;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
func_8038AD50(this, 1);
return;
}
if (this->state == 1){
if(mapSpecificFlags_get(5)) {
mapSpecificFlags_set(5, FALSE);
func_8038AD50(this, 2);
}
}
if (this->state == 2) {
func_80326224(this);
func_8033568C(this->unk148, &sp38, &sp34);
for(iPtr = &D_8038F254[0]; iPtr->unk0 > 0.0f; iPtr++){
if ((sp38 < iPtr->unk0) && (iPtr->unk0 <= sp34)) {
func_8030E878((s32) iPtr->unk8, iPtr->unk4, iPtr->unkA, this->position, 1500.0f, 4500.0f);
}
}
if (mapSpecificFlags_get(6)) {
mapSpecificFlags_set(6, FALSE);
func_8038AD50(this, 3);
}
if (0.99 < this->unk48) {
func_8038AD50(this, 4);
}
}
if (this->state == 3) {
func_80326224(this);
func_8033568C(this->unk148, &sp30, &sp2C);
if ((sp30 <= 0.5) && (sp2C >= 0.5)) {
jiggySpawn(JIGGY_49_CCW_EYRIE, this->position);
}
if (func_80335794(this->unk148) > 0) {
func_8038AD50(this, 2);
}
}
}

83
src/CCW/code_4D00.c Normal file
View File

@@ -0,0 +1,83 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_80335A24(void *, s32, f32, f32);
typedef struct {
f32 unk0;
}ActorLocal_CCW_4D00;
typedef struct {
f32 unk0;
f32 unk4;
s16 unk8;
s16 unkA;
}Struct_CCW_4D00_0;
void func_8038B19C(Actor *this);
/* .data */
extern ActorInfo D_8038F270 = { 0x1B9, 0x2A6, 0x502, 0x0, NULL, func_8038B19C, NULL, func_80325888, 0, 0, 0.0f, 0};
extern Struct_CCW_4D00_0 D_8038F294[];
/* .code */
void func_8038B0F0(Actor *this, s32 next_state) {
ActorLocal_CCW_4D00 *local = (ActorLocal_CCW_4D00 *)&this->local;
local->unk0 = 0.0f;
if (next_state == 1) {
func_80335A24(this->unk148, 0x1A3, 0.2f, 11.0f);
local->unk0 = randf2(3.0f, 10.0f);
}
if (next_state == 2) {
func_80335924(this->unk148, 0x1A4, 0.2f, 3.0f);
}
this->state = next_state;
}
void func_8038B19C(Actor *this) {
ActorLocal_CCW_4D00 *local;
f32 tick;
Struct_CCW_4D00_0 *iPtr;
f32 sp50;
f32 sp4C;
local = (ActorLocal_CCW_4D00 *)&this->local;
tick = time_getDelta();
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->unk138_24 = FALSE;
func_8038B0F0(this, 1);
}
if ((this->state == 1) && func_8025773C(&local->unk0, tick)) {
func_8038B0F0(this, 2);
}
if (this->state == 2) {
func_8033568C(this->unk148, &sp50, &sp4C);
for(iPtr = &D_8038F294[0]; iPtr->unk0 > 0.0f; iPtr++){
if ((sp50 < iPtr->unk0) && (iPtr->unk0 <= sp4C)) {
func_8030E878(iPtr->unk8, randf2(iPtr->unk4 - 0.05, iPtr->unk4 + 0.05), randi2(iPtr->unkA - 0x1F4, iPtr->unkA + 0x1F4), this->position, 500.0f, 2500.0f);
}
}
if ((sp50 < 0.97) && (0.97 <= sp4C)) {
if (randf() >= 0.5) {
func_8030E878(SFX_AE_YUMYUM_TALKING, randf2(1.8f, 1.85f), randi2(19000, 21000), this->position, 500.0f, 2500.0f);
} else {
func_8030E878(SFX_4B_GULPING, randf2(1.4f, 1.45f), randi2(24000, 26000), this->position, 500.0f, 2500.0f);
}
}
if (func_80335794(this->unk148) > 0) {
func_8038B0F0(this, 1);
}
}
if (!this->unk138_24 && func_803292E0(this)) {
this->unk138_24 = TRUE;
func_80311480(0xCC8, 0, NULL, NULL, NULL, NULL);
}
func_8028E668(this->position, 300.0f, -50.0f, 120.0f);
}

98
src/CCW/code_50D0.c Normal file
View File

@@ -0,0 +1,98 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038B87C(Actor *this);
/* .data */
ActorInfo D_8038F300 = {
0x1BA, 0x2A7, 0x503,
0x0, NULL,
func_8038B87C, NULL, func_80325888,
0, 0, 2.0f, 0
};
s32 D_8038F324[] = {
SFX_97_BLUBBER_BURPS,
SFX_3E_POOP_NOISE,
SFX_F6_BLUBBER_TALKING_2,
SFX_F7_BLUBBER_TALKING_3,
SFX_F8_BLUBBER_TALKING_4,
SFX_F5_BLUBBER_TALKING_1,
0
};
/* .code */
void func_8038B4C0(ActorMarker *marker) {
Actor *this;
static s32 D_8038F340 = 0;
this = marker_getActor(marker);
func_8030E878(D_8038F324[D_8038F340], randf2(1.1f, 1.2f), (s32) randf2(31000.0f, 32000.0f), this->position, 500.0f, 2500.0f);
D_8038F340++;
if (D_8038F324[D_8038F340] == 0) {
D_8038F340 = 0;
}
}
void func_8038B58C(ActorMarker* marker) {
Actor* actor = marker_getActor(marker);
func_8030E878(0x81, randf2(1.0f, 1.1f), (s32) randf2(31000.0f, 32000.0f), actor->position, 500.0f, 2500.0f);
}
void func_8038B610(ActorMarker* marker) {
Actor* actor;
s32 temp_s0;
f32 sp24;
s32 sp20;
actor = marker_getActor(marker);
temp_s0 = func_802F9AA8(SFX_12B_BOILING_AND_BUBBLING);
sp24 = randf2(1.0f, 1.0f);
sp20 = randf2(29000.0f, 32000.0f);
func_802F9DB8(temp_s0, sp24, sp24, 0.0f);
func_802F9EC4(temp_s0, actor->position, 0xC8, 0x7D0);
func_802F9F80(temp_s0, 0.05f, 0.2f, 0.3f);
func_802FA060(temp_s0, sp20, sp20, 0.0f);
}
void func_8038B6DC(ActorMarker *marker) {
Actor *this;
f32 phi_f20;
int i;
this = marker_getActor(marker);
func_80335650(this->unk148);
phi_f20 = randf2(0.1f, 0.3f);
for(i = 0; i < 3; i++){
func_80335800(this->unk148, phi_f20, func_8038B610, this->marker);
phi_f20 += randf2(0.15f, 0.3f);
if(0.85 < phi_f20)
break;
}
func_80335800(this->unk148, 0.35f, func_8038B4C0, this->marker);
func_80335800(this->unk148, 0.63f, func_8038B58C, this->marker);
func_80335800(this->unk148, 0.9f, func_8038B6DC, this->marker);
}
void func_8038B814(Actor *this, s32 next_state) {
if (next_state == 1) {
func_80335924(this->unk148, 0x22B, 0.2f, 11.0f);
func_8038B6DC(this->marker);
}
this->state = next_state;
}
void func_8038B87C(Actor *this) {
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->unk138_24 = FALSE;
func_8038B814(this, 1);
}
if (!this->unk138_24 && func_803292E0(this)) {
this->unk138_24 = TRUE;
func_80311480(0xCC9, 0, NULL, NULL, NULL, NULL);
}
func_8028E668(this->position, 300.0f, -50.0f, 120.0f);
}

171
src/CCW/code_5540.c Normal file
View File

@@ -0,0 +1,171 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
s32 returned_acorn_count;
}ActorLocal_CCW_5540;
void chnabnut_setState(Actor *this, s32 next_state);
Actor *chnabnut_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void chnabnut_update(Actor *this);
enum nabnut_state_e{
NABNUT_STATE_1_SAD = 1,
NABNUT_STATE_2_WAIT,
NABNUT_STATE_3_BACKFLIP,
NABNUT_STATE_4_THANK_PLAYER,
NABNUT_STATE_5_EXIT,
NABNUT_STATE_6_DESPAWN
};
/* .data */
extern f32 D_8038F350[3];
extern ActorInfo D_8038F35C = {
MARKER_1BB_NABNUT, ACTOR_2A8_NABNUT, ASSET_502_MODEL_NABNUT,
0x0, NULL,
chnabnut_update, chnabnut_update, chnabnut_draw,
0, 0, 1.2f, 0
};
/* .code */
void __chnabnut_setState_method(ActorMarker* marker, s32 next_state) {
chnabnut_setState(marker_getActor(marker), next_state);
}
void chnabnut_setState(Actor *this, s32 next_state) {
if (next_state == NABNUT_STATE_1_SAD) {
func_80335924(this->unk148, ASSET_22C_ANIM_NAMBUT_CRY, 0.2f, 10.6f);
}
if (next_state == NABNUT_STATE_2_WAIT) {
timedFunc_set_2(1.0f, (TFQM2)__chnabnut_setState_method, (s32)this->marker, NABNUT_STATE_3_BACKFLIP);
}
if (next_state == NABNUT_STATE_3_BACKFLIP) {
this->marker->propPtr->unk8_3 = FALSE;
func_80335924(this->unk148, ASSET_22D_ANIM_NAMBUT_BACKFLIP, 0.2f, 3.13f);
func_80335A8C(this->unk148, 2);
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.0f, 0xB);
func_80311480(0xCCC, 0x20, this->position, NULL, NULL, NULL);
}
if (next_state == NABNUT_STATE_4_THANK_PLAYER) {
func_80335924(this->unk148, ASSET_22E_ANIM_NAMBUT_STAND, 0.2f, 3.53f);
func_80335A8C(this->unk148, 1);
func_802C8F70(this->yaw - 40.0f);
jiggySpawn(JIGGY_4A_CCW_NABNUT, this->position);
}
if (next_state == NABNUT_STATE_5_EXIT) {
func_80335924(this->unk148, ASSET_22F_ANIM_NAMBUT_RUN, 0.2f, 0.34f);
}
if (next_state == NABNUT_STATE_6_DESPAWN) {
func_80324E38(0.0f, 0);
func_80324E88(0.0f);
marker_despawn(this->marker);
}
this->state = next_state;
}
Actor *chnabnut_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Actor *this;
Actor *out;
void *sp24;
f32 temp_f2;
this = marker_getActor(marker);
func_8033A45C(3, 0);
func_8033A45C(4, 0);
func_8033A45C(5, 1);
func_8033A45C(6, 0);
func_8033A45C(7, 1);
func_8033A45C(8, 1);
func_8033A45C(9, 0);
func_8033A45C(0xA, 1);
if (this->state == 1) {
temp_f2 = func_80335684(this->unk148);
if ((0.116 <= temp_f2) && (temp_f2 <= 0.32)) {
sp24 = this->unk130;
this->unk130 = NULL;
func_8033A45C(1, 4);
out = func_80325888(marker, gfx, mtx, vtx);
out->unk130 = sp24;
return out;
}
}
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038BC50(f32 dst[3]){
dst[0] = D_8038F350[0];
dst[1] = D_8038F350[1];
dst[2] = D_8038F350[2];
}
void chnabnut_update(Actor *this) {
ActorLocal_CCW_5540 *local;
f32 sp30[3];
f32 sp2C;
f32 sp28;
f32 sp24;
local = (ActorLocal_CCW_5540 *)&this->local;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
D_8038F350[0] = this->position[0];
D_8038F350[1] = this->position[1];
D_8038F350[2] = this->position[2];
if (this->state == 0) {
this->unk138_24 = FALSE;
local->returned_acorn_count = NULL;
}
chnabnut_setState(this, 1);
if(jiggyscore_isSpawned(JIGGY_4A_CCW_NABNUT)) {
marker_despawn(this->marker);
}
return;
}
if (this->state == NABNUT_STATE_1_SAD) {
player_getPosition(sp30);
if (!this->unk138_24 && (ml_vec3f_distance(this->position, sp30) < 400.0f)) {
this->unk138_24 = TRUE;
func_80311480(0xCCA, 0xE, this->position, NULL, NULL, NULL);
}
if (item_getCount(ITEM_23_ACORNS) > 0) {
func_80258A4C(this->position, this->yaw - 90.0f, sp30, &sp2C, &sp28, &sp24);
this->yaw += sp24 * 10.0f;
}
if (this->unk138_24 && !func_803114B0()) {
func_8028F364(this->position, 500.0f, 200.0f, ACTOR_2A9_ACORN, &this);
if ((func_8028E8C0() == ACTOR_2A9_ACORN) && (ml_vec3f_distance(this->position, sp30) < 300.0f) && func_8028FC34()) {
func_8028FA54(D_8038F350);
local->returned_acorn_count++;
if (local->returned_acorn_count == 6) {
chnabnut_setState(this, NABNUT_STATE_2_WAIT);
} else if (item_getCount(ITEM_23_ACORNS) == 1) {
func_80311480(0xCCB, 0x20, this->position, NULL, NULL, NULL);
}
}
}
}
if ((this->state == NABNUT_STATE_3_BACKFLIP) && (func_80335794(this->unk148) > 0)) {
chnabnut_setState(this, NABNUT_STATE_4_THANK_PLAYER);
}
if ((this->state == NABNUT_STATE_4_THANK_PLAYER) && (func_80335794(this->unk148) > 0)) {
chnabnut_setState(this, NABNUT_STATE_5_EXIT);
}
if (this->state == NABNUT_STATE_5_EXIT) {
func_80326224(this);
func_8028FC8C(this->position);
if (0.99 < this->unk48) {
chnabnut_setState(this, NABNUT_STATE_6_DESPAWN);
}
}
func_8028E668(this->position, 300.0f, -50.0f, 120.0f);
}

123
src/CCW/code_5BF0.c Normal file
View File

@@ -0,0 +1,123 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028E668(f32[3], f32, f32, f32);
Actor *func_8038C380(ActorMarker* marker, Gfx** gfx, Mtx** mtx, Vtx** vtx);
void func_8038C41C(Actor *this);
/* .data */
extern ActorInfo D_8038F380 = { 0x1C6, 0x310, 0x501, 0x0, NULL, func_8038C41C, NULL, func_80325888, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F3A4 = { 0x1C7, 0x311, 0x462, 0x0, NULL, func_8038C41C, NULL, func_8038C380, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F3C8 = { 0x1C8, 0x312, 0x463, 0x0, NULL, func_8038C41C, NULL, func_80325888, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F3EC = { 0x1C9, 0x313, 0x464, 0x0, NULL, func_8038C41C, NULL, func_80325888, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F410 = { 0x1CA, 0x314, 0x502, 0x0, NULL, func_8038C41C, NULL, func_80325888, 0, 0, 2.0f, 0};
extern ActorInfo D_8038F434 = { 0x1CB, 0x315, 0x48D, 0x0, NULL, func_8038C41C, NULL, func_8038C380, 0, 0, 0.0f, 0};
/* .code */
void func_8038BFE0(ActorMarker* marker) {
Actor* sp2C = marker_getActor(marker);
func_8030E878(SFX_5D_BANJO_RAAOWW, randf2(1.0f, 1.1f), (s32)randf2(21000.0f, 22000.0f), sp2C->position, 500.0f, 2500.0f);
}
void func_8038C064(ActorMarker* marker) {
Actor* sp2C = marker_getActor(marker);
func_8030E878(SFX_5E_BANJO_PHEWWW, randf2(1.0f, 1.1f), (s32)randf2(21000.0f, 22000.0f), sp2C->position, 500.0f, 2500.0f);
}
void func_8038C0E8(ActorMarker* marker) {
Actor* sp24 = marker_getActor(marker);
f32 sp20 = randf2(0.9f, 1.1f);
func_8030E878(SFX_81_UUU, sp20, (s32)randf2(10000.0f, 31000.0f), sp24->position, 500.0f, 2500.0f);
}
void func_8038C16C(Actor *this, s32 next_state) {
Actor *other;
if (next_state == 1) {
this->position[1] -= 300.0f;
}
if (this->state == 1) {
this->position[1] += 300.0f;
}
if (next_state == 2) {
if (this->marker->unk14_20 == 0x1CA) {
func_80335924(this->unk148, 0x22E, 0.2f, 3.53f);
func_80335800(this->unk148, 0.1f, func_8038C0E8, this->marker);
}
if (this->marker->unk14_20 == 0x1C7) {
func_80335924(this->unk148, 0x230, 0.2f, 4.0f);
}
if (this->marker->unk14_20 == 0x1CB) {
func_80335924(this->unk148, 0x1A2, 0.2f, 4.0f);
func_80335800(this->unk148, 0.3f, func_8038BFE0, this->marker);
func_80335800(this->unk148, 0.65f, func_8038C064, this->marker);
}
if (this->marker->unk14_20 == 0x1C8) {
func_80335924(this->unk148, 0x231, 0.2f, 4.0f);
}
if ((this->marker->unk14_20 == 0x1C7) || (this->marker->unk14_20 == 0x1CB) || (this->marker->unk14_20 == 0x1C8)) {
other = func_80326EEC(0x313);
if (other != 0) {
this->position[0] = other->position[0];
this->position[1] = other->position[1];
this->position[2] = other->position[2];
this->pitch = other->pitch;
this->yaw = other->yaw;
this->roll = other->roll;
}
}
}
this->state = next_state;
}
Actor *func_8038C380(ActorMarker* marker, Gfx** gfx, Mtx** mtx, Vtx** vtx) {
func_8033A45C(3, 0);
func_8033A45C(4, 0);
func_8033A45C(5, 0);
func_8033A45C(6, 1);
func_8033A45C(7, 0);
func_8033A45C(8, 0);
func_8033A45C(9, 0);
func_8033A45C(0xA, 1);
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038C41C(Actor *this) {
f32 sp2C[3];
if (!this->unk16C_4) {
this->marker->propPtr->unk8_3 = TRUE;
this->unk16C_4 = TRUE;
this->unk138_24 = FALSE;
return;
}
if (this->state == 0) {
if( map_get() == MAP_60_CCW_AUTUMN_NABNUTS_HOUSE
&& !jiggyscore_isSpawned(JIGGY_4A_CCW_NABNUT)
&& (this->marker->unk14_20 == 0x1C6 || this->marker->unk14_20 == 0x1CA)
){
func_8038C16C(this, 1);
} else {
func_8038C16C(this, 2);
}
}
if ((this->marker->unk14_20 == 0x1CA) && (this->state != 1)) {
func_8028E668(this->position, 300.0f, -50.0f, 120.0f);
}
if ((this->marker->unk14_20 == 0x1CB) && (this->state == 2)) {
player_getPosition(sp2C);
if (!this->unk138_24 && (ml_vec3f_distance(this->position, sp2C) < 400.0f)) {
this->unk138_24 = TRUE;
func_80311480(0xCCD, 0, NULL, NULL, NULL, NULL);
}
}
}

100
src/CCW/code_61E0.c Normal file
View File

@@ -0,0 +1,100 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern ActorMarker *func_8028E86C(void);
typedef struct {
f32 unk0[3];
f32 unkC[3];
f32 unk18;
}ActorLocal_CCW_61E0;
void func_8038C7A8(Actor *this);
/* .data */
extern ActorInfo D_8038F460 = { 0x1BC, 0x2A9, 0x48E, 0x0, NULL, func_8038C7A8, NULL, func_80325888, 0, 0, 0.8f, 0};
/* .code */
void func_8038C5D0(ActorMarker* marker) {
Actor* actor = marker_getActor(marker);
func_8030E878(SFX_3F2_UNKNOWN, randf2(0.95f, 1.05f), 26000, actor->position, 500.0f, 1000.0f);
}
void func_8038C638(ActorMarker* marker) {
Actor* actor = marker_getActor(marker);
func_8030E878(SFX_5_BANJO_LANDING_01, randf2(0.95f, 1.05f), 22000, actor->position, 500.0f, 1000.0f);
}
void func_8038C6A0(Actor *this, s32 next_state) {
ActorLocal_CCW_61E0 *local;
local = (ActorLocal_CCW_61E0 *)&this->local;
if (next_state == 1) {
func_80335924(this->unk148, 0x25B, 0.0f, 1.0f);
func_80335800(this->unk148, 0.5f, func_8038C5D0, this->marker);
func_80335800(this->unk148, 0.7f, func_8038C638, this->marker);
}
if (next_state == 3) {
local->unk0[0] = this->position[0];
local->unk0[1] = this->position[1];
local->unk0[2] = this->position[2];
func_8038BC50(local->unkC);
local->unk18 = 0.0f;
}
if (next_state == 4) {
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
marker_despawn(this->marker);
}
if (next_state == 5) {
marker_despawn(this->marker);
}
this->state = next_state;
}
void func_8038C7A8(Actor *this) {
bool sp4C;
ActorLocal_CCW_61E0 *local;
f32 sp44;
f32 sp38[3];
local = (ActorLocal_CCW_61E0 *)&this->local;
sp44 = time_getDelta();
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
return;
}
sp4C = (func_8028E86C() == this->marker);
if (this->state == 0) {
func_8038C6A0(this, sp4C ? 2 : 1);
}
if (this->state == 1) {
player_getPosition(sp38);
if (ml_vec3f_distance(this->position, sp38) < 50.0f) {
func_8028F030(0x2A9);
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 25000, this->position, 500, 2500);
func_8038C6A0(this, 5);
}
}
if (this->state == 2) {
if (this->unk138_21) {
func_8028F010(0x2A9);
func_8038C6A0(this, 3);
} else if (!sp4C) {
func_8028F050(0x2A9);
func_8038C6A0(this, 5);
}
}
if (this->state == 3) {
local->unk18 += 3.3333333333333333 * sp44;
local->unk18 = (local->unk18 > 1.0) ? 1.0 : local->unk18;
func_80255FE4(this->position, local->unk0, local->unkC, local->unk18);
this->position[1] += 50.0f * sinf(local->unk18 * RARE_PI);
if (local->unk18 == 1.0) {
func_8038C6A0(this, 4);
}
}
}

114
src/CCW/code_6620.c Normal file
View File

@@ -0,0 +1,114 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern ParticleEmitter *func_802EDD8C(f32[3], f32, f32);
typedef struct{
s16 map_id;
s16 unk2;
s16 unk4;
}Struct_CCW_6620_0;
typedef struct{
Struct_CCW_6620_0 *unk0;
f32 unk4[3];
}ActorLocal_CCW_6620;
Actor *func_8038CBF0(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038CC4C(Actor *this);
/* .data */
extern Struct_CCW_6620_0 D_8038F490[];
extern ActorInfo D_8038F4A8 = { 0x1BD, 0x2AA, 0x48F, 0x0, NULL, func_8038CC4C, NULL, func_8038CBF0, 0, 0, 2.2f, 0};
/* .code */
void func_8038CA10(ActorMarker *marker) {
Actor *this;
ActorLocal_CCW_6620 *local;
ParticleEmitter *pCtrl;
this = marker_getActor(marker);
local = (ActorLocal_CCW_6620 *)&this->local;
if (this->marker->unk14_21) {
if (0.65 < (f64) randf()) {
pCtrl = func_802EDD8C(local->unk4, 0.0f, this->position[1] + 500.0f);
func_802EFB70(pCtrl, 0.04f, 0.05f);
func_802EFB84(pCtrl, 0.18f, 0.2f);
particleEmitter_setParticleSpawnPositionRange(pCtrl, -10.0f, 0.0f, -10.0f, 10.0f, 20.0f, 10.0f);
particleEmitter_setParticleVelocityRange(pCtrl, 0.0f, 31.0f, 0.0f, 0.0f, 37.0f, 0.0f);
particleEmitter_emitN(pCtrl, 1);
}
}
}
void func_8038CB40(Actor *this, s32 next_state) {
int i;
if (next_state == 1) {
func_80335924(this->unk148, 0x289, 0.2f, 1.1f);
for(i = 0; i < 10; i++){
func_80335800(this->unk148, randf(), func_8038CA10, this->marker);
}
}
this->state = next_state;
}
Actor *func_8038CBF0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Actor *this;
ActorLocal_CCW_6620 *local;
this = func_80325888(marker, gfx, mtx, vtx);
local = (ActorLocal_CCW_6620 *)&this->local;
if (this->marker->unk14_21) {
func_8034A174(func_80329934(), 5, local->unk4);
}
return this;
}
void func_8038CC4C(Actor *this) {
ActorLocal_CCW_6620 *local;
f32 sp50[3];
f32 sp4C;
f32 sp48;
f32 sp44;
f32 sp38[3];
local = (ActorLocal_CCW_6620 *)&this->local;
if (!this->unk16C_4) {
this->marker->propPtr->unk8_3 = TRUE;
this->unk16C_4 = TRUE;
this->unk138_24 = FALSE;
local->unk0 = &D_8038F490[0];
while(local->unk0->map_id != 0 && map_get() != local->unk0->map_id){
local->unk0++;
}
func_8038CB40(this, 1);
if (jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY)) {
levelSpecificFlags_set(0x25, TRUE);
}
if ((local->unk0->unk2 != 0) && levelSpecificFlags_get(0x25)) {
marker_despawn(this->marker);
}
return;
}
if (this->state == 1 && this->marker->unk14_21) {
player_getPosition(sp50);
func_80258A4C(this->position, this->yaw - 90.0f, sp50, &sp4C, &sp48, &sp44);
if (sp4C > 100.0f) {
this->yaw += 30.0f * sp44;
}
}
if (!this->unk138_24) {
player_getPosition(sp38);
if (ml_vec3f_distance(this->position, sp38) < 900.0f) {
if (local->unk0->map_id != MAP_46_CCW_WINTER || func_8028F2FC()) {
func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL);
this->unk138_24 = TRUE;
}
}
}
}

114
src/CCW/code_6AC0.c Normal file
View File

@@ -0,0 +1,114 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
f32 unk0;
f32 unk4;
s16 unk8;
s16 unkA;
}Struct_CCW_6AC0_0;
void func_8038CFB4(Actor *this);
/* .data */
extern ActorInfo D_8038F4D0 = {
0x1BE, 0x2AB, 0x48F,
0x0, NULL,
func_8038CFB4, func_8038CFB4, func_80325888,
0, 0, 2.2f, 0
};
extern Struct_CCW_6AC0_0 D_8038F4F4[];
extern Struct_CCW_6AC0_0 D_8038F53C[];
extern Struct_CCW_6AC0_0 D_8038F5D8[];
/* .code */
void func_8038CEB0(Actor *this, s32 next_state) {
ActorProp *temp_v0;
if (next_state == 1) {
func_80335924(this->unk148, 0x1A6, 0.2f, 4.5f);
}
if (next_state == 2) {
this->marker->propPtr->unk8_3 = FALSE;
func_80335924(this->unk148, 0x1A7, 0.2f, 3.0f);
func_80335A8C(this->unk148, 2);
func_80311480(0xCD0, 0x24, NULL, NULL, NULL, NULL);
}
if (next_state == 3) {
func_80335924(this->unk148, 0x1A8, 0.2f, 0.5f);
func_80335A8C(this->unk148, 1);
}
if (next_state == 4) {
marker_despawn(this->marker);
}
this->state = next_state;
}
void func_8038CFB4(Actor *this) {
Struct_CCW_6AC0_0 *phi_s0;
f32 sp70;
f32 sp6C;
f32 sp60[3];
if (!this->unk16C_4) {
this->marker->propPtr->unk8_3 = TRUE;
this->unk16C_4 = TRUE;
this->unk138_24 = FALSE;
func_8038CEB0(this, 1);
if (jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY) != 0) {
levelSpecificFlags_set(0x25, 1);
}
if (levelSpecificFlags_get(0x25) != 0) {
marker_despawn(this->marker);
}
return;
}
if (this->state == 1) {
phi_s0 = &D_8038F4F4;
} else if (this->state == 2) {
phi_s0 = &D_8038F53C;
} else if (this->state == 3) {
phi_s0 = &D_8038F5D8;
} else{
phi_s0 = NULL;
}
if (phi_s0 != NULL) {
func_8033568C(this->unk148, &sp70, &sp6C);
while(phi_s0->unk0 > 0.0f){
if (((sp70 < phi_s0->unk0) || (sp6C < sp70)) && (phi_s0->unk0 <= sp6C)) {
func_8030E878(phi_s0->unk8, randf2(phi_s0->unk4 - 0.05, phi_s0->unk4 + 0.05), randi2(phi_s0->unkA - 200, phi_s0->unkA + 100), this->position, 500.0f, 1500.0f);
}
phi_s0++;
}
}
if (this->state == 1) {
if (!this->unk138_24) {
player_getPosition(&sp60);
if (ml_vec3f_distance(this->position, &sp60) < 900.0f) {
func_80311480(0xCCF, 4, NULL, NULL, NULL, NULL);
this->unk138_24 = TRUE;
}
}
if (levelSpecificFlags_get(0x25) != 0) {
func_8038CEB0(this, 2);
}
}
if (this->state == 2){
if((func_80335794(this->unk148) > 0)) {
func_8038CEB0(this, 3);
}
}
if (this->state == 3) {
func_80326224(this);
if (0.99 < (f64) this->unk48) {
func_8038CEB0(this, 4);
}
}
}

79
src/CCW/code_6EC0.c Normal file
View File

@@ -0,0 +1,79 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
s16 map;
s16 unk2;
s16 unk4;
}Struct_CCW_6EC0_0;
typedef struct{
Struct_CCW_6EC0_0 *unk0;
}ActorLocal_CCW_6EC0;
void func_8038D368(Actor *this);
Actor *func_8038D30C(ActorMarker* marker, Gfx** gfx, Mtx** mtx, Vtx** vtx);
/* .data */
extern Struct_CCW_6EC0_0 D_8038F600[];
extern ActorInfo D_8038F614 = {
0x1CE, 0x31A, 0x48F,
0x0, NULL,
func_8038D368, NULL, func_8038D30C,
0, 0, 2.2f, 0
};
/* .code */
void func_8038D2B0(Actor *this, s32 next_state) {
if (next_state == 1) {
func_80335924(this->unk148, 0x1A6, 0.2f, 5.5f);
}
this->state = next_state;
}
Actor *func_8038D30C(ActorMarker* marker, Gfx** gfx, Mtx** mtx, Vtx** vtx) {
if (levelSpecificFlags_get(0x25) == 0) {
return func_80325340(marker, gfx, mtx, vtx);
}
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038D368(Actor *this) {
ActorLocal_CCW_6EC0 *local;
f32 plyr_pos[3];
local = (ActorLocal_CCW_6EC0 *)&this->local;
if (!this->unk16C_4) {
this->marker->propPtr->unk8_3 = TRUE;
this->unk16C_4 = TRUE;
this->unk138_24 = FALSE;
local->unk0 = D_8038F600;
while (local->unk0->map != 0 && map_get() != local->unk0->map) {
local->unk0++;
}
func_8038D2B0(this, 1);
if (jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY)) {
levelSpecificFlags_set(0x25, TRUE);
}
return;
}
if(!this->unk138_24){
player_getPosition(plyr_pos);
if (ml_vec3f_distance(this->position, plyr_pos) < 600.0f) {
if (!jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY)) {
func_80311480(local->unk0->unk2, 4, NULL, NULL, NULL, NULL);
} else {
if (local->unk0->unk4) {
func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL);
}
}
this->unk138_24 = TRUE;
}
}
}

114
src/CCW/code_7120.c Normal file
View File

@@ -0,0 +1,114 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
f32 unk0;
} ActorLocal_CCW_7120;
void func_8038D85C(Actor *this);
/* .data */
extern ActorInfo D_8038F640 = {
0x1BF, 0x2AC, 0x490,
0x0, NULL,
func_8038D85C, NULL, func_80325888,
0, 0, 2.2f, 0
};
extern s32 D_8038F664[3];
extern struct42s D_8038F670;
extern struct43s D_8038F6A0;
void func_8038D510(Actor *this) {
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(6);
particleEmitter_setSprite(pCtrl, ASSET_70E_SPRITE_SMOKE_2);
func_802EFA5C(pCtrl, 0.01f, 0.5f);
particleEmitter_setStartingFrameRange(pCtrl, 0, 7);
particleEmitter_setPosition(pCtrl, this->position);
func_802EFB70(pCtrl, 1.0f, 2.0f);
func_802EFB84(pCtrl, 3.0f, 4.0f);
particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038F670);
func_802EFFA8(pCtrl, D_8038F664);
func_802EFEC0(pCtrl, 3.0f, 4.0f);
particleEmitter_emitN(pCtrl, 6);
}
void func_8038D5DC(Actor *this) {
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(30);
func_802EF9F8(pCtrl, 0.6f);
func_802EFA18(pCtrl, 3);
particleEmitter_setModel(pCtrl, 0x896);
particleEmitter_setPosition(pCtrl, this->position);
func_802EFB70(pCtrl, 0.05f, 0.3f);
func_802EFE24(pCtrl,
-600.0f, -600.0f, -600.0f,
600.0f, 600.0f, 600.0f
);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 10.0f, 10.0f);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8038F6A0);
particleEmitter_emitN(pCtrl, 30);
}
void func_8038D6D8(Actor *this, s32 next_state) {
ActorLocal_CCW_7120 *local = (ActorLocal_CCW_7120 *)&this->local;
local->unk0 = 0.0f;
if (next_state == 2) {
this->marker->propPtr->unk8_3 = FALSE;
func_802BB3DC(0, 60.0f, 0.7f);
func_8038D510(this);
func_8038D5DC(this);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.3f, 15000);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.5f, 15000);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.7f, 15000);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.9f, 15000);
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.5f, 3);
timedFunc_set_2(0.5f, levelSpecificFlags_set, 0x25, TRUE);
func_80324E88(4.0f);
func_80324E38(4.0f, 0);
local->unk0 = 0.5f;
marker_despawn(this->marker);
}
if (next_state == 3) {
marker_despawn(this->marker);
}
this->state = next_state;
}
void func_8038D81C(ActorMarker* marker, ActorMarker *other_marker) {
Actor* actor = marker_getActor(marker);
if (actor->state == 1) {
func_8038D6D8(actor, 2);
}
}
void func_8038D85C(Actor *this) {
ActorLocal_CCW_7120 *local = (ActorLocal_CCW_7120 *)&this->local;
f32 tick;
tick = time_getDelta();
if (!this->unk16C_4) {
this->marker->propPtr->unk8_3 = TRUE;
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, 0, &func_8038D81C, 0);
func_8038D6D8(this, 1);
if (jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY) != 0) {
levelSpecificFlags_set(0x25, 1);
}
if ((levelSpecificFlags_get(0x25) != 0) && (map_get() != MAP_43_CCW_SPRING)) {
marker_despawn(this->marker);
}
return;
}
if(this->state == 2){
if (func_8025773C(&local->unk0, tick) ) {
func_8038D6D8(this, 3);
}
}
}

40
src/CCW/code_7570.c Normal file
View File

@@ -0,0 +1,40 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038D9E0(Actor *this);
/* .data */
extern ActorInfo D_8038F6F0 = { 0x1C3, 0x30C, 0x4E4, 0x0, NULL, func_8038D9E0, NULL, func_80325888, 0, 0, 0.0f, 0};
/* .code */
void func_8038D960(Actor *this, s32 next_state) {
if (next_state == 1) {
func_80335924(this->unk148, 0x21C, 0.0f, 6.0f);
func_80335A8C(this->unk148, 2);
}
if (next_state == 2) {
func_80326310(this);
}
this->state = next_state;
}
void func_8038D9E0(Actor *this) {
f32 sp24;
f32 sp20;
ActorMarker *temp_v0;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->unk124_9 = 2;
this->marker->unk40_22 = TRUE;
func_8038D960(this, 1);
}
if (this->state == 1) {
this = this;
func_8033568C(this->unk148, &sp24, &sp20);
if ((sp24 < 0.25f) && (sp20 >= 0.25f)) {
func_8038D960(this, 2);
}
}
}

155
src/CCW/code_76C0.c Normal file
View File

@@ -0,0 +1,155 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "prop.h"
extern void func_802D3D54(Actor *);
extern void func_802D3D74(Actor *);
extern void func_80325F84(Actor *);
extern ActorInfo D_8038EB50;
extern ActorInfo D_8038EB74;
extern ActorInfo D_8038EBA0;
extern ActorInfo D_8038EBD0;
extern ActorInfo D_8038EC14;
extern ActorInfo D_8038EC70;
extern ActorInfo D_8038ECA0;
extern ActorInfo D_8038ECE8;
extern ActorInfo D_8038EE70;
extern ActorInfo D_8038F130;
extern ActorInfo chCaterpillar;
extern ActorInfo D_8038F190;
extern ActorInfo D_8038F230;
extern ActorInfo D_8038F6F0;
extern ActorInfo D_8038ED50;
extern ActorInfo D_8038ED98;
extern ActorInfo D_8038EDE0;
extern ActorInfo D_8038EE28;
extern ActorInfo D_8038ED74;
extern ActorInfo D_8038EDBC;
extern ActorInfo D_8038EE04;
extern ActorInfo D_8038EE4C;
extern ActorInfo D_8038F270;
extern ActorInfo D_8038F300;
extern ActorInfo D_8038F35C;
extern ActorInfo D_8038F380;
extern ActorInfo D_8038F3A4;
extern ActorInfo D_8038F3C8;
extern ActorInfo D_8038F3EC;
extern ActorInfo D_8038F410;
extern ActorInfo D_8038F434;
extern ActorInfo D_8038F460;
extern ActorInfo D_8038F4A8;
extern ActorInfo D_8038F4D0;
extern ActorInfo D_8038F614;
extern ActorInfo D_8038F640;
extern ActorInfo D_8038F908;
extern ActorInfo D_8038F8C0;
extern ActorInfo D_8038F720;
extern ActorInfo D_8038F744;
extern ActorInfo D_8038F768;
extern ActorInfo D_8038F78C;
extern ActorInfo D_8038F988;
extern ActorInfo D_8038FA00;
extern ActorInfo D_8038F7D4;
extern ActorInfo D_8038F7B0;
extern ActorInfo D_8038F888;
extern ActorInfo D_8038F7F8;
extern ActorInfo D_8038F81C;
extern ActorInfo D_8038F840;
extern ActorInfo D_8038F864;
void func_8038DB0C(Actor *this);
void func_8038DAB0(Actor *this);
/* .data */
extern ActorInfo D_8038F720 = { 0x239, 0x25F, 0x4FC, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F744 = { 0x236, 0x260, 0x4F9, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F768 = { 0x237, 0x261, 0x4FA, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F78C = { 0x238, 0x262, 0x4FB, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F7B0 = { 0x243, 0x2E6, 0x533, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F7D4 = { 0x263, 0x2E7, 0x518, 0x1, NULL, func_8038DAB0, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F7F8 = { 0x21E, 0x233, 0x3B3, 0x1, NULL, func_802D3D74, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F81C = { 0x26B, 0x2DE, 0x531, 0x1, NULL, func_8038DB0C, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F840 = { 0x26C, 0x2DD, 0x53E, 0x1, NULL, func_8038DB0C, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F864 = { 0x26D, 0x2DC, 0x53F, 0x1, NULL, func_8038DB0C, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
extern ActorInfo D_8038F888 = { 0x1CC, 0x318, 0x0, 0x0, NULL, func_80325F84, NULL, func_80325340, 0, 0, 0.0f, 0};
/* .code */
void func_8038DAB0(Actor *this){
if(!this->initialized){
func_802D3CE8(this);
this->initialized = TRUE;
if(levelSpecificFlags_get(0x38)){
marker_despawn(this->marker);
}
}
}
void func_8038DB0C(Actor *this){
if(!this->initialized){
func_802D3D74(this);
this->initialized = TRUE;
this->position_x = 325.8f;
this->position_y = 600.0f;
this->position_z = 0.0f;
}
}
void func_8038DB6C(void)
{
spawnableActorList_add(&D_8038EB50, actor_new, 0X80);
spawnableActorList_add(&D_8038EB74, actor_new, 0X80);
spawnableActorList_add(&D_8038EBA0, actor_new, 0X180);
spawnableActorList_add(&D_8038EBD0, actor_new, 0X200080C);
spawnableActorList_add(&D_8038EC14, actor_new, 0X888);
spawnableActorList_add(&D_8038EC70, actor_new, 0X94C88);
spawnableActorList_add(&D_8038ECA0, actor_new, 0X84C88);
spawnableActorList_add(&D_8038ECE8, actor_new, 0X809A8);
spawnableActorList_add(&D_8038EE70, actor_new, 0XC80);
spawnableActorList_add(&D_8038F130, actor_new, 0X84C2A);
spawnableActorList_add(&chCaterpillar, actor_new, 0X881);
spawnableActorList_add(&D_8038F190, actor_new, 0X80D80);
spawnableActorList_add(&D_8038F230, actor_new, 0XD80);
spawnableActorList_add(&D_8038F6F0, actor_new, 0X804);
spawnableActorList_add(&D_8038ED50, actor_new, 0X400);
spawnableActorList_add(&D_8038ED98, actor_new, 0X400);
spawnableActorList_add(&D_8038EDE0, actor_new, 0X400);
spawnableActorList_add(&D_8038EE28, actor_new, 0X400);
spawnableActorList_add(&D_8038ED74, actor_new, 0);
spawnableActorList_add(&D_8038EDBC, actor_new, 0);
spawnableActorList_add(&D_8038EE04, actor_new, 0);
spawnableActorList_add(&D_8038EE4C, actor_new, 0);
spawnableActorList_add(&D_8038F270, actor_new, 0X989);
spawnableActorList_add(&D_8038F300, actor_new, 0X989);
spawnableActorList_add(&D_8038F35C, actor_new, 0X909);
spawnableActorList_add(&D_8038F380, actor_new, 0X80);
spawnableActorList_add(&D_8038F3A4, actor_new, 0X888);
spawnableActorList_add(&D_8038F3C8, actor_new, 0X888);
spawnableActorList_add(&D_8038F3EC, actor_new, 0X80);
spawnableActorList_add(&D_8038F410, actor_new, 0X988);
spawnableActorList_add(&D_8038F434, actor_new, 0X888);
spawnableActorList_add(&D_8038F460, actor_new, 0X880);
spawnableActorList_add(&D_8038F4A8, actor_new, 0X98A);
spawnableActorList_add(&D_8038F4D0, actor_new, 0X988);
spawnableActorList_add(&D_8038F614, actor_new, 0X988);
spawnableActorList_add(&D_8038F640, actor_new, 0X80);
spawnableActorList_add(&D_8038F908, actor_new, 8);
spawnableActorList_add(&D_8038F8C0, actor_new, 8);
spawnableActorList_add(&D_8038F720, actor_new, 0);
spawnableActorList_add(&D_8038F744, actor_new, 0);
spawnableActorList_add(&D_8038F768, actor_new, 0);
spawnableActorList_add(&D_8038F78C, actor_new, 0);
spawnableActorList_add(&D_8038F988, actor_new, 0X2010121);
spawnableActorList_add(&D_8038FA00, actor_new, 0);
spawnableActorList_add(&D_8038F7D4, actor_new, 0X400);
spawnableActorList_add(&D_8038F7B0, actor_new, 0X400);
spawnableActorList_add(&D_8038F888, actor_new, 0X80);
spawnableActorList_add(&D_8038F7F8, actor_new, 0X400);
spawnableActorList_add(&D_8038F81C, actor_new, 0X400);
spawnableActorList_add(&D_8038F840, actor_new, 0X400);
spawnableActorList_add(&D_8038F864, actor_new, 0X400);
}

20
src/CCW/code_7BC0.c Normal file
View File

@@ -0,0 +1,20 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038DFB0(Actor *this);
extern ActorAnimationInfo D_8038F8B0[];
extern ActorInfo D_8038F8C0 = { 0x251, 0x37E, 0x506,
0x1, D_8038F8B0,
func_8038DFB0, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
/* .code */
void func_8038DFB0(Actor *this){
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
}

117
src/CCW/code_7BF0.c Normal file
View File

@@ -0,0 +1,117 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038E0C8(Actor *this);
/* .data */
extern ActorAnimationInfo D_8038F8F0[];
extern ActorInfo D_8038F908 = {
0x1F9, 0x1E9, 0x440,
0x1, D_8038F8F0,
func_8038E0C8, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
/* .code */
void func_8038DFE0(Actor* actor) {
func_80328B8C(actor, 1, 0.001f, 1);
actor->unk38_31 = randi2(0, 0);
}
void func_8038E034(Actor* actor) {
func_80328B8C(actor, 2, 0.001f, 1);
}
void func_8038E060(s32 arg0, ActorMarker *marker){
Actor *this;
f32 sp28[3];
s32 pad24;
f32 sp18[3];
this = marker_getActor(marker);
if(arg0){
sp28[0] = 0.0f;
sp28[1] = this->unk1C[0];
sp28[2] = 0.0f;
func_80345C78(sp18, sp28);
func_8033A8F0(arg0, 1, sp18);
func_8033A238(arg0);
}
}
void func_8038E0C8(Actor *this) {
f32 sp44[3];
f32 sp40;
f32 sp3C;
f32 sp38;
f32 sp34;
sp34 = time_getDelta();
if(!actor_playerIsWithinDist(this, 3000)) return;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
func_8028746C(this->animctrl, func_8038E060);
func_8028748C(this->animctrl, (s32) this->marker);
this->marker->propPtr->unk8_3 = TRUE;
this->unk1C[0] = 0.0f;
this->unk38_31 = 0;
}
if (player_getTransformation() == TRANSFORM_6_BEE) {
actor_collisionOff(this);
} else {
actor_collisionOn(this);
player_getPosition(sp44);
func_80258A4C(this->position, this->yaw - 90.0f, sp44, &sp40, &sp3C, &sp38);
if( (sp40 < 1050.0f)
&& (sp38 > -1.0f)
&& (sp38 < 1.0f)
) {
func_80258A4C(this->position, this->unk1C[0] + (this->yaw - 90.0f), sp44, &sp40, &sp3C, &sp38);
this->unk1C[0] += sp38 * 160.0f * sp34;
} else {
if (this->unk1C[0] > 0.0f) {
this->unk1C[0] -= (30.0f * sp34);
this->unk1C[0] = (this->unk1C[0] < 0.0f) ? 0.0f : this->unk1C[0];
} else if (this->unk1C[0] < 0.0f) {
this->unk1C[0] += (30.0f * sp34);
this->unk1C[0] = (this->unk1C[0] > 0.0f) ? 0.0f : this->unk1C[0];
}
}
}
switch (this->state) {
case 1:
if (this->unk38_31 != 0) {
this->unk38_31--;
break;
}
if( func_80329530(this, 0x2A8)
&& (this->unk38_31 == 0)
&& (player_getTransformation() == TRANSFORM_1_BANJO)
) {
func_8038E034(this);
}
break;
case 2:
if (actor_animationIsAt(this, 0.999f)) {
func_8038DFE0(this);
break;
}
if( actor_animationIsAt(this, 0.18f)
|| actor_animationIsAt(this, 0.47f)
|| actor_animationIsAt(this, 0.78f)
) {
FUNC_8030E8B4(SFX_80_YUMYUM_CLACK, 1.0f, 32000, this->position, 1500, 3000);
}
break;
}
}

178
src/CCW/code_8050.c Normal file
View File

@@ -0,0 +1,178 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_802DABA0(ParticleEmitter *, f32[3], f32, enum asset_e);
extern void func_8033A45C(s32, s32);
extern void func_802DB548(void);
enum ccw_season_e
{
SPRING,
SUMMER,
AUTUMN,
WINTER
};
typedef struct {
f32 unk0;
f32 unk4;
u8 unk8;
u8 unk9;
u8 unkA;
u8 unkB;
u32 unkC_31:3;
u32 unkC_28:1;
u32 season:28;
s16 unk10;
s16 unk12;
f32 unk14;
u8 pad18[0x18];
void (*unk30)(void);
void (*unk34)(ActorMarker *, s32);
u8 pad38[4];
f32 unk3C;
} ActorLocal_CCW_8050;
void func_8038E964(Actor *this);
Actor *func_8038E56C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
extern ActorAnimationInfo D_8038F930[];
extern ActorInfo D_8038F988 = {
0x1E2, 0x375, 0x52C,
0x1, D_8038F930,
func_8038E964, func_80326224, func_8038E56C,
2500, 0, 1.0f, 0
};
extern struct43s D_8038F9AC;
/* .code */
void func_8038E440(ParticleEmitter *pCtrl, Actor *actor, enum asset_e model_id){
func_802DABA0(pCtrl, actor->position, actor->scale, model_id);
func_802EFE24(pCtrl,
-600.0f, -600.0f, -600.0f,
600.0f, 600.0f, 600.0f
);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8038F9AC);
particleEmitter_emitN(pCtrl, 1);
}
void func_8038E4C0(ActorMarker* marker, s32 arg1) {
Actor* actor = marker_getActor(marker);
ParticleEmitter *pCtrl;
func_80328B8C(actor, 5, 0.0f, 1);
actor_playAnimationOnce(actor);
FUNC_8030E8B4(SFX_C2_GRUBLIN_EGH, 1.0f, 32000, actor->position, 1250, 2500);
pCtrl = partEmitList_pushNew(1);
func_8038E440(pCtrl, actor, ASSET_52D_MODEL_GRUBLIN_HOOD_HAT);
func_802C3F04((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32,actor->position_x), reinterpret_cast(s32,actor->position_y), reinterpret_cast(s32,actor->position_z));
actor_collisionOff(actor);
actor->unk138_24 = 1;
}
Actor *func_8038E56C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this;
ActorLocal_CCW_8050 *local;
this = marker_getActor(marker);
local = (ActorLocal_CCW_8050 *)&this->local;
func_8033A45C(3, (local->season == SUMMER) ? 1 : 2);
func_8033A45C(4, (local->season == SUMMER) ? 1 : 2);
func_8033A45C(5, (local->season < AUTUMN) ? 1 : 2);
func_8033A45C(6, (local->season < AUTUMN) ? 1 : 2);
func_8033A45C(7, (local->season < AUTUMN) ? 1 : 2);
func_8033A45C(8, (local->season < AUTUMN) ? 1 : 2);
func_8033A45C(9, (local->season == SUMMER) ? 1 : 0);
func_8033A45C(10, (local->season < AUTUMN) ? 0 : (local->season == AUTUMN) ? 1 : 2);
func_8033A45C(11, (local->season < AUTUMN) ? 0 : (local->season == AUTUMN) ? 1 : 2);
func_8033A45C(12, (local->season == WINTER) ? 2 : 1);
func_8033A45C(13, (local->season == WINTER) ? 1 : 0);
func_8033A45C(14, (this->unk138_24)? 0 : 1);
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038E868(Actor *this){
ActorLocal_CCW_8050 *local = (ActorLocal_CCW_8050 *)&this->local;
local->unk8 = 6;
local->unk9 = 0xC;
local->unkA = 0x10;
local->unkB = 8;
local->unkC_31 = 1;
local->unk10 = 0x29;
local->unk12 = 25000;
local->unkC_28 = 1;
local->unk30 = func_802DB548;
local->unk34 = func_8038E4C0;
local->unk0 = 5.0f;
local->unk4 = 8.0f;
local->unk14 = 1.0f;
local->unk3C = 1.5f;
}
enum ccw_season_e func_8038E8FC(Actor *this){
switch(map_get()){
case MAP_43_CCW_SPRING: //// 8038E930
case MAP_4A_CCW_SPRING_MUMBOS_SKULL:// 8038E930
case MAP_5B_CCW_SPRING_ZUBBA_HIVE:// 8038E930
case MAP_5E_CCW_SPRING_NABNUTS_HOUSE:// 8038E930
case MAP_65_CCW_SPRING_WHIPCRACK_ROOM:// 8038E930
return SPRING;
case MAP_44_CCW_SUMMER:// 8038E938
case MAP_4B_CCW_SUMMER_MUMBOS_SKULL:// 8038E938
case MAP_5A_CCW_SUMMER_ZUBBA_HIVE:// 8038E938
case MAP_5F_CCW_SUMMER_NABNUTS_HOUSE:// 8038E938
case MAP_66_CCW_SUMMER_WHIPCRACK_ROOM:// 8038E938
return SUMMER;
case MAP_45_CCW_AUTUMN:// 8038E940
case MAP_4C_CCW_AUTUMN_MUMBOS_SKULL:// 8038E940
case MAP_5C_CCW_AUTUMN_ZUBBA_HIVE:// 8038E940
case MAP_60_CCW_AUTUMN_NABNUTS_HOUSE:// 8038E940
case MAP_63_CCW_AUTUMN_NABNUTS_WATER_SUPPLY:// 8038E940
case MAP_67_CCW_AUTUMN_WHIPCRACK_ROOM:// 8038E940
return AUTUMN;
case MAP_46_CCW_WINTER:// 8038E948
case MAP_4D_CCW_WINTER_MUMBOS_SKULL:// 8038E948
case MAP_61_CCW_WINTER_NABNUTS_HOUSE:// 8038E948
case MAP_62_CCW_WINTER_HONEYCOMB_ROOM:// 8038E948
case MAP_64_CCW_WINTER_NABNUTS_WATER_SUPPLY:// 8038E948
case MAP_68_CCW_WINTER_WHIPCRACK_ROOM:// 8038E948
return WINTER;
default:
return SPRING;
}
}
void func_8038E964(Actor *this) {
ActorLocal_CCW_8050 *local;
f32 temp_a0;
local = (ActorLocal_CCW_8050 *)&this->local;
if (!this->unk16C_4) {
func_8038E868(this);
local->season = func_8038E8FC(this);
}
if(local->season < 4){
func_802DB5A0(this);
if (this->state == 5) {
if (actor_animationIsAt(this, 0.18f)) {
FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 1.0f, 28000, this->position, 1250, 2500);
}
if (actor_animationIsAt(this, 0.7f)) {
FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 28000, this->position, 1250, 2500);
}
}
}
}

31
src/CCW/code_8670.c Normal file
View File

@@ -0,0 +1,31 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038EAD4(Actor *this);
/* .data */
extern ActorInfo D_8038FA00 = { 0x1E3, 0x374, 0x0, 0x0, NULL, func_8038EAD4, func_80326224, func_80325340, 0, 0, 0.0f, 0};
/* .code */
bool func_8038EA60(s32 arg0, s32 arg1, s32 arg2) {
s32 sp24;
s32 temp_a0;
s32 sp1C;
s32 temp_v1;
func_8028EB3C(&sp1C);
temp_v1 = arg1 - sp24;
temp_a0 = arg0 - sp1C;
return ((temp_v1 * temp_v1) + (temp_a0 * temp_a0)) < (arg2 * arg2);
}
void func_8038EAD4(Actor* this) {
if (func_803203FC(0x13)) {
marker_despawn(this->marker);
return;
}
if (func_8038EA60(0, -0x6B, 0xBC) != 0) {
func_80311480(0xDA9, 4, NULL, NULL, NULL, NULL);
func_803204E4(0x13, 1);
}
}

215
src/CCW/code_950.c Normal file
View File

@@ -0,0 +1,215 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8030DBFC(u8, f32, f32, f32);
typedef struct{
u8 unk0;
//u8 pad1[3];
ActorMarker *unk4;
f32 unk8[3];
f32 unk14;
f32 unk18;
}ActorLocal_CCW_950;
void chwasp_update(Actor *this);
/* .data */
extern ActorInfo D_8038EBD0 = { MARKER_1AE_ZUBBA, ACTOR_29B_ZUBBA, ASSET_446_MODEL_ZUBBA, 0x0, NULL, chwasp_update, NULL, func_80325888, 0, 0, 1.0f, 0};
/* .code */
void chwasp_setState(Actor *this, s32 next_state) {
ActorLocal_CCW_950 *local;
f32 sp50[3];
f32 sp44[3];
local = (ActorLocal_CCW_950 *)&this->local;
local->unk18 = 0.0f;
if (next_state == 1) {
local->unk18 = 800.0f;
func_80335924(this->unk148, ASSET_16F_ANIM_ZUBBA_FLY_MOVE, 0.0f, 0.65f);
}
if (next_state == 2) {
func_80335924(this->unk148, ASSET_170_ANIM_ZUBBA_FLY_IDLE, 0.1f, 0.65f);
player_getPosition(sp50);
sp50[1] += 50.0f;
local->unk8[0] = sp50[0] - this->position[0];
local->unk8[1] = sp50[1] - this->position[1];
local->unk8[2] = sp50[2] - this->position[2];
ml_vec3f_normalize(local->unk8);
if ((local->unk8[0] == 0.0f) && (local->unk8[1] == 0.0f) && (local->unk8[2] == 0.0f)) {
local->unk8[1] = -1.0f;
}
}
if (next_state == 3) {
FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200, this->position, 500, 3000);
func_80324D54(randf2(0.1f, 0.4f), 0x3FC, randf2(0.95f, 1.1f), 32000, this->position, 500.0f, 3000.0f);
actor_collisionOff(this);
}
if (next_state == 4) {
func_80335924(this->unk148, ASSET_171_ANIM_ZUBBA_DIE, 0.1f, 0.2f);
FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200, this->position, 500, 3000);
func_80324D54(0.1f, 0x66, randf2(1.6f, 1.7f), 32000, this->position, 500.0f, 3000.0f);
func_803867C8(local->unk4);
actor_collisionOff(this);
player_getPosition(sp44);
sp44[1] += 50.0f;
local->unk8[0] = this->position[0] - sp44[0];
local->unk8[1] = this->position[1] - sp44[1];
local->unk8[2] = this->position[2] - sp44[2];
ml_vec3f_normalize(local->unk8);
if ((local->unk8[0] == 0.0f) && (local->unk8[1] == 0.0f) && (local->unk8[2] == 0.0f)) {
local->unk8[1] = -1.0f;
}
}
if (next_state == 5) {
func_8030E878(SFX_A_BANJO_LANDING_05, randf2(0.85f, 0.95f), 18000, this->position, 500.0f, 3000.0f);
func_80335924(this->unk148, ASSET_172_ANIM_ZUBBA_LAND, 0.0f, 1.0f);
func_80335A8C(this->unk148, 2);
}
if (next_state == 6) {
marker_despawn(this->marker);
}
if (next_state == 7) {
func_80386814(local->unk4);
marker_despawn(this->marker);
}
this->state = next_state;
}
void func_80387124(ActorMarker* marker, ActorMarker *other_marker) {
chwasp_setState(marker_getActor(marker), 3);
}
void func_80387150(ActorMarker* marker, ActorMarker *other_marker) {
chwasp_setState(marker_getActor(marker), 4);
}
void func_8038717C(Actor *this){
ActorLocal_CCW_950 *local;
local = (ActorLocal_CCW_950 *)&this->local;
func_8030DA44(local->unk0);
}
void chwasp_update(Actor *this) {
ActorLocal_CCW_950 *local;
f32 sp68;
Actor *other;
s32 sp60;
s32 sp5C;
f32 sp50[3];
f32 sp4C;
f32 sp48;
f32 sp44;
f32 temp_f0;
f32 pad;
sp68 = time_getDelta();
local = (ActorLocal_CCW_950 *)&this->local;
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->unk30 = func_8038717C;
local->unk0 = func_8030D90C();
local->unk4 = 0;
local->unk14 = 1000.0f;
sfxsource_setSfxId(local->unk0, 0x3FA);
func_8030DD14(local->unk0, 2);
func_8030DBB4(local->unk0, 0.9f);
sfxsource_setSampleRate(local->unk0, 0);
marker_setCollisionScripts(this->marker, func_80387124, NULL, func_80387150);
chwasp_setState(this, 1);
return;
}
if(local->unk4 == NULL) {
other = func_80326EEC(0x299);
if (other == NULL) {
marker_despawn(this->marker);
return;
}
local->unk4 = other->marker;
func_80386840(local->unk4, &sp60, &sp5C);
local->unk14 = (((f32)sp60 /(f32)sp5C) * 1000.0f) + 1000.0f;
}
if (this->state == 1) {
temp_f0 = this->position[1];
this->position[0] += 0.1 * sp68;
this->position[1] += local->unk18 * sp68;
if ((temp_f0 < 0.0f) && (this->position[1] >= 0.0f)) {
func_8030E878(SFX_A_BANJO_LANDING_05, randf2(1.0f, 1.1f), 18000, this->position, 500.0f, 3000.0f);
}
player_getPosition(sp50);
func_80258A4C(this->position, this->yaw - 90.0f, sp50, &sp4C, &sp48, &sp44);
this->yaw += 360.0f * sp44 * sp68;
if (this->position[1] > 150.0f) {
local->unk18 -= 2000.0f * sp68;
if (local->unk18 < 0.0f) {
chwasp_setState(this, 2);
}
}
}
if (this->state == 2) {
if (local->unk18 < local->unk14) {
local->unk18 += (4.0f * local->unk14 * sp68);
}
this->position[0] += local->unk8[0] * local->unk18 * sp68;
this->position[1] += local->unk8[1] * local->unk18 * sp68;
this->position[2] += local->unk8[2] * local->unk18 * sp68;
if( (this->position[0] < -1500.0f) || (1500.0f < this->position[0])
|| (this->position[1] < -100.0f) || (1300.0f < this->position[1])
|| (this->position[2] < -1200.0f) || (this->position[2] > 2000.0f)
){
chwasp_setState(this, 7);
}
}
if (this->state == 3) {
this->position[1] += local->unk18 * sp68;
if (local->unk18 < local->unk14) {
local->unk18 += 2000.0f * sp68;
}
if( (this->position[0] < -1500.0f) || (1500.0f < this->position[0])
|| (this->position[1] < -100.0f) || (1300.0f < this->position[1])
|| (this->position[2] < -1200.0f) || (this->position[2] > 2000.0f)
) {
chwasp_setState(this, 7);
}
}
if (this->state == 4) {
this->position[0] += local->unk8[0] * 1000.0f * sp68;
this->position[1] -= local->unk18 * sp68;
this->position[2] += local->unk8[2] * 1000.0f * sp68;
if (local->unk18 < local->unk14) {
local->unk18 += (1000.0f * sp68);
}
if (this->position[1] <= 0.0f) {
this->position[1] = 0.0f;
chwasp_setState(this, 5);
}
}
if (this->state == 5) {
this->position[1] -= 300.0f * sp68;
if (this->position[1] < -200.0f) {
chwasp_setState(this, 6);
}
}
if(this->state);
if (this->state == 2) {
func_8030DBFC(local->unk0, 1.0f, 1.1f, 0.05f);
} else {
func_8030DBFC(local->unk0, 0.8f, 0.9f, 0.05f);
}
func_8030DEB4(local->unk0, 500.0f, 1500.0f);
func_8030DF68(local->unk0, this->position);
func_8030E2C4(local->unk0);
sfxsource_setSampleRate(local->unk0, (s32) ((local->unk18 / local->unk14) * 10000.0f));
}

91
src/FP/ch/wozzasjig.c Normal file
View File

@@ -0,0 +1,91 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
Actor *func_8038FF00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038FF54(Actor *this);
/* .data */
extern ActorAnimationInfo D_803925C0[];
extern ActorInfo D_80392628 = { MARKER_20C_WOZZAS_JIGGY, ACTOR_1F4_WOZZAS_JIGGY, ASSET_495_MODEL_WOZZAS_JIGGY,
0x1, D_803925C0,
func_8038FF54, func_80326224, func_8038FF00,
0, 0, 0.0f, 0
};
extern struct31s D_8039264C;
/* .code */
Actor *func_8038FF00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if(func_8038BFA0()) return this;
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038FF54(Actor *this){
Actor *other;
f32 sp40[3];
ParticleEmitter *sp3C;
if( func_8038BFA0() ) return;
if( !actor_playerIsWithinDist(this, 4500) ) return;
this->marker->propPtr->unk8_3 = FALSE;
actor_collisionOff(this);
if(this->unk100){
other = marker_getActor(this->unk100);
if(this->state != 9){
if(other->state == 9){
func_80328B8C(this, 9, 0.01f, 1);
actor_playAnimationOnce(this);
}
else{
animctrl_setIndex(this->animctrl, animctrl_getIndex(other->animctrl));
func_8028774C(this->animctrl, animctrl_getAnimTimer(other->animctrl));
animctrl_setDuration(this->animctrl, animctrl_getDuration(other->animctrl));
animctrl_setSmoothTransition(this->animctrl, FALSE);
func_802875AC(this->animctrl, "chwozzasjig.c", 0x87);
this->position[0] = other->position[0];
this->position[1] = other->position[1];
this->position[2] = other->position[2];
this->yaw = other->yaw;
}
}
}//L8039008C
if(this->state == 9){
if(0.99999 <= animctrl_getAnimTimer(this->animctrl)){
func_8034A174(this->marker->unk44, 5, sp40);
sp40[0] = (f32)(s32)sp40[0];
sp40[1] = (f32)(s32)sp40[1];
sp40[2] = (f32)(s32)sp40[2];
func_802C8F70(this->yaw + 90.0f);
jiggySpawn(JIGGY_32_FP_WOZZA, sp40);
levelSpecificFlags_set(0x26, TRUE);
marker_despawn(this->marker);
}
else if(this->marker->unk14_21){//L8039016C
sp3C = partEmitList_pushNew(1);
func_8034A174(this->marker->unk44, 5, sp40);
particleEmitter_setSprite(sp3C, ASSET_713_SPRITE_SPARKLE_YELLOW);
particleEmitter_setStartingFrameRange(sp3C, 1, 6);
particleEmitter_setPosition(sp3C, sp40);
particleEmitter_setParticleSpawnPositionRange(sp3C,
0.0f, 20.0f, 0.0f,
0.0f, 20.0f, 0.0f
);
particleEmitter_setParticleVelocityRange(sp3C,
-180.0f, 0.0f, -180.0f,
180.0f, 280.0f, 180.0f
);
particleEmitter_setParticleAccelerationRange(sp3C,
0.0f, -60.0f, 0.0f,
0.0f, -90.0f, 0.0f
);
func_802EFB98(sp3C, &D_8039264C);
particleEmitter_emitN(sp3C, 1);
}
}
}

148
src/FP/code_0.c Normal file
View File

@@ -0,0 +1,148 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_803867BC(Actor *this);
/* .data */
ActorAnimationInfo D_803919F0[] ={
{ASSET_1A1_ANIM_SLED, 1.0f},
{ASSET_1A1_ANIM_SLED, 1.0f},
{ASSET_1A1_ANIM_SLED, 1.0f},
{ASSET_1A1_ANIM_SLED, 1.0f}
};
ActorInfo D_80391A10 = {
MARKER_3B_SCARF_SLED, ACTOR_181_SCARF_SLED, ASSET_352_MODEL_SLED,
0, D_803919F0,
NULL, func_803867BC, func_80325888,
1000, 0, 0.0f, 0
};
/* .code */
void func_803863F0(Actor *this, s32 next_state){
func_80328A84(this, next_state);
if(next_state == 2){
mapSpecificFlags_set(0xB, TRUE);
timed_setCameraToNode(0.0f, 0x27);
timed_playSfx(0.6f, SFX_52_BANJO_YAH_OH, 1.0f, 28000);
timed_playSfx(1.25f, SFX_31_BANJO_OHHWAAOOO, 1.0f, 28000);
timed_setCameraToNode(1.5f, 0x26);
timed_setCameraToNode(2.75f, 0x25);
timed_playSfx(3.5f, SFX_63_BANJO_UWAAAAOOH, 1.0f, 28000);
timed_setCameraToNode(3.75f, 0x24);
timed_playSfx(4.25f, SFX_A7_WOODEN_SWOSH, 1.2f, 18000);
timed_playSfx(4.45f, SFX_C1_BUZZBOMB_ATTACK, 1.0f, 0x7fff);
timed_setCameraToNode(4.75f, 0x23);
}
}
void func_803864F4(ActorMarker *this_marker, ActorMarker *other_marker){
Actor * this = marker_getActor(this_marker);
if(this->state != 1) return;
if(player_getTransformation() != TRANSFORM_1_BANJO) return;
if(func_8028F68C(0x27, this->marker))
func_803863F0(this, 2);
}
void func_8038655C(Actor *this){
int tmp_bool;
int tmp;
tmp_bool = (mlAbsF(this->position_y - this->velocity_y) < 100.0f);
tmp = this->unk10_12;
this->unk10_12 = FALSE;
if(!tmp_bool){
if(tmp != 0){
func_8030E6A4(SFX_19_BANJO_LANDING_08, func_8030E200(this->unk44_31), 0x55f0);
}
}
else{
if(this->unk44_31 == 0){
this->unk44_31 = func_8030ED2C(SFX_18_BIGBUTT_SLIDE, 2);
func_8030E0FC(this->unk44_31, 0.9f, 1.5f, 1.2f);
}
this->unk10_12 = TRUE;
func_8030E2C4(*((u8*)this + 0x44));
}
}
void func_80386630(Actor *this){
f32 sp7C[3];
f32 sp70[3];
f32 sp64[3];
f32 sp24[4][4];
func_80343DEC(this);
mapSpecificFlags_set(9, 1);
func_8038655C(this);
if(this->unk138_20){
this->yaw = 0.0f;
sp64[0] = this->pitch;
sp64[1] = this->yaw;
sp64[2] = this->roll;
mlMtxIdent();
mlMtxRotYaw(sp64[1]);
mlMtxRotPitch(sp64[0]);
func_802513B0(sp24);
sp70[0] = 0.0f;
sp70[1] = 18.0f;
sp70[2] = 0.0f;
func_8025235C(sp70, sp70);
sp70[0] += this->position[0];
sp70[1] += this->position[1];
sp70[2] += this->position[2];
func_8028FAB0(sp70);
sp64[0] = this->pitch;
sp64[1] = this->yaw;
sp64[2] = this->roll;
func_8028FAEC(sp64);
}//L80386724
if(1.0 == this->unk48){
mapSpecificFlags_set(1, TRUE);
FUNC_8030E624(SFX_103_FLOTSAM_DEATH, 1.0f, 30000);
FUNC_8030E624(SFX_11_WOOD_BREAKING_1, 0.8f, 25000);
FUNC_8030E624(SFX_D_EGGSHELL_BREAKING, 1.0f, 25000);
sp7C[0] = -1000.0f;
sp7C[1] = 1727.0f;
sp7C[2] = 6218.0f;
func_8028F490(sp7C);
marker_despawn(this->marker);
}//L803867AC
}
void func_803867BC(Actor *this){
if(!this->initialized){
this->initialized = TRUE;
marker_setCollisionScripts(this->marker, func_803864F4, NULL, NULL);
this->marker->propPtr->unk8_3 = TRUE;
this->unk10_12 = 0;
ml_vec3f_clear(this->velocity);
func_803863F0(this, 1);
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(jiggyscore_isCollected(JIGGY_2A_FP_BOGGY_1)){
marker_despawn(this->marker);
return;
}
}
this->velocity_x = this->position_x;
this->velocity_y = func_80309724(this->position);
this->velocity_z = this->position_z;
if(this->state == 2){
func_80386630(this);
}
}

201
src/FP/code_11F0.c Normal file
View File

@@ -0,0 +1,201 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_80324CD8(f32);
Actor *func_803875E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038774C(Actor *this);
void func_8038794C(Actor *this);
/* .data */
ActorAnimationInfo D_80391B80[] = {
{0x000, 0.0f},
{0x14E, 2.0f},
{0x14D, 7.0f},
{0x14C, 2.0f},
{0x14F, 0.5f},
{0x14F, 1.0f}
};
ActorInfo D_80391BB0 = {
MARKER_124_BOGGY_1, ACTOR_160_BOGGY_1, ASSET_38A_MODEL_BOGGY_1,
0x1, D_80391B80,
func_8038774C, func_8038794C, func_803875E0,
2500, 0, 1.4f, 0
};
f32 D_80391BD4[3] = {1592.0f, 673.0f, 5895.0f};
f32 D_80391BE0[3] = { 0.0f, 0.0f, 0.0f};
f32 D_80391BEC[5] = {2.0f, 2.8f, 4.3f, 5.1f, 5.7f};
/* .code */
Actor *func_803875E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if(!this->unk38_31 || this->state == 5)
return this;
func_8033A45C(1, 0);
func_8033A45C(3, 1);
this = func_80325888(marker, gfx, mtx, vtx);
if(marker->unk14_21){
func_8034A174(func_80329934(), 5, this->velocity);
}
return this;
}
void func_803876A4(Actor *this){
func_80328B8C(this, 2, 0.0001f, 1);
actor_playAnimationOnce(this);
FUNC_8030E8B4(SFX_8E_GRUNTLING_DAMAGE, 1.0f, 32000, this->position, 1250, 2500);
}
void func_803876F8(Actor *this){
this->marker->propPtr->unk8_3 = FALSE;
func_80328B8C(this, 5, 0.0001f, 1);
this->unk48 = 0.0f;
func_80343DEC(this);
}
void func_8038774C(Actor *this){}
void func_80387754(ActorMarker *this_marker, ActorMarker *other_marker){}
void func_80387760(ActorMarker *marker){
Actor *other = func_80328230(ACTOR_C8_BOGGY_2, D_80391BD4, D_80391BE0);
other->unk4C = 1.0f;
func_80343DEC(other);
}
void func_803877A8(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
if(arg2 == 1){
jiggySpawn(JIGGY_2A_FP_BOGGY_1, this->velocity);
}
else if(arg2 == 2){
func_80328B8C(this, 4, 0.0001f, 1);
actor_loopAnimation(this);
actor_collisionOff(this);
}
}
void func_80387828(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
if(text_id == 0xc00){
func_80311480(0xc2b, 0xf, NULL, this->marker, NULL, func_803877A8);
}
}
void func_8038787C(ActorMarker *marker){
Actor *this = marker_getActor(marker);
s32 s0;
f32 sp24;
s32 sp20;
s0 = func_802F9AA8(SFX_12B_BOILING_AND_BUBBLING);
sp24 = randf2(0.9f, 1.1f);
sp20 = (s32)randf2(16000.0f, 23000.0f);
func_802F9DB8(s0, sp24, sp24, 0.0f);
func_802F9EC4(s0, this->position, 500, 1200);
func_802F9F80(s0, 0.05f, 0.2f, 0.3f);
func_802FA060(s0, sp20, sp20, 0.0f);
}
void func_8038794C(Actor *this){
int i;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
marker_setCollisionScripts(this->marker, NULL, func_80387754, NULL);
this->unk38_31 = 1;
ml_vec3f_copy(this->velocity, this->position);
if(func_803203FC(1))
return;
if(!jiggyscore_isCollected(JIGGY_2A_FP_BOGGY_1) && jiggyscore_isSpawned(JIGGY_2A_FP_BOGGY_1)){
func_803876F8(this);
actor_collisionOff(this);
}
if(jiggyscore_isCollected(JIGGY_2A_FP_BOGGY_1)){
if(!jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3) && !jiggyscore_isSpawned(JIGGY_2C_FP_BOGGY_3)){
func_802C3C88(func_80387760, this->marker);
}
this->unk38_31 = 0;
actor_collisionOff(this);
this->marker->propPtr->unk8_3 = FALSE;
}
}//L80387A68
if( !this->unk38_31 ) return;
switch(this->state){
case 1://L80387AB0
if(mapSpecificFlags_get(0xb))
this->unk138_24 = TRUE;
if(mapSpecificFlags_get(0x1)){
func_8028F94C(1, this->position);
timed_setCameraToNode(0.0f, 0x12);
func_80324DBC(1.0f, 0xc00, 0xe, NULL, this->marker, func_80387828, func_803877A8);
func_803876A4(this);
break;
}//L80387B38
if(!this->unk138_24 && func_80329530(this, 0x1f4)){
if(!func_8028ECAC() || func_8028ECAC() == BSGROUP_8_TROT){
if(func_80311480(0xbff, 0x2a, this->position, NULL, NULL, NULL)){
for(i = 0; i <5; i++ ){
timedFunc_set_1(D_80391BEC[i], (TFQM1)func_8038787C, (s32)this->marker);
}
this->unk138_24 = TRUE;
}
}
}
break;
case 2://L80387BEC
func_8028FC8C(this->position);
if(actor_animationIsAt(this, 0.1f)){
FUNC_8030E8B4(SFX_F6_BLUBBER_TALKING_2, 1.0f, 32000, this->position, 1250, 2500);
}
else if(actor_animationIsAt(this, 0.24f)){//L80387C2C
FUNC_8030E8B4(SFX_A0_COUGHING, 0.7f, 32000, this->position, 1250, 2500);
}
else if(actor_animationIsAt(this, 0.52f)){//L80387C60
FUNC_8030E8B4(SFX_A0_COUGHING, 0.67f, 32000, this->position, 1250, 2500);
}
else if(actor_animationIsAt(this, 0.61f)){//L80387C94
FUNC_8030E8B4(SFX_A0_COUGHING, 0.64f, 32000, this->position, 1250, 2500);
}
else if(actor_animationIsAt(this, 0.69f)){//L80387CC8
FUNC_8030E8B4(SFX_A0_COUGHING, 0.61f, 32000, this->position, 1250, 2500);
}//L80387CF4
if(actor_animationIsAt(this, 0.9999f)){
func_80328B8C(this, 3, 0.0001f, 1);
actor_loopAnimation(this);
}
break;
case 4://L80387D2C
func_80343DEC(this);
func_8028FC8C(this->position);
if(0.99 <= this->unk48){
func_8028F918(0);
func_80324CD8(0.0f);
func_80324E88(0.0f);
func_803876F8(this);
}
break;
case 5://L80387D90
if(jiggyscore_isCollected(JIGGY_2A_FP_BOGGY_1)){
this->unk38_31 = 0;
func_802C3C88(func_80387760, this->marker);
}
break;
}
}

102
src/FP/code_19E0.c Normal file
View File

@@ -0,0 +1,102 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
u8 pad0[1];
u8 unk1;
} ActorLocal_FP_19E0;
void func_803289EC(Actor *, f32, s32);
void func_8028E668(f32[3], f32, f32, f32);
Actor *func_80387DD0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_803881AC(Actor *this);
/* .data */
ActorAnimationInfo D_80391C00[] = {
{0x000, 0.0f},
{0x152, 4.0f},
{0x151, 1.2f}
};
ActorInfo D_80391C18 = {
0x125, 0x161, 0x38b,
0x1, D_80391C00,
func_803881AC, func_80326224, func_80387DD0,
0, 0, 0.35f, 0
};
/* .code */
Actor *func_80387DD0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if(this->velocity[0] == 0.0f || 0.0f != this->velocity[1])
return this;
func_8033A45C(2, this->velocity[0] == 1.0f ? 1 : 0);
func_8033A45C(3, this->velocity[0] == 3.0f ? 1 : 0);
func_8033A45C(4, this->velocity[0] == 2.0f ? 1 : 0);
return func_80325888(marker, gfx, mtx, vtx);
}
#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_19E0/func_80387EE4.s")
#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_19E0/func_80388000.s")
void func_8038811C(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if(this->state == 2)
return;
func_80328B8C(this, 2, 0.0001, 1);
func_8030E878(SFX_6A_FLAGPOLE_WOBBLE, randf2(0.9f, 1.1f), 32000, this->position, 1000.0f, 2000.0f);
}
void func_803881AC(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3)){
marker_despawn(this->marker);
return;
}
marker_setCollisionScripts(this->marker, NULL, func_8038811C, NULL);
this->marker->propPtr->unk8_3 = FALSE;
this->unk124_6 = FALSE;
func_803289EC(this, randf(), 1);
if(this->unk38_31 == 0){
func_8038B8B0(this->marker);
this->velocity_x = 0.0f;
}
this->initialized = FALSE;
this->velocity_z = 0.0f;
}//L8038827C
if(0.0f == this->velocity_x || 0.0f != this->velocity_y) {
this->marker->collidable = FALSE;
if(0.0f == this->velocity_x)
return;
}else{
if(!func_80329530(this, 2000) && !func_8038BFE8(this->position, 2000))
return;
this->marker->collidable = TRUE;
this->unk124_6 = TRUE;
}//L80388314
func_8028E668(this->position, 200.0f, -10.0f, 30.0f);
if(this->state == 2){
if(actor_animationIsAt(this, 0.9999f)){
func_80328B8C(this, 1, 0.0001f, 1);
}
}
if( 1.0f == this->velocity_x && func_80387EE4(this)){
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
func_8038BA88(this->unkF4_8);
}
if(func_80388000(this)){
func_8038BC0C(this->unkF4_8);
}
}

84
src/FP/code_1FF0.c Normal file
View File

@@ -0,0 +1,84 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_803289EC(Actor *, f32, s32);
extern void func_8028E668(f32[3], f32, f32, f32);
void func_80388584(Actor *this);
Actor *func_803883E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_80391C40[] = {
{0x000, 0.0f},
{0x152, 4.0f},
{0x151, 1.2f}
};
ActorInfo D_80391C58 = {
0x126, 0x162, 0x38B,
0x1, D_80391C40,
func_80388584, func_80326224, func_803883E0,
0, 0, 0.35f, 0
};
/* .code */
Actor *func_803883E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if(this->velocity[0] == 0.0f || 0.0f != this->velocity[1])
return this;
func_8033A45C(2, this->velocity[0] == 1.0f ? 1 : 0);
func_8033A45C(3, this->velocity[0] == 3.0f ? 1 : 0);
func_8033A45C(4, this->velocity[0] == 2.0f ? 1 : 0);
return func_80325888(marker, gfx, mtx, vtx);
}
void func_803884F4(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if(this->state != 2){
func_80328B8C(this, 2, 0.0001f, 1);
func_8030E878(SFX_6A_FLAGPOLE_WOBBLE, randf2(0.9f, 1.1f), 32000, this->position, 1000.0f, 2000.0f);
}
}
void func_80388584(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3)){
marker_despawn(this->marker);
return;
}
marker_setCollisionScripts(this->marker, NULL, func_803884F4, NULL);
this->marker->propPtr->unk8_3 = FALSE;
func_803289EC(this, randf(), 1);
this->unk124_6 = 0;
if(this->unk38_31 == 0){
func_8038B930(this->marker);
this->velocity[0] = 0.0f;
}
}//L8038863C
if((this->velocity[0] == 0.0f || this->velocity[1] != 0.0f)){//L8038866C
this->marker->collidable = FALSE;
if(this->velocity[0] != 0.0f){
}
else{
return;
}
}
else{//L80388694
if(!func_80329530(this, 2000)&& !func_8038BFE8(this->position, 2000))
return;
this->marker->collidable = TRUE;
this->unk124_6 = TRUE;
}
func_8028E668(this->position, 200.0f, -10.0f, 30.0f);
if(this->state == 2){
if(actor_animationIsAt(this, 0.9999f)){
func_80328B8C(this, 1, 0.0001f, 1);
}
}
}

661
src/FP/code_2350.c Normal file
View File

@@ -0,0 +1,661 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028E668(f32[3], f32, f32, f32);
extern f32 func_8038BE20(f32 arg0[3]);
typedef struct {
ParticleEmitter *unk0;
ParticleEmitter *unk4;
f32 unk8;
f32 unkC;
f32 unk10;
f32 unk14;
u8 unk18;
u8 unk19;
}ActorLocal_FP_2350;
typedef struct {
s32 unk0;
s32 actor_id;
}Struct_FP_2350;
Actor *func_80388740(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_80388D70(ActorMarker *caller, enum asset_e text_id, s32 arg2);
void func_80388EE8(ParticleEmitter *pCtrl);
void func_80388F4C(Actor *this);
void func_803896FC(Actor *this);
/* .data */
ActorAnimationInfo D_80391C80[] = {
{0x000, 0.0f},
{0x150, 0.6f},
{0x150, 0.6f},
{0x150, 0.6f},
{0x150, 0.6f},
{0x179, 2.3f},
{0x17A, 1.3f},
{0x17B, 2.0f},
{0x150, 1.0f},
{0x1AA, 4.3f},
{0x1AB, 4.3f},
{0x150, 1.0f},
{0x150, 0.6f}
};
ActorInfo D_80391CE8 = { 0x97, ACTOR_C8_BOGGY_2, ASSET_38A_MODEL_BOGGY_1,
0x1, D_80391C80,
func_80388F4C, func_803896FC, func_80388740,
0, 0, 1.4f, 0
};
f32 D_80391D0C[3] = {1842.0f, 658.0f, 5758.0f};
f32 D_80391D18[3] = {1463.0f, 635.0f, 5193.0f};
s32 D_80391D24[3] = {0xc8, 0xc8, 0xe6};
struct31s D_80391D30 = {
{0.2f, 0.4f},
{1.2f, 1.6f},
{0.0f, 0.001f},
{0.3f, 0.45f},
0.0f, 0.01f
};
struct42s D_80391D58 = {
{{-10.0f, 10.0f, -10.0f}, {10.0f, 240.0f, 10.0f}},
{{0.0f, 0.0f, 0.0f}, {0.0f, 20.0f, 0.0f}}
};
f32 D_80391D88[3] = { 1592.0f, 673.0f, 5895.0f};
f32 D_80391D94[3] = {0.0f, 0.0f, 0.0f};
s32 D_80391DA0[3] = {0x5F5, 0x292, 0x1539};
s32 D_80391DAC[3] = {-0x11F8, 0x637, -0x1816};
Struct_FP_2350 D_80391DB8[7]={
{0x361, 0x35D},
{0x365, 0x35D},
{0x362, 0x360},
{0x366, 0x35D},
{0x37B, 0x35D},
{0x363, 0x35F},
{0x364, 0x35E}
};
f64 D_80392CB8;
s32 D_80392F20[3];
/* .code */
Actor *func_80388740(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
ActorLocal_FP_2350 * local = (ActorLocal_FP_2350 *) &this->local;
f32 sp2C[3];
func_8033A45C(1, 1);
func_8033A45C(3, 1);
this = func_80325888(marker, gfx, mtx, vtx);
if(this->unk16C_4 && marker->unk14_21){
if( this->state == 4
|| this->state == 5
|| this->state == 6
|| this->state == 8
){
if(this->unk4C != 0.0f && (func_8023DB5C() & 1)){
if(-2.0 < this->roll){
func_8034A174(func_80329934(), 6, sp2C);
particleEmitter_setPosition(local->unk0, sp2C);
particleEmitter_emitN(local->unk0, 1);
}
if(this->roll < 2.0){
func_8034A174(func_80329934(), 7, sp2C);
particleEmitter_setPosition(local->unk4, sp2C);
particleEmitter_emitN(local->unk4, 1);
}
}
}//L803888D4
}
return this;
}
void func_803888E4(Actor *this){
func_80328B8C(this, 0xC, 0.0001f, 1);
if(!jiggyscore_isSpawned(JIGGY_30_FP_BOGGY_2)){
if(mapSpecificFlags_get(5)){
func_80324DBC(0.1f, 0xc06, 0x2a, D_80391D18, this->marker, func_80388D70, NULL);
}
else{//L80388964
func_80324DBC(0.1f, 0xc03, 0x2a, D_80391D18, this->marker, func_80388D70, NULL);
}
}
else{//L803889A0
func_8028F490(D_80391D0C);
if(mapSpecificFlags_get(6)){
func_80324DBC(0.1f, 0xc29, 0x2a, D_80391D18, this->marker, func_80388D70, NULL);
}
else{
func_80324DBC(0.1f, 0xc28, 0x2a, D_80391D18, this->marker, func_80388D70, NULL);
}
}//L80388A30
mapSpecificFlags_set(5, TRUE);
func_8038B9C8();
}
void func_80388A50(Actor *this){
ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local;
func_80328B8C(this, 2, 0.0001f, 1);
timed_setCameraToNode(0.0f, 4);
local->unk18 = 0;
}
void func_80388A94(Actor *this){
func_80388A50(this);
if(mapSpecificFlags_get(6)){
func_80311480(0xc0a, 0xe, this->position, this->marker, func_80388D70, NULL);
}
else{
func_80311480(0xc09, 0xe, this->position, this->marker, func_80388D70, NULL);
}
}
void func_80388B18(Actor *this, u8 arg1){
if(arg1 == TRUE){
if(player_getTransformation() == TRANSFORM_4_WALRUS){
func_80388A50(this);
if(mapSpecificFlags_get(5)){
func_80311480(0xc05, 0xf, this->position, this->marker, func_80388D70, NULL);
}
else{
func_80311480(0xc02, 0xf, this->position, this->marker, func_80388D70, NULL);
}
}
else{//L80388BB8
if(!func_803203FC(0xb3)){
if(func_80311480(0xc01, 0xe, this->position, this->marker, func_80388D70, NULL)){
func_803204E4(0xb3, TRUE);
func_80388A50(this);
}
}
}
}
else{//L80388C08
if(player_getTransformation() == TRANSFORM_4_WALRUS){
if(!func_803203FC(0xb4)){
if(func_80311480(0xc08, 0xe, this->position, this->marker, func_80388D70, NULL)){
func_803204E4(0xb4, TRUE);
func_80388A50(this);
}
}
}
else{
func_80388A94(this);
}
}
}
void func_80388C88(Actor *this){
ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local;
this->unk10_12 = 0;
local->unk18 = 1;
}
bool func_80388CA0(Actor *this){
ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local;
u32 sp20;
if(func_8028ECAC() != 0 && func_8028ECAC() != BSGROUP_8_TROT)
return FALSE;
if( !func_80329530(this, 1100) ){
local->unk18 = TRUE;
}
sp20 = this->unk10_12;
this->unk10_12 = func_80329530(this, 0x1C2);
return (sp20 == 0 && this->unk10_12 && local->unk18);
}
void func_80388D70(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local;
func_80324E88(0.0f);
switch(text_id){
case 0xc03:
case 0xc06:
case 0xc28:
case 0xc29://L80388DC4
func_8025A6EC(COMUSIC_3A_FP_BOGGY_RACE, 25000);
func_8025A58C(0, 4000);
func_8024BD08(0);
func_802BE720();
local->unk0 = partEmitList_pushNew(16);
local->unk4 = partEmitList_pushNew(16);
func_80388EE8(local->unk0);
func_80388EE8(local->unk4);
func_80328B8C(this, 4, 0.0001f, 1);
local->unk14 = (local->unk19 == 2) ? 1.0f : 0.0f;
this->marker->unk40_23 = TRUE;
break;
default://L80388E78
switch(arg2){
case 1:
func_803888E4(this);
mapSpecificFlags_set(6, TRUE);
break;
case 0:
func_80328B8C(this, 1, 0.0001f, 1);
break;
default:
func_80328B8C(this, 1, 0.0001f, 1);
break;
}
break;
}
}
void func_80388EE8(ParticleEmitter *pCtrl){
particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST);
func_802EFFA8(pCtrl, D_80391D24);
particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_80391D58);
func_802EFB98(pCtrl, &D_80391D30);
func_802F0D54(pCtrl);
}
void func_80388F4C(Actor *this){}
void func_80388F54(ActorMarker *marker){
Actor *other = func_80328230(ACTOR_C8_BOGGY_2, D_80391D88, D_80391D94);
func_80343DEC(other);
}
void func_80388F90(Actor *this){
ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local;
func_8030DB04(this->unk44_31, 32000, this->position, 1000.0f, 4000.0f);
func_8030DBB4(this->unk44_31, local->unk8);
func_8030E2C4(this->unk44_31);
}
bool func_80388FE8(Actor *this, f32 arg1, f32 arg2){
if(arg2 < 0.0f && 0.0f < arg1){
func_8030E878(SFX_8D_BOGGY_OHWW, randf2(1.04f, 1.12f), 32000, this->position, 600.0f, 1200.0f);
return TRUE;
}
else if( 0.0f < arg2 && arg1 < 0.0f){
func_8030E878(SFX_F9_GRUNTLING_NOISE_1, randf2(1.04f, 1.12f), 32000, this->position, 600.0f, 1200.0f);
return TRUE;
}
return FALSE;
}
void func_803890DC(Actor *this, u8 arg1){
ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local;
f32 yaw_to_target;
f32 yaw;
f32 f16;
f32 prev_roll;
f32 dyaw;
yaw_to_target = (this->unk1C[0] < 180.0f) ? this->unk1C[0] : this->unk1C[0] - 360.0f;
yaw = (this->yaw < 180.0f) ? this->yaw : this->yaw - 360.0f;
prev_roll = this->roll;
f16 = (arg1 == 2) ? 1100.0f : 780.0f;
dyaw = yaw - yaw_to_target;
dyaw = (180.0f < dyaw) ? 360.0f - dyaw
: (dyaw < -180.0f) ? 360.0f + dyaw
: dyaw;
this->roll += (2.0*dyaw)*(this->unk4C / f16);
this->roll = (26.0f < this->roll) ? 26.0f
: (this->roll < -26.0f) ? -26.0f
: this->roll;
this->roll += (this->roll < 0.0f) ? 1.8
: (0.0f < this->roll) ? -1.8
: 0.0;
if(local->unk10 == 0.0){
if(this->state != 9 && this->state != 10 && this->state != 11){
if( (23.0f < this->roll && prev_roll < 23.0f)
|| (this->roll < -23.0f && -23.0f < prev_roll)
){//L8038933C
func_8030E878(SFX_8C_BOGGY_WAHEY, randf2(1.04f, 1.12f), 32000, this->position, 600.0f, 1500.0f);
local->unk10 = 1.5f;
}//L80389394
}
}//L80389398
if(this->roll <= 1.8 && -1.8 <= this->roll){
this->roll = 0.0f;
}
}
void func_803893E4(Actor *this, f32 arg1, u8 arg2){
ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local;
f32 sp30;
f32 sp2C;
f32 sp28;
if((u8)arg2 != 2){
sp30 = 575.0f;
sp2C = 780.0f;
sp28 = 1.7f;
}
else{
sp30 = 700.0f;
sp2C = 1100.0f;
sp28 = 2.3f;
}
func_80343DEC(this);
if(this->state == 7){
this->unk4C += ((f32)D_80392F20[1] - this->position_y)*0.02;
}
else{
this->unk4C += ((f32)D_80392F20[1] - this->position_y)*0.03 + sp28*func_8038BE20(this->position);
}
if(this->unk4C < sp30){
this->unk4C = sp30;
}
if(sp2C < this->unk4C){
this->unk4C = sp2C;
}
if((u8)arg2 == 2 && func_8028ECAC() != 6){
this->unk4C = 1200.0f;
}
local->unk8 = ((this->unk4C - sp30)/(sp2C - sp30))*(0.6000000000000001) + 0.7;
func_803890DC(this, (u8)(arg2));
}
void func_803895E0(void){
int i;
s16 *s0;
f32 sp64[3];
Actor *actor;
f32 f20;
f32 f22;
f32 f8;
for (i = 0; i< 7; i++){
s0 = (i < 3)
? func_803049CC(D_80391DB8[i].unk0, D_80391DA0)
: func_803049CC(D_80391DB8[i].unk0, D_80391DAC);
nodeprop_getPosition(s0, sp64);
f20 = (f32)func_80304DA8(s0);
f8 = (f32)func_80304DB8(s0);
f22 = f8*0.01;
actor = func_8032813C(D_80391DB8[i].actor_id, sp64, (s32)f20);
actor->scale = f22;
}
}
void func_803896FC(Actor *this){
ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local;
f32 sp58;
f32 sp54;
s32 sp3C[6];
sp58 = func_8038BE20(this->position);
sp54 = time_getDelta();
func_8024E55C(0, sp3C);
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->unk40_23 = FALSE;
this->marker->propPtr->unk8_3 = FALSE;
this->marker->unk2C_1 = TRUE;
this->unk44_31 = func_8030ED2C(SFX_18_BIGBUTT_SLIDE, 2);
D_80392F20[0] = this->position_x;
D_80392F20[1] = this->position_y;
D_80392F20[2] = this->position_z;
this->unk1C[0] = this->yaw;
local->unk0 = NULL;
local->unk4 = NULL;
local->unk8 = 0.0f;
local->unkC = 0.0f;
local->unk10 = 0.0f;
local->unk8 = 1.0f;
func_8038B9B0(this->marker);
this->unk38_31 = 0;
func_80388C88(this);
func_802C3BF8(func_803895E0);
if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){
local->unk19 = 2;
this->unk4C = 900.0f;
}
else if(jiggyscore_isSpawned(JIGGY_30_FP_BOGGY_2)){
local->unk19 = 1;
this->unk38_31 = 2;
this->unk4C = 600.0f;
func_80328B8C(this, 11, 0.0001f, 1);
}
else{
local->unk19 = 1;
this->unk4C = 600.0f;
mapSpecificFlags_set(4, TRUE);
}
}//L803898CC
func_8028E668(this->position, 200.0f, -200.0f, 140.0f);
if(!func_8038A1A0(this->marker)){
switch(this->unk38_31){
case 1://L80389920
func_80328B8C(this, 9, 0.0001f, 1);
break;
case 2://L80389938
func_80328B8C(this, 10, 0.0001f, 1);
break;
}
}//L80389950
if(0.0 <local->unk10 - sp54)
local->unk10 =local->unk10 - sp54;
else
local->unk10 = 0.0f;
switch(this->state){
case 1:// L803899B8
if(func_80388CA0(this)){
func_80388B18(this, local->unk19);
}//L803899DC
else if(!jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2) && func_8028ECAC() == BSGROUP_C_WALRUS_SLED){
func_803888E4(this);
}
else if( func_80329530(this, 0x1C2)
&& func_8028ECAC() == 0
&& func_8028F20C()
&& func_8028EFC8()
&& sp3C[1] == 1
&& !func_803114B0()
){
if( local->unk19 == 1
&& player_getTransformation() != TRANSFORM_4_WALRUS
&& func_803203FC(0xb3)
){
func_80311480(0xC01, 0xf, this->position, this->marker, func_80388D70, NULL);
}
else if( local->unk19 == 2){
if( player_getTransformation() == TRANSFORM_4_WALRUS
&& func_803203FC(0xb4)
){
func_80311480(0xC08, 0xf, this->position, this->marker, func_80388D70, NULL);
}
else if( player_getTransformation() != TRANSFORM_4_WALRUS){
func_80388A94(this);
}
}
}
break;
case 4:// L80389B50
if(0.0 < local->unk14){
local->unk14 -= sp54;
}
else{
local->unk14 = 0.0f;
if( randf() < 0.02 && sp58 < 0.0){
if(randf() < 0.5)
func_80328B8C(this, 5, 0.0001f, 1);
else
func_80328B8C(this, 6, 0.0001f, 1);
}//L80389C18
func_803893E4(this, sp58, local->unk19);
func_80388F90(this);
if(0.0 ==local->unk10 && func_80388FE8(this, sp58,local->unkC)){
local->unk10 = 1.5f;
}
}//L80389C78
break;
case 5:// L80389C80
case 6:// L80389C80
if(actor_animationIsAt(this, 0.9999f) || sp58 >= 0.0){
func_80328B8C(this, 4, 0.0001f, 1);
}//L80389CC8
func_803893E4(this, sp58, local->unk19);
func_80388F90(this);
if(0.0 == local->unk10 && func_80388FE8(this, sp58, local->unkC)){
local->unk10 = 1.5f;
}
break;
case 7:// L80389D34
if(actor_animationIsAt(this, 0.9999f)){
func_80328B8C(this, 4, 0.0001f, 1);
}//L80389D60
func_803893E4(this, sp58, local->unk19);
func_80388F90(this);
break;
case 8:// L80389D84
func_80343DEC(this);
if(this->unk4C < 740.0f){
this->unk4C += 10.0f;
}
else if(740.0f < this->unk4C) {
this->unk4C -= 10.0f;
}
func_803890DC(this, local->unk19);
func_80388F90(this);
if(0.0 == local->unk10 && func_80388FE8(this, sp58, local->unkC)){
local->unk10 = 1.5f;
}
break;
case 9:// L80389E48
func_803893E4(this, sp58, local->unk19);
if(this->unk48 < 0.99999999999){
func_80388F90(this);
}
if(actor_animationIsAt(this, 0.9999f)){
func_80328B8C(this, 11, 0.0001f, 1);
}
break;
case 10:// L80389EB4
func_803893E4(this, sp58, local->unk19);
if(this->unk48 < 0.99999999999){
func_80388F90(this);
}
if(actor_animationIsAt(this, 0.9999f)){
func_80328B8C(this, 11, 0.0001f, 1);
}
break;
case 11:// L80389F20
func_803890DC(this, local->unk19);
if(!actor_playerIsWithinDist(this, 2000)
&& !this->marker->unk14_21
){
switch(local->unk19){
case 1: //L80389F78
if(this->unk38_31 == 2){
if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){
func_802C3C88(func_80388F54, this->marker);
func_8038B9BC();
marker_despawn(this->marker);
}
}
else{
func_8038B9BC();
marker_despawn(this->marker);
}
break;
case 2: //L80389FDC
if(this->unk38_31 == 2){
if(jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3)){
func_8038B9BC();
marker_despawn(this->marker);
mapSpecificFlags_set(0xC, TRUE);
}
}
else{
func_8038B9BC();
marker_despawn(this->marker);
}
break;
}
}
break;
}//L8038A034
D_80392F20[0] = (s32)this->position[0];
D_80392F20[1] = (s32)this->position[1];
D_80392F20[2] = (s32)this->position[2];
this->unk1C[0] = this->yaw;
local->unkC = sp58;
}
void func_8038A09C(f32 arg0[3]){
arg0[0] = (f32)D_80392F20[0];
arg0[1] = (f32)D_80392F20[1];
arg0[2] = (f32)D_80392F20[2];
}
void func_8038A0E4(UNK_TYPE(s32) arg0, ActorMarker *marker){
Actor *actor = marker_getActor(marker);
if(actor){
if(actor->state != 7){
func_80328B8C(actor, 7, 0.0001f, 1);
}
else{
func_80328B8C(actor, 4, 0.0001f, 1);
}
};
}
void func_8038A150(UNK_TYPE(s32) arg0, ActorMarker *marker){
Actor *actor = marker_getActor(marker);
if(actor && actor->state != 8){
func_80328B8C(actor, 8, 0.0001f, 1);
};
}
bool func_8038A1A0(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
switch (actor->state){
case 9:
case 10:
case 11:
return TRUE;
default:
return FALSE;
}
}

179
src/FP/code_3E00.c Normal file
View File

@@ -0,0 +1,179 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028E668(f32[3], f32, f32, f32);
extern s32 func_8028F31C(f32[3], f32, s32, Actor **);
typedef struct {
s32 unk0;
s32 unk4;
s32 unk8;
s32 unkC;
} Struct_FP_3E00;
void func_8038A384(Actor *this);
/* .data */
ActorAnimationInfo D_80391DF0[] = {
{0, 0.0f},
{ASSET_17E_ANIM_POLAR_BEAR_CUB_SAD, 5.5f},
{ASSET_17D_ANIM_POLAR_BEAR_CUB_HAPPY, 2.5f}
};
ActorInfo D_80391E08 = { MARKER_1FA_POLAR_BEAR_CUB_BLUE, ACTOR_1EA_POLAR_BEAR_CUB_BLUE, ASSET_44C_MODEL_POLAR_BEAR_CUB_BLUE,
0x1, D_80391DF0,
func_8038A384, func_80326224, func_80325888,
2500, 0, 1.2f, 0
};
ActorInfo D_80391E2C = { MARKER_1FB_POLAR_BEAR_CUB_GREEN, ACTOR_1EB_POLAR_BEAR_CUB_GREEN, ASSET_44D_MODEL_POLAR_BEAR_CUB_GREEN,
0x1, D_80391DF0,
func_8038A384, func_80326224, func_80325888,
2500, 0, 1.2f, 0
};
ActorInfo D_80391E50 = { MARKER_1FC_POLAR_BEAR_CUB_RED, ACTOR_1EC_POLAR_BEAR_CUB_RED, ASSET_44E_MODEL_POLAR_BEAR_CUB_RED,
0x1, D_80391DF0,
func_8038A384, func_80326224, func_80325888,
2500, 0, 1.2f, 0
};
f32 D_80391E74[3] = {-5.0f, 180.0f, 1.0f};
Struct_FP_3E00 D_80391E80[] ={
{0x11, 0x1FD, 0x1ED, 0x1EE},
{0x12, 0x1FE, 0x1EF, 0x1F0},
{0x13, 0x1FF, 0x1F1, 0x1F2}
};
/* .code */
void func_8038A1F0(Actor **this_ptr, s32 arg1, enum actor_e actor_id, s32 arg3){
func_8028F31C((*this_ptr)->position, 600.0f, actor_id, this_ptr);
if(!func_80329530(*this_ptr, 400)) return;
if(func_8028E88C() != arg1) return;
if(!func_8028FC34()) return;
func_8028FA34(arg3, *this_ptr);
}
void func_8038A274(Actor *this){
if(actor_animationIsAt(this, 0.4f)){
func_8030E878(SFX_B2_BOGGY_KID_HAPPY, this->unk1C[0], 32000, this->position, 100.0f, 600.0f);
return;
}
if(actor_animationIsAt(this, 0.75f)){
func_8030E878(SFX_53_BANJO_HUIII, this->unk1C[1], 32000, this->position, 100.0f, 600.0f);
}
}
void func_8038A318(ActorMarker *caller, enum asset_e text_id, s32 arg1){
if(text_id == 0xc19){
func_802BAFE4(0x25);
jiggySpawn(JIGGY_2E_FP_PRESENTS, D_80391E74);
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 32000);
func_8025A6EC(COMUSIC_5B_FP_IGLOO_HAPPY, 25000);
func_8025A58C(0, 4000);
func_8024BD08(0);
}
}
void func_8038A384(Actor *this){
s32 sp3C;
enum asset_e sp38;
s32 sp34;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = FALSE;
switch(this->marker->unk14_20){
case MARKER_1FA_POLAR_BEAR_CUB_BLUE://L8038A404
this->unk1C[0] = 1.0f;
this->unk1C[1] = 1.2f;
animctrl_setAnimTimer(this->animctrl, 0.0f);
break;
case MARKER_1FB_POLAR_BEAR_CUB_GREEN://L8038A438
this->unk1C[0] = 1.1f;
this->unk1C[1] = 1.3f;
animctrl_setAnimTimer(this->animctrl, 0.4f);
break;
case MARKER_1FC_POLAR_BEAR_CUB_RED://L8038A470
this->unk1C[0] = 1.2f;
this->unk1C[1] = 1.4f;
animctrl_setAnimTimer(this->animctrl, 0.7f);
break;
}//L8038A4A0
if( jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS)
|| func_803203FC(0xC1)
){
func_80328B8C(this, 2, randf2(0.0f, 0.9f), 1);
}
}//L8038A4E4
sp34 = levelSpecificFlags_get(0x11) + levelSpecificFlags_get(0x12) + levelSpecificFlags_get(0x13);
sp38 = (sp34 == 1) ? 0xC17
: (sp34 == 2) ? 0xC18
: 0xC19;
this->yaw_moving = (f32)func_80329784(this);
func_80328FB0(this, 2.0f);
func_8028E668(this->position, 100.0f, -10.0f, 100.0f);
switch(this->state){
case 1://L8038A5B0
if(!levelSpecificFlags_get(0x19) && func_80329530(this, 0xfa)){
if(func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT){
if(sp34 == 0
&& !jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3)
&& !jiggyscore_isSpawned(JIGGY_2C_FP_BOGGY_3)
){
if(func_80311480(0xc1a, 0x2a, NULL, NULL, NULL, NULL))
levelSpecificFlags_set(0x19, TRUE);
}
}
}//L8038A648
switch(this->marker->unk14_20){
case MARKER_1FA_POLAR_BEAR_CUB_BLUE:
sp3C = 0;
break;
case MARKER_1FB_POLAR_BEAR_CUB_GREEN:
sp3C = 1;
break;
case MARKER_1FC_POLAR_BEAR_CUB_RED:
sp3C = 2;
break;
}
if(levelSpecificFlags_get(D_80391E80[sp3C].unk0)){
func_80328B8C(this, 2, 0.001f, 1);
if(sp38 == 0xc19){
func_80311480(sp38, 0x2f, this->position, this->marker, func_8038A318, NULL);
}
else{
func_80311480(sp38, 0x3, this->position, this->marker, func_8038A318, NULL);
}
}
else{//L8038A73C
func_8038A1F0(&this, D_80391E80[sp3C].unk4, D_80391E80[sp3C].unk8, D_80391E80[sp3C].unkC);
if( actor_animationIsAt(this, 0.45f)
&& !func_803114B0()
){
func_8030E878(SFX_B1_BOGGY_KID_CRYING, randf2(0.9f, 1.1f), 32000, this->position, 150.0f, 700.0f);
}
}//L8038A7DC
break;
case 2://L8038A7C0
if(!func_803114B0()){
func_8038A274(this);
}
break;
}//L8038A7DC
}

80
src/FP/code_4400.c Normal file
View File

@@ -0,0 +1,80 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
/* .bss */
extern struct {
u8 unk0;
s32 unk4;
s32 unk8;
s32 unkC;
f32 spawn_pos[3];
u8 unk1C;
} D_80392F30;
/* .code */
void func_8038A7F0(void){
if( map_get() != MAP_27_FP_FREEZEEZY_PEAK
|| jiggyscore_isCollected(JIGGY_31_FP_SIR_SLUSH)
|| jiggyscore_isSpawned(JIGGY_31_FP_SIR_SLUSH)
){
D_80392F30.unk0 = 0;
return;
}
D_80392F30.unk1C = 0;
if(func_80304E24(0x128, D_80392F30.spawn_pos)){
D_80392F30.unk1C = 1;
}
D_80392F30.unk0 = 1;
D_80392F30.unk4 = 0;
D_80392F30.unk8 = 0;
}
void func_8038A888(void){}
void func_8038A890(void){
switch(D_80392F30.unk0){
case 0:
break;
case 1://L8038A8CC
if(D_80392F30.unk4) break;
if(!D_80392F30.unk8) break;
D_80392F30.unk0 = 2;
D_80392F30.unkC = 0;
break;
case 2://L8038A8F4
if(D_80392F30.unkC >= 0x4b){
if(D_80392F30.unk1C){
func_802BAFE4(0x12);
jiggySpawn(JIGGY_31_FP_SIR_SLUSH, D_80392F30.spawn_pos);
func_802C3F04(func_802C4140, ACTOR_4C_STEAM,
reinterpret_cast(s32, D_80392F30.spawn_pos[0]),
reinterpret_cast(s32, D_80392F30.spawn_pos[1]),
reinterpret_cast(s32, D_80392F30.spawn_pos[2])
);
}
D_80392F30.unk0 = 3;
}
else{
D_80392F30.unkC++;
}
break;
case 3://L8038A96C
break;
}
}
void func_8038A978(void){
D_80392F30.unk4--;
}
void func_8038A990(void){
D_80392F30.unk8++;
D_80392F30.unk4++;
}

79
src/FP/code_45D0.c Normal file
View File

@@ -0,0 +1,79 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
u8 unk0;
// u8 pad1[3];
s32 unk4;
s32 unk8;
f32 spawn_pos[3];
u8 unk18;
} Struct_FP_45D0_0;
extern Struct_FP_45D0_0 D_80392F50;
/* .code */
void func_8038A9C0(void){
if( map_get() != MAP_27_FP_FREEZEEZY_PEAK
|| jiggyscore_isCollected(JIGGY_2D_FP_SNOWMAN_BUTTONS)
|| jiggyscore_isSpawned(JIGGY_2D_FP_SNOWMAN_BUTTONS)
){
D_80392F50.unk0 = 0;
return;
}
D_80392F50.unk18 = 0;
if(func_80304E24(0x15E, D_80392F50.spawn_pos)){
D_80392F50.unk18 = 1;
}
D_80392F50.unk0 = 1;
D_80392F50.unk4 = 3;
}
void func_8038AA58(void){}
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_45D0/func_8038AA60.s")
#else
void func_8038AA60(void){
switch(D_80392F50.unk0){
// case 0:
// break;
case 1:
if(D_80392F50.unk4 <= 0){
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
D_80392F50.unk0 = 2;
D_80392F50.unk8 = 0;
}
break;
case 2://L8038A8F4
if(D_80392F50.unk8 >= 0x1e){
if(D_80392F50.unk18){
func_802BAFE4(0x11);
jiggySpawn(JIGGY_2D_FP_SNOWMAN_BUTTONS, D_80392F50.spawn_pos);
func_802C3F04(func_802C4140, ACTOR_4C_STEAM,
reinterpret_cast(s32, D_80392F50.spawn_pos[0]),
reinterpret_cast(s32, D_80392F50.spawn_pos[1]),
reinterpret_cast(s32, D_80392F50.spawn_pos[2])
);
}
D_80392F50.unk0 = 3;
}
else{
D_80392F50.unk8++;
}
break;
case 3://L8038A96C
break;
}
}
#endif
void func_8038AB40(void){
D_80392F50.unk4--;
}

611
src/FP/code_4770.c Normal file
View File

@@ -0,0 +1,611 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028F710(s32, f32);
typedef struct {
ActorMarker *marker;
f32 position[3];
f32 unk10;
}Struct_FP_4770;
/* .data */
extern f32 D_80391ED0[3];
extern f32 D_80391EDC;
extern f32 D_80391EE0[3];
extern f32 D_80391EEC;
extern f32 D_80391EF0[3];
extern f32 D_80391EFC;
extern f32 D_80391F00[3];
extern f32 D_80391F0C;
extern f32 D_80391F10[3];
extern f32 D_80391F1C;
extern f32 D_80391F20[3];
extern f32 D_80391F2C[3];
extern f32 D_80391F38[3];
/* .bss */
extern ActorMarker *D_80393590[5];
extern struct {
u8 unk0;
// u8 pad1[0x3];
s32 unk4;
s32 unk8;
s32 unkC;
s32 unk10;
ActorMarker *unk14;
u8 unk18;
u8 unk19;
u8 unk1A;
}D_803935A8;
extern Struct_FP_4770 D_80392F70[0x27];
extern Struct_FP_4770 D_80393280[0x27];
/* .code */
void func_8038AB60(s32 arg0){
int i;
func_8028F8F8(0xe, arg0 ^ 1);
for (i = 0x14; i < 0x23; i++){
func_8028F8F8(i, arg0);
}
for (i = 0x32; i < 0x38; i++){
func_8028F8F8(i, arg0);
}
}
void func_8038ABDC(void){
comusic_8025AB44(COMUSIC_3A_FP_BOGGY_RACE, 0, 4000);
func_8025AABC(COMUSIC_3A_FP_BOGGY_RACE);
func_8025A58C(-1, 4000);
func_8024BD08(1);
}
void func_8038AC20(s32 gate_indx, s32 arg1){
Actor *a1;
Actor *a2;
a1 = marker_getActor(D_80392F70[gate_indx].marker);
a2 = marker_getActor(D_80393280[gate_indx].marker);
a1->velocity[0] = (f32)arg1;
a2->velocity[0] = (f32)arg1;
}
//spawn race flag pair
void func_8038AC90(s32 indx, s32 arg1){
ActorMarker *m1;
ActorMarker *m2;
Actor *a1;
Actor *a2;
m1 = func_8032813C(0x161, D_80392F70[indx].position, 0)->marker;
m2 = func_8032813C(0x162, D_80393280[indx].position, 0)->marker;
a1 = marker_getActor(m1);
a2 = marker_getActor(m2);
a1->unk38_31 = 1;
a2->unk38_31 = 1;
a1->unkF4_8 = indx + 1;
a2->unkF4_8 = indx + 1;
D_80392F70[indx].marker = a1->marker;
D_80393280[indx].marker = a2->marker;
func_8038AC20(indx, arg1);
a1->unk1C[0] = a2->position_x;
a1->unk1C[1] = a2->position_y;
a1->unk1C[2] = a2->position_z;
if(indx + 1 == 0x27){
a1->velocity[1] = 1.0f;
a2->velocity[1] = 1.0f;
}
}
void func_8038ADE4(s32 indx, s32 arg1){
func_802C3D3C(func_8038AC90, indx, arg1);
}
void func_8038AE14(s32 indx){
if(D_80392F70[indx].marker){
func_80326310(marker_getActor(D_80392F70[indx].marker));
D_80392F70[indx].marker = NULL;
}
if(D_80393280[indx].marker){
func_80326310(marker_getActor(D_80393280[indx].marker));
D_80393280[indx].marker = NULL;
}
}
void func_8038AEA0(void){
int i;
for(i = 0; i < 0x27; i++){
func_8038AE14(i);
}
}
void func_8038AEE0(s32 indx){
Actor *sp1C;
switch(indx){
case 0:// L8038AF0C
sp1C = func_8032813C(0x22d, D_80391ED0, D_80391EDC);
break;
case 1:// L8038AF38
sp1C = func_8032813C(0x22e, D_80391EE0, D_80391EEC);
break;
case 2:// L8038AF64
sp1C = func_8032813C(0x22d, D_80391EF0, D_80391EFC);
break;
case 3:// L8038AF90
sp1C = func_8032813C(0x22d, D_80391F00, D_80391F0C);
break;
case 4:// L8038AFBC
sp1C = func_8032813C(0x22d, D_80391F10, D_80391F1C);
break;
}
D_80393590[indx] = sp1C->marker;
}
void func_8038B00C(s32 indx){
func_802C3C88(func_8038AEE0, indx);
}
void func_8038B034(void){
int i;
for(i = 0; i < 5; i++){
func_8038B00C(i);
}
}
void func_8038B074(s32 indx){
if(D_80393590[indx]){
marker_despawn(D_80393590[indx]);
D_80393590[indx] = NULL;
}
}
void func_8038B0B8(void){
int i;
for(i = 0; i < 5; i++){
func_8038B074(i);
}
}
void func_8038B0F8(void){
Actor *trainers = func_8032813C(ACTOR_2C_TURBO_TALON_TRAINERS, D_80391F20, 100);
trainers->unk10_1 = FALSE;
}
void func_8038B130(enum jiggy_e jiggy_id){
if(jiggy_id == JIGGY_2C_FP_BOGGY_3 && !jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){
jiggySpawn(jiggy_id, D_80391F38);
}
else{
jiggySpawn(jiggy_id, D_80391F2C);
}
}
void func_8038B190(void){
func_8028F66C(0x2B);
mapSpecificFlags_set(4, FALSE);
func_8028F918(0);
}
void func_8038B1C4(void){
D_803935A8.unk0 = 0;
}
void func_8038B1D0(enum jiggy_e jiggy_id){
timed_setCameraToNode(0.0f, 3);
timedFunc_set_0(0.0f, func_8038AEA0);
timedFunc_set_0(0.0f, func_8038B0B8);
timedFunc_set_1(0.1f, (TFQM1) func_8038B130, jiggy_id);
timedFunc_set_0(5.0f, func_8038B190);
timedFunc_set_0(5.0f, func_8038B1C4);
func_80324E88(5.0f);
}
void func_8038B268(void){
func_80324E88(0.0f);
timedFunc_set_0(0.0f, func_8038AEA0);
timedFunc_set_0(0.0f, func_8038B0B8);
func_8028FA14(map_get(), 0x11);
func_8028F66C(0x2A);
}
void func_8038B2C8(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *actor;
if(D_803935A8.unk14){
actor = marker_getActor(D_803935A8.unk14);
}
switch(text_id){
case 0xc04: //8038B318
func_8038B268();
break;
case 0xc07: //8038B328
func_8038B1D0(JIGGY_30_FP_BOGGY_2);
break;
case 0xc0b: //8038B338
func_8038B268();
break;
case 0xc0d: //8038B348
func_8038B1D0(JIGGY_2C_FP_BOGGY_3);
break;
case 0xc10: //8038B358
func_8038ABDC();
func_8028FA14(map_get(), 0x11);
func_8028F66C(0x2A);
timedFunc_set_0(0.0f, func_8038B1C4);
break;
}//L8038B38C
}
void func_8038B39C(void){
if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2) && func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS){
func_8028F710(3, 2.0f);
}
func_8028F918(1);
func_8025A6EC(COMUSIC_3B_MINIGAME_VICTORY, 28000);
func_8038AB60(0);
func_8038ABDC();
timed_setCameraToNode(0.0f, 1);
}
void func_8038B410(void){
Actor *sp2C;
func_8028F918(2);
if(D_803935A8.unk14)
sp2C = marker_getActor(D_803935A8.unk14);
sp2C->unk38_31 = 1;
func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 28000);
func_8038AB60(0);
func_8038ABDC();
if(!jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){
timed_setCameraToNode(0.0f, 1);
timed_playSfx(1.0f, SFX_8C_BOGGY_WAHEY, 1.0f, 32000);
func_80324DBC(2.0f, 0xC04, 0x2b, sp2C->position, NULL, func_8038B2C8, NULL);
}//L8038B4E0
else{
timed_setCameraToNode(0.0f, 1);
timed_playSfx(1.0f, SFX_8C_BOGGY_WAHEY, 1.0f, 32000);
func_80324DBC(2.0f, 0xC0b, 0x2b, sp2C->position, NULL, func_8038B2C8, NULL);
}
}
void func_8038B544(void){
Actor *sp2C;
int i;
f32 f2;
f32 f0;
switch(D_803935A8.unk0){
case 1: //L8038B57C
if(D_803935A8.unk4 < 0x4e) break;
for(i = 0; i < 0x27; i++){
if(i < 0x26){
f0 = D_80392F70[i+1].position[2] - D_80392F70[i].position[2];
f2 = D_80392F70[i+1].position[0] - D_80392F70[i].position[0];
D_80392F70[i].unk10 = f0*f0 + f2*f2;
}
if(D_80392F70[0x26].unk10 < D_80392F70[i].unk10)
D_80392F70[0x26].unk10 = D_80392F70[i].unk10;
}
func_8038AEA0();
D_803935A8.unk0 = NULL;
break;
case 2: //L8038B61C
if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2) && func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS){
func_8028F710(3, 20.0f);
}
if(D_80392F70[0x26].marker == NULL) break;
if(3.0f == marker_getActor(D_80392F70[0x26].marker)->velocity[0]){
func_8038B39C();
D_803935A8.unk0 = 3;
break;
}
if(D_803935A8.unk10){
func_8038B410();
D_803935A8.unk0 = 4;
}
break;
case 3: //L8038B6C4
if(D_803935A8.unk14){
sp2C = marker_getActor(D_803935A8.unk14);
}
sp2C->unk38_31 = 2;
timed_playSfx(1.0f, SFX_8D_BOGGY_OHWW, 1.0f, 32000);
if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2) || jiggyscore_isSpawned(JIGGY_30_FP_BOGGY_2)){
func_80324DBC(2.0f, 0xc0d, 0x2a, sp2C->position, NULL, func_8038B2C8, NULL);
}
else{
func_80324DBC(2.0f, 0xc07, 0x22, sp2C->position, NULL, func_8038B2C8, NULL);
}
D_803935A8.unk0 = 4;
break;
}//L8038B794
}
void func_8038B7A4(void){
int i;
func_8038AB60(0);
if(map_get() != MAP_27_FP_FREEZEEZY_PEAK || jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3)){
D_803935A8.unk0 = 0;
return;
}
D_803935A8.unk0 = 1;
D_803935A8.unk14 = NULL;
D_803935A8.unk4 = 0;
D_803935A8.unk8 = -1;
D_803935A8.unkC = -1;
D_803935A8.unk10 = 0;
D_803935A8.unk18 = 0;
D_803935A8.unk19 = 0;
D_803935A8.unk1A = 0;
for(i = 0; i < 0x27; i++){
D_80392F70[i].marker = NULL;
D_80393280[i].marker = NULL;
D_80392F70[i].position[0] = D_80392F70[i].position[1] = D_80392F70[i].position[2] = 0.0f;
D_80393280[i].position[0] = D_80393280[i].position[1] = D_80393280[i].position[2] = 0.0f;
D_80392F70[i].unk10 = 0.0f;
D_80393280[i].unk10 = 0.0f;
}
for(i = 0; i < 5; i++){
D_80393590[i] = NULL;
}
}
void func_8038B8A8(){}
void func_8038B8B0(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
s32 tmp_a0;
tmp_a0 = actor->unkF4_8 - 1;
if(tmp_a0 < 0x27){
D_80392F70[tmp_a0].marker = actor->marker;
D_80392F70[tmp_a0].position[0] = actor->position[0];
D_80392F70[tmp_a0].position[1] = actor->position[1];
D_80392F70[tmp_a0].position[2] = actor->position[2];
D_803935A8.unk4++;
}//L8038B920
}
void func_8038B930(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
s32 tmp_a0;
tmp_a0 = actor->unkF4_8 - 1;
if(tmp_a0 < 0x27){
D_80393280[tmp_a0].marker = actor->marker;
D_80393280[tmp_a0].position[0] = actor->position[0];
D_80393280[tmp_a0].position[1] = actor->position[1];
D_80393280[tmp_a0].position[2] = actor->position[2];
D_803935A8.unk4++;
}//L8038B9A0
}
void func_8038B9B0(ActorMarker *marker){
D_803935A8.unk14 = marker;
}
void func_8038B9BC(void){
D_803935A8.unk14 = NULL;
}
void func_8038B9C8(void){
int i;
func_8038ADE4(0, 1);
for(i = 1; i < 4; i++){
func_8038ADE4(i, 2);
}
func_8038ADE4(0x26, 2);
func_8038B034();
if(jiggyscore_isSpawned(JIGGY_30_FP_BOGGY_2) || jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){
func_802C3BF8(func_8038B0F8);
}
D_803935A8.unk8 = -1;
D_803935A8.unkC = -1;
D_803935A8.unk10 = 0;
D_803935A8.unk18 = 0;
D_803935A8.unk19 = 0;
D_803935A8.unk1A = 0;
func_8038AB60(1);
D_803935A8.unk0 = 2;
}
void func_8038BA88(s32 arg0){
D_803935A8.unk8 = --arg0;
func_8038AC20(arg0, 3);
if(arg0 + 1 < 39){
func_8038AC20(arg0 + 1, 1);
}
if(arg0 + 4 < 38){
func_8038ADE4(arg0 + 4, 2);
}
if(arg0 >= 2){
func_8038AE14(arg0 - 2);
}
if(arg0 + 4 < 11){
func_8028F8F8(20, 1);
func_8028F8F8(20, 1);
func_8028F8F8(21, 1);
func_8028F8F8(22, 1);
func_8028F8F8(30, 0);
}
else{
func_8028F8F8(20, 0);
func_8028F8F8(21, 0);
func_8028F8F8(22, 0);
func_8028F8F8(30, 1);
}
switch(D_803935A8.unkC - D_803935A8.unk8){
case 3:
func_8025AEA0(0x3a, 0x411aa);
break;
case 2:
func_8025AEA0(0x3a, 0x493e0);
break;
case 4:
break;
default:
func_8025AEA0(0x3a, 0x51615);
break;
}
}
void func_8038BC0C(s32 arg0){
if(D_803935A8.unkC - D_803935A8.unk8 < 4 || 0x23 < D_803935A8.unkC){
if(D_803935A8.unk14)
marker_getActor(D_803935A8.unk14);
if(func_8038A1A0(D_803935A8.unk14))
return;
D_803935A8.unkC = arg0-1;
if(D_803935A8.unkC >= 0x26){
D_803935A8.unk10 = 1;
return;
}
if(D_803935A8.unk0 == 3) return;
if(D_803935A8.unk0 == 4) return;
if(D_803935A8.unkC >= 0x25) return;
switch(D_803935A8.unkC - D_803935A8.unk8){
case 4:
if(D_803935A8.unk1A)
break;
D_803935A8.unk1A = TRUE;
func_8038AB60(0);
if(!func_8028F22C()){
func_8028F918(2);
func_80311480(0xc10, 0x20, NULL, NULL, func_8038B2C8, NULL);
}//L8038BD40
D_803935A8.unk0 = 4;
break;
case 3:
if(!D_803935A8.unk19 && !func_8028F22C()){
D_803935A8.unk19 = 1;
func_80311480(0xc0f, 0x20, NULL, NULL, NULL, NULL);
}//L8038BD94
func_8025AEA0(0x3a, 0x411aa);
break;
case 2:
if(!D_803935A8.unk18 && !func_8028F22C()){
D_803935A8.unk18 = 1;
func_80311480(0xc0e, 0x20, NULL, NULL, NULL, NULL);
}//L8038BDF0
func_8025AEA0(0x3a, 0x493e0);
break;
default:
func_8025AEA0(0x3a, 0x51615);
break;
}
}
}
f32 func_8038BE20(f32 arg0[3]){
f32 sp38[4];
f32 f18;
f32 sp30;
f32 sp2C;
f32 tmp_f12;
tmp_f12 = (f32)(D_803935A8.unkC - D_803935A8.unk8);
if(D_803935A8.unk0 != 2 || D_803935A8.unkC < 0 || D_803935A8.unk8 < 0)
return 0.0f;
if(tmp_f12 == 0.0f){
player_getPosition(sp38);
f18 = D_80392F70[D_803935A8.unkC].unk10;
if( 0.0 == f18 )
return 0.5f;
sp30 = ((arg0[0] - D_80392F70[D_803935A8.unkC].position[0])*(D_80392F70[D_803935A8.unkC+1].position[0] - D_80392F70[D_803935A8.unkC].position[0]) + (arg0[2] - D_80392F70[D_803935A8.unkC].position[2])*(D_80392F70[D_803935A8.unkC+1].position[2] - D_80392F70[D_803935A8.unkC].position[2]))/f18;
sp2C = ((sp38[0] - D_80392F70[D_803935A8.unkC].position[0])*(D_80392F70[D_803935A8.unkC+1].position[0] - D_80392F70[D_803935A8.unkC].position[0]) + (sp38[2] - D_80392F70[D_803935A8.unkC].position[2])*(D_80392F70[D_803935A8.unkC+1].position[2] - D_80392F70[D_803935A8.unkC].position[2]))/f18;
return -(sp30 - sp2C);
}//L8038BF58
tmp_f12 += (tmp_f12 < 0.0f) ? -0.5 : 0.5;
return -tmp_f12;
}
bool func_8038BFA0(void){
if ( D_803935A8.unk0 == 2
|| D_803935A8.unk0 == 3
|| D_803935A8.unk0 == 4
|| D_803935A8.unk1A
){
return TRUE;
}
return FALSE;
}
bool func_8038BFE8(f32 arg0[3], s32 arg1){
Actor *actor;
if(D_803935A8.unk14){
actor = marker_getActor(D_803935A8.unk14);
}
else{
return FALSE;
}
if( (actor->position[0] - arg0[0])*(actor->position[0] - arg0[0])
+ (actor->position[1] - arg0[1])*(actor->position[1] - arg0[1])
+ (actor->position[2] - arg0[2])*(actor->position[2] - arg0[2])
< arg1*arg1
){
return TRUE;
}
return FALSE;
}
s32 func_8038C098(void){
return D_803935A8.unk10;
}

93
src/FP/code_4D0.c Normal file
View File

@@ -0,0 +1,93 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
Actor *func_803868C0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_80386AA4(Actor *this);
/* .data */
ActorAnimationInfo D_80391A40 []= {
{ ASSET_1A1_ANIM_SLED, 1.0f},
{ ASSET_1A1_ANIM_SLED, 1.0f},
{ ASSET_1A1_ANIM_SLED, 1.0f},
{ ASSET_1A1_ANIM_SLED, 1.0f}
};
ActorInfo D_80391A60 = {
MARKER_3C_RACE_SLED, ACTOR_182_RACE_SLED, ASSET_352_MODEL_SLED,
0x0, D_80391A40,
func_80386AA4, NULL, func_803868C0,
1000, 0, 0.0f, 0
};
/* .code */
Actor *func_803868C0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if(this->unk10_12 == FALSE){
return func_80325888(marker, gfx, mtx, vtx);
}
return this;
}
void func_80386920(Actor *this, s32 next_state){
if(this->state != 1 || next_state != 1){
func_80328A84(this, next_state);
switch(next_state){
case 1: //L8038697C
this->unk10_12 = TRUE;
this->marker->propPtr->unk8_3 = FALSE;
break;
case 2: //L803869A4
this->unk10_12 = FALSE;
this->marker->propPtr->unk8_3 = TRUE;
break;
case 3: //L803869CC
this->unk10_12 = TRUE;
this->marker->propPtr->unk8_3 = FALSE;
break;
}
}
}
void func_803869FC(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
f32 plyr_pos[3];
if(this->state == 2){
player_getPosition(plyr_pos);
if( this->position_y + 20.0f < plyr_pos[1]
&& func_8028F20C()
&& player_getTransformation() == TRANSFORM_4_WALRUS
&& func_8028F68C(0x29, this->marker)
){
func_80386920(this, 3); //start_race
}
}
}
void func_80386AA4(Actor *this){
s32 sp24;
if(!this->initialized){
this->initialized = TRUE;
marker_setCollisionScripts(this->marker, func_803869FC, NULL, NULL);
func_80386920(this, 1);
}
sp24 = mapSpecificFlags_get(4);
if(sp24 == 0){
func_80386920(this, 1);
}
switch (this->state){
case 1://L80386B38
if(sp24){
func_80386920(this, 2);
}
break;
case 3://L80386B50
if(func_8028ECAC() != BSGROUP_C_WALRUS_SLED){
func_80386920(this, 2);
}
break;
}
}

392
src/FP/code_5CC0.c Normal file
View File

@@ -0,0 +1,392 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern Actor *func_802EBAE0(UNK_TYPE(s32), f32 position[3], f32 rotation[3], f32 scale, UNK_TYPE(s32), UNK_TYPE(s32), UNK_TYPE(s32), f32, UNK_TYPE(s32));
Actor *func_8038C1F8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038C9A0(Actor *this);
/* .data */
extern ActorAnimationInfo D_80391F50[];
extern ActorInfo D_80391F88 = { MARKER_200_TWINKLY_BLUE, ACTOR_332_TWINKLY_BLUE, ASSET_448_MODEL_TWINKLY_BLUE,
0x1, D_80391F50,
func_8038C9A0, func_80326224, func_8038C1F8,
0, 0, 1.0f, 0
};
extern ActorInfo D_80391FAC = { MARKER_201_TWINKLY_GREEN, ACTOR_333_TWINKLY_GREEN, ASSET_449_MODEL_TWINKLY_GREEN,
0x1, D_80391F50,
func_8038C9A0, func_80326224, func_8038C1F8,
0, 0, 1.0f, 0
};
extern ActorInfo D_80391FD0 = { MARKER_202_TWINKLY_ORANGE, ACTOR_334_TWINKLY_ORANGE, ASSET_44A_MODEL_TWINKLY_ORANGE,
0x1, D_80391F50,
func_8038C9A0, func_80326224, func_8038C1F8,
0, 0, 1.0f, 0
};
extern ActorInfo D_80391FF4 = { MARKER_203_TWINKLY_RED, ACTOR_335_TWINKLY_RED, ASSET_44B_MODEL_TWINKLY_RED,
0x1, D_80391F50,
func_8038C9A0, func_80326224, func_8038C1F8,
0, 0, 1.0f, 0
};
extern s32 D_80392018[4];
extern struct43s D_80392028;
extern f32 D_80392070[3];
extern f32 D_8039207C[3];
extern f32 D_80392088[3];
extern f32 D_80392094[3];
extern s32 D_803920A0[4];
extern s32 D_803920B0[4];
extern f64 D_80392D80;
extern f64 D_80392D88;
extern f64 D_80392D90;
extern f32 D_80392D98;
extern f32 D_80392D9C;
extern f32 D_80392DA0;
extern f32 D_80392DA4;
extern f32 D_80392DA8;
extern f32 D_80392DAC;
extern f32 D_80392DB0;
extern f64 D_80392DB8;
extern f64 D_80392DC0;
extern f64 D_80392DC8;
// C00999999999999A
// C00999999999999A
// 3FEFFFEB074A771D
// 3F99999A
// 3FA66666
// 44DAC000
// 455AC000
// 3FB33333
// 44DAC000
// 455AC000
// C00999999999999A
// 3FEFFF2E48E8A71E
// 3FEFFFFDE7210BE9
/* .code */
Actor *func_8038C0B0(ActorMarker *marker, UNK_TYPE(s32) arg1, f32 arg2, UNK_TYPE(s32) arg3){
UNK_TYPE(s32) sp5C = func_8033A12C(func_80330B1C(marker));
Actor *this = marker_getActor(marker);
f32 sp4C[3];
f32 sp40[3];
f32 sp3C;
sp4C[0] = (f32)marker->propPtr->x;
sp4C[1] = (f32)marker->propPtr->y;
sp4C[2] = (f32)marker->propPtr->z;
sp40[0] = (f32)marker->pitch;
sp40[1] = this->unk60;
sp40[2] = (f32)marker->roll;
sp3C = this->scale;
if(func_802EA190(marker->unk20)){
return func_802EBAE0(sp5C, sp4C, sp40, sp3C, NULL, marker->unk20, arg1, arg2, arg3);
}
else{
return NULL;
}
}
Actor *func_8038C1F8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
func_8033A45C(2, this->unk38_31);
func_8033A45C(1, func_8033A0F0(2) ^ 1);
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038C260(f32 position[3], s32 count, enum asset_e model_id){
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
particleEmitter_setModel(pCtrl, model_id);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80392028);
func_802EFE24(pCtrl,
400.0f, 400.0f, 400.0f,
800.0f, 800.0f, 800.0f
);
func_802EFB70(pCtrl, 0.1f, 0.2f);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.02f);
func_802EFEC0(pCtrl, 1.5f, 1.5f);
func_802EFA5C(pCtrl, 0.0f, 0.3f);
func_802EF9F8(pCtrl, 0.6f);
func_802EFA18(pCtrl, 0);
func_802EFA20(pCtrl, 1.0f, 1.3f);
func_802EF9EC(pCtrl, 0x7B, 8000);
particleEmitter_emitN(pCtrl, count);
}
void func_8038C398(f32 position[3], enum marker_e marker_id){
enum asset_e sp1C;
switch(marker_id){
case MARKER_200_TWINKLY_BLUE:
sp1C = ASSET_497_MODEL_TWINKLY_SHARD_BLUE;
break;
case MARKER_201_TWINKLY_GREEN:
sp1C = ASSET_499_MODEL_TWINKLY_SHARD_GREEN;
break;
case MARKER_202_TWINKLY_ORANGE:
sp1C = ASSET_49A_MODLE_TWINKLY_SHARD_ORANGE;
break;
case MARKER_203_TWINKLY_RED:
sp1C = ASSET_49B_MODLE_TWINKLY_SHARD_RED;
break;
}
func_8038C260(position, 12, sp1C);
func_8038C260(position, 4, ASSET_498_MODEL_TWINKLY_SHARD_YELLOW);
}
#ifndef NONMATCHING
void func_8038C428(Actor *this, f32 arg1[3], f32 arg2);
#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_5CC0/func_8038C428.s")
#else
void func_8038C428(Actor *this, f32 arg1[3], f32 arg2) {
u8 sp7F;
s32 sp78;
f32 sp74;
f32 sp70;
f32 sp5C[3];
f32 sp54;
f32 sp50;
f32 sp48;
f32 temp_f0_2;
f32 phi_f22;
f32 phi_f24;
f32 phi_f16;
s32 phi_v0;
s32 phi_v1;
sp74 = arg2;
sp70 = this->position[1];
phi_v1 = (arg2 == 0.0f) ? FALSE : TRUE;
phi_f22 = arg1[0] - this->position[0];
phi_f24 = arg1[2] - this->position[2];
sp78 = 0;
sp48 = phi_f22 / sp54;
sp50 = phi_f24 / sp54;
sp54 = gu_sqrtf((phi_f22 * phi_f22) + (phi_f24 * phi_f24));
if (sp7F = phi_v1) {
temp_f0_2 = randf2(130.0f, 150.0f);
if (!(sp54 < temp_f0_2)) {
sp54 = temp_f0_2;
}
phi_f22 = sp48 * sp54;
phi_f24 = sp50 * sp54;
}
sp5C[0] = this->position[0] + phi_f22;
sp5C[1] = this->position[1];
sp5C[2] = this->position[2] + phi_f24;
sp78 = 0;
if (sp7F) {
do {
// sp70 += arg2 += D_80392D80;
// sp70 += arg2 += D_80392D80;
sp70 += arg2 += -3.2;
sp78++;
} while (func_80309724(sp5C) < sp70 || arg2 > 0.0f);
} else {
sp74 = (f32) ((f64) (((arg1[1] + 40.0f) - this->position[1]) / 28.0f) - (-3.2 * (f64) 28.0f * 0.5));
sp78 = 0x1C;
}
animctrl_setAnimTimer(this->animctrl, 0.0f);
this->unk1C[0] = D_80392D90 / sp78;
this->velocity[1] = sp74;
this->velocity[0] = phi_f22 / sp78;
this->velocity[2] = phi_f24 / sp78;
if (sp7F) {
func_8030E878(SFX_3F2_UNKNOWN, randf2(D_80392D98, D_80392D9C), 32000, this->position, D_80392DA0, D_80392DA4);
}
else{
func_8030E878(SFX_53_BANJO_HUIII, randf2(D_80392DA8, 1.5f), 32000, this->position, D_80392DAC, D_80392DB0);
}
}
#endif
bool func_8038C718(Actor *this, f32 arg1){
f32 tmp;
this->position[0] += this->velocity[0];
this->position_y += (this->velocity_y += D_80392DB8);
this->position_z += this->velocity_z;
tmp = D_80392DC0 < animctrl_getAnimTimer(this->animctrl) + this->unk1C[0] ? D_80392DC8 : animctrl_getAnimTimer(this->animctrl) + this->unk1C[0];
animctrl_setAnimTimer(this->animctrl, tmp);
if(arg1 == 0.0f)
arg1 = func_80309724(this->position);
if(this->position_y <= arg1){
this->position_y = arg1;
return FALSE;
}
return TRUE;
}
bool func_8038C844(f32 arg0[3], f32 arg1[3]){
if( (arg0[0] - arg1[0] < 26.0f && -26.0f < arg0[0] - arg1[0])
&& (arg0[1] - arg1[1] < 26.0f && -26.0f < arg0[1] - arg1[1])
&& (arg0[2] - arg1[2] < 26.0f && -26.0f < arg0[2] - arg1[2])
){
return TRUE;
}
return FALSE;
}
void func_8038C8F0(ActorMarker *marker){
Actor *this;
Actor *muncher;
Actor *other;
s32 pad;
this = marker_getActor(reinterpret_cast(ActorMarker *, marker));
other = marker_getActor(this->unk100);
muncher = func_8032813C(ACTOR_337_TWINKLY_MUNCHER, D_80392070, 170);
muncher->unk100 = other->marker;
muncher->unkF4_8 = 1;
if(pad);
}
void func_8038C94C(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
if(!func_803203FC(0xC1)){
func_80328A84(this, 6);
func_802C3C88(func_8038C8F0, this->marker);
}
}
#ifndef NONAMTCHING
#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_5CC0/func_8038C9A0.s")
#else
void func_8038C9A0(Actor *this){
Actor *other; //sp34
void * sp30;
if(this->marker->unk14_20 == 0x200){
sp30 = func_8034C2C4(this->marker, 0x190);
}
other = marker_getActor(this->unk100);
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->unk18 = &D_80392018;
this->unk38_31 = 0;
if(0.0f != other->velocity[0]){
func_80328A84(this, 4);
this->unk1C[1] = this->position_y + 50.0f;
this->unk1C[2] = this->position_y;
}
else{
this->velocity_x = 0.0f;
this->velocity_y = 0.0f;
this->velocity_z = 0.0f;
this->unk1C[0] = 0.0f;
animctrl_setAnimTimer(this->animctrl, 0.0f);
func_8038C428(this, &D_8039207C, 0);
return;
}
}//L8038CA9C
if(1.0f == other->unk1C[1]){
func_8038C398(this->position, this->marker->unk14_20);
FUNC_8030E8B4(SFX_7B_ICE_BREAKING_1, 1.0f, 32000, this->position, 0x6d6, 0xdac);\
marker_despawn(this->marker);
return;
}//L8038CB04
switch(this->state){
case 1:// 8038CB2C
if(func_8038C718(this, 0))
break;
func_80328B8C(this, 2, 0.001f, 1);
func_8038C428(this, D_80392088, randf2(20.0f, 24.0f));
this->unk60 = this->yaw;
break;
case 2:// 8038CB8C
this->yaw += 4.0f;
if(actor_animationIsAt(this, 0.999)){
func_8034DFB0(sp30, D_803920A0, D_803920B0, 0.14f);
}
if(actor_animationIsAt(this, 0.8f)){
func_8034DFB0(sp30, D_803920B0, D_803920A0, 0.14f);
}
if(0.8 < animctrl_getAnimTimer(this->animctrl) || animctrl_getAnimTimer(this->animctrl) < 0.2){
this->unk38_31 = TRUE;
}
else{
this->unk38_31 = FALSE;
}
if(func_8038C718(this, 0.0f))
return;
if(func_8038C844(this->position, D_80392088)){
func_80328B8C(this, 3, 0.001f, 1);
func_8038C428(this, D_80392094, 0.0f);
}
else{
func_8038C428(this, D_80392088, randf2(20.0f, 24.0f));
}
break;
case 3:// 8038CCFC
if(func_8038C718(this, 0.0f))
break;
if(other->unk38_31 != 0){
other->unk38_31--;
}
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
marker_despawn(this->marker);
break;
case 4:// 8038CD58
this->position_y += 3.0f;
if(this->unk1C[1] <= this->position_y){
this->position_y = this->unk1C[1];
if(!func_8031FF1C(0x82)){
func_80311480(0xc12, 0x2a, this->position, this->marker, func_8038C94C, NULL);
func_80320004(0x82, TRUE);
}
else{
func_80311480(0xc25, 0x2b, this->position, this->marker, func_8038C94C, NULL);
}
func_80328A84(this, 5);
this->pitch -= 3.0f;
}
break;
case 5:// 8038CE14
this->yaw_moving = (f32)func_80329784(this);
func_80328FB0(this, 8.0f);
if(func_8038C718(this, this->unk1C[1]))
break;
this->velocity[1] = randf2(14.0f, 20.0f);
break;
case 6:// 8038CE64
this->position_y -= 5.0f;
if(this->position_y < this->unk1C[2] - 50.0f){
this->velocity_x = 0.0f;
marker_despawn(this->marker);
return;
}
break;
}//L8038CEB0
}
#endif

445
src/FP/code_6AE0.c Normal file
View File

@@ -0,0 +1,445 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_80324CD8(f32);
extern Actor *func_8032813C(enum actor_e, f32[3], s32);
Actor *func_8038CED0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038D6C8(Actor *this);
/* .data */
ActorAnimationInfo D_803920C0[] ={
{0x000, 0.0f},
{0x16D, 10000000.0f},
{0x237, 2.0f},
{0x16D, 0.8f},
{0x16D, 0.8f}
};
ActorInfo D_803920E8 = { 0x204, 0x336, 0x442,
0x1, D_803920C0,
func_8038D6C8, func_80326224, func_8038CED0,
0, 0, 0.0f, 0
};
struct31s D_8039210C = {
{ 0.4f, 0.8f },
{-1.0f, -1.0f },
{ 0.0f, 0.02f},
{ 1.8f, 2.2f },
0.0f,
0.7f
};
struct43s D_80392134 = {
{{-200.0f, 200.0f, -200.0f}, {200.0f, 400.0f, 200.0f}},
{{ 0.0f, -800.0f, 0.0f}, { 0.0f, -800.0f, 0.0f}},
{{-100.0f, 0.0f, -100.0f}, {100.0f, 100.0f, 100.0f}}
};
struct31s D_8039217C = {
{0.8f, 1.2f },
{1.4f, 2.0f },
{0.0f, 0.01f},
{1.2f, 1.8f },
0.0f,
0.01f
};
s32 D_803921A4[3] = { 0xDC, 0xDC, 0xE6};
struct43s D_803921B0 = {
{{-200.0f, 0.0f, -200.0f}, {200.0f, 200.0f, 200.0f}},
{{ 0.0f, -10.0f, 0.0f}, { 0.0f, -10.0f, 0.0f}},
{{-50.0f, 0.0f, -50.0f}, {50.0f, 200.0f, 50.0f}}
};
struct31s D_803921F8 = {
{ 0.2f, 0.3f },
{-1.0f, -1.0f },
{ 0.0f, 0.02f},
{ 2.0f, 2.5f },
0.0f, 0.3f
};
struct43s D_80392220 = {
{{-300.0f, 400.0f, -300.0f}, {300.0f, 800.0f, 300.0f}},
{{ 0.0f, -800.0f, 0.0f}, { 0.0f, -800.0f, 0.0f}},
{{-80.0f, 80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}}
};
struct31s D_80392268 ={
{ 0.4f, 0.6f },
{-1.0f, -1.0f },
{ 0.0f, 0.02f},
{ 2.0f, 2.5f },
0.0f,
0.3f
};
struct43s D_80392290 = {
{{-300.0f, 400.0f, -300.0f}, {300.0f, 800.0f, 300.0f}},
{{ 0.0f, -800.0f, 0.0f}, { 0.0f, -800.0f, 0.0f}},
{{-80.0f, 80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}}
};
struct31s D_803922D8 = {
{0.5f, 0.7f },
{1.4f, 1.7f },
{0.0f, 0.01f},
{0.6f, 0.9f },
0.0f, 0.01f
};
s32 D_80392300[3] = { 0xDC, 0xDC, 0xE6};
struct43s D_8039230C = {
{{-100.0f, 0.0f, -100.0f}, {100.0f, 100.0f, 100.0f}},
{{0.0f, -10.0f, 0.0f}, {0.0f, -10.0f, 0.0f}},
{{-80.0f, 0.0f, -80.0f}, {50.0f, 200.0f, 80.0f}}
};
f32 D_80392354[3] = {-4165.0f, 73.0f, 4483.0f};
f32 D_80392360[3] = {-4292.0f, 73.0f, 5054.0f};
enum actor_e D_8039236C[4] = {
ACTOR_332_TWINKLY_BLUE,
ACTOR_333_TWINKLY_GREEN,
ACTOR_334_TWINKLY_ORANGE,
ACTOR_335_TWINKLY_RED,
};
f32 D_8039237C[3] = {-3940.0f, 69.0f, 3570.0f};
/* .code */
Actor *func_8038CED0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if( func_8038BFA0() || func_8031FF1C(BKPROG_13) ){
if(0.0f == this->velocity[1])
return this;
}
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038CF54(f32 position[3], s32 count, enum asset_e model_id){
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
particleEmitter_setModel(pCtrl, model_id);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80392134);
func_802EFE24(pCtrl,
100.0f, 100.0f, 100.0f,
200.0f, 200.0f, 200.0f
);
func_802EFB98(pCtrl, &D_8039210C);
func_802EF9F8(pCtrl, 0.6f);
func_802EFA18(pCtrl, 3);
particleEmitter_emitN(pCtrl, count);
}
void func_8038D01C(f32 position[3], s32 count, enum asset_e sprite_id){
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
func_802EFFA8(pCtrl, D_803921A4);
particleEmitter_setSprite(pCtrl, sprite_id);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_803921B0);
func_802EFB98(pCtrl, &D_8039217C);
particleEmitter_emitN(pCtrl, count);
}
void func_8038D0A8(f32 position[3], s32 count, enum asset_e model_id){
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
particleEmitter_setModel(pCtrl, model_id);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80392220);
func_802EFE24(pCtrl,
200.0f, 200.0f, 200.0f,
300.0f, 300.0f, 300.0f
);
func_802EFB98(pCtrl, &D_803921F8);
func_802EF9F8(pCtrl, 0.2f);
func_802EFA18(pCtrl, 2);
particleEmitter_emitN(pCtrl, count);
}
void func_8038D170(f32 position[3], s32 count, enum asset_e sprite_id){
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
particleEmitter_setSprite(pCtrl, sprite_id);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80392290);
func_802EFB98(pCtrl, &D_80392268);
func_802EF9F8(pCtrl, 0.2f);
func_802EFA18(pCtrl, 2);
particleEmitter_emitN(pCtrl, count);
}
void func_8038D208(f32 position[3], s32 count, enum asset_e sprite_id){
ParticleEmitter *pCtrl;
pCtrl = partEmitList_pushNew(count);
func_802EFFA8(pCtrl, D_80392300);
particleEmitter_setSprite(pCtrl, sprite_id);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8039230C);
func_802EFB98(pCtrl, &D_803922D8);
particleEmitter_emitN(pCtrl, count);
}
void func_8038D294(ActorMarker *marker){
Actor *this = marker_getActor(marker);
func_8038CF54(this->position, 12, ASSET_4D4_MODEL_TWINKLY_BOX_PAPER_SHARD);
func_8038D01C(this->position, 12, ASSET_700_SPRITE_DUST);
this->velocity[1] = 0.0f;
FUNC_8030E8B4(SFX_30_MAGIC_POOF, 1.0f, 32000, this->position, 1000, 3500);
func_80311480(0xc13, 0, NULL, NULL, NULL, NULL);
}
void func_8038D324(Actor *this){
int i;
func_8038D0A8(this->position, 24, ASSET_4D4_MODEL_TWINKLY_BOX_PAPER_SHARD);
for(i = 0; i < 24; i++){
func_8038D170(this->position, 1, ASSET_710_SPRITE_SPARKLE_PURPLE + randi2(0, 10));
}
func_8038D208(this->position, 8, ASSET_700_SPRITE_DUST);
FUNC_8030E624(SFX_30_MAGIC_POOF, 1.0f, 32000);
}
void func_8038D3B0(Actor *arg0){
item_set(ITEM_6_HOURGLASS, FALSE);
}
void func_8038D3D8(void){
comusic_8025AB44(COMUSIC_68_TWINKLY_MINIGAME, 0, 4000);
func_8025AABC(COMUSIC_68_TWINKLY_MINIGAME);
func_8025A58C(-1, 4000);
func_8024BD08(1);
}
void func_8038D41C(ActorMarker *marker){
s32 pad[2];
ActorMarker *_marker = reinterpret_cast(ActorMarker *, marker);
Actor *actor;
actor = func_8032813C(ACTOR_337_TWINKLY_MUNCHER, D_80392354, 170);
actor->unk100 = _marker;
actor = func_8032813C(ACTOR_337_TWINKLY_MUNCHER, D_80392360, 170);
actor->unk100 = _marker;
if(pad[0]);
}
void func_8038D474(ActorMarker *marker){
Actor *actor = marker_getActor(reinterpret_cast(ActorMarker*, marker));
Actor *child;
s32 pad;
if((s32)actor->unk1C[0] >= 3){
actor->unk1C[0] = -1.0f;
}
actor->unk1C[0] += 1.0;
child = spawn_child_actor(D_8039236C[(s32)actor->unk1C[0]], &actor);
child->unk100 = actor->marker;
}
void func_8038D51C(ActorMarker *marker){
Actor *this = marker_getActor(marker);
item_set(ITEM_6_HOURGLASS, FALSE);
func_80320004(BKPROG_13, TRUE);
FUNC_8030E624(SFX_416, 0.8f, 32000);
func_8028F8F8(7, 0);
this->unk1C[1] = 1.0f;
func_80324E88(1.7f);
func_80324E38(1.7f, 0);
timedFunc_set_1(2.3f, (TFQM1)func_8038D294, (s32)this->marker);
this->velocity[1] = 1.0f;
}
void func_8038D5C8(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if(this->state == 1 || this->state == 2){
actor_collisionOff(this);
timed_setCameraToNode(0.0f, 0xa);
func_80324CD8(0.1f);
func_8028F784(1);
func_8028F490(D_8039237C);
func_8028F8F8(7, 1);
this->unk1C[1] = 0.0f;
func_8025A6EC(COMUSIC_68_TWINKLY_MINIGAME, 25000);
func_8025A58C(0, 4000);
func_8024BD08(0);
this->unk1C[2] = 428571.0f;
func_8025AEA0(0x68, (s32)this->unk1C[2]);
func_80328B8C(this, 3, 0.001f, 1);
actor_playAnimationOnce(this);
this->velocity[0] = 1.0f;
}//L8038D6B8
}
void func_8038D6C8(Actor *this){
f32 sp24;
bool sp20;
sp24 = time_getDelta();
mapSpecificFlags_set(0xd, (this->state != 1 && this->state != 2) ? TRUE : FALSE);
if(func_8038BFA0() || func_8031FF1C(BKPROG_13)){
this->marker->propPtr->unk8_3 = FALSE;
actor_collisionOff(this);
func_8028F8F8(7, FALSE);
return;
}
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOn(this);
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
func_803300D8(this->marker, func_8038D3B0);
marker_setCollisionScripts(this->marker, NULL, func_8038D5C8, NULL);
this->unk38_31 = 0;
this->unk1C[1] = 0.0f;
this->velocity[0] = 0.0f;
this->velocity[1] = 0.0f;
this->unk1C[0] = -1.0f;
func_8028F8F8(7, FALSE);
if(func_803203FC(0xC1) && func_8031B4F4() == -1){
func_80328B8C(this, 3, 0.001f, 1);
actor_playAnimationOnce(this);
this->velocity[0] = 1.0f;
}
}//L8038D844
if(func_803203FC(0xc1)){
this->velocity[0] = 1.0f;
}
switch (this->state)
{
case 1: //L8038D89C
if(!func_80329530(this, 800))
break;
if(!(func_8023DB5C() & 1))
func_80328B8C(this, 2, 0.001f, 1);
else
func_80328B8C(this, 2, 0.999f, 0);
actor_playAnimationOnce(this);
this->velocity[2] = randf2(1.4f, 2.0f);
break;
case 2: //L8038D91C
sp20 = animctrl_isPlayedForwards(this->animctrl);
animctrl_setDuration(this->animctrl, this->velocity[2]);
if( ( sp20 == TRUE && actor_animationIsAt(this, 0.999f) )
|| ( sp20 == FALSE && actor_animationIsAt(this, 0.001f) )
){
func_80328B8C(this, 1, 0.001f, 0);
actor_playAnimationOnce(this);
break;
}
if( actor_animationIsAt(this, 0.02f)
|| actor_animationIsAt(this, 0.15f)
|| actor_animationIsAt(this, 0.28f)
|| actor_animationIsAt(this, 0.63f)
|| actor_animationIsAt(this, 0.81f)
){
FUNC_8030E8B4(SFX_98_DEAF_THUD, 1.0f, 32000, this->position, 400, 2000);
}
break;
case 3: //L8038DA24
if(actor_animationIsAt(this, 0.3f))
func_8038D324(this);
if(actor_animationIsAt(this, 0.999f))
func_802C3C88((GenMethod_1)func_8038D474, (s32)this->marker);
if(this->velocity[0] != 0.0f)
break;
func_80324E88(0.0f);
func_8028F784(0);
func_80328B8C(this, 4, 0.999f, 1);
actor_playAnimationOnce(this);
item_set(ITEM_0_HOURGLASS_TIMER, 80*60 - 1);
item_set(ITEM_6_HOURGLASS, TRUE);
this->unk38_31 = 0xA;
item_set(ITEM_24_TWINKLY_SCORE, this->unk38_31);
func_802C3C88((GenMethod_1)func_8038D41C, (s32)this->marker);
this->unk60 = 0.0f;
func_80347A14(0);
func_802FAD64(ITEM_14_HEALTH);
break;
case 4: //L8038DB18
this->unk1C[2] += (sp24*-195238.0f)/80.0f;
if(this->unk1C[2] < 233333.0f)
this->unk1C[2] = 233333.0f;
func_8025AEA0(COMUSIC_68_TWINKLY_MINIGAME, (s32)this->unk1C[2]);
if(item_getCount(ITEM_24_TWINKLY_SCORE) == 0){
func_80328B8C(this, 1, 0.001f, 1);
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
func_8038D3D8();
func_80324E38(0.0f, 3);
timedFunc_set_1(1.3f, (TFQM1)func_8038D51C, (s32)this->marker);
timed_setCameraToNode(0.9f, 0xC);
item_set(ITEM_24_TWINKLY_SCORE, this->unk38_31);
func_80347A14(1);
break;
}
if(item_empty(ITEM_6_HOURGLASS)){
func_80328B8C(this, 1, 0.001f, 0);
actor_playAnimationOnce(this);
this->unk38_31 = 0;
item_set(ITEM_6_HOURGLASS, FALSE);
func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 28000);
func_8028F8F8(7, FALSE);
this->unk1C[1] = 1.0f;
func_8038D3D8();
func_80347A14(1);
break;
}
if(0.96 < animctrl_getAnimTimer(this->animctrl)){
if(this->unk60 <= 0.0){
func_802C3C88((GenMethod_1)func_8038D474, (s32)this->marker);
this->unk60 = 2.9f;
}
else{
this->unk60 -= sp24;
}
item_set(ITEM_24_TWINKLY_SCORE, this->unk38_31);
}
break;
}
}
bool func_8038DD14(void){
return mapSpecificFlags_get(0xD);
}
bool func_8038DD34(ActorMarker *marker){
Actor *this = marker_getActor(marker);
if(func_80329530(this, 800))
return TRUE;
return FALSE;
}

102
src/FP/code_790.c Normal file
View File

@@ -0,0 +1,102 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
Actor *func_80386B80(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_80386CF8(Actor *this);
/* .data */
ActorAnimationInfo D_80391A90[] ={
{0, 0.0},
{ASSET_143_ANIM_SNOWMAN_BUTTON, 800000.0f},
{ASSET_143_ANIM_SNOWMAN_BUTTON, 0.5f},
{ASSET_143_ANIM_SNOWMAN_BUTTON, 800000.0f}
};
ActorInfo D_80391AB0 = {
MARKER_B9_FP_SNOWMAN_BUTTON, ACTOR_116_FP_SNOWMAN_BUTTON, ASSET_421_MODEL_FP_SNOWMAN_BUTTON,
0x1, D_80391A90,
func_80386CF8, func_80326224, func_80386B80,
0, 0x800, 0.0f, 0
};
struct31s D_80391AD4 = {
{0.4f, 0.6f},
{1.8f, 3.6f},
{0.0f, 0.01f},
{0.5f, 1.4f},
0.0f, 0.01f,
};
struct43s D_80391AFC = {
{{-300.0f, 350.0f, -300.0f}, {300.0f, 800.0f, 300.0f}},
{{0.0f, -800.0f, 0.0f}, {0.0f, -800.0f, 0.0f}},
{{-50.0f, -50.0f, -50.0f}, {50.0f, 50.0f, 50.0f}}
};
s32 D_80391B44[3] = {225, 225, 245};
/* .code */
Actor *func_80386B80(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
func_8033A45C(1, this->state == 3);
func_8033A45C(2, func_8033A0F0(1) ^ 1);
return func_80325888(marker, gfx, mtx, vtx);
}
void func_80386BEC(Actor *this){
f32 plyr_pos[3];
ParticleEmitter *pCtrl = partEmitList_pushNew(12);
player_getPosition(plyr_pos);
func_80328B8C(this, 2, 0.01f, 1);
actor_collisionOff(this);
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
FUNC_8030E624(SFX_90_SWITCH_PRESS, 1.0f, 32000);
func_8038AB40();
func_802EFFA8(pCtrl, D_80391B44);
particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST);
particleEmitter_setPosition(pCtrl, plyr_pos);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80391AFC);
func_802EFB98(pCtrl, &D_80391AD4);
particleEmitter_emitN(pCtrl, 12);
}
void func_80386CB8(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if(this->state == 1)
func_80386BEC(this);
}
void func_80386CF8(Actor *this){
marker_setCollisionScripts(this->marker, NULL, NULL, func_80386CB8);
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOn(this);
if(!this->initialized){
this->initialized = TRUE;
this->pitch += (f32)(this->unkF4_8 - 1);
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(this->state == 3){
func_8038AB40();
}
}
switch(this->state){
case 1:
break;
case 2:
if(actor_animationIsAt(this, 0.99f)){
func_80328B8C(this, 3, 0.99f, 0);
}
break;
case 3:
break;
}
}

236
src/FP/code_7980.c Normal file
View File

@@ -0,0 +1,236 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern ActorProp *func_80320EB0(ActorMarker *, f32, s32);
Actor *func_8038DD70(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038E094(Actor *this);
/* .data */
extern ActorAnimationInfo D_80392390[] ={
{0, 0.0f},
{ASSET_1AF_ANIM_TWINKLY_MUNCHER_APPEAR, 10000000.0f},
{ASSET_1B0_ANIM_TWINKLY_MUNCHER_DIE, 1.0f},
{ASSET_1B1_ANIM_TWINKLY_MUNCHER_IDLE, 1.0f},
{ASSET_1B2_ANIM_TWINKLY_MUNCHER_ATTACK, 1.0f},
{ASSET_1AF_ANIM_TWINKLY_MUNCHER_APPEAR, 0.667f},
{ASSET_1B1_ANIM_TWINKLY_MUNCHER_IDLE, 1.0f},
{ASSET_1AF_ANIM_TWINKLY_MUNCHER_APPEAR, 0.667f}
};
extern ActorInfo D_803923D0 = { MARKER_205_TWINKLY_MUNCHER, ACTOR_337_TWINKLY_MUNCHER, ASSET_496_MODEL_TWINKLY_MUNCHER,
0x1, D_80392390,
func_8038E094, func_80326224, func_8038DD70,
2500, 0, 1.0f, 0
};
/* .code */
Actor *func_8038DD70(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if(this->state == 1)
return this;
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038DDC8(Actor *this){
actor_collisionOn(this);
func_80328B8C(this, 2, 0.03f, 1);
actor_playAnimationOnce(this);
}
void func_8038DE08(Actor *this){
func_80328B8C(this, 3, 0.03f, 1);
actor_loopAnimation(this);
}
void func_8038DE40(Actor *this){
func_80328B8C(this, 4, 0.03f, 1);
actor_playAnimationOnce(this);
}
void func_8038DE78(Actor *this){
actor_collisionOff(this);
func_80328B8C(this, 5, 0.03f, 1);
actor_playAnimationOnce(this);
}
void func_8038DEB8(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if(this->state != 1 && this->state != 5){
func_8038DE78(this);
FUNC_8030E8B4(SFX_87_TANKTUP_OOOHW, 1.6f, 32000, this->position, 1250, 2500);
FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 26000, this->position, 1250, 2500);
}
}
Actor *func_8038DF34(Actor *this){
ActorProp *prop;
Actor *other;
s32 marker_id;
f32 sp18[3];
func_8034A174(this->marker->unk44, 5, sp18);
this->marker->unk38[0] = sp18[0] - this->position[0];
this->marker->unk38[1] = sp18[1] - this->position[1];
this->marker->unk38[2] = sp18[2] - this->position[2];
prop = func_80320EB0(this->marker, 75.0f, 1);
if(prop && prop->unk8_0){
other = marker_getActor(prop->marker);
marker_id = other->marker->unk14_20;
if( marker_id == MARKER_200_TWINKLY_BLUE
|| marker_id == MARKER_201_TWINKLY_GREEN
|| marker_id == MARKER_202_TWINKLY_ORANGE
|| marker_id == MARKER_203_TWINKLY_RED
){
return other;
}
}
return NULL;
}
void func_8038E040(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
func_80324E88(0.5f);
func_80328B8C(this, 7, 0.03f, 1);
actor_playAnimationOnce(this);
}
void func_8038E094(Actor *this){
s32 sp3C;
Actor *sp38;
f32 sp34 = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, NULL, func_8038DEB8, NULL);
this->marker->propPtr->unk8_3 = TRUE;
animctrl_setAnimTimer(this->animctrl, 0.99999f);
this->unk60 = 0.0f;
if(this->unkF4_8 == 1){
func_8038DDC8(this);
}
if(this->unkF4_8 == 2){
if(func_803203FC(UNKFLAGS1_C1) && func_8031B4F4() == -2){
func_8038DDC8(this);
}
else{
marker_despawn(this->marker);
return;
}
}
}//L8038E180
if(this->unk100){
sp38 = marker_getActor(this->unk100);
if(sp38->unk1C[1] == 1.0f){
if(this->unkF4_8 == 1 && !func_8031FF1C(BKPROG_13)){
if(this->state != 6 && this->state != 7 && 0.0f == this->velocity[0]){
timed_setCameraToNode(0.5f, 0xd);
func_80311480(ASSET_C15_TEXT_TWINKLIE_MINIGAME_LOST, 0x2b, this->position, this->marker, func_8038E040, NULL);
this->velocity[0] = 1.0f;
func_80328B8C(this, 6, 0.03f, 1);
actor_loopAnimation(this);
}
}
else{//L8038E274
if(this->state == 1){
marker_despawn(this->marker);
}
else if( this->state != 1 && this->state != 5){
func_8038DE78(this);
}
}
}
}//L8038E2B4
switch(this->state){
case 1: //L8038E2DC
this->marker->propPtr->unk8_3 = FALSE;
animctrl_setAnimTimer(this->animctrl, 0.99f);
if(this->unk60 < 5.0){
this->unk60 += sp34;
}
else{
if(10.0 <= this->unk60 || randf() < this->unk60/10.0){
if(!func_8038DF34(this)){
this->unk60 = 0.0f;
func_8038DDC8(this);
break;
}
}
this->unk60 += sp34;
}
break;
case 2: //L8038E3C0
this->marker->propPtr->unk8_3 = TRUE;
sp38 = func_8038DF34(this);
if(sp38){
func_8038DE40(this);
this->unk38_31 = sp38->marker->unk14_20;
break;
}
if(actor_animationIsAt(this, 0.15f))
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1250, 2500);
if(actor_animationIsAt(this, 0.35f))
FUNC_8030E8B4(SFX_C4_TWINKLY_MUNCHER_GRR, 1.2f, 32000, this->position, 1250, 2500);
if(actor_animationIsAt(this, 0.97f))
func_8038DE08(this);
break;
case 3: //L8038E498
this->marker->propPtr->unk8_3 = TRUE;
sp38 = func_8038DF34(this);
if(sp38){
func_8038DE40(this);
this->unk38_31 = sp38->marker->unk14_20;
}
break;
case 4: //L8038E4F0
this->marker->propPtr->unk8_3 = TRUE;
sp38 = func_8038DF34(this);
if(sp38 && sp38->marker->unk14_20 == this->unk38_31){
if(actor_animationIsAt(this, 0.23)){
func_8038C398(sp38->position, sp38->marker->unk14_20);
FUNC_8030E8B4(SFX_110_TWINKLY_DEATH, 1.0f, 32000, this->position, 1250, 2500);
FUNC_8030E8B4(SFX_27_JINJO_HI, 1.6f, 32000, this->position, 1250, 2500);
func_80324D54(0.35f, SFX_110_TWINKLY_DEATH, 1.0f, 32000, this->position, 1250.0f, 2500.0f);
marker_despawn(sp38->marker);
if( !mapSpecificFlags_get(0xa) && func_80311480(0xc16, 0, NULL, NULL, NULL, NULL)){
mapSpecificFlags_set(0xa, TRUE);
}
}
}//L8038E620
if(actor_animationIsAt(this, 0.97f)){
func_8038DE08(this);
}
break;
case 5: //L8038E644
this->marker->propPtr->unk8_3 = TRUE;
if(actor_animationIsAt(this, 0.97f)){
func_80328B8C(this, 1, 0.97f, 0);
actor_playAnimationOnce(this);
this->unk60 = 0.0f;
}
break;
case 6: //L8038E698
this->marker->propPtr->unk8_3 = FALSE;
this->yaw_moving = (f32)func_80329784(this);
func_80328FB0(this, 12.0f);
break;
case 7: //L8038E6D4
this->marker->propPtr->unk8_3 = FALSE;
if(actor_animationIsAt(this, 0.97f)){
marker_despawn(this->marker);
}
break;
}
}

115
src/FP/code_8330.c Normal file
View File

@@ -0,0 +1,115 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
Actor *func_8038E720(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038E940(Actor *this);
/* .data */
extern ActorAnimationInfo D_80392400[];
extern ActorInfo D_80392420 = { 0x206, 0x338, 0x486,
0x1, D_80392400,
func_8038E940, func_80326224, func_8038E720,
4500, 0, 0.0f, 0
};
struct31s *D_80392444;
/* .code */
Actor *func_8038E720(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
func_8033A45C(1, 0);
func_8033A45C(2, 1);
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038E774(Actor *this){
func_80328B8C(this, 2, 0.05f, 1);
actor_playAnimationOnce(this);
this->marker->collidable = TRUE;
this->unk38_31 = 0;
}
void func_8038E7CC(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if(this->state == 2){
this->unk38_31++;
if(this->unk38_31 < 4){
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
}
}
}
void func_8038E840(f32 position[3], s32 cnt, enum asset_e sprite_id){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
particleEmitter_setSprite(pCtrl, sprite_id);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-100.0f, -80.0f, -70.0f,
100.0f, 100.0f, 70.0f
);
particleEmitter_setParticleAccelerationRange(pCtrl,
0.0f, -200.0f, 0.0f,
0.0f, -200.0f, 0.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-200.0f, -100.0f, -200.0f,
200.0f, 300.0f, 200.0f
);
func_802EFB98(pCtrl, &D_80392444);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038E940(Actor *this){
if(jiggyscore_isCollected(JIGGY_2F_FP_XMAS_TREE) || levelSpecificFlags_get(0x29)){
this->marker->propPtr->unk8_3 = TRUE;
this->marker->collidable = FALSE;
func_80328B8C(this, 3, 0.95f, 0);
return;
}//L8038E9B8
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
this->marker->collidable = FALSE;
marker_setCollisionScripts(this->marker, NULL, func_8038E7CC, NULL);
func_80328B8C(this, 1, 0.05f, 1);
this->unk38_31 = 0;
this->unk60 = 0.0f;
}//L8038EA3C
this->unk58_0 = (this->state == 1) ? FALSE : TRUE;
switch(this->state){
case 1: //L8038EA98
if(func_8031FF1C(BKPROG_13) && !mapSpecificFlags_get(2))
func_8038E774(this);
break;
case 2: //L8038EAC8
if(actor_animationIsAt(this, 0.2f))
func_8038E840(this->position, 0x20, ASSET_717_SPRITE_SPARKLE_YELLOW_2);
if(this->unk38_31 < 3)
break;
func_80328B8C(this, 3, 0.05f, 1);
actor_playAnimationOnce(this);
FUNC_8030E624(SFX_416, 0.8f, 32000);
this->marker->collidable = FALSE;
this->unk60 = 0.0f;
break;
case 3: //L8038EB44
if(this->unk60 == 0.0f && actor_animationIsAt(this, 0.95f)){
this->unk60 = 1.0f;
mapSpecificFlags_set(2, TRUE);
break;
}
if(this->unk60 != 0.0f && !mapSpecificFlags_get(2)){
func_8038E774(this);
}
break;
}//L8038EBC0
}

148
src/FP/code_87E0.c Normal file
View File

@@ -0,0 +1,148 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
f32 unk0[3];
f32 unkC[3];
u8 unk18;
u8 unk19;
u8 unk1A;
u8 unk1B;
} ActorLocal_FP_87E0;
Actor *func_8038EBD0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038ECD8(Actor *this);
/* .data */
ActorInfo D_80392470 = { 0x207, 0x339, 0x426,
0x1, NULL,
func_8038ECD8, func_80326224, func_8038EBD0,
0, 0, 0.0f, 0
};
/* .bss */
f32 D_803935D0[3];
/* .code */
Actor *func_8038EBD0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
func_8033A45C( 2, mapSpecificFlags_get(0));
func_8033A45C( 1, mapSpecificFlags_get(0) ^ 1);
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038EC34(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
ActorLocal_FP_87E0 *local = (ActorLocal_FP_87E0 *)&this->local;
local->unk1B = TRUE;
}
void func_8038EC5C(Actor *this){
if(0.0f == this->unk60){
this->unk38_31++;
this->unk60 = 0.33f;
if(this->unk38_31 < 4){
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
}
}
}
void func_8038ECD8(Actor *this){
ActorLocal_FP_87E0 *local = (ActorLocal_FP_87E0 *)&this->local;
f32 sp68[3];
s32 sp64;
f32 sp58[3];
f32 sp4C[3];
f32 sp40[3];
s32 sp3C;
f32 sp30[3];
if(jiggyscore_isCollected(JIGGY_2F_FP_XMAS_TREE)){
this->marker->collidable = FALSE;
return;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, NULL, func_8038EC34, NULL);
this->marker->propPtr->unk8_3 = TRUE;
player_getPosition(D_803935D0);
local->unk1B = 0;
this->unk38_31 = 0;
local->unk1A = 0;
}
local->unk19 = 0;
if(!local->unk1A && this->marker->unk14_21){
func_8034A174(this->marker->unk44, 5, sp58);
func_8034A174(this->marker->unk44, 6, sp4C);
local->unk0[0] = sp58[0] - sp4C[0];
local->unk0[1] = sp58[1] - sp4C[1];
local->unk0[2] = sp58[2] - sp4C[2];
player_getPosition(sp40);
sp40[0] -= sp4C[0];
sp40[1] -= sp4C[1];
sp40[2] -= sp4C[2];
local->unk18 = (0.0f <= sp40[0]*local->unk0[0] + sp40[1]*local->unk0[1] + sp40[2]*local->unk0[2]) ? 0 : 1;
local->unkC[0] = sp4C[0];
local->unkC[1] = sp4C[1];
local->unkC[2] = sp4C[2];
local->unk1A = TRUE;
}//L8038EE98
if(0.0f != this->unk60){
if(time_getDelta() < this->unk60){
this->unk60 -= time_getDelta();
}else{
this->unk60 = 0.0f;
}
}//L8038EEF0
switch(this->state){
case 1: //L8038EF10
this->marker->collidable = FALSE;
if(!mapSpecificFlags_get(2)) break;
if(mapSpecificFlags_get(3)) break;
func_80328A84(this, 2);
this->unk38_31 = 0;
break;
case 2://L8038EF5C
if(!local->unk1A) return;
if(item_empty(ITEM_6_HOURGLASS)){
func_80328A84(this, 1);
}
else{
this->marker->collidable = TRUE;
player_getPosition(sp68);
sp68[0] -= local->unkC[0];
sp68[1] -= local->unkC[1];
sp68[2] -= local->unkC[2];
sp64 = (0.0f <= sp68[0]*local->unk0[0] + sp68[1]*local->unk0[1] + sp68[2]*local->unk0[2]) ? 0 : 1;
if(sp64 == (local->unk18 ^ 1)){
local->unk19 = TRUE;
if(local->unk1B){
func_8038EC5C(this);
}
else{
player_getPosition(sp68);
sp3C = func_80320B98(D_803935D0, sp68, sp30, 0);
if(sp3C){
if(*(s32 *)(sp3C + 8) << 9 < 0)
func_8038EC5C(this);
}
}
}//L8038F090
if(!(this->unk38_31 < 3)){
func_80328A84(this, 1);
mapSpecificFlags_set(3, 1);
}
}
break;
}//L8038F0BC
local->unk18 = sp64;
local->unk1B = 0;
player_getPosition(D_803935D0);
}

57
src/FP/code_8D00.c Normal file
View File

@@ -0,0 +1,57 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
Actor *func_8038F0F0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038F144(Actor *this);
/* .data */
ActorAnimationInfo D_803924A0[] = {
{0, 0.0f},
{ASSET_18A_XMAS_GIFT, 1.5f}
};
ActorInfo D_803924B0 = { MARKER_208_BLUE_PRESENT, ACTOR_33A_BLUE_PRESENT, ASSET_47F_MODEL_XMAS_GIFT_BLUE,
0x1, D_803924A0,
func_8038F144, func_80326224, func_8038F0F0,
2500, 0, 1.2f, 0
};
ActorInfo D_803924D4 = { MARKER_209_GREEN_PRESENT, ACTOR_33B_GREEN_PRESENT, ASSET_480_MODEL_XMAS_GIFT_GREEN,
0x1, D_803924A0,
func_8038F144, func_80326224, func_8038F0F0,
2500, 0, 1.2f, 0
};
ActorInfo D_803924F8 = { MARKER_20A_RED_PRESENT, ACTOR_33C_RED_PRESENT, ASSET_481_MODEL_XMAS_GIFT_RED,
0x1, D_803924A0,
func_8038F144, func_80326224, func_8038F0F0,
2500, 0, 1.2f, 0
};
/* .code */
Actor *func_8038F0F0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if(this->unk38_31)
return this;
else
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038F144(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(!jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS)){
this->unk38_31 = TRUE;
this->marker->collidable = FALSE;
this->marker->propPtr->unk8_3 = FALSE;
}
else{
this->unk38_31 = FALSE;
this->marker->collidable = FALSE;
this->marker->propPtr->unk8_3 = TRUE;
animctrl_setAnimTimer(this->animctrl, randf());
}
}
if (this) if (this);
}

341
src/FP/code_8E20.c Normal file
View File

@@ -0,0 +1,341 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
f32 unk0[3];
f32 unkC[3];
f32 unk18[3];
f32 unk24[3];
u8 unk30;
} ActorLocal_Wozza;
Actor *func_8038F210(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8038F7AC(Actor *this);
/* .data */
extern ActorAnimationInfo D_80392520[];
extern ActorInfo D_80392588 = { MARKER_20B_WOZZA, ACTOR_1F3_WOZZA, ASSET_494_MODEL_WOZZA,
0x1, D_80392520,
func_8038F7AC, func_80326224, func_8038F210,
0, 0, 1.6f, 0
};
extern f32 D_803925AC[3];
/* .code */
Actor *func_8038F210(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if(func_8038BFA0() || this->unk38_31)
return this;
return func_80325888(marker, gfx, mtx, vtx);
}
void func_8038F274(void){
UNK_TYPE(s32) v0 = func_8034C528(0x191);
if(v0){
func_8034DE60(v0, 0.0f, -500.0f, 0.2f, 1);
}
}
void func_8038F2B8(Actor *this){
func_80328B8C(this, 3, 0.02f, 1);
actor_loopAnimation(this);
}
void func_8038F2F0(Actor *this){
func_80328B8C(this, 11, 0.02f, 1);
actor_loopAnimation(this);
func_8038F274();
}
void func_8038F330(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
switch(text_id){
case 0xC1B:
func_80324E88(0.0f);
break;
case 0xC1C:
func_80324E88(0.0f);
func_8038F2F0(this);
break;
}
}
void func_8038F3A0(void){
mapSpecificFlags_set(8, 1);
}
void func_8038F3C4(ActorMarker *caller, enum asset_e text_id, s32 arg2){
if(arg2 == 1){
func_8038F3A0();
}
}
void func_8038F3F4(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
func_8038F2B8(actor);
}
void func_8038F41C(Actor *this){
func_80328B8C(this, 1, 0.02f, 1);
actor_loopAnimation(this);
}
void func_8038F454(Actor *this){
if(!mapSpecificFlags_get(7) && func_8028ECAC() != BSGROUP_A_FLYING && func_80329530(this, 1000) ){
mapSpecificFlags_set(7, TRUE);
func_80328A84(this, 2);
actor_loopAnimation(this);
timed_setCameraToNode(0.0f, 0x2e);
func_80324DBC(0.0f, 0xc1b, 0x2a, this->position, this->marker, func_8038F330, NULL);
timedFunc_set_1(2.5f, (TFQM1)func_8038F3F4, (s32)this->marker);
}
else{
func_8038F2B8(this);
}
}
void func_8038F528(Actor *this){
func_80328B8C(this, 4, 0.02f, 1);
actor_loopAnimation(this);
}
void func_8038F560(Actor *this){
func_80328B8C(this, 7, 0.02f, 1);
actor_loopAnimation(this);
}
void func_8038F598(Actor *this, f32 arg1){
this->yaw_moving = func_80329784(this);
func_80328FB0(this, arg1);
}
bool func_8038F5D4(Actor *this, f32 arg1[3], f32 arg2, f32 arg3, s32 arg4){
f32 sp24;
sp24 = animctrl_getAnimTimer(this->animctrl);
this->yaw_moving = (f32) func_803297C8(this, arg1);
func_80328FB0(this, arg3);
if(actor_animationIsAt(this, 0.9f)){
FUNC_8030E8B4(SFX_3F2_UNKNOWN, 0.8f, 24000, this->position, 500, 2000);
}
this->unk28 = (1.0f- sp24)*arg2;
func_80329054(this, 2);
if(ml_vec3f_distance(this->position, arg1) <= arg4)
return TRUE;
return FALSE;
}
bool func_8038F6C4(Actor *this, f32 arg1[3], f32 arg2){
s32 dTheta;
func_80328C64(this, func_803297C8(this, arg1));
func_80328FB0(this, arg2);
dTheta = this->yaw - this->yaw_moving;
if(-arg2 <= dTheta && dTheta <= arg2){
return TRUE;
}
return FALSE;
}
void func_8038F758(ActorMarker *marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, marker));
Actor *jiggy = spawn_child_actor(ACTOR_1F4_WOZZAS_JIGGY, &this);
s32 pad;
jiggy->yaw = this->yaw;
this->unk100 = jiggy->marker;
jiggy->unk100 = this->marker;
}
void func_8038F7AC(Actor *this){
ActorLocal_Wozza * local = (ActorLocal_Wozza *)&this->local;
if(func_803203FC(0xC4)){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = FALSE;
actor_collisionOff(this);
this->unk58_0 = FALSE;
func_8038F274();
}
return;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = FALSE;
if(jiggyscore_isCollected(JIGGY_32_FP_WOZZA)){
func_8038F274();
marker_despawn(this->marker);
return;
}
if(levelSpecificFlags_get(0x26)){
this->unk38_31 = TRUE;
func_8038F274();
}
else{//L8038F8A0
func_80304E24(0x359, local->unk24);
func_80304E24(0x35A, local->unk0);
func_80304E24(0x35B, local->unkC);
func_80304E24(0x35C, local->unk18);
this->position[0] = local->unkC[0];\
this->position[1] = local->unkC[1];\
this->position[2] = local->unkC[2];
func_802C3C88(func_8038F758, this->marker);
local->unk30 = FALSE;
}
}//L8038F910
if(func_8038BFA0() || this->unk38_31 || !actor_playerIsWithinDist(this, 3000)){
actor_collisionOff(this);
return;
}
actor_collisionOn(this);
switch(this->state){
case 1: //L8038F984
if(func_8028ECAC() == BSGROUP_A_FLYING){
func_8038F454(this);
break;
}
if(func_80329530(this, 1300) && player_getTransformation() == TRANSFORM_4_WALRUS){
func_80328B8C(this, 8, 0.02f, 1);
actor_loopAnimation(this);
break;
}
if(func_80329530(this, 1000) && !func_803203FC(0x1f)){
func_8038F454(this);
break;
}
func_8038F598(this, 1.0f);
if( actor_animationIsAt(this, 0.38f) || actor_animationIsAt(this, 0.7f)){
if(randf() < 0.4)
animctrl_setDirection(this->animctrl, animctrl_isPlayedForwards(this->animctrl) ^ 1);
}
break;
case 3: //L8038FA9C
if(func_8038F5D4(this, local->unk24, 30.0f, 12.0f, 0x3C))
func_8038F528(this);
break;
case 4: //L8038FAD0
if(!func_80329530(this, 2000) && func_8028ECAC() != BSGROUP_A_FLYING){
func_8038F560(this);
break;
}
if(func_8038F5D4(this, local->unk0, 30.0f, 12.0f, 0x3C)){
func_80328B8C(this, 5, 0.02f, 1);
actor_playAnimationOnce(this);
}
break;
case 5: //L8038FB50
func_8038F6C4(this, local->unk18, 1.0f);
if(0.97 < animctrl_getAnimTimer(this->animctrl)){
func_80328B8C(this, 6, 0.02f, 1);
actor_loopAnimation(this);
}
break;
case 6: //L8038FBA8
func_8038F6C4(this, local->unk18, 1.0f);
if( func_80329530(this, 1700) ) break;
if( func_8028ECAC() == BSGROUP_A_FLYING ) break;
func_8038F560(this);
if(!local->unk30){
if(func_80311480(0xc1d, 0x20, NULL, NULL, NULL, NULL)){
local->unk30 = TRUE;
}
}
break;
case 7: //L8038FC30
if(!func_8038F6C4(this, local->unkC, 4.5f))
break;
if(func_80329530(this, 1000) || func_8028ECAC() == BSGROUP_A_FLYING){
func_8038F528(this);
break;
}
if(func_8038F5D4(this, local->unkC, 30.0f, 12.0f, 0x3C)){
func_8038F41C(this);
}
break;
case 8: //L8038FCB0
if(player_getTransformation() != TRANSFORM_4_WALRUS){
func_8038F41C(this);
break;
}
if(func_80329530(this, 500) && !this->unk138_24){
if(func_80311480(0xc1c, 0xAA, this->position, this->marker, func_8038F330, func_8038F3C4)){
timed_setCameraToNode(0.0f, 0x2E);
this->unk138_24 = TRUE;
}
break;
}//L8038FD40
if(mapSpecificFlags_get(8)){
if(func_8038F6C4(this, D_803925AC, 9.0f)){
func_80328B8C(this, 9, 0.02f, 1);
actor_playAnimationOnce(this);
}
break;
}
func_8038F598(this, 2.0f);
if(!func_803114B0()){
if( actor_animationIsAt(this, 0.02f)
|| actor_animationIsAt(this, 0.14f)
|| actor_animationIsAt(this, 0.28f)
|| actor_animationIsAt(this, 0.42f)
){
FUNC_8030E8B4(SFX_88_WOZZA_NOISE, 1.0f, 32000, this->position, 500, 2000);
}
}
break;
case 9: //L8038FE14
func_8038F6C4(this, D_803925AC, 9.0f);
if(0.97 < animctrl_getAnimTimer(this->animctrl)){
func_80328B8C(this, 10, 0.02f, 1);
actor_loopAnimation(this);
}
break;
case 10: //L8038FE70
func_8038F598(this, 9.0f);
break;
case 11: //L8038FE84
if(func_8038F5D4(this, local->unk24, 30.0f, 12.0f, 0x3C)){
func_80328A84(this, 12);
}
break;
case 12: //L8038FEB8
if(func_8038F5D4(this, local->unk18, 30.0f, 12.0f, 0x3C)){
this->unk38_31 = TRUE;
}
break;
}//L8038FEEC
}

89
src/FP/code_9EA0.c Normal file
View File

@@ -0,0 +1,89 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
Actor *func_80390290(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_80390388(Actor *this);
/* .data */
extern ActorAnimationInfo D_80392680[];
extern ActorInfo D_80392690 = { 0x20D, 0x33D, 0x38A,
0x1, D_80392680,
func_80390388, func_80326224, func_80390290,
2500, 0, 1.0f, 0
};
/* .code */
Actor *func_80390290(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
s32 sp18;
sp18 = 2;
if(this->unk38_31) return this;
if(func_803114C4() == 0xC1F || func_803114C4() == 0xC1E){
sp18 = 1;
}
func_8033A45C(1, 0);
func_8033A45C(3, sp18);
func_80325888(marker, gfx, mtx, vtx);
}
int func_80390334(void){
if( levelSpecificFlags_get(0x11) && levelSpecificFlags_get(0x12) && levelSpecificFlags_get(0x13)){
return TRUE;
}
return FALSE;
}
void func_80390388(Actor *this){
actor_collisionOff(this);
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(jiggyscore_isSpawned(JIGGY_2E_FP_PRESENTS) || jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS)){
levelSpecificFlags_set(0x11, TRUE);
levelSpecificFlags_set(0x12, TRUE);
levelSpecificFlags_set(0x13, TRUE);
}
if(jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3) || jiggyscore_isSpawned(JIGGY_2C_FP_BOGGY_3)){
this->unk38_31 = FALSE;
this->marker->propPtr->unk8_3 = TRUE;
}
else{
this->unk38_31 = TRUE;
this->marker->propPtr->unk8_3 = FALSE;
return;
}
}//L80390468
if( this->unk38_31 ) return;
if( this->state != 1 ) return;
if( jiggyscore_isSpawned(JIGGY_2E_FP_PRESENTS)
|| jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS)
|| func_80390334()
){
this->unk138_24 = TRUE;
}
if( func_80329530(this, 0xFA)
&& (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT)
){
if(0.0f == this->unk1C[0] && func_80390334()){
if(func_80311480(0xc1f, 0xb, this->position, NULL, NULL, NULL)){
this->unk138_24 = TRUE;
this->unk1C[0] = 1.0f;
}
}
else{
if( !this->unk138_24 ){
if(func_80311480(0xc1e, 0x2b, this->position, NULL, NULL, NULL)){
this->unk138_24 = TRUE;
}
}
}
}
}

21
src/FP/code_A1C0.c Normal file
View File

@@ -0,0 +1,21 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_803905B0(Actor *this);
/* .data */
ActorInfo D_803926C0 = { 0x20E, 0x33E, 0x49C,
0x1, NULL,
func_803905B0, func_80326224, func_80325340,
0, 0, 0.0f, 0
};
/* .code */
void func_803905B0(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
actor_collisionOff(this);
}
this->marker->propPtr->unk8_3 = func_8038DD14(this) ? TRUE : FALSE;
}

86
src/FP/code_A240.c Normal file
View File

@@ -0,0 +1,86 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028E668(f32[3], f32, f32, f32);
void func_80390630(Actor *this);
/* .data */
extern ActorAnimationInfo D_803926F0[]= {
{0, 0.0f},
{ASSET_221_ANIM_WOZZA_IN_CAVE, 5.0f}
};
extern ActorInfo D_80392700 = { MARKER_20F_WOZZA_IN_CAVE, ACTOR_33F_WOZZA_IN_CAVE, ASSET_494_MODEL_WOZZA,
0x1, D_803926F0,
func_80390630, func_80326224, func_80325888,
2500, 0, 1.6f, 0
};
/* .code */
void func_80390630(Actor *this){
if(func_803203FC(0xC4)){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = FALSE;
actor_collisionOff(this);
this->unk58_0 = FALSE;
}
return;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = FALSE;
actor_collisionOn(this);
this->unk38_31 = jiggyscore_isCollected(JIGGY_32_FP_WOZZA) || levelSpecificFlags_get(0x26) ? 0 : 1;
}//L80390714
if(this->unk38_31){
this->unk58_0 = FALSE;
return;
}
this->unk58_0 = TRUE;
func_8028E668(this->position, 200.0f, -40.0f, 160.0f);
if(this->state == 1){
this->yaw_moving = (f32)func_80329784(this);
func_80328FB0(this, 1.0f);
if(!func_803114B0()){
if( actor_animationIsAt(this, 0.09f)
|| actor_animationIsAt(this, 0.19f)
){
FUNC_8030E8B4(SFX_88_WOZZA_NOISE, 1.0f, 22000, this->position, 500, 2000);
}
if( actor_animationIsAt(this, 0.68f)
|| actor_animationIsAt(this, 0.78f)
|| actor_animationIsAt(this, 0.85f)
|| actor_animationIsAt(this, 0.92f)
){
FUNC_8030E8B4(SFX_3F2_UNKNOWN, 0.8f, 24000, this->position, 500, 2000);
}
}
if(func_80329530(this, 350)){
if(player_getTransformation() == TRANSFORM_4_WALRUS){
if(!levelSpecificFlags_get(0x31)){
if(func_80311480(0xc27, 0x23, NULL, NULL, NULL, NULL)){
levelSpecificFlags_set(0x31, TRUE);
}
}
}
else{
if(!levelSpecificFlags_get(0x32)){
if(func_80311480(0xc26, 0x23, NULL, NULL, NULL, NULL)){
levelSpecificFlags_set(0x32, TRUE);
}
}
}
}
}
}

210
src/FP/code_A40.c Normal file
View File

@@ -0,0 +1,210 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
Actor *func_80386E30(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void chXmasTree_update(Actor *this);
/* .data */
ActorInfo D_80391B50 = {
MARKER_BA_XMAS_TREE, ACTOR_15F_XMAS_TREE, ASSET_488_MODEL_XMAS_TREE,
0x1, NULL,
chXmasTree_update, func_80326224, func_80386E30,
0, 0, 0.0f, 0
};
s32 chXmasTree_switch_spawn_position[3] = {-0x1220, 0x6A, 0x1945};
/* .code */
Actor *func_80386E30(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
func_8033A45C(5, this->unk38_31);
func_8033A45C(6, func_8031FF1C(0x13) && !func_8033A0F0(5));
return func_80325888(marker, gfx, mtx, vtx);
}
void func_80386EAC(Actor *this){
u8 tmp_a0;
item_set(ITEM_6_HOURGLASS, FALSE);
tmp_a0 = this->unk44_31;
if(tmp_a0){
func_8030DA44(tmp_a0);
this->unk44_31 = 0;
}
}
void func_80386EF4(Actor *this, int arg1){
this->unk38_31 = arg1;
mapSpecificFlags_set(0, this->unk38_31);
}
void func_80386F3C(void){
levelSpecificFlags_set(0x29, TRUE);
func_803228D8();
func_803204E4(0xe, 1);
func_802E4078(MAP_53_FP_CHRISTMAS_TREE, 1, 0);
}
void func_80386F84(Actor * this){
func_80328A84(this, 2);
func_80386EF4(this, 0);
}
void func_80386FB4(void){
func_8032811C(ACTOR_338_XMAS_TREE_SWITCH, chXmasTree_switch_spawn_position, 350);
}
void func_80386FE0(void *marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, marker));
Actor *child = spawn_child_actor(0x339, &this);
s32 pad;
child->position_x += 20.0f;
child->position_z += 25.0f;
}
void func_80387038(Actor *this){
if(func_8030E3FC(this->unk44_31))
func_8030E394(this->unk44_31);
func_8030DBB4(this->unk44_31, randf2(0.9f, 1.1f));
func_8030E2C4(this->unk44_31);
}
void func_8038709C(Actor *this){
if(this->state == 5){
if(!mapSpecificFlags_get(0))
func_80387038(this);
return;
}
if(mapSpecificFlags_get(0) && !func_8030E3FC(this->unk44_31))
func_80387038(this);
}
void chXmasTree_update(Actor *this){
f32 sp2C = time_getDelta();
u8 tmp_a0;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
this->marker->collidable = FALSE;
func_803300D8(this->marker, func_80386EAC);
if(this->unk44_31 == 0){
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, SFX_415_UNKNOWN);
func_8030DD14(this->unk44_31, 3);
sfxsource_setSampleRate(this->unk44_31, 28000);
}
func_802C3BF8(func_80386FB4);
func_802C3C88(func_80386FE0, this->marker);
if(func_8031FF1C(0x13)){
func_80386F84(this);
mapSpecificFlags_set(2, FALSE);
}
}
this->unk124_9 = 1;
if(jiggyscore_isCollected(JIGGY_2F_FP_XMAS_TREE) || levelSpecificFlags_get(0x29)){
func_80386EF4(this, 1);
return;
}
switch(this->state){
case 1: // L80387268
func_80386EF4(this, 0);
if(func_8031FF1C(0x13)){
func_80386F84(this);
}
break;
case 2: // L80387294
if(!mapSpecificFlags_get(2)) break;
func_80328A84(this, 3);
this->unk60 = 2.0f;
func_8025A6EC(COMUSIC_61_XMAS_TREE_LIGHTS_UP, 28000);
func_802BAFE4(0x1A);
func_80311480(0xC14, 0, NULL, NULL, NULL, NULL);
break;
case 3: // L803872F0
if(0.0 <= this->unk60){
if( 1.8 < this->unk60){
func_80386EF4(this, 0);
}
else if(this->unk60 < 0.2){//L80387340
func_80386EF4(this, 1);
}
else{
if(randf() < 0.2){
func_80386EF4(this, this->unk38_31 ^ 1);
func_8038709C(this);
}
}//L803873AC
this->unk60 -= sp2C;
}
else{//L803873BC
if(func_802BB270()){
func_80328A84(this, 4);
func_80386EF4(this, 1);
item_set(ITEM_0_HOURGLASS_TIMER, 3600 - 1);
item_set(ITEM_6_HOURGLASS, TRUE);
}
}
break;
case 4: // L80387400
if(mapSpecificFlags_get(3)){
func_80328A84(this, 6);
func_80386EF4(this, 1);
item_set(ITEM_6_HOURGLASS, FALSE);
tmp_a0 = this->unk44_31;
if(tmp_a0){
func_8030DA44(tmp_a0);
this->unk44_31 = 0;
}
func_80324E38(0.0f, 3);
timedFunc_set_0(0.5f, func_80386F3C);
}
else{//L80387470
if(item_empty(ITEM_6_HOURGLASS)){
func_80328A84(this, 5);
mapSpecificFlags_set(2, FALSE);
this->unk60 = 0.1f;
if(!func_8038BFA0()){
if(!mapSpecificFlags_get(9) || mapSpecificFlags_get(1)){
func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 28000);
func_802BAFE4(0x1a);
this->unk60 = 2.0f;
}
}
}
}
break;
case 5: // L803874EC
if(0.0 <= this->unk60){
if( 1.8 < this->unk60){
func_80386EF4(this, 1);
}
else if(this->unk60 < 0.2){
func_80386EF4(this, 0);
}
else{
if(randf() < 0.2){
func_80386EF4(this, this->unk38_31 ^ 1);
func_8038709C(this);
}
}
this->unk60 -= sp2C;
}
else{
func_80386F84(this);
}
break;
}
}

93
src/FP/code_A500.c Normal file
View File

@@ -0,0 +1,93 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
Actor *func_803908F0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_80390BDC(Actor *this);
/* .data */
extern ActorInfo D_80392730 = { 0x210, 0x340, 0x4D2,
0x0, NULL,
func_80390BDC, func_80326224, func_803908F0,
0, 0, 1.0f, 0
};
extern struct31s D_80392754;
extern struct43s D_8039277C;
extern struct31s D_803927C4;
extern struct43s D_803927EC;
extern s32 D_80392834[3];
/* .code */
Actor *func_803908F0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(marker);
if(this->unk38_31 != 0) return this;
return func_80325888(marker, gfx, mtx, vtx);
}
void func_80390944(f32 position[3], s32 cnt, enum asset_e model_id){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
particleEmitter_setModel(pCtrl, model_id);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8039277C);
func_802EFE24(pCtrl,
100.0f, 100.0f, 100.0f,
250.0f, 250.0f, 250.0f
);
func_802EFB98(pCtrl, &D_80392754);
func_802EF9F8(pCtrl, 0.6f);
func_802EFA18(pCtrl, 0);
func_802EFA20(pCtrl, 1.0f, 1.3f);
func_802EF9EC(pCtrl, 0x7B, 8000);
particleEmitter_emitN(pCtrl, cnt);
}
void func_80390A30(f32 position[3], s32 cnt, enum asset_e sprite_id){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
func_802EFFA8(pCtrl, D_80392834);
particleEmitter_setSprite(pCtrl, sprite_id);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_803927EC);
func_802EFB98(pCtrl, &D_803927C4);
particleEmitter_emitN(pCtrl, cnt);
}
void func_80390ABC(ActorMarker *marker){
Actor *this = marker_getActor(marker);
func_80390944(this->position, 0xA, 0x4D3);
func_80390A30(this->position, 6, ASSET_700_SPRITE_DUST);
func_8030E6D4(SFX_B6_GLASS_BREAKING_1);
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
this->unk38_31 = 1;
}
void func_80390B2C(ActorMarker *marker){
Actor *this = marker_getActor(marker);
func_803228D8();
func_802E4078(MAP_27_FP_FREEZEEZY_PEAK, 0xd, 0);
marker_despawn(this->marker);
}
void func_80390B70(Actor *this){
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.0f, 0);
timedFunc_set_1(0.6f, (TFQM1)func_80390ABC, this->marker);
timedFunc_set_1(2.5f, func_80390B2C, this->marker);
}
void func_80390BDC(Actor *this){
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(jiggyscore_isCollected(JIGGY_2F_FP_XMAS_TREE)){
marker_despawn(this->marker);
}
else{
if(levelSpecificFlags_get(0x29)){
func_80390B70(this);
}
}
}
}

83
src/FP/code_A880.c Normal file
View File

@@ -0,0 +1,83 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern s32 func_8024DB50(f32[3], f32);
void func_80390EB0(Actor *this);
/* .data */
extern ActorInfo D_80392840 = { 0x245, 0x353, 0x402,
0x0, NULL,
func_80390EB0, func_80326224, func_80325340,
2000, 0, 0.0f, 0
};
struct40s D_80392864;
s32 D_80392894[3];
struct40s D_803928A0;
s32 D_803928D0[3];
/* .code */
void func_80390C70(f32 position[3]){
ParticleEmitter *pCtrl = partEmitList_pushNew(1);
particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1);
particleEmitter_setStartingFrameRange(pCtrl, 1, 6);
func_802EFFA8(pCtrl, D_80392894);
func_802EF9E4(pCtrl, 0x41);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-40.0f, 110.0f, -40.0f,
40.0f, 110.0f, 40.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
0.0f, 40.0f, 0.0f,
0.0f, 90.0f, 0.0f
);
func_802EFC28(pCtrl, &D_80392864);
}
void func_80390D58(f32 position[3]){
ParticleEmitter *pCtrl = partEmitList_pushNew(1);
particleEmitter_setSprite(pCtrl, ASSET_713_SPRITE_SPARKLE_YELLOW);
particleEmitter_setStartingFrameRange(pCtrl, 1, 6);
func_802EFFA8(pCtrl, D_803928D0);
func_802EF9E4(pCtrl, 0xFF);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-40.0f, 50.0,-40.0f,
40.0f, 70.0, 40.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-40.0f, 120.0,-40.0f,
40.0f, 180.0, 40.0f
);
particleEmitter_setParticleAccelerationRange(pCtrl,
0.0f, -60.0f, 0.0f,
0.0f, -100.0f, 0.0f
);
func_802EFC28(pCtrl, &D_803928A0);
}
void func_80390E78(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
FUNC_8030E8B4(SFX_96_HOTSAND_EEL_HISS, 1.0f, 32000, this->position, 1000, 2000);
}
void func_80390EB0(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
actor_collisionOn(this);
marker_setCollisionScripts(this->marker, func_80390E78, NULL, NULL);
}
if(func_8024DB50(this->position, 150.0f) || func_80329530(this, 1200))
{
if( !(func_8023DB5C() & 3) && randf() < 0.2){
func_80390C70(this->position);
}
if( !(func_8023DB5C() & 3) && randf() < 0.7){
func_80390D58(this->position);
}
}
}

245
src/FP/code_ABD0.c Normal file
View File

@@ -0,0 +1,245 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "prop.h"
#include "SnS.h"
extern ActorInfo D_80367FE0;
extern ActorInfo D_80391A10;
extern ActorInfo D_80391A60;
extern ActorInfo D_80391AB0;
extern ActorInfo D_80391B50;
extern ActorInfo D_80391BB0;
extern ActorInfo D_80391C18;
extern ActorInfo D_80391C58;
extern ActorInfo D_80391CE8;
extern ActorInfo D_80391E08;
extern ActorInfo D_80391E2C;
extern ActorInfo D_80391E50;
extern ActorInfo D_80391F88;
extern ActorInfo D_80391FAC;
extern ActorInfo D_80391FD0;
extern ActorInfo D_80391FF4;
extern ActorInfo D_803920E8;
extern ActorInfo D_803923D0;
extern ActorInfo D_80392420;
extern ActorInfo D_80392470;
extern ActorInfo D_803924B0;
extern ActorInfo D_803924D4;
extern ActorInfo D_803924F8;
extern ActorInfo D_80392588;
extern ActorInfo D_80392628;
extern ActorInfo D_80392690;
extern ActorInfo D_803926C0;
extern ActorInfo D_80392700;
extern ActorInfo D_80392730;
extern ActorInfo D_80392840;
void func_80391040(Actor *this);
void func_80391180(Actor *this);
void func_80391254(Actor *this);
void func_803912EC(Actor *this);
void func_8039180C(Actor *this);
void func_80391894(Actor *this);
/* .data */
ActorInfo D_803928E0 = { 0x247, 0x355, 0x4E5, 0x0, NULL, func_80391040, func_80326224, func_80325888, 3000, 0, 0.0f, 0};
ActorInfo D_80392904 = { 0x248, 0x356, 0x4E6, 0x0, NULL, func_80391040, func_80326224, func_80325888, 3000, 0, 0.0f, 0};
ActorInfo D_80392928 = { 0x249, 0x357, 0x4E7, 0x0, NULL, func_80391040, func_80326224, func_80325888, 3000, 0, 0.0f, 0};
ActorInfo D_8039294C = { 0x24A, 0x358, 0x4E8, 0x0, NULL, func_80391040, func_80326224, func_80325888, 3000, 0, 0.0f, 0};
ActorInfo D_80392970 = { 0x21F, 0x22B, 0x4C4, 0x1, NULL, func_80391180, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392994 = { 0x220, 0x22C, 0x4C5, 0x1, NULL, func_80391180, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_803929B8 = { 0x221, 0x22D, 0x4C6, 0x1, NULL, func_80391254, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_803929DC = { 0x222, 0x22E, 0x4C6, 0x1, NULL, func_80391254, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392A00 = { 0x223, 0x22F, 0x4C6, 0x1, NULL, func_80391254, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392A24 = { 0x24B, 0x35D, 0x4E9, 0x1, NULL, func_803912EC, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392A48 = { 0x24C, 0x35E, 0x4EC, 0x1, NULL, func_803912EC, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392A6C = { 0x24D, 0x35F, 0x4EA, 0x1, NULL, func_803912EC, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392A90 = { 0x24E, 0x360, 0x4EB, 0x1, NULL, func_803912EC, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392AB4 = { 0x23D, 0x253, 0x512, 0x1, NULL, func_8039180C, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392AD8 = { 0x23E, 0x254, 0x513, 0x1, NULL, func_80391894, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392AFC = { 0x286, 0x3AE, 0x55B, 0x1, NULL, func_80391180, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392B20 = { 0x21D, 0x229, 0x4C3, 0x1, NULL, func_80391180, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
ActorInfo D_80392B44 = { 0x289, 0x3B0, 0x56A, 0x1, NULL, func_80391180, func_80326224, func_80325E78, 0, 0, 0.0f, 0};
/* .code */
int func_80390FC0(void){
f32 sp1C[3];
player_getVelocity(sp1C);
if ( 0.0 == sp1C[0] && -1.0 == sp1C[1] && 0.0 == sp1C[2])
return 0;
return 1;
}
void func_80391040(Actor *this){
f32 sp34[3];
s32 a1;
s32 sp2C;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
actor_collisionOff(this);
this->marker->propPtr->unk8_3 = TRUE;
}
if( !this->marker->unk14_21 ) return;
if( !func_80390FC0() ) return;
if( func_8023DB5C() & 7 ) return;
if(randf() < 0.5){
a1 = 8;
switch(this->marker->unk14_20){
case 0x247://L80391128
sp2C = 0x710;
break;
case 0x248://L80391130
sp2C = 0x711;
break;
case 0x249://L80391138
sp2C = 0x712;
break;
case 0x24A://L80391140
sp2C = 0x711;
a1 = 6;
break;
default:
sp2C = 0x711;
break;
}
func_8034A174(this->marker->unk44, randi2(0,a1) + 5, sp34);
func_802DC110(sp34, sp2C);
}
}
void func_80391180(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
}
this->unk58_0 = func_8038DD14() ? 0 : 1;
if(this->marker->unk14_20 == 0x21F){
this->marker->unk40_22 = actor_playerIsWithinDist(this, 2000) ? 1 : 0;
}
}
void func_80391254(Actor *this){
func_802D3D74(this);
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(this->marker->unk14_20 == 0x221 || this->marker->unk14_20 == 0x223){
this->pitch = 3.0f;
}
if(this->marker->unk14_20 == 0x222){
this->pitch = 2.0f;
}
}
}
void func_803912EC(Actor *this){
func_802D3D74(this);
if(mapSpecificFlags_get(0xC)){
marker_despawn(this->marker);
}
}
void func_80391324(void)
{
spawnableActorList_add(&D_80391AB0, actor_new, 0X600);
spawnableActorList_add(&D_80391BB0, actor_new, 0X2A);
spawnableActorList_add(&D_80391C18, actor_new, 0X180084);
spawnableActorList_add(&D_80391C58, actor_new, 0X180084);
spawnableActorList_add(&D_80391CE8, actor_new, 0X2002E);
spawnableActorList_add(&D_80391E08, actor_new, 0X100);
spawnableActorList_add(&D_80391E2C, actor_new, 0X100);
spawnableActorList_add(&D_80391E50, actor_new, 0X100);
spawnableActorList_add(&D_80391F88, actor_new, 0X2100C);
spawnableActorList_add(&D_80391FAC, actor_new, 0X2100C);
spawnableActorList_add(&D_80391FD0, actor_new, 0X2100C);
spawnableActorList_add(&D_80391FF4, actor_new, 0X2100C);
spawnableActorList_add(&D_803920E8, actor_new, 0X408);
spawnableActorList_add(&D_803923D0, actor_new, 0X100006C);
spawnableActorList_add(&D_80391B50, actor_new, 0X20400);
spawnableActorList_add(&D_80392420, actor_new, 4);
spawnableActorList_add(&D_80392470, actor_new, 0X444);
spawnableActorList_add(&D_803924B0, actor_new, 8);
spawnableActorList_add(&D_803924D4, actor_new, 8);
spawnableActorList_add(&D_803924F8, actor_new, 8);
spawnableActorList_add(&D_80391A10, actor_new, 0);
spawnableActorList_add(&D_80391A60, actor_new, 0X20);
spawnableActorList_add(&D_80392588, actor_new, 0X80108);
spawnableActorList_add(&D_80392628, actor_new, 0X44);
spawnableActorList_add(&D_80392690, actor_new, 0XA8);
spawnableActorList_add(&D_803926C0, actor_new, 0X8000400);
spawnableActorList_add(&D_80392700, actor_new, 0X108);
spawnableActorList_add(&D_80392840, actor_new, 0);
spawnableActorList_add(&D_80392730, actor_new, 0X20000);
spawnableActorList_add(&D_80367FE0, actor_new, 0);
spawnableActorList_add(&D_803928E0, actor_new, 0X40);
spawnableActorList_add(&D_80392904, actor_new, 0X40);
spawnableActorList_add(&D_80392928, actor_new, 0X40);
spawnableActorList_add(&D_8039294C, actor_new, 0X40);
spawnableActorList_add(&D_80392B20, actor_new, 0X400);
spawnableActorList_add(&D_80392B44, actor_new, 0X400);
spawnableActorList_add(&D_80392970, actor_new, 0X400);
spawnableActorList_add(&D_80392994, actor_new, 0X400);
spawnableActorList_add(&D_803929B8, actor_new, 0X404);
spawnableActorList_add(&D_803929DC, actor_new, 0X404);
spawnableActorList_add(&D_80392A00, actor_new, 0X404);
spawnableActorList_add(&D_80392A24, actor_new, 0X20004);
spawnableActorList_add(&D_80392A48, actor_new, 4);
spawnableActorList_add(&D_80392A6C, actor_new, 0X20004);
spawnableActorList_add(&D_80392A90, actor_new, 0X20004);
spawnableActorList_add(&D_80392AB4, actor_new, 0X400);
spawnableActorList_add(&D_80392AD8, actor_new, 0X400);
spawnableActorList_add(&D_80392AFC, actor_new, 0X400);
}
void func_80391744(Actor *this, Actor* other){
f32 sp34[3] = {0.0f, 0.0f, 0.0f};
f32 sp28[3];
void *sp24;
f32 tmp_f0;
sp24 = func_80304C38(0x22A, this);
tmp_f0 = (f32)func_80304DA8(sp24);
other->yaw = tmp_f0;
this->yaw = tmp_f0;
ml_vec3f_yaw_rotate_copy(sp28, sp34, tmp_f0);
nodeprop_getPosition(sp24, sp34);
this->position_x = sp34[0] - sp28[0];
this->position_z = sp34[2] - sp28[2];
other->position_x = sp34[0] + sp28[0];
other->position_z = sp34[2] + sp28[2];
}
void func_8039180C(Actor *this){
ActorMarker *sp24;
if(!this->initialized){
sp24 = func_80326EEC(0x254);
if(sns_get_item_state(SNS_ITEM_ICE_KEY, 1) == 1){
marker_despawn(this->marker);
}
else{
func_802D3D74(this);
func_80391744(this, sp24);
this->initialized = TRUE;
}
}
}
void func_80391894(Actor *this){
func_802D3D74(this);
}

40
src/FP/code_B4D0.c Normal file
View File

@@ -0,0 +1,40 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
struct {
u8 unk0;
f32 unk4[3];
} D_803935E0;
/* .code */
void func_803918C0(void){
Actor *actor;
if(map_get() == MAP_7F_FP_WOZZAS_CAVE){
D_803935E0.unk0 = func_8030ED2C(SFX_128_FIRE_CRACKING, 2);
func_8030DBB4(D_803935E0.unk0, 1.0f);
actor = func_80326EEC(0x353);
if(actor){
D_803935E0.unk4[0] = actor->position_x;
D_803935E0.unk4[1] = actor->position_y;
D_803935E0.unk4[2] = actor->position_z;
}
else{
D_803935E0.unk4[0] = D_803935E0.unk4[1] = D_803935E0.unk4[2] = 0.0f;
}
}
}
void func_8039195C(void){
if(D_803935E0.unk0){
func_8030DA44(D_803935E0.unk0);
D_803935E0.unk0 = 0;
}
}
void func_80391994(void){
if(map_get() == MAP_7F_FP_WOZZAS_CAVE){
func_8030DB04(D_803935E0.unk0, 22000, D_803935E0.unk4, 400.0f, 1200.0f);
func_8030E2C4(D_803935E0.unk0);
}
}

87
src/GV/code_0.c Normal file
View File

@@ -0,0 +1,87 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void chtoots_update(Actor *this);
/* .data */
ActorAnimationInfo D_80390BD0[] = {
{0x000, 0.0f},
{ASSET_162_ANIM_TOOTS_IDLE, 5.0f},
{ASSET_162_ANIM_TOOTS_IDLE, 2.5f},
{ASSET_164_ANIM_TOOTS_SING, 1.0f}
};
ActorInfo D_80390BF0 = { MARKER_1F4_TOOTS, ACTOR_1E4_TOOTS, ASSET_434_MODEL_TOOTS,
0x1, D_80390BD0,
chtoots_update, func_80326224, func_80325888,
2000, 0, 0.5f, 0
};
/*.bss */
s32 D_80391A30;
s32 D_80391A34;
/* .code */
void func_803863F0(Actor *this){
func_80328B8C(this, 1, 0.0001f, 1);
D_80391A30 = FALSE;
}
void func_80386420(Actor *this){
func_80328B8C(this, 2, 0.0001f, 1);
this->unk38_31 = 0x23;
}
void func_80386464(Actor *this){
func_80328B8C(this, 3, 0.0001f, 1);
}
void chtoots_update(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
D_80391A30 = 0;
D_80391A34 = 0;
}
switch(this->state){
case 1://L80386500
if(D_80391A34){
func_80386464(this);
}
else if(D_80391A30 == TRUE){
func_80386420(this);
}
break;
case 2://L80386540
if(D_80391A34){
func_80386464(this);
}
else if(this->unk38_31 != 0){
this->unk38_31--;
if(this->unk38_31 == 6){
FUNC_8030E8B4(SFX_DD_JINJO_TALKING, 1.0f, 20000, this->position, 1500, 4500);
}
}
else{
func_803863F0(this);
}
break;
case 3://L803865C8
if(!D_80391A34)
func_803863F0(this);
break;
}//L803865DC
}
void func_803865E8(void){
D_80391A30 = TRUE;
}
void func_803865F8(void){
D_80391A34 = TRUE;
}
void func_80386608(void){
D_80391A34 = FALSE;
}

237
src/GV/code_1570.c Normal file
View File

@@ -0,0 +1,237 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
u8 pad0[4];
Struct80s *unk4;
BKModelBin *unk8;
}ActorLocal_Gobi2;
void chgobi2_setState(Actor *this, s32 next_state);
void chgobi2_update(Actor *this);
Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390CB0 = { MARKER_BF_GOBI_2, ACTOR_131_GOBI_2, ASSET_3E0_MODEL_GOBI,
0x0, NULL,
NULL, chgobi2_update, chgobi2_draw,
0, 0x533, 0.0f, 0
};
f32 D_80390CD4[3] = {1475.0f, 442.0f, 8870.0f};
f32 chgobi2_jiggy_position[3] = {1150.0f, 1150.0f, 9200.0f}; //jiggy spawn position
f32 D_80390CEC[3] = {1145.0f, 443.0f, 9197.0f};
/* .bss */
extern u8 D_80391A50;
/* .code */
void func_80387960(void){
func_8028F490(D_80390CD4);
}
void func_80387984(ActorMarker *this){
mapSpecificFlags_set(0xC, 1);
}
void __chgobi2_spawnJIggy(void){
jiggySpawn(JIGGY_45_GV_GOBI_2, chgobi2_jiggy_position);
}
void func_803879D4(ActorMarker *this_marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker));
chgobi2_setState(this, 4);
}
void func_80387A00(ActorMarker *this_marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker));
chgobi2_setState(this, 7);
}
void func_80387A2C(ActorMarker *caller, enum asset_e text_id, s32 arg2){
timed_setCameraToNode(0.0f, 0xC);
timedFunc_set_1(0.5f, (TFQM1) func_80387984, reinterpret_cast(s32, caller));
timed_playSfx(0.5f, SFX_2C_PULLING_NOISE, 0.9f, 32000);
timed_playSfx(1.8f, SFX_2C_PULLING_NOISE, 1.0f, 32000);
timed_playSfx(2.5f, SFX_2C_PULLING_NOISE, 1.1f, 32000);
timed_setCameraToNode(3.0f, 0xd);
timedFunc_set_0(3.5f, __chgobi2_spawnJIggy);
func_80324E88(6.0f);
timedFunc_set_1(6.0f, (TFQM1) func_80387A00, reinterpret_cast(s32, caller));
func_80324E38(6.0f, 0);
}
void chgobi2_setState(Actor *this, s32 next_state){
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
if(next_state == 1)
actor_collisionOff(this);
if(this->state == 1)
actor_collisionOn(this);
if(next_state == 2){
this->marker->propPtr->unk8_3 = TRUE;
func_80335924(this->unk148, ASSET_F4_ANIM_GOBI_IDLE, 0.5f, 12.0f);
}
if(next_state == 3){
timedFunc_set_0(0.05f, func_80387960);
timed_playSfx(0.05f, SFX_84_GOBI_CRYING, 1.1f, 32000);
func_80324E38(0.051f, 1);
timedFunc_set_1(0.06f, (TFQM1)func_803879D4, reinterpret_cast(s32, this->marker));
timed_setCameraToNode(0.86f, 0xb);
timed_playSfx(0.8f, SFX_4B_GULPING, 0.8f, 28000);
timed_playSfx(1.4f, SFX_4B_GULPING, 0.8f, 28000);
timed_playSfx(2.0f, SFX_4B_GULPING, 0.8f, 28000);
func_80324DBC(3.0f, ASSET_A72_TEXT_TRUNKER_HELPED, 0x2A, D_80390CEC, this->marker, func_80387A2C, NULL);
}//L80387C94
if(next_state == 4){
func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 3.0f);
func_80335924(local->unk4, ASSET_100_ANIM_GOBI_SPIT, 0.0f, 3.0f);
}
if(next_state == 5){
func_80335924(this->unk148, ASSET_FD_ANIM_GOBI2_GETTING_UP, 0.43f, 0.5f);
func_80335A8C(this->unk148, 2);
}
if(next_state == 6){
func_80335924(this->unk148, ASSET_F8_ANIM_GOBI_RUNNING, 0.4f, 0.71f);
func_80335A8C(this->unk148, 1);
}
if(next_state == 7){
marker_despawn(this->marker);
}
if(next_state == 8){
FUNC_8030E8B4(SFX_84_GOBI_CRYING, 0.9f, 20000, this->position, 1500, 2500);
func_80335924(this->unk148, ASSET_242_ANIM_GOBI_RELAXING, 0.2f, 0.5f);
}
this->state = next_state;
}
Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
f32 sp3C[3];
if(this->state == 0 || this->state == 1){
return this;
}
if(this->state == 6)
func_8033A280(2.0f);
sp3C[0] = this->pitch;
sp3C[1] = this->yaw;
sp3C[2] = this->roll;
func_8033A238(func_803356A0(this->unk148));
func_8033A2D4(func_803253A0, this);
func_803391A4(gfx, mtx, this->position, sp3C, 1.0f, NULL, func_80330B1C(this_marker));
if(this->state == 4){
func_8033A238(func_803356A0(local->unk4));
set_model_render_mode(2);
func_803391A4(gfx, mtx, this->position, sp3C, 1.0f, NULL, local->unk8);
}
return this;
}
void __chgobi2_80387EFC(Actor *this){
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
chgobi2_setState(this, 0);
func_80335874(local->unk4);
assetcache_release(local->unk8);
}
void __chgobi2_ow(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
enum hitbox_e hitbox;
hitbox = player_getActiveHitbox(NULL);
if(hitbox == HITBOX_1_BEAK_BUSTER)
D_80391A50 = TRUE;
else if(hitbox == HITBOX_A_FAST_FALLING){
this->unk1C[0] = 1.0f;
}
}
void chgobi2_update(Actor *this){
ActorMarker *sp34;
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
f32 sp2C;
sp34 = this->marker;
sp2C = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, __chgobi2_ow, NULL, NULL);
sp34->unk30 = __chgobi2_80387EFC;
local->unk4 = func_803358B4();
local->unk8 = (BKModelBin*) assetcache_get(ASSET_3F3_MODEL_GOBI_SPIT);
D_80391A50 = 0;
this->unk1C[0] = 0.0f;
this->unk1C[1] = 0.0f;
chgobi2_setState(this, 1);
if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2))
marker_despawn(this->marker);
return;
}//L80388060
if(this->state == 1){
if(jiggyscore_isCollected(JIGGY_44_GV_GOBI_1))
chgobi2_setState(this, 2);
}
if(this->state == 2){
if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0){
chgobi2_setState(this, 8);
}
else if(D_80391A50){
chgobi2_setState(this, 3);
}
}//L80388114
if(this->state == 2){
if(!this->unk138_24){
if(func_80329530(this, 0xFA) && !func_80329530(this, 0x50)){
if(func_8028F2A0()){
if(func_80311480(ASSET_A75_TEXT_GOBI2_MEET, 0, this->position, NULL, NULL, NULL))
this->unk138_24 = TRUE;
}
}
}
}//L80388194
if(this->state == 4){
func_80335A94(local->unk4, sp2C, 1);
if(func_80335794(this->unk148) > 0){
chgobi2_setState(this, 5);
}
}
if(this->state == 5){
if(func_80335794(this->unk148) > 0){
chgobi2_setState(this, 6);
}
}
if(this->state == 6){
func_80326224(this);
}
if(this->state == 8){
if(func_80335794(this->unk148) > 0){
chgobi2_setState(this, 2);
}
}
D_80391A50 = FALSE;
this->unk1C[1] = this->unk1C[0];
this->unk1C[0] = 0.0f;
}

158
src/GV/code_1E80.c Normal file
View File

@@ -0,0 +1,158 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void chgobi3_setState(Actor *this, s32 next_state);
void chgobi3_update(Actor *this);
Actor *chgobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390D00 = { MARKER_C3_GOBI_3, ACTOR_135_GOBI_3, ASSET_3E0_MODEL_GOBI,
0, NULL,
NULL, chgobi3_update, chgobi3_draw,
0, 0, 0.0f, 0
};
/* .code */
void func_80388270(Actor *this){
func_8028F428(2, this->marker);
}
void func_80388298(Actor *this){
s32 pad24;
f32 sp18[3];
TUPLE_ASSIGN(sp18, -6885.0f, 2383.0f, 1335.0f);
func_802C8F70(this->yaw);
func_802CA1CC(HONEYCOMB_C_GV_GOBI_3);
func_802C937C(0xd, sp18);
}
void func_803882F0(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
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.65f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
timed_playSfx(0.65f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
timed_playSfx(1.25f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 15000);
timed_playSfx(1.25f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 15000);
timed_playSfx(1.81f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 10000);
timed_playSfx(1.81f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 10000);
timed_playSfx(2.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 5000);
timed_playSfx(2.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 5000);
func_80324E88(3.0f);
func_80324E38(3.0f, 0);
}
void chgobi3_setState(Actor *this, s32 next_state){
if(next_state == 1)
actor_collisionOff(this);
if(this->state == 1)
actor_collisionOn(this);
if(next_state == 2){
this->marker->propPtr->unk8_3 = TRUE;
func_80335924(this->unk148, ASSET_F4_ANIM_GOBI_IDLE, 0.5f, 12.0f);
}
if(next_state == 3){
func_80324E38(0.0f, 3);
timedFunc_set_1(0.02f, (TFQM1)func_80388270, (s32)this);
timed_setCameraToNode(0.1f, 0x12);
timed_playSfx(0.2f, SFX_4C_LIP_SMACK, 1.0f, 32000);
timedFunc_set_1(0.2f, (TFQM1)func_80388298, (s32)this);
func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 1.0f);
}
if(next_state == 5){
func_80335924(this->unk148, 0xd9, 0.5f, 4.0f);
func_80311480(ASSET_A77_TEXT_GOBI3_DONE, 0xe, this->position, this->marker, func_803882F0, NULL);
}
if(next_state == 4){
this->marker->propPtr->unk8_3 = FALSE;
func_80335924(this->unk148, ASSET_F8_ANIM_GOBI_RUNNING, 0.3f, 0.71f);
}
if(next_state == 6){
marker_despawn(this->marker);
}
if(next_state == 7){
FUNC_8030E8B4(SFX_84_GOBI_CRYING, 0.9f, 20000, this->position, 1500, 2500);
func_80335924(this->unk148, ASSET_242_ANIM_GOBI_RELAXING, 0.2f, 0.5f);
}
this->state = next_state;
}
Actor *chgobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
if(this->state == 0 || this->state == 1) return this;
return func_80325888(this_marker, gfx, mtx, vtx);
}
void chgobi3_ow(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
enum hitbox_e hitbox;
hitbox = player_getActiveHitbox(NULL);
if(hitbox == HITBOX_1_BEAK_BUSTER){
if(this->state == 2)
chgobi3_setState(this, 3);
}
else if(hitbox == HITBOX_A_FAST_FALLING){
this->unk1C[0] = 1.0f;
}
}
void chgobi3_update(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, chgobi3_ow, NULL, NULL);
this->unk1C[0] = 0.0f;
this->unk1C[1] = 0.0f;
chgobi3_setState(this, 1);
if(honeycombscore_get(HONEYCOMB_C_GV_GOBI_3))
marker_despawn(this->marker);
return;
}
if(this->state == 1){
if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2))
chgobi3_setState(this, 2);
}
if(this->state == 2){
if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0){
chgobi3_setState(this, 7);
}
}
if(this->state == 3){
if(func_80335794(this->unk148) > 0)
chgobi3_setState(this, 5);
}
if(this->state == 4){
func_80326224(this);
if(timedFuncQueue_is_empty())
chgobi3_setState(this, 6);
}
if(this->state == 7){
if(func_80335794(this->unk148) > 0)
chgobi3_setState(this, 2);
}
this->unk1C[1] = this->unk1C[0];
this->unk1C[0] = 0.0f;
}

267
src/GV/code_230.c Normal file
View File

@@ -0,0 +1,267 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_80244BB0(s32, s32, s32, f32);
typedef struct {
f32 unk0[3];
u32 unk4_31:1;
u32 unk4_30:31;
f32 unk10[3];
f32 unk1C;
}ActorLocal_GV_230;
#define LOCAL_GV_230(s) ((ActorLocal_GV_230 *)&s->local)
void chancientone_update(Actor *this);
Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
s16 D_80390C20[4] = {5, 6, 7, 8};
ActorMarker *D_80390C28[5] = {NULL};
ActorAnimationInfo D_80390C3C[] = {
{0, 0.0f},
{0, 0.0f},
{ASSET_ED_ANIM_ANCIENT_ONE, 2.0f},
{ASSET_ED_ANIM_ANCIENT_ONE, 33000000.f}
};
ActorInfo D_80390C5C = { MARKER_F4_ANCIENT_ONE, ACTOR_147_ANCIENT_ONE, ASSET_3E8_MODEL_ANCIENT_ONE,
0x1, D_80390C3C,
chancientone_update, func_80326224, chancientone_draw,
0, 0x100, 0.0f, 0
};
/* .code */
void func_80386620(Actor *this){
int i;
s32 *temp_v0;
ActorMarker *temp_a0;
s32 temp_a1;
Actor *temp_v0_3;
s32 phi_s2;
s32 phi_s1;
s32 phi_s3;
for(i = 0; i <5; i++){
if(D_80390C28[i] == NULL)
return;
}
D_80390C20[0] = 5;
D_80390C20[1] = 6;
D_80390C20[2] = 7;
D_80390C20[3] = 8;
phi_s3 = (randf() * 1.0737418e9f);
phi_s2 = 1;
phi_s1 = 0;
while(phi_s2 != 0x40000000){
if ((phi_s3 & phi_s2) != 0) {
temp_a1 = D_80390C20[phi_s1];
D_80390C20[phi_s1] = D_80390C20[phi_s1 + 1];
D_80390C20[phi_s1 + 1] = temp_a1;
temp_a0 = D_80390C28[phi_s1 + 1];
D_80390C28[phi_s1 + 1] = D_80390C28[phi_s1 + 2];
D_80390C28[phi_s1 + 2] = temp_a0;
temp_v0_3 = marker_getActor(D_80390C28[phi_s1 + 1]);
temp_v0_3->unkF4_8 = phi_s1 + 2;
temp_v0_3 = marker_getActor(D_80390C28[phi_s1 + 2]);
temp_v0_3->unkF4_8 = phi_s1 + 3;
}
phi_s1 = (phi_s1 == 2) ? 0 : phi_s1 + 1;
phi_s2 <<= 1;
};
}
void func_8038678C(void){
func_80244BB0(3, 0x85, 0x7ff8, 1.0f);
func_80244BB0(4, 0x85, 0x7ff8, 1.0f);
}
void func_803867CC(void){
func_80244C78(3);
func_80244C78(4);
}
void func_803867F4(void){
f32 sp24[3];
func_802BAFE4(4);
if(func_80304E24(0x148, sp24)){
jiggySpawn(JIGGY_46_GV_ANCIENT_ONES, sp24);
func_802C3F04((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2]));
}
}
void func_80386850(ActorMarker *caller_marker, enum asset_e text_id, s32 arg2){
Actor *caller = marker_getActor(caller_marker);
if(text_id == 0xA80){
func_80328B8C(caller, 2, 0.0f, 1);
actor_playAnimationOnce(caller);
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff);
timedFunc_set_0(1.0f, func_803867F4);
}
}
void chancientone_update(Actor *this){
f32 sp44[3];
s32 sp40;
s32 sp38;
s32 pad;
f32 sp34;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(jiggyscore_isSpawned(JIGGY_46_GV_ANCIENT_ONES)){
marker_despawn(this->marker);
return;
}
}
if(!this->initialized){
if(D_80390C28[this->unkF4_8 - 1])
return;
LOCAL_GV_230(this)->unk1C = this->position_y;
this->position_y -= 1100.0f;
D_80390C28[this->unkF4_8 - 1] = this->marker;
if(this->unkF4_8 != 1){
this->marker->propPtr->unk8_4 = FALSE;
}
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
func_80386620(this);
}
else{//L803869B4
switch(this->state){
case 1: //L803869E4
player_getPosition(sp44);
sp44[0] -= LOCAL_GV_230(this)->unk10[0];
sp44[1] -= LOCAL_GV_230(this)->unk10[1];
sp44[2] -= LOCAL_GV_230(this)->unk10[2];
sp40 = (0.0f <= sp44[0]*LOCAL_GV_230(this)->unk0[0] + sp44[1]*LOCAL_GV_230(this)->unk0[1] + sp44[2]*LOCAL_GV_230(this)->unk0[2]) ? 0 : 1;
if(LOCAL_GV_230(this)->unk1C <= this->position_y){
this->position_y = LOCAL_GV_230(this)->unk1C;
if( sp40 == (LOCAL_GV_230(this)->unk4_31 ^ 1)){
if((sp44[0]*sp44[0] + sp44[1]*sp44[1] + sp44[2]*sp44[2]) < (f32)LOCAL_GV_230(this)->unk4_30){
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
for(sp38= 7; sp38< 0xC && mapSpecificFlags_get(sp38);sp38++);
mapSpecificFlags_set(sp38, TRUE);
if(sp38== 0xB){
if(!jiggyscore_isCollected(JIGGY_46_GV_ANCIENT_ONES)){
func_80311480(ASSET_A80_TEXT_ANICIENT_ONES_DONE, 0xE, NULL, this->marker, func_80386850, NULL);
}
else{
func_80386850(this->marker, 0xA80, -1);
}
}//L80386B98
else {
if(sp38== 7){
if(!jiggyscore_isCollected(JIGGY_46_GV_ANCIENT_ONES)){
func_80311480(ASSET_A7F_TEXT_ANICIENT_ONES_MEET, 0x4, NULL, NULL, NULL, NULL);
}
}
func_80328B8C(this, 2, 0.0f, 1);
actor_playAnimationOnce(this);
if(this->unkF4_8 < 5){
D_80390C28[this->unkF4_8]->propPtr->unk8_4 = TRUE;
func_802BAFE4(D_80390C20[this->unkF4_8 - 1]);
func_80244BB0(2, 0x86, 0x7ff8, 0.3f);
timedFunc_set_0(0.45f, func_8038678C);
}//L80386DB0
}
}
}
}
else{//L80386C64
sp38 = func_8023DB5C() & 0xF;
sp34 = LOCAL_GV_230(this)->unk1C + 40.0f;
this->position_y += 18.0;
this->position_x += (sp38 & 1) ? 0x17 : -0x17;
this->position_z += (sp38 & 2) ? 0xC : -0xC;
if(this->unkF4_8 != 1){
if(sp38 == 6){
func_802C3F04((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){
func_802C3F04((GenMethod_4)func_802C4140, 0x11f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z));
}//L80386D80
}
if(LOCAL_GV_230(this)->unk1C <= this->position_y){
func_80244C78(2);
timedFunc_set_0(0.5f, func_803867CC);
}
}//L80386DB0
LOCAL_GV_230(this)->unk4_31 = sp40;
break;
case 2: //L80386DCC
if(actor_animationIsAt(this, 0.999f)){
func_80328B8C(this, 3, 0.9999f, 1);
actor_playAnimationOnce(this);
}
break;
case 3: //L80386E04
if(LOCAL_GV_230(this)->unk1C - 1100.0f < this->position_y){
this->position_y -= 10.0;
}
else{
this->marker->propPtr->unk8_4 = FALSE;
}
break;
}//L80386E60
}//L80386E60
}
Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
int sp58;
s32 sp4C[3];
s32 sp40[3];
s32 sp34[3];
f32 sp28[3];
s32 tmp_v0;
sp58 = (this->state == 3) ? 0 : 1;
func_8033A45C(3, sp58);
func_8033A45C(4, sp58);
func_80325888(this_marker, gfx, mtx, vtx);
if( !this->initialized && this_marker->unk14_21){
func_8034A1B4(func_80329934(), 5, sp4C);
func_8034A1B4(func_80329934(), 6, sp40);
func_8034A1B4(func_80329934(), 7, sp34);
sp4C[1] += 1100;
sp40[1] += 1100;
sp34[1] += 1100;
LOCAL_GV_230(this)->unk0[0] = (sp4C[0] - sp40[0]);
LOCAL_GV_230(this)->unk0[1] = (sp4C[1] - sp40[1]);
LOCAL_GV_230(this)->unk0[2] = (sp4C[2] - sp40[2]);
player_getPosition(sp28);
sp28[0] -= sp40[0];
sp28[1] -= sp40[1];
sp28[2] -= sp40[2];
if(0.0f <= sp28[0] *LOCAL_GV_230(this)->unk0[0] + sp28[1]*LOCAL_GV_230(this)->unk0[1] + sp28[2]*LOCAL_GV_230(this)->unk0[2])
LOCAL_GV_230(this)->unk4_31 = FALSE;
else
LOCAL_GV_230(this)->unk4_31 = TRUE;
LOCAL_GV_230(this)->unk10[0] = (f32)sp40[0];
LOCAL_GV_230(this)->unk10[1] = (f32)sp40[1];
LOCAL_GV_230(this)->unk10[2] = (f32)sp40[2];
tmp_v0 = (sp34[1]- sp40[1]);
LOCAL_GV_230(this)->unk4_30 = (s32)(0.95*(f32)(tmp_v0*tmp_v0));
this->initialized = TRUE;
}
return this;
}
void func_80387118(void){
int i;
for(i = 0; i < 5; i++){
D_80390C28[i] = NULL;
}
}

76
src/GV/code_24D0.c Normal file
View File

@@ -0,0 +1,76 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void chgobirope_update(Actor *this);
/* .data */
ActorInfo D_80390D30 = { MARKER_BD_GOBI_ROPE, ACTOR_12F_GOBI_ROPE, ASSET_3E3_MODEL_GOBI_ROPE,
0, NULL,
chgobirope_update, func_80326224, func_80325888,
0, 0x533, 0.0f, 0
};
/* .code */
void chgobirope_setState(Actor *this, s32 next_state){
this->state = next_state;
if(this->state == 1){
func_80335924(this->unk148, ASSET_DD_ANIM_GOBI_ROPE, 0.5f, 4.0f);
}
if(this->state == 2){
func_80335924(this->unk148, ASSET_DC_ANIM_GOBI_ROPE_PULLING, 1.0f, 5.0f);
}
if(this->state == 3){
func_80335924(this->unk148, 0xF5, 0.1f, 1.0f);
func_80335A8C(this->unk148, 2);
}
if(this->state == 4){
marker_despawn(this->marker);
}
}
void chgobirope_update(Actor *this){
Actor *sp2C;
f32 sp28;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
sp2C = func_80326D68(this->position, ACTOR_12E_GOBI_1, -1, &sp28);
if(sp2C){
this->position_x = sp2C->position_x;
this->position_y = sp2C->position_y;
this->position_z = sp2C->position_z;
}
chgobirope_setState(this, 1);
if( jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1)
&& !func_803203FC(1)
){
marker_despawn(this->marker);
}
}
else{
if(this->state == 1 || this->state == 2){
if(this->state == 1 && func_80387354()){
chgobirope_setState(this, 2);
}
else{
if(func_80387360())
chgobirope_setState(this, 4);
}
}//L80388AB4
if(this->state == 2){
if(func_80335794(this->unk148) > 0)
chgobirope_setState(this, 1);
}
if(this->state == 3){
if(func_80335794(this->unk148) > 0)
chgobirope_setState(this, 4);
}
}
}

131
src/GV/code_2730.c Normal file
View File

@@ -0,0 +1,131 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_802EF3A8(ParticleEmitter *, Gfx **, Mtx **, Vtx**);
typedef struct {
f32 unk0[3];
ParticleEmitter *unkC;
ParticleEmitter *unk10;
f32 unk14;
}ActorLocal_GV_2730;
void func_80388DC8(Actor *this);
Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390D60 = { 0xBE, 0x130, 0x3E4,
0, NULL,
func_80388DC8, func_80326224, func_80388C64,
0, 0x533, 0.0f, 0
};
f32 D_80390D84[3] = {5644.0f, 2930.0f, -3258.0f};
/*.bss */
u8 D_80391A60;
/* .code */
void func_80388B20(Actor *this, s32 next_state){
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
this->state = next_state;
local->unk14 = 0.0f;
D_80391A60 = FALSE;
if(this->state == 2){
this->marker->propPtr->unk8_3 = FALSE;
local->unk14 = 2.6f;
D_80391A60 = TRUE;
func_8028F428(2, this->marker);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.3f, 9000);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.5f, 9000);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.7f, 9000);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.9f, 9000);
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
func_802F066C(local->unkC, local->unk0);
particleEmitter_emitN(local->unkC, 10);
func_802F053C(local->unk10, local->unk0);
particleEmitter_emitN(local->unk10, 10);
}
}
void func_80388C24(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if(this->state == 1)
func_80388B20(this, 2);
}
Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
f32 sp3C[3];
func_802EF3A8(local->unkC, gfx, mtx, vtx);
func_802EF3A8(local->unk10, gfx, mtx, vtx);
if(this->state == 0 || this->state == 2)
return this;
sp3C[0] = this->pitch;
sp3C[1] = this->yaw;
sp3C[2] = this->roll;
func_8033A2D4(func_803253A0, this);
func_8033A450(func_80329934());
func_803391A4(gfx, mtx, this->position, sp3C, 1.0f, NULL,func_80330B1C(this_marker));
func_8034A174(func_80329934(), 5, local->unk0);
return this;
}
s32 func_80388D78(void){
return D_80391A60;
}
void func_80388D84(Actor *this){
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
func_80388B20(this, 0);
func_802EF684(local->unkC);
func_802EF684(local->unk10);
}
void func_80388DC8(Actor *this){
ActorMarker *sp34 = this->marker;
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
f32 sp2C;
Actor *sp28;
f32 sp24 = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
sp34->unk30 = func_80388D84;
sp34->propPtr->unk8_3 = TRUE;
marker_setCollisionScripts(this->marker, NULL, NULL, func_80388C24);
local->unkC = particleEmitter_new(20);
local->unk10 = particleEmitter_new(30);
D_80391A60 = FALSE;
sp28 = func_80326D68(this->position, ACTOR_12E_GOBI_1, -1, &sp2C);
if(sp28){
this->position_x = sp28->position_x;
this->position_y = sp28->position_y;
this->position_z = sp28->position_z;
}
func_80388B20(this, 1);
if(jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1) && !func_803203FC(1)){
marker_despawn(this->marker);
}
}
else{//L80388ED0
particleEmitter_update(local->unkC);
particleEmitter_update(local->unk10);
if(func_8025773C(&local->unk14, sp24)){
jiggySpawn(JIGGY_44_GV_GOBI_1, D_80390D84);
func_802BB3DC(0, 60.0f, 0.65f);
}
if(this->state == 2){
if(func_802EF648(local->unkC) && func_802EF648(local->unk10)){
marker_despawn(sp34);
}
}
}
}

91
src/GV/code_2B80.c Normal file
View File

@@ -0,0 +1,91 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_80389144(Actor *this);
Actor *func_80389050(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390D90 = {
MARKER_C0_TRUNKER, ACTOR_132_TRUNKER, ASSET_3DF_MODEL_TRUNKER,
0, NULL,
func_80389144, NULL, func_80389050,
0, 0x599, 2.0f, 0
};
/* .code */
void func_80388F70(Actor *this, s32 next_state){
this->state = next_state;
if(this->state == 1){
func_80335924(this->unk148, ASSET_FE_ANIM_TRUCKER_SHORT, 0.1f, 2.5f);
}
if(this->state == 2){
func_80335924(this->unk148, ASSET_FF_ANIM_TRUCKER_GROW, 0.1f, 2.5f);
func_80335A8C(this->unk148, 2);
}
if(this->state == 3){
func_80335924(this->unk148, ASSET_FF_ANIM_TRUCKER_GROW, 0.0f, 2.5f);
func_80335A74(this->unk148, 0.999f);
func_80335A8C(this->unk148, 2);
}
}
Actor *func_80389050(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
f32 sp38[3];
f32 sp2C[3];
if(this->state == 0) return this;
this = func_80325888(this_marker, gfx, mtx, vtx);
sp38[0] = this->position_x - 150.0f;
sp38[1] = this->position_y + 2.0f;
sp38[2] = this->position_z - 170.0f;
sp2C[0] = this->pitch;
sp2C[1] = this->yaw + 220.0f;
sp2C[2] = this->roll;
set_model_render_mode(2);
func_803391A4(gfx, mtx, sp38, sp2C, 1.0f, NULL, func_8030A428(3));
return this;
}
void func_80389144(Actor *this){
ActorMarker *marker = this->marker;
s32 sp28 = 0;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
mapSpecificFlags_set(0xC, FALSE);
if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2) && !func_803203FC(1)){
func_80388F70(this, 3);
}
else{//L803891CC
func_80388F70(this, 1);
}
}//L803891D8
if( this->state == 1
&& !this->unk138_24
&& func_80329530(this, 250)
&& !func_80329530(this, 80)
&& func_8028F2A0()
){
func_80311480(ASSET_A71_TEXT_TRUNKER_MEET, 0xe, this->position, NULL, NULL, NULL);
this->unk138_24 = 1;
}//L80389254
if(this->state == 1 && mapSpecificFlags_get(0xC)){
sp28 = 2;
}
if(this->state == 2 && func_80335794(this->unk148) > 0){
sp28 = 3;
}
if(sp28)
func_80388F70(this, sp28);
}

50
src/GV/code_2EE0.c Normal file
View File

@@ -0,0 +1,50 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038938C(Actor *this);
Actor *func_803892D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
extern ActorAnimationInfo D_80390DC0[]={
{0, 0.0f},
{ASSET_F1_ANIM_MAGIC_CARPET, 2.0f}
};
extern ActorInfo D_80390DD0 = { MARKER_AF_MAGIC_CARPET_SHADOW, ACTOR_122_MAGIC_CARPET_SHADOW, ASSET_3E7_MODEL_MAGIC_CARPET_SHADOW,
0x1, D_80390DC0,
func_8038938C, func_80326224, func_803892D0,
2500, 0, 0.0f, 0
};
/* .code */
Actor *func_803892D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
f32 rotation[3];
f32 position[3];
Actor *this;
this = func_80325300(this_marker, rotation);
if(this->unk1C[2] != 0.0f){
position[0] = this->position_x;
position[1] = this->position_y;
position[2] = this->position_z;
position[1] += 8.0f;
func_8033A2D4(func_803253A0, this);
func_803391A4(gfx, mtx, position, rotation, this->unk1C[0], NULL, func_80330B1C(this_marker));
}
return this;
}
void func_8038938C(Actor *this){
if(!this->initialized){
this->initialized = TRUE;
this->unk124_11 = 3;
this->unk1C[2] = 1.0f;
this->velocity[0] = 0.0f;
actor_collisionOff(this);
}
if(this->velocity[0] != 0.0f){
this->alpha_124_19 = this->velocity[1];
}
}

152
src/GV/code_30C0.c Normal file
View File

@@ -0,0 +1,152 @@
#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);
void func_80389634(Actor *this);
void func_803898B8(Actor *this);
/* .data */
ActorAnimationInfo D_80390E00[] = {
{0x00, 0.0f},
{0xCD, 8000000.0f},
{0xCD, 2.5f},
{0xCD, 8000000.0f},
{0xCD, 1.6f},
{0xCD, 4.5f},
};
ActorInfo D_80390E30 = { 0xA8, 0x11A, 0x33D,
0x1, D_80390E00,
func_80389634, func_80326224, func_80325888,
2500, 0, 0.0f, 0
};
ActorInfo D_80390E54 = { 0x23B, 0x244, 0x33D,
0x1, D_80390E00,
func_803898B8, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
s32 D_80390E78[4] = {0xff, 0xd0, 0x5d, 0xb4};
s32 D_80390E88[4] = {0, 0, 0, 0};
/* .code */
void func_803894B0(Actor *this){
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
func_80328B8C(this, 1, 0.01f, 1);
this->unk38_31 = 0;
this->initialized = TRUE;
}
void func_80389518(Actor *this){
func_802EE6CC(this->unk1C, D_80390E88, D_80390E78, 0,
0.55f, 50.0f, 0xDC, 0x168, 0
);
}
int func_8038957C(Actor *this){
f32 f0;
f0 = this->yaw - func_80329784(this);
if(180.0f <= f0)
f0 -= 360;
else if(f0 < -180.0f)
f0 += 360;
if(f0 <= 0.0f && -180.0f <= f0){
return 1;
}
return 0;
}
void func_80389634(Actor *this){
int i;
switch(this->state){
case 1: //L80389680
if(!this->initialized){
func_803894B0(this);
}
if(func_80329530(this, 500) && func_8038957C(this)){
func_80328B8C(this, 2, 0.01f, 1);
FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500);
FUNC_8030E8B4(SFX_3F6_UNKNOWN, 1.0f, 32000, this->position, 1250, 2500);
}
break;
case 2: //L8038970C
if( this->unk38_31 == 0
&& actor_animationIsAt(this, 0.1f)
&& !jiggyscore_isCollected(JIGGY_41_GV_MAZE)
){
func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7fff);
this->unk38_31 = 1;
}
if(actor_animationIsAt(this, 0.5f)){
func_80328B8C(this, 3, 0.5f, 1);
}
break;
case 3: //L80389788
if(!func_80329530(this, 0x2bc)){
func_80328B8C(this, 4, 0.5f, 1);
FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500);
FUNC_8030E8B4(SFX_3F6_UNKNOWN, 1.0f, 32000, this->position, 1250, 2500);
}
break;
case 4: //L803897E4
if(actor_animationIsAt(this, 0.9f) && this->marker->unk14_21){
i = 6;
do{
func_8034A174((struct5Bs*)this->marker->unk44, i, this->unk1C);
func_80389518(this);
i++;
}while(i < 17);
}
if(actor_animationIsAt(this, 0.99f)){
func_80328B8C(this, 1, 0.01f, 1);
}
else if(actor_animationIsAt(this, 0.9f)){
FUNC_8030E8B4(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 32000, this->position, 1250, 2500);
}
break;
}//L803898A8
}
void func_803898B8(Actor *this){
if(!this->initialized){
func_803894B0(this);
if(func_8031FF1C(BKPROG_A4_UNKOWN))
func_80328B8C(this, 3, 0.5f, 1);
this->unk1C[0] = 0.0f;
}
switch(this->state){
case 1://L80389934
if(this->unk1C[0] != 0.0f){
this->unk1C[0] -= 1.0f;
if(this->unk1C[0] == 0.0f){
func_80328B8C(this, 5, 0.01f, 1);
FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 0.5f, 32000, this->position, 1250, 2500);
FUNC_8030E8B4(SFX_3F6_UNKNOWN, 0.5f, 32000, this->position, 1250, 2500);
}
}
else{//L803899C0
if(func_8031FF1C(BKPROG_A3_UNKOWN)){
this->unk1C[0] = 33.0f;
}
}
break;
case 5://L803899DC
if(actor_animationIsAt(this, 0.5f)){
func_80328B8C(this, 3, 0.5f, 1);
FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 25000);
}
break;
}//L80389A0C
}

117
src/GV/code_3630.c Normal file
View File

@@ -0,0 +1,117 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_80389B1C(Actor *this);
/* .data */
ActorAnimationInfo D_80390EA0[] = {
{0x00, 0.0f},
{0xDF, 4.5f},
{0xE3, 2.0f},
{0xE4, 1.95f},
{0xCE, 2.4f},
{0xDF, 4.5f}
};
ActorInfo D_80390ED0 = { MARKER_A9_RUBEE, ACTOR_11B_RUBEE, ASSET_3DD_MODEL_RUBEE,
0x2, D_80390EA0,
func_80389B1C, func_80326224, func_80325888,
2500, 0, 1.6f, 0
};
/* .code */
void func_80389A20(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
func_8038E18C();
func_80328B8C(this, 3, 0.0f, 1);
}
void func_80389A60(Actor *this){
func_80311480(ASSET_A70_TEXT_CHARMER_HELPED, 4, NULL, this->marker, func_80389A20, NULL);
this->unk138_24 = TRUE;
func_80328A84(this, 5);
}
void func_80389ABC(Actor *this){
if(this->unk138_23){
func_80389A20(this->marker, ASSET_A70_TEXT_CHARMER_HELPED, -1);
}
else{
this->unk138_23 = TRUE;
mapSpecificFlags_set(2, TRUE);
func_80389A60(this);
}
}
void func_80389B1C(Actor *this){
if(!this->unk16C_4){
this->unk60 = (f32) func_8038E184();
this->unk138_24 = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(0);
this->unk138_23 = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(2);
this->unk16C_4 = TRUE;
}
if(!this->initialized){
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
this->initialized = TRUE;
}
animctrl_setTransitionDuration(this->animctrl, 0.15f);
if(this->state == 1 || this->state == 2){
if(! this->unk138_24 && func_80329530(this, 250) && !func_80329530(this, 0x50)){
func_80311480(ASSET_A6F_TEXT_CHARMER_MEET, 0xe, this->position, NULL, NULL, NULL);
this->unk138_24 = TRUE;
mapSpecificFlags_set(0, TRUE);
}
}
switch(this->state){
case 1://L80389CC4
if(this->unk60 <= (f32)func_8038E178()){
func_80389ABC(this);
}
else if(actor_animationIsAt(this, 0.99f)){
func_80328B38(this, 2, 0.9f);
}
if( actor_animationIsAt(this, 0.42f)
|| actor_animationIsAt(this, 0.46f)
|| actor_animationIsAt(this, 0.51f)
|| actor_animationIsAt(this, 0.57f)
){
FUNC_8030E8B4(SFX_8_BANJO_LANDING_04, 3.802f, 8000, this->position, 1500, 4500);
}
if( actor_animationIsAt(this, 0.4f)){
func_803865E8();
}
break;
case 2: //L80389DB0
if(this->unk60 <= (f32)func_8038E178()){
func_80389ABC(this);
}
else if(actor_animationIsAt(this, 0.99f)){
func_80328B38(this, 1, 0.4f);
}
break;
case 3: //L80389E14
if( actor_animationIsAt(this, 0.2f)){
func_8025A58C(500, 400);
func_8025A6EC(COMUSIC_27_GV_RUBEES_SONG, 28000);
}
if( actor_animationIsAt(this, 0.99f)){
func_80328A84(this, 4);
}
break;
case 4: //L80389E64
if(!func_8038E178())
func_80328A84(this, 2);
break;
}//L80389E80
}

25
src/GV/code_3AA0.c Normal file
View File

@@ -0,0 +1,25 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_80389E90(Actor *this);
void func_80389EA8(Actor *this);
/* .data */
ActorInfo D_80390F00 = { MARKER_AB_RUBEES_EGG_POT, ACTOR_11D_RUBEES_EGG_POT, ASSET_3E1_MODEL_RUBEES_EGG_POT,
0x1, NULL,
func_80389E90, func_80389EA8, func_80325888,
2500, 0, 0.9f, 0
};
/* .code */
void func_80389E90(Actor *this){
this->marker->propPtr->unk8_3 = FALSE;
}
void func_80389EA8(Actor *this){
this->marker->propPtr->unk8_3 = FALSE;
this->unk4C = 100 + 40*func_8038E178();
func_80343DEC(this);
}

28
src/GV/code_3B10.c Normal file
View File

@@ -0,0 +1,28 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028F710(s32, f32);
/* .data */
u8 D_80390F30[] = {
0x00, 0x27, 0x45, 0x30,
0xAA, 0x18, 0xBB, 0xF3,
0x00, 0x03, 0x03, 0x1C,
0x00, 0x00, 0x00, 0x00
};
/* .code */
void func_80389F00(void){
if(getGameMode() != GAME_MODE_7_ATTRACT_DEMO && 2.0f < func_8028E80C(3)){
func_8028F710(3, 2.0f);
}
}
void func_80389F5C(void){
u32 sp1C;
osPiReadIo(0x800, &sp1C);
sp1C <<= 0x10;
if(sp1C != 0x10000)
func_80389F00();
}

63
src/GV/code_3BB0.c Normal file
View File

@@ -0,0 +1,63 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern int func_8024DB50(f32[3], f32);
void func_8038A084(Actor *this);
/* .data */
ActorInfo D_80390F40 = { 0x24F, 0x37C, 0x0,
0, NULL,
func_8038A084, func_80326224, func_80325340,
2000, 0, 0.0f, 0
};
struct40s D_80390F64 = {
{ {2.5f, 2.8f},
{4.0f, 5.0f},
{0.0f, 0.01f},
{2.0f, 2.5f},
0.1f, 0.4f
},
4.0f,
1.0f
};
s32 D_80390F94[3] = {0xFF, 0xFF, 0x9B};
/* .code */
void func_80389FA0(f32 position[3]){
ParticleEmitter *pCtrl = partEmitList_pushNew(1);
particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1);
particleEmitter_setStartingFrameRange(pCtrl, 1, 6);
func_802EFFA8(pCtrl, D_80390F94);
func_802EF9E4(pCtrl, 100);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setParticleSpawnPositionRange( pCtrl,
-700.0f, 0.0f, -700.0f,
700.0f, 0.0f, 700.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
0.0f, 40.0f, 0.0f,
0.0f, 90.0f, 0.0f
);
func_802EFC28(pCtrl, &D_80390F64);
}
void func_8038A084(Actor *this){
if(this->unkF4_8 == 6 && !this->unk16C_4){
this->unk16C_4 = TRUE;
if( jiggyscore_isCollected(JIGGY_42_GV_WATER_PYRAMID) && this->yaw == 1.0f){
this->unk38_31 = TRUE;
}
}
if(this->unkF4_8 == 6
&& func_8024DB50(this->position, 50.0f)
&& !this->unk38_31
&& randf() < 0.2
){
func_80389FA0(this->position);
}
}

158
src/GV/code_3D90.c Normal file
View File

@@ -0,0 +1,158 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern f32 func_80309724(f32[3]);
void func_80329904(ActorMarker *, s32, void *);
void func_8038A314(Actor *this);
void func_8038A31C(Actor *this);
Actor *func_8038A180(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_80390FA0[] = {
{0, 0.0f},
{0xC9, 2.0f},
{0xC9, 2.0f},
{0xC9, 2.0f},
{0xC9, 2.0f},
{0xC9, 2.0f},
};
ActorInfo D_80390FD0 = { MARKER_B0_MAGIC_CARPET_2, ACTOR_123_MAGIC_CARPET_2, ASSET_3DC_MODEL_MAGIC_CARPET,
0x1, D_80390FA0,
func_8038A314, func_8038A31C, func_8038A180,
0, 0, 0.0f, 0
};
u8 D_80390FF4[6] = {0,0,0,1,1,1};
/* .code */
Actor *func_8038A180(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor * this = marker_getActor(this_marker);
if(this->unk1C[0] != 0.0f){
this = func_80325888(this_marker, gfx, mtx, vtx);
if( this->unk54 == 0.0f
&& this->unk48 != this->unk1C[1]
&& this_marker->unk14_21
&& func_80329530(this, 0xbb8)
){
func_8033E73C(this->marker, 6, func_80329904);
func_8033E3F0(0xc, this->marker->unk14_21);
}
}
return this;
}
f32 func_8038A264(Actor *shadow, Actor* this){
if(this && shadow){
return ml_map_f(this->position_y - shadow->position_y, 0.0f, 2200.0f, 1.0f, 0.35f);
}
else{
return 0.0;
}
}
void func_8038A2C0(void *this_marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker));
Actor *shadow = spawn_child_actor(ACTOR_122_MAGIC_CARPET_SHADOW, &this);
s32 pad;
func_8032AA58(shadow, this->scale);
this->unk100 = shadow->marker;
}
void func_8038A314(Actor *this){}
void func_8038A31C(Actor *this){
Actor *sp24;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
actor_collisionOff(this);
func_802C3C88((GenMethod_1)func_8038A2C0, reinterpret_cast(s32, this->marker));
this->velocity[0] = 0.0f;
}
if(this->unk100)
sp24 = func_80329980(this);
this->unk1C[1] = this->unk48;
;
switch(func_8038F4C0(this, 3))
{
case 1: //L8038A3C0
func_80343DEC(this);
this->marker->propPtr->unk8_3 = TRUE;
this->unk1C[0] = 1.0;
this->alpha_124_19 = 0xff;
if(this->unk54 != 0.0f){
func_80328B8C(this, 2, 0.02f, 1);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED);
}
break;
case 2: //L8038A440
this->marker->propPtr->unk8_3 = TRUE;
this->unk1C[0] = 1.0;
if(45.0f <= this->velocity[0]){
func_80328B8C(this, 3, 0.02f, 1);
this->velocity[0] = 0.0f;
}
else{
if(D_80390FF4[((s32)this->velocity[0])%6] == 0){
this->alpha_124_19 -= 0x55;
}
else{
this->alpha_124_19 += 0x55;
}
this->velocity[0] += 1.0f;
}
break;
case 3: //L8038A534
func_80343DEC(this);
this->marker->propPtr->unk8_3 = FALSE;
this->unk1C[0] = 0.0;
this->alpha_124_19 = 0;
if(this->unk54 == 0.0f){
func_80328B8C(this, 4, 0.02f, 1);
}
break;
case 4: //L8038A5A4
this->marker->propPtr->unk8_3 = TRUE;
this->unk1C[0] = 1.0;
if(45.0f <= this->velocity[0]){
func_80328B8C(this, 1, 0.02f, 1);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP);
this->velocity[0] = 0.0f;
}
else{
if(D_80390FF4[5 - ((s32)this->velocity[0])%6 ] != 0){
this->alpha_124_19 += 0x55;
}
else{
this->alpha_124_19 -= 0x55;
}
this->velocity[0] += 1.0f;
}
break;
}//L8038A6A4
this->unk124_11 = 0x3;
this->pitch = 0.0f;
if(this->unk100 && sp24 && this->unk100->unk14_20 == MARKER_AF_MAGIC_CARPET_SHADOW){
sp24->position_x = this->position_x;
sp24->position_y = func_80309724(this->position) + 60.0f;
sp24->position_z = this->position_z;
sp24->unk1C[0] = func_8038A264(sp24, this);
sp24->yaw = this->yaw;
sp24->velocity[0] = 1.0;
sp24->velocity[1] = this->alpha_124_19;
if (0.0f != this->unk1C[0])
sp24->unk1C[2] = 1.0;
else
sp24->unk1C[2] = 0.0f;
}//L8038A780
}

110
src/GV/code_43B0.c Normal file
View File

@@ -0,0 +1,110 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern f32 func_80309724(f32[3]);
void func_80329904(ActorMarker *, s32, void *);
void func_8038A948(Actor *this);
void func_8038A9C0(Actor *this);
Actor *func_8038A7A0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_80391000[] = {
{0, 0.0f},
{0xC9, 2.0f}
};
ActorInfo D_80391010 = { MARKER_A7_MAGIC_CARPET_1, ACTOR_119_MAGIC_CARPET_1, ASSET_3DC_MODEL_MAGIC_CARPET,
0x1, D_80391000,
func_8038A948, func_8038A9C0, func_8038A7A0,
2500, 0, 0.0f, 0
};
/* .code */
Actor *func_8038A7A0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor * this;
this = func_80325888(this_marker, gfx, mtx, vtx);
if( this->velocity_y != 0.0f
&& this_marker->unk14_21
&& this->unk48 != this->unk1C[2]
){
func_8033E73C(this->marker, 5, func_80329904);
func_8033E3F0(0xa, this->marker->unk14_21);
this->unk38_31++;
}
return this;
}
f32 func_8038A860(Actor *shadow, Actor* this){
f32 out = 0.0f;
if(this && shadow){
out = this->scale * ml_map_f(this->position_y - shadow->position_y, 0.0f, 2200.0f, 1.2f, 0.35f);
}
return out;
}
void func_8038A8CC(ActorMarker *this_marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker));
Actor *shadow = spawn_child_actor(ACTOR_122_MAGIC_CARPET_SHADOW, &this);
s32 pad;
this->unk100 = shadow->marker;
shadow->position_y = func_80309724(this->position);
shadow->unk1C[0] = func_8038A860(shadow, this);
shadow->yaw = this->yaw;
func_8032AA58(shadow, this->scale);
}
void func_8038A948(Actor *this){
if(!this->initialized){
this->initialized = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
func_802C3C88((GenMethod_1)func_8038A8CC, (s32)this->marker);
this->velocity_y = 0.0f;
}
}
void func_8038A9C0(Actor *this){
Actor * sp24;
if(!this->initialized){
this->initialized = TRUE;
this->velocity_y = 0.0f;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
func_802C3C88((GenMethod_1)func_8038A8CC, (s32)this->marker);
sp24 = func_80329980(this);
this->unk1C[1] = this->unk48;
this->pitch = 0.0f;
this->yaw = 90.0f;
}
if(this->unk100)
sp24 = func_80329980(this);
if(this->velocity_y != 0.0f){
func_80343DEC(this);
if(this->unk48 < this->unk1C[1]){
this->velocity_y = 0.0f;
}
this->unk1C[2] = this->unk1C[1];
this->unk1C[1] = this->unk48;
if(this->unk100 && sp24 && this->unk100->unk14_20 == MARKER_AF_MAGIC_CARPET_SHADOW){
sp24->unk1C[0] = func_8038A860(sp24, this);
}
}
this->pitch = 0.0f;
this->yaw = 90.0f;
}

325
src/GV/code_4740.c Normal file
View File

@@ -0,0 +1,325 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
f32 func_80257204(f32, f32, f32, f32);
void func_8038B124(Actor *this);
/* .data */
ActorAnimationInfo D_80391040[] ={
{0x00, 0.0f},
{0xE9, 800000.0f},
{0xE9, 0.8f},
{0xEA, 1.0f},
{0xEA, 2.0f},
{0xEB, 0.8f},
{0xEB, 800000.0f},
{0xEC, 1.2f},
{0xEF, 1.4f},
{0xEE, 1.4f},
{0xEE, 1.4f}
};
ActorInfo D_80391098 = { MARKER_AD_SLAPPA, ACTOR_120_SLAPPA, ASSET_376_MODEL_SLAPPA,
0x1, D_80391040,
func_8038B124, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
s32 D_803910BC[3] = {175, 100, 0};
s32 D_803910C8[3] = {175, 140, 0};
struct43s D_803910D4 = {
{{-120.0f, 550.0f, -120.0f}, {120.0f, 950.0f, 120.0f}},
{{0.0f, -1400.0f, 0.0f}, {0.0f, -1400.0f, 0.0f}},
{{-100.0f, 0.0f, -100.0f}, {100.0f, 30.0f, 100.0f}}
};
/* .bss */
f32 D_80391A70[3];
/* .code */
void func_8038AB30(ParticleEmitter *pCtrl, f32 position[3], s32 cnt){
if(map_get() != MAP_1A_GV_INSIDE_JINXY)
func_802EFFA8(pCtrl, D_803910BC);
else
func_802EFFA8(pCtrl, D_803910C8);
func_802EF9E4(pCtrl, 0xBE);
particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST);
func_802EFA5C(pCtrl, 0.0f, 0.01f);
particleEmitter_setStartingFrameRange(pCtrl, 0, 7);
particleEmitter_setPosition(pCtrl, position);
}
void func_8038ABD8(f32 position[3], s32 cnt){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
func_8038AB30(pCtrl, position, cnt);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-40.0f, -5.0f, -40.0f,
60.0f, 20.0f, 60.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-100.0f, 10.0f, -100.0f,
100.0f, 60.0f, 100.0f
);
func_802EFB70(pCtrl, 0.1f, 0.5f);
func_802EFB84(pCtrl, 1.2f, 2.6f);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 0.5f, 1.4f);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038ACEC(f32 pos[3], s32 cnt){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
func_8038AB30(pCtrl, pos, cnt);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-80.0f, 20.0f, -80.0f,
120.0f, 120.0f, 120.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-200.0f, 20.0f, -200.0f,
300.0f, 120.0f, 200.0f
);
func_802EFB70(pCtrl, 1.0f, 2.6f);
func_802EFB84(pCtrl, 3.0f, 5.5f);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 1.2f, 3.2f);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038ADFC(f32 pos[3], s32 cnt){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
particleEmitter_setModel(pCtrl, 0x389);
particleEmitter_setPosition(pCtrl, pos);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_803910D4);
func_802EFE24(pCtrl, -500.0f, -500.0f, -500.0f, 500.0f, 500.0f, 500.0f);
func_802EF9F8(pCtrl, 0.6f);
func_802EFA18(pCtrl, 2);
func_802EFB70(pCtrl, 1.0f, 1.0f);
func_802EFA70(pCtrl, 2);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 4.0f, 6.0f);
func_802EFA5C(pCtrl, 0.0f, 0.05f);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038AF10(Actor *this){
animctrl_setSmoothTransition(this->animctrl, TRUE);
func_80328B8C(this, 3, 0.00001f, 1);
actor_loopAnimation(this);
this->unk28 = 16.0f;
this->unk1C[0] = 1.0f;
}
int func_8038AF78(Actor *this, f32 arg1, f32 arg2){
this->unk28 = arg2;
this->yaw_moving = (f32)func_80329784(this);
func_80328FB0(this, arg1);
if(!func_80329030(this, 0) && func_80329480(this))
return 0;
return 1;
}
void func_8038AFF4(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
func_8032B4DC(this, other_marker, 0xC);
actor_collisionOff(this);
func_80328B8C(this, ASSET_9_ANIM_BANJO_DIE, 0.00001f, 1);
actor_playAnimationOnce(this);
this->unk1C[0] = 0.0f;
func_8030E878(SFX_D7_GRABBA_DEATH, 1.0f, 32000, this->position, 2250.0f, 4500.0f);
}
void func_8038B08C(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
func_8032B4DC(this, other_marker, 0xC);
}
void func_8038B0BC(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
func_8030E878(SFX_3F5_UNKNOWN, randf2(0.95f, 1.05f), 32000, this->position, 2250.0f, 4500.0f);
}
void func_8038B124(Actor *this){
if(!this->initialized){
this->initialized = TRUE;
this->unk38_31 = 0;
this->unk1C[0] = 0.0f;
this->unk1C[2] = 240.0f;
this->velocity_x = this->position_x;
this->velocity_y = this->position_y;
this->velocity_z = this->position_z;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(this->state == 0xa)
marker_despawn(this->marker);
marker_setCollisionScripts(this->marker, func_8038B0BC, func_8038B08C, func_8038AFF4);
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOn(this);
this->unk138_27 = 1;
this->unk1C[1] = 0.0f;
if(this->unk44_31 == 0){
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 0.1f);
sfxsource_setSampleRate(this->unk44_31, 32000);
}
}//L8038B25C
if(!actor_playerIsWithinDist(this, 4500)) return;
this->unk58_0 = TRUE;
switch(this->state){
case 1: //L8038B2A4
this->unk58_0 = FALSE;
if(0.0 < this->unk1C[1]){
this->unk1C[1] = MAX((f64)(this->unk1C[1] - time_getDelta()), 0.0);
}//L8038B33C
if( this->unk1C[1] == 0.0
&& func_80329530(this, 0x320)
&& func_803292E0(this)
){
animctrl_setSmoothTransition(this->animctrl, 0);
func_80328B8C(this, 2, 0.00001f, 1);
actor_playAnimationOnce(this);
this->yaw = (f32)func_80329784(this);
this->unk28 = 0.0f;
this->unk1C[0] = 1.0f;
func_802BB3DC(0, 14.0f, 0.92f);
func_8038ABD8(this->position, 8);
}
else{//L8038B3E0
this->yaw_moving = func_80257204(this->position_x, this->position_z, this->velocity_x, this->velocity_z);
func_80328FB0(this, 18.0f);
this->unk28 = 18.0f;
func_80329030(this, 0);
animctrl_setAnimTimer(this->animctrl, 0.0f);
}
break;
case 2: //L8038B430
func_8030E2C4(this->unk44_31);
if(0.98 < animctrl_getAnimTimer(this->animctrl)){
func_8038AF10(this);
}
else{
this->yaw_moving = func_80329784(this);
func_80328FB0(this, 8.0f);
}
break;
case 3: //L8038B494
func_8030E2C4(this->unk44_31);
if(func_80329530(this, 175)){
func_80328B8C(this, 4, 0.00001f, 1);
actor_loopAnimation(this);
this->unk1C[0] = 1.0f;
}
else if(!func_80329530(this, 1100) || !func_8038AF78(this, 8.0f, 16.0f)){
func_80328B8C(this, 8, 0.00001f, 1);
actor_playAnimationOnce(this);
this->unk1C[0] = 1.0f;
func_802BB3DC(0, 6.0f, 0.92f);
func_8038ABD8(this->position, 8);
}
else{
D_80391A70[0] = 2*this->unk28;
D_80391A70[1] = 0.0f;
D_80391A70[2] = 0.0f;
ml_vec3f_yaw_rotate_copy(D_80391A70, D_80391A70, this->yaw - 90.0);
D_80391A70[0] = D_80391A70[0] + this->position[0];
D_80391A70[1] = D_80391A70[1] + this->position[1];
D_80391A70[2] = D_80391A70[2] + this->position[2];
func_8038ABD8(D_80391A70, 1);
}
break;
case 4: //L8038B5F0
this->yaw_moving = func_80329784(this);
func_80328FB0(this, 8.0f);
if(this->unk38_31 >= 20){
func_80328B8C(this, 5, 0.00001f, 1);
actor_playAnimationOnce(this);
this->unk38_31 = 0;
this->unk1C[0] = 1.0f;
}
else{//L8038B660
this->unk38_31++;
}
break;
case 5: //L8038B67C
if(this->marker->unk14_21 && actor_animationIsAt(this, 0.79f)){
func_8034A174(this->marker->unk44, 5, D_80391A70);
func_8038ACEC(D_80391A70, 2);
func_8034A174(this->marker->unk44, 6, D_80391A70);
func_8038ACEC(D_80391A70, 3);
func_802BB3DC(0, 18.0f, 0.92f);
func_8030E878(SFX_3_DULL_CANNON_SHOT, 1.0f, 32000, this->position, 2250.0f, 4500.0f);
}//L8038B734
if(0.98 < animctrl_getAnimTimer(this->animctrl)){
func_80328B8C(this, 6, 0.99f, 0);
actor_playAnimationOnce(this);
this->unk60 = 0.0f;
this->unk1C[0] = 1.0f;
}
break;
case 6: //L8038B78C
if(75.0f <= this->unk60){
func_80328B8C(this, 7, 0.00001f, 1);
actor_playAnimationOnce(this);
this->unk1C[0] = 1.0f;
}
else{
this->unk60 += 1.0f;
}
break;
case 7: //L8038B7EC
if(0.98 < animctrl_getAnimTimer(this->animctrl)){
func_8038AF10(this);
}
break;
case 8: //L8038B820
if(0.98 < animctrl_getAnimTimer(this->animctrl)){
func_80328B8C(this, 1, 0.00001f, 1);
this->unk1C[0] = 0.0f;
this->unk1C[1] = 2.0f;
}
break;
case 9: //L8038B870
func_80328A84(this, 0xA);
func_8038ACEC(this->position, 2);
func_8034A174(this->marker->unk44, 5, D_80391A70);
func_8038ACEC(D_80391A70, 2);
func_8038ADFC(D_80391A70, 3);
func_8034A174(this->marker->unk44, 6, D_80391A70);
func_8038ACEC(D_80391A70, 3);
func_8038ADFC(D_80391A70, 2);
break;
case 10: //L8038B900
this->unk58_0 = FALSE;
if(0.0f != this->unk1C[2]){
this->unk1C[2] -= 1.0f;
}
else{
marker_despawn(this->marker);
}
break;
}
}

323
src/GV/code_5570.c Normal file
View File

@@ -0,0 +1,323 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8025AE50(s32, f32);
extern void func_8028F710(s32, f32);
typedef struct {
s32 unk0;
}ActorLocal_Grabba;
void func_8038BEA0(Actor *this);
/* .data */
ActorAnimationInfo D_80391120[] ={
{0x00, 0.0f},
{ASSET_C5_ANIM_GRABBA_APPEAR, 8000000.0f},
{ASSET_C5_ANIM_GRABBA_APPEAR, 1.6f},
{ASSET_C7_ANIM_GRABBA_IDLE, 1.8f},
{ASSET_C6_ANIM_GRABBA_HIDE, 0.55f},
{ASSET_C8_ANIM_GRABBA_DEFEATED, 0.8f},
{ASSET_C7_ANIM_GRABBA_IDLE, 1.8f}
};
ActorInfo D_80391158 = { MARKER_A6_GRABBA, ACTOR_118_GRABBA, ASSET_371_MODEL_GRABBA,
0x1, D_80391120,
func_8038BEA0, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
s32 D_8039117C[3] = {160, 100, 0};
/* .bss */
extern s32 D_80391A80;
/* .code */
void func_8038B960(void){
func_8025AE50(5000, 3.19f);
}
/* .bss */
extern s32 D_80391A80;
/* .code */
void func_8038B988(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
func_80328B8C(this, 5, 0.01f, 1);
actor_loopAnimation(this);
func_802BAFE4(0x13);
FUNC_8030E624(SFX_8D_BOGGY_OHWW, 0.9f, 32000);
timedFunc_set_0(2.5f, func_8038B960);
D_80391A80 = this->state;
}
void func_8038BA08(Actor *this){
func_80328B8C(this, 6, 0.01f, 1);
actor_loopAnimation(this);
this->unk100 = NULL;
D_80391A80 = 3;
if(func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS)
func_8028F710(3, 0.0f);
func_80311480(ASSET_A79_TEXT_GRABBA_DEFEAT, 0xf, this->position, this->marker, func_8038B988, NULL);
comusic_8025AB44(COMUSIC_57_TURBO_TRAINERS, 7000, 700);
}
s32 func_8038BAA4(Actor *jiggy){
s32 tmp_v0;
s32 sp18[3];
map_get();
sp18[0] = (s32)jiggy->position_x;
sp18[1] = (s32)jiggy->position_y;
sp18[2] = (s32)jiggy->position_z;
tmp_v0 = func_80307164(sp18, jiggy);
if( tmp_v0 < 0)
return 0;
else
return func_80306DBC(tmp_v0) + 1;
}
int func_8038BB24(Actor *this){
if(func_80329530(this, 1560) && !func_80329530(this, 1380)){
return TRUE;
}
else{
return FALSE;
}
}
void func_8038BB6C(Actor *jiggy, ActorMarker * grabba_marker)
{
Actor *grabba;
ActorLocal_Grabba *grabba_local;
ActorMarker *tmp = reinterpret_cast(ActorMarker *, grabba_marker);
grabba = marker_getActor(tmp);
grabba_local = (ActorLocal_Grabba *)&grabba->local;
grabba->unk100 = jiggy->marker;
grabba_local->unk0 = grabba->unk100->unk5C;
jiggy->unk10_1 = TRUE;
grabba->unk1C[2] = (f32)func_8038BAA4(jiggy);
if(jiggyscore_isCollected((s32)grabba->unk1C[2])){
func_8038C748();
marker_despawn(grabba->marker);
}
}
void func_8038BBFC(ParticleEmitter *pCtrl, f32 position[3], s32 cnt){
func_802EFFA8(pCtrl, D_8039117C);
func_802EF9E4(pCtrl, 0x96);
particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST);
func_802EFA5C(pCtrl, 0.0f, 0.01f);
particleEmitter_setStartingFrameRange(pCtrl, 0, 7);
particleEmitter_setPosition(pCtrl, position);
}
void func_8038BC7C(f32 position[3], s32 cnt){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
func_8038BBFC(pCtrl, position, cnt);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-60.0f, 0.0f, -60.0f,
60.0f, 30.0f, 60.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-250.0f, 10.0f, -250.0f,
250.0f, 110.0f, 250.0f
);
func_802EFB70(pCtrl, 0.1f, 0.5f);
func_802EFB84(pCtrl, 2.0f, 2.6f);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 0.5f, 1.4f);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038BD8C(f32 position[3], s32 cnt){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
func_8038BBFC(pCtrl, position, cnt);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-40.0f, 0.0f, -40.0f,
40.0f, 30.0f, 40.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-100.0f, 20.0f, -100.0f,
100.0f, 60.0f, 100.0f
);
func_802EFB70(pCtrl, 0.1f, 0.5f);
func_802EFB84(pCtrl, 1.2, 1.6f);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 0.5f, 1.4f);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038BEA0(Actor *this){
ActorLocal_Grabba *local = (ActorLocal_Grabba *)&this->local;
f32 sp38[3];
if(!this->initialized){
this->initialized = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
this->unk38_31 = 0;
this->unk1C[1] = this->position_y;
D_80391A80 = this->state;
func_80333270(JIGGY_3E_GV_GRABBA, this->position, func_8038BB6C, this->marker);
}//L8038BF24
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(this->unk44_31 == 0){
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 0.1f);
sfxsource_setSampleRate(this->unk44_31, 32000);
}
if(this->unk100 == NULL){
this->unk100 = func_8032B16C(JIGGY_3E_GV_GRABBA);
local->unk0 = this->unk100 != NULL ? this->unk100->unk5C : NULL;
}
func_80328B8C(this, this->state, 0.01f, 1);
this->unk58_0 = FALSE;
this->marker->propPtr->unk8_3 = FALSE;
}//L8038BFF4
if(actor_playerIsWithinDist(this, 4000) || this->state == 5){
this->unk58_0 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
switch(this->state){
case 1: //L8038C064
this->unk58_0 = FALSE;
this->marker->propPtr->unk8_3 = FALSE;
if(func_8038BB24(this)){
func_80328B8C(this, 2, 0.01f, 1);
actor_playAnimationOnce(this);
this->unk38_31 = 0;
D_80391A80 = this->state;
func_802BB3DC(0, 14.0f, 0.92f);
func_802C3F04((GenMethod_4)func_802C4140, 0x11f,
reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z)
);
}
break;
case 2: //L8038C108
if(actor_animationIsAt(this, 0.69f)){
func_80328B8C(this, 3, 0.01f, 1);
actor_loopAnimation(this);
D_80391A80 = this->state;
if(this->unk100){
this->unk100->collidable = TRUE;
}
}
else{
if(animctrl_getAnimTimer(this->animctrl) < 0.55){
func_8030E2C4(this->unk44_31);
if(randf() < 0.6){
func_8038BC7C(this->position, 0xA);
}
}
}
break;
case 3: //L8038C1CC
if(this->unk100 && this->unk100->unk5C != local->unk0){
func_8038BA08(this);
}
else if(this->unk38_31 >= 0xC){
func_80328B8C(this, 4, 0.01f, 1);
actor_playAnimationOnce(this);
D_80391A80 = this->state;
func_802BB3DC(0, 12.0f, 0.92f);
}
else if(func_80329530(this, 600)){
if(func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS){
this->unk38_31++;
}
else{
this->unk38_31 += 4;
}
}
else{
if(!this->unk138_24){
if(func_80311480(ASSET_A78_TEXT_GRABBA_MEET, 0, NULL, NULL, NULL, NULL)){
this->unk138_24 = TRUE;
}
}
}
break;
case 4: //L8038C304
if(this->unk100 && this->unk100->unk5C != local->unk0){
func_8038BA08(this);
}
else if(actor_animationIsAt(this, 0.89f)){
func_80328B8C(this, 1, 0.01f, 1);
actor_loopAnimation(this);
D_80391A80 = this->state;
}
else{
if(0.35 < animctrl_getAnimTimer(this->animctrl)){
func_8030E2C4(this->unk44_31);
if(randf() < 0.6){
func_8038BC7C(this->position, 5);
}
}
if(actor_animationIsAt(this, 0.4f)){
if(this->unk100){
this->unk100->collidable = FALSE;
func_8030E878(SFX_3F5_UNKNOWN, randf2(0.95f, 1.05f), 32000, this->position, 1250.0f, 2500.0f);
}
if(!this->unk138_23){
if(func_80311480(ASSET_A7A_TEXT_GRABBA_TOO_FAST, 0, NULL, NULL, NULL, NULL)){
this->unk138_23 = TRUE;
}
}
}
}
break;
case 5: //L8038C488
if(this->position_y <= this->unk1C[1] - 330.0f){
marker_despawn(this->marker);
func_8038C748();
}
else{
func_8030E2C4(this->unk44_31);
this->position_y -= 7.0;
if(func_8023DB5C() & 1){
sp38[0] = this->position_x;
sp38[1] = this->position_y;
sp38[2] = this->position_z;
sp38[1] = this->unk1C[1];
func_8038BD8C(sp38, 1);
}
}
break;
}//L8038C528
if(this->unk100 && this->unk100->unk5C == local->unk0){
Actor *tmp_v0;
tmp_v0 = func_80329980(this);
if(this->marker->unk14_21){
func_8034A174(this->marker->unk44, 5, tmp_v0->position);
}
else{
tmp_v0->position_x = this->position_x;
tmp_v0->position_y = this->position_y;
tmp_v0->position_z = this->position_z;
tmp_v0->position_y -= 200.0f;
}
}
}//L8038C5AC
}
s32 func_8038C5BC(void){
return D_80391A80;
}

Some files were not shown because too many files have changed in this diff Show More