Merge branch 'mr-origin-66'
This commit is contained in:
commit
d876e71eba
|
@ -56,25 +56,31 @@ ActorInfo chcongaInfo = { MARKER_7_CONGA, ACTOR_8_CONGA, ASSET_35C_MODEL_CONGA,
|
|||
|
||||
|
||||
/* code */
|
||||
int func_80386ED0(Actor * this){
|
||||
f32 plyrPos[3];
|
||||
f32 tmpz;
|
||||
bool __chConga_isPlayerNearCongaTree(Actor * this){
|
||||
f32 plyr_pos[3];
|
||||
f32 unused_tmpz;
|
||||
|
||||
if(map_get() != MAP_2_MM_MUMBOS_MOUNTAIN)
|
||||
return 0;
|
||||
if (map_get() != MAP_2_MM_MUMBOS_MOUNTAIN) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(!this->unk10_12)
|
||||
return 0;
|
||||
if (!this->unk10_12) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
player_getPosition(plyrPos);
|
||||
if(plyrPos[1] < 300.0f || 600.0f < plyrPos[1])
|
||||
return 0;
|
||||
player_getPosition(plyr_pos);
|
||||
|
||||
tmpz = plyrPos[2]- 5029.0f;
|
||||
if(52900.0f < (plyrPos[0]- -5011.0f)*(plyrPos[0]- -5011.0f) + (plyrPos[2]- 5029.0f)*(plyrPos[2]- 5029.0f))
|
||||
return 0;
|
||||
if (plyr_pos[1] < 300.0f || 600.0f < plyr_pos[1]) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
unused_tmpz = plyr_pos[2] - 5029.0f;
|
||||
|
||||
if (52900.0f < (plyr_pos[0] - - 5011.0f)*(plyr_pos[0] - - 5011.0f) + (plyr_pos[2]- 5029.0f)*(plyr_pos[2] - 5029.0f)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void func_80386FB0(Actor *this){
|
||||
|
@ -82,7 +88,7 @@ void func_80386FB0(Actor *this){
|
|||
func_80328FB0(this, 3.0f);
|
||||
}
|
||||
|
||||
void func_80386FE8(void){
|
||||
void __chConga_playRandomNoise(void){
|
||||
if( (globalTimer_getTime() & 0xF) == 0xB
|
||||
&& 0.85 < randf ()
|
||||
&& !func_803114B0()
|
||||
|
@ -103,15 +109,14 @@ void func_803870D0(Actor *this, ActorMarker *arg1){
|
|||
void func_80387100(ActorMarker *this){
|
||||
ActorMarker *m = *(ActorMarker **)&this;
|
||||
Actor* actorPtr;
|
||||
f32 sp1C[3];
|
||||
f32 position[3];
|
||||
|
||||
actorPtr = marker_getActor(m);
|
||||
sp1C[0] = actorPtr->position_x;
|
||||
sp1C[1] = actorPtr->position_y + 60.0f;
|
||||
sp1C[2] = actorPtr->position_z;
|
||||
position[0] = actorPtr->position_x;
|
||||
position[1] = actorPtr->position_y + 60.0f;
|
||||
position[2] = actorPtr->position_z;
|
||||
func_802C8F70(0.0f);
|
||||
func_80333270(JIGGY_A_MM_CONGA, sp1C, func_803870D0, m);
|
||||
|
||||
func_80333270(JIGGY_A_MM_CONGA, position, func_803870D0, m);
|
||||
}
|
||||
|
||||
void func_80387168(ActorMarker *marker, ActorMarker *other_marker){
|
||||
|
@ -144,7 +149,6 @@ void func_80387168(ActorMarker *marker, ActorMarker *other_marker){
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int func_803872EC(void){
|
||||
|
@ -165,19 +169,19 @@ void func_80387370(ActorMarker *this, enum asset_e text_id, s32 arg2){
|
|||
func_80324E38(3.2f, 0);
|
||||
}
|
||||
|
||||
void func_803873C8(ActorMarker *congaMarker){
|
||||
void __chConga_sendOrangeProjectile(ActorMarker *congaMarker){
|
||||
ActorMarker *m = *(ActorMarker **)&congaMarker; //sp84
|
||||
Actor * congaPtr = marker_getActor(m); //sp80
|
||||
ActorLocal_Conga *conga_localPtr = (ActorLocal_Conga *)&congaPtr->local; //sp7C
|
||||
s32 conga_state = congaPtr->state;
|
||||
Actor * orangePtr;
|
||||
f32 pad0;
|
||||
f32 unused;
|
||||
TUPLE(f32, pos) plyr;
|
||||
f32 temp_f22;
|
||||
f32 temp_f20;
|
||||
f32 temp_f18;
|
||||
f32 iHeight;
|
||||
f32 iVelY;
|
||||
f32 simulation_count;
|
||||
f32 simulated_position_y;
|
||||
f32 simulated_velocity_y;
|
||||
|
||||
congaPtr->unk10_12 -= (congaPtr->unk10_12 && ( conga_state == 7));
|
||||
MM_func_80387F44();
|
||||
|
@ -189,6 +193,7 @@ void func_803873C8(ActorMarker *congaMarker){
|
|||
orangePtr->velocity_x = plyr.pos_x - orangePtr->position_x;
|
||||
orangePtr->velocity_y = (60.0)*((conga_state == 7) ? 0.5: 1.0);
|
||||
orangePtr->velocity_z = plyr.pos_z - orangePtr->position_z;
|
||||
|
||||
if(SQUARE(plyr.pos_z - m->propPtr->z) + SQUARE(plyr.pos_x - m->propPtr->x) < 40000.0f ){
|
||||
temp_f20 = randf2(2.4f, 4.4f); temp_f22 = randf2(2.4f, 4.4f); //f22
|
||||
orangePtr->velocity[0] *= (randf() < 0.5)? temp_f20 : -temp_f20;
|
||||
|
@ -196,19 +201,21 @@ void func_803873C8(ActorMarker *congaMarker){
|
|||
orangePtr->velocity[2] *= (randf() < 0.5)? temp_f22 : -temp_f22;
|
||||
}
|
||||
|
||||
iHeight = orangePtr->position_y;
|
||||
iVelY = orangePtr->velocity_y;
|
||||
for(temp_f18 = 0.0f; !(iHeight < plyr.pos_y && iVelY < 0.0f); temp_f18++){
|
||||
iHeight += (iVelY -= 5.0);
|
||||
simulated_position_y = orangePtr->position_y;
|
||||
simulated_velocity_y = orangePtr->velocity_y;
|
||||
|
||||
for(simulation_count = 0.0f; !(simulated_position_y < plyr.pos_y && simulated_velocity_y < 0.0f); simulation_count++){
|
||||
simulated_position_y += (simulated_velocity_y -= 5.0);
|
||||
}
|
||||
orangePtr->velocity_x /= temp_f18;
|
||||
orangePtr->velocity_z /= temp_f18;
|
||||
|
||||
orangePtr->velocity_x /= simulation_count;
|
||||
orangePtr->velocity_z /= simulation_count;
|
||||
}
|
||||
}
|
||||
|
||||
void func_803876D0(Actor *this){
|
||||
f32 tmp_f4;
|
||||
NodeProp *sp40;
|
||||
f32 unused;
|
||||
NodeProp *node_prop;
|
||||
s32 sp3C;
|
||||
|
||||
this->marker->propPtr->unk8_3 = (timedFuncQueue_is_empty(this))?1:0;
|
||||
|
@ -218,9 +225,9 @@ void func_803876D0(Actor *this){
|
|||
this->initialized = 1;
|
||||
this->velocity_x = 0.0f;
|
||||
this->unk28 = 0.0f;
|
||||
sp40 = func_80304C38(0x150, this);
|
||||
((ActorLocal_Conga *)&this->local)->unk1C = nodeprop_getRadius(sp40);
|
||||
func_80304D4C(sp40, &((ActorLocal_Conga *)&this->local)->unk10);
|
||||
node_prop = func_80304C38(0x150, this);
|
||||
((ActorLocal_Conga *)&this->local)->unk1C = nodeprop_getRadius(node_prop);
|
||||
func_80304D4C(node_prop, &((ActorLocal_Conga *)&this->local)->unk10);
|
||||
}
|
||||
if(0.0f == this->unk28){
|
||||
this->unk28 = (actorArray_findActorFromMarkerId(MARKER_36_ORANGE_COLLECTIBLE) != NULL)? 2.0f: 1.0f;
|
||||
|
@ -262,7 +269,7 @@ void func_803876D0(Actor *this){
|
|||
case 1://80387990
|
||||
actor_loopAnimation(this);
|
||||
func_80386FB0(this);
|
||||
func_80386FE8();
|
||||
__chConga_playRandomNoise();
|
||||
if(actor_animationIsAt(this, 0.0f) || actor_animationIsAt(this, 0.45f)){
|
||||
if(randf() < 0.2){
|
||||
animctrl_setDirection(this->animctrl, animctrl_isPlayedForwards(this->animctrl)?0:1);
|
||||
|
@ -273,7 +280,7 @@ void func_803876D0(Actor *this){
|
|||
}
|
||||
if( sp3C
|
||||
&& func_8028ECAC() != 1
|
||||
&& !func_80386ED0(this)
|
||||
&& !__chConga_isPlayerNearCongaTree(this)
|
||||
&& timedFuncQueue_is_empty()
|
||||
&& !func_8032A9E4(((ActorLocal_Conga *)&this->local)->unk10, ((ActorLocal_Conga *)&this->local)->unk18, ((ActorLocal_Conga *)&this->local)->unk1C)
|
||||
&& !func_803872EC()
|
||||
|
@ -281,7 +288,7 @@ void func_803876D0(Actor *this){
|
|||
subaddie_set_state_with_direction(this, 4, 0.0f, 1);
|
||||
}//L80387AC0
|
||||
if( func_8028ECAC() != 1
|
||||
&& func_80386ED0(this)
|
||||
&& __chConga_isPlayerNearCongaTree(this)
|
||||
&& this->unk38_31 != 0
|
||||
&& !func_803872EC()
|
||||
){
|
||||
|
@ -292,7 +299,7 @@ void func_803876D0(Actor *this){
|
|||
case 6: //L80387B24
|
||||
((ActorLocal_Conga *)&this->local)->unkC = 1;
|
||||
actor_playAnimationOnce(this);
|
||||
func_80386FE8();
|
||||
__chConga_playRandomNoise();
|
||||
if( animctrl_isPlayedForwards(this->animctrl) == TRUE
|
||||
&& actor_animationIsAt(this, 0.0f)
|
||||
){
|
||||
|
@ -308,7 +315,7 @@ void func_803876D0(Actor *this){
|
|||
case 5: //L80387BC0
|
||||
((ActorLocal_Conga *)&this->local)->unkC = 1;
|
||||
actor_loopAnimation(this);
|
||||
func_80386FE8();
|
||||
__chConga_playRandomNoise();
|
||||
if( actor_animationIsAt(this, 0.99f)){
|
||||
subaddie_maybe_set_state_position_direction(this, 6, 0.999f, 0, sp3C ? 1.0 : 0.4);
|
||||
}//L80387C30
|
||||
|
@ -326,7 +333,7 @@ void func_803876D0(Actor *this){
|
|||
func_80386FB0(this);
|
||||
if( !sp3C
|
||||
|| player_is_in_jiggy_jig()
|
||||
|| func_80386ED0(this)
|
||||
|| __chConga_isPlayerNearCongaTree(this)
|
||||
|| !timedFuncQueue_is_empty()
|
||||
|| func_803872EC()
|
||||
){
|
||||
|
@ -369,6 +376,6 @@ void func_803876D0(Actor *this){
|
|||
|| (this->state == 7 && actor_animationIsAt(this, 0.468f))
|
||||
){
|
||||
func_8034A1B4(this->marker->unk44, 5, &this->local);
|
||||
__spawnQueue_add_1((GenFunction_1)func_803873C8, (s32)this->marker); //spawn orange
|
||||
__spawnQueue_add_1((GenFunction_1)__chConga_sendOrangeProjectile, (s32)this->marker); //spawn orange
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,17 @@
|
|||
|
||||
#include "prop.h"
|
||||
|
||||
#ifndef HUT_STATE_INTACT
|
||||
#define HUT_STATE_INTACT 0
|
||||
#endif
|
||||
|
||||
#ifndef HUT_STATE_DAMAGED
|
||||
#define HUT_STATE_DAMAGED 1
|
||||
#endif
|
||||
|
||||
#ifndef HUT_STATE_DESTROYED
|
||||
#define HUT_STATE_DESTROYED 2
|
||||
#endif
|
||||
|
||||
/* extern function declarations */
|
||||
|
||||
|
@ -28,19 +38,19 @@ ActorAnimationInfo chhutAnimations[3] = {
|
|||
};
|
||||
|
||||
/* .code */
|
||||
Actor *chhut_draw(ActorMarker *this, Gfx **arg1, Mtx **arg2, Vtx **arg3){
|
||||
Actor *chhut_draw(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *actorPtr;
|
||||
s32 temp_a1;
|
||||
s32 temp_a2;
|
||||
s32 is_not_destroyed;
|
||||
s32 is_intact_or_destroyed;
|
||||
|
||||
actorPtr = marker_getActor(this);
|
||||
|
||||
temp_a1 = actorPtr->state != 2;
|
||||
temp_a2 = actorPtr->state == 0 || actorPtr->state == 2;
|
||||
this->propPtr->unk8_3 = temp_a2;
|
||||
func_8033A45C(1, temp_a1);
|
||||
is_not_destroyed = actorPtr->state != HUT_STATE_DESTROYED;
|
||||
is_intact_or_destroyed = actorPtr->state == HUT_STATE_INTACT || actorPtr->state == HUT_STATE_DESTROYED;
|
||||
this->propPtr->unk8_3 = is_intact_or_destroyed;
|
||||
func_8033A45C(1, is_not_destroyed);
|
||||
|
||||
return actor_draw(this, arg1, arg2, arg3);
|
||||
return actor_draw(this, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
void func_803869EC(ActorMarker *this){
|
||||
|
@ -56,8 +66,8 @@ void func_803869EC(ActorMarker *this){
|
|||
|
||||
void chhut_update(Actor *this){
|
||||
static s32 D_803898D8[6] = { 0, 1, 2, 3, 6, 4};
|
||||
f32 sp3C[3];
|
||||
f32 sp30[3];
|
||||
f32 diff_pos[3];
|
||||
f32 plyr_pos[3];
|
||||
|
||||
if(func_80334904() != 2)
|
||||
return;
|
||||
|
@ -67,42 +77,42 @@ void chhut_update(Actor *this){
|
|||
this->initialized = 1;
|
||||
}
|
||||
switch(this->state){
|
||||
case 0: //L80386AA4
|
||||
player_getPosition(sp30);
|
||||
sp3C[0] = sp30[0] - this->position_x;
|
||||
sp3C[1] = sp30[1] - this->position_y;
|
||||
sp3C[2] = sp30[2] - this->position_z;
|
||||
if(150.0f < sp3C[1]
|
||||
case HUT_STATE_INTACT:
|
||||
player_getPosition(plyr_pos);
|
||||
diff_pos[0] = plyr_pos[0] - this->position_x;
|
||||
diff_pos[1] = plyr_pos[1] - this->position_y;
|
||||
diff_pos[2] = plyr_pos[2] - this->position_z;
|
||||
if(150.0f < diff_pos[1]
|
||||
&& player_getActiveHitbox(this->marker) == HITBOX_1_BEAK_BUSTER
|
||||
&& func_8028F20C()
|
||||
&& gu_sqrtf(sp3C[0]*sp3C[0] + sp3C[1]*sp3C[1] + sp3C[2]*sp3C[2]) < 350.0f
|
||||
&& gu_sqrtf(diff_pos[0]*diff_pos[0] + diff_pos[1]*diff_pos[1] + diff_pos[2]*diff_pos[2]) < 350.0f
|
||||
){
|
||||
sp3C[0] = this->position_x;
|
||||
sp3C[1] = this->position_y;
|
||||
sp3C[2] = this->position_z;
|
||||
sp3C[1] += 125.0;
|
||||
diff_pos[0] = this->position_x;
|
||||
diff_pos[1] = this->position_y;
|
||||
diff_pos[2] = this->position_z;
|
||||
diff_pos[1] += 125.0;
|
||||
func_8030E484(SFX_5B_HEAVY_STUFF_FALLING);
|
||||
subaddie_set_state(this, 1);
|
||||
subaddie_set_state(this, HUT_STATE_DAMAGED);
|
||||
actor_playAnimationOnce(this);
|
||||
__spawnQueue_add_1((GenFunction_1)func_803869EC, (s32)this->marker);
|
||||
func_802C8F70(this->yaw);
|
||||
if(D_8037DCB0 < 5){
|
||||
__spawnQueue_add_4((GenFunction_4)func_802C4218, D_803898D8[D_8037DCB0], *(s32*)(&sp3C[0]),*(s32*)(&sp3C[1]),*(s32*)(&sp3C[2]));
|
||||
__spawnQueue_add_4((GenFunction_4)func_802C4218, D_803898D8[D_8037DCB0], *(s32*)(&diff_pos[0]),*(s32*)(&diff_pos[1]),*(s32*)(&diff_pos[2]));
|
||||
}
|
||||
else{
|
||||
jiggy_spawn(JIGGY_5_MM_HUTS, sp3C);
|
||||
jiggy_spawn(JIGGY_5_MM_HUTS, diff_pos);
|
||||
}
|
||||
D_8037DCB0 = ( D_8037DCB0 + 1 ) % 6;
|
||||
}
|
||||
break;
|
||||
case 1: //L80386C2C
|
||||
case HUT_STATE_DAMAGED:
|
||||
if(animctrl_getAnimTimer(this->animctrl) > 0.99){
|
||||
animctrl_setTransitionDuration(this->animctrl, 0.0f);
|
||||
subaddie_set_state(this, 2);
|
||||
subaddie_set_state(this, HUT_STATE_DESTROYED);
|
||||
this->position_y -= 160.0f;
|
||||
}
|
||||
break;
|
||||
case 2: //L80386C80
|
||||
case HUT_STATE_DESTROYED:
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,38 +46,40 @@ void func_80388FD0(Actor *this, f32 *arg1, f32 *arg2, s32 arg3){
|
|||
}
|
||||
|
||||
Actor* func_80389014(ActorMarker *this, Gfx **dl, Mtx **mPtr, Vtx **arg2){
|
||||
f32 sp34[3];
|
||||
f32 rotation[3];
|
||||
Actor * actorPtr;
|
||||
ActorLocal_Juju_2 *jujuPtr;
|
||||
|
||||
actorPtr = marker_getActorAndRotation(this, sp34);
|
||||
actorPtr = marker_getActorAndRotation(this, rotation);
|
||||
jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local;
|
||||
if(jujuPtr->unk0 != 2){
|
||||
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
|
||||
modelRender_draw(dl, mPtr, actorPtr->position, sp34, jujuPtr->unk14, NULL, marker_loadModelBin(this));
|
||||
modelRender_draw(dl, mPtr, actorPtr->position, rotation, jujuPtr->unk14, NULL, marker_loadModelBin(this));
|
||||
}
|
||||
return actorPtr;
|
||||
}
|
||||
|
||||
void func_803890A0(ActorMarker *arg0, s32 arg1){
|
||||
void func_803890A0(ActorMarker *marker, s32 arg1){
|
||||
int s1;
|
||||
Actor* actorPtr = marker_getActor(arg0);
|
||||
f32 sp5C[3];
|
||||
Actor* actorPtr = marker_getActor(marker);
|
||||
f32 position[3];
|
||||
s32 i;
|
||||
Actor* jujuPtr;
|
||||
|
||||
sp5C[0] = actorPtr->position_x;
|
||||
sp5C[1] = actorPtr->position_y;
|
||||
sp5C[2] = actorPtr->position_z;
|
||||
position[0] = actorPtr->position_x;
|
||||
position[1] = actorPtr->position_y;
|
||||
position[2] = actorPtr->position_z;
|
||||
for(i = 0; i < 4; i++){
|
||||
jujuPtr = func_8032813C(ACTOR_59_JUJU, actorPtr->position, actorPtr->yaw);
|
||||
jujuPtr->marker->collidable = 0;
|
||||
actorPtr = marker_getActor(arg0);
|
||||
actorPtr = marker_getActor(marker);
|
||||
func_80388DE8(actorPtr, i, jujuPtr);
|
||||
|
||||
s1 = (i >= arg1);
|
||||
func_80388FD0(jujuPtr, sp5C, actorPtr->position, (s1)? 1 : 2);
|
||||
func_80388FD0(jujuPtr, position, actorPtr->position, (s1)? 1 : 2);
|
||||
|
||||
if(s1){
|
||||
sp5C[1] += 250.0f;
|
||||
position[1] += 250.0f;
|
||||
}
|
||||
if(i == arg1){
|
||||
((ActorLocal_Juju_2 *)&jujuPtr->local)->unk18 = 1;
|
||||
|
|
|
@ -49,29 +49,32 @@ int func_80388B30(Actor *this, float arg1){
|
|||
return 0;
|
||||
}
|
||||
|
||||
void func_80388BEC(NodeProp *arg0, ActorMarker *arg1){
|
||||
f32 sp34;
|
||||
Actor *sp30;
|
||||
void func_80388BEC(NodeProp *node, ActorMarker *marker){
|
||||
f32 distance_to_closest_actor;
|
||||
Actor *closest_actor;
|
||||
Actor *temp_v0;
|
||||
f32 sp20[3];
|
||||
f32 position[3];
|
||||
|
||||
|
||||
sp20[0] = (f32)arg0->x;
|
||||
sp20[1] = (f32)arg0->y;
|
||||
sp20[2] = (f32)arg0->z;
|
||||
sp30 = actorArray_findClosestActorFromActorId(sp20, 0x11, -1, &sp34);
|
||||
if( sp30 != NULL
|
||||
&& !( sp34 > 500.0f )
|
||||
&& (sp30->state ==3)
|
||||
position[0] = (f32)node->x;
|
||||
position[1] = (f32)node->y;
|
||||
position[2] = (f32)node->z;
|
||||
|
||||
closest_actor = actorArray_findClosestActorFromActorId(position, 0x11, -1, &distance_to_closest_actor);
|
||||
|
||||
if( closest_actor != NULL
|
||||
&& !( distance_to_closest_actor > 500.0f )
|
||||
&& (closest_actor->state ==3)
|
||||
){
|
||||
temp_v0 = marker_getActor(((ActorLocal_JujuHitbox *)&sp30->local)->unk8[((ActorLocal_JujuHitbox *)&sp30->local)->unk4]);
|
||||
temp_v0 = marker_getActor(((ActorLocal_JujuHitbox *)&closest_actor->local)->unk8[((ActorLocal_JujuHitbox *)&closest_actor->local)->unk4]);
|
||||
|
||||
if(temp_v0 != NULL){
|
||||
if(func_80388B30(temp_v0, 90.0f)){
|
||||
sp30->state = 1;
|
||||
((ActorLocal_JujuHitbox *)&sp30->local)->unk4++;
|
||||
func_803892A8(((ActorLocal_JujuHitbox *)&sp30->local)->unk8);
|
||||
func_80353580(arg1);
|
||||
__spawnQueue_add_4((GenFunction_4)func_802C4140, 0x58, *(s32 *)&sp20[0], *(s32 *)&sp20[1], *(s32 *)&sp20[2]);
|
||||
closest_actor->state = 1;
|
||||
((ActorLocal_JujuHitbox *)&closest_actor->local)->unk4++;
|
||||
func_803892A8(((ActorLocal_JujuHitbox *)&closest_actor->local)->unk8);
|
||||
func_80353580(marker);
|
||||
__spawnQueue_add_4((GenFunction_4)func_802C4140, 0x58, *(s32 *)&position[0], *(s32 *)&position[1], *(s32 *)&position[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,19 +44,19 @@ void func_80388300(Actor **arg0){
|
|||
if(arg0);
|
||||
}
|
||||
|
||||
void MM_func_803883AC(Actor *this){
|
||||
f32 sp2C;
|
||||
f32 sp28;
|
||||
static D_80389A5C = 0;
|
||||
|
||||
void __chLMonkey_playRandomNoise(Actor *this){
|
||||
f32 scaled_noise_volume;
|
||||
f32 random_noise;
|
||||
static sNoiseCooldown = 0;
|
||||
|
||||
sp2C = ml_map_f(func_8032970C(this), 1000000.0f, 343000000.0f, 18000.0f, 0.0f);
|
||||
sp28 = randf();
|
||||
D_80389A5C--;
|
||||
if(D_80389A5C < 0){
|
||||
scaled_noise_volume = ml_map_f(func_8032970C(this), 1000000.0f, 343000000.0f, 18000.0f, 0.0f);
|
||||
random_noise = randf();
|
||||
sNoiseCooldown--;
|
||||
|
||||
if(sNoiseCooldown < 0){
|
||||
if(randf() < 0.2){
|
||||
D_80389A5C = 6;
|
||||
func_8030E6A4(((sp28 < 0.5) ? SFX_58_CHIMPY_NOISE_1 : SFX_59_CHIMPY_NOISE_2 ), randf()*0.25 + 0.85, sp2C);
|
||||
sNoiseCooldown = 6;
|
||||
func_8030E6A4(((random_noise < 0.5) ? SFX_58_CHIMPY_NOISE_1 : SFX_59_CHIMPY_NOISE_2 ), randf()*0.25 + 0.85, scaled_noise_volume);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ void chLMonkey_update(Actor *this){
|
|||
func_80343DEC(this);
|
||||
}else{//L80388630
|
||||
if(func_80329530(this, 700) && !func_803114B0()){
|
||||
MM_func_803883AC(this);
|
||||
__chLMonkey_playRandomNoise(this);
|
||||
}//L8038865C
|
||||
switch(this->state){
|
||||
case 1://L80388690
|
||||
|
|
|
@ -7,6 +7,14 @@
|
|||
#define MIN(s,t) ((s < t)?(s):(t))
|
||||
#endif
|
||||
|
||||
#ifndef ORANGE_FALLING_STATE
|
||||
#define ORANGE_FALLING_STATE 1
|
||||
#endif
|
||||
|
||||
#ifndef ORANGE_LANDED_STATE
|
||||
#define ORANGE_LANDED_STATE 2
|
||||
#endif
|
||||
|
||||
/* extern functions */
|
||||
f32 func_80309724(f32*);
|
||||
|
||||
|
@ -15,7 +23,7 @@ void MM_func_80387FF4(Actor *this);
|
|||
Actor* func_80388188(ActorMarker *, Gfx **, Mtx**, Vtx**);
|
||||
|
||||
/* .data */
|
||||
ActorInfo chorangeInfo = { MARKER_C_ORANGE_PROJECTILE, ACTOR_14_ORANGE_PROJECTILE, ASSET_2D2_MODEL_ORANGE,
|
||||
ActorInfo chorangeInfo = { MARKER_C_ORANGE_PROJECTILE, ACTOR_14_ORANGE_PROJECTILE, ASSET_2D2_MODEL_ORANGE,
|
||||
1, NULL,
|
||||
MM_func_80387FF4, func_80326224, func_80388188,
|
||||
0, 0, 0.6f, 0
|
||||
|
@ -25,7 +33,7 @@ f32 D_803899F4[3] = {0.0f,-8.0f, 0.0f};
|
|||
f32 D_80389A00[3] = {0.0f, 0.0f, 0.0f};
|
||||
|
||||
void func_80387F90(ActorMarker *arg0, ActorMarker *other_marker){
|
||||
if( !func_8028F22C(arg0)
|
||||
if( !func_8028F22C(arg0)
|
||||
&& !mapSpecificFlags_get(mapflag_mm_main_hit_with_orange)
|
||||
&& func_80311480(ASSET_B3A_TEXT_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL)
|
||||
){
|
||||
|
@ -36,34 +44,34 @@ void func_80387F90(ActorMarker *arg0, ActorMarker *other_marker){
|
|||
}
|
||||
|
||||
void MM_func_80387FF4(Actor * this){
|
||||
f32 temp_f2;
|
||||
f32 temp_f0;
|
||||
f32 ground_position_y;
|
||||
f32 velocity_y;
|
||||
|
||||
if(!this->initialized){
|
||||
this->marker->unk2C_1 = 1;
|
||||
marker_setCollisionScripts(this->marker, NULL, func_80387F90, NULL);
|
||||
}
|
||||
switch(this->state){
|
||||
case 1://L80388060
|
||||
case ORANGE_FALLING_STATE:
|
||||
this->position_x += this->velocity_x;
|
||||
temp_f0 = this->velocity_y - 5.0;
|
||||
this->velocity_y = temp_f0;
|
||||
this->position_y += temp_f0;
|
||||
velocity_y = this->velocity_y - 5.0;
|
||||
this->velocity_y = velocity_y;
|
||||
this->position_y += velocity_y;
|
||||
this->position_z += this->velocity_z;
|
||||
|
||||
|
||||
temp_f2 = func_80309724(this->position);
|
||||
if(this->position_y < temp_f2){
|
||||
this->position_y = temp_f2;
|
||||
this->unk1C_y = temp_f2;
|
||||
|
||||
ground_position_y = func_80309724(this->position);
|
||||
|
||||
if(this->position_y < ground_position_y){
|
||||
this->position_y = ground_position_y;
|
||||
this->unk1C_y = ground_position_y;
|
||||
func_8030E6D4(SFX_2F_ORANGE_SPLAT);
|
||||
|
||||
|
||||
this->unk28 = 1.0f;
|
||||
this->unk60 = 340.0f;
|
||||
this->state = 2;
|
||||
}
|
||||
break;
|
||||
case 2://L8038810C
|
||||
case ORANGE_LANDED_STATE:
|
||||
if(this->unk60 < 324.0){
|
||||
this->marker->collidable = 0;
|
||||
}
|
||||
|
@ -78,16 +86,16 @@ void MM_func_80387FF4(Actor * this){
|
|||
Actor *func_80388188(ActorMarker *this, Gfx **dl, Mtx **mptr, Vtx **vtx){
|
||||
Actor* actorPtr = actor_drawFullDepth(this, dl, mptr, vtx);
|
||||
f32 sp60[3] = D_803899F4;
|
||||
f32 sp54[3] = D_80389A00;
|
||||
f32 sp48[3];
|
||||
f32 rotation[3] = D_80389A00;
|
||||
f32 position[3];
|
||||
|
||||
if(actorPtr->state == 2){
|
||||
sp48[0] = actorPtr->position_x;
|
||||
sp48[1] = actorPtr->unk1C_y + 3.0f;
|
||||
sp48[2] = actorPtr->position_z;
|
||||
position[0] = actorPtr->position_x;
|
||||
position[1] = actorPtr->unk1C_y + 3.0f;
|
||||
position[2] = actorPtr->position_z;
|
||||
modelRender_setAlpha( (s32) MIN(255.0f, actorPtr->unk60) );
|
||||
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
|
||||
modelRender_draw(dl, mptr, sp48, sp54, actorPtr->unk28, sp60, func_8030A428(0x18));
|
||||
modelRender_draw(dl, mptr, position, rotation, actorPtr->unk28, sp60, func_8030A428(0x18));
|
||||
actorPtr->position_y -= 1.9;
|
||||
if(actorPtr->unk28 < 2.428){
|
||||
actorPtr->unk28 += 0.1;
|
||||
|
|
|
@ -27,64 +27,67 @@ void MM_func_803863F0(s32 x, s32 y, s32 z){
|
|||
jiggy_spawn(JIGGY_8_MM_ORANGE_PADS, pos);
|
||||
}
|
||||
|
||||
void func_80386444(ActorMarker *arg0){
|
||||
f32 orange_pad_distance;
|
||||
Actor *orange_pad;
|
||||
f32 sp44[3];
|
||||
ParticleEmitter *s0;
|
||||
void func_80386444(ActorMarker *marker){
|
||||
f32 distance_to_orange_pad;
|
||||
Actor *closest_orange_pad;
|
||||
f32 position[3];
|
||||
ParticleEmitter *p_ctrl;
|
||||
s32 temp_a0;
|
||||
|
||||
sp44[0] = arg0->propPtr->x;
|
||||
sp44[1] = arg0->propPtr->y;
|
||||
sp44[2] = arg0->propPtr->z;
|
||||
orange_pad = actorArray_findClosestActorFromActorId(sp44, ACTOR_57_ORANGE_PAD, 1, &orange_pad_distance);
|
||||
position[0] = marker->propPtr->x;
|
||||
position[1] = marker->propPtr->y;
|
||||
position[2] = marker->propPtr->z;
|
||||
|
||||
closest_orange_pad = actorArray_findClosestActorFromActorId(position, ACTOR_57_ORANGE_PAD, 1, &distance_to_orange_pad);
|
||||
|
||||
|
||||
if(orange_pad && !(500.0f < orange_pad_distance)){
|
||||
orange_pad->state = 1;
|
||||
if(actorArray_findClosestActorFromActorId(sp44, ACTOR_57_ORANGE_PAD, 1, &orange_pad_distance)){
|
||||
if(closest_orange_pad && !(500.0f < distance_to_orange_pad)){
|
||||
closest_orange_pad->state = 1;
|
||||
|
||||
if(actorArray_findClosestActorFromActorId(position, ACTOR_57_ORANGE_PAD, 1, &distance_to_orange_pad)){
|
||||
func_8025A6EC(COMUSIC_2B_DING_B, 22000);
|
||||
}else{
|
||||
temp_a0 = (orange_pad->unk78_13 == 0x106) ? 0x10
|
||||
: (orange_pad->unk78_13 == 0x76) ? 0xf
|
||||
temp_a0 = (closest_orange_pad->unk78_13 == 0x106) ? 0x10
|
||||
: (closest_orange_pad->unk78_13 == 0x76) ? 0xf
|
||||
: 0xe;
|
||||
|
||||
func_802BAFE4(temp_a0);
|
||||
sp44[1] += 50.0f;
|
||||
timedFunc_set_3(0.6f, (GenFunction_3) MM_func_803863F0, (s32)sp44[0], (s32)sp44[1], (s32)sp44[2]);
|
||||
position[1] += 50.0f;
|
||||
timedFunc_set_3(0.6f, (GenFunction_3) MM_func_803863F0, (s32)position[0], (s32)position[1], (s32)position[2]);
|
||||
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF);
|
||||
|
||||
if(!jiggyscore_isCollected(JIGGY_8_MM_ORANGE_PADS)){
|
||||
func_80311480(0xB3B, 4, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
}// L803865D8
|
||||
|
||||
//emmit sparkles
|
||||
s0 = partEmitMgr_newEmitter(30);
|
||||
particleEmitter_setPosition(s0, orange_pad->position);
|
||||
particleEmitter_setModel(s0, 0x89f);
|
||||
func_802EFB70(s0, 0.09f, 0.19f);
|
||||
func_802EFB84(s0, 0.0f, 0.0f);
|
||||
// Emmit sparkles
|
||||
p_ctrl = partEmitMgr_newEmitter(30);
|
||||
particleEmitter_setPosition(p_ctrl, closest_orange_pad->position);
|
||||
particleEmitter_setModel(p_ctrl, 0x89f);
|
||||
func_802EFB70(p_ctrl, 0.09f, 0.19f);
|
||||
func_802EFB84(p_ctrl, 0.0f, 0.0f);
|
||||
|
||||
particleEmitter_setParticleVelocityRange(s0,
|
||||
particleEmitter_setParticleVelocityRange(p_ctrl,
|
||||
-200.0f, 500.0f, -200.0f,
|
||||
200.0f, 700.0f, 200.0f
|
||||
);
|
||||
|
||||
particleEmitter_setParticleAccelerationRange(s0,
|
||||
particleEmitter_setParticleAccelerationRange(p_ctrl,
|
||||
0.0f, -1200.0f, 0.0f,
|
||||
0.0f, -1200.0f, 0.0f
|
||||
);
|
||||
|
||||
particleEmitter_setAngularVelocityRange(s0,
|
||||
particleEmitter_setAngularVelocityRange(p_ctrl,
|
||||
-600.0f, -600.0f, -600.0f,
|
||||
600.0f, 600.0f, 600.0f
|
||||
);
|
||||
particleEmitter_setSpawnIntervalRange(s0, 0.0f, 0.01f);
|
||||
particleEmitter_setParticleLifeTimeRange(s0, 4.0f, 4.0f);
|
||||
func_802EF9F8(s0, 0.01f);
|
||||
func_802EFA18(s0, 3);
|
||||
func_802EFA20(s0, 1.0f, 1.3f);
|
||||
particleEmitter_emitN(s0, 30);
|
||||
particleEmitter_setSpawnIntervalRange(p_ctrl, 0.0f, 0.01f);
|
||||
particleEmitter_setParticleLifeTimeRange(p_ctrl, 4.0f, 4.0f);
|
||||
func_802EF9F8(p_ctrl, 0.01f);
|
||||
func_802EFA18(p_ctrl, 3);
|
||||
func_802EFA20(p_ctrl, 1.0f, 1.3f);
|
||||
particleEmitter_emitN(p_ctrl, 30);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,9 +96,9 @@ void func_80386744(s32 arg0, ActorMarker *arg1) {
|
|||
}
|
||||
|
||||
void func_80386768(Actor * this){
|
||||
Actor *sp3C;
|
||||
f32 pad;
|
||||
f32 sp34;
|
||||
Actor *closest_actor;
|
||||
f32 unused;
|
||||
f32 min_distance;
|
||||
|
||||
|
||||
if(!this->initialized){
|
||||
|
@ -105,33 +108,34 @@ void func_80386768(Actor * this){
|
|||
}//L803867B0
|
||||
|
||||
if(!this->unk16C_4){
|
||||
this->unk100 = actorArray_findClosestActorFromActorId(this->position, 8,-1, &sp34)->marker;
|
||||
this->unk100 = actorArray_findClosestActorFromActorId(this->position, 8,-1, &min_distance)->marker;
|
||||
this->unk16C_4 = 1;
|
||||
}//L803867E0
|
||||
|
||||
if(this->unk100){
|
||||
sp3C = marker_getActor(this->unk100);
|
||||
closest_actor = marker_getActor(this->unk100);
|
||||
}
|
||||
|
||||
if( func_80329530(this, 0x28)
|
||||
&& !func_8028ECAC()
|
||||
&& !mapSpecificFlags_get(6)
|
||||
&& sp3C->state != 3
|
||||
&& closest_actor->state != 3
|
||||
){
|
||||
if(func_80311480(0xb3d, 0, NULL, NULL, NULL, NULL))
|
||||
if(func_80311480(0xb3d, 0, NULL, NULL, NULL, NULL)) {
|
||||
mapSpecificFlags_set(6,1);
|
||||
}
|
||||
}
|
||||
|
||||
if(this->state == 1){
|
||||
if(this->unk60 < 72.0f){
|
||||
func_8033E73C(this->marker, 5, func_80329904);
|
||||
func_8033E3F0(9, this->marker->unk14_21);
|
||||
}
|
||||
this->unk60 = MIN(255.0, this->unk60 + 7.0);
|
||||
if(this->unk60 < 72.0f){
|
||||
func_8033E73C(this->marker, 5, func_80329904);
|
||||
func_8033E3F0(9, this->marker->unk14_21);
|
||||
}
|
||||
this->unk60 = MIN(255.0, this->unk60 + 7.0);
|
||||
|
||||
if(255.0 == this->unk60){
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
if(255.0 == this->unk60){
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
}else{
|
||||
}//L80386928
|
||||
|
||||
|
|
|
@ -315,16 +315,16 @@ f32 func_8028E904(void){
|
|||
return func_802915D8();
|
||||
}
|
||||
|
||||
f32 func_8028E924(f32 arg0[3], s32 arg1){
|
||||
f32 func_8028E924(f32 pos[3], s32 arg1){
|
||||
s32 *sp1C;
|
||||
|
||||
baModel_80292284(arg0, arg1);
|
||||
baModel_80292284(pos, arg1);
|
||||
baMarker_8028D6F0(&sp1C);
|
||||
return (f32) sp1C[arg1];
|
||||
}
|
||||
|
||||
void func_8028E964(f32 arg0[3]){
|
||||
func_8028E924(arg0, 0);
|
||||
void func_8028E964(f32 pos[3]){
|
||||
func_8028E924(pos, 0);
|
||||
}
|
||||
|
||||
f32 func_8028E984(void){
|
||||
|
|
|
@ -994,21 +994,24 @@ NodeProp *cubeList_findNodePropByActorId(enum actor_e actor_id, s32 position[3])
|
|||
return NULL;
|
||||
}
|
||||
|
||||
NodeProp *func_80304C38(enum actor_e actor_id, Actor *arg1){
|
||||
s32 vec[3];
|
||||
s32 *phi_a1;
|
||||
NodeProp *func_80304C38(enum actor_e actor_id, Actor *actor){
|
||||
s32 tmp_position[3];
|
||||
s32 *position;
|
||||
|
||||
if (arg1 != NULL) {
|
||||
vec[0] = arg1->position_x;
|
||||
vec[1] = arg1->position_y;
|
||||
vec[2] = arg1->position_z;
|
||||
if (actor != NULL) {
|
||||
tmp_position[0] = actor->position_x;
|
||||
tmp_position[1] = actor->position_y;
|
||||
tmp_position[2] = actor->position_z;
|
||||
}
|
||||
if (arg1 == NULL) {
|
||||
phi_a1 = NULL;
|
||||
} else {
|
||||
phi_a1 = vec;
|
||||
|
||||
if (actor == NULL) {
|
||||
position = NULL;
|
||||
}
|
||||
return cubeList_findNodePropByActorId(actor_id, phi_a1);
|
||||
else {
|
||||
position = tmp_position;
|
||||
}
|
||||
|
||||
return cubeList_findNodePropByActorId(actor_id, position);
|
||||
}
|
||||
|
||||
NodeProp *func_80304CAC(s32 arg0, f32 *arg1) {
|
||||
|
|
|
@ -1569,11 +1569,11 @@ bool func_803296D8(Actor *this, s32 dist){
|
|||
|
||||
s32 func_8032970C(Actor *this){
|
||||
f32 sp24[3];
|
||||
f32 sp18[3];
|
||||
f32 plyr_pos[3];
|
||||
|
||||
func_8028E964(sp24);
|
||||
_player_getPosition(sp18);
|
||||
sp24[1] = sp18[1];
|
||||
_player_getPosition(plyr_pos);
|
||||
sp24[1] = plyr_pos[1];
|
||||
return (s32) DIST_SQ_VEC3F(this->position, sp24);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue