The first commit

This commit is contained in:
Banjo Kazooie
2022-07-15 17:09:41 -05:00
commit dd13d34074
1087 changed files with 391897 additions and 0 deletions

40
src/fight/code_0.c Normal file
View File

@@ -0,0 +1,40 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "prop.h"
extern ActorInfo D_80366F68;
extern ActorInfo D_80391500;
extern ActorInfo D_80391840;
extern ActorInfo D_80391864;
extern ActorInfo D_80391888;
extern ActorInfo D_803918AC;
extern ActorInfo D_80391990;
extern ActorInfo D_80391A10;
extern ActorInfo D_80391A40;
extern ActorInfo D_80391AD0;
extern ActorInfo D_80391B00;
extern ActorInfo D_80391B24;
extern ActorInfo D_80391DC0;
extern ActorInfo D_80392018;
extern ActorInfo D_80392090;
void func_803863F0(void)
{
spawnableActorList_add(&D_80391B00, actor_new, 0X108444);
spawnableActorList_add(&D_80391DC0, actor_new, 0X108444);
spawnableActorList_add(&D_80391500, actor_new, 0X300468);
spawnableActorList_add(&D_80391840, actor_new, 0X8464);
spawnableActorList_add(&D_80391864, actor_new, 0X8464);
spawnableActorList_add(&D_80391888, actor_new, 0X8464);
spawnableActorList_add(&D_803918AC, actor_new, 0X8464);
spawnableActorList_add(&D_80391A10, actor_new, 0X20004);
spawnableActorList_add(&D_80391990, actor_new, 0X800100C);
spawnableActorList_add(&D_80391A40, actor_new, 0X8009404);
spawnableActorList_add(&D_80391B24, actor_new, 0X108444);
spawnableActorList_add(&D_80391AD0, actor_new, 0X101404);
spawnableActorList_add(&D_80366F68, actor_new, 0X100404);
spawnableActorList_add(&D_80392018, actor_new, 0X9464);
spawnableActorList_add(&D_80392090, actor_new, 0X100404);
}

2409
src/fight/code_180.c Normal file

File diff suppressed because it is too large Load Diff

405
src/fight/code_5ED0.c Normal file
View File

