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

@@ -90,7 +90,7 @@ static void __chBlubber_showJiggySpawnedText(ActorMarker *marker){
if(!mapSpecificFlags_get(TTC_SPECIFIC_FLAG_2_BLUBBER_JIGGY_SPAWNED_TEXT_SHOWN)) {
text_id = jiggyscore_isCollected(JIGGY_14_TTC_BLUBBER) ? ASSET_A2A_BLUBBER_COMPLETE_JIGGY_COLLECTED : ASSET_A0D_DIALOG_BLUBBER_COMPLETE;
gcdialog_showText(text_id, 0xf, this->position, this->marker, __chBlubber_showTextCallback, __chBlubber_showTextCallback2);
gcdialog_showDialog(text_id, 0xf, this->position, this->marker, __chBlubber_showTextCallback, __chBlubber_showTextCallback2);
mapSpecificFlags_set(TTC_SPECIFIC_FLAG_2_BLUBBER_JIGGY_SPAWNED_TEXT_SHOWN, TRUE);
}
}
@@ -120,7 +120,7 @@ static void __func_80387774(Actor **this_ptr){
ActorLocal_Blubber *local = (ActorLocal_Blubber *)&(*this_ptr)->local;
player_setCarryObjectPoseInCylinder(local->throw_target_position, local->throw_target_radius, 100.0f, ACTOR_2A_GOLD_BULLION, this_ptr);
if( func_80329530(*this_ptr, 200)
if( subaddie_playerIsWithinSphereAndActive(*this_ptr, 200)
&& bacarry_get_markerId() == MARKER_37_GOLD_BULLION
&& player_throwCarriedObject()
) {
@@ -143,7 +143,7 @@ static void __chBlubber_updateFunc(Actor *this){
this->marker->propPtr->unk8_3 = TRUE;
func_8028E668(this->position, 90.0f, -10.0f, 110.0f);
if(!mapSpecificFlags_get(TTC_SPECIFIC_FLAG_1_UNKNOWN) && !func_80329530(this, 2500))
if(!mapSpecificFlags_get(TTC_SPECIFIC_FLAG_1_UNKNOWN) && !subaddie_playerIsWithinSphereAndActive(this, 2500))
return;
if(!this->volatile_initialized){
@@ -153,11 +153,11 @@ static void __chBlubber_updateFunc(Actor *this){
this->volatile_initialized = TRUE;
}//L80387970
if(func_80329530(this, 250) && !func_80329530(this, 80)
if(subaddie_playerIsWithinSphereAndActive(this, 250) && !subaddie_playerIsWithinSphereAndActive(this, 80)
&& !this->has_met_before
&& item_getCount(ITEM_18_GOLD_BULLIONS) == 0
){
gcdialog_showText(ASSET_A0B_DIALOG_BLUBBER_FIRST_MEET, 0xe, this->position, this->marker, __chBlubber_showTextCallback, NULL);
gcdialog_showDialog(ASSET_A0B_DIALOG_BLUBBER_FIRST_MEET, 0xe, this->position, this->marker, __chBlubber_showTextCallback, NULL);
this->has_met_before = TRUE;
subaddie_set_state_forward(this, CH_BLUBBER_STATE_3_UNKNOWN);
}
@@ -166,7 +166,7 @@ static void __chBlubber_updateFunc(Actor *this){
&& !this->unk138_23
){
if (item_getCount(ITEM_18_GOLD_BULLIONS) == 0) {
gcdialog_showText(ASSET_A0C_DIALOG_BLUBBER_HALF_GOLD, 4, NULL, NULL, NULL, NULL);
gcdialog_showDialog(ASSET_A0C_DIALOG_BLUBBER_HALF_GOLD, 4, NULL, NULL, NULL, NULL);
}
this->unk138_23 = TRUE;
@@ -200,15 +200,15 @@ static void __chBlubber_updateFunc(Actor *this){
}
if(actor_animationIsAt(this, 0.3f)){
FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.95f, 17000, this->position, 1250, 2500);
sfx_playFadeShorthandDefault(SFX_83_BLUBBER_CRYING, 0.95f, 17000, this->position, 1250, 2500);
}
if(actor_animationIsAt(this, 0.53f)){
FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.93f, 17000, this->position, 1250, 2500);
sfx_playFadeShorthandDefault(SFX_83_BLUBBER_CRYING, 0.93f, 17000, this->position, 1250, 2500);
}
if(actor_animationIsAt(this, 0.72f)){
FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.91f, 17000, this->position, 1250, 2500);
sfx_playFadeShorthandDefault(SFX_83_BLUBBER_CRYING, 0.91f, 17000, this->position, 1250, 2500);
}
__chBlubber_checkJiggySpawnedTextAndAdvanceState(this);
@@ -227,12 +227,12 @@ static void __chBlubber_updateFunc(Actor *this){
}
}
if(actor_animationIsAt(this, 0.3f) && !func_803114B0()){
if(actor_animationIsAt(this, 0.3f) && !gcdialog_hasCurrentTextId()){
FUNC_8030E624(SFX_8C_BOGGY_WAHEY, 1.0f, 27000);
}
if(actor_animationIsAt(this, 0.28f) ||
(actor_animationIsAt(this, 0.78f) && !func_803114B0())
(actor_animationIsAt(this, 0.78f) && !gcdialog_hasCurrentTextId())
){
FUNC_8030E624(SFX_80_YUMYUM_CLACK, 0.9f, 13000);
}

View File

@@ -24,7 +24,7 @@ ActorInfo gChClam = {
/* .code */
static void __chClam_playSfx(enum sfx_e sfx_id, f32 volume, s32 sampleRate, f32 position[3], f32 minFadeDistance, f32 maxFadeDistance){
if(func_803114B0()){
if(gcdialog_hasCurrentTextId()){
sampleRate -= 10000;
if(sampleRate < 0)
sampleRate = 0;
@@ -69,7 +69,7 @@ static bool __chClam_updateFuncTarget(Actor *this, f32 arg1) {
TUPLE_COPY(target_position, red_feather->position)
phi_f2 = egg_dist;
}
else if ((func_80329530(this, 1200) != 0) && (func_803292E0(this) != 0)) {
else if ((subaddie_playerIsWithinSphereAndActive(this, 1200) != 0) && (func_803292E0(this) != 0)) {
phi_f2 = gu_sqrtf((f32) func_8032970C(this));
player_getPosition(target_position);
sp38 = 1;
@@ -135,7 +135,7 @@ static void __chClam_particalEmitterInit(ParticleEmitter *pCtrl, f32 position[3]
particleEmitter_setPosition(pCtrl, position);
particleEmitter_func_802EF9F8(pCtrl, 0.7f);
particleEmitter_func_802EFA18(pCtrl, 3);
func_802EFA20(pCtrl, 0.8f, 1.0f);
particleEmitter_func_802EFA20(pCtrl, 0.8f, 1.0f);
particleEmitter_setSfx(pCtrl, SFX_1F_HITTING_AN_ENEMY_3, 10000);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
particleEmitter_setParticleLifeTimeRange(pCtrl, 3.5f, 3.5f);
@@ -242,9 +242,9 @@ static void __chClam_playerDropsItem(enum bundle_e bundle_id, enum item_e item_i
static void __chClam_attackOther(ActorMarker *this_marker, ActorMarker *other_marker){
if(func_80297C6C() == 3) return;
if(bsiFrame_getState() == 3) return;
if( !mapSpecificFlags_get(TTC_SPECIFIC_FLAG_5_CLAM_FIRST_MEET_TEXT_SHOWN) && gcdialog_showText(ASSET_A14_DIALOG_CLAM_TAUNT, 0, NULL, NULL, NULL, NULL)){
if( !mapSpecificFlags_get(TTC_SPECIFIC_FLAG_5_CLAM_FIRST_MEET_TEXT_SHOWN) && gcdialog_showDialog(ASSET_A14_DIALOG_CLAM_TAUNT, 0, NULL, NULL, NULL, NULL)){
mapSpecificFlags_set(TTC_SPECIFIC_FLAG_5_CLAM_FIRST_MEET_TEXT_SHOWN, TRUE);
}

View File

@@ -58,14 +58,14 @@ static void __chLeaky_updateFunc(Actor *this) {
if( this->state == 1
&& !this->has_met_before
&& func_80329530(this, 250) && !func_80329530(this, 160)
&& subaddie_playerIsWithinSphereAndActive(this, 250) && !subaddie_playerIsWithinSphereAndActive(this, 160)
&& !player_movementGroup()
&& gcdialog_showText(ASSET_A1A_DIALOG_LEAKY_FIRST_MEET, 0, NULL, NULL, NULL, NULL)
&& gcdialog_showDialog(ASSET_A1A_DIALOG_LEAKY_FIRST_MEET, 0, NULL, NULL, NULL, NULL)
){
this->has_met_before = TRUE;
}
if (func_803114B0() == 0) {
if (gcdialog_hasCurrentTextId() == 0) {
if (actor_animationIsAt(this, 0.83f)) {
func_8030E878(SFX_109_LOGGO_LID_CLAP, randf2(0.775f, 0.825f), 22000, this->position, 400.0f, 1000.0f);
return;
@@ -98,7 +98,7 @@ static void __chLeaky_showDoneText(ActorMarker *caller, enum asset_e text_id, s3
timedFunc_set_0(1.0f, __func_80388F88);
func_80324E38(2.5f, 0);
timedFunc_set_1(2.5f, func_8028F9DC, 2);
timedFunc_set_3(2.5f, (GenFunction_3)func_802E4078, MAP_A_TTC_SANDCASTLE, 0, 0);
timedFunc_set_3(2.5f, (GenFunction_3)transitionToMap, MAP_A_TTC_SANDCASTLE, 0, 0);
func_803228D8();
}
@@ -118,6 +118,6 @@ bool chLeaky_eggCollision(ActorMarker *marker){
levelSpecificFlags_set(2, TRUE);
levelSpecificFlags_set(5, TRUE);
gcdialog_showText(ASSET_A28_DIALOG_LEAKY_DONE, 0x2a, this->position, this->marker, __chLeaky_showDoneText, NULL);
gcdialog_showDialog(ASSET_A28_DIALOG_LEAKY_DONE, 0x2a, this->position, this->marker, __chLeaky_showDoneText, NULL);
return TRUE;
}

View File

@@ -2,158 +2,150 @@
#include "functions.h"
#include "variables.h"
extern void func_802EE6CC(f32[3], s32[4], s32[4], s32, f32, f32, s32, s32, s32);
#include "core2/dustemitter.h"
typedef struct {
s32 closed_ticks_counter;
s32 open_ticks_counter;
} ActorLocal_Lockup;
#include "lockup.h"
static Actor *__chLockup_drawFunc(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx);
static void __chLockup_updateFunc(Actor *this);
enum ch_lockup_states_e {
CH_LOCKUP_STATE_CLOSED = 1, // L803896F0
CH_LOCKUP_STATE_OPENING = 2, // L803897DC
CH_LOCKUP_STATE_OPEN = 3, // L80389864
CH_LOCKUP_STATE_CLOSING = 4, // L803898F4
CH_LOCKUP_STATE_CLOSING2 = 5 // L803898F4
ActorAnimationInfo chLockupAnimations[6] = {
{ NULL, NULL },
{ ASSET_BC_ANIM_LOCKUP, 8000000.0f },
{ ASSET_BC_ANIM_LOCKUP, 4.0f },
{ ASSET_BC_ANIM_LOCKUP, 8000000.0f },
{ ASSET_BC_ANIM_LOCKUP, 1.4f },
{ ASSET_BC_ANIM_LOCKUP, 8000000.0f }
};
/* .data */
ActorAnimationInfo gChLockupAnimations[6] ={
{NULL, NULL},
{ASSET_BC_ANIM_LOCKUP, 8000000.0f},
{ASSET_BC_ANIM_LOCKUP, 4.0f},
{ASSET_BC_ANIM_LOCKUP, 8000000.0f},
{ASSET_BC_ANIM_LOCKUP, 1.4f},
{ASSET_BC_ANIM_LOCKUP, 8000000.0f}
};
ActorInfo gChLockupSlow = {
ActorInfo chLockupSlow = {
MARKER_A4_LOCKUP_SLOW, ACTOR_151_LOCKUP_SLOW, ASSET_3D4_MODEL_LOCKUP,
1, gChLockupAnimations,
__chLockup_updateFunc, actor_update_func_80326224, __chLockup_drawFunc,
1, chLockupAnimations,
chLockup_update, actor_update_func_80326224, chLockup_draw,
2500, 0x366, 0.0f, 0
};
ActorInfo gChLockupMedium = {
ActorInfo chLockupMedium = {
MARKER_F6_LOCKUP_MEDIUM, ACTOR_152_LOCKUP_MEDIUM, ASSET_3D4_MODEL_LOCKUP,
1, gChLockupAnimations,
__chLockup_updateFunc, actor_update_func_80326224, __chLockup_drawFunc,
1, chLockupAnimations,
chLockup_update, actor_update_func_80326224, chLockup_draw,
2500, 0x366, 0.0f, 0
};
ActorInfo gChLockupFast = {
ActorInfo chLockupFast = {
MARKER_F7_LOCKUP_FAST, ACTOR_153_LOCKUP_FAST, ASSET_3D4_MODEL_LOCKUP,
1, gChLockupAnimations,
__chLockup_updateFunc, actor_update_func_80326224, __chLockup_drawFunc,
1, chLockupAnimations,
chLockup_update, actor_update_func_80326224, chLockup_draw,
2500, 0x366, 0.0f, 0
};
static s32 sLockup_CloseColor[4] = {120, 120, 120, 120};
static s32 sLockup_CloseVelocity[3] = {0,0,0};
static s32 SMOKE_COLOR[4] = { 120, 120, 120, 120 };
static s32 SMOKE_VELOCITY[3] = { 0, 0, 0 };
/* .code */
static Actor *__chLockup_drawFunc(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor * actor = marker_getActor(marker);
static Actor *chLockup_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Actor *actor = marker_getActor(marker);
func_8033A45C(3, actor->unk38_31);
func_8033A45C(4, actor->unk38_31);
actor_draw(marker, gfx, mtx, vtx);
}
static void __chLockup_close(Actor *this){
static void close(Actor *this) {
subaddie_set_state_with_direction(this, CH_LOCKUP_STATE_CLOSED, 0.2f, 1);
this->marker->collidable = FALSE;
this->unk38_31 = 0;
FUNC_8030E8B4(SFX_6C_LOCKUP_CLOSING, 1.0f, 32000, this->position, 1250, 2500);
sfx_playFadeShorthandDefault(SFX_6C_LOCKUP_CLOSING, 1.0f, 32000, this->position, 1250, 2500);
}
static void __chLockup_open(Actor *this){
static void open(Actor *this) {
code3040_func_80389468();
subaddie_set_state_with_direction(this, CH_LOCKUP_STATE_OPENING, 0.2f, 1);
this->unk38_31 = 1;
FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500);
sfx_playFadeShorthandDefault(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500);
}
static void __chLockup_updateFunc(Actor *this){
static void chLockup_update(Actor *this) {
ActorLocal_Lockup *local = (ActorLocal_Lockup *)&this->local;
s32 tmp_v1;
s32 cycle_ticks;
int i;
if( !this->has_met_before
&& this->unkF4_8 == 0xA
// Display "this be Grunty's gold" when getting close for the first time
if (!this->has_met_before
&& this->actorTypeSpecificField == LOCKUP_WITH_JIGGY_ID
&& !jiggyscore_isCollected(JIGGY_13_TTC_LOCKUP)
&& func_80329530(this, 320)
&& !func_80329530(this, 160)
&& subaddie_playerIsWithinSphereAndActive(this, 320)
&& !subaddie_playerIsWithinSphereAndActive(this, 160)
&& !player_movementGroup()
&& gcdialog_showText(ASSET_A15_DIALOG_TTC_LOCKUP_SPAWNED, 0, NULL, NULL, NULL, NULL)
){
&& gcdialog_showDialog(ASSET_A15_DIALOG_TTC_LOCKUP_SPAWNED, 0, NULL, NULL, NULL, NULL)) {
this->has_met_before = TRUE;
}
if(!this->volatile_initialized){
if (!this->volatile_initialized) {
this->volatile_initialized = TRUE;
}
switch(this->state){
switch (this->state) {
case CH_LOCKUP_STATE_CLOSED:
if(!this->initialized){
if (!this->initialized) {
this->marker->propPtr->unk8_3 = TRUE;
subaddie_set_state_with_direction(this, CH_LOCKUP_STATE_CLOSED, 0.2f, 1);
this->marker->collidable = FALSE;
this->unk38_31 = 0;
this->initialized = TRUE;
}
local->closed_ticks_counter++;
tmp_v1 = (this->modelCacheIndex == ACTOR_151_LOCKUP_SLOW) ? 0x1E :
(this->modelCacheIndex == ACTOR_152_LOCKUP_MEDIUM) ? 0x14 :
(this->modelCacheIndex == ACTOR_153_LOCKUP_FAST) ? 0xA :
10000;
local->closedTicksCounter++;
if(!(local->closed_ticks_counter < tmp_v1)){
local->closed_ticks_counter = 0;
__chLockup_open(this);
cycle_ticks = (this->modelCacheIndex == ACTOR_151_LOCKUP_SLOW) ? LOCKUP_CYCLE_TICKS_SLOW :
(this->modelCacheIndex == ACTOR_152_LOCKUP_MEDIUM) ? LOCKUP_CYCLE_TICKS_MEDIUM :
(this->modelCacheIndex == ACTOR_153_LOCKUP_FAST) ? LOCKUP_CYCLE_TICKS_FAST :
LOCKUP_CYCLE_TICKS_DEFAULT;
if (!(local->closedTicksCounter < cycle_ticks)) {
local->closedTicksCounter = 0;
open(this);
}
break;
case CH_LOCKUP_STATE_OPENING:
if(subaddie_playerIsWithinSphere(this, 400) && func_8028FB48(0x8000000)){
if (subaddie_playerIsWithinSphere(this, 400) && func_8028FB48(0x8000000)) {
func_8028F428(0xA, this->marker);
}
if(actor_animationIsAt(this, 0.5f)){
if (actor_animationIsAt(this, 0.5f)) {
subaddie_set_state_with_direction(this, CH_LOCKUP_STATE_OPEN, 0.5f, 1);
}
if(0.15 < anctrl_getAnimTimer(this->anctrl)){
if (0.15 < anctrl_getAnimTimer(this->anctrl)) {
this->marker->collidable = TRUE;
}
break;
case CH_LOCKUP_STATE_OPEN:
local->open_ticks_counter++;
tmp_v1 = (this->modelCacheIndex == ACTOR_151_LOCKUP_SLOW) ? 0x1E :
(this->modelCacheIndex == ACTOR_152_LOCKUP_MEDIUM) ? 0x14 :
(this->modelCacheIndex == ACTOR_153_LOCKUP_FAST) ? 0xA :
10000;
local->openTicksCounter++;
cycle_ticks = (this->modelCacheIndex == ACTOR_151_LOCKUP_SLOW) ? LOCKUP_CYCLE_TICKS_SLOW :
(this->modelCacheIndex == ACTOR_152_LOCKUP_MEDIUM) ? LOCKUP_CYCLE_TICKS_MEDIUM :
(this->modelCacheIndex == ACTOR_153_LOCKUP_FAST) ? LOCKUP_CYCLE_TICKS_FAST :
LOCKUP_CYCLE_TICKS_DEFAULT;
if(!(local->open_ticks_counter < tmp_v1)){
local->open_ticks_counter = 0;
if (!(local->openTicksCounter < cycle_ticks)) {
local->openTicksCounter = 0;
subaddie_set_state_with_direction(this, CH_LOCKUP_STATE_CLOSING, 0.5f, 1);
}
break;
case CH_LOCKUP_STATE_CLOSING:
case CH_LOCKUP_STATE_CLOSING2:
if(this->marker->unk14_21 && actor_animationIsAt(this, 0.99f)){
__chLockup_close(this);
for(i = 5; i < 0xe; i++){
if (this->marker->unk14_21 && actor_animationIsAt(this, 0.99f)) {
close(this);
// Spawn smoke particles
for (i = 5; i < 0xE; i++) {
func_8034A174(this->marker->unk44, i, this->unk1C);
func_802EE6CC(this->unk1C, sLockup_CloseVelocity, sLockup_CloseColor, 1, 0.4f, 50.0f, 0xb4, 0xa0, 0);
dustEmitter_emit(this->unk1C, SMOKE_VELOCITY, SMOKE_COLOR, TRUE, 0.4f, 50.0f, 0xB4, 0xA0, DUST_EMITTER_TYPE_DUST);
}
}
break;
}
}

22
src/TTC/ch/lockup.h Normal file
View File

@@ -0,0 +1,22 @@
#define LOCKUP_WITH_JIGGY_ID 0xA
#define LOCKUP_CYCLE_TICKS_SLOW 0x1E
#define LOCKUP_CYCLE_TICKS_MEDIUM 0x14
#define LOCKUP_CYCLE_TICKS_FAST 0xA
#define LOCKUP_CYCLE_TICKS_DEFAULT 10000
typedef struct {
s32 closedTicksCounter;
s32 openTicksCounter;
} ActorLocal_Lockup;
static Actor *chLockup_draw(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx);
static void chLockup_update(Actor *this);
enum ch_lockup_states_e {
CH_LOCKUP_STATE_CLOSED = 1,
CH_LOCKUP_STATE_OPENING = 2,
CH_LOCKUP_STATE_OPEN = 3,
CH_LOCKUP_STATE_CLOSING = 4,
CH_LOCKUP_STATE_CLOSING2 = 5
};

View File

@@ -104,7 +104,7 @@ static void __chNipper_playDeathAnimation(Actor *this) {
subaddie_set_state_with_direction(this, CH_NIPPER_STATE_4_DIEING, 0.01f, 1);
actor_playAnimationOnce(this);
for(i = 0; i < 3; i ++){
FUNC_8030E8B4(SFX_79_TICKER_DEATH, 0.5f, 17000, this->position, 1500, 3000);
sfx_playFadeShorthandDefault(SFX_79_TICKER_DEATH, 0.5f, 17000, this->position, 1500, 3000);
};
}
@@ -125,7 +125,7 @@ static bool __func_80388088(Actor *this){
}
static bool __chNipper_shouldShowActor(Actor *this){
return BOOL(func_80329530(this, 1300) && __func_80388088(this));
return BOOL(subaddie_playerIsWithinSphereAndActive(this, 1300) && __func_80388088(this));
}
static void __chNipper_dieFunc(ActorMarker *this_marker, ActorMarker *other_marker) {
@@ -139,12 +139,12 @@ static void __chNipper_dieFunc(ActorMarker *this_marker, ActorMarker *other_mark
subaddie_set_state_with_direction(this, CH_NIPPER_STATE_6_DEAD, 0.01f, 1);
actor_playAnimationOnce(this);
for(i = 0; i < 3; i++){
FUNC_8030E8B4(SFX_78_EAGLECRY, 0.7f, 20000, this->position, 1500, 3000);
sfx_playFadeShorthandDefault(SFX_78_EAGLECRY, 0.7f, 20000, this->position, 1500, 3000);
};
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 0, 300);
func_8025AABC(COMUSIC_12_TTC_NIPPER);
func_8032BB88(this, -1, 300);
func_802BAFE4(0x1C);
gcStaticCamera_activate(0x1C);
return;
}
@@ -156,7 +156,7 @@ static void __chNipper_dieFunc(ActorMarker *this_marker, ActorMarker *other_mark
__chNipper_playDeathAnimation(this);
this->lifetime_value = 80.0f;
gcdialog_showText(ASSET_A10_DIALOG_TTC_NIPPER_HURT, 4, NULL, NULL, NULL, NULL);
gcdialog_showDialog(ASSET_A10_DIALOG_TTC_NIPPER_HURT, 4, NULL, NULL, NULL, NULL);
return;
}
@@ -177,7 +177,7 @@ static void __chNipper_ow2Func(ActorMarker * this_marker, ActorMarker *other_mar
this = marker_getActor(this_marker);
if( !mapSpecificFlags_get(TTC_SPECIFIC_FLAG_7_NIPPER_FIRST_MEET_TEXT_SHOWN)
&& this->has_met_before
&& gcdialog_showText(0xa0f, 0, NULL, NULL, NULL, NULL)
&& gcdialog_showDialog(0xa0f, 0, NULL, NULL, NULL, NULL)
){
mapSpecificFlags_set(TTC_SPECIFIC_FLAG_7_NIPPER_FIRST_MEET_TEXT_SHOWN, TRUE);
}
@@ -188,7 +188,7 @@ static void __chNipper_owFunc(ActorMarker * this_marker, ActorMarker *other_mark
Actor *this = marker_getActor(this_marker);
if( !this->unk138_23
&& this->has_met_before
&& gcdialog_showText(0xa11, 0, NULL, NULL, NULL, NULL)
&& gcdialog_showDialog(0xa11, 0, NULL, NULL, NULL, NULL)
){
this->unk138_23 = TRUE;
}
@@ -243,7 +243,7 @@ static void __chNipper_updateFunc(Actor *this){
&& player_movement_group != BSGROUP_A_FLYING
){
subaddie_set_state_with_direction(this, CH_NIPPER_STATE_5_SPAWNED, 0.01f, 1);
if(gcdialog_showText(ASSET_A0E_DIALOG_NIPPER_SPAWNED, 0xf, this->position, this->marker, __chNipper_spawnedShowTextCallback, NULL)){
if(gcdialog_showDialog(ASSET_A0E_DIALOG_NIPPER_SPAWNED, 0xf, this->position, this->marker, __chNipper_spawnedShowTextCallback, NULL)){
this->has_met_before = TRUE;
}
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 5000, 300);
@@ -260,7 +260,7 @@ static void __chNipper_updateFunc(Actor *this){
|| actor_animationIsAt(this, 0.6f)
|| actor_animationIsAt(this, 0.7f)
){
FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 0x5dc, 0xbb8);
sfx_playFadeShorthandDefault(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 0x5dc, 0xbb8);
}
break;
@@ -301,7 +301,7 @@ static void __chNipper_updateFunc(Actor *this){
|| actor_animationIsAt(this, 0.95f)
){
for(sp48 = 0; sp48 < 3; sp48++){
FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 1500, 3000);
sfx_playFadeShorthandDefault(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 1500, 3000);
}
}
break;
@@ -318,14 +318,14 @@ static void __chNipper_updateFunc(Actor *this){
|| actor_animationIsAt(this, 0.6f)
|| actor_animationIsAt(this, 0.7f)
){
FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 0x5dc, 0xbb8);
sfx_playFadeShorthandDefault(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 0x5dc, 0xbb8);
}
break;
case CH_NIPPER_STATE_6_DEAD:
this->marker->collidable = FALSE;
if(actor_animationIsAt(this, 0.6f)){
FUNC_8030E8B4(SFX_7C_CHEBOOF, 0.9f, 20000, this->position, 1500, 3000);
sfx_playFadeShorthandDefault(SFX_7C_CHEBOOF, 0.9f, 20000, this->position, 1500, 3000);
break;
}

View File

@@ -48,7 +48,7 @@ static void __chTreasure_updateFunc(Actor *this){
if(!this->initialized){
this->initialized = TRUE;
if(this->unkF4_8 == 1 && !volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)){
if(this->actorTypeSpecificField == 1 && !volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)){
marker_despawn(this->marker);
return;
}

View File

@@ -12,7 +12,7 @@ typedef struct {
static void __chTreasurehunt_updateFunc(Actor *this);
static Actor *__chTreasurehunt_animFunc(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
extern u32 CH_TREASUREHUNT_PUZZLE_CURRENT_STEP;
extern u32 chtreasureHunt_puzzleCurrentStep;
/* .data */
static f32 sChTreasurehunt_stepPositions[6][3] = {
@@ -79,11 +79,11 @@ static bool __chTreasurehunt_isActiveHitboxBeakBusterHitbox(void) {
if (player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER) {
comusic_id = COMUSIC_2B_DING_B;
music_volume = 28000;
if (CH_TREASUREHUNT_PUZZLE_CURRENT_STEP == 5) {
if (chtreasureHunt_puzzleCurrentStep == 5) {
comusic_id = COMUSIC_2D_PUZZLE_SOLVED_FANFARE;
music_volume = 0x7FFF;
}
func_8025A6EC(comusic_id, music_volume);
coMusicPlayer_playMusic(comusic_id, music_volume);
return TRUE;
}
return FALSE;
@@ -93,10 +93,10 @@ static void __chTreasurehunt_spawnRedXForNextStep(void) {
Actor *actor;
ActorLocal_TreasureHunt *local;
actor = actor_spawnWithYaw_f32(ACTOR_55_RED_X, sChTreasurehunt_stepPositions[CH_TREASUREHUNT_PUZZLE_CURRENT_STEP], 0);
actor = actor_spawnWithYaw_f32(ACTOR_55_RED_X, sChTreasurehunt_stepPositions[chtreasureHunt_puzzleCurrentStep], 0);
local = (ActorLocal_TreasureHunt *)&actor->local;
actor->yaw = sChTreasurehunt_StepRedXYaws[CH_TREASUREHUNT_PUZZLE_CURRENT_STEP];
local->unk0 = CH_TREASUREHUNT_PUZZLE_CURRENT_STEP;
actor->yaw = sChTreasurehunt_StepRedXYaws[chtreasureHunt_puzzleCurrentStep];
local->unk0 = chtreasureHunt_puzzleCurrentStep;
actor->lifetime_value = 0.0f;
actor->state = 0;
}
@@ -105,24 +105,24 @@ static void __chTreasurehunt_spawnActorForNextStep(void) {
Actor *actor;
ActorLocal_TreasureHunt *local;
actor = actor_spawnWithYaw_f32((sChTreasurehunt_StepActors - 1)[CH_TREASUREHUNT_PUZZLE_CURRENT_STEP], sChTreasurehunt_stepPositions[CH_TREASUREHUNT_PUZZLE_CURRENT_STEP - 1], 0);
actor = actor_spawnWithYaw_f32((sChTreasurehunt_StepActors - 1)[chtreasureHunt_puzzleCurrentStep], sChTreasurehunt_stepPositions[chtreasureHunt_puzzleCurrentStep - 1], 0);
local = (ActorLocal_TreasureHunt *)&actor->local;
actor->yaw = sChTreasurehunt_StepYaws[CH_TREASUREHUNT_PUZZLE_CURRENT_STEP - 1];
local->unk0 = CH_TREASUREHUNT_PUZZLE_CURRENT_STEP;
actor->yaw = sChTreasurehunt_StepYaws[chtreasureHunt_puzzleCurrentStep - 1];
local->unk0 = chtreasureHunt_puzzleCurrentStep;
actor->lifetime_value = 0.0f;
actor->state = 0;
}
static void __chTreasurehunt_checkStepProgress(s32 currentStep){
if(CH_TREASUREHUNT_PUZZLE_CURRENT_STEP == currentStep && __chTreasurehunt_isActiveHitboxBeakBusterHitbox()){
if(chtreasureHunt_puzzleCurrentStep == currentStep && __chTreasurehunt_isActiveHitboxBeakBusterHitbox()){
if(currentStep == 0 && !jiggyscore_isCollected(JIGGY_11_TTC_RED_X)){
gcdialog_showText(ASSET_A18_DIALOG_TREASUREHUNT_FOLLOW_CLUES, 4, NULL, NULL, NULL, NULL);
gcdialog_showDialog(ASSET_A18_DIALOG_TREASUREHUNT_FOLLOW_CLUES, 4, NULL, NULL, NULL, NULL);
}
else if(currentStep == 4){
gcdialog_showText(ASSET_A19_DIALOG_TREASUREHUNT_SECOND_STEP, 4, NULL, NULL, NULL, NULL);
gcdialog_showDialog(ASSET_A19_DIALOG_TREASUREHUNT_SECOND_STEP, 4, NULL, NULL, NULL, NULL);
}
CH_TREASUREHUNT_PUZZLE_CURRENT_STEP++;
chtreasureHunt_puzzleCurrentStep++;
__spawnQueue_add_0(__chTreasurehunt_spawnActorForNextStep);
__spawnQueue_add_0(__chTreasurehunt_spawnRedXForNextStep);
}
@@ -152,7 +152,7 @@ void chTreasurehunt_checkStepProgress5(NodeProp *this, ActorMarker *arg1){
static ParticleEmitter *particleEmitter;
static f32 particleTargetPosition[3];
if(CH_TREASUREHUNT_PUZZLE_CURRENT_STEP == 5 && __chTreasurehunt_isActiveHitboxBeakBusterHitbox()){
if(chtreasureHunt_puzzleCurrentStep == 5 && __chTreasurehunt_isActiveHitboxBeakBusterHitbox()){
particleTargetPosition[0] = (f32)this->x;
particleTargetPosition[1] = (f32)this->y;
particleTargetPosition[2] = (f32)this->z;
@@ -170,13 +170,13 @@ void chTreasurehunt_checkStepProgress5(NodeProp *this, ActorMarker *arg1){
gcpausemenu_80314AC8(0);
timedFunc_set_2(0.1f, (GenFunction_2) func_8028F45C, 9, (s32)&particleTargetPosition);
timedFunc_set_1(0.1f, (GenFunction_1) gcpausemenu_80314AC8, 1);
gcdialog_showText(ASSET_A17_DIALOG_BURIED_TREASURE_SPAWNED, 4, NULL, NULL, NULL, NULL);
CH_TREASUREHUNT_PUZZLE_CURRENT_STEP++;
gcdialog_showDialog(ASSET_A17_DIALOG_BURIED_TREASURE_SPAWNED, 4, NULL, NULL, NULL, NULL);
chtreasureHunt_puzzleCurrentStep++;
}
}
void chTreasurehunt_resetProgress(void){
CH_TREASUREHUNT_PUZZLE_CURRENT_STEP = 0;
chtreasureHunt_puzzleCurrentStep = 0;
}
static void __chTreasurehunt_updateFunc(Actor *this){
@@ -198,7 +198,7 @@ static void __chTreasurehunt_updateFunc(Actor *this){
}
break;
case 1:
if(local->unk0 < CH_TREASUREHUNT_PUZZLE_CURRENT_STEP){
if(local->unk0 < chtreasureHunt_puzzleCurrentStep){
this->state = 2;
}
break;

View File

@@ -17,9 +17,9 @@ extern ActorInfo gStairs1;
extern ActorInfo gStairs2;
extern ActorInfo gPalmTree;
extern ActorInfo gChLeaky;
extern ActorInfo gChLockupSlow;
extern ActorInfo gChLockupMedium;
extern ActorInfo gChLockupFast;
extern ActorInfo chLockupSlow;
extern ActorInfo chLockupMedium;
extern ActorInfo chLockupFast;
extern ActorInfo gChTreasurehuntRedArrow;
extern ActorInfo gChTreasurehuntRedQuestionMark;
extern ActorInfo gChTreasurehuntRedX;
@@ -97,9 +97,9 @@ void code26D0_resetSpawnableActorsForTTC(void)
spawnableActorList_add(&gChNipper, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_5 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_20 | ACTOR_FLAG_UNKNOWN_26);
spawnableActorList_add(&gChBlubber, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_26);
spawnableActorList_add(&gChLeaky, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_8);
spawnableActorList_add(&gChLockupSlow, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8);
spawnableActorList_add(&gChLockupMedium, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8);
spawnableActorList_add(&gChLockupFast, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8);
spawnableActorList_add(&chLockupSlow, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8);
spawnableActorList_add(&chLockupMedium, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8);
spawnableActorList_add(&chLockupFast, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8);
spawnableActorList_add(&gChTreasurehuntRedArrow, actor_new, ACTOR_FLAG_UNKNOWN_10);
spawnableActorList_add(&gChTreasurehuntRedQuestionMark, actor_new, ACTOR_FLAG_UNKNOWN_10);
spawnableActorList_add(&gChTreasurehuntRedX, actor_new, ACTOR_FLAG_UNKNOWN_10);

View File

@@ -242,7 +242,7 @@ static void __maCastle_setLetterFloorTileState(LetterFloorTile *arg0, s32 arg1)
arg0->timeDeltaSum = 0.0f;
if ((arg1 == 1) && (temp_v0 != arg1))
{
func_8025A6EC(COMUSIC_2C_BUZZER, 32000);
coMusicPlayer_playMusic(COMUSIC_2C_BUZZER, 32000);
}
}
@@ -327,11 +327,11 @@ static u32 __maCastle_cheatoCodeUnlocked(s32 cheato_code_index)
static void __maCastle_setVolatileFlags(u32 arg0)
{
int i;
volatileFlag_setAndTriggerDialog_0(VOLATILE_FLAG_C2_NOBONUS_TEXT);
progressDialog_setAndTriggerDialog_0(VOLATILE_FLAG_C2_NOBONUS_TEXT);
// wish washy banjo cheat code
if (arg0 & 0x400)
{
volatileFlag_setAndTriggerDialog_E(VOLATILE_FLAG_C5_WISHYWASHYBANJO_TEXT);
progressDialog_setAndTriggerDialog_E(VOLATILE_FLAG_C5_WISHYWASHYBANJO_TEXT);
}
volatileFlag_set(VOLATILE_FLAG_78_SANDCASTLE_NO_BONUS, 0);
for (i = 4; i < 11; i++)
@@ -414,7 +414,7 @@ static void __maCastle_checkFloorTileForRegularCheatCode(LetterFloorTile *letter
}
if (cheatcode_ptr->code[cheatcode_ptr->codeCharacterIdx] == 0)
{
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 32000);
coMusicPlayer_playMusic(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 32000);
if (is_in_ff_minigame)
{
@@ -433,14 +433,14 @@ static void __maCastle_checkFloorTileForRegularCheatCode(LetterFloorTile *letter
sMapState.unkC = 0.0f;
mapSpecificFlags_set(TTC_SPECIFIC_FLAG_1_UNKNOWN, TRUE);
fileProgressFlag_set(FILEPROG_FA_UNKNOWN, TRUE);
func_8030E2C4(sMapState.doorOpeningSfxSourceIdx);
sfxSource_func_8030E2C4(sMapState.doorOpeningSfxSourceIdx);
__maCastle_setupCheatCodeTimer(2);
}
// blue eggs & red/gold feathers check
else if (var_v0 & 0xE)
{
// trigger dialog
func_8035644C((cheatcode_ptr - sCheatCodes) - 1 + FILEPROG_BE_CHEATO_BLUEEGGS);
progressDialog_showDialogMaskZero((cheatcode_ptr - sCheatCodes) - 1 + FILEPROG_BE_CHEATO_BLUEEGGS);
switch ((cheatcode_ptr - sCheatCodes) - 1)
{
default:
@@ -468,7 +468,7 @@ static void __maCastle_checkFloorTileForRegularCheatCode(LetterFloorTile *letter
}
else
{
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
coMusicPlayer_playMusic(COMUSIC_2B_DING_B, 28000);
}
}
}
@@ -539,7 +539,7 @@ void maCastle_init(void)
timed_exitStaticCamera(2.0f);
func_80324E38(2.0f, 0);
func_803228D8();
timedFunc_set_3(2.0f, (GenFunction_3)func_802E4078, MAP_7_TTC_TREASURE_TROVE_COVE, 1, 0);
timedFunc_set_3(2.0f, (GenFunction_3)transitionToMap, MAP_7_TTC_TREASURE_TROVE_COVE, 1, 0);
}
else if (levelSpecificFlags_get(LEVEL_FLAG_2_TTC_UNKNOWN) || volatileFlag_get(VOLATILE_FLAG_2_FF_IN_MINIGAME)) {
func_8034E71C(sp2C, -500, 0.0f);
@@ -557,12 +557,12 @@ void maCastle_init(void)
sMapState.doorOpeningSfxSourceIdx = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_playSfxAtVolume(sMapState.doorOpeningSfxSourceIdx, 0.1f);
sfxsource_setSfxId(sMapState.doorOpeningSfxSourceIdx, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(sMapState.doorOpeningSfxSourceIdx, 3);
sfxSource_setunk43_7ByIndex(sMapState.doorOpeningSfxSourceIdx, 3);
sfxsource_setSampleRate(sMapState.doorOpeningSfxSourceIdx, 28000);
sMapState.dullCannonShotSfxSourceId = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(sMapState.dullCannonShotSfxSourceId, SFX_3_DULL_CANNON_SHOT);
func_8030DD14(sMapState.dullCannonShotSfxSourceId, 3);
sfxSource_setunk43_7ByIndex(sMapState.dullCannonShotSfxSourceId, 3);
sfxsource_setSampleRate(sMapState.dullCannonShotSfxSourceId, 0x7fff);
__maCastle_initFloorTiles();
__maCastle_resetCheatCodeProgress();
@@ -588,7 +588,7 @@ void maCastle_update(void)
time_delta = time_getDelta();
if (__maCastle_getNumberOfBannedCheatCodesEntered() == 3)
{
func_802C5A3C(-1);
gameSelect_setGameNumber(-1);
}
if (sMapState.model1 != 0)
{
@@ -638,8 +638,8 @@ void maCastle_update(void)
if (sMapState.unkC > 4.0f)
{
sMapState.banjoKazooieCodeEnteredState = 3;
func_8030E2C4(sMapState.dullCannonShotSfxSourceId);
func_8030E394(sMapState.doorOpeningSfxSourceIdx);
sfxSource_func_8030E2C4(sMapState.dullCannonShotSfxSourceId);
sfxSource_triggerCallbackByIndex(sMapState.doorOpeningSfxSourceIdx);
}
}
}
@@ -1029,10 +1029,10 @@ static void __maCastle_eraseGameplayDialogCallback(ActorMarker *caller, enum ass
{
__maCastle_setNumberOfBannedCheatcodesEntered(3);
__maCastle_checkSecretCheatCodeIndex(sThirdForbiddenSecretCheatCodeIndex);
gcdialog_showText(ASSET_FBF_DIALOG_ERASED_SAVE, 0xC, NULL, NULL, NULL, NULL);
gameFile_clear(func_802C5A30());
gameFile_8033CFD4(func_802C5A30());
func_802C5A3C(-1);
gcdialog_showDialog(ASSET_FBF_DIALOG_ERASED_SAVE, 0xC, NULL, NULL, NULL, NULL);
gameFile_clear(gameSelect_getGameNumber());
gameFile_8033CFD4(gameSelect_getGameNumber());
gameSelect_setGameNumber(-1);
return;
}
__maCastle_resetSecretCheatCodeProgress();
@@ -1064,11 +1064,11 @@ static void __maCastle_checkIfBannedCheatCodeEntered(s32 secret_cheat_code_index
__maCastle_setNumberOfBannedCheatcodesEntered(2);
__maCastle_checkSecretCheatCodeIndex(secret_cheat_code_index);
__maCastle_resetSecretCheatCodeProgress();
gcdialog_showText(ASSET_FBE_DIALOG_CHEATING_ERASE_SAVE_WARNING, 0xC, NULL, NULL, NULL, NULL);
gcdialog_showDialog(ASSET_FBE_DIALOG_CHEATING_ERASE_SAVE_WARNING, 0xC, NULL, NULL, NULL, NULL);
return;
case 2:
sThirdForbiddenSecretCheatCodeIndex = secret_cheat_code_index;
gcdialog_showText(ASSET_E38_DIALOG_CHEATING_ERASE_SAVE_CONFIRMATION, 0xC, NULL, NULL, __maCastle_eraseGameplayDialogCallback, NULL);
gcdialog_showDialog(ASSET_E38_DIALOG_CHEATING_ERASE_SAVE_CONFIRMATION, 0xC, NULL, NULL, __maCastle_eraseGameplayDialogCallback, NULL);
return;
}
return;