dKyr_thunder_move

This commit is contained in:
Jasper St. Pierre
2023-10-25 20:15:43 -07:00
parent d7359dd777
commit eabcab65a6
5 changed files with 97 additions and 8 deletions
+8 -2
View File
@@ -64,7 +64,7 @@ struct GB_WIND_INFLUENCE {
struct EF_THUNDER {
/* 0x00 */ u8 mStatus;
/* 0x01 */ u8 mStateTimer;
/* 0x01 */ u8 mState;
/* 0x02 */ u8 field_0x2;
/* 0x04 */ int mMode;
/* 0x08 */ f32 mFlashTimer;
@@ -392,14 +392,20 @@ void dKy_Sound_set(cXyz i_pos, int param_1, unsigned int i_actorID, int param_3)
void dKy_itudemo_se();
void dKy_actor_addcol_set(s16, s16, s16, f32);
void dKy_actor_addcol_amb_set(s16, s16, s16, f32);
void dKy_actor_addcol_dif_set(s16, s16, s16, f32);
void dKy_bg_addcol_amb_set(s16, s16, s16, f32);
void dKy_bg_addcol_dif_set(s16, s16, s16, f32);
void dKy_bg1_addcol_amb_set(s16, s16, s16, f32);
void dKy_bg1_addcol_dif_set(s16, s16, s16, f32);
void dKy_vrbox_addcol_sky0_set(s16, s16, s16, f32);
void dKy_vrbox_addcol_kasumi_set(s16, s16, s16, f32);
void dKy_vrbox_addcol_set(s16, s16, s16, f32);
void dKy_addcol_fog_set(s16, s16, s16, f32);
void dKy_plight_set(LIGHT_INFLUENCE*);
void dKy_efplight_set(LIGHT_INFLUENCE* param_0);
void dKy_plight_cut(LIGHT_INFLUENCE* param_0);
void dKy_efplight_cut(LIGHT_INFLUENCE* param_0);
void dKy_fog_startendz_set(f32, f32, f32);
void dKy_vrbox_addcol_set(s16, s16, s16, f32);
BOOL dKy_daynight_check();
void dKy_tevstr_init(dKy_tevstr_c*, s8, u8);
void dKy_Sound_init();
+2 -1
View File
@@ -14,6 +14,7 @@ typedef int (*fopKyM_CreateFunc)(void*);
void fopKyM_Delete(void* param_1);
int fopKyM_Create(s16 param_1, fopKyM_CreateFunc param_2, void* param_3);
int fopKyM_create(s16 i_procName, int i_param, cXyz* i_pos, cXyz* i_scale, fopKyM_CreateFunc i_createFunc);
base_process_class* fopKyM_fastCreate(s16 param_0, int param_1, cXyz* param_2, cXyz* param_3,
fopKyM_CreateFunc);
int fopKyM_createWpillar(cXyz const* i_pos, f32 scaleXZ, f32 scaleY, int i_param);
@@ -22,4 +23,4 @@ inline void* fopKyM_GetAppend(void* param_0) {
return fpcM_GetAppend(param_0);
}
#endif
#endif
+85 -2
View File
@@ -9,8 +9,11 @@
#include "d/d_com_inf_game.h"
#include "d/d_kankyo.h"
#include "d/d_kankyo_wether.h"
#include "d/d_procname.h"
#include "d/d_snap.h"
#include "f_op/f_op_camera_mng.h"
#include "f_op/f_op_kankyo_mng.h"
#include "m_Do/m_Do_audio.h"
#include "m_Do/m_Do_lib.h"
#include "JSystem/JKernel/JKRHeap.h"
@@ -1192,10 +1195,90 @@ void drawVrkumo(Mtx, GXColor&, u8**) {
/* 8009B9C4-8009B9D8 .text dKyr_thunder_init__Fv */
void dKyr_thunder_init() {
g_env_light.mThunderEff.mStateTimer = 0;
g_env_light.mThunderEff.mState = 0;
}
/* 8009B9D8-8009BDEC .text dKyr_thunder_move__Fv */
void dKyr_thunder_move() {
/* Nonmatching */
EF_THUNDER * pThunder = &g_env_light.mThunderEff;
camera_class * pCamera = dComIfGp_getCamera(0);
switch (pThunder->mState) {
case 0:
{
pThunder->mFlashTimer = 0.0f;
pThunder->field_0xc = 0.0f;
pThunder->field_0x10 = 0.0f;
if (cM_rndF(1.0f) < 0.007f) {
pThunder->mState = 11;
} else if (cM_rndF(1.0f) < 0.005f && g_env_light.mThunderEff.mMode < 10) {
pThunder->mLightInfluence.mPos.x = pCamera->mLookat.mEye.x;
pThunder->mLightInfluence.mPos.y = pCamera->mLookat.mEye.y;
pThunder->mLightInfluence.mPos.z = pCamera->mLookat.mEye.z;
pThunder->mLightInfluence.mColor.r = 0;
pThunder->mLightInfluence.mColor.g = 0;
pThunder->mLightInfluence.mColor.b = 0;
pThunder->mLightInfluence.mPower = 90000.0f;
pThunder->mLightInfluence.mFluctuation = 150.0f;
dKy_efplight_set(&pThunder->mLightInfluence);
pThunder->mState++;
}
}
break;
case 1:
case 11:
{
cLib_addCalc(&pThunder->mFlashTimer, 1.0f, 0.3f, 0.2f, 0.001f);
if (pThunder->mFlashTimer >= 1.0f) {
if (pThunder->mState < 10)
mDoAud_seStart(0x69f7, NULL, 0, 0);
pThunder->mState++;
}
if (cM_rndF(1.0f) < 0.18f)
fopKyM_create(PROC_KY_THUNDER, -1, NULL, NULL, NULL);
}
break;
case 2:
case 12:
{
cLib_addCalc(&pThunder->mFlashTimer, 0.0f, 0.1f, 0.05f, 0.001f);
if (pThunder->mFlashTimer <= 0.0f) {
if (pThunder->mState < 10)
dKy_efplight_cut(&pThunder->mLightInfluence);
pThunder->mState = 0;
if (g_env_light.mThunderEff.mMode == 0)
pThunder->mStatus = 0;
}
}
break;
}
if (pThunder->mState != 0) {
if (pThunder->mState < 10) {
pThunder->mLightInfluence.mPos.x = pCamera->mLookat.mEye.x;
pThunder->mLightInfluence.mPos.y = pCamera->mLookat.mEye.y + 150.0f;
pThunder->mLightInfluence.mPos.z = pCamera->mLookat.mEye.z;
pThunder->mLightInfluence.mColor.r = (u8)(pThunder->mFlashTimer * 0.2f * 180.0f);
pThunder->mLightInfluence.mColor.g = (u8)(pThunder->mFlashTimer * 0.2f * 235.0f);
pThunder->mLightInfluence.mColor.b = (u8)(pThunder->mFlashTimer * 0.2f * 255.0f);
if (g_env_light.field_0xc98 == 0) {
dKy_actor_addcol_amb_set(0x5a, 0xa0, 0xf5, pThunder->mFlashTimer * 0.5f);
dKy_actor_addcol_dif_set(0x5a, 0xa0, 0xf5, pThunder->mFlashTimer * 0.5f);
dKy_bg_addcol_amb_set(0x32, 0x78, 0xff, pThunder->mFlashTimer * 0.7f);
dKy_bg_addcol_dif_set(0x32, 0x78, 0xff, pThunder->mFlashTimer * 0.7f);
dKy_bg1_addcol_amb_set(0x5a, 0xa0, 0xf5, pThunder->mFlashTimer * 0.35f);
dKy_bg1_addcol_dif_set(0x5a, 0xa0, 0xf5, pThunder->mFlashTimer * 0.35f);
dKy_vrbox_addcol_sky0_set(0x5a, 0xa0, 0xf5, pThunder->mFlashTimer * 0.4f);
dKy_vrbox_addcol_kasumi_set(0x5a, 0xa0, 0xf5, pThunder->mFlashTimer * 0.5f);
dKy_addcol_fog_set(0x5a, 0xa0, 0xf5, pThunder->mFlashTimer * 0.3f);
}
} else {
dKy_vrbox_addcol_sky0_set(0x5a,0xa0,0xf5,(pThunder->mFlashTimer * 0.15f));
dKy_vrbox_addcol_kasumi_set(0x5a,0xa0,0xf5,(pThunder->mFlashTimer * 0.35f));
dKy_addcol_fog_set(0x5a, 0xa0, 0xf5, pThunder->mFlashTimer * 0.12f);
}
}
}
+1 -1
View File
@@ -152,7 +152,7 @@ s32 dThunder_c::create() {
mBtkTime = cM_rndF(1.0f);
f32 size = g_env_light.mThunderEff.mStateTimer < 10 ? 1.0f : 0.5f;
f32 size = g_env_light.mThunderEff.mState < 10 ? 1.0f : 0.5f;
mRot = 4000.0f;
mRot = size * cM_rndFX(mRot);
mScale.x = size * (cM_rndF(15.0f) + 5.0f);
+1 -2
View File
@@ -53,8 +53,7 @@ int fopKyM_Create(s16 i_procName, fopKyM_CreateFunc i_createFunc, void* i_proces
}
/* 8002A9D8-8002AA38 .text fopKyM_create__FsiP4cXyzP4cXyzPFPv_i */
int fopKyM_create(s16 i_procName, int i_param, cXyz* i_pos, cXyz* i_scale,
fopKyM_CreateFunc i_createFunc) {
int fopKyM_create(s16 i_procName, int i_param, cXyz* i_pos, cXyz* i_scale, fopKyM_CreateFunc i_createFunc) {
fopKyM_prm_class* params = createAppend(i_param, i_pos, i_scale);
if (params == NULL) {