@@ -0,0 +1,405 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8024C5CC(f32 (*)[3]);
extern void func_80328B8C(Actor *, s32, f32, s32);
extern void func_80386654(f32 arg0, f32 (*arg1)[4], f32 (*arg2)[4]);
extern void func_80324CFC(f32, enum comusic_e, s32);
extern void func_80387470(Actor *, f32 [3], f32, f32, f32, f32, f32);
extern void func_80329904(ActorMarker*, s32, f32*);
void func_8038C840(Actor *this);
void func_8038D014(Actor *this);
/* .data */
ActorAnimationInfo D_80391810[] = {
{0, 0.0f},
{0x264, 1000000.0f},
{0x264, 2.26f},
{0x130, 1.75f},
{0x131, 2.13333f},
{0x262, 2.0f}
};
ActorInfo D_80391840 = {
0x27B, 0x3A5, 0x3BC, 0x1, D_80391810,
func_8038C840, func_8038D014, func_80325888,
0, 0, 1.0f, 0
};
ActorInfo D_80391864 = {
0x27C, 0x3A6, 0x3C2, 0x1, D_80391810,
func_8038C840, func_8038D014, func_80325888,
0, 0, 1.0f, 0
};
ActorInfo D_80391888 = {
0x27D, 0x3A7, 0x3C1, 0x1, D_80391810,
func_8038C840, func_8038D014, func_80325888,
0, 0, 1.0f, 0
};
ActorInfo D_803918AC = {
0x27E, 0x3A8, 0x3BB, 0x1, D_80391810,
func_8038C840, func_8038D014, func_80325888,
0, 0, 1.0f, 0
};
struct43s D_803918D0 = {
{ {-420.0f, 410.0f, -420.0f}, {480.0f, 860.0f, 480.0f}},
{{0.0f, -1200.0f, 0.0f}, {0.0f, -1200.0f, 0.0f}},
{{0.0f, -20.0f, 0.0f}, {0.0f, 20.0f, 0.0f}}
};
struct42s D_80391918 = {
{ {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}},
{ {-80.0f, -80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}}
};
f32 D_80391948[4] = {1.0f, 1.0f, 1.0f, 1.0f};
f32 D_80391958[4] = {0.33f, 0.33f, 0.33f, 1.0f};
struct31s D_80391968 = {
{0.1f, 0.1f}, {10.0f, 10.0f}, {0.0f, 0.01f}, {0.8f, 0.8f}, 0.1f, 0.1f
};
/* .code */
void func_8038C2C0(f32 position[3], s32 count, enum asset_e id, f32 arg3){
ParticleEmitter * temp_s0 = partEmitList_pushNew(count);
f32 sp24;
particleEmitter_setSprite(temp_s0, id);
particleEmitter_setStartingFrameRange(temp_s0, 1, 6);
particleEmitter_setPosition(temp_s0, position);
func_802EFE24(temp_s0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
func_802EFB70(temp_s0, arg3*0.35, arg3*0.65);
func_802EFB84(temp_s0, 0.0f, 0.0f);
func_802EF9F8(temp_s0, 0.5f);
func_802EFA18(temp_s0, 3);
particleEmitter_setSpawnIntervalRange(temp_s0, 0.0f, 0.01f);
func_802EFEC0(temp_s0, 3.0f, 3.3f);
func_802EFA5C(temp_s0, 0.0f, 0.35f);
particleEmitter_setPositionVelocityAndAccelerationRanges(temp_s0, &D_803918D0);
func_802EFA70(temp_s0, 4);
particleEmitter_emitN(temp_s0, count);
}
void func_8038C424(f32 position[3], s32 count, enum asset_e id, f32 arg3){
ParticleEmitter * temp_s0 = partEmitList_pushNew(count);
f32 sp24;
particleEmitter_setSprite(temp_s0, id);
particleEmitter_setStartingFrameRange(temp_s0, 0, 9);
particleEmitter_setParticleFramerateRange(temp_s0, 12.0f, 12.0f);
particleEmitter_setPosition(temp_s0, position);
particleEmitter_setPositionAndVelocityRanges(temp_s0, &D_80391918);
sp24 = arg3 * 5.0;
func_802EFB70(temp_s0, sp24, sp24);
func_802EFB84(temp_s0, sp24, sp24);
particleEmitter_setSpawnIntervalRange(temp_s0, 0.0f, 0.0f);
func_802EFEC0(temp_s0, (arg3*0.5), (arg3*0.5)*1.5);
func_802EFA5C(temp_s0, 0.7f, 0.8f);
func_802EFA70(temp_s0, 0x10);
particleEmitter_emitN(temp_s0, count);
}
void func_8038C588(void){
func_80386654(1.0f, &D_80391958, &D_80391948);
}
void func_8038C5BC(void){
func_80386654(1.0f, &D_80391948, &D_80391958);
}
void func_8038C5F0(Actor *this, enum asset_e arg1, enum asset_e arg2, f32 arg3){
f32 sp1C[3];
func_8038C0DC(&sp1C);
func_8038C2C0(this->position, 0x20, arg1, arg3);
func_8038C424(this->position, 4, arg2, arg3);
timedFunc_set_0(0.0f, func_8038C588);
timedFunc_set_0(0.3f, func_8038C5BC);
}
void func_8038C674(Actor *this){
s32 a1;
s32 a2;
switch(this->marker->unk14_20){
default:
a1 = ASSET_718_SPRITE_SPARKLE_WHITE_2;
a2 = ASSET_6C2_SPRITE_SMOKE_WHITE;
break;
case 0x27b:
a1 = ASSET_71B_SPRITE_SPARKLE_ORANGE_2;
a2 = ASSET_6C5_SPRITE_SMOKE_ORANGE;
break;
case 0x27c:
a1 = ASSET_719_SPRITE_SPARKLE_GREEN_2;
a2 = ASSET_6C3_SPRITE_SMOKE_GREEN;
break;
case 0x27d:
a1 = ASSET_71A_SPRITE_SPARKLE_PINK_2;
a2 = ASSET_6C6_SPRITE_SMOKE_PINK;
break;
case 0x27e:
a1 = ASSET_717_SPRITE_SPARKLE_YELLOW_2;
a2 = ASSET_6C4_SPRITE_SMOKE_YELLOW;
break;
}
func_8038C5F0(this, a1, a2, 1.0f);
}
void func_8038C6FC(Actor *this, s16 arg1){
f32 temp_f2 = this->yaw;
f32 tick = time_getDelta();
temp_f2 -= (tick*arg1)/45.0;
if(360.0f <= temp_f2){
temp_f2 -= 360.0f;
}
else{
if(temp_f2 < 0.0f)
temp_f2 += 360.0f;
}
this->yaw = temp_f2;
}
void func_8038C79C(Actor *this){
int i;
for(i = 0; i < 4; i++){
if(randf() < 0.3){
func_8033E73C(this->marker, i + 5, func_80329904);
func_8033E3F0(8, this->marker->unk14_21);
}
}
}
void func_8038C840(Actor *this){
f32 sp74 = time_getDelta();
f32 sp68[3];
f32 sp5C[3];
f32 sp50[3];
f32 sp4C;
int sp48;
s32 sp44;
s16 sp42;
s16 sp40;
if(!this->unk16C_4){
this->unk16C_4 = 1;
func_80324CFC(0.0f, SFX_JINJO_STATUE_POWERUP, 32000);
func_80324D2C(this->unk60 + 2.26, SFX_JINJO_STATUE_POWERUP);
}//L8038C8A4
func_8028E964(sp68);
func_80257F18(this->position, sp68, &sp4C);
sp40 = (this->yaw * 182.04444);
sp42 = sp40 - (s16)(sp4C*182.04444);
switch(this->state){
case 1: //8038C92C
animctrl_setAnimTimer(this->animctrl, 0.0f);
if(this->unk60 < 0.0)
func_80328B8C(this, 2, 0.001f, 1);
else//L8038C974
this->unk60 -= sp74;
break;
case 2: // 8038C980
if(actor_animationIsAt(this, 0.44f))
func_8030E878(SFX_105_EYRIE_YAWN, randf2(0.95f, 1.05f), 32000, this->position, 1000.0f, 5000.0f);
if(actor_animationIsAt(this, 0.999f)){
func_80328B8C(this, 3, 0.001f, 1);
func_8030E878(0x3ee, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f);
}
break;
case 3: // 8038CA48
case 4: // 8038CA48
sp48 = (this->state == 3);
if(!sp48 || 0.1 < animctrl_getAnimTimer(this->animctrl)){//L8038CA7C
player_getVelocity(&sp5C);
sp5C[0] *= sp74 * 6.0f;
sp5C[1] *= sp74 * 6.0f;
sp5C[2] *= sp74 * 6.0f;
sp5C[0] = sp5C[0] + sp68[0];
sp5C[1] = sp5C[1] + sp68[1];
sp5C[2] = sp5C[2] + sp68[2];
sp5C[0] -= this->position_x;
sp5C[1] -= this->position_y;
sp5C[2] -= this->position_z;
sp5C[0] *= sp74*3.0f;
sp5C[1] *= sp74*3.0f;
sp5C[2] *= sp74*3.0f;
this->position_x = sp5C[0] + this->position_x;
this->position_y = sp5C[1] + this->position_y;
this->position_z = sp5C[2] + this->position_z;
if(sp48 || animctrl_getAnimTimer(this->animctrl) < 0.8)
func_8038C79C(this);
}//L8038CB9C
if(sp48){
if(animctrl_getAnimTimer(this->animctrl) < 0.2){
func_8038C6FC(this, sp42);
}
if(actor_animationIsAt(this, 0.1f)){
this->unk44_31 = func_8030ED2C(0x18, 3);
func_8030E2C4(this->unk44_31);
func_8025A6EC(COMUSIC_43_ENTER_LEVEL_GLITTER, 0x7fff);
FUNC_8030E8B4(SFX_C7_SHWOOP, 0.8f, 32750, this->position, 300, 2000);
}//L8038CC2C
if(actor_animationIsAt(this, 0.434f)){
FUNC_8030E8B4(SFX_C7_SHWOOP, 0.9f, 32750, this->position, 300, 2000);
}//L8038CC58
if(actor_animationIsAt(this, 0.811f)){
FUNC_8030E8B4(SFX_C7_SHWOOP, 1.0f, 32750, this->position, 300, 2000);
}
}
else{//L8038CC8C
if(actor_animationIsAt(this, 0.214f)){
FUNC_8030E8B4(SFX_C7_SHWOOP, 1.1f, 32750, this->position, 300, 2000);
}//L8038CCB0
if(actor_animationIsAt(this, 0.55f)){
FUNC_8030E8B4(SFX_53_BANJO_HUIII, 1.5f, 32750, this->position, 300, 2000);
}//L8038CCDC
if(actor_animationIsAt(this, 0.85f)){
if(func_8030E3FC(this->unk44_31))
func_8030E394(this->unk44_31);
func_8030E484(SFX_19_BANJO_LANDING_08);
func_8025A7DC(0x43);
}//L8038CD20
}
if(sp48){
if(actor_animationIsAt(this, 0.96f)){
func_80328B8C(this, 4, 0.0f, -1);
actor_playAnimationOnce(this);
}
}
else{//L8038CD68
if(actor_animationIsAt(this, 0.9f)){
animctrl_setSmoothTransition(this->animctrl, FALSE);
func_80328B8C(this, 5, 0.001f, 1);
FUNC_8030E8B4(SFX_135_CARTOONY_SPRING, 1.0f, 32000, this->position, 10000, 16000);
func_80324D54(0.1f, SFX_C1_BUZZBOMB_ATTACK, 0.85f, 32000, this->position, 5000.0f, 12000.0f);
func_8034A174(this->marker->unk44, 0x1f, this->position);
this->velocity_x = (this->position_x - this->unk1C[0])/ sp74;
this->velocity_y = (this->position_y - this->unk1C[1])/ sp74;
this->velocity_z = (this->position_z - this->unk1C[2])/ sp74;
}
else{//L8038CE50
func_8034A174(this->marker->unk44, 0x1f, this->unk1C);
}
}
break;
case 5: // 8038CE68
func_8038C0DC(&sp50);
sp50[1] += 100.0f;
func_80387470(this, sp50, 1200.0f, 3840.0f, 200.0f, 2500.0f, 70.0f);
func_8038C79C(this);
break;
}//L8038CEC8
}
void func_8038CED8(f32 arg0[3], s32 arg1, f32 arg2, f32 arg3){
ParticleEmitter *s0 = partEmitList_pushNew(1);
f32 sp40[3];
f32 sp34[3];
func_8024C5CC(&sp40);
sp34[0] = sp40[0] - arg0[0];
sp34[1] = sp40[1] - arg0[1];
sp34[2] = sp40[2] - arg0[2];
ml_vec3f_set_length(sp34, 20.0f);
particleEmitter_setModel(s0, arg1);
particleEmitter_setPosition(s0, arg0);
particleEmitter_setParticleVelocityRange(s0, sp34[0], sp34[1], sp34[2], sp34[0], sp34[1], sp34[2]);
D_80391968.unk20 = arg3;
D_80391968.unk0[0] *= arg2;
D_80391968.unk24 = arg3;
D_80391968.unk0[1] *= arg2;
D_80391968.unk8[0] *= arg2;
D_80391968.unk8[1] *= arg2;
func_802EFB98(s0, &D_80391968);
func_802EFA70(s0, 0x10);
func_802EFA78(s0, 1);
particleEmitter_emitN(s0, 1);
}
void func_8038D014(Actor *this){
s32 temp_a1;
if(!this->unk16C_4){
this->unk16C_4 = 1;
this->marker->propPtr->unk8_3 = 0;
actor_collisionOff(this);
this->alpha_124_19 = 0x7d;
actor_setOpacity(this, this->alpha_124_19);
this->scale = (f64)this->scale + this->scale;
func_80328B8C(this, 5, 0.001f, 1);
func_80343DEC(this);
}//L8038D0B8
if(!func_8038C298()){
this->unk58_0 = 0;
}else{//L8038D0DC
this->unk58_0 = 1;
func_80343DEC(this);
if(this->state == 5){
if(this->marker->unk14_21)
func_8038C79C(this);
if(0.98 < this->unk48){
func_8030E6A4(0x3ee, randf2(1.0f, 1.15f), 32000);
timed_playSfx(0.1f, 0x416, 0.6f, 32000);
marker_despawn(this->marker);
switch (this->marker->unk14_20)
{
case 0x27b:
temp_a1 = 0x557;
break;
case 0x27c:
temp_a1 = 0x558;
break;
case 0x27d:
temp_a1 = 0x559;
break;
case 0x27e:
temp_a1 = 0x556;
break;
default:
temp_a1 = 0x556;
break;
}
func_8038CED8(this->position, temp_a1, 1.0f, 0.1f);
func_802BB3DC(0, 12.0f, 0.4f);
}
}
}//L8038D200
}
void func_8038D214(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
func_8038C674(actor);
FUNC_8030E8B4(SFX_1B_EXPLOSION_1, 1.0f, 32000, actor->position, 1000, 6500);
marker_despawn(actor->marker);
}
f32 func_8038D268(void){
return 2.26f;
}

171
src/fight/code_6E90.c Normal file
View File

@@ -0,0 +1,171 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
u8 unk0;
}ActorLocal_fight_6E90;
void func_8038D568(Actor *this);
/* .data */
ActorInfo D_80391990 = {
0x27A, 0x3A2, 0x543, 0x1, NULL,
func_8038D568, func_80326224, func_80325888,
0, 0x800, 0.0f, 0
};
s32 D_803919B4[3] = {0xC8, 0xC8, 0xA0};
struct31s D_803919C0 = {
{1.0f, 1.0f},
{1.7f, 2.7f},
{0.0f, 0.05f},
{2.6f, 3.4f},
0.0f, 0.1f
};
/* .code */
void func_8038D280(ActorMarker *arg0) {
Actor *sp1C = marker_getActor(arg0);
Actor *temp_v0 = spawn_child_actor(0x3A1, &sp1C);
temp_v0->unkF4_8 = sp1C->unkF4_8;
temp_v0->position_y = temp_v0->position_y + 172.0f;
sp1C->unk100 = temp_v0->marker;
}
void func_8038D2EC(f32 arg0[3], s32 arg1) {
ParticleEmitter *temp_v0 = partEmitList_pushNew(arg1);
particleEmitter_setSprite(temp_v0, ASSET_70E_SPRITE_SMOKE_2);
func_802EFFA8(temp_v0, D_803919B4);
particleEmitter_setStartingFrameRange(temp_v0, 0, 7);
particleEmitter_setPosition(temp_v0, arg0);
particleEmitter_setParticleSpawnPositionRange(temp_v0, -90.0f, 0.0f, -80.0f, 80.0f, 60.0f, 80.0f);
particleEmitter_setParticleVelocityRange(temp_v0, -170.0f, 0.0f, -170.0f, 170.0f, 100.0f, 170.0f);
func_802EFB98(temp_v0, &D_803919C0);
particleEmitter_emitN(temp_v0, arg1);
}
void func_8038D3DC(Actor* this, s32 arg1, f32 arg2, f32 arg3, f32 arg4){
s32 tmp = func_8034C2C4(this->marker, arg1);
if(tmp){
func_8034DE60(tmp, arg2, arg3, arg4, 1);
}
}
void func_8038D428(ActorMarker *arg0, ActorMarker *arg1) {
Actor *temp_v0;
Actor *s0;
temp_v0 = marker_getActor(arg0);
if (temp_v0->state != 3) {
func_8025A70C(COMUSIC_2B_DING_B);
temp_v0->unk38_31++;
if (temp_v0->unk38_31 >= 3) {
func_80328A84(temp_v0, 3);
func_8038DE98(temp_v0->unk100);
func_8038D3DC(temp_v0, 0x19A, -100.0f, 0.0f, 1.2f);
func_80324D54(1.2f, SFX_90_SWITCH_PRESS, 1.0f, 32000, temp_v0->position, 1000.0f, 2000.0f);
}
}
}
void func_8038D510(Actor *arg0) {
ActorLocal_fight_6E90 *sp18 = (ActorLocal_fight_6E90 *)&arg0->local;
if ((u8)arg0->unk44_31 != 0) {
func_8030DA44(arg0->unk44_31);
arg0->unk44_31 = 0;
}
if (sp18->unk0 != 0) {
func_8030DA44(sp18->unk0);
sp18->unk0 = 0;
}
}
void func_8038D568(Actor *this){
ActorLocal_fight_6E90 *local = (ActorLocal_fight_6E90 *)&this->local;
f32 sp48 = time_getDelta();
u32 sp44 = func_8023DB5C() & 0xF;
Actor *other; //sp40
f32 sp3C;
f32 sp30[3];
this->unkF4_29 = 0;
func_80330B1C(this->marker);
if(!this->unk16C_4){
this->unk16C_4 = 1;
marker_setCollisionScripts(this->marker, NULL, func_8038D428, NULL);
func_803300D8(this->marker, func_8038D510);
this->marker->propPtr->unk8_3 = 1;
actor_collisionOn(this);
this->unk38_31 = 0;
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, 0x3f9);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 32000);
local->unk0 = func_8030D90C();
sfxsource_setSfxId(local->unk0, 0x405);
func_8030DD14(local->unk0, 2);
func_8030DBB4(local->unk0, 0.7f);
sfxsource_setSampleRate(local->unk0, 12000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.6f, 20000);
func_8038D3DC(this, 0x19a, 0.0f, -200.0f, 0.0f);
TUPLE_COPY(this->unk1C, this->position);
this->position_y = -400.0f;
if(0.0f != this->unk60)
this->velocity_y = 400.0f/this->unk60;
else
this->velocity_y = 100.0f;
func_802BB3DC(0, 8.0f, 0.92f);
func_802C3F04((GenMethod_4)func_802C4140, 0x3ad, *(s32*)&this->unk1C[0], *(s32*)&this->unk1C[1], *(s32*)&this->unk1C[2]);
func_8038D2EC(this->unk1C, 0x10);
func_802C3C88((GenMethod_1)func_8038D280, reinterpret_cast(s32, this->marker));
}
else{//L8038D774
if(this->state == 1){
other = marker_getActor(this->unk100);
sp3C = this->velocity_y * sp48;
if(this->position_y + sp3C < this->unk1C[1]){
if(!func_8031FF1C(0xd2) || this->unkF4_8 == 1){
func_8030E2C4(this->unk44_31);
func_8030E2C4(local->unk0);
}
sp30[0] = (sp44 & 1) ? 3.0f : -3.0f;
sp30[1] = sp3C;
sp30[2] = (sp44 & 2) ? 3.0f : -3.0f;
this->position_x = this->unk1C[0];
this->position_z = this->unk1C[2];
this->position_x = sp30[0] + this->position_x;
this->position_y = sp30[1] + this->position_y;
this->position_z = sp30[2] + this->position_z;
other->position_x = this->unk1C[0];
other->position_z = this->unk1C[2];
other->position_x = sp30[0] + other->position_x;
other->position_y = sp30[1] + other->position_y;
other->position_z = sp30[2] + other->position_z;
}
else{//L8038D8E0
func_80328A84(this, 2);
func_8030DA44(this->unk44_31);
this->unk44_31 = 0;
func_8030DA44(local->unk0);
local->unk0 = 0;
TUPLE_COPY(this->position, this->unk1C);
TUPLE_COPY(other->position, this->unk1C);
other->position_y += 172.0f;
}
}
}//L8038D954
}

