The first commit
This commit is contained in:
66
src/MM/ch/chimpystump.c
Normal file
66
src/MM/ch/chimpystump.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/*DONE!!!*/
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#include "prop.h"
|
||||
|
||||
/* external function declarations */
|
||||
void func_80353064(f32 *, f32);
|
||||
void func_802BB3DC(s32, f32, f32);
|
||||
void func_80244BB0(s32, s32, s32, f32);
|
||||
|
||||
/* public function declarations */
|
||||
void chchimpystump_update(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo chchimpystump = { MARKER_95_CHIMPY_STUMP, ACTOR_C5_CHIMPY_STUMP, ASSET_3C8_MODEL_CHIMPY_STUMP,
|
||||
1, NULL,
|
||||
chchimpystump_update, func_80326224, func_80325E78,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
void _chchimpystump_80386CA0(Actor *this){
|
||||
if(mapSpecificFlags_get(4)){
|
||||
if(this->unk10_12 == 0){
|
||||
this->unk10_12 = 1;
|
||||
func_802BB3DC(1, 3.0f, 1.0f);
|
||||
func_80244BB0(0, 0x6A, 0x7FF8, 0.2f);
|
||||
}//L80386D0C
|
||||
this->position_x = ((func_8023DB5C() & 1) * 2) ^ (s32)this->position_x;
|
||||
this->position_z = ((func_8023DB5C() & 2) * 2) ^ (s32)this->position_z;
|
||||
}
|
||||
}
|
||||
|
||||
void chchimpystump_update(Actor *this){
|
||||
if(!this->initialized){
|
||||
actor_collisionOff(this);
|
||||
this->initialized = 1;
|
||||
this->unk28 = this->position_y;
|
||||
this->position_y -= 134.0f;
|
||||
this->marker->propPtr->unk8_3 = 1;
|
||||
}
|
||||
switch (this->state)
|
||||
{
|
||||
case 1:
|
||||
if(mapSpecificFlags_get(0))
|
||||
func_80328A84(this, 2);
|
||||
|
||||
_chchimpystump_80386CA0(this);
|
||||
break;
|
||||
case 2:
|
||||
_chchimpystump_80386CA0(this);
|
||||
this->position_y += 2.5;
|
||||
if(this->unk28 <= this->position_y){
|
||||
this->position_y = this->unk28;
|
||||
func_80328A84(this, 3);
|
||||
func_802BB41C(1);
|
||||
func_80244C78(0);
|
||||
}
|
||||
if((func_8023DB5C() & 3) == 2)
|
||||
func_80353064(this->position, 40.0f);
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
}
|
||||
}
|
374
src/MM/ch/conga.c
Normal file
374
src/MM/ch/conga.c
Normal file
@@ -0,0 +1,374 @@
|
||||
#include <ultra64.h>
|
||||
#include "rand.h"
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(s,t) ((s)<(t)?(s):(t))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(s,t) ((s)<(t)?(t):(s))
|
||||
#endif
|
||||
|
||||
#ifndef SQUARE
|
||||
#define SQUARE(s) ((s)*(s))
|
||||
#endif
|
||||
|
||||
void func_80328FB0(Actor *, f32);
|
||||
|
||||
void func_80328B8C(Actor*, s32, f32, s32);
|
||||
void func_802C8F70(f32);
|
||||
void func_80324E88(f32);
|
||||
Actor *func_8032811C(s32 actor_id, s32 position[3], s32 yaw);
|
||||
void func_80387F44(void);
|
||||
|
||||
void func_803876D0(Actor *);
|
||||
|
||||
typedef struct chconga_s{
|
||||
TUPLE(s32, orangeSpawnPosition);
|
||||
s32 unkC;
|
||||
s32 unk10;
|
||||
u8 pad14[0x4];
|
||||
s32 unk18;
|
||||
s32 unk1C;
|
||||
}ActorLocal_Conga;
|
||||
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo chCongaAnimations[9] = {
|
||||
{0, 0.0f},
|
||||
{ASSET_51_ANIM_CONGA_IDLE, 3.8f},
|
||||
{ASSET_52_ANIM_CONGA_OW, 1.0f},
|
||||
{ASSET_53_ANIM_CONGA_DEFEAT, 2.0f},
|
||||
{ASSET_54_ANIM_CONGA_THROW, 1.4f},
|
||||
{ASSET_55_ANIM_CONGA_BEAT_CHEST, 0.4f},
|
||||
{ASSET_56_ANIM_CONGA_RAISE_ARMS, 0.9f},
|
||||
{0xA2, 1.6f},
|
||||
{ASSET_52_ANIM_CONGA_OW, 1.0f}
|
||||
};
|
||||
|
||||
ActorInfo D_80389998 = { MARKER_7_CONGA, ACTOR_8_CONGA, ASSET_35C_MODEL_CONGA,
|
||||
1, chCongaAnimations,
|
||||
func_803876D0, func_80326224, func_80325888,
|
||||
0, 0x333, 0.0f, 0
|
||||
};
|
||||
|
||||
|
||||
/* code */
|
||||
int func_80386ED0(Actor * this){
|
||||
f32 plyrPos[3];
|
||||
f32 tmpz;
|
||||
|
||||
if(map_get() != MAP_2_MM_MUMBOS_MOUNTAIN)
|
||||
return 0;
|
||||
|
||||
if(!this->unk10_12)
|
||||
return 0;
|
||||
|
||||
player_getPosition(plyrPos);
|
||||
if(plyrPos[1] < 300.0f || 600.0f < plyrPos[1])
|
||||
return 0;
|
||||
|
||||
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;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_80386FB0(Actor *this){
|
||||
func_80328C64(this, func_80329784(this));
|
||||
func_80328FB0(this, 3.0f);
|
||||
}
|
||||
|
||||
void func_80386FE8(void){
|
||||
if( (func_8023DB5C() & 0xF) == 0xB
|
||||
&& 0.85 < randf ()
|
||||
&& !func_803114B0()
|
||||
){
|
||||
func_8030E58C(((s32)(randf ()*256.0f) & 1)? SFX_22_KONGA_NOISE_1: SFX_23_KONGA_NOISE_2, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038708C(Actor *this, s32 anim_id){
|
||||
func_80328B8C(this, anim_id, 0.0f, 1);
|
||||
func_8030E58C(SFX_24_KONGA_NOISE_3, randf2(0.9f, 1.1f));
|
||||
}
|
||||
|
||||
void func_803870D0(Actor *this, ActorMarker *arg1){
|
||||
marker_getActor(arg1)->unk100 = this->marker;
|
||||
}
|
||||
|
||||
void func_80387100(ActorMarker *this){
|
||||
ActorMarker *m = *(ActorMarker **)&this;
|
||||
Actor* actorPtr;
|
||||
f32 sp1C[3];
|
||||
|
||||
actorPtr = marker_getActor(m);
|
||||
sp1C[0] = actorPtr->position_x;
|
||||
sp1C[1] = actorPtr->position_y + 60.0f;
|
||||
sp1C[2] = actorPtr->position_z;
|
||||
func_802C8F70(0.0f);
|
||||
func_80333270(JIGGY_A_MM_CONGA, sp1C, func_803870D0, m);
|
||||
|
||||
}
|
||||
|
||||
void func_80387168(ActorMarker *marker, ActorMarker *other_marker){
|
||||
Actor *actorPtr;
|
||||
|
||||
actorPtr = marker_getActor(marker);
|
||||
if(((ActorLocal_Conga *)&actorPtr->local)->unkC == 1){
|
||||
if(actorPtr->unk10_12 == 0){
|
||||
((ActorLocal_Conga *)&actorPtr->local)->unkC = 0;
|
||||
if(mapSpecificFlags_get(0xA))
|
||||
actorPtr->unk38_31++;
|
||||
|
||||
actorPtr->unk10_12 = MIN(actorPtr->unk38_31, 0xA);
|
||||
if( actorPtr->unk38_31 == 3
|
||||
&& !jiggyscore_isCollected(JIGGY_A_MM_CONGA)
|
||||
){
|
||||
func_80328B8C(actorPtr, 8, 0 ,1);
|
||||
timed_setCameraToNode(0.0f, 0x10);
|
||||
func_80324E38(0.0f, 3);
|
||||
FUNC_8030E624(SFX_84_GOBI_CRYING, 0.8f, 32750);
|
||||
FUNC_8030E624(SFX_84_GOBI_CRYING, 0.8f, 32750);
|
||||
}
|
||||
else if( actorPtr->state != 3
|
||||
&& actorPtr->state != 8
|
||||
){
|
||||
func_8038708C(actorPtr, 2);
|
||||
if(actorPtr->unk38_31 == 1){
|
||||
func_80311480(ASSET_B39_TEXT_CONGA_HIT_BY_EGG, 4, actorPtr->position, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int func_803872EC(void){
|
||||
s32 text_id = func_803114C4();
|
||||
|
||||
return text_id == ASSET_B37_TEXT_CONGA_SAFE_UP_HERE
|
||||
|| text_id == ASSET_B38_TEXT_CONGA_DEFEAT
|
||||
|| func_803203FC(0x1F)
|
||||
|| text_id == ASSET_B3B_TEXT_CONGA_ORANGE_PAD_JIGGY
|
||||
|| text_id == ASSET_B45_TEXT_JIGGY_COLLECT_10
|
||||
|| text_id == ASSET_B51_TEXT_BOTTLES_HOW_TO_EXIT_LEVEL;
|
||||
}
|
||||
|
||||
void func_80387370(ActorMarker *this, enum asset_e text_id, s32 arg2){
|
||||
marker_getActor(this)->velocity_x = 9.0f;
|
||||
timed_setCameraToNode(0.0f, 0x11);
|
||||
func_80324E88(3.2f);
|
||||
func_80324E38(3.2f, 0);
|
||||
}
|
||||
|
||||
void func_803873C8(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;
|
||||
TUPLE(f32, pos) plyr;
|
||||
f32 temp_f22;
|
||||
f32 temp_f20;
|
||||
f32 temp_f18;
|
||||
f32 iHeight;
|
||||
f32 iVelY;
|
||||
|
||||
congaPtr->unk10_12 -= (congaPtr->unk10_12 && ( conga_state == 7));
|
||||
func_80387F44();
|
||||
congaPtr->unk28 = 2.0f;
|
||||
orangePtr = func_8032811C(ACTOR_14_ORANGE_PROJECTILE, conga_localPtr->orangeSpawnPosition, congaPtr->yaw);
|
||||
|
||||
if(orangePtr != NULL){
|
||||
player_getPosition(plyr.pos);
|
||||
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;
|
||||
orangePtr->velocity[1] = randf2(1.8f, 2.2f) * 60.0;
|
||||
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);
|
||||
}
|
||||
orangePtr->velocity_x /= temp_f18;
|
||||
orangePtr->velocity_z /= temp_f18;
|
||||
}
|
||||
}
|
||||
|
||||
void func_803876D0(Actor *this){
|
||||
f32 tmp_f4;
|
||||
NodeProp *sp40;
|
||||
s32 sp3C;
|
||||
|
||||
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 = 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);
|
||||
}
|
||||
if(0.0f == this->unk28){
|
||||
this->unk28 = (func_80326CCC(0x36) != NULL)? 2.0f: 1.0f;
|
||||
}
|
||||
if(0.0f != this->velocity_x){
|
||||
this->velocity_x -= 1.0f;
|
||||
if(0.0f == this->velocity_x){
|
||||
func_802C3C88((GenMethod_1)func_80387100, (s32)this->marker);
|
||||
}
|
||||
}
|
||||
marker_setCollisionScripts(this->marker, NULL, NULL, func_80387168);
|
||||
if( !func_80329530(this, 2100)
|
||||
&& this->state != 2
|
||||
&& this->state != 8
|
||||
){
|
||||
if(this->state > 3 && this->state < 8){
|
||||
actor_loopAnimation(this);
|
||||
func_80328B8C(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)
|
||||
&& !this->unk138_23
|
||||
&& func_80311480(ASSET_B37_TEXT_CONGA_SAFE_UP_HERE, 0, 0, 0, 0, 0)
|
||||
){
|
||||
this->unk138_23 = 1;
|
||||
mapSpecificFlags_set(0xA, 1);
|
||||
}//L803878F8
|
||||
|
||||
if( sp3C && !this->unk138_24){
|
||||
if(func_80311480((player_getTransformation()== TRANSFORM_2_TERMITE) ? ASSET_B3E_TEXT_CONGA_MEET_AS_TERMITE : ASSET_B3C_TEXT_CONGA_MEET, 0, this->position, 0,0,0)){
|
||||
this->unk138_24 = 1;
|
||||
}
|
||||
} //L80387968
|
||||
|
||||
switch(this->state){
|
||||
case 1://80387990
|
||||
actor_loopAnimation(this);
|
||||
func_80386FB0(this);
|
||||
func_80386FE8();
|
||||
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);
|
||||
};
|
||||
}//L80387A18
|
||||
if(actor_animationIsAt(this, 0.66f)){
|
||||
func_80328BD4(this, 6, 0, 1, 0.38f);
|
||||
}
|
||||
if( sp3C
|
||||
&& func_8028ECAC() != 1
|
||||
&& !func_80386ED0(this)
|
||||
&& timedFuncQueue_is_empty()
|
||||
&& !func_8032A9E4(((ActorLocal_Conga *)&this->local)->unk10, ((ActorLocal_Conga *)&this->local)->unk18, ((ActorLocal_Conga *)&this->local)->unk1C)
|
||||
&& !func_803872EC()
|
||||
){
|
||||
func_80328B8C(this, 4, 0.0f, 1);
|
||||
}//L80387AC0
|
||||
if( func_8028ECAC() != 1
|
||||
&& func_80386ED0(this)
|
||||
&& this->unk38_31 != 0
|
||||
&& !func_803872EC()
|
||||
){
|
||||
func_80328B8C(this, 7, 0.0f, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6: //L80387B24
|
||||
((ActorLocal_Conga *)&this->local)->unkC = 1;
|
||||
actor_playAnimationOnce(this);
|
||||
func_80386FE8();
|
||||
if( animctrl_isPlayedForwards(this->animctrl) == TRUE
|
||||
&& actor_animationIsAt(this, 0.0f)
|
||||
){
|
||||
func_80328B8C(this, 5, 0.0f, 1);
|
||||
}
|
||||
else if( !animctrl_isPlayedForwards(this->animctrl)
|
||||
&& actor_animationIsAt(this, 0.001f)
|
||||
){
|
||||
func_80328B8C(this, 1, 0.76f, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: //L80387BC0
|
||||
((ActorLocal_Conga *)&this->local)->unkC = 1;
|
||||
actor_loopAnimation(this);
|
||||
func_80386FE8();
|
||||
if( actor_animationIsAt(this, 0.99f)){
|
||||
func_80328BD4(this, 6, 0.999f, 0, sp3C ? 1.0 : 0.4);
|
||||
}//L80387C30
|
||||
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)){
|
||||
func_8030E58C(SFX_2_CLAW_SWIPE, 0.7f);
|
||||
}
|
||||
func_80386FB0(this);
|
||||
if( !sp3C
|
||||
|| player_is_in_jiggy_jig()
|
||||
|| func_80386ED0(this)
|
||||
|| !timedFuncQueue_is_empty()
|
||||
|| func_803872EC()
|
||||
){
|
||||
func_80328B8C(this, 1, 0.0f, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: //L80387D0C
|
||||
actor_playAnimationOnce(this);
|
||||
if(actor_animationIsAt(this, 0.99f)){
|
||||
func_80328B8C(this, 1, 0.0f, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 8: //L80387D4C
|
||||
actor_playAnimationOnce(this);
|
||||
if(actor_animationIsAt(this, 0.99f)){
|
||||
func_80328B8C(this, 3, 0.0f, 1);
|
||||
func_80311480(ASSET_B38_TEXT_CONGA_DEFEAT, 0xe, this->position, this->marker, func_80387370, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: //L80387DB8
|
||||
actor_loopAnimation(this);
|
||||
if(jiggyscore_isCollected(JIGGY_A_MM_CONGA)){
|
||||
func_80328B8C(this, 1, 0.0f, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 7: //L80387DF0
|
||||
if(this->unk10_12 == 0){
|
||||
if(actor_animationIsAt(this, 0.97f)){
|
||||
((ActorLocal_Conga *)&this->local)->unkC = 1;
|
||||
func_80328B8C(this, 6, 0.0f, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}//L80387E38
|
||||
if( (this->state == 4 && actor_animationIsAt(this, 0.56f))
|
||||
|| (this->state == 7 && actor_animationIsAt(this, 0.468f))
|
||||
){
|
||||
func_8034A1B4(this->marker->unk44, 5, &this->local);
|
||||
func_802C3C88((GenMethod_1)func_803873C8, (s32)this->marker); //spawn orange
|
||||
}
|
||||
}
|
91
src/MM/ch/grublin.c
Normal file
91
src/MM/ch/grublin.c
Normal file
@@ -0,0 +1,91 @@
|
||||
/*!!!DONE!!!*/
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
typedef struct chgrublin_s{
|
||||
f32 unk0;
|
||||
f32 unk4;
|
||||
u8 unk8;
|
||||
u8 unk9;
|
||||
u8 unkA;
|
||||
u8 unkB;
|
||||
u32 unkC_31:3;
|
||||
u32 unkC_28:1;
|
||||
u32 padC_27:28;
|
||||
s16 unk10;
|
||||
s16 unk12;
|
||||
f32 unk14; //90
|
||||
u8 unk18[0x18];
|
||||
s32 unk30;
|
||||
void (*unk34)(ActorMarker *, s32);
|
||||
}ActorLocal_Grublin;
|
||||
|
||||
void func_80328B8C(Actor *, s32, f32, s32);
|
||||
|
||||
void func_80388A80(Actor *);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo chGrublinAnimations[11] = {
|
||||
{0, 0.0f},
|
||||
{0x62, 4.0f},
|
||||
{0x62, 0.7f},
|
||||
{0x63, 0.7f},
|
||||
{0x64, 0.9f},
|
||||
{ASSET_94_ANIM_GRUBLIN_DIE, 1.0f},
|
||||
{0x62, 1.5f},
|
||||
{0x63, 0.5f},
|
||||
{0x62, 1.5f},
|
||||
{0x62, 1000000.0f},
|
||||
{0x62, 1000000.0f}
|
||||
};
|
||||
|
||||
ActorInfo chgrublinInfo = { MARKER_5_GRUBLIN, ACTOR_6_GRUBLIN, ASSET_3C5_MODEL_GRUBLIN,
|
||||
1, chGrublinAnimations,
|
||||
func_80388A80, func_80326224, func_80325888,
|
||||
2500, 0, 1.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_803889A0(ActorMarker *this, s32 arg1){
|
||||
Actor *actorPtr;
|
||||
|
||||
actorPtr = marker_getActor(this);
|
||||
func_80328B8C(actorPtr, 5, 0.0f, 1);
|
||||
actor_playAnimationOnce(actorPtr);
|
||||
FUNC_8030E8B4(SFX_C2_GRUBLIN_EGH, 1.0f, 32000, actorPtr->position, 1250, 2500);
|
||||
|
||||
actor_collisionOff(actorPtr);
|
||||
}
|
||||
|
||||
void func_80388A04(Actor *this){
|
||||
ActorLocal_Grublin *local = (ActorLocal_Grublin *)&this->local;
|
||||
local->unk0 = 1.5f;
|
||||
local->unk4 = 2.3f;
|
||||
local->unk8 = 5;
|
||||
local->unk9 = 7;
|
||||
local->unkC_31 = 2;
|
||||
local->unkA = 9;
|
||||
local->unkB = 9;
|
||||
local->unk10 = 0x29;
|
||||
local->unk12 = 25000;
|
||||
local->unkC_28 = 1;
|
||||
local->unk30 = 0;
|
||||
local->unk34 = func_803889A0;
|
||||
local->unk14 = 1.0f;
|
||||
}
|
||||
|
||||
void func_80388A80(Actor *this) {
|
||||
if (!this->unk16C_4){
|
||||
func_80388A04(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);
|
||||
}
|
||||
if (actor_animationIsAt(this, 0.7f)) {
|
||||
FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 28000, this->position, 1250, 2500);
|
||||
}
|
||||
}
|
||||
}
|
121
src/MM/ch/hut.c
Normal file
121
src/MM/ch/hut.c
Normal file
@@ -0,0 +1,121 @@
|
||||
/*!!!DONE!!!*/
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#include "prop.h"
|
||||
|
||||
|
||||
|
||||
/* extern function declarations */
|
||||
|
||||
void func_802C8F70(f32);
|
||||
void func_802C4218(s32, s32, s32, s32);
|
||||
|
||||
/* public function declarations */
|
||||
Actor *chhut_draw(ActorMarker *, Gfx **, Mtx**, Vtx **);
|
||||
void chhut_update(Actor *);
|
||||
|
||||
/* .bss */
|
||||
extern s32 D_8037DCB0; //mm_hut_smash_count
|
||||
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo chhutAnimations[3] = {
|
||||
{0, 0.0f},
|
||||
{0x4E, 0.25f},
|
||||
{0x4E, 1000000.0f}
|
||||
};
|
||||
|
||||
s32 D_803898D8[6] = { 0, 1, 2, 3, 6, 4};
|
||||
|
||||
ActorInfo chhutInfo = { MARKER_51_MM_HUT, ACTOR_9_MM_HUT, ASSET_7D7_MODEL_MM_HUT,
|
||||
0, chhutAnimations,
|
||||
chhut_update, func_80326224, chhut_draw,
|
||||
0, 0x100, 0.0f, 0
|
||||
};
|
||||
|
||||
|
||||
/* .code */
|
||||
Actor *chhut_draw(ActorMarker *this, Gfx **arg1, Mtx **arg2, Vtx **arg3){
|
||||
Actor *actorPtr;
|
||||
s32 temp_a1;
|
||||
s32 temp_a2;
|
||||
|
||||
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, temp_a2);
|
||||
|
||||
return func_80325888(this, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
void func_803869EC(ActorMarker *this){
|
||||
Actor * actorPtr;
|
||||
f32 *pos;
|
||||
|
||||
actorPtr = marker_getActor(this);
|
||||
actorPtr = func_8032813C(0x4B, actorPtr->position, 0);
|
||||
func_8032813C(ACTOR_4D_STEAM_2, actorPtr->position, 0);
|
||||
|
||||
if(this);
|
||||
}
|
||||
|
||||
void chhut_update(Actor *this){
|
||||
f32 sp3C[3];
|
||||
f32 sp30[3];
|
||||
|
||||
if(func_80334904() != 2)
|
||||
return;
|
||||
|
||||
if(!this->initialized){
|
||||
this->marker->collidable = 0;
|
||||
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]
|
||||
&& 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
|
||||
){
|
||||
sp3C[0] = this->position_x;
|
||||
sp3C[1] = this->position_y;
|
||||
sp3C[2] = this->position_z;
|
||||
sp3C[1] += 125.0;
|
||||
func_8030E484(SFX_5B_HEAVY_STUFF_FALLING);
|
||||
func_80328A84(this, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
func_802C3C88((GenMethod_1)func_803869EC, (s32)this->marker);
|
||||
func_802C8F70(this->yaw);
|
||||
if(D_8037DCB0 < 5){
|
||||
func_802C3F04(func_802C4218, D_803898D8[D_8037DCB0], *(s32*)(&sp3C[0]),*(s32*)(&sp3C[1]),*(s32*)(&sp3C[2]));
|
||||
}
|
||||
else{
|
||||
jiggySpawn(JIGGY_5_MM_HUTS, sp3C);
|
||||
}
|
||||
D_8037DCB0 = ( D_8037DCB0 + 1 ) % 6;
|
||||
}
|
||||
break;
|
||||
case 1: //L80386C2C
|
||||
if(animctrl_getAnimTimer(this->animctrl) > 0.99){
|
||||
animctrl_setTransitionDuration(this->animctrl, 0.0f);
|
||||
func_80328A84(this, 2);
|
||||
this->position_y -= 160.0f;
|
||||
}
|
||||
break;
|
||||
case 2: //L80386C80
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void func_80386C90(void){
|
||||
D_8037DCB0 = 0;
|
||||
}
|
227
src/MM/ch/juju.c
Normal file
227
src/MM/ch/juju.c
Normal file
@@ -0,0 +1,227 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
/* extern functions */
|
||||
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;
|
||||
|
||||
/* public functions */
|
||||
void func_80389598(Actor *this);
|
||||
Actor* func_80389014(ActorMarker *, Gfx **, Mtx**, Vtx** );
|
||||
|
||||
extern s32 D_80389C90;
|
||||
|
||||
/* .data */
|
||||
ActorInfo chjujuInfo = { MARKER_67_JUJU, ACTOR_59_JUJU, ASSET_2E6_MODEL_JUJU,
|
||||
0, NULL,
|
||||
func_80389598, func_80326224, func_80389014,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
void func_80388FD0(Actor *this, f32 *arg1, f32 *arg2, s32 arg3){
|
||||
ActorLocal_Juju_2 *local;
|
||||
|
||||
local = (ActorLocal_Juju_2 *)&this->local;
|
||||
local->unk0 = arg3;
|
||||
local->unk14 = 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];
|
||||
}
|
||||
|
||||
Actor* func_80389014(ActorMarker *this, Gfx **dl, Mtx **mPtr, Vtx **arg2){
|
||||
f32 sp34[3];
|
||||
Actor * actorPtr;
|
||||
ActorLocal_Juju_2 *jujuPtr;
|
||||
|
||||
actorPtr = func_80325300(this, sp34);
|
||||
jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local;
|
||||
if(jujuPtr->unk0 != 2){
|
||||
set_model_render_mode(1);
|
||||
func_803391A4(dl, mPtr, actorPtr->position, sp34, jujuPtr->unk14, NULL, func_80330B1C(this));
|
||||
}
|
||||
return actorPtr;
|
||||
}
|
||||
|
||||
void func_803890A0(ActorMarker *arg0, s32 arg1){
|
||||
int s1;
|
||||
Actor* actorPtr = marker_getActor(arg0);
|
||||
f32 sp5C[3];
|
||||
s32 i;
|
||||
Actor* jujuPtr;
|
||||
|
||||
sp5C[0] = actorPtr->position_x;
|
||||
sp5C[1] = actorPtr->position_y;
|
||||
sp5C[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);
|
||||
func_80388DE8(actorPtr, i, jujuPtr);
|
||||
s1 = (i >= arg1);
|
||||
func_80388FD0(jujuPtr, sp5C, actorPtr->position, (s1)? 1 : 2);
|
||||
if(s1){
|
||||
sp5C[1] += 250.0f;
|
||||
}
|
||||
if(i == arg1){
|
||||
((ActorLocal_Juju_2 *)&jujuPtr->local)->unk18 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_803891E8(s32 x, s32 y, s32 z, s32 yaw){
|
||||
f32 sp1C[3];
|
||||
sp1C[0] = x;
|
||||
sp1C[1] = y + 0x14;
|
||||
sp1C[2] = z;
|
||||
jiggySpawn(JIGGY_4_MM_JUJU, sp1C);
|
||||
}
|
||||
|
||||
void func_80389244(s32 x, s32 y, s32 z, s32 yaw){
|
||||
func_802C3F04(func_803891E8, x, y, z, yaw);
|
||||
func_802BB3DC(0, 10.0f, 0.8f);
|
||||
func_80314AC8(1);
|
||||
}
|
||||
|
||||
void func_803892A8(ActorMarker **ptr){
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 s2;
|
||||
s32 s6;
|
||||
Actor *actorPtr;
|
||||
ActorLocal_Juju_2 *jujuPtr;
|
||||
|
||||
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){
|
||||
func_80314AC8(0);
|
||||
timedFunc_set_4(1.25f, func_80389244, jujuPtr->unk8_x, jujuPtr->unk8_y, jujuPtr->unk8_z, actorPtr->yaw);
|
||||
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x6d60);
|
||||
}
|
||||
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;
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int func_8038941C(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;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int func_8038948C(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;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_80389514(ActorMarker **ptr){
|
||||
s32 i;
|
||||
D_80389C90 = 0;
|
||||
for(i = 0; i < 4; i++){
|
||||
if(((ActorLocal_Juju_2 *)&marker_getActor(ptr[i])->local)->unk0 != 2){
|
||||
D_80389C90++;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
switch(jujuPtr->unk0){
|
||||
case 1: //L80389624
|
||||
sp34 = this->yaw;
|
||||
this->yaw += ((0xb - D_80389C90*2)*time_getDelta()*60.0f)/2;
|
||||
if(360.0f < this->yaw){
|
||||
sp38 = 1;
|
||||
this->yaw -= 360.0f;
|
||||
}//L803896B4
|
||||
if(jujuPtr->unk18){
|
||||
if(sp38 || (sp34 < 180.0f && 180.0f <= this->yaw)){
|
||||
mapSpecificFlags_set(9,1);
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
|
161
src/MM/ch/jujuhitbox.c
Normal file
161
src/MM/ch/jujuhitbox.c
Normal file
@@ -0,0 +1,161 @@
|
||||
/*!!!DONE!!!*/
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
/* extern functions */
|
||||
void func_80388DFC(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;
|
||||
|
||||
/* public functions */
|
||||
void func_80388E20(Actor *this);
|
||||
Actor* func_80388DC0(ActorMarker *, Gfx **, Mtx**, Vtx **);
|
||||
void func_80388DE8(Actor* this, s32 slave_id, Actor *slavePtr);
|
||||
|
||||
/* .data */
|
||||
ActorInfo chjujuhitboxInfo = { MARKER_67_JUJU, ACTOR_11_JUJU_CTRL, 0,
|
||||
3, NULL,
|
||||
func_80388E20, func_80326224, func_80388DC0,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
int func_80388B30(Actor *this, float arg1){
|
||||
f32 yaw;
|
||||
|
||||
yaw = this->yaw - func_80329784(this);
|
||||
|
||||
if(180.0f <= yaw){
|
||||
yaw -= 360.0f;
|
||||
}
|
||||
else if(yaw < -180.0f){
|
||||
yaw += 360.0f;
|
||||
}
|
||||
|
||||
if (yaw < 0.0f){
|
||||
yaw = -yaw;
|
||||
}
|
||||
|
||||
if (yaw < arg1){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void func_80388BEC(s16 *arg0, ActorMarker *arg1){
|
||||
f32 sp34;
|
||||
Actor *sp30;
|
||||
Actor *temp_v0;
|
||||
f32 sp20[3];
|
||||
|
||||
|
||||
sp20[0] = (f32)arg0[0];
|
||||
sp20[1] = (f32)arg0[1];
|
||||
sp20[2] = (f32)arg0[2];
|
||||
sp30 = func_80326D68(sp20, 0x11, -1, &sp34);
|
||||
if( sp30 != NULL
|
||||
&& !( sp34 > 500.0f )
|
||||
&& (sp30->state ==3)
|
||||
){
|
||||
temp_v0 = marker_getActor(((ActorLocal_JujuHitbox *)&sp30->local)->unk8[((ActorLocal_JujuHitbox *)&sp30->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);
|
||||
func_802C3F04((GenMethod_4)func_802C4140, 0x58, *(s32 *)&sp20[0], *(s32 *)&sp20[1], *(s32 *)&sp20[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80388D14(Actor *this){
|
||||
ActorLocal_JujuHitbox *jujuCtlPtr;
|
||||
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local;
|
||||
func_8030E878(0x3F6, jujuCtlPtr->unk18, 20000, this->position, 300.0f, 2000.0f);
|
||||
}
|
||||
|
||||
void func_80388D60(Actor *this){
|
||||
ActorLocal_JujuHitbox *jujuCtlPtr;
|
||||
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local;
|
||||
if(!func_8038941C(jujuCtlPtr->unk8)){
|
||||
jujuCtlPtr->unk18 *= 1.05;
|
||||
}
|
||||
this->state = 3;
|
||||
}
|
||||
|
||||
Actor* func_80388DC0(ActorMarker *this, Gfx **dl, Mtx**mPtr, Vtx **arg3){
|
||||
return marker_getActor(this);
|
||||
}
|
||||
|
||||
void func_80388DE8(Actor *this, s32 child_id, Actor *childPtr){
|
||||
ActorLocal_JujuHitbox *jujuCtlPtr;
|
||||
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local;
|
||||
jujuCtlPtr->unk8[child_id] = childPtr->marker;
|
||||
}
|
||||
|
||||
void func_80388DFC(ActorMarker *arg0, s32 arg1){
|
||||
func_803890A0(arg0, arg1);
|
||||
|
||||
if(arg0 && arg1); //for args to save
|
||||
}
|
||||
|
||||
void func_80388E20(Actor *this){
|
||||
ActorLocal_JujuHitbox *jujuCtlPtr;
|
||||
s32 i;
|
||||
|
||||
jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local;
|
||||
if(!this->initialized){
|
||||
this->initialized = 1;
|
||||
this->unk138_24 = 0;
|
||||
jujuCtlPtr->unk18 = 0.5f;
|
||||
}
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = 1;
|
||||
func_802C3D3C(func_80388DFC,this->marker, jujuCtlPtr->unk4);
|
||||
func_80388D14(this);
|
||||
}else{
|
||||
if( func_80329530(this, 0xfa)
|
||||
&& !func_80329530(this, 0x50)
|
||||
&& !func_8028ECAC()
|
||||
){
|
||||
if( !this->unk138_24 ){
|
||||
if(func_80311480(ASSET_B44_TEXT_JUJU_MEET, 0, 0, 0, NULL, NULL)){
|
||||
this->unk138_24 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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(0x9)){
|
||||
func_80388D14(this);
|
||||
mapSpecificFlags_set(0x9, 0);
|
||||
}
|
||||
}
|
||||
}
|
138
src/MM/ch/lmonkey.c
Normal file
138
src/MM/ch/lmonkey.c
Normal file
@@ -0,0 +1,138 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
void func_8028E668(f32 *, f32, f32, f32);
|
||||
int actor_animationIsAt(Actor *, f32);
|
||||
void func_80328B8C(Actor *, s32, f32, s32);
|
||||
void func_80324E88(f32);
|
||||
void func_80324E38(f32,s32);
|
||||
void timed_setCameraToNode(f32, s32);
|
||||
s32 func_8028F31C(f32 *, f32, s32, Actor **);
|
||||
void func_8028FA34(s32, Actor *);
|
||||
|
||||
|
||||
void func_803885D0(Actor *);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo chlmonkeyAnimations[5] = {
|
||||
{0, 0.0f},
|
||||
{0x5C, 2.3f},
|
||||
{0x5B, 0.67f},
|
||||
{0x5D, 0.5f},
|
||||
{0x5C, 2.3f}
|
||||
};
|
||||
|
||||
ActorInfo chlmonkeyInfo = { MARKER_A_CHIMPY, ACTOR_F_CHIMPY, ASSET_35D_MODEL_CHIMPY,
|
||||
1, chlmonkeyAnimations,
|
||||
NULL, func_803885D0, func_80325888,
|
||||
2500, 0, 0.8f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_80388300(Actor **arg0){
|
||||
func_8028F31C((*arg0)->position, 800.0f, ACTOR_29_ORANGE_COLLECTABLE, arg0);
|
||||
if( func_80329530(*arg0, 0x159)
|
||||
&& func_8028E88C() == 0x36
|
||||
&& func_8028FC34()
|
||||
){
|
||||
func_8028FA34(0xc6, *arg0);
|
||||
(*arg0)->unk138_24 = 1;
|
||||
timed_setCameraToNode(1.2f, 0xF);
|
||||
func_80324E38(1.2f, 3);
|
||||
}
|
||||
if(arg0);
|
||||
}
|
||||
|
||||
void func_803883AC(Actor *this){
|
||||
f32 sp2C;
|
||||
f32 sp28;
|
||||
static D_80389A5C = 0;
|
||||
|
||||
|
||||
sp2C = ml_map_f(func_8032970C(this), 1000000.0f, 343000000.0f, 18000.0f, 0.0f);
|
||||
sp28 = randf();
|
||||
D_80389A5C--;
|
||||
if(D_80389A5C < 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_803884C0(s32 x, s32 y, s32 z){
|
||||
f32 sp1C[3];
|
||||
TUPLE_ASSIGN(sp1C, x, y, z);
|
||||
jiggySpawn(JIGGY_9_MM_CHIMPY, sp1C);
|
||||
}
|
||||
|
||||
void func_80388514(ActorMarker *marker, enum asset_e arg1, s32 arg2){
|
||||
Actor * actor = marker_getActor(marker);
|
||||
mapSpecificFlags_set(4,1);
|
||||
func_80328A84(actor, 3);
|
||||
timed_setCameraToNode(2.3f, 0x12);
|
||||
timedFunc_set_3(2.9f,func_803884C0, actor->position_x, actor->position_y + 150.0f, actor->position_z);
|
||||
func_80324E88(4.3f);
|
||||
func_80324E38(4.3f, 0);
|
||||
}
|
||||
|
||||
void func_803885D0(Actor *this){
|
||||
func_8028E668(this->position, 35.0f, 0.0f, 65.0f);
|
||||
actor_collisionOff(this);
|
||||
this->marker->propPtr->unk8_3 = 1;
|
||||
if(map_get() != MAP_2_MM_MUMBOS_MOUNTAIN){
|
||||
func_80343DEC(this);
|
||||
}else{//L80388630
|
||||
if(func_80329530(this, 0x2BC) && !func_803114B0()){
|
||||
func_803883AC(this);
|
||||
}//L8038865C
|
||||
switch(this->state){
|
||||
case 1://L80388690
|
||||
if(mapSpecificFlags_get(2)){
|
||||
func_80328A84(this, 4);
|
||||
if(!jiggyscore_isCollected(JIGGY_9_MM_CHIMPY)){
|
||||
func_80311480(0xB40, 0xE, this->position, this->marker, func_80388514, NULL);
|
||||
}else{//L803886E8
|
||||
func_80388514(this->marker, 0xB40, -1);
|
||||
}//L80388898
|
||||
}else{
|
||||
func_80388300(&this);
|
||||
if( func_80329530(this, 0x159)
|
||||
&& !func_80329530(this, 0x96)
|
||||
&& !item_getCount(ITEM_19_ORANGE)
|
||||
&& !this->unk138_24
|
||||
){
|
||||
func_80311480(0xb3f, 0xe, this->position, NULL, NULL, NULL);
|
||||
this->unk138_24 = 1;
|
||||
}//L80388774
|
||||
actor_loopAnimation(this);
|
||||
func_80328BD4(this, 2, 0.0f, -1, 0.02f);
|
||||
}
|
||||
break;
|
||||
case 2: //L803887A4
|
||||
func_80388300(&this);
|
||||
actor_playAnimationOnce(this);
|
||||
if(actor_animationIsAt(this, 0.99f)){
|
||||
func_80328B8C(this,1,0.0f,-1);
|
||||
}
|
||||
break;
|
||||
case 4: //L803887E4
|
||||
actor_loopAnimation(this);
|
||||
break;
|
||||
case 3: //L803887F4
|
||||
func_80343DEC(this);
|
||||
actor_loopAnimation(this);
|
||||
if(0.19 <= this->unk48){
|
||||
mapSpecificFlags_set(0, 1);
|
||||
}
|
||||
if(0.24 <= this->unk48){
|
||||
mapSpecificFlags_set(3, 1);
|
||||
}
|
||||
if(0.99 <= this->unk48){
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}//L80388898
|
||||
}
|
97
src/MM/ch/orange.c
Normal file
97
src/MM/ch/orange.c
Normal file
@@ -0,0 +1,97 @@
|
||||
/*!!!DONE!!!*/
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(s,t) ((s < t)?(s):(t))
|
||||
#endif
|
||||
|
||||
/* extern functions */
|
||||
f32 func_80309724(f32*);
|
||||
|
||||
/* public functions */
|
||||
void 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,
|
||||
1, NULL,
|
||||
func_80387FF4, func_80326224, func_80388188,
|
||||
0, 0, 0.6f, 0
|
||||
};
|
||||
|
||||
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)
|
||||
&& !mapSpecificFlags_get(mapflag_mm_main_hit_with_orange)
|
||||
&& func_80311480(ASSET_B3A_TEXT_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL)
|
||||
){
|
||||
mapSpecificFlags_set(mapflag_mm_main_hit_with_orange, 1);
|
||||
}
|
||||
|
||||
if(arg0);
|
||||
}
|
||||
|
||||
void func_80387FF4(Actor * this){
|
||||
f32 temp_f2;
|
||||
f32 temp_f0;
|
||||
|
||||
if(!this->initialized){
|
||||
this->marker->unk2C_1 = 1;
|
||||
marker_setCollisionScripts(this->marker, NULL, func_80387F90, NULL);
|
||||
}
|
||||
switch(this->state){
|
||||
case 1://L80388060
|
||||
this->position_x += this->velocity_x;
|
||||
temp_f0 = this->velocity_y - 5.0;
|
||||
this->velocity_y = temp_f0;
|
||||
this->position_y += temp_f0;
|
||||
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;
|
||||
func_8030E6D4(SFX_2F_ORANGE_SPLAT);
|
||||
|
||||
this->unk28 = 1.0f;
|
||||
this->unk60 = 340.0f;
|
||||
this->state = 2;
|
||||
}
|
||||
break;
|
||||
case 2://L8038810C
|
||||
if(this->unk60 < 324.0){
|
||||
this->marker->collidable = 0;
|
||||
}
|
||||
this->unk60 -= 4.0;
|
||||
if(this->unk60 < 4.0){
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Actor *func_80388188(ActorMarker *this, Gfx **dl, Mtx **mptr, Vtx **vtx){
|
||||
Actor* actorPtr = func_80325E78(this, dl, mptr, vtx);
|
||||
f32 sp60[3] = D_803899F4;
|
||||
f32 sp54[3] = D_80389A00;
|
||||
f32 sp48[3];
|
||||
|
||||
if(actorPtr->state == 2){
|
||||
sp48[0] = actorPtr->position_x;
|
||||
sp48[1] = actorPtr->unk1C_y + 3.0f;
|
||||
sp48[2] = actorPtr->position_z;
|
||||
func_8033A410( (s32) MIN(255.0f, actorPtr->unk60) );
|
||||
set_model_render_mode(1);
|
||||
func_803391A4(dl, mptr, sp48, sp54, actorPtr->unk28, sp60, func_8030A428(0x18));
|
||||
actorPtr->position_y -= 1.9;
|
||||
if(actorPtr->unk28 < 2.428){
|
||||
actorPtr->unk28 += 0.1;
|
||||
}
|
||||
}
|
||||
return actorPtr;
|
||||
}
|
141
src/MM/ch/orangepad.c
Normal file
141
src/MM/ch/orangepad.c
Normal file
@@ -0,0 +1,141 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
/* extern functions */
|
||||
void func_80326224(Actor *);
|
||||
void func_80329904(ActorMarker *, s32, void *);
|
||||
extern void func_802EFA20(ParticleEmitter *, f32, f32);
|
||||
|
||||
|
||||
/* public functions */
|
||||
void func_80386768(Actor *);
|
||||
|
||||
|
||||
|
||||
/* .data */
|
||||
ActorInfo chorangepadInfo = { MARKER_66_ORANGE_PAD, ACTOR_57_ORANGE_PAD, ASSET_2EB_MODEL_ORANGE_PAD,
|
||||
0, NULL,
|
||||
func_80386768, func_80326224, func_80325888,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
extern f32 D_80389B40;
|
||||
extern f64 D_80389B48;
|
||||
|
||||
/*.code */
|
||||
void func_803863F0(s32 x, s32 y, s32 z){
|
||||
f32 pos[3];
|
||||
|
||||
TUPLE_ASSIGN(pos, x, y, z);
|
||||
|
||||
jiggySpawn(JIGGY_8_MM_ORANGE_PADS, pos);
|
||||
}
|
||||
|
||||
void func_80386444(ActorMarker *arg0){
|
||||
f32 sp54;
|
||||
Actor *actor;
|
||||
f32 sp44[3];
|
||||
ParticleEmitter *s0;
|
||||
s32 temp_a0;
|
||||
|
||||
sp44[0] = arg0->propPtr->x;
|
||||
sp44[1] = arg0->propPtr->y;
|
||||
sp44[2] = arg0->propPtr->z;
|
||||
actor = func_80326D68(sp44, 0x57, 1, &sp54);
|
||||
|
||||
|
||||
if(actor && !(500.0f < sp54)){
|
||||
actor->state = 1;
|
||||
if(func_80326D68(sp44, 0x57, 1, &sp54)){
|
||||
func_8025A6EC(COMUSIC_2B_DING_B, 22000);
|
||||
}else{
|
||||
temp_a0 = (actor->unk78_13 == 0x106) ? 0x10 : (actor->unk78_13 == 0x76) ? 0xf : 0xe;
|
||||
|
||||
func_802BAFE4(temp_a0);
|
||||
sp44[1] += 50.0f;
|
||||
timedFunc_set_3(0.6f, (TFQM3) func_803863F0, (s32)sp44[0], (s32)sp44[1], (s32)sp44[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
|
||||
|
||||
s0 = partEmitList_pushNew(0x1e);
|
||||
particleEmitter_setPosition(s0, actor->position);
|
||||
particleEmitter_setModel(s0, 0x89f);
|
||||
func_802EFB70(s0, 0.09f, 0.19f);
|
||||
func_802EFB84(s0, 0.0f, 0.0f);
|
||||
|
||||
particleEmitter_setParticleVelocityRange(s0,
|
||||
-200.0f, 500.0f, -200.0f,
|
||||
200.0f, 700.0f, 200.0f
|
||||
);
|
||||
|
||||
particleEmitter_setParticleAccelerationRange(s0,
|
||||
0.0f, -1200.0f, 0.0f,
|
||||
0.0f, -1200.0f, 0.0f
|
||||
);
|
||||
|
||||
func_802EFE24(s0,
|
||||
-600.0f, -600.0f, -600.0f,
|
||||
600.0f, 600.0f, 600.0f
|
||||
);
|
||||
particleEmitter_setSpawnIntervalRange(s0, 0.0f, 0.01f);
|
||||
func_802EFEC0(s0, 4.0f, 4.0f);
|
||||
func_802EF9F8(s0, 0.01f);
|
||||
func_802EFA18(s0, 3);
|
||||
func_802EFA20(s0, 1.0f, 1.3f);
|
||||
particleEmitter_emitN(s0, 0x1e);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80386744(s32 arg0, ActorMarker *arg1) {
|
||||
func_80386444(arg1);
|
||||
}
|
||||
|
||||
void func_80386768(Actor * this){
|
||||
Actor *sp3C;
|
||||
f32 pad;
|
||||
f32 sp34;
|
||||
|
||||
|
||||
if(!this->initialized){
|
||||
this->marker->propPtr->unk8_3 = 1;
|
||||
actor_collisionOff(this);
|
||||
this->initialized = 1;
|
||||
}//L803867B0
|
||||
|
||||
if(!this->unk16C_4){
|
||||
this->unk100 = func_80326D68(this->position, 8,-1, &sp34)->marker;
|
||||
this->unk16C_4 = 1;
|
||||
}//L803867E0
|
||||
|
||||
if(this->unk100){
|
||||
sp3C = marker_getActor(this->unk100);
|
||||
}
|
||||
|
||||
if( func_80329530(this, 0x28)
|
||||
&& !func_8028ECAC()
|
||||
&& !mapSpecificFlags_get(6)
|
||||
&& sp3C->state != 3
|
||||
){
|
||||
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(255.0 == this->unk60){
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
}else{
|
||||
}//L80386928
|
||||
|
||||
actor_setOpacity(this, 0xFF - (s32)this->unk60);
|
||||
}//*/
|
34
src/MM/code_1AD0.c
Normal file
34
src/MM/code_1AD0.c
Normal file
@@ -0,0 +1,34 @@
|
||||
//!!!DONE
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
u8 D_803899C0[] = {0x00, 0x0C, 0x74, 0x0C, 0xCD, 0x24, 0x9C, 0xB3, 0x00, 0x00, 0xD4, 0x4F};
|
||||
|
||||
void func_802D1724(void);
|
||||
|
||||
void func_80387EC0(void) {
|
||||
u32 *temp_v0;
|
||||
u32 temp_a0;
|
||||
|
||||
temp_v0 = (u32* )func_802D1724;
|
||||
if (getGameMode() != 7) {
|
||||
temp_a0 = (temp_v0[2] & 0x03FFFFFF)*4; //get offset
|
||||
temp_a0 += (u32)&temp_v0[3] & 0xF0000000; //get region
|
||||
((u32 *)temp_a0)[0] = 0x03E00008; //jr $ra
|
||||
((u32 *)temp_a0)[1] = 0x24020002; //addiu $v0, $zero, 0x2
|
||||
|
||||
osWritebackDCache((void *)temp_a0, 8);
|
||||
osInvalICache((void *)temp_a0, 8);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80387F44(void) {
|
||||
s32 sp1C;
|
||||
|
||||
osPiReadIo(0x578, (u32 *)&sp1C);
|
||||
sp1C = sp1C & (sp1C ^ 0xFFFF0000);
|
||||
if (sp1C != 0x8965){
|
||||
func_80387EC0();
|
||||
}
|
||||
}
|
28
src/MM/code_24C0.c
Normal file
28
src/MM/code_24C0.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/*!!!DONE!!!*/
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#include "prop.h"
|
||||
|
||||
extern ActorInfo chhutInfo;
|
||||
extern ActorInfo chchimpystump;
|
||||
extern ActorInfo chgrublinInfo;
|
||||
extern ActorInfo chcongaInfo;
|
||||
extern ActorInfo chorangeInfo;
|
||||
extern ActorInfo chjujuhitboxInfo;
|
||||
extern ActorInfo chjujuInfo;
|
||||
extern ActorInfo chorangepadInfo;
|
||||
extern ActorInfo chlmonkeyInfo;
|
||||
|
||||
void func_803888B0(void){
|
||||
spawnableActorList_add( &chhutInfo, actor_new, 0X400);
|
||||
spawnableActorList_add( &chchimpystump, actor_new, 0x0);
|
||||
spawnableActorList_add( &chgrublinInfo, actor_new, 0X2000121);
|
||||
spawnableActorList_add( &chcongaInfo, actor_new, 0X2000160);
|
||||
spawnableActorList_add( &chorangeInfo, actor_new, 0x0);
|
||||
spawnableActorList_add( &chjujuhitboxInfo, actor_new, 0x0);
|
||||
spawnableActorList_add( &chjujuInfo, actor_new, 0X4004);
|
||||
spawnableActorList_add( &chorangepadInfo, actor_new, 0X40);
|
||||
spawnableActorList_add( &chlmonkeyInfo, actor_new, 0X100);
|
||||
}
|
Reference in New Issue
Block a user