documentations:
- various particle system functions/structs - more in src/fight - beehive - added prototypes (reduced compiler warnings)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "fight.h"
|
||||
#include "core2/particle.h"
|
||||
|
||||
|
||||
@@ -68,7 +69,7 @@ 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 = {
|
||||
ParticleScaleAndLifetimeRanges D_80391968 = {
|
||||
{0.1f, 0.1f}, {10.0f, 10.0f}, {0.0f, 0.01f}, {0.8f, 0.8f}, 0.1f, 0.1f
|
||||
};
|
||||
|
||||
@@ -340,7 +341,7 @@ void func_8038CED8(f32 arg0[3], enum asset_e model_id, f32 arg2, f32 arg3){
|
||||
D_80391968.unk0[1] *= arg2;
|
||||
D_80391968.unk8[0] *= arg2;
|
||||
D_80391968.unk8[1] *= arg2;
|
||||
func_802EFB98(s0, &D_80391968);
|
||||
particleEmitter_setScaleAndLifetimeRanges(s0, &D_80391968);
|
||||
particleEmitter_setDrawMode(s0, PART_EMIT_NO_DEPTH);
|
||||
func_802EFA78(s0, 1);
|
||||
particleEmitter_emitN(s0, 1);
|
||||
|
@@ -1,24 +1,31 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "fight.h"
|
||||
|
||||
typedef struct {
|
||||
u8 unk0;
|
||||
}ActorLocal_fight_6E90;
|
||||
}ActorLocal_BossJinjoBase;
|
||||
|
||||
void func_8038D568(Actor *this);
|
||||
enum chBossJinjoBase_states {
|
||||
CHBOSSJINJOBASE_STATE_1_RAISE = 1,
|
||||
CHBOSSJINJOBASE_STATE_2_DEFAULT = 2,
|
||||
CHBOSSJINJOBASE_STATE_3_SPAWNED_BOSS_JINJO = 3
|
||||
};
|
||||
|
||||
void chBossJinjoBase_update(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo chBossJinjoBase = {
|
||||
MARKER_27A_JINJO_STATUE_BASE, ACTOR_3A2_JINJO_STATUE_BASE, ASSET_543_MODEL_JINJO_STATUE_BASE,
|
||||
0x1, NULL,
|
||||
func_8038D568, func_80326224, actor_draw,
|
||||
chBossJinjoBase_update, func_80326224, actor_draw,
|
||||
0, 0x800, 0.0f, 0
|
||||
};
|
||||
|
||||
s32 D_803919B4[3] = {0xC8, 0xC8, 0xA0};
|
||||
s32 chBossJinjoBase_smokeColor[3] = {0xC8, 0xC8, 0xA0};
|
||||
|
||||
struct31s D_803919C0 = {
|
||||
ParticleScaleAndLifetimeRanges chBossJinjoBase_smokeSettings = {
|
||||
{1.0f, 1.0f},
|
||||
{1.7f, 2.7f},
|
||||
{0.0f, 0.05f},
|
||||
@@ -36,17 +43,17 @@ void chbossjinjobase_spawnStoneJinjo(ActorMarker *arg0) {
|
||||
sp1C->unk100 = temp_v0->marker;
|
||||
}
|
||||
|
||||
void func_8038D2EC(f32 arg0[3], s32 arg1) {
|
||||
ParticleEmitter *temp_v0 = partEmitMgr_newEmitter(arg1);
|
||||
void chBossJinjoBase_emitSmoke(f32 position[3], s32 count) {
|
||||
ParticleEmitter *p = partEmitMgr_newEmitter(count);
|
||||
|
||||
particleEmitter_setSprite(temp_v0, ASSET_70E_SPRITE_SMOKE_2);
|
||||
particleEmitter_setRGB(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);
|
||||
particleEmitter_setSprite(p, ASSET_70E_SPRITE_SMOKE_2);
|
||||
particleEmitter_setRGB(p, chBossJinjoBase_smokeColor);
|
||||
particleEmitter_setStartingFrameRange(p, 0, 7);
|
||||
particleEmitter_setPosition(p, position);
|
||||
particleEmitter_setParticleSpawnPositionRange(p, -90.0f, 0.0f, -80.0f, 80.0f, 60.0f, 80.0f);
|
||||
particleEmitter_setParticleVelocityRange(p, -170.0f, 0.0f, -170.0f, 170.0f, 100.0f, 170.0f);
|
||||
particleEmitter_setScaleAndLifetimeRanges(p, &chBossJinjoBase_smokeSettings);
|
||||
particleEmitter_emitN(p, count);
|
||||
}
|
||||
|
||||
void func_8038D3DC(Actor* this, s32 arg1, f32 arg2, f32 arg3, f32 arg4){
|
||||
@@ -57,25 +64,27 @@ void func_8038D3DC(Actor* this, s32 arg1, f32 arg2, f32 arg3, f32 arg4){
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038D428(ActorMarker *arg0, ActorMarker *arg1) {
|
||||
Actor *temp_v0;
|
||||
Actor *s0;
|
||||
void chBossJinjoBase_getHitByEgg(ActorMarker *this, ActorMarker *other) {
|
||||
Actor *actor_base;
|
||||
Actor *actor_other;
|
||||
|
||||
temp_v0 = marker_getActor(arg0);
|
||||
if (temp_v0->state != 3) {
|
||||
actor_base = marker_getActor(this);
|
||||
|
||||
if (actor_base->state != CHBOSSJINJOBASE_STATE_3_SPAWNED_BOSS_JINJO) {
|
||||
func_8025A70C(COMUSIC_2B_DING_B);
|
||||
temp_v0->unk38_31++;
|
||||
if (temp_v0->unk38_31 >= 3) {
|
||||
subaddie_set_state(temp_v0, 3);
|
||||
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);
|
||||
actor_base->unk38_31++; // hit count
|
||||
|
||||
if (actor_base->unk38_31 >= 3) { // spawn Jjnjonator
|
||||
subaddie_set_state(actor_base, CHBOSSJINJOBASE_STATE_3_SPAWNED_BOSS_JINJO);
|
||||
chstonejinjo_breakOpen(actor_base->unk100);
|
||||
func_8038D3DC(actor_base, 0x19A, -100.0f, 0.0f, 1.2f);
|
||||
func_80324D54(1.2f, SFX_90_SWITCH_PRESS, 1.0f, 32000, actor_base->position, 1000.0f, 2000.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fight_func_8038D510(Actor *arg0) {
|
||||
ActorLocal_fight_6E90 *sp18 = (ActorLocal_fight_6E90 *)&arg0->local;
|
||||
ActorLocal_BossJinjoBase *sp18 = (ActorLocal_BossJinjoBase *)&arg0->local;
|
||||
|
||||
if ((u8)arg0->unk44_31 != 0) {
|
||||
func_8030DA44(arg0->unk44_31);
|
||||
@@ -87,21 +96,21 @@ void fight_func_8038D510(Actor *arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8038D568(Actor *this){
|
||||
ActorLocal_fight_6E90 *local = (ActorLocal_fight_6E90 *)&this->local;
|
||||
void chBossJinjoBase_update(Actor *this) {
|
||||
ActorLocal_BossJinjoBase *local = (ActorLocal_BossJinjoBase *)&this->local;
|
||||
|
||||
f32 sp48 = time_getDelta();
|
||||
u32 sp44 = globalTimer_getTime() & 0xF;
|
||||
Actor *other; //sp40
|
||||
f32 sp3C;
|
||||
f32 sp30[3];
|
||||
f32 delta_time = time_getDelta();
|
||||
u32 shake_noise = globalTimer_getTime() & 0xF;
|
||||
Actor *actor_stone_jinjo; //sp40
|
||||
f32 y_delta;
|
||||
f32 position_delta[3];
|
||||
|
||||
this->unkF4_29 = 0;
|
||||
func_80330B1C(this->marker);
|
||||
marker_loadModelBin(this->marker);
|
||||
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = 1;
|
||||
marker_setCollisionScripts(this->marker, NULL, func_8038D428, NULL);
|
||||
marker_setCollisionScripts(this->marker, NULL, chBossJinjoBase_getHitByEgg, NULL);
|
||||
marker_setFreeMethod(this->marker, fight_func_8038D510);
|
||||
this->marker->propPtr->unk8_3 = 1;
|
||||
actor_collisionOn(this);
|
||||
@@ -128,44 +137,45 @@ void func_8038D568(Actor *this){
|
||||
|
||||
func_802BB3DC(0, 8.0f, 0.92f);
|
||||
__spawnQueue_add_4((GenFunction_4)func_802C4140, 0x3ad, *(s32*)&this->unk1C[0], *(s32*)&this->unk1C[1], *(s32*)&this->unk1C[2]);
|
||||
func_8038D2EC(this->unk1C, 0x10);
|
||||
chBossJinjoBase_emitSmoke(this->unk1C, 0x10);
|
||||
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( !fileProgressFlag_get(FILEPROG_D2_HAS_SPAWNED_A_JINJO_STATUE_IN_FINAL_FIGHT) || this->unkF4_8 == 1){
|
||||
else{
|
||||
if(this->state == CHBOSSJINJOBASE_STATE_1_RAISE) {
|
||||
actor_stone_jinjo = marker_getActor(this->unk100);
|
||||
y_delta = this->velocity_y * delta_time;
|
||||
|
||||
if(this->position_y + y_delta < this->unk1C[1]) {
|
||||
if( !fileProgressFlag_get(FILEPROG_D2_HAS_SPAWNED_A_JINJO_STATUE_IN_FINAL_FIGHT) || 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;
|
||||
|
||||
position_delta[0] = (shake_noise & 1) ? 3.0f : -3.0f;
|
||||
position_delta[1] = y_delta;
|
||||
position_delta[2] = (shake_noise & 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;
|
||||
this->position_x = position_delta[0] + this->position_x;
|
||||
this->position_y = position_delta[1] + this->position_y;
|
||||
this->position_z = position_delta[2] + this->position_z;
|
||||
|
||||
actor_stone_jinjo->position_x = this->unk1C[0];
|
||||
actor_stone_jinjo->position_z = this->unk1C[2];
|
||||
actor_stone_jinjo->position_x = position_delta[0] + actor_stone_jinjo->position_x;
|
||||
actor_stone_jinjo->position_y = position_delta[1] + actor_stone_jinjo->position_y;
|
||||
actor_stone_jinjo->position_z = position_delta[2] + actor_stone_jinjo->position_z;
|
||||
}
|
||||
else{//L8038D8E0
|
||||
subaddie_set_state(this, 2);
|
||||
else {
|
||||
subaddie_set_state(this, CHBOSSJINJOBASE_STATE_2_DEFAULT);
|
||||
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;
|
||||
TUPLE_COPY(actor_stone_jinjo->position, this->unk1C);
|
||||
actor_stone_jinjo->position_y += 172.0f;
|
||||
}
|
||||
}
|
||||
}//L8038D954
|
||||
|
@@ -1,30 +1,29 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "fight.h"
|
||||
|
||||
Actor *chbossshadow_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3);
|
||||
void chbossshadow_update(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorInfo chBossShadow = {
|
||||
MARKER_288_GRUNTY_SHADOW, ACTOR_3AF_GRUNTY_SHADOW, ASSET_3BF_MODEL_PLAYER_SHADOW, 0x1, NULL,
|
||||
chbossshadow_update, func_80326224, chbossshadow_draw,
|
||||
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 = marker_getActorAndRotation(marker, sp34);
|
||||
sp30 = this->scale * ml_map_f(this->unk1C[0], 0.0f, 1000.0f, 1.75f, 0.9f);
|
||||
Actor *chBossShadow_draw(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **vptr) {
|
||||
f32 rotation[3];
|
||||
f32 scale;
|
||||
Actor *actor;
|
||||
|
||||
// unk1C[0] of ACTOR_3AF_GRUNTY_SHADOW is set in chfinalboss_update to the distance between Gruntilda and the floor triangle below her
|
||||
actor = marker_getActorAndRotation(this, rotation);
|
||||
scale = actor->scale * ml_map_f(actor->unk1C[0], 0.0f, 1000.0f, 1.75f, 0.9f);
|
||||
|
||||
modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE);
|
||||
modelRender_draw(gdl, mptr, this->position, sp34, sp30, NULL, func_80330B1C(marker));
|
||||
return this;
|
||||
modelRender_draw(gdl, mptr, actor->position, rotation, scale, NULL, marker_loadModelBin(this));
|
||||
|
||||
return actor;
|
||||
}
|
||||
|
||||
|
||||
void chbossshadow_update(Actor *this){
|
||||
void chBossShadow_update(Actor *this) {
|
||||
actor_collisionOff(this);
|
||||
}
|
||||
|
@@ -122,7 +122,7 @@ f32 fight_D_80391524[3] = {0.0f, -8.0f, 400.0f};
|
||||
|
||||
f32 D_80391530[3] = {0.0f, -8.0f, 0.0f};
|
||||
|
||||
struct31s D_8039153C ={
|
||||
ParticleScaleAndLifetimeRanges D_8039153C ={
|
||||
{1.0f, 1.0f},
|
||||
{1.0f, 1.0f},
|
||||
{0.0f, 0.01f},
|
||||
@@ -285,7 +285,7 @@ void chfinalboss_spawnBroomstickParticles(f32 position[3], enum asset_e model_id
|
||||
particleEmitter_setPosition(temp_s0, position);
|
||||
particleEmitter_setAngularVelocityRange(temp_s0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
|
||||
particleEmitter_setPositionVelocityAndAccelerationRanges(temp_s0, &D_80391564);
|
||||
func_802EFB98(temp_s0, &D_8039153C);
|
||||
particleEmitter_setScaleAndLifetimeRanges(temp_s0, &D_8039153C);
|
||||
func_802EFA78(temp_s0, 1);
|
||||
particleEmitter_emitN(temp_s0, n);
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "fight.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);
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "fight.h"
|
||||
|
||||
extern f32 func_8038C288(void);
|
||||
extern void subaddie_set_state_with_direction(Actor *, s32, f32, s32);
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "fight.h"
|
||||
|
||||
typedef struct {
|
||||
u8 unk0[4];
|
||||
@@ -18,7 +19,7 @@ ActorInfo chJinjonatorBase = {
|
||||
|
||||
s32 D_80391A64[3] = {0xC8, 0xC8, 0xA0};
|
||||
|
||||
struct31s fight_D_80391A70 = {
|
||||
ParticleScaleAndLifetimeRanges fight_D_80391A70 = {
|
||||
{1.0f, 1.0f},
|
||||
{1.7f, 2.7f},
|
||||
{0.0f, 0.05f},
|
||||
@@ -53,7 +54,7 @@ void func_8038E03C(f32 arg0[3], u32 arg1) {
|
||||
particleEmitter_setStartingFrameRange(temp_v0, 0, 7);
|
||||
particleEmitter_setPosition(temp_v0, arg0);
|
||||
particleEmitter_setPositionAndVelocityRanges(temp_v0, &D_80391A98);
|
||||
func_802EFB98(temp_v0, &fight_D_80391A70);
|
||||
particleEmitter_setScaleAndLifetimeRanges(temp_v0, &fight_D_80391A70);
|
||||
particleEmitter_emitN(temp_v0, arg1);
|
||||
}
|
||||
|
||||
@@ -116,7 +117,7 @@ void chjinjonatorbase_update(Actor *this){
|
||||
f32 sp38[3];
|
||||
|
||||
|
||||
func_80330B1C(this->marker);
|
||||
marker_loadModelBin(this->marker);
|
||||
if(!this->unk16C_4){
|
||||
this->unk16C_4 = 1;
|
||||
marker_setCollisionScripts(this->marker, NULL, func_8038E120, NULL);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#include "fight.h"
|
||||
|
||||
extern ActorMarker *chfinalboss_findCollidingJinjo(Actor*, f32);
|
||||
void func_80386654(f32 arg0, f32 (*arg1)[4], f32 (*arg2)[4]);
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "fight.h"
|
||||
#include "core2/particle.h"
|
||||
|
||||
extern void func_80324CFC(f32, s32, s32);
|
||||
|
@@ -1,26 +1,9 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#include "prop.h"
|
||||
#include "fight.h"
|
||||
|
||||
extern ActorInfo chFightFlightPad;
|
||||
extern ActorInfo chFinalBoss;
|
||||
extern ActorInfo chBossJinjoOrange;
|
||||
extern ActorInfo chBossJinjoGreen;
|
||||
extern ActorInfo chBossJinjoPink;
|
||||
extern ActorInfo chBossJinjoYellow;
|
||||
extern ActorInfo chBossJinjoBase;
|
||||
extern ActorInfo chStoneJinjo;
|
||||
extern ActorInfo chJinjonatorBase;
|
||||
extern ActorInfo chSpellBarrier;
|
||||
extern ActorInfo chSpellFireball;
|
||||
extern ActorInfo chSpellGreen;
|
||||
extern ActorInfo chGreenBlast;
|
||||
extern ActorInfo chJinjonator;
|
||||
extern ActorInfo chBossShadow;
|
||||
|
||||
/* .bss */
|
||||
u8 pad_fight_80392740[0x10];
|
||||
|
||||
void fight_func_803863F0(void)
|
||||
|
@@ -9,4 +9,25 @@ enum bossjinjo_e{
|
||||
BOSSJINJO_JINJONATOR
|
||||
};
|
||||
|
||||
extern ActorInfo chFightFlightPad;
|
||||
extern ActorInfo chFinalBoss;
|
||||
extern ActorInfo chBossJinjoOrange;
|
||||
extern ActorInfo chBossJinjoGreen;
|
||||
extern ActorInfo chBossJinjoPink;
|
||||
extern ActorInfo chBossJinjoYellow;
|
||||
extern ActorInfo chBossJinjoBase;
|
||||
extern ActorInfo chStoneJinjo;
|
||||
extern ActorInfo chJinjonatorBase;
|
||||
extern ActorInfo chSpellBarrier;
|
||||
extern ActorInfo chSpellFireball;
|
||||
extern ActorInfo chSpellGreen;
|
||||
extern ActorInfo chGreenBlast;
|
||||
extern ActorInfo chJinjonator;
|
||||
extern ActorInfo chBossShadow;
|
||||
|
||||
extern void fight_func_803863F0(void);
|
||||
|
||||
extern Actor *chBossShadow_draw(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **vptr);
|
||||
extern void chBossShadow_update(Actor *this);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user