134
src/fight/code_7580.c Normal file
View File

@@ -0,0 +1,134 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern Actor *func_80326EEC();
extern void func_80328B8C(Actor*, s32, f32, s32);
extern f32 func_8038D268(void);
void func_8038DA04(Actor *);
/* .data */
ActorAnimationInfo D_803919F0[] ={
{0, 0.0f},
{0x265, 1e+8f},
{0x265, 1e+8f},
{0x265, 1e+8f},
};
ActorInfo D_80391A10 = { 0x276, 0x3A1, 0x545, 0x1, D_803919F0, func_8038DA04, func_80326224, func_80325888, 0, 0x800, 1.0f, 0};
/* .code */
void func_8038D970(ActorMarker *arg0) {
Actor *temp_v0;
Actor *phi_v0;
temp_v0 = marker_getActor(arg0);
if (temp_v0->unkF4_8 == 5) {
phi_v0 = spawn_child_actor(0x3AC, &temp_v0);
} else {
phi_v0 = spawn_child_actor((temp_v0->unkF4_8) + 0x3A4, &temp_v0);
}
phi_v0->unkF4_8 = temp_v0->unkF4_8;
phi_v0->unk60 = temp_v0->unk1C[0];
phi_v0->scale = temp_v0->scale;
}
void func_8038DA04(Actor *this) {
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
if (this->unkF4_8 == 5) {
this->marker->unk40_23 = TRUE;
this->marker->unk40_20 = TRUE;
this->unk1C[0] = 6.0f;
this->scale *= 4.0;
} else {
this->unk1C[0] = 2.0f;
this->scale *= 1.8;
}
}
switch (this->state) {
case 1:
animctrl_setAnimTimer(this->animctrl, 0.0f);
break;
case 2:
if (this->unkF4_8 != 5) {
if (actor_animationIsAt(this, 0.001f)) {
FUNC_8030E8B4(SFX_D_EGGSHELL_BREAKING, 1.2f, 25000, this->position, 1000, 5000);
func_8030E878(SFX_80_YUMYUM_CLACK, randf2(0.6f, 0.8f), 20000, this->position, 1000.0f, 5000.0f);
}
if( actor_animationIsAt(this, 0.26f)
|| actor_animationIsAt(this, 0.43f)
|| actor_animationIsAt(this, 0.55f)
|| actor_animationIsAt(this, 0.62f)
|| actor_animationIsAt(this, 0.77f)
) {
func_8030E878(SFX_80_YUMYUM_CLACK, randf2(0.6f, 0.8f), 20000, this->position, 1000.0f, 5000.0f);
}
} else {
if (actor_animationIsAt(this, 0.001f)) {
FUNC_8030E8B4(SFX_D_EGGSHELL_BREAKING, 1.2f, 25000, this->position, 1000, 5000);
func_8030E878(SFX_80_YUMYUM_CLACK, randf2(0.4f, 0.6f), 20000, this->position, 1000.0f, 5000.0f);
}
if( actor_animationIsAt(this, 0.26f)
|| actor_animationIsAt(this, 0.43f)
|| actor_animationIsAt(this, 0.55f)
|| actor_animationIsAt(this, 0.62f)
|| actor_animationIsAt(this, 0.77f)
) {
func_8030E878(SFX_80_YUMYUM_CLACK, randf2(0.4f, 0.6f), 20000, this->position, 1000.0f, 5000.0f);
}
if( actor_animationIsAt(this, 0.1f)
|| actor_animationIsAt(this, 0.23f)
|| actor_animationIsAt(this, 0.34f)
|| actor_animationIsAt(this, 0.45f)
|| actor_animationIsAt(this, 0.55f)
|| actor_animationIsAt(this, 0.65f)
|| actor_animationIsAt(this, 0.78f)
|| actor_animationIsAt(this, 0.83f)
|| actor_animationIsAt(this, 0.9f)
|| actor_animationIsAt(this, 0.98f)
) {
func_8030E6A4(SFX_3_DULL_CANNON_SHOT, randf2(1.2f, 1.4f), 0x4E20);
}
}
if (actor_animationIsAt(this, 0.999f) != 0) {
func_80328B8C(this, 3, 0.99999f, 1);
actor_playAnimationOnce(this);
func_80326310(this);
}
break;
}
}
void func_8038DE98(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
s32 sp38;
f32 sp34;
f32 sp30;
f32 sp24[3];
if(actor->state != 2){
func_80328B8C(actor, 2, 0.0f, 1);
actor_playAnimationOnce(actor);
animctrl_setDuration(actor->animctrl, actor->unk1C[0]);
func_802C3C88((GenMethod_1)func_8038D970, reinterpret_cast(s32, actor->marker));
if(!func_8031FF1C(0xD1) && actor->unkF4_8 != 5){
sp38 = 0x30 + actor->unkF4_8*2;
sp34 = func_8038D268();
sp30 = actor->unk1C[0] + sp34;
func_8038C0DC(&sp24);
func_8028F94C(2, &sp24);
func_8038C27C(1);
timed_setCameraToNode(0 * sp30, sp38);
func_80324E88(1 * sp30);
timed_setCameraToNode(1 * sp30, sp38 + 1);
}
}//L8038DF8C
}
f32 func_8038DFA0(void) {
return func_80326EEC(0x3A1)->unk1C_x;
}

206
src/fight/code_7BE0.c Normal file
View File

