document: Blubber actor from TTC

This commit is contained in:
Bl00D4NGEL
2024-09-28 22:32:03 +02:00
parent 86b22d6d09
commit 1506d57893
21 changed files with 107 additions and 89 deletions

View File

@@ -828,7 +828,7 @@ enum sfx_e
SFX_24_KONGA_NOISE_3, SFX_24_KONGA_NOISE_3,
// might be part of Clankers Bolt // might be part of Clankers Bolt
SFX_25_METAL_SLIDING_OVER_SMTH, SFX_25_METAL_SLIDING_OVER_SMTH,
SFX_26_BANJO_LANDING_09, SFX_26_BANJO_LANDING_09 = 0x26,
SFX_27_JINJO_HI, SFX_27_JINJO_HI,
SFX_28_RUSTLING_NOISE, SFX_28_RUSTLING_NOISE,
SFX_29_GRUBLIN_NYAHAHA, SFX_29_GRUBLIN_NYAHAHA,
@@ -1859,6 +1859,10 @@ enum actor_e
ACTOR_146_GV_KAZOOIE_TARGET, ACTOR_146_GV_KAZOOIE_TARGET,
ACTOR_147_ANCIENT_ONE, ACTOR_147_ANCIENT_ONE,
ACTOR_149_TTC_BLUBBER_UNKNOWN = 0x149,
ACTOR_14A_TTC_BLUBBER_UNKNOWN = 0x14a,
ACTOR_14B_TTC_BLUBBER_UNKNOWN = 0x14b,
ACTOR_14E_BGS_ELEVATED_WALKWAY_SWITCH = 0x14E, ACTOR_14E_BGS_ELEVATED_WALKWAY_SWITCH = 0x14E,
ACTOR_14F_DESTROYED_JIGGY, ACTOR_14F_DESTROYED_JIGGY,
@@ -3983,9 +3987,9 @@ enum asset_e
ASSET_8A0_SPRITE_WATER_DROP = 0x8a0, ASSET_8A0_SPRITE_WATER_DROP = 0x8a0,
ASSET_A0B_TEXT_UNKNOWN = 0xA0B, ASSET_A0B_FIRST_MEET_BLUBBER = 0xA0B,
ASSET_A0C_TEXT_UNKNOWN = 0xA0C, ASSET_A0C_BLUBBER_HALF_GOLD = 0xA0C,
ASSET_A0D_TEXT_UNKNOWN = 0xA0D, ASSET_A0D_BLUBBER_COMPLETE = 0xA0D,
ASSET_A14_TEXT_UNKNOWN = 0xA14, ASSET_A14_TEXT_UNKNOWN = 0xA14,
@@ -4002,7 +4006,7 @@ enum asset_e
ASSET_A27_TEXT_BOTTLES_ALL_TTC_MOVES_LEARNED, ASSET_A27_TEXT_BOTTLES_ALL_TTC_MOVES_LEARNED,
ASSET_A28_TEXT_LEAKY_DONE, ASSET_A28_TEXT_LEAKY_DONE,
ASSET_A2A_TEXT_UNKNOWN = 0xA2A, ASSET_A2A_BLUBBER_COMPLETE_JIGGY_COLLECTED = 0xA2A,
ASSET_A6F_TEXT_CHARMER_MEET = 0xA6F, ASSET_A6F_TEXT_CHARMER_MEET = 0xA6F,
ASSET_A70_TEXT_CHARMER_HELPED, ASSET_A70_TEXT_CHARMER_HELPED,

View File

@@ -475,7 +475,7 @@ void func_80352CF4(f32 *, f32 *, f32, f32);
AnimCtrl *baanim_getAnimCtrlPtr(void); AnimCtrl *baanim_getAnimCtrlPtr(void);
void player_setYPosition(f32); void player_setYPosition(f32);
NodeProp *func_80304C38(enum actor_e arg0, Actor *arg1); NodeProp *nodeprop_findByActorIdAndActorPosition(enum actor_e arg0, Actor *arg1);
NodeProp *func_80304CAC(s32 arg0, f32 position[3]); NodeProp *func_80304CAC(s32 arg0, f32 position[3]);
Actor *actorArray_findClosestActorFromActorId(f32 position[3], enum actor_e actor_id, s32 arg2, f32 *min_distance_ptr); Actor *actorArray_findClosestActorFromActorId(f32 position[3], enum actor_e actor_id, s32 arg2, f32 *min_distance_ptr);
Actor *subaddie_getLinkedActor(Actor *); Actor *subaddie_getLinkedActor(Actor *);

View File

