All Changes
This commit is contained in:
committed by
Banjo Kazooie
parent
fd208f77ca
commit
c2dd933d22
@@ -3,6 +3,9 @@
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include <math.h>
|
||||
|
||||
#include "conga.h"
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(s,t) ((s)<(t)?(s):(t))
|
||||
#endif
|
||||
@@ -19,16 +22,16 @@ void timed_exitStaticCamera(f32);
|
||||
Actor *actor_spawnWithYaw_s32(s32 actor_id, s32 position[3], s32 yaw);
|
||||
void MM_func_80387F44(void);
|
||||
|
||||
void func_803876D0(Actor *);
|
||||
void chConga_update(Actor *);
|
||||
|
||||
typedef struct chconga_s{
|
||||
typedef struct chconga_s {
|
||||
TUPLE(s32, orangeSpawnPosition);
|
||||
s32 unkC;
|
||||
s32 unk10;
|
||||
u8 pad14[0x4];
|
||||
s32 unk18;
|
||||
s32 unk1C;
|
||||
}ActorLocal_Conga;
|
||||
} ActorLocal_Conga;
|
||||
|
||||
|
||||
/* .data */
|
||||
@@ -44,9 +47,9 @@ ActorAnimationInfo chCongaAnimations[9] = {
|
||||
{ASSET_52_ANIM_CONGA_OW, 1.0f}
|
||||
};
|
||||
|
||||
ActorInfo chcongaInfo = { MARKER_7_CONGA, ACTOR_8_CONGA, ASSET_35C_MODEL_CONGA,
|
||||
ActorInfo chCongaInfo = { MARKER_7_CONGA, ACTOR_8_CONGA, ASSET_35C_MODEL_CONGA,
|
||||
1, chCongaAnimations,
|
||||
func_803876D0, actor_update_func_80326224, actor_draw,
|
||||
chConga_update, actor_update_func_80326224, actor_draw,
|
||||
0, 0x333, 0.0f, 0
|
||||
};
|
||||
|
||||
@@ -87,7 +90,7 @@ void func_80386FB0(Actor *this){
|
||||
void __chConga_playRandomNoise(void){
|
||||
if( (globalTimer_getTime() & 0xF) == 0xB
|
||||
&& 0.85 < randf ()
|
||||
&& !func_803114B0()
|
||||
&& !gcdialog_hasCurrentTextId()
|
||||
){
|
||||
func_8030E58C(((s32)(randf ()*256.0f) & 1)? SFX_22_KONGA_NOISE_1: SFX_23_KONGA_NOISE_2, 1.0f);
|
||||
}
|
||||
@@ -99,7 +102,7 @@ void func_8038708C(Actor *this, s32 anim_id){
|
||||
}
|
||||
|
||||
void func_803870D0(Actor *this, ActorMarker *arg1){
|
||||
marker_getActor(arg1)->unk100 = this->marker;
|
||||
marker_getActor(arg1)->partnerActor = this->marker;
|
||||
}
|
||||
|
||||
void func_80387100(ActorMarker *this){
|
||||
@@ -140,7 +143,7 @@ void func_80387168(ActorMarker *marker, ActorMarker *other_marker){
|
||||
){
|
||||
func_8038708C(actorPtr, 2);
|
||||
if(actorPtr->unk38_31 == 1){
|
||||
gcdialog_showText(ASSET_B39_DIALOG_CONGA_HIT_BY_EGG, 4, actorPtr->position, 0, 0, 0);
|
||||
gcdialog_showDialog(ASSET_B39_DIALOG_CONGA_HIT_BY_EGG, 4, actorPtr->position, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,7 +151,7 @@ void func_80387168(ActorMarker *marker, ActorMarker *other_marker){
|
||||
}
|
||||
|
||||
int func_803872EC(void){
|
||||
s32 text_id = func_803114C4();
|
||||
s32 text_id = gcdialog_getCurrentTextId();
|
||||
|
||||
return text_id == ASSET_B37_DIALOG_CONGA_SAFE_UP_HERE
|
||||
|| text_id == ASSET_B38_DIALOG_CONGA_DEFEAT
|
||||
@@ -209,13 +212,15 @@ void __chConga_sendOrangeProjectile(ActorMarker *congaMarker){
|
||||
}
|
||||
}
|
||||
|
||||
void func_803876D0(Actor *this){
|
||||
void chConga_update(Actor *this) {
|
||||
|
||||
f32 unused;
|
||||
NodeProp *node_prop;
|
||||
s32 sp3C;
|
||||
|
||||
this->marker->propPtr->unk8_3 = (timedFuncQueue_is_empty(this))?1:0;
|
||||
if(!this->initialized){
|
||||
this->marker->propPtr->unk8_3 = timedFuncQueue_is_empty(this) ? 1 : 0;
|
||||
|
||||
if (!this->initialized) {
|
||||
((ActorLocal_Conga *)&this->local)->unkC = 1;
|
||||
this->unk16C_0 = 1;
|
||||
this->initialized = TRUE;
|
||||
@@ -225,152 +230,173 @@ void func_803876D0(Actor *this){
|
||||
((ActorLocal_Conga *)&this->local)->unk1C = nodeprop_getRadius(node_prop);
|
||||
nodeprop_getPosition_s32(node_prop, &((ActorLocal_Conga *)&this->local)->unk10);
|
||||
}
|
||||
if(0.0f == this->actor_specific_1_f){
|
||||
|
||||
if (0.0f == this->actor_specific_1_f) {
|
||||
this->actor_specific_1_f = (actorArray_findActorFromMarkerId(MARKER_36_ORANGE_COLLECTIBLE) != NULL)? 2.0f: 1.0f;
|
||||
}
|
||||
if(0.0f != this->velocity_x){
|
||||
|
||||
if (0.0f != this->velocity_x) {
|
||||
this->velocity_x -= 1.0f;
|
||||
if(0.0f == this->velocity_x){
|
||||
__spawnQueue_add_1((GenFunction_1)func_80387100, (s32)this->marker);
|
||||
}
|
||||
}
|
||||
|
||||
marker_setCollisionScripts(this->marker, NULL, NULL, func_80387168);
|
||||
if( !func_80329530(this, 2100)
|
||||
|
||||
if (!subaddie_playerIsWithinSphereAndActive(this, 2100)
|
||||
&& this->state != 2
|
||||
&& this->state != 8
|
||||
){
|
||||
&& this->state != 8) {
|
||||
|
||||
if(this->state > 3 && this->state < 8){
|
||||
actor_loopAnimation(this);
|
||||
subaddie_set_state_with_direction(this, 1, 0.76f, 1);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sp3C = func_80329530(this, 1000);
|
||||
if( func_8032A9E4(((ActorLocal_Conga *)&this->local)->unk10, ((ActorLocal_Conga *)&this->local)->unk18, ((ActorLocal_Conga *)&this->local)->unk1C)
|
||||
sp3C = subaddie_playerIsWithinSphereAndActive(this, 1000);
|
||||
|
||||
if (func_8032A9E4(((ActorLocal_Conga *)&this->local)->unk10, ((ActorLocal_Conga *)&this->local)->unk18, ((ActorLocal_Conga *)&this->local)->unk1C)
|
||||
&& !this->unk138_23
|
||||
&& gcdialog_showText(ASSET_B37_DIALOG_CONGA_SAFE_UP_HERE, 0, 0, 0, 0, 0)
|
||||
){
|
||||
&& gcdialog_showDialog(ASSET_B37_DIALOG_CONGA_SAFE_UP_HERE, 0, 0, 0, 0, 0)) {
|
||||
this->unk138_23 = 1;
|
||||
mapSpecificFlags_set(MM_SPECIFIC_FLAG_A_UNKNOWN, TRUE);
|
||||
}//L803878F8
|
||||
|
||||
if( sp3C && !this->has_met_before){
|
||||
if(gcdialog_showText((player_getTransformation()== TRANSFORM_2_TERMITE) ? ASSET_B3E_DIALOG_CONGA_MEET_AS_TERMITE : ASSET_B3C_DIALOG_CONGA_MEET, 0, this->position, 0,0,0)){
|
||||
if (sp3C && !this->has_met_before) {
|
||||
if (gcdialog_showDialog((player_getTransformation()== TRANSFORM_2_TERMITE) ? ASSET_B3E_DIALOG_CONGA_MEET_AS_TERMITE : ASSET_B3C_DIALOG_CONGA_MEET, 0, this->position, 0,0,0)) {
|
||||
this->has_met_before = TRUE;
|
||||
}
|
||||
} //L80387968
|
||||
|
||||
switch(this->state){
|
||||
case 1://80387990
|
||||
switch (this->state) {
|
||||
case CONGA_STATE_IDLE://80387990
|
||||
actor_loopAnimation(this);
|
||||
func_80386FB0(this);
|
||||
__chConga_playRandomNoise();
|
||||
|
||||
if(actor_animationIsAt(this, 0.0f) || actor_animationIsAt(this, 0.45f)){
|
||||
if(randf() < 0.2){
|
||||
anctrl_setDirection(this->anctrl, anctrl_isPlayedForwards(this->anctrl)?0:1);
|
||||
};
|
||||
}//L80387A18
|
||||
if(actor_animationIsAt(this, 0.66f)){
|
||||
subaddie_maybe_set_state_position_direction(this, 6, 0, 1, 0.38f);
|
||||
|
||||
if (actor_animationIsAt(this, 0.66f)) {
|
||||
subaddie_maybe_set_state_position_direction(this, CONGA_STATE_BEAT_CHEST_STOP, 0, 1, 0.38f);
|
||||
}
|
||||
if( sp3C
|
||||
|
||||
if (sp3C
|
||||
&& player_movementGroup() != BSGROUP_1_INTR
|
||||
&& !__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()
|
||||
){
|
||||
subaddie_set_state_with_direction(this, 4, 0.0f, 1);
|
||||
&& !func_803872EC()) {
|
||||
|
||||
subaddie_set_state_with_direction(this, CONGA_STATE_TARGET_GROUND, 0.0f, 1);
|
||||
}//L80387AC0
|
||||
if( player_movementGroup() != BSGROUP_1_INTR
|
||||
|
||||
if (player_movementGroup() != BSGROUP_1_INTR
|
||||
&& __chConga_isPlayerNearCongaTree(this)
|
||||
&& this->unk38_31 != 0
|
||||
&& !func_803872EC()
|
||||
){
|
||||
subaddie_set_state_with_direction(this, 7, 0.0f, 1);
|
||||
&& !func_803872EC()) {
|
||||
|
||||
subaddie_set_state_with_direction(this, CONGA_STATE_TARGET_BANJO, 0.0f, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6: //L80387B24
|
||||
case CONGA_STATE_BEAT_CHEST_STOP: //L80387B24
|
||||
((ActorLocal_Conga *)&this->local)->unkC = 1;
|
||||
actor_playAnimationOnce(this);
|
||||
__chConga_playRandomNoise();
|
||||
if( anctrl_isPlayedForwards(this->anctrl) == TRUE
|
||||
&& actor_animationIsAt(this, 0.0f)
|
||||
){
|
||||
subaddie_set_state_with_direction(this, 5, 0.0f, 1);
|
||||
}
|
||||
else if( !anctrl_isPlayedForwards(this->anctrl)
|
||||
&& actor_animationIsAt(this, 0.001f)
|
||||
){
|
||||
subaddie_set_state_with_direction(this, 1, 0.76f, 1);
|
||||
|
||||
if (anctrl_isPlayedForwards(this->anctrl) == TRUE
|
||||
&& actor_animationIsAt(this, 0.0f)) {
|
||||
|
||||
subaddie_set_state_with_direction(this, CONGA_STATE_BEAT_CHEST, 0.0f, 1);
|
||||
} else if (!anctrl_isPlayedForwards(this->anctrl)
|
||||
&& actor_animationIsAt(this, 0.001f)) {
|
||||
subaddie_set_state_with_direction(this, CONGA_STATE_IDLE, 0.76f, 1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 5: //L80387BC0
|
||||
case CONGA_STATE_BEAT_CHEST: //L80387BC0
|
||||
((ActorLocal_Conga *)&this->local)->unkC = 1;
|
||||
actor_loopAnimation(this);
|
||||
__chConga_playRandomNoise();
|
||||
if( actor_animationIsAt(this, 0.99f)){
|
||||
subaddie_maybe_set_state_position_direction(this, 6, 0.999f, 0, sp3C ? 1.0 : 0.4);
|
||||
|
||||
if (actor_animationIsAt(this, 0.99f)) {
|
||||
subaddie_maybe_set_state_position_direction(this, CONGA_STATE_BEAT_CHEST_STOP, 0.999f, 0, sp3C ? 1.0 : 0.4);
|
||||
}//L80387C30
|
||||
if( actor_animationIsAt(this, 0.9f)
|
||||
|| actor_animationIsAt(this, 0.4f)
|
||||
){
|
||||
|
||||
if (actor_animationIsAt(this, 0.9f)
|
||||
|| actor_animationIsAt(this, 0.4f)) {
|
||||
func_8030E6D4(SFX_3FB_UNKNOWN);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 4: //L80387C74
|
||||
if(actor_animationIsAt(this, 0.6f)){
|
||||
case CONGA_STATE_TARGET_GROUND: //L80387C74
|
||||
if (actor_animationIsAt(this, 0.6f)) {
|
||||
func_8030E58C(SFX_2_CLAW_SWIPE, 0.7f);
|
||||
}
|
||||
|
||||
func_80386FB0(this);
|
||||
if( !sp3C
|
||||
|
||||
if (!sp3C
|
||||
|| player_is_in_jiggy_jig()
|
||||
|| __chConga_isPlayerNearCongaTree(this)
|
||||
|| !timedFuncQueue_is_empty()
|
||||
|| func_803872EC()
|
||||
){
|
||||
subaddie_set_state_with_direction(this, 1, 0.0f, 1);
|
||||
|| func_803872EC()) {
|
||||
|
||||
subaddie_set_state_with_direction(this, CONGA_STATE_IDLE, 0.0f, 1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2: //L80387D0C
|
||||
case CONGA_STATE_HIT: //L80387D0C
|
||||
actor_playAnimationOnce(this);
|
||||
if(actor_animationIsAt(this, 0.99f)){
|
||||
subaddie_set_state_with_direction(this, 1, 0.0f, 1);
|
||||
if (actor_animationIsAt(this, 0.99f)) {
|
||||
subaddie_set_state_with_direction(this, CONGA_STATE_IDLE, 0.0f, 1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 8: //L80387D4C
|
||||
case CONGA_STATE_ROAR: //L80387D4C
|
||||
actor_playAnimationOnce(this);
|
||||
if(actor_animationIsAt(this, 0.99f)){
|
||||
subaddie_set_state_with_direction(this, 3, 0.0f, 1);
|
||||
gcdialog_showText(ASSET_B38_DIALOG_CONGA_DEFEAT, 0xe, this->position, this->marker, func_80387370, NULL);
|
||||
|
||||
if (actor_animationIsAt(this, 0.99f)) {
|
||||
subaddie_set_state_with_direction(this, CONGA_STATE_MOPEY, 0.0f, 1);
|
||||
gcdialog_showDialog(ASSET_B38_DIALOG_CONGA_DEFEAT, 0xe, this->position, this->marker, func_80387370, NULL);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 3: //L80387DB8
|
||||
case CONGA_STATE_MOPEY: //L80387DB8
|
||||
actor_loopAnimation(this);
|
||||
if(jiggyscore_isCollected(JIGGY_A_MM_CONGA)){
|
||||
subaddie_set_state_with_direction(this, 1, 0.0f, 1);
|
||||
|
||||
if (jiggyscore_isCollected(JIGGY_A_MM_CONGA)) {
|
||||
subaddie_set_state_with_direction(this, CONGA_STATE_IDLE, 0.0f, 1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 7: //L80387DF0
|
||||
if(this->unk10_12 == 0){
|
||||
if(actor_animationIsAt(this, 0.97f)){
|
||||
case CONGA_STATE_TARGET_BANJO: //L80387DF0
|
||||
if (this->unk10_12 == 0) {
|
||||
if (actor_animationIsAt(this, 0.97f)) {
|
||||
((ActorLocal_Conga *)&this->local)->unkC = 1;
|
||||
subaddie_set_state_with_direction(this, 6, 0.0f, 1);
|
||||
subaddie_set_state_with_direction(this, CONGA_STATE_BEAT_CHEST_STOP, 0.0f, 1);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}//L80387E38
|
||||
if( (this->state == 4 && actor_animationIsAt(this, 0.56f))
|
||||
|| (this->state == 7 && actor_animationIsAt(this, 0.468f))
|
||||
){
|
||||
|
||||
if ((this->state == CONGA_STATE_TARGET_GROUND && actor_animationIsAt(this, 0.56f))
|
||||
|| (this->state == CONGA_STATE_TARGET_BANJO && actor_animationIsAt(this, 0.468f))) {
|
||||
|
||||
func_8034A1B4(this->marker->unk44, 5, &this->local);
|
||||
__spawnQueue_add_1((GenFunction_1)__chConga_sendOrangeProjectile, (s32)this->marker); //spawn orange
|
||||
}
|
||||
|
10
src/MM/ch/conga.h
Normal file
10
src/MM/ch/conga.h
Normal file
@@ -0,0 +1,10 @@
|
||||
enum conga_state_s {
|
||||
CONGA_STATE_IDLE = 1,
|
||||
CONGA_STATE_HIT = 2,
|
||||
CONGA_STATE_MOPEY = 3, // After defeat, waiting for Banjo to collect the jiggy
|
||||
CONGA_STATE_TARGET_GROUND = 4,
|
||||
CONGA_STATE_BEAT_CHEST = 5,
|
||||
CONGA_STATE_BEAT_CHEST_STOP = 6, // Though depending on the animation, he'll go back to beating his chest
|
||||
CONGA_STATE_TARGET_BANJO = 7, // Targeting Banjo when he's at eye level
|
||||
CONGA_STATE_ROAR = 8 // When Conga is defeated
|
||||
};
|
@@ -53,7 +53,7 @@ void func_803889A0(ActorMarker *this, s32 arg1){
|
||||
actorPtr = marker_getActor(this);
|
||||
subaddie_set_state_with_direction(actorPtr, 5, 0.0f, 1);
|
||||
actor_playAnimationOnce(actorPtr);
|
||||
FUNC_8030E8B4(SFX_C2_GRUBLIN_EGH, 1.0f, 32000, actorPtr->position, 1250, 2500);
|
||||
sfx_playFadeShorthandDefault(SFX_C2_GRUBLIN_EGH, 1.0f, 32000, actorPtr->position, 1250, 2500);
|
||||
|
||||
actor_collisionOff(actorPtr);
|
||||
}
|
||||
@@ -82,10 +82,10 @@ void func_80388A80(Actor *this) {
|
||||
func_802DB5A0(this);
|
||||
if (this->state == 5) {
|
||||
if (actor_animationIsAt(this, 0.18f)) {
|
||||
FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 1.0f, 28000, this->position, 1250, 2500);
|
||||
sfx_playFadeShorthandDefault(SFX_2_CLAW_SWIPE, 1.0f, 28000, this->position, 1250, 2500);
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.7f)) {
|
||||
FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 28000, this->position, 1250, 2500);
|
||||
sfx_playFadeShorthandDefault(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 28000, this->position, 1250, 2500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ Actor *chhut_draw(ActorMarker *, Gfx **, Mtx **, Vtx **);
|
||||
void chhut_update(Actor *);
|
||||
|
||||
/* .bss */
|
||||
extern s32 mm_hut_smash_count; //mm_hut_smash_count
|
||||
extern s32 mmhut_smashCount; //mmhut_smashCount
|
||||
|
||||
/* .data */
|
||||
enum chhut_state_e {
|
||||
@@ -94,14 +94,14 @@ void chhut_update(Actor *this) {
|
||||
__spawnQueue_add_1((GenFunction_1) __chhut_spawnExplosion, (s32) this->marker);
|
||||
bundle_setYaw(this->yaw);
|
||||
|
||||
if (mm_hut_smash_count < 5) {
|
||||
__spawnQueue_add_4((GenFunction_4) spawnQueue_bundle_f32, D_803898D8[mm_hut_smash_count], *(s32 * )(&diff_pos[0]), *(s32 * )(&diff_pos[1]), *(s32 * )(&diff_pos[2]));
|
||||
if (mmhut_smashCount < 5) {
|
||||
__spawnQueue_add_4((GenFunction_4) spawnQueue_bundle_f32, D_803898D8[mmhut_smashCount], *(s32 * )(&diff_pos[0]), *(s32 * )(&diff_pos[1]), *(s32 * )(&diff_pos[2]));
|
||||
}
|
||||
else {
|
||||
jiggy_spawn(JIGGY_5_MM_HUTS, diff_pos);
|
||||
}
|
||||
|
||||
mm_hut_smash_count = (mm_hut_smash_count + 1) % 6;
|
||||
mmhut_smashCount = (mmhut_smashCount + 1) % 6;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -119,7 +119,7 @@ void chhut_update(Actor *this) {
|
||||
}
|
||||
|
||||
void mm_resetHuts(void) {
|
||||
mm_hut_smash_count = 0;
|
||||
mmhut_smashCount = 0;
|
||||
}
|
||||
|
||||
ActorInfo chhutInfo = {
|
||||
|
@@ -135,10 +135,10 @@ void func_803892A8(ActorMarker **ptr) {
|
||||
if (i == 3) {
|
||||
gcpausemenu_80314AC8(0);
|
||||
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);
|
||||
coMusicPlayer_playMusic(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x6d60);
|
||||
}
|
||||
else {//L80389384
|
||||
func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff);
|
||||
coMusicPlayer_playMusic(COMUSIC_2B_DING_B, 0x7fff);
|
||||
}
|
||||
|
||||
for (s2 = 3, j = i + 1; j < 4; s2 += 5, j++) {
|
||||
|
@@ -137,8 +137,8 @@ void chjujuhitbox_update(Actor *this) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (func_80329530(this, 0xfa) && !func_80329530(this, 0x50) && !player_movementGroup()) {
|
||||
if (!this->has_met_before && gcdialog_showText(ASSET_B44_DIALOG_JUJU_MEET, 0, 0, 0, NULL, NULL)) {
|
||||
if (subaddie_playerIsWithinSphereAndActive(this, 0xfa) && !subaddie_playerIsWithinSphereAndActive(this, 0x50) && !player_movementGroup()) {
|
||||
if (!this->has_met_before && gcdialog_showDialog(ASSET_B44_DIALOG_JUJU_MEET, 0, 0, 0, NULL, NULL)) {
|
||||
this->has_met_before = TRUE;
|
||||
}
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ ActorInfo chlmonkeyInfo = {
|
||||
void __chlmonkey_updateBringOrange(Actor **this_ptr) {
|
||||
player_setCarryObjectPoseInHorizontalRadius((*this_ptr)->position, 800.0f, ACTOR_29_ORANGE_COLLECTIBLE, this_ptr);
|
||||
|
||||
if (func_80329530(*this_ptr, 345) &&
|
||||
if (subaddie_playerIsWithinSphereAndActive(*this_ptr, 345) &&
|
||||
bacarry_get_markerId() == MARKER_36_ORANGE_COLLECTIBLE &&
|
||||
player_throwCarriedObject()) {
|
||||
|
||||
@@ -67,7 +67,7 @@ void __chlmonkey_playRandomNoise(Actor *this) {
|
||||
|
||||
if (sNoiseCooldown < 0 && randf() < 0.2) {
|
||||
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);
|
||||
gcsfx_playWithPitch(((random_noise < 0.5) ? SFX_58_CHIMPY_NOISE_1 : SFX_59_CHIMPY_NOISE_2), randf() * 0.25 + 0.85, scaled_noise_volume);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ void chlmonkey_update(Actor *this) {
|
||||
func_80343DEC(this);
|
||||
}
|
||||
else {//L80388630
|
||||
if (func_80329530(this, 700) && !func_803114B0()) {
|
||||
if (subaddie_playerIsWithinSphereAndActive(this, 700) && !gcdialog_hasCurrentTextId()) {
|
||||
__chlmonkey_playRandomNoise(this);
|
||||
}//L8038865C
|
||||
|
||||
@@ -108,7 +108,7 @@ void chlmonkey_update(Actor *this) {
|
||||
subaddie_set_state(this, LMONKEY_STATE_4_LEAVING);
|
||||
|
||||
if (!jiggyscore_isCollected(JIGGY_9_MM_CHIMPY)) {
|
||||
gcdialog_showText(ASSET_B40_DIALOG_CHIMPY_COMPLETE, 0xE, this->position, this->marker, __chlmonkey_complete, NULL);
|
||||
gcdialog_showDialog(ASSET_B40_DIALOG_CHIMPY_COMPLETE, 0xE, this->position, this->marker, __chlmonkey_complete, NULL);
|
||||
}
|
||||
else {//L803886E8
|
||||
__chlmonkey_complete(this->marker, ASSET_B40_DIALOG_CHIMPY_COMPLETE, -1);
|
||||
@@ -117,12 +117,12 @@ void chlmonkey_update(Actor *this) {
|
||||
else {
|
||||
__chlmonkey_updateBringOrange(&this);
|
||||
|
||||
if (func_80329530(this, 345) &&
|
||||
!func_80329530(this, 150) &&
|
||||
if (subaddie_playerIsWithinSphereAndActive(this, 345) &&
|
||||
!subaddie_playerIsWithinSphereAndActive(this, 150) &&
|
||||
!item_getCount(ITEM_19_ORANGE) &&
|
||||
!this->has_met_before) {
|
||||
|
||||
gcdialog_showText(ASSET_B3F_DIALOG_CHIMPY_MEET, 0xe, this->position, NULL, NULL, NULL);
|
||||
gcdialog_showDialog(ASSET_B3F_DIALOG_CHIMPY_MEET, 0xe, this->position, NULL, NULL, NULL);
|
||||
this->has_met_before = TRUE;
|
||||
}//L80388774
|
||||
|
||||
|
@@ -30,7 +30,7 @@ f32 D_80389A00[3] = {0.0f, 0.0f, 0.0f};
|
||||
void __chorange_collisionCallback(ActorMarker *marker, ActorMarker *other_marker) {
|
||||
if (!player_isDead() &&
|
||||
!mapSpecificFlags_get(MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE) &&
|
||||
gcdialog_showText(ASSET_B3A_DIALOG_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL)) {
|
||||
gcdialog_showDialog(ASSET_B3A_DIALOG_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL)) {
|
||||
|
||||
mapSpecificFlags_set(MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE, TRUE);
|
||||
}
|
||||
|
@@ -2,87 +2,93 @@
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
/* extern functions */
|
||||
void actor_update_func_80326224(Actor *);
|
||||
void func_80329904(ActorMarker *, s32, void *);
|
||||
extern void func_802EFA20(ParticleEmitter *, f32, f32);
|
||||
#include "core2/staticcamera.h"
|
||||
|
||||
/* public functions */
|
||||
void chorangepad_update(Actor *);
|
||||
#include "conga.h"
|
||||
#include "orangepad.h"
|
||||
|
||||
/* .data */
|
||||
ActorInfo chorangepadInfo = {
|
||||
extern void func_80329904(ActorMarker *, s32, void *);
|
||||
|
||||
void chOrangePad_update(Actor *);
|
||||
|
||||
ActorInfo chOrangePadInfo = {
|
||||
MARKER_66_ORANGE_PAD, ACTOR_57_ORANGE_PAD, ASSET_2EB_MODEL_ORANGE_PAD,
|
||||
0, NULL,
|
||||
chorangepad_update, actor_update_func_80326224, actor_draw,
|
||||
chOrangePad_update, actor_update_func_80326224, actor_draw,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/*.code */
|
||||
void __chorangepad_spawnJiggy(s32 x, s32 y, s32 z) {
|
||||
void spawnJiggy(s32 x, s32 y, s32 z) {
|
||||
f32 pos[3];
|
||||
|
||||
TUPLE_ASSIGN(pos, x, y, z);
|
||||
jiggy_spawn(JIGGY_8_MM_ORANGE_PADS, pos);
|
||||
}
|
||||
|
||||
void func_80386444(ActorMarker *marker) {
|
||||
void handleOrangeCollision(ActorMarker *marker) {
|
||||
f32 distance_to_orange_pad;
|
||||
Actor *closest_orange_pad;
|
||||
f32 position[3];
|
||||
ParticleEmitter *p_ctrl;
|
||||
s32 temp_a0;
|
||||
s32 camera_id;
|
||||
|
||||
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);
|
||||
closest_orange_pad = actorArray_findClosestActorFromActorId(position, ACTOR_57_ORANGE_PAD, ORANGE_PAD_STATE_HIT, &distance_to_orange_pad);
|
||||
|
||||
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 = (closest_orange_pad->unk78_13 == 0x106) ? 0x10
|
||||
: (closest_orange_pad->unk78_13 == 0x76) ? 0xf
|
||||
: 0xe;
|
||||
|
||||
func_802BAFE4(temp_a0);
|
||||
position[1] += 50.0f;
|
||||
timedFunc_set_3(0.6f, (GenFunction_3) __chorangepad_spawnJiggy, (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)) {
|
||||
gcdialog_showText(0xB3B, 4, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
}// L803865D8
|
||||
|
||||
// Emmit sparkles
|
||||
p_ctrl = partEmitMgr_newEmitter(30);
|
||||
particleEmitter_setPosition(p_ctrl, closest_orange_pad->position);
|
||||
particleEmitter_setModel(p_ctrl, 0x89f);
|
||||
particleEmitter_setStartingScaleRange(p_ctrl, 0.09f, 0.19f);
|
||||
particleEmitter_setFinalScaleRange(p_ctrl, 0.0f, 0.0f);
|
||||
particleEmitter_setParticleVelocityRange(p_ctrl, -200.0f, 500.0f, -200.0f, 200.0f, 700.0f, 200.0f);
|
||||
particleEmitter_setAccelerationRange(p_ctrl, 0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f);
|
||||
particleEmitter_setAngularVelocityRange(p_ctrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f);
|
||||
particleEmitter_setSpawnIntervalRange(p_ctrl, 0.0f, 0.01f);
|
||||
particleEmitter_setParticleLifeTimeRange(p_ctrl, 4.0f, 4.0f);
|
||||
particleEmitter_func_802EF9F8(p_ctrl, 0.01f);
|
||||
particleEmitter_func_802EFA18(p_ctrl, 3);
|
||||
func_802EFA20(p_ctrl, 1.0f, 1.3f);
|
||||
particleEmitter_emitN(p_ctrl, 30);
|
||||
if (!closest_orange_pad || 500.0f < distance_to_orange_pad) {
|
||||
return;
|
||||
}
|
||||
|
||||
closest_orange_pad->state = ORANGE_PAD_STATE_HIT;
|
||||
|
||||
if (actorArray_findClosestActorFromActorId(position, ACTOR_57_ORANGE_PAD, ORANGE_PAD_STATE_HIT, &distance_to_orange_pad)) {
|
||||
// There are still other pads on the ground, play progress ding
|
||||
coMusicPlayer_playMusic(COMUSIC_2B_DING_B, 22000);
|
||||
} else { // No more pads, dispense jiggy
|
||||
camera_id = (closest_orange_pad->secondaryId == ORANGE_PAD_RIGHT) ? MM_ORANGE_PAD_JIGGY_SPAWN_RIGHT
|
||||
: (closest_orange_pad->secondaryId == ORANGE_PAD_LEFT) ? MM_ORANGE_PAD_JIGGY_SPAWN_LEFT
|
||||
: MM_ORANGE_PAD_JIGGY_SPAWN_TOP;
|
||||
|
||||
gcStaticCamera_activate(camera_id);
|
||||
|
||||
position[1] += 50.0f;
|
||||
timedFunc_set_3(0.6f, (GenFunction_3) spawnJiggy, (s32) position[0], (s32) position[1], (s32) position[2]);
|
||||
|
||||
coMusicPlayer_playMusic(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF);
|
||||
|
||||
if (!jiggyscore_isCollected(JIGGY_8_MM_ORANGE_PADS)) {
|
||||
gcdialog_showDialog(ASSET_B3B_DIALOG_CONGA_ORANGE_PAD_JIGGY, 4, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
// Spawn orange particles
|
||||
p_ctrl = partEmitMgr_newEmitter(ORANGE_PARTICLE_COUNT);
|
||||
|
||||
particleEmitter_setPosition(p_ctrl, closest_orange_pad->position);
|
||||
particleEmitter_setModel(p_ctrl, ASSET_89F_MODEL_ORANGE_PARTICLE);
|
||||
particleEmitter_setStartingScaleRange(p_ctrl, 0.09f, 0.19f);
|
||||
particleEmitter_setFinalScaleRange(p_ctrl, 0.0f, 0.0f);
|
||||
particleEmitter_setParticleVelocityRange(p_ctrl, -200.0f, 500.0f, -200.0f, 200.0f, 700.0f, 200.0f);
|
||||
particleEmitter_setAccelerationRange(p_ctrl, 0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f);
|
||||
particleEmitter_setAngularVelocityRange(p_ctrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f);
|
||||
particleEmitter_setSpawnIntervalRange(p_ctrl, 0.0f, 0.01f);
|
||||
particleEmitter_setParticleLifeTimeRange(p_ctrl, 4.0f, 4.0f);
|
||||
particleEmitter_func_802EF9F8(p_ctrl, 0.01f);
|
||||
particleEmitter_func_802EFA18(p_ctrl, 3);
|
||||
particleEmitter_func_802EFA20(p_ctrl, 1.0f, 1.3f);
|
||||
|
||||
particleEmitter_emitN(p_ctrl, ORANGE_PARTICLE_COUNT);
|
||||
}
|
||||
|
||||
void func_80386744(s32 arg0, ActorMarker *arg1) {
|
||||
func_80386444(arg1);
|
||||
void chOrangePad_handleOrangeCollision(s32 _, ActorMarker *marker) {
|
||||
handleOrangeCollision(marker);
|
||||
}
|
||||
|
||||
void chorangepad_update(Actor *this) {
|
||||
Actor *closest_actor;
|
||||
void chOrangePad_update(Actor *this) {
|
||||
Actor *conga;
|
||||
f32 unused;
|
||||
f32 min_distance;
|
||||
|
||||
@@ -90,41 +96,41 @@ void chorangepad_update(Actor *this) {
|
||||
this->marker->propPtr->unk8_3 = 1;
|
||||
actor_collisionOff(this);
|
||||
this->initialized = TRUE;
|
||||
}//L803867B0
|
||||
}
|
||||
|
||||
if (!this->volatile_initialized) {
|
||||
this->unk100 = actorArray_findClosestActorFromActorId(this->position, 8, -1, &min_distance)->marker;
|
||||
this->partnerActor = actorArray_findClosestActorFromActorId(this->position, ACTOR_8_CONGA, -1, &min_distance)->marker;
|
||||
this->volatile_initialized = TRUE;
|
||||
}//L803867E0
|
||||
|
||||
if (this->unk100) {
|
||||
closest_actor = marker_getActor(this->unk100);
|
||||
}
|
||||
|
||||
if (func_80329530(this, 0x28) &&
|
||||
!player_movementGroup() &&
|
||||
!mapSpecificFlags_get(MM_SPECIFIC_FLAG_6_UNKNOWN) &&
|
||||
closest_actor->state != 3) {
|
||||
if (this->partnerActor) {
|
||||
conga = marker_getActor(this->partnerActor);
|
||||
}
|
||||
|
||||
if (gcdialog_showText(0xb3d, 0, NULL, NULL, NULL, NULL)) {
|
||||
mapSpecificFlags_set(MM_SPECIFIC_FLAG_6_UNKNOWN, TRUE);
|
||||
if (subaddie_playerIsWithinSphereAndActive(this, CONGA_WARN_DISTANCE)
|
||||
&& !player_movementGroup()
|
||||
&& !mapSpecificFlags_get(MM_SPECIFIC_FLAG_CONGA_WARNED_BLOCKS)
|
||||
&& conga->state != CONGA_STATE_MOPEY) {
|
||||
|
||||
if (gcdialog_showDialog(ASSET_B3D_DIALOG_CONGA_DONT_TOUCH_BLOCKS, 0, NULL, NULL, NULL, NULL)) {
|
||||
mapSpecificFlags_set(MM_SPECIFIC_FLAG_CONGA_WARNED_BLOCKS, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->state == 1) {
|
||||
if (this->state == ORANGE_PAD_STATE_HIT) {
|
||||
if (this->lifetime_value < 72.0f) {
|
||||
func_8033E73C(this->marker, 5, func_80329904);
|
||||
func_8033E3F0(9, this->marker->unk14_21);
|
||||
commonParticle_add(this->marker, 5, func_80329904);
|
||||
commonParticle_new(9, this->marker->unk14_21);
|
||||
}
|
||||
|
||||
this->lifetime_value = MIN(255.0, this->lifetime_value + 7.0);
|
||||
// Tick up respawn by 7 every update
|
||||
this->lifetime_value = MIN(ORANGE_PAD_HIT_LIFETIME, this->lifetime_value + ORANGE_PAD_LIFETIME_INCREMENT);
|
||||
|
||||
if (255.0 == this->lifetime_value) {
|
||||
if (ORANGE_PAD_HIT_LIFETIME == this->lifetime_value) {
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
}
|
||||
else {
|
||||
}//L80386928
|
||||
} else { } // Can't remove the else ;.;
|
||||
|
||||
// If hit, then fade out
|
||||
actor_setOpacity(this, 0xFF - (s32) this->lifetime_value);
|
||||
}//*/
|
||||
}
|
||||
|
13
src/MM/ch/orangepad.h
Normal file
13
src/MM/ch/orangepad.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#define ORANGE_PARTICLE_COUNT 30
|
||||
#define CONGA_WARN_DISTANCE 0x28
|
||||
#define ORANGE_PAD_HIT_LIFETIME 255.0
|
||||
#define ORANGE_PAD_LIFETIME_INCREMENT 7.0
|
||||
|
||||
enum orange_pad_state_e {
|
||||
ORANGE_PAD_STATE_HIT = 1
|
||||
};
|
||||
|
||||
enum orange_pad_ids {
|
||||
ORANGE_PAD_LEFT = 0x76,
|
||||
ORANGE_PAD_RIGHT = 0x106
|
||||
};
|
@@ -9,21 +9,21 @@
|
||||
extern ActorInfo chhutInfo;
|
||||
extern ActorInfo chchimpystump;
|
||||
extern ActorInfo chgrublinInfo;
|
||||
extern ActorInfo chcongaInfo;
|
||||
extern ActorInfo chCongaInfo;
|
||||
extern ActorInfo chorangeInfo;
|
||||
extern ActorInfo chjujuhitboxInfo;
|
||||
extern ActorInfo chjujuInfo;
|
||||
extern ActorInfo chorangepadInfo;
|
||||
extern ActorInfo chOrangePadInfo;
|
||||
extern ActorInfo chlmonkeyInfo;
|
||||
|
||||
void MM_func_803888B0(void){
|
||||
spawnableActorList_add( &chhutInfo, actor_new, ACTOR_FLAG_UNKNOWN_10);
|
||||
spawnableActorList_add( &chchimpystump, actor_new, ACTOR_FLAG_NONE);
|
||||
spawnableActorList_add( &chgrublinInfo, actor_new, ACTOR_FLAG_UNKNOWN_25 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_5 | ACTOR_FLAG_UNKNOWN_0);
|
||||
spawnableActorList_add( &chcongaInfo, actor_new, ACTOR_FLAG_UNKNOWN_25 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_5);
|
||||
spawnableActorList_add( &chCongaInfo, actor_new, ACTOR_FLAG_UNKNOWN_25 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_5);
|
||||
spawnableActorList_add( &chorangeInfo, actor_new, ACTOR_FLAG_NONE);
|
||||
spawnableActorList_add( &chjujuhitboxInfo, actor_new, ACTOR_FLAG_NONE);
|
||||
spawnableActorList_add( &chjujuInfo, actor_new, ACTOR_FLAG_UNKNOWN_14 | ACTOR_FLAG_UNKNOWN_2);
|
||||
spawnableActorList_add( &chorangepadInfo, actor_new, ACTOR_FLAG_UNKNOWN_6);
|
||||
spawnableActorList_add( &chOrangePadInfo, actor_new, ACTOR_FLAG_UNKNOWN_6);
|
||||
spawnableActorList_add( &chlmonkeyInfo, actor_new, ACTOR_FLAG_UNKNOWN_8);
|
||||
}
|
||||
|
Reference in New Issue
Block a user