All Changes

This commit is contained in:
Moses Troyer
2025-08-16 17:15:49 +00:00
committed by Banjo Kazooie
parent fd208f77ca
commit c2dd933d22
389 changed files with 7824 additions and 6965 deletions

View File

@@ -24,15 +24,15 @@ void func_8038BA30(ActorMarker *marker, enum asset_e text_id, s32 arg2){
this = marker_getActor(marker);
phi_v1 = this->unk10_12*2;
volatileFlag_getN(VOLATILE_FLAG_20_BEGIN_CHARACTER_PARADE + this->unkF4_8*6 + phi_v1, 2);
volatileFlag_getN(VOLATILE_FLAG_20_BEGIN_CHARACTER_PARADE + this->actorTypeSpecificField*6 + phi_v1, 2);
}
void lair_func_8038BA88(ActorMarker *marker, enum asset_e text_id, s32 arg2){
void healDuoToFull(ActorMarker *marker, enum asset_e textId_unused, s32 arg2){
Actor *this;
this = marker_getActor(marker);
item_set(ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL));
fileProgressFlag_set(this->unkF4_8 - 1 + FILEPROG_E9_HEALED_BY_BRENTILDA_1, TRUE);
fileProgressFlag_set(this->actorTypeSpecificField - 1 + FILEPROG_E9_HEALED_BY_BRENTILDA_1, TRUE);
}
void func_8038BADC(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
@@ -40,13 +40,13 @@ void func_8038BADC(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
this = marker_getActor(marker);
if (text_id == ((ActorLocal_lair_5640 *)&this->local)->unk0 + 2) {
if (!fileProgressFlag_get(this->unkF4_8 - 1 + FILEPROG_E9_HEALED_BY_BRENTILDA_1)) {
if (!fileProgressFlag_get(this->actorTypeSpecificField - 1 + FILEPROG_E9_HEALED_BY_BRENTILDA_1)) {
if (item_getCount(ITEM_14_HEALTH) < item_getCount(ITEM_15_HEALTH_TOTAL)) {
gcdialog_showText(ASSET_10A2_DIALOG_UNKNOWN, 0xF, this->position, this->marker, func_8038BADC, lair_func_8038BA88);
gcdialog_showDialog(ASSET_10A2_DIALOG_BRENTILDA_HEAL, 0xF, this->position, this->marker, func_8038BADC, healDuoToFull);
return;
}
}
gcdialog_showText(ASSET_D38_DIALOG_BOTTLES_ALL_MOVES_LEARNED, 0xC, this->position, this->marker, func_8038BADC, NULL);
gcdialog_showDialog(ASSET_D38_DIALOG_EMPTY, 0xC, this->position, this->marker, func_8038BADC, NULL);
return;
}
subaddie_set_state(this, 1);
@@ -111,7 +111,7 @@ void chBrentilda_update(Actor *this) {
}
if (!this->volatile_initialized) {
local->unk0 = this->unkF4_8*3 + 0x1080;
local->unk0 = this->actorTypeSpecificField*3 + 0x1080;
this->volatile_initialized = TRUE;
}
@@ -178,9 +178,9 @@ void chBrentilda_update(Actor *this) {
if( (phi_f2 < 300.0)
&& (player_movementGroup() == BSGROUP_0_NONE)
&& func_8028F20C()
&& !func_803114B0()) {
&& !gcdialog_hasCurrentTextId()) {
if (!fileProgressFlag_get(FILEPROG_96_MET_BRENTILDA)) {
gcdialog_showText(ASSET_10A1_DIALOG_BRENTILDA_MEET, 0xA, this->position, this->marker, func_8038BADC, NULL);
gcdialog_showDialog(ASSET_10A1_DIALOG_BRENTILDA_MEET, 0xA, this->position, this->marker, func_8038BADC, NULL);
fileProgressFlag_set(FILEPROG_96_MET_BRENTILDA, TRUE);
subaddie_set_state(this, 2);
return;
@@ -188,7 +188,7 @@ void chBrentilda_update(Actor *this) {
if (func_8028EFC8() && (sp78[FACE_BUTTON(BUTTON_B)] == 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);
gcdialog_showDialogConditional(local->unk0 + this->unk10_12, 0xB, this->position, this->marker, func_8038BADC, NULL, func_8038BA30);
subaddie_set_state(this, 2);
return;
}

View File

@@ -63,7 +63,7 @@ f32 D_803936E4[] = {0.03f, 0.09f, 0.2f, 0.25f, 0.32f, 0.4f, 0.45f, 1.0f};
/* .code */
bool func_8038A690(Actor *this) {
if (this->unkF4_8 != 3) {
if (this->actorTypeSpecificField != 3) {
return subaddie_playerIsWithinCylinder(this, 400, 90);
}
else{
@@ -72,11 +72,11 @@ bool func_8038A690(Actor *this) {
}
enum file_progress_e chWarpCauldron_getFileProgressFlagIndex(Actor *this){
return this->unkF4_8 -1 + 0x49;
return this->actorTypeSpecificField -1 + 0x49;
}
enum file_progress_e chWarpCauldron_getPairedFileProgressFlagIndex(Actor *this){
return ((this->unkF4_8 - 1) ^ 1) + 0x49;
return ((this->actorTypeSpecificField - 1) ^ 1) + 0x49;
}
void func_8038A704(Actor *this){
@@ -135,8 +135,8 @@ void func_8038A96C(Actor *this, s32 arg1) {
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[i] = D_803935A8[(((s32)this->actorTypeSpecificField - 1)>>1)][0][i];
sp38[i] = D_803935A8[(((s32)this->actorTypeSpecificField - 1)>>1)][1][i];
}
sp48[3] = 1.0f;
@@ -153,7 +153,7 @@ void func_8038A96C(Actor *this, s32 arg1) {
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) {
if (this->actorTypeSpecificField == 7) {
func_80324CFC(0.5f, COMUSIC_8C_JINJONATOR_POWERUP, 32000);
func_80324D2C(7.0f, COMUSIC_8C_JINJONATOR_POWERUP);
}
@@ -164,9 +164,9 @@ void func_8038AB90(Actor *this, s32 arg1, s32 arg2, enum sfx_e sfx_id, f32 sfx_t
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);
coMusicPlayer_playMusicWeak(COMUSIC_3F_MAGIC_CARPET_RISING, 32000);
func_80324D2C(2.6f, COMUSIC_3F_MAGIC_CARPET_RISING);
func_8030E540(SFX_7C_CHEBOOF);
gcsfx_play(SFX_7C_CHEBOOF);
}
}
}
@@ -176,15 +176,15 @@ void func_8038AC7C(Actor *this) {
u32 sp28;
if(
(func_803114C4() != 0xFAD)
&& func_80329530(this, 1200)
(gcdialog_getCurrentTextId() != 0xFAD)
&& subaddie_playerIsWithinSphereAndActive(this, 1200)
&& !fileProgressFlag_get(FILEPROG_FC_DEFEAT_GRUNTY)
) {
this->lifetime_value += time_getDelta();
if (35.0 < this->lifetime_value) {
sp2C = (fileProgressFlag_get(FILEPROG_CF_HAS_ENTERED_FINAL_FIGHT)) ? 0xFB7 : 0xFAE;
sp28 = (fileProgressFlag_get(FILEPROG_CF_HAS_ENTERED_FINAL_FIGHT)) ? 0xFBC : 0xFB7;
if (gcdialog_showText(sp2C + this->unk38_31, 0, NULL, NULL, NULL, NULL)) {
if (gcdialog_showDialog(sp2C + this->unk38_31, 0, NULL, NULL, NULL, NULL)) {
this->unk38_31++;
this->lifetime_value = 0.0f;
if (sp2C + this->unk38_31 >= sp28) {
@@ -244,11 +244,11 @@ void chWarpCauldron_update(Actor *this) {
func_8038A96C(this, 2);
sp50 = TRUE;
if( ( func_802D677C(-1) != 0
&& (func_802D677C(-1) == D_80393620[this->unkF4_8 - 1].unk0)
&& (func_802D677C(-1) == D_80393620[this->actorTypeSpecificField - 1].unk0)
&& (func_802D67AC(-1) == MAP_16_GV_RUBEES_CHAMBER)
&& (func_802D680C(-1) == this->unkF4_8)
&& (func_802D680C(-1) == this->actorTypeSpecificField)
)
|| (exit_get() == D_80393620[this->unkF4_8 - 1].unk2)
|| (exit_get() == D_80393620[this->actorTypeSpecificField - 1].unk2)
) {
func_8028F85C(this->position);
this->unk10_12 = 1;
@@ -256,7 +256,7 @@ void chWarpCauldron_update(Actor *this) {
}
if (!fileProgressFlag_get(FILEPROG_F5_COMPLETED_A_WARP_CAULDRON_SET) && fileProgressFlag_get(chWarpCauldron_getPairedFileProgressFlagIndex(this))) {
if (func_802D677C(-1) != map_get()) {
gcdialog_showText(ASSET_F7A_DIALOG_UNKNOWN, 4, NULL, NULL, NULL, NULL);
gcdialog_showDialog(ASSET_F7A_DIALOG_UNKNOWN, 4, NULL, NULL, NULL, NULL);
fileProgressFlag_set(FILEPROG_F5_COMPLETED_A_WARP_CAULDRON_SET, 1);
}
}
@@ -273,15 +273,15 @@ void chWarpCauldron_update(Actor *this) {
subaddie_set_state_forward(this, 2);
this->unk38_0 = FALSE;
func_8038A96C(this, 1);
func_802BAFE4(D_80393620[this->unkF4_8 - 1].unk3);
gcStaticCamera_activate(D_80393620[this->actorTypeSpecificField - 1].unk3);
func_802D09B8(this, 2);
phi_a0 = (fileProgressFlag_get(chWarpCauldron_getPairedFileProgressFlagIndex(this)) != 0) ? SFX_107_CAULDRON_ACTIVATION_1 : SFX_108_CAULDRON_ACTIVATION_2;
sfxsource_play(phi_a0, 32000);
gcsfx_playAtSampleRate(phi_a0, 32000);
if (!fileProgressFlag_get(FILEPROG_F5_COMPLETED_A_WARP_CAULDRON_SET) && !fileProgressFlag_get(chWarpCauldron_getPairedFileProgressFlagIndex(this))) {
gcdialog_showText(ASSET_F79_DIALOG_UNKNOWN, 4, NULL, NULL, NULL, NULL);
gcdialog_showDialog(ASSET_F79_DIALOG_UNKNOWN, 4, NULL, NULL, NULL, NULL);
}
if (fileProgressFlag_get(chWarpCauldron_getPairedFileProgressFlagIndex(this))){
switch(this->unkF4_8){
switch(this->actorTypeSpecificField){
case 2://L8038B204
func_802D6310(2.0f, MAP_6A_GL_TTC_AND_CC_PUZZLE, 0x62, 0x22, 0);
break;
@@ -351,16 +351,16 @@ void chWarpCauldron_update(Actor *this) {
case 5: //L8038B48C
func_8038A96C(this, 3);
if (actor_animationIsAt(this, 0.01f)) {
func_8030E540(SFX_7C_CHEBOOF);
gcsfx_play(SFX_7C_CHEBOOF);
}
if (actor_animationIsAt(this, 0.63f)) {
volatileFlag_set(VOLATILE_FLAG_1E, 0);
func_802D677C(0);
func_8028FCAC();
nodeprop_getPosition(nodeprop_findByActorIdAndActorPosition(D_80393620[this->unkF4_8 - 1].unk6, this), sp54);
if (this->unkF4_8 == 7) {
nodeprop_getPosition(nodeprop_findByActorIdAndActorPosition(D_80393620[this->actorTypeSpecificField - 1].unk6, this), sp54);
if (this->actorTypeSpecificField == 7) {
func_8028F66C(BS_INTR_36_DINGPOT);
func_802BAFE4(0x82);
gcStaticCamera_activate(0x82);
} else {
func_8028F4B8(sp54, 1620.0f, -4100.0f);
}
@@ -375,17 +375,17 @@ void chWarpCauldron_update(Actor *this) {
func_8038A96C(this, 3);
if (actor_animationIsAt(this, 0.99f)) {
func_802D6344();
func_802D677C(D_80393620[((this->unkF4_8 - 1) ^ 1)].unk0);
func_802D677C(D_80393620[((this->actorTypeSpecificField - 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);
func_802D680C(((this->actorTypeSpecificField - 1) ^ 1) + 1);
func_802D683C(D_80393620[((this->actorTypeSpecificField - 1) ^ 1)].unk1);
func_8031CC40(D_80393620[((this->actorTypeSpecificField - 1) ^ 1)].unk0, D_80393620[((this->actorTypeSpecificField - 1) ^ 1)].unk2);
}
break;
case 6: //L8038B64C
if (func_8038A690(this) && !fileProgressFlag_get(FILEPROG_F3_MET_DINGPOT)) {
gcdialog_showText(ASSET_FAD_DIALOG_UNKNOWN, 0xA, this->position, NULL, __chWarpCauldron_dingpotDialogCallback, NULL);
gcdialog_showDialog(ASSET_FAD_DIALOG_DINGPOT_MEET, 0xA, this->position, NULL, __chWarpCauldron_dingpotDialogCallback, NULL);
}
this->unk38_0 = TRUE;

View File

@@ -4,18 +4,19 @@
#include "prop.h"
#include "actor.h"
#include "core2/dustemitter.h"
extern void func_8028F918(s32);
extern void func_802D2FB0(Actor *, s32, s32, s32, f32, s32, s32, s32);
extern void func_802D3CE8(Actor *);
extern void func_802D3D54(Actor *);
extern void func_802D3D74(Actor *this);
extern void func_802D4830(Actor *, s32, f32);
extern void func_802EE6CC(f32[3], f32[3], s32[4], s32, f32, f32, s32, s32, s32);
extern void func_80324CFC(f32, enum comusic_e, s32);
extern int actor_animationIsAt(Actor *, f32);
extern void subaddie_set_state_with_direction(Actor *, s32, f32, s32);
extern void func_8033A45C(s32, s32);
extern void func_8034E0FC(void *, s32);
extern void setStruct6DsOpacity(void *, s32);
@@ -61,8 +62,8 @@ void func_8038A0A4(Actor *this);
extern ActorInfo D_80393560;
extern ActorInfo D_80393584;
extern ActorInfo D_803947B0;
extern ActorInfo D_803947D4;
extern ActorInfo JIGSAW_PICTURE_ACTOR;
extern ActorInfo JIGSAW_PICTURE_ACTOR_2;
extern ActorInfo chBrentilda;
extern ActorInfo D_80394A80;
extern ActorInfo D_80394AB0;
@@ -219,7 +220,7 @@ void chFloorCobweb_update(Actor *this)
{
func_802D3CE8(this);
if (fileProgressFlag_get(this->unkF4_8 == 1 ? FILEPROG_CB_LAIR_COBWEB_OVER_FLIGHTPAD_BROKEN : FILEPROG_CC_LAIR_COBWEB_OVER_GREEN_CAULDRON_BROKEN))
if (fileProgressFlag_get(this->actorTypeSpecificField == 1 ? FILEPROG_CB_LAIR_COBWEB_OVER_FLIGHTPAD_BROKEN : FILEPROG_CC_LAIR_COBWEB_OVER_GREEN_CAULDRON_BROKEN))
{
marker_despawn(this->marker);
return;
@@ -266,7 +267,7 @@ void lair_func_80386550(Actor *this)
{
func_802D3CE8(this);
if (fileProgressFlag_get(this->unkF4_8 == 1 ? FILEPROG_C8_LAIR_BRICKWALL_TO_WADINGBOOTS_BROKEN : FILEPROG_C9_LAIR_BRICKWALL_TO_SHOCKJUMP_PAD_BROKEN))
if (fileProgressFlag_get(this->actorTypeSpecificField == 1 ? FILEPROG_C8_LAIR_BRICKWALL_TO_WADINGBOOTS_BROKEN : FILEPROG_C9_LAIR_BRICKWALL_TO_SHOCKJUMP_PAD_BROKEN))
{
marker_despawn(this->marker);
return;
@@ -382,7 +383,7 @@ void func_803867A8(Actor *this) {
this->velocity[0] += 1.0f;
if((this->velocity[0] < 0.0f) || (this->velocity[0] > 19.0f)) {
this->velocity[0] = 0.0f;
func_8030E6A4(SFX_3F6_RUBBING, 0.5f, this->alpha_124_19*0x25 + 0x3840);
gcsfx_playWithPitch(SFX_3F6_RUBBING, 0.5f, this->alpha_124_19*0x25 + 0x3840);
}
}
}
@@ -390,7 +391,7 @@ void func_803867A8(Actor *this) {
this->velocity[0] += 1.0f;
if ((this->velocity[0] < 0.0f) || (this->velocity[0] > 19.0f)) {
this->velocity[0] = 0.0f;
FUNC_8030E8B4(SFX_3F6_RUBBING, 0.5f, 24000, this->position, 100, 2300);
sfx_playFadeShorthandDefault(SFX_3F6_RUBBING, 0.5f, 24000, this->position, 100, 2300);
}
}
@@ -399,7 +400,7 @@ void func_803867A8(Actor *this) {
this->position_y = this->unk1C[1];
sp5C[1] = sp5C[2] =0.0f;
sp5C[0] = this->unkF4_8*2;
sp5C[0] = this->actorTypeSpecificField*2;
ml_vec3f_yaw_rotate_copy(sp5C, sp5C, this->lifetime_value);
this->position[0] = this->unk1C[0] + sp5C[0];
this->position[2] = this->unk1C[2] + sp5C[2];
@@ -412,7 +413,7 @@ void func_803867A8(Actor *this) {
sp50[1] = this->unk1C[1];
sp5C[1] = sp5C[2] = 0.0f;
sp5C[0] = this->unkF4_8*2;
sp5C[0] = this->actorTypeSpecificField*2;
ml_vec3f_yaw_rotate_copy(sp5C, sp5C, phi_f0);
sp50[0] = this->unk1C[0] + sp5C[0];
sp50[2] = this->unk1C[2] + sp5C[2];
@@ -507,7 +508,7 @@ void func_80386D78(Actor *this) {
this->scale = 0.0001f;
this->lifetime_value = 26.0f;
this->position[1] = this->unk1C[1];
func_802BAFE4(0x80);
gcStaticCamera_activate(0x80);
timedFunc_set_0(3.0f, func_80386D40);
}
}
@@ -524,8 +525,8 @@ void func_803870DC(Actor *this) {
f32 sp64[3];
s32 temp_s7;
phi_v1 = fileProgressFlag_get(D_80393454[this->unkF4_8 - 1])
|| (D_80393468[this->unkF4_8 - 1] != 0 && volatileFlag_get(D_80393468[this->unkF4_8 - 1]));
phi_v1 = fileProgressFlag_get(D_80393454[this->actorTypeSpecificField - 1])
|| (D_80393468[this->actorTypeSpecificField - 1] != 0 && volatileFlag_get(D_80393468[this->actorTypeSpecificField - 1]));
if (!this->volatile_initialized) {
this->volatile_initialized = TRUE;
@@ -592,7 +593,7 @@ Actor *lair_func_80387560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx)
u32 i;
for (i = 0; i != 10; i++)
func_8033A45C(i + 1, actor->unkF4_8 + 1 == i + 2);
func_8033A45C(i + 1, actor->actorTypeSpecificField + 1 == i + 2);
return actor_drawFullDepth(marker, gfx, mtx, vtx);
}
@@ -613,7 +614,7 @@ void func_803875F0(Actor * this)
if (mapSpecificFlags_get(0))
{
this->unk1C_y = this->position_y;
func_802BAFE4(0x2A);
gcStaticCamera_activate(0x2A);
fileProgressFlag_set(FILEPROG_1E_LAIR_GRATE_TO_BGS_PUZZLE_OPEN, TRUE);
this->volatile_initialized = TRUE;
this->unk38_31 = 0x0C;
@@ -662,11 +663,11 @@ void func_80387730(Actor *this) {
this->alpha_124_19 = 0xFF;
this->unk1C[1] = 0.0f;
this->unk1C[2] = 3.5f;
if (fileProgressFlag_get(this->unkF4_8 + FILEPROG_39_CCW_OPEN)) {
if (fileProgressFlag_get(this->actorTypeSpecificField + FILEPROG_39_CCW_OPEN)) {
marker_despawn(this->marker);
return;
}
if ((this->unkF4_8 >= 2U) && (this->unkF4_8 < 8U) && volatileFlag_get(D_80393494[this->unkF4_8 - 2])) {
if ((this->actorTypeSpecificField >= 2U) && (this->actorTypeSpecificField < 8U) && volatileFlag_get(D_80393494[this->actorTypeSpecificField - 2])) {
marker_despawn(this->marker);
return;
}
@@ -681,12 +682,12 @@ void func_80387730(Actor *this) {
this->unk1C[1] = 0.0f;
this->unk1C[2] = 3.5f;
}
if (!fileProgressFlag_get(this->unkF4_8 + FILEPROG_39_CCW_OPEN) && ability_isUnlocked(ABILITY_13_1ST_NOTEDOOR)) {
if (!fileProgressFlag_get(this->actorTypeSpecificField + FILEPROG_39_CCW_OPEN) && ability_isUnlocked(ABILITY_13_1ST_NOTEDOOR)) {
player_getPosition(spAC);
if ((ml_vec3f_distance(spAC, this->position) < 500.0f) && (func_803114C4() != 0xF64)) {
if ((ml_vec3f_distance(spAC, this->position) < 500.0f) && (gcdialog_getCurrentTextId() != 0xF64)) {
func_802FACA4(0xC);
}
if (itemscore_noteScores_getTotal() >= D_8039347C[this->unkF4_8 - 1]) {
if (itemscore_noteScores_getTotal() >= D_8039347C[this->actorTypeSpecificField - 1]) {
if (this->marker->unk14_21) {
func_8032BC60(this, 5, sp90);
func_8032BC60(this, 6, sp84);
@@ -711,7 +712,7 @@ void func_80387730(Actor *this) {
this->alpha_124_19 -= 7;
}
if (this->alpha_124_19 == 0) {
fileProgressFlag_set(this->unkF4_8 + FILEPROG_39_CCW_OPEN, TRUE);
fileProgressFlag_set(this->actorTypeSpecificField + FILEPROG_39_CCW_OPEN, TRUE);
marker_despawn(this->marker);
func_8028F918(0);
func_8028F66C(BS_INTR_35);
@@ -740,8 +741,8 @@ void func_80387730(Actor *this) {
}
}
}
} else if ((this->unkF4_8 >= 2) && (ml_vec3f_distance(spAC, this->position) < 290.0f)) {
volatileFlag_setAndTriggerDialog_0(VOLATILE_FLAG_B0_NOT_ENOUGH_NOTES);
} else if ((this->actorTypeSpecificField >= 2) && (ml_vec3f_distance(spAC, this->position) < 290.0f)) {
progressDialog_setAndTriggerDialog_0(VOLATILE_FLAG_B0_NOT_ENOUGH_NOTES);
}
}
}
@@ -753,7 +754,7 @@ Actor *func_80387DA8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx)
{
// TODO: Think of a better way of doing this, similar to the SM64 one
#define NUM_NOTE_DOORS (12)
#define noteDoorIdx unkF4_8
#define noteDoorIdx actorTypeSpecificField
#define opacityTimer unk1C[1]
Actor *actor;
@@ -769,13 +770,13 @@ Actor *func_80387DA8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx)
* Sets opacity of the "note" symbol
*/
if (var2)
func_8034E0FC(var2, actor->opacityTimer);
setStruct6DsOpacity(var2, actor->opacityTimer);
/**
* Sets opacity of note door numbers
*/
if (var1)
func_8034E0FC(var1, 0xFF - (s32)actor->opacityTimer);
setStruct6DsOpacity(var1, 0xFF - (s32)actor->opacityTimer);
/**
* Hides all note door graphics that don't match this note door's index
@@ -804,9 +805,9 @@ void func_80387E94(s32 arg0)
// Grab the same pointer again for good measure :^)
actor2 = marker_getActor(marker);
actorNew->unkF4_20 = actor2->unk78_13;
actorNew->unkF4_20 = actor2->secondaryId;
actor2->unk100 = actorNew->marker;
actor2->partnerActor = actorNew->marker;
actorNew->unk1C[0] = 0;
}
@@ -815,7 +816,7 @@ void func_80387F1C(void)
{
f32 tmp[3];
func_802BAFE4(0x7B);
gcStaticCamera_activate(0x7B);
if (nodeProp_findPositionFromActorId(400, tmp))
{
@@ -839,7 +840,7 @@ void func_80387F78(Actor *this, enum file_progress_e progress_flag)
&& fileProgressFlag_get(FILEPROG_9C_LAIR_CC_WITCH_SWITCH_LEFT_EYE_PRESSED)
&& fileProgressFlag_get(FILEPROG_9D_LAIR_CC_WITCH_SWITCH_RIGHT_EYE_PRESSED))
{
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF);
coMusicPlayer_playMusic(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF);
timedFunc_set_0(0.9f, func_80387F1C);
}
}
@@ -884,9 +885,9 @@ void func_803880BC(Actor *this)
actor_collisionOn(this);
}
if (this->unk100 != NULL && !fileProgressFlag_get(FILEPROG_9D_LAIR_CC_WITCH_SWITCH_RIGHT_EYE_PRESSED))
if (this->partnerActor != NULL && !fileProgressFlag_get(FILEPROG_9D_LAIR_CC_WITCH_SWITCH_RIGHT_EYE_PRESSED))
{
Actor *actor = marker_getActor(this->unk100);
Actor *actor = marker_getActor(this->partnerActor);
actor->position_y = this->unk1C[1];
actor_collisionOn(actor);
}
@@ -902,9 +903,9 @@ void func_803880BC(Actor *this)
fileProgressFlag_set(FILEPROG_9B_LAIR_CC_WITCH_SWITCH_EYES_ACTIVE, TRUE);
}
if (this->unk100 != NULL)
if (this->partnerActor != NULL)
{
Actor *actor = marker_getActor(this->unk100);
Actor *actor = marker_getActor(this->partnerActor);
actor->position_y = this->position_y;
}
}
@@ -955,7 +956,7 @@ void func_803882B0(Actor *this)
if (this->lifetime_value == 0 && this->pitch > 42.f)
{
this->lifetime_value = 1.f;
func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF);
coMusicPlayer_playMusic(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF);
}
if (this->pitch > 90.f)
@@ -969,7 +970,7 @@ void func_803882B0(Actor *this)
void func_80388404(enum file_progress_e progress_flag, enum sfx_e sfx, f32 a2, s32 a3)
{
if (fileProgressFlag_get(progress_flag) == FALSE)
func_8030E6A4(sfx, a2, a3);
gcsfx_playWithPitch(sfx, a2, a3);
fileProgressFlag_set(progress_flag, TRUE);
}
@@ -1015,61 +1016,61 @@ void func_80388524(Actor *this) {
if (!sp34) {
switch(this->modelCacheIndex){
case ACTOR_2E5_DOOR_OF_GRUNTY://L80388630
if (!fileProgressFlag_get(FILEPROG_E2_DOOR_OF_GRUNTY_OPEN) && func_8038EAE0(0xA)) {
if (!fileProgressFlag_get(FILEPROG_E2_DOOR_OF_GRUNTY_OPEN) && jigsawPicture_isJigsawPictureComplete(0xA)) {
fileProgressFlag_set(FILEPROG_E2_DOOR_OF_GRUNTY_OPEN, TRUE);
}
break;
case ACTOR_20E_MM_ENTRANCE_DOOR: //L80388660
if (!fileProgressFlag_get(FILEPROG_31_MM_OPEN) && func_8038EAE0(1)) {
if (!fileProgressFlag_get(FILEPROG_31_MM_OPEN) && jigsawPicture_isJigsawPictureComplete(1)) {
fileProgressFlag_set(FILEPROG_31_MM_OPEN, TRUE);
}
break;
case ACTOR_226_GV_ENTRANCE: //L80388690
if (!fileProgressFlag_get(FILEPROG_36_GV_OPEN) && func_8038EAE0(6)) {
if (!fileProgressFlag_get(FILEPROG_36_GV_OPEN) && jigsawPicture_isJigsawPictureComplete(6)) {
fileProgressFlag_set(FILEPROG_36_GV_OPEN, TRUE);
}
break;
case ACTOR_212_CC_ENTRANCE_BARS: //L803886C0
if (!fileProgressFlag_get(FILEPROG_33_CC_OPEN) && func_8038EAE0(3)) {
if (!fileProgressFlag_get(FILEPROG_33_CC_OPEN) && jigsawPicture_isJigsawPictureComplete(3)) {
fileProgressFlag_set(FILEPROG_33_CC_OPEN, TRUE);
}
break;
case ACTOR_211_TCC_ENTRANCE_CHEST_LID: //L803886F0
if (!fileProgressFlag_get(FILEPROG_32_TTC_OPEN) && func_8038EAE0(2)) {
if (!fileProgressFlag_get(FILEPROG_32_TTC_OPEN) && jigsawPicture_isJigsawPictureComplete(2)) {
fileProgressFlag_set(FILEPROG_32_TTC_OPEN, TRUE);
}
break;
case ACTOR_210_BGS_ENTRANCE_DOOR: //L80388720
if (!fileProgressFlag_get(FILEPROG_34_BGS_OPEN) && func_8038EAE0(4)) {
if (!fileProgressFlag_get(FILEPROG_34_BGS_OPEN) && jigsawPicture_isJigsawPictureComplete(4)) {
fileProgressFlag_set(FILEPROG_34_BGS_OPEN, TRUE);
}
break;
case ACTOR_20F_RBB_ENTRANCE_DOOR: //L80388750
if (!fileProgressFlag_get(FILEPROG_38_RBB_OPEN) && func_8038EAE0(8)) {
if (!fileProgressFlag_get(FILEPROG_38_RBB_OPEN) && jigsawPicture_isJigsawPictureComplete(8)) {
fileProgressFlag_set(FILEPROG_38_RBB_OPEN, TRUE);
}
break;
case ACTOR_228_MMM_ENTRANCE_DOOR: //L80388780
if (!fileProgressFlag_get(FILEPROG_37_MMM_OPEN) && func_8038EAE0(7)) {
if (!fileProgressFlag_get(FILEPROG_37_MMM_OPEN) && jigsawPicture_isJigsawPictureComplete(7)) {
fileProgressFlag_set(FILEPROG_37_MMM_OPEN, TRUE);
}
break;
case ACTOR_234_CCW_ENTRANCE_DOOR: //L803887B0
if (!fileProgressFlag_get(FILEPROG_39_CCW_OPEN) && func_8038EAE0(9)) {
if (!fileProgressFlag_get(FILEPROG_39_CCW_OPEN) && jigsawPicture_isJigsawPictureComplete(9)) {
fileProgressFlag_set(FILEPROG_39_CCW_OPEN, TRUE);
}
break;
case ACTOR_235_FP_ENTANCE_DOOR: //L803887E0
if (!fileProgressFlag_get(FILEPROG_35_FP_OPEN) && func_8038EAE0(5)) {
if (!fileProgressFlag_get(FILEPROG_35_FP_OPEN) && jigsawPicture_isJigsawPictureComplete(5)) {
fileProgressFlag_set(FILEPROG_35_FP_OPEN, TRUE);
}
break;
@@ -1167,7 +1168,7 @@ void func_80388524(Actor *this) {
switch (this->state) {
case 0x19: //L80388B34
subaddie_set_state_with_direction(this, 0x1A, 0.0f, 1);
func_8025A6EC(JINGLE_END_OF_INTRO, -1);
coMusicPlayer_playMusic(JINGLE_END_OF_INTRO, -1);
break;
case 26: //L80388B54
@@ -1322,7 +1323,7 @@ void func_80388FC8(Actor *this)
{
if (this->modelCacheIndex == 0x215)
{
func_802BAFE4(0x2B);
gcStaticCamera_activate(0x2B);
if (1); // oof
}
@@ -1357,7 +1358,7 @@ void func_80388FC8(Actor *this)
if (this->modelCacheIndex == 0x215)
{
func_802D48B8(this);
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
gcsfx_play(SFX_7F_HEAVYDOOR_SLAM);
}
this->lifetime_value = 1.f;
@@ -1397,7 +1398,7 @@ void lair_func_80389204(Actor *this)
if (mapSpecificFlags_get(2))
{
func_802BAFE4(0x2C);
gcStaticCamera_activate(0x2C);
fileProgressFlag_set(FILEPROG_21_CC_LOBBY_PIPE_3_RAISED, TRUE);
this->volatile_initialized = TRUE;
@@ -1423,7 +1424,7 @@ void lair_func_80389204(Actor *this)
this->position_y = this->unk1C[1];
func_802D48B8(this);
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
gcsfx_play(SFX_7F_HEAVYDOOR_SLAM);
this->lifetime_value = 1.f;
}
@@ -1629,7 +1630,7 @@ void func_80389934(Actor *this)
subaddie_set_state_forward(this, 0x17);
actor_playAnimationOnce(this);
FUNC_8030E624(SFX_3F6_RUBBING, 0.6f, 32000);
func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF);
coMusicPlayer_playMusic(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF);
}
break;
@@ -1792,7 +1793,7 @@ Actor *func_80389E10(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
sp90[2] = sp84[2] + ((sp78[2] - sp84[2]) * randf());
func_802EE6CC(sp90, sp6C, D_80393504, 1, 0.3f, 50.0f, 180, randi2(130, 200), 0);
dustEmitter_emit(sp90, sp6C, D_80393504, 1, 0.3f, 50.0f, 180, randi2(130, 200), DUST_EMITTER_TYPE_DUST);
};
}
return this;
@@ -1885,8 +1886,8 @@ void lair_func_8038A0C4(void)
spawnableActorList_add(&D_80393584, actor_new, ACTOR_FLAG_UNKNOWN_1 | ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_5 | ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_9 | ACTOR_FLAG_UNKNOWN_10 | ACTOR_FLAG_UNKNOWN_15);
spawnableActorList_add(&D_803933E4, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_9 | ACTOR_FLAG_UNKNOWN_10 | ACTOR_FLAG_UNKNOWN_15);
spawnableActorList_add(&D_80393378, actor_new, ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_9 | ACTOR_FLAG_UNKNOWN_10 | ACTOR_FLAG_UNKNOWN_15);
spawnableActorList_add(&D_803947B0, actor_new, ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_10 | ACTOR_FLAG_UNKNOWN_12 | ACTOR_FLAG_UNKNOWN_17 | ACTOR_FLAG_UNKNOWN_19);
spawnableActorList_add(&D_803947D4, actor_new, ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_10 | ACTOR_FLAG_UNKNOWN_12 | ACTOR_FLAG_UNKNOWN_17 | ACTOR_FLAG_UNKNOWN_19);
spawnableActorList_add(&JIGSAW_PICTURE_ACTOR, actor_new, ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_10 | ACTOR_FLAG_UNKNOWN_12 | ACTOR_FLAG_UNKNOWN_17 | ACTOR_FLAG_UNKNOWN_19);
spawnableActorList_add(&JIGSAW_PICTURE_ACTOR_2, actor_new, ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_10 | ACTOR_FLAG_UNKNOWN_12 | ACTOR_FLAG_UNKNOWN_17 | ACTOR_FLAG_UNKNOWN_19);
spawnableActorList_add(&chBrentilda, actor_new, ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8);
spawnableActorList_add(&D_80394A80, actor_new, ACTOR_FLAG_NONE);
spawnableActorList_add(&D_80394AB0, actor_new, ACTOR_FLAG_UNKNOWN_2 | ACTOR_FLAG_UNKNOWN_6);

View File

@@ -525,7 +525,7 @@ void func_8038CC10(void)
func_8030DD90(D_8037DCB8->UNK_18, 0);
sfxsource_setSampleRate(D_8037DCB8->UNK_18, 32760);
sfxsource_playSfxAtVolume(D_8037DCB8->UNK_18, 0.7f);
func_8030E2C4(D_8037DCB8->UNK_18);
sfxSource_func_8030E2C4(D_8037DCB8->UNK_18);
}
void lair_func_8038CC9C(void)
@@ -533,7 +533,7 @@ void lair_func_8038CC9C(void)
if (!D_8037DCB8->UNK_18)
return;
func_8030E394(D_8037DCB8->UNK_18);
sfxSource_triggerCallbackByIndex(D_8037DCB8->UNK_18);
sfxsource_freeSfxsourceByIndex(D_8037DCB8->UNK_18);
D_8037DCB8->UNK_18 = 0;
}
@@ -548,7 +548,7 @@ void func_8038CCEC(void)
gcquiz_free();
quizQuestionAskedBitfield_free();
func_802C5994();
gameSelect_saveAndExit();
}
void lair_func_8038CD48(void)
@@ -707,7 +707,7 @@ void func_8038D0BC(s32 a0, s32 a1)
void func_8038D16C(s32 a0, u16 a1)
{
func_8025A6EC(a0, 0);
coMusicPlayer_playMusic(a0, 0);
comusic_8025AB44(a0, 28000, 500);
func_80250530(func_8025ADD4(a0), a1, 0);
}
@@ -831,7 +831,7 @@ void func_8038D4BC(void)
// trigger warp after a delay
timedFunc_set_3(0.25f,
(GenFunction_3)func_802E4078,
(GenFunction_3)transitionToMap,
D_803945B8[D_8037DCB8->unkC].map,
D_803945B8[D_8037DCB8->unkC].exit,
1
@@ -956,17 +956,17 @@ void func_8038D670(enum FF_Action next_state) {
if (((s32) D_8037DCB8->unk4->unk8 >= 7) && (quizQuestionAskedBitfield_get(func_8038D60C(D_8037DCB8->unk8)) == 0)) {
item_adjustByDiffWithHud(ITEM_27_JOKER_CARD, D_8037DCB8->unk4->unk8 - 6);
quizQuestionAskedBitfield_set(func_8038D60C(D_8037DCB8->unk8), TRUE);
volatileFlag_setAndTriggerDialog_4(VOLATILE_FLAG_A8_FF_GOT_JOKER);
progressDialog_setAndTriggerDialog_4(VOLATILE_FLAG_A8_FF_GOT_JOKER);
}
if (D_8037DCB8->unk8 != 0x1EF) {
func_8030E6A4(SFX_126_AUDIENCE_BOOING, 1.0f, 0x7FF8);
gcsfx_playWithPitch(SFX_126_AUDIENCE_BOOING, 1.0f, 0x7FF8);
if (D_8037DCB8->unk4->unk8 == FFTT_5_GRUNTY) {
volatileFlag_setAndTriggerDialog_4(VOLATILE_FLAG_A2_FF_GRUNTY_ANSWER_RIGHT);
progressDialog_setAndTriggerDialog_4(VOLATILE_FLAG_A2_FF_GRUNTY_ANSWER_RIGHT);
}
if (volatileFlag_get(VOLATILE_FLAG_A0_FF_FIRST_ANSWER_RIGHT)) {
volatileFlag_setAndTriggerDialog_4(VOLATILE_FLAG_A1_FF_NEXT_ANSWER_RIGHT);
progressDialog_setAndTriggerDialog_4(VOLATILE_FLAG_A1_FF_NEXT_ANSWER_RIGHT);
}
volatileFlag_setAndTriggerDialog_4(VOLATILE_FLAG_A0_FF_FIRST_ANSWER_RIGHT);
progressDialog_setAndTriggerDialog_4(VOLATILE_FLAG_A0_FF_FIRST_ANSWER_RIGHT);
}
} else {
if (D_8037DCB8->unk4->unk8 == FFTT_6_SKULL) {
@@ -993,9 +993,9 @@ void func_8038D670(enum FF_Action next_state) {
lair_func_8038C640(D_8037DCB8->unk8, D_8037DCB8->unk4);
}
if (volatileFlag_get(VOLATILE_FLAG_A3_FF_FIRST_ANSWER_WRONG)) {
volatileFlag_setAndTriggerDialog_4(VOLATILE_FLAG_A4_FF_NEXT_ANSWER_WRONG);
progressDialog_setAndTriggerDialog_4(VOLATILE_FLAG_A4_FF_NEXT_ANSWER_WRONG);
}
volatileFlag_setAndTriggerDialog_4(VOLATILE_FLAG_A3_FF_FIRST_ANSWER_WRONG);
progressDialog_setAndTriggerDialog_4(VOLATILE_FLAG_A3_FF_FIRST_ANSWER_WRONG);
}
break;
@@ -1157,7 +1157,7 @@ void lair_func_8038E0B0(void) {
gcquiz_func_80319EA4();
func_8038C9D0();
controller_copyFaceButtons(0, sp48);
func_8024E60C(0, sp3C);
controller_copySideButtons(0, sp3C);
if (D_8037DCB8->currFfMode < 3) {
player_getPosition(D_8037DCB8->playerPosition);
temp_v0 = func_8033F3E8(D_8037DCB8->unk0, D_8037DCB8->playerPosition, 0x191, 0x1F0);
@@ -1231,13 +1231,13 @@ void lair_func_8038E0B0(void) {
func_802FACA4(0x16);
if (sp38 != FFTT_0_NIL) {
sp28 = sp38 - 1 + FILEPROG_55_FF_BK_SQUARE_INSTRUCTIONS;
if (!fileProgressFlag_get(sp28) && gcdialog_showText(sp38 + 0x101E, 0, NULL, NULL, NULL, NULL)) {
if (!fileProgressFlag_get(sp28) && gcdialog_showDialog(sp38 + 0x101E, 0, NULL, NULL, NULL, NULL)) {
fileProgressFlag_set(sp28, TRUE);
}
if ((sp38 == FFTT_6_SKULL) && (item_getCount(ITEM_16_LIFE) == 1)) {
volatileFlag_setAndTriggerDialog_4(VOLATILE_FLAG_AB_LAST_LIFE_ON_SKULL);
progressDialog_setAndTriggerDialog_4(VOLATILE_FLAG_AB_LAST_LIFE_ON_SKULL);
} else if (item_getCount(ITEM_14_HEALTH) == 1) {
volatileFlag_setAndTriggerDialog_4(VOLATILE_FLAG_AA_FF_LOW_HEALTH);
progressDialog_setAndTriggerDialog_4(VOLATILE_FLAG_AA_FF_LOW_HEALTH);
}
if ((D_8037DCB8->unk4->unk9 == 2) && (player_movementGroup() == BSGROUP_0_NONE)) {
if (func_8028EFEC() && (sp48[FACE_BUTTON(BUTTON_A)] == 1)) {
@@ -1252,8 +1252,8 @@ void lair_func_8038E0B0(void) {
if ((item_getCount(ITEM_27_JOKER_CARD) > 0) && (sp28 < 0x5B)) {
lair_func_8038C640(D_8037DCB8->unk8, D_8037DCB8->unk4);
item_dec(ITEM_27_JOKER_CARD);
func_8030E6D4(SFX_3EA_UNKNOWN);
volatileFlag_setAndTriggerDialog_4(VOLATILE_FLAG_A9_FF_USED_JOKER);
func_8030E6D4(SFX_3EA_BANJO_GUH_HUH);
progressDialog_setAndTriggerDialog_4(VOLATILE_FLAG_A9_FF_USED_JOKER);
if (D_8037DCB8->unk8 == 0x1EF) {
func_8038D670(8);
}

View File

@@ -1,549 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028F3D8(f32[3], f32, void(*)(ActorMarker *), ActorMarker *);
extern void func_80324CFC(f32, enum comusic_e, s32);
extern void rand_seed(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 cost;
u8 size_bits;
u16 progress_flag; // enum file_progress_e
}Struct_lair_86F0_0;
void func_8038F350(Actor *this, s32 next_state);
void lair_func_8038F924(Actor *this);
/* .data */
ActorInfo D_803947B0 = { 0x1EB, 0x3B7, 0x48B, 0x1, NULL, lair_func_8038F924, actor_update_func_80326224, actor_draw, 0, 0, 0.0f, 0};
ActorInfo D_803947D4 = { 0x1EB, 0x3BC, 0x538, 0x1, NULL, lair_func_8038F924, actor_update_func_80326224, actor_draw, 0, 0, 0.0f, 0};
Struct_lair_86F0_0 D_803947F8[0xb] ={
{ 1, 0x1, FILEPROG_5D_MM_PUZZLE_PIECES_PLACED},
{ 2, 0x2, FILEPROG_5E_TCC_PUZZLE_PIECES_PLACED},
{ 5, 0x3, FILEPROG_60_CC_PUZZLE_PIECES_PLACED},
{ 7, 0x3, FILEPROG_63_BGS_PUZZLE_PIECES_PLACED},
{ 8, 0x4, FILEPROG_66_FP_PUZZLE_PIECES_PLACED},
{ 9, 0x4, FILEPROG_6A_GV_PUZZLE_PIECES_PLACED},
{10, 0x4, FILEPROG_6E_MMM_PUZZLE_PIECES_PLACED},
{12, 0x4, FILEPROG_72_RBB_PUZZLE_PIECES_PLACED},
{15, 0x4, FILEPROG_76_CCW_PUZZLE_PIECES_PLACED},
{25, 0x5, FILEPROG_7A_DOG_PUZZLE_PIECES_PLACED},
{ 4, 0x3, FILEPROG_7F_DOUBLE_HEALTH_PUZZLE_PIECES_PLACED}
};
s32 D_80394824[3] = {0xff, 0xff, 0};
ParticleScaleAndLifetimeRanges 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 fileProgressFlag_getN(D_803947F8[arg0 -1].progress_flag, D_803947F8[arg0 -1].size_bits) == D_803947F8[arg0 -1].cost;
}
s32 func_8038EB24(Actor *this){
return (this->unkF4_8 != 0 && this->unkF4_8 < 0xC) ? D_803947F8[this->unkF4_8 - 1].cost : 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);
fileProgressFlag_set(FILEPROG_B9_DOUBLE_HEALTH, TRUE);
func_80347958();
item_adjustByDiffWithHud(ITEM_14_HEALTH, 0);
gcpausemenu_80314AC8(1);
}
void func_8038EBEC(ActorMarker *marker) {
Actor *this;
u32 temp_t6;
this = marker_getActor(reinterpret_cast(ActorMarker *, marker));
if (this->unkF4_8 < 0xA) {
levelSpecificFlags_set(func_8038EB84(this), TRUE);
return;
}
if (this->unkF4_8 == 0xA) {
func_8028F918(0);
func_8028F918(2);
levelSpecificFlags_set(LEVEL_FLAG_3F_LAIR_UNKNOWN, TRUE);
return;
}
if (this->unkF4_8 == 0xB) {
timedFunc_set_0(1.5f, func_8038EB94);
gcpausemenu_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, fileProgressFlag_get(FILEPROG_17_HAS_HAD_ENOUGH_JIGSAW_PIECES) ? 4 : 3);
}
void func_8038EFD8(Actor *this) {
s32 pad3C;
f32 sp30[3];
f32 sp24[3];
this->has_met_before = 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;
rand_seed(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)
&& !fileProgressFlag_get(FILEPROG_DF_CAN_REMOVE_ALL_PUZZLE_PIECES)
) {
if (gcdialog_showText(0xF7C, 2, NULL, NULL, NULL, NULL)) {
fileProgressFlag_set(FILEPROG_DF_CAN_REMOVE_ALL_PUZZLE_PIECES, TRUE);
}
} else if ((this->unkF4_8 >= 3)
&& (local->unk4 >= 2)
&& !func_8038EB58(this)
&& !fileProgressFlag_get(FILEPROG_E0_CAN_PLACE_ALL_PUZZLE_PIECES)
){
if(gcdialog_showText(0xF7D, 2, NULL, NULL, NULL, NULL)) {
fileProgressFlag_set(FILEPROG_E0_CAN_PLACE_ALL_PUZZLE_PIECES, 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) {
gcdialog_showText(fileProgressFlag_get(FILEPROG_16_STOOD_ON_JIGSAW_PODIUM) ? 0xF5A : 0xF59, 6, sp50, this->marker, func_8038F078, NULL);
fileProgressFlag_set(FILEPROG_17_HAS_HAD_ENOUGH_JIGSAW_PIECES, 1);
} else {
gcdialog_showText(0xF58, 6, sp50, this->marker, func_8038F078, NULL);
}
fileProgressFlag_set(FILEPROG_16_STOOD_ON_JIGSAW_PODIUM, 1);
fileProgressFlag_set(FILEPROG_A7_NEAR_PUZZLE_PODIUM_TEXT, 1);
break;
case 8: //L8038F4AC
if (local->unk4 > 0) {
comusic_playTrack(SFX_REMOVE_JIGGY);
this->lifetime_value = 1.0f;
temp_s1 = func_8038F0EC(this);
func_8038F1EC(this, temp_s1, 0);
local->unk4--;
local->unk0 &= ~(1 << temp_s1);
fileProgressFlag_setN(D_803947F8[this->unkF4_8 - 1].progress_flag, local->unk4, D_803947F8[this->unkF4_8 - 1].size_bits);
item_adjustByDiffWithoutHud(ITEM_26_JIGGY_TOTAL, 1);
}
break;
case 5: //L8038F550
if (local->unk4 < func_8038EB24(this)) {
comusic_playTrack(COMUSIC_67_INSERTING_JIGGY);
this->lifetime_value = 1.0f;
local->unk4++;
temp_s1 = func_8038F0EC(this);
func_8038F1EC(this, temp_s1, 1);
local->unk0 |= (1 << temp_s1);
fileProgressFlag_setN(D_803947F8[this->unkF4_8 - 1].progress_flag, local->unk4, D_803947F8[this->unkF4_8 - 1].size_bits);
item_adjustByDiffWithoutHud(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);
}
comusic_playTrack(COMUSIC_67_INSERTING_JIGGY);
this->lifetime_value = 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);
item_adjustByDiffWithoutHud(ITEM_26_JIGGY_TOTAL, -1);
}
fileProgressFlag_setN(D_803947F8[this->unkF4_8 - 1].progress_flag, local->unk4, D_803947F8[this->unkF4_8 - 1].size_bits);
func_8038F250(this);
}
break;
case 7: //L8038F724
comusic_playTrack(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, (GenFunction_1) func_8038EBEC, (s32) this->marker);
this->lifetime_value = 3.0f;
break;
}
subaddie_set_state(this, next_state);
}
void lair_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 lair_func_8038F894(Actor *this, s32 arg1) {
if (item_getCount(ITEM_26_JIGGY_TOTAL) > 0) {
func_8038F350(this, arg1);
return;
}
comusic_playTrack(COMUSIC_2C_BUZZER);
if (fileProgressFlag_get(FILEPROG_DE_USED_ALL_YOUR_PUZZLE_PIECES) != 0) {
func_8038F350(this, 1);
return;
}
gcdialog_showText(0xFBC, 4, NULL, NULL, NULL, NULL);
fileProgressFlag_set(FILEPROG_DE_USED_ALL_YOUR_PUZZLE_PIECES, 1);
}
void lair_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->volatile_initialized) {
// temp_v0 = &D_803947F8[this->unkF4_8 - 1];
sp64 = fileProgressFlag_getN(D_803947F8[this->unkF4_8 - 1].progress_flag, D_803947F8[this->unkF4_8 - 1].size_bits);
local->unk0 = 0;
local->unk4 = 0;
local->unk8 = (func_8038ECA8(this->marker)) ? 0xff : 1;
this->has_met_before = TRUE;
for(phi_v1 = 0; phi_v1 < sp64; phi_v1 ++){
local->unk4++;
local->unk0 |= (1 << func_8038F0EC(this));
}
lair_func_8038F800(this);
marker_setCollisionScripts(this->marker, func_8038EC94, NULL, NULL);
this->marker->propPtr->unk8_3 = TRUE;
this->volatile_initialized = TRUE;
if (this->unkF4_8 == 9) {
this->unk1C[0] = 8.0f;
if (!fileProgressFlag_get(FILEPROG_53_CCW_PUZZLE_PODIUM_SWITCH_PRESSED)) {
marker_despawn(this->marker);
return;
}
if (!fileProgressFlag_get(FILEPROG_54_CCW_PUZZLE_PODIUM_ACTIVE)) {
__bundle_spawnFromFirstActor(BUNDLE_20__UNKOWN, 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) && !fileProgressFlag_get(FILEPROG_54_CCW_PUZZLE_PODIUM_ACTIVE)) {
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 = partEmitMgr_newEmitter(6);
particleEmitter_setSprite(sp54, ASSET_710_SPRITE_SPARKLE_PURPLE);
particleEmitter_setAlpha(sp54, 0xFF);
particleEmitter_setScaleAndLifetimeRanges(sp54, &D_80394830);
particleEmitter_setPosition(sp54, this->position);
sp58[2] = randf() * 255.0f;
particleEmitter_setRGB(sp54, sp58);
particleEmitter_setSpawnPositionRange(sp54, -30.0f, -40.0f, -30.0f, 30.0f, 20.0f, 30.0f);
particleEmitter_emitN(sp54, 6);
}
}
controller_copyFaceButtons(0, sp7C);
func_8024E60C(0, sp6C);
func_8038EDBC(this);
switch(this->state){
case 1://L8038FCD0
if (!this->has_met_before && (!func_8028F20C() || !func_8028FB48(0x08000000))) {
this->has_met_before = TRUE;
}
if (func_80329530(this, 300)) {
if ((this->unkF4_8 == 0xA) && !fileProgressFlag_get(FILEPROG_F6_SEEN_DOOR_OF_GRUNTY_PUZZLE_PODIUM)) {
phi_a0 = (item_getCount(ITEM_26_JIGGY_TOTAL) < D_803947F8[this->unkF4_8 - 1].cost) ? 0xFAB : 0xFC0;
if (gcdialog_showText(phi_a0, 0, NULL, NULL, NULL, NULL)) {
fileProgressFlag_set(FILEPROG_F6_SEEN_DOOR_OF_GRUNTY_PUZZLE_PODIUM, TRUE);
}
} else if (this->unkF4_8 == 1) {
func_8035644C(FILEPROG_A7_NEAR_PUZZLE_PODIUM_TEXT);
}
}
if (func_8038ECA8(this->marker) && this->has_met_before && !func_8038EB58(this) && (player_movementGroup() == BSGROUP_0_NONE || player_movementGroup() == BSGROUP_8_TROT)) {
func_8038F350(this, 2);
}
break;
case 4: //L8038FE28
if ((func_803114C4() != 0xF7C) && (func_803114C4() != 0xF7D)) {
if (sp7C[FACE_BUTTON(BUTTON_A)] == 1) {
lair_func_8038F894(this, 5);
} else if (sp7C[FACE_BUTTON(BUTTON_B)] == 1) {
func_8038F350(this, 1);
} else if ((sp6C[SIDE_BUTTON(BUTTON_Z)] == 1) && fileProgressFlag_get(FILEPROG_E0_CAN_PLACE_ALL_PUZZLE_PIECES)) {
lair_func_8038F894(this, 6);
} else if (sp7C[FACE_BUTTON(BUTTON_C_DOWN)] == 1) {
if (local->unk4) {
func_8038F350(this, 8);
} else {
comusic_playTrack(COMUSIC_2C_BUZZER);
func_8038F350(this, 1);
}
}
}
break;
case 5: //L8038FF00
case 6: //L8038FF00
case 8: //L8038FF00
if (this->lifetime_value > 0.0f) {
this->lifetime_value -= sp68;
} else {
func_8038F350(this, func_8038EB58(this) ? 7 :4);
}
break;
case 7: //L8038FF50
if (this->lifetime_value > 0.0f) {
this->lifetime_value -= sp68;
} else {
func_8038F350(this, 1);
}
break;
}
{
s32 pad;
f32 sp44[3];
s32 pad2;
this->marker->unk3E_1 = FALSE;
player_getPosition(sp44);
if (ml_distanceSquared_vec3f(sp44, this->position) < 250000.0f) {
if (!this->unk38_0) {
itemPrint_reset();
this->unk38_0 = TRUE;
}
func_802FACA4(0x2B);
}
else if (this->unk38_0) {
func_802FAD64(0x2B);
this->unk38_0 = FALSE;
}
}
}

View File

@@ -44,7 +44,7 @@ void func_803900EC(ActorMarker *marker, enum asset_e text_id, s32 arg2){
func_8028F918(0);
if (!fileProgressFlag_get(sp1C + FILEPROG_AD_CHEATO_BLUEEGGS_UNLOCKED)) {
fileProgressFlag_set(sp1C + FILEPROG_AD_CHEATO_BLUEEGGS_UNLOCKED, 1);
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
coMusicPlayer_playMusic(COMUSIC_2B_DING_B, 28000);
}
}
@@ -63,10 +63,10 @@ void func_80390174(ActorMarker *marker, s32 arg1) {
func_8028F94C(2, this->position);
if (fileProgressFlag_get(sp28 + FILEPROG_AD_CHEATO_BLUEEGGS_UNLOCKED)) {
// cheato hint texts
gcdialog_showText(sp28 + 0xF83, 0xE, this->position, this->marker, func_803900EC, lair_func_803900DC);
gcdialog_showDialog(sp28 + 0xF83, 0xE, this->position, this->marker, func_803900EC, lair_func_803900DC);
return;
}
func_80311174(func_80390084() + 0xFA5, 0xE, this->position, this->marker, func_803900EC, lair_func_803900DC, func_80390158);
gcdialog_showDialogConditional(func_80390084() + 0xFA5, 0xE, this->position, this->marker, func_803900EC, lair_func_803900DC, func_80390158);
}
void func_8039024C(Actor *this){
@@ -97,7 +97,7 @@ void func_803902B8(Actor *this) {
sp58 = ml_vec3f_within_distance(this->position, sp5C, 1750.0f) && !this->has_met_before;
if (sp58 && !this->unk38_0) {
func_8032BB88(this, 0, 0x1F4);
func_8025A6EC(COMUSIC_79_CHEATO, 0);
coMusicPlayer_playMusic(COMUSIC_79_CHEATO, 0);
comusic_8025AB44(COMUSIC_79_CHEATO, -1, 0x1F4);
}
else if (!sp58 && this->unk38_0) {

View File

@@ -36,17 +36,17 @@ void func_803905CC(ActorMarker *marker, ActorMarker *other_marker){
case 0x170:
item_setMaxCount(ITEM_D_EGGS);
fxSparkle_giantBlueEgg(&marker->propPtr->x);
func_8025A6EC(SFX_EGG_REFILL, -1);
coMusicPlayer_playMusic(SFX_EGG_REFILL, -1);
break;
case 0x171:
item_setMaxCount(ITEM_F_RED_FEATHER);
fxSparkle_giantRedFeather(&marker->propPtr->x);
func_8025A6EC(SFX_RED_FEATHER_REFILL, -1);
coMusicPlayer_playMusic(SFX_RED_FEATHER_REFILL, -1);
break;
case 0x172:
item_setMaxCount(ITEM_10_GOLD_FEATHER);
fxSparkle_giantGoldFeather(&marker->propPtr->x);
func_8025A6EC(SFX_GOLD_FEATHER_REFILL, -1);
coMusicPlayer_playMusic(SFX_GOLD_FEATHER_REFILL, -1);
break;
}
marker->collidable = FALSE;
@@ -81,8 +81,8 @@ void func_803906A0(Actor *this) {
}
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);
commonParticle_add(this->marker, phi_s0 + 5, &func_80329904);
commonParticle_new(phi_s4, 1);
}
}
}

View File

@@ -10,7 +10,7 @@ ActorInfo D_80394980 = { 0x299, 0x3C3, 0x0, 0x0, NULL, func_80390820, actor_upda
/* .code */
void func_80390820(Actor *this)
{
if (!this->unk38_0 && func_80329530(this, 200))
if (!this->unk38_0 && subaddie_playerIsWithinSphereAndActive(this, 200))
{
FUNC_8030E624(SFX_61_CARTOONY_FALL, 0.8f, 32000);
timed_playSfx(0.5f, SFX_31_BANJO_OHHWAAOOO, 1, 32000);

View File

@@ -92,10 +92,10 @@ void func_80390AE8(Actor *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);
sfx_playFadeShorthandDefault(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);
sfx_playFadeShorthandDefault(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 28000, this->position, 1250, 2500);
}
}
}

View File

@@ -182,7 +182,7 @@ void func_80391810(Actor *this, s32 next_state) {
func_803916BC(sp38, 3);
break;
case 2:
FUNC_8030E8B4(SFX_148_GRUNTY_SPELL_LANDING, 1.0f, 20000, this->position, 1500, 3000);
sfx_playFadeShorthandDefault(SFX_148_GRUNTY_SPELL_LANDING, 1.0f, 20000, this->position, 1500, 3000);
lair_func_80391254(this->position, 2, 0x4A0);
lair_func_80391254(this->position, 2, 0x6C1);
func_80391160(this->position, 4);
@@ -193,7 +193,7 @@ void func_80391810(Actor *this, s32 next_state) {
this->lifetime_value = 4.0f;
break;
case 3:
FUNC_8030E8B4(SFX_96_HOTSAND_EEL_HISS, 0.8f, 25000, this->position, 1500, 3000);
sfx_playFadeShorthandDefault(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];
@@ -264,7 +264,7 @@ void func_80391B04(Actor *this) {
}
}
if ((local->unk8 < this->position[1]) && !this->has_met_before) {
FUNC_8030E8B4(SFX_14E_SOFT_EXPLOSION, 1.0f, 20000, this->position, 1500, 3000);
sfx_playFadeShorthandDefault(SFX_14E_SOFT_EXPLOSION, 1.0f, 20000, this->position, 1500, 3000);
this->has_met_before = TRUE;
}
break;
@@ -303,7 +303,7 @@ void func_80391EA8(ActorMarker *marker, ActorMarker *a1, f32 a2[3], f32 f1, f32
actor->scale = scale;
actor->unk100 = a1;
actor->partnerActor = a1;
*(f32 *)(unk + 0x04) = f2 > 0 ? 0.5 : 0.0;
*(s32 *)(unk + 0x0C) = f2 < 0 ? 2.5 : 1.0;

View File

@@ -55,11 +55,11 @@ void func_80392690(ActorMarker *marker, enum asset_e text_id, s32 arg2){
void func_80392700(Actor *this) {
if (mapSpecificFlags_get(4)) {
if (fileProgressFlag_get(FILEPROG_F4_ENTER_FF_CUTSCENE)) {
gcdialog_showText(0x1031, 0xF, this->position, this->marker, func_80392664, func_80392610);
gcdialog_showDialog(0x1031, 0xF, this->position, this->marker, func_80392664, func_80392610);
} else {
func_802BC280();
ncStaticCamera_setToNode(0x1F);
gcdialog_showText(0x102C, 0xE, this->position, this->marker, func_80392664, func_80392610);
gcdialog_showDialog(0x102C, 0xE, this->position, this->marker, func_80392664, func_80392610);
fileProgressFlag_set(FILEPROG_F4_ENTER_FF_CUTSCENE, TRUE);
}
mapSpecificFlags_set(4, 0);
@@ -70,7 +70,7 @@ void func_80392700(Actor *this) {
ncStaticCamera_setToNode(9);
mapSpecificFlags_set(9, 1);
func_8028F94C(2, this->position);
gcdialog_showText(0x103F, 0x2A, this->position, this->marker, func_80392690, func_80392610);
gcdialog_showDialog(0x103F, 0x2A, this->position, this->marker, func_80392690, func_80392610);
mapSpecificFlags_set(6, 0);
subaddie_set_state_with_direction(this, 3, 0.0f, 1);
actor_playAnimationOnce(this);

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern void func_8028F3D8(f32[3], f32, void(*)(ActorMarker *), ActorMarker *);
extern void player_walkToPosition(f32[3], f32, void(*)(ActorMarker *), ActorMarker *);
void func_80392B6C(Actor *this);
@@ -22,7 +22,7 @@ void func_80392AF4(ActorMarker *marker, enum asset_e text_id, s32 arg2){
void func_80392B1C(ActorMarker *marker) {
func_8028E6EC(0);
gcdialog_showText(0x1040, 8, NULL, marker, func_80392AB0, func_80392AF4);
gcdialog_showDialog(0x1040, 8, NULL, marker, func_80392AB0, func_80392AF4);
}
void func_80392B6C(Actor *this) {
@@ -52,6 +52,6 @@ void func_80392B6C(Actor *this) {
ncStaticCamera_setToNode(0x10);
func_8028F918(0);
func_8028F85C(this->position);
func_8028F3D8(this->unk1C, (f32) sp28, &func_80392B1C, this->marker);
player_walkToPosition(this->unk1C, (f32) sp28, &func_80392B1C, this->marker);
}
}

647
src/lair/jigsawpicture.c Normal file
View File

@@ -0,0 +1,647 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "jigsawpicture.h"
extern void player_walkToPosition(f32[3], f32, void(*)(ActorMarker *), ActorMarker *);
extern void func_80324CFC(f32, enum comusic_e, s32);
extern void rand_seed(s32);
extern void func_8034DF30(s32, f32[3], f32[3], f32);
extern void updateStruct6DsOpacity(s32, s32, s32,f32);
typedef struct {
s32 placedPieces;
s32 placedJiggyCount;
s32 unk8;
} JigsawPictureActorData;
typedef struct {
u8 cost;
u8 sizeBits;
u16 progressFlag; // enum file_progress_e
} JigsawPictureInfo;
void jigsawPicture_setState(Actor *this, s32 next_state);
void updateJigsawPictureActor(Actor *this);
/*
* Jigsaw Podium Actors:
* actorTypeSpecificField: Basically an ID that corresponds to which picture it's for
* lifetime_value: Timeout for interacting with the picture
*/
/* .data */
// Seem to correspond to the two possible jigsaw pictures that can spawn in a map.
// IE, in the first room, the first corresponds to MM.
// In the second room, the first corresponds to CC and the second to TTC
ActorInfo JIGSAW_PICTURE_ACTOR = { 0x1EB, 0x3B7, 0x48B, 0x1, NULL, updateJigsawPictureActor, actor_update_func_80326224, actor_draw, 0, 0, 0.0f, 0};
ActorInfo JIGSAW_PICTURE_ACTOR_2 = { 0x1EB, 0x3BC, 0x538, 0x1, NULL, updateJigsawPictureActor, actor_update_func_80326224, actor_draw, 0, 0, 0.0f, 0};
JigsawPictureInfo PICTURE_INFO[0xB] ={
{ 1, 0x1, FILEPROG_5D_MM_PUZZLE_PIECES_PLACED },
{ 2, 0x2, FILEPROG_5E_TCC_PUZZLE_PIECES_PLACED },
{ 5, 0x3, FILEPROG_60_CC_PUZZLE_PIECES_PLACED },
{ 7, 0x3, FILEPROG_63_BGS_PUZZLE_PIECES_PLACED },
{ 8, 0x4, FILEPROG_66_FP_PUZZLE_PIECES_PLACED },
{ 9, 0x4, FILEPROG_6A_GV_PUZZLE_PIECES_PLACED },
{10, 0x4, FILEPROG_6E_MMM_PUZZLE_PIECES_PLACED },
{12, 0x4, FILEPROG_72_RBB_PUZZLE_PIECES_PLACED },
{15, 0x4, FILEPROG_76_CCW_PUZZLE_PIECES_PLACED },
{25, 0x5, FILEPROG_7A_DOG_PUZZLE_PIECES_PLACED },
{ 4, 0x3, FILEPROG_7F_DOUBLE_HEALTH_PUZZLE_PIECES_PLACED }
};
s32 D_80394824[3] = { 0xff, 0xff, 0 };
ParticleScaleAndLifetimeRanges D_80394830 = {
{ 0.17f, 0.24f },
{ 0.08f, 0.13f },
{ 0.0f, 0.01f },
{ 0.9f, 0.9f },
0.0f,
0.0f
};
/* .code */
bool jigsawPicture_isJigsawPictureComplete(s32 world) {
return fileProgressFlag_getN(PICTURE_INFO[world - 1].progressFlag, PICTURE_INFO[world - 1].sizeBits) == PICTURE_INFO[world - 1].cost;
}
s32 getPictureCost(Actor *this) {
// Check bounds of PICTURE_INFO
return (this->actorTypeSpecificField != 0 && this->actorTypeSpecificField < 0xC)
? PICTURE_INFO[this->actorTypeSpecificField - 1].cost : 0;
}
bool isPictureComplete(Actor *this) {
JigsawPictureActorData *local;
local = (JigsawPictureActorData*)&this->local;
return getPictureCost(this) == local->placedJiggyCount;
}
s32 getLevelSpecificOpenFlag(Actor *this) {
return this->actorTypeSpecificField + 0x1B; // MM starts at 1C
}
void activateDoubleHealth(void) {
func_802FAFD4(ITEM_14_HEALTH, SFX_417_DOUBLE_HEALTH_UPGRADE);
func_802FAFC0(ITEM_14_HEALTH, COMUSIC_2B_DING_B);
fileProgressFlag_set(FILEPROG_B9_DOUBLE_HEALTH, TRUE);
func_80347958();
item_adjustByDiffWithHud(ITEM_14_HEALTH, 0);
gcpausemenu_80314AC8(1);
}
void afterPictureComplete(ActorMarker *marker) {
Actor *this;
this = marker_getActor(reinterpret_cast(ActorMarker *, marker));
// Normal world pictures
if (this->actorTypeSpecificField < 0xA) {
levelSpecificFlags_set(getLevelSpecificOpenFlag(this), TRUE);
return;
}
// Final Grunty door
if (this->actorTypeSpecificField == 0xA) {
func_8028F918(0);
func_8028F918(2);
levelSpecificFlags_set(LEVEL_FLAG_3F_LAIR_GRUNTY_DOOR_OPEN, TRUE);
return;
}
// Double health picture
if (this->actorTypeSpecificField == 0xB) {
timedFunc_set_0(1.5f, activateDoubleHealth);
gcpausemenu_80314AC8(0);
}
}
void onJigsawPodiumCollide(ActorMarker *marker, ActorMarker *_) {
marker->isBanjoOnTop = TRUE;
}
bool isBanjoOnPodium(ActorMarker *marker) {
return func_8028F20C() && func_8028FB48(0x08000000) && marker->isBanjoOnTop;
}
s32 isPicturePiecePlaced(Actor *this, s32 position) {
JigsawPictureActorData *local;
local = (JigsawPictureActorData*)&this->local;
return local->placedPieces & (1 << position);
}
s32 jiggyPositionToID(Actor *this, s32 position) {
s32 start;
switch (this->actorTypeSpecificField) {
case 7: // MMM
start = (position == 2) ? 0x1a4 : 0x190;
break;
case 3: // CC
start = 0x192;
break;
case 8: // RBB
start = 0x19A;
break;
case 11: // Double health
start = 0x1AE;
break;
default:
start = 0x190;
break;
}
return start + position;
}
s32 getUnknownJigsawPictureIndex(Actor *this) {
switch (this->actorTypeSpecificField) {
case 3: // CC
case 8: // RBB
case 0xB: // Double health
return 0x1F;
}
return 0x1E;
}
void func_8038EDBC(Actor *this) {
s32 sp44;
s32 sp40;
JigsawPictureActorData *local;
s32 sp38;
f32 sp34;
f32 sp28[3];
local = (JigsawPictureActorData*)&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 (isBanjoOnPodium(this->marker) && local->unk8 < 0xFF) {
local->unk8 = (local->unk8 + 8 < 0xFF) ? local->unk8 + 8 : 0xFF;
} else if (!isBanjoOnPodium(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); // Probably a debug assert
}
}
void stoodOnPodiumCallback(ActorMarker *marker) {
f32 camera_position[3];
Actor *this;
this = marker_getActor(marker);
func_8034A174(func_803097A0(), getUnknownJigsawPictureIndex(this), camera_position);
// Put Banjo into the idle animation
func_8028E6EC(2);
func_8028F918(0);
func_8028F94C(4, camera_position);
jigsawPicture_setState(this,
fileProgressFlag_get(FILEPROG_17_HAS_HAD_ENOUGH_JIGSAW_PIECES) ? JIGSAW_PICTURE_WAITING : JIGSAW_PICTURE_INSTRUCTIONS);
}
void walkToPodium(Actor *this) {
s32 unused; // Can't remove ;.;
f32 player_position[3];
f32 target_position[3];
this->has_met_before = FALSE;
player_getPosition(player_position);
target_position[0] = this->position[0];
target_position[1] = this->position[1];
target_position[2] = this->position[2];
target_position[1] += 50.0f;
player_walkToPosition(target_position, ml_vec3f_distance(player_position, target_position) / 150.0, stoodOnPodiumCallback, this->marker);
}
void bottlesInstructionsCallback(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
Actor *this;
this = marker_getActor(marker);
// If this is the first picture, and the player has no jiggies, then force them to leave the podium
jigsawPicture_setState(this, (text_id == ASSET_F58_DIALOG_FIRST_PICTURE_INSTRUCTION) ? JIGSAW_PICTURE_LEAVE_PODIUM : JIGSAW_PICTURE_WAITING);
}
void gruntyLaughCallback(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
func_8030E6D4(SFX_EA_GRUNTY_LAUGH_1);
}
// Deterministic-randomly returns the next piece that should be added or removed.
// 0 is the upper left continuing to 3 in the upper right, then wrapping around on the next row on the left side
s32 getPicturePiecePosition(Actor *this) {
JigsawPictureActorData *local;
s32 previous;
s32 position;
s32 i;
previous = 0;
local = (JigsawPictureActorData*)&this->local;
// The places that pieces are placed is random, but it's deterministic based on the picture
rand_seed(this->actorTypeSpecificField);
// Final Grunty door or double health
if (this->actorTypeSpecificField >= 0xA) {
for (i = 0; i < local->placedJiggyCount; i++) {
position = i;
previous |= (1 << position);
}
} else {
for (i = 0; i < local->placedJiggyCount; i++) {
do {
position = randi2(0, getPictureCost(this));
} while ((1 << position) & previous);
previous |= 1 << position; // Funny bitmath to ensure that the value is not the same as a preceding
}
}
return position;
}
void addOrRemovePieceFromDisplay(Actor *this, s32 position, bool isAdd) {
s32 piece = func_8034C528(jiggyPositionToID(this, position));
if (piece != 0) {
updateStruct6DsOpacity(piece, isAdd ? 0 : 0xFF, isAdd ? 0xFF : 0, 1.0f);
}
}
void unlockAdditionalActions(Actor *this) {
JigsawPictureActorData *local;
local = (JigsawPictureActorData*)&this->local;
if ((this->actorTypeSpecificField >= 2) // Trigger at TTC
&& (local->placedJiggyCount > 0)
&& !isPictureComplete(this)
&& !fileProgressFlag_get(FILEPROG_DF_CAN_REMOVE_ALL_PUZZLE_PIECES)) {
if (gcdialog_showDialog(ASSET_F7C_DIALOG_BOTTLES_REMOVE_PIECE_INSTRUCTIONS, 2, NULL, NULL, NULL, NULL)) {
fileProgressFlag_set(FILEPROG_DF_CAN_REMOVE_ALL_PUZZLE_PIECES, TRUE);
}
} else if ((this->actorTypeSpecificField >= 3) // Trigger at CC
&& (local->placedJiggyCount >= 2) // Trigger after the player put 2 jiggies in the picture
&& !isPictureComplete(this)
&& !fileProgressFlag_get(FILEPROG_E0_CAN_PLACE_ALL_PUZZLE_PIECES)) {
if (gcdialog_showDialog(ASSET_F7D_DIALOG_BOTTLES_EXPLAINS_PLACE_ALL, 2, NULL, NULL, NULL, NULL)) {
fileProgressFlag_set(FILEPROG_E0_CAN_PLACE_ALL_PUZZLE_PIECES, TRUE);
}
}
}
void jigsawPicture_setState(Actor *this, s32 nextState) {
JigsawPictureActorData *local;
f32 position[3];
s32 jiggy_add_count;
s32 piece_position;
s32 i;
local = (JigsawPictureActorData*)&this->local;
func_8034A174(func_803097A0(), getUnknownJigsawPictureIndex(this), position);
switch (nextState) {
case JIGSAW_PICTURE_LEAVE_PODIUM:
func_8028F918(0);
break;
case JIGSAW_PICTURE_ENTER_PODIUM:
walkToPodium(this);
sfx_playFadeShorthandDefault(SFX_112_TINKER_ATTENTION, 1.0f, 32000, this->position, 500, 1000);
break;
case JIGSAW_PICTURE_INSTRUCTIONS:
func_803115C4(0xF7B);
func_803115C4(0xF80);
func_803115C4(0xF7F);
if (item_getCount(ITEM_26_JIGGY_TOTAL) > 0) {
gcdialog_showDialog(
fileProgressFlag_get(FILEPROG_16_STOOD_ON_JIGSAW_PODIUM)
? ASSET_F5A_DIALOG_FIRST_PICTURE_FIRST_PIECE_OBTAINED_AFTER
: ASSET_F59_DIALOG_FIRST_PICTURE_FIRST_PIECE_ALREADY_OBTAINED,
6,
position,
this->marker,
bottlesInstructionsCallback,
NULL);
fileProgressFlag_set(FILEPROG_17_HAS_HAD_ENOUGH_JIGSAW_PIECES, 1);
} else {
gcdialog_showDialog(ASSET_F58_DIALOG_FIRST_PICTURE_INSTRUCTION, 6, position, this->marker, bottlesInstructionsCallback, NULL);
}
fileProgressFlag_set(FILEPROG_16_STOOD_ON_JIGSAW_PODIUM, 1);
fileProgressFlag_set(FILEPROG_A7_NEAR_PUZZLE_PODIUM_TEXT, 1);
break;
case JIGSAW_PICTURE_REMOVE_PIECE:
if (local->placedJiggyCount > 0) {
comusic_playTrack(SFX_REMOVE_JIGGY);
this->lifetime_value = 1.0f;
piece_position = getPicturePiecePosition(this);
addOrRemovePieceFromDisplay(this, piece_position, 0);
local->placedJiggyCount--;
local->placedPieces &= ~(1 << piece_position);
fileProgressFlag_setN(PICTURE_INFO[this->actorTypeSpecificField - 1].progressFlag, local->placedJiggyCount, PICTURE_INFO[this->actorTypeSpecificField - 1].sizeBits);
item_adjustByDiffWithoutHud(ITEM_26_JIGGY_TOTAL, 1);
}
break;
case JIGSAW_PICTURE_ADD_PIECE:
if (local->placedJiggyCount < getPictureCost(this)) {
comusic_playTrack(COMUSIC_67_INSERTING_JIGGY);
this->lifetime_value = 1.0f;
local->placedJiggyCount++;
piece_position = getPicturePiecePosition(this);
addOrRemovePieceFromDisplay(this, piece_position, 1);
local->placedPieces |= (1 << piece_position);
fileProgressFlag_setN(PICTURE_INFO[this->actorTypeSpecificField - 1].progressFlag, local->placedJiggyCount, PICTURE_INFO[this->actorTypeSpecificField - 1].sizeBits);
item_adjustByDiffWithoutHud(ITEM_26_JIGGY_TOTAL, -1);
unlockAdditionalActions(this);
}
break;
case JIGSAW_PICTURE_ADD_ALL:
if (local->placedJiggyCount < getPictureCost(this)) {
// Does the player have enough jiggies to add all? Get the amount left or how many they have
if (item_getCount(ITEM_26_JIGGY_TOTAL) > getPictureCost(this) - local->placedJiggyCount) {
jiggy_add_count = getPictureCost(this) - local->placedJiggyCount;
} else {
jiggy_add_count = item_getCount(ITEM_26_JIGGY_TOTAL);
}
comusic_playTrack(COMUSIC_67_INSERTING_JIGGY);
this->lifetime_value = 1.0f;
for (i = 0; i < jiggy_add_count; i++) {
local->placedJiggyCount++;
piece_position = getPicturePiecePosition(this);
addOrRemovePieceFromDisplay(this, piece_position, 1);
local->placedPieces |= (1 << piece_position);
item_adjustByDiffWithoutHud(ITEM_26_JIGGY_TOTAL, -1);
}
fileProgressFlag_setN(PICTURE_INFO[this->actorTypeSpecificField - 1].progressFlag, local->placedJiggyCount, PICTURE_INFO[this->actorTypeSpecificField - 1].sizeBits);
unlockAdditionalActions(this);
}
break;
case JIGSAW_PICTURE_COMPLETE:
comusic_playTrack(COMUSIC_65_WORLD_OPENING_B);
// If MM or the last Grunty door, make her cackle
if (this->actorTypeSpecificField == 1) {
func_80324DBC(1.0f, 0xF7E, 4, NULL, this->marker, gruntyLaughCallback, NULL);
} else if (this->actorTypeSpecificField == 0xA) {
func_80324DBC(1.0f, 0xFAC, 4, NULL, this->marker, gruntyLaughCallback, NULL);
}
timedFunc_set_1(2.0f, (GenFunction_1) afterPictureComplete, (s32) this->marker);
this->lifetime_value = 3.0f;
break;
}
subaddie_set_state(this, nextState);
}
void setInitialJigsawPictureOpacity(Actor *this) {
s32 piece;
s32 i;
for (i = 0; i < getPictureCost(this); i++) {
piece = func_8034C528(jiggyPositionToID(this, i));
if (piece != 0) {
setStruct6DsOpacity(piece, isPicturePiecePlaced(this, i) ? 0xff : 0);
}
}
}
void addPieces(Actor *this, s32 nextState) {
// Does the player have any jiggies?
if (item_getCount(ITEM_26_JIGGY_TOTAL) > 0) {
// Transition to an add state
jigsawPicture_setState(this, nextState);
return;
}
comusic_playTrack(COMUSIC_2C_BUZZER);
if (fileProgressFlag_get(FILEPROG_DE_USED_ALL_YOUR_PUZZLE_PIECES) != 0) {
jigsawPicture_setState(this, JIGSAW_PICTURE_LEAVE_PODIUM);
return;
}
// Bottles tells the player they need more jiggies, then sets flag; on future attempts it'll kick the player out
gcdialog_showDialog(ASSET_FBC_DIALOG_BOTTLES_OUT_OF_JIGGIES, 4, NULL, NULL, NULL, NULL);
fileProgressFlag_set(FILEPROG_DE_USED_ALL_YOUR_PUZZLE_PIECES, TRUE);
}
void updateJigsawPictureActor(Actor *this) {
JigsawPictureActorData *local;
s32 face_buttons[6];
s32 i;
s32 text_id;
s32 side_buttons[2];
f32 delta_time;
s32 jiggiesPlaced;
local = (JigsawPictureActorData*)&this->local;
delta_time = time_getDelta();
if (!this->initialized) {
this->initialized = TRUE;
}
if (!this->volatile_initialized) {
jiggiesPlaced = fileProgressFlag_getN(PICTURE_INFO[this->actorTypeSpecificField - 1].progressFlag, PICTURE_INFO[this->actorTypeSpecificField - 1].sizeBits);
local->placedPieces = 0;
local->placedJiggyCount = 0;
local->unk8 = (isBanjoOnPodium(this->marker)) ? 0xFF : 1;
this->has_met_before = TRUE;
// Initialize which jiggies have been placed
for (i = 0; i < jiggiesPlaced; i ++) {
local->placedJiggyCount++;
local->placedPieces |= (1 << getPicturePiecePosition(this));
}
setInitialJigsawPictureOpacity(this);
marker_setCollisionScripts(this->marker, onJigsawPodiumCollide, NULL, NULL);
this->marker->propPtr->unk8_3 = TRUE;
this->volatile_initialized = TRUE;
// Click Clock Wood specific
if (this->actorTypeSpecificField == 9) {
this->unk1C[0] = 8.0f;
// If the switch hasn't been pressed, then get rid of the podium
if (!fileProgressFlag_get(FILEPROG_53_CCW_PUZZLE_PODIUM_SWITCH_PRESSED)) {
marker_despawn(this->marker);
return;
}
// Boring CCW podium activation
if (!fileProgressFlag_get(FILEPROG_54_CCW_PUZZLE_PODIUM_ACTIVE)) {
__bundle_spawnFromFirstActor(BUNDLE_20__UNKNOWN, 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);
}
}
}
// CCW podium activation, when it's not specifically active from the sandcastle cheat
if ((this->actorTypeSpecificField == 9) && !fileProgressFlag_get(FILEPROG_54_CCW_PUZZLE_PODIUM_ACTIVE)) {
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 = partEmitMgr_newEmitter(6);
particleEmitter_setSprite(sp54, ASSET_710_SPRITE_SPARKLE_PURPLE);
particleEmitter_setAlpha(sp54, 0xFF);
particleEmitter_setScaleAndLifetimeRanges(sp54, &D_80394830);
particleEmitter_setPosition(sp54, this->position);
sp58[2] = randf() * 255.0f;
particleEmitter_setRGB(sp54, sp58);
particleEmitter_setSpawnPositionRange(sp54, -30.0f, -40.0f, -30.0f, 30.0f, 20.0f, 30.0f);
particleEmitter_emitN(sp54, 6);
}
}
controller_copyFaceButtons(0, face_buttons);
controller_copySideButtons(0, side_buttons);
func_8038EDBC(this);
switch (this->state) {
case JIGSAW_PICTURE_LEAVE_PODIUM:
if (!this->has_met_before && (!func_8028F20C() || !func_8028FB48(0x08000000))) {
this->has_met_before = TRUE;
}
if (subaddie_playerIsWithinSphereAndActive(this, 300)) {
if ((this->actorTypeSpecificField == 0xA) && !fileProgressFlag_get(FILEPROG_F6_SEEN_DOOR_OF_GRUNTY_PUZZLE_PODIUM)) {
text_id = (item_getCount(ITEM_26_JIGGY_TOTAL) < PICTURE_INFO[this->actorTypeSpecificField - 1].cost)
? ASSET_FAB_DIALOG_GRUNTY_DOOR_NEED_JIGGIES : ASSET_FC0_DIALOG_GRUNTY_DOOR_HAVE_JIGGIES;
if (gcdialog_showDialog(text_id, 0, NULL, NULL, NULL, NULL)) {
fileProgressFlag_set(FILEPROG_F6_SEEN_DOOR_OF_GRUNTY_PUZZLE_PODIUM, TRUE);
}
} else if (this->actorTypeSpecificField == 1) { // MM
progressDialog_showDialogMaskZero(FILEPROG_A7_NEAR_PUZZLE_PODIUM_TEXT);
}
}
if (isBanjoOnPodium(this->marker) && this->has_met_before && !isPictureComplete(this) && (player_movementGroup() == BSGROUP_0_NONE || player_movementGroup() == BSGROUP_8_TROT)) {
jigsawPicture_setState(this, JIGSAW_PICTURE_ENTER_PODIUM);
}
break;
case JIGSAW_PICTURE_WAITING:
if ((gcdialog_getCurrentTextId() != ASSET_F7C_DIALOG_BOTTLES_REMOVE_PIECE_INSTRUCTIONS)
&& (gcdialog_getCurrentTextId() != ASSET_F7D_DIALOG_BOTTLES_EXPLAINS_PLACE_ALL)) {
// Add piece
if (face_buttons[FACE_BUTTON(BUTTON_A)] == TRUE) {
addPieces(this, JIGSAW_PICTURE_ADD_PIECE);
// Leave Podium
} else if (face_buttons[FACE_BUTTON(BUTTON_B)] == TRUE) {
jigsawPicture_setState(this, JIGSAW_PICTURE_LEAVE_PODIUM);
// Add all pieces
} else if ((side_buttons[SIDE_BUTTON(BUTTON_Z)] == TRUE) && fileProgressFlag_get(FILEPROG_E0_CAN_PLACE_ALL_PUZZLE_PIECES)) {
addPieces(this, JIGSAW_PICTURE_ADD_ALL);
// Remove piece
} else if (face_buttons[FACE_BUTTON(BUTTON_C_DOWN)] == TRUE) {
if (local->placedJiggyCount) {
jigsawPicture_setState(this, JIGSAW_PICTURE_REMOVE_PIECE);
} else { // No pieces to remove in picture, exit
comusic_playTrack(COMUSIC_2C_BUZZER);
jigsawPicture_setState(this, JIGSAW_PICTURE_LEAVE_PODIUM);
}
}
}
break;
case JIGSAW_PICTURE_ADD_PIECE:
case JIGSAW_PICTURE_ADD_ALL:
case JIGSAW_PICTURE_REMOVE_PIECE:
if (this->lifetime_value > 0.0f) { // Wait for timeout
this->lifetime_value -= delta_time;
} else {
jigsawPicture_setState(this, isPictureComplete(this) ? JIGSAW_PICTURE_COMPLETE : JIGSAW_PICTURE_WAITING);
}
break;
case JIGSAW_PICTURE_COMPLETE:
if (this->lifetime_value > 0.0f) { // Wait for timeout
this->lifetime_value -= delta_time;
} else {
jigsawPicture_setState(this, JIGSAW_PICTURE_LEAVE_PODIUM);
}
break;
}
{
s32 pad;
f32 sp44[3];
s32 pad2;
this->marker->isBanjoOnTop = FALSE;
player_getPosition(sp44);
if (ml_distanceSquared_vec3f(sp44, this->position) < 250000.0f) {
if (!this->unk38_0) {
itemPrint_reset();
this->unk38_0 = TRUE;
}
func_802FACA4(0x2B);
} else if (this->unk38_0) {
func_802FAD64(0x2B);
this->unk38_0 = FALSE;
}
}
}

10
src/lair/jigsawpicture.h Normal file
View File

@@ -0,0 +1,10 @@
typedef enum {
JIGSAW_PICTURE_LEAVE_PODIUM = 1,
JIGSAW_PICTURE_ENTER_PODIUM = 2,
JIGSAW_PICTURE_INSTRUCTIONS = 3,
JIGSAW_PICTURE_WAITING = 4,
JIGSAW_PICTURE_ADD_PIECE = 5,
JIGSAW_PICTURE_ADD_ALL = 6,
JIGSAW_PICTURE_COMPLETE = 7,
JIGSAW_PICTURE_REMOVE_PIECE = 8
} JigsawPictureState;