@@ -0,0 +1,206 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
u8 unk0[4];
}ActorLocal_fight_7BE0;
void func_8038E2FC(Actor *);
/* .data */
ActorInfo D_80391A40 = {
0x27F, 0x3A9, 0x544, 0x1, NULL,
func_8038E2FC, func_80326224, func_80325888,
0, 0x800, 0.0f, 0
};
s32 D_80391A64[3] = {0xC8, 0xC8, 0xA0};
struct31s D_80391A70 = {
{1.0f, 1.0f},
{1.7f, 2.7f},
{0.0f, 0.05f},
{2.6f, 3.4f},
0.0f, 0.1f
};
struct42s D_80391A98 = {
{ {-170.0f, 0.0f, -170.0f}, {170.0f, 100.0f, 170.0f}},
{ {-90.0f, 0.0f, -80.0f},
{80.0f, 60.0f, 80.0f}
}
};
/* .code */
void func_8038DFD0(ActorMarker *arg0) {
Actor *sp1C;
Actor *temp_v0;
sp1C = marker_getActor(arg0);
temp_v0 = spawn_child_actor(0x3A1, &sp1C);
temp_v0->unkF4_8 = sp1C->unkF4_8;
temp_v0->position_y = temp_v0->position_y + 155.0f;
sp1C->unk100 = temp_v0->marker;
}
void func_8038E03C(f32 arg0[3], u32 arg1) {
ParticleEmitter *temp_v0 = partEmitList_pushNew(arg1);
particleEmitter_setSprite(temp_v0, ASSET_70E_SPRITE_SMOKE_2);
func_802EFFA8(temp_v0, D_80391A64);
particleEmitter_setStartingFrameRange(temp_v0, 0, 7);
particleEmitter_setPosition(temp_v0, arg0);
particleEmitter_setPositionAndVelocityRanges(temp_v0, &D_80391A98);
func_802EFB98(temp_v0, &D_80391A70);
particleEmitter_emitN(temp_v0, arg1);
}
void func_8038E0D4(Actor *arg0, s32 arg1, f32 arg2, f32 arg3, f32 arg4) {
s32 temp_v0 = func_8034C2C4(arg0->marker, arg1);
if (temp_v0) {
func_8034DE60(temp_v0, arg2, arg3, arg4, 1);
}
}
void func_8038E120(ActorMarker * marker, ActorMarker *arg1){
Actor *actor = marker_getActor(marker);
ActorLocal_fight_7BE0 * local = (ActorLocal_fight_7BE0 *)&actor->local;
int indx;
s32 remaining;
f32 pad;
indx = marker->unk40_31 - 1;
if(actor->state != 3){
if(local->unk0[indx]){
local->unk0[indx]--;
func_8025A70C(COMUSIC_2B_DING_B);
if(local->unk0[indx] <= 0){
func_8038E0D4(actor, indx + 0x19a, -100.0f, 0.0f, 1.2f);
func_80324D54(1.2f, SFX_90_SWITCH_PRESS, 1.0f, 32000, actor->position, 1000.0f, 2000.0f);
}
}//L8038E210
remaining = local->unk0[0] + local->unk0[1] + local->unk0[2] + local->unk0[3];
if( remaining <= 0){
func_8038C148();
func_80328A84(actor, 3);
func_8038DE98(actor->unk100);
}
}//L8038E24C
}
void func_8038E260(ActorMarker *arg0) {
Actor *sp24 = marker_getActor(arg0);
func_802BB3DC(0, 18.0f, 0.92f);
func_802C3F04((GenMethod_4) func_802C4140, 0x3AD, *(u32 *)(&sp24->unk1C_x), *(u32 *)(&sp24->unk1C_y), *(u32 *)(&sp24->unk1C_z));
func_8038E03C(sp24->unk1C, 0x10);
}
void func_8038E2CC(ActorMarker *arg0) {
func_8032BB88(marker_getActor(arg0), -1, 0x7FFF);
}
void func_8038E2FC(Actor *this){
ActorLocal_fight_7BE0 *local = (ActorLocal_fight_7BE0 *)&this->local;
f32 sp58 = time_getDelta();
s32 temp_s1 = func_8023DB5C() & 0xf;
s32 temp_s0;
int i;
Actor *other;
f32 temp_f20;
f32 sp38[3];
func_80330B1C(this->marker);
if(!this->unk16C_4){
this->unk16C_4 = 1;
marker_setCollisionScripts(this->marker, NULL, func_8038E120, NULL);
this->marker->propPtr->unk8_3 = 1;
actor_collisionOn(this);
for(i = 0; i < 4; i++){
local->unk0[i] = 5;
func_8038E0D4(this, 0x19a + i, 0.0f, -300.0f, 0.0f);
}
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, 0x3f9);
func_8030DD14(this->unk44_31, 3);
func_8030DBB4(this->unk44_31, 1.0f);
sfxsource_setSampleRate(this->unk44_31, 26000);
func_8030E2C4(this->unk44_31);
temp_s0 = func_802F9AA8(0x3EC);
func_802F9DB8(temp_s0, 0.5f, 0.5f, 0.0f);
func_802F9EC4(temp_s0, this->position, 5000, 15000);
func_802F9FD0(temp_s0, 0.25f, this->unk60 - 1.0, 1);
func_802FA060(temp_s0, 17000, 17000, 0.0f);
func_8025A6EC(JINGLE_MENACING_GRUNTILDA_A, 15000);
func_8032BB88(this, 0, 0x7fff);
timedFunc_set_1(8.0f, (TFQM1)func_8038E2CC, (s32)this->marker);
this->unk1C[0] = this->position_x;
this->unk1C[1] = this->position_y;
this->unk1C[2] = this->position_z;
this->position_y = -600.0f;
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.6f, 25000);
if(0.0f != this->unk60){
this->velocity_y = 600.0f/this->unk60;
}else{
this->velocity_y = 100.0f;
}
timedFunc_set_1(this->unk60* 0.05, (TFQM1)func_8038E260, (s32)this->marker);
timedFunc_set_1(this->unk60* 0.28, (TFQM1) func_8038E260, (s32)this->marker);
timedFunc_set_1(this->unk60* 0.46, (TFQM1) func_8038E260, (s32)this->marker);
timedFunc_set_1(this->unk60* 0.58, (TFQM1) func_8038E260, (s32)this->marker);
func_802C3C88((GenMethod_1)func_8038DFD0, reinterpret_cast(s32,this->marker));
}
else{//L8038E5CC
if(this->state == 1){
other = marker_getActor(this->unk100);
temp_f20 = this->velocity_y * sp58;
if(this->position_y + temp_f20 < this->unk1C[1]){
if(!func_8030E3FC(this->unk44_31)){
func_8030E2C4(this->unk44_31);
}
sp38[0] = (temp_s1 & 1) ? 3.0f : -3.0f;
sp38[1] = temp_f20;
sp38[2] = (temp_s1 & 2) ? 3.0f : -3.0f;
this->position_x = this->unk1C[0];
this->position_z = this->unk1C[2];
this->position_x = sp38[0] + this->position_x;
this->position_y = sp38[1] + this->position_y;
this->position_z = sp38[2] + this->position_z;
other->position_x = this->unk1C[0];
other->position_z = this->unk1C[2];
other->position_x = sp38[0] + other->position_x;
other->position_y = sp38[1] + other->position_y;
other->position_z = sp38[2] + other->position_z;
}
else{//L8038E6FC
func_80328A84(this, 2);
FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 32000);
func_8030E394(this->unk44_31);
func_8030DA44(this->unk44_31);
this->unk44_31 = 0;
this->position_x = this->unk1C[0];
this->position_y = this->unk1C[1];
this->position_z = this->unk1C[2];
other->position_x = this->unk1C[0];
other->position_y = this->unk1C[1];
other->position_z = this->unk1C[2];
other->position_y += 155.0f;
}
}
}//L8038E768
}

134
src/fight/code_8390.c Normal file
View File

