mirror of
https://github.com/zeldaret/ss
synced 2026-07-31 08:05:47 -04:00
Merge pull request #183 from Seba244c/main
d_a_obj_tarzan_pole Implementation
This commit is contained in:
@@ -2,17 +2,17 @@ _prolog = .text:0x00000000; // type:function size:0x2C scope:global
|
||||
_epilog = .text:0x00000030; // type:function size:0x2C scope:global
|
||||
_unresolved = .text:0x00000060; // type:function size:0x4 scope:global
|
||||
dAcOTarzanPole_c_classInit__Fv = .text:0x00000070; // type:function size:0x6C
|
||||
AcOTarzanPole__initModels = .text:0x000000E0; // type:function size:0xCC
|
||||
AcOTarzanPole__init = .text:0x000001B0; // type:function size:0x16C
|
||||
fn_288_320 = .text:0x00000320; // type:function size:0x8
|
||||
AcOTarzanPole__update = .text:0x00000330; // type:function size:0x224
|
||||
AcOTarzanPole__draw = .text:0x00000560; // type:function size:0x28
|
||||
createHeap__16dAcOTarzanPole_cFv = .text:0x000000E0; // type:function size:0xCC
|
||||
create__16dAcOTarzanPole_cFv = .text:0x000001B0; // type:function size:0x16C
|
||||
doDelete__16dAcOTarzanPole_cFv = .text:0x00000320; // type:function size:0x8
|
||||
actorExecute__16dAcOTarzanPole_cFv = .text:0x00000330; // type:function size:0x224
|
||||
draw__16dAcOTarzanPole_cFv = .text:0x00000560; // type:function size:0x28
|
||||
__dt__16dAcOTarzanPole_cFv = .text:0x00000590; // type:function size:0x80
|
||||
_ctors = .ctors:0x00000000; // type:label scope:global
|
||||
_dtors = .dtors:0x00000000; // type:label scope:global
|
||||
lbl_288_rodata_0 = .rodata:0x00000000; // type:object size:0x4C data:float
|
||||
lbl_288_rodata_0 = .rodata:0x00000000; // type:object size:0x4C scope:local data:float
|
||||
g_profile_OBJ_TARZAN_POLE = .data:0x00000000; // type:object size:0x10
|
||||
lbl_288_data_10 = .data:0x00000010; // type:object size:0x30
|
||||
lbl_288_data_40 = .data:0x00000040; // type:object size:0x8 data:string
|
||||
lbl_288_data_48 = .data:0x00000048; // type:object size:0x20
|
||||
AcOTarzanPole__vtable = .data:0x00000068; // type:object size:0x80
|
||||
sCcSrc__16dAcOTarzanPole_c = .data:0x00000010; // type:object size:0x30
|
||||
@23333 = .data:0x00000040; // type:object size:0x8 scope:local data:string
|
||||
@23358 = .data:0x00000048; // type:object size:0x20 scope:local
|
||||
__vt__16dAcOTarzanPole_c = .data:0x00000068; // type:object size:0x80
|
||||
|
||||
+1
-1
@@ -2293,7 +2293,7 @@ config.libs = [
|
||||
Rel(NonMatching, "d_a_obj_syako_shutter", "REL/d/a/obj/d_a_obj_syako_shutter.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_tableware", "REL/d/a/obj/d_a_obj_tableware.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_tackle", "REL/d/a/obj/d_a_obj_tackle.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_tarzan_pole", "REL/d/a/obj/d_a_obj_tarzan_pole.cpp"),
|
||||
Rel(Matching, "d_a_obj_tarzan_pole", "REL/d/a/obj/d_a_obj_tarzan_pole.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_tenijima", "REL/d/a/obj/d_a_obj_tenijima.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_teni_rail", "REL/d/a/obj/d_a_obj_teni_rail.cpp"),
|
||||
Rel(
|
||||
|
||||
@@ -2,13 +2,35 @@
|
||||
#define D_A_OBJ_TARZAN_POLE_H
|
||||
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/col/bg/d_bg_w.h"
|
||||
#include "d/col/cc/d_cc_d.h"
|
||||
#include "m/m3d/m_smdl.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "nw4r/g3d/res/g3d_resfile.h"
|
||||
|
||||
class dAcOTarzanPole_c : public dAcObjBase_c {
|
||||
public:
|
||||
dAcOTarzanPole_c() {}
|
||||
virtual ~dAcOTarzanPole_c() {}
|
||||
|
||||
virtual bool createHeap() override;
|
||||
virtual int create() override;
|
||||
virtual int doDelete() override;
|
||||
virtual int actorExecute() override;
|
||||
virtual int draw() override;
|
||||
|
||||
private:
|
||||
static dCcD_SrcSph sCcSrc;
|
||||
|
||||
static const f32 sXOffset;
|
||||
static const f32 sYOffset;
|
||||
|
||||
/* 0x330 */ nw4r::g3d::ResFile mBrres;
|
||||
/* 0x334 */ m3d::smdl_c mMdl;
|
||||
/* 0x350 */ dBgW mBgCollider;
|
||||
/* 0x560 */ dCcD_Sph mCollider;
|
||||
/* 0x6b0 */ mVec3_c mVec; // TODO: Find better name, once we've figured out it's purpose
|
||||
/* 0x6bc */ f32 mFloat; // TODO: No usage found yet
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,107 @@
|
||||
#include "d/a/obj/d_a_obj_tarzan_pole.h"
|
||||
|
||||
#include "d/a/d_a_base.h"
|
||||
#include "d/a/d_a_item.h"
|
||||
#include "d/a/d_a_itembase.h"
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "d/col/cc/d_cc_d.h"
|
||||
#include "d/col/cc/d_cc_s.h"
|
||||
#include "f/f_base.h"
|
||||
#include "nw4r/g3d/res/g3d_resmdl.h"
|
||||
#include "toBeSorted/attention.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_TARZAN_POLE, dAcOTarzanPole_c, fProfile::OBJ_TARZAN_POLE, 0x235, 0, 3);
|
||||
|
||||
// clang-format off
|
||||
dCcD_SrcSph dAcOTarzanPole_c::sCcSrc = {
|
||||
/* mObjInf */ {
|
||||
/* mObjAt */ {0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0},
|
||||
/* mObjTg */ {(AT_TYPE_WHIP | AT_TYPE_WIND), 0x800311, {0, 0, 0x407}, 0x0000, 0x0000},
|
||||
/* mObjCo */ {0x00000000}},
|
||||
/* mSphInf */ {10.0f}
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
const f32 dAcOTarzanPole_c::sXOffset = 320.0f;
|
||||
const f32 dAcOTarzanPole_c::sYOffset = 0.0f;
|
||||
|
||||
bool dAcOTarzanPole_c::createHeap() {
|
||||
// Get Res File
|
||||
void *resFile = getOarcResFile("WhipBar");
|
||||
mBrres = nw4r::g3d::ResFile(resFile);
|
||||
|
||||
// Create model
|
||||
nw4r::g3d::ResMdl resMdl = mBrres.GetResMdl("WhipBar");
|
||||
TRY_CREATE(mMdl.create(resMdl, &heap_allocator, 0x120, 1, nullptr));
|
||||
|
||||
// Load Collider
|
||||
void *dzb = getOarcDZB("WhipBar", "WhipBar");
|
||||
void *plc = getOarcPLC("WhipBar", "WhipBar");
|
||||
updateMatrix();
|
||||
if (mBgCollider.Set((cBgD_t *)dzb, (PLC *)plc, 1, &mWorldMtx, &mScale)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int dAcOTarzanPole_c::create() {
|
||||
CREATE_ALLOCATOR(dAcOTarzanPole_c);
|
||||
|
||||
dBgS::GetInstance()->Regist(&mBgCollider, this);
|
||||
|
||||
mStts.SetRank(1);
|
||||
mCollider.Set(sCcSrc);
|
||||
mCollider.SetStts(mStts);
|
||||
|
||||
forwardAccel = 0.0f;
|
||||
forwardMaxSpeed = -40.0f;
|
||||
|
||||
mFloat = (s32)(params & 0xFF) * 10.0f;
|
||||
if ((s32)(params & 0xFF) == 0xFF) {
|
||||
mFloat = 0.0f;
|
||||
}
|
||||
|
||||
mVec = mVec3_c::Ex * 400.0f;
|
||||
mVec.rotY(rotation.y);
|
||||
boundingBox.Set(mVec3_c(-0.0f, -120.0f, -110.0f), mVec3_c(500.0f, 140.0f, 110.0f));
|
||||
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOTarzanPole_c::doDelete() {
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOTarzanPole_c::actorExecute() {
|
||||
updateMatrix();
|
||||
mMdl.setLocalMtx(mWorldMtx);
|
||||
mMdl.calc(false);
|
||||
|
||||
const dAcPy_c *player = dAcPy_c::GetLink();
|
||||
bool bVar = false;
|
||||
if (mCollider.ChkTgHit() && mCollider.ChkTgAtHitType(AT_TYPE_WHIP)) {
|
||||
setObjectProperty(0x1000);
|
||||
}
|
||||
|
||||
mVec = mVec3_c::Ex * sXOffset + mVec3_c::Ey * sYOffset;
|
||||
mVec.rotY(rotation.y);
|
||||
poscopy2 = position + mVec;
|
||||
poscopy3 = poscopy2 + mVec3_c::Ey * 20.0f;
|
||||
|
||||
// 0x400000 corresponds to dAcPy_FLG0::FLG0_SWING_ROPE
|
||||
if (player != nullptr && !player->checkActionFlags(0x400000) && dAcItem_c::checkFlag(ITEM_WHIP)) {
|
||||
AttentionManager::GetInstance()->addUnk7Target(*this, 1, 1000.0f, 10.0f, -600.0, 200);
|
||||
}
|
||||
|
||||
mCollider.SetC(poscopy2);
|
||||
|
||||
dCcS::GetInstance()->Set(&mCollider);
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOTarzanPole_c::draw() {
|
||||
drawModelType1(&mMdl);
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user