The first commit
This commit is contained in:
1885
src/lair/code_0.c
Normal file
1885
src/lair/code_0.c
Normal file
File diff suppressed because it is too large
Load Diff
424
src/lair/code_42A0.c
Normal file
424
src/lair/code_42A0.c
Normal file
@@ -0,0 +1,424 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern void func_8028F4B8(f32[3], f32, f32);
|
||||
extern void func_8028F66C(s32);
|
||||
extern void func_802D6310(f32, enum map_e, s32, s32, enum bkprog_e);
|
||||
extern void func_802EE354(Actor *, s32, s32, s32, f32, f32, f32, s32[4], s32, s32);
|
||||
extern void func_80324CFC(f32, enum comusic_e, s32);
|
||||
extern void func_8034DF30(s32, f32[4], f32[4], f32);
|
||||
|
||||
/* .h */
|
||||
typedef struct {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
u8 pad4[0x2];
|
||||
s16 unk6;
|
||||
}Struct_lair_42A0_0;
|
||||
|
||||
void func_8038AE2C(Actor *this);
|
||||
Actor *func_8038B898(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
|
||||
/* .data */
|
||||
extern ActorAnimationInfo D_80393520[];
|
||||
extern ActorInfo D_80393560 = { 0x231, 0x23B, 0x4DF, 0x1, D_80393520, func_8038AE2C, func_80326224, func_8038B898, 0, 0, 3.0f, 0};
|
||||
extern ActorInfo D_80393584 = { 0x244, 0x2DB, 0x450, 0x1, D_80393520, func_8038AE2C, func_80326224, func_8038B898, 0, 0, 3.0f, 0};
|
||||
extern f32 D_803935A8[][2][3];
|
||||
extern Struct_lair_42A0_0 D_80393620[];
|
||||
extern f32 D_80393670[];
|
||||
extern f32 D_80393688[];
|
||||
extern f32 D_803936A8[];
|
||||
extern f32 D_803936E4[];
|
||||
|
||||
/* .code */
|
||||
bool func_8038A690(Actor *this) {
|
||||
if (this->unkF4_8 != 3) {
|
||||
return func_803296B8(this, 0x190, 0x5A);
|
||||
}
|
||||
else{
|
||||
return func_80329628(this, 0x1F4, 0x104, 0x5A);
|
||||
}
|
||||
}
|
||||
|
||||
enum bkprog_e func_8038A6DC(Actor *this){
|
||||
return this->unkF4_8 + 0x48;
|
||||
}
|
||||
|
||||
enum bkprog_e func_8038A6EC(Actor *this){
|
||||
return ((this->unkF4_8 - 1) ^ 1) + 0x49;
|
||||
}
|
||||
|
||||
void func_8038A704(Actor *this){
|
||||
func_80328B8C(this, 3, 0.99f, 1);
|
||||
}
|
||||
|
||||
void func_8038A730(Actor *this, f32 *arg1, enum sfx_e arg2, enum sfx_e arg3, u32 arg4) {
|
||||
s32 i;
|
||||
|
||||
for(i = 0; arg1[i] != -1.0f; i++){
|
||||
if (actor_animationIsAt(this, arg1[i])) {
|
||||
if (arg3 != SFX_0_BLOOP) {
|
||||
func_8030E878((randf() < 0.5) ? arg2 : arg3, randf2(1.0f, 1.1f), arg4, this->position, 0.0f, 1200.0f);
|
||||
}
|
||||
else{
|
||||
func_8030E878(arg2, 1.0f, arg4, this->position, 0.0f, 1200.0f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038A864(Actor *this) {
|
||||
switch (this->state) {
|
||||
case 2:
|
||||
func_8038A730(this, D_80393670, SFX_3F_CAULDRON_SQEAK_1, SFX_40_CAULDRON_SQEAK_2, 11000);
|
||||
break;
|
||||
case 3:
|
||||
func_8038A730(this, D_80393688, SFX_3F_CAULDRON_SQEAK_1, SFX_40_CAULDRON_SQEAK_2, 11000);
|
||||
break;
|
||||
case 5:
|
||||
if (actor_animationIsAt(this, 0.5f)) {
|
||||
FUNC_8030E624(SFX_C5_TWINKLY_POP, 0.8f, 32000);
|
||||
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.596f)) {
|
||||
FUNC_8030E624(SFX_2D_KABOING, 0.85f, 32000);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
func_8038A730(this, D_803936A8, SFX_3F_CAULDRON_SQEAK_1, SFX_40_CAULDRON_SQEAK_2, 11000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038A96C(Actor *this, s32 arg1) {
|
||||
s32 sp5C;
|
||||
s32 i;
|
||||
f32 sp48[4];
|
||||
f32 sp38[4];
|
||||
|
||||
if( ( (arg1 != 3) || ( (this->unk1C[1] == 0.0f) && (this->marker->unk14_21 == 1)))
|
||||
&& (this->modelCacheIndex == 0x23B)
|
||||
&& ((arg1 != 0) || func_8031FF1C(func_8038A6DC(this)))
|
||||
){
|
||||
sp5C = func_8034C2C4(this->marker, 0x1C3);
|
||||
if(sp5C != 0){
|
||||
for(i = 0; i < 3; i++){
|
||||
sp48[i] = D_803935A8[(((s32)this->unkF4_8 - 1)>>1)][0][i];
|
||||
sp38[i] = D_803935A8[(((s32)this->unkF4_8 - 1)>>1)][1][i];
|
||||
|
||||
}
|
||||
sp48[3] = 1.0f;
|
||||
sp38[3] = 1.0f;
|
||||
if (arg1 == 2) {
|
||||
func_8034DF30(sp5C, sp38, sp38, 0.3f);
|
||||
}
|
||||
else{
|
||||
func_8034DF30(sp5C, sp48, sp38, func_8031FF1C(func_8038A6DC(this)) ? 0.3 : 3.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038AB90(Actor *this, s32 arg1, s32 arg2, enum sfx_e sfx_id, f32 sfx_timing) {
|
||||
if (arg2 == this->unk10_12) {
|
||||
if (this->unkF4_8 == 7) {
|
||||
func_80324CFC(0.5f, COMUSIC_8C_JINJONATOR_POWERUP, 32000);
|
||||
func_80324D2C(7.0f, COMUSIC_8C_JINJONATOR_POWERUP);
|
||||
}
|
||||
this->unk10_12 = 0;
|
||||
func_80328AC8(this, arg1);
|
||||
actor_playAnimationOnce(this);
|
||||
func_8028FCBC();
|
||||
if (sfx_id != SFX_0_BLOOP) {
|
||||
timed_playSfx(sfx_timing, sfx_id, 1.0f, 32000);
|
||||
if (arg2 == 2) {
|
||||
func_8025A6CC(COMUSIC_3F_MAGIC_CARPET_RISING, 32000);
|
||||
func_80324D2C(2.6f, COMUSIC_3F_MAGIC_CARPET_RISING);
|
||||
func_8030E540(SFX_7C_CHEBOOF);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void func_8038AC7C(Actor *this) {
|
||||
s32 sp2C;
|
||||
u32 sp28;
|
||||
|
||||
if(
|
||||
(func_803114C4() != 0xFAD)
|
||||
&& func_80329530(this, 1200)
|
||||
&& !func_8031FF1C(0xFC)
|
||||
) {
|
||||
this->unk60 += time_getDelta();
|
||||
if (35.0 < this->unk60) {
|
||||
sp2C = (func_8031FF1C(0xCF)) ? 0xFB7 : 0xFAE;
|
||||
sp28 = (func_8031FF1C(0xCF)) ? 0xFBC : 0xFB7;
|
||||
if (func_80311480(sp2C + this->unk38_31, 0, NULL, NULL, NULL, NULL)) {
|
||||
this->unk38_31++;
|
||||
this->unk60 = 0.0f;
|
||||
if (sp2C + this->unk38_31 >= sp28) {
|
||||
this->unk38_31 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void func_8038ADC0(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
func_80320004(0xF3, TRUE);
|
||||
}
|
||||
|
||||
bool func_8038ADF0(s32 arg0, s32 arg1) {
|
||||
s32 phi_v1;
|
||||
|
||||
phi_v1 = arg1 - arg0;
|
||||
while (phi_v1 < 0) { phi_v1 += 360; }
|
||||
while (phi_v1 >= 360) { phi_v1 -= 360;}
|
||||
return phi_v1 < 70;
|
||||
}
|
||||
|
||||
void func_8038AE2C(Actor *this) {
|
||||
f32 sp54[3];
|
||||
s32 sp50;
|
||||
s32 sp4C;
|
||||
s32 phi_v0;
|
||||
enum sfx_e phi_a0;
|
||||
f32 temp_f0;
|
||||
s32 sp3C;
|
||||
s32 sp38;
|
||||
f32 sp34;
|
||||
|
||||
func_8038A864(this);
|
||||
if (!this->unk16C_4) {
|
||||
sp50 = FALSE;
|
||||
this->unk16C_4 = TRUE;
|
||||
this->marker->propPtr->unk8_3 = TRUE;
|
||||
this->unk1C[1] = 0.0f;
|
||||
this->velocity[0] = this->yaw;
|
||||
if (this->modelCacheIndex == 0x2DB) {
|
||||
if (func_8031FF1C(0xF3)) {
|
||||
sp4C = (func_8031FF1C(0xCF)) ? 0xFB7 : 0xFAE;
|
||||
phi_v0 = (func_8031FF1C(0xCF)) ? 0xFBC : 0xFB7;
|
||||
this->unk60 = 35.0f;
|
||||
this->unk38_31 = randi2(0, phi_v0 - sp4C);
|
||||
}
|
||||
this->scale = 1.8f;
|
||||
func_80328B8C(this, 6, 0.99f, 1);
|
||||
func_802D09B8(this, 2);
|
||||
}
|
||||
if (func_8031FF1C(func_8038A6DC(this))) {
|
||||
func_8038A704(this);
|
||||
func_802D09B8(this, 2);
|
||||
func_8038A96C(this, 2);
|
||||
sp50 = TRUE;
|
||||
if( ( func_802D677C(-1) != 0
|
||||
&& (func_802D677C(-1) == D_80393620[this->unkF4_8 - 1].unk0)
|
||||
&& (func_802D67AC(-1) == MAP_16_GV_RUBEES_CHAMBER)
|
||||
&& (func_802D680C(-1) == this->unkF4_8)
|
||||
)
|
||||
|| (func_803348CC() == D_80393620[this->unkF4_8 - 1].unk2)
|
||||
) {
|
||||
func_8028F85C(this->position);
|
||||
this->unk10_12 = 1;
|
||||
func_8038AB90(this, 5, 1, 0, 0.0f);
|
||||
}
|
||||
if (!func_8031FF1C(0xF5) && func_8031FF1C(func_8038A6EC(this))) {
|
||||
if (func_802D677C(-1) != map_get()) {
|
||||
func_80311480(0xF7A, 4, NULL, NULL, NULL, NULL);
|
||||
func_80320004(0xF5, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sp50 == 0) {
|
||||
this->unk10_12 = 0;
|
||||
func_8038A96C(this, 0);
|
||||
}
|
||||
}
|
||||
switch(this->state){
|
||||
case 1: //L8038B0F4
|
||||
if (func_8038A690(this)) {
|
||||
func_8028F918(2);
|
||||
func_80328AC8(this, 2);
|
||||
this->unk38_0 = FALSE;
|
||||
func_8038A96C(this, 1);
|
||||
func_802BAFE4(D_80393620[this->unkF4_8 - 1].unk3);
|
||||
func_802D09B8(this, 2);
|
||||
phi_a0 = (func_8031FF1C(func_8038A6EC(this)) != 0) ? SFX_107_CAULDRON_ACTIVATION_1 : SFX_108_CAULDRON_ACTIVATION_2;
|
||||
func_8030E510(phi_a0, 0x7D00);
|
||||
if (!func_8031FF1C(0xF5) && !func_8031FF1C(func_8038A6EC(this))) {
|
||||
func_80311480(0xF79, 4, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
if (func_8031FF1C(func_8038A6EC(this))){
|
||||
switch(this->unkF4_8){
|
||||
case 2://L8038B204
|
||||
func_802D6310(2.0f, MAP_6A_GL_TTC_AND_CC_PUZZLE, 0x62, 0x22, 0);
|
||||
break;
|
||||
|
||||
case 1://L8038B228
|
||||
func_802D6310(2.0f, MAP_6F_GL_FP_LOBBY, 0x63, 0x23, 0);
|
||||
break;
|
||||
|
||||
case 4://L8038B24C
|
||||
func_802D6310(2.0f, MAP_6F_GL_FP_LOBBY, 0x64, 0x24, 0);
|
||||
break;
|
||||
|
||||
case 3://L8038B270
|
||||
func_802D6310(2.0f, MAP_77_GL_RBB_LOBBY, 0x65, 0x25, 0);
|
||||
break;
|
||||
|
||||
case 6://L8038B294
|
||||
func_802D6310(2.0f, MAP_6C_GL_RED_CAULDRON_ROOM, 0x66, 0x26, 0);
|
||||
break;
|
||||
|
||||
case 5://L8038B2B8
|
||||
func_802D6310(2.0f, MAP_79_GL_CCW_LOBBY, 0x67, 0x27, 0);
|
||||
break;
|
||||
|
||||
case 10://L8038B2DC
|
||||
func_802D6310(2.0f, MAP_8E_GL_FURNACE_FUN, 0x8C, 0x29, 0);
|
||||
break;
|
||||
|
||||
case 9://L8038B300
|
||||
func_802D6310(2.0f, MAP_93_GL_DINGPOT, 0x8D, 0x2A, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: //L8038B324
|
||||
temp_f0 = animctrl_getAnimTimer(this->animctrl);
|
||||
for(sp3C = 0; D_803936E4[sp3C] < temp_f0; sp3C++)
|
||||
;
|
||||
|
||||
this->unk38_0 = (sp3C & 1) ? TRUE : FALSE;
|
||||
if (actor_animationIsAt(this, 0.95f)) {
|
||||
func_8038A704(this);
|
||||
func_80320004(func_8038A6DC(this), 1);
|
||||
func_8028F918(0);
|
||||
this->unk1C[2] = 4.0f;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: //L8038B3DC
|
||||
this->unk38_0 = TRUE;
|
||||
if (this->unk1C[2] != 0.0f) {
|
||||
this->unk1C[2] = this->unk1C[2] - 1.0f;
|
||||
} else {
|
||||
func_8038AB90(this, 5, 1, 0, 0.0f);
|
||||
func_8038AB90(this, 4, 2, 0xA6, 2.6f);
|
||||
}
|
||||
func_8038A96C(this, 3);
|
||||
break;
|
||||
|
||||
case 7: //L8038B460
|
||||
this->unk38_0 = TRUE;
|
||||
if (actor_animationIsAt(this, 0.62f)) {
|
||||
func_8030E6D4(SFX_1B_EXPLOSION_1);
|
||||
}
|
||||
case 5: //L8038B48C
|
||||
func_8038A96C(this, 3);
|
||||
if (actor_animationIsAt(this, 0.01f)) {
|
||||
func_8030E540(SFX_7C_CHEBOOF);
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.63f)) {
|
||||
func_803204E4(0x1E, 0);
|
||||
func_802D677C(0);
|
||||
func_8028FCAC();
|
||||
nodeprop_getPosition(func_80304C38(D_80393620[this->unkF4_8 - 1].unk6, this), sp54);
|
||||
if (this->unkF4_8 == 7) {
|
||||
func_8028F66C(0x36);
|
||||
func_802BAFE4(0x82);
|
||||
} else {
|
||||
func_8028F4B8(sp54, 1620.0f, -4100.0f);
|
||||
}
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.98f)) {
|
||||
func_8038A704(this);
|
||||
actor_loopAnimation(this);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: //L8038B584
|
||||
func_8038A96C(this, 3);
|
||||
if (actor_animationIsAt(this, 0.99f)) {
|
||||
func_802D6344();
|
||||
func_802D677C(D_80393620[((this->unkF4_8 - 1) ^ 1)].unk0);
|
||||
func_802D67AC(0x16);
|
||||
func_802D680C(((this->unkF4_8 - 1) ^ 1) + 1);
|
||||
func_802D683C(D_80393620[((this->unkF4_8 - 1) ^ 1)].unk1);
|
||||
func_8031CC40(D_80393620[((this->unkF4_8 - 1) ^ 1)].unk0, D_80393620[((this->unkF4_8 - 1) ^ 1)].unk2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6: //L8038B64C
|
||||
if (func_8038A690(this) && !func_8031FF1C(0xF3)) {
|
||||
func_80311480(0xFAD, 0xA, this->position, NULL, func_8038ADC0, NULL);
|
||||
}
|
||||
this->unk38_0 = TRUE;
|
||||
|
||||
sp3C = 0;
|
||||
if (func_8031FF1C(0xFC)){
|
||||
if(jiggyscore_total() == 0x64){
|
||||
sp3C = 1;
|
||||
}
|
||||
}
|
||||
else{
|
||||
sp3C = 1;
|
||||
}
|
||||
if (sp3C != 0) {
|
||||
func_8038AB90(this, 7, 1, 0, 0.0f);
|
||||
}
|
||||
func_8038AC7C(this);
|
||||
sp38 = func_80329784(this);
|
||||
if( func_8038ADF0(sp38, (s32) this->velocity[0])
|
||||
|| func_8038ADF0((s32) this->velocity[0], sp38)
|
||||
) {
|
||||
this->yaw_moving = (f32) sp38;
|
||||
}
|
||||
func_80328FB0(this, 3.0f);
|
||||
if( actor_animationIsAt(this, 0.114f)
|
||||
|| actor_animationIsAt(this, 0.217f)
|
||||
|| actor_animationIsAt(this, 0.321f)
|
||||
) {
|
||||
sp34 = randf2(0.85f, 0.95f);
|
||||
func_8030E878(SFX_20_METAL_CLANK_1, sp34, 16000, this->position, 100.0f, 1750.0f);
|
||||
}
|
||||
if( actor_animationIsAt(this, 0.49f)
|
||||
|| actor_animationIsAt(this, 0.68f)
|
||||
) {
|
||||
sp34 = randf2(0.65f, 0.75f);
|
||||
func_8030E878(SFX_F9_GRUNTLING_NOISE_1, sp34, 16000, this->position, 100.0f, 1750.0f);
|
||||
}
|
||||
break;
|
||||
|
||||
}//L8038B854
|
||||
|
||||
this->unk1C[1] = (f32)this->marker->unk14_21;
|
||||
}
|
||||
|
||||
Actor *func_8038B898(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
|
||||
Actor *this;
|
||||
s32 sp3C[4];
|
||||
|
||||
this = marker_getActor(marker);
|
||||
if(this->modelCacheIndex == 0x23B) {
|
||||
func_8033A45C(3, this->unk38_0 ? TRUE : FALSE);
|
||||
func_8033A45C(4, this->unk38_0 ? FALSE : TRUE);
|
||||
}
|
||||
this = func_80325888(marker, gfx, mtx, vtx);
|
||||
if (marker->unk14_21 && this->unk38_0 && (getGameMode() != GAME_MODE_4_PAUSED)) {
|
||||
sp3C[1] = randi2(200, 255);
|
||||
sp3C[0] = randi2(150, sp3C[1]);
|
||||
sp3C[2] = 0;
|
||||
sp3C[3] = randi2(40, 80);
|
||||
if (func_8023DB5C() & 1) {
|
||||
func_802EE354(this, 0x3E9, 5, randi2(-10, 90), randf2(0.3f, 0.7f), 0.28f, 0.45f, sp3C, 5, 0);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
210
src/lair/code_5640.c
Normal file
210
src/lair/code_5640.c
Normal file
@@ -0,0 +1,210 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern f32 func_80258640(f32[3], f32[3]);
|
||||
|
||||
typedef struct {
|
||||
s32 unk0;
|
||||
} ActorLocal_lair_5640;
|
||||
|
||||
void func_8038BCF0(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_80393710[] ={
|
||||
{0, 0.0f},
|
||||
{0x26B, 4.0f},
|
||||
{0x26C, 4.0f},
|
||||
{0x26B, 4.0f},
|
||||
};
|
||||
ActorInfo D_80393730 = { 0x1E0, 0x348, 0x539, 0x1, D_80393710, func_8038BCF0, func_80326224, func_80325888, 2000, 0, 2.0f, 0};
|
||||
|
||||
/* .code */
|
||||
void func_8038BA30(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
Actor *this;
|
||||
s32 phi_v1;
|
||||
|
||||
this = marker_getActor(marker);
|
||||
phi_v1 = this->unk10_12*2;
|
||||
func_80320424(0x20 + this->unkF4_8*6 + phi_v1, 2);
|
||||
}
|
||||
|
||||
void func_8038BA88(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
Actor *this;
|
||||
|
||||
this = marker_getActor(marker);
|
||||
item_set(ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL));
|
||||
func_80320004(this->unkF4_8 + 0xE8, TRUE);
|
||||
}
|
||||
|
||||
void func_8038BADC(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
|
||||
Actor *this;
|
||||
|
||||
this = marker_getActor(marker);
|
||||
if (text_id == ((ActorLocal_lair_5640 *)&this->local)->unk0 + 2) {
|
||||
if (!func_8031FF1C(this->unkF4_8 + 0xE8)) {
|
||||
if (item_getCount(ITEM_14_HEALTH) < item_getCount(ITEM_15_HEALTH_TOTAL)) {
|
||||
func_80311480(0x10A2, 0xF, this->position, this->marker, func_8038BADC, func_8038BA88);
|
||||
return;
|
||||
}
|
||||
}
|
||||
func_80311480(0xD38, 0xC, this->position, this->marker, func_8038BADC, NULL);
|
||||
return;
|
||||
}
|
||||
func_80328A84(this, 1);
|
||||
}
|
||||
|
||||
void func_8038BBC0(Actor *this) {
|
||||
if (this->unk38_0) {
|
||||
comusic_8025AB44(COMUSIC_7A_BRENTILDA, 0, 10000);
|
||||
func_8025AABC(COMUSIC_7A_BRENTILDA);
|
||||
func_8032BB88(this, -1, 10000);
|
||||
this->unk38_0 = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038BC24(void) {
|
||||
s32 temp_v0;
|
||||
s32 phi_s0;
|
||||
s32 phi_s1;
|
||||
|
||||
if (func_8031FF1C(0x5C) && !func_803203FC(0x62)) {
|
||||
func_8034A8BC(func_8031FF44(0xD3, 8));
|
||||
for(phi_s1 = 0; phi_s1 < func_8031A45C(3); phi_s1++){
|
||||
phi_s0 = 0x26 + 2*phi_s1;
|
||||
temp_v0 = randi2(0, 3);
|
||||
if (phi_s0 >= 0x61) {
|
||||
func_80320524(0x26, temp_v0, 2);
|
||||
} else {
|
||||
func_80320524(phi_s0, temp_v0, 2);
|
||||
}
|
||||
}
|
||||
func_803204E4(0x62, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void func_8038BCF0(Actor *this) {
|
||||
s32 sp78[6];
|
||||
s32 sp74;
|
||||
ActorLocal_lair_5640 *local;
|
||||
f32 sp64[3];
|
||||
f32 temp_f0;
|
||||
f32 phi_f2;
|
||||
f32 sp50[3];
|
||||
s16 sp48[3];
|
||||
|
||||
|
||||
local = (ActorLocal_lair_5640 *)&this->local;
|
||||
if (!this->initialized) {
|
||||
func_803300D8(this->marker, func_8038BBC0);
|
||||
actor_collisionOff(this);
|
||||
this->unk10_12 = 2;
|
||||
if (!func_8031FF1C(0x5C)) {
|
||||
func_80320044(0xD3, randi2(0, 0x100), 8);
|
||||
func_80320004(0x5C, TRUE);
|
||||
}
|
||||
func_8038BC24();
|
||||
actor_setOpacity(this, 0x40);
|
||||
this->initialized = TRUE;
|
||||
}
|
||||
|
||||
if (!this->unk16C_4) {
|
||||
local->unk0 = this->unkF4_8*3 + 0x1080;
|
||||
this->unk16C_4 = TRUE;
|
||||
}
|
||||
|
||||
func_8028E668(this->position, 280.0f, -40.0f, 160.0f);
|
||||
this->yaw_moving = (f32) func_80329784(this);
|
||||
func_80328FB0(this, 3.0f);
|
||||
func_8024E55C(0, sp78);
|
||||
player_getPosition(sp64);
|
||||
temp_f0 = sp64[1] - this->position[1];
|
||||
if ((temp_f0 > -100.0f) && (temp_f0 < 350.0f)) {
|
||||
phi_f2 = func_80258640(sp64, this->position);
|
||||
} else {
|
||||
phi_f2 = 2000.0f;
|
||||
}
|
||||
if ((phi_f2 < 500.0) && (this->unk38_31 & 1)) {
|
||||
func_80329904(this->marker, 0x1F, sp50);
|
||||
sp48[0] = (s16)sp50[0];
|
||||
sp48[1] = (s16)sp50[1];
|
||||
sp48[2] = (s16)sp50[2];
|
||||
func_802F3B9C(sp48);
|
||||
}
|
||||
|
||||
this->unk38_31++;
|
||||
switch (this->state) {
|
||||
case 1:
|
||||
sp74 = func_8032627C(this);
|
||||
if (phi_f2 < 500.0) {
|
||||
if (sp74 < 0xFF) {
|
||||
sp74 = (sp74 + 0xC < 0xFF) ? sp74 + 0xC : 0xFF;
|
||||
if (!this->unk138_24) {
|
||||
func_8025A70C(COMUSIC_81_ACTIVATING_BRENTILDA);
|
||||
func_80324D2C(1.0f, COMUSIC_81_ACTIVATING_BRENTILDA);
|
||||
this->unk138_24 = TRUE;
|
||||
this->unk138_23 = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (500.0 < phi_f2) {
|
||||
if (sp74 >= 0x41) {
|
||||
sp74 = (sp74 - 0xC >= 0x41) ? sp74 - 0xC : 0x40;
|
||||
if (!this->unk138_23) {
|
||||
func_8025A70C(COMUSIC_8B_DEACTIVATE_BRENTILDA);
|
||||
func_80324D2C(1.0f, COMUSIC_8B_DEACTIVATE_BRENTILDA);
|
||||
this->unk138_23 = TRUE;
|
||||
this->unk138_24 = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
actor_setOpacity(this, sp74);
|
||||
if (!func_803203FC(0x1F)) {
|
||||
if ((phi_f2 < 600.0) && !this->unk38_0) {
|
||||
comusic_8025AB44(COMUSIC_7A_BRENTILDA, -1, 0x1F4);
|
||||
func_8032BB88(this, 0, 0x1F4);
|
||||
this->unk38_0 = TRUE;
|
||||
}
|
||||
if ((600.0 < phi_f2) && this->unk38_0) {
|
||||
comusic_8025AB44(COMUSIC_7A_BRENTILDA, 0, 0x1F4);
|
||||
func_8025AABC(0x7A);
|
||||
func_8032BB88(this, -1, 0x1F4);
|
||||
this->unk38_0 = FALSE;
|
||||
}
|
||||
}
|
||||
if( (phi_f2 < 300.0)
|
||||
&& (func_8028ECAC() == 0)
|
||||
&& func_8028F20C()
|
||||
&& !func_803114B0()) {
|
||||
if (!func_8031FF1C(0x96)) {
|
||||
func_80311480(0x10A1, 0xA, this->position, this->marker, func_8038BADC, NULL);
|
||||
func_80320004(0x96, TRUE);
|
||||
func_80328A84(this, 2);
|
||||
return;
|
||||
}
|
||||
if (func_8028EFC8() && (sp78[BUTTON_Z] == 1)) {
|
||||
this->unk10_12++;
|
||||
this->unk10_12 %= 3;
|
||||
func_80311174(local->unk0 + this->unk10_12, 0xB, this->position, this->marker, func_8038BADC, NULL, func_8038BA30);
|
||||
func_80328A84(this, 2);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (actor_animationIsAt(this, 0.999f)) {
|
||||
func_80328A84(this, 3);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (actor_animationIsAt(this, 0.999f)) {
|
||||
func_80328A84(this, 2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
1224
src/lair/code_5ED0.c
Normal file
1224
src/lair/code_5ED0.c
Normal file
File diff suppressed because it is too large
Load Diff
550
src/lair/code_86F0.c
Normal file
550
src/lair/code_86F0.c
Normal file
@@ -0,0 +1,550 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern f32 ml_vec3f_distance_squared(f32[3], f32[3]);
|
||||
extern void func_8028F3D8(f32[3], f32, void(*)(ActorMarker *), ActorMarker *);
|
||||
extern void func_80324CFC(f32, enum comusic_e, s32);
|
||||
extern void func_8034A8BC(s32);
|
||||
extern void func_8034DF30(s32, f32[3], f32[3], f32);
|
||||
extern void func_8034E088(s32, s32, s32,f32);
|
||||
|
||||
typedef struct {
|
||||
s32 unk0;
|
||||
s32 unk4;
|
||||
s32 unk8;
|
||||
}ActorLocal_lair_86F0;
|
||||
|
||||
typedef struct {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u16 unk2;
|
||||
}Struct_lair_86F0_0;
|
||||
|
||||
void func_8038F350(Actor *this, s32 next_state);
|
||||
void func_8038F924(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_803947B0 = { 0x1EB, 0x3B7, 0x48B, 0x1, NULL, func_8038F924, func_80326224, func_80325888, 0, 0, 0.0f, 0};
|
||||
ActorInfo D_803947D4 = { 0x1EB, 0x3BC, 0x538, 0x1, NULL, func_8038F924, func_80326224, func_80325888, 0, 0, 0.0f, 0};
|
||||
Struct_lair_86F0_0 D_803947F8[0xb] ={
|
||||
{0x01, 0x1, 0x5D},
|
||||
{0x02, 0x2, 0x5E},
|
||||
{0x05, 0x3, 0x60},
|
||||
{0x07, 0x3, 0x63},
|
||||
{0x08, 0x4, 0x66},
|
||||
{0x09, 0x4, 0x6A},
|
||||
{0x0A, 0x4, 0x6E},
|
||||
{0x0C, 0x4, 0x72},
|
||||
{0x0F, 0x4, 0x76},
|
||||
{0x19, 0x5, 0x7A},
|
||||
{0x04, 0x3, 0x7F}
|
||||
};
|
||||
s32 D_80394824[3] = {0xff, 0xff, 0};
|
||||
struct31s D_80394830 = {
|
||||
{0.17f, 0.24f},
|
||||
{0.08f, 0.13f},
|
||||
{0.0f, 0.01f},
|
||||
{0.9f, 0.9f},
|
||||
0.0f, 0.0f
|
||||
};
|
||||
|
||||
/* .code */
|
||||
bool func_8038EAE0(s32 arg0) {
|
||||
return func_8031FF44(D_803947F8[arg0 -1].unk2, D_803947F8[arg0 -1].unk1) == D_803947F8[arg0 -1].unk0;
|
||||
}
|
||||
|
||||
s32 func_8038EB24(Actor *this){
|
||||
return (this->unkF4_8 != 0 && this->unkF4_8 < 0xC) ? D_803947F8[this->unkF4_8 - 1].unk0 : 0;
|
||||
}
|
||||
|
||||
bool func_8038EB58(Actor *this){
|
||||
ActorLocal_lair_86F0 *local;
|
||||
|
||||
local = (ActorLocal_lair_86F0*)&this->local;
|
||||
return func_8038EB24(this) == local->unk4;
|
||||
}
|
||||
|
||||
s32 func_8038EB84(Actor *this){
|
||||
return this->unkF4_8 + 0x1B;
|
||||
}
|
||||
|
||||
void func_8038EB94(void){
|
||||
func_802FAFD4(ITEM_14_HEALTH, 0x417);
|
||||
func_802FAFC0(ITEM_14_HEALTH, COMUSIC_2B_DING_B);
|
||||
func_80320004(BKPROG_B9_DOUBLE_HEALTH, TRUE);
|
||||
func_80347958();
|
||||
func_803463D4(ITEM_14_HEALTH, 0);
|
||||
func_80314AC8(1);
|
||||
}
|
||||
|
||||
void func_8038EBEC(ActorMarker *marker) {
|
||||
Actor *this;
|
||||
u32 temp_t6;
|
||||
|
||||
this = marker_getActor(reinterpret_cast(ActorMarker *, marker));
|
||||
if (this->unkF4_8 < 0xAU) {
|
||||
levelSpecificFlags_set(func_8038EB84(this), TRUE);
|
||||
return;
|
||||
}
|
||||
if (this->unkF4_8 == 0xA) {
|
||||
func_8028F918(0);
|
||||
func_8028F918(2);
|
||||
levelSpecificFlags_set(0x3F, TRUE);
|
||||
return;
|
||||
}
|
||||
if (this->unkF4_8 == 0xB) {
|
||||
timedFunc_set_0(1.5f, func_8038EB94);
|
||||
func_80314AC8(0);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038EC94(ActorMarker *marker, ActorMarker *other_marker){
|
||||
marker->unk3E_1 = TRUE;
|
||||
}
|
||||
|
||||
bool func_8038ECA8(ActorMarker *marker) {
|
||||
return func_8028F20C() && func_8028FB48(0x08000000) && marker->unk3E_1;
|
||||
}
|
||||
|
||||
s32 func_8038ECFC(Actor *this, s32 arg1){
|
||||
ActorLocal_lair_86F0 *local;
|
||||
|
||||
local = (ActorLocal_lair_86F0*)&this->local;
|
||||
return local->unk0 & (1 << arg1);
|
||||
}
|
||||
|
||||
s32 func_8038ED10(Actor *this, s32 arg1){
|
||||
s32 phi_v1;
|
||||
switch (this->unkF4_8){
|
||||
case 7:
|
||||
phi_v1 = (arg1 == 2) ? 0x1a4 : 0x190;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
phi_v1 = 0x192;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
phi_v1 = 0x19A;
|
||||
break;
|
||||
|
||||
case 11:
|
||||
phi_v1 = 0x1AE;
|
||||
break;
|
||||
default:
|
||||
phi_v1 = 0x190;
|
||||
break;
|
||||
}
|
||||
return phi_v1 + arg1;
|
||||
}
|
||||
|
||||
s32 func_8038ED88(Actor *this){
|
||||
switch (this->unkF4_8){
|
||||
case 3:
|
||||
case 8:
|
||||
case 0xb:
|
||||
return 0x1F;
|
||||
}
|
||||
return 0x1E;
|
||||
}
|
||||
|
||||
void func_8038EDBC(Actor *this) {
|
||||
s32 sp44;
|
||||
s32 sp40;
|
||||
ActorLocal_lair_86F0 *local;
|
||||
s32 sp38;
|
||||
f32 sp34;
|
||||
f32 sp28[3];
|
||||
|
||||
local = (ActorLocal_lair_86F0*)&this->local;
|
||||
sp38 = (this->modelCacheIndex == 0x3B7)? 0x190 : 0x192;
|
||||
sp44 = func_8034C2C4(this->marker, sp38);
|
||||
sp40 = func_8034C2C4(this->marker, sp38 + 1);
|
||||
if ((sp44 != 0) && (sp40 != 0) && (this->marker->unk14_21)) {
|
||||
sp28[0] = 1.0f;
|
||||
sp28[1] = 1.0f;
|
||||
sp28[2] = 1.0f;
|
||||
if (func_8038ECA8(this->marker) && local->unk8 < 0xFF) {
|
||||
local->unk8 = (local->unk8 + 8 < 0xFF) ? local->unk8 + 8 : 0xFF;
|
||||
}
|
||||
else if (!func_8038ECA8(this->marker) && (local->unk8 > 0)) {
|
||||
local->unk8 = (local->unk8 - 8 > 0) ? local->unk8 - 8 : 0;
|
||||
}
|
||||
sp34 = (0xFF - local->unk8) / 255.0;
|
||||
func_8034DF30(sp44, sp28, sp28, 0);
|
||||
sp34 = 1.0 - sp34;
|
||||
func_8034DF30(sp40, sp28, sp28, 0);
|
||||
if(sp34);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void func_8038EF58(ActorMarker *marker) {
|
||||
f32 sp24[3];
|
||||
Actor *this;
|
||||
|
||||
this = marker_getActor(marker);
|
||||
func_8034A174(func_803097A0(), func_8038ED88(this), sp24);
|
||||
func_8028E6EC(2);
|
||||
func_8028F918(0);
|
||||
func_8028F94C(4, sp24);
|
||||
func_8038F350(this, func_8031FF1C(0x17) ? 4 : 3);
|
||||
}
|
||||
|
||||
void func_8038EFD8(Actor *this) {
|
||||
s32 pad3C;
|
||||
f32 sp30[3];
|
||||
f32 sp24[3];
|
||||
|
||||
this->unk138_24 = FALSE;
|
||||
player_getPosition(sp30);
|
||||
sp24[0] = this->position[0];
|
||||
sp24[1] = this->position[1];
|
||||
sp24[2] = this->position[2];
|
||||
sp24[1] += 50.0f;
|
||||
func_8028F3D8(sp24, ml_vec3f_distance(sp30, sp24) / 150.0, func_8038EF58, this->marker);
|
||||
}
|
||||
|
||||
void func_8038F078(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
Actor *this;
|
||||
|
||||
this = marker_getActor(marker);
|
||||
func_8038F350(this, (text_id == 0xf58) ? 1 : 4);
|
||||
}
|
||||
|
||||
void func_8038F0C0(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
func_8030E6D4(SFX_EA_GRUNTY_LAUGH_1);
|
||||
}
|
||||
|
||||
s32 func_8038F0EC(Actor *this) {
|
||||
ActorLocal_lair_86F0 *local;
|
||||
s32 phi_s0;
|
||||
s32 sp34;
|
||||
s32 phi_s2;
|
||||
|
||||
phi_s0 = 0;
|
||||
local = (ActorLocal_lair_86F0*)&this->local;
|
||||
func_8034A8BC(this->unkF4_8);
|
||||
if (this->unkF4_8 >= 0xA) {
|
||||
for(phi_s2 = 0; phi_s2 < local->unk4; phi_s2++){
|
||||
sp34 = phi_s2;
|
||||
phi_s0 |= (1 << sp34);
|
||||
}
|
||||
} else {
|
||||
for(phi_s2 = 0; phi_s2 < local->unk4; phi_s2++){
|
||||
do{
|
||||
sp34 = randi2(0, func_8038EB24(this));
|
||||
}
|
||||
while(1 << sp34 & phi_s0);
|
||||
phi_s0 |= 1 << sp34;
|
||||
}
|
||||
}
|
||||
return sp34;
|
||||
}
|
||||
|
||||
|
||||
void func_8038F1EC(Actor *this, s32 arg1, bool arg2) {
|
||||
s32 temp_v0;
|
||||
|
||||
temp_v0 = func_8034C528(func_8038ED10(this, arg1));
|
||||
if (temp_v0 != 0) {
|
||||
func_8034E088(temp_v0, arg2 ? 0 : 0xff, arg2 ? 0xff : 0, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038F250(Actor *this){
|
||||
ActorLocal_lair_86F0 *local;
|
||||
|
||||
local = (ActorLocal_lair_86F0*)&this->local;
|
||||
if( (this->unkF4_8 >= 2)
|
||||
&& (local->unk4 > 0)
|
||||
&& !func_8038EB58(this)
|
||||
&& !func_8031FF1C(0xDF)
|
||||
) {
|
||||
if (func_80311480(0xF7C, 2, NULL, NULL, NULL, NULL)) {
|
||||
func_80320004(0xDF, TRUE);
|
||||
}
|
||||
} else if ((this->unkF4_8 >= 3)
|
||||
&& (local->unk4 >= 2)
|
||||
&& !func_8038EB58(this)
|
||||
&& !func_8031FF1C(0xE0)
|
||||
){
|
||||
if(func_80311480(0xF7D, 2, NULL, NULL, NULL, NULL)) {
|
||||
func_80320004(0xE0, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038F350(Actor *this, s32 next_state){
|
||||
ActorLocal_lair_86F0 *local;
|
||||
f32 sp50[3];
|
||||
s32 sp4C;
|
||||
s32 temp_s1;
|
||||
s32 phi_s0;
|
||||
|
||||
local = (ActorLocal_lair_86F0*)&this->local;
|
||||
func_8034A174(func_803097A0(), func_8038ED88(this), sp50);
|
||||
switch (next_state) {
|
||||
case 1: //L8038F3BC
|
||||
func_8028F918(0);
|
||||
break;
|
||||
|
||||
case 2: //L8038F3CC
|
||||
func_8038EFD8(this);
|
||||
FUNC_8030E8B4(SFX_112_TINKER_ATTENTION, 1.0f, 32000, this->position, 500, 1000);
|
||||
break;
|
||||
|
||||
case 3: //L8038F3F4
|
||||
func_803115C4(0xF7B);
|
||||
func_803115C4(0xF80);
|
||||
func_803115C4(0xF7F);
|
||||
if (item_getCount(ITEM_26_JIGGY_TOTAL) > 0) {
|
||||
func_80311480(func_8031FF1C(0x16) ? 0xF5A : 0xF59, 6, sp50, this->marker, func_8038F078, NULL);
|
||||
func_80320004(0x17, 1);
|
||||
} else {
|
||||
func_80311480(0xF58, 6, sp50, this->marker, func_8038F078, NULL);
|
||||
}
|
||||
func_80320004(0x16, 1);
|
||||
func_80320004(0xA7, 1);
|
||||
break;
|
||||
|
||||
case 8: //L8038F4AC
|
||||
if (local->unk4 > 0) {
|
||||
func_8025A70C(SFX_REMOVE_JIGGY);
|
||||
this->unk60 = 1.0f;
|
||||
temp_s1 = func_8038F0EC(this);
|
||||
func_8038F1EC(this, temp_s1, 0);
|
||||
local->unk4--;
|
||||
local->unk0 &= ~(1 << temp_s1);
|
||||
func_80320044(D_803947F8[this->unkF4_8 - 1].unk2, local->unk4, D_803947F8[this->unkF4_8 - 1].unk1);
|
||||
func_803463F4(ITEM_26_JIGGY_TOTAL, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: //L8038F550
|
||||
if (local->unk4 < func_8038EB24(this)) {
|
||||
func_8025A70C(COMUSIC_67_INSERTING_JIGGY);
|
||||
this->unk60 = 1.0f;
|
||||
local->unk4++;
|
||||
temp_s1 = func_8038F0EC(this);
|
||||
func_8038F1EC(this, temp_s1, 1);
|
||||
local->unk0 |= (1 << temp_s1);
|
||||
func_80320044(D_803947F8[this->unkF4_8 - 1].unk2, local->unk4, D_803947F8[this->unkF4_8 - 1].unk1);
|
||||
func_803463F4(ITEM_26_JIGGY_TOTAL, -1);
|
||||
func_8038F250(this);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6: //L8038F604
|
||||
if (local->unk4 < func_8038EB24(this)) {
|
||||
if(item_getCount(ITEM_26_JIGGY_TOTAL) > func_8038EB24(this) - local->unk4){
|
||||
sp4C = func_8038EB24(this) - local->unk4;
|
||||
}
|
||||
else{
|
||||
sp4C = item_getCount(ITEM_26_JIGGY_TOTAL);
|
||||
}
|
||||
func_8025A70C(COMUSIC_67_INSERTING_JIGGY);
|
||||
this->unk60 = 1.0f;
|
||||
for(phi_s0 = 0; phi_s0 < sp4C; phi_s0++){
|
||||
local->unk4++;
|
||||
temp_s1 = func_8038F0EC(this);
|
||||
func_8038F1EC(this, temp_s1, 1);
|
||||
local->unk0 |= (1 << temp_s1);
|
||||
func_803463F4(ITEM_26_JIGGY_TOTAL, -1);
|
||||
}
|
||||
func_80320044(D_803947F8[this->unkF4_8 - 1].unk2, local->unk4, D_803947F8[this->unkF4_8 - 1].unk1);
|
||||
func_8038F250(this);
|
||||
}
|
||||
break;
|
||||
|
||||
case 7: //L8038F724
|
||||
func_8025A70C(COMUSIC_65_WORLD_OPENING_B);
|
||||
if (this->unkF4_8 == 1) {
|
||||
func_80324DBC(1.0f, 0xF7E, 4, NULL, this->marker, func_8038F0C0, NULL);
|
||||
} else if (this->unkF4_8 == 0xA) {
|
||||
func_80324DBC(1.0f, 0xFAC, 4, NULL, this->marker, func_8038F0C0, NULL);
|
||||
}
|
||||
timedFunc_set_1(2.0f, (TFQM1) func_8038EBEC, (s32) this->marker);
|
||||
this->unk60 = 3.0f;
|
||||
break;
|
||||
}
|
||||
func_80328A84(this, next_state);
|
||||
}
|
||||
|
||||
|
||||
void func_8038F800(Actor *this) {
|
||||
s32 temp_v0;
|
||||
s32 phi_s0;
|
||||
|
||||
for(phi_s0 = 0; phi_s0 < func_8038EB24(this); phi_s0++){
|
||||
temp_v0 = func_8034C528(func_8038ED10(this, phi_s0));
|
||||
if (temp_v0 != 0) {
|
||||
func_8034E0FC(temp_v0, func_8038ECFC(this, phi_s0) ? 0xff : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038F894(Actor *this, s32 arg1) {
|
||||
if (item_getCount(ITEM_26_JIGGY_TOTAL) > 0) {
|
||||
func_8038F350(this, arg1);
|
||||
return;
|
||||
}
|
||||
func_8025A70C(COMUSIC_2C_BUZZER);
|
||||
if (func_8031FF1C(0xDE) != 0) {
|
||||
func_8038F350(this, 1);
|
||||
return;
|
||||
}
|
||||
func_80311480(0xFBC, 4, NULL, NULL, NULL, NULL);
|
||||
func_80320004(0xDE, 1);
|
||||
}
|
||||
|
||||
void func_8038F924(Actor *this) {
|
||||
ActorLocal_lair_86F0 *local;
|
||||
s32 sp7C[6]; //buttons
|
||||
s32 phi_v1;
|
||||
s32 phi_a0;
|
||||
s32 sp6C[2]; //joystick
|
||||
f32 sp68;
|
||||
s32 sp64;
|
||||
|
||||
|
||||
local = (ActorLocal_lair_86F0*)&this->local;
|
||||
sp68 = time_getDelta();
|
||||
if (!this->initialized) {
|
||||
this->initialized = TRUE;
|
||||
}
|
||||
|
||||
if (!this->unk16C_4) {
|
||||
// temp_v0 = &D_803947F8[this->unkF4_8 - 1];
|
||||
sp64 = func_8031FF44(D_803947F8[this->unkF4_8 - 1].unk2, D_803947F8[this->unkF4_8 - 1].unk1);
|
||||
local->unk0 = 0;
|
||||
local->unk4 = 0;
|
||||
local->unk8 = (func_8038ECA8(this->marker)) ? 0xff : 1;
|
||||
this->unk138_24 = TRUE;
|
||||
for(phi_v1 = 0; phi_v1 < sp64; phi_v1 ++){
|
||||
local->unk4++;
|
||||
local->unk0 |= (1 << func_8038F0EC(this));
|
||||
}
|
||||
func_8038F800(this);
|
||||
marker_setCollisionScripts(this->marker, func_8038EC94, NULL, NULL);
|
||||
this->marker->propPtr->unk8_3 = TRUE;
|
||||
this->unk16C_4 = TRUE;
|
||||
if (this->unkF4_8 == 9) {
|
||||
this->unk1C[0] = 8.0f;
|
||||
if (!func_8031FF1C(0x53)) {
|
||||
marker_despawn(this->marker);
|
||||
return;
|
||||
}
|
||||
if (!func_8031FF1C(0x54)) {
|
||||
func_802C9334(0x20, this);
|
||||
func_80324CFC(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER, 0x7FFF);
|
||||
func_80324D2C(2.1f, COMUSIC_43_ENTER_LEVEL_GLITTER);
|
||||
func_8030E6D4(SFX_113_PAD_APPEARS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((this->unkF4_8 == 9) && !func_8031FF1C(0x54)) {
|
||||
this->yaw += this->unk1C[0];
|
||||
while(this->yaw >= 360.0f){
|
||||
this->yaw -= 360.0f;
|
||||
}
|
||||
this->unk1C[0] -= 0.089888;
|
||||
if (this->unk1C[0] < 0.0f) {
|
||||
this->unk1C[0] = 0.0f;
|
||||
}
|
||||
if (this->marker->unk14_21) {
|
||||
s32 sp58[3] = D_80394824;
|
||||
ParticleEmitter *sp54;
|
||||
sp54 = partEmitList_pushNew(6);
|
||||
particleEmitter_setSprite(sp54, ASSET_710_SPRITE_SPARKLE_PURPLE);
|
||||
func_802EF9E4(sp54, 0xFF);
|
||||
func_802EFB98(sp54, &D_80394830);
|
||||
particleEmitter_setPosition(sp54, this->position);
|
||||
sp58[2] = randf() * 255.0f;
|
||||
func_802EFFA8(sp54, sp58);
|
||||
particleEmitter_setParticleSpawnPositionRange(sp54, -30.0f, -40.0f, -30.0f, 30.0f, 20.0f, 30.0f);
|
||||
particleEmitter_emitN(sp54, 6);
|
||||
}
|
||||
}
|
||||
func_8024E55C(0, sp7C);
|
||||
func_8024E60C(0, sp6C);
|
||||
func_8038EDBC(this);
|
||||
switch(this->state){
|
||||
case 1://L8038FCD0
|
||||
if (!this->unk138_24 && (!func_8028F20C() || !func_8028FB48(0x08000000))) {
|
||||
this->unk138_24 = TRUE;
|
||||
}
|
||||
if (func_80329530(this, 300)) {
|
||||
if ((this->unkF4_8 == 0xA) && !func_8031FF1C(0xF6)) {
|
||||
phi_a0 = (item_getCount(ITEM_26_JIGGY_TOTAL) < D_803947F8[this->unkF4_8 - 1].unk0) ? 0xFAB : 0xFC0;
|
||||
if (func_80311480(phi_a0, 0, NULL, NULL, NULL, NULL)) {
|
||||
func_80320004(0xF6, TRUE);
|
||||
}
|
||||
} else if (this->unkF4_8 == 1) {
|
||||
func_8035644C(0xA7);
|
||||
}
|
||||
}
|
||||
if (func_8038ECA8(this->marker) && this->unk138_24 && !func_8038EB58(this) && (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT)) {
|
||||
func_8038F350(this, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: //L8038FE28
|
||||
if ((func_803114C4() != 0xF7C) && (func_803114C4() != 0xF7D)) {
|
||||
if (sp7C[BUTTON_START] == 1) {
|
||||
func_8038F894(this, 5);
|
||||
} else if (sp7C[BUTTON_Z] == 1) {
|
||||
func_8038F350(this, 1);
|
||||
} else if ((sp6C[0] == 1) && func_8031FF1C(0xE0)) {
|
||||
func_8038F894(this, 6);
|
||||
} else if (sp7C[BUTTON_R] == 1) {
|
||||
if (local->unk4) {
|
||||
func_8038F350(this, 8);
|
||||
} else {
|
||||
func_8025A70C(COMUSIC_2C_BUZZER);
|
||||
func_8038F350(this, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: //L8038FF00
|
||||
case 6: //L8038FF00
|
||||
case 8: //L8038FF00
|
||||
if (this->unk60 > 0.0f) {
|
||||
this->unk60 -= sp68;
|
||||
} else {
|
||||
func_8038F350(this, func_8038EB58(this) ? 7 :4);
|
||||
}
|
||||
break;
|
||||
|
||||
case 7: //L8038FF50
|
||||
if (this->unk60 > 0.0f) {
|
||||
this->unk60 -= sp68;
|
||||
} else {
|
||||
func_8038F350(this, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
{
|
||||
s32 pad;
|
||||
f32 sp44[3];
|
||||
s32 pad2;
|
||||
this->marker->unk3E_1 = FALSE;
|
||||
player_getPosition(sp44);
|
||||
if (ml_vec3f_distance_squared(sp44, this->position) < 250000.0f) {
|
||||
if (!this->unk38_0) {
|
||||
func_802FA5D0();
|
||||
this->unk38_0 = TRUE;
|
||||
}
|
||||
func_802FACA4(0x2B);
|
||||
}
|
||||
else if (this->unk38_0) {
|
||||
func_802FAD64(0x2B);
|
||||
this->unk38_0 = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
123
src/lair/code_9C40.c
Normal file
123
src/lair/code_9C40.c
Normal file
@@ -0,0 +1,123 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern bool func_80259384(f32[3], f32[3], f32);
|
||||
|
||||
void func_803902B8(Actor *this);
|
||||
Actor *func_80390030(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_80394860[] = {
|
||||
{0, 0.0f},
|
||||
{0x272, 0.8f}
|
||||
};
|
||||
ActorInfo D_80394870 = { 0x16D, 0x1D5, 0x54F, 0x1, D_80394860, func_803902B8, func_80326224, func_80390030, 2500, 0, 1.2f, 0};
|
||||
ActorInfo D_80394894 = { 0x16E, 0x1D6, 0x54F, 0x1, D_80394860, func_803902B8, func_80326224, func_80390030, 2500, 0, 1.2f, 0};
|
||||
ActorInfo D_803948B8 = { 0x16F, 0x1D7, 0x54F, 0x1, D_80394860, func_803902B8, func_80326224, func_80390030, 2500, 0, 1.2f, 0};
|
||||
|
||||
/* .code */
|
||||
Actor *func_80390030(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
func_8033A45C(3, 1);
|
||||
func_8033A45C(4, 1);
|
||||
func_80325888(marker, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
s32 func_80390084(void) {
|
||||
s32 phi_s0;
|
||||
s32 phi_s1;
|
||||
|
||||
for(phi_s0 = 0, phi_s1 = 0; phi_s0 < 3; phi_s0++){
|
||||
if (func_8031FF1C(phi_s0 + 0xAD)) {
|
||||
phi_s1++;
|
||||
}
|
||||
}
|
||||
return phi_s1;
|
||||
}
|
||||
|
||||
void func_803900DC(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
|
||||
}
|
||||
|
||||
void func_803900EC(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
s32 sp1C;
|
||||
|
||||
sp1C = marker->unk14_20 - 0x16D;
|
||||
func_8028F918(0);
|
||||
if (!func_8031FF1C(sp1C + 0xAD)) {
|
||||
func_80320004(sp1C + 0xAD, 1);
|
||||
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_80390158(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
s32 phi_v1;
|
||||
phi_v1 = marker->unk14_20 - 0x16D;
|
||||
return phi_v1;
|
||||
}
|
||||
|
||||
void func_80390174(ActorMarker *marker, s32 arg1) {
|
||||
Actor *this;
|
||||
s32 sp28;
|
||||
|
||||
this = marker_getActor(marker);
|
||||
sp28 = this->marker->unk14_20 - 0x16D;
|
||||
func_8028F94C(2, this->position);
|
||||
if (func_8031FF1C(sp28 + 0xAD)) {
|
||||
func_80311480(sp28 + 0xF83, 0xE, this->position, this->marker, func_803900EC, func_803900DC);
|
||||
return;
|
||||
}
|
||||
func_80311174(func_80390084() + 0xFA5, 0xE, this->position, this->marker, func_803900EC, func_803900DC, func_80390158);
|
||||
}
|
||||
|
||||
void func_8039024C(Actor *this){
|
||||
if(this->unk38_0){
|
||||
func_8032BB88(this, -1, 0x1f4);
|
||||
comusic_8025AB44(COMUSIC_79_CHEATO, 0, 500);
|
||||
func_8025AABC(COMUSIC_79_CHEATO);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80390298(Actor *this) {
|
||||
func_8039024C(this);
|
||||
}
|
||||
|
||||
void func_803902B8(Actor *this) {
|
||||
f32 sp5C[3];
|
||||
s32 sp58;
|
||||
s32 sp54;
|
||||
s32 sp3C[6];
|
||||
|
||||
sp54 = this->marker->unk14_20 - 0x16D;
|
||||
if (!this->initialized) {
|
||||
func_803300D8(this->marker, func_80390298);
|
||||
this->unk138_24 = func_803203FC(0x1F);
|
||||
this->initialized = TRUE;
|
||||
}
|
||||
_player_getPosition(sp5C);
|
||||
sp58 = func_80259384(this->position, sp5C, 1750.0f) && !this->unk138_24;
|
||||
if (sp58 && !this->unk38_0) {
|
||||
func_8032BB88(this, 0, 0x1F4);
|
||||
func_8025A6EC(COMUSIC_79_CHEATO, 0);
|
||||
comusic_8025AB44(COMUSIC_79_CHEATO, -1, 0x1F4);
|
||||
}
|
||||
else if (!sp58 && this->unk38_0) {
|
||||
func_8039024C(this);
|
||||
}
|
||||
this->unk38_0 = sp58;
|
||||
sp58 = func_80259384(this->position, sp5C, 400.0f);
|
||||
if (func_8031FF1C(sp54 + 0xAD)) {
|
||||
func_8024E55C(0, sp3C);
|
||||
sp58 &= (sp3C[BUTTON_Z] == TRUE) || func_8028EC04();
|
||||
}
|
||||
if (sp58 && !*(s32 *)&this->local) {
|
||||
func_80390174(this->marker, 0);
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.01f)) {
|
||||
func_8030E878(SFX_F1_CHEATO_IDLE_2, randf()*0.1 + 0.95, 20000, this->position, 200.0f, 1500.f);
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.25f)) {
|
||||
func_8030E878(SFX_F0_CHEATO_IDLE_1, randf()*0.1 + 0.95, 20000, this->position, 200.0f, 1500.0f);
|
||||
}
|
||||
*(s32 *)&this->local = sp58;
|
||||
}
|
89
src/lair/code_A170.c
Normal file
89
src/lair/code_A170.c
Normal file
@@ -0,0 +1,89 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern void func_80329904(ActorMarker*, s32, f32*);
|
||||
|
||||
void func_803906A0(Actor *this);
|
||||
Actor *func_80390560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_803948E0[] = {
|
||||
{0, 0.0f},
|
||||
{0x268, 1.6f},
|
||||
};
|
||||
ActorAnimationInfo D_803948F0[] = {
|
||||
{0, 0.0f},
|
||||
{0x269, 1.6f},
|
||||
};
|
||||
ActorAnimationInfo D_80394900[] = {
|
||||
{0, 0.0f},
|
||||
{0x26A, 1.6f},
|
||||
};
|
||||
ActorInfo D_80394910 = { 0x170, 0x1D8, 0x547, 0x1, D_803948E0, func_803906A0, func_80326224, func_80390560, 0, 0, 0.7f, 0};
|
||||
ActorInfo D_80394934 = { 0x171, 0x1D9, 0x548, 0x1, D_803948F0, func_803906A0, func_80326224, func_80390560, 0, 0, 0.5f, 0};
|
||||
ActorInfo D_80394958 = { 0x172, 0x1DA, 0x549, 0x1, D_80394900, func_803906A0, func_80326224, func_80390560, 0, 0, 0.5f, 0};
|
||||
|
||||
/* .code */
|
||||
Actor *func_80390560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
func_8033A45C(3, marker->collidable);
|
||||
func_8033A45C(4, marker->collidable);
|
||||
return func_80325888(marker, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
void func_803905CC(ActorMarker *marker, ActorMarker *other_marker){
|
||||
switch (marker->unk14_20) {
|
||||
case 0x170:
|
||||
func_80346448(ITEM_D_EGGS);
|
||||
func_802F3874(&marker->propPtr->x);
|
||||
func_8025A6EC(SFX_EGG_REFILL, -1);
|
||||
break;
|
||||
case 0x171:
|
||||
func_80346448(ITEM_F_RED_FEATHER);
|
||||
func_802F3978(&marker->propPtr->x);
|
||||
func_8025A6EC(SFX_RED_FEATHER_REFILL, -1);
|
||||
break;
|
||||
case 0x172:
|
||||
func_80346448(ITEM_10_GOLD_FEATHER);
|
||||
func_802F3A60(&marker->propPtr->x);
|
||||
func_8025A6EC(SFX_GOLD_FEATHER_REFILL, -1);
|
||||
break;
|
||||
}
|
||||
marker->collidable = FALSE;
|
||||
}
|
||||
|
||||
void func_803906A0(Actor *this) {
|
||||
s32 phi_s0;
|
||||
s32 phi_s2;
|
||||
s32 phi_s4;
|
||||
|
||||
if (!this->initialized) {
|
||||
marker_setCollisionScripts(this->marker, func_803905CC, NULL, NULL);
|
||||
this->initialized = TRUE;
|
||||
this->marker->propPtr->unk8_3 = TRUE;
|
||||
}
|
||||
if (this->marker->unk14_21 && this->marker->collidable) {
|
||||
switch (this->marker->modelId) {
|
||||
default:
|
||||
break;
|
||||
case 0x547:
|
||||
phi_s2 = 4;
|
||||
phi_s4 = 8;
|
||||
break;
|
||||
case 0x548:
|
||||
phi_s2 = 4;
|
||||
phi_s4 = 8;
|
||||
break;
|
||||
case 0x549:
|
||||
phi_s2 = 4;
|
||||
phi_s4 = 8;
|
||||
break;
|
||||
}
|
||||
for(phi_s0 = 0; phi_s0 < phi_s2; phi_s0++){
|
||||
if (randf() < ((1.0 / (f64) phi_s2) / 15.0)) {
|
||||
func_8033E73C(this->marker, phi_s0 + 5, &func_80329904);
|
||||
func_8033E3F0(phi_s4, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
19
src/lair/code_A430.c
Normal file
19
src/lair/code_A430.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
void func_80390820(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80394980 = { 0x299, 0x3C3, 0x0, 0x0, NULL, func_80390820, func_80326224, func_80325340, 0, 0, 0.0f, 0};
|
||||
|
||||
/* .code */
|
||||
void func_80390820(Actor *this)
|
||||
{
|
||||
if (!this->unk38_0 && func_80329530(this, 200))
|
||||
{
|
||||
FUNC_8030E624(SFX_61_CARTOONY_FALL, 0.8f, 32000);
|
||||
timed_playSfx(0.5f, SFX_31_BANJO_OHHWAAOOO, 1, 32000);
|
||||
this->unk38_0 = TRUE;
|
||||
}
|
||||
}
|
101
src/lair/code_A4A0.c
Normal file
101
src/lair/code_A4A0.c
Normal file
@@ -0,0 +1,101 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern void func_802DB548(ActorMarker *, ActorMarker *);
|
||||
|
||||
typedef struct {
|
||||
f32 unk0;
|
||||
f32 unk4;
|
||||
s8 unk8;
|
||||
s8 unk9;
|
||||
s8 unkA;
|
||||
s8 unkB;
|
||||
u32 unkC_31:3;
|
||||
u32 unkC_28:1;
|
||||
u32 unkC_27:28;
|
||||
s16 unk10;
|
||||
s16 unk12;
|
||||
f32 unk14;
|
||||
u8 pad18[0x18];
|
||||
void (*unk30)(ActorMarker *, ActorMarker *);
|
||||
void (*unk34)(ActorMarker *, ActorMarker *);
|
||||
u8 pad38[0x4];
|
||||
f32 unk3C;
|
||||
} ActorLocal_lair_A4A0;
|
||||
|
||||
void func_80390AE8(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_803949B0[] ={
|
||||
{0x000, 0.0f},
|
||||
{0x26D, 4.0f},
|
||||
{0x26D, 0.7f},
|
||||
{0x26F, 0.7f},
|
||||
{0x26E, 0.9f},
|
||||
{0x270, 1.6f},
|
||||
{0x26D, 1.5f},
|
||||
{0x26F, 0.5f},
|
||||
{0x26D, 1.5f},
|
||||
{0x26D, 1000000.0f},
|
||||
{0x26D, 1000000.0f},
|
||||
};
|
||||
ActorInfo D_80394A08 = { 0x1EA, 0x367, 0x54A, 0x1, D_803949B0, func_80390AE8, func_80326224, func_80325888, 2500, 0, 1.0f, 0};
|
||||
ActorInfo D_80394A2C = { 0x295, 0x3BF, 0x561, 0x1, D_803949B0, func_80390AE8, func_80326224, func_80325888, 2500, 0, 1.0f, 0};
|
||||
ActorInfo D_80394A50 = { 0x1F1, 0x3C0, 0x562, 0x1, D_803949B0, func_80390AE8, func_80326224, func_80325888, 2500, 0, 1.0f, 0};
|
||||
|
||||
/* .code */
|
||||
void func_80390890(ActorMarker *marker, ActorMarker *other_marker) {
|
||||
Actor *this;
|
||||
ActorLocal_lair_A4A0 *local;
|
||||
|
||||
this = marker_getActor(marker);
|
||||
local = (ActorLocal_lair_A4A0 *)&this->local;
|
||||
func_80328B8C(this, 5, 0.0f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
func_8030E878(SFX_C2_GRUBLIN_EGH, local->unkC_27*0.1 + 0.8, 32000, this->position, 1250.0f, 2500.0f);
|
||||
func_802C3F04((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2]));
|
||||
actor_collisionOff(this);
|
||||
this->unk138_24 = TRUE;
|
||||
}
|
||||
|
||||
void func_80390994(Actor *this) {
|
||||
ActorLocal_lair_A4A0 *local;
|
||||
|
||||
local = (ActorLocal_lair_A4A0 *)&this->local;
|
||||
local->unk0 = 5 - local->unkC_27;
|
||||
local->unk4 = 8 - local->unkC_27 * 2;
|
||||
local->unk8 = 6 - local->unkC_27;
|
||||
local->unk9 = 0xC - local->unkC_27 * 2;
|
||||
local->unkA = 0x10 - (local->unkC_27 * 3);
|
||||
local->unkB = 8 - local->unkC_27;
|
||||
local->unkC_31 = 1;
|
||||
local->unk10 = 0xFB;
|
||||
local->unk12 = 0x7530;
|
||||
local->unk14 = local->unkC_27 * 0.1 + 0.8;
|
||||
local->unk3C = local->unkC_27 * 0.2 + 1.1;
|
||||
local->unkC_28 = TRUE;
|
||||
local->unk30 = func_802DB548;
|
||||
local->unk34 = func_80390890;
|
||||
}
|
||||
|
||||
void func_80390AE8(Actor *this) {
|
||||
ActorLocal_lair_A4A0 *local;
|
||||
|
||||
local = (ActorLocal_lair_A4A0 *)&this->local;
|
||||
if (!this->unk16C_4) {
|
||||
local->unkC_27 = (this->modelCacheIndex == 0x367) ? 2
|
||||
: (this->modelCacheIndex == 0x3bf) ? 1
|
||||
: 0;
|
||||
func_80390994(this);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
148
src/lair/code_A810.c
Normal file
148
src/lair/code_A810.c
Normal file
@@ -0,0 +1,148 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern func_80391EA8(ActorMarker *, ActorMarker *, f32 [3], f32, f32, s32);
|
||||
|
||||
typedef struct {
|
||||
f32 unk0[4][3];
|
||||
}ActorLocal_lair_A810;
|
||||
|
||||
|
||||
void func_80390E28(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80394A80 = { 0x1EC, 0x377, 0x0, 0x0, NULL, func_80390E28, func_80326224, func_80325340, 3000, 0, 0.0f, 0};
|
||||
|
||||
/* .bss */
|
||||
extern f32 D_80395370[14][3];
|
||||
extern s32 D_80395460;
|
||||
|
||||
/* .code */
|
||||
void func_80390C00(ActorMarker *marker)
|
||||
{
|
||||
Actor *actor;
|
||||
Actor *newActor;
|
||||
s32 pad;
|
||||
|
||||
actor = marker_getActor(reinterpret_cast(ActorMarker *, marker));
|
||||
newActor = spawn_child_actor(0x3BB, &actor);
|
||||
|
||||
func_80391EA8(
|
||||
newActor->marker, actor->marker, actor->unk1C,
|
||||
randf2(1400, 1800),
|
||||
randf2(0.2f, 0.6f),
|
||||
randf() < 0.5 ? 1 : 0
|
||||
);
|
||||
}
|
||||
|
||||
void func_80390CB4(ActorMarker *marker)
|
||||
{
|
||||
Actor *actor;
|
||||
Actor *newActor;
|
||||
s32 pad;
|
||||
|
||||
actor = marker_getActor(reinterpret_cast(ActorMarker *, marker));
|
||||
newActor = spawn_child_actor(0x3BB, &actor);
|
||||
|
||||
func_80391EA8(
|
||||
newActor->marker, actor->marker, actor->unk1C,
|
||||
randf2(1200, 1400),
|
||||
randf2(0.8f, 1),
|
||||
-1
|
||||
);
|
||||
}
|
||||
|
||||
void func_80390D3C(Actor *this, s32 val)
|
||||
{
|
||||
ActorLocal_lair_A810 *local;
|
||||
|
||||
local = (ActorLocal_lair_A810 *)&this->local;
|
||||
func_80328A84(this, val);
|
||||
|
||||
switch (val)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
if (this->unk10_12 != 0)
|
||||
{
|
||||
s32 rand = randi2(0, this->unk10_12);
|
||||
this->unk1C[0] = local->unk0[rand][0];
|
||||
this->unk1C[1] = local->unk0[rand][1];
|
||||
this->unk1C[2] = local->unk0[rand][2];
|
||||
}
|
||||
else
|
||||
{
|
||||
this->unk1C[0] = this->position_x;
|
||||
this->unk1C[1] = this->position_y;
|
||||
this->unk1C[2] = this->position_z;
|
||||
}
|
||||
|
||||
func_802C3C88((GenMethod_1)func_80390C00, reinterpret_cast(s32, this->marker));
|
||||
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
this->unk1C[0] = this->position_x;
|
||||
this->unk1C[1] = this->position_y;
|
||||
this->unk1C[2] = this->position_z;
|
||||
|
||||
func_802C3C88((GenMethod_1)func_80390CB4, reinterpret_cast(s32, this->marker));
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80390E28(Actor *this) {
|
||||
ActorLocal_lair_A810 *local;
|
||||
bool sp38;
|
||||
s32 i;
|
||||
f32 temp_f0;
|
||||
|
||||
local = (ActorLocal_lair_A810 *)&this->local;
|
||||
sp38 = mapSpecificFlags_getN(0, 2);
|
||||
if (!this->initialized) {
|
||||
if (D_80395460 == 0) {
|
||||
D_80395460 = func_8030508C(0x377, D_80395370[0], 0x14);
|
||||
}
|
||||
this->unk10_12 = 0;
|
||||
for(i = 0; (i < D_80395460) && (this->unk10_12 < 4); i++){
|
||||
temp_f0 = ml_vec3f_distance(this->position, D_80395370[i]);
|
||||
if ((temp_f0 > 400.0f) && (temp_f0 < 1200.0f)) {
|
||||
local->unk0[this->unk10_12][0] = D_80395370[i][0];
|
||||
local->unk0[this->unk10_12][1] = D_80395370[i][1];
|
||||
local->unk0[this->unk10_12][2] = D_80395370[i][2];
|
||||
this->unk10_12++;
|
||||
}
|
||||
}
|
||||
this->initialized = TRUE;
|
||||
}
|
||||
if (!this->unk16C_4) {
|
||||
if (sp38 != 0) {
|
||||
mapSpecificFlags_setN(0, 0, 2);
|
||||
}
|
||||
this->unk16C_4 = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this->state) {
|
||||
case 0:
|
||||
if( !func_8031A3BC() && (sp38 < 2) && (randf() < 0.1) && !mapSpecificFlags_get(0xA) && !func_803203FC(0x1F)) {
|
||||
sp38++;
|
||||
mapSpecificFlags_setN(0, sp38, 2);
|
||||
func_80390D3C(this, (randf() < 0.5) ? 2 :1);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
if (this->unk38_0) {
|
||||
func_80390D3C(this, 0);
|
||||
this->unk38_0 = FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
317
src/lair/code_AD70.c
Normal file
317
src/lair/code_AD70.c
Normal file
@@ -0,0 +1,317 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern void func_8038EA68(s32, s32[3]);
|
||||
extern void func_8038EA10(s32, f32[3]);
|
||||
extern void func_8038E9A4(s32, f32[3]);
|
||||
|
||||
typedef struct {
|
||||
f32 unk0;
|
||||
f32 unk4;
|
||||
f32 unk8;
|
||||
s32 unkC;
|
||||
s32 unk10;
|
||||
} ActorLocal_lair_AD70;
|
||||
|
||||
void func_80391B04(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80394AB0 = { 0x1EF, 0x3BB, 0x54B, 0x1, NULL, func_80391B04, func_80326224, func_80325340, 0, 0, 0.0f, 0};
|
||||
s32 D_80394AD4[3] = {0xBA, 0xBA, 0xBA};
|
||||
struct31s D_80394AE0 = {
|
||||
{0.1f, 0.2f},
|
||||
{3.6f, 4.6f},
|
||||
{1.0f, 1.0f},
|
||||
{3.0f, 3.0f},
|
||||
0.05f, 0.1f
|
||||
};
|
||||
|
||||
struct31s D_80394B08 = {
|
||||
{0.3f, 0.5f},
|
||||
{0.0f, 0.0f},
|
||||
{0.0f, 0.1f},
|
||||
{3.0f, 3.5f},
|
||||
0.4f, 0.6f,
|
||||
};
|
||||
|
||||
struct43s D_80394B30 = {
|
||||
{{-400.0f, 400.0f, -400.0f}, {400.0f, 800.0f, 400.0f}},
|
||||
{{0.0f, -1000.0f, 0.0f}, {0.0f, -1000.0f, 0.0f}},
|
||||
{{-20.0f, -20.0f, -20.0f}, {20.0f, 20.0f, 20.0f}}
|
||||
};
|
||||
|
||||
struct43s D_80394B78 = {
|
||||
{{-50.0f, 200.0f, -50.0f}, {50.0f, 400.0f, 50.0f}},
|
||||
{{0.0f, -500.0f, 0.0f}, {0.0f, -500.0f, 0.0f}},
|
||||
{{-40.0f, -40.0f, -40.0f}, {40.0f, 40.0f, 40.0f}}
|
||||
};
|
||||
f32 D_80394BC0[2] = {1000.0f, 2000.0f};
|
||||
s32 D_80394BC8[3] = {0xC0, 0xC0, 0xC0};
|
||||
s32 D_80394BD4[3] = {0xff, 0x80, 0x80};
|
||||
|
||||
/* .rodata */
|
||||
extern f32 D_803952D0; // .rodata : 0.2f
|
||||
extern f64 D_803952D8; // 4.0
|
||||
extern f64 D_803952E0;
|
||||
extern f64 D_803952E8;
|
||||
|
||||
|
||||
/* .code */
|
||||
void func_80391160(f32 pos[3], u32 count)
|
||||
{
|
||||
ParticleEmitter *p = partEmitList_pushNew(count);
|
||||
particleEmitter_setSprite(p, 0x70E);
|
||||
func_802EFFA8(p, D_80394AD4);
|
||||
func_802EF9E4(p, 0xEB);
|
||||
particleEmitter_setStartingFrameRange(p, 0, 7);
|
||||
particleEmitter_setPosition(p, pos);
|
||||
particleEmitter_setParticleSpawnPositionRange(p, -55, -55, -55, 55, 55, 55);
|
||||
particleEmitter_setParticleVelocityRange(p, -70, -70, -70, 70, 70, 70);
|
||||
func_802EFB98(p, &D_80394AE0);
|
||||
particleEmitter_emitN(p, count);
|
||||
}
|
||||
|
||||
void func_80391254(f32 pos[3], u32 count, enum asset_e sprite)
|
||||
{
|
||||
ParticleEmitter *p = partEmitList_pushNew(count);
|
||||
particleEmitter_setSprite(p, sprite);
|
||||
func_802EFA70(p, 8);
|
||||
particleEmitter_setStartingFrameRange(p, 0, 2);
|
||||
particleEmitter_setParticleFramerateRange(p, 4, 6);
|
||||
particleEmitter_setParticleSpawnPositionRange(p, -80, 0, -80, 80, 0, 80);
|
||||
particleEmitter_setPosition(p, pos);
|
||||
func_802EFA5C(p, 0.6f, 0.7f);
|
||||
func_802EFB70(p, 3, 3);
|
||||
func_802EFB84(p, 4, 4);
|
||||
func_802EFEC0(p, 1, 1);
|
||||
particleEmitter_emitN(p, count);
|
||||
}
|
||||
|
||||
void func_8039137C(f32 pos[3], u32 count, enum asset_e sprite)
|
||||
{
|
||||
ParticleEmitter *p = partEmitList_pushNew(count);
|
||||
particleEmitter_setSprite(p, sprite);
|
||||
particleEmitter_setPosition(p, pos);
|
||||
func_802EF9F8(p, 0.3f);
|
||||
func_802EFA18(p, 3);
|
||||
func_802EFE24(p, 0, 0, 600, 0, 0, 900);
|
||||
particleEmitter_setPositionVelocityAndAccelerationRanges(p, &D_80394B30);
|
||||
func_802EFB98(p, &D_80394B08);
|
||||
func_802EFA70(p, 2);
|
||||
particleEmitter_emitN(p, count);
|
||||
}
|
||||
|
||||
void func_8039144C(f32 pos[3], u32 count)
|
||||
{
|
||||
ParticleEmitter *p = partEmitList_pushNew(count);
|
||||
particleEmitter_setSprite(p, 0x713);
|
||||
particleEmitter_setPosition(p, pos);
|
||||
particleEmitter_setParticleSpawnPositionRange(p, -40, -40, -40, 40, 40, 40);
|
||||
func_802EFA70(p, 4);
|
||||
func_802EFE24(p, 0, 0, 200, 0, 0, 300);
|
||||
func_802EFA5C(p, 0.1f, 0.2f);
|
||||
func_802EFEC0(p, 0.75f, 0.75f);
|
||||
func_802EFB70(p, 0.5f, 0.5f);
|
||||
func_802EFB84(p, 0.2f, 0.2f);
|
||||
particleEmitter_setParticleAccelerationRange(p, 0, -50, 0, 0, -100, 0);
|
||||
particleEmitter_emitN(p, count);
|
||||
}
|
||||
|
||||
void func_803915A4(f32 pos[3], s32 count, f32 scale)
|
||||
{
|
||||
ParticleEmitter *p = partEmitList_pushNew(count);
|
||||
particleEmitter_setSprite(p, 0x4A0);
|
||||
func_802EFA5C(p, 0.1f, 0.2f);
|
||||
func_802EFA70(p, 8);
|
||||
particleEmitter_setStartingFrameRange(p, 2, 8);
|
||||
particleEmitter_setParticleFramerateRange(p, 8, 8);
|
||||
particleEmitter_setPosition(p, pos);
|
||||
func_802EFB70(p, scale * 2.0, scale * 2.0);
|
||||
func_802EFB84(p, scale * 0.4, scale * 0.4);
|
||||
func_802EFEC0(p, 0.5f, 0.5f);
|
||||
particleEmitter_emitN(p, count);
|
||||
}
|
||||
|
||||
|
||||
void func_803916BC(f32 position[3], s32 cnt){
|
||||
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
|
||||
particleEmitter_setSprite(pCtrl, ASSET_4A0_SPRITE_EXPLOSION);
|
||||
func_802EFA5C(pCtrl, 0.1f, 0.3f);
|
||||
func_802EFA70(pCtrl, 8);
|
||||
particleEmitter_setStartingFrameRange(pCtrl, 0, 6);
|
||||
particleEmitter_setParticleFramerateRange(pCtrl, 5.0f, 8.0f);
|
||||
particleEmitter_setPosition(pCtrl, position);
|
||||
func_802EFB70(pCtrl, 2.0f, 2.0f);
|
||||
func_802EFB84(pCtrl, 4.0f, 4.0f);
|
||||
func_802EFEC0(pCtrl, 1.0f, 1.5f);
|
||||
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80394B78);
|
||||
particleEmitter_emitN(pCtrl, cnt);
|
||||
}
|
||||
|
||||
void func_803917B0(Actor *actor)
|
||||
{
|
||||
Actor *unk = func_80329980(actor);
|
||||
|
||||
unk->unk38_0 = TRUE;
|
||||
}
|
||||
|
||||
void func_803917DC(void)
|
||||
{
|
||||
u32 flags = mapSpecificFlags_getN(0, 2);
|
||||
mapSpecificFlags_setN(0, flags - 1, 2);
|
||||
}
|
||||
|
||||
void func_80391810(Actor *this, s32 next_state) {
|
||||
ActorLocal_lair_AD70 *local;
|
||||
f32 sp38[3];
|
||||
f32 sp34;
|
||||
|
||||
local = (ActorLocal_lair_AD70 *)&this->local;
|
||||
switch (next_state) {
|
||||
case 1:
|
||||
sp34 = (this->position[1] + this->unk28) - this->unk1C[1];
|
||||
this->velocity[1] = gu_sqrtf(this->unk28 * 2000.0);
|
||||
local->unk0 = -this->velocity[1] / -1000.0f;
|
||||
local->unk0 += gu_sqrtf((sp34 * -2.0) / -1000.0);
|
||||
this->velocity[0] = this->unk1C[0] - this->position[0];
|
||||
this->velocity[2] = this->unk1C[2] - this->position[2];
|
||||
this->velocity[0] /= local->unk0;
|
||||
this->velocity[2] /= local->unk0;
|
||||
local->unk4 *= local->unk0;
|
||||
this->unk60 = 0.0f;
|
||||
local->unk8 = this->position[1] * 0.5;
|
||||
sp38[0] = this->position[0];
|
||||
sp38[1] = this->position[1];
|
||||
sp38[2] = this->position[2];
|
||||
sp38[1] += 100.0f;
|
||||
func_803916BC(sp38, 3);
|
||||
break;
|
||||
case 2:
|
||||
FUNC_8030E8B4(SFX_148_GRUNTY_SPELL_LANDING, 1.0f, 20000, this->position, 1500, 3000);
|
||||
func_80391254(this->position, 2, 0x4A0);
|
||||
func_80391254(this->position, 2, 0x6C1);
|
||||
func_80391160(this->position, 4);
|
||||
func_8039137C(this->position, 4, 0x711);
|
||||
func_8039137C(this->position, 4, 0x712);
|
||||
func_803917B0(this);
|
||||
timedFunc_set_0(4.0f, func_803917DC);
|
||||
this->unk60 = 4.0f;
|
||||
break;
|
||||
case 3:
|
||||
FUNC_8030E8B4(SFX_96_HOTSAND_EEL_HISS, 0.8f, 25000, this->position, 1500, 3000);
|
||||
sp38[0] = this->position[0];
|
||||
sp38[1] = this->position[1];
|
||||
sp38[2] = this->position[2];
|
||||
sp38[1] += 100.0f;
|
||||
func_803916BC(sp38, 3);
|
||||
func_80391160(sp38, 4);
|
||||
func_8039137C(sp38, 4, 0x714);
|
||||
func_8039137C(sp38, 4, 0x715);
|
||||
func_803917B0(this);
|
||||
func_803917DC();
|
||||
break;
|
||||
case 4:
|
||||
func_803917B0(this);
|
||||
func_803917DC();
|
||||
break;
|
||||
}
|
||||
func_80328A84(this, next_state);
|
||||
}
|
||||
|
||||
|
||||
void func_80391AE4(Actor *actor)
|
||||
{
|
||||
func_8038E968(*(s32 *)&actor->unk7C[0x10]);
|
||||
}
|
||||
|
||||
void func_80391B04(Actor *this) {
|
||||
f32 sp44;
|
||||
ActorLocal_lair_AD70 *local;
|
||||
f32 sp34[3];
|
||||
f32 temp_f0_2;
|
||||
|
||||
local = (ActorLocal_lair_AD70 *)&this->local;
|
||||
sp44 = time_getDelta();
|
||||
if (!this->unk16C_4) {
|
||||
local->unk10 = func_8038E800();
|
||||
func_8038EA68(local->unk10, D_80394BC8);
|
||||
func_8038EA10(local->unk10, D_80394BC0);
|
||||
this->unk58_2 = FALSE;
|
||||
func_80391810(this, 1);
|
||||
func_803300D8(this->marker, func_80391AE4);
|
||||
this->unk16C_4 = TRUE;
|
||||
}
|
||||
|
||||
func_8038E9A4(local->unk10, this->position);
|
||||
switch (this->state) { /* irregular */
|
||||
case 1:
|
||||
if (func_8031A3BC() || mapSpecificFlags_get(0xA)) {
|
||||
func_80391810(this, 4);
|
||||
break;
|
||||
}
|
||||
this->position[0] += this->velocity[0] * sp44;
|
||||
this->position[1] += this->velocity[1] * sp44;
|
||||
this->position[2] += this->velocity[2] * sp44;
|
||||
this->velocity[1] += -1000.0f * sp44;
|
||||
this->yaw += this->yaw_moving * sp44;
|
||||
this->pitch += this->unk6C * sp44;
|
||||
if ((this->velocity[1] < 0.0) && (this->position[1] < this->unk1C[1])) {
|
||||
func_80391810(this, 3);
|
||||
}
|
||||
func_803915A4(this->position, 1, (f32)local->unkC);
|
||||
if (func_80329904(this->marker, 5, sp34)) {
|
||||
func_8039144C(sp34, 1);
|
||||
}
|
||||
if (local->unk4 > 0.0) {
|
||||
this->unk60 += sp44;
|
||||
if (local->unk4 < this->unk60) {
|
||||
func_80391810(this, 2);
|
||||
}
|
||||
}
|
||||
if ((local->unk8 < this->position[1]) && !this->unk138_24) {
|
||||
FUNC_8030E8B4(SFX_14E_SOFT_EXPLOSION, 1.0f, 20000, this->position, 1500, 3000);
|
||||
this->unk138_24 = TRUE;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
marker_despawn(this->marker);
|
||||
break;
|
||||
case 2:
|
||||
this->unk60 -= sp44;
|
||||
if (this->unk60 > 0.0f) {
|
||||
temp_f0_2 = (f32) ((f64) this->unk60 * 0.25);
|
||||
D_80394BD4[0] = (s32) ((f32) D_80394BD4[0] * temp_f0_2);
|
||||
D_80394BD4[1] = (s32) ((f32) D_80394BD4[1] * temp_f0_2);
|
||||
D_80394BD4[2] = (s32) ((f32) D_80394BD4[2] * temp_f0_2);
|
||||
func_8038EA68(local->unk10, D_80394BD4);
|
||||
break;
|
||||
}
|
||||
marker_despawn(this->marker);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80391EA8(ActorMarker *marker, ActorMarker *a1, f32 a2[3], f32 f1, f32 scale, s32 f2)
|
||||
{
|
||||
Actor *actor = marker_getActor(marker);
|
||||
u8 *unk = actor->unk7C;
|
||||
|
||||
actor->unk1C[0] = a2[0];
|
||||
actor->unk1C[1] = a2[1];
|
||||
actor->unk1C[2] = a2[2];
|
||||
|
||||
actor->unk28 = f1;
|
||||
|
||||
actor->yaw_moving = randf2( 240, 480);
|
||||
actor->unk6C = randf2(-240, -480);
|
||||
|
||||
actor->scale = scale;
|
||||
|
||||
actor->unk100 = a1;
|
||||
|
||||
*(f32 *)(unk + 0x04) = f2 > 0 ? 0.5 : 0.0;
|
||||
*(s32 *)(unk + 0x0C) = f2 < 0 ? 2.5 : 1.0;
|
||||
}
|
||||
|
146
src/lair/code_BBD0.c
Normal file
146
src/lair/code_BBD0.c
Normal file
@@ -0,0 +1,146 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern void func_8030E9FC(enum sfx_e, f32, f32, s32, f32[3], f32, f32);
|
||||
|
||||
void func_8039217C(Actor *this);
|
||||
Actor *func_80391FC0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_80394BE0[] = {
|
||||
{0x000, 0.0f},
|
||||
{0x28A, 1000000.0f},
|
||||
{0x28A, 1.5f},
|
||||
{0x28C, 1000000.0f},
|
||||
{0x28C, 2.0f},
|
||||
{0x1D5, 1000000.0f},
|
||||
{0x1D5, 0.25},
|
||||
{0x28E, 2.0f},
|
||||
{0x1D0, 3.0f},
|
||||
};
|
||||
ActorInfo D_80394C28 = { 0x29A, 0x3C4, 0x55F, 0x1, D_80394BE0, func_8039217C, func_80326224, func_80325888, 0, 0, 3.0f, 0};
|
||||
ActorInfo D_80394C4C = { 0x29A, 0x3C7, 0x560, 0x3, D_80394BE0, func_8039217C, func_80326224, func_80325888, 0, 0, 1.0f, 0};
|
||||
ActorInfo D_80394C70 = { 0x29A, 0x3C6, 0x34C, 0x0, D_80394BE0, func_8039217C, func_80326224, func_80325888, 0, 0, 3.0f, 0};
|
||||
ActorInfo D_80394C94 = { 0x29A, 0x3C8, 0x35B, 0x5, D_80394BE0, func_8039217C, func_80326224, func_80391FC0, 0, 0, 1.0f, 0};
|
||||
|
||||
/* .code */
|
||||
Actor *func_80391FC0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
func_8033A45C(4, 1);
|
||||
func_8033A45C(5, 1);
|
||||
return func_80325888(marker, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
void func_80392014(Actor *this, enum sfx_e sfx_id, f32 arg2, f32 arg3, s32 arg4) {
|
||||
if (mapSpecificFlags_get(0xA) || func_803203FC(0x1F)) {
|
||||
arg4 = arg4 * 0.5;
|
||||
}
|
||||
if (mapSpecificFlags_get(5)) {
|
||||
func_8030EBC8(sfx_id, arg2, arg3, arg4, arg4);
|
||||
return;
|
||||
}
|
||||
func_8030E9FC(sfx_id, arg2, arg3, arg4, this->position, 1000.0f, 2000.0f);
|
||||
}
|
||||
|
||||
void func_803920E0(Actor *this, enum sfx_e sfx_id, f32 arg2, f32 arg3, s32 arg4, f32 arg5) {
|
||||
s32 sp1C;
|
||||
|
||||
sp1C = func_802F9AA8(sfx_id);
|
||||
func_802F9F80(sp1C, 0.1f, arg5, 0.2f);
|
||||
func_802FA060(sp1C, arg4, arg4, 0.0f);
|
||||
func_802F9DB8(sp1C, arg2, arg3, 0.01f);
|
||||
if (!mapSpecificFlags_get(5)) {
|
||||
func_802F9EC4(sp1C, this->position, 1000, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8039217C(Actor *this) {
|
||||
if (!this->initialized) {
|
||||
this->initialized = TRUE;
|
||||
if (func_8031FF1C(0xA6)) {
|
||||
marker_despawn(this->marker);
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch(this->state){
|
||||
case 1: //L803921F4
|
||||
if (randf() < 0.01) {
|
||||
func_80328A84(this, 2U);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: //L8039222C
|
||||
if (actor_animationIsAt(this, 0.2f)) {
|
||||
func_80392014(this, SFX_20_METAL_CLANK_1, 0.95f, 1.05f, 15000);
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.45f)) {
|
||||
func_80392014(this, SFX_20_METAL_CLANK_1, 0.95f, 1.05f, 15000);
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.9f)) {
|
||||
func_80392014(this, SFX_20_METAL_CLANK_1, 0.95f, 1.05f, 15000);
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.999f)) {
|
||||
func_80328A84(this, 1U);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: //L803922FC
|
||||
if (randf() < 0.01) {
|
||||
func_80328A84(this, 4U);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: //L80392334
|
||||
if (actor_animationIsAt(this, 0.15f)) {
|
||||
func_80392014(this, SFX_9_SQUEAKY_TOY, 1.25f, 1.35f, 28000);
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.5f)) {
|
||||
func_80392014(this, SFX_9_SQUEAKY_TOY, 1.25f, 1.35f, 28000);
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.999f)) {
|
||||
func_80328A84(this, 3U);
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: //L803923C0
|
||||
if (func_803203FC(0x1F)) {
|
||||
func_80328A84(this, 8U);
|
||||
break;
|
||||
}
|
||||
if (mapSpecificFlags_get(9)) {
|
||||
mapSpecificFlags_set(5, 0);
|
||||
func_80328A84(this, 8U);
|
||||
break;
|
||||
}
|
||||
if ((randf() < 0.1) || mapSpecificFlags_get(5)) {
|
||||
this->unk38_0 = mapSpecificFlags_get(5);
|
||||
this->unk60 = randf2(2.0f, 4.0f);
|
||||
func_80328A84(this, 6U);
|
||||
func_803920E0(this, SFX_134_FREEZING_SHIVER, 1.1f, 1.2f, 15000, this->unk60);
|
||||
break;
|
||||
}
|
||||
if (randf() < 0.1) {
|
||||
func_80328A84(this, 7U);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6: //L803924EC
|
||||
if (this->unk60 > 0.0f) {
|
||||
this->unk60 -= time_getDelta();
|
||||
break;
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.999f) || (mapSpecificFlags_get(5) != this->unk38_0)) {
|
||||
func_80328A84(this, 5U);
|
||||
}
|
||||
break;
|
||||
|
||||
case 7: //L8039255C
|
||||
if ((actor_animationIsAt(this, 0.999f)) || (mapSpecificFlags_get(5) != this->unk38_0)) {
|
||||
func_80328A84(this, 5U);
|
||||
}
|
||||
break;
|
||||
|
||||
case 8: //L80392594
|
||||
break;
|
||||
}
|
||||
}
|
121
src/lair/code_C1C0.c
Normal file
121
src/lair/code_C1C0.c
Normal file
@@ -0,0 +1,121 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
Actor *func_803925B0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
void func_80392700(Actor *this);
|
||||
void func_80392918(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_80394CC0[] = {
|
||||
{0x000, 0.0f},
|
||||
{0x28B, 8.0f},
|
||||
{0x28D, 0.5f},
|
||||
{0x2AC, 3.0f},
|
||||
{0x2AD, 14.0f},
|
||||
{0x28D, 0.5f},
|
||||
};
|
||||
ActorInfo D_80394CF0 = { 0x29B, 0x3C5, 0x53D, 0x1, D_80394CC0, func_80392700, func_80392918, func_803925B0, 0, 0, 3.0f, 0};
|
||||
|
||||
/* .code */
|
||||
Actor *func_803925B0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
func_8033A45C(3, 0);
|
||||
func_8033A45C(4, 0);
|
||||
func_8033A45C(5, 0);
|
||||
return func_80325888(marker, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
|
||||
void func_80392610(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
if(arg2 == 0xA){
|
||||
mapSpecificFlags_set(5, TRUE);
|
||||
}
|
||||
else{
|
||||
mapSpecificFlags_set(5, FALSE);
|
||||
}
|
||||
set_camera_to_node(arg2);
|
||||
}
|
||||
|
||||
void func_80392664(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
func_802BBC58(2);
|
||||
}
|
||||
|
||||
void func_80392690(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
Actor *this;
|
||||
|
||||
this = marker_getActor(marker);
|
||||
func_8030E6D4(SFX_EA_GRUNTY_LAUGH_1);
|
||||
func_80328B8C(this, 5, 0.0f, 1);
|
||||
actor_loopAnimation(this);
|
||||
this->yaw_moving = 79.0f;
|
||||
animctrl_setTransitionDuration(this->animctrl, 0.4f);
|
||||
}
|
||||
|
||||
void func_80392700(Actor *this) {
|
||||
if (mapSpecificFlags_get(4)) {
|
||||
if (func_8031FF1C(0xF4)) {
|
||||
func_80311480(0x1031, 0xF, this->position, this->marker, func_80392664, func_80392610);
|
||||
} else {
|
||||
func_802BC280();
|
||||
set_camera_to_node(0x1F);
|
||||
func_80311480(0x102C, 0xE, this->position, this->marker, func_80392664, func_80392610);
|
||||
func_80320004(0xF4, 1);
|
||||
}
|
||||
mapSpecificFlags_set(4, 0);
|
||||
}
|
||||
if (mapSpecificFlags_get(6)) {
|
||||
func_8025A70C(MUSIC_KLUNGO_BY_FALLEN_GRUNTY);
|
||||
func_802BC280();
|
||||
set_camera_to_node(9);
|
||||
mapSpecificFlags_set(9, 1);
|
||||
func_8028F94C(2, this->position);
|
||||
func_80311480(0x103F, 0x2A, this->position, this->marker, func_80392690, func_80392610);
|
||||
mapSpecificFlags_set(6, 0);
|
||||
func_80328B8C(this, 3, 0.0f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
}
|
||||
if ((this->state == 3) && (actor_animationIsAt(this, 0.999f) != 0)) {
|
||||
func_80328B8C(this, 4, 0.0f, 1);
|
||||
actor_loopAnimation(this);
|
||||
}
|
||||
if (this->state == 5) {
|
||||
func_80328FB0(this, 12.0f);
|
||||
if (func_80329480(this) != 0) {
|
||||
func_80328B8C(this, 5, 0.0f, 1);
|
||||
this->marker->unk2C_2 = TRUE;
|
||||
}
|
||||
}
|
||||
this->unk58_0 = !func_8031A3BC();
|
||||
}
|
||||
|
||||
|
||||
void func_80392918(Actor *this) {
|
||||
if (!this->unk16C_4) {
|
||||
if ((func_8031FF1C(0xF4) != 0) && (func_8028E4A4() == 2)) {
|
||||
mapSpecificFlags_set(4, 1);
|
||||
}
|
||||
this->unk4C = 400.0f;
|
||||
this->marker->unk2C_2 = FALSE;
|
||||
this->unk16C_4 = TRUE;
|
||||
if (func_8031FF1C(0xA6) != 0) {
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
return;
|
||||
}
|
||||
func_80326224(this);
|
||||
if ((this->unk48 > 0.5) && !this->unk138_24) {
|
||||
this->unk138_24 = TRUE;
|
||||
set_camera_to_node(0x1E);
|
||||
}
|
||||
if ((0.999 < this->unk48) && !this->unk38_0) {
|
||||
comusic_8025AB44(MUSIC_KLUNGO_BY_FALLEN_GRUNTY, 0, 2000);
|
||||
func_8025AABC(0xA8);
|
||||
this->unk38_0 = TRUE;
|
||||
mapSpecificFlags_set(7, TRUE);
|
||||
mapSpecificFlags_set(5, TRUE);
|
||||
}
|
||||
if (this->unk48 == 1.0) {
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
|
||||
}
|
57
src/lair/code_C6C0.c
Normal file
57
src/lair/code_C6C0.c
Normal file
@@ -0,0 +1,57 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern void func_8028F3D8(f32[3], f32, void(*)(ActorMarker *), ActorMarker *);
|
||||
|
||||
void func_80392B6C(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80394D20 = { 0x29C, 0x3C9, 0x0, 0x0, NULL, func_80392B6C, func_80326224, func_80325340, 0, 0, 0.0f, 0};
|
||||
|
||||
/* .code */
|
||||
void func_80392AB0(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
comusic_8025AB44(COMUSIC_A9_TOOTY, 0, 2000);
|
||||
func_8025AABC(0xA9);
|
||||
func_8031B51C();
|
||||
}
|
||||
|
||||
void func_80392AF4(ActorMarker *marker, enum asset_e text_id, s32 arg2){
|
||||
set_camera_to_node(arg2);
|
||||
}
|
||||
|
||||
void func_80392B1C(ActorMarker *marker) {
|
||||
func_8028E6EC(0);
|
||||
func_80311480(0x1040, 8, NULL, marker, func_80392AB0, func_80392AF4);
|
||||
}
|
||||
|
||||
void func_80392B6C(Actor *this) {
|
||||
NodeProp* phi_a0;
|
||||
s32 sp28;
|
||||
|
||||
if (!this->unk16C_4) {
|
||||
this->unk16C_4 = TRUE;
|
||||
if (func_8031FF1C(0xA6) != 0) {
|
||||
marker_despawn(this->marker);
|
||||
return;
|
||||
}
|
||||
phi_a0 = func_80304C38(0x3BE, this);
|
||||
if (this == NULL) {
|
||||
this->unk1C[0] = -1300.0f;
|
||||
this->unk1C[1] = 250.0f;
|
||||
this->unk1C[2] = -3422.0f;
|
||||
} else {
|
||||
nodeprop_getPosition(phi_a0, this->unk1C);
|
||||
}
|
||||
}
|
||||
if (mapSpecificFlags_get(7) != 0) {
|
||||
sp28 = ml_vec3f_distance(this->position, this->unk1C) / 350.0;
|
||||
func_8025A70C(COMUSIC_A9_TOOTY);
|
||||
mapSpecificFlags_set(7, 0);
|
||||
mapSpecificFlags_set(9, 1);
|
||||
set_camera_to_node(0x10);
|
||||
func_8028F918(0);
|
||||
func_8028F85C(this->position);
|
||||
func_8028F3D8(this->unk1C, (f32) sp28, &func_80392B1C, this->marker);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user