remove "done" folders, label "bs/droneenter, bs/dronelook, and bs/dronevanish files and functions"
This commit is contained in:
24
src/BGS/ch/bigalligator.c
Normal file
24
src/BGS/ch/bigalligator.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void func_8038FCB0(Actor *);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80390D70 = {MARKER_DC_BIG_ALLIGATOR, ACTOR_F6_BIG_ALLIGATOR, ASSET_397_MODEL_BIG_ALLIGATOR, 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/ch/code_2270.c
Normal file
347
src/BGS/ch/code_2270.c
Normal file
@@ -0,0 +1,347 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
void func_80324E88(f32);
|
||||
void BGS_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 = {
|
||||
MARKER_19A_TIPTUP, ACTOR_27A_TIPTUP, ASSET_3F8_MODEL_TIPTUP,
|
||||
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 BGS_func_80388660(ActorMarker *this){
|
||||
BGS_func_803888E4(marker_getActor(this), 6);
|
||||
}
|
||||
|
||||
void BGS_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);
|
||||
BGS_func_803888E4(thisActor, 5);
|
||||
}
|
||||
|
||||
void func_8038873C(void){
|
||||
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
|
||||
}
|
||||
|
||||
void BGS_func_80388760(void){
|
||||
func_8025A6EC(COMUSIC_2C_BUZZER, 28000);
|
||||
}
|
||||
|
||||
void func_80388784(ActorMarker *this, enum asset_e text_id, s32 arg2){
|
||||
Actor *thisActor;
|
||||
|
||||
thisActor = marker_getActor(this);
|
||||
switch(text_id){
|
||||
case 0xc72:
|
||||
case 0xc74:
|
||||
BGS_func_803888E4(thisActor, 3);
|
||||
break;
|
||||
case 0xc78:
|
||||
case 0xc7a:
|
||||
case 0xc7c:
|
||||
BGS_func_803888E4(thisActor, 4);
|
||||
break;
|
||||
case 0xc77:
|
||||
case 0xc79:
|
||||
func_80324E38(0.0f, 0);
|
||||
BGS_func_803888E4(thisActor, 3);
|
||||
break;
|
||||
case 0xc7b:
|
||||
timedFunc_set_0(0.0f, BGS_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{
|
||||
BGS_func_80388660(thisActor->marker);
|
||||
}
|
||||
}
|
||||
|
||||
void BGS_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, (GenMethod_2) func_803886B4, reinterpret_cast(s32, this->marker), rand2);
|
||||
timedFunc_set_2(tmpf + 0.1, (GenMethod_2)func_803886B4, reinterpret_cast(s32, 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, (GenMethod_1)func_803886F4, reinterpret_cast(s32, 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, (GenMethod_2)func_803886B4, reinterpret_cast(s32, this->marker), s1->unk0);
|
||||
timedFunc_set_2(tmpf + 0.1, (GenMethod_2)func_803886B4, reinterpret_cast(s32, 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, (GenMethod_1)func_80388848, reinterpret_cast(s32, thisActor->marker));
|
||||
}
|
||||
else{
|
||||
func_8028F55C(1, thisActor->marker);
|
||||
timedFunc_set_0(0.5f, BGS_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 player_position[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;
|
||||
}
|
||||
BGS_func_803888E4(this, 1);
|
||||
if(jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP) && !func_803203FC(2) && !func_803203FC(1))
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
else{
|
||||
player_getPosition(player_position);
|
||||
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, player_position, &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);
|
||||
BGS_func_803888E4(this, 3);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(ml_vec3f_distance(this->position, player_position) < 300.0f && player_getTransformation() == TRANSFORM_1_BANJO && !jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP)){
|
||||
BGS_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, player_position) >= 300.0f)
|
||||
BGS_func_803888E4(this, 1);
|
||||
}
|
||||
}//L803893A0
|
||||
if(this->state == 6){
|
||||
if(ml_vec3f_distance(this->position, player_position) < 300.0f && !unqPtr->unk8){
|
||||
unqPtr->unk8 = 1;
|
||||
func_80311480(0xc7d, 4, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
203
src/BGS/ch/code_6730.c
Normal file
203
src/BGS/ch/code_6730.c
Normal file
@@ -0,0 +1,203 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
|
||||
void chfrogminigame_update(Actor *);
|
||||
void chFrogMinigame_setState(Actor * arg0, u32 arg1);
|
||||
void func_8025A58C(u32, u32);
|
||||
void func_80324E88(f32);
|
||||
|
||||
|
||||
ActorInfo BGS_D_80390AB0 = {MARKER_C4_YELLOW_FLIBBIT_CTRL, ACTOR_136_YELLOW_FLIBBIT_CONTROLLER, 0x00, 0x00, NULL,
|
||||
chfrogminigame_update, NULL, func_80325340,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
|
||||
/* .bss */
|
||||
u8 D_80391240[4];
|
||||
|
||||
/* .code */
|
||||
static void __chFrogMinigame_spawnJiggy(void){
|
||||
static f32 D_80390AD4[3] = {1985.0f, 200.0f, -1386.0f};
|
||||
jiggySpawn(JIGGY_24_BGS_FLIBBITS, D_80390AD4);
|
||||
}
|
||||
|
||||
static void __chFrogMinigame_textCallback(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
Actor *actPtr = marker_getActor(marker);
|
||||
mapSpecificFlags_set(0x10, 0);
|
||||
if(actPtr->state == 4){
|
||||
chFrogMinigame_setState(actPtr,5);
|
||||
}
|
||||
else{
|
||||
chFrogMinigame_setState(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 chFrogMinigame_setState(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, __chFrogMinigame_textCallback, 0);
|
||||
}else{
|
||||
if(!arg0->bgs_6730.unk8){
|
||||
func_80311480(text_flibbits_return, 0x4, arg0->position, arg0->marker, __chFrogMinigame_textCallback, 0);
|
||||
}
|
||||
else{
|
||||
__chFrogMinigame_textCallback(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, __chFrogMinigame_textCallback, 0);
|
||||
}
|
||||
if(arg1 == 5){
|
||||
func_80324E38(0.0f, 3);
|
||||
timed_setCameraToNode(0.0f, 0x27);
|
||||
timedFunc_set_0(0.2f, __chFrogMinigame_spawnJiggy);
|
||||
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 BGS_func_8038CED0(void){
|
||||
D_80391240[3]++;
|
||||
}
|
||||
|
||||
void chfrogminigame_update(Actor *this){
|
||||
f32 player_position[3];
|
||||
u32 sp28;
|
||||
ActorLocal_BGS_6730 *local;
|
||||
|
||||
local = &this->bgs_6730;
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = 1;
|
||||
local->unk0 = 0;
|
||||
local->unk4 = 0;
|
||||
local->unk8 = 0;
|
||||
local->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)){
|
||||
chFrogMinigame_setState(this,6);
|
||||
return;
|
||||
}else{
|
||||
chFrogMinigame_setState(this,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(D_80391240[0]>0){
|
||||
local->unk8 += D_80391240[0];
|
||||
local->unkC -= D_80391240[0];
|
||||
D_80391240[0] = 0;
|
||||
}
|
||||
if(D_80391240[1]>0){
|
||||
local->unk8 -= D_80391240[1];
|
||||
D_80391240[1] = 0;
|
||||
}
|
||||
if(D_80391240[2]>0){
|
||||
local->unk8 -= D_80391240[2];
|
||||
local->unkC += D_80391240[2];
|
||||
D_80391240[2] = 0;
|
||||
}
|
||||
if(D_80391240[3]>0){
|
||||
local->unkC += D_80391240[3];
|
||||
D_80391240[3] = 0;
|
||||
}
|
||||
player_getPosition(player_position);
|
||||
sp28 = (player_position[1] < 500.0f) && (func_80329210(this, player_position) != 0);
|
||||
if(this->state == 1){
|
||||
if(sp28 && ((local->unk8 > 0) || (local->unkC > 0)) && !func_8028FB48(0xe000)){
|
||||
chFrogMinigame_setState(this,2);
|
||||
}
|
||||
else{
|
||||
//L8038D0E0
|
||||
if(local->unk4 && !local->unk8){
|
||||
func_8038CBB4(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this->state == 3){
|
||||
if(!sp28){
|
||||
chFrogMinigame_setState(this, 1);
|
||||
}else{
|
||||
if(local->unk8 < 2 && local->unkC > 0){
|
||||
mapSpecificFlags_set(0x12, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this->state == 1 || this->state == 3){
|
||||
if( (local->unk0)
|
||||
&& !jiggyscore_isSpawned(JIGGY_24_BGS_FLIBBITS)
|
||||
&& !local->unk8
|
||||
&& !local->unkC
|
||||
){
|
||||
chFrogMinigame_setState(this, 4);
|
||||
}
|
||||
}
|
||||
}
|
108
src/BGS/ch/code_8A60.c
Normal file
108
src/BGS/ch/code_8A60.c
Normal file
@@ -0,0 +1,108 @@
|
||||
#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 = {MARKER_F5_BGS_ELEVATED_WALKWAY_SWITCH, ACTOR_14E_BGS_ELEVATED_WALKWAY_SWITCH, ASSET_3F5_BGS_JIGGY_SWITCH, 1, D_80390B90, func_8038EEA4, func_80326224, func_80325888, 0, 0, 0.0f, 0};
|
||||
ActorInfo D_80390BFC = {MARKER_FD_BGS_MAZE_SWITCH, ACTOR_1FB_BGS_MAZE_SWITCH, ASSET_3F5_BGS_JIGGY_SWITCH, 1, D_80390B90, func_8038F06C, func_80326224, func_80325888, 0, 0, 0.0f, 0};
|
||||
|
||||
void func_8038EE50(void){
|
||||
f32 sp24[3];
|
||||
|
||||
if(nodeProp_findPositionFromActorId(0x14d, sp24)){
|
||||
jiggySpawn(JIGGY_20_BGS_ELEVATED_WALKWAY, sp24);
|
||||
__spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM,
|
||||
reinterpret_cast(s32, sp24[0]),
|
||||
reinterpret_cast(s32, sp24[1]),
|
||||
reinterpret_cast(s32, sp24[2])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038EEA4(Actor *this){
|
||||
func_8038EA90();
|
||||
if(mapSpecificFlags_get(7)){
|
||||
mapSpecificFlags_set(7, 0);
|
||||
if(!mapSpecificFlags_get(3) || (item_getCount(0) > 0)){
|
||||
func_802D68F0(45);
|
||||
}
|
||||
}
|
||||
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(45);
|
||||
item_set(ITEM_6_HOURGLASS,1);
|
||||
} //L8038EFB4
|
||||
}
|
||||
|
||||
void func_8038F018(void){
|
||||
f32 sp24[3];
|
||||
|
||||
if(nodeProp_findPositionFromActorId(0x1fc, sp24)){
|
||||
jiggySpawn(JIGGY_25_BGS_MAZE, sp24);
|
||||
__spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM,
|
||||
reinterpret_cast(s32, sp24[0]),
|
||||
reinterpret_cast(s32, sp24[1]),
|
||||
reinterpret_cast(s32, sp24[2])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038F06C(Actor *this){
|
||||
func_8038EA90();
|
||||
if(mapSpecificFlags_get(8)){
|
||||
mapSpecificFlags_set(8, 0);
|
||||
if(!mapSpecificFlags_get(0xC) || (item_getCount(0) > 0)){
|
||||
func_802D68F0(10);
|
||||
}
|
||||
}
|
||||
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(10);
|
||||
item_set(ITEM_6_HOURGLASS,1);
|
||||
} //L8038EFB4
|
||||
}
|
129
src/BGS/ch/mudhut.c
Normal file
129
src/BGS/ch/mudhut.c
Normal file
@@ -0,0 +1,129 @@
|
||||
#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 *chmudhut_draw(ActorMarker *this, Gfx** gdl, Mtx** mtx, Vtx **vtx);
|
||||
void func_8038EB4C(ActorMarker *);
|
||||
void chmudhut_update(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 = {MARKER_D5_BGS_MUD_HUT, ACTOR_C_MUD_HUT, ASSET_7D8_MODEL_MM_HUT_TOP, 0x01, D_80390B30,
|
||||
chmudhut_update, func_80326224, chmudhut_draw,
|
||||
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 *chmudhut_draw(ActorMarker *this, Gfx** gdl, Mtx** mtx, Vtx **vtx){
|
||||
Actor *thisActor;
|
||||
|
||||
thisActor = marker_getActor(this);
|
||||
func_8033A45C(1, thisActor->state == 1);
|
||||
if(thisActor->state == 3)
|
||||
return thisActor;
|
||||
|
||||
return func_80325888(this, gdl, mtx, vtx);
|
||||
}
|
||||
|
||||
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 chmudhut_update(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);
|
||||
}
|
||||
__spawnQueue_add_1((GenMethod_1)func_8038EB4C, reinterpret_cast(s32, this->marker));
|
||||
if(tmp < 5){
|
||||
__spawnQueue_add_4((GenMethod_4)func_802C4218, D_80390B50[tmp],
|
||||
reinterpret_cast(s32, diffPos[0]),
|
||||
reinterpret_cast(s32, diffPos[1]),
|
||||
reinterpret_cast(s32, 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{
|
||||
|
||||
}
|
||||
}
|
126
src/BGS/ch/pinkegg.c
Normal file
126
src/BGS/ch/pinkegg.c
Normal file
@@ -0,0 +1,126 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
typedef struct chpinkegg_s{
|
||||
u32 unk0;
|
||||
u32 unk4;
|
||||
} ActorLocal_PinkEgg;
|
||||
|
||||
Actor *chpinkegg_draw(ActorMarker *this, Gfx ** gdl, Mtx** mptr, Vtx **vtx);
|
||||
void chpinkegg_collision(ActorMarker *this, ActorMarker *other_marker);
|
||||
void chpinkegg_update(Actor *this);
|
||||
|
||||
u32 D_803906C0 = 0x5B;
|
||||
enum actor_e D_803906C4[5] = {
|
||||
ACTOR_ED_PINK_EGG_LARGE,
|
||||
ACTOR_EE_PINK_EGG_MEDIUM,
|
||||
ACTOR_EF_PINK_EGG_SMALL,
|
||||
ACTOR_F0_PINK_EGG_SMALLEST,
|
||||
0x00
|
||||
};
|
||||
|
||||
ActorAnimationInfo D_803906D8[4] = {
|
||||
{0, 0.0f},
|
||||
{0, 0.0f},
|
||||
{0, 0.0f},
|
||||
{0x10B, 2.0f}
|
||||
};
|
||||
|
||||
ActorInfo D_803906F8 = {MARKER_6E_PINK_EGG_LARGEST, ACTOR_5B_PINK_EGG_LARGEST, ASSET_380_MODEL_PINK_EGG_LARGEST, 0x01, D_803906D8,
|
||||
chpinkegg_update, func_80326224, chpinkegg_draw,
|
||||
0, 0x2CC, 6.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_8039071C = {MARKER_D6_PINK_EGG_LARGE, ACTOR_ED_PINK_EGG_LARGE, ASSET_381_MODEL_PINK_EGG_LARGE, 0x01, D_803906D8,
|
||||
chpinkegg_update, func_80326224, chpinkegg_draw,
|
||||
0, 0x2CC, 5.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_80390740 = {MARKER_D7_PINK_EGG_MEDIUM, ACTOR_EE_PINK_EGG_MEDIUM, ASSET_382_MODEL_PINK_EGG_MEDIUM, 0x01, D_803906D8,
|
||||
chpinkegg_update, func_80326224, chpinkegg_draw,
|
||||
0, 0x2CC, 4.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_80390764 = {MARKER_D8_PINK_EGG_SMALL, ACTOR_EF_PINK_EGG_SMALL, ASSET_383_MODEL_PINK_EGG_SMALL, 0x01, D_803906D8,
|
||||
chpinkegg_update, func_80326224, chpinkegg_draw,
|
||||
0, 0x2CC, 3.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_80390788 = {MARKER_D9_PINK_EGG_SMALLEST, ACTOR_F0_PINK_EGG_SMALLEST, ASSET_384_MODEL_PINK_EGG_SMALLEST, 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;
|
||||
|
||||
}
|
||||
|
||||
Actor *chpinkegg_draw(ActorMarker *this, Gfx ** gdl, Mtx** mptr, Vtx **arg3){
|
||||
u32 sp18;
|
||||
u32 t7;
|
||||
|
||||
t7 = marker_getActor(this)->state == 3;
|
||||
func_8033A45C(1, NOT(sp18 = t7));
|
||||
func_8033A45C(2, sp18);
|
||||
return 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){
|
||||
__spawnQueue_add_2(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->depth_mode = 0x2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user