mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-19 21:11:59 -04:00
d_a_obj_item done (#2150)
* d_a_obj_item 99% done * item cleanup * remove asm * add actor attention dist type enum * change dist_entry names slightly
This commit is contained in:
@@ -1,29 +1,21 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: d/a/d_a_item_static
|
||||
//
|
||||
/**
|
||||
* d_a_item_static.cpp
|
||||
*
|
||||
*/
|
||||
|
||||
#include "d/a/d_a_item_static.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void startCtrl__8daItem_cFv();
|
||||
extern "C" void startControl__8daItem_cFv();
|
||||
extern "C" void endControl__8daItem_cFv();
|
||||
|
||||
u32 daItem_c::startCtrl() {
|
||||
setFlag(4);
|
||||
setFlag(FLAG_NO_MOVE_e);
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 daItem_c::startControl() {
|
||||
mStatus = 1;
|
||||
mStatus = STATUS_ENEMY_CARRY_e;
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 daItem_c::endControl() {
|
||||
mStatus = 0;
|
||||
mStatus = STATUS_NORMAL_e;
|
||||
return 1;
|
||||
}
|
||||
|
||||
+93
-96
@@ -1,26 +1,16 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: d/a/d_a_itembase
|
||||
//
|
||||
/**
|
||||
* d_a_itembase.cpp
|
||||
* Item Actor base
|
||||
*/
|
||||
|
||||
#include "d/a/d_a_itembase.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "d/d_item_data.h"
|
||||
#include "f_op/f_op_actor_mng.h"
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" extern dScnKy_env_light_c g_env_light;
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 80144724-8014474C 13F064 0028+00 0/0 1/1 8/8 .text DeleteBase__12daItemBase_cFPCc */
|
||||
int daItemBase_c::DeleteBase(char const* res) {
|
||||
dComIfG_resDelete(&mPhase, res);
|
||||
int daItemBase_c::DeleteBase(const char* i_resName) {
|
||||
dComIfG_resDelete(&mPhase, i_resName);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -35,97 +25,104 @@ int daItemBase_c::__CreateHeap() {
|
||||
}
|
||||
|
||||
/* 8014475C-80144B94 13F09C 0438+00 0/0 3/3 0/0 .text CreateItemHeap__12daItemBase_cFPCcsssssss */
|
||||
int daItemBase_c::CreateItemHeap(char const* arcName, s16 bmdName, s16 btkName, s16 bpkName,
|
||||
s16 bckName, s16 bxaName, s16 brkName, s16 btpName) {
|
||||
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(arcName, bmdName);
|
||||
int daItemBase_c::CreateItemHeap(char const* i_arcName, s16 i_bmdName, s16 i_btkName, s16 i_bpkName,
|
||||
s16 i_bckName, s16 i_bxaName, s16 i_brkName, s16 i_btpName) {
|
||||
JUT_ASSERT(0 <= m_itemNo && m_itemNo <= 255);
|
||||
|
||||
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(i_arcName, i_bmdName);
|
||||
JUT_ASSERT(modelData != 0);
|
||||
|
||||
u32 flags = 0x11000084;
|
||||
u32 uvar7 = 0x80000;
|
||||
u32 modelflags = 0x80000;
|
||||
|
||||
if (btkName > 0) {
|
||||
if (i_btkName > 0) {
|
||||
flags |= 0x200;
|
||||
}
|
||||
|
||||
if (bpkName > 0) {
|
||||
if (i_bpkName > 0) {
|
||||
flags |= 0x1;
|
||||
}
|
||||
|
||||
if (btpName > 0) {
|
||||
if (i_btpName > 0) {
|
||||
flags |= 0x20000;
|
||||
}
|
||||
|
||||
if (chkFlag(4)) {
|
||||
uvar7 = 0;
|
||||
modelflags = 0;
|
||||
}
|
||||
|
||||
mpModel = mDoExt_J3DModel__create(modelData, uvar7, flags);
|
||||
|
||||
mpModel = mDoExt_J3DModel__create(modelData, modelflags, flags);
|
||||
if (mpModel == NULL) {
|
||||
return 0;
|
||||
} else {
|
||||
mpBtkAnm = NULL;
|
||||
if (btkName > 0) {
|
||||
J3DAnmTextureSRTKey* pbtk =
|
||||
(J3DAnmTextureSRTKey*)dComIfG_getObjectRes(arcName, btkName);
|
||||
mpBtkAnm = new mDoExt_btkAnm();
|
||||
}
|
||||
|
||||
if (mpBtkAnm == NULL || !mpBtkAnm->init(modelData, pbtk, 1, 2, 1.0f, 0, -1)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
mpBtkAnm = NULL;
|
||||
if (i_btkName > 0) {
|
||||
J3DAnmTextureSRTKey* pbtk =
|
||||
(J3DAnmTextureSRTKey*)dComIfG_getObjectRes(i_arcName, i_btkName);
|
||||
JUT_ASSERT(pbtk != 0);
|
||||
|
||||
mpBpkAnm = NULL;
|
||||
if (bpkName > 0) {
|
||||
J3DAnmColor* pbpk = (J3DAnmColor*)dComIfG_getObjectRes(arcName, bpkName);
|
||||
mpBpkAnm = new mDoExt_bpkAnm();
|
||||
|
||||
if (mpBpkAnm == NULL || !mpBpkAnm->init(modelData, pbpk, 1, 2, 1.0f, 0, -1)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
mpBckAnm = NULL;
|
||||
if (bckName > 0) {
|
||||
J3DAnmTransform* pbck = (J3DAnmTransform*)dComIfG_getObjectRes(arcName, bckName);
|
||||
mpBckAnm = new mDoExt_bckAnm();
|
||||
|
||||
if (mpBckAnm == NULL || !mpBckAnm->init(pbck, 1, 2, 1.0f, 0, -1, false)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
mpBrkAnm = NULL;
|
||||
if (brkName > 0) {
|
||||
J3DAnmTevRegKey* pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(arcName, brkName);
|
||||
s8 tevFrm = getTevFrm();
|
||||
int anmPlay = 1;
|
||||
if (tevFrm != -1) {
|
||||
anmPlay = 0;
|
||||
}
|
||||
|
||||
mpBrkAnm = new mDoExt_brkAnm();
|
||||
|
||||
if (mpBrkAnm == NULL || !mpBrkAnm->init(modelData, pbrk, anmPlay, 2, 1.0f, 0, -1)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
mpBtpAnm = NULL;
|
||||
if (btpName > 0) {
|
||||
J3DAnmTexPattern* pbtp = (J3DAnmTexPattern*)dComIfG_getObjectRes(arcName, btpName);
|
||||
mpBtpAnm = new mDoExt_btpAnm();
|
||||
|
||||
if (mpBtpAnm == NULL || !mpBtpAnm->init(modelData, pbtp, 1, 2, 1.0f, 0, -1)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!clothCreate()) {
|
||||
mpBtkAnm = new mDoExt_btkAnm();
|
||||
if (mpBtkAnm == NULL || !mpBtkAnm->init(modelData, pbtk, TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return __CreateHeap() ? 1 : 0;
|
||||
mpBpkAnm = NULL;
|
||||
if (i_bpkName > 0) {
|
||||
J3DAnmColor* pbpk = (J3DAnmColor*)dComIfG_getObjectRes(i_arcName, i_bpkName);
|
||||
JUT_ASSERT(pbpk != 0);
|
||||
|
||||
mpBpkAnm = new mDoExt_bpkAnm();
|
||||
if (mpBpkAnm == NULL || !mpBpkAnm->init(modelData, pbpk, TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
mpBckAnm = NULL;
|
||||
if (i_bckName > 0) {
|
||||
J3DAnmTransform* pbck = (J3DAnmTransform*)dComIfG_getObjectRes(i_arcName, i_bckName);
|
||||
JUT_ASSERT(pbck != 0);
|
||||
|
||||
mpBckAnm = new mDoExt_bckAnm();
|
||||
if (mpBckAnm == NULL || !mpBckAnm->init(pbck, TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1, false)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
mpBrkAnm = NULL;
|
||||
if (i_brkName > 0) {
|
||||
J3DAnmTevRegKey* pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(i_arcName, i_brkName);
|
||||
JUT_ASSERT(pbrk != 0);
|
||||
|
||||
s8 tevFrm = getTevFrm();
|
||||
int anmPlay = TRUE;
|
||||
if (tevFrm != -1) {
|
||||
anmPlay = FALSE;
|
||||
}
|
||||
|
||||
mpBrkAnm = new mDoExt_brkAnm();
|
||||
if (mpBrkAnm == NULL || !mpBrkAnm->init(modelData, pbrk, anmPlay, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
mpBtpAnm = NULL;
|
||||
if (i_btpName > 0) {
|
||||
J3DAnmTexPattern* pbtp = (J3DAnmTexPattern*)dComIfG_getObjectRes(i_arcName, i_btpName);
|
||||
JUT_ASSERT(pbtp != 0);
|
||||
|
||||
mpBtpAnm = new mDoExt_btpAnm();
|
||||
if (mpBtpAnm == NULL || !mpBtpAnm->init(modelData, pbtp, TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!clothCreate()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return __CreateHeap() ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
/* 80144B94-80144C30 13F4D4 009C+00 1/0 1/0 9/0 .text DrawBase__12daItemBase_cFv */
|
||||
@@ -142,7 +139,7 @@ int daItemBase_c::DrawBase() {
|
||||
|
||||
/* 80144C30-80144C7C 13F570 004C+00 1/0 1/0 9/0 .text RotateYBase__12daItemBase_cFv */
|
||||
void daItemBase_c::RotateYBase() {
|
||||
shape_angle.y += (s16)(0xFFFF / getData().field_0x1c);
|
||||
shape_angle.y += (s16)(0xFFFF / getData().mRotateYSpeed);
|
||||
}
|
||||
|
||||
/* 80144C7C-80144CA0 13F5BC 0024+00 1/0 1/0 5/0 .text setListStart__12daItemBase_cFv */
|
||||
@@ -185,8 +182,8 @@ void daItemBase_c::setShadow() {
|
||||
}
|
||||
|
||||
mShadowKey = dComIfGd_setShadow(mShadowKey, 3, mpModel, ¤t.pos, shadowSize, 0.0f,
|
||||
current.pos.y, mAcch.GetGroundH(), mAcch.m_gnd, &tevStr,
|
||||
0, 1.0f, dDlst_shadowControl_c::getSimpleTex());
|
||||
current.pos.y, mAcch.GetGroundH(), mAcch.m_gnd, &tevStr, 0,
|
||||
1.0f, dDlst_shadowControl_c::getSimpleTex());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,37 +221,37 @@ void daItemBase_c::animEntry() {
|
||||
}
|
||||
|
||||
/* 8014503C-80145144 13F97C 0108+00 0/0 2/2 4/4 .text animPlay__12daItemBase_cFffffff */
|
||||
void daItemBase_c::animPlay(f32 btkSpeed, f32 bpkSpeed, f32 bckSpeed, f32 param_3, f32 brkSpeed,
|
||||
f32 btpSpeed) {
|
||||
void daItemBase_c::animPlay(f32 i_btkSpeed, f32 i_bpkSpeed, f32 i_bckSpeed, f32 param_3, f32 i_brkSpeed,
|
||||
f32 i_btpSpeed) {
|
||||
if (mpBrkAnm != NULL && getTevFrm() == -1) {
|
||||
mpBrkAnm->setPlaySpeed(brkSpeed);
|
||||
mpBrkAnm->setPlaySpeed(i_brkSpeed);
|
||||
mpBrkAnm->play();
|
||||
}
|
||||
|
||||
if (mpBtpAnm != NULL && getBtpFrm() == -1) {
|
||||
mpBtpAnm->setPlaySpeed(btpSpeed);
|
||||
mpBtpAnm->setPlaySpeed(i_btpSpeed);
|
||||
mpBtpAnm->play();
|
||||
}
|
||||
|
||||
if (mpBtkAnm != NULL) {
|
||||
mpBtkAnm->setPlaySpeed(btkSpeed);
|
||||
mpBtkAnm->setPlaySpeed(i_btkSpeed);
|
||||
mpBtkAnm->play();
|
||||
}
|
||||
|
||||
if (mpBpkAnm != NULL) {
|
||||
mpBpkAnm->setPlaySpeed(bpkSpeed);
|
||||
mpBpkAnm->setPlaySpeed(i_bpkSpeed);
|
||||
mpBpkAnm->play();
|
||||
}
|
||||
|
||||
if (mpBckAnm != NULL) {
|
||||
mpBckAnm->setPlaySpeed(bckSpeed);
|
||||
mpBckAnm->setPlaySpeed(i_bckSpeed);
|
||||
mpBckAnm->play();
|
||||
}
|
||||
}
|
||||
|
||||
/* 80145144-80145164 13FA84 0020+00 1/0 1/0 8/0 .text chkFlag__12daItemBase_cFi */
|
||||
BOOL daItemBase_c::chkFlag(int flag) {
|
||||
return dItem_data::chkFlag(m_itemNo, flag);
|
||||
BOOL daItemBase_c::chkFlag(int i_flag) {
|
||||
return dItem_data::chkFlag(m_itemNo, i_flag);
|
||||
}
|
||||
|
||||
/* 80145164-80145180 13FAA4 001C+00 1/0 1/0 8/0 .text getTevFrm__12daItemBase_cFv */
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: d/a/d_a_itembase_static
|
||||
//
|
||||
/**
|
||||
* d_a_itembase_static.cpp
|
||||
*
|
||||
*/
|
||||
|
||||
#include "d/a/d_a_itembase_static.h"
|
||||
#include "d/a/d_a_itembase.h"
|
||||
#include "SSystem/SComponent/c_lib.h"
|
||||
#include "d/a/d_a_itembase.h"
|
||||
#include "d/d_item_data.h"
|
||||
#include "dol2asm.h"
|
||||
|
||||
u8 daItemBase_c::getItemNo() {
|
||||
return m_itemNo;
|
||||
@@ -43,35 +42,46 @@ u8 daItemBase_c::chkDead() {
|
||||
|
||||
/* 80037B0C-80037B78 03244C 006C+00 0/0 0/0 1/1 .text CheckItemCreateHeap__FP10fopAc_ac_c
|
||||
*/
|
||||
int CheckItemCreateHeap(fopAc_ac_c* actor) {
|
||||
daItemBase_c* item = static_cast<daItemBase_c*>(actor);
|
||||
int CheckItemCreateHeap(fopAc_ac_c* i_this) {
|
||||
daItemBase_c* a_this = static_cast<daItemBase_c*>(i_this);
|
||||
|
||||
u8 item_no = item->getItemNo();
|
||||
return item->CreateItemHeap(
|
||||
dItem_data::getArcName(item_no), dItem_data::getBmdName(item_no),
|
||||
dItem_data::getBtkName(item_no), dItem_data::getBpkName(item_no),
|
||||
dItem_data::getBckName(item_no), dItem_data::getBxaName(item_no),
|
||||
dItem_data::getBrkName(item_no), dItem_data::getBtpName(item_no)
|
||||
);
|
||||
u8 item_no = a_this->getItemNo();
|
||||
return a_this->CreateItemHeap(dItem_data::getArcName(item_no), dItem_data::getBmdName(item_no),
|
||||
dItem_data::getBtkName(item_no), dItem_data::getBpkName(item_no),
|
||||
dItem_data::getBckName(item_no), dItem_data::getBxaName(item_no),
|
||||
dItem_data::getBrkName(item_no), dItem_data::getBtpName(item_no));
|
||||
}
|
||||
|
||||
/* 80037B78-80037BE0 0324B8 0068+00 0/0 1/1 7/7 .text CheckFieldItemCreateHeap__FP10fopAc_ac_c */
|
||||
int CheckFieldItemCreateHeap(fopAc_ac_c* actor) {
|
||||
daItemBase_c* item = static_cast<daItemBase_c*>(actor);
|
||||
int CheckFieldItemCreateHeap(fopAc_ac_c* i_this) {
|
||||
daItemBase_c* a_this = static_cast<daItemBase_c*>(i_this);
|
||||
|
||||
u8 item_no = item->getItemNo();
|
||||
return item->CreateItemHeap(
|
||||
u8 item_no = a_this->getItemNo();
|
||||
return a_this->CreateItemHeap(
|
||||
dItem_data::getFieldArc(item_no), dItem_data::getItemBmdName(item_no),
|
||||
dItem_data::getItemBtkName(item_no), dItem_data::getItemBpkName(item_no),
|
||||
dItem_data::getItemBckName(item_no), dItem_data::getItemBxaName(item_no),
|
||||
dItem_data::getItemBrkName(item_no), dItem_data::getItemBtpName(item_no)
|
||||
);
|
||||
dItem_data::getItemBrkName(item_no), dItem_data::getItemBtpName(item_no));
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803792B0-803792E8 005910 0038+00 0/0 1/1 0/0 .rodata m_data__12daItemBase_c */
|
||||
SECTION_RODATA daItemBase_data const daItemBase_c::m_data = {
|
||||
-4.5f, 0.62f, 45.0f, 10.0f, 6.0f, 1, 240, 60, 4000,
|
||||
120, -4.0f, 3.5f, 1100, 3000, 23.0f, -6.0f, 13, 10,
|
||||
const daItemBase_data daItemBase_c::m_data = {
|
||||
-4.5f, // mGravity
|
||||
0.62f, // mGroundReflect
|
||||
45.0f, // mLaunchSpeed
|
||||
10.0f, // mScalingTime
|
||||
6.0f, // mSpeedH
|
||||
1, // mFlashCycleTime
|
||||
240, // mWaitTime
|
||||
60, // mDisappearTime
|
||||
4000, // mRotateXSpeed
|
||||
120, // mRotateYSpeed
|
||||
-4.0f, // mHeartFallSpeed
|
||||
3.5f, // mHeartAmplitude
|
||||
1100, // mHeartFallCycleTime
|
||||
3000, // mHeartTilt
|
||||
23.0f, // mGetDemoLaunchSpeed
|
||||
-6.0f, // mGetDemoGravity
|
||||
13, // mSimpleExistTime
|
||||
10, // mNoGetTime
|
||||
};
|
||||
COMPILER_STRIP_GATE(0x803792B0, &daItemBase_c::m_data);
|
||||
|
||||
+3
-3
@@ -5509,9 +5509,9 @@ BOOL daNpcF_c::chkActorInAttnArea(fopAc_ac_c* i_actorCheck, fopAc_ac_c* i_actorA
|
||||
f32 neg_upper_y = dComIfGp_getAttention().getDistTable(i_distIndex).mUpperY * -1.0f;
|
||||
cXyz center = i_actorAttn->current.pos;
|
||||
cXyz bounds;
|
||||
bounds.x = dComIfGp_getAttention().getDistTable(i_distIndex).mRadius1;
|
||||
bounds.x = dComIfGp_getAttention().getDistTable(i_distIndex).mDistMax;
|
||||
bounds.y = (fabsf(neg_lower_y) + fabsf(neg_upper_y)) / 2.0f;
|
||||
bounds.z = dComIfGp_getAttention().getDistTable(i_distIndex).mRadius1;
|
||||
bounds.z = dComIfGp_getAttention().getDistTable(i_distIndex).mDistMax;
|
||||
center.y = bounds.y + (center.y + neg_upper_y);
|
||||
if (chkActorInArea(i_actorCheck, center, bounds, i_actorAttn->shape_angle.y)) {
|
||||
ret = true;
|
||||
@@ -5911,7 +5911,7 @@ cXyz daNpcF_c::getAttentionPos(fopAc_ac_c* i_ActorP) {
|
||||
// matches with literals
|
||||
BOOL daNpcF_c::chkFindPlayer2(BOOL i_hasAttn, s16 i_angle) {
|
||||
cXyz attn_pos = getAttentionPos(daPy_getPlayerActorClass());
|
||||
int attn_no = i_hasAttn == false ? attention_info.field_0x0[3] : attention_info.field_0x0[1];
|
||||
int attn_no = i_hasAttn == false ? attention_info.distances[fopAc_attn_SPEAK_e] : attention_info.distances[fopAc_attn_TALK_e];
|
||||
f32 fvar2 = i_hasAttn == false ? dAttention_c::getDistTable(attn_no).field_0x0
|
||||
: dAttention_c::getDistTable(attn_no).field_0x4;
|
||||
f32 fvar3 = dAttention_c::getDistTable(attn_no).field_0x10 * -1.0f;
|
||||
|
||||
@@ -2330,10 +2330,3 @@ asm void __sinit_d_a_npc_cd2_cpp(){nofralloc
|
||||
#pragma force_active on
|
||||
REGISTER_CTORS(0x8015A90C, __sinit_d_a_npc_cd2_cpp);
|
||||
#pragma pop
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80451010-80451018 000510 0008+00 0/0 1/1 0/0 .sbss None */
|
||||
extern u8 data_80451010[8];
|
||||
u8 data_80451010[8];
|
||||
|
||||
/* 80393B70-80393B70 0201D0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
|
||||
|
||||
+645
-988
File diff suppressed because it is too large
Load Diff
@@ -793,7 +793,7 @@ f32 dAttention_c::calcWeight(int param_0, fopAc_ac_c* param_1, f32 param_2, s16
|
||||
type_tbl_entry* entry = &table[i];
|
||||
|
||||
if (mPlayerAttentionFlags & entry->field_0x2 & param_1->attention_info.flags) {
|
||||
u8 index = param_1->attention_info.field_0x0[entry->field_0x0];
|
||||
u8 index = param_1->attention_info.distances[entry->field_0x0];
|
||||
dist_entry* d_entry = &dist_table[index];
|
||||
|
||||
if (fopAcM_checkStatus(param_1, 0x20000000) ||
|
||||
@@ -802,7 +802,7 @@ f32 dAttention_c::calcWeight(int param_0, fopAc_ac_c* param_1, f32 param_2, s16
|
||||
} else if (check_flontofplayer(d_entry->mAngleSelect, param_3, param_4)) {
|
||||
dvar12 = 0.0f;
|
||||
} else if (!check_distace(&mOwnerAttnPos, param_3, ¶m_1->attention_info.position,
|
||||
d_entry->mRadius1, d_entry->mDistanceAdjust, d_entry->mUpperY,
|
||||
d_entry->mDistMax, d_entry->mDistanceAdjust, d_entry->mUpperY,
|
||||
d_entry->mLowerY)) {
|
||||
dvar12 = 0.0f;
|
||||
} else {
|
||||
@@ -1143,7 +1143,7 @@ bool dAttention_c::chaseAttention() {
|
||||
f32 weight = calcWeight(0x4C, actor, g1.R(), a1.Val(), a2.Val(), &type);
|
||||
if (weight <= 0.0f) {
|
||||
type = mLockOnList[offset].mType;
|
||||
int tbl_idx = actor->attention_info.field_0x0[type];
|
||||
int tbl_idx = actor->attention_info.distances[type];
|
||||
|
||||
if (!chkAttMask(type, actor->attention_info.flags)) {
|
||||
return false;
|
||||
@@ -1152,7 +1152,7 @@ bool dAttention_c::chaseAttention() {
|
||||
} else if (check_flontofplayer(dist_table[tbl_idx].mAngleSelect, a1.Val(), a2.Val())) {
|
||||
return false;
|
||||
} else if (check_distace(&mOwnerAttnPos, a1.Val(), &actor->attention_info.position,
|
||||
dist_table[tbl_idx].mRadius2,
|
||||
dist_table[tbl_idx].mDistMaxRelease,
|
||||
dist_table[tbl_idx].mDistanceAdjust,
|
||||
dist_table[tbl_idx].mUpperY, dist_table[tbl_idx].mLowerY)) {
|
||||
mLockOnList[offset].mWeight = distace_weight(g1.R(), a1.Val(), 0.5f);
|
||||
@@ -1198,7 +1198,7 @@ f32 dAttention_c::EnemyDistance(fopAc_ac_c* i_actor) {
|
||||
distance = -1.0f;
|
||||
} else {
|
||||
distance = fopAcM_searchActorDistance(mpPlayer, i_actor);
|
||||
u8 tmp = i_actor->attention_info.field_0x0[2];
|
||||
u8 tmp = i_actor->attention_info.distances[fopAc_attn_BATTLE_e];
|
||||
|
||||
if (distance < dist_table[tmp].field_0x0 + dist_table[tmp].field_0x8) {
|
||||
return distance;
|
||||
@@ -1958,7 +1958,7 @@ f32 dAttention_c::LockonReleaseDistanse() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
int idx = actor->attention_info.field_0x0[mLockOnList[mLockOnOffset].mType];
|
||||
int idx = actor->attention_info.distances[mLockOnList[mLockOnOffset].mType];
|
||||
cSGlobe tmp_g(actor->attention_info.position - mOwnerAttnPos);
|
||||
cSAngle tmp_a(tmp_g.U() - fopAcM_GetShapeAngle_p(mpPlayer)->y);
|
||||
|
||||
|
||||
@@ -6,6 +6,23 @@
|
||||
#include "d/d_insect.h"
|
||||
#include "d/menu/d_menu_insect.h"
|
||||
#include "m_Do/m_Do_lib.h"
|
||||
#include "dol2asm.h"
|
||||
|
||||
// This is a HACK to get d_insect data at correct address due to
|
||||
// issues with the d_a_obj_item vtable. TODO: fix daItem_c vtable
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA extern void* __vt__8daItem_c__HACK[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 8015E010-8015E078 158950 0068+00 0/0 0/0 13/13 .text __ct__9dInsect_cFv */
|
||||
dInsect_c::dInsect_c() {
|
||||
|
||||
@@ -1214,7 +1214,7 @@ int dMsgFlow_c::query007(mesg_flow_node_branch* flow_node, fopAc_ac_c* param_1,
|
||||
cXyz this_00 = daPy_getPlayerActorClass()->attention_info.position;
|
||||
this_00.y -= daPy_getPlayerActorClass()->getAttentionOffsetY();
|
||||
s16 uVar8 = (cSGlobe(param_1->attention_info.position - this_00).U() - daPy_getPlayerActorClass()->shape_angle.GetY());
|
||||
u8 attentionId = param_1->attention_info.field_0x0[3];
|
||||
u8 attentionId = param_1->attention_info.distances[fopAc_attn_SPEAK_e];
|
||||
f32 fVar1 = dAttention_c::getDistTable(attentionId).field_0x4;
|
||||
u16 x = uVar3;
|
||||
if (x != 0) {
|
||||
|
||||
@@ -164,15 +164,15 @@ static int fopAc_Create(void* i_this) {
|
||||
a_this->current = a_this->home;
|
||||
a_this->eyePos = a_this->home.pos;
|
||||
a_this->maxFallSpeed = -100.0f;
|
||||
a_this->attention_info.field_0x0[0] = 1;
|
||||
a_this->attention_info.field_0x0[1] = 2;
|
||||
a_this->attention_info.field_0x0[2] = 3;
|
||||
a_this->attention_info.field_0x0[3] = 5;
|
||||
a_this->attention_info.field_0x0[4] = 6;
|
||||
a_this->attention_info.field_0x0[7] = 14;
|
||||
a_this->attention_info.field_0x0[5] = 15;
|
||||
a_this->attention_info.field_0x0[6] = 15;
|
||||
a_this->attention_info.field_0x0[8] = 51;
|
||||
a_this->attention_info.distances[fopAc_attn_LOCK_e] = 1;
|
||||
a_this->attention_info.distances[fopAc_attn_TALK_e] = 2;
|
||||
a_this->attention_info.distances[fopAc_attn_BATTLE_e] = 3;
|
||||
a_this->attention_info.distances[fopAc_attn_SPEAK_e] = 5;
|
||||
a_this->attention_info.distances[fopAc_attn_CARRY_e] = 6;
|
||||
a_this->attention_info.distances[fopAc_attn_ETC_e] = 14;
|
||||
a_this->attention_info.distances[fopAc_attn_DOOR_e] = 15;
|
||||
a_this->attention_info.distances[fopAc_attn_JUEL_e] = 15;
|
||||
a_this->attention_info.distances[fopAc_attn_CHECK_e] = 51;
|
||||
a_this->attention_info.position = a_this->home.pos;
|
||||
a_this->attention_info.field_0xa = 30;
|
||||
dKy_tevstr_init(&a_this->tevStr, a_this->home.roomNo, -1);
|
||||
|
||||
Reference in New Issue
Block a user