@@ -165,7 +165,7 @@ typedef struct actor_s{
u32 is_bundle:1; u32 is_bundle:1;
AnimCtrl *animctrl; AnimCtrl *animctrl;
ActorAnimationInfo *unk18; ActorAnimationInfo *unk18;
TUPLE(f32, unk1C); TUPLE(f32, unk1C); // actor position?
f32 actor_specific_1_f; //used in cheggs f32 actor_specific_1_f; //used in cheggs
TUPLE(f32, velocity); TUPLE(f32, velocity);
u32 unk38_31:10; u32 unk38_31:10;

View File

@@ -201,7 +201,7 @@ func_802F9FD0 = 0x802fa1b0;
func_802FA060 = 0x802fa240; func_802FA060 = 0x802fa240;
func_802FADD4 = 0x802fafb4; func_802FADD4 = 0x802fafb4;
cubeList_findNodePropByActorId = 0x80304b6c; cubeList_findNodePropByActorId = 0x80304b6c;
func_80304C38 = 0x80304dd8; nodeprop_findByActorIdAndActorPosition = 0x80304dd8;
nodeprop_getPosition_s32 = 0x80304eec; nodeprop_getPosition_s32 = 0x80304eec;
nodeprop_getPosition = 0x80304f08; nodeprop_getPosition = 0x80304f08;
func_80309B48 = 0x80309ce8; func_80309B48 = 0x80309ce8;

View File

@@ -100,7 +100,7 @@ void func_8038F6A4(Actor *this)
NodeProp *temp_v0; NodeProp *temp_v0;
if (!this->initialized) if (!this->initialized)
{ {
temp_v0 = func_80304C38(ACTOR_32B_UNKNOWN, this); temp_v0 = nodeprop_findByActorIdAndActorPosition(ACTOR_32B_UNKNOWN, this);
if (temp_v0 == 0) if (temp_v0 == 0)
{ {
local->unk18[0] = 3672.0f; local->unk18[0] = 3672.0f;

View File

@@ -211,7 +211,7 @@ void func_80391744(Actor *this, Actor* other){
void *sp24; void *sp24;
f32 tmp_f0; f32 tmp_f0;
sp24 = func_80304C38(0x22A, this); sp24 = nodeprop_findByActorIdAndActorPosition(0x22A, this);
tmp_f0 = (f32)func_80304DA8(sp24); tmp_f0 = (f32)func_80304DA8(sp24);
other->yaw = tmp_f0; other->yaw = tmp_f0;
this->yaw = tmp_f0; this->yaw = tmp_f0;

View File

@@ -221,7 +221,7 @@ void func_803876D0(Actor *this){
this->initialized = TRUE; this->initialized = TRUE;
this->velocity_x = 0.0f; this->velocity_x = 0.0f;
this->actor_specific_1_f = 0.0f; this->actor_specific_1_f = 0.0f;
node_prop = func_80304C38(0x150, this); node_prop = nodeprop_findByActorIdAndActorPosition(0x150, this);
((ActorLocal_Conga *)&this->local)->unk1C = nodeprop_getRadius(node_prop); ((ActorLocal_Conga *)&this->local)->unk1C = nodeprop_getRadius(node_prop);
nodeprop_getPosition_s32(node_prop, &((ActorLocal_Conga *)&this->local)->unk10); nodeprop_getPosition_s32(node_prop, &((ActorLocal_Conga *)&this->local)->unk10);
} }

View File

@@ -409,7 +409,7 @@ void chsmmole_Update(Actor * this){
this->initialized = TRUE; this->initialized = TRUE;
marker_setFreeMethod(this->marker, func_80389984); marker_setFreeMethod(this->marker, func_80389984);
if(this->unkF4_8 == 1 || this->unkF4_8 == 8){//L80389A30 if(this->unkF4_8 == 1 || this->unkF4_8 == 8){//L80389A30
sp40 = func_80304C38(0x349, this); sp40 = nodeprop_findByActorIdAndActorPosition(0x349, this);
if(!sp40){ if(!sp40){
this->unk1C_x = this->position_x; this->unk1C_x = this->position_x;
this->unk1C_y = this->position_y; this->unk1C_y = this->position_y;

View File

@@ -28,7 +28,7 @@ void func_8038A8F8(Actor *this){
NodeProp *other; NodeProp *other;
if(!this->volatile_initialized){ if(!this->volatile_initialized){
other = func_80304C38(0x3be, this); other = nodeprop_findByActorIdAndActorPosition(0x3be, this);
if(!other){ if(!other){
this->unk1C_x = this->position_x; this->unk1C_x = this->position_x;
this->unk1C_y = this->position_y; this->unk1C_y = this->position_y;

View File

@@ -11,16 +11,31 @@ typedef struct {
s16 unkE; s16 unkE;
f32 throw_target_position[3]; f32 throw_target_position[3];
s32 throw_target_radius; s32 throw_target_radius;
NodeProp* unk20; NodeProp* gold_bullion_throw_target_node_prop;
s32 unk24; s32 unk24; // bullions left to collect ? (changes from 4 to 0)
}ActorLocal_Blubber; }ActorLocal_Blubber;
void func_803878CC(Actor *this); void TTC_Blubber_updateFunc(Actor *this);
void TTC_func_80387CF4(Actor *this); void TTC_Blubber_update2Func(Actor *this);
Actor *func_80387D6C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); Actor *TTC_Blubber_drawFunc(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
enum ttc_blubber_map_flags_e {
TTC_BLUBBER_MAP_FLAG_0_UNKNOWN = 0,
TTC_BLUBBER_MAP_FLAG_1_UNKNOWN = 1, // If this is not set some things will not run like showing the jiggy collected text
TTC_BLUBBER_MAP_FLAG_2_JIGGY_SPAWNED_TEXT_SHOWN = 2, // Jiggy collected text shown
TTC_BLUBBER_MAP_FLAG_3_SHOW_JIGGY_SPAWNED_TEXT_FLAG = 3
};
enum ttc_blubber_states_e {
TTC_BLUBBER_STATE_1_UNKNOWN = 1, // initial state (80387A84)
TTC_BLUBBER_STATE_2_UNKNOWN = 2, // 80387B10
TTC_BLUBBER_STATE_3_UNKNOWN = 3,
TTC_BLUBBER_STATE_4_UNKNOWN = 4, // 80387C04
TTC_BLUBBER_STATE_5_UNKNOWN = 5 // 80387CD4
};
/* .data */ /* .data */
ActorAnimationInfo D_8038C4E0[] = { ActorAnimationInfo TTC_BLUBBER_ACTOR_ANIMATIONS[6] = {
{0x00, 0.0f}, {0x00, 0.0f},
{ASSET_B5_ANIM_BLUBBER_WALK, 2.0f}, {ASSET_B5_ANIM_BLUBBER_WALK, 2.0f},
{ASSET_B6_ANIM_BLUBBER_CRY, 2.0f}, {ASSET_B6_ANIM_BLUBBER_CRY, 2.0f},
@@ -29,75 +44,74 @@ ActorAnimationInfo D_8038C4E0[] = {
{ASSET_B8_ANIM_BLUBBER_RUN, 0.8f} {ASSET_B8_ANIM_BLUBBER_RUN, 0.8f}
}; };
ActorInfo TTC_D_8038C510 = { ActorInfo TTC_BLUBBER_ACTOR_INFO = {
MARKER_A3_BLUBBER, ACTOR_115_BLUBBER, ASSET_370_MODEL_BLUBBER, MARKER_A3_BLUBBER, ACTOR_115_BLUBBER, ASSET_370_MODEL_BLUBBER,
0x1, D_8038C4E0, 0x1, TTC_BLUBBER_ACTOR_ANIMATIONS,
func_803878CC, TTC_func_80387CF4, func_80387D6C, TTC_Blubber_updateFunc, TTC_Blubber_update2Func, TTC_Blubber_drawFunc,
0, 0x399, 1.8f, 0 0, 0x399, 1.8f, 0
}; };
/* .code */ /* .code */
void func_80387490(Actor *this){ void TTC_Blubber_initiliaze(Actor *this){
ActorLocal_Blubber *local = (ActorLocal_Blubber *)&this->local; ActorLocal_Blubber *local = (ActorLocal_Blubber *)&this->local;
animctrl_setTransitionDuration(this->animctrl, 0.2f); animctrl_setTransitionDuration(this->animctrl, 0.2f);
this->initialized = TRUE; this->initialized = TRUE;
local->unk20 = func_80304C38(ACTOR_2B_GOLD_BULLION_THROW_TARGET, this); local->gold_bullion_throw_target_node_prop = nodeprop_findByActorIdAndActorPosition(ACTOR_2B_GOLD_BULLION_THROW_TARGET, this);
if(local->unk20){ if(local->gold_bullion_throw_target_node_prop){
nodeprop_getPosition(local->gold_bullion_throw_target_node_prop, local->throw_target_position);
nodeprop_getPosition(local->unk20, local->throw_target_position); local->throw_target_radius = nodeprop_getRadius(local->gold_bullion_throw_target_node_prop);
local->throw_target_radius = nodeprop_getRadius(local->unk20);
} }
local->unk24 = 4; local->unk24 = 4;
func_8032A82C(this, 0x14C); func_8032A82C(this, 0x14C);
} }
void func_80387520(ActorMarker *caller, enum asset_e text_id, s32 arg1){ void TTC_Blubber_showTextCallback(ActorMarker *caller, enum asset_e text_id, s32 arg1){
Actor *this = marker_getActor(caller); Actor *this = marker_getActor(caller);
ActorLocal_Blubber *local = (ActorLocal_Blubber*)&this->local; ActorLocal_Blubber *local = (ActorLocal_Blubber*)&this->local;
if(text_id == 0xa0d || text_id == 0xa2a){ if(text_id == ASSET_A0D_BLUBBER_COMPLETE || text_id == ASSET_A2A_BLUBBER_COMPLETE_JIGGY_COLLECTED){
local->unk24 = 0; local->unk24 = 0;
} }
else{ else{
subaddie_set_state_with_direction(this, 2, 0, 1); subaddie_set_state_with_direction(this, TTC_BLUBBER_STATE_2_UNKNOWN, 0, 1);
} }
} }
void func_80387574(ActorMarker *caller, enum asset_e text_id, s32 arg1){ void TTC_Blubber_showTextCallback2(ActorMarker *caller, enum asset_e text_id, s32 arg1){
f32 sp24[3]; f32 sp24[3];
if(nodeProp_findPositionFromActorId(0x14b, sp24)){ if(nodeProp_findPositionFromActorId(ACTOR_14B_TTC_BLUBBER_UNKNOWN, sp24)){
jiggy_spawn(JIGGY_14_TTC_BLUBBER, sp24); jiggy_spawn(JIGGY_14_TTC_BLUBBER, sp24);
__spawnQueue_add_4((GenFunction_4)spawnQueue_actor_f32, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); __spawnQueue_add_4((GenFunction_4)spawnQueue_actor_f32, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2]));
} }
} }
void func_803875D4(ActorMarker *marker){ void TTC_Blubber_showJiggySpawnedText(ActorMarker *marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, marker)); Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, marker));
enum asset_e text_id; enum asset_e text_id;
subaddie_set_state(this, 4); subaddie_set_state(this, TTC_BLUBBER_STATE_4_UNKNOWN);
actor_loopAnimation(this); actor_loopAnimation(this);
this->actor_specific_1_f = 0.0f; this->actor_specific_1_f = 0.0f;
if(!mapSpecificFlags_get(2)) { if(!mapSpecificFlags_get(TTC_BLUBBER_MAP_FLAG_2_JIGGY_SPAWNED_TEXT_SHOWN)) {
text_id = jiggyscore_isCollected(JIGGY_14_TTC_BLUBBER) ? ASSET_A2A_TEXT_UNKNOWN : ASSET_A0D_TEXT_UNKNOWN; text_id = jiggyscore_isCollected(JIGGY_14_TTC_BLUBBER) ? ASSET_A2A_BLUBBER_COMPLETE_JIGGY_COLLECTED : ASSET_A0D_BLUBBER_COMPLETE;
gcdialog_showText(text_id, 0xf, this->position, this->marker, func_80387520, func_80387574); gcdialog_showText(text_id, 0xf, this->position, this->marker, TTC_Blubber_showTextCallback, TTC_Blubber_showTextCallback2);
mapSpecificFlags_set(2, TRUE); mapSpecificFlags_set(TTC_BLUBBER_MAP_FLAG_2_JIGGY_SPAWNED_TEXT_SHOWN, TRUE);
} }
} }
void func_80387678(Actor *this){ void TTC_Blubber_checkJiggySpawnedTextAndAdvanceState(Actor *this){
if( !mapSpecificFlags_get(1) ) return; if( !mapSpecificFlags_get(TTC_BLUBBER_MAP_FLAG_1_UNKNOWN) ) return;
if( mapSpecificFlags_get(3) ) return; if( mapSpecificFlags_get(TTC_BLUBBER_MAP_FLAG_3_SHOW_JIGGY_SPAWNED_TEXT_FLAG) ) return;
this->yaw_ideal = (f32) func_80329784(this); this->yaw_ideal = (f32) func_80329784(this);
mapSpecificFlags_set(3, TRUE); mapSpecificFlags_set(TTC_BLUBBER_MAP_FLAG_3_SHOW_JIGGY_SPAWNED_TEXT_FLAG, TRUE);
func_8028F918(2); func_8028F918(2);
timed_setStaticCameraToNode(0.0f, 4); timed_setStaticCameraToNode(0.0f, 4);
timedFunc_set_1(1.0f, (GenFunction_1)func_803875D4, (s32)this->marker); timedFunc_set_1(1.0f, (GenFunction_1)TTC_Blubber_showJiggySpawnedText, (s32)this->marker);
subaddie_set_state_with_direction(this, 1, 0.0f, 1); subaddie_set_state_with_direction(this, TTC_BLUBBER_STATE_1_UNKNOWN, 0.0f, 1);
} }
void func_8038771C(Actor *this){ void func_8038771C(Actor *this){
@@ -108,6 +122,7 @@ void func_8038771C(Actor *this){
} }
} }
// probably something related to blubber throwing the bullions
void func_80387774(Actor **this_ptr){ void func_80387774(Actor **this_ptr){
ActorLocal_Blubber *local = (ActorLocal_Blubber *)&(*this_ptr)->local; ActorLocal_Blubber *local = (ActorLocal_Blubber *)&(*this_ptr)->local;
@@ -115,8 +130,8 @@ void func_80387774(Actor **this_ptr){
if( func_80329530(*this_ptr, 200) if( func_80329530(*this_ptr, 200)
&& bacarry_get_markerId() == MARKER_37_GOLD_BULLION && bacarry_get_markerId() == MARKER_37_GOLD_BULLION
&& player_throwCarriedObject() && player_throwCarriedObject()
){ ) {
func_8028FA34(!mapSpecificFlags_get(0)? 0x149 : 0x14a, *this_ptr); func_8028FA34(!mapSpecificFlags_get(TTC_BLUBBER_MAP_FLAG_0_UNKNOWN) ? ACTOR_149_TTC_BLUBBER_UNKNOWN : ACTOR_14A_TTC_BLUBBER_UNKNOWN, *this_ptr);
(*this_ptr)->has_met_before = TRUE; (*this_ptr)->has_met_before = TRUE;
} }
@@ -126,21 +141,21 @@ void func_80387830(Actor *this , f32 arg1, f32 arg2){
if( actor_animationIsAt(this, arg1) if( actor_animationIsAt(this, arg1)
|| actor_animationIsAt(this, arg2) || actor_animationIsAt(this, arg2)
){ ){
this->unk10_12 = func_802E0970(0x26, 0.75f, 0.85f, 0.05f, 11000, this->unk10_12, this->position); this->unk10_12 = func_802E0970(SFX_26_BANJO_LANDING_09, 0.75f, 0.85f, 0.05f, 11000, this->unk10_12, this->position);
} }
} }
void func_803878CC(Actor * this){ void TTC_Blubber_updateFunc(Actor * this){
ActorLocal_Blubber *local; ActorLocal_Blubber *local;
this->marker->propPtr->unk8_3 = TRUE; this->marker->propPtr->unk8_3 = TRUE;
func_8028E668(this->position, 90.0f, -10.0f, 110.0f); func_8028E668(this->position, 90.0f, -10.0f, 110.0f);
if(!mapSpecificFlags_get(1) && !func_80329530(this, 2500)) if(!mapSpecificFlags_get(TTC_BLUBBER_MAP_FLAG_1_UNKNOWN) && !func_80329530(this, 2500))
return; return;
if(!this->volatile_initialized){ if(!this->volatile_initialized){
if(this->state == 3){ if(this->state == TTC_BLUBBER_STATE_3_UNKNOWN){
subaddie_set_state_with_direction(this, 2, 0.0f, 1); subaddie_set_state_with_direction(this, TTC_BLUBBER_STATE_2_UNKNOWN, 0.0f, 1);
} }
this->volatile_initialized = TRUE; this->volatile_initialized = TRUE;
}//L80387970 }//L80387970
@@ -149,44 +164,43 @@ void func_803878CC(Actor * this){
&& !this->has_met_before && !this->has_met_before
&& item_getCount(ITEM_18_GOLD_BULLIONS) == 0 && item_getCount(ITEM_18_GOLD_BULLIONS) == 0
){ ){
gcdialog_showText(ASSET_A0B_TEXT_UNKNOWN, 0xe, this->position, this->marker, func_80387520, NULL); gcdialog_showText(ASSET_A0B_FIRST_MEET_BLUBBER, 0xe, this->position, this->marker, TTC_Blubber_showTextCallback, NULL);
this->has_met_before = TRUE; this->has_met_before = TRUE;
subaddie_set_state_forward(this, 3); subaddie_set_state_forward(this, TTC_BLUBBER_STATE_3_UNKNOWN);
} }
if( mapSpecificFlags_get(0) if( mapSpecificFlags_get(TTC_BLUBBER_MAP_FLAG_0_UNKNOWN)
&& !this->unk138_23 && !this->unk138_23
){ ){
if (item_getCount(ITEM_18_GOLD_BULLIONS) == 0) { if (item_getCount(ITEM_18_GOLD_BULLIONS) == 0) {
gcdialog_showText(ASSET_A0C_TEXT_UNKNOWN, 4, NULL, NULL, NULL, NULL); gcdialog_showText(ASSET_A0C_BLUBBER_HALF_GOLD, 4, NULL, NULL, NULL, NULL);
} }
this->unk138_23 = TRUE; this->unk138_23 = TRUE;
this->has_met_before = TRUE; this->has_met_before = TRUE;
}//L80387A54 }//L80387A54
switch(this->state){//D_8038CD40 switch(this->state){//D_8038CD40
case 1:// 80387A84 case TTC_BLUBBER_STATE_1_UNKNOWN:
if(!this->initialized){ if(!this->initialized){
actor_collisionOff(this); actor_collisionOff(this);
func_80387490(this); TTC_Blubber_initiliaze(this);
} }
func_80387774(&this); func_80387774(&this);
if(subaddie_maybe_set_state_position_direction(this, 2, 0.0f, 1, 0.007f)) if(subaddie_maybe_set_state_position_direction(this, TTC_BLUBBER_STATE_2_UNKNOWN, 0.0f, 1, 0.007f))
break; break;
func_80328FB0(this, 3.0f); func_80328FB0(this, 3.0f);
func_8038771C(this); func_8038771C(this);
func_80387830(this, 0.14f, 0.68f); func_80387830(this, 0.14f, 0.68f);
func_80387678(this); TTC_Blubber_checkJiggySpawnedTextAndAdvanceState(this);
break; break;
case 2:// 80387B10 case TTC_BLUBBER_STATE_2_UNKNOWN:
func_80387774(&this); func_80387774(&this);
if( actor_animationIsAt(this, 0.99f) if( actor_animationIsAt(this, 0.99f)
&& subaddie_maybe_set_state_position_direction(this, 1, 0.0f, 1, 0.78f) && subaddie_maybe_set_state_position_direction(this, TTC_BLUBBER_STATE_1_UNKNOWN, 0.0f, 1, 0.78f)
){ ){
this->actor_specific_1_f = 4.0f; this->actor_specific_1_f = 4.0f;
break; break;
@@ -204,18 +218,18 @@ void func_803878CC(Actor * this){
FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.91f, 17000, this->position, 1250, 2500); FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.91f, 17000, this->position, 1250, 2500);
} }
func_80387678(this); TTC_Blubber_checkJiggySpawnedTextAndAdvanceState(this);
break; break;
case 3: case TTC_BLUBBER_STATE_3_UNKNOWN:
break; break;
case 4:// 80387C04 case TTC_BLUBBER_STATE_4_UNKNOWN:
{ {
func_80328FB0(this, 3.0f); func_80328FB0(this, 3.0f);
local = (ActorLocal_Blubber*)&this->local; local = (ActorLocal_Blubber*)&this->local;
if(actor_animationIsAt(this, 0.99f) && !local->unk24){ if(actor_animationIsAt(this, 0.99f) && !local->unk24){
subaddie_set_state(this, 5); subaddie_set_state(this, TTC_BLUBBER_STATE_5_UNKNOWN);
this->actor_specific_1_f = 8.0f; this->actor_specific_1_f = 8.0f;
} }
} }
@@ -231,14 +245,14 @@ void func_803878CC(Actor * this){
} }
break; break;
case 5:// 80387CD4 case TTC_BLUBBER_STATE_5_UNKNOWN:
local = (ActorLocal_Blubber*)&this->local; local = (ActorLocal_Blubber*)&this->local;
func_8032A95C(this, local->unkE, 0x21c); func_8032A95C(this, local->unkE, 0x21c);
break; break;
} }
} }
void TTC_func_80387CF4(Actor *this){ void TTC_Blubber_update2Func(Actor *this){
func_80343DEC(this); func_80343DEC(this);
if(0.99 <= this->unk48){ if(0.99 <= this->unk48){
func_8028F918(0); func_8028F918(0);
@@ -248,7 +262,7 @@ void TTC_func_80387CF4(Actor *this){
func_80387830(this, 0.5f, 0.97f); func_80387830(this, 0.5f, 0.97f);
} }
Actor *func_80387D6C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ Actor *TTC_Blubber_drawFunc(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
func_8033A45C(4, 0); func_8033A45C(4, 0);
return actor_draw(marker, gfx, mtx, vtx); return actor_draw(marker, gfx, mtx, vtx);
} }

View File

@@ -6,7 +6,7 @@
#include "actor.h" #include "actor.h"
extern ActorInfo chClam; extern ActorInfo chClam;
extern ActorInfo TTC_D_8038C510; extern ActorInfo TTC_BLUBBER_ACTOR_INFO;
extern ActorInfo D_8038C580; extern ActorInfo D_8038C580;
extern ActorInfo D_8038C5E0; extern ActorInfo D_8038C5E0;
extern ActorInfo D_8038C604; extern ActorInfo D_8038C604;
@@ -94,7 +94,7 @@ void TTC_func_80388AC0(void)
spawnableActorList_add(&D_8038C5E0, actor_new, ACTOR_FLAG_NONE); spawnableActorList_add(&D_8038C5E0, actor_new, ACTOR_FLAG_NONE);
spawnableActorList_add(&D_8038C604, actor_new, ACTOR_FLAG_NONE); spawnableActorList_add(&D_8038C604, actor_new, ACTOR_FLAG_NONE);
spawnableActorList_add(&D_8038C580, 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(&D_8038C580, 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(&TTC_D_8038C510, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_26); spawnableActorList_add(&TTC_BLUBBER_ACTOR_INFO, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_26);
spawnableActorList_add(&D_8038C718, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_8); spawnableActorList_add(&D_8038C718, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_8);
spawnableActorList_add(&D_8038C790, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8); spawnableActorList_add(&D_8038C790, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8);
spawnableActorList_add(&D_8038C7B4, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8); spawnableActorList_add(&D_8038C7B4, actor_new, ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8);

View File

@@ -56,7 +56,7 @@ void bacarriedobj_spawn(enum actor_e actor_id){
void func_8028DEEC(enum actor_e actor_id, Actor *actor){ void func_8028DEEC(enum actor_e actor_id, Actor *actor){
f32 sp1C[3]; f32 sp1C[3];
nodeprop_getPosition(func_80304C38(actor_id, actor), sp1C); nodeprop_getPosition(nodeprop_findByActorIdAndActorPosition(actor_id, actor), sp1C);
set_throw_target_position(sp1C); set_throw_target_position(sp1C);
} }

View File

@@ -349,7 +349,7 @@ void chmole_update(Actor *this){
if(!this->initialized){ if(!this->initialized){
// Checks if player is within radius of a specific actor exists within the same cube // Checks if player is within radius of a specific actor exists within the same cube
// If actor exists and player is within radius, force trigger conversation // If actor exists and player is within radius, force trigger conversation
node_prop = func_80304C38(0x372, this); node_prop = nodeprop_findByActorIdAndActorPosition(0x372, this);
if(node_prop == NULL){ if(node_prop == NULL){
this->unk38_0 = FALSE; this->unk38_0 = FALSE;
} }
@@ -363,7 +363,7 @@ void chmole_update(Actor *this){
this->marker->collidable = FALSE; this->marker->collidable = FALSE;
this->initialized = TRUE; this->initialized = TRUE;
if(this->unkF4_8 == 0x12){ if(this->unkF4_8 == 0x12){
node_prop = func_80304C38(0x349, this); node_prop = nodeprop_findByActorIdAndActorPosition(0x349, this);
if(node_prop == NULL){ if(node_prop == NULL){
this->velocity[0] = this->position[0]; this->velocity[0] = this->position[0];
this->velocity[1] = this->position[1]; this->velocity[1] = this->position[1];

View File

@@ -142,7 +142,7 @@ void func_802CEEA4(Actor *this, Struct_core2_47BD0_0 *arg1) {
} }
void func_802CEF54(Actor *this, f32 arg1[3], f32 arg2){ void func_802CEF54(Actor *this, f32 arg1[3], f32 distance){
f32 sp34[3]; f32 sp34[3];
s32 phi_v1; s32 phi_v1;
s32 phi_v0; s32 phi_v0;
@@ -153,7 +153,7 @@ void func_802CEF54(Actor *this, f32 arg1[3], f32 arg2){
phi_v1 = (this->state == 5) ? 200 : 50; phi_v1 = (this->state == 5) ? 200 : 50;
phi_v0 = (this->state == 5) ? 200 : 100; phi_v0 = (this->state == 5) ? 200 : 100;
func_802CEDE4(sp34, this->unk1C, arg2, &this->actor_specific_1_f, (f32) phi_v1, (f32) phi_v0); func_802CEDE4(sp34, this->unk1C, distance, &this->actor_specific_1_f, (f32) phi_v1, (f32) phi_v0);
this->unk1C[0] = this->unk1C[0] + arg1[0]; this->unk1C[0] = this->unk1C[0] + arg1[0];
this->unk1C[1] = this->unk1C[1] + arg1[1]; this->unk1C[1] = this->unk1C[1] + arg1[1];
this->unk1C[2] = this->unk1C[2] + arg1[2]; this->unk1C[2] = this->unk1C[2] + arg1[2];

View File

@@ -2,13 +2,13 @@
#include "functions.h" #include "functions.h"
#include "variables.h" #include "variables.h"
s32 func_802E0970(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, bool arg5, f32 arg6[3]) { s32 func_802E0970(enum sfx_e sfxId, f32 arg1, f32 arg2, f32 arg3, s32 sampleRate, bool arg5, f32 position[3]) {
f32 temp_f0; f32 temp_f0;
f32 phi_f2; f32 phi_f2;
phi_f2 = (arg5) ? arg1 : arg2; phi_f2 = (arg5) ? arg1 : arg2;
temp_f0 = arg3 * 0.5; temp_f0 = arg3 * 0.5;
func_8030E878(arg0, randf2(phi_f2 - temp_f0, phi_f2 + temp_f0), arg4, arg6, 1000.0f, 2300.0f); func_8030E878(sfxId, randf2(phi_f2 - temp_f0, phi_f2 + temp_f0), sampleRate, position, 1000.0f, 2300.0f);
return NOT(arg5); return NOT(arg5);
} }

View File

@@ -995,7 +995,7 @@ NodeProp *cubeList_findNodePropByActorId(enum actor_e actor_id, s32 position[3])
return NULL; return NULL;
} }
NodeProp *func_80304C38(enum actor_e actor_id, Actor *actor){ NodeProp *nodeprop_findByActorIdAndActorPosition(enum actor_e actor_id, Actor *actor){
s32 tmp_position[3]; s32 tmp_position[3];
s32 *position; s32 *position;

View File

@@ -39,7 +39,7 @@ typedef struct {
u8 unk40; u8 unk40;
u8 unk41; u8 unk41;
u8 busy; u8 busy;
u8 unk43_7:3; u8 unk43_7:3; // value is set to 1, 2 or 3
u8 unk43_4:3; u8 unk43_4:3;
u8 unk43_1:2; u8 unk43_1:2;
}SfxSource; }SfxSource;
@@ -420,11 +420,11 @@ void func_8030D644(void){
} }
} }
void func_8030D6C4(enum sfx_e uid, f32 arg1, s32 arg2, s32 arg3, s32 arg4){ void func_8030D6C4(enum sfx_e uid, f32 arg1, s32 sampleRate, s32 arg3, s32 arg4){
u8 indx = sfxsource_createSfxsourceAndReturnIndex(); u8 indx = sfxsource_createSfxsourceAndReturnIndex();
if(indx){ if(indx){
sfxsource_setSfxId(indx, uid); sfxsource_setSfxId(indx, uid);
sfxsource_setSampleRate(indx, arg2); sfxsource_setSampleRate(indx, sampleRate);
sfxsource_playSfxAtVolume(indx, arg1); sfxsource_playSfxAtVolume(indx, arg1);
func_8030DCCC(indx, arg3); func_8030DCCC(indx, arg3);
func_8030DD14(indx, 1); func_8030DD14(indx, 1);
@@ -850,8 +850,8 @@ void func_8030E4E4(enum sfx_e uid){
func_8030D6C4(uid, 1.0f, 22000, 0, 0); func_8030D6C4(uid, 1.0f, 22000, 0, 0);
} }
void sfxsource_play(enum sfx_e uid, s32 sample_rate){ void sfxsource_play(enum sfx_e uid, s32 sampleRate){
func_8030D6C4(uid, 1.0f, sample_rate, 0, 2); func_8030D6C4(uid, 1.0f, sampleRate, 0, 2);
} }
void func_8030E540(enum sfx_e uid){ void func_8030E540(enum sfx_e uid){

View File

@@ -1932,7 +1932,7 @@ void func_8032A82C(Actor *arg0, s32 arg1) {
Actorlocal_Core2_9E370 *sp1C; Actorlocal_Core2_9E370 *sp1C;
sp1C = &arg0->local; sp1C = &arg0->local;
sp24 = func_80304C38(arg1, arg0); sp24 = nodeprop_findByActorIdAndActorPosition(arg1, arg0);
if (sp24 != NULL) { if (sp24 != NULL) {
sp1C->unkC = func_80304DA8(sp24); sp1C->unkC = func_80304DA8(sp24);
nodeprop_getPosition(sp24, sp1C->unk0); nodeprop_getPosition(sp24, sp1C->unk0);

View File

@@ -357,7 +357,7 @@ void chWarpCauldron_update(Actor *this) {
volatileFlag_set(VOLATILE_FLAG_1E, 0); volatileFlag_set(VOLATILE_FLAG_1E, 0);
func_802D677C(0); func_802D677C(0);
func_8028FCAC(); func_8028FCAC();
nodeprop_getPosition(func_80304C38(D_80393620[this->unkF4_8 - 1].unk6, this), sp54); nodeprop_getPosition(nodeprop_findByActorIdAndActorPosition(D_80393620[this->unkF4_8 - 1].unk6, this), sp54);
if (this->unkF4_8 == 7) { if (this->unkF4_8 == 7) {
func_8028F66C(BS_INTR_36_DINGPOT); func_8028F66C(BS_INTR_36_DINGPOT);
func_802BAFE4(0x82); func_802BAFE4(0x82);

View File

@@ -978,7 +978,7 @@ void func_80388450(Actor *actor1, Actor *actor2)
{ {
f32 vec1[3]; f32 vec1[3];
f32 vec2[3]; f32 vec2[3];
void *actor3 = func_80304C38(0x22A, actor1); void *actor3 = nodeprop_findByActorIdAndActorPosition(0x22A, actor1);
s32 val = func_80304DA8(actor3); s32 val = func_80304DA8(actor3);
actor2->yaw = val; actor2->yaw = val;

View File

@@ -35,7 +35,7 @@ void func_80392B6C(Actor *this) {
marker_despawn(this->marker); marker_despawn(this->marker);
return; return;
} }
phi_a0 = func_80304C38(0x3BE, this); phi_a0 = nodeprop_findByActorIdAndActorPosition(0x3BE, this);
if (this == NULL) { if (this == NULL) {
this->unk1C[0] = -1300.0f; this->unk1C[0] = -1300.0f;
this->unk1C[1] = 250.0f; this->unk1C[1] = 250.0f;