Files
dusklight/src/d/actor/d_a_econt.cpp
T
Huitzi 56890c32e8 Actor status consolidation & process profile definition editing (#3117)
* 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>
2026-03-09 18:33:31 -07:00

98 lines
2.6 KiB
C++

/**
* d_a_econt.cpp
* Encounter
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_econt.h"
#include "d/d_timer.h"
#include "d/d_meter2_info.h"
#include "f_pc/f_pc_executor.h"
u8 data_805197E0[4];
static int daEcont_Draw(econt_class* i_this) {
return 1;
}
static void* s_rd_sub(void* i_this, void* param_1) {
if (fopAcM_IsActor(i_this) && fopAcM_GetName(i_this) == fpcNm_E_RD_e) {
data_805197E0[0]++;
}
return 0;
}
static void rider_game(econt_class* i_this) {
if (dComIfGs_isSwitch(0x2e,fopAcM_GetRoomNo(i_this)) && !dComIfGp_event_runCheck()) {
data_805197E0[0] = 0;
fpcM_Search(s_rd_sub,i_this);
if (i_this->field_0x5b4 == 0) {
if (i_this->field_0x5b8[0] == 0) {
i_this->field_0x5b4 = 1;
dMeter2Info_setMaxCount(data_805197E0[0]);
dComIfG_TimerStart(8,0);
}
} else if (data_805197E0[0] == 0) {
fopAcM_delete(i_this);
return;
}
dMeter2Info_setNowCount(data_805197E0[0]);
}
}
static int daEcont_Execute(econt_class* i_this) {
for (int i = 0; i < 3; i++) {
if (i_this->field_0x5b8[i] != 0) {
i_this->field_0x5b8[i] -= 1;
}
}
rider_game(i_this);
return 1;
}
static int daEcont_IsDelete(econt_class* i_this) {
return 1;
}
static int daEcont_Delete(econt_class* i_this) {
dComIfG_TimerDeleteRequest(8);
return 1;
}
static int daEcont_Create(fopAc_ac_c* i_this) {
econt_class* encounter = (econt_class*)i_this;
fopAcM_ct(i_this, econt_class);
dTimer_createTimer(8,0x989298,2,0,210.0f,410.0f,32.0f,419.0f);
encounter->field_0x5b8[0] = 0x14;
return cPhs_COMPLEATE_e;
}
static actor_method_class l_daEcont_Method = {
(process_method_func)daEcont_Create,
(process_method_func)daEcont_Delete,
(process_method_func)daEcont_Execute,
(process_method_func)daEcont_IsDelete,
(process_method_func)daEcont_Draw
};
actor_process_profile_definition g_profile_ECONT = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 8,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_ECONT_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(econt_class),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_ECONT_e,
/* Actor SubMtd */ &l_daEcont_Method,
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_UNK_0x4000_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_0_e,
};