@@ -0,0 +1,134 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern ActorMarker *func_8038A4E8(Actor*, f32);
void func_80386654(f32 arg0, f32 (*arg1)[4], f32 (*arg2)[4]);
typedef struct {
s32 unk0;
u8 unk4;
u8 unk5;
u8 unk6;
u8 unk7;
u8 unk8;
u8 unk9;
u8 unkA;
u8 unkB;
u8 unkC;
u8 unkD;
u8 unkE;
u8 unkF;
u8 unk10;
} ActorLocal_fight_8390;
void func_8038E844(Actor *this);
/* .data */
ActorInfo D_80391AD0 = {
0x284, 0x3AB, 0x546, 0x1, NULL,
func_8038E844, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
/* .code */
void func_8038E780(ActorMarker *arg0, ActorMarker *arg1) {
Actor *sp1C;
ActorLocal_fight_8390 *sp18;
sp1C = marker_getActor(arg0);
sp18 = (ActorLocal_fight_8390 *) &sp1C->local;
sp18->unk0 = 0xFF;
sp18->unk4 = 0;
if (func_8030E3FC(sp18->unk10) == 0) {
func_8030E2C4(sp18->unk10);
}
if (func_8030E3FC(sp1C->unk44_31) == 0) {
func_8030E2C4(sp1C->unk44_31);
}
}
void func_8038E7EC(Actor *arg0) {
ActorLocal_fight_8390 *temp_v0 = (ActorLocal_fight_8390 *)&arg0->local;
if ((u8)arg0->unk44_31) {
func_8030DA44(arg0->unk44_31);
arg0->unk44_31 = 0;
}
if (temp_v0->unk10 != 0) {
func_8030DA44(temp_v0->unk10);
temp_v0->unk10 = (u8)0;
}
}
void func_8038E844(Actor *this){
ActorLocal_fight_8390 *local = (ActorLocal_fight_8390 *)&this->local;
f32 sp38 = time_getDelta();
ActorMarker *temp_v0;
if(!this->unk16C_4){
this->unk16C_4 = 1;
marker_setCollisionScripts(this->marker, NULL, func_8038E780, NULL);
func_803300D8(this->marker, func_8038E7EC);
this->marker->propPtr->unk8_3 = 0;
actor_collisionOn(this);
local->unk0 = 0;
local->unk4 = 1;
this->unk124_9 = 0;
this->scale = 0.0f;
this->unk44_31 = func_8030ED2C(SFX_142_GRUNTY_LAUGH_3, 3);
func_8030DB04(this->unk44_31, 32000, this->position, 4000.0f, 12000.0f);
func_8030DBB4(this->unk44_31, 1.0f);
local->unk10 = func_8030ED2C(0x415, 3);
func_8030DB04(local->unk10, 32000, this->position, 4000.0f, 12000.0f);
func_8030DBB4(local->unk10, 1.0f);
FUNC_8030E8B4(SFX_416, 0.8f, 32000, this->position, 10000, 25000);
}//L8038E97C
temp_v0 = func_8038A4E8(this, 600.0f);
if(temp_v0){
if(temp_v0->unk14_20 == 0x285){
marker_despawn(this->marker);
func_8038C100();
return;
}
else{
local->unk0 = 0;
local->unk4 = 1;
actor_setOpacity(this, 0);
this->unk58_0 = 0;
this->unk60 = 2.0f;
}
} //L8038E9F4
if(this->state == 1){
this->yaw += 30.0f*sp38;
if(this->scale < 1.0){
this->scale = MIN(1.0, this->scale + ((f64)sp38 + (f64)sp38));
}//L8038EA68
if(0.0 < this->unk60){
this->unk58_0 = 0;
this->unk60 -= sp38;
}
else{ //L8038EAA4
this->unk58_0 = 1;
if(local->unk4){
local->unk0 = MIN(0x64, local->unk0 + (s32)(60.0f*sp38));
if(local->unk0 >= 0x64){
local->unk0 = 0x64;
local->unk4 = 0;
}
}
else{//L8038EB20
local->unk0 = MAX(0, local->unk0 - (s32)(60.0f*sp38));
if(local->unk0 <= 0){
local->unk0 = 0;
local->unk4 = 1;
this->unk60 = 0.25f;
}
}//L8038EB74
actor_setOpacity(this, local->unk0);
}
}
//L8038EB80
}

410
src/fight/code_87A0.c Normal file
View File

@@ -0,0 +1,410 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_80324CFC(f32, s32, s32);
extern void func_80386654(f32 arg0, f32 arg1[4], f32 arg2[4]);
extern void func_8038E03C(f32*, u32);
extern Actor *func_80325CAC(ActorMarker*, Gfx**, Mtx**, Vtx **);
bool func_80320C94(f32 [3], f32[3], f32, f32[3], s32, u32);
f32 func_8033229C(ActorMarker *);
void func_8038CED8(f32 [3], s32, f32, f32);
void func_8038C5F0(Actor *, s32, s32, f32);
typedef struct {
f32 unk0;
}ActorLocal_fight_87A0;
void func_8038F620(Actor *this);
/* .data */
ActorInfo D_80391B00 = {
0x25C, 0x389, 0x541, 0x1, NULL,
func_8038F620, func_80326224, func_80325888,
0, 0, 1.0f, 0
};
ActorInfo D_80391B24 = {
0x280, 0x3AA, 0x6C9, 0x1, NULL,
func_8038F620, func_80326224, func_80325CAC,
0, 0, 1.0f, 0
};
s32 D_80391B48[3] = {0xBA, 0xBA, 0xBA};
struct42s D_80391B54 = {
{ {-70.0f, 50.0f, -70.0f}, {70.0f, 100.0f, 70.0f}},
{ {-55.0f, 0.0f, -55.0f}, {55.0f, 20.0f, 55.0f}}
};
f32 D_80391B84[4] = {1.0f, 1.0f, 1.0f, 1.0f};
f32 D_80391B94[4] = {0.3f, 0.3f, 0.3f, 1.0f};
s32 D_80391BA4[2] = {1, 9};
f32 D_80391BAC[4] = {4.5f, 4.5f, 4.5f, 4.5f};
f32 D_80391BBC[4] = {0.0f, 0.0f, 1.0f, 1.0f};
f32 D_80391BCC[4] = {0.0f, 0.0f, 0.85f, 1.35f};
f32 D_80391BDC[2] = {0.6f, 0.7f};
f32 D_80391BE4[6] = {-130.0f, 0.0f, -130.0f, 130.0f, 0.0f, 130.0f};
f32 D_80391BFC[4] = {1.1f, 1.1f, 4.0f, 5.4f};
f32 D_80391C0C[6] = {-20.0f, 0.0f, -20.0f, 20.0f, 40.0f, 20.0f};
f32 D_80391C24[6] = {0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f};
f32 D_80391C3C[6] = {-420.0f, 410.0f, -420.0f, 480.0f, 860.0f, 480.0f};
f32 D_80391C54[4] = {0.35f, 0.65f, 0.0f, 0.0f};
f32 D_80391C64[4] = {0.0f, 0.01f, 2.0f, 2.3f};
f32 D_80391C74[2] = {0.0f, 0.35f};
f32 D_80391C7C[6] = {0.0f, 50.0f, 0.0f, 0.0f, 50.0f, 0.0f};
f32 D_80391C94[4] = {0.0f, 0.0f, 0.0f, 0.0f};
f32 D_80391CA4[4] = {0.0f, 0.0f, 0.0f, 0.0f};
f32 D_80391CB4[2] = {0.0f, 0.0f};
f32 D_80391CBC[4] = {0.0f, 0.0f, 0.2f, 0.25f};
f32 D_80391DCC[2] = {2.3f, 2.5f};
f32 D_80391DD4[6] = {0.0f, 0.0f, 0.34f, 0.34f, 0.7f, 0.8f};
s32 D_80391CEC[2] = {2, 0xf};
f32 D_80391CF4[4] = {2.0f, 2.0f, 0.4f, 0.4f};
f32 D_80391D04[4] = {0.0f, 0.0f, 0.24f, 0.24f};
f32 D_80391D14[2] = {0.1f, 0.2f};
f32 D_80391D1C[4] = {0.0f, 0.0f, 0.44f, 0.44f};
f32 D_80391D2C[2] = {0.4f, 0.5f};
f32 D_80391D34[6] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
f32 D_80391D4C[6] = {-50.0f, -50.0f, -50.0f, 50.0f, 50.0f, 50.0f};
f32 D_80391D64[6] = {0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f};
f32 D_80391D7C[6] = {-260.0f, -260.0f, -260.0f, 260.0f, 260.0f, 260.0f};
f32 D_80391D94[4] = {0.15f, 0.3f, 0.0f, 0.0f};
f32 D_80391DA4[4] = {0.0f, 0.01f, 0.7f, 0.8f};
f32 D_80391DB4[2] = {0.0f, 0.65f};
/* .bss */
u8 pad[0x180]; //TODO!!!! define other file .bss sections
u8 D_803928E0;
u8 D_803928E1;
u8 D_803928E2;
u8 D_803928E3;
u8 D_803928E4;
u8 D_803928E5;
f32 D_803928E8[3];
f32 D_803928F8[3];
f32 D_80392908[3];
extern f32 D_80392914;
/* .code */
void func_8038EB90(ActorMarker *arg0, f32 *arg1) {
Actor *temp_v0;
temp_v0 = marker_getActor(arg0);
temp_v0->position_x = arg1[0];
temp_v0->position_y = arg1[1];
temp_v0->position_z = arg1[2];
temp_v0->position_y = temp_v0->position_y + 210.0f;
}
void func_8038EBE0(f32 arg0[3], u32 arg1, enum asset_e arg2, f32 arg3[6], f32 arg4[6], f32 arg5[6], f32 arg6[4], f32 arg7[4], f32 arg8[2]) {
ParticleEmitter *temp_v0 = partEmitList_pushNew(arg1);
particleEmitter_setSprite(temp_v0, arg2);
particleEmitter_setStartingFrameRange(temp_v0, 1, 6);
particleEmitter_setPosition(temp_v0, arg0);
particleEmitter_setParticleSpawnPositionRange(temp_v0, arg3[0], arg3[1], arg3[2], arg3[3], arg3[4], arg3[5]);
particleEmitter_setParticleAccelerationRange(temp_v0, arg4[0], arg4[1], arg4[2], arg4[3], arg4[4], arg4[5]);
particleEmitter_setParticleVelocityRange(temp_v0, arg5[0], arg5[1], arg5[2], arg5[3], arg5[4], arg5[5]);
func_802EFE24(temp_v0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
func_802EFB70(temp_v0, arg6[0], arg6[1]);
func_802EFB84(temp_v0, arg6[2], arg6[3]);
func_802EF9F8(temp_v0, 0.5f);
func_802EFA18(temp_v0, 3);
particleEmitter_setSpawnIntervalRange(temp_v0, arg7[0], arg7[1]);
func_802EFEC0(temp_v0, arg7[2], arg7[3]);
func_802EFA5C(temp_v0, arg8[0], arg8[1]);
func_802EFA78(temp_v0, 1);
func_802EFA70(temp_v0, 4);
particleEmitter_emitN(temp_v0, arg1);
}
void func_8038ED9C(f32 arg0[3], u32 arg1, s32 arg2, s32 arg3[2], f32 arg4[6], f32 arg5[4], f32 arg6[4], f32 arg7[2]) {
ParticleEmitter *temp_v0 = partEmitList_pushNew(arg2);
particleEmitter_setSprite(temp_v0, arg1);
particleEmitter_setStartingFrameRange(temp_v0, arg3[0], arg3[1]);
particleEmitter_setParticleFramerateRange(temp_v0, 8.0f, 8.0f);
particleEmitter_setPosition(temp_v0, arg0);
particleEmitter_setParticleSpawnPositionRange(temp_v0, arg4[0], arg4[1], arg4[2], arg4[3], arg4[4], arg4[5]);
particleEmitter_setParticleVelocityRange(temp_v0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
func_802EFB70(temp_v0, arg5[0], arg5[1]);
func_802EFB84(temp_v0, arg5[2], arg5[3]);
particleEmitter_setSpawnIntervalRange(temp_v0, arg6[0], arg6[1]);
func_802EFEC0(temp_v0, arg6[2], arg6[3]);
func_802EFA5C(temp_v0, arg7[0], arg7[1]);
func_802EFA70(temp_v0, 0x10);
func_802EFA78(temp_v0, 1);
particleEmitter_emitN(temp_v0, arg2);
}
void func_8038EEFC(f32 arg0[3], u32 arg1, f32 *arg2) {
ParticleEmitter *temp_v0 = partEmitList_pushNew(arg1);
particleEmitter_setSprite(temp_v0, ASSET_70E_SPRITE_SMOKE_2);
func_802EFFA8(temp_v0, D_80391B48);
func_802EF9E4(temp_v0, 0xEB);
particleEmitter_setStartingFrameRange(temp_v0, 0, 7);
particleEmitter_setPosition(temp_v0, arg0);
particleEmitter_setPositionAndVelocityRanges(temp_v0, &D_80391B54);
func_802EFB70(temp_v0, 0.1f, 0.2f);
func_802EFB84(temp_v0, 3.6f, 4.6f);
particleEmitter_setSpawnIntervalRange(temp_v0, arg2[0], arg2[1]);
func_802EFEC0(temp_v0, arg2[2], arg2[3]);
func_802EFA5C(temp_v0, 0.05f, 0.1f);
func_802EFA70(temp_v0, 0x10);
func_802EFA78(temp_v0, 1);
particleEmitter_emitN(temp_v0, arg1);
}
void func_8038F01C(void) {
func_80386654(1.0f, D_80391B94, D_80391B84);
}
void func_8038F050(void) {
func_80386654(1.0f, D_80391B84, D_80391B94);
}
void func_8038F084(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
ActorLocal_fight_87A0 *local = (ActorLocal_fight_87A0 *)&actor->local;
D_803928E8[0] = actor->position_x;
D_803928E8[1] = actor->position_y;
D_803928E8[2] = actor->position_z;
D_803928E8[1] += 120.0f;
if(actor->state != 2){//L8038F39C
FUNC_8030E8B4(SFX_148_GRUNTY_SPELL_LANDING, 1.0f, 32000, actor->position, 1000, 3500);
timedFunc_set_0(0.0f, func_8038F01C);
timedFunc_set_0(0.3f, func_8038F050);
actor->unk58_0 = 0;
actor->scale *= 1.6;
if(actor->marker->unk14_20 != 0x280){
func_8038EBE0(actor->position, 4, ASSET_713_SPRITE_SPARKLE_YELLOW,
D_80391C0C, D_80391C24, D_80391C3C,
D_80391C54, D_80391C64, D_80391C74
);
func_8038EBE0(actor->position, 4, ASSET_715_SPRITE_SPARKLE_RED,
D_80391C0C, D_80391C24, D_80391C3C,
D_80391C54, D_80391C64, D_80391C74
);
func_8038EEFC(actor->position, 3, D_80391BFC);
func_8038ED9C(D_803928E8, ASSET_4A0_SPRITE_EXPLOSION, 1, D_80391BA4, D_80391BE4,
D_80391BAC, D_80391BBC, D_80391BDC
);
D_803928E8[1] -= 50.0f;
func_8038ED9C(D_803928E8, ASSET_6C1_SPRITE_SMOKE, 2, D_80391BA4, D_80391BE4,
D_80391BAC, D_80391BBC, D_80391BDC
);
}
else{//L8038F304
func_8038EBE0(actor->position, 4, ASSET_713_SPRITE_SPARKLE_YELLOW,
D_80391C0C, D_80391C24, D_80391C3C,
D_80391C54, D_80391BCC, D_80391C74
);
func_8038EEFC(actor->position, 3, D_80391BFC);
func_8038CED8(actor->position, 0x558, 0.15f, 0.5f);
actor->position_y += 260.0f;
func_8038C5F0(actor, 0x712, ASSET_6C3_SPRITE_SMOKE_GREEN, 1.6f);
}
local->unk0 = 0.66f;
func_80328A84(actor, 2);
}//L8038F39C
}
void func_8038F3B4(ActorMarker *marker, ActorMarker *other){
if( other->unk14_20 == 0x276
|| other->unk14_20 == 0x27A
|| other->unk14_20 == 0x27F
) return;
func_8038F084(marker);
switch(func_80320424(0x23, 3)){
case 1: //8038F41C
if(!D_803928E0 && func_80311480(randi2(0, 5) + 0x10f2, 0, 0, 0, 0, 0))
D_803928E0 = 1;
break;
case 2: //8038F468
if(!D_803928E1 && func_80311480(randi2(0, 5) + 0x110b, 0, 0, 0, 0, 0))
D_803928E1 = 1;
break;
case 3: //8038F4B4
if(!D_803928E2 && func_80311480(randi2(0, 5) + 0x1122, 0, 0, 0, 0, 0))
D_803928E2 = 1;
break;
case 4: //8038F500
if( !D_803928E3
&& func_8038C2A4()
&& func_80311480(randi2(0, 5) + 0x113b, 0, 0, 0, 0, 0)
)
D_803928E3 = 1;
break;
case 5:
if( !D_803928E4
&& func_8038C2B0()
&& func_80311480(randi2(0, 5) + 0x1154, 0, 0, 0, 0, 0)
)
D_803928E4 = 1;
break;
}//L8038F5B0
}
s32 func_8038F5BC(f32 *arg0, f32 arg1) {
if (((arg0[0] * arg0[0]) + (arg0[2] * arg0[2])) < arg1) {
return 1;
}
return 0;
}
void func_8038F5F8(Actor *arg0) {
func_80324D2C(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER);
}
void func_8038F620(Actor *this){
ActorLocal_fight_87A0 * local = (ActorLocal_fight_87A0 *)&this->local;
f32 sp40 = time_getDelta();
static f32 D_80392914;
if(!this->unk16C_4){
this->unk16C_4 = 1;
marker_setCollisionScripts(this->marker, NULL, NULL, func_8038F3B4);
this->marker->propPtr->unk8_3 = 0;
actor_collisionOn(this);
this->unk60 = 8.0f;
this->scale = 0.1f;
if( this->marker->unk14_20 == 0x280){
actor_collisionOff(this);
func_803300D8(this->marker, func_8038F5F8);
func_80324CFC(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER, 32000);
timed_playSfx(0.0f, SFX_113_PAD_APPEARS, 1.0f, 32000);
timed_playSfx(0.75f, 0x415, 1.0f, 32000);
timed_playSfx(2.0f, 0x415, 1.0f, 32000);
}
else{//L8038F738
func_80324D54(0.26f, SFX_14F_FIREWORK_WHISTLING, 1.0f, 0x61A8,
this->position, 1000.0f, 7500.0f
);
func_80324D54(0.4f, SFX_14E_SOFT_EXPLOSION, 1.0f, 0x61A8,
this->position, 500.0f, 4500.0f
);
}
}//L8038F79C
if(D_803928E5 && this->marker->unk14_20 == 0x280){
func_802BAD08(this->position);
}//L8038F7D4
switch(this->state){
case 1://L8038F7F8
{ // TODO: get rid of f0, maybe D_80392914 is static?
// f32 temp_f0;
D_80392914 = sp40*1.4;
// temp_f0 = this->scale + D_80392914;
this->scale = (this->scale + D_80392914 < 1.0) ? this->scale + D_80392914 : 1.0f;
}
switch(this->marker->unk14_20){
case 0x25C://L8038F8AC
func_8038ED9C(this->position, ASSET_4A0_SPRITE_EXPLOSION, 1,
D_80391CEC, D_80391D34,
D_80391CF4, D_80391D04, D_80391D14
);
break;
case 0x280://L8038F8C8
func_8038ED9C(this->position, ASSET_6C9_SPRITE_SMOKE_GREEN_BIG, 1,
D_80391CEC, D_80391D34,
D_80391CF4, D_80391D1C, D_80391D2C
);
func_8023DB5C();
break;
}//L8038F918
D_803928F8[0] = this->position[0];
D_803928F8[1] = this->position[1];
D_803928F8[2] = this->position[2];
this->position[0] += this->velocity_x*sp40;
this->position[1] += this->velocity_y*sp40;
this->position[2] += this->velocity_z*sp40;
this->velocity[0] += this->unk1C[0]*sp40;
this->velocity[1] += this->unk1C[1]*sp40;
this->velocity[2] += this->unk1C[2]*sp40;
this->pitch += 200.0f*sp40;
this->yaw += 200.0f*sp40;
if( this->position_y < -2500.0f
|| 5000.0f < this->position_y
|| !func_8038F5BC(this->position, 100000000.0f)
){
marker_despawn(this->marker);
}
else{
if(this->position_y < 300.0f
&& func_8038F5BC(this->position, 16000000.0f)
){
if(func_80320C94(D_803928F8, this->position, func_8033229C(this->marker), D_80392908, 8, 0x40000000)){
func_8038F084(this->marker);
return;
}
}
}
// L8038FABC
if( this->marker->unk14_20 != 0x280
&& func_8028F25C()
){
func_8038F084(this->marker);
}
else {
if(0.0 <= this->unk60){
this->unk60 -= sp40;
}else{
func_8038F084(this->marker);
}
}
break;
case 2://L8038FB34
if(local->unk0 < 0.0){
marker_despawn(this->marker);
}else{
local->unk0 -= sp40;
}
break;
}//L8038FB74
}
void func_8038FB84(ActorMarker *arg0, f32 *arg1, f32 *arg2, f32 *arg3) {
Actor *temp_v0 = marker_getActor(arg0);
temp_v0->position_x = arg1[0];
temp_v0->position_y = arg1[1];
temp_v0->position_z = arg1[2];
temp_v0->velocity_x = arg2[0];
temp_v0->velocity_y = arg2[1];
temp_v0->velocity_z = arg2[2];
temp_v0->unk1C_x = arg3[0];
temp_v0->unk1C_y = arg3[1];
temp_v0->unk1C_z = arg3[2];
}
void func_8038FC00(void) {
D_803928E0 = (u8)0;
D_803928E1 = (u8)0;
D_803928E2 = (u8)0;
D_803928E3 = (u8)0;
D_803928E4 = (u8)0;
}
void func_8038FC2C(s32 arg0) {
D_803928E5 = arg0;
}

142
src/fight/code_9850.c Normal file
View File

@@ -0,0 +1,142 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_80386654(f32 arg0, f32 (*arg1)[4], f32 (*arg2)[4]);
extern void func_80387470(Actor *, f32 [3], f32, f32, f32, f32, f32);
extern Actor *func_80325CAC(ActorMarker *, Gfx **, Mtx **, Vtx**);
void func_8038FE94(Actor *this);
Actor *func_8038FC40(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3);
/* .data */
ActorInfo D_80391DC0 = {
0x25D, 0x38A, 0x6C7, 0x1, NULL,
func_8038FE94, func_80326224, func_8038FC40,
0, 0, 1.0f, 0
};
f32 D_80391DE4[4] = {0.6f, 1.0f, 1.0f, 1.0f};
f32 D_80391DF4[4] = {0.3f, 0.3f, 0.3f, 1.0f};
s32 D_80391E04[2] = {1, 9};
f32 D_80391E0C[4] = {4.5f, 4.5f, 4.5f, 4.5f};
f32 D_80391E1C[4] = {0.0f, 0.0f, 0.85f, 1.35f};
f32 D_80391E2C[2] = {0.6f, 0.7f};
f32 D_80391E34[6] = {-130.0f, 0.0f, -130.0f, 130.0f, 0.0f, 130.0f};
f32 D_80391E4C[4] = {1.1f, 1.1f, 4.0f, 5.4f};
f32 D_80391E5C[6] = {-20.0f, 0.0f, -20.0f, 20.0f, 40.0f, 20.0f};
f32 D_80391E74[6] = {0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f};
f32 D_80391E8C[6] = {-420.0f, 410.0f, -420.0f, 480.0f, 860.0f, 480.0f};
f32 D_80391EA4[4] = {0.35f, 0.65f, 0.0f, 0.0f};
f32 D_80391EB4[4] = {0.0f, 0.01f, 2.0f, 2.3f};
f32 D_80391EC4[2] = { 0.0f, 0.35f};
f32 D_80391ECC[6] = {0.0f, 50.0f, 0.0f, 0.0f, 50.0f, 0.0f};
f32 D_80391EE4[6] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
f32 D_80391EFC[6] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
f32 D_80391F14[4] = {0.2f, 0.25f, 2.3f, 2.5f};
f32 D_80391F24[4] = {0.0f, 0.0f, 0.34f, 0.34f};
f32 D_80391F34[2] = {0.7f, 0.8f};
f32 D_80391F3C[6] = { -50.0f, -50.0f, -50.0f, 50.0f, 50.0f, 50.0f};
f32 D_80391F54[6] = { 0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f};
f32 D_80391F6C[6] = { -260.0f, -260.0f, -260.0f, 260.0f, 260.0f, 260.0f};
f32 D_80391F84[4] = {0.15f, 0.3f, 0.0f, 0.0f};
f32 D_80391F94[4] = {0.0f, 0.01f, 0.7f, 0.8f};
f32 D_80391FA4[2] = {0.0f, 0.65f};
/* .code */
Actor *func_8038FC40(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3){
Actor *actor = marker_getActor(marker);
func_80344C2C(1);
return func_80325CAC(marker, gdl, mptr, arg3);
}
void func_8038FC88(void){
func_80386654(1.0f, &D_80391DF4, &D_80391DE4);
}
void func_8038FCBC(void){
func_80386654(1.0f, &D_80391DE4, &D_80391DF4);
}
void func_8038FCF0(ActorMarker *marker, ActorMarker *other_marker){
Actor *actor = marker_getActor(marker);
f32 sp38[3];
sp38[0] = actor->position_x;
sp38[1] = actor->position_y;
sp38[2] = actor->position_z;
sp38[1] += 160.0f;
FUNC_8030E8B4(SFX_1B_EXPLOSION_1, 1.0f, 32000, actor->position, 1000, 3500);
timedFunc_set_0(0.0f, func_8038FC88);
timedFunc_set_0(0.3f, func_8038FCBC);
func_8038EBE0(actor->position, 4, ASSET_710_SPRITE_SPARKLE_PURPLE,
&D_80391E5C, &D_80391E74, &D_80391E8C,
&D_80391EA4, &D_80391EB4, &D_80391EC4
);
func_8038EBE0(actor->position, 4, ASSET_711_SPRITE_SPARKLE_DARK_BLUE,
&D_80391E5C, &D_80391E74, &D_80391E8C,
&D_80391EA4, &D_80391EB4, &D_80391EC4
);
func_8038EEFC(actor->position, 3, &D_80391E4C);
func_8038ED9C(&sp38, 0x6C8, 3,
&D_80391E04, &D_80391E34,
&D_80391E0C, &D_80391E1C, &D_80391E2C
);
marker_despawn(actor->marker);
}
void func_8038FE94(Actor *this){
f32 sp54 = time_getDelta();
f32 sp48[3];
if(!this->unk16C_4){
this->unk16C_4 = 1;
marker_setCollisionScripts(this->marker, NULL, NULL, func_8038FCF0);
this->marker->propPtr->unk8_3 = 0;
actor_collisionOn(this);
this->unk60 = 10.0f;
this->scale = (f64)this->scale + this->scale;
}//L8038FF18
this->roll += 20.0f;
if(func_8023DB5C()%4 == 1){
if(randf() < 0.5){
func_8038EBE0(this->position, 4, ASSET_718_SPRITE_SPARKLE_WHITE_2,
&D_80391F3C, &D_80391F54, &D_80391F6C,
&D_80391F84, &D_80391F94, &D_80391FA4
);
}
else{//L8038FFE0
func_8038EBE0(this->position, 4, ASSET_719_SPRITE_SPARKLE_GREEN_2,
&D_80391F3C, &D_80391F54, &D_80391F6C,
&D_80391F84, &D_80391F94, &D_80391FA4
);
}
}//L80390020
player_getPosition(sp48);
sp48[1] += 50.0f;
func_80387470(this, sp48, this->unk1C[0], this->unk1C[1], 0.0f, 1400.0f, 70.0f);
if(func_8028F25C()){
func_8038FCF0(this->marker, 0);
}
else{
if(0.0 <= this->unk60){
this->unk60 -= sp54;
}
else{
func_8038FCF0(this->marker, 0);
}
}
}
void func_803900DC(ActorMarker *marker, f32 (*arg1)[3], f32 arg2, f32 arg3){
Actor *actor = marker_getActor(marker);
actor->position_x = (*arg1)[0];
actor->position_y = (*arg1)[1];
actor->position_z = (*arg1)[2];
actor->unk1C[0] = arg2;
actor->unk1C[1] = arg3;
}

420
src/fight/code_9D40.c Normal file
View File

@@ -0,0 +1,420 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern f32 func_8038C288(void);
extern void func_80328B8C(Actor *, s32, f32, s32);
extern void func_80324CFC(f32, s32, s32);
extern void func_802F9E44(s32, f32, f32, f32, f32);
extern void func_80387470(Actor *, f32 [3], f32, f32, f32, f32, f32);
extern void func_8038C0DC(f32[3]);
extern void func_8038C5F0(Actor *, enum asset_e, enum asset_e, f32);
typedef struct{
f32 unk0;
f32 unk4;
f32 unk8[3];
f32 unk14;
f32 unk18;
f32 unk1C;
s32 unk20;
s32 unk24;
s32 unk28;
}ActorLocal_fight_9850;
void func_8039049C(Actor *this);
/* .data */
//BBC0
ActorAnimationInfo D_80391FB0[] = {
{0x000, 00000000},
{0x275, 1000000.0f},
{0x275, 3.3f},
{0x276, 0.67f},
{0x277, 1.167f},
{0x27E, 2.5f},
{0x27F, 4.0f},
{0x262, 2.0f},
{0x278, 1.75f},
{0x27B, 2.25f},
{0x27C, 0.33f},
{0x27D, 0.8f},
{0x280, 0.4f}
};
ActorInfo D_80392018 = {
0x285, 0x3AC, 0x551, 0x1, D_80391FB0,
func_8039049C, func_80326224, func_80325888,
0, 0, 1.0f, 0
};
s32 D_8039203C[] = {0xDC, 0x96, 0x82, 0xB4, 0xD2, 0xAA, 0xC8, 0x96, 0xB4};
s32 D_80392060[] = {0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, 0xA0, 0xA1, 0xA2};
/* .bss */
f32 D_80392720;
f32 D_80392724;
f32 D_80392920[3];
/* .code */
void func_80390130(f32 position[3], int count, enum asset_e sprite_id){
ParticleEmitter *s0 = partEmitList_pushNew(count);
particleEmitter_setSprite(s0, sprite_id);
particleEmitter_setStartingFrameRange(s0, 1, 6);
particleEmitter_setPosition(s0, position);
particleEmitter_setParticleAccelerationRange(s0, 0.0f, -200.0f, 0.0f, 0.0f, -200.0f, 0.0f);
particleEmitter_setParticleVelocityRange(s0, -100.0f, -100.0f, -100.0f, 100.0f, 100.0f, 100.0f);
func_802EFB70(s0, 0.5f, 0.65f);
func_802EFB84(s0, 0.0f, 0.0f);
particleEmitter_setSpawnIntervalRange(s0, 0.0f, 0.01f);
func_802EFEC0(s0, 0.65f, 0.85f);
func_802EFA5C(s0, 0.0f, 0.35f);
func_802EFA78(s0, 1);
func_802EFA70(s0, 4);
particleEmitter_emitN(s0, count);
}
void func_80390278(Actor *this){
f32 sp34[3];
int i;
for(i = 0; i < 4; i++){
if(randf() < 0.3){
func_8034A174(this->marker->unk44, i + 5, sp34);
func_80390130(sp34, 1, ASSET_718_SPRITE_SPARKLE_WHITE_2);
}
}
}
void func_80390318(Actor *this, s32 arg1){
s32 sp1C;
s32 sp18;
switch(arg1){
case 1:
case 5:
sp1C = ASSET_71B_SPRITE_SPARKLE_ORANGE_2;
sp18 = ASSET_6C5_SPRITE_SMOKE_ORANGE;
break;
case 2:
case 6:
sp1C = ASSET_719_SPRITE_SPARKLE_GREEN_2;
sp18 = ASSET_6C3_SPRITE_SMOKE_GREEN;
break;
case 3:
case 7:
sp1C = ASSET_71A_SPRITE_SPARKLE_PINK_2;
sp18 = ASSET_6C6_SPRITE_SMOKE_PINK;
break;
case 4:
case 8:
sp1C = ASSET_717_SPRITE_SPARKLE_YELLOW_2;
sp18 = ASSET_6C4_SPRITE_SMOKE_YELLOW;
break;
case 9:
case 10:
sp1C = ASSET_718_SPRITE_SPARKLE_WHITE_2;
sp18 = ASSET_6C2_SPRITE_SMOKE_WHITE;
break;
}
func_8038C5F0(this, sp1C, sp18, 2.0f);
}
void func_803903C4(Actor *this){
animctrl_setSmoothTransition(this->animctrl, FALSE);
func_80328B8C(this, 7, 0.001f, 1);
actor_loopAnimation(this);
}
void func_8039040C(Actor *this){
ActorLocal_fight_9850 *local = (ActorLocal_fight_9850 *)&this->local;
f32 tick = time_getDelta();
local->unk14 = MIN(1.99, local->unk14 + local->unk18*tick);
func_8030DBB4(this->unk44_31, local->unk14);
if(func_8030E3FC(this->unk44_31) == 0)
func_8030E2C4(this->unk44_31);
}
void func_8039049C(Actor *this){
ActorLocal_fight_9850 *local = (ActorLocal_fight_9850 *)&this->local;
f32 sp58;
f32 sp54;
f32 sp50;
s32 sp4C;
f32 sp48;
sp58 = time_getDelta();
sp54 = animctrl_getDuration(this->animctrl);
if(!this->unk16C_4){
this->unk16C_4 = 1;
local->unk18 = 0.40000000000000013 / (this->unk60 + 3.3);
local->unk14 = 0.7f;
func_8025A6EC(JINGLE_MENACING_GRUNTILDA_B, 20000);
func_8025A58C(0, 0x7fff);
this->unk44_31 = func_8030ED2C(SFX_17A_SHIPHORN, 3);
sfxsource_setSampleRate(this->unk44_31, 25000);
func_8030DBB4(this->unk44_31, local->unk14);
func_8030E2C4(this->unk44_31);
local->unk28 = 0xC;
}//L80390574
if(0.0 < local->unk4){
local->unk4 -= sp58;
return;
}
switch(this->state){
case 1: //803905D4
func_8039040C(this);
animctrl_setAnimTimer(this->animctrl, 0.0f);
this->unk60 -= sp58;
if(this->unk60 < 0.0){
func_80328B8C(this, 2, 0.001f, 1);
actor_playAnimationOnce(this);
}
break;
case 2: //80390648
func_8039040C(this);
if(actor_animationIsAt(this, 0.27f))
FUNC_8030E624(SFX_D0_GRIMLET_SQUEAK, 0.7f, 29000);
if(actor_animationIsAt(this, 0.44f)){
FUNC_8030E624(SFX_176_JINJONATOR_JINJOOO_1, 1.0f, 25000);
timed_playSfx(0.66f, SFX_176_JINJONATOR_JINJOOO_1, 0.9f, 25000);
}
if(actor_animationIsAt(this, 0.999f)){
func_80328B8C(this, 3, 0.001f, 1);
actor_playAnimationOnce(this);
func_8030E394(this->unk44_31);
func_8030DA44(this->unk44_31);
this->unk44_31 = 0;
local->unk0 = (320.0f - this->position_y) * 0.5;
func_80324CFC(0.0f, 0x8c, 0x7d00);
}
break;
case 3: //8039073C
func_80390278(this);
if(this->position_y < 320.0f){
this->position_y = MIN(320.0f, this->position_y + local->unk0*sp58);
}//L803907A0
if(320.0f == this->position_y){
func_80328B8C(this, 4, 0.001f, 1);
actor_loopAnimation(this);
local->unk4 = func_8038C288();
}
break;
case 4: //803907D4
func_80390278(this);
func_80328B8C(this, 5, 0.001f, 1);
actor_playAnimationOnce(this);
break;
case 5: //80390804
func_80390278(this);
if(actor_animationIsAt(this, 0.998f)){
animctrl_setSmoothTransition(this->animctrl, FALSE);
func_80328B8C(this, 6, 0.0001f, 1);
actor_loopAnimation(this);
if(this->unk44_31 == 0){
local->unk18 = 0.1f;
local->unk14 = 0.4f;
this->unk44_31 = func_8030ED2C(0x416, 3);
sfxsource_setSampleRate(this->unk44_31, 26000);
func_8030DBB4(this->unk44_31, local->unk14);
func_8030E2C4(this->unk44_31);
}//L803908AC
local->unk1C = 0.5f;
}
break;
case 6: //803908BC
this->position[1] = MIN(1e+8f, this->position[1] + 80.0f*sp58);
animctrl_setDuration(this->animctrl, MAX(0.4, sp54 - (0.5*sp58)));
func_80390278(this);
if(actor_animationIsAt(this, 0.25f) || actor_animationIsAt(this, 0.75f)){
FUNC_8030E624(SFX_2_CLAW_SWIPE, local->unk1C, 26000);
local->unk1C += 0.04;
}//L80390A4C
func_8039040C(this);
if(actor_animationIsAt(this, 0.5f)){
if(--local->unk28 <= 0){
func_803903C4(this);
FUNC_8030E8B4(SFX_135_CARTOONY_SPRING, 1.0f, 32000, this->position, 10000, 16000);
func_80324D54(0.1f, SFX_C1_BUZZBOMB_ATTACK, 0.85f, 32000, this->position, 5000.0f, 12000.0f);
if((u8)this->unk44_31){
func_8030E394(this->unk44_31);
func_8030DA44(this->unk44_31);
this->unk44_31 = 0;
}
func_80324D2C(0.0f, COMUSIC_8C_JINJONATOR_POWERUP);
func_8034A174(this->marker->unk44, 0x1f, this->position);
this->velocity[0] = (this->position[0] - this->unk1C[0]) / sp58;
this->velocity[1] = (this->position[1] - this->unk1C[1]) / sp58;
this->velocity[2] = (this->position[2] - this->unk1C[2]) / sp58;
}
}//L80390B60
else{
func_8034A174(this->marker->unk44, 0x1f, this->unk1C);
}
break;
case 7: //80390B78
sp50 = local->unk24*0.11 + 1.0;
func_80390278(this);
func_8038C0DC(local->unk8);
local->unk8[1] += 100.0f;
func_80387470(this, local->unk8, sp50*2400.0f, sp50*2400.0f*4.2, 170.0f, sp50*2500.0f, 0.0f);
break;
case 8: //80390C48
if(actor_animationIsAt(this, 0.16f) || actor_animationIsAt(this, 0.47f))
FUNC_8030E624(SFX_2_CLAW_SWIPE, 1.0f, 28000);
if(actor_animationIsAt(this, 0.999f)){
func_8034A174(this->marker->unk44, 0x1f, this->position);
func_803903C4(this);
FUNC_8030E8B4(SFX_135_CARTOONY_SPRING, 1.0f, 32000, this->position, 10000, 16000);
func_80324D54(0.1f, SFX_C1_BUZZBOMB_ATTACK, 0.85f, 32000, this->position, 5000.0f, 12000.0f);
this->velocity[2] = 0.0f;
this->velocity[1] = 0.0f;
this->velocity[0] = 0.0f;
}
break;
case 9: //80390D20
if(actor_animationIsAt(this, 0.16f) || actor_animationIsAt(this, 0.47f))
FUNC_8030E624(SFX_2_CLAW_SWIPE, 1.0f, 28000);
if(actor_animationIsAt(this, 0.8f)){
sp4C = func_802F9AA8(SFX_141_MECHANICAL_WINCH);
func_802F9F80(sp4C, 0.0f, 5.92f, 0.0f);
func_802F9E44(sp4C, 0.1f, 5.92f, 0.3f, 1.0f);
func_802FA060(sp4C, 32000, 32000, 0.0f);
}
if(actor_animationIsAt(this, 0.999f)){
func_80328B8C(this, 0xA, 0.001f, 1);
actor_loopAnimation(this);
local->unk20 = 0xE;
}
break;
case 10: //80390E1C
if(actor_animationIsAt(this, 0.999f)){
local->unk20--;
}
if(local->unk20 == 2 && actor_animationIsAt(this, 0.1f)){
FUNC_8030E624(SFX_176_JINJONATOR_JINJOOO_1, 1.0f, 32000);
timed_playSfx(0.66f, SFX_176_JINJONATOR_JINJOOO_1, 0.9f, 32000);
}//L80390E90
if(local->unk20 <= 0){
s32 text_id;
func_80328B8C(this, 0xB, 0.001f, 1);
actor_playAnimationOnce(this);
func_802BB41C(0);
text_id = 0x115e + randi2(0,5);
func_80311480(text_id, 0x20, 0, 0, 0, 0);
}
break;
case 11: //80390EF8
if(actor_animationIsAt(this, 0.999f)){
func_8034A174(this->marker->unk44, 0x1f, this->position);
FUNC_8030E624(SFX_17B_AIRPLANE_FALLING, 1.0f, 32000);
FUNC_8030E624(SFX_147_GRUNTY_SPELL_ATTACK_2, 1.0f, 32000);
animctrl_setSmoothTransition(this->animctrl, 0);
func_80328B8C(this, 0xC, 0.001f, 1);
actor_playAnimationOnce(this);
this->velocity[2] = 0.0f;
this->velocity[1] = 0.0f;
this->velocity[0] = 0.0f;
}
break;
case 12: //80390F7C
sp48 = local->unk24*0.11 + 1.0;
func_80390278(this);
func_8038C0DC(local->unk8);
local->unk8[1] += 100.0f;
func_80387470(this, local->unk8, sp48*2400.0f, sp48*2400.0f*4.2, 170.0f, sp48*2500.0f, 0.0f);
break;
}//L80391044
func_8034A174(this->marker->unk44, 0x1f, D_80392920);
}
void func_80391070(ActorMarker *marker, s32 arg1, s32 arg2) {
Actor *temp_s0;
ActorLocal_fight_9850 *local;
s32 pad;
temp_s0 = marker_getActor(marker);
local = (ActorLocal_fight_9850 *)&temp_s0->local;
func_8025A6EC(D_80392060[arg1-1], 20000);
func_80390318(temp_s0, arg1);
FUNC_8030E8B4(SFX_1B_EXPLOSION_1, 1.0f, 32000, temp_s0->position, 1000, 6500);
temp_s0->velocity[2] = 0.0f;
temp_s0->velocity[1] = 0.0f;
temp_s0->velocity[0] = 0.0f;
temp_s0->yaw = (f32)D_8039203C[arg1-1];
if (arg2 != 0) {
temp_s0->yaw = (f32) (temp_s0->yaw + 180.0f);
}
local->unk24 = arg1;
animctrl_setSmoothTransition(temp_s0->animctrl, 1);
actor_playAnimationOnce(temp_s0);
if (&D_8039203C[arg1] >= D_80392060) {
func_80328B8C(temp_s0, 9, 0.001f, 1);
return;
}
func_80328B8C(temp_s0, 8, 0.001f, 1);
animctrl_setDuration(temp_s0->animctrl, (f32) (1.75 - 0.11 * local->unk24));
}
void func_803911F8(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
func_80390318(actor, 0xa);
marker_despawn(actor->marker);
}
f32 func_80391234(void){
return 3.3f;
}
f32 func_80391240(void){
return 2.0;
}
f32 func_80391250(void){
return 4.62f;
}
s32 func_8039125C(ActorMarker *marker){
u32 state = (u32) (marker_getActor(marker))->state;
if (state == 0x7 || state == 0xC) {
return 1;
}
return 0;
}
void func_8039129C(f32 arg0[3]) {
arg0[0] = D_80392920[0];
arg0[1] = D_80392920[1];
arg0[2] = D_80392920[2];
}

30
src/fight/code_AED0.c Normal file
View File

@@ -0,0 +1,30 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
Actor *func_803912C0(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3);
void func_80391360(Actor *this);
/* .data */
ActorInfo D_80392090 = {
0x288, 0x3AF, 0x3BF, 0x1, NULL,
func_80391360, func_80326224, func_803912C0,
0, 0, 0.0f, 0
};
/* .code */
Actor *func_803912C0(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3){
f32 sp34[3];
f32 sp30;
Actor *sp2C;
sp2C = func_80325300(marker, sp34);
sp30 = sp2C->scale * ml_map_f(sp2C->unk1C[0], 0.0f, 1000.0f, 1.75f, 0.9f);
set_model_render_mode(2);
func_803391A4(gdl, mptr, sp2C->position, sp34, sp30, NULL, func_80330B1C(marker));
return sp2C;
}
void func_80391360(Actor *this){
actor_collisionOff(this);
}