fight documentation

This commit is contained in:
Banjo Kazooie
2022-10-08 22:07:56 -05:00
parent c0b005fa3d
commit cd222d498a
106 changed files with 1120 additions and 880 deletions

View File

@@ -24,25 +24,29 @@ ActorAnimationInfo D_80391810[] = {
};
ActorInfo D_80391840 = {
0x27B, 0x3A5, 0x3BC, 0x1, D_80391810,
MARKER_27B_BOSS_JINJO_ORANGE, ACTOR_3A5_BOSS_JINJO_ORANGE, ASSET_3BC_MODEL_JINJO_ORANGE,
0x1, D_80391810,
func_8038C840, func_8038D014, func_80325888,
0, 0, 1.0f, 0
};
ActorInfo D_80391864 = {
0x27C, 0x3A6, 0x3C2, 0x1, D_80391810,
MARKER_27C_BOSS_JINJO_GREEN, ACTOR_3A6_BOSS_JINJO_GREEN, ASSET_3C2_MODEL_JINJO_GREEN,
0x1, D_80391810,
func_8038C840, func_8038D014, func_80325888,
0, 0, 1.0f, 0
};
ActorInfo D_80391888 = {
0x27D, 0x3A7, 0x3C1, 0x1, D_80391810,
MARKER_27D_BOSS_JINJO_PINK, ACTOR_3A7_BOSS_JINJO_PINK, ASSET_3C1_MODEL_JINJO_PINK,
0x1, D_80391810,
func_8038C840, func_8038D014, func_80325888,
0, 0, 1.0f, 0
};
ActorInfo D_803918AC = {
0x27E, 0x3A8, 0x3BB, 0x1, D_80391810,
MARKER_27E_BOSS_JINJO_YELLOW, ACTOR_3A8_BOSS_JINJO_YELLOW, ASSET_3BB_MODEL_JINJO_YELLOW,
0x1, D_80391810,
func_8038C840, func_8038D014, func_80325888,
0, 0, 1.0f, 0
};
@@ -114,7 +118,7 @@ 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){
void chbossjinjo_spawnParticles(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);
@@ -123,32 +127,32 @@ void func_8038C5F0(Actor *this, enum asset_e arg1, enum asset_e arg2, f32 arg3){
timedFunc_set_0(0.3f, func_8038C5BC);
}
void func_8038C674(Actor *this){
s32 a1;
s32 a2;
void chbossjinjo_spawnAttackParticles(Actor *this){
s32 sparkle_sprite_id;
s32 smoke_sprite_id;
switch(this->marker->unk14_20){
default:
a1 = ASSET_718_SPRITE_SPARKLE_WHITE_2;
a2 = ASSET_6C2_SPRITE_SMOKE_WHITE;
sparkle_sprite_id = ASSET_718_SPRITE_SPARKLE_WHITE_2;
smoke_sprite_id = ASSET_6C2_SPRITE_SMOKE_WHITE;
break;
case 0x27b:
a1 = ASSET_71B_SPRITE_SPARKLE_ORANGE_2;
a2 = ASSET_6C5_SPRITE_SMOKE_ORANGE;
case MARKER_27B_BOSS_JINJO_ORANGE:
sparkle_sprite_id = ASSET_71B_SPRITE_SPARKLE_ORANGE_2;
smoke_sprite_id = ASSET_6C5_SPRITE_SMOKE_ORANGE;
break;
case 0x27c:
a1 = ASSET_719_SPRITE_SPARKLE_GREEN_2;
a2 = ASSET_6C3_SPRITE_SMOKE_GREEN;
case MARKER_27C_BOSS_JINJO_GREEN:
sparkle_sprite_id = ASSET_719_SPRITE_SPARKLE_GREEN_2;
smoke_sprite_id = ASSET_6C3_SPRITE_SMOKE_GREEN;
break;
case 0x27d:
a1 = ASSET_71A_SPRITE_SPARKLE_PINK_2;
a2 = ASSET_6C6_SPRITE_SMOKE_PINK;
case MARKER_27D_BOSS_JINJO_PINK:
sparkle_sprite_id = ASSET_71A_SPRITE_SPARKLE_PINK_2;
smoke_sprite_id = ASSET_6C6_SPRITE_SMOKE_PINK;
break;
case 0x27e:
a1 = ASSET_717_SPRITE_SPARKLE_YELLOW_2;
a2 = ASSET_6C4_SPRITE_SMOKE_YELLOW;
case MARKER_27E_BOSS_JINJO_YELLOW:
sparkle_sprite_id = ASSET_717_SPRITE_SPARKLE_YELLOW_2;
smoke_sprite_id = ASSET_6C4_SPRITE_SMOKE_YELLOW;
break;
}
func_8038C5F0(this, a1, a2, 1.0f);
chbossjinjo_spawnParticles(this, sparkle_sprite_id, smoke_sprite_id, 1.0f);
}
@@ -313,7 +317,7 @@ void func_8038C840(Actor *this){
}//L8038CEC8
}
void func_8038CED8(f32 arg0[3], s32 arg1, f32 arg2, f32 arg3){
void func_8038CED8(f32 arg0[3], enum asset_e model_id, f32 arg2, f32 arg3){
ParticleEmitter *s0 = partEmitList_pushNew(1);
f32 sp40[3];
f32 sp34[3];
@@ -325,7 +329,7 @@ void func_8038CED8(f32 arg0[3], s32 arg1, f32 arg2, f32 arg3){
sp34[2] = sp40[2] - arg0[2];
ml_vec3f_set_length(sp34, 20.0f);
particleEmitter_setModel(s0, arg1);
particleEmitter_setModel(s0, model_id);
particleEmitter_setPosition(s0, arg0);
particleEmitter_setParticleVelocityRange(s0, sp34[0], sp34[1], sp34[2], sp34[0], sp34[1], sp34[2]);
D_80391968.unk20 = arg3;
@@ -369,16 +373,16 @@ void func_8038D014(Actor *this){
marker_despawn(this->marker);
switch (this->marker->unk14_20)
{
case 0x27b:
case MARKER_27B_BOSS_JINJO_ORANGE:
temp_a1 = 0x557;
break;
case 0x27c:
case MARKER_27C_BOSS_JINJO_GREEN:
temp_a1 = 0x558;
break;
case 0x27d:
case MARKER_27D_BOSS_JINJO_PINK:
temp_a1 = 0x559;
break;
case 0x27e:
case MARKER_27E_BOSS_JINJO_YELLOW:
temp_a1 = 0x556;
break;
default:
@@ -393,13 +397,13 @@ void func_8038D014(Actor *this){
}
void func_8038D214(ActorMarker *marker){
void chbossjinjo_attack(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
func_8038C674(actor);
chbossjinjo_spawnAttackParticles(actor);
FUNC_8030E8B4(SFX_1B_EXPLOSION_1, 1.0f, 32000, actor->position, 1000, 6500);
marker_despawn(actor->marker);
}
f32 func_8038D268(void){
f32 chbossjinjo_8038D268(void){
return 2.26f;
}

View File

@@ -10,7 +10,8 @@ void func_8038D568(Actor *this);
/* .data */
ActorInfo D_80391990 = {
0x27A, 0x3A2, 0x543, 0x1, NULL,
MARKER_27A_JINJO_STATUE_BASE, ACTOR_3A2_JINJO_STATUE_BASE, ASSET_543_MODEL_JINJO_STATUE_BASE,
0x1, NULL,
func_8038D568, func_80326224, func_80325888,
0, 0x800, 0.0f, 0
};
@@ -26,9 +27,9 @@ struct31s D_803919C0 = {
};
/* .code */
void func_8038D280(ActorMarker *arg0) {
void chbossjinjobase_spawnStoneJinjo(ActorMarker *arg0) {
Actor *sp1C = marker_getActor(arg0);
Actor *temp_v0 = spawn_child_actor(0x3A1, &sp1C);
Actor *temp_v0 = spawn_child_actor(ACTOR_3A1_STONE_JINJO, &sp1C);
temp_v0->unkF4_8 = sp1C->unkF4_8;
temp_v0->position_y = temp_v0->position_y + 172.0f;
@@ -66,7 +67,7 @@ void func_8038D428(ActorMarker *arg0, ActorMarker *arg1) {
temp_v0->unk38_31++;
if (temp_v0->unk38_31 >= 3) {
func_80328A84(temp_v0, 3);
func_8038DE98(temp_v0->unk100);
chstonejinjo_breakOpen(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);
}
@@ -106,13 +107,13 @@ void func_8038D568(Actor *this){
actor_collisionOn(this);
this->unk38_31 = 0;
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, 0x3f9);
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, 32000);
local->unk0 = func_8030D90C();
sfxsource_setSfxId(local->unk0, 0x405);
sfxsource_setSfxId(local->unk0, SFX_405_UNKNOWN);
func_8030DD14(local->unk0, 2);
func_8030DBB4(local->unk0, 0.7f);
sfxsource_setSampleRate(local->unk0, 12000);
@@ -128,14 +129,14 @@ void func_8038D568(Actor *this){
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));
SPAWNQUEUE_ADD_1(chbossjinjobase_spawnStoneJinjo, 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){
if( !func_8031FF1C(BKPROG_D2_HAS_SPAWNED_A_JINJO_STATUE_IN_FINAL_FIGHT) || this->unkF4_8 == 1){
func_8030E2C4(this->unk44_31);
func_8030E2C4(local->unk0);
}

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

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

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@ 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);
extern void chbossjinjo_spawnParticles(Actor *, enum asset_e, enum asset_e, f32);
typedef struct{
f32 unk0;
@@ -23,7 +23,7 @@ typedef struct{
s32 unk28;
}ActorLocal_fight_9850;
void func_8039049C(Actor *this);
void chjinjonator_update(Actor *this);
/* .data */
@@ -45,13 +45,24 @@ ActorAnimationInfo D_80391FB0[] = {
};
ActorInfo D_80392018 = {
0x285, 0x3AC, 0x551, 0x1, D_80391FB0,
func_8039049C, func_80326224, func_80325888,
MARKER_285_JINJONATOR, ACTOR_3AC_JINJONATOR, ASSET_551_MODEL_JINJONATOR,
0x1, D_80391FB0,
chjinjonator_update, 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};
s32 D_80392060[] = {
COMUSIC_9A_JINJONATOR_HITS_GRUNTY_A,
COMUSIC_9B_JINJONATOR_HITS_GRUNTY_B,
COMUSIC_9C_JINJONATOR_HITS_GRUNTY_C,
COMUSIC_9D_JINJONATOR_HITS_GRUNTY_D,
COMUSIC_9E_JINJONATOR_HITS_GRUNTY_E,
COMUSIC_9F_JINJONATOR_HITS_GRUNTY_F,
COMUSIC_A0_JINJONATOR_HITS_GRUNTY_G,
COMUSIC_A1_JINJONATOR_HITS_GRUNTY_H,
COMUSIC_A2_JINJONATOR_HITS_GRUNTY_I
};
/* .bss */
f32 D_80392720;
@@ -59,7 +70,7 @@ f32 D_80392724;
f32 D_80392920[3];
/* .code */
void func_80390130(f32 position[3], int count, enum asset_e sprite_id){
void chjinjonator_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);
@@ -76,18 +87,18 @@ void func_80390130(f32 position[3], int count, enum asset_e sprite_id){
particleEmitter_emitN(s0, count);
}
void func_80390278(Actor *this){
void chjinjonator_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);
chjinjonator_80390130(sp34, 1, ASSET_718_SPRITE_SPARKLE_WHITE_2);
}
}
}
void func_80390318(Actor *this, s32 arg1){
void chjinjonator_spawnAttackParticles(Actor *this, s32 arg1){
s32 sp1C;
s32 sp18;
@@ -118,16 +129,16 @@ void func_80390318(Actor *this, s32 arg1){
sp18 = ASSET_6C2_SPRITE_SMOKE_WHITE;
break;
}
func_8038C5F0(this, sp1C, sp18, 2.0f);
chbossjinjo_spawnParticles(this, sp1C, sp18, 2.0f);
}
void func_803903C4(Actor *this){
void chjinjonator_803903C4(Actor *this){
animctrl_setSmoothTransition(this->animctrl, FALSE);
func_80328B8C(this, 7, 0.001f, 1);
actor_loopAnimation(this);
}
void func_8039040C(Actor *this){
void chjinjonator_8039040C(Actor *this){
ActorLocal_fight_9850 *local = (ActorLocal_fight_9850 *)&this->local;
f32 tick = time_getDelta();
@@ -137,7 +148,7 @@ void func_8039040C(Actor *this){
func_8030E2C4(this->unk44_31);
}
void func_8039049C(Actor *this){
void chjinjonator_update(Actor *this){
ActorLocal_fight_9850 *local = (ActorLocal_fight_9850 *)&this->local;
f32 sp58;
f32 sp54;
@@ -170,7 +181,7 @@ void func_8039049C(Actor *this){
switch(this->state){
case 1: //803905D4
func_8039040C(this);
chjinjonator_8039040C(this);
animctrl_setAnimTimer(this->animctrl, 0.0f);
this->unk60 -= sp58;
if(this->unk60 < 0.0){
@@ -180,7 +191,7 @@ void func_8039049C(Actor *this){
break;
case 2: //80390648
func_8039040C(this);
chjinjonator_8039040C(this);
if(actor_animationIsAt(this, 0.27f))
FUNC_8030E624(SFX_D0_GRIMLET_SQUEAK, 0.7f, 29000);
@@ -196,12 +207,12 @@ void func_8039049C(Actor *this){
func_8030DA44(this->unk44_31);
this->unk44_31 = 0;
local->unk0 = (320.0f - this->position_y) * 0.5;
func_80324CFC(0.0f, 0x8c, 0x7d00);
func_80324CFC(0.0f, COMUSIC_8C_JINJONATOR_POWERUP, 32000);
}
break;
case 3: //8039073C
func_80390278(this);
chjinjonator_80390278(this);
if(this->position_y < 320.0f){
this->position_y = MIN(320.0f, this->position_y + local->unk0*sp58);
}//L803907A0
@@ -214,13 +225,13 @@ void func_8039049C(Actor *this){
break;
case 4: //803907D4
func_80390278(this);
chjinjonator_80390278(this);
func_80328B8C(this, 5, 0.001f, 1);
actor_playAnimationOnce(this);
break;
case 5: //80390804
func_80390278(this);
chjinjonator_80390278(this);
if(actor_animationIsAt(this, 0.998f)){
animctrl_setSmoothTransition(this->animctrl, FALSE);
func_80328B8C(this, 6, 0.0001f, 1);
@@ -240,27 +251,27 @@ void func_8039049C(Actor *this){
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);
chjinjonator_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);
chjinjonator_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;
chjinjonator_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
@@ -270,7 +281,7 @@ void func_8039049C(Actor *this){
break;
case 7: //80390B78
sp50 = local->unk24*0.11 + 1.0;
func_80390278(this);
chjinjonator_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);
@@ -281,7 +292,7 @@ void func_8039049C(Actor *this){
if(actor_animationIsAt(this, 0.999f)){
func_8034A174(this->marker->unk44, 0x1f, this->position);
func_803903C4(this);
chjinjonator_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;
@@ -346,7 +357,7 @@ void func_8039049C(Actor *this){
break;
case 12: //80390F7C
sp48 = local->unk24*0.11 + 1.0;
func_80390278(this);
chjinjonator_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);
@@ -355,7 +366,7 @@ void func_8039049C(Actor *this){
func_8034A174(this->marker->unk44, 0x1f, D_80392920);
}
void func_80391070(ActorMarker *marker, s32 arg1, s32 arg2) {
void chjinjonator_attack(ActorMarker *marker, s32 hit_count, bool mirrored) {
Actor *temp_s0;
ActorLocal_fight_9850 *local;
s32 pad;
@@ -363,23 +374,23 @@ void func_80391070(ActorMarker *marker, s32 arg1, s32 arg2) {
temp_s0 = marker_getActor(marker);
local = (ActorLocal_fight_9850 *)&temp_s0->local;
func_8025A6EC(D_80392060[arg1-1], 20000);
func_8025A6EC(D_80392060[hit_count-1], 20000);
func_80390318(temp_s0, arg1);
chjinjonator_spawnAttackParticles(temp_s0, hit_count);
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)D_8039203C[hit_count-1];
if (mirrored) {
temp_s0->yaw = (f32) (temp_s0->yaw + 180.0f);
}
local->unk24 = arg1;
local->unk24 = hit_count;
animctrl_setSmoothTransition(temp_s0->animctrl, 1);
actor_playAnimationOnce(temp_s0);
if (&D_8039203C[arg1] >= D_80392060) {
if (&D_8039203C[hit_count] >= D_80392060) {
func_80328B8C(temp_s0, 9, 0.001f, 1);
return;
}
@@ -387,33 +398,33 @@ void func_80391070(ActorMarker *marker, s32 arg1, s32 arg2) {
animctrl_setDuration(temp_s0->animctrl, (f32) (1.75 - 0.11 * local->unk24));
}
void func_803911F8(ActorMarker *marker){
void chjinjonator_finalAttack(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
func_80390318(actor, 0xa);
chjinjonator_spawnAttackParticles(actor, 0xa);
marker_despawn(actor->marker);
}
f32 func_80391234(void){
f32 chjinjonator_80391234(void){
return 3.3f;
}
f32 func_80391240(void){
f32 chjinjonator_80391240(void){
return 2.0;
}
f32 func_80391250(void){
f32 chjinjonator_80391250(void){
return 4.62f;
}
s32 func_8039125C(ActorMarker *marker){
bool chjinjonator_8039125C(ActorMarker *marker){
u32 state = (u32) (marker_getActor(marker))->state;
if (state == 0x7 || state == 0xC) {
return 1;
return TRUE;
}
return 0;
return FALSE;
}
void func_8039129C(f32 arg0[3]) {
void chjinjonator_8039129C(f32 arg0[3]) {
arg0[0] = D_80392920[0];
arg0[1] = D_80392920[1];
arg0[2] = D_80392920[2];

View File

@@ -6,12 +6,13 @@ typedef struct {
u8 unk0[4];
}ActorLocal_fight_7BE0;
void func_8038E2FC(Actor *);
void chjinjonatorbase_update(Actor *);
/* .data */
ActorInfo D_80391A40 = {
0x27F, 0x3A9, 0x544, 0x1, NULL,
func_8038E2FC, func_80326224, func_80325888,
MARKER_27F_JINJONATOR_STATUE_BASE, ACTOR_3A9_JINJONATOR_STATUE_BASE, ASSET_544_MODEL_JINJONATOR_STATUE_BASE,
0x1, NULL,
chjinjonatorbase_update, func_80326224, func_80325888,
0, 0x800, 0.0f, 0
};
@@ -33,15 +34,15 @@ struct42s D_80391A98 = {
};
/* .code */
void func_8038DFD0(ActorMarker *arg0) {
Actor *sp1C;
Actor *temp_v0;
void chjinjonatorbase_spawnStoneJinjo(ActorMarker *marker) {
Actor *this;
Actor *stone_jinjo;
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;
this = marker_getActor(marker);
stone_jinjo = spawn_child_actor(ACTOR_3A1_STONE_JINJO, &this);
stone_jinjo->unkF4_8 = this->unkF4_8;
stone_jinjo->position_y = stone_jinjo->position_y + 155.0f;
this->unk100 = stone_jinjo->marker;
}
void func_8038E03C(f32 arg0[3], u32 arg1) {
@@ -86,7 +87,7 @@ void func_8038E120(ActorMarker * marker, ActorMarker *arg1){
if( remaining <= 0){
func_8038C148();
func_80328A84(actor, 3);
func_8038DE98(actor->unk100);
chstonejinjo_breakOpen(actor->unk100);
}
}//L8038E24C
}
@@ -104,7 +105,7 @@ void func_8038E2CC(ActorMarker *arg0) {
func_8032BB88(marker_getActor(arg0), -1, 0x7FFF);
}
void func_8038E2FC(Actor *this){
void chjinjonatorbase_update(Actor *this){
ActorLocal_fight_7BE0 *local = (ActorLocal_fight_7BE0 *)&this->local;
f32 sp58 = time_getDelta();
s32 temp_s1 = func_8023DB5C() & 0xf;
@@ -138,7 +139,7 @@ void func_8038E2FC(Actor *this){
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);
timedFunc_set_1(8.0f, (GenMethod_1)func_8038E2CC, reinterpret_cast(s32,this->marker));
this->unk1C[0] = this->position_x;
this->unk1C[1] = this->position_y;
this->unk1C[2] = this->position_z;
@@ -149,11 +150,12 @@ void func_8038E2FC(Actor *this){
}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));
timedFunc_set_1(this->unk60* 0.05, (GenMethod_1)func_8038E260, reinterpret_cast(s32,this->marker));
timedFunc_set_1(this->unk60* 0.28, (GenMethod_1) func_8038E260, reinterpret_cast(s32,this->marker));
timedFunc_set_1(this->unk60* 0.46, (GenMethod_1) func_8038E260, reinterpret_cast(s32,this->marker));
timedFunc_set_1(this->unk60* 0.58, (GenMethod_1) func_8038E260, reinterpret_cast(s32,this->marker));
SPAWNQUEUE_ADD_1(chjinjonatorbase_spawnStoneJinjo, this->marker);
}
else{//L8038E5CC
if(this->state == 1){

View File

@@ -3,7 +3,7 @@
#include "variables.h"
extern ActorMarker *func_8038A4E8(Actor*, f32);
extern ActorMarker *chfinalboss_findCollidingJinjo(Actor*, f32);
void func_80386654(f32 arg0, f32 (*arg1)[4], f32 (*arg2)[4]);
typedef struct {
@@ -23,12 +23,13 @@ typedef struct {
u8 unk10;
} ActorLocal_fight_8390;
void func_8038E844(Actor *this);
void chspellbarrier_update(Actor *this);
/* .data */
ActorInfo D_80391AD0 = {
0x284, 0x3AB, 0x546, 0x1, NULL,
func_8038E844, func_80326224, func_80325888,
MARKER_284_GRUNTY_SPELL_BARRIER, ACTOR_3AB_GRUNTY_SPELL_BARRIER, ASSET_546_MODEL_GRUNTY_SPELL_BARRIER,
0x1, NULL,
chspellbarrier_update, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
@@ -50,22 +51,22 @@ void func_8038E780(ActorMarker *arg0, ActorMarker *arg1) {
}
void func_8038E7EC(Actor *arg0) {
ActorLocal_fight_8390 *temp_v0 = (ActorLocal_fight_8390 *)&arg0->local;
ActorLocal_fight_8390 *local = (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;
if (local->unk10 != 0) {
func_8030DA44(local->unk10);
local->unk10 = (u8)0;
}
}
void func_8038E844(Actor *this){
void chspellbarrier_update(Actor *this){
ActorLocal_fight_8390 *local = (ActorLocal_fight_8390 *)&this->local;
f32 sp38 = time_getDelta();
ActorMarker *temp_v0;
ActorMarker *jinjo_marker;
if(!this->unk16C_4){
this->unk16C_4 = 1;
@@ -85,11 +86,11 @@ void func_8038E844(Actor *this){
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){
jinjo_marker = chfinalboss_findCollidingJinjo(this, 600.0f);
if(jinjo_marker){
if(jinjo_marker->unk14_20 == MARKER_285_JINJONATOR){
marker_despawn(this->marker);
func_8038C100();
chfinalboss_spellBarrierInactive();
return;
}
else{

View File

@@ -9,7 +9,7 @@ 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);
void chbossjinjo_spawnParticles(Actor *, s32, s32, f32);
typedef struct {
f32 unk0;
@@ -19,13 +19,15 @@ void func_8038F620(Actor *this);
/* .data */
ActorInfo D_80391B00 = {
0x25C, 0x389, 0x541, 0x1, NULL,
MARKER_25C_GRUNTY_SPELL_FIREBALL, ACTOR_389_GRUNTY_SPELL_FIREBALL, ASSET_541_SPRITE_FIREBALL_SPELL_ATTACK,
0x1, NULL,
func_8038F620, func_80326224, func_80325888,
0, 0, 1.0f, 0
};
ActorInfo D_80391B24 = {
0x280, 0x3AA, 0x6C9, 0x1, NULL,
MARKER_280_GRUNTY_SPELL_GREEN_ATTACK, ACTOR_3AA_GRUNTY_SPELL_GREEN_ATTACK, ASSET_6C9_SPRITE_GREEN_SPELL_ATTACK,
0x1, NULL,
func_8038F620, func_80326224, func_80325CAC,
0, 0, 1.0f, 0
};
@@ -83,10 +85,6 @@ 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) {
@@ -168,6 +166,7 @@ void func_8038F050(void) {
}
void func_8038F084(ActorMarker *marker){
static f32 D_803928E8[3];
Actor *actor = marker_getActor(marker);
ActorLocal_fight_87A0 *local = (ActorLocal_fight_87A0 *)&actor->local;
@@ -183,7 +182,7 @@ void func_8038F084(ActorMarker *marker){
timedFunc_set_0(0.3f, func_8038F050);
actor->unk58_0 = 0;
actor->scale *= 1.6;
if(actor->marker->unk14_20 != 0x280){
if(actor->marker->unk14_20 != MARKER_280_GRUNTY_SPELL_GREEN_ATTACK){
func_8038EBE0(actor->position, 4, ASSET_713_SPRITE_SPARKLE_YELLOW,
D_80391C0C, D_80391C24, D_80391C3C,
D_80391C54, D_80391C64, D_80391C74
@@ -211,7 +210,7 @@ void func_8038F084(ActorMarker *marker){
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);
chbossjinjo_spawnParticles(actor, 0x712, ASSET_6C3_SPRITE_SMOKE_GREEN, 1.6f);
}
local->unk0 = 0.66f;
func_80328A84(actor, 2);
@@ -268,9 +267,12 @@ void func_8038F5F8(Actor *arg0) {
}
void func_8038F620(Actor *this){
static f32 D_803928F8[3];
static f32 D_80392908[3];
static f32 D_80392914;
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;
@@ -279,7 +281,7 @@ void func_8038F620(Actor *this){
actor_collisionOn(this);
this->unk60 = 8.0f;
this->scale = 0.1f;
if( this->marker->unk14_20 == 0x280){
if( this->marker->unk14_20 == MARKER_280_GRUNTY_SPELL_GREEN_ATTACK){
actor_collisionOff(this);
func_803300D8(this->marker, func_8038F5F8);
func_80324CFC(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER, 32000);
@@ -299,29 +301,24 @@ void func_8038F620(Actor *this){
);
}
}//L8038F79C
if(D_803928E5 && this->marker->unk14_20 == 0x280){
if(D_803928E5 && this->marker->unk14_20 == MARKER_280_GRUNTY_SPELL_GREEN_ATTACK){
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;
}
D_80392914 = sp40*1.4;
this->scale = (this->scale + D_80392914 < 1.0) ? this->scale + D_80392914 : 1.0f;
switch(this->marker->unk14_20){
case 0x25C://L8038F8AC
case MARKER_25C_GRUNTY_SPELL_FIREBALL://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,
case MARKER_280_GRUNTY_SPELL_GREEN_ATTACK://L8038F8C8
func_8038ED9C(this->position, ASSET_6C9_SPRITE_GREEN_SPELL_ATTACK, 1,
D_80391CEC, D_80391D34,
D_80391CF4, D_80391D1C, D_80391D2C
);
@@ -360,7 +357,7 @@ void func_8038F620(Actor *this){
}
}
// L8038FABC
if( this->marker->unk14_20 != 0x280
if( this->marker->unk14_20 != MARKER_280_GRUNTY_SPELL_GREEN_ATTACK
&& func_8028F25C()
){
func_8038F084(this->marker);

View File

@@ -1,12 +1,13 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "fight.h"
extern Actor *func_80326EEC();
extern void func_80328B8C(Actor*, s32, f32, s32);
extern f32 func_8038D268(void);
extern f32 chbossjinjo_8038D268(void);
void func_8038DA04(Actor *);
void chstonejinjo_update(Actor *);
/* .data */
ActorAnimationInfo D_803919F0[] ={
@@ -15,31 +16,35 @@ ActorAnimationInfo D_803919F0[] ={
{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};
ActorInfo D_80391A10 = {
MARKER_276_STONE_JINJO, ACTOR_3A1_STONE_JINJO, ASSET_545_MODEL_STONE_JINJO,
0x1, D_803919F0,
chstonejinjo_update, func_80326224, func_80325888,
0, 0x800, 1.0f, 0
};
/* .code */
void func_8038D970(ActorMarker *arg0) {
Actor *temp_v0;
Actor *phi_v0;
void chstonejinjo_spawnJinjo(ActorMarker *marker) {
Actor *this;
Actor *jinjo;
temp_v0 = marker_getActor(arg0);
if (temp_v0->unkF4_8 == 5) {
phi_v0 = spawn_child_actor(0x3AC, &temp_v0);
this = marker_getActor(marker);
if (this->unkF4_8 == BOSSJINJO_JINJONATOR) {
jinjo = spawn_child_actor(ACTOR_3AC_JINJONATOR, &this);
} else {
phi_v0 = spawn_child_actor((temp_v0->unkF4_8) + 0x3A4, &temp_v0);
jinjo = spawn_child_actor((this->unkF4_8) + 0x3A4, &this);
}
phi_v0->unkF4_8 = temp_v0->unkF4_8;
phi_v0->unk60 = temp_v0->unk1C[0];
phi_v0->scale = temp_v0->scale;
jinjo->unkF4_8 = this->unkF4_8;
jinjo->unk60 = this->unk1C[0];
jinjo->scale = this->scale;
}
void func_8038DA04(Actor *this) {
void chstonejinjo_update(Actor *this) {
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
if (this->unkF4_8 == 5) {
if (this->unkF4_8 == BOSSJINJO_JINJONATOR) {
this->marker->unk40_23 = TRUE;
this->marker->unk40_20 = TRUE;
this->unk1C[0] = 6.0f;
@@ -54,7 +59,7 @@ void func_8038DA04(Actor *this) {
animctrl_setAnimTimer(this->animctrl, 0.0f);
break;
case 2:
if (this->unkF4_8 != 5) {
if (this->unkF4_8 != BOSSJINJO_JINJONATOR) {
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);
@@ -91,10 +96,10 @@ void func_8038DA04(Actor *this) {
|| actor_animationIsAt(this, 0.9f)
|| actor_animationIsAt(this, 0.98f)
) {
func_8030E6A4(SFX_3_DULL_CANNON_SHOT, randf2(1.2f, 1.4f), 0x4E20);
func_8030E6A4(SFX_3_DULL_CANNON_SHOT, randf2(1.2f, 1.4f), 20000);
}
}
if (actor_animationIsAt(this, 0.999f) != 0) {
if (actor_animationIsAt(this, 0.999f)) {
func_80328B8C(this, 3, 0.99999f, 1);
actor_playAnimationOnce(this);
func_80326310(this);
@@ -103,7 +108,7 @@ void func_8038DA04(Actor *this) {
}
}
void func_8038DE98(ActorMarker *marker){
void chstonejinjo_breakOpen(ActorMarker *marker){
Actor *actor = marker_getActor(marker);
s32 sp38;
f32 sp34;
@@ -114,10 +119,10 @@ void func_8038DE98(ActorMarker *marker){
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){
SPAWNQUEUE_ADD_1(chstonejinjo_spawnJinjo, actor->marker);
if(!func_8031FF1C(BKPROG_D1_HAS_ACTIVATED_A_JINJO_STATUE_IN_FINAL_FIGHT) && actor->unkF4_8 != BOSSJINJO_JINJONATOR){
sp38 = 0x30 + actor->unkF4_8*2;
sp34 = func_8038D268();
sp34 = chbossjinjo_8038D268();
sp30 = actor->unk1C[0] + sp34;
func_8038C0DC(&sp24);
func_8028F94C(2, &sp24);
@@ -130,5 +135,5 @@ void func_8038DE98(ActorMarker *marker){
}
f32 func_8038DFA0(void) {
return func_80326EEC(0x3A1)->unk1C_x;
return func_80326EEC(ACTOR_3A1_STONE_JINJO)->unk1C_x;
}

View File

@@ -11,7 +11,8 @@ Actor *func_8038FC40(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3);
/* .data */
ActorInfo D_80391DC0 = {
0x25D, 0x38A, 0x6C7, 0x1, NULL,
0x25D, 0x38A, ASSET_6C7_SPRITE_SMOKE_GREEN_2,
0x1, NULL,
func_8038FE94, func_80326224, func_8038FC40,
0, 0, 1.0f, 0
};

View File

@@ -1,30 +0,0 @@
#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);
}

12
src/fight/fight.h Normal file
View File

@@ -0,0 +1,12 @@
#ifndef _FIGHT_INTERNAL_H_
#define _FIGHT_INTERNAL_H_
enum bossjinjo_e{
BOSSJINJO_ORANGE = 1,
BOSSJINJO_GREEN,
BOSSJINJO_PINK,
BOSSJINJO_YELLOW,
BOSSJINJO_JINJONATOR
};
#endif