Renaming Juju
This commit is contained in:
@@ -255,9 +255,9 @@ void func_803876D0(Actor *this){
|
||||
mapSpecificFlags_set(MM_SPECIFIC_FLAG_A_UNKNOWN, TRUE);
|
||||
}//L803878F8
|
||||
|
||||
if( sp3C && !this->is_first_encounter){
|
||||
if( sp3C && !this->has_met_before){
|
||||
if(gcdialog_showText((player_getTransformation()== TRANSFORM_2_TERMITE) ? ASSET_B3E_TEXT_CONGA_MEET_AS_TERMITE : ASSET_B3C_TEXT_CONGA_MEET, 0, this->position, 0,0,0)){
|
||||
this->is_first_encounter = TRUE;
|
||||
this->has_met_before = TRUE;
|
||||
}
|
||||
} //L80387968
|
||||
|
||||
|
@@ -79,7 +79,7 @@ void chhut_update(Actor *this) {
|
||||
diff_pos[2] = this->position_z;
|
||||
diff_pos[1] += 125.0;
|
||||
|
||||
func_8030E484(SFX_5B_HEAVY_STUFF_FALLING);
|
||||
sfxsource_playHighPriority(SFX_5B_HEAVY_STUFF_FALLING);
|
||||
subaddie_set_state(this, HUT_STATE_1_DAMAGED);
|
||||
actor_playAnimationOnce(this);
|
||||
__spawnQueue_add_1((GenFunction_1) __chhut_spawnExplosion, (s32) this->marker);
|
||||
|
283
src/MM/ch/juju.c
283
src/MM/ch/juju.c
@@ -3,91 +3,106 @@
|
||||
#include "variables.h"
|
||||
|
||||
/* extern functions */
|
||||
int func_80353064(f32*, f32);
|
||||
void func_802BB3DC(s32, f32, f32);
|
||||
int func_80353064(f32 *, f32);
|
||||
void func_802BB3DC(s32, f32, f32);
|
||||
|
||||
typedef struct{
|
||||
s32 unk0;
|
||||
s32 unk4;
|
||||
TUPLE(f32, unk8);
|
||||
f32 unk14;
|
||||
s32 unk18;
|
||||
}ActorLocal_Juju_2;
|
||||
typedef struct {
|
||||
s32 animation_state;
|
||||
s32 animation_countdown;
|
||||
TUPLE(f32, next_pos);
|
||||
f32 scale;
|
||||
s32 unk18;
|
||||
} ActorLocal_Juju_2;
|
||||
|
||||
/* public functions */
|
||||
void func_80389598(Actor *this);
|
||||
Actor* func_80389014(ActorMarker *, Gfx **, Mtx**, Vtx** );
|
||||
void chjuju_update(Actor *this);
|
||||
Actor *chjuju_draw(ActorMarker *, Gfx **, Mtx **, Vtx **);
|
||||
|
||||
/* .bss */
|
||||
u8 MM_pad_80389C80[0x10];
|
||||
s32 MM_D_80389C90;
|
||||
s32 mm_juju_count;
|
||||
|
||||
/* .data */
|
||||
ActorInfo chjujuInfo = { MARKER_67_JUJU, ACTOR_59_JUJU, ASSET_2E6_MODEL_JUJU,
|
||||
enum chjuju_animation_state_e {
|
||||
JUJU_ANIMATION_STATE_1_YAWING = 1,
|
||||
JUJU_ANIMATION_STATE_2_DESPAWNED,
|
||||
JUJU_ANIMATION_STATE_3_WAITING_TO_FALL,
|
||||
JUJU_ANIMATION_STATE_4_FALLING,
|
||||
JUJU_ANIMATION_STATE_5_DISAPPEARING
|
||||
};
|
||||
|
||||
ActorInfo chjujuInfo = {
|
||||
MARKER_67_JUJU, ACTOR_59_JUJU, ASSET_2E6_MODEL_JUJU,
|
||||
0, NULL,
|
||||
func_80389598, func_80326224, func_80389014,
|
||||
chjuju_update, func_80326224, chjuju_draw,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
void func_80388FD0(Actor *this, f32 *arg1, f32 *arg2, s32 arg3){
|
||||
/* .code */
|
||||
void __chjuju_initialize(Actor *this, f32 *arg1, f32 *arg2, s32 animationState) {
|
||||
ActorLocal_Juju_2 *local;
|
||||
|
||||
local = (ActorLocal_Juju_2 *)&this->local;
|
||||
local->unk0 = arg3;
|
||||
local->unk14 = 1.0f;
|
||||
local = (ActorLocal_Juju_2 *) &this->local;
|
||||
local->animation_state = animationState;
|
||||
local->scale = 1.0f;
|
||||
|
||||
this->position_x = arg1[0];
|
||||
this->position_y = arg1[1];
|
||||
this->position_z = arg1[2];
|
||||
|
||||
local->unk8_x = arg2[0];
|
||||
local->unk8_y = arg2[1];
|
||||
local->unk8_z = arg2[2];
|
||||
|
||||
local->next_pos_x = arg2[0];
|
||||
local->next_pos_y = arg2[1];
|
||||
local->next_pos_z = arg2[2];
|
||||
}
|
||||
|
||||
Actor* func_80389014(ActorMarker *this, Gfx **dl, Mtx **mPtr, Vtx **arg2){
|
||||
Actor *chjuju_draw(ActorMarker *this, Gfx **dl, Mtx **mPtr, Vtx **arg2) {
|
||||
f32 rotation[3];
|
||||
Actor * actorPtr;
|
||||
Actor *actorPtr;
|
||||
ActorLocal_Juju_2 *jujuPtr;
|
||||
|
||||
actorPtr = marker_getActorAndRotation(this, rotation);
|
||||
jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local;
|
||||
if(jujuPtr->unk0 != 2){
|
||||
jujuPtr = (ActorLocal_Juju_2 *) &actorPtr->local;
|
||||
|
||||
if (jujuPtr->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) {
|
||||
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
|
||||
modelRender_draw(dl, mPtr, actorPtr->position, rotation, jujuPtr->unk14, NULL, marker_loadModelBin(this));
|
||||
modelRender_draw(dl, mPtr, actorPtr->position, rotation, jujuPtr->scale, NULL, marker_loadModelBin(this));
|
||||
}
|
||||
|
||||
return actorPtr;
|
||||
}
|
||||
|
||||
void func_803890A0(ActorMarker *marker, s32 arg1){
|
||||
int s1;
|
||||
Actor* actorPtr = marker_getActor(marker);
|
||||
void __chjuju_initialize_all(ActorMarker *marker, s32 count) {
|
||||
int should_spawn;
|
||||
Actor *actorPtr = marker_getActor(marker);
|
||||
f32 position[3];
|
||||
s32 i;
|
||||
Actor* jujuPtr;
|
||||
Actor *jujuPtr;
|
||||
|
||||
position[0] = actorPtr->position_x;
|
||||
position[1] = actorPtr->position_y;
|
||||
position[2] = actorPtr->position_z;
|
||||
for(i = 0; i < 4; i++){
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
jujuPtr = spawn_actor_f32(ACTOR_59_JUJU, actorPtr->position, actorPtr->yaw);
|
||||
jujuPtr->marker->collidable = FALSE;
|
||||
|
||||
actorPtr = marker_getActor(marker);
|
||||
func_80388DE8(actorPtr, i, jujuPtr);
|
||||
chjujuhitbox_setJuju(actorPtr, i, jujuPtr);
|
||||
|
||||
s1 = (i >= arg1);
|
||||
func_80388FD0(jujuPtr, position, actorPtr->position, (s1)? 1 : 2);
|
||||
should_spawn = (i >= count);
|
||||
__chjuju_initialize(jujuPtr, position, actorPtr->position, should_spawn ? JUJU_ANIMATION_STATE_1_YAWING : JUJU_ANIMATION_STATE_2_DESPAWNED);
|
||||
|
||||
if(s1){
|
||||
if (should_spawn) {
|
||||
position[1] += 250.0f;
|
||||
}
|
||||
if(i == arg1){
|
||||
((ActorLocal_Juju_2 *)&jujuPtr->local)->unk18 = 1;
|
||||
|
||||
if (i == count) {
|
||||
((ActorLocal_Juju_2 *) &jujuPtr->local)->unk18 = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_803891E8(s32 x, s32 y, s32 z, s32 yaw){
|
||||
void __chjuju_spawnJiggy(s32 x, s32 y, s32 z, s32 yaw) {
|
||||
f32 sp1C[3];
|
||||
sp1C[0] = x;
|
||||
sp1C[1] = y + 0x14;
|
||||
@@ -95,13 +110,13 @@ void func_803891E8(s32 x, s32 y, s32 z, s32 yaw){
|
||||
jiggy_spawn(JIGGY_4_MM_JUJU, sp1C);
|
||||
}
|
||||
|
||||
void func_80389244(s32 x, s32 y, s32 z, s32 yaw){
|
||||
__spawnQueue_add_4((GenFunction_4)func_803891E8, x, y, z, yaw);
|
||||
void __chjuju_solvePuzzle(s32 x, s32 y, s32 z, s32 yaw) {
|
||||
__spawnQueue_add_4((GenFunction_4) __chjuju_spawnJiggy, x, y, z, yaw);
|
||||
func_802BB3DC(0, 10.0f, 0.8f);
|
||||
gcpausemenu_80314AC8(1);
|
||||
}
|
||||
|
||||
void func_803892A8(ActorMarker **ptr){
|
||||
void func_803892A8(ActorMarker **ptr) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 s2;
|
||||
@@ -109,123 +124,141 @@ void func_803892A8(ActorMarker **ptr){
|
||||
Actor *actorPtr;
|
||||
ActorLocal_Juju_2 *jujuPtr;
|
||||
|
||||
for(i = 0; i < 4; i++){
|
||||
for (i = 0; i < 4; i++) {
|
||||
actorPtr = marker_getActor(ptr[i]);
|
||||
jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local;
|
||||
if(jujuPtr->unk0 != 2){
|
||||
jujuPtr->unk0 = 5;
|
||||
jujuPtr->unk4 = 0xC;
|
||||
func_8030E484(0x3f6);
|
||||
if(i == 3){
|
||||
jujuPtr = (ActorLocal_Juju_2 *) &actorPtr->local;
|
||||
|
||||
if (jujuPtr->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) {
|
||||
jujuPtr->animation_state = JUJU_ANIMATION_STATE_5_DISAPPEARING;
|
||||
jujuPtr->animation_countdown = 12;
|
||||
sfxsource_playHighPriority(0x3f6);
|
||||
|
||||
if (i == 3) {
|
||||
gcpausemenu_80314AC8(0);
|
||||
timedFunc_set_4(1.25f, func_80389244, jujuPtr->unk8_x, jujuPtr->unk8_y, jujuPtr->unk8_z, actorPtr->yaw);
|
||||
timedFunc_set_4(1.25f, __chjuju_solvePuzzle, jujuPtr->next_pos_x, jujuPtr->next_pos_y, jujuPtr->next_pos_z, actorPtr->yaw);
|
||||
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x6d60);
|
||||
}
|
||||
else{//L80389384
|
||||
else {//L80389384
|
||||
func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff);
|
||||
}
|
||||
for(s2 = 3, j = i + 1; j < 4; s2+=5, j++){
|
||||
actorPtr = marker_getActor(ptr[j]);
|
||||
jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local;
|
||||
if(j == i+1){
|
||||
jujuPtr->unk18 = 1;
|
||||
}
|
||||
jujuPtr->unk4 = s2;
|
||||
jujuPtr->unk0 = 3;
|
||||
|
||||
for (s2 = 3, j = i + 1; j < 4; s2 += 5, j++) {
|
||||
actorPtr = marker_getActor(ptr[j]);
|
||||
jujuPtr = (ActorLocal_Juju_2 *) &actorPtr->local;
|
||||
|
||||
if (j == i + 1) {
|
||||
jujuPtr->unk18 = TRUE;
|
||||
}
|
||||
|
||||
jujuPtr->animation_countdown = s2;
|
||||
jujuPtr->animation_state = JUJU_ANIMATION_STATE_3_WAITING_TO_FALL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int func_8038941C(ActorMarker **ptr){
|
||||
bool __chjuju_isEveryJujuDespawned(ActorMarker **ptr) {
|
||||
s32 i;
|
||||
ActorLocal_Juju_2 *jujuPtr;
|
||||
|
||||
for(i = 0; i < 4; i++){
|
||||
jujuPtr = (ActorLocal_Juju_2 *)&marker_getActor(ptr[i])->local;
|
||||
if(jujuPtr->unk0 != 2)
|
||||
return 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
jujuPtr = (ActorLocal_Juju_2 *) &marker_getActor(ptr[i])->local;
|
||||
|
||||
if (jujuPtr->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int func_8038948C(ActorMarker **ptr){
|
||||
bool __chjuju_isEveryJujuStable(ActorMarker **ptr) {
|
||||
s32 i;
|
||||
ActorLocal_Juju_2 *jujuPtr;
|
||||
|
||||
for(i = 0; i < 4; i++){
|
||||
jujuPtr = (ActorLocal_Juju_2 *)&marker_getActor(ptr[i])->local;
|
||||
if(jujuPtr->unk0 != 1 && jujuPtr->unk0 != 2)
|
||||
return 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
jujuPtr = (ActorLocal_Juju_2 *) &marker_getActor(ptr[i])->local;
|
||||
|
||||
if (jujuPtr->animation_state != JUJU_ANIMATION_STATE_1_YAWING && jujuPtr->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void func_80389514(ActorMarker **ptr){
|
||||
void __chjuju_updateCount(ActorMarker **ptr) {
|
||||
s32 i;
|
||||
MM_D_80389C90 = 0;
|
||||
for(i = 0; i < 4; i++){
|
||||
if(((ActorLocal_Juju_2 *)&marker_getActor(ptr[i])->local)->unk0 != 2){
|
||||
MM_D_80389C90++;
|
||||
};
|
||||
mm_juju_count = 0;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (((ActorLocal_Juju_2 *) &marker_getActor(ptr[i])->local)->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) {
|
||||
mm_juju_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80389598(Actor *this){
|
||||
ActorLocal_Juju_2 *jujuPtr = (ActorLocal_Juju_2 *)&this->local;
|
||||
s32 sp38 = 0;
|
||||
f32 sp34;
|
||||
f32 sp28[3];
|
||||
|
||||
this->marker->propPtr->unk8_3 = (jujuPtr->unk0 != 2) && (jujuPtr->unk0 != 5);
|
||||
void chjuju_update(Actor *this) {
|
||||
ActorLocal_Juju_2 *jujuPtr = (ActorLocal_Juju_2 *) &this->local;
|
||||
s32 has_completed_full_turn = FALSE;
|
||||
f32 previous_yaw;
|
||||
f32 pos_offset[3];
|
||||
|
||||
switch(jujuPtr->unk0){
|
||||
case 1: //L80389624
|
||||
sp34 = this->yaw;
|
||||
this->yaw += ((0xb - MM_D_80389C90*2)*time_getDelta()*60.0f)/2;
|
||||
if(360.0f < this->yaw){
|
||||
sp38 = 1;
|
||||
this->marker->propPtr->unk8_3 = (jujuPtr->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) && (jujuPtr->animation_state != JUJU_ANIMATION_STATE_5_DISAPPEARING);
|
||||
|
||||
switch (jujuPtr->animation_state) {
|
||||
case JUJU_ANIMATION_STATE_1_YAWING: //L80389624
|
||||
previous_yaw = this->yaw;
|
||||
this->yaw += ((11 - mm_juju_count * 2) * time_getDelta() * 60.0f) / 2;
|
||||
|
||||
if (360.0f < this->yaw) {
|
||||
has_completed_full_turn = TRUE;
|
||||
this->yaw -= 360.0f;
|
||||
}//L803896B4
|
||||
if(jujuPtr->unk18){
|
||||
if(sp38 || (sp34 < 180.0f && 180.0f <= this->yaw)){
|
||||
mapSpecificFlags_set(MM_SPECIFIC_FLAG_9_UNKNOWN, TRUE);
|
||||
|
||||
if (jujuPtr->unk18 && (has_completed_full_turn || (previous_yaw < 180.0f && 180.0f <= this->yaw))) {
|
||||
mapSpecificFlags_set(MM_SPECIFIC_FLAG_9_JUJU_HAS_HALF_TURNED, TRUE);
|
||||
}
|
||||
break;
|
||||
|
||||
case JUJU_ANIMATION_STATE_3_WAITING_TO_FALL: //L80389700
|
||||
if (--jujuPtr->animation_countdown == 0) {
|
||||
jujuPtr->animation_state = JUJU_ANIMATION_STATE_4_FALLING;
|
||||
jujuPtr->next_pos_y = this->position_y - 250.0f;
|
||||
}
|
||||
break;
|
||||
|
||||
case JUJU_ANIMATION_STATE_5_DISAPPEARING: //L80389738
|
||||
jujuPtr->animation_countdown--;
|
||||
jujuPtr->scale *= 0.85;
|
||||
|
||||
pos_offset[0] = 100.0f;
|
||||
pos_offset[1] = 0.0f;
|
||||
pos_offset[2] = 0.0f;
|
||||
ml_vec3f_yaw_rotate_copy(pos_offset, pos_offset, this->yaw + 90.0);
|
||||
|
||||
this->position_x += pos_offset[0];
|
||||
this->position_y += pos_offset[1];
|
||||
this->position_z += pos_offset[2];
|
||||
|
||||
if (!jujuPtr->animation_countdown) {
|
||||
jujuPtr->animation_state = JUJU_ANIMATION_STATE_2_DESPAWNED;
|
||||
}
|
||||
break;
|
||||
|
||||
case JUJU_ANIMATION_STATE_4_FALLING: //L803897F8
|
||||
this->position_y -= 25.0;
|
||||
|
||||
if (jujuPtr->next_pos_y == this->position_y) {
|
||||
jujuPtr->animation_state = JUJU_ANIMATION_STATE_1_YAWING;
|
||||
sfxsource_playHighPriority(SFX_3_DULL_CANNON_SHOT);
|
||||
func_802BB3DC(0, 10.0f, 0.8f);
|
||||
|
||||
if (jujuPtr->unk18) {
|
||||
func_80353064(this->position, 24.0f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3: //L80389700
|
||||
if(--jujuPtr->unk4 == 0){
|
||||
jujuPtr->unk0 = 4;
|
||||
jujuPtr->unk8_y = this->position_y - 250.0f;
|
||||
}
|
||||
break;
|
||||
case 5: //L80389738
|
||||
jujuPtr->unk4--;
|
||||
jujuPtr->unk14 *= 0.85;
|
||||
{sp28[0] = 100.0f;
|
||||
sp28[1] = 0.0f;
|
||||
sp28[2] = 0.0f;}
|
||||
ml_vec3f_yaw_rotate_copy(sp28, sp28, this->yaw + 90.0);
|
||||
this->position_x += sp28[0];
|
||||
this->position_y += sp28[1];
|
||||
this->position_z += sp28[2];
|
||||
if(!jujuPtr->unk4){
|
||||
jujuPtr->unk0 = 2;
|
||||
}
|
||||
break;
|
||||
case 4: //L803897F8
|
||||
this->position_y -= 25.0;
|
||||
if(jujuPtr->unk8_y == this->position_y){
|
||||
jujuPtr->unk0 = 1;
|
||||
func_8030E484(SFX_3_DULL_CANNON_SHOT);
|
||||
func_802BB3DC(0, 10.0f, 0.8f);
|
||||
if(jujuPtr->unk18)
|
||||
func_80353064(this->position, 24.0f);
|
||||
}
|
||||
break;
|
||||
|
||||
}//L8038987C
|
||||
}
|
||||
|
||||
|
@@ -4,161 +4,164 @@
|
||||
#include "variables.h"
|
||||
|
||||
/* extern functions */
|
||||
void func_80388DFC(ActorMarker *, s32);
|
||||
s32 func_80329784(Actor *);
|
||||
void __chjujuhitbox_initialize_all(ActorMarker *, s32);
|
||||
s32 func_80329784(Actor *);
|
||||
void func_80353580(ActorMarker *);
|
||||
|
||||
typedef struct juju_hitbox_s{
|
||||
u8 pad0[0x4];
|
||||
s32 unk4;
|
||||
ActorMarker *unk8[4];
|
||||
f32 unk18;
|
||||
}ActorLocal_JujuHitbox;
|
||||
typedef struct juju_hitbox_s {
|
||||
u8 pad0[0x4];
|
||||
s32 unk4;
|
||||
ActorMarker *jujus[4];
|
||||
f32 unk18;
|
||||
} ActorLocal_JujuHitbox;
|
||||
|
||||
/* public functions */
|
||||
void func_80388E20(Actor *this);
|
||||
Actor* func_80388DC0(ActorMarker *, Gfx **, Mtx**, Vtx **);
|
||||
void func_80388DE8(Actor* this, s32 slave_id, Actor *slavePtr);
|
||||
void chjujuhitbox_update(Actor *this);
|
||||
Actor *chjujuhitbox_draw(ActorMarker *, Gfx **, Mtx **, Vtx **);
|
||||
void chjujuhitbox_setJuju(Actor *this, s32 slave_id, Actor *slavePtr);
|
||||
|
||||
/* .data */
|
||||
ActorInfo chjujuhitboxInfo = { MARKER_67_JUJU, ACTOR_11_JUJU_CTRL, 0,
|
||||
ActorInfo chjujuhitboxInfo = {
|
||||
MARKER_67_JUJU, ACTOR_11_JUJU_CTRL, 0,
|
||||
3, NULL,
|
||||
func_80388E20, func_80326224, func_80388DC0,
|
||||
chjujuhitbox_update, func_80326224, chjujuhitbox_draw,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
int func_80388B30(Actor *this, float arg1){
|
||||
/* code */
|
||||
bool func_80388B30(Actor *this, float arg1) {
|
||||
f32 yaw;
|
||||
|
||||
yaw = this->yaw - func_80329784(this);
|
||||
|
||||
if(180.0f <= yaw){
|
||||
if (180.0f <= yaw) {
|
||||
yaw -= 360.0f;
|
||||
}
|
||||
else if(yaw < -180.0f){
|
||||
else if (yaw < -180.0f) {
|
||||
yaw += 360.0f;
|
||||
}
|
||||
|
||||
if (yaw < 0.0f){
|
||||
if (yaw < 0.0f) {
|
||||
yaw = -yaw;
|
||||
}
|
||||
|
||||
if (yaw < arg1){
|
||||
return 1;
|
||||
if (yaw < arg1) {
|
||||
return TRUE;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void func_80388BEC(NodeProp *node, ActorMarker *marker){
|
||||
void func_80388BEC(NodeProp *node, ActorMarker *marker) {
|
||||
f32 distance_to_closest_actor;
|
||||
Actor *closest_actor;
|
||||
Actor *temp_v0;
|
||||
f32 position[3];
|
||||
|
||||
|
||||
position[0] = (f32)node->x;
|
||||
position[1] = (f32)node->y;
|
||||
position[2] = (f32)node->z;
|
||||
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);
|
||||
closest_actor = actorArray_findClosestActorFromActorId(position, ACTOR_11_JUJU_CTRL, -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 *)&closest_actor->local)->unk8[((ActorLocal_JujuHitbox *)&closest_actor->local)->unk4]);
|
||||
if (closest_actor != NULL
|
||||
&& !(distance_to_closest_actor > 500.0f)
|
||||
&& (closest_actor->state == 3)
|
||||
) {
|
||||
temp_v0 = marker_getActor(((ActorLocal_JujuHitbox *) &closest_actor->local)->jujus[((ActorLocal_JujuHitbox *) &closest_actor->local)->unk4]);
|
||||
|
||||
if(temp_v0 != NULL){
|
||||
if(func_80388B30(temp_v0, 90.0f)){
|
||||
if (temp_v0 != NULL) {
|
||||
if (func_80388B30(temp_v0, 90.0f)) {
|
||||
closest_actor->state = 1;
|
||||
((ActorLocal_JujuHitbox *)&closest_actor->local)->unk4++;
|
||||
func_803892A8(((ActorLocal_JujuHitbox *)&closest_actor->local)->unk8);
|
||||
((ActorLocal_JujuHitbox *) &closest_actor->local)->unk4++;
|
||||
func_803892A8(((ActorLocal_JujuHitbox *) &closest_actor->local)->jujus);
|
||||
func_80353580(marker);
|
||||
__spawnQueue_add_4((GenFunction_4)func_802C4140, 0x58, *(s32 *)&position[0], *(s32 *)&position[1], *(s32 *)&position[2]);
|
||||
__spawnQueue_add_4((GenFunction_4) func_802C4140, 0x58, *(s32 * ) & position[0], *(s32 * ) & position[1], *(s32 * ) & position[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80388D14(Actor *this){
|
||||
void __chjujuhitbox_playRubbingSfx(Actor *this) {
|
||||
ActorLocal_JujuHitbox *jujuCtlPtr;
|
||||
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local;
|
||||
func_8030E878(0x3F6, jujuCtlPtr->unk18, 20000, this->position, 300.0f, 2000.0f);
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *) &this->local;
|
||||
func_8030E878(SFX_3F6_RUBBING, jujuCtlPtr->unk18, 20000, this->position, 300.0f, 2000.0f);
|
||||
}
|
||||
|
||||
void func_80388D60(Actor *this){
|
||||
void func_80388D60(Actor *this) {
|
||||
ActorLocal_JujuHitbox *jujuCtlPtr;
|
||||
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local;
|
||||
if(!func_8038941C(jujuCtlPtr->unk8)){
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *) &this->local;
|
||||
|
||||
if (!__chjuju_isEveryJujuDespawned(jujuCtlPtr->jujus)) {
|
||||
jujuCtlPtr->unk18 *= 1.05;
|
||||
}
|
||||
|
||||
this->state = 3;
|
||||
}
|
||||
|
||||
Actor* func_80388DC0(ActorMarker *this, Gfx **dl, Mtx**mPtr, Vtx **arg3){
|
||||
Actor *chjujuhitbox_draw(ActorMarker *this, Gfx **dl, Mtx **mPtr, Vtx **arg3) {
|
||||
return marker_getActor(this);
|
||||
}
|
||||
|
||||
void func_80388DE8(Actor *this, s32 child_id, Actor *childPtr){
|
||||
void chjujuhitbox_setJuju(Actor *this, s32 child_id, Actor *childPtr) {
|
||||
ActorLocal_JujuHitbox *jujuCtlPtr;
|
||||
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local;
|
||||
jujuCtlPtr->unk8[child_id] = childPtr->marker;
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *) &this->local;
|
||||
jujuCtlPtr->jujus[child_id] = childPtr->marker;
|
||||
}
|
||||
|
||||
void func_80388DFC(ActorMarker *arg0, s32 arg1){
|
||||
func_803890A0(arg0, arg1);
|
||||
void __chjujuhitbox_initialize_all(ActorMarker *marker, s32 count) {
|
||||
__chjuju_initialize_all(marker, count);
|
||||
|
||||
if(arg0 && arg1); //for args to save
|
||||
if (marker && count); //for args to save
|
||||
}
|
||||
|
||||
void func_80388E20(Actor *this){
|
||||
void chjujuhitbox_update(Actor *this) {
|
||||
ActorLocal_JujuHitbox *jujuCtlPtr;
|
||||
s32 i;
|
||||
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local;
|
||||
if(!this->initialized){
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *) &this->local;
|
||||
|
||||
if (!this->initialized) {
|
||||
this->initialized = TRUE;
|
||||
this->is_first_encounter = FALSE;
|
||||
this->has_met_before = FALSE;
|
||||
jujuCtlPtr->unk18 = 0.5f;
|
||||
}
|
||||
if(!this->volatile_initialized){
|
||||
|
||||
if (!this->volatile_initialized) {
|
||||
this->volatile_initialized = TRUE;
|
||||
__spawnQueue_add_2((GenFunction_2)func_80388DFC,this->marker, jujuCtlPtr->unk4);
|
||||
func_80388D14(this);
|
||||
}else{
|
||||
if( func_80329530(this, 0xfa)
|
||||
&& !func_80329530(this, 0x50)
|
||||
&& !func_8028ECAC()
|
||||
){
|
||||
if( !this->is_first_encounter ){
|
||||
if(gcdialog_showText(ASSET_B44_TEXT_JUJU_MEET, 0, 0, 0, NULL, NULL)){
|
||||
this->is_first_encounter = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
__spawnQueue_add_2((GenFunction_2) __chjujuhitbox_initialize_all, this->marker, jujuCtlPtr->unk4);
|
||||
__chjujuhitbox_playRubbingSfx(this);
|
||||
return;
|
||||
}
|
||||
|
||||
if(this->state == 1){
|
||||
if(func_8038948C(jujuCtlPtr->unk8)){
|
||||
func_80388D60(this);
|
||||
}
|
||||
if(func_8038941C(jujuCtlPtr->unk8)){
|
||||
marker_despawn(this->marker);
|
||||
for(i = 0; i < 4; i++){
|
||||
marker_despawn(jujuCtlPtr->unk8[i]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
else{
|
||||
func_80389514(jujuCtlPtr->unk8);
|
||||
}
|
||||
|
||||
if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_9_UNKNOWN)) {
|
||||
func_80388D14(this);
|
||||
mapSpecificFlags_set(MM_SPECIFIC_FLAG_9_UNKNOWN, FALSE);
|
||||
if (func_80329530(this, 0xfa) && !func_80329530(this, 0x50) && !func_8028ECAC()) {
|
||||
if (!this->has_met_before && gcdialog_showText(ASSET_B44_TEXT_JUJU_MEET, 0, 0, 0, NULL, NULL)) {
|
||||
this->has_met_before = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->state == 1) {
|
||||
if (__chjuju_isEveryJujuStable(jujuCtlPtr->jujus)) {
|
||||
func_80388D60(this);
|
||||
}
|
||||
|
||||
if (__chjuju_isEveryJujuDespawned(jujuCtlPtr->jujus)) {
|
||||
marker_despawn(this->marker);
|
||||
for (i = 0; i < 4; i++) {
|
||||
marker_despawn(jujuCtlPtr->jujus[i]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
__chjuju_updateCount(jujuCtlPtr->jujus);
|
||||
}
|
||||
|
||||
if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_9_JUJU_HAS_HALF_TURNED)) {
|
||||
__chjujuhitbox_playRubbingSfx(this);
|
||||
mapSpecificFlags_set(MM_SPECIFIC_FLAG_9_JUJU_HAS_HALF_TURNED, FALSE);
|
||||
}
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ void __chlmonkey_updateBringOrange(Actor **this_ptr) {
|
||||
player_throwCarriedObject()) {
|
||||
|
||||
func_8028FA34(0xc6, *this_ptr);
|
||||
(*this_ptr)->is_first_encounter = TRUE;
|
||||
(*this_ptr)->has_met_before = TRUE;
|
||||
timed_setStaticCameraToNode(1.2f, 0xF);
|
||||
func_80324E38(1.2f, 3);
|
||||
}
|
||||
@@ -120,10 +120,10 @@ void chlmonkey_update(Actor *this) {
|
||||
if (func_80329530(this, 345) &&
|
||||
!func_80329530(this, 150) &&
|
||||
!item_getCount(ITEM_19_ORANGE) &&
|
||||
!this->is_first_encounter) {
|
||||
!this->has_met_before) {
|
||||
|
||||
gcdialog_showText(ASSET_B3F_DIALOG_CHIMPY_MEET, 0xe, this->position, NULL, NULL, NULL);
|
||||
this->is_first_encounter = TRUE;
|
||||
this->has_met_before = TRUE;
|
||||
}//L80388774
|
||||
|
||||
actor_loopAnimation(this);
|
||||
|
Reference in New Issue
Block a user