diff options
Diffstat (limited to 'include/d')
| -rw-r--r-- | include/d/a/d_a_base.h | 2 | ||||
| -rw-r--r-- | include/d/a/e/d_a_e_bc.h | 6 | ||||
| -rw-r--r-- | include/d/a/npc/d_a_npc_bee.h | 79 | ||||
| -rw-r--r-- | include/d/a/npc/d_a_npc_honeycomb.h | 8 | ||||
| -rw-r--r-- | include/d/a/npc/d_a_npc_insect_capture_game_kobun.h | 1 | ||||
| -rw-r--r-- | include/d/a/obj/d_a_obj_spore.h | 11 |
6 files changed, 104 insertions, 3 deletions
diff --git a/include/d/a/d_a_base.h b/include/d/a/d_a_base.h index f063e4e2..b405f69d 100644 --- a/include/d/a/d_a_base.h +++ b/include/d/a/d_a_base.h @@ -72,7 +72,7 @@ public: enum AcProperties_e { AC_PROP_0x1 = (1 << 0), AC_PROP_0x2 = (1 << 1), - AC_PROP_0x4 = (1 << 2), + AC_PROP_0x4 = (1 << 2), // when set, also update in event AC_PROP_0x100 = (1 << 8), AC_PROP_0x400 = (1 << 10), AC_PROP_0x800 = (1 << 11), diff --git a/include/d/a/e/d_a_e_bc.h b/include/d/a/e/d_a_e_bc.h index 520aa7d9..bf5671ad 100644 --- a/include/d/a/e/d_a_e_bc.h +++ b/include/d/a/e/d_a_e_bc.h @@ -45,8 +45,14 @@ public: STATE_FUNC_DECLARE(dAcEbc_c, AAttack); STATE_FUNC_DECLARE(dAcEbc_c, ADamage); + u8 getField_0x130D() const { + return field_0x130D; + } + private: /* 0x??? */ STATE_MGR_DECLARE(dAcEbc_c); + /* 0x??? */ u8 field_unk[0xF59]; + /* 0x130D */ u8 field_0x130D; }; #endif diff --git a/include/d/a/npc/d_a_npc_bee.h b/include/d/a/npc/d_a_npc_bee.h index 855e6c25..96286f4b 100644 --- a/include/d/a/npc/d_a_npc_bee.h +++ b/include/d/a/npc/d_a_npc_bee.h @@ -1,14 +1,91 @@ #ifndef D_A_NPC_BEE_H #define D_A_NPC_BEE_H +#include "common.h" +#include "d/a/d_a_base.h" #include "d/a/e/d_a_en_base.h" +#include "d/a/npc/d_a_npc_honeycomb.h" +#include "d/a/obj/d_a_obj_base.h" +#include "d/col/cc/d_cc_d.h" +#include "d/d_cc.h" +#include "m/m3d/m_proc.h" +#include "m/m_angle.h" +#include "m/m_vec.h" +#include "nw4r/g3d/res/g3d_resfile.h" + +class dAcOSpore_c; + +class dAcNpcBeeSingleBee { +public: + enum State { + BEE_STATE_DEAD = 0, + BEE_STATE_CHASE = 1, + BEE_STATE_FLY_TO_HIVE = 2, + BEE_STATE_FLY_UP = 3, + BEE_STATE_BLOWN_AWAY = 4, + BEE_STATE_RISE = 5, + BEE_STATE_CRAWL = 0xA, + }; + /* 0x000 */ u8 mIndex; + /* 0x001 */ u8 mBeeState; // see State enum + /* 0x002 */ u8 mActionTimer; + /* 0x003 */ bool mIsFlying; + /* 0x004 */ u8 field_0x004; // unused + /* 0x005 */ u8 mSubState; + /* 0x006 */ u8 mDisableAttackTimer; + /* 0x007 */ u8 mSwordDodgeTimer; + /* 0x008 */ bool mHide; + /* 0x009 */ u8 mAttackCooldownTimer; + /* 0x00A */ bool mIsAttacking; + /* 0x00B */ u8 mWallReflectTimer; + /* 0x00C */ s16 mTimer; // only counts up, used for kinda random calculations + /* 0x00E */ s16 mFlyingStatesTimer; // used for vanishing after flying up and something else + /* 0x010 */ f32 mCrawlingSpeed; + /* 0x014 */ f32 mSpeed; + /* 0x018 */ mVec3_c mPos; + /* 0x024 */ mVec3_c field_0x024; + /* 0x030 */ mVec3_c mSwordDodgeOffset; + /* 0x03C */ mVec3_c mOldPos; + /* 0x048 */ mVec3_c field_0x048; + /* 0x054 */ mVec3_c mTargetPos; // Either an absolute target or relative to the attacked actor + /* 0x060 */ mAng3_c mCrawlingRotation; + /* 0x066 */ mAng3_c mModelRotation; + /* 0x06C */ dCcD_Linked_Sph mCollider; +}; class dAcNpcBee_c : public dAcEnBase_c { public: - dAcNpcBee_c() {} + dAcNpcBee_c() : mRes(nullptr) {} virtual ~dAcNpcBee_c() {} + virtual bool createHeap() override; + virtual int create() override; + virtual int actorExecute() override; + virtual int draw() override; + virtual int doDelete() override; + u32 updateSwarmBeeColliders(); + void actuallyUpdateSwarmBees(); + void handleBeeCrawlingOnHive(dAcNpcBeeSingleBee *bee); + void handleBeeFlyingStates(dAcNpcBeeSingleBee *bee); + void handleBeeRising(dAcNpcBeeSingleBee *bee); + s32 beeCheckWallFloorCollision(dAcNpcBeeSingleBee *bee); + void handleBeeBlownAway(dAcNpcBeeSingleBee *bee); private: + /* 0x0378 */ u8 mSwarmBeeCount; + /* 0x0379 */ u8 mRumbleTimer; + /* 0x037A */ u8 mSceneflag; + /* 0x037C */ s16 mFrameCounter; // used to only search for new targets every 16 frames + /* 0x0380 */ f32 mAttackActorDistFromHome; + /* 0x0384 */ u8 field_0x0384[4]; // unused + /* 0x0388 */ nw4r::g3d::ResFile mRes; + /* 0x038C */ dShpProc1_c mBeeModels[4]; + /* 0x045C */ dAcNpcBeeSingleBee mBees[100]; // only 20 slots are used + /* 0xB80C */ dAcRef_c<dAcNpcHc_c> mHiveRef; + /* 0xB818 */ dAcRef_c<dAcObjBase_c> mAttackRef; + /* 0xB824 */ dColliderLinkedList mColliderList; + /* 0xB830 */ mVec3_c mAliveBeePos; // overwritten by all alive bees, so it's the last on in the list + /* 0xB83C */ dAcObjBase_c *mAttackActor; + /* 0xB840 */ dAcOSpore_c *mSporeActor; }; #endif diff --git a/include/d/a/npc/d_a_npc_honeycomb.h b/include/d/a/npc/d_a_npc_honeycomb.h index a0c3c7dd..f04640a2 100644 --- a/include/d/a/npc/d_a_npc_honeycomb.h +++ b/include/d/a/npc/d_a_npc_honeycomb.h @@ -2,13 +2,19 @@ #define D_A_NPC_HONEYCOMB_H #include "d/a/e/d_a_en_base.h" +#include "m/m_vec.h" class dAcNpcHc_c : public dAcEnBase_c { public: dAcNpcHc_c() {} virtual ~dAcNpcHc_c() {} -private: + // private: + /* 0x378 */ u8 field_0x378[0x915 - 0x378]; + /* 0x915 */ u8 field_0x915; + /* 0x916 */ u8 field_0x916; + /* 0x917 */ u8 field_0x917[0x928 - 0x917]; + /* 0x928 */ mVec3_c field_0x928; }; #endif diff --git a/include/d/a/npc/d_a_npc_insect_capture_game_kobun.h b/include/d/a/npc/d_a_npc_insect_capture_game_kobun.h index ffec4454..f4ace5eb 100644 --- a/include/d/a/npc/d_a_npc_insect_capture_game_kobun.h +++ b/include/d/a/npc/d_a_npc_insect_capture_game_kobun.h @@ -8,6 +8,7 @@ class dAcNpcIcgKobun_c : public dAcNpc_c { public: dAcNpcIcgKobun_c() : mStateMgr(*this) {} virtual ~dAcNpcIcgKobun_c() {} + void fn_66_30C0(u32 itemId); private: /* 0x??? */ STATE_MGR_DECLARE(dAcNpcIcgKobun_c); diff --git a/include/d/a/obj/d_a_obj_spore.h b/include/d/a/obj/d_a_obj_spore.h index 1f787c6e..2685bf93 100644 --- a/include/d/a/obj/d_a_obj_spore.h +++ b/include/d/a/obj/d_a_obj_spore.h @@ -1,13 +1,24 @@ #ifndef D_A_O_SPORE_H #define D_A_O_SPORE_H +#include "common.h" #include "d/a/obj/d_a_obj_base.h" +#include "f/f_list_mg.h" class dAcOSpore_c : public dAcObjBase_c { public: dAcOSpore_c() {} virtual ~dAcOSpore_c() {} + static fLiNdBa_c *getListHead(); + s32 getSporeType() const { + return mParams & 0xF; + } + bool isGlitteringSpore() const { + return getSporeType() == 1; + } + private: + static fLiMgBa_c sSpores; }; #endif |
