Sakuita rope Matching (#2470)

* Change dComIfGp_getAttention to return a pointer

* d_a_obj_sakuita_rope Matching
This commit is contained in:
hatal175
2025-06-01 20:36:19 -07:00
committed by GitHub
parent 8e91607e55
commit 588b20679d
32 changed files with 558 additions and 531 deletions
@@ -13,16 +13,16 @@ create_init__14daObjItaRope_cFv = .text:0x00000624; // type:function size:0x664
initBaseMtx__14daObjItaRope_cFv = .text:0x00000C88; // type:function size:0x34 scope:global
setBaseMtx__14daObjItaRope_cFv = .text:0x00000CBC; // type:function size:0x50 scope:global
setNormalRopePos__14daObjItaRope_cFv = .text:0x00000D0C; // type:function size:0x360 scope:global
createSolidHeap__FP10fopAc_ac_c = .text:0x0000106C; // type:function size:0x1B8 scope:global
createSolidHeap__FP10fopAc_ac_c = .text:0x0000106C; // type:function size:0x1B8 scope:local
__dt__9Sakuita_cFv = .text:0x00001224; // type:function size:0x3C scope:global
__ct__9Sakuita_cFv = .text:0x00001260; // type:function size:0x4 scope:global
__dt__10RopeWork_cFv = .text:0x00001264; // type:function size:0x3C scope:global
__ct__10RopeWork_cFv = .text:0x000012A0; // type:function size:0x4 scope:global
daObjItaRope_Draw__FP14daObjItaRope_c = .text:0x000012A4; // type:function size:0xC8 scope:global
daObjItaRope_Execute__FP14daObjItaRope_c = .text:0x0000136C; // type:function size:0xE4 scope:global
daObjItaRope_IsDelete__FP14daObjItaRope_c = .text:0x00001450; // type:function size:0x8 scope:global
daObjItaRope_Delete__FP14daObjItaRope_c = .text:0x00001458; // type:function size:0x120 scope:global
daObjItaRope_Create__FP10fopAc_ac_c = .text:0x00001578; // type:function size:0x10C scope:global
daObjItaRope_Draw__FP14daObjItaRope_c = .text:0x000012A4; // type:function size:0xC8 scope:local
daObjItaRope_Execute__FP14daObjItaRope_c = .text:0x0000136C; // type:function size:0xE4 scope:local
daObjItaRope_IsDelete__FP14daObjItaRope_c = .text:0x00001450; // type:function size:0x8 scope:local
daObjItaRope_Delete__FP14daObjItaRope_c = .text:0x00001458; // type:function size:0x120 scope:local
daObjItaRope_Create__FP10fopAc_ac_c = .text:0x00001578; // type:function size:0x10C scope:local
__dt__10dCcD_GSttsFv = .text:0x00001684; // type:function size:0x5C scope:global
__dt__10cCcD_GSttsFv = .text:0x000016E0; // type:function size:0x48 scope:global
_ctors = .ctors:0x00000000; // type:label scope:global
@@ -52,9 +52,9 @@ M_attr__14daObjItaRope_c = .rodata:0x00000000; // type:object size:0x14 scope:gl
@4094 = .rodata:0x00000078; // type:object size:0x4 scope:local
@4149 = .rodata:0x0000007C; // type:object size:0x4 scope:local align:4 data:float
@stringBase0 = .rodata:0x00000080; // type:object size:0x25 scope:local data:string_table
l_arcName = .data:0x00000000; // type:object size:0x4 scope:global
l_arcName = .data:0x00000000; // type:object size:0x4 scope:local
l_color$localstatic3$draw__14daObjItaRope_cFv = .data:0x00000004; // type:object size:0x4 scope:local
l_daObjItaRope_Method = .data:0x00000008; // type:object size:0x20 scope:global
l_daObjItaRope_Method = .data:0x00000008; // type:object size:0x20 scope:local
g_profile_Obj_ItaRope = .data:0x00000028; // type:object size:0x30 scope:global
__vt__18mDoExt_3DlineMat_c = .data:0x00000058; // type:object size:0x14 scope:global
__vt__10cCcD_GStts = .data:0x0000006C; // type:object size:0xC scope:global
+1 -1
View File
@@ -2075,7 +2075,7 @@ config.libs = [
ActorRel(NonMatching, "d_a_obj_rw"),
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_saidan"),
ActorRel(NonMatching, "d_a_obj_sakuita"),
ActorRel(NonMatching, "d_a_obj_sakuita_rope"),
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_sakuita_rope"),
ActorRel(NonMatching, "d_a_obj_scannon"),
ActorRel(NonMatching, "d_a_obj_scannon_crs"),
ActorRel(NonMatching, "d_a_obj_scannon_ten"),
+75 -24
View File
@@ -1,8 +1,52 @@
#ifndef D_A_OBJ_SAKUITA_ROPE_H
#define D_A_OBJ_SAKUITA_ROPE_H
#include "d/d_cc_d.h"
#include "f_op/f_op_actor_mng.h"
struct daObjItaRope_Attr_c {
/* 0x00 */ f32 mGravity;
/* 0x04 */ f32 mWindRate;
/* 0x08 */ f32 mSpeedRate;
/* 0x0C */ f32 mOffsetRate;
/* 0x10 */ u8 mStringWeight;
};
class Sakuita_c {
public:
/* 80CC5238 */ int setModelData(J3DModelData*);
/* 80CC527C */ void create(cXyz*, s16, s8);
/* 80CC5314 */ void execute(cXyz*, s16);
/* 80CC5354 */ void draw();
/* 80CC5390 */ void initBaseMtx();
/* 80CC53B0 */ void setBaseMtx();
/* 80CC5444 */ void setPlatePos(cXyz*);
/* 80CC5720 */ void calcAngle();
/* 80CC63E4 */ ~Sakuita_c();
/* 80CC6420 */ Sakuita_c();
/* 0x00 */ J3DModel* mModel;
/* 0x04 */ cXyz* field_0x04;
/* 0x08 */ cXyz field_0x08;
/* 0x14 */ cXyz field_0x14;
/* 0x20 */ cXyz field_0x20;
/* 0x2C */ f32 field_0x2c;
/* 0x30 */ csXyz mRotation;
/* 0x36 */ s16 field_0x36;
/* 0x38 */ s16 field_0x38;
/* 0x3A */ s8 field_0x3a;
};
class RopeWork_c {
public:
/* 80CC6424 */ ~RopeWork_c();
/* 80CC6460 */ RopeWork_c();
/* 0x00 */ cXyz field_0x00;
/* 0x0C */ cXyz field_0x0c;
/* 0x18 */ int field_0x18;
};
/**
* @ingroup actors-objects
* @class daObjItaRope_c
@@ -18,34 +62,41 @@ public:
/* 80CC5E7C */ void setBaseMtx();
/* 80CC5ECC */ void setNormalRopePos();
static u8 const M_attr[20];
inline ~daObjItaRope_c();
inline int createHeap();
inline int draw();
inline int execute();
inline int create();
daObjItaRope_Attr_c const& attr() const { return M_attr; }
u8 getJointNum() { return fopAcM_GetParam(this) & 0xff; }
int getPathID() { return (fopAcM_GetParam(this) >> 8) & 0xff; }
cXyz* getRopeStartPos() { return mLineMat.getPos(0);}
f32 getStartRate(const cXyz* pos) {
if (field_0x634 != 0) {
return field_0x62c * (pos->x - getRopeStartPos()->x);
}
return field_0x62c * (pos->z - getRopeStartPos()->z);
}
static daObjItaRope_Attr_c const M_attr;
private:
/* 0x568 */ u8 field_0x568[0x638 - 0x568];
/* 0x570 */ mDoExt_3DlineMat1_c mLineMat;
/* 0x5A4 */ request_of_phase_process_class mPhase;
/* 0x5AC */ Mtx mMtx;
/* 0x5AC */ dCcD_Stts mStts;
/* 0x618 */ RopeWork_c* mRopes;
/* 0x61C */ Sakuita_c* mSakuitas;
/* 0x620 */ cXyz field_0x620;
/* 0x62C */ f32 field_0x62c;
/* 0x630 */ f32 field_0x630;
/* 0x634 */ u8 field_0x634;
/* 0x635 */ u8 field_0x635;
/* 0x636 */ u8 field_0x636;
};
STATIC_ASSERT(sizeof(daObjItaRope_c) == 0x638);
class Sakuita_c {
public:
/* 80CC5238 */ void setModelData(J3DModelData*);
/* 80CC527C */ void create(cXyz*, s16, s8);
/* 80CC5314 */ void execute(cXyz*, s16);
/* 80CC5354 */ void draw();
/* 80CC5390 */ void initBaseMtx();
/* 80CC53B0 */ void setBaseMtx();
/* 80CC5444 */ void setPlatePos(cXyz*);
/* 80CC5720 */ void calcAngle();
/* 80CC63E4 */ ~Sakuita_c();
/* 80CC6420 */ Sakuita_c();
};
class RopeWork_c {
public:
/* 80CC6424 */ ~RopeWork_c();
/* 80CC6460 */ RopeWork_c();
};
#endif /* D_A_OBJ_SAKUITA_ROPE_H */
+9
View File
@@ -21,6 +21,15 @@ int PrmAbstract(const fopAc_ac_c* i_actor, T i_prmA, T i_prmB) {
u32 param = fopAcM_GetParam(i_actor);
return ((1 << i_prmA) - 1) & (param >> i_prmB);
}
#ifdef DEBUG
class HioVarious_c {
public:
static void init(JORReflexible*, const char*);
static void clean(JORReflexible*);
};
#endif
}; // namespace daObj
#endif /* D_A_D_A_OBJ_H */
+4 -4
View File
@@ -10,7 +10,7 @@
#include "d/d_stage.h"
#include "f_op/f_op_actor.h"
dAttention_c& dComIfGp_getAttention();
dAttention_c* dComIfGp_getAttention();
struct dCamMapToolData {
dCamMapToolData() { Clr(); }
@@ -419,9 +419,9 @@ public:
}
void Att() {
dAttention_c& attn = dComIfGp_getAttention();
mpLockonTarget = attn.LockonTruth() ? attn.LockonTarget(0) : NULL;
attn.LockSoundOn();
dAttention_c* attn = dComIfGp_getAttention();
mpLockonTarget = attn->LockonTruth() ? attn->LockonTarget(0) : NULL;
attn->LockSoundOn();
}
void SetWindow(f32 param_0, f32 param_1) {
+11 -11
View File
@@ -290,7 +290,7 @@ public:
fopAc_ac_c* getPlayer(int idx) { return (fopAc_ac_c*)mPlayer[idx * 2]; }
dPa_control_c* getParticle() { return mParticle; }
dEvent_manager_c& getEvtManager() { return mEvtManager; }
dAttention_c& getAttention() { return mAttention; }
dAttention_c* getAttention() { return &mAttention; }
dStage_startStage_c* getStartStage() { return &mStartStage; }
void setCurrentGrafPort(J2DOrthoGraph* i_graf) { mCurrentGrafPort = i_graf; }
@@ -1792,8 +1792,8 @@ inline void dComIfGs_removeZone(int i_zoneNo) {
g_dComIfG_gameInfo.info.removeZone(i_zoneNo);
}
inline void dComIfGp_addSimpleModel(J3DModelData* i_modelData, int roomNo, u8 i_drawBG) {
g_dComIfG_gameInfo.play.addSimpleModel(i_modelData, roomNo, i_drawBG);
inline int dComIfGp_addSimpleModel(J3DModelData* i_modelData, int roomNo, u8 i_drawBG) {
return g_dComIfG_gameInfo.play.addSimpleModel(i_modelData, roomNo, i_drawBG);
}
inline void dComIfGp_removeSimpleModel(J3DModelData* i_modelData, int roomNo) {
@@ -2157,40 +2157,40 @@ inline dEvent_manager_c* dComIfGp_getPEvtManager() {
return &g_dComIfG_gameInfo.play.getEvtManager();
}
inline dAttention_c& dComIfGp_getAttention() {
inline dAttention_c* dComIfGp_getAttention() {
return g_dComIfG_gameInfo.play.getAttention();
}
inline u8 dComIfGp_att_getCatchChgItem() {
return dComIfGp_getAttention().getCatchChgItem();
return dComIfGp_getAttention()->getCatchChgItem();
}
inline fopAc_ac_c* dComIfGp_att_getCatghTarget() {
return dComIfGp_getAttention().getCatghTarget();
return dComIfGp_getAttention()->getCatghTarget();
}
inline fopAc_ac_c* dComIfGp_att_getZHint() {
return dComIfGp_getAttention().getZHintTarget();
return dComIfGp_getAttention()->getZHintTarget();
}
inline int dComIfGp_att_ZHintRequest(fopAc_ac_c* param_1, int param_2) {
return dComIfGp_getAttention().ZHintRequest(param_1, param_2);
return dComIfGp_getAttention()->ZHintRequest(param_1, param_2);
}
inline void dComIfGp_att_LookRequest(fopAc_ac_c* param_0, f32 i_horizontalDist, f32 i_upDist,
f32 i_downDist, s16 i_angle, int param_5) {
dComIfGp_getAttention().LookRequest(param_0, i_horizontalDist, i_upDist, i_downDist, i_angle,
dComIfGp_getAttention()->LookRequest(param_0, i_horizontalDist, i_upDist, i_downDist, i_angle,
param_5);
}
inline void dComIfGp_att_CatchRequest(fopAc_ac_c* param_0, u8 param_1, f32 i_horizontalDist,
f32 i_upDist, f32 i_downDist, s16 i_angle, int param_5) {
dComIfGp_getAttention().CatchRequest(param_0, param_1, i_horizontalDist, i_upDist, i_downDist,
dComIfGp_getAttention()->CatchRequest(param_0, param_1, i_horizontalDist, i_upDist, i_downDist,
i_angle, param_5);
}
inline fopAc_ac_c* dComIfGp_att_getLookTarget() {
return dComIfGp_getAttention().getLookTarget();
return dComIfGp_getAttention()->getLookTarget();
}
inline J2DGrafContext* dComIfGp_getCurrentGrafPort() {
+1 -1
View File
@@ -4694,7 +4694,7 @@ int daAlink_c::create() {
return cPhs_ERROR_e;
}
mAttention = &dComIfGp_getAttention();
mAttention = dComIfGp_getAttention();
field_0x317c = dComIfGp_getPlayerCameraID(0);
playerInit();
+1 -1
View File
@@ -2327,7 +2327,7 @@ void daB_DR_c::executeBreathAttack() {
attention_info.flags &= ~0x4;
} else {
mWeekCc.OnTgSetBit();
if (mTarget != 0 || (dComIfGp_getAttention().GetLockonList(0) != NULL && dComIfGp_getAttention().LockonTruth() && dComIfGp_getAttention().GetLockonList(0)->getActor() == this)) {
if (mTarget != 0 || (dComIfGp_getAttention()->GetLockonList(0) != NULL && dComIfGp_getAttention()->LockonTruth() && dComIfGp_getAttention()->GetLockonList(0)->getActor() == this)) {
mTarget = 0;
} else {
attention_info.flags &= ~0x4;
+1 -1
View File
@@ -5411,7 +5411,7 @@ void daB_ZANT_c::cc_ice_set() {
cXyz sp40;
if (mAction == ACT_ICE_STEP || mAction == ACT_ICE_JUMP) {
if (!dComIfGp_getAttention().LockonTruth() || dComIfGp_getAttention().LockonTarget(0) != this) {
if (!dComIfGp_getAttention()->LockonTruth() || dComIfGp_getAttention()->LockonTarget(0) != this) {
mDoMtx_stack_c::copy(mpModelMorf->getModel()->getAnmMtx(JNT_FOOT_L));
mDoMtx_stack_c::transM(20.0f, 0.0f, 0.0f);
mDoMtx_stack_c::multVecZero(&sp34);
+3 -3
View File
@@ -121,9 +121,9 @@ int daCoachFire_c::execute() {
setNoHitTimer();
}
if (coach != NULL && coach->checkCoachBlazing()) {
dAttention_c& attn = dComIfGp_getAttention();
if (attn.LockonTruth()) {
if (attn.LockonTarget(0) != this) {
dAttention_c* attn = dComIfGp_getAttention();
if (attn->LockonTruth()) {
if (attn->LockonTarget(0) != this) {
if (coach->deleteFireArrowFromList(fopAcM_GetID(this)) != NULL) {
fopAcM_delete(this);
}
+2 -2
View File
@@ -1827,8 +1827,8 @@ void daCow_c::action_angry() {
}
int lockedOn = false;
if (mRunDuration && mForgetCowPTimer && dComIfGp_getAttention().LockonTruth() &&
(dComIfGp_getAttention().LockonTarget(0) == this) &&
if (mRunDuration && mForgetCowPTimer && dComIfGp_getAttention()->LockonTruth() &&
(dComIfGp_getAttention()->LockonTarget(0) == this) &&
(s16)cLib_distanceAngleS(playerAngle, mSavedAngle.y) < 0x800)
{
mTargetAngle = playerAngle;
+1 -1
View File
@@ -138,7 +138,7 @@ static void e_tk_ball_move(e_tk_ball_class* i_this) {
s8 actor_lockon = false;
fopAc_ac_c* parent_actor = fopAcM_SearchByID(actor->parentActorID);
if (parent_actor != NULL) {
dAttention_c* attention = &dComIfGp_getAttention();
dAttention_c* attention = dComIfGp_getAttention();
if (attention->Lockon() && parent_actor == attention->LockonTarget(0)) {
actor_lockon = true;
parent_actor->attention_info.flags |= 0x200000;
+3 -3
View File
@@ -348,9 +348,9 @@ u8 daE_YM_c::checkSurpriseLock() {
return 0;
}
if (mAction != 8) {
bool truth = dComIfGp_getAttention().LockonTruth();
bool truth = dComIfGp_getAttention()->LockonTruth();
if (truth) {
fopAc_ac_c* tgt = dComIfGp_getAttention().LockonTarget(0);
fopAc_ac_c* tgt = dComIfGp_getAttention()->LockonTarget(0);
if (tgt == this && mType == 0) {
cXyz my_vec_0 = current.pos - mPrevPos;
cXyz my_vec_1 = player->current.pos - mPrevPos;
@@ -1499,7 +1499,7 @@ void daE_YM_c::executeAttack() {
field_0x6a5 = 0;
break;
case 1:
if (field_0x6d4 && (dComIfGp_getAttention().LockonTruth() == 0 || dComIfGp_getAttention().LockonTarget(0) != this)) {
if (field_0x6d4 && (dComIfGp_getAttention()->LockonTruth() == 0 || dComIfGp_getAttention()->LockonTarget(0) != this)) {
if (checkSurpriseNear()) {
return;
}
+2 -2
View File
@@ -224,10 +224,10 @@ static void hahen_carry(ep_class* i_this, ep_hahen_s* hahen_s) {
hahen_s->field_0x28.x = 0;
hahen_s->field_0x28.z = 0x4000;
hahen_s->field_0x28.y = player->shape_angle.y;
if (dComIfGp_getAttention().Lockon()) {
if (dComIfGp_getAttention()->Lockon()) {
hahen_s->field_0x30 = 80.0f;
fopAc_ac_c* lockOnTarget = dComIfGp_getAttention().LockonTarget(0);
fopAc_ac_c* lockOnTarget = dComIfGp_getAttention()->LockonTarget(0);
if (lockOnTarget) {
cXyz local_34, cStack_28;
local_34 = lockOnTarget->current.pos - hahen_s->field_0x4;
+2 -2
View File
@@ -1942,7 +1942,7 @@ int daHorse_c::setSpeedAndAngle() {
}
if (checkStateFlg0(FLG0_UNK_1)) {
dAttention_c* attention = &dComIfGp_getAttention();
dAttention_c* attention = dComIfGp_getAttention();
if (attention->GetLockonList(0) != NULL && attention->LockonTruth() && fopAcM_searchActorDistanceXZ2(this, attention->GetLockonList(0)->getActor()) > 1000000.0f) {
cLib_addCalcAngleS(&current.angle.y, fopAcM_searchActorAngleY(this, attention->GetLockonList(0)->getActor()), 5, field_0x16c2, daHorse_hio_c0::m.min_turn);
if (!checkStateFlg0(daHorse_FLG0(FLG0_UNK_100000 | FLG0_UNK_200000))) {
@@ -3099,7 +3099,7 @@ BOOL daHorse_c::checkServiceWaitAnime() {
/* 80840844-808408F0 008A04 00AC+00 2/2 0/0 0/0 .text checkTurnInput__9daHorse_cFv */
BOOL daHorse_c::checkTurnInput() {
return m_padStickValue > 0.9f && (!dComIfGp_getAttention().Lockon() || daAlink_getAlinkActorClass()->getAtnActor() != NULL);
return m_padStickValue > 0.9f && (!dComIfGp_getAttention()->Lockon() || daAlink_getAlinkActorClass()->getAtnActor() != NULL);
}
/* 808408F0-808409C0 008AB0 00D0+00 2/2 0/0 0/0 .text checkTgHitTurn__9daHorse_cFv */
+1 -1
View File
@@ -481,7 +481,7 @@ void daHoZelda_c::setAnm() {
}
BOOL gnd_lockon;
if (dComIfGp_getAttention().GetLockonList(0) != NULL && dComIfGp_getAttention().LockonTruth() && dComIfGp_getAttention().GetLockonList(0)->getActor() == gnd_actor) {
if (dComIfGp_getAttention()->GetLockonList(0) != NULL && dComIfGp_getAttention()->LockonTruth() && dComIfGp_getAttention()->GetLockonList(0)->getActor() == gnd_actor) {
gnd_lockon = TRUE;
} else {
gnd_lockon = FALSE;
+21 -21
View File
@@ -2234,11 +2234,11 @@ BOOL daNpcT_c::chkFindActor(fopAc_ac_c* i_actor, BOOL i_release, s16 i_angleY) {
int dist_index = i_release == FALSE ? attention_info.distances[fopAc_attn_SPEAK_e]
: attention_info.distances[fopAc_attn_TALK_e];
f32 dist_max = i_release == FALSE ? dComIfGp_getAttention().getDistTable(dist_index).mDistMax
: dComIfGp_getAttention().getDistTable(dist_index).mDistMaxRelease;
f32 lower_y = dComIfGp_getAttention().getDistTable(dist_index).mLowerY * -1.0f;
f32 upper_y = dComIfGp_getAttention().getDistTable(dist_index).mUpperY * -1.0f;
u32 angle_select = dComIfGp_getAttention().getDistTable(dist_index).mAngleSelect;
f32 dist_max = i_release == FALSE ? dComIfGp_getAttention()->getDistTable(dist_index).mDistMax
: dComIfGp_getAttention()->getDistTable(dist_index).mDistMaxRelease;
f32 lower_y = dComIfGp_getAttention()->getDistTable(dist_index).mLowerY * -1.0f;
f32 upper_y = dComIfGp_getAttention()->getDistTable(dist_index).mUpperY * -1.0f;
u32 angle_select = dComIfGp_getAttention()->getDistTable(dist_index).mAngleSelect;
f32 fov = 180.0f;
if (angle_select & 8) {
@@ -2286,17 +2286,17 @@ BOOL daNpcT_c::chkFindWolf(s16 i_angleY, int i_distIndex, int param_2, f32 i_bou
return TRUE;
}
f32 dist_max = dComIfGp_getAttention().getDistTable(i_distIndex).mDistMax;
f32 upper_y = dComIfGp_getAttention().getDistTable(i_distIndex).mUpperY;
f32 lower_y = dComIfGp_getAttention().getDistTable(i_distIndex).mLowerY;
f32 dist_max = dComIfGp_getAttention()->getDistTable(i_distIndex).mDistMax;
f32 upper_y = dComIfGp_getAttention()->getDistTable(i_distIndex).mUpperY;
f32 lower_y = dComIfGp_getAttention()->getDistTable(i_distIndex).mLowerY;
if (chkPointInArea(attn_pos, attention_info.position, dist_max, upper_y, lower_y, 0)) {
return TRUE;
}
int dist_index = attention_info.distances[fopAc_attn_TALK_e];
dist_max = dComIfGp_getAttention().getDistTable(dist_index).mDistMax;
upper_y = dComIfGp_getAttention().getDistTable(dist_index).mUpperY;
lower_y = dComIfGp_getAttention().getDistTable(dist_index).mLowerY;
dist_max = dComIfGp_getAttention()->getDistTable(dist_index).mDistMax;
upper_y = dComIfGp_getAttention()->getDistTable(dist_index).mUpperY;
lower_y = dComIfGp_getAttention()->getDistTable(dist_index).mLowerY;
if (chkPointInArea(attn_pos, attention_info.position, dist_max, upper_y, lower_y, 0)
&& param_2 < 2 && param_7 && chkWolfAction())
{
@@ -2437,8 +2437,8 @@ void daNpcT_c::calcSpeedAndAngle(cXyz i_target, BOOL i_stop, s16 i_angleScale, s
*/
int daNpcT_c::getActorDistance(fopAc_ac_c* i_actor, int i_distIndex1, int i_distIndex2) {
int ret = 0;
f32 dist1 = dComIfGp_getAttention().getDistTable(i_distIndex1).mDistMax;
f32 dist2 = dComIfGp_getAttention().getDistTable(i_distIndex2).mDistMax;
f32 dist1 = dComIfGp_getAttention()->getDistTable(i_distIndex1).mDistMax;
f32 dist2 = dComIfGp_getAttention()->getDistTable(i_distIndex2).mDistMax;
f32 actor_dist = fopAcM_searchActorDistanceXZ(this, i_actor);
if (actor_dist < dist1) {
@@ -2697,19 +2697,19 @@ BOOL daNpcT_chkDoBtnIsSpeak(fopAc_ac_c* i_actor_p) {
if (daPy_getPlayerActorClass()->checkPriActorOwn(i_actor_p)) {
JUT_ASSERT(4965, 0 != dComIfGp_getAttention());
for (int i = 0; i < dComIfGp_getAttention().GetActionCount(); i++) {
if (dComIfGp_getAttention().ActionTarget(i) == i_actor_p &&
dComIfGp_getAttention().getActionBtnB() != NULL &&
dComIfGp_getAttention().getActionBtnB()->mType == 3)
for (int i = 0; i < dComIfGp_getAttention()->GetActionCount(); i++) {
if (dComIfGp_getAttention()->ActionTarget(i) == i_actor_p &&
dComIfGp_getAttention()->getActionBtnB() != NULL &&
dComIfGp_getAttention()->getActionBtnB()->mType == 3)
{
ret = TRUE;
}
}
for (int i = 0; i < dComIfGp_getAttention().GetLockonCount(); i++) {
if (dComIfGp_getAttention().LockonTarget(i) == i_actor_p &&
dComIfGp_getAttention().getActionBtnB() != NULL &&
dComIfGp_getAttention().getActionBtnB()->mType == 1)
for (int i = 0; i < dComIfGp_getAttention()->GetLockonCount(); i++) {
if (dComIfGp_getAttention()->LockonTarget(i) == i_actor_p &&
dComIfGp_getAttention()->getActionBtnB() != NULL &&
dComIfGp_getAttention()->getActionBtnB()->mType == 1)
{
ret = TRUE;
}
+17 -17
View File
@@ -1358,14 +1358,14 @@ BOOL daNpcF_c::chkActorInArea(fopAc_ac_c* i_actor, cXyz i_center, cXyz i_bounds,
BOOL daNpcF_c::chkActorInAttnArea(fopAc_ac_c* i_actorCheck, fopAc_ac_c* i_actorAttn,
int i_distIndex) {
BOOL ret = false;
f32 neg_lower_y = dComIfGp_getAttention().getDistTable(i_distIndex).mLowerY * -1.0f;
f32 neg_upper_y = dComIfGp_getAttention().getDistTable(i_distIndex).mUpperY * -1.0f;
f32 neg_lower_y = dComIfGp_getAttention()->getDistTable(i_distIndex).mLowerY * -1.0f;
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).mDistMax;
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).mDistMax;
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)) {
@@ -1681,11 +1681,11 @@ BOOL daNpcF_c::chkFindPlayer2(BOOL i_hasAttn, s16 i_angle) {
cXyz attn_pos = getAttentionPos(daPy_getPlayerActorClass());
int attn_no = i_hasAttn == false ? attention_info.distances[fopAc_attn_SPEAK_e]
: attention_info.distances[fopAc_attn_TALK_e];
f32 dist_max = i_hasAttn == false ? dComIfGp_getAttention().getDistTable(attn_no).mDistMax
: dComIfGp_getAttention().getDistTable(attn_no).mDistMaxRelease;
f32 lower_y = dComIfGp_getAttention().getDistTable(attn_no).mLowerY * -1.0f;
f32 upper_y = dComIfGp_getAttention().getDistTable(attn_no).mUpperY * -1.0f;
u32 angle_select = dComIfGp_getAttention().getDistTable(attn_no).mAngleSelect;
f32 dist_max = i_hasAttn == false ? dComIfGp_getAttention()->getDistTable(attn_no).mDistMax
: dComIfGp_getAttention()->getDistTable(attn_no).mDistMaxRelease;
f32 lower_y = dComIfGp_getAttention()->getDistTable(attn_no).mLowerY * -1.0f;
f32 upper_y = dComIfGp_getAttention()->getDistTable(attn_no).mUpperY * -1.0f;
u32 angle_select = dComIfGp_getAttention()->getDistTable(attn_no).mAngleSelect;
f32 fovy = 180.0f;
if (angle_select & 8) {
@@ -1911,19 +1911,19 @@ bool daNpcF_chkDoBtnEqSpeak(fopAc_ac_c* i_actor_p) {
bool ret = FALSE;
if (daPy_getPlayerActorClass()->checkPriActorOwn(i_actor_p)) {
for (int i = 0; i < dComIfGp_getAttention().GetActionCount(); i++) {
if (dComIfGp_getAttention().ActionTarget(i) == i_actor_p &&
dComIfGp_getAttention().getActionBtnB() &&
dComIfGp_getAttention().getActionBtnB()->mType == 3)
for (int i = 0; i < dComIfGp_getAttention()->GetActionCount(); i++) {
if (dComIfGp_getAttention()->ActionTarget(i) == i_actor_p &&
dComIfGp_getAttention()->getActionBtnB() &&
dComIfGp_getAttention()->getActionBtnB()->mType == 3)
{
ret = TRUE;
}
}
for (int i = 0; i < dComIfGp_getAttention().GetLockonCount(); i++) {
if (dComIfGp_getAttention().LockonTarget(i) == i_actor_p &&
dComIfGp_getAttention().getActionBtnB() &&
dComIfGp_getAttention().getActionBtnB()->mType == 1)
for (int i = 0; i < dComIfGp_getAttention()->GetLockonCount(); i++) {
if (dComIfGp_getAttention()->LockonTarget(i) == i_actor_p &&
dComIfGp_getAttention()->getActionBtnB() &&
dComIfGp_getAttention()->getActionBtnB()->mType == 1)
{
ret = TRUE;
}
+4 -4
View File
@@ -163,10 +163,10 @@ void daNpc_FairySeirei_c::reset() {
void daNpc_FairySeirei_c::setParam() {
selectAction();
srchActors();
dComIfGp_getAttention().getDistTable(0x28).mDistMax = daNpc_FairySeirei_Param_c::m[36];
dComIfGp_getAttention().getDistTable(0x28).mDistMaxRelease = daNpc_FairySeirei_Param_c::m[36];
dComIfGp_getAttention().getDistTable(0x27).mDistMax = daNpc_FairySeirei_Param_c::m[36];
dComIfGp_getAttention().getDistTable(0x27).mDistMaxRelease = daNpc_FairySeirei_Param_c::m[36];
dComIfGp_getAttention()->getDistTable(0x28).mDistMax = daNpc_FairySeirei_Param_c::m[36];
dComIfGp_getAttention()->getDistTable(0x28).mDistMaxRelease = daNpc_FairySeirei_Param_c::m[36];
dComIfGp_getAttention()->getDistTable(0x27).mDistMax = daNpc_FairySeirei_Param_c::m[36];
dComIfGp_getAttention()->getDistTable(0x27).mDistMaxRelease = daNpc_FairySeirei_Param_c::m[36];
attention_info.distances[fopAc_attn_LOCK_e] = 0x27;
attention_info.distances[fopAc_attn_TALK_e] = 0x27;
attention_info.distances[fopAc_attn_SPEAK_e] = 0x27;
+1 -1
View File
@@ -1625,7 +1625,7 @@ static int npc_ks_demo_02(npc_ks_class* i_this) {
a_this->attention_info.distances[3] = 2;
}
if (i_this == (npc_ks_class*)dComIfGp_getAttention().LockonTarget(0) && i_this->mTimers[2] == 0
if (i_this == (npc_ks_class*)dComIfGp_getAttention()->LockonTarget(0) && i_this->mTimers[2] == 0
&& mDoCPd_c::getTrigA(PAD_1) != 0) {
i_this->mMode = 17;
anm_init(i_this, 25, 2.0f, 0, 1.0f);

Some files were not shown because too many files have changed in this diff Show More