The first commit
This commit is contained in:
37
src/CCW/code_0.c
Normal file
37
src/CCW/code_0.c
Normal 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
125
src/CCW/code_14B0.c
Normal 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
217
src/CCW/code_160.c
Normal 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
162
src/CCW/code_1B20.c
Normal 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
34
src/CCW/code_21A0.c
Normal 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
207
src/CCW/code_2270.c
Normal 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
170
src/CCW/code_2B00.c
Normal 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
69
src/CCW/code_3050.c
Normal 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
251
src/CCW/code_3310.c
Normal 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
187
src/CCW/code_3DA0.c
Normal 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
107
src/CCW/code_4530.c
Normal 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
100
src/CCW/code_4960.c
Normal 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
83
src/CCW/code_4D00.c
Normal 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
98
src/CCW/code_50D0.c
Normal 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
171
src/CCW/code_5540.c
Normal 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
123
src/CCW/code_5BF0.c
Normal 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
100
src/CCW/code_61E0.c
Normal 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
114
src/CCW/code_6620.c
Normal 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
114
src/CCW/code_6AC0.c
Normal 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
79
src/CCW/code_6EC0.c
Normal 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
114
src/CCW/code_7120.c
Normal 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
40
src/CCW/code_7570.c
Normal 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
155
src/CCW/code_76C0.c
Normal 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
20
src/CCW/code_7BC0.c
Normal 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
117
src/CCW/code_7BF0.c
Normal 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
178
src/CCW/code_8050.c
Normal 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
31
src/CCW/code_8670.c
Normal 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
215
src/CCW/code_950.c
Normal 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));
|
||||
}
|
Reference in New Issue
Block a user