mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-07 03:17:22 -04:00
56890c32e8
* Consolidate fopAcM_STATUS into fopAc_Status_e * Add _e suffix to fopAcStts enums * Prepare for profile enumeration * Correct typo in scene_process_profile_definition * Manually handle g_profile_Obj_DamCps (inline preprocessing) * Correct g_profile_TAG_LV5SOUP procname to enum * Create d_priority.h * Update process profile definitions * Moved inline comments to the left * Add missing fopAcStts enums * Add d_priority.h include in f_pc_leaf.h * Manually update d_a_obj_damCps profile * Replace fopAcStts enums replacing and anticipatory profile size correction * Changed profile size from literal to sizeof() in anticipation of PR #3116 * Provided putative names to staff-related status enums * Replaced appropriate literals with fopAcStts enums * Fix borked merge * Rename item number enums and move to d_item_data.h * Rename process profile name & draw priority enums * Move process profile name & draw priority enums to appropriate files * Moved fpcNm_ enums from d/d_procname.h to f_pc/f_pc_name.h * Moved fpcDwPi_ enums from d/d_priority.h to f_pc/f_pc_draw_priority.h * ACTUALLY (whoops) stage merge * Correct item mistranslation Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com> --------- Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com>
119 lines
3.2 KiB
C++
119 lines
3.2 KiB
C++
/**
|
|
* d_a_obj_lv3waterEff.cpp
|
|
* Lakebed Temple Pre-Deku Toad Room Water Bubbles
|
|
*/
|
|
|
|
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
|
|
|
#include "d/actor/d_a_obj_lv3waterEff.h"
|
|
#include "d/d_com_inf_game.h"
|
|
#include "f_pc/f_pc_name.h"
|
|
#include "f_op/f_op_actor_mng.h"
|
|
|
|
static u16 const l_eff_id[] = {
|
|
0x86D2,
|
|
0x86D3,
|
|
0x86D4,
|
|
0x86D5,
|
|
};
|
|
|
|
int daObjWaterEff_c::Create() {
|
|
for (int i = 0; i < 4; i++) {
|
|
mParticles[i] = dComIfGp_particle_set(l_eff_id[i], ¤t.pos, NULL, NULL, 0xFF, NULL, -1,
|
|
NULL, NULL, NULL);
|
|
|
|
if(mParticles[i] == NULL) {
|
|
// "LV3R09 Water flow effect: Effect <%d> could not be set"
|
|
OS_REPORT_ERROR("Lv3R09水流エフェクト:エフェクト<%d>セットできませんでした\n");
|
|
}
|
|
}
|
|
|
|
mSePositions[0].set(14420.0f, -1100.0f, -4950.0f);
|
|
mSePositions[1].set(12585.0f, -550.0f, -2390.0f);
|
|
return 1;
|
|
}
|
|
|
|
int daObjWaterEff_c::create() {
|
|
fopAcM_ct(this, daObjWaterEff_c);
|
|
|
|
if (!Create()) {
|
|
return cPhs_ERROR_e;
|
|
}
|
|
|
|
return cPhs_COMPLEATE_e;
|
|
}
|
|
|
|
int daObjWaterEff_c::execute() {
|
|
if (dKy_camera_water_in_status_check()) {
|
|
for (int i = 0; i < 4; i++) {
|
|
if (mParticles[i] != NULL) {
|
|
mParticles[i]->setGlobalAlpha(255);
|
|
}
|
|
}
|
|
} else {
|
|
for (int i = 0; i < 4; i++) {
|
|
if (mParticles[i] != NULL) {
|
|
mParticles[i]->setGlobalAlpha(128);
|
|
}
|
|
}
|
|
}
|
|
|
|
for (int i = 0; i < 2; i++) {
|
|
mDoAud_seStartLevel(Z2SE_OBJ_WTR_STREAM, &mSePositions[i], 0, 0);
|
|
}
|
|
|
|
return 1;
|
|
}
|
|
|
|
int daObjWaterEff_c::_delete() {
|
|
for (int i = 0; i < 4; i++) {
|
|
if (mParticles[i] != NULL) {
|
|
mParticles[i]->becomeInvalidEmitter();
|
|
mParticles[i]->quitImmortalEmitter();
|
|
mParticles[i] = NULL;
|
|
}
|
|
}
|
|
|
|
return 1;
|
|
}
|
|
|
|
static int daObjWaterEff_Execute(daObjWaterEff_c* i_this) {
|
|
return i_this->execute();
|
|
}
|
|
|
|
static int daObjWaterEff_Delete(daObjWaterEff_c* i_this) {
|
|
const fpc_ProcID id = fopAcM_GetID(i_this);
|
|
return i_this->_delete();
|
|
}
|
|
|
|
static int daObjWaterEff_Create(fopAc_ac_c* i_this) {
|
|
daObjWaterEff_c* const actor = static_cast<daObjWaterEff_c*>(i_this);
|
|
const fpc_ProcID id = fopAcM_GetID(i_this);
|
|
return actor->create();
|
|
}
|
|
|
|
static actor_method_class l_daObjWaterEff_Method = {
|
|
(process_method_func)daObjWaterEff_Create,
|
|
(process_method_func)daObjWaterEff_Delete,
|
|
(process_method_func)daObjWaterEff_Execute,
|
|
(process_method_func)NULL,
|
|
(process_method_func)NULL,
|
|
};
|
|
|
|
actor_process_profile_definition g_profile_Obj_WaterEff = {
|
|
/* Layer ID */ fpcLy_CURRENT_e,
|
|
/* List ID */ 7,
|
|
/* List Prio */ fpcPi_CURRENT_e,
|
|
/* Proc Name */ fpcNm_Obj_WaterEff_e,
|
|
/* Proc SubMtd */ &g_fpcLf_Method.base,
|
|
/* Size */ sizeof(daObjWaterEff_c),
|
|
/* Size Other */ 0,
|
|
/* Parameters */ 0,
|
|
/* Leaf SubMtd */ &g_fopAc_Method.base,
|
|
/* Draw Prio */ fpcDwPi_Obj_WaterEff_e,
|
|
/* Actor SubMtd */ &l_daObjWaterEff_Method,
|
|
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_CULL_e,
|
|
/* Group */ fopAc_ACTOR_e,
|
|
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
|
|
};
|