mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-17 21:03:35 -04:00
d_a_obj_quake (#676)
* d_a_obj_quake work * daObjQuake_c::_create matching * daObjQuake_c::_is_delete matching * d_a_obj_quake matching
This commit is contained in:
+165
-22
@@ -5,70 +5,213 @@
|
||||
|
||||
#include "d/actor/d_a_obj_quake.h"
|
||||
#include "d/d_procname.h"
|
||||
#include "d/d_a_obj.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
|
||||
static daObjQuake_HIO_c l_HIO;
|
||||
|
||||
/* 000000EC-00000134 .text __ct__16daObjQuake_HIO_cFv */
|
||||
daObjQuake_HIO_c::daObjQuake_HIO_c() {
|
||||
/* Nonmatching */
|
||||
mChildID = -1;
|
||||
field_0x08 = 0;
|
||||
field_0x0C = 0;
|
||||
field_0x0D = 0;
|
||||
field_0x0E = 3;
|
||||
field_0x0F = 3;
|
||||
field_0x10 = 1;
|
||||
field_0x11 = 1;
|
||||
field_0x12 = 1;
|
||||
field_0x13 = 0;
|
||||
}
|
||||
|
||||
/* 00000134-000002C4 .text _create__12daObjQuake_cFv */
|
||||
s32 daObjQuake_c::_create() {
|
||||
/* Nonmatching */
|
||||
fopAcM_SetupActor(this, daObjQuake_c);
|
||||
|
||||
if (dComIfGs_isSymbol(1)) {
|
||||
return cPhs_UNK3_e;
|
||||
}
|
||||
|
||||
if (getPrmType() < 3) {
|
||||
fopAcM_offDraw(this);
|
||||
mType = getPrmType();
|
||||
m2A1 = false;
|
||||
m290 = 30.0f * dStage_stagInfo_GetSchSec(dComIfGp_getStageStagInfo());
|
||||
|
||||
switch (mType) {
|
||||
case 0:
|
||||
case 2:
|
||||
m298 = 4.0f;
|
||||
m29C = 6.0f;
|
||||
break;
|
||||
case 1:
|
||||
m298 = 0.0f;
|
||||
m29C = 6.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
if (l_HIO.mChildID < 0) {
|
||||
l_HIO.mChildID = mDoHIO_root.mDoHIO_createChild("振動効果", &l_HIO);
|
||||
}
|
||||
|
||||
l_HIO.field_0x08 += 1;
|
||||
return cPhs_COMPLEATE_e;
|
||||
}
|
||||
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
/* 000002C4-000002CC .text _delete__12daObjQuake_cFv */
|
||||
BOOL daObjQuake_c::_delete() {
|
||||
/* Nonmatching */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 000002CC-00000390 .text _is_delete__12daObjQuake_cFv */
|
||||
void daObjQuake_c::_is_delete() {
|
||||
/* Nonmatching */
|
||||
BOOL daObjQuake_c::_is_delete() {
|
||||
if (m2A1) {
|
||||
switch (mType) {
|
||||
case 0:
|
||||
dComIfGp_getVibration().StopQuake(0x3E);
|
||||
break;
|
||||
case 2:
|
||||
dComIfGp_getVibration().StopQuake(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (l_HIO.mChildID >= 0) {
|
||||
l_HIO.field_0x08 -= 1;
|
||||
if (l_HIO.field_0x08 == 0) {
|
||||
mDoHIO_root.mDoHIO_deleteChild(l_HIO.mChildID);
|
||||
l_HIO.mChildID = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000390-00000674 .text _execute__12daObjQuake_cFv */
|
||||
BOOL daObjQuake_c::_execute() {
|
||||
/* Nonmatching */
|
||||
// Required for match
|
||||
const char* unused[] = {"camera", "sound", "motor"}; // Has to be in a function after _create and before getPrmType
|
||||
|
||||
m294 = dKy_get_schbit_timer();
|
||||
s32 var_r30 = 0x2E;
|
||||
s32 var_r29 = getPrmPower();
|
||||
s32 var_r28 = getPrmPower();
|
||||
|
||||
if (l_HIO.field_0x0C != 0) {
|
||||
var_r29 = l_HIO.field_0x0E + 1;
|
||||
}
|
||||
|
||||
if (l_HIO.field_0x0D != 0) {
|
||||
var_r28 = l_HIO.field_0x0F + 1;
|
||||
|
||||
if (l_HIO.field_0x10 != 0) {
|
||||
var_r30 = var_r30 | 2;
|
||||
} else {
|
||||
var_r30 = var_r30 & ~2;
|
||||
}
|
||||
|
||||
if (l_HIO.field_0x11 != 0) {
|
||||
var_r30 = var_r30 | 4;
|
||||
} else {
|
||||
var_r30 = var_r30 & ~4;
|
||||
}
|
||||
|
||||
if (l_HIO.field_0x12 != 0) {
|
||||
var_r30 = var_r30 | 8;
|
||||
} else {
|
||||
var_r30 = var_r30 & ~8;
|
||||
}
|
||||
|
||||
if (l_HIO.field_0x13 != 0) {
|
||||
var_r30 = var_r30 | 0x10;
|
||||
} else {
|
||||
var_r30 = var_r30 & ~0x10;
|
||||
}
|
||||
}
|
||||
|
||||
u8 sch = getPrmSch();
|
||||
bool var_r27 = false;
|
||||
if (sch & dKy_get_schbit() && !dComIfGp_event_chkEventFlag(dEvtFlag_TALK_e)) {
|
||||
f32 a = (m29C / 6.0f) * m290;
|
||||
f32 b = (m298 / 6.0f) * m290;
|
||||
if (m294 >= b && m294 < a) {
|
||||
var_r27 = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (m2A1) {
|
||||
if (mType == 1) {
|
||||
mDoAud_seStart(JA_SE_ATM_JINARI);
|
||||
}
|
||||
|
||||
if (!var_r27) {
|
||||
switch (mType) {
|
||||
case 0:
|
||||
dComIfGp_getVibration().StopQuake(var_r30);
|
||||
break;
|
||||
case 2:
|
||||
dComIfGp_getVibration().StopQuake(1);
|
||||
break;
|
||||
}
|
||||
m2A1 = false;
|
||||
}
|
||||
} else if (var_r27) {
|
||||
switch (mType) {
|
||||
case 0:
|
||||
dComIfGp_getVibration().StartQuake(var_r28, var_r30, cXyz(0.0f, 1.0f, 0.0f));
|
||||
break;
|
||||
case 2:
|
||||
dComIfGp_getVibration().StartQuake(var_r29, 1, cXyz(0.0f, 1.0f, 0.0f));
|
||||
break;
|
||||
}
|
||||
|
||||
m2A1 = true;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000674-000006A0 .text getPrmType__12daObjQuake_cFv */
|
||||
void daObjQuake_c::getPrmType() {
|
||||
/* Nonmatching */
|
||||
u8 daObjQuake_c::getPrmType() {
|
||||
return daObj::PrmAbstract<Prm_e>(this, PRM_TYPE_W, PRM_TYPE_S);
|
||||
}
|
||||
|
||||
/* 000006A0-000006CC .text getPrmSch__12daObjQuake_cFv */
|
||||
void daObjQuake_c::getPrmSch() {
|
||||
/* Nonmatching */
|
||||
u8 daObjQuake_c::getPrmSch() {
|
||||
return daObj::PrmAbstract<Prm_e>(this, PRM_SCH_W, PRM_SCH_S);
|
||||
}
|
||||
|
||||
/* 000006CC-000006F8 .text getPrmPower__12daObjQuake_cFv */
|
||||
void daObjQuake_c::getPrmPower() {
|
||||
/* Nonmatching */
|
||||
s32 daObjQuake_c::getPrmPower() {
|
||||
return daObj::PrmAbstract<Prm_e>(this, PRM_POWER_W, PRM_POWER_S) + 1;
|
||||
}
|
||||
|
||||
/* 000006F8-00000718 .text daObjQuakeCreate__FPv */
|
||||
static s32 daObjQuakeCreate(void*) {
|
||||
/* Nonmatching */
|
||||
static s32 daObjQuakeCreate(void* i_this) {
|
||||
return static_cast<daObjQuake_c*>(i_this)->_create();
|
||||
}
|
||||
|
||||
/* 00000718-00000738 .text daObjQuakeDelete__FPv */
|
||||
static BOOL daObjQuakeDelete(void*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daObjQuakeDelete(void* i_this) {
|
||||
return static_cast<daObjQuake_c*>(i_this)->_delete();
|
||||
}
|
||||
|
||||
/* 00000738-00000758 .text daObjQuakeExecute__FPv */
|
||||
static BOOL daObjQuakeExecute(void*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daObjQuakeExecute(void* i_this) {
|
||||
return static_cast<daObjQuake_c*>(i_this)->_execute();
|
||||
}
|
||||
|
||||
/* 00000758-00000760 .text daObjQuakeDraw__FPv */
|
||||
static BOOL daObjQuakeDraw(void*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daObjQuakeDraw(void* i_this) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000760-00000780 .text daObjQuakeIsDelete__FPv */
|
||||
static BOOL daObjQuakeIsDelete(void*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daObjQuakeIsDelete(void* i_this) {
|
||||
return static_cast<daObjQuake_c*>(i_this)->_is_delete();
|
||||
}
|
||||
|
||||
static actor_method_class daObjQuakeMethodTable = {
|
||||
|
||||
Reference in New Issue
Block a user