The first commit
This commit is contained in:
162
src/core2/ch/badShad.c
Normal file
162
src/core2/ch/badShad.c
Normal file
@@ -0,0 +1,162 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern void func_802C3D3C(void (*)(s32, s32), s32, s32);
|
||||
|
||||
Actor *func_802D6F48(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3);
|
||||
void func_802D6EA0(Actor *this);
|
||||
void func_802D729C(Actor *actor, f32 arg1);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80367A50 = {
|
||||
0x9B, 0x108, 0x3BF,
|
||||
0x1, NULL,
|
||||
func_802D6EA0, func_80326224, func_802D6F48,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .bss */
|
||||
f32 D_8037DE10[3];
|
||||
f32 D_8037DE20[3];
|
||||
|
||||
/* .code */
|
||||
void func_802D6EA0(Actor *this){
|
||||
s32 iVar1;
|
||||
if(!this->initialized){
|
||||
this->initialized = 1;
|
||||
this->marker->collidable = 0;
|
||||
}
|
||||
if(!this->despawn_flag && this->unk1C_x < (f32)(func_8023DB5C() - 1) ){
|
||||
if(this->unk104){
|
||||
marker_getActor(this->unk104)->unk104 = 0;
|
||||
}
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
}
|
||||
|
||||
Actor *func_802D6F48(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
f32 sp44[3];
|
||||
f32 sp40;
|
||||
Actor *this = func_80325300(marker, sp44);
|
||||
Actor *other;
|
||||
if(this->despawn_flag)
|
||||
return this;
|
||||
|
||||
if(this->unk104){
|
||||
other = marker_getActor(this->unk104);
|
||||
}
|
||||
|
||||
if(other)
|
||||
func_8033A410(other->alpha_124_19);
|
||||
sp40 = ml_map_f(this->unk28, 0.0f , 800.0f, 0.53f, 0.18f)*this->unk1C[1];
|
||||
set_model_render_mode(2);
|
||||
func_803391A4(gfx, mtx, this->position, sp44, sp40, NULL, func_80330B1C(marker));
|
||||
return this;
|
||||
}
|
||||
|
||||
f32 func_802D7038(Actor *this) {
|
||||
f32 sp34;
|
||||
f32 sp28[3];
|
||||
|
||||
sp34 = 0.0f;
|
||||
if( (this->spawn_position_x == this->position_x)
|
||||
&& (this->spawn_position_z == this->position_z)
|
||||
){
|
||||
D_8037DE10[0] = this->spawn_position[0];
|
||||
D_8037DE10[1] = this->spawn_position[1];
|
||||
D_8037DE10[2] = this->spawn_position[2];
|
||||
} else {
|
||||
this->spawn_position[0] = this->position[0];
|
||||
this->spawn_position[2] = this->position[2];
|
||||
sp28[0] = this->position[0];
|
||||
sp28[1] = this->position[1];
|
||||
sp28[2] = this->position[2];
|
||||
if (func_803209F8(D_8037DE10, D_8037DE20, &sp34, sp28)) {
|
||||
this->spawn_position[1] = D_8037DE10[1];
|
||||
} else {
|
||||
D_8037DE10[0] = sp28[0];
|
||||
D_8037DE10[1] = sp28[1];
|
||||
D_8037DE10[2] = sp28[2];
|
||||
this->spawn_position[1] = sp28[1];
|
||||
}
|
||||
}
|
||||
return sp34;
|
||||
}
|
||||
|
||||
void func_802D7124(Actor *actor, f32 arg1) {
|
||||
f32 sp1C[3];
|
||||
|
||||
func_8024C5CC(&sp1C);
|
||||
if ((actor->position[0] - sp1C[0]) * (actor->position[0] - sp1C[0]) + (actor->position[2] - sp1C[2]) * (actor->position[2] - sp1C[2]) < 12250000.0f) {
|
||||
func_802D729C(actor, arg1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void func_802D71A0(s32 this, s32 arg1){
|
||||
ActorMarker *marker;
|
||||
f32 sp40;
|
||||
Actor *sp3C;
|
||||
Actor *sp38;
|
||||
s32 sp2C[3];
|
||||
f32 sp28;
|
||||
|
||||
marker = reinterpret_cast(ActorMarker *,this);
|
||||
sp38 = marker_getActor(marker);
|
||||
if(!sp38->despawn_flag){
|
||||
sp40 = reinterpret_cast(f32,arg1);
|
||||
sp38 = marker_getActor(marker);
|
||||
sp28 = func_802D7038(sp38);
|
||||
sp2C[0] = (s32) D_8037DE10[0];
|
||||
sp2C[1] = (s32) D_8037DE10[1];
|
||||
sp2C[2] = (s32) D_8037DE10[2];
|
||||
sp3C = func_803056FC(0x108, sp2C, (s32)sp38->yaw);
|
||||
if(sp3C){
|
||||
marker_getActor(marker)->unk104 = sp3C->marker;
|
||||
sp3C->unk104 = marker;
|
||||
sp3C->unk1C[0] = func_8023DB5C();
|
||||
sp3C->unk1C[1] = sp40;
|
||||
sp3C->unk28 = sp28;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_802D729C(Actor *actor, f32 arg1){
|
||||
Actor *sp1C;
|
||||
if(actor->despawn_flag){
|
||||
if(actor->unk104){
|
||||
sp1C = marker_getActor(actor->unk104);
|
||||
sp1C->unk104 = NULL;
|
||||
marker_getActor(actor->unk104)->despawn_flag = TRUE;
|
||||
}
|
||||
else{
|
||||
}
|
||||
actor->unk104 = NULL;
|
||||
return;
|
||||
}
|
||||
if(!actor->unk104){
|
||||
func_802C3D3C(func_802D71A0, (s32) actor->marker, reinterpret_cast(s32, arg1));
|
||||
return;
|
||||
}
|
||||
|
||||
sp1C = marker_getActor(actor->unk104);
|
||||
if(sp1C->despawn_flag == TRUE)
|
||||
return;
|
||||
|
||||
if(!((func_8023DB5C() ^ actor->marker->actrArrayIdx) & 0x7)){
|
||||
sp1C->unk28 = func_802D7038(actor);
|
||||
sp1C->position_x = D_8037DE10[0];
|
||||
sp1C->position_y = D_8037DE10[1] + 6.0f;
|
||||
sp1C->position_z = D_8037DE10[2];
|
||||
sp1C->yaw = D_8037DE20[1];
|
||||
sp1C->pitch = D_8037DE20[0];
|
||||
sp1C->roll = D_8037DE20[2];
|
||||
}
|
||||
else{
|
||||
sp1C->position_x = actor->position_x;
|
||||
sp1C->position_z = actor->position_z;
|
||||
}
|
||||
sp1C->unk1C[0] = func_8023DB5C();
|
||||
sp1C->unk1C[1] = arg1;
|
||||
}
|
89
src/core2/ch/beehive.c
Normal file
89
src/core2/ch/beehive.c
Normal file
@@ -0,0 +1,89 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
void func_802CE8D4(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_803672C0[] ={
|
||||
{0x000, 0.0f},
|
||||
{ASSET_165_ANIM_BEEHIVE_IDLE, 0.65f},
|
||||
{ASSET_65_ANIM_BEEHIVE_DIE, 0.5f},
|
||||
{ASSET_65_ANIM_BEEHIVE_DIE, 1000000.0f},
|
||||
};
|
||||
|
||||
ActorInfo D_803672E0 = {0x50, ACTOR_12_BEEHIVE, ASSET_364_MODEL_BEEHIVE,
|
||||
1, &D_803672C0,
|
||||
func_802CE8D4, func_80326224, func_80325888,
|
||||
0, 0x333, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_802CE7E0(ActorMarker *marker, s32 arg1){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
FUNC_8030E8B4(SFX_11_WOOD_BREAKING_1, 1.0f, 28000, actor->position, 300, 3000);
|
||||
FUNC_8030E8B4(SFX_D_EGGSHELL_BREAKING, 1.0f, 28000, actor->position, 300, 3000);
|
||||
func_80328A84(actor, 2);
|
||||
actor_playAnimationOnce(actor);
|
||||
marker->collidable = FALSE;
|
||||
actor->unk138_27 = 3;
|
||||
func_802C3F04(func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, actor->position[0]), reinterpret_cast(s32, actor->position[1]), reinterpret_cast(s32, actor->position[2]));
|
||||
func_802C3F04(func_802C4140, ACTOR_4A_WOOD_EXPLOSION, reinterpret_cast(s32, actor->position[0]), reinterpret_cast(s32, actor->position[1]), reinterpret_cast(s32, actor->position[2]));
|
||||
actor->marker->propPtr->unk8_3 = 0;
|
||||
func_803115C4(ASSET_D96_TEXT_BEEHIVE);
|
||||
func_803115C4(ASSET_DA6_TEXT_BEEHIVE_WITH_BEES);
|
||||
}
|
||||
|
||||
void func_802CE8D4(Actor *this){
|
||||
if(!this->unk16C_4){
|
||||
marker_setCollisionScripts(this->marker, NULL, NULL, func_802CE7E0);
|
||||
this->marker->propPtr->unk8_3 = 1;
|
||||
this->unk44_31 = func_8030D90C();
|
||||
this->unk16C_4 = 1;
|
||||
this->unk38_0 = func_803203FC(1)| func_803203FC(0x1F);
|
||||
}//L802CE960
|
||||
if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){
|
||||
if(func_8038BFA0()){
|
||||
this->unk58_0 = 0;
|
||||
return;
|
||||
}
|
||||
this->unk58_0 = 1;
|
||||
}//L802CE9A4
|
||||
switch(this->state)
|
||||
{
|
||||
case 1://L802CE9C4
|
||||
if( !func_8031FF1C(BKPROG_D_BEEHIVE_TEXT)
|
||||
&& func_803296B8(this, 250, 300)
|
||||
){
|
||||
if(func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT){
|
||||
if( player_getTransformation() == TRANSFORM_1_BANJO
|
||||
&& func_80311480(ASSET_D96_TEXT_BEEHIVE, 0, NULL, NULL, NULL, 0)
|
||||
){
|
||||
func_80320004(BKPROG_D_BEEHIVE_TEXT, 1);
|
||||
}
|
||||
}
|
||||
}//L802CEA48
|
||||
if( actor_animationIsAt(this, 0.45f)
|
||||
|| actor_animationIsAt(this, 0.55f)
|
||||
|| actor_animationIsAt(this, 0.6f)
|
||||
){
|
||||
if(!this->unk38_0){
|
||||
func_8030E394(this->unk44_31);
|
||||
sfxsource_setSfxId(this->unk44_31, SFX_67_BEEHIVE_CLONK);
|
||||
sfxsource_setSampleRate(this->unk44_31, 12000);
|
||||
func_8030DBB4(this->unk44_31, (animctrl_getAnimTimer(this->animctrl) + 0.9) - 0.4);
|
||||
func_8030DF68(this->unk44_31, this->position);
|
||||
func_8030DEB4(this->unk44_31, 300.0f, 1500.0f);
|
||||
func_8030DD14(this->unk44_31, 3);
|
||||
func_8030E2C4(this->unk44_31);
|
||||
}
|
||||
}//L802CEB48
|
||||
break;
|
||||
case 2://L802CEB2C
|
||||
if(animctrl_isStopped(this->animctrl)){
|
||||
func_80326310(this);
|
||||
}
|
||||
break;
|
||||
}//L802CEB48
|
||||
}
|
||||
|
386
src/core2/ch/bigbutt.c
Normal file
386
src/core2/ch/bigbutt.c
Normal file
@@ -0,0 +1,386 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
|
||||
void func_802C6240(Actor *);
|
||||
Actor *func_802C6E84(ActorMarker *, Gfx **, Mtx **, Vtx **);
|
||||
/*.data */
|
||||
ActorAnimationInfo D_80366010[] ={
|
||||
{0x00, 0.0f},
|
||||
{ASSET_33_ANIM_BIGBUTT_EAT, 5.5f},
|
||||
{ASSET_36_ANIM_BIGBUTT_WALK, 0.7f},
|
||||
{ASSET_10_ANIM_BIGBUTT_RUN, 0.8f},
|
||||
{ASSET_21_ANIM_BIGBUTT_SLIDE, 0.9f},
|
||||
{ASSET_32_ANIM_BIGBUTT_ATTACK, 1.1f},
|
||||
{ASSET_35_ANIM_BIGBUTT_ALERT, 0.6f},
|
||||
{ASSET_34_ANIM_BIGBUTT_DIE, 4.0f},
|
||||
{ASSET_36_ANIM_BIGBUTT_WALK, 1.3f},
|
||||
{ASSET_10_ANIM_BIGBUTT_RUN, 0.6f},
|
||||
{ASSET_33_ANIM_BIGBUTT_EAT, 5.5f},
|
||||
{ASSET_36_ANIM_BIGBUTT_WALK, 1.3f},
|
||||
{ASSET_253_ANIM_BIGBUTT_OW, 0.7f},
|
||||
{ASSET_254_ANIM_BIGBUTT_FALL, 1.1f},
|
||||
{ASSET_254_ANIM_BIGBUTT_FALL, 1000000000.0f},
|
||||
{ASSET_255_ANIM_BIGBUTT_GET_UP, 1.0f},
|
||||
};
|
||||
|
||||
|
||||
ActorInfo D_80366090 = {0x3, ACTOR_4_BIGBUTT, ASSET_353_MODEL_BIGBUTT,
|
||||
1, D_80366010,
|
||||
func_802C6240, func_80326224, func_802C6E84,
|
||||
3200, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_803660B4 = {0x9, ACTOR_E_BULL_INTRO, ASSET_354_MODEL_BULL_INTRO,
|
||||
1, D_80366010,
|
||||
func_802C6240, func_80326224, func_802C6E84,
|
||||
3200, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_802C5E80(Actor *this){
|
||||
this->unk28 = randf2(3.5f, 4.9f);
|
||||
}
|
||||
|
||||
void func_802C5EB8(Actor *this){
|
||||
if(func_803203FC(0xC1))
|
||||
return;
|
||||
|
||||
if(this->unk38_31){
|
||||
this->unk38_31--;
|
||||
}
|
||||
else{
|
||||
if(func_80329530(this, 1200) && func_803292E0(this)){
|
||||
func_80328A84(this, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_802C5F44(Actor *this){
|
||||
if(!func_80329530(this, 1200) || !func_803292E0(this)){
|
||||
func_80328B8C(this, 1, 0.16f, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void func_802C5F94(Actor *this){
|
||||
func_80328A84(this, 2);
|
||||
func_802C5E80(this);
|
||||
func_80328CEC(this, (s32)this->yaw_moving, 135, 175);
|
||||
this->unk38_31 = 150;
|
||||
}
|
||||
|
||||
void func_802C5FF8(Actor *this){
|
||||
if( !this->unk138_28
|
||||
&& actor_animationIsAt(this, 0.4f)
|
||||
&& randf() < 0.14
|
||||
&& func_8028EE84() != BSWATERGROUP_2_UNDERWATER
|
||||
){
|
||||
func_8030E878(SFX_2B_BULL_MOO_1, randf2(0.9f, 1.1f), 32000, this->position, 0.0f, 2000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_802C60AC(ActorMarker *marker, ActorMarker *other_marker){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
if( actor->state == 4
|
||||
&& 5.0 <= actor->unk28
|
||||
&& func_803294F0(actor, 80, func_80329784(actor))
|
||||
){
|
||||
animctrl_setPlaybackType(actor->animctrl, ANIMCTRL_ONCE);
|
||||
func_80328A84(actor, 5);
|
||||
func_8030E58C(SFX_1E_HITTING_AN_ENEMY_2, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_802C6150(ActorMarker *marker, ActorMarker *other_marker){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
func_80328AC8(actor, 0xC);
|
||||
func_8030E878(SFX_2B_BULL_MOO_1, randf2(1.28f, 1.37f), 32000, actor->position, 0.0f, 2000.0f);
|
||||
}
|
||||
|
||||
void func_802C61C0(ActorMarker *marker, ActorMarker *other_marker){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
if( actor->state != 0xd
|
||||
&& actor->state != 0xe
|
||||
&& actor->state != 0xf
|
||||
){
|
||||
func_80328AC8(actor, 0xd);
|
||||
FUNC_8030E8B4(SFX_143_BULL_DAMAGE, 1.0f, 16000, actor->position, 0, 2000);
|
||||
FUNC_8030E8B4(SFX_143_BULL_DAMAGE, 1.0f, 16000, actor->position, 0, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
//chBigbuttUpdate
|
||||
void func_802C6240(Actor *this){
|
||||
s32 sp2C;
|
||||
u8 tmp_a0;
|
||||
f32 tmp_f0;
|
||||
|
||||
|
||||
if(!this->initialized){
|
||||
this->marker->unk1C = func_802C61C0;
|
||||
this->marker->unkC = func_802C60AC;
|
||||
this->marker->unk10 = func_802C6150;
|
||||
this->unk138_24 = 0;
|
||||
this->unk16C_0 = 1;
|
||||
this->initialized = TRUE;
|
||||
return;
|
||||
}//L802C62BC
|
||||
switch(this->state){
|
||||
case 0x1: //L802C62E4
|
||||
this->unk10_12 = 3;
|
||||
sp2C = func_8032863C(this->animctrl, 0.16f, 0.55f);
|
||||
if(!this->unk138_28){
|
||||
if( actor_animationIsAt(this, 0.157f)
|
||||
|| actor_animationIsAt(this, 0.289f)
|
||||
|| actor_animationIsAt(this, 0.4f)
|
||||
|| actor_animationIsAt(this, 0.536f)
|
||||
){
|
||||
if(func_8028EE84() != BSWATERGROUP_2_UNDERWATER){
|
||||
func_8030E878(SFX_C8_CRUNCH,randf2(0.93f, 1.07f),10000, this->position, 0.0f, 1800.0f);
|
||||
}
|
||||
}
|
||||
}//L802C63C4
|
||||
if(sp2C == 2){
|
||||
func_80328A2C(this, 0.55f, 1, 0.35f);
|
||||
}
|
||||
func_802C5FF8(this);
|
||||
if( func_8032863C(this->animctrl, 0.65f, 0.99f) >= 2
|
||||
&& !func_80328A2C(this, 0.0f, -1, 0.45f)
|
||||
&& func_80328BD4(this, 2, 0.0f, -1, 0.58f)
|
||||
){
|
||||
func_80328CEC(this, (s32)this->yaw, 10, 45);
|
||||
func_802C5E80(this);
|
||||
}//L802C647C
|
||||
func_802C5EB8(this);
|
||||
break;
|
||||
|
||||
case 0x2: //L802C6494
|
||||
func_802C5FF8(this);
|
||||
func_80328FB0(this, 2.0f);
|
||||
if(!func_80329030(this, 0) && func_80329480(this)){
|
||||
func_80328CEC(this, (s32)this->yaw, 90, 150);
|
||||
}//L802C64EC
|
||||
if(!(func_8023DB5C() & 0xf))
|
||||
func_80328CEC(this, (s32)this->yaw_moving, 10, 20);
|
||||
|
||||
if(!(func_8023DB5C() & 0x7))
|
||||
func_80328BD4(this, 1, 0.16f, 1, 0.02f);
|
||||
|
||||
if( !(func_8023DB5C() & 0xf)
|
||||
&& func_80329078(this, (s32)this->yaw_moving, 150)
|
||||
&& func_80328B38(this, 3, 0.13f)
|
||||
){
|
||||
this->unk28 = randf2(7.1f, 8.4f);
|
||||
}
|
||||
func_802C5EB8(this);
|
||||
break;
|
||||
|
||||
case 0x8: //L802C65D0
|
||||
func_802C5F44(this);
|
||||
this->yaw_moving = func_80329784(this);
|
||||
func_80328FB0(this, 4.0f);
|
||||
if(func_80329480(this))
|
||||
func_80328A84(this, 6);
|
||||
break;
|
||||
|
||||
case 0x3: //L802C6620
|
||||
func_80328FB0(this, 3.0f);
|
||||
if(! func_80329030(this, 0) && func_80329480(this)){
|
||||
func_80328CEC(this, (s32)this->yaw, 120, 180);
|
||||
func_80328A84(this, 2);
|
||||
func_802C5E80(this);
|
||||
}
|
||||
if(!(func_8023DB5C() & 0xf) && func_80328B38(this, 2, 0.08f))
|
||||
func_802C5E80(this);
|
||||
func_802C5EB8(this);
|
||||
break;
|
||||
|
||||
case 0x6: //L802C66D0
|
||||
animctrl_setDuration(this->animctrl, D_80366010[6].duration - (3 - this->unk10_12)*0.1085);
|
||||
this->yaw_moving = (f32)func_80329784(this);
|
||||
if(!func_803294B4(this, 0x21)){
|
||||
func_80328A84(this, 8);
|
||||
}
|
||||
func_802C5F44(this);
|
||||
if(actor_animationIsAt(this, 0.35f) && func_8028EE84() != BSWATERGROUP_2_UNDERWATER){
|
||||
func_8030E58C(SFX_3C_BULL_GROWN, randf()/10.0f + 1.0);
|
||||
this->unk10_12--;
|
||||
}
|
||||
if(!func_80329078(this, (s32)this->yaw, 20))
|
||||
func_802C5F94(this);
|
||||
|
||||
if(this->unk10_12 == 0 || (this->unk10_12 < 3 && func_80329530(this, 300))){
|
||||
func_80328A84(this, 9);
|
||||
this->unk28 = 13.0f;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x9: //L802C6878
|
||||
if(actor_animationIsAt(this, 0.35f))
|
||||
func_8030E58C(SFX_2E_BIGBUTT_RUNNING, 1.0f);
|
||||
|
||||
this->unk28 += 0.15;
|
||||
if(30.0f < this->unk28)
|
||||
this->unk28 = 30.0f;
|
||||
|
||||
this->yaw_moving = (f32)func_80329784(this);
|
||||
func_80328FB0(this, 9.0f);
|
||||
if(!func_80329030(this, 0))
|
||||
func_802C5F94(this);
|
||||
|
||||
if(func_80329530(this, 320)){
|
||||
if(func_80329078(this, (s32)this->yaw_moving,200)){
|
||||
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE);
|
||||
func_80328A84(this, 4);
|
||||
this->unk28 += 5.7;
|
||||
tmp_a0 = this->unk44_31;
|
||||
if(this->unk44_31 == 0){
|
||||
this->unk44_31 = func_8030D90C();
|
||||
tmp_a0 = this->unk44_31;
|
||||
}
|
||||
sfxsource_setSfxId(tmp_a0, SFX_18_BIGBUTT_SLIDE);
|
||||
func_8030DD14(this->unk44_31, 2);
|
||||
func_8030DBB4(this->unk44_31, (randf()*0.1 - 0.05) + 1.0);
|
||||
func_8030E2C4(this->unk44_31);
|
||||
}
|
||||
else{//L802C69FC
|
||||
func_802C5F94(this);
|
||||
}
|
||||
}//L802C6A08
|
||||
break;
|
||||
|
||||
case 0x4: //L802C6A14
|
||||
if(animctrl_getAnimTimer(this->animctrl) < 0.99){
|
||||
this->yaw_moving = (f32)func_80329784(this);
|
||||
func_80328FB0(this, 1.0f);
|
||||
}
|
||||
func_80329030(this, 0);
|
||||
func_8030E2C4(this->unk44_31);
|
||||
if(0.99 <= animctrl_getAnimTimer(this->animctrl)){
|
||||
func_80329878(this, func_80329530(this, 250)? 0.8: 1.2);
|
||||
if(0.0f == this->unk28){
|
||||
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP);
|
||||
func_80328B8C(this, 1, 0.65f, 1);
|
||||
func_8030DA44(this->unk44_31);
|
||||
this->unk44_31 = 0;
|
||||
func_8030E484(SFX_19_BANJO_LANDING_08);
|
||||
}
|
||||
}//L802C6B1C
|
||||
break;
|
||||
|
||||
case 0x5: //L802C6B28
|
||||
actor_playAnimationOnce(this);
|
||||
tmp_f0 = animctrl_getAnimTimer(this->animctrl);
|
||||
animctrl_setDuration(this->animctrl, D_80366010[5].duration + ((0.65 < tmp_f0)? (tmp_f0 - 0.65)*16.0 : 0.0));
|
||||
if(actor_animationIsAt(this, 0.95f)){
|
||||
actor_loopAnimation(this);
|
||||
func_802C5F94(this);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xc: //L802C6BDC
|
||||
actor_playAnimationOnce(this);
|
||||
if(actor_animationIsAt(this, 0.95f)){
|
||||
func_80328B8C(this, 1, 0.65f, 1);
|
||||
actor_loopAnimation(this);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xd: //L802C6C28
|
||||
actor_playAnimationOnce(this);
|
||||
if(actor_animationIsAt(this, 0.95f)){
|
||||
func_80328B8C(this, 0xe, 0.99f, 1);
|
||||
this->unk60 = 4.0f;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xe: //L802C6C7C
|
||||
actor_playAnimationOnce(this);
|
||||
this->unk60 -= time_getDelta();
|
||||
if(this->unk60 <= 0.0f){
|
||||
this->unk166 = 0x63;
|
||||
func_80328AC8(this, 0xF);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 0xf: //L802C6CD4
|
||||
actor_playAnimationOnce(this);
|
||||
if(actor_animationIsAt(this, 0.95f)){
|
||||
func_80328B8C(this, 1, 0.65f, 1);
|
||||
actor_loopAnimation(this);
|
||||
}
|
||||
break;
|
||||
}//L802C6D1C
|
||||
if(this->state == 0xe){
|
||||
if(this->marker->unk14_20 != 0x29e)
|
||||
this->marker->unk14_20 = 0x29e;
|
||||
}else{//L802C6D60
|
||||
if(this->marker->unk14_20 != 3)
|
||||
this->marker->unk14_20 = 3;
|
||||
}
|
||||
}
|
||||
|
||||
void func_802C6DA0(s32 arg0, f32 arg1[3], f32 arg2[3]){
|
||||
func_8034A174(func_80329934(), arg0, arg2);
|
||||
arg2[0] = (arg2[0] - arg1[0])*0.2;
|
||||
arg2[1] = (arg2[1] - arg1[1])*0.2;
|
||||
arg2[2] = (arg2[2] - arg1[2])*0.2;
|
||||
|
||||
}
|
||||
|
||||
void func_802C6E3C(s32 arg0, f32 arg1[3]){
|
||||
f32 sp1C[3];
|
||||
func_8034A174(func_80329934(), arg0, sp1C);
|
||||
func_80352CF4(sp1C, arg1, 170.0f, 50.0f);
|
||||
}
|
||||
|
||||
Actor *func_802C6E84(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *actor; //sp4C
|
||||
f32 sp40[3];
|
||||
|
||||
|
||||
actor = func_80325888(marker, gfx, mtx, vtx);
|
||||
if(marker->unk14_21){
|
||||
f32 sp34[3] = {0.0f, 4.0f, -15.0f};
|
||||
f32 sp28[3];
|
||||
f32 sp1C[3];
|
||||
|
||||
ml_vec3f_yaw_rotate_copy(sp34, sp34, actor->yaw);
|
||||
switch(actor->state){
|
||||
case 6:
|
||||
if(actor_animationIsAt(actor, 0.65f)){
|
||||
func_8034A174(func_80329934(), 9, sp40);
|
||||
func_80352CF4(sp40, sp34, 60.0f, 50.0f);
|
||||
}
|
||||
break;
|
||||
case 4://L802C6F50
|
||||
if((func_8023DB5C() & 1) == 1){
|
||||
if(func_80259808(actor->yaw)){
|
||||
func_802C6E3C(0xb, sp34);
|
||||
func_802C6E3C(0xa, sp34);
|
||||
}
|
||||
else{
|
||||
func_802C6E3C(0x8, sp34);
|
||||
func_802C6E3C(0x9, sp34);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1://L802C6FB4
|
||||
if(actor_animationIsAt(actor, 0.85f)
|
||||
&& (func_8023DB5C()& 0xe) == 8
|
||||
&& randf() < 0.6
|
||||
){
|
||||
func_8034A174(func_80329934(),5, sp40);
|
||||
func_802C6DA0(6, sp40, sp28);
|
||||
func_802C6DA0(7, sp40, sp1C);
|
||||
func_80352CF4(sp40, sp28, 200.0f, 50.0f);
|
||||
func_80352CF4(sp40, sp1C, 200.0f, 50.0f);
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}//L802C7064
|
||||
return actor;
|
||||
}
|
57
src/core2/ch/clankerwhipcrack.c
Normal file
57
src/core2/ch/clankerwhipcrack.c
Normal file
@@ -0,0 +1,57 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
void func_803567EC(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80372810 = {
|
||||
0x1A7, ACTOR_28A_CLANKER_WHIPCRACK, ASSET_432_MODEL_CLANKER_WHIPCRACK,
|
||||
0, NULL,
|
||||
func_803567EC, NULL, func_80325888,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_80356770(Actor *this, s32 next_state){
|
||||
if(next_state == 1)
|
||||
func_80335924(this->unk148, ASSET_15C_ANIM_CLANKER_WHIPCRACK_IDLE, 0.5f, 1.0f);
|
||||
|
||||
if(next_state == 2)
|
||||
func_80335924(this->unk148, ASSET_15D_ANIM_CLANKER_WHIPCRACK_ATTACK, 0.5f, 1.0f);
|
||||
|
||||
this->state = next_state;
|
||||
}
|
||||
|
||||
void func_803567EC(Actor *this){
|
||||
f32 plyr_pos[3];
|
||||
f32 plyr_dist;
|
||||
f32 sp44;
|
||||
f32 sp40;
|
||||
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = TRUE;
|
||||
this->roll = this->yaw;
|
||||
this->yaw = 0.0f;
|
||||
func_80356770(this, 1);
|
||||
}
|
||||
|
||||
player_getPosition(plyr_pos);
|
||||
plyr_dist = ml_vec3f_distance(plyr_pos, this->position);
|
||||
if(this->state == 1){
|
||||
if(plyr_dist < 700.0f)
|
||||
func_80356770(this, 2);
|
||||
}
|
||||
|
||||
if(this->state == 2){
|
||||
func_8033568C(this->unk148, &sp44, &sp40);
|
||||
if(sp44 < 0.13 && 0.13 <= sp40)
|
||||
func_8030E9C4(SFX_6A_FLAGPOLE_WOBBLE, randf2(0.9f, 1.0f), 14000, this->position, 500.0f, 1000.0f);
|
||||
|
||||
if(sp44 < 0.8 && 0.8 <= sp40)
|
||||
func_8030E9C4(SFX_2_CLAW_SWIPE, randf2(0.9f, 1.1f), randi2(10000, 14000), this->position, 500.0f, 1000.0f);
|
||||
|
||||
if(800.0f < plyr_dist)
|
||||
func_80356770(this, 1);
|
||||
}//L803569D4
|
||||
}
|
91
src/core2/ch/climbBase.c
Normal file
91
src/core2/ch/climbBase.c
Normal file
@@ -0,0 +1,91 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
|
||||
void func_802D77D4(Actor *this);
|
||||
extern void func_8028F738(f32[3], f32[3], f32, u32);
|
||||
extern f32 func_80258640(f32[3], f32[3]);
|
||||
|
||||
typedef struct {
|
||||
f32 unk0[3];
|
||||
s16 unkC;
|
||||
}ActorLocal_climbBase;
|
||||
|
||||
/* .data */
|
||||
extern ActorInfo D_80367B20 = {
|
||||
0x35, 0x26, 0x0,
|
||||
0x1, NULL,
|
||||
func_802D77D4, func_80326224, func_80325340,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
extern f32 D_8037DE30[3];
|
||||
extern u8 D_8037DE3C;
|
||||
|
||||
/* .code */
|
||||
s32 func_802D76E0(Actor *this, f32 *arg1) {
|
||||
ActorLocal_climbBase *local;
|
||||
f32 sp40[3];
|
||||
f32 sp34[3];
|
||||
f32 sp30;
|
||||
s32 temp_v0;
|
||||
s32 sp28;
|
||||
|
||||
local = (ActorLocal_climbBase *)&this->local;
|
||||
sp28 = func_8030526C(sp40, 0x27, this->position);
|
||||
temp_v0 = func_8030526C(sp34, 0x28, this->position);
|
||||
if (!sp28 && !temp_v0) {
|
||||
return FALSE;
|
||||
}
|
||||
if (sp28 && temp_v0) {
|
||||
sp30 = func_80258640(this->position, sp40);
|
||||
if (func_80258640(this->position, sp34) < sp30) {
|
||||
sp28 = 0;
|
||||
}
|
||||
}
|
||||
if (sp28) {
|
||||
ml_vec3f_copy(arg1, sp40);
|
||||
local->unkC = 1;
|
||||
} else {
|
||||
ml_vec3f_copy(arg1, sp34);
|
||||
local->unkC = 2;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void func_802D77D4(Actor *this) {
|
||||
f32 sp4C[3];
|
||||
f32 sp40[3];
|
||||
f32 sp3C;
|
||||
f32 sp30[3];
|
||||
ActorLocal_climbBase *local;
|
||||
|
||||
|
||||
local = (ActorLocal_climbBase *)&this->local;
|
||||
switch (this->state) { /* irregular */
|
||||
case 1:
|
||||
func_802D76E0(this, sp30);
|
||||
ml_vec3f_copy(local->unk0, sp30);
|
||||
func_80328A84(this, 2);
|
||||
return;
|
||||
|
||||
case 2:
|
||||
sp3C = (f32)(this->unkF4_8 + 0x19);
|
||||
player_getPosition(sp40);
|
||||
ml_vec3f_diff_copy(sp4C, this->position, sp40);
|
||||
if (((sp4C[0] * sp4C[0]) + (sp4C[2] * sp4C[2])) < (sp3C * sp3C)) {
|
||||
if ((this->position[1] < sp40[1]) && (sp40[1] <= local->unk0[1])) {
|
||||
if (func_803203FC(2) == 0) {
|
||||
func_8028F738(this->position, local->unk0, (f32)this->unkF4_8, local->unkC);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void func_802D7930(void){
|
||||
player_getPosition(D_8037DE30);
|
||||
D_8037DE3C = TRUE;
|
||||
}
|
227
src/core2/ch/clucker.c
Normal file
227
src/core2/ch/clucker.c
Normal file
@@ -0,0 +1,227 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern void func_8033A45C(s32, s32);
|
||||
|
||||
typedef struct{
|
||||
u8 unk0;
|
||||
// u8 pad1[3];
|
||||
f32 unk4;
|
||||
} ActorLocal_Clucker;
|
||||
|
||||
Actor *func_803575B8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
void func_8035765C(Actor *this);
|
||||
|
||||
/* .data */
|
||||
extern ActorInfo D_80372870 = {
|
||||
0x1B2, ACTOR_29F_CLUCKER, ASSET_482_MODEL_CLUCKER,
|
||||
0, NULL,
|
||||
func_8035765C, NULL, func_803575B8,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_80357150(Actor *this){
|
||||
f32 sp34[3];
|
||||
f32 sp28[3];
|
||||
f32 sp1C[3];
|
||||
|
||||
sp1C[0] = 50.0f;
|
||||
sp1C[1] = 200.0f;
|
||||
sp1C[2] = 300.0f;
|
||||
ml_vec3f_yaw_rotate_copy(sp1C, sp1C, this->yaw);
|
||||
|
||||
sp34[0] = sp1C[0] + this->position_x;
|
||||
sp34[1] = sp1C[1] + this->position_y;
|
||||
sp34[2] = sp1C[2] + this->position_z;
|
||||
ml_vec3f_yaw_rotate_copy(sp1C, sp1C, 10.0f);
|
||||
|
||||
sp34[0] += 3.0f*sp1C[0];
|
||||
sp34[1] += 3.0f*sp1C[1];
|
||||
sp34[2] += 3.0f*sp1C[2];
|
||||
|
||||
sp28[0] = -50.0f;
|
||||
sp28[1] = this->yaw + 20.0f;
|
||||
sp28[2] = 0.0f;
|
||||
func_802BAE6C(sp34, sp28);
|
||||
}
|
||||
|
||||
void func_80357264(Actor *this, s32 next_state){
|
||||
ActorLocal_Clucker *local = (ActorLocal_Clucker *)&this->local;
|
||||
f32 sp38;
|
||||
s32 pad34;
|
||||
|
||||
this->marker->unk14_20 = 0x1d0;
|
||||
actor_collisionOff(this);
|
||||
if(next_state == 1 || next_state == 2){
|
||||
func_80335924(this->unk148, ASSET_184_ANIM_CLUCKER_ATTACK_SHORT, 0.0f, 2.5f);
|
||||
func_80335A74(this->unk148, 0.99f);
|
||||
func_80335A8C(this->unk148, 4);
|
||||
if(this->state == 4){
|
||||
if(local->unk0 == 2){
|
||||
local->unk4 = randf2(0.5f, 0.75f);
|
||||
}
|
||||
else{//L8035732C
|
||||
local->unk4 = randf2(0.25f, 0.35f);
|
||||
}//L8035734C
|
||||
}
|
||||
else{//L80357358
|
||||
local->unk4 = 0.0f;
|
||||
}
|
||||
}//L80357368
|
||||
|
||||
if(this->state == 1 && next_state == 2)
|
||||
local->unk0 = -1;
|
||||
|
||||
if(next_state == 3)
|
||||
local->unk4 = 0.2f;
|
||||
|
||||
if(next_state == 4){
|
||||
this->marker->unk14_20 = 0x1b2;
|
||||
actor_collisionOn(this);
|
||||
local->unk0 = (local->unk0 + 1) % 3;
|
||||
if(local->unk0 < 2)
|
||||
func_80335924(this->unk148, ASSET_184_ANIM_CLUCKER_ATTACK_SHORT, 0.0f, randf2( 0.6f, 1.0f));
|
||||
else
|
||||
func_80335924(this->unk148, ASSET_185_ANIM_CLUCKER_ATTACK_LONG, 0.0f, randf2( 2.3f, 2.7f));
|
||||
func_80335A8C(this->unk148, 2);
|
||||
func_8030E6A4(SFX_4A_CLUCKER_AHH, randf2(0.85f, 0.95f), 32000);
|
||||
}
|
||||
|
||||
if(next_state == 5){
|
||||
if(!levelSpecificFlags_get(0x14)
|
||||
&& !( func_80326D68(this->position, 0x318, -1, &sp38) && ( sp38 < 250.0f))
|
||||
){
|
||||
levelSpecificFlags_set(0x14, TRUE);
|
||||
func_80324E38(0.0f, 3);
|
||||
func_80357150(this);
|
||||
func_80324E88(2.0f);
|
||||
func_80324E38(2.0f, 0);
|
||||
}//L80357518
|
||||
func_8030E6D4(SFX_1E_HITTING_AN_ENEMY_2);
|
||||
func_80335924(this->unk148, ASSET_186_ANIM_CLUCKER_DIE, 0.05f, 2.0f);
|
||||
}//L80357540
|
||||
|
||||
this->state = next_state;
|
||||
}
|
||||
|
||||
void func_80357564(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
func_8030E6D4(SFX_1E_HITTING_AN_ENEMY_2);
|
||||
}
|
||||
|
||||
void func_8035758C(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
Actor *this = marker_getActor(this_marker);
|
||||
func_80357264(this, 5);
|
||||
}
|
||||
|
||||
Actor *func_803575B8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *this = marker_getActor(marker);
|
||||
|
||||
func_8033A45C(3, (this->state == 5)? 1 : 0);
|
||||
func_8033A45C(4, (this->state == 0 || this->state == 1 || this->state == 6)? 0 : 1);
|
||||
return func_80325888(marker, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
void func_8035765C(Actor *this){
|
||||
f32 sp5C[3];
|
||||
f32 sp58;
|
||||
ActorLocal_Clucker *local = (ActorLocal_Clucker *)&this->local;
|
||||
f32 sp50;
|
||||
f32 sp4C;
|
||||
f32 sp48;
|
||||
f32 sp44;
|
||||
f32 sp40;
|
||||
|
||||
sp50 = time_getDelta();
|
||||
if( !this->unk16C_4){
|
||||
this->unk16C_4 = TRUE;
|
||||
this->unk16C_0 = TRUE;
|
||||
if(this->state != 6){
|
||||
marker_setCollisionScripts(this->marker, NULL, func_80357564, func_8035758C);
|
||||
local->unk0 = 0xff;
|
||||
func_80357264(this, 1);
|
||||
}
|
||||
else{//L803576E0
|
||||
func_80357264(this, 6);
|
||||
}
|
||||
}//L803576EC
|
||||
|
||||
player_getPosition(sp5C);
|
||||
sp58 = ml_vec3f_distance(this->position, sp5C);
|
||||
if(this->state == 1){
|
||||
if(sp58 < this->scale*800.0f){
|
||||
func_80357264(this, 2);
|
||||
}
|
||||
}//L80357758
|
||||
|
||||
if(this->state == 2){
|
||||
if(0.0f < local->unk4){
|
||||
local->unk4 -= sp50;
|
||||
}
|
||||
else if(sp58 < this->scale*600.0f){
|
||||
func_80357264(this, 3);
|
||||
}
|
||||
else if(this->scale*1000.0f < sp58){//L803577DC
|
||||
func_80357264(this, 1);
|
||||
}
|
||||
}//L80357808
|
||||
|
||||
if(this->state == 3){
|
||||
if(func_8025773C(&local->unk4, sp50)){
|
||||
func_80357264(this, 4);
|
||||
}
|
||||
}
|
||||
|
||||
if(this->state == 4){
|
||||
func_8033568C(this->unk148, &sp4C, &sp48);
|
||||
if(func_8033567C(this->unk148) == 0x185){
|
||||
if(sp4C < 0.58 && 0.58 <= sp48){
|
||||
this->marker->unk14_20 = 0x1d0;
|
||||
}
|
||||
if(sp4C < 0.05 && 0.05 <= sp48){
|
||||
FUNC_8030E624(SFX_2_CLAW_SWIPE, 0.9f, 32000);
|
||||
}
|
||||
if( (sp4C < 0.11 && 0.11 <= sp48)
|
||||
|| (sp4C < 0.32 && 0.32 <= sp48)
|
||||
|| (sp4C < 0.53 && 0.53 <= sp48)
|
||||
){
|
||||
func_8030E6A4(SFX_80_YUMYUM_CLACK, randf2(0.75f, 0.95f), 32700);
|
||||
}
|
||||
if(sp4C < 0.9 && 0.9 <= sp48){
|
||||
func_8030E6D4(SFX_2_CLAW_SWIPE);
|
||||
}
|
||||
}
|
||||
else{//L803579F0
|
||||
if(sp4C < 0.63 && 0.63 <= sp48){
|
||||
this->marker->unk14_20 = 0x1d0;
|
||||
}
|
||||
if(sp4C < 0.1 && 0.1 <= sp48){
|
||||
FUNC_8030E624(SFX_2_CLAW_SWIPE, 0.9f, 32000);
|
||||
}
|
||||
if(sp4C < 0.5 && 0.5 <= sp48){
|
||||
func_8030E6A4(SFX_80_YUMYUM_CLACK, randf2(0.75f, 0.95f), 32700);
|
||||
}
|
||||
if(sp4C < 0.9 && 0.9 <= sp48){
|
||||
func_8030E6D4(SFX_2_CLAW_SWIPE);
|
||||
}
|
||||
}//L80357B30
|
||||
if(func_80335794(this->unk148) > 0){
|
||||
func_80357264(this, 2);
|
||||
}
|
||||
}//L80357B48
|
||||
|
||||
if(this->state == 5){
|
||||
func_8033568C(this->unk148, &sp44, &sp40);
|
||||
if(sp44 < 0.1 && 0.1 <= sp40){
|
||||
func_8030E6A4(SFX_68_CLUCKER_AAEEGHH, randf2(1.0f, 1.1f), 32000);
|
||||
}
|
||||
|
||||
if(sp44 < 0.7 && 0.7 <= sp40){
|
||||
func_8030E6D4(SFX_61_CARTOONY_FALL);
|
||||
}
|
||||
if(func_80335794(this->unk148) > 0){
|
||||
func_80357264(this, 6);
|
||||
}
|
||||
}
|
||||
}
|
101
src/core2/ch/code_468E0.c
Normal file
101
src/core2/ch/code_468E0.c
Normal file
@@ -0,0 +1,101 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
|
||||
void func_802CD898(Actor *);
|
||||
void func_802CD8C0(Actor *);
|
||||
void func_802CDAC4(Actor *);
|
||||
void func_802CDB18(Actor *);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80367160 = {0x12, 0x66, 0, 0, NULL,
|
||||
func_802CD898, func_802CD8C0, func_80325340,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_80367184 = {0x12, 0x6C, 0, 0, NULL,
|
||||
func_802CD898, func_802CDB18, func_80325340,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_802CD870(Actor *this){
|
||||
*(s32 *)this->unkBC = TRUE;
|
||||
func_8028F918(2);
|
||||
}
|
||||
|
||||
void func_802CD898(Actor *this){
|
||||
marker_despawn(this->marker);
|
||||
func_802BBC58(2);
|
||||
}
|
||||
|
||||
void func_802CD8C0(Actor *this){
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = 1;
|
||||
this->marker->unk2C_1 = 1;
|
||||
this->marker->collidable = 0;
|
||||
*(s32*)this->unkBC = 0; //TODO Make struct
|
||||
if(func_803203FC(1) || func_803203FC(0x1F)){
|
||||
marker_despawn(this->marker);
|
||||
return;
|
||||
}
|
||||
if(this->unkF4_8 != 0x32 && func_8028E4A4() != this->unkF4_8){
|
||||
marker_despawn(this->marker);
|
||||
return;
|
||||
}
|
||||
if(map_get() == MAP_26_MMM_NAPPERS_ROOM){
|
||||
if(func_8031FF1C(BKPROG_1D_MMM_DINNING_ROOM_CUTSCENE)){
|
||||
marker_despawn(this->marker);
|
||||
return;
|
||||
}
|
||||
else{
|
||||
func_802CD870(this);
|
||||
func_80320004(BKPROG_1D_MMM_DINNING_ROOM_CUTSCENE, TRUE);
|
||||
}
|
||||
}
|
||||
//L802CD9C4
|
||||
if(map_get() == MAP_8E_GL_FURNACE_FUN){
|
||||
if(func_8031FF1C(BKPROG_F4_ENTER_FF_CUTSCENE)){
|
||||
marker_despawn(this->marker);
|
||||
return;
|
||||
}
|
||||
else{
|
||||
func_802CD870(this);
|
||||
}
|
||||
}
|
||||
}//L802CDA00
|
||||
|
||||
if(func_80343D50(this, func_80343654(this) + 1, 20, 20)){
|
||||
func_802CDAC4(this);
|
||||
if(1.0 == this->unk48){
|
||||
this->marker->unk2C_2 = 0;
|
||||
if(*(s32*)this->unkBC)
|
||||
func_8028F918(0);
|
||||
if(map_get() == MAP_8E_GL_FURNACE_FUN){
|
||||
mapSpecificFlags_set(4, TRUE);
|
||||
}
|
||||
else{
|
||||
func_802BBC58(2);
|
||||
func_802BD0D8(0xf);
|
||||
}
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_802CDAC4(Actor *this){
|
||||
f32 sp1C[3];
|
||||
|
||||
func_802BBC58(1);
|
||||
func_8024CD88(this->position);
|
||||
sp1C[0] = this->pitch;
|
||||
sp1C[1] = this->yaw;
|
||||
sp1C[2] = 0.0f;
|
||||
func_8024CE18(sp1C);
|
||||
}
|
||||
|
||||
void func_802CDB18(Actor *this){
|
||||
func_8028FBD4(0);
|
||||
func_802CD8C0(this);
|
||||
}
|
324
src/core2/ch/code_5AB30.c
Normal file
324
src/core2/ch/code_5AB30.c
Normal file
@@ -0,0 +1,324 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern int func_802592C4(f32[3], f32[3], f32);
|
||||
extern void func_802EFA20(ParticleEmitter *, f32, f32);
|
||||
extern void func_80328B8C(Actor *, s32, f32, s32);
|
||||
extern void func_80328FB0(Actor *, f32);
|
||||
extern void func_803300C0(ActorMarker *, void *);
|
||||
|
||||
|
||||
typedef struct {
|
||||
ActorMarker *unk0;
|
||||
f32 unk4;
|
||||
u8 pad8[0x1];
|
||||
u8 unk9;
|
||||
u8 unkA;
|
||||
u8 unkB;
|
||||
} ActorLocal_chSirSlush;
|
||||
|
||||
Actor *func_802E1AC0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); //chSirSlush_draw
|
||||
void func_802E20E8(Actor *this); //chSirSlush_update
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_80368650[] = {
|
||||
{0, 0.0f},
|
||||
{ASSET_108_ANIM_SIR_SLUSH_IDLE, 0.8f},
|
||||
{ASSET_109_ANIM_SIR_SLUSH_ATTACK, 4.0f},
|
||||
{ASSET_220_ANIM_SIR_SLUSH_DIE, 1.6f}
|
||||
};
|
||||
|
||||
ActorInfo D_80368670 = {
|
||||
0xB1, ACTOR_124_SIR_SLUSH, ASSET_377_MODEL_SIR_SLUSH,
|
||||
1, D_80368650,
|
||||
func_802E20E8, func_80326224, func_802E1AC0,
|
||||
0, 0x199, 0.0f, 0
|
||||
};
|
||||
|
||||
struct31s D_80368694 = {
|
||||
{0.4f, 1.55f},
|
||||
{0.0f, 0.0f},
|
||||
{0.0f, 0.01f},
|
||||
{4.0f, 4.0f},
|
||||
0.0f, 0.3f
|
||||
};
|
||||
|
||||
struct43s D_803686BC = {
|
||||
{{-250.0f, 600.0f, -250.0f}, {350.0f, 960.0f, 350.0f}},
|
||||
{{0.0f, -1200.0f, 0.0f}, {0.0f, -1200.0f, 0.0f}},
|
||||
{{-80.0f, 0.0f, -80.0f}, {80.0f, 200.0f, 80.0f}}
|
||||
};
|
||||
|
||||
f32 D_80368704[3] = {350.0f, 600.0f, 65.0f};
|
||||
|
||||
/* .code */
|
||||
Actor *func_802E1AC0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *actor;
|
||||
ActorLocal_chSirSlush *local;
|
||||
|
||||
actor = marker_getActor(marker);
|
||||
local = (ActorLocal_chSirSlush *)&actor->local;
|
||||
func_8033A45C(1, local->unk9);
|
||||
func_8033A45C(2, local->unkA);
|
||||
func_80325888(marker, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
void func_802E1B24(ActorMarker *marker){
|
||||
Actor *actor;
|
||||
Actor *other;
|
||||
f32 sp1C[3];
|
||||
ActorMarker *m = *(ActorMarker **)▮
|
||||
|
||||
actor = marker_getActor(m);
|
||||
other = spawn_child_actor(ACTOR_125_SNOWBALL, &actor);
|
||||
if(m->unk14_21){
|
||||
func_8034A174(m->unk44, 5, sp1C);
|
||||
}
|
||||
else{
|
||||
sp1C[0] = actor->position[0];
|
||||
sp1C[1] = actor->position[1];
|
||||
sp1C[2] = actor->position[2];
|
||||
sp1C[1] += 150.0f;
|
||||
}
|
||||
other->position[0] = sp1C[0];
|
||||
other->position[1] = sp1C[1];
|
||||
other->position[2] = sp1C[2];
|
||||
}
|
||||
|
||||
void func_802E1BD0(ActorMarker *marker){
|
||||
Actor *actor;
|
||||
Actor *other;
|
||||
f32 sp2C[3];
|
||||
s32 sp28;
|
||||
ActorMarker *m = *(ActorMarker **)▮
|
||||
|
||||
actor = marker_getActor(m);
|
||||
other = spawn_child_actor(ACTOR_126_SIR_SLUSH_HAT, &actor);
|
||||
|
||||
func_8034A174(m->unk44, 6, sp2C);
|
||||
|
||||
other->position[0] = sp2C[0];
|
||||
other->position[1] = sp2C[1];
|
||||
other->position[2] = sp2C[2];
|
||||
|
||||
|
||||
other->yaw = actor->yaw + 180.0f;
|
||||
other->velocity[0] = other->velocity[1] = other->velocity[2] = 0.0f;
|
||||
|
||||
other->velocity[0] = 34.0f;
|
||||
|
||||
sp28 = (func_8023DB5C() & 1)? 0x3C : 0x78;
|
||||
ml_vec3f_yaw_rotate_copy(other->velocity, other->velocity, other->yaw - sp28);
|
||||
other->velocity[1] = 30.0f;
|
||||
}
|
||||
|
||||
void func_802E1CB8(f32 position[3], s32 count){
|
||||
ParticleEmitter *particleSpawner = partEmitList_pushNew(count);
|
||||
|
||||
particleEmitter_setModel(particleSpawner, ASSET_378_MODEL_SNOWBALL);
|
||||
particleEmitter_setPosition(particleSpawner, position);
|
||||
particleEmitter_setPositionVelocityAndAccelerationRanges(particleSpawner, &D_803686BC);
|
||||
func_802EFE24(particleSpawner, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f);
|
||||
func_802EF9F8(particleSpawner, 0.01f);
|
||||
func_802EFA18(particleSpawner, 3);
|
||||
func_802EFA20(particleSpawner, 1.0f, 1.3f);
|
||||
func_802EF9EC(particleSpawner, 0x2f, 16000);
|
||||
func_802EFB98(particleSpawner, &D_80368694);
|
||||
particleEmitter_emitN(particleSpawner, count);
|
||||
}
|
||||
|
||||
void func_802E1DA0(Actor *this){
|
||||
ActorLocal_chSirSlush *local = (ActorLocal_chSirSlush *) &this->local;
|
||||
func_80328B8C(this, 1, 0.01f, 1);
|
||||
actor_loopAnimation(this);
|
||||
local->unk4 = 0.4f;
|
||||
}
|
||||
|
||||
void func_802E1DE8(Actor *this){
|
||||
func_80328B8C(this, 3, 0.01f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
}
|
||||
|
||||
void func_802E1E20(Actor *this, f32 arg1){
|
||||
this->yaw_moving = func_80329784(this);
|
||||
func_80328FB0(this, 6.0f);
|
||||
}
|
||||
|
||||
int func_802E1E5C(Actor *this, s32 arg1){
|
||||
f32 f0;
|
||||
f0 = this->yaw - this->yaw_moving;
|
||||
if((f0 < arg1) && (-arg1 < f0)){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int func_802E1EB4(Actor *this, s32 arg1, s32 arg2){
|
||||
f32 sp1C[3];
|
||||
if(this->unkF4_8 == 0x33){
|
||||
player_getPosition(sp1C);
|
||||
if( (this->position[1] + 500.0f < sp1C[1]) || (sp1C[1] < this->position[1] - 500.0f))
|
||||
return 0;
|
||||
}//L802E1F28
|
||||
if(func_80329530(this, arg2) && !func_80329530(this, arg1)){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int func_802E1F70(ActorMarker *marker, s32 arg1){
|
||||
if(marker->unk40_31 == 0xB){
|
||||
marker->unk14_20 = 0x287;
|
||||
}
|
||||
else{
|
||||
marker->unk14_20 = 0xB1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_802E1FD0(ActorMarker *marker, ActorMarker *other_marker){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
FUNC_8030E8B4(SFX_15_METALLIC_HIT_2, 1.0f, 30000, actor->position, 1500, 4500);
|
||||
FUNC_8030E8B4(SFX_3EA_UNKNOWN, 1.0f, 30000, actor->position, 1500, 4500);
|
||||
FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 1.0f, 30000, actor->position, 1500, 4500);
|
||||
|
||||
func_802C3C88((GenMethod_1)func_802E1BD0, (s32)actor->marker);
|
||||
if(map_get() == MAP_27_FP_FREEZEEZY_PEAK)
|
||||
func_8038A978();
|
||||
func_802E1CB8(actor->position, 0xC);
|
||||
marker_despawn(actor->marker);
|
||||
}
|
||||
|
||||
int func_802E208C(void){
|
||||
f32 sp1C[3];
|
||||
if(map_get() == MAP_46_CCW_WINTER){
|
||||
player_getPosition(sp1C);
|
||||
if(func_802592C4(sp1C, D_80368704, 900.0f))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//chSirSlush_update
|
||||
void func_802E20E8(Actor *this){
|
||||
ActorLocal_chSirSlush *local = (ActorLocal_chSirSlush *) &this->local;
|
||||
f32 sp38;
|
||||
|
||||
|
||||
sp38 = time_getDelta();
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = TRUE;
|
||||
this->marker->propPtr->unk8_3 = 0;
|
||||
actor_collisionOn(this);
|
||||
marker_setCollisionScripts(this->marker, NULL, NULL, func_802E1FD0);
|
||||
func_803300C0(this->marker, func_802E1F70);
|
||||
local->unk9 = 0;
|
||||
local->unkA = 1;
|
||||
local->unkB = 0;
|
||||
local->unk4 = 0.0f;
|
||||
animctrl_setTransitionDuration(this->animctrl, 0.8f);
|
||||
animctrl_setAnimTimer(this->animctrl, randf());
|
||||
func_8032BC18(this);
|
||||
if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){
|
||||
local->unk0 = func_80326EEC(0x336)->marker;
|
||||
func_8038A990();
|
||||
}
|
||||
}//L802E21D8
|
||||
if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){
|
||||
if(func_8038BFA0() || func_8038DD14()){
|
||||
actor_collisionOff(this);
|
||||
this->unk58_0 = 0;
|
||||
return;
|
||||
}
|
||||
else{//L802E2224
|
||||
actor_collisionOn(this);
|
||||
this->unk58_0 = 1;
|
||||
|
||||
}
|
||||
}//L802E223C
|
||||
if(!actor_playerIsWithinDist(this, 4000))
|
||||
return;
|
||||
|
||||
if(!local->unkB && this->marker->unk14_21){
|
||||
local->unkB = 1;
|
||||
}//L802E2280
|
||||
switch(this->state){
|
||||
case 1://L802E22B0
|
||||
local->unk9 = FALSE;
|
||||
local->unkA = 1;
|
||||
func_802E1E20(this, 6.0f);
|
||||
if(!func_80329530(this, 0xC4E)){
|
||||
func_802E1DE8(this);
|
||||
}
|
||||
else if(
|
||||
map_get() != MAP_27_FP_FREEZEEZY_PEAK
|
||||
|| func_8038DD34(local->unk0) == 0
|
||||
|| func_8031FF1C(0x13)
|
||||
){//L802E2318
|
||||
if(0.0 < local->unk4){
|
||||
if( (func_8023DB5C() & 1)
|
||||
|| func_8028ECAC() == BSGROUP_A_FLYING
|
||||
){//L802E236C
|
||||
local->unk4 -= sp38;
|
||||
}
|
||||
}
|
||||
else{//L802E2380
|
||||
if( func_802E1EB4(this, 0x1f4, 0xabe)
|
||||
&& func_802E1E5C(this, 3)
|
||||
&& func_8028EE84() != BSWATERGROUP_2_UNDERWATER
|
||||
&& !func_802E208C()
|
||||
){
|
||||
func_80328B8C(this, 2, 0.01f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2://L802E23E8
|
||||
if(!func_80329530(this, 0xC4E)){
|
||||
func_802E1DE8(this);
|
||||
}//L802E240C
|
||||
else if(
|
||||
0.98 < animctrl_getAnimTimer(this->animctrl)
|
||||
|| !func_802E1EB4(this, 0x1f4, 0xabe)
|
||||
|| func_8028EE84() == BSWATERGROUP_2_UNDERWATER
|
||||
|| func_802E208C()
|
||||
){
|
||||
func_802E1DA0(this);
|
||||
}
|
||||
else{
|
||||
if(animctrl_getAnimTimer(this->animctrl) < 0.45){
|
||||
func_802E1E20(this, 6.0f);
|
||||
}
|
||||
if( actor_animationIsAt(this, 0.19f)
|
||||
|| actor_animationIsAt(this, 0.28f)
|
||||
|| actor_animationIsAt(this, 0.37f)
|
||||
){
|
||||
FUNC_8030E8B4(SFX_A7_WOODEN_SWOSH, 1.3f, 18000, this->position, 800, 3050);
|
||||
}//L802E24FC
|
||||
if(actor_animationIsAt(this, 0.15f)){
|
||||
func_8030E878(SFX_3F5_UNKNOWN, randf2(1.35f, 1.5f),32000, this->position, 800.0f, 3050.0f);
|
||||
}//L802E2558
|
||||
|
||||
if(actor_animationIsAt(this, 0.45f)){
|
||||
local->unk9 = TRUE;
|
||||
}
|
||||
else if(
|
||||
actor_animationIsAt(this, 0.58f)
|
||||
&& local->unkB
|
||||
){
|
||||
func_8030E878(SFX_8F_SNOWBALL_FLYING, randf2(0.95f, 1.05f), 30000, this->position, 800.0f, 3050.0f);
|
||||
func_802C3C88((GenMethod_1)func_802E1B24, (s32)this->marker);
|
||||
local->unk9 = FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 3://L802E2604
|
||||
if(func_80329530(this, 0xC4E)){
|
||||
func_802E1DA0(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
156
src/core2/ch/code_CFA60.c
Normal file
156
src/core2/ch/code_CFA60.c
Normal file
@@ -0,0 +1,156 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
/* public */
|
||||
Actor *func_80356C50(ActorMarker *, Gfx **, Mtx **, Vtx **);
|
||||
void func_80356CCC(Actor *);
|
||||
|
||||
typedef struct{
|
||||
f32 unk0;
|
||||
}ActorLocal_Core2_CFA60;
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80372840 = {
|
||||
0x29, ACTOR_1CC_GRILL_CHOMPA, ASSET_430_MODEL_GRILL_CHOMPA,
|
||||
0, NULL,
|
||||
func_80356CCC, NULL, func_80356C50,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_803569F0(Actor *this, s32 next_state){
|
||||
ActorLocal_Core2_CFA60 *local = (ActorLocal_Core2_CFA60 *)&this->local;
|
||||
|
||||
this->marker->unk14_20 = 0x1cf;
|
||||
actor_collisionOff(this);
|
||||
if(next_state == 1 || next_state == 2){
|
||||
func_80335924(this->unk148, ASSET_15A_ANIM_GRILL_CHOMPA_ATTACK, 0, 2.5f);
|
||||
func_80335A74(this->unk148, 0.99f);
|
||||
func_80335A8C(this->unk148, 4);
|
||||
if(this->state == 4){
|
||||
local->unk0 = randf2(0.5f, 1.0f);
|
||||
}
|
||||
else{//L80356AA4
|
||||
local->unk0 = 0.0f;
|
||||
}
|
||||
}////L80356AB8
|
||||
if(this->state == 1 && next_state == 2){
|
||||
func_8030E760(0x3EF, 0.9f, 32700);
|
||||
}
|
||||
if(next_state == 3){
|
||||
local->unk0 = 0.2f;
|
||||
}
|
||||
if(next_state == 4){
|
||||
this->marker->unk14_20 = 0x29;
|
||||
actor_collisionOn(this);
|
||||
func_80335924(this->unk148, ASSET_15A_ANIM_GRILL_CHOMPA_ATTACK, 0, randf2(2.3f, 2.7f));
|
||||
func_80335A8C(this->unk148, 2);
|
||||
func_8030E760(0x3ef, 1.1f, 25000);
|
||||
func_8030E760(0x3ef, 1.1f, 25000);
|
||||
}//L80356B90
|
||||
if(next_state == 5){
|
||||
func_8030E760(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 32000);
|
||||
func_80335924(this->unk148, ASSET_15B_ANIM_GRILL_CHOMPA_DIE, 0.05f, 2.0f);
|
||||
func_80335A8C(this->unk148, 2);
|
||||
}
|
||||
this->state = next_state;
|
||||
}
|
||||
|
||||
|
||||
void func_80356BF4(ActorMarker *marker, ActorMarker *other_marker){
|
||||
func_8030E760(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 32000);
|
||||
}
|
||||
|
||||
void func_80356C24(ActorMarker *marker, ActorMarker *other_marker){
|
||||
func_803569F0(marker_getActor(marker), 5);
|
||||
}
|
||||
|
||||
Actor *func_80356C50(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
if(actor->state == 0){
|
||||
return actor;
|
||||
}
|
||||
else{
|
||||
func_8033A45C(3, (actor->state == 1 || actor->state == 6)? 0:1);
|
||||
return func_80325888(marker, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void func_80356CCC(Actor *this){
|
||||
f32 sp5C[3];
|
||||
f32 sp58;
|
||||
ActorLocal_Core2_CFA60 *local = (ActorLocal_Core2_CFA60 *)&this->local;
|
||||
f32 sp50;
|
||||
f32 sp4C;
|
||||
f32 sp48;
|
||||
f32 sp44;
|
||||
f32 sp40;
|
||||
|
||||
sp50 = time_getDelta();
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = 1;
|
||||
this->unk16C_0 = 1;
|
||||
marker_setCollisionScripts(this->marker, NULL, func_80356BF4, func_80356C24);
|
||||
func_803569F0(this, (this->state < 5)? 1 : 6);
|
||||
}//L80356D48
|
||||
player_getPosition(sp5C);
|
||||
sp58 = ml_vec3f_distance(this->position, sp5C);
|
||||
if( this->state == 1){
|
||||
if( sp58 < this->scale*400.0f
|
||||
&& (map_get() != MAP_3C_RBB_KITCHEN || this->position_z < sp5C[2])
|
||||
){
|
||||
func_803569F0(this, 2);
|
||||
}
|
||||
}//L80356DCC
|
||||
if(this->state == 2){
|
||||
if(0.0f < local->unk0){
|
||||
local->unk0 -= sp50;
|
||||
}
|
||||
else if(sp58 < this->scale*300.0f){
|
||||
func_803569F0(this, 3);
|
||||
}
|
||||
else if(this->scale*500.0f < sp58){
|
||||
func_803569F0(this, 1);
|
||||
}
|
||||
}//L80356E88
|
||||
if(this->state == 3){
|
||||
if(func_8025773C(&this->local, sp50)){
|
||||
func_803569F0(this, 4);
|
||||
}
|
||||
}//L80356EAC
|
||||
if(this->state == 4){
|
||||
func_8033568C(this->unk148, &sp4C, &sp48);
|
||||
if(sp4C < 0.59 && 0.59 <= sp48){
|
||||
this->marker->unk14_20 = 0x1cf;
|
||||
}
|
||||
if(sp4C < 0.5 && 0.5 <= sp48){
|
||||
func_8030E760(SFX_2_CLAW_SWIPE, 0.9f, 32000);
|
||||
}
|
||||
if( (sp4C < 0.11 && 0.11 <= sp48)
|
||||
|| (sp4C < 0.32 && 0.32 <= sp48)
|
||||
|| (sp4C < 0.53 && 0.53 <= sp48)
|
||||
){
|
||||
func_8030E760(SFX_6D_CROC_BITE, randf2(0.95f, 1.05f), 32000);
|
||||
}//L80357028
|
||||
if(sp4C < 0.9 && 0.9 <= sp48){
|
||||
func_8030E760(SFX_2_CLAW_SWIPE, 1.0f, 32000);
|
||||
}
|
||||
if(func_80335794(this->unk148) > 0){
|
||||
func_803569F0(this, 2);
|
||||
}
|
||||
}//L80357078
|
||||
if(this->state == 5){
|
||||
func_8033568C(this->unk148, &sp44, &sp40);
|
||||
if(sp44 < 0.1 && 0.1 <= sp40){
|
||||
func_8030E760(SFX_D7_GRABBA_DEATH, 1.0f, 32000);
|
||||
}
|
||||
if(sp44 < 0.7 && 0.7 <= sp40){
|
||||
func_8030E760(SFX_A_BANJO_LANDING_05, 0.8f, 32000);
|
||||
}
|
||||
if(func_80335794(this->unk148) > 0){
|
||||
func_803569F0(this, 6);
|
||||
}
|
||||
}//L8035713C
|
||||
}
|
89
src/core2/ch/drips.c
Normal file
89
src/core2/ch/drips.c
Normal file
@@ -0,0 +1,89 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#define _HorzDist3v(v1, v2) ((v1[0]-v2[0])*(v1[0]-v2[0]) + (v1[2]-v2[2])*(v1[2]-v2[2]))
|
||||
extern int func_8024549C(f32[3], f32);
|
||||
|
||||
typedef struct{
|
||||
f32 unk0;
|
||||
f32 unk4;
|
||||
f32 unk8;
|
||||
f32 unkC;
|
||||
}struct_core2_D2AB0;
|
||||
|
||||
void chdrips_update(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo gChDripsInfo = {
|
||||
0x246, ACTOR_354_DRIPS, 0,
|
||||
0, NULL,
|
||||
chdrips_update, func_80326224, func_80325340,
|
||||
5000, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
s32 D_80372AE4[3] = {0xff, 0xff, 0xfe};
|
||||
|
||||
struct_core2_D2AB0 D_80372AF0 = {0.0f, 0.0f, 1.0f, 1.4f};
|
||||
|
||||
struct43s D_80372B00 = {
|
||||
{{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}},
|
||||
{{0.0f, -650.0f, 0.0f}, {0.0f, -650.0f, 0.0f}},
|
||||
{{-400.0f, 0.0f, -400.0f}, {400.0f, 0.0f, 400.0f}}
|
||||
};
|
||||
|
||||
|
||||
/* .code */
|
||||
void func_80359A40(f32 position[3], struct_core2_D2AB0 *arg1, s32 cnt){
|
||||
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
|
||||
particleEmitter_setSprite(pCtrl, ASSET_70C_SPRITE_RIPPLE);
|
||||
func_802EFA70(pCtrl, 1);
|
||||
func_802EFFA8(pCtrl, D_80372AE4);
|
||||
particleEmitter_setPosition(pCtrl, position);
|
||||
func_802EFB70(pCtrl, 0.1f, 0.1f);
|
||||
func_802EFB84(pCtrl, 1.0f, 1.4f);
|
||||
particleEmitter_setSpawnIntervalRange(pCtrl, arg1->unk0, arg1->unk4);
|
||||
func_802EFEC0(pCtrl, arg1->unk8, arg1->unkC);
|
||||
func_802EFA5C(pCtrl, 0.0f, 0.5f);
|
||||
particleEmitter_emitN(pCtrl, cnt);
|
||||
}
|
||||
|
||||
void __chdrips_particleCallback(struct31s *pCtrl, f32 position[3]){
|
||||
if(func_8024549C(position, 4.0f)){
|
||||
position[1] += 2.0f;
|
||||
func_80359A40(position, &D_80372AF0, 1);
|
||||
func_8030E878(SFX_413_UNKNOWN, randf2(1.0f, 1.4f), 20000, position, 0.0f, 3500.0f);
|
||||
}
|
||||
}
|
||||
|
||||
int __chdrips_playerWithinDist(Actor *this, s32 arg1){
|
||||
f32 sp1C[3];
|
||||
|
||||
player_getPosition(sp1C);
|
||||
if(_HorzDist3v(this->position, sp1C) < arg1*arg1)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void chdrips_update(Actor *this){
|
||||
ParticleEmitter *pCtrl;
|
||||
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = TRUE;
|
||||
actor_collisionOff(this);
|
||||
this->unk60 = this->yaw/360.0;
|
||||
}
|
||||
if(__chdrips_playerWithinDist(this, 5000) && randf() < this->unk60){
|
||||
pCtrl = partEmitList_pushNew(1);
|
||||
particleEmitter_setModel(pCtrl, ASSET_8A0_SPRITE_WATER_DROP);
|
||||
particleEmitter_setPosition(pCtrl, this->position);
|
||||
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80372B00);
|
||||
func_802EFA18(pCtrl, 1);
|
||||
particleEmitter_setParticleCallback(pCtrl, __chdrips_particleCallback);
|
||||
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
|
||||
func_802EFEC0(pCtrl, 7.0f, 7.0f);
|
||||
func_802EFB70(pCtrl, 0.1f, 0.1f);
|
||||
func_802EFB84(pCtrl, 0.1f, 0.1f);
|
||||
particleEmitter_emitN(pCtrl, 1);
|
||||
}
|
||||
}
|
91
src/core2/ch/firefx.c
Normal file
91
src/core2/ch/firefx.c
Normal file
@@ -0,0 +1,91 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern int func_8024DB50(f32 arg0[3], f32 arg1);
|
||||
|
||||
void chfirefx_update(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo gChFireFxInfo = {
|
||||
0x256, ACTOR_383_FIRE_FX, ASSET_526_SPRITE_FIRE,
|
||||
0, NULL,
|
||||
chfirefx_update, func_80326224, func_80325888,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* code */
|
||||
void __chfirefx_spawnSmoke(f32 position[3], f32 scale){
|
||||
ParticleEmitter *pCtrl;
|
||||
|
||||
pCtrl = partEmitList_pushNew(1);
|
||||
particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1);
|
||||
particleEmitter_setStartingFrameRange(pCtrl, 1, 6);
|
||||
func_802EF9E4(pCtrl, 0x23);
|
||||
particleEmitter_setPosition(pCtrl, position);
|
||||
particleEmitter_setParticleSpawnPositionRange(pCtrl, 0.0f, 110.0f*scale, 0.0f, 0.0f, 110.0f*scale, 0.0f);
|
||||
particleEmitter_setParticleVelocityRange(pCtrl, 0.0f, 40.0f*scale, 0.0f, 0.0f, 90.0f*scale, 0.0f);
|
||||
func_802EFB70(pCtrl, 2.6*scale, 3.2*scale);
|
||||
func_802EFB84(pCtrl, 5.0*scale, 6.0*scale);
|
||||
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
|
||||
func_802EFEC0(pCtrl, 4.0f, 7.0f);
|
||||
func_802EFA5C(pCtrl, 0.3f, 0.7f);
|
||||
func_802EFA70(pCtrl, 4);
|
||||
particleEmitter_emitN(pCtrl, 1);
|
||||
}
|
||||
|
||||
void __chfirefx_spawnSpark(f32 position[3], f32 scale){
|
||||
ParticleEmitter *pCtrl;
|
||||
|
||||
pCtrl = partEmitList_pushNew(1);
|
||||
particleEmitter_setSprite(pCtrl, ASSET_713_SPRITE_SPARKLE_YELLOW);
|
||||
particleEmitter_setStartingFrameRange(pCtrl, 1, 6);
|
||||
particleEmitter_setPosition(pCtrl, position);
|
||||
particleEmitter_setParticleSpawnPositionRange(pCtrl, 0.0f, 20.0f*scale, 0.0f, 0.0f, 20.0f*scale, 0.0f);
|
||||
particleEmitter_setParticleVelocityRange(pCtrl, -30.0f*scale, 120.0f*scale, -30.0f*scale, 60.0f*scale, 360.0f*scale, 60.0f*scale);
|
||||
particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -50.0f, 0.0f, 0.0f, -90.0f, 0.0f);
|
||||
func_802EFB70(pCtrl, 0.1*scale, 0.2*scale);
|
||||
func_802EFB84(pCtrl, 0.2*scale, 0.4*scale);
|
||||
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
|
||||
func_802EFEC0(pCtrl, 0.9f, 1.3f);
|
||||
func_802EFA5C(pCtrl, 0.3f, 0.7f);
|
||||
func_802EFA70(pCtrl, 4);
|
||||
particleEmitter_emitN(pCtrl, 1);
|
||||
}
|
||||
|
||||
void __chfirefx_hiss(ActorMarker *marker,ActorMarker *other_marker){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
FUNC_8030E8B4(SFX_96_HOTSAND_EEL_HISS, 1.0f, 32000, actor->position, 1000, 2000);
|
||||
}
|
||||
|
||||
void chfirefx_update(Actor *this){
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = TRUE;
|
||||
this->marker->propPtr->unk8_3 = FALSE;
|
||||
actor_collisionOn(this);
|
||||
marker_setCollisionScripts(this->marker, __chfirefx_hiss, NULL, NULL);
|
||||
this->unk38_31 = (0.0f != this->yaw) ? 1 : 0;
|
||||
if(this->unkF4_8 != 0x32){
|
||||
this->unk1C[0] = 1.0f;
|
||||
this->unk44_31 = func_8030ED2C(SFX_128_FIRE_CRACKING, 2);
|
||||
func_8030DBB4(this->unk44_31, 1.1f);
|
||||
}
|
||||
else{
|
||||
this->unk1C[0] = 0.0f;
|
||||
}
|
||||
}//L80359934
|
||||
if(actor_playerIsWithinDist(this, 2000)){
|
||||
if( func_8024DB50(this->position, 50.0f) && this->unk38_31 ){
|
||||
if(!(func_8023DB5C() & 3) && randf() < 0.1){
|
||||
__chfirefx_spawnSmoke(this->position, this->scale);
|
||||
} //L803599AC
|
||||
if(!(func_8023DB5C() & 3) && randf() < 0.3){
|
||||
__chfirefx_spawnSpark(this->position, this->scale);
|
||||
}
|
||||
}//L803599F4
|
||||
if(0.0f != this->unk1C[0]){
|
||||
func_8030DB04(this->unk44_31, 7000, this->position, 300.0f, 800.0f);
|
||||
func_8030E2C4(this->unk44_31);
|
||||
}
|
||||
}//L80359A2C
|
||||
}
|
332
src/core2/ch/flotsam.c
Normal file
332
src/core2/ch/flotsam.c
Normal file
@@ -0,0 +1,332 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern f32 func_80309724(f32[3]);
|
||||
|
||||
typedef struct {
|
||||
f32 unk0;
|
||||
f32 unk4;
|
||||
ParticleEmitter *pCtrl_8;
|
||||
u8 unkC;
|
||||
u8 unkD;
|
||||
//u8 padE[2];
|
||||
f32 unk10[3];
|
||||
f32 unk1C[3];
|
||||
f32 unk28[3];
|
||||
f32 unk34[3];
|
||||
}ActorLocal_Core2_D50F0;
|
||||
|
||||
|
||||
void func_8035C8F4(Actor *this);
|
||||
Actor* func_8035C71C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80372C80 = {
|
||||
0xC9, 0x13B, 0x401,
|
||||
0, NULL,
|
||||
func_8035C8F4, NULL, func_8035C71C,
|
||||
0, 0, 1.0f, 0
|
||||
};
|
||||
|
||||
struct31s D_80372CA4 = {
|
||||
{1.0f, 1.2f},
|
||||
{1.6f, 2.0f},
|
||||
{0.05f, 0.05f},
|
||||
{0.3f, 0.5f},
|
||||
0.1f, 0.5f
|
||||
};
|
||||
|
||||
struct43s D_80372CCC = {
|
||||
{{-5.0f, 10.0f, -5.0f}, {5.0f, 50.0f, 5.0f}},
|
||||
{{0.0f, 200.0f, 0.0f}, {0.0f, 1000.0f, 0.0f}},
|
||||
{{-20.0f, -20.0f, -20.0f}, {20.0f, 20.0f, 20.0f}}
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_8035C080(Actor *this, s32 next_state){
|
||||
f32 i;
|
||||
ActorLocal_Core2_D50F0 *local = (ActorLocal_Core2_D50F0 *)&this->local; //sp60
|
||||
f32 sp64[3];
|
||||
f32 sp60;
|
||||
f32 sp54[3];
|
||||
f32 sp48[3];
|
||||
f32 sp3C[3];
|
||||
s32 sp38;
|
||||
|
||||
local->unk0 = 0.0f;
|
||||
local->unkD = next_state;
|
||||
|
||||
if(next_state == 1){
|
||||
func_80335924(this->unk148, 0, 0.0f, 0.0f);
|
||||
this->yaw = local->unk34[0];
|
||||
}
|
||||
if( next_state == 3
|
||||
|| next_state == 4
|
||||
|| next_state == 7
|
||||
|| next_state == 6
|
||||
){
|
||||
func_80335924(this->unk148, ASSET_132_ANIM_FLOTSAM_MOVE, 0.1f, 0.7f);
|
||||
local->unk10[0] = this->position_x;
|
||||
local->unk10[1] = this->position_y;
|
||||
local->unk10[2] = this->position_z;
|
||||
actor_collisionOn(this);
|
||||
if(next_state == 3){
|
||||
player_getPosition(sp54);
|
||||
}
|
||||
else if(next_state == 4){//L8035C15C
|
||||
sp54[0] = local->unk28[0];\
|
||||
sp54[1] = local->unk28[1];\
|
||||
sp54[2] = local->unk28[2];
|
||||
}
|
||||
else if(next_state == 6){//L8035C180
|
||||
func_8030E6D4(SFX_1D_HITTING_AN_ENEMY_1);
|
||||
actor_collisionOff(this);
|
||||
player_getPosition(sp48);
|
||||
sp3C[0] = this->position_x - sp48[0];
|
||||
sp3C[1] = this->position_y - sp48[1];\
|
||||
sp3C[2] = this->position_z - sp48[2];\
|
||||
sp3C[1] = 0.0f;
|
||||
ml_vec3f_set_length(sp3C, 150.0f);
|
||||
sp54[0] = sp3C[0] + this->position_x;\
|
||||
sp54[1] = sp3C[1] + this->position_y;\
|
||||
sp54[2] = sp3C[2] + this->position_z;
|
||||
sp54[1] = local->unk4;
|
||||
}
|
||||
else{//L8035C228
|
||||
sp54[0] = this->position_x;\
|
||||
sp54[1] = this->position_y;\
|
||||
sp54[2] = this->position_z;
|
||||
} //L8035C240
|
||||
sp64[0] = sp54[0] - this->position_x;\
|
||||
sp64[1] = sp54[1] - this->position_y;\
|
||||
sp64[2] = sp54[2] - this->position_z;
|
||||
sp64[1] = 0.0f;
|
||||
sp60 = gu_sqrtf(sp64[0]*sp64[0] + sp64[1]*sp64[1] + sp64[2]*sp64[2]);
|
||||
|
||||
if(next_state == 4 && sp60 <= 250.0f){
|
||||
local->unk1C[0] = sp54[0];\
|
||||
local->unk1C[1] = sp54[1];\
|
||||
local->unk1C[2] = sp54[2];
|
||||
next_state = 5;
|
||||
}
|
||||
else{//L8035C2DC
|
||||
if(this->state == 2){
|
||||
if(300.0f < sp60){
|
||||
ml_vec3f_set_length(sp64, 300.0f);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(150.0f < sp60){
|
||||
ml_vec3f_set_length(sp64, 150.0f);
|
||||
}
|
||||
}////L8035C344
|
||||
for(i = 1; 0.025 < i; i -= 0.05){//L8035C378
|
||||
local->unk1C[0] = sp64[0] *i + this->position_x;
|
||||
local->unk1C[1] = local->unk4;
|
||||
local->unk1C[2] = sp64[2] *i + this->position_z;
|
||||
if(func_80329210(this, local->unk1C)){
|
||||
next_state = 5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}//L8035C3F8
|
||||
|
||||
if(next_state == 5){
|
||||
func_8030E878(0x3f2, randf2(1, 1.2f), 0x7530, this->position, 100.0f, 10000.0f);
|
||||
local->unk34[1] = this->yaw;
|
||||
if(sp60 <= 250.0f){
|
||||
local->unk34[2] = local->unk34[0];
|
||||
}
|
||||
else if(local->unk34[0] < local->unk34[1]){//L8035C47C
|
||||
local->unk34[2] = local->unk34[0] - 20.0f;
|
||||
}
|
||||
else{//L8035C4B0
|
||||
local->unk34[2] = local->unk34[0] + 20.0f;
|
||||
}
|
||||
}
|
||||
else if(next_state == 3){//L8035C4C0
|
||||
if(ml_vec3f_distance(local->unk28, this->position) < 10.0f){
|
||||
func_8035C080(this, 1);
|
||||
return;
|
||||
}
|
||||
else{
|
||||
func_8035C080(this, 4);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(next_state == 4){//L8035C514
|
||||
local->unk1C[0] = sp54[0];
|
||||
local->unk1C[1] = sp54[1];
|
||||
local->unk1C[2] = sp54[2];
|
||||
next_state = 5;
|
||||
}
|
||||
else if(next_state == 7){//L8035C540
|
||||
func_8035C080(this, 4);
|
||||
return;
|
||||
}
|
||||
}//L8035C560
|
||||
|
||||
if(next_state == 8){
|
||||
actor_collisionOff(this);
|
||||
FUNC_8030E624(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 25000);
|
||||
timed_playSfx(0.2f, SFX_103_FLOTSAM_DEATH, 1.0f, 32000);
|
||||
sp38 = func_802F9AA8(SFX_104_PROPELLER_NOISE);
|
||||
func_802F9DB8(sp38, 1.0f, 1.3f, 0.05f);
|
||||
func_802F9EC4(sp38, this->position, 0x5dc, 0x9c4);
|
||||
func_802F9F80(sp38, 0.0f, 2.0f, 2.0f);
|
||||
func_802FA060(sp38, 0x6590, 0x6d60, 500.0f);
|
||||
func_80335924(this->unk148, ASSET_189_ANIM_FLOTSAM_DIE, 0.1f, 4.0f);
|
||||
func_80335A8C(this->unk148, 2);
|
||||
local->pCtrl_8 = particleEmitter_new(20);
|
||||
particleEmitter_setSprite(local->pCtrl_8, ASSET_70E_SPRITE_SMOKE_2);
|
||||
particleEmitter_setStartingFrameRange(local->pCtrl_8, 0, 7);
|
||||
particleEmitter_setPosition(local->pCtrl_8, this->position);
|
||||
particleEmitter_setPositionVelocityAndAccelerationRanges(local->pCtrl_8, &D_80372CCC);
|
||||
func_802EFB98(local->pCtrl_8, &D_80372CA4);
|
||||
particleEmitter_setSpawnInterval(local->pCtrl_8, 4);
|
||||
}//L8035C698
|
||||
|
||||
this->state = next_state;
|
||||
|
||||
}
|
||||
|
||||
void func_8035C6C4(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
Actor *this = marker_getActor(this_marker);
|
||||
func_8035C080(this, 6);
|
||||
}
|
||||
|
||||
void func_8035C6F0(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
Actor *this = marker_getActor(this_marker);
|
||||
func_8035C080(this, 8);
|
||||
}
|
||||
|
||||
Actor* func_8035C71C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *this = marker_getActor(marker); //sp64
|
||||
ActorLocal_Core2_D50F0 *local = (ActorLocal_Core2_D50F0 *)&this->local; //sp60
|
||||
s32 sp5C;
|
||||
s32 pad58;
|
||||
f32 sp4C[3];
|
||||
f32 sp40[3];
|
||||
f32 sp34[3];
|
||||
f32 sp28[3];
|
||||
|
||||
if(this->state == 0) return this;
|
||||
|
||||
if(this->state == 8){
|
||||
sp5C = func_803356A0(this->unk148);
|
||||
if(sp5C){
|
||||
sp40[0] = 0.0f;
|
||||
sp40[1] = 0.0f;
|
||||
sp40[2] = local->unk0 * -2200.0f;
|
||||
func_80345C78(sp4C, sp40);
|
||||
func_8033A8F0(sp5C, 3, sp4C);
|
||||
sp34[0] = 1.0 - local->unk0*0.5;
|
||||
sp34[1] = 1.0 - local->unk0*0.5;
|
||||
sp34[2] = 1.0 - local->unk0*0.5;
|
||||
func_8033A928(sp5C, 3, sp34);
|
||||
}
|
||||
}
|
||||
|
||||
if(local->pCtrl_8){
|
||||
func_8033A450(func_80329934());
|
||||
}
|
||||
|
||||
func_80325888(marker, gfx, mtx, vtx);
|
||||
|
||||
if(local->pCtrl_8 && this->marker->unk14_21){
|
||||
func_8034A174(func_80329934(), 5, sp28);
|
||||
particleEmitter_setPosition(local->pCtrl_8, sp28);
|
||||
func_802EF3A8(local->pCtrl_8, gfx, mtx, vtx);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
void func_8035C8C8(Actor *this){
|
||||
ActorLocal_Core2_D50F0 *local = (ActorLocal_Core2_D50F0 *)&this->local;
|
||||
|
||||
if(local->pCtrl_8)
|
||||
func_802EF684(local->pCtrl_8);
|
||||
}
|
||||
|
||||
void func_8035C8F4(Actor *this){
|
||||
f32 plyr_pos[3];
|
||||
f32 sp40[3];
|
||||
f32 sp3C;
|
||||
ActorLocal_Core2_D50F0 *local = (ActorLocal_Core2_D50F0 *)&this->local;
|
||||
f32 sp34;
|
||||
|
||||
sp34 = time_getDelta();
|
||||
if(this->state == 0){
|
||||
this->marker->unk14_21 = FALSE;
|
||||
this->marker->unk30 = func_8035C8C8;
|
||||
marker_setCollisionScripts(this->marker, func_8035C6C4, func_8035C6C4, func_8035C6F0);
|
||||
local->unk4 = func_80309724(this->position);
|
||||
local->pCtrl_8 = NULL;
|
||||
local->unk34[0] = this->yaw;
|
||||
local->unk34[2] = local->unk34[1] = local->unk34[0];
|
||||
local->unk28[0] = this->position_x;
|
||||
local->unk28[1] = this->position_y;
|
||||
local->unk28[2] = this->position_z;
|
||||
func_8035C080(this, 1);
|
||||
}//L8035C9AC
|
||||
|
||||
player_getPosition(plyr_pos);
|
||||
sp40[0] = plyr_pos[0] - this->position_x;
|
||||
sp40[1] = plyr_pos[1] - this->position_y;
|
||||
sp40[2] = plyr_pos[2] - this->position_z;
|
||||
sp3C = gu_sqrtf(sp40[0]*sp40[0] + sp40[1]*sp40[1] + sp40[2]*sp40[2]);
|
||||
if(local->pCtrl_8){
|
||||
particleEmitter_update(local->pCtrl_8);
|
||||
}
|
||||
|
||||
if(this->state == 1){
|
||||
if( sp3C < 800.0f
|
||||
&& func_80329210(this, plyr_pos)
|
||||
&& plyr_pos[1] < this->position_y + 100.0f
|
||||
){
|
||||
func_8035C080(this, 3);
|
||||
}
|
||||
}//L8035CA80
|
||||
|
||||
if(this->state == 5){
|
||||
local->unk0 += 1.9047619047619049*sp34;
|
||||
if(1.0f <= local->unk0)
|
||||
local->unk0 = 1.0f;
|
||||
func_80255FE4(this->position, local->unk10, local->unk1C, local->unk0);
|
||||
this->position_y += 100.0f*sinf(local->unk0*3.141592654);
|
||||
this->yaw = local->unk0*(local->unk34[2] - local->unk34[1]) + local->unk34[1];
|
||||
if(func_80335794(this->unk148) > 0){
|
||||
if(ml_vec3f_distance(this->position, local->unk28) < 10.0f){
|
||||
func_8035C080(this, 1);
|
||||
}
|
||||
else if(local->unkC > 0){//L8035CB8C
|
||||
local->unkC--;
|
||||
if(local->unkC > 0){
|
||||
func_8035C080(this, 7);
|
||||
}
|
||||
else{
|
||||
func_8035C080(this, 2);
|
||||
}
|
||||
}
|
||||
else{
|
||||
func_8035C080(this, 2);
|
||||
}
|
||||
}
|
||||
}//L8035CBD4
|
||||
|
||||
if(this->state == 2){
|
||||
if(sp3C < 800.0f){
|
||||
func_8035C080(this, 3);
|
||||
}
|
||||
else{
|
||||
func_8035C080(this, 4);
|
||||
}
|
||||
}//L8035CC38
|
||||
|
||||
if(this->state == 8){
|
||||
local->unk0 += 0.25*sp34;
|
||||
if(func_80335794(this->unk148) > 0)
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
}
|
606
src/core2/ch/gameSelect.c
Normal file
606
src/core2/ch/gameSelect.c
Normal file
@@ -0,0 +1,606 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#ifndef ABS
|
||||
#define ABS(d) ((d) >= 0) ? (d) : -(d)
|
||||
#endif
|
||||
|
||||
void func_8031FBF8(void);
|
||||
void func_8031FBA0(void);
|
||||
void func_803184C8(gczoombox_t *, f32, s32, s32, f32, s32, s32);
|
||||
|
||||
Actor *func_802C4360(ActorMarker *, Gfx **, Mtx **, Vtx **);
|
||||
Actor *func_802C4464(ActorMarker *, Gfx **, Mtx **, Vtx **);
|
||||
void func_802C4C14(Actor *this);
|
||||
void func_802C5740(Actor *this);
|
||||
|
||||
extern void func_802C71F0(Actor *);
|
||||
extern void func_802C74F4(Actor *, s32, f32 );
|
||||
extern void func_8031FB14(s32, s32);
|
||||
extern void func_8031F678(s32, s32);
|
||||
extern void func_80335110(s32);
|
||||
|
||||
extern void func_8024E60C(s32, f32*);
|
||||
extern void func_8024E71C(s32, f32*);
|
||||
|
||||
|
||||
/* .data */
|
||||
f32 D_80365DD0[3][3] = {
|
||||
{-320.0f, 340.0f, 350.0f},
|
||||
{110.0f, 340.0f, 110.0f},
|
||||
{-413.333313f, 353.333313f, -234.305511f}
|
||||
};
|
||||
u8 *D_80365DF4 = "USE THE CONTROL STICK TO SELECT A GAME.";
|
||||
u8 *D_80365DF8 = "PRESS A TO PLAY THE GAME OR Z TO ERASE IT!";
|
||||
u8 *D_80365DFC = "ARE YOU SURE? PRESS A TO CONFIRM, OR B TO CANCEL";
|
||||
s32 D_80365E00 = -1;
|
||||
f32 D_80365E04[3][3] = {
|
||||
{-435.0f, 278.0f, -159.0f},
|
||||
{ 444.635437f, 216.0f, -356.591675f},
|
||||
{ 55.0f, 191.822906f, -905.96875f}
|
||||
};
|
||||
|
||||
ActorAnimationInfo D_80365E28[] = {
|
||||
{0x000, 0.0f},
|
||||
{0x24D, 9e+09f},
|
||||
{0x24D, 2.0f},
|
||||
{0x24E, 1.0f},
|
||||
{0x24F, 0.6f},
|
||||
{0x24D, 2.0f}
|
||||
};
|
||||
ActorInfo D_80365E58 = { 0xE4, 0x195, 0x532, 0x1, D_80365E28, func_802C5740, func_80326224, func_802C4464, 0, 0, 0.0f, 0};
|
||||
|
||||
ActorAnimationInfo D_80365E7C[] = {
|
||||
{0x000, 0.0f},
|
||||
{0x250, 9e+09f},
|
||||
{0x250, 4.5f},
|
||||
{0x251, 1.0f},
|
||||
{0x252, 0.67f},
|
||||
{0x250, 4.5f},
|
||||
};
|
||||
ActorInfo D_80365EAC = { 0xE5, 0x196, 0x532, 0x1, D_80365E7C, func_802C4C14, func_80326224, func_802C4360, 0, 0, 0.0f, 0};
|
||||
|
||||
ActorAnimationInfo D_80365ED0[] = {
|
||||
{0x000, 0.0f},
|
||||
{0x24A, 9e+09f},
|
||||
{0x24A, 1.0f},
|
||||
{0x24B, 1.0f},
|
||||
{0x24C, 1.0f},
|
||||
{0x24A, 1.0f}
|
||||
};
|
||||
ActorInfo D_80365F00 = { 0xE6, 0x197, 0x532, 0x1, D_80365ED0, func_802C4C14, func_80326224, func_802C4360, 0, 0, 0.0f, 0};
|
||||
|
||||
|
||||
/* .bss */
|
||||
// Remove this when this memory region is properly symbolized
|
||||
u8 unk_8037DCB0[0x8037DCE0 - 0x8037DCB0];
|
||||
|
||||
extern u8 D_8037DCCE[0x12];
|
||||
|
||||
struct {
|
||||
u8 *unk0;
|
||||
u8 *unk4;
|
||||
} D_8037DCE0;
|
||||
s32 D_8037DCE8;
|
||||
s32 D_8037DCEC;
|
||||
gczoombox_t *D_8037DCF0;
|
||||
gczoombox_t *D_8037DCF4;
|
||||
f32 D_8037DCF8[2][3];
|
||||
f32 D_8037DD10[2][3];
|
||||
void *D_8037DD28;
|
||||
s32 D_8037DD2C;
|
||||
f32 D_8037DD30;
|
||||
f32 D_8037DD34;
|
||||
|
||||
|
||||
|
||||
/* .code */
|
||||
Actor *func_802C4360(ActorMarker *marker, Gfx **arg1, Mtx **arg2, Vtx **arg3){
|
||||
s32 sp1C = marker->unk14_20 - 0xe4;
|
||||
func_8033A45C(3, sp1C);
|
||||
func_8033A45C(1, 1);
|
||||
func_8033A45C(4, 1);
|
||||
func_8033A45C(9, 1);
|
||||
func_8033A45C(5, 0);
|
||||
func_8033A45C(8, 0);
|
||||
func_8033A45C(6, 0);
|
||||
func_8033A45C(7, 0);
|
||||
func_8033A45C(0xC, 1);
|
||||
func_8033A45C(0xF, 1);
|
||||
if(sp1C == D_80365E00){
|
||||
func_8033A388(0xFF, 0xFF, 0xFF, 0xFF);
|
||||
}
|
||||
else{
|
||||
func_8033A388(0x64, 0x64, 0x64, 0xFF);
|
||||
}
|
||||
return func_80325888(marker, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
Actor *func_802C4464(ActorMarker *marker, Gfx **arg1, Mtx **arg2, Vtx **arg3){
|
||||
Actor *ret_val = func_802C4360(marker, arg1, arg2, arg3);
|
||||
if(D_8037DCF4)
|
||||
gczoombox_draw(D_8037DCF4, arg1, arg2, arg3);
|
||||
if(D_8037DCF0)
|
||||
gczoombox_draw(D_8037DCF0, arg1, arg2, arg3);
|
||||
return ret_val;
|
||||
|
||||
}
|
||||
|
||||
void func_802C44D0(s32 arg0, s32 arg1){
|
||||
if(arg1 == 3)
|
||||
D_8037DD2C = 0;
|
||||
}
|
||||
|
||||
void *func_802C44EC(f32 arg0[3], f32 arg1[3], f32 arg2) {
|
||||
f32 phi_f12;
|
||||
f32 sp40[3];
|
||||
s32 i;
|
||||
static bool D_8037DD38;
|
||||
static f32 D_8037DD3C;
|
||||
static f32 D_8037DD40;
|
||||
|
||||
arg2 = (arg2 > 0.75) ? 0.75 : arg2;
|
||||
sp40[0] = arg1[0] - arg0[0];
|
||||
sp40[1] = arg1[1] - arg0[1];
|
||||
sp40[2] = arg1[2] - arg0[2];
|
||||
D_8037DD38 = D_8037DD38^1;
|
||||
phi_f12 = gu_sqrtf(sp40[0]*sp40[0] + sp40[1]*sp40[1] + sp40[2]*sp40[2]);
|
||||
if (phi_f12 < 10.0f) {
|
||||
phi_f12 = 500.0f;
|
||||
}
|
||||
D_8037DD3C = 1.0 + (9.0f / gu_sqrtf(phi_f12));
|
||||
D_8037DD40 = sinf(D_8037DD3C*1.5707963267948966);
|
||||
for(i = 0; i < 3; i++){
|
||||
D_8037DD10[D_8037DD38][i] = arg0[i] + ((arg1[i] - arg0[i])*sinf((((arg2 / 0.75) * 3.1415926535897931) / 2) * D_8037DD3C)) / D_8037DD40;
|
||||
D_8037DCF8[D_8037DD38][i] += (D_8037DD10[D_8037DD38][i] - D_8037DCF8[D_8037DD38][i]) / 5.0;
|
||||
|
||||
}
|
||||
return &D_8037DCF8[D_8037DD38];
|
||||
}
|
||||
|
||||
void func_802C4768(s32 gamenum){
|
||||
u8 * sp20[2];
|
||||
static u8 D_8037DD48[0x20];
|
||||
static u8 D_8037DD68[0x20];
|
||||
|
||||
func_8031FBF8();
|
||||
D_80365E00 = gamenum;
|
||||
func_8031FBA0();
|
||||
if(func_8033D1BC(gamenum)){
|
||||
func_8033D13C(gamenum);
|
||||
D_8037DCCE[gamenum] = (func_8034717C(6)) ? 1 : 0;
|
||||
|
||||
strcpy(D_8037DD48, "");
|
||||
strcat(D_8037DD48, "GAME ");
|
||||
switch(gamenum){
|
||||
case 0: //L802C4820
|
||||
strIToA(D_8037DD48, 1);
|
||||
break;
|
||||
case 1: //L802C4838
|
||||
strIToA(D_8037DD48, 3);
|
||||
break;
|
||||
case 2: //L802C484C
|
||||
strIToA(D_8037DD48, 2);
|
||||
break;
|
||||
}//L802C4858
|
||||
strcat(D_8037DD48, ": TIME ");
|
||||
strcat(D_8037DD48, func_80311C64(func_803470A0()));
|
||||
strcat(D_8037DD48, ",");
|
||||
strcat(D_8037DD48, "");
|
||||
|
||||
strcpy(D_8037DD68, "");
|
||||
strIToA(D_8037DD68, jiggyscore_total());
|
||||
strcat(D_8037DD68, " JIGSAW");
|
||||
if(jiggyscore_total() != 1){
|
||||
strcat(D_8037DD68, "S");
|
||||
}
|
||||
strcat(D_8037DD68, ", ");
|
||||
strIToA(D_8037DD68, notescore_getTotal());
|
||||
strcat(D_8037DD68, " NOTE");
|
||||
if(notescore_getTotal() != 1){
|
||||
strcat(D_8037DD68, "S");
|
||||
}
|
||||
strcat(D_8037DD68, ".");
|
||||
strcat(D_8037DD68, "");
|
||||
}//L802C49AC
|
||||
else{
|
||||
D_8037DCCE[gamenum] = 0;
|
||||
strcpy(D_8037DD48, "");
|
||||
strcat(D_8037DD48, "GAME ");
|
||||
switch (gamenum){
|
||||
case 0:
|
||||
strIToA(D_8037DD48, 1);
|
||||
break;
|
||||
case 1:
|
||||
strIToA(D_8037DD48, 3);
|
||||
break;
|
||||
case 2:
|
||||
strIToA(D_8037DD48, 2);
|
||||
break;
|
||||
}//L802C4A40
|
||||
strcat(D_8037DD48, ": EMPTY");
|
||||
strcpy(D_8037DD68, "");
|
||||
}//L802C4A68
|
||||
sp20[0] = D_8037DD48;\
|
||||
sp20[1] = D_8037DD68;
|
||||
func_8031877C(D_8037DCF4);
|
||||
func_80318284(D_8037DCF4, 2, sp20);
|
||||
gczoombox_maximize(D_8037DCF4);
|
||||
gczoombox_resolve_minimize(D_8037DCF4);
|
||||
}
|
||||
|
||||
void func_802C4AC8(s32 arg0){
|
||||
func_8033D0FC(arg0);
|
||||
func_802C4768(arg0);
|
||||
}
|
||||
|
||||
void func_802C4AF0(Actor * this){
|
||||
int i;
|
||||
|
||||
if(D_8037DCF0){
|
||||
gczoombox_free(D_8037DCF0);
|
||||
D_8037DCF0 = NULL;
|
||||
}
|
||||
|
||||
if(D_8037DCF4){
|
||||
gczoombox_free(D_8037DCF4);
|
||||
D_8037DCF4 = NULL;
|
||||
}
|
||||
|
||||
for(i = 0; i < 3; i++){
|
||||
func_8033CFD4(i);
|
||||
}
|
||||
|
||||
if(D_8037DD28){
|
||||
func_802F9D38(D_8037DD28);
|
||||
D_8037DD28 = NULL;
|
||||
}
|
||||
|
||||
comusic_8025AB44(COMUSIC_73_GAMEBOY, 0, 4000);
|
||||
func_8025AABC(COMUSIC_73_GAMEBOY);
|
||||
func_8025AB00();
|
||||
}
|
||||
|
||||
void func_802C4BB4(ActorMarker *marker){
|
||||
Actor *this;
|
||||
s32 sp20;
|
||||
Actor *other;
|
||||
f32 sp18;
|
||||
sp20 = marker->unk14_20 - 0xe4;
|
||||
this = marker_getActor(marker);
|
||||
sp18 = this->scale;
|
||||
other = func_8032813C(sp20 + 0x198, this->position, (s32)this->yaw);
|
||||
other->scale = sp18;
|
||||
}
|
||||
|
||||
void func_802C4C14(Actor *this){
|
||||
int sp84;
|
||||
int sp80;
|
||||
s32 sp74[3];
|
||||
s32 *tmp_a2; //pad70
|
||||
s32 pad_6C;
|
||||
s32 pad_68;
|
||||
s32 sp5C[3];
|
||||
s32 pad_58;
|
||||
f32 sp54;
|
||||
f32 sp50;
|
||||
int i; //sp4C
|
||||
s32 sp48;
|
||||
f32 sp44;
|
||||
s32 tmp_a2_2;
|
||||
f32 sp34[3];
|
||||
|
||||
sp84 = this->marker->unk14_20 - 0xe4;
|
||||
sp80 = (sp84 == D_80365E00);
|
||||
sp50 = time_getDelta();
|
||||
if(!D_8037DCF4)
|
||||
return;
|
||||
|
||||
if(!this->initialized){
|
||||
func_802C3C88(func_802C4BB4, this->marker);
|
||||
func_802C7318(this);
|
||||
this->unk130 = func_802C71F0;
|
||||
if(sp84 == 0){
|
||||
func_802C75A0(this, 1);
|
||||
func_802C74F4(this, 0, 1.0f);
|
||||
func_802C74F4(this, 1, 1.0f);
|
||||
}//L802C4CD8
|
||||
this->initialized = TRUE;
|
||||
}//L802C4CE4
|
||||
func_802C7478(this);
|
||||
if(!sp80){
|
||||
if(this->state != 1){
|
||||
func_80328A84(this, 1);
|
||||
}
|
||||
}
|
||||
else{//L802C4D24
|
||||
func_8024E60C(0, sp74);
|
||||
func_8024E55C(0, sp5C);
|
||||
func_8024E71C(0, &sp54);
|
||||
switch(this->state){
|
||||
case 2:
|
||||
case 5:
|
||||
switch(sp84){
|
||||
case 0://L802C4D8C
|
||||
if(actor_animationIsAt(this, 0.1f))
|
||||
func_8030E510(SFX_5D_BANJO_RAAOWW, 8000);
|
||||
|
||||
if(actor_animationIsAt(this, 0.7f))
|
||||
func_8030E510(SFX_5E_BANJO_PHEWWW, 8000);
|
||||
break;
|
||||
case 1://L802C4DD0
|
||||
if(randf() < 0.1){
|
||||
// if(randf() < D_80376118){
|
||||
func_8030E6A4(MIN(2.0f, randf() *3.0f) + 311.0f, 1.0f, 12000);
|
||||
}
|
||||
break;
|
||||
case 2://L802C4E74
|
||||
if(randf() < 0.03){
|
||||
func_8030E6A4(0x3ed, randf()*0.3 + 0.7, 15000);
|
||||
}
|
||||
break;
|
||||
}//L802C4ED4
|
||||
break;
|
||||
}//L802C4ED4
|
||||
if(!func_8038AAB0()){
|
||||
switch(this->state){
|
||||
case 1://L802C4F10
|
||||
if(sp84 == 1){
|
||||
func_8030E510(SFX_136_GAMEBOY_STARTUP, 15000);
|
||||
timedFunc_set_3(0.25f, comusic_8025AB44, COMUSIC_73_GAMEBOY, -1, 2000);
|
||||
func_8025A58C(0, 2000);
|
||||
}
|
||||
else{
|
||||
comusic_8025AB44(COMUSIC_73_GAMEBOY, 0, 4000);
|
||||
func_8025A58C(-1, 2000);
|
||||
}
|
||||
|
||||
if(sp84 == 2){
|
||||
D_8037DD28 = func_802F9AA8(SFX_12B_BOILING_AND_BUBBLING);
|
||||
func_802F9F80(D_8037DD28, 0.5f, 9000000000.0f, 0.5f);
|
||||
func_802F9DB8(D_8037DD28, 0.9f, 0.9f, 0.0f);
|
||||
func_802FA060(D_8037DD28, 15000, 15000, 0.0f);
|
||||
}
|
||||
else{
|
||||
if(D_8037DD28){
|
||||
func_802F9D38(D_8037DD28);
|
||||
D_8037DD28 = NULL;
|
||||
}
|
||||
}
|
||||
func_802C4768(sp84);
|
||||
func_80328A84(this, 2);
|
||||
break;
|
||||
case 5://L802C5040
|
||||
if(D_8037DD2C == 0 &&
|
||||
(sp5C[0] == 1 || sp5C[1] == 1)
|
||||
){
|
||||
if(sp5C[0] == 1){
|
||||
func_802C4AC8(sp84);
|
||||
func_8025A6EC(COMUSIC_2B_DING_B, 22000);
|
||||
}
|
||||
func_80328A84(this, 2);
|
||||
func_8031877C(D_8037DCF0);
|
||||
func_80318284(D_8037DCF0, 2, &D_8037DCE0);
|
||||
D_8037DD34 = 0.0f;
|
||||
}
|
||||
break;
|
||||
case 3://L802C50C8
|
||||
case 4://L802C50C8
|
||||
if(animctrl_isStopped(this->animctrl)){
|
||||
func_802DEB80();
|
||||
if(!func_8033D1BC(sp84)){
|
||||
timedFunc_set_3(0.0f, func_802E4078, MAP_85_CS_SPIRAL_MOUNTAIN_3, 0, 1);
|
||||
}
|
||||
else{//L802C511C
|
||||
sp44 = 0.0f;
|
||||
if(this->state == 4 && (sp84 == 0 || sp84 == 1))
|
||||
sp44 = 0.25f;
|
||||
if(func_802DA498() && func_8031FF1C(BKPROG_BD_ENTER_LAIR_CUTSCENE)){
|
||||
timedFunc_set_2(sp44, func_8031FB14, 0, 0);
|
||||
}
|
||||
else{//L802C5188
|
||||
timedFunc_set_2(sp44, func_8031F678, 0, 0);
|
||||
}//L802C51A0
|
||||
timedFunc_set_1(sp44, func_80335110, 1);
|
||||
}//L802C51B8
|
||||
this->state = 6;
|
||||
}
|
||||
break;
|
||||
case 2://L802C51CC
|
||||
if(sp74[0] == 1){
|
||||
if(func_8033D1BC(sp84)){
|
||||
func_8031877C(D_8037DCF0);
|
||||
func_803183A4(D_8037DCF0, (&D_80365DFC)[func_8031B5B0()]);
|
||||
D_8037DD2C = 1;
|
||||
func_80328A84(this, 5);
|
||||
}
|
||||
else{//L802C5240
|
||||
func_8025A6EC(COMUSIC_2C_BUZZER, 22000);
|
||||
}
|
||||
}
|
||||
else if(sp5C[0] == 1){//L802C5250
|
||||
if(func_8033D1BC(sp84)){
|
||||
if(randf() < 0.1){
|
||||
switch(sp84){
|
||||
case 0://L802C52B8
|
||||
func_8030E510(SFX_31_BANJO_OHHWAAOOO, 28000);
|
||||
func_8030E540(SFX_135_CARTOONY_SPRING);
|
||||
timedFunc_set_2(0.4f, func_8030E510, SFX_13A_GLASS_BREAKING_7, 0x7fff);
|
||||
timedFunc_set_2(0.9f, func_8030E510, SFX_150_PORCELAIN_CRASH, 0x7fff);
|
||||
timedFunc_set_2(1.0f, func_8030E510, SFX_151_CAT_MEOW, 0x7fff);
|
||||
break;
|
||||
case 1://L802C5320
|
||||
timedFunc_set_2(0.4f, func_8030E510, SFX_31_BANJO_OHHWAAOOO, 28000);
|
||||
timedFunc_set_2(0.2f, func_8030E510, SFX_E_SHOCKSPRING_BOING, 28000);
|
||||
func_8030E540(SFX_2D_KABOING);
|
||||
break;
|
||||
case 2://L802C5364
|
||||
timedFunc_set_2(0.15f, func_8030E510, SFX_32_BANJO_EGHEE, 28000);
|
||||
func_8030E510(SFX_3F6_UNKNOWN, 28000);
|
||||
func_8030E540(SFX_8F_SNOWBALL_FLYING);
|
||||
break;
|
||||
}//L802C5394
|
||||
func_80328A84(this, 4);
|
||||
levelSpecificFlags_set(sp84 + 0x35, 1);
|
||||
}
|
||||
else{//L802C53B4
|
||||
func_8030E484(SFX_3EA_UNKNOWN);
|
||||
func_80328A84(this, 3);
|
||||
}
|
||||
}else{//L802C53D0
|
||||
func_8030E510(SFX_4F_BANJO_WAHOO, 28000);
|
||||
func_80328A84(this, 3);
|
||||
}//L802C53E8
|
||||
if(sp84 == 0)
|
||||
func_802C75A0(this, 2);
|
||||
|
||||
if(sp84 == 1)
|
||||
comusic_8025AB44(COMUSIC_73_GAMEBOY, 0, 4000);
|
||||
|
||||
func_8025A58C(0, 0x1f4);
|
||||
actor_playAnimationOnce(this);
|
||||
}
|
||||
else{//L802C5434
|
||||
if((0.7 < ((0.0f <= sp54) ? sp54 : -sp54)) && D_8037DCEC == 0
|
||||
){
|
||||
tmp_a2_2 = D_80365E00;
|
||||
if(sp54 < 0.0f){
|
||||
D_8037DCEC = 1;
|
||||
switch(D_80365E00){
|
||||
case 0:
|
||||
D_8037DCEC = 0;
|
||||
break;
|
||||
case 1:
|
||||
D_80365E00 = 2;
|
||||
break;
|
||||
case 2:
|
||||
D_80365E00 = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{//L802C54D4
|
||||
D_8037DCEC = 1;
|
||||
switch(D_80365E00){
|
||||
case 0:
|
||||
D_80365E00 = 2;
|
||||
break;
|
||||
case 1:
|
||||
D_8037DCEC = 0;
|
||||
break;
|
||||
case 2:
|
||||
D_80365E00 = 1;
|
||||
break;
|
||||
}
|
||||
}//L802C550C
|
||||
if(D_8037DCEC){
|
||||
D_8037DCE8 = tmp_a2_2;
|
||||
D_8037DD30 = 0.0f;
|
||||
}
|
||||
}else{//L802C5530
|
||||
if(((0.0f <= sp54) ? sp54 : -sp54) < 0.3){
|
||||
D_8037DCEC = 0;
|
||||
}
|
||||
}
|
||||
}//L802C556C
|
||||
if(D_8037DD2C == 0){
|
||||
D_8037DD34 += sp50;
|
||||
if(20.0 < D_8037DD34){
|
||||
func_8031877C(D_8037DCF0);
|
||||
func_80318284(D_8037DCF0, 2, &D_8037DCE0);
|
||||
D_8037DD34 = 0.0f;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6://L802C55E8
|
||||
break;
|
||||
}
|
||||
}//L802C55E8
|
||||
D_8037DD30 += sp50;
|
||||
sp48 = func_803097A0();
|
||||
if(this->marker->unk14_21){
|
||||
for(i = 0; i < 3; i++){
|
||||
func_8034A174(sp48, i+5, sp34);
|
||||
ml_vec3f_copy(D_80365DD0[i], sp34);
|
||||
}
|
||||
}
|
||||
func_802BAEB4(
|
||||
func_802C44EC(D_80365DD0[D_8037DCE8], D_80365DD0[D_80365E00], D_8037DD30),
|
||||
func_802C44EC(D_80365E04[D_8037DCE8], D_80365E04[D_80365E00], D_8037DD30)
|
||||
);
|
||||
if(this->marker->unk14_21)
|
||||
osViBlack(0);
|
||||
}//L802C5734
|
||||
}
|
||||
|
||||
void func_802C5740(Actor * this){
|
||||
int i = func_8031B5B0();
|
||||
D_8037DCE0.unk0 = (&D_80365DF4)[i];
|
||||
D_8037DCE0.unk4 = (&D_80365DF8)[i];
|
||||
|
||||
if(!this->initialized){
|
||||
func_8033CE40();
|
||||
if(D_8037DCF4 == NULL){
|
||||
D_8037DCF4 = gczoombox_new(0xA0, 0xc, 2, 0, NULL);
|
||||
gczoombox_open(D_8037DCF4);
|
||||
func_803184C8(D_8037DCF4, 30.0f, 5, 2, 0.4f, 0, 0);
|
||||
}//L802C57FC
|
||||
|
||||
if(D_8037DCF0 == NULL){
|
||||
D_8037DCF0 = gczoombox_new(0xA, 0xd, 2, 1, func_802C44D0);
|
||||
func_80318284(D_8037DCF0, 2, &D_8037DCE0);
|
||||
gczoombox_open(D_8037DCF0);
|
||||
gczoombox_maximize(D_8037DCF0);
|
||||
}//L802C5860
|
||||
|
||||
func_803300D8(this->marker, func_802C4AF0);
|
||||
D_8037DCEC = 0;
|
||||
func_8031FBF8();
|
||||
func_8031FBA0();
|
||||
D_8037DCE8 = 0;
|
||||
D_80365E00 = 0;
|
||||
D_8037DCF8[1][0] = D_80365DD0[0][0];
|
||||
D_8037DCF8[1][1] = D_80365DD0[0][1];
|
||||
D_8037DCF8[1][2] = D_80365DD0[0][2];
|
||||
|
||||
D_8037DCF8[0][0] = D_80365E04[0][0];
|
||||
D_8037DCF8[0][1] = D_80365E04[0][1];
|
||||
D_8037DCF8[0][2] = D_80365E04[0][2];
|
||||
D_8037DD30 = 0.75f;
|
||||
D_8037DD34 = func_8038AAB0(&D_80365E04[0], &D_8037DCE8) ? 20.0 : 0.0;
|
||||
actor_collisionOff(this);
|
||||
func_8025A6EC(COMUSIC_73_GAMEBOY, 0);
|
||||
}//L802C5940
|
||||
if(!func_8038AAB0()){
|
||||
if(D_8037DCF4)
|
||||
func_80316EF4(D_8037DCF4);
|
||||
if(D_8037DCF0)
|
||||
func_80316EF4(D_8037DCF0);
|
||||
}
|
||||
func_802C4C14(this);
|
||||
}
|
||||
|
||||
void func_802C5994(void){
|
||||
s32 sp1C = level_get();
|
||||
s32 t6 = map_get() == MAP_83_CS_GAME_OVER_MACHINE_ROOM;
|
||||
s32 a1 = (0 < sp1C && sp1C < 0xd);
|
||||
if( a1 || t6)
|
||||
{
|
||||
if(D_80365E00 != -1 && !func_802E4A08() && map_get() != MAP_91_FILE_SELECT){
|
||||
func_8033D17C(D_80365E00);
|
||||
func_8033CFD4(D_80365E00);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_802C5A30(void){
|
||||
return D_80365E00;
|
||||
}
|
||||
|
||||
void func_802C5A3C(s32 arg0){
|
||||
D_80365E00 = arg0;
|
||||
}
|
||||
|
||||
void func_802C5A48(void){
|
||||
D_80365E00 = -1;
|
||||
}
|
367
src/core2/ch/ghost.c
Normal file
367
src/core2/ch/ghost.c
Normal file
@@ -0,0 +1,367 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
typedef struct {
|
||||
f32 unk0;
|
||||
f32 unk4;
|
||||
} ActorLocal_Core2_D4050;
|
||||
|
||||
void func_8035B900(Actor *this);
|
||||
void func_8035BD48(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_80372BE0[] ={
|
||||
{0x00, 0.0f},
|
||||
{ASSET_9E_ANIM_TEEHEE_IDLE, 2.0f},
|
||||
{ASSET_9F_ANIM_TEEHEE_ALERTED, 1.5f},
|
||||
{ASSET_AC_ANIM_TEEHEE_CHASE, 1.0f},
|
||||
{ASSET_9E_ANIM_TEEHEE_IDLE, 2.0f},
|
||||
{ASSET_9E_ANIM_TEEHEE_IDLE, 2.0f},
|
||||
{ASSET_2AB_ANIM_TEEHEE_DIE, 1.0f}
|
||||
};
|
||||
|
||||
ActorInfo D_80372C18 = { //TEEHEE
|
||||
0x99, ACTOR_CA_TEEHEE, ASSET_3CB_MODEL_TEEHEE,
|
||||
0x1, D_80372BE0,
|
||||
func_8035B900, func_80326224, func_80325888,
|
||||
6500, 0, 0.9f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_80372C3C = { //PURPLE_TEEHEE (inside tumblar)
|
||||
0x296, ACTOR_3C1_PURPLE_TEEHEE, ASSET_564_MODEL_PURPLE_TEEHEE,
|
||||
0x1, D_80372BE0,
|
||||
func_8035B900, func_8035BD48, func_80325888,
|
||||
6500, 0, 0.9f, 0
|
||||
};
|
||||
|
||||
s32 D_80372C60[3] = {0x46, 0xFE, 0x46};
|
||||
|
||||
s32 D_80372C6C[3] = {0xFE, 0x46, 0xFE};
|
||||
|
||||
/* .code */
|
||||
void func_8035AFE0(f32 scale, f32 pos[3], s32 cnt, enum asset_e sprite_id, s32 arg4[3]){
|
||||
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
|
||||
|
||||
particleEmitter_setSprite(pCtrl, sprite_id);
|
||||
func_802EFFA8(pCtrl, arg4);
|
||||
particleEmitter_setPosition(pCtrl, pos);
|
||||
particleEmitter_setParticleSpawnPositionRange(pCtrl,
|
||||
-100.0f*scale, 20.0f*scale, -100.0f*scale,
|
||||
100.0f*scale, 200.0f*scale, 100.0f*scale
|
||||
);
|
||||
particleEmitter_setParticleAccelerationRange(pCtrl,
|
||||
0.0f, -10.0f*scale, 0.0f,
|
||||
0.0f, -10.0f*scale, 0.0f
|
||||
);
|
||||
particleEmitter_setParticleVelocityRange(pCtrl,
|
||||
-100.0f*scale, -20.0f*scale, -100.0f*scale,
|
||||
100.0f*scale, 100.0f*scale, 100.0f*scale
|
||||
);
|
||||
func_802EFB70(pCtrl, scale*0.4, scale*0.6);
|
||||
func_802EFB84(pCtrl, scale*1.0, scale*1.4);
|
||||
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
|
||||
func_802EFEC0(pCtrl, 1.0f, 1.4f);
|
||||
func_802EFA5C(pCtrl, 0.0f, 0.01f);
|
||||
func_802EFA70(pCtrl, 0x10);
|
||||
particleEmitter_emitN(pCtrl, cnt);
|
||||
}
|
||||
|
||||
void func_8035B1CC(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
Actor *this = marker_getActor(this_marker);
|
||||
f32 sp30;
|
||||
|
||||
sp30 = this->scale;
|
||||
func_8030E878(SFX_121_AWAWAU, 1.3f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
|
||||
func_8030E878(SFX_30_MAGIC_POOF, 1.0f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
|
||||
func_80328B8C(this, 6, 0.01f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
actor_collisionOff(this);
|
||||
func_80326310(this);
|
||||
func_8035AFE0(sp30, this->position, 8, ASSET_700_SPRITE_DUST, D_80372C60);
|
||||
}
|
||||
|
||||
void func_8035B2C4(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
Actor *this = marker_getActor(this_marker);
|
||||
f32 sp30 = this->scale;
|
||||
func_8030E878(SFX_121_AWAWAU, 1.3f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
|
||||
func_8030E878(SFX_30_MAGIC_POOF, 1.0f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
|
||||
func_80328B8C(this, 6, 0.01f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
actor_collisionOff(this);
|
||||
func_8035AFE0(sp30, this->position, 8, ASSET_700_SPRITE_DUST, D_80372C6C);
|
||||
}
|
||||
|
||||
void func_8035B3B4(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
Actor *this = marker_getActor(this_marker);
|
||||
this->unk60 = 1.0f;
|
||||
}
|
||||
|
||||
int func_8035B3E4(Actor *this){
|
||||
if(func_80329530(this, (s32)(this->scale*600.0f)) && func_803292E0(this))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int func_8035B444(Actor *this, f32 arg1){
|
||||
int out;
|
||||
func_80328FB0(this, arg1);
|
||||
|
||||
if(!func_80329054(this, 2) && func_80329480(this))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_8035B49C(Actor *this){
|
||||
f32 tmp_f2;
|
||||
if(this->velocity_x < this->unk1C_x){
|
||||
this->velocity_x = (f64)this->velocity_x + this->scale;
|
||||
}
|
||||
else if(this->unk1C_x < this->velocity_x){
|
||||
this->velocity_x = (f64)this->velocity_x - this->scale;
|
||||
}
|
||||
this->velocity_z += (this->velocity_y += (0.0f <= this->velocity_z)? -(0.1*this->scale) : 0.1*this->scale);
|
||||
this->position_y = this->velocity_z + this->velocity_x;
|
||||
}
|
||||
|
||||
void func_8035B56C(Actor *this){
|
||||
f32 sp2C;
|
||||
f32 plyr_pos[3];
|
||||
|
||||
sp2C = 2*(f64)this->scale;
|
||||
player_getPosition(plyr_pos);
|
||||
|
||||
if(this->position_y < plyr_pos[1]){
|
||||
if(this->position_y + sp2C < plyr_pos[1]){
|
||||
this->position_y = this->position_y + sp2C;
|
||||
this->velocity_x += sp2C;
|
||||
}
|
||||
else{
|
||||
this->velocity_x += plyr_pos[1] - this->position_y;
|
||||
this->position_y = plyr_pos[1];
|
||||
}
|
||||
}
|
||||
else if(plyr_pos[1] < this->position_y){
|
||||
if(plyr_pos[1] < this->position_y - sp2C){
|
||||
this->position_y = this->position_y - sp2C;
|
||||
this->velocity_x -= sp2C;
|
||||
}
|
||||
else{
|
||||
this->velocity_x -= (this->position_y - plyr_pos[1]);
|
||||
this->position_y = plyr_pos[1];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void func_8035B674(Actor *this){
|
||||
ActorLocal_Core2_D4050 *local = (ActorLocal_Core2_D4050 *)&this->local;
|
||||
|
||||
func_80328B8C(this, 1, 0.01f, 1);
|
||||
actor_loopAnimation(this);
|
||||
local->unk0 = randf2(1.0f, 4.5f);
|
||||
|
||||
}
|
||||
|
||||
void func_8035B6CC(Actor *this){
|
||||
func_80328B8C(this, 2, 0.01f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
this->unk28 = 1.0f;
|
||||
func_8030E878(0x3F4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
|
||||
}
|
||||
|
||||
void func_8035B75C(Actor *this){
|
||||
func_80328B8C(this, 3, 0.01f, 1);
|
||||
actor_loopAnimation(this);
|
||||
this->unk28 = func_803203FC(0xC1) ? 0.0 : 12.0;
|
||||
func_8030E878(0x3F4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
|
||||
}
|
||||
|
||||
void func_8035B824(Actor *this){
|
||||
ActorLocal_Core2_D4050 *local = (ActorLocal_Core2_D4050 *)&this->local;
|
||||
|
||||
func_80328B8C(this, 4, 0.01f, 1);
|
||||
actor_loopAnimation(this);
|
||||
func_80328CEC(this, (s32)this->yaw_moving, 0xA, 0x1E);
|
||||
this->unk28 = 4.0f;
|
||||
local->unk4 = randf2(2.0f, 4.5f);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void func_8035B8A8(Actor *this){
|
||||
func_80328B8C(this, 5, 0.01f, 1);
|
||||
actor_loopAnimation(this);
|
||||
func_80328CEC(this, (s32)this->yaw_moving, 0xE1, 0x87);
|
||||
}
|
||||
|
||||
void func_8035B900(Actor *this){
|
||||
ActorLocal_Core2_D4050 *local = (ActorLocal_Core2_D4050 *)&this->local;
|
||||
s32 sp30 = func_8023DB5C();
|
||||
f32 sp2C = time_getDelta();
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = TRUE;
|
||||
marker_setCollisionScripts(this->marker, NULL, func_8035B3B4, func_8035B1CC);
|
||||
this->marker->propPtr->unk8_3 = FALSE;
|
||||
actor_collisionOn(this);
|
||||
this->velocity_z = 0.0f;
|
||||
this->unk60 = 0.0f;
|
||||
this->unk1C[0] = this->position_y + this->scale*100.0f;
|
||||
this->velocity_y = this->scale*2.0;
|
||||
this->velocity_x = this->unk1C[0];
|
||||
local->unk0 = randf2(1.0f, 4.5f);
|
||||
animctrl_setTransitionDuration(this->animctrl, 0.8f);
|
||||
}//L8035B9D4
|
||||
|
||||
if(0.0 < this->unk60 - sp2C){
|
||||
this->unk60 -= sp2C;
|
||||
}
|
||||
else{//L8035BA08
|
||||
switch(this->state){
|
||||
case 1: //L8035BA30
|
||||
func_8035B49C(this);
|
||||
if(func_8035B3E4(this)){
|
||||
func_8035B6CC(this);
|
||||
}
|
||||
else if(0.0 < local->unk0 - sp2C){
|
||||
local->unk0 = local->unk0 - sp2C;
|
||||
}
|
||||
else{
|
||||
func_8035B824(this);
|
||||
}
|
||||
break;
|
||||
case 2: //L8035BA98
|
||||
this->yaw_moving = func_80329784(this);
|
||||
func_8035B444(this, 4.0f);
|
||||
if(actor_animationIsAt(this, 0.99f)){
|
||||
func_8035B75C(this);
|
||||
}
|
||||
break;
|
||||
case 3: //L8035BAE0
|
||||
func_8035B56C(this);
|
||||
if((sp30 & 0x3F) == 7 && randf() < 0.7){
|
||||
func_8030E878(0x3F4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
|
||||
}//L8035BB6C
|
||||
this->yaw_moving = func_80329784(this);
|
||||
if(!func_8035B3E4(this) || !func_8035B444(this, 5.0f)){
|
||||
func_8035B674(this);
|
||||
}
|
||||
break;
|
||||
case 4: //L8035BBB0
|
||||
func_8035B49C(this);
|
||||
if(!func_8035B444(this, 2.0f)){
|
||||
func_8035B8A8(this);
|
||||
}
|
||||
else if(local->unk4 - sp2C <= 0.0){
|
||||
func_8035B674(this);
|
||||
}
|
||||
else{
|
||||
local->unk4 = local->unk4 - sp2C;
|
||||
}
|
||||
break;
|
||||
case 5: //L8035BC1C
|
||||
func_8035B49C(this);
|
||||
func_80328FB0(this, 3.0f);
|
||||
if(func_80329480(this)){
|
||||
func_8035B674(this);
|
||||
}
|
||||
break;
|
||||
case 6: //L8035BC48
|
||||
break;
|
||||
}
|
||||
}//L8035BC48
|
||||
}
|
||||
|
||||
int func_8035BC5C(Actor *this, s32 target, s32 delta){
|
||||
s32 done = FALSE;
|
||||
s32 alpha;
|
||||
if(delta < 0){
|
||||
if((s32)(this->alpha_124_19 + delta) < target){
|
||||
this->alpha_124_19 = target;
|
||||
done = TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
else{//L8035BCB8
|
||||
if(target < this->alpha_124_19 + delta){
|
||||
this->alpha_124_19 = target;
|
||||
done = TRUE;
|
||||
}
|
||||
}
|
||||
if(!done){
|
||||
this->alpha_124_19 += delta;
|
||||
}
|
||||
alpha = this->alpha_124_19;
|
||||
actor_setOpacity(this, alpha);
|
||||
return done;
|
||||
}
|
||||
|
||||
void func_8035BD48(Actor *this){
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = TRUE;
|
||||
this->marker->propPtr->unk8_3 = FALSE;
|
||||
actor_collisionOn(this);
|
||||
marker_setCollisionScripts(this->marker, NULL, func_8035B3B4, func_8035B2C4);
|
||||
mapSpecificFlags_set(3, FALSE);
|
||||
mapSpecificFlags_set(4, FALSE);
|
||||
if(map_get() == MAP_24_MMM_TUMBLARS_SHED){
|
||||
if( jiggyscore_isSpawned(JIGGY_62_MMM_TUMBLAR)
|
||||
|| jiggyscore_isCollected(JIGGY_62_MMM_TUMBLAR)
|
||||
){
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
else{//L8035BE04
|
||||
func_80328B8C(this, 1, 0.01f, 1);
|
||||
actor_setOpacity(this, 0);
|
||||
}
|
||||
}
|
||||
else{//L8035BE2C
|
||||
func_80328B8C(this, 3, 0.01f, 1);
|
||||
actor_setOpacity(this, 0xff);
|
||||
}
|
||||
}//L8035BE50
|
||||
|
||||
switch(this->state){
|
||||
case 1: //L8035BE78
|
||||
actor_collisionOff(this);
|
||||
if(mapSpecificFlags_getClear(4)){
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
else if(mapSpecificFlags_getClear(3)){
|
||||
func_80328B8C(this, 3, 0.01f, 1);
|
||||
}
|
||||
break;
|
||||
case 3: //L8035BECC
|
||||
this->unk58_0 = TRUE;
|
||||
actor_collisionOn(this);
|
||||
if(mapSpecificFlags_getClear(4)){
|
||||
this->unk38_0 = TRUE;
|
||||
func_8035B2C4(this->marker, NULL);
|
||||
}
|
||||
else{//L8035BF14
|
||||
if(this->alpha_124_19 == 0xFF || func_8035BC5C(this, 0xff, 0xA)){
|
||||
func_80343DEC(this);
|
||||
}
|
||||
|
||||
if((func_8023DB5C() &0x3F) == 7 && randf() < 0.7){
|
||||
func_8030E878(0x3f4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6: //L8035BFD4
|
||||
if(func_8035BC5C(this, 0, -7)){
|
||||
this->unk58_0 = FALSE;
|
||||
this->unk48 = 0.0f;
|
||||
func_80343DEC(this);
|
||||
if(this->unk38_0){
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
else{
|
||||
func_80328B8C(this, 1, 0.01f, 1);
|
||||
timedFunc_set_2(randf2(5.0f, 10.0f), mapSpecificFlags_set, 3, TRUE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}//L8035C06C
|
||||
}
|
93
src/core2/ch/gloop.c
Normal file
93
src/core2/ch/gloop.c
Normal file
@@ -0,0 +1,93 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
Actor *chgloop_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
void chgloop_update(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo chgloop_animations[] ={
|
||||
{0x00, 0.0f},
|
||||
{ASSET_CA_ANIM_GLOOP_SWIMMING, 2.0f},
|
||||
{ASSET_CA_ANIM_GLOOP_SWIMMING, 1.0f},
|
||||
{ASSET_CA_ANIM_GLOOP_SWIMMING, 0.4f},
|
||||
{ASSET_CB_ANIM_GLOOP_BLOWING_BUBBLE, 1.5f},
|
||||
{ASSET_CA_ANIM_GLOOP_SWIMMING, 2.0f},
|
||||
{ASSET_CA_ANIM_GLOOP_SWIMMING, 2.0f}
|
||||
};
|
||||
|
||||
ActorInfo chGloop = {
|
||||
MARKER_6A_GLOOP, ACTOR_E6_GLOOP, ASSET_372_MODEL_GLOOP,
|
||||
0x2, chgloop_animations,
|
||||
chgloop_update, chgloop_update, chgloop_draw,
|
||||
1900, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
Actor *chgloop_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *this = func_80325888(marker, gfx, mtx, vtx);
|
||||
if(!marker->unk14_21)
|
||||
return this;
|
||||
|
||||
func_8034A174(func_80329934(), 5, this->unk1C);
|
||||
return this;
|
||||
}
|
||||
|
||||
void chgloop_spawnBubble(s32 arg0, s32 arg1, s32 arg2, s32 arg3){
|
||||
f32 sp1C[3];
|
||||
sp1C[0] = reinterpret_cast(f32, arg0);
|
||||
sp1C[1] = reinterpret_cast(f32, arg1);
|
||||
sp1C[2] = reinterpret_cast(f32, arg2);
|
||||
func_8032813C(ACTOR_E7_GLOOP_BUBBLE, sp1C, (s32)reinterpret_cast(f32, arg3));
|
||||
}
|
||||
|
||||
void chgloop_update(Actor *this){
|
||||
f32 sp34[3];
|
||||
|
||||
if(!this->initialized){
|
||||
actor_collisionOff(this);
|
||||
this->initialized = TRUE;
|
||||
this->marker->propPtr->unk8_3 = TRUE;
|
||||
}
|
||||
|
||||
func_80326224(this);
|
||||
|
||||
switch(this->state){
|
||||
case 2://L802D14DC
|
||||
actor_loopAnimation(this);
|
||||
if(this->unk54 != 0.0f)
|
||||
func_80328A84(this, 4);
|
||||
|
||||
if( !mapSpecificFlags_get(2)
|
||||
&& func_80329530(this, 350)
|
||||
&& func_80311480(ASSET_D34_TEXT_GLOOP_MEET, 0, NULL, NULL, NULL, NULL)
|
||||
){
|
||||
mapSpecificFlags_set(2, TRUE);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4://L802D1558
|
||||
actor_playAnimationOnce(this);
|
||||
if(this->unk54 == 0.0f)
|
||||
func_80328A84(this, 2);
|
||||
|
||||
if(actor_animationIsAt(this, 0.6f)){
|
||||
if(this->marker->unk14_21){
|
||||
sp34[0] = this->unk1C[0];
|
||||
sp34[1] = this->unk1C[1];
|
||||
sp34[2] = this->unk1C[2];
|
||||
}
|
||||
else{
|
||||
sp34[0] = this->position[0];
|
||||
sp34[1] = this->position[1];
|
||||
sp34[2] = this->position[2];
|
||||
}
|
||||
if(func_80329530(this, 1900)){
|
||||
func_802C3F04(chgloop_spawnBubble, reinterpret_cast(s32, sp34[0]), reinterpret_cast(s32, sp34[1]), reinterpret_cast(s32, sp34[2]), reinterpret_cast(s32, this->yaw));
|
||||
}
|
||||
|
||||
func_8030E9C4(SFX_3ED, randf()/2 + 0.6, 32000, this->position, 100.0f, 3000.0f);
|
||||
}
|
||||
break;
|
||||
}//L802D1670
|
||||
}
|
376
src/core2/ch/icecube.c
Normal file
376
src/core2/ch/icecube.c
Normal file
@@ -0,0 +1,376 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#define _HorzDist3v(v1, v2) ((v1[0]-v2[0])*(v1[0]-v2[0]) + (v1[2]-v2[2])*(v1[2]-v2[2]))
|
||||
extern void func_802D729C(Actor *, f32);
|
||||
extern f32 func_80257204(f32, f32, f32, f32);
|
||||
|
||||
void chicecube_update(Actor *this);
|
||||
Actor *chicecube_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_80372B50[] = {
|
||||
{0x000, 0.0f},
|
||||
{ASSET_233_ANIM_ICECUBE, 999999.0f},
|
||||
{ASSET_233_ANIM_ICECUBE, 1.2f},
|
||||
{ASSET_233_ANIM_ICECUBE, 999999.0f},
|
||||
{ASSET_233_ANIM_ICECUBE, 999999.0f},
|
||||
{ASSET_233_ANIM_ICECUBE, 1.2f}
|
||||
};
|
||||
|
||||
ActorInfo D_80372B80 = {
|
||||
0x250, 0x37D, ASSET_504_MODEL_ICECUBE,
|
||||
1, D_80372B50,
|
||||
chicecube_update, func_80326224, chicecube_draw,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
ActorInfo D_80372BA4 = {
|
||||
0x25F, 0x3A0, ASSET_504_MODEL_ICECUBE,
|
||||
1, D_80372B50,
|
||||
chicecube_update, func_80326224, chicecube_draw,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
s32 D_80372BC8[3] = {220, 220, 230};
|
||||
s32 D_80372BD4[3] = {200, 200, 255};
|
||||
|
||||
/*.code */
|
||||
Actor *chicecube_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
func_8033A45C(3, actor->unk38_31);
|
||||
actor = func_80325888(marker, gfx, mtx, vtx);
|
||||
return actor;
|
||||
}
|
||||
|
||||
int func_80359DF4(Actor *this, s32 arg1){
|
||||
if(func_80329530(this, arg1) && func_803292E0(this))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int func_80359E38(Actor *this, s32 arg1, s32 arg2){
|
||||
int sp1C = 0;
|
||||
if(arg1 < this->alpha_124_19 + arg2){
|
||||
this->alpha_124_19 = arg1;
|
||||
sp1C = 1;
|
||||
}
|
||||
else{
|
||||
this->alpha_124_19 += arg2;
|
||||
}
|
||||
actor_setOpacity(this, this->alpha_124_19);
|
||||
return sp1C;
|
||||
}
|
||||
|
||||
int func_80359EBC(Actor *this, s32 arg1, s32 arg2){
|
||||
int sp1C = 0;
|
||||
if((this->alpha_124_19 - arg2) < arg1){
|
||||
this->alpha_124_19 = arg1;
|
||||
sp1C = 1;
|
||||
}
|
||||
else{
|
||||
this->alpha_124_19 -= arg2;
|
||||
}
|
||||
actor_setOpacity(this, this->alpha_124_19);
|
||||
return sp1C;
|
||||
}
|
||||
|
||||
int func_80359F40(Actor *this, f32 arg1[3]){
|
||||
f32 sp24;
|
||||
f32 sp20;
|
||||
|
||||
sp24 = func_80257204(this->position[0], this->position[2], arg1[0], arg1[2]);
|
||||
if((func_8023DB5C() & 0xF) == 4){
|
||||
this->velocity[2] = (f32)randi2(-45, 45);
|
||||
}
|
||||
sp20 = this->yaw;
|
||||
sp24 += this->velocity[2];
|
||||
this->yaw = sp24;
|
||||
if(func_80329030(this, 0)){
|
||||
this->yaw = sp20;
|
||||
return 1;
|
||||
}
|
||||
else{
|
||||
this->yaw = sp20;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int func_80359FEC(f32 arg0[3], f32 arg1[3], s32 arg2){
|
||||
if(_HorzDist3v(arg0, arg1) < arg2*arg2)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void func_8035A04C(f32 position[3], s32 cnt, enum asset_e model_id, f32 scale){
|
||||
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
|
||||
|
||||
particleEmitter_setModel(pCtrl, model_id);
|
||||
particleEmitter_setPosition(pCtrl, position);
|
||||
particleEmitter_setParticleSpawnPositionRange(pCtrl, -100.0f*scale, 0.0f, -100.0f*scale, 100.0f*scale, 200.0f*scale, 100.0f*scale);
|
||||
particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1000.0f, 0.0f, 0.0f, -1000.0f, 0.0f);
|
||||
particleEmitter_setParticleVelocityRange(pCtrl, -400.0f*scale, 450.0f*scale, -400.0f*scale, 400.0f*scale, 600.0f*scale, 400.0f*scale);
|
||||
func_802EFE24(pCtrl, 100.0f*scale, 100.0f*scale, 100.0f*scale, 250.0f*scale, 250.0f*scale, 250.0f*scale);
|
||||
func_802EFB70(pCtrl, scale*0.2, scale*0.4);
|
||||
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.02f);
|
||||
func_802EFEC0(pCtrl, 2.2f, 2.2f);
|
||||
func_802EFA5C(pCtrl, 0.0f, 0.3f);
|
||||
particleEmitter_emitN(pCtrl, cnt);
|
||||
}
|
||||
|
||||
void func_8035A228(f32 position[3], s32 cnt, enum asset_e sprite_id, f32 scale){
|
||||
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
|
||||
|
||||
func_802EFFA8(pCtrl, D_80372BC8);
|
||||
particleEmitter_setSprite(pCtrl, sprite_id);
|
||||
particleEmitter_setPosition(pCtrl, position);
|
||||
particleEmitter_setParticleSpawnPositionRange(pCtrl, -50.0f*scale, 0.0f, -50.0f*scale, 50.0f*scale, 200.0f*scale, 50.0f*scale);
|
||||
particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -10.0f, 0.0f, 0.0f, -10.0f, 0.0f);
|
||||
particleEmitter_setParticleVelocityRange(pCtrl, -280.0f*scale, 0.0f, -280.0f*scale, 280.0f*scale, 280.0f*scale, 280.0f*scale);
|
||||
func_802EFB70(pCtrl, scale*0.6, scale*0.8);
|
||||
func_802EFB84(pCtrl, scale*1.0, scale*1.4);
|
||||
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
|
||||
func_802EFEC0(pCtrl, 1.2f, 1.8f);
|
||||
func_802EFA5C(pCtrl, 0.0f, 0.01f);
|
||||
particleEmitter_emitN(pCtrl, cnt);
|
||||
}
|
||||
|
||||
void func_8035A3F8(f32 position[3], s32 cnt, enum asset_e sprite_id, f32 scale){
|
||||
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
|
||||
|
||||
func_802EFFA8(pCtrl, D_80372BD4);
|
||||
particleEmitter_setSprite(pCtrl, sprite_id);
|
||||
particleEmitter_setPosition(pCtrl, position);
|
||||
particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -10.0f, 0.0f, 0.0f, -10.0f, 0.0f);
|
||||
particleEmitter_setParticleVelocityRange(pCtrl, -60.0f*scale, 0.0f, -60.0f*scale, 60.0f*scale, 60.0f*scale, 60.0f*scale);
|
||||
func_802EFB70(pCtrl, scale*0.4, scale*0.6);
|
||||
func_802EFB84(pCtrl, scale*0.8, scale*1.2);
|
||||
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
|
||||
func_802EFEC0(pCtrl, 0.5f, 0.7f);
|
||||
func_802EFA5C(pCtrl, 0.0f, 0.3f);
|
||||
func_802EFA70(pCtrl, 4);
|
||||
particleEmitter_emitN(pCtrl, cnt);
|
||||
}
|
||||
|
||||
void func_8035A594(f32 position[3], f32 arg1, f32 arg2){
|
||||
int i;
|
||||
int v0;
|
||||
for(i = 60; i != 380; i+=160){
|
||||
v0 = i;
|
||||
if(i > 360)
|
||||
v0 = i - 360;
|
||||
|
||||
if(v0 < arg1 && arg2 < v0){
|
||||
func_8030E878(SFX_28_RUSTLING_NOISE, randf2(1.6f, 1.7f), 17000, position, 500.0f, 1000.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8035A694(Actor *this){
|
||||
f32 sp3C;
|
||||
f32 sp38;
|
||||
s32 tmp_v0;
|
||||
f32 sp28[3];
|
||||
|
||||
sp3C = this->yaw;
|
||||
sp38 = this->unk28*1.5 + 1.0;
|
||||
tmp_v0 = func_8023DB5C();
|
||||
this->yaw += sp38;
|
||||
if(360.0f < this->yaw)
|
||||
this->yaw -= 360.0f;
|
||||
if(this->marker->unk14_21 && !(tmp_v0 & 1)){
|
||||
func_8034A174(this->marker->unk44, 5, sp28);
|
||||
func_8035A3F8(sp28, 1, ASSET_70D_SPRITE_SMOKE_1, this->scale);
|
||||
}
|
||||
func_8035A594(this->position, this->yaw, sp3C);
|
||||
|
||||
}
|
||||
|
||||
void __chicecube_spawnHalfCubes(ActorMarker *marker){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
Actor *other;
|
||||
f32 sp54[3];
|
||||
int i;
|
||||
f32 pad[1];
|
||||
|
||||
sp54[0] = actor->position[0];
|
||||
sp54[1] = actor->position[1];
|
||||
sp54[2] = actor->position[2];
|
||||
sp54[1] += 100.0f;
|
||||
for(i = 0; i < 2; i++){//L8035A7FC
|
||||
func_802C8F70((i & 1)? actor->yaw : actor->yaw + 180.0f);
|
||||
other = func_802C937C(0x21, sp54);
|
||||
other->unkF4_8 = 1; //don't spawn more
|
||||
other->scale = randf2(0.5f, 0.6f)*actor->scale;
|
||||
actor->yaw = randi2(0, 359);
|
||||
}
|
||||
if(marker);
|
||||
}
|
||||
|
||||
//__chicecube_ow
|
||||
void __chicecube_ow(ActorMarker *marker, ActorMarker *other_marker){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 0.9f, 22000, actor->position, 1500, 3000);
|
||||
actor->velocity[1] = 0.8f;
|
||||
actor->unk28 = 0.0f;
|
||||
}
|
||||
|
||||
//__chicecube_die
|
||||
void __chicecube_die(ActorMarker *marker, ActorMarker *other_marker){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
FUNC_8030E8B4(SFX_B6_GLASS_BREAKING_1, 1.0f, 32000, actor->position, 1500, 4500);
|
||||
actor->velocity[1] = 0.0f;
|
||||
func_8035A04C(actor->position, 12, ASSET_505_MODEL_ICECUBE_CHUNK, actor->scale);
|
||||
func_8035A228(actor->position, 6, ASSET_700_SPRITE_DUST, actor->scale);
|
||||
if(actor->unkF4_8 != 1){
|
||||
func_802C3C88(__chicecube_spawnHalfCubes, actor->marker);
|
||||
}
|
||||
marker_despawn(actor->marker);
|
||||
}
|
||||
|
||||
void func_8035A998(Actor *this){
|
||||
func_80328B8C(this, 1, 0.0001f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
this->unk38_31 = 0;
|
||||
}
|
||||
|
||||
void func_8035A9E0(Actor *this){
|
||||
func_80328B8C(this, 3, animctrl_getAnimTimer(this->animctrl), 1);
|
||||
actor_loopAnimation(this);
|
||||
this->unk38_31 = 1;
|
||||
this->unk28 = 0.0f;
|
||||
}
|
||||
|
||||
void func_8035AA40(Actor *this){
|
||||
func_80328B8C(this, 5, 0.9999f, 0);
|
||||
actor_playAnimationOnce(this);
|
||||
this->unk38_31 = 1;
|
||||
}
|
||||
|
||||
void chicecube_update(Actor *this){
|
||||
f32 sp3C = time_getDelta();
|
||||
f32 sp30[3];
|
||||
|
||||
if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){
|
||||
if(func_8038BFA0()){
|
||||
actor_collisionOff(this);
|
||||
this->unk58_0 = FALSE;
|
||||
return;
|
||||
}
|
||||
actor_collisionOn(this);
|
||||
this->unk58_0 = TRUE;
|
||||
}//L8035AAF4
|
||||
|
||||
if(!actor_playerIsWithinDist(this, 3000))
|
||||
return;
|
||||
|
||||
func_802D729C(this, 3.4 * this->scale);
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = TRUE;
|
||||
marker_setCollisionScripts(this->marker, __chicecube_ow, NULL, __chicecube_die);
|
||||
this->marker->propPtr->unk8_3 = FALSE;
|
||||
actor_collisionOff(this);
|
||||
this->alpha_124_19 = 0x50;
|
||||
actor_setOpacity(this, this->alpha_124_19);
|
||||
this->unk38_31 = 0;
|
||||
this->unk60 = 1.0f;
|
||||
}//L8035ABC0
|
||||
if(this->unk60 <= 0.0){
|
||||
if(-99999.0 != this->unk60){
|
||||
this->unk60 = -99999.0f;
|
||||
actor_collisionOn(this);
|
||||
this->unk1C[0] =this->position[0];
|
||||
this->unk1C[1] =this->position[1];
|
||||
this->unk1C[2] =this->position[2];
|
||||
this->velocity[0] = this->yaw;
|
||||
}
|
||||
}
|
||||
else{//L8035AC3C
|
||||
this->unk60 -= sp3C;
|
||||
}
|
||||
|
||||
if(0.0 >= this->velocity[1]){
|
||||
this->velocity[1] = 0.0f;
|
||||
}
|
||||
else{
|
||||
this->velocity[1] -= sp3C;
|
||||
return;
|
||||
}
|
||||
switch(this->state){
|
||||
case 1: // L8035AC9C
|
||||
animctrl_setAnimTimer(this->animctrl, 0.0f);
|
||||
if( func_80359DF4(this, 900)
|
||||
|| (this->unkF4_8 == 2 && func_803203FC(0xC1))
|
||||
){
|
||||
func_80328B8C(this, 2, 0.0001f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
this->unk38_31 = 0x1;
|
||||
}
|
||||
break;
|
||||
case 2: // L8035AD10
|
||||
if(actor_animationIsAt(this, 0.1f)){
|
||||
FUNC_8030E8B4(SFX_112_TINKER_ATTENTION, 1.3f, 23000, this->position, 1500, 4500);
|
||||
}
|
||||
if( func_80359E38(this, 0xff, 0xa)
|
||||
&& 0.98 < animctrl_getAnimTimer(this->animctrl)
|
||||
){
|
||||
func_8035A9E0(this);
|
||||
}
|
||||
break;
|
||||
case 3: // L8035AD88
|
||||
animctrl_setAnimTimer(this->animctrl, 0.999f);
|
||||
if(this->unk28 + 0.28 < 18.0){
|
||||
this->unk28 = this->unk28 + 0.28;
|
||||
}
|
||||
else{
|
||||
this->unk28 = 18.0f;
|
||||
}
|
||||
func_8035A694(this);
|
||||
if(!func_80359DF4(this, 1300)){
|
||||
func_80328B8C(this, 4, animctrl_getAnimTimer(this->animctrl), 1);
|
||||
actor_loopAnimation(this);
|
||||
this->unk38_31 = 1;
|
||||
}
|
||||
else{
|
||||
player_getPosition(sp30);
|
||||
if(!func_80359F40(this, sp30)){
|
||||
func_8035A998(this);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4: // L8035AE64
|
||||
animctrl_setAnimTimer(this->animctrl, 0.999f);
|
||||
if(this->unk28 - 0.28 > 8.0)
|
||||
this->unk28 = this->unk28 - 0.28;
|
||||
else
|
||||
this->unk28 = 8.0f;
|
||||
func_8035A694(this);
|
||||
if(func_80359DF4(this, 900)){
|
||||
func_8035A9E0(this);
|
||||
}
|
||||
else if(func_80359FEC(this->position, this->unk1C, 0x14)){//L8035AEEC
|
||||
if(func_803294F0(this, 0xa, (s32)this->velocity[0])){
|
||||
func_8035AA40(this);
|
||||
}
|
||||
}
|
||||
else{//L8035AF38
|
||||
if(!func_80359F40(this, this->unk1C)){
|
||||
func_8035AA40(this);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5: // L8035AF58
|
||||
if(actor_animationIsAt(this, 0.25f)){
|
||||
FUNC_8030E8B4(SFX_112_TINKER_ATTENTION, 1.3f, 23000, this->position, 1500, 4500);
|
||||
}
|
||||
if( animctrl_getAnimTimer(this->animctrl) < 0.1
|
||||
&& func_80359EBC(this, 0x50, 0xA)
|
||||
){
|
||||
func_8035A998(this);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
212
src/core2/ch/jiggy.c
Normal file
212
src/core2/ch/jiggy.c
Normal file
@@ -0,0 +1,212 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern void func_802BE720(void);
|
||||
extern f32 func_8033A244(f32);
|
||||
extern void func_8033A280(f32);
|
||||
|
||||
extern u8 D_80329904[];
|
||||
|
||||
typedef struct chjiggy_s{
|
||||
u32 unk0;
|
||||
u32 index;
|
||||
} ActorLocal_Jiggy;
|
||||
|
||||
Actor *func_802C41D8(f32, f32, f32);
|
||||
void func_802C7AF8(u32 x, u32 y, u32 z, u32 arg3);
|
||||
Actor *func_802C7D0C(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3);
|
||||
void func_802C7D98(Actor * arg0);
|
||||
void func_802C7DC0(Actor *this);
|
||||
int func_802C8088(Actor *this);
|
||||
|
||||
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_80366290[] = {
|
||||
{0, 0.0f},
|
||||
{0, 0.0f},
|
||||
{0, 0.0f}
|
||||
};
|
||||
|
||||
ActorInfo D_803662A8 = {
|
||||
0x52, ACTOR_46_JIGGY, ASSET_35F_MODEL_JIGGY,
|
||||
1, D_80366290,
|
||||
func_802C7DC0, func_802C7D98, func_802C7D0C,
|
||||
0, 0, 0.9f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
enum jiggy_e func_802C7A30(Actor *this){
|
||||
s32 id;
|
||||
s32 sp18[3];
|
||||
|
||||
id = map_get();
|
||||
|
||||
sp18[0] = (s32)this->position[0];
|
||||
sp18[1] = (s32)this->position[1];
|
||||
sp18[2] = (s32)this->position[2];
|
||||
id = func_80307164(sp18);
|
||||
if( id < 0){
|
||||
return 0;
|
||||
}
|
||||
else{
|
||||
return func_80306DBC(id) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
void func_802C7AB0(ActorMarker * arg0, u32 arg1){
|
||||
func_8030E6D4(SFX_30_MAGIC_POOF);
|
||||
func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 0x7FF8);
|
||||
mapSpecificFlags_set(arg1, 1);
|
||||
marker_despawn(arg0);
|
||||
}
|
||||
|
||||
void func_802C7AF8(u32 x, u32 y, u32 z, u32 arg3){
|
||||
func_802C3F04((GenMethod_4)func_802C41D8, ACTOR_4C_STEAM, x, y, z);
|
||||
func_802C3F04((GenMethod_4)func_802C41D8, ACTOR_14F_DESTROYED_JIGGY, x, y, z);
|
||||
mapSpecificFlags_set(arg3, 1);
|
||||
}
|
||||
|
||||
void func_802C7B6C(u32 arg0){
|
||||
mapSpecificFlags_set(arg0, 0);
|
||||
}
|
||||
|
||||
void func_802C7B8C(Actor *this, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6){
|
||||
if( !mapSpecificFlags_get(arg1)
|
||||
&& mapSpecificFlags_get(arg2)
|
||||
&& item_getCount(ITEM_0_HOURGLASS_TIMER) == 0
|
||||
){
|
||||
func_8028FCC8(1);
|
||||
actor_collisionOff(this);
|
||||
func_802BAFE4(arg3);
|
||||
func_80356520(arg6);
|
||||
timedFunc_set_4(0.6f, (TFQM4)func_802C7AF8, (s32)this->position[0], (s32)this->position[1], (s32)this->position[2], arg4);
|
||||
timedFunc_set_2(0.6f, (TFQM2)func_802C7AB0, (s32)this->marker, arg5);
|
||||
timedFunc_set_0(1.0f, (TFQM0)func_802BE720);
|
||||
timedFunc_set_1(3.9f, (TFQM1)func_802C7B6C, arg4);
|
||||
mapSpecificFlags_set(arg1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//chjiggy_updateRotate
|
||||
void func_802C7CA4(Actor *this){
|
||||
f32 delta = time_getDelta();
|
||||
this->yaw += delta * 230.0f;
|
||||
if(360.0f <= this->yaw){
|
||||
this->yaw -= 360.0f;
|
||||
}
|
||||
this->yaw_moving = this->yaw;
|
||||
}
|
||||
|
||||
//chjiggy_draw
|
||||
Actor *func_802C7D0C(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){
|
||||
Actor * thisActor = marker_getActor(this);
|
||||
ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&thisActor->local;
|
||||
u32 jiggyId;
|
||||
|
||||
if(!local->unk0){
|
||||
jiggyId = func_802C8088(thisActor);
|
||||
if((jiggyId == JIGGY_1C_CC_RINGS) || (jiggyId == JIGGY_1D_CC_SLOW_SAWBLADES)){
|
||||
func_8033A280(10.0f);
|
||||
func_8033A244(30000.0f);
|
||||
}
|
||||
thisActor = func_80325888(this, gdl, mptr, arg3);
|
||||
}
|
||||
return thisActor;
|
||||
}
|
||||
|
||||
void func_802C7D98(Actor * arg0){
|
||||
func_80343DEC(arg0);
|
||||
func_802C7CA4(arg0);
|
||||
}
|
||||
|
||||
//chjiggy_update
|
||||
void func_802C7DC0(Actor *this){
|
||||
ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local;
|
||||
int i;
|
||||
|
||||
if(this->marker->unk14_21){
|
||||
for(i = 0; i < 4; i++){
|
||||
if(randf() < 0.015){
|
||||
func_8033E73C(this->marker, i + 5, &D_80329904);
|
||||
func_8033E3F0(8, 1);
|
||||
}
|
||||
}
|
||||
}//L802C7E44
|
||||
switch(this->state){
|
||||
case 1: //L802C7E68
|
||||
local->unk0 = 0;
|
||||
if(local->index == 0)
|
||||
local->index = func_802C7A30(this);
|
||||
|
||||
if(jiggyscore_isCollected(local->index)){
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
else{
|
||||
func_80328A84(this, 2);
|
||||
switch(func_802C8088(this)){
|
||||
case JIGGY_17_CC_CLANKER_RAISED: //L802C7EF8
|
||||
case JIGGY_49_CCW_EYRIE:// L802C7EF8
|
||||
this->marker->unk40_21 = 1;
|
||||
break;
|
||||
case JIGGY_36_LAIR_TTC_WITCH_SWITCH:// L802C7F0C
|
||||
this->unk44_14 = func_80341F2C(0x20A);
|
||||
this->unk48 = 0.0f;
|
||||
this->unk4C = 300.0f;
|
||||
this->marker->unk2C_2 = 1;
|
||||
this->unk54 = 0.0f;
|
||||
func_80343DEC(this);
|
||||
func_802C7CA4(this);
|
||||
break;
|
||||
case JIGGY_3E_GV_GRABBA:// L802C7F6C
|
||||
case JIGGY_4D_CCW_FLOWER:// L802C7F6C
|
||||
this->unk124_6 = 0;
|
||||
break;
|
||||
case JIGGY_41_GV_MAZE:// L802C7F7C
|
||||
this->marker->unk14_10 = 0x1E;
|
||||
break;
|
||||
case JIGGY_13_TTC_LOCKUP: //L802C7F94
|
||||
this->marker->unk14_10 = 0x28;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2: //L802C7FAC
|
||||
func_802C7CA4(this);
|
||||
switch(func_802C8088(this)){
|
||||
case JIGGY_20_BGS_ELEVATED_WALKWAY: //L802C7FE8
|
||||
func_802C7B8C(this, 4, 3, 0xD, 5, 2, 0xae);
|
||||
break;
|
||||
case JIGGY_25_BGS_MAZE://L802C8018
|
||||
func_802C7B8C(this, 0xd, 0xc, 0x1e, 9, 0xb, 0xaf);
|
||||
break;
|
||||
case JIGGY_2F_FP_XMAS_TREE://L802C8048
|
||||
if(levelSpecificFlags_get(0x29))
|
||||
actor_collisionOn(this);
|
||||
else
|
||||
actor_collisionOff(this);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}//L802C8074
|
||||
}
|
||||
|
||||
//chjiggy_getId
|
||||
int func_802C8088(Actor *this){
|
||||
ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local;
|
||||
return local->index;
|
||||
}
|
||||
|
||||
|
||||
void func_802C8090(Actor * this){
|
||||
ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local;
|
||||
local->unk0 = 1;
|
||||
actor_collisionOff(this);
|
||||
}
|
||||
|
||||
//chjiggy_setId
|
||||
void func_802C80B4(Actor *this, u32 id){
|
||||
ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local;
|
||||
local->index = id;
|
||||
}
|
106
src/core2/ch/jigsawdance.c
Normal file
106
src/core2/ch/jigsawdance.c
Normal file
@@ -0,0 +1,106 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern f32 func_8028EBA4();
|
||||
|
||||
Actor *func_802C80C0(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3);
|
||||
void func_802C811C(Actor * this);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_803662D0[] = {
|
||||
{0x00, 0.0f},
|
||||
{0x00, 2.0f},
|
||||
{0x76, 1.5f},
|
||||
{0x76, 1.5f},
|
||||
{0x30, 5.0f},
|
||||
{0x00, 2.0f}
|
||||
};
|
||||
|
||||
ActorInfo D_80366300 = {0x68, 0x5A, 0x35E,
|
||||
1, D_803662D0,
|
||||
func_802C811C, func_80326224, func_802C80C0,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
|
||||
/* .code */
|
||||
Actor *func_802C80C0(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){
|
||||
Actor *thisActor = marker_getActor(this);
|
||||
|
||||
if(!thisActor->initialized){
|
||||
thisActor->initialized = 1;
|
||||
return thisActor;
|
||||
}
|
||||
else{
|
||||
return func_80325888(this, gdl, mptr, arg3);
|
||||
}
|
||||
}
|
||||
|
||||
void func_802C811C(Actor * this){
|
||||
ActorAnimCtrl *plyrMvmt;
|
||||
|
||||
this->marker->collidable = 0;
|
||||
switch(this->state){
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
player_getPosition(this->position);
|
||||
this->yaw = func_8028EBA4();
|
||||
plyrMvmt = player_getAnimCtrlPtr();
|
||||
animctrl_setSmoothTransition(this->animctrl, 0);
|
||||
animctrl_setIndex(this->animctrl, animctrl_getIndex(plyrMvmt));
|
||||
func_8028774C(this->animctrl,animctrl_getAnimTimer(plyrMvmt));
|
||||
animctrl_setDuration(this->animctrl, 1000.0f);
|
||||
func_802875AC(this->animctrl, "chjigsawdance.c", 0x59);
|
||||
break;
|
||||
case 3:
|
||||
plyrMvmt = player_getAnimCtrlPtr();
|
||||
animctrl_setSmoothTransition(this->animctrl, 0);
|
||||
func_8028774C(this->animctrl,animctrl_getAnimTimer(plyrMvmt));
|
||||
animctrl_setDuration(this->animctrl, 1000.0f);
|
||||
func_802875AC(this->animctrl, "chjigsawdance.c", 0x62);
|
||||
break;
|
||||
case 4:
|
||||
player_getPosition(this->position);
|
||||
this->yaw = func_8028EBA4();
|
||||
plyrMvmt = player_getAnimCtrlPtr();
|
||||
animctrl_setSmoothTransition(this->animctrl, 0);
|
||||
func_8028774C(this->animctrl,animctrl_getAnimTimer(plyrMvmt));
|
||||
animctrl_setDuration(this->animctrl, 1000.0f);
|
||||
func_802875AC(this->animctrl, "chjigsawdance.c", 0x6e);
|
||||
break;
|
||||
case 5:
|
||||
this->marker->propPtr->unk8_4 = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void func_802C82C0(Actor * this, u32 arg1){
|
||||
switch(arg1){
|
||||
case 3:
|
||||
if(this->state == 1){
|
||||
func_80328A84(this, 2);
|
||||
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
func_80328A84(this, 3);
|
||||
break;
|
||||
case 1:
|
||||
func_80328A84(this, 4);
|
||||
break;
|
||||
case 4:
|
||||
player_getPosition(this->position);
|
||||
this->yaw = func_8028EBA4();
|
||||
animctrl_setSmoothTransition(this->animctrl, 0);
|
||||
func_8028774C(this->animctrl, animctrl_getAnimTimer(player_getAnimCtrlPtr()));
|
||||
animctrl_setDuration(this->animctrl, 1000.0f);
|
||||
func_802875AC(this->animctrl, "chjigsawdance.c", 0x97);
|
||||
break;
|
||||
case 5:
|
||||
func_80328A84(this, 5);
|
||||
this->marker->propPtr->unk8_4 = 0;
|
||||
break;
|
||||
}
|
||||
}
|
321
src/core2/ch/jinjo.c
Normal file
321
src/core2/ch/jinjo.c
Normal file
@@ -0,0 +1,321 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern void func_80328B8C(Actor *, s32, f32 , s32);
|
||||
extern f32 func_80309B24(f32*);
|
||||
extern void func_80329904(ActorMarker*, s32, f32*);
|
||||
extern void func_80326310(Actor *);
|
||||
extern void func_8032BB88(Actor *, s32, s32);
|
||||
|
||||
void func_802CDD78(Actor *this);
|
||||
|
||||
/* .data */
|
||||
extern ActorAnimationInfo D_803671B0[];
|
||||
extern ActorInfo D_80367200 = { 0x5A, 0x60, 0x3C0, 0x1, D_803671B0, func_802CDD78, func_80326224, func_80325888, 0, 0, 0.0f, 0};
|
||||
extern ActorInfo D_80367224 = { 0x5B, 0x62, 0x3C2, 0x1, D_803671B0, func_802CDD78, func_80326224, func_80325888, 0, 0, 0.0f, 0};
|
||||
extern ActorInfo D_80367248 = { 0x5E, 0x5E, 0x3BB, 0x1, D_803671B0, func_802CDD78, func_80326224, func_80325888, 0, 0, 0.0f, 0};
|
||||
extern ActorInfo D_8036726C = { 0x5D, 0x61, 0x3C1, 0x1, D_803671B0, func_802CDD78, func_80326224, func_80325888, 0, 0, 0.0f, 0};
|
||||
extern ActorInfo D_80367290 = { 0x5C, 0x5F, 0x3BC, 0x1, D_803671B0, func_802CDD78, func_80326224, func_80325888, 0, 0, 0.0f, 0};
|
||||
|
||||
/*.rodata */
|
||||
//jumptable D_80376560
|
||||
extern f64 D_80376578; //45.0
|
||||
extern f64 D_80376580; //182.04444
|
||||
extern f64 D_803765A8; //0.015
|
||||
extern f64 D_803765B0; //0.8
|
||||
extern f64 D_803765B8; //0.3
|
||||
extern f64 D_803765C0; //0.2
|
||||
extern f64 D_803765C8; //0.9
|
||||
//0.1
|
||||
//.rodata end 803765d0
|
||||
|
||||
s32 func_802CDB50(s32 arg0){
|
||||
switch(arg0){
|
||||
case 0x5A:
|
||||
return 0xD98;
|
||||
case 0x5B:
|
||||
return 0xD99;
|
||||
case 0x5C:
|
||||
return 0xD9b;
|
||||
case 0x5d:
|
||||
return 0xD9a;
|
||||
case 0x5e:
|
||||
return 0xD97;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void func_802CDBA8(ActorMarker *this, s32 arg1){
|
||||
Actor *actorPtr = marker_getActor(this);
|
||||
ActorLocal_Jinjo *localPtr = &actorPtr->jinjo;
|
||||
|
||||
if(actorPtr->state < 5){
|
||||
if(!func_8031FF1C(BKPROG_E_JINJO_TEXT)){
|
||||
func_80311480(func_802CDB50(actorPtr->marker->unk14_20), 4, 0, 0, 0, 0);
|
||||
func_80320004(BKPROG_E_JINJO_TEXT, 1);
|
||||
}
|
||||
func_80328B8C(actorPtr, 6, 0.0f , -1);
|
||||
if(func_803463D4(ITEM_12_JINJOS, 1 << (this->unk14_20 + 6) ) == 0x1f)
|
||||
localPtr->unk4 = 1;
|
||||
actor_loopAnimation(actorPtr);
|
||||
this->collidable = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void func_802CDC9C(Actor *this, s16 arg1){
|
||||
f32 tmpf;
|
||||
|
||||
tmpf = this->yaw;
|
||||
tmpf -= time_getDelta()*arg1/45.0;
|
||||
|
||||
if(tmpf >= 360.0f)
|
||||
tmpf -= 360.0f;
|
||||
else if (tmpf < 0.0f)
|
||||
tmpf += 360.0f;
|
||||
|
||||
this->yaw = tmpf;
|
||||
}
|
||||
|
||||
|
||||
void func_802CDD3C(Actor * this){
|
||||
ActorLocal_Jinjo *localPtr = &this->jinjo;
|
||||
if(localPtr->unkC != 0){
|
||||
func_802F9D38(localPtr->unkC);
|
||||
localPtr->unkC = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
void func_802CDD78(Actor * this){
|
||||
f32 sp7C[3];
|
||||
f32 sp70[3];
|
||||
f32 sp6C;
|
||||
f32 sp68; //unused??
|
||||
s16 sp66;
|
||||
s16 sp64;
|
||||
s32 sp60;
|
||||
// f32 sp5C;
|
||||
ActorLocal_Jinjo *local; //= &this->jinjo; //sp34
|
||||
f32 sp58 = time_getDelta();
|
||||
int sp50;
|
||||
//f32 sp4C; //unused
|
||||
f32 sp40[3];
|
||||
//s32 sp3C;
|
||||
//s32 sp38;
|
||||
f32 *sp30;
|
||||
f32 tmp_f0;
|
||||
s32 i;
|
||||
|
||||
local = &this->jinjo;
|
||||
if(!this->initialized){
|
||||
this->initialized = 1;
|
||||
local->unk0 = 1;
|
||||
local->unk4 = 0;
|
||||
local->unk8 = (this->position_y < func_80309B24(this->position));
|
||||
this->marker->unkC = func_802CDBA8;
|
||||
func_803300D8(this->marker, func_802CDD3C);
|
||||
if(func_803203FC(0xc1)){
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
}//L802CDE24
|
||||
sp30 = this->position;
|
||||
func_8028E964(sp7C);
|
||||
func_80257F18(sp30, sp7C, &sp6C);
|
||||
sp64 = (this->yaw * 182.04444);
|
||||
sp66 = sp64 - (s32)(sp6C*182.04444);
|
||||
sp60 = func_8028AED4(sp30, 55.0f);
|
||||
|
||||
switch(this->state){
|
||||
case 1:
|
||||
if(randf() < 0.015){
|
||||
if(sp60){
|
||||
func_80328B8C(this, 3, 0.0f, -1);
|
||||
}else{
|
||||
func_80328B8C(this, 2, 0.0f, -1);
|
||||
}
|
||||
actor_playAnimationOnce(this);
|
||||
}//L802CDF24
|
||||
break;
|
||||
|
||||
case 2: /* 46FA0 802CDF30 3C053F7D */
|
||||
case 3:
|
||||
if(actor_animationIsAt(this, 0.99f)){
|
||||
func_80328B8C(this, 1, 0.0f, -1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: /* 46FD8 802CDF68 3C053F7D */
|
||||
if(actor_animationIsAt(this, 0.99f)){
|
||||
func_80328B8C(this, 1, 0.0f, -1);
|
||||
}else{//L802CDF9C
|
||||
tmp_f0 = this->yaw;
|
||||
if(sp66 >= 0){
|
||||
tmp_f0 -= 80.0f * sp58;
|
||||
}
|
||||
else{//L802CDFBC
|
||||
tmp_f0 += 80.0f * sp58;
|
||||
}//L802CDFD0
|
||||
if(tmp_f0 >= 360.0f)
|
||||
tmp_f0 -= 360.0f;
|
||||
else if(tmp_f0 < 0.0f)
|
||||
tmp_f0 += 360.0f;
|
||||
|
||||
this->yaw = tmp_f0;
|
||||
}//L802CE018
|
||||
break;
|
||||
case 6:/* 47094 802CE024 02002025 */
|
||||
func_802CDC9C(this, sp66);
|
||||
if(actor_animationIsAt(this, 0.0f) && --(local->unk0) == 0){
|
||||
func_80328B8C(this, 7, 0.0f, -1);
|
||||
actor_playAnimationOnce(this);
|
||||
if(local->unk4){
|
||||
sp40[0] = this->position_x;
|
||||
sp40[1] = this->position_y;
|
||||
sp40[2] = this->position_z;
|
||||
sp40[1] += 50.0f;
|
||||
jiggySpawn(10*level_get()-9, sp40);
|
||||
}//L802CE0CC
|
||||
func_8024BD08(0);
|
||||
func_8032BB88(this, 0, 4000);
|
||||
if(local->unk4){
|
||||
func_8025A6EC(COMUSIC_30_5TH_JINJO_COLLECTED, 28000);
|
||||
}else{
|
||||
func_8025A6EC(COMUSIC_A_JINJO_COLLECTED, 28000);
|
||||
}
|
||||
}//L802CE114
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case 8:
|
||||
sp50 = this->state == 7;
|
||||
if(!sp50 || 0.8 < animctrl_getAnimTimer(this->animctrl)){//L802CE158
|
||||
player_getVelocity(sp70);
|
||||
sp70[0] *= sp58*6.0f;
|
||||
sp70[1] *= sp58*6.0f;
|
||||
sp70[2] *= sp58*6.0f;
|
||||
sp70[0] += sp7C[0];
|
||||
sp70[1] += sp7C[1];
|
||||
sp70[2] += sp7C[2];
|
||||
sp70[0] -= this->position_x;
|
||||
sp70[1] -= this->position_y;
|
||||
sp70[2] -= this->position_z;
|
||||
sp70[0] *= sp58*3.0f;
|
||||
sp70[1] *= sp58*3.0f;
|
||||
sp70[2] *= sp58*3.0f;
|
||||
this->position_x += sp70[0];
|
||||
this->position_y += sp70[1];
|
||||
this->position_z += sp70[2];
|
||||
if(sp50 || animctrl_getAnimTimer(this->animctrl) < 0.3){
|
||||
for(i = 0; i < 4; i++){
|
||||
if(randf() < 0.2){
|
||||
func_8033E73C(this->marker, i + 5, func_80329904);
|
||||
func_8033E3F0(8, this->marker->unk14_21);
|
||||
} //L802CE2C4
|
||||
}
|
||||
}//L802CE2D0
|
||||
}
|
||||
|
||||
if(sp50){
|
||||
if(animctrl_getAnimTimer(this->animctrl) < 0.9)
|
||||
func_802CDC9C(this, sp66);
|
||||
|
||||
if(actor_animationIsAt(this, 0.1f)){
|
||||
local->unkC = func_802F9AA8(SFX_18_BIGBUTT_SLIDE);
|
||||
func_802F9EC4(local->unkC, sp30, 500, 2000);
|
||||
func_802F9F80(local->unkC, 0.0f, 0x50061c46, 0.0f);
|
||||
func_802FA0B0(local->unkC, 0);
|
||||
func_8025A6EC(COMUSIC_43_ENTER_LEVEL_GLITTER, 0x7FFF);
|
||||
func_8025AABC(COMUSIC_43_ENTER_LEVEL_GLITTER);
|
||||
func_8030E9C4(SFX_C7_SHWOOP, 0.8f, 0x7FFF, sp30, 300.0f, 2000.0f);
|
||||
}//L802CE3C4
|
||||
|
||||
if(actor_animationIsAt(this, 0.434f)){
|
||||
func_8030E9C4(SFX_C7_SHWOOP, 0.9f, 0x7fff, sp30, 300.0f, 2000.0f);
|
||||
}//L802CE408
|
||||
|
||||
if(actor_animationIsAt(this, 0.811f)){
|
||||
func_8030E9C4(SFX_C7_SHWOOP, 1.0f, 0x7fff, sp30, 300.0f, 2000.0f);
|
||||
}
|
||||
|
||||
}else{//L802CE450
|
||||
if(actor_animationIsAt(this,0.214f)){
|
||||
func_8030E9C4(SFX_C7_SHWOOP, 1.1f, 0x7fff, sp30, 300.0f, 2000.0f);
|
||||
}//L802CE490
|
||||
|
||||
if(actor_animationIsAt(this,0.55f)){
|
||||
func_8030E9C4(SFX_53_BANJO_HUIII, 1.5f, 0x7fff, sp30, 300.0f, 2000.0f);
|
||||
}//L802CE4D0
|
||||
|
||||
if(actor_animationIsAt(this,0.75f)){
|
||||
func_80326310(this);
|
||||
if(local->unk4 == 0){
|
||||
func_8032BB88(this, -1, 4000);
|
||||
func_8024BD08(1);
|
||||
}
|
||||
}//L802CE518
|
||||
|
||||
if(actor_animationIsAt(this,0.85f)){
|
||||
if(local->unk4){
|
||||
func_802F9D38();
|
||||
local->unk4 = 0;
|
||||
}
|
||||
func_8030E4E4(SFX_19_BANJO_LANDING_08);
|
||||
func_8025A7DC(COMUSIC_43_ENTER_LEVEL_GLITTER);
|
||||
}//L802CE558
|
||||
|
||||
if(local->unk4 && actor_animationIsAt(this,0.95f)){
|
||||
func_8032BB88(this, -1, 4000);
|
||||
func_8024BD08(1);
|
||||
}
|
||||
}//L802CE598
|
||||
|
||||
if(sp50){
|
||||
if(actor_animationIsAt(this, 0.96f) || actor_animationIsAt(this, 0.99f)){
|
||||
func_80328B8C(this, 8, 0.0f, -1);
|
||||
actor_playAnimationOnce(this);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}//L802CE5F0
|
||||
if(this->state < 4 && !(((sp66 >= 0)? sp66: -sp66) <= 0x100)){
|
||||
func_80328B8C(this, 4, 0.0f, -1);
|
||||
actor_playAnimationOnce(this);
|
||||
}//L802CE630
|
||||
if(!func_803114B0()){
|
||||
switch(D_803671B0[this->state].index){
|
||||
case 0x31:
|
||||
if(actor_animationIsAt(this, 0.6f)){
|
||||
if(local->unk8){
|
||||
func_8030E988(SFX_8_BANJO_LANDING_04, 1.8f, 18000, sp30, 120.0f, 1200.0f);
|
||||
}else{
|
||||
FUNC_8030E8B4(SFX_8_BANJO_LANDING_04, 1.8f, 18000, sp30, 120, 1200);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x2D: //L802CE6F4
|
||||
if(actor_animationIsAt(this, 0.2f)){
|
||||
if(local->unk8){
|
||||
func_8030E988(SFX_17_JINJO_WHISTLE, 1.0f, 22000, sp30, 120.0f, 1200.0f);
|
||||
}else{
|
||||
FUNC_8030E8B4(SFX_27_JINJO_HI, 1.0f, 22000, sp30, 120, 1200);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x2F: //L802CE760
|
||||
if(actor_animationIsAt(this, 0.2f)){
|
||||
if(local->unk8){
|
||||
func_8030E988(SFX_27_JINJO_HI, 1.0f, 22000, sp30, 120.0f, 1200.0f);
|
||||
}else{
|
||||
FUNC_8030E8B4(SFX_17_JINJO_WHISTLE, 1.0f, 22000, sp30, 120, 1200);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: //L802CE7C8
|
||||
break;
|
||||
}
|
||||
}//L802CE7CC
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/nonmatchings/core2/ch/jinjo/func_802CDD78.s")
|
||||
#endif
|
453
src/core2/ch/mole.c
Normal file
453
src/core2/ch/mole.c
Normal file
@@ -0,0 +1,453 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
void func_802D9D60(Actor *this);
|
||||
Actor *func_802D94B4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
void func_802D9830(ActorMarker *marker, enum asset_e arg1, s32 arg2);
|
||||
|
||||
typedef struct{
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s8 unk4;
|
||||
s8 unk5;
|
||||
} struct_core2_52290;
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_80367D70[]= {
|
||||
{0, 0.0f},
|
||||
{ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f},
|
||||
{ASSET_13A_ANIM_BOTTLES_ENTER, 4.5f},
|
||||
{ASSET_13B_ANIM_BOTTLES_IDLE, 7.0f},
|
||||
{ASSET_139_ANIM_BOTTLES_EXIT, 1.7f},
|
||||
{ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f},
|
||||
};
|
||||
|
||||
ActorInfo D_80367DA0= {
|
||||
0x1DF, ACTOR_37A_BOTTLES, ASSET_387_MODEL_BOTTLES,
|
||||
1, D_80367D70,
|
||||
func_802D9D60, func_80326224, func_802D94B4,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
struct_core2_52290 D_80367DC4[] = {
|
||||
{0x0C23, 0x0C24, 0x0F, ABILITY_1_BEAK_BOMB},
|
||||
{0x0B47, 0x0B4B, 0x16, ABILITY_6_EGGS},
|
||||
{0x0B48, 0x0B4C, 0x17, ABILITY_2_BEAK_BUSTER},
|
||||
{0x0B49, 0x0B4A, 0x18, ABILITY_10_TALON_TROT},
|
||||
{0x0A1F, 0x0A23, 0x0C, ABILITY_D_SHOCK_JUMP},
|
||||
{0x0A20, 0x0A22, 0x0D, ABILITY_9_FLY},
|
||||
{0x0D35, 0x0D36, 0x01, ABILITY_12_WONDERWING},
|
||||
{0x0C88, 0x0C89, 0x10, ABILITY_E_WADING_BOOTS},
|
||||
{0x0A84, 0x0A85, 0x19, ABILITY_11_TURBO_TALON},
|
||||
{0x0F64, 0x0F65, 0x0E, ABILITY_13_1ST_NOTEDOOR}
|
||||
};
|
||||
|
||||
/* .code */
|
||||
int func_802D9220(enum level_e level){
|
||||
switch (level){
|
||||
case LEVEL_1_MUMBOS_MOUNTAIN:
|
||||
return ability_isUnlocked(ABILITY_6_EGGS)
|
||||
&& ability_isUnlocked(ABILITY_2_BEAK_BUSTER)
|
||||
&& ability_isUnlocked(ABILITY_10_TALON_TROT);
|
||||
case LEVEL_2_TREASURE_TROVE_COVE:
|
||||
return ability_isUnlocked(ABILITY_D_SHOCK_JUMP)
|
||||
&& ability_isUnlocked(ABILITY_9_FLY);
|
||||
case LEVEL_3_CLANKERS_CAVERN:
|
||||
return ability_isUnlocked(ABILITY_12_WONDERWING);
|
||||
case LEVEL_4_BUBBLEGLOOP_SWAMP:
|
||||
return ability_isUnlocked(ABILITY_E_WADING_BOOTS);
|
||||
case LEVEL_5_FREEZEEZY_PEAK:
|
||||
return ability_isUnlocked(ABILITY_1_BEAK_BOMB);
|
||||
case LEVEL_7_GOBIS_VALLEY:
|
||||
return ability_isUnlocked(ABILITY_11_TURBO_TALON);
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
enum asset_e func_802D9304(void){
|
||||
s32 level_id = level_get();
|
||||
int learned_all_moves = func_802D9220(level_id);
|
||||
switch(level_id){
|
||||
case LEVEL_1_MUMBOS_MOUNTAIN:
|
||||
return learned_all_moves ? 0xb4e : 0xd38;
|
||||
case LEVEL_2_TREASURE_TROVE_COVE:
|
||||
return learned_all_moves ? 0xa27 : 0xd38;
|
||||
case LEVEL_3_CLANKERS_CAVERN:
|
||||
return learned_all_moves ? 0xd37 : 0xd38;
|
||||
case LEVEL_4_BUBBLEGLOOP_SWAMP:
|
||||
return learned_all_moves ? 0xc8a : 0xd38;
|
||||
case LEVEL_5_FREEZEEZY_PEAK:
|
||||
return learned_all_moves ? 0xc2a : 0xd38;
|
||||
case LEVEL_7_GOBIS_VALLEY:
|
||||
return learned_all_moves ? 0xc2a : 0xd38;
|
||||
default:
|
||||
return 0xd38;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int func_802D93EC(void){
|
||||
return ability_isUnlocked(ABILITY_6_EGGS)
|
||||
&& ability_isUnlocked(ABILITY_2_BEAK_BUSTER)
|
||||
&& ability_isUnlocked(ABILITY_10_TALON_TROT)
|
||||
&& ability_isUnlocked(ABILITY_D_SHOCK_JUMP)
|
||||
&& ability_isUnlocked(ABILITY_9_FLY)
|
||||
&& ability_isUnlocked(ABILITY_12_WONDERWING)
|
||||
&& ability_isUnlocked(ABILITY_E_WADING_BOOTS)
|
||||
&& ability_isUnlocked(ABILITY_1_BEAK_BOMB)
|
||||
&& ability_isUnlocked(ABILITY_11_TURBO_TALON);
|
||||
}
|
||||
|
||||
Actor *func_802D94B4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
|
||||
if(actor->state != 1 && actor->state != 5){
|
||||
func_8033A45C(3, 0);
|
||||
func_8033A45C(4, 0);
|
||||
actor = func_80325888(marker, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
return actor;
|
||||
}
|
||||
|
||||
void func_802D9530(Actor *this){
|
||||
Actor *other = func_80329980(this);
|
||||
if(this->unk100 && other){
|
||||
if(this->unk100->unk14_20 == 0xB8)
|
||||
func_80328B8C(other, 3, 0.0001f, 1);
|
||||
}
|
||||
func_80328B8C(this, 4, 0.0001f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
this->unk44_31 = func_8030D90C();
|
||||
sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN);
|
||||
func_8030DD14(this->unk44_31, 2);
|
||||
func_8030DBB4(this->unk44_31, 1.4f);
|
||||
sfxsource_setSampleRate(this->unk44_31, 26000);
|
||||
func_8028F918(0);
|
||||
}
|
||||
|
||||
void func_802D9600(Actor * this){
|
||||
animctrl_setSmoothTransition(this->animctrl, 0);
|
||||
func_80328B8C(this, 1, 0.0001f, 1);
|
||||
this->marker->propPtr->unk8_3 = 0;
|
||||
}
|
||||
|
||||
void func_802D9658(Actor *this){
|
||||
timed_setCameraToNode(0.0f, D_80367DC4[this->unkF4_8-9].unk4);
|
||||
}
|
||||
|
||||
void func_802D9698(ActorMarker *marker, enum asset_e arg1, s32 arg2){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
|
||||
if( arg1 == D_80367DC4[actor->unkF4_8-9].unk0
|
||||
&& item_getCount(ITEM_14_HEALTH) < item_getCount(ITEM_15_HEALTH_TOTAL)
|
||||
){
|
||||
func_80311480(ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH, 7, 0, actor->marker, func_802D9698, func_802D9830);
|
||||
}//L802D9738
|
||||
else if(arg1 == D_80367DC4[actor->unkF4_8-9].unk0 || arg1 == ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH){
|
||||
func_80311480(func_802D93EC()? 0xa87 : func_802D9304(), 7, 0, actor->marker, func_802D9698, NULL);
|
||||
}
|
||||
else{//L802D97BC
|
||||
if(actor->unk138_24){
|
||||
func_80347A14(1);
|
||||
actor->unk138_24 = FALSE;
|
||||
}
|
||||
func_80324E88(0.0f);
|
||||
if(actor->state == 5){
|
||||
func_8028F918(0);
|
||||
func_802D9600(actor);
|
||||
}//L802D9814
|
||||
else{
|
||||
func_802D9530(actor);
|
||||
}
|
||||
}//L802D9820
|
||||
}
|
||||
|
||||
void func_802D9830(ActorMarker *marker, enum asset_e arg1, s32 arg2){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
switch(arg2){
|
||||
case 1:
|
||||
timed_setCameraToNode(0.0f, 0x11);
|
||||
levelSpecificFlags_set(0x1A, 1);
|
||||
break;
|
||||
case 2:
|
||||
levelSpecificFlags_set(0x1A, 0);
|
||||
func_802D9658(actor);
|
||||
break;
|
||||
case 3:
|
||||
timed_setCameraToNode(0.0f, 0x29);
|
||||
levelSpecificFlags_set(0x1A, 1);
|
||||
break;
|
||||
case 4:
|
||||
levelSpecificFlags_set(0x1A, 0);
|
||||
func_802D9658(actor);
|
||||
break;
|
||||
case 5:
|
||||
func_803463D4(ITEM_D_EGGS, 50);
|
||||
break;
|
||||
case 6:
|
||||
func_803463D4(ITEM_F_RED_FEATHER, 25);
|
||||
break;
|
||||
case 7:
|
||||
func_803463D4(ITEM_10_GOLD_FEATHER, 5);
|
||||
break;
|
||||
case 8:
|
||||
item_set(ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL));
|
||||
break;
|
||||
case 0xff:
|
||||
func_802D9658(actor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int func_802D997C(Actor *this){
|
||||
s32 sp2C;
|
||||
s32 sp28 = 0xe;
|
||||
if(ability_isUnlocked(D_80367DC4[this->unkF4_8-9].unk5)){
|
||||
sp28 = 0xf;
|
||||
sp2C = D_80367DC4[this->unkF4_8-9].unk2;
|
||||
}//L802D99EC
|
||||
else{
|
||||
func_80347A14(0);
|
||||
this->unk138_24 = 1;
|
||||
sp2C = D_80367DC4[this->unkF4_8-9].unk0;
|
||||
ability_unlock(D_80367DC4[this->unkF4_8-9].unk5);
|
||||
switch(D_80367DC4[this->unkF4_8-9].unk5){
|
||||
case ABILITY_9_FLY:
|
||||
case ABILITY_D_SHOCK_JUMP:
|
||||
func_8030E6A4(SFX_113_PAD_APPEARS, 0.9f, 32000);
|
||||
break;
|
||||
case ABILITY_13_1ST_NOTEDOOR:
|
||||
func_802FAD64(ITEM_C_NOTE);
|
||||
break;
|
||||
}
|
||||
}//L802D9A9C
|
||||
func_80311480(sp2C, sp28, this->position, this->marker, func_802D9698, func_802D9830);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void func_802D9ADC(Actor *this){
|
||||
Actor *other = func_80329980(this);
|
||||
if(this->unk100 && other && this->unk100->unk14_20 == 0xB8){
|
||||
func_80328B8C(other, 2, 0.0001f, 1);
|
||||
}
|
||||
this->marker->propPtr->unk8_3 = 1;
|
||||
animctrl_setSmoothTransition(this->animctrl, TRUE);
|
||||
func_80328B8C(this, 2, 0.0001f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
this->unk44_31 = func_8030D90C();
|
||||
sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN);
|
||||
func_8030DD14(this->unk44_31, 2);
|
||||
func_8030DBB4(this->unk44_31, 1.4f);
|
||||
sfxsource_setSampleRate(this->unk44_31, 26000);
|
||||
func_802D9658(this);
|
||||
func_8028F94C(2, this->position);
|
||||
}
|
||||
|
||||
void func_802D9BD8(Actor *this){
|
||||
func_80328A84(this, 5);
|
||||
func_802D9658(this);
|
||||
func_8028F94C(2, this->position);
|
||||
func_802D997C(this);
|
||||
}
|
||||
|
||||
void func_802D9C1C(Actor *this){
|
||||
func_80328B8C(this, 3, 0.0001f, 1);
|
||||
actor_loopAnimation(this);
|
||||
}
|
||||
|
||||
void func_802D9C54(ActorMarker *marker){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
Actor *other = spawn_child_actor(ACTOR_12C_MOLEHILL, &actor);
|
||||
f32 pad[1];
|
||||
|
||||
actor->unk100 = other->marker;
|
||||
if(marker);
|
||||
}
|
||||
|
||||
void func_802D9C90(Actor *this){
|
||||
u8 tmp_a1 = this->unk44_31;
|
||||
if(tmp_a1){
|
||||
func_8030DA44(tmp_a1);
|
||||
}
|
||||
}
|
||||
|
||||
void func_802D9CBC(Actor *this){
|
||||
if(ability_isUnlocked(D_80367DC4[this->unkF4_8 - 9].unk5)){
|
||||
func_802D9BD8(this);
|
||||
}
|
||||
else{
|
||||
if(func_80329530(this, 150)){
|
||||
if(this->unk38_0 == 0)
|
||||
func_8028F45C(9, this->position);
|
||||
else
|
||||
func_8028F490(this->unk1C);
|
||||
}//L802D9D44
|
||||
func_802D9ADC(this);
|
||||
}
|
||||
}
|
||||
|
||||
void func_802D9D60(Actor *this){
|
||||
s32 sp50[6];
|
||||
f32 sp4C;
|
||||
f32 pad44[2];
|
||||
Actor *other;
|
||||
f32 sp34[3];
|
||||
|
||||
if(this->unkF4_8 < 8 || this->unkF4_8 >= 0x13)
|
||||
return;
|
||||
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = 1;
|
||||
func_803300D8(this->marker, func_802D9C90);
|
||||
if(this->initialized){
|
||||
other = func_80326D68(this->position, ACTOR_12C_MOLEHILL, -1, &sp4C);
|
||||
this->unk100 = (other) ? other->marker : NULL;
|
||||
if(this->unk100){
|
||||
other = func_80329980(this);
|
||||
if(other && this->unk100->unk14_20 == 0xB8){
|
||||
func_80328A84(other, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}//L802D9E34
|
||||
|
||||
if(!this->initialized){
|
||||
other = func_80304C38(0x372, this);
|
||||
if(other == NULL){
|
||||
this->unk38_0 = FALSE;
|
||||
}
|
||||
else{
|
||||
this->unk38_0 = TRUE;
|
||||
nodeprop_getPosition(other, this->unk1C);
|
||||
}
|
||||
func_802C3C88(func_802D9C54, this->marker);
|
||||
this->marker->propPtr->unk8_3 = FALSE;
|
||||
this->marker->collidable = FALSE;
|
||||
this->initialized = TRUE;
|
||||
if(this->unkF4_8 == 0x12){
|
||||
other = func_80304C38(0x349, this);
|
||||
if(other == NULL){
|
||||
this->velocity[0] = this->position[0];
|
||||
this->velocity[1] = this->position[1];
|
||||
this->velocity[2] = this->position[2];
|
||||
this->unk28 = 500.0f;
|
||||
}
|
||||
else{ //L802D9F08
|
||||
nodeprop_getPosition(other, this->velocity);
|
||||
this->unk28 = 2*nodeprop_getRadius(other);
|
||||
}
|
||||
}
|
||||
}//L802D9F34
|
||||
func_8024E55C(0, sp50);//get face buttons press counters
|
||||
switch(this->state){
|
||||
case 1://L802D9F70
|
||||
this->yaw_moving = func_80329784(this);
|
||||
func_80328FB0(this, 4.0f);
|
||||
if(func_8028F20C() && func_8028F0D4() && !func_8028EC04()){
|
||||
if( this->unkF4_8 == 0x12
|
||||
&& !ability_isUnlocked(D_80367DC4[this->unkF4_8-9].unk5)
|
||||
&& (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT)
|
||||
){
|
||||
player_getPosition(sp34);
|
||||
if(ml_vec3f_distance(sp34, this->velocity) < this->unk28){
|
||||
func_802D9CBC(this);
|
||||
}
|
||||
}
|
||||
else{//L802DA054
|
||||
if( !func_8028ECAC()
|
||||
&& func_80329530(this, 0xFA)
|
||||
&& func_8028EFC8()
|
||||
&& sp50[BUTTON_Z] == 1
|
||||
){
|
||||
func_802D9CBC(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2://L802DA0A0
|
||||
this->marker->propPtr->unk8_3 = TRUE;
|
||||
this->yaw_moving = func_80329784(this);
|
||||
func_80328FB0(this, 4.0f);
|
||||
if( 0.0 < animctrl_getAnimTimer(this->animctrl)
|
||||
&& animctrl_getAnimTimer(this->animctrl) < 0.16
|
||||
){
|
||||
func_8030E2C4(this->unk44_31);
|
||||
}//L802DA128
|
||||
if(actor_animationIsAt(this, 0.9999f)){
|
||||
func_802D9C1C(this);
|
||||
func_8030DA44(this->unk44_31);
|
||||
this->unk44_31 = 0;
|
||||
}
|
||||
else if(actor_animationIsAt(this, 0.14f)){//L802DA154
|
||||
FUNC_8030E8B4(SFX_C6_SHAKING_MOUTH, 1.2f, 24000, this->position, 1250, 2500);
|
||||
}
|
||||
else if(actor_animationIsAt(this, 0.4f)){//L802DA188
|
||||
FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.2f, 24000, this->position, 1250, 2500);
|
||||
}
|
||||
else if(actor_animationIsAt(this, 0.75f)){//L802DA1BC
|
||||
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1250, 2500);
|
||||
}
|
||||
else if(actor_animationIsAt(this, 0.35f)){//L802DA1EC
|
||||
func_802D997C(this);
|
||||
}
|
||||
break;
|
||||
case 3://L802DA210
|
||||
this->yaw_moving = func_80329784(this);
|
||||
func_80328FB0(this, 4.0f);
|
||||
if( ( actor_animationIsAt(this, 0.37f)
|
||||
|| actor_animationIsAt(this, 0.66f)
|
||||
|| actor_animationIsAt(this, 0.85f)
|
||||
)
|
||||
&& randf() < 0.2
|
||||
){
|
||||
animctrl_setDirection(this->animctrl, 1 ^ animctrl_isPlayedForwards(this->animctrl));
|
||||
}
|
||||
else if(
|
||||
actor_animationIsAt(this, 0.25f)
|
||||
|| actor_animationIsAt(this, 0.28f)
|
||||
|| actor_animationIsAt(this, 0.31f)
|
||||
){//L802DA2B4
|
||||
func_8030E878(SFX_6F_BANJO_HEADSCRATCH, randf2(1.4f, 1.55f), 16000, this->position, 1250.0f, 2500.0f);
|
||||
}
|
||||
else if(
|
||||
actor_animationIsAt(this, 0.45f)
|
||||
|| actor_animationIsAt(this, 0.48f)
|
||||
|| actor_animationIsAt(this, 0.51f)
|
||||
|| actor_animationIsAt(this, 0.7f)
|
||||
|| actor_animationIsAt(this, 0.73f)
|
||||
|| actor_animationIsAt(this, 0.76f)
|
||||
){//L802DA33C
|
||||
func_8030E878(SFX_6F_BANJO_HEADSCRATCH, randf2(1.35f, 1.5f), 6000, this->position, 1250.0f, 2500.0f);
|
||||
}
|
||||
break;
|
||||
case 4://L802DA400
|
||||
if( 0.35 < animctrl_getAnimTimer(this->animctrl)
|
||||
&& animctrl_getAnimTimer(this->animctrl) < 0.9
|
||||
){
|
||||
func_8030E2C4(this->unk44_31);
|
||||
}
|
||||
else if(actor_animationIsAt(this, 0.9999f)){//L802DA45C
|
||||
func_802D9600(this);
|
||||
func_8030DA44(this->unk44_31);
|
||||
this->unk44_31 = 0;
|
||||
}
|
||||
break;
|
||||
}//L802DA488
|
||||
}
|
||||
|
||||
int func_802DA498(void){
|
||||
return ability_isUnlocked(ABILITY_F_DIVE)
|
||||
&& ability_isUnlocked(ABILITY_4_BEAR_PUNCH)
|
||||
&& ability_isUnlocked(ABILITY_C_ROLL)
|
||||
&& ability_isUnlocked(ABILITY_B_RATATAT_RAP)
|
||||
&& ability_isUnlocked(ABILITY_0_BARGE)
|
||||
&& ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER)
|
||||
&& ability_isUnlocked(ABILITY_7_FLAP)
|
||||
&& ability_isUnlocked(ABILITY_8_FLIP)
|
||||
&& ability_isUnlocked(ABILITY_5_CLIMB)
|
||||
;
|
||||
}
|
113
src/core2/ch/molehill.c
Normal file
113
src/core2/ch/molehill.c
Normal file
@@ -0,0 +1,113 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
typedef struct{
|
||||
u8 unk0;
|
||||
u8 pad1[3];
|
||||
f32 unk4[3];
|
||||
f32 unk10[3];
|
||||
f32 unk1C[3];
|
||||
}ActorLocal_MoleHill;
|
||||
|
||||
Actor *func_802DA560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
void func_802DA740(Actor *this);
|
||||
|
||||
/*.data */
|
||||
ActorAnimationInfo D_80367E00[] = {
|
||||
{0x000, 0.0f},
|
||||
{0x13D, 2000000000.0f},
|
||||
{0x13D, 4.5f},
|
||||
{0x13C, 1.7f}
|
||||
};
|
||||
|
||||
ActorInfo D_80367E20= {
|
||||
0xB8, ACTOR_12C_MOLEHILL, ASSET_388_MODEL_MOLEHILL,
|
||||
0, D_80367E00,
|
||||
func_802DA740, func_80326224, func_802DA560,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
struct31s D_80367E44 = {
|
||||
{0.05f, 0.1f},
|
||||
{0.0f, 0.0f},
|
||||
{0.0f, 0.01f},
|
||||
{4.0f, 4.0f},
|
||||
0.0f,
|
||||
0.3f
|
||||
};
|
||||
|
||||
/* .code */
|
||||
Actor *func_802DA560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *actor = marker_getActor(marker);
|
||||
ActorLocal_MoleHill * local = (ActorLocal_MoleHill *) &actor->local;
|
||||
if(actor->unk16C_4){
|
||||
actor = func_80325888(marker, gfx, mtx, vtx);
|
||||
func_8034A174(actor->marker->unk44, 5, actor->velocity);
|
||||
func_8034A174(actor->marker->unk44, 6, actor->unk1C);
|
||||
func_8034A174(actor->marker->unk44, 7, local->unk4);
|
||||
func_8034A174(actor->marker->unk44, 8, local->unk10);
|
||||
func_8034A174(actor->marker->unk44, 9, local->unk1C);
|
||||
local->unk0 = 1;
|
||||
}
|
||||
return actor;
|
||||
}
|
||||
|
||||
void func_802DA634(ParticleEmitter *pCtrl, f32 arg1[3], s32 cnt){
|
||||
particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -600.0f, 0.0f, 0.0f, -600.0f, 0.0f);
|
||||
particleEmitter_setModel(pCtrl, 0x344);
|
||||
particleEmitter_setPosition(pCtrl, arg1);
|
||||
func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f);
|
||||
particleEmitter_setParticleVelocityRange(pCtrl, -150.0f, 150.0f, -150.0f, 150.0f, 360.0f, 150.0f);
|
||||
func_802EFB98(pCtrl, &D_80367E44);
|
||||
func_802EF9F8(pCtrl, 0.01f);
|
||||
func_802EFA18(pCtrl, 3);
|
||||
particleEmitter_emitN(pCtrl, cnt);
|
||||
}
|
||||
|
||||
void func_802DA740(Actor *this){
|
||||
ActorLocal_MoleHill * local = (ActorLocal_MoleHill *) &this->local;
|
||||
|
||||
this->marker->propPtr->unk8_3 = TRUE;
|
||||
this->marker->collidable = FALSE;
|
||||
if(!this->unk16C_4){
|
||||
local->unk0 = 0;
|
||||
this->unk16C_4 = 1;
|
||||
}
|
||||
switch(this->state){
|
||||
case 1:
|
||||
break;
|
||||
case 2: //L802DA7C4
|
||||
if(actor_animationIsAt(this, 0.9999f)){
|
||||
func_80328B8C(this, 1, 0.0001f, 1);
|
||||
}
|
||||
else{
|
||||
if(local->unk0 && actor_animationIsAt(this, 0.05f)){
|
||||
func_802DA634(partEmitList_pushNew(6), this->velocity, 6);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3: //L802DA838
|
||||
if(actor_animationIsAt(this, 0.9999f)){
|
||||
func_80328B8C(this, 1, 0.0001f, 1);
|
||||
}
|
||||
else if(local->unk0){
|
||||
if(actor_animationIsAt(this, 0.3f)){
|
||||
func_802DA634(partEmitList_pushNew(6), this->velocity, 6);
|
||||
}
|
||||
else if(actor_animationIsAt(this, 0.4f)){
|
||||
func_802DA634(partEmitList_pushNew(4), this->unk1C, 4);
|
||||
}
|
||||
else if(actor_animationIsAt(this, 0.45f)){
|
||||
func_802DA634(partEmitList_pushNew(4), local->unk4, 4);
|
||||
}
|
||||
else if(actor_animationIsAt(this, 0.5f)){
|
||||
func_802DA634(partEmitList_pushNew(4), local->unk10, 4);
|
||||
}
|
||||
else if(actor_animationIsAt(this, 0.55f)){
|
||||
func_802DA634(partEmitList_pushNew(4), local->unk1C, 4);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}//L802DA984
|
||||
}
|
17
src/core2/ch/musicnote.c
Normal file
17
src/core2/ch/musicnote.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
void func_802C9C30(Actor* this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80366C50 = {
|
||||
MARKER_5F_MUSIC_NOTE, ACTOR_51_MUSIC_NOTE, ASSET_6D6_MODEL_MUSIC_NOTE, 0, NULL,
|
||||
func_802C9C30, func_80326224, func_80325934,
|
||||
0, 0, 0.6f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_802C9C30(Actor* this){
|
||||
this->scale = 0.42857143f;
|
||||
}
|
124
src/core2/ch/soundsource.c
Normal file
124
src/core2/ch/soundsource.c
Normal file
@@ -0,0 +1,124 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
void func_802D07C8(Actor *this);
|
||||
|
||||
typedef struct{
|
||||
s32 unk0; //enum sfx_e
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
s32 unk8;
|
||||
f32 unkC;
|
||||
f32 unk10;
|
||||
}struct49570s;
|
||||
|
||||
typedef struct{
|
||||
u8 unk0;
|
||||
}ActorLocal_Core2_49570;
|
||||
|
||||
/* .data */
|
||||
struct49570s D_80367340[] = {
|
||||
{0x03EC, 400, 3200, -1, -1.0f, -1.0f},
|
||||
{SFX_128_FIRE_CRACKING, 400, 2600, -1, -1.0f, -1.0f},
|
||||
{SFX_12B_BOILING_AND_BUBBLING, 100, 1200, 14000, -1.0f, 2.5f},
|
||||
{-1, 0, 0, 0, 0.0f, 0.0f},
|
||||
};
|
||||
|
||||
ActorInfo D_80367390 = {0x1A8, ACTOR_28B_SOUND_SOURCE, 0,
|
||||
0, NULL,
|
||||
func_802D07C8, NULL, func_80325340,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_802D0500(Actor *this){
|
||||
ActorLocal_Core2_49570 *local = (ActorLocal_Core2_49570 *)this->local;
|
||||
if(D_80367340[(s32)this->yaw].unk8 != -1){
|
||||
if(this->unk1C[0] == this->unk1C[1])
|
||||
sfxsource_setSampleRate(local->unk0, D_80367340[(s32)this->yaw].unk8);
|
||||
else{
|
||||
sfxsource_setSampleRate(local->unk0, (s32)((D_80367340[(s32)this->yaw].unk8/this->unk1C[1])*this->unk1C[0]));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_802D05A0(Actor *this, s32 next_state){
|
||||
ActorLocal_Core2_49570 *local = (ActorLocal_Core2_49570 *)this->local;
|
||||
if(this->state == 2 && local->unk0){
|
||||
func_8030DA44(local->unk0);
|
||||
local->unk0 = 0;
|
||||
}
|
||||
if(next_state == 2){
|
||||
this->unk1C[0] = 0.0f;
|
||||
this->unk1C[1] = 0.0f;
|
||||
if(-1.0f != D_80367340[(s32)this->yaw].unk10){
|
||||
this->unk1C[1] = D_80367340[(s32)this->yaw].unk10;
|
||||
}
|
||||
local->unk0 = func_8030D90C();
|
||||
sfxsource_setSfxId(local->unk0, D_80367340[(s32)this->yaw].unk0);
|
||||
func_8030DD14(local->unk0, 3);
|
||||
func_8030DFF0(local->unk0, 1);
|
||||
func_8030DF68(local->unk0, this->position);
|
||||
func_8030DEB4(local->unk0, D_80367340[(s32)this->yaw].unk4*this->scale, D_80367340[(s32)this->yaw].unk6*this->scale);
|
||||
func_8030DFB4(local->unk0, 1);
|
||||
func_802D0500(this);
|
||||
if(-1.0f != D_80367340[(s32)this->yaw].unkC)
|
||||
func_8030DBB4(local->unk0, D_80367340[(s32)this->yaw].unkC);
|
||||
func_8030E2C4(local->unk0);
|
||||
}//L802D0780
|
||||
this->state = next_state;
|
||||
}
|
||||
|
||||
void func_802D07A8(Actor *this){
|
||||
func_802D05A0(this, 0);
|
||||
}
|
||||
|
||||
void func_802D07C8(Actor *this){
|
||||
f32 sp2C[3];
|
||||
f32 sp28;
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = 1;
|
||||
this->marker->unk30 = func_802D07A8;
|
||||
func_802D05A0(this, 1);
|
||||
}
|
||||
player_getPosition(sp2C);
|
||||
sp28 = ml_vec3f_distance(sp2C, this->position);
|
||||
if( this->state == 1){
|
||||
if(sp28 < D_80367340[(s32)this->yaw].unk6*this->scale){
|
||||
func_802D05A0(this, 2);
|
||||
}
|
||||
}//L802D08A0
|
||||
if(this->state == 2){
|
||||
if((D_80367340[(s32)this->yaw].unk6 + 100)*this->scale < sp28){
|
||||
func_802D05A0(this, 1);
|
||||
}
|
||||
if(this->unk1C[0] != this->unk1C[1]){
|
||||
this->unk1C[0] += time_getDelta();
|
||||
if(this->unk1C[1] < this->unk1C[0]){
|
||||
this->unk1C[0] = this->unk1C[1];
|
||||
}
|
||||
func_802D0500(this);
|
||||
}
|
||||
}//L802D095C
|
||||
}
|
||||
|
||||
void func_802D096C(s32 arg0, s32 arg1, s32 arg2, s32 arg3){
|
||||
f32 sp1C[3];
|
||||
|
||||
sp1C[0] = reinterpret_cast(f32, arg0);
|
||||
sp1C[1] = reinterpret_cast(f32, arg1);
|
||||
sp1C[2] = reinterpret_cast(f32, arg2);
|
||||
func_8032813C(0x28B, sp1C, arg3);
|
||||
|
||||
}
|
||||
|
||||
void func_802D09B8(Actor *this, s32 arg1){
|
||||
func_802C3F04(func_802D096C,
|
||||
reinterpret_cast(s32, this->position[0]),
|
||||
reinterpret_cast(s32, this->position[1]),
|
||||
reinterpret_cast(s32, this->position[2]),
|
||||
arg1
|
||||
);
|
||||
}
|
123
src/core2/ch/trainers.c
Normal file
123
src/core2/ch/trainers.c
Normal file
@@ -0,0 +1,123 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
Actor *chtrainers_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
void chtrainers_update(Actor *this);
|
||||
|
||||
/* .data */
|
||||
extern ActorAnimationInfo D_80366EA0[];
|
||||
extern ActorInfo D_80366EC0 = {
|
||||
MARKER_38_TURBO_TALON_TRAINERS, ACTOR_2C_TURBO_TALON_TRAINERS, ASSET_367_MODEL_TURBO_TALON_TRAINERS,
|
||||
0x0, D_80366EA0,
|
||||
chtrainers_update, func_80326224, chtrainers_draw,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .rodata */
|
||||
extern f64 D_80376470;
|
||||
extern f64 D_80376478;
|
||||
|
||||
/* .code */
|
||||
Actor *chtrainers_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *this = marker_getActor(marker);
|
||||
if( !this->unk10_12 )
|
||||
return this;
|
||||
return func_80325888(marker, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
|
||||
void _chtrainers_802CA378(Actor *this, bool arg1){
|
||||
f32 sp24[3];
|
||||
if(ability_isUnlocked(ABILITY_11_TURBO_TALON))
|
||||
actor_setOpacity(this, 0xff);
|
||||
else
|
||||
actor_setOpacity(this, 0x87);
|
||||
|
||||
if( actor_animationIsAt(this, 0.38f)
|
||||
|| actor_animationIsAt(this, 0.88f)
|
||||
){
|
||||
if(arg1)
|
||||
FUNC_8030E624(SFX_8_BANJO_LANDING_04, 1.6f, 7000);
|
||||
else
|
||||
FUNC_8030E8B4(SFX_8_BANJO_LANDING_04, 1.6f, 7000, this->position, 600, 1500);
|
||||
}
|
||||
|
||||
func_802589E4(sp24, this->velocity[1], 40.0f);
|
||||
sp24[1] = 0.0f;
|
||||
ml_vec3f_add(this->position, this->unk1C, sp24);
|
||||
this->velocity[1] += D_80376470;
|
||||
this->yaw = mlNormalizeAngle(this->velocity[1] + D_80376478);
|
||||
}
|
||||
|
||||
void chtrainers_update(Actor *this){
|
||||
s32 sp2C = levelSpecificFlags_get(0x1a);
|
||||
if(sp2C && this->unkF4_8 != 1){
|
||||
return;
|
||||
}
|
||||
|
||||
if(!this->initialized){
|
||||
this->initialized = TRUE;
|
||||
ml_vec3f_copy(this->unk1C, this->position);
|
||||
this->velocity[0] = this->yaw;
|
||||
this->velocity[1] = 0.0f;
|
||||
this->unk10_12 = !func_803203FC(0x1f) && !func_803203FC(0x1);
|
||||
func_80328A84(this, 0);
|
||||
}
|
||||
|
||||
if(!func_803203FC(0xF) && ability_isUnlocked(ABILITY_11_TURBO_TALON)){
|
||||
func_803204E4(0xF, TRUE);
|
||||
}
|
||||
|
||||
switch(this->state){
|
||||
case 0://L802CA5A8
|
||||
if(func_803296D8(this, 2000) || sp2C){
|
||||
if( func_80329530(this, 0xfa)
|
||||
&& !func_803203FC(0xf)
|
||||
&& player_getTransformation() == TRANSFORM_1_BANJO
|
||||
){
|
||||
if(func_80311480(0xda4, 0, NULL, NULL, NULL, NULL)){
|
||||
func_803204E4(0xf, TRUE);
|
||||
}
|
||||
}//L802CA620
|
||||
_chtrainers_802CA378(this, sp2C);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1://L802CA630
|
||||
this->velocity[2] -= time_getDelta();
|
||||
if(this->velocity[2] <= 0.0f){
|
||||
func_80328A84(this, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2://L802CA670
|
||||
if(func_8028E80C(3) == 0.0f){
|
||||
this->velocity[2] = 1.0f;
|
||||
func_80328A84(this, 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3://L802CA6AC
|
||||
this->velocity[2] -= time_getDelta();
|
||||
if(this->velocity[2] <= 0.0f){
|
||||
this->unk10_12 = 1;
|
||||
func_80328A84(this, 0);
|
||||
}
|
||||
break;
|
||||
}//L802CA6F8
|
||||
}
|
||||
|
||||
bool chtrainers_802CA708(Actor *this){
|
||||
return this->unk10_12 && ability_isUnlocked(ABILITY_11_TURBO_TALON);
|
||||
}
|
||||
|
||||
f32 chtrainers_802CA748(Actor *this){
|
||||
return this->velocity[0];
|
||||
}
|
||||
|
||||
void chtrainers_802CA750(Actor *this){
|
||||
func_80328A84(this, 1);
|
||||
this->velocity[2] = 1.0f;
|
||||
this->unk10_12 = 0;
|
||||
}
|
105
src/core2/ch/wadingboots.c
Normal file
105
src/core2/ch/wadingboots.c
Normal file
@@ -0,0 +1,105 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
Actor *chwadingboots_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
|
||||
void chwadingboots_update(Actor *this);
|
||||
|
||||
/* .data */
|
||||
extern ActorAnimationInfo D_80367A00[];
|
||||
extern ActorInfo D_80367A20 = {
|
||||
MARKER_11_WADING_BOOTS, ACTOR_65_WADING_BOOTS, ASSET_366_MODEL_WADING_BOOTS,
|
||||
0x0, D_80367A00,
|
||||
chwadingboots_update, func_80326224, chwadingboots_draw,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
Actor *chwadingboots_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
|
||||
Actor *this = marker_getActor(marker);
|
||||
|
||||
if(!this->unk10_12) return this;
|
||||
|
||||
return func_80325888(marker, gfx, mtx, vtx);
|
||||
}
|
||||
|
||||
void chwadingboots_update(Actor *this){
|
||||
s32 sp2C = levelSpecificFlags_get(0x1a);
|
||||
if(sp2C && this->unkF4_8 != 1){
|
||||
return;
|
||||
}
|
||||
|
||||
if(!this->initialized){
|
||||
this->initialized = TRUE;
|
||||
this->velocity[0] = this->yaw;
|
||||
this->unk10_12 = !func_803203FC(0x1f) && !func_803203FC(0x1);
|
||||
func_80328A84(this, 0);
|
||||
}
|
||||
|
||||
if(!func_803203FC(0x10) && ability_isUnlocked(ABILITY_E_WADING_BOOTS)){
|
||||
func_803204E4(0x10, TRUE);
|
||||
}
|
||||
|
||||
switch(this->state){
|
||||
case 0://L802D6C60
|
||||
if(ability_isUnlocked(ABILITY_E_WADING_BOOTS))
|
||||
actor_setOpacity(this, 0xff);
|
||||
else
|
||||
actor_setOpacity(this, 0x87);
|
||||
|
||||
if(actor_animationIsAt(this, 0.25f)){
|
||||
if(sp2C){
|
||||
FUNC_8030E624(SFX_3F2_UNKNOWN, 1.4f, 23000);
|
||||
}
|
||||
else{
|
||||
FUNC_8030E8B4(SFX_3F2_UNKNOWN, 1.4f, 23000, this->position, 600, 1500);
|
||||
}
|
||||
}
|
||||
|
||||
if(func_803203FC(0x10)) break;
|
||||
if(!func_80329530(this, 0xfa)) break;
|
||||
if(player_getTransformation() != TRANSFORM_1_BANJO) break;
|
||||
|
||||
if(func_80311480(0xda5, 0, NULL, NULL, NULL, NULL)){
|
||||
func_803204E4(0x10, TRUE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1://L802D6D34
|
||||
this->velocity[1] -= time_getDelta();
|
||||
if(this->velocity[1] <= 0.0f){
|
||||
func_80328A84(this, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2://L802D6D74
|
||||
if(func_8028E80C(2) == 0.0f){
|
||||
this->velocity[1] = 1.5f;
|
||||
func_80328A84(this, 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3://L802D6DB0
|
||||
this->velocity[1] -= time_getDelta();
|
||||
if(this->velocity[1] <= 0.0f){
|
||||
this->unk10_12 = 1;
|
||||
func_80328A84(this, 0);
|
||||
}
|
||||
break;
|
||||
}//L802D6DFC
|
||||
}
|
||||
|
||||
bool chwadingboots_802D6E0C(Actor *this){
|
||||
return this->unk10_12 && ability_isUnlocked(ABILITY_E_WADING_BOOTS);
|
||||
}
|
||||
|
||||
f32 chwadingboots_802D6E4C(Actor *this){
|
||||
return this->velocity[0];
|
||||
}
|
||||
|
||||
void chwadingboots_802D6E54(Actor *this){
|
||||
func_80328A84(this, 1);
|
||||
this->velocity[1] = 1.5f;
|
||||
this->unk10_12 = 0;
|
||||
}
|
129
src/core2/ch/whipcrack.c
Normal file
129
src/core2/ch/whipcrack.c
Normal file
@@ -0,0 +1,129 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
void chwhipcrack_update(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo D_80373100 = {
|
||||
0x1c5, ACTOR_30F_WHIPCRACK, ASSET_4FD_MODEL_WHIPCRACK,
|
||||
0, NULL,
|
||||
chwhipcrack_update, NULL, func_80325888,
|
||||
0, 0, 0.0f, 0
|
||||
};
|
||||
|
||||
s32 D_80373124[3] = {0xA0, 0x6B, 0x23};
|
||||
|
||||
/* .code */
|
||||
void __chwhipcrack_spawnPieces(Actor *this, enum asset_e model_id, s32 cnt){
|
||||
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
|
||||
|
||||
particleEmitter_setParticleAccelerationRange(pCtrl,
|
||||
0.0f, -1000.0f, 0.0f,
|
||||
0.0f, -1000.0f, 0.0f
|
||||
);
|
||||
func_802EF9F8(pCtrl, 0.7f);
|
||||
func_802EFA18(pCtrl, 3);
|
||||
func_802EFA20(pCtrl, 0.5f, 1.0f);
|
||||
func_802EF9EC(pCtrl, 0x1f, 10000);
|
||||
particleEmitter_setModel(pCtrl, model_id);
|
||||
particleEmitter_setParticleSpawnPositionRange(pCtrl,
|
||||
-120.0f, 50.0f, -120.0f,
|
||||
120.0f, 300.0f, 120.0f
|
||||
);
|
||||
particleEmitter_setPosition(pCtrl, this->position);
|
||||
func_802EFB70(pCtrl, 0.5f, 1.0f);
|
||||
func_802EFE24(pCtrl,
|
||||
-500.0f, -500.0f, -500.0f,
|
||||
500.0f, 500.0f, 500.0f
|
||||
);
|
||||
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
|
||||
func_802EFEC0(pCtrl, 4.0f, 4.0f);
|
||||
particleEmitter_setParticleVelocityRange(pCtrl,
|
||||
-300.0f, 250.0f, -300.0f,
|
||||
300.0f, 400.0f, 300.0f
|
||||
);
|
||||
particleEmitter_emitN(pCtrl, cnt);
|
||||
}
|
||||
|
||||
void __chwhipcrack_spawnSmoke(Actor *this, s32 cnt){
|
||||
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
|
||||
particleEmitter_setSprite(pCtrl, ASSET_70E_SPRITE_SMOKE_2);
|
||||
func_802EFA5C(pCtrl, 0.05f, 0.1f);
|
||||
particleEmitter_setStartingFrameRange(pCtrl, 0, 7);
|
||||
particleEmitter_setPosition(pCtrl, this->position);
|
||||
func_802EFB70(pCtrl, 3.0f, 3.5f);
|
||||
func_802EFB84(pCtrl, 4.5f, 5.5f);
|
||||
particleEmitter_setParticleSpawnPositionRange(pCtrl,
|
||||
-50.0f, 50.0f, -50.0f,
|
||||
50.0f, 200.0f, 50.0f
|
||||
);
|
||||
particleEmitter_setParticleVelocityRange(pCtrl,
|
||||
-30.0f, 150.0f, -30.0f,
|
||||
30.0f, 300.0f, 30.0f
|
||||
);
|
||||
func_802EFFA8(pCtrl, D_80373124);
|
||||
func_802EFEC0(pCtrl, 3.0f, 4.0f);
|
||||
particleEmitter_emitN(pCtrl, cnt);
|
||||
}
|
||||
|
||||
void __chwhipcrack_setState(Actor *this, s32 next_state){
|
||||
if(next_state == 1)
|
||||
func_80335924(this->unk148, ASSET_22A_ANIM_WHIPCRACK_IDLE, 0.5f, 1.0f);
|
||||
|
||||
if(next_state == 2)
|
||||
func_80335924(this->unk148, ASSET_229_ANIM_WHIPCRACK_ATTACK, 0.5f, 1.0f);
|
||||
|
||||
if(next_state == 3){
|
||||
__chwhipcrack_spawnPieces(this, ASSET_4FE_MODEL_WHIPCRACK_PART_1, 4);
|
||||
__chwhipcrack_spawnPieces(this, ASSET_4FF_MODEL_WHIPCRACK_PART_2, 4);
|
||||
__chwhipcrack_spawnPieces(this, ASSET_500_MODEL_WHIPCRACK_PART_3, 4);
|
||||
__chwhipcrack_spawnSmoke(this, 6);
|
||||
FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 0.8f, 32200, this->position, 500, 2500);
|
||||
marker_despawn(this->marker);
|
||||
}
|
||||
|
||||
this->state = next_state;
|
||||
}
|
||||
|
||||
void __chwhipcrack_die(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
Actor *this = marker_getActor(this_marker);
|
||||
__chwhipcrack_setState(this, 3);
|
||||
}
|
||||
|
||||
void chwhipcrack_update(Actor *this){
|
||||
f32 plyr_pos[3];
|
||||
f32 plyr_dist;
|
||||
f32 sp44;
|
||||
f32 sp40;
|
||||
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = TRUE;
|
||||
this->roll = this->yaw;
|
||||
this->yaw = 0.0f;
|
||||
marker_setCollisionScripts(this->marker, NULL, NULL, __chwhipcrack_die);
|
||||
__chwhipcrack_setState(this, 1);
|
||||
}
|
||||
player_getPosition(plyr_pos);
|
||||
plyr_dist = ml_vec3f_distance(plyr_pos, this->position);
|
||||
if(this->state == 1){
|
||||
if(plyr_dist < 700.0f){
|
||||
__chwhipcrack_setState(this, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if(this->state == 2){
|
||||
func_8033568C(this->unk148, &sp44, &sp40);
|
||||
if((sp44 < 0.13) && (0.13 <= sp40)){
|
||||
func_8030E878(SFX_69_WHIPCRACK_CREAKING, randf2(1.05f, 1.1f), 15000, this->position, 500.0f, 1000.0f);
|
||||
}
|
||||
|
||||
if((sp44 < 0.8) && (0.8 <= sp40)){
|
||||
func_8030E878(SFX_2_CLAW_SWIPE, randf2(0.9f, 1.1f), randi2(28000, 32000), this->position, 500.0f, 1000.0f);
|
||||
}
|
||||
|
||||
if(800.0f < plyr_dist){
|
||||
__chwhipcrack_setState(this, 1);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user