mirror of
https://github.com/zeldaret/ss
synced 2026-06-12 13:34:57 -04:00
Improve dAcBase_c (#133)
* Improve dAcBase_c * Fix missed polyAttr0/1 renaming * Add getters for EventManager funcs used in dAcBase * Fix include * Replace actor_properties with helper calls * Fix SoundInfo TList function (thanks robo) * Make roundAngleToNearest90 static * Fix removeSoundInfo symbol * Revert d_a_item spawnItem and spawnDrop param change * Fix d_t_reaction and improve spawnHearts a bit * Also update special_item_drop_mgr * Fix special_item_drop_mgr * Small fixes --------- Co-authored-by: robojumper <robojumper@gmail.com> Co-authored-by: elijah-thomas774 <elijahthomas774@gmail.com>
This commit is contained in:
@@ -41,7 +41,7 @@ d/a/d_a_base.cpp:
|
||||
.data start:0x80501538 end:0x805015B8
|
||||
.sdata start:0x80571920 end:0x80571930
|
||||
.sbss start:0x80575080 end:0x80575098
|
||||
.sdata2 start:0x80576C88 end:0x80576C8C
|
||||
.sdata2 start:0x80576C88 end:0x80576CA0
|
||||
|
||||
d/a/obj/d_a_obj_base.cpp:
|
||||
.text start:0x8002DE40 end:0x8002F300
|
||||
|
||||
+12
-12
@@ -1030,7 +1030,7 @@ createHeap__9dAcBase_cFv = .text:0x8002C3A0; // type:function size:0x8
|
||||
__ct__9dAcBase_cFv = .text:0x8002C3B0; // type:function size:0x178
|
||||
__dt__7dBase_cFv = .text:0x8002C530; // type:function size:0x58
|
||||
__dt__9dAcBase_cFv = .text:0x8002C590; // type:function size:0xB4
|
||||
setTempCreateParams__9dAcBase_cFP7mVec3_cP7mAng3_cP7mVec3_clUlP9dAcBase_cUcsUcP7ObjInfo = .text:0x8002C650; // type:function size:0x34
|
||||
setTempCreateParams__9dAcBase_cFP7mVec3_cP7mAng3_cP7mVec3_clUlP9dAcBase_cUcUsScP7ObjInfo = .text:0x8002C650; // type:function size:0x34
|
||||
FUN_8002c690__9dAcBase_cFv = .text:0x8002C690; // type:function size:0x78
|
||||
initAllocatorWork1Heap__9dAcBase_cFiPci = .text:0x8002C710; // type:function size:0xC
|
||||
initAllocator__9dAcBase_cFiPcPQ23EGG4Heapi = .text:0x8002C720; // type:function size:0x8C
|
||||
@@ -1085,7 +1085,7 @@ FUN_8002d810__9dAcBase_cFv = .text:0x8002D810; // type:function size:0x20
|
||||
FUN_8002d830__9dAcBase_cFv = .text:0x8002D830; // type:function size:0x28
|
||||
FUN_8002d860__9dAcBase_cFv = .text:0x8002D860; // type:function size:0x20
|
||||
getSoundSource__9dAcBase_cFv = .text:0x8002D880; // type:function size:0x8
|
||||
FUN_8002d890__9dAcBase_cFP9SoundInfo = .text:0x8002D890; // type:function size:0x88
|
||||
removeSoundInfo__9dAcBase_cFP9SoundInfo = .text:0x8002D890; // type:function size:0x88
|
||||
setActorRef__9dAcBase_cFP9dAcBase_c = .text:0x8002D920; // type:function size:0x8
|
||||
setEnemyDefeatFlag__9dAcBase_cFv = .text:0x8002D930; // type:function size:0x10
|
||||
changeLoadedEntitiesWithSet__9dAcBase_cFv = .text:0x8002D940; // type:function size:0x14
|
||||
@@ -1095,14 +1095,14 @@ createActorStage__9dAcBase_cFUsUlP7mVec3_cP7mAng3_cP7mVec3_cUllP7dBase_c = .text
|
||||
registerInEvent__9dAcBase_cFv = .text:0x8002DB80; // type:function size:0x4
|
||||
unkVirtFunc_0x6C__9dAcBase_cFv = .text:0x8002DB90; // type:function size:0x4
|
||||
doInteraction__9dAcBase_cFl = .text:0x8002DBA0; // type:function size:0x80
|
||||
FUN_8002dc20__9dAcBase_cFPsPs = .text:0x8002DC20; // type:function size:0x28
|
||||
roundAngleToNearest90__9dAcBase_cFPsPs = .text:0x8002DC20; // type:function size:0x28
|
||||
incrementKillCounter__9dAcBase_cFv = .text:0x8002DC50; // type:function size:0x7C
|
||||
FUN_8002dcd0__9dAcBase_cFv = .text:0x8002DCD0; // type:function size:0x3C
|
||||
FUN_8002dd10__9dAcBase_cFv = .text:0x8002DD10; // type:function size:0x3C
|
||||
FUN_8002dd50__9dAcBase_cFv = .text:0x8002DD50; // type:function size:0x34
|
||||
FUN_8002dd90__9dAcBase_cFv = .text:0x8002DD90; // type:function size:0x3C
|
||||
FUN_8002ddd0__9dAcBase_cFv = .text:0x8002DDD0; // type:function size:0x54
|
||||
FUN_8002de30__9dAcBase_cFR13cBgS_PolyInfo = .text:0x8002DE30; // type:function size:0x4
|
||||
killNoItemDrop__9dAcBase_cFv = .text:0x8002DCD0; // type:function size:0x3C
|
||||
killWithFlag__9dAcBase_cFv = .text:0x8002DD10; // type:function size:0x3C
|
||||
killWithFlagNoItemDrop__9dAcBase_cFv = .text:0x8002DD50; // type:function size:0x34
|
||||
deleteWithFlagNoItemDrop__9dAcBase_cFv = .text:0x8002DD90; // type:function size:0x3C
|
||||
setPolyAttrs__9dAcBase_cFR13cBgS_PolyInfo = .text:0x8002DDD0; // type:function size:0x54
|
||||
setPolyAttrsDupe__9dAcBase_cFR13cBgS_PolyInfo = .text:0x8002DE30; // type:function size:0x4
|
||||
getOarcFile__12dAcObjBase_cFPCcPCc = .text:0x8002DE40; // type:function size:0x14
|
||||
ActorObjectBase__getOarcSubentry = .text:0x8002DE60; // type:function size:0x14
|
||||
getOarcResFile__12dAcObjBase_cFPCc = .text:0x8002DE80; // type:function size:0xC
|
||||
@@ -3039,7 +3039,7 @@ set__16LayoutArcControlFPCPCcl = .text:0x8006A350; // type:function size:0xC
|
||||
load__16LayoutArcControlFPQ23EGG4Heap = .text:0x8006A360; // type:function size:0x88
|
||||
fn_8006A3F0 = .text:0x8006A3F0; // type:function size:0x88
|
||||
release__16LayoutArcControlFv = .text:0x8006A480; // type:function size:0xC4
|
||||
getActorInfoForObjName = .text:0x8006A550; // type:function size:0x98
|
||||
getObjByActorName_unkNamespace = .text:0x8006A550; // type:function size:0x98
|
||||
getActorIdForObjName = .text:0x8006A5F0; // type:function size:0x34
|
||||
getActorIdForObjName2 = .text:0x8006A630; // type:function size:0x34
|
||||
fn_8006A670 = .text:0x8006A670; // type:function size:0xB8
|
||||
@@ -17275,7 +17275,7 @@ cLib__addCalcPosXZ2 = .text:0x802E02D0; // type:function size:0xF8
|
||||
cLib__chasePos = .text:0x802E03D0; // type:function size:0x174
|
||||
cLib__chasePosXZ = .text:0x802E0550; // type:function size:0x124
|
||||
targetAngleY__4cLibFRC7mVec3_cRC7mVec3_c = .text:0x802E0680; // type:function size:0x1C
|
||||
cLib__targetAngleX = .text:0x802E06A0; // type:function size:0x68
|
||||
targetAngleX__4cLibFRC7mVec3_cRC7mVec3_c = .text:0x802E06A0; // type:function size:0x68
|
||||
cLib__offsetPos = .text:0x802E0710; // type:function size:0xD8
|
||||
fn_802E07F0 = .text:0x802E07F0; // type:function size:0x24
|
||||
fn_802E0820 = .text:0x802E0820; // type:function size:0x34
|
||||
@@ -29918,7 +29918,7 @@ lbl_805014C0 = .data:0x805014C0; // type:object size:0x28
|
||||
lbl_805014E8 = .data:0x805014E8; // type:object size:0x18
|
||||
lbl_80501500 = .data:0x80501500; // type:object size:0x28
|
||||
lbl_80501528 = .data:0x80501528; // type:object size:0x10
|
||||
lbl_80501538 = .data:0x80501538; // type:object size:0xC data:string
|
||||
@19465 = .data:0x80501538; // type:object size:0xC data:string
|
||||
__vt__9dAcBase_c = .data:0x80501544; // type:object size:0x74
|
||||
ActorObjectBase__vtable = .data:0x805015B8; // type:object size:0x80
|
||||
lbl_80501638 = .data:0x80501638; // type:object size:0xC
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
namespace cLib {
|
||||
|
||||
s32 targetAngleY(const mVec3_c &target, const mVec3_c &source);
|
||||
s32 targetAngleX(const mVec3_c &target, const mVec3_c &source);
|
||||
f32 addCalcPosXZ(mVec3_c *src, const mVec3_c &target, f32 scale, f32 maxStep, f32 minStep);
|
||||
|
||||
} // namespace cLib
|
||||
|
||||
+15
-14
@@ -6,13 +6,14 @@
|
||||
#include "m/m_allocator.h"
|
||||
#include "m/m_angle.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "toBeSorted/raii_ptr.h"
|
||||
#include "toBeSorted/tlist.h"
|
||||
|
||||
class dAcBase_c;
|
||||
struct cBgS_PolyInfo;
|
||||
|
||||
struct SoundSource {
|
||||
// TODO
|
||||
virtual ~SoundSource() {}
|
||||
};
|
||||
|
||||
struct SoundInfo {
|
||||
@@ -71,7 +72,7 @@ public:
|
||||
/* 0x68 */ mHeapAllocator_c heap_allocator;
|
||||
/* 0x84 */ ObjInfo *obj_info;
|
||||
/* 0x88 */ TList<SoundInfo, 12> sound_list;
|
||||
/* 0x94 */ SoundSource *sound_source;
|
||||
/* 0x94 */ RaiiPtr<SoundSource> sound_source;
|
||||
/* 0x98 */ mVec3_c *obj_pos;
|
||||
/* 0x9C */ mVec3_c pos_copy;
|
||||
/* 0xA8 */ u32 params2;
|
||||
@@ -88,8 +89,8 @@ public:
|
||||
/* 0xE8 */ u32 field_0xe8;
|
||||
/* 0xEC */ s8 roomid;
|
||||
/* 0xED */ u8 actor_subtype;
|
||||
/* 0xEE */ u8 field_0xEE;
|
||||
/* 0xEF */ u8 field_0xEF;
|
||||
/* 0xEE */ u8 polyAttr0;
|
||||
/* 0xEF */ u8 polyAttr1;
|
||||
/* 0xF0 */ u32 JStudio_actor;
|
||||
/* 0xF4 */ char someStr[4];
|
||||
/* 0xF8 */ char field_0xf8[0xfc - 0xf8];
|
||||
@@ -176,8 +177,8 @@ public:
|
||||
public:
|
||||
// funcs found in TU
|
||||
/* 8002c650 */ static void setTempCreateParams(
|
||||
mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2, dAcBase_c *parent, u8 subtype, s16 unkFlag,
|
||||
u8 viewClipIdx, ObjInfo *objInfo
|
||||
mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2, dAcBase_c *parent, u8 subtype, u16 unkFlag,
|
||||
s8 viewClipIdx, ObjInfo *objInfo
|
||||
);
|
||||
|
||||
/* 8002c690 */ SoundSource *FUN_8002c690();
|
||||
@@ -232,7 +233,7 @@ public:
|
||||
/* 8002d880 */ SoundSource *getSoundSource();
|
||||
// End of SoundSource stuff
|
||||
|
||||
/* 8002d890 */ void FUN_8002d890();
|
||||
/* 8002d890 */ void removeSoundInfo(SoundInfo *);
|
||||
/* 8002d920 */ void setActorRef(dAcBase_c *);
|
||||
// next three funcs are related
|
||||
/* 8002d930 */ void setEnemyDefeatFlag();
|
||||
@@ -249,14 +250,14 @@ public:
|
||||
dBase_c *ref
|
||||
);
|
||||
|
||||
/* 8002dc20 */ void FUN_8002dc20(s16 *, s16 *);
|
||||
/* 8002dc20 */ static void roundAngleToNearest90(s16 *, s16 *);
|
||||
/* 8002dc50 */ void incrementKillCounter();
|
||||
/* 8002dcd0 */ void FUN_8002dcd0();
|
||||
/* 8002dd10 */ void FUN_8002dd10();
|
||||
/* 8002dd50 */ void FUN_8002dd50();
|
||||
/* 8002dd90 */ void FUN_8002dd90();
|
||||
/* 8002ddd0 */ void FUN_8002ddd0();
|
||||
/* 8002de30 */ void FUN_8002de30(cBgS_PolyInfo &p);
|
||||
/* 8002dcd0 */ void killNoItemDrop();
|
||||
/* 8002dd10 */ void killWithFlag();
|
||||
/* 8002dd50 */ void killWithFlagNoItemDrop();
|
||||
/* 8002dd90 */ void deleteWithFlagNoItemDrop();
|
||||
/* 8002ddd0 */ void setPolyAttrs(cBgS_PolyInfo &p);
|
||||
/* 8002de30 */ void setPolyAttrsDupe(cBgS_PolyInfo &p);
|
||||
|
||||
public:
|
||||
/* 80571920 */ static u32 s_Create_RoomId;
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
STATE_FUNC_DECLARE(dAcOVortex_c, Appear);
|
||||
|
||||
void triggerActivation() {
|
||||
actor_properties |= 0x4;
|
||||
setActorProperty(0x4);
|
||||
field_0x870 = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/col/cc/d_cc_d.h"
|
||||
#include "m/m_angle.h"
|
||||
#include "s/s_State.hpp"
|
||||
#include "s/s_StateMgr.hpp"
|
||||
#include "toBeSorted/dowsing_target.h"
|
||||
|
||||
class dTgReaction_c : public dAcObjBase_c {
|
||||
|
||||
@@ -82,7 +82,9 @@ public:
|
||||
);
|
||||
|
||||
dAcObjBase_c *getActor(s32 i) {
|
||||
return i < mNumUsedRefs && mInfos[i].mActorIdx != 0xFF ? mRefs[mInfos[i].mActorIdx].get() : nullptr;
|
||||
// This only matches if the comparision is always true
|
||||
// Logic is hard sometimes I guess xD
|
||||
return i < mNumUsedRefs && mInfos[i].mActorIdx != -1 ? mRefs[mInfos[i].mActorIdx].get() : nullptr;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
|
||||
@@ -23,8 +23,12 @@ public:
|
||||
return sInstance != nullptr && sInstance->mState != 0;
|
||||
}
|
||||
|
||||
static bool isInEventOtherThan7() {
|
||||
return isInEvent() && sInstance != nullptr && sInstance->mState != 7;
|
||||
static bool isInEvent0Or7() {
|
||||
return sInstance != nullptr && (sInstance->mState == 0 || sInstance->mState == 7);
|
||||
}
|
||||
|
||||
static bool isInEventOtherThan0Or7() {
|
||||
return isInEvent() && !isInEvent0Or7();
|
||||
}
|
||||
|
||||
static const char *getCurrentEventName() {
|
||||
@@ -35,7 +39,12 @@ public:
|
||||
return strequals(getCurrentEventName(), name);
|
||||
}
|
||||
|
||||
// Something like isActorInEvent maybe?
|
||||
static bool FUN_800a0570(dAcBase_c *actor);
|
||||
static bool FUN_800a0ba0();
|
||||
|
||||
private:
|
||||
|
||||
/* 0x000 */ u8 _000[0x084 - 0x000];
|
||||
/* 0x084 */ Event mCurrentEvent;
|
||||
/* 0x0C4 */ u8 _0C4[0x184 - 0x0C4];
|
||||
|
||||
@@ -25,6 +25,14 @@ public:
|
||||
return mPtr != nullptr;
|
||||
}
|
||||
|
||||
const T *get() const {
|
||||
return mPtr;
|
||||
}
|
||||
|
||||
T *get() {
|
||||
return mPtr;
|
||||
}
|
||||
|
||||
const T *operator->() const {
|
||||
return mPtr;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,8 @@ int dAcBombf_c::actorCreate() {
|
||||
boundingBox.Set(mVec3_c(-80.0, -50.0f, -80.0f), mVec3_c(80.0, 60.0f, 80.0f));
|
||||
angle = rotation;
|
||||
if (mDespawnSceneFlag < 0xFF) {
|
||||
actor_properties = (actor_properties & ~1) | 4;
|
||||
clearActorProperty(0x1);
|
||||
setActorProperty(0x4);
|
||||
}
|
||||
|
||||
return SUCCEEDED;
|
||||
@@ -67,7 +68,8 @@ int dAcBombf_c::actorPostCreate() {
|
||||
|
||||
if (dBgS::GetInstance()->ChkMoveBG(dBgS_ObjLinChk::GetInstance(), false)) {
|
||||
field_0x398.SetPolyInfo(dBgS_ObjLinChk::GetInstance());
|
||||
actor_properties = (actor_properties & ~1) | 4;
|
||||
clearActorProperty(0x1);
|
||||
setActorProperty(0x4);
|
||||
}
|
||||
mLightingInfo.mLightingCode = dBgS::GetInstance()->GetLightingCode(dBgS_ObjLinChk::GetInstance());
|
||||
}
|
||||
@@ -139,7 +141,7 @@ int dAcBombf_c::draw() {
|
||||
|
||||
void dAcBombf_c::regrowBomb() {
|
||||
// These params are hell
|
||||
s8 viewclip_idx = (actor_properties & 1) != 0 ? viewclip_index : -1;
|
||||
s8 viewclip_idx = checkActorProperty(0x1) ? viewclip_index : -1;
|
||||
u32 actorParams1;
|
||||
actorParams1 = 1;
|
||||
if (field_0x3D0) {
|
||||
@@ -153,8 +155,8 @@ void dAcBombf_c::regrowBomb() {
|
||||
if (bomb != nullptr) {
|
||||
field_0x394 = 0x3C;
|
||||
bomb->setTransformFromFlower(mWorldMtx);
|
||||
if ((actor_properties & 1) != 0) {
|
||||
bomb->actor_properties |= 1;
|
||||
if (checkActorProperty(0x1)) {
|
||||
bomb->setActorProperty(0x1);
|
||||
}
|
||||
if (field_0x3D4 == 0) {
|
||||
bomb->mField_0xA44 *= 1.5f;
|
||||
|
||||
@@ -52,7 +52,7 @@ int dAcEhb_leaf_c::create() {
|
||||
}
|
||||
|
||||
if (mType != 0) {
|
||||
actor_properties &= ~1;
|
||||
clearActorProperty(0x1);
|
||||
}
|
||||
|
||||
mStartingPos = position;
|
||||
|
||||
@@ -481,8 +481,8 @@ u32 dAcODungeonShip_c::fn_485_1960() {
|
||||
mVec3_c dist = link->position - position;
|
||||
dist.y = 0.0f;
|
||||
dist.normalizeRS();
|
||||
int a1 = cLib::targetAngleY(mVec3_c::Zero, v);
|
||||
int a2 = cLib::targetAngleY(mVec3_c::Zero, dist);
|
||||
s32 a1 = cLib::targetAngleY(mVec3_c::Zero, v);
|
||||
s32 a2 = cLib::targetAngleY(mVec3_c::Zero, dist);
|
||||
// okay
|
||||
return labs(mAng(mAng(a1) - mAng(a2)));
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ STATE_DEFINE(dAcOtubo_c, Slope);
|
||||
STATE_DEFINE(dAcOtubo_c, Rebirth);
|
||||
|
||||
dCcD_SrcSph dAcOtubo_c::sSphSrc = {
|
||||
/* mObjInf */
|
||||
/* mObjInf */
|
||||
{/* mObjAt */ {AT_TYPE_PHYSICS, 0x12, {0, 0, 0}, 2, 0, 0, 0, 0, 0},
|
||||
/* mObjTg */ {~(AT_TYPE_BUGNET | AT_TYPE_0x80000 | AT_TYPE_0x8000), 0x801111, {0xA, 0x40F}, 8, 0},
|
||||
/* mObjCo */ {0x1E9}},
|
||||
/* mSphInf */
|
||||
/* mSphInf */
|
||||
{30.f},
|
||||
};
|
||||
|
||||
@@ -122,7 +122,8 @@ int dAcOtubo_c::actorPostCreate() {
|
||||
if (DungeonflagManager::sInstance->getCounterOrFlag(3, 8) != 0) {
|
||||
return FAILED;
|
||||
}
|
||||
actor_properties |= 4; // TODO ( actor_properties )
|
||||
|
||||
setActorProperty(0x4);
|
||||
|
||||
if (dBgS_ObjGndChk ::CheckPos(position + mVec3_c::Ey * 50.f)) {
|
||||
position.y = dBgS_ObjGndChk::GetGroundHeight();
|
||||
@@ -216,7 +217,7 @@ void dAcOtubo_c::executeState_Wait() {
|
||||
if (mObjAcch.ChkGroundLanding()) {
|
||||
if (!mbField_0x9EF || !EventManager::isInEvent()) {
|
||||
if (mField_0x9F6 == 2) {
|
||||
fn_8002A450(position, field_0xEE, field_0xEF, mField_0x1B4, 0, 1.0f, mField_0x1B0);
|
||||
fn_8002A450(position, polyAttr0, polyAttr1, mField_0x1B4, 0, 1.0f, mField_0x1B0);
|
||||
}
|
||||
if (mbField_0x9F3) {
|
||||
playSound(0xA46);
|
||||
@@ -224,7 +225,7 @@ void dAcOtubo_c::executeState_Wait() {
|
||||
}
|
||||
if (checkOnLava()) {
|
||||
if (mField_0x9F6 != 2) {
|
||||
fn_8002A450(position, field_0xEE, field_0xEF, mField_0x1B4, 0, 1.0f, mField_0x1B0);
|
||||
fn_8002A450(position, polyAttr0, polyAttr1, mField_0x1B4, 0, 1.0f, mField_0x1B0);
|
||||
}
|
||||
playSound(0x9A3);
|
||||
}
|
||||
@@ -362,7 +363,7 @@ void dAcOtubo_c::initializeState_Slope() {
|
||||
}
|
||||
void dAcOtubo_c::executeState_Slope() {
|
||||
if (mObjAcch.ChkGroundLanding()) {
|
||||
fn_8002A450(position, field_0xEE, field_0xEF, mField_0x1B4, 0, 1.0f, mField_0x1B0);
|
||||
fn_8002A450(position, polyAttr0, polyAttr1, mField_0x1B4, 0, 1.0f, mField_0x1B0);
|
||||
} else if (mObjAcch.ChkGndHit()) {
|
||||
mField_0x9DC = 0.f;
|
||||
addPickupTarget();
|
||||
@@ -671,7 +672,7 @@ void dAcOtubo_c::attemptDestroy() {
|
||||
if (mObjAcch.ChkRoofHit()) {
|
||||
destroy();
|
||||
} else if (!mbField_0x9EF && checkYOffsetField_0x100() && getParams_0x3000() != 1) {
|
||||
FUN_8002dcd0();
|
||||
killNoItemDrop();
|
||||
} else if (fn_272_38A0()) {
|
||||
destroy();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "m/m_mtx.h"
|
||||
#include "m/m_quat.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "rvl/MTX/vec.h"
|
||||
#include "s/s_Math.h"
|
||||
#include "toBeSorted/blur_and_palette_manager.h"
|
||||
#include "toBeSorted/dowsing_target.h"
|
||||
@@ -31,11 +30,11 @@ STATE_DEFINE(dAcOTumbleWeed_c, Wait);
|
||||
STATE_DEFINE(dAcOTumbleWeed_c, Slope);
|
||||
|
||||
dCcD_SrcSph dAcOTumbleWeed_c::sSphSrc = {
|
||||
/* mObjInf */
|
||||
/* mObjInf */
|
||||
{/* mObjAt */ {0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0},
|
||||
/* mObjTg */ {~(AT_TYPE_BEETLE | AT_TYPE_0x80000 | AT_TYPE_0x8000), 0x111, {8, 0x40F}, 0, 0},
|
||||
/* mObjCo */ {0xE9}},
|
||||
/* mSphInf */
|
||||
/* mSphInf */
|
||||
{60.f},
|
||||
};
|
||||
|
||||
@@ -114,7 +113,7 @@ int dAcOTumbleWeed_c::actorExecute() {
|
||||
mField_0x974 += position.y - mOldPosition.y;
|
||||
if (checkCollect()) {
|
||||
dAcPy_c::LINK->bugNetCollectTreasure(ITEM_TUMBLE_WEED);
|
||||
FUN_8002dcd0();
|
||||
killNoItemDrop();
|
||||
return SUCCEEDED;
|
||||
}
|
||||
if (checkBreak()) {
|
||||
@@ -132,7 +131,7 @@ int dAcOTumbleWeed_c::actorExecute() {
|
||||
if (checkObjectProperty(0x2)) {
|
||||
// Weak function not being placed right
|
||||
if (sLib::calcTimer(&mTumbleTimer) == 0) {
|
||||
FUN_8002dcd0();
|
||||
killNoItemDrop();
|
||||
return SUCCEEDED;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "d/col/c/c_cc_d.h"
|
||||
#include "d/col/cc/d_cc_s.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "m/m_angle.h"
|
||||
#include "toBeSorted/small_sound_mgr.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(TAG_REACTION, dTgReaction_c, fProfile::TAG_REACTION, 0x0151, 0, 0);
|
||||
@@ -251,38 +252,39 @@ void dTgReaction_c::onDelete() {
|
||||
}
|
||||
}
|
||||
|
||||
bool dTgReaction_c::fn_578_DB0(const mVec3_c &position, u32 arg) {}
|
||||
bool dTgReaction_c::fn_578_DB0(const mVec3_c &position, u32 arg) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dTgReaction_c::spawnHearts(s32 params, const mVec3_c &pos, s32 arg, mAng angle) {
|
||||
static s32 SOME_ANG = -3641;
|
||||
|
||||
bool dTgReaction_c::spawnHearts(s32 params, const mVec3_c &pos, s32 velocity_type, mAng angle) {
|
||||
int numHearts = params == 6 ? 3 : 1;
|
||||
mAng3_c ang(0, 0, 0);
|
||||
|
||||
// This is annoying because we don't know which operators
|
||||
// mAng supports
|
||||
mAng tmp1;
|
||||
int tmp3;
|
||||
if (arg == 6) {
|
||||
tmp1 = angle;
|
||||
static s32 SOME_ANG = -3641;
|
||||
tmp3 = SOME_ANG;
|
||||
s32 max;
|
||||
s32 min;
|
||||
if (velocity_type == 6) {
|
||||
max = angle;
|
||||
min = SOME_ANG;
|
||||
} else {
|
||||
tmp1 = cLib::targetAngleY(dAcPy_c::LINK->position, pos);
|
||||
tmp3 = -0x8000;
|
||||
tmp1 = tmp1 + mAng(0x4000);
|
||||
max = (s16)cLib::targetAngleY(dAcPy_c::LINK->position, pos) + 0x4000;
|
||||
min = -0x8000;
|
||||
}
|
||||
|
||||
mAng tmp2 = tmp3;
|
||||
s16 stepSize = tmp2 / numHearts;
|
||||
tmp2 = stepSize / 2;
|
||||
int step = tmp1 + tmp2;
|
||||
tmp2 = mAng(tmp2 / 2);
|
||||
s16 stepSize = s16(min) / numHearts;
|
||||
mAng range = stepSize / 2;
|
||||
s32 step = s16(max) + range;
|
||||
mAng rndMax = range / 2;
|
||||
mAng rndMin = -rndMax;
|
||||
|
||||
for (int i = 0; i < numHearts; i++) {
|
||||
mAng offset = cM::rndRange(-tmp2, tmp2);
|
||||
ang.y = mAng(step) + offset;
|
||||
if (arg == 5) {
|
||||
ang.y = mAng(step) + cM::rndRange(rndMin, rndMax);
|
||||
if (velocity_type == 5) {
|
||||
dAcItem_c::spawnItem(ITEM_HEART, roomid, pos, ang, 0xFFFFFFFF, 1);
|
||||
} else if (arg == 6) {
|
||||
} else if (velocity_type == 6) {
|
||||
dAcItem_c::spawnItem(ITEM_HEART, roomid, pos, ang, 0xFFFFFFFF, 0);
|
||||
} else {
|
||||
dAcItem_c::spawnDrop(ITEM_HEART, roomid, pos, ang);
|
||||
|
||||
+128
-52
@@ -1,12 +1,18 @@
|
||||
#include "d/a/d_a_base.h"
|
||||
|
||||
#include "c/c_lib.h"
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "d/col/bg/d_bg_s_gnd_chk.h"
|
||||
#include "d/d_heap.h"
|
||||
#include "d/d_room.h"
|
||||
#include "d/d_sc_game.h"
|
||||
#include "d/d_stage.h"
|
||||
#include "d/flag/enemyflag_manager.h"
|
||||
#include "egg/core/eggAllocator.h"
|
||||
#include "f/f_base.h"
|
||||
#include "f/f_list_nd.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "toBeSorted/event.h"
|
||||
@@ -32,20 +38,25 @@ extern "C" ObjInfo *getObjByActorIdAndSubtype_unkNamespace(ProfileName, u8);
|
||||
extern "C" ObjInfo *getObjByActorName_unkNamespace(char *name);
|
||||
extern "C" char *getObjectName_8006a730(ObjInfo *);
|
||||
extern "C" SoundSource *soundForActorInitRelated_803889c0(s8, fBase_c *, char *, u8);
|
||||
extern "C" s16 targetAngleY(mVec3_c *, mVec3_c *);
|
||||
extern "C" s16 targetAngleX(mVec3_c *, mVec3_c *);
|
||||
extern "C" bool checkCollision(mVec3_c *pos);
|
||||
extern "C" s8 collisionCheckGetRoom();
|
||||
|
||||
bool dAcBase_c::createHeap() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Doesnt Match Yet
|
||||
// sound_source and sound_list need to be ironed out before this can match
|
||||
// NOT MATCHING
|
||||
// 8002c3b0
|
||||
dAcBase_c::dAcBase_c()
|
||||
: heap_allocator(), obj_info(s_Create_ObjInfo), sound_source(nullptr), sound_list(), obj_pos(&position),
|
||||
params2(s_Create_Params2), obj_id(s_Create_UnkFlags), viewclip_index(s_Create_ViewClipIdx), actor_node(nullptr),
|
||||
roomid(s_Create_RoomId), actor_subtype(s_Create_Subtype) {
|
||||
: heap_allocator(),
|
||||
obj_info(s_Create_ObjInfo),
|
||||
sound_list(),
|
||||
obj_pos(&position),
|
||||
params2(s_Create_Params2),
|
||||
obj_id(s_Create_UnkFlags),
|
||||
viewclip_index(s_Create_ViewClipIdx),
|
||||
actor_node(nullptr),
|
||||
roomid(s_Create_RoomId),
|
||||
actor_subtype(s_Create_Subtype) {
|
||||
JStudio_actor = 0;
|
||||
someStr[0] = 0;
|
||||
|
||||
@@ -78,11 +89,14 @@ dAcBase_c::dAcBase_c()
|
||||
// 8002c530
|
||||
// dBase_c::~dBase_c() {}
|
||||
|
||||
// Fixing the sound_source and sound_info in the ctor should make this match
|
||||
// NOT MATCHING
|
||||
// 8002c590
|
||||
dAcBase_c::~dAcBase_c() {}
|
||||
|
||||
void dAcBase_c::setTempCreateParams(
|
||||
mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2, dAcBase_c *parent, u8 subtype, s16 unkFlag,
|
||||
u8 viewClipIdx, ObjInfo *objInfo
|
||||
mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2, dAcBase_c *parent, u8 subtype, u16 unkFlag,
|
||||
s8 viewClipIdx, ObjInfo *objInfo
|
||||
) {
|
||||
s_Create_Position = pos;
|
||||
s_Create_Rotation = rot;
|
||||
@@ -154,19 +168,18 @@ int dAcBase_c::actorPostCreate() {
|
||||
}
|
||||
|
||||
int dAcBase_c::create() {
|
||||
if (actor_properties & 0x8000000) {
|
||||
if (checkActorProperty(0x8000000)) {
|
||||
return actorPostCreate();
|
||||
}
|
||||
int success = actorCreate();
|
||||
if (success == SUCCEEDED) {
|
||||
success = NOT_READY;
|
||||
actor_properties |= 0x8000000;
|
||||
setActorProperty(0x8000000);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
// 8002c8f0
|
||||
// loads f2 before f0 instead of f0 then f2
|
||||
void dAcBase_c::postCreate(fBase_c::MAIN_STATE_e state) {
|
||||
if (state == SUCCESS) {
|
||||
pos_copy = position;
|
||||
@@ -176,25 +189,69 @@ void dAcBase_c::postCreate(fBase_c::MAIN_STATE_e state) {
|
||||
dBase_c::postCreate(state);
|
||||
}
|
||||
|
||||
// NOT MATCHING
|
||||
// 8002c940
|
||||
int dAcBase_c::preDelete() {}
|
||||
int dAcBase_c::preDelete() {
|
||||
int fbaseDelete = fBase_c::preDelete();
|
||||
|
||||
if (!checkActorProperty(0x800) && checkActorProperty(0x10000000) &&
|
||||
fBase_c::getConnectParent()->lifecycle_state != TO_BE_DELETED) {
|
||||
if (itemDroppingAndGivingRelated(nullptr, 0) != 0) {
|
||||
setEnemyDefeatFlag();
|
||||
}
|
||||
|
||||
} else {
|
||||
if (sound_source != nullptr) {
|
||||
// TODO: add func call
|
||||
}
|
||||
|
||||
// TODO: add sound_info stuff once the SoundInfo x Heap weirdness is figured out
|
||||
}
|
||||
|
||||
if (fbaseDelete == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sound_source != nullptr) {
|
||||
// TODO: add func calls
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: add sound_info stuff once the SoundInfo x Heap weirdness is figured out
|
||||
|
||||
if (checkActorProperty(0x20000000)) {
|
||||
changeLoadedEntitiesNoSet();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// 8002cb10
|
||||
int dAcBase_c::preExecute() {
|
||||
if (dBase_c::preExecute() == NOT_READY) {
|
||||
return NOT_READY;
|
||||
}
|
||||
if (actor_properties & 0x10000000) {
|
||||
if (actor_properties & 0x40000000) {
|
||||
if (checkActorProperty(0x10000000)) {
|
||||
if (checkActorProperty(0x40000000)) {
|
||||
return NOT_READY;
|
||||
}
|
||||
|
||||
if (EventManager::isInEvent() && JStudio_actor == nullptr && !EventManager::isInEvent0Or7() &&
|
||||
!EventManager::FUN_800a0ba0() && !EventManager::FUN_800a0570(this) && !checkActorProperty(0x4)) {
|
||||
return NOT_READY;
|
||||
}
|
||||
// TODO: Add event control
|
||||
}
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
// 8002cc10
|
||||
int dAcBase_c::execute() {}
|
||||
int dAcBase_c::execute() {
|
||||
if (EventManager::isInEvent() && !EventManager::isInEvent0Or7()) {
|
||||
return actorExecuteInEvent();
|
||||
}
|
||||
|
||||
return actorExecute();
|
||||
}
|
||||
|
||||
// 8002cca0
|
||||
int dAcBase_c::actorExecute() {
|
||||
@@ -206,6 +263,7 @@ int dAcBase_c::actorExecuteInEvent() {
|
||||
return actorExecute();
|
||||
}
|
||||
|
||||
// Can't make progress on this til the SoundInfo x Heap weirdness is figured out
|
||||
// 8002ccc0
|
||||
void dAcBase_c::postExecute(fBase_c::MAIN_STATE_e state) {}
|
||||
|
||||
@@ -248,6 +306,7 @@ u32 dAcBase_c::itemDroppingAndGivingRelated(mVec3_c *spawnPos, int subtype) {
|
||||
|
||||
// 8002cf90
|
||||
void dAcBase_c::fillUpperParams2Byte() {
|
||||
// Upper byte of param2 determines item drops when actor is deleted
|
||||
params2 |= 0xFF000000;
|
||||
}
|
||||
|
||||
@@ -309,14 +368,17 @@ FORCE_INLINE dAcBase_c *findActor(dAcBase_c *parent) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// control flow sucks ;-;
|
||||
// NOT MATCHING
|
||||
// 8002d0a0
|
||||
dAcBase_c *dAcBase_c::searchActor(dAcBase_c *parent) {
|
||||
dAcBase_c *foundActor = ::findActor(parent);
|
||||
|
||||
if (foundActor) {
|
||||
return foundActor;
|
||||
} else {
|
||||
if (!foundActor) {
|
||||
return (dAcBase_c *)fManager_c::searchBaseByGroupType(STAGE, parent);
|
||||
}
|
||||
|
||||
return foundActor;
|
||||
}
|
||||
|
||||
// 8002d130
|
||||
@@ -331,7 +393,7 @@ void dAcBase_c::forEveryActor(void *func(dAcBase_c *, dAcBase_c *), dAcBase_c *p
|
||||
|
||||
// 8002d190
|
||||
mAng dAcBase_c::getXZAngleToPlayer() {
|
||||
return targetAngleY(&this->position, &dAcPy_c::LINK->position);
|
||||
return cLib::targetAngleY(this->position, dAcPy_c::LINK->position);
|
||||
}
|
||||
|
||||
// 8002d1d0
|
||||
@@ -354,16 +416,12 @@ bool dAcBase_c::getDistanceToActor(dAcBase_c *actor, f32 distThresh, f32 *outDis
|
||||
return isWithinThreshhold;
|
||||
}
|
||||
|
||||
s32 doAbs(s16 val) {
|
||||
return labs(val);
|
||||
}
|
||||
// Similar weirdness as the above function. Also, r29->31 are initted in the
|
||||
// wrong order? 8002d290
|
||||
// 8002d290
|
||||
bool dAcBase_c::getDistanceAndAngleToActor(
|
||||
dAcBase_c *actor, f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY, s16 *outDiffAngleX
|
||||
) {
|
||||
f32 distSquared = 3.402823e+38f;
|
||||
s16 angleToActorY, angleToActorX;
|
||||
s32 angleToActorY, angleToActorX;
|
||||
bool isWithinRange = false;
|
||||
|
||||
angleToActorY = 0;
|
||||
@@ -371,11 +429,12 @@ bool dAcBase_c::getDistanceAndAngleToActor(
|
||||
|
||||
if (actor != nullptr) {
|
||||
distSquared = PSVECSquareDistance(position, actor->position);
|
||||
angleToActorY = targetAngleY(&position, &actor->position);
|
||||
angleToActorX = targetAngleX(&position, &actor->position);
|
||||
angleToActorY = cLib::targetAngleY(position, actor->position);
|
||||
angleToActorX = cLib::targetAngleX(position, actor->position);
|
||||
|
||||
if ((distSquared <= distThresh * distThresh) && (doAbs(s32(rotation.y.mVal - angleToActorY)) <= yAngle) &&
|
||||
(doAbs(s32(rotation.x.mVal - angleToActorX)) <= xAngle)) {
|
||||
// These casts are nuts wild ^^'
|
||||
if ((distSquared <= distThresh * distThresh) && (labs(s16(rotation.y.mVal - (s16)angleToActorY)) <= yAngle) &&
|
||||
(labs(s16(rotation.x.mVal - (s16)angleToActorX)) <= xAngle)) {
|
||||
isWithinRange = true;
|
||||
}
|
||||
}
|
||||
@@ -424,8 +483,8 @@ void dAcBase_c::updateRoomId(f32 yOffset) {
|
||||
if (getConnectParent()->profile_name != fProfile::ROOM) {
|
||||
mVec3_c actorPos(position.x, position.y + yOffset, position.z);
|
||||
|
||||
if (checkCollision(&actorPos)) {
|
||||
roomid = collisionCheckGetRoom();
|
||||
if (dBgS_ObjGndChk::CheckPos(actorPos)) {
|
||||
roomid = dBgS_ObjGndChk::GetRoomID();
|
||||
} else {
|
||||
roomid = dStage_c::GetInstance()->getCurrRoomId();
|
||||
}
|
||||
@@ -458,13 +517,17 @@ void dAcBase_c::FUN_8002d860() {}
|
||||
|
||||
// 8002d880
|
||||
SoundSource *dAcBase_c::getSoundSource() {
|
||||
return sound_source;
|
||||
return sound_source.get();
|
||||
}
|
||||
// End of SoundSource stuff
|
||||
|
||||
// first param is not dAcBase_c
|
||||
// 8002d890
|
||||
void dAcBase_c::FUN_8002d890() {}
|
||||
void dAcBase_c::removeSoundInfo(SoundInfo *soundInfo) {
|
||||
// Position != EndIter -> soundInfo is contained in sound_list
|
||||
if (sound_list.GetPosition(soundInfo) != sound_list.GetEndIter()) {
|
||||
sound_list.remove(soundInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// current name is Global__setActorRef
|
||||
void dAcBase_c::setActorRef(dAcBase_c *ref) {
|
||||
@@ -511,7 +574,7 @@ dAcBase_c *dAcBase_c::createActor(
|
||||
u32 newParams2 = actorParams2 != 0 ? getParams2_ignoreLower() : -1;
|
||||
|
||||
setTempCreateParams(
|
||||
actorPosition, actorRotation, actorScale, actorRoomid, newParams2, (dAcBase_c *)actorRef, 0, -1, 0xFF, nullptr
|
||||
actorPosition, actorRotation, actorScale, actorRoomid, newParams2, (dAcBase_c *)actorRef, 0, -1, -1, nullptr
|
||||
);
|
||||
dBase_c *room = dStage_c::getParentForRoom(roomid);
|
||||
return (dAcBase_c *)dBase_c::createBase(actorId, room, actorParams1, ACTOR);
|
||||
@@ -542,7 +605,7 @@ dAcBase_c *dAcBase_c::createActorStage(
|
||||
u32 newParams2 = actorParams2 != 0 ? getParams2_ignoreLower() : -1;
|
||||
|
||||
setTempCreateParams(
|
||||
actorPosition, actorRotation, actorScale, actorRoomid, newParams2, (dAcBase_c *)actorRef, 0, -1, 0xFF, nullptr
|
||||
actorPosition, actorRotation, actorScale, actorRoomid, newParams2, (dAcBase_c *)actorRef, 0, -1, -1, nullptr
|
||||
);
|
||||
dBase_c *room = dStage_c::getParentForRoom(roomid);
|
||||
return (dAcBase_c *)dBase_c::createBase(actorId, room, actorParams1, STAGE);
|
||||
@@ -562,9 +625,19 @@ void dAcBase_c::doInteraction(s32 param) {
|
||||
}
|
||||
}
|
||||
|
||||
// Only called by dPlayer::dig and that function fails to decomp in ghidra?
|
||||
// Only called by dPlayer::dig
|
||||
// Rounds angle to nearest 90 deg?
|
||||
// 8002dc20
|
||||
void dAcBase_c::FUN_8002dc20(s16 *, s16 *) {}
|
||||
void dAcBase_c::roundAngleToNearest90(s16 *dst_angle, s16 *src_angle) {
|
||||
s32 roundedAngle = *src_angle;
|
||||
|
||||
if (roundedAngle < 0) {
|
||||
roundedAngle += 0x10000;
|
||||
}
|
||||
roundedAngle += 0x2000;
|
||||
|
||||
*dst_angle = (roundedAngle / 0x4000) * 0x4000;
|
||||
}
|
||||
|
||||
// 8002dc50
|
||||
void dAcBase_c::incrementKillCounter() {
|
||||
@@ -582,37 +655,40 @@ void dAcBase_c::incrementKillCounter() {
|
||||
}
|
||||
|
||||
// 8002dcd0
|
||||
void dAcBase_c::FUN_8002dcd0() {
|
||||
void dAcBase_c::killNoItemDrop() {
|
||||
fillUpperParams2Byte();
|
||||
fBase_c::deleteRequest();
|
||||
incrementKillCounter();
|
||||
}
|
||||
|
||||
// 8002dd10
|
||||
void dAcBase_c::FUN_8002dd10() {
|
||||
void dAcBase_c::killWithFlag() {
|
||||
setEnemyDefeatFlag();
|
||||
fBase_c::deleteRequest();
|
||||
incrementKillCounter();
|
||||
}
|
||||
|
||||
// 8002dd50
|
||||
void dAcBase_c::FUN_8002dd50() {
|
||||
void dAcBase_c::killWithFlagNoItemDrop() {
|
||||
fillUpperParams2Byte();
|
||||
FUN_8002dd10();
|
||||
killWithFlag();
|
||||
}
|
||||
|
||||
// 8002dd90
|
||||
void dAcBase_c::FUN_8002dd90() {
|
||||
void dAcBase_c::deleteWithFlagNoItemDrop() {
|
||||
fillUpperParams2Byte();
|
||||
setEnemyDefeatFlag();
|
||||
fBase_c::deleteRequest();
|
||||
}
|
||||
|
||||
// Some collision related thing
|
||||
// 8002ddd0
|
||||
void dAcBase_c::FUN_8002ddd0() {}
|
||||
|
||||
// 8002de30
|
||||
void dAcBase_c::FUN_8002de30(cBgS_PolyInfo &p) {
|
||||
FUN_8002ddd0();
|
||||
void dAcBase_c::setPolyAttrs(cBgS_PolyInfo &pPolyInfo) {
|
||||
polyAttr0 = dBgS::GetInstance()->GetPolyAtt0(pPolyInfo);
|
||||
polyAttr1 = dBgS::GetInstance()->GetPolyAtt1(pPolyInfo);
|
||||
}
|
||||
|
||||
// Idk what's up with this function. It's only used once.
|
||||
// 8002de30
|
||||
void dAcBase_c::setPolyAttrsDupe(cBgS_PolyInfo &pPolyInfo) {
|
||||
setPolyAttrs(pPolyInfo);
|
||||
}
|
||||
|
||||
@@ -67,13 +67,13 @@ void dAcObjFairy_c::finalizeState_Wait() {}
|
||||
void dAcObjFairy_c::initializeState_Avoid() {}
|
||||
void dAcObjFairy_c::executeState_Avoid() {}
|
||||
void dAcObjFairy_c::finalizeState_Avoid() {
|
||||
actor_properties |= 1;
|
||||
setActorProperty(0x1);
|
||||
}
|
||||
|
||||
void dAcObjFairy_c::initializeState_PlayerAvoid() {}
|
||||
void dAcObjFairy_c::executeState_PlayerAvoid() {}
|
||||
void dAcObjFairy_c::finalizeState_PlayerAvoid() {
|
||||
actor_properties |= 1;
|
||||
setActorProperty(0x1);
|
||||
}
|
||||
|
||||
void dAcObjFairy_c::initializeState_CureStart() {}
|
||||
|
||||
@@ -2672,6 +2672,6 @@ void dAcTbox_c::fn_8026E630() {
|
||||
if (dBgS_ObjGndChk::CheckPos(checkPos) && &dBgS_ObjGndChk::GetInstance()) {
|
||||
cBgS_PolyInfo p = dBgS_ObjGndChk::GetInstance();
|
||||
dBgS::GetInstance()->SetLightingCode(this, p);
|
||||
FUN_8002de30(p);
|
||||
setPolyAttrsDupe(p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/d_heap.h"
|
||||
#include "d/d_pad.h"
|
||||
#include "m/m_angle.h"
|
||||
#include "nw4r/g3d/res/g3d_resfile.h"
|
||||
#include "toBeSorted/arc_managers/oarc_manager.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
@@ -163,7 +164,7 @@ bool AttentionManager::checkLink2() const {}
|
||||
bool AttentionManager::execute() {
|
||||
field_0xBDC = 0;
|
||||
if (!isInNormalGameState() && !field_0xBD5) {
|
||||
if (!EventManager::isInEvent() && !EventManager::isInEventOtherThan7()) {
|
||||
if (!EventManager::isInEvent() || !EventManager::isInEventOtherThan0Or7()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -483,6 +483,8 @@ int SpecialItemDropMgr::giveSpecialDropItem(
|
||||
return ret;
|
||||
}
|
||||
|
||||
static s32 SOME_ANG = -3641;
|
||||
|
||||
// 800c7ef0
|
||||
// Very unmatching. Just here as a starting point
|
||||
bool SpecialItemDropMgr::spawnSpecialDropItem(int specialItemId, int roomid, mVec3_c *pos, int subtype, mAng rot) {
|
||||
@@ -502,29 +504,27 @@ bool SpecialItemDropMgr::spawnSpecialDropItem(int specialItemId, int roomid, mVe
|
||||
itemCount = 2;
|
||||
}
|
||||
|
||||
mAng currentRot;
|
||||
mAng tempOther;
|
||||
u32 itemid = SPECIAL_ITEM_ARRAY[unk];
|
||||
mAng3_c itemRot(0, 0, 0);
|
||||
|
||||
s32 max;
|
||||
s32 min;
|
||||
if (subtype == 2 || subtype == 6) {
|
||||
currentRot = rot;
|
||||
tempOther = -0xe39;
|
||||
max = rot;
|
||||
min = SOME_ANG;
|
||||
} else {
|
||||
currentRot = cLib::targetAngleY(dAcPy_c::LINK->position, *pos);
|
||||
tempOther = -0x8000;
|
||||
currentRot += 0x4000;
|
||||
max = (s16)cLib::targetAngleY(dAcPy_c::LINK->position, *pos) + 0x4000;
|
||||
min = -0x8000;
|
||||
}
|
||||
// This angle code is annoying. d_t_reaction has similar code
|
||||
s32 angleDecrement = tempOther / itemCount;
|
||||
tempOther = angleDecrement / 2;
|
||||
currentRot += tempOther;
|
||||
tempOther = tempOther / 2;
|
||||
|
||||
s16 stepSize = s16(min) / itemCount;
|
||||
mAng range = stepSize / 2;
|
||||
s32 step = s16(max) + range;
|
||||
mAng rndMax = range / 2;
|
||||
mAng rndMin = -rndMax;
|
||||
|
||||
for (int currentItemIndex = 0; currentItemIndex < itemCount; currentItemIndex++) {
|
||||
mAng out = cM::rndRange(tempOther, -tempOther);
|
||||
|
||||
itemRot.y = currentRot + out;
|
||||
itemRot.y = mAng(step) + cM::rndRange(rndMin, rndMax);
|
||||
if (unk >= 12 && unk < 14) {
|
||||
itemid = RAND_RUPEE_ARRAY[cM::rndInt(3)];
|
||||
spawnItem1(itemid, roomid, pos, &itemRot, 0xFFFFFFFF, 0);
|
||||
@@ -547,7 +547,7 @@ bool SpecialItemDropMgr::spawnSpecialDropItem(int specialItemId, int roomid, mVe
|
||||
spawnItem9(itemid, roomid, pos, &itemRot);
|
||||
}
|
||||
}
|
||||
currentRot.mVal -= angleDecrement;
|
||||
step = mAng(step) - stepSize;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user