Skip to content

Commit

Permalink
Match rest of itemHoney.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartPiece44 committed Sep 28, 2023
1 parent 5edcb8a commit 389433a
Show file tree
Hide file tree
Showing 8 changed files with 315 additions and 4,331 deletions.
34 changes: 17 additions & 17 deletions docs/recommended_todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,23 @@
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiTeki.cpp">aiTeki.cpp</a> | 5858 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pelletNumber.cpp">pelletNumber.cpp</a> | 6199 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gamePelletList.cpp">gamePelletList.cpp</a> | 8282 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/mapMgrTraceMove.cpp">mapMgrTraceMove.cpp</a> | 9030 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/cellIterator.cpp">cellIterator.cpp</a> | 9434 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemHole.cpp">itemHole.cpp</a> | 11712 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemBigFountain.cpp">itemBigFountain.cpp</a> | 12679 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiRescue.cpp">aiRescue.cpp</a> | 13908 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/texCaster.cpp">texCaster.cpp</a> | 13913 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBreakGate.cpp">aiBreakGate.cpp</a> | 13918 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/creatureLOD.cpp">creatureLOD.cpp</a> | 14136 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/flockMgr.cpp">flockMgr.cpp</a> | 14542 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviWhistle.cpp">naviWhistle.cpp</a> | 16714 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemRock.cpp">itemRock.cpp</a> | 17257 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBattle.cpp">aiBattle.cpp</a> | 17401 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemCave.cpp">itemCave.cpp</a> | 20150 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameResultTexMgr.cpp">gameResultTexMgr.cpp</a> | 21221 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemDownFloor.cpp">itemDownFloor.cpp</a> | 21226 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_MainResult.cpp">singleGS_MainResult.cpp</a> | 21236 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_CaveResult.cpp">singleGS_CaveResult.cpp</a> | 22845 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviMgr.cpp">naviMgr.cpp</a> | 24409 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBore.cpp">aiBore.cpp</a> | 26633 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiCrop.cpp">aiCrop.cpp</a> | 26982 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiTransport.cpp">aiTransport.cpp</a> | 27275 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameSystem.cpp">gameSystem.cpp</a> | 27889 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameSeaMgr.cpp">gameSeaMgr.cpp</a> | 27984 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pathfinder.cpp">pathfinder.cpp</a> | 28318 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiAttack.cpp">aiAttack.cpp</a> | 28457 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/vsCardMgr.cpp">vsCardMgr.cpp</a> | 31094 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiEnter.cpp">aiEnter.cpp</a> | 31721 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_DayEnd.cpp">singleGS_DayEnd.cpp</a> | 31850 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemBridge.cpp">itemBridge.cpp</a> | 32146 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameDynamics.cpp">gameDynamics.cpp</a> | 34058 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/baseGameSectionKantei.cpp">baseGameSectionKantei.cpp</a> | 35202 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gamePlayDataMemCard.cpp">gamePlayDataMemCard.cpp</a> | 36035 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/piki.cpp">piki.cpp</a> | 36373 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameGeneratorCache.cpp">gameGeneratorCache.cpp</a> | 37575 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiWeed.cpp">aiWeed.cpp</a> | 38056 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/cellIterator.cpp">cellIterator.cpp</a> | 9434 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemHole.cpp">itemHole.cpp</a> | 11676 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemBigFountain.cpp">itemBigFountain.cpp</a> | 12679 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemHoney.cpp">itemHoney.cpp</a> | 12872 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiRescue.cpp">aiRescue.cpp</a> | 13908 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/texCaster.cpp">texCaster.cpp</a> | 13913 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBreakGate.cpp">aiBreakGate.cpp</a> | 13918 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/creatureLOD.cpp">creatureLOD.cpp</a> | 14136 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/flockMgr.cpp">flockMgr.cpp</a> | 14542 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviWhistle.cpp">naviWhistle.cpp</a> | 16714 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemRock.cpp">itemRock.cpp</a> | 17257 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBattle.cpp">aiBattle.cpp</a> | 17401 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemCave.cpp">itemCave.cpp</a> | 20150 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameResultTexMgr.cpp">gameResultTexMgr.cpp</a> | 21221 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemDownFloor.cpp">itemDownFloor.cpp</a> | 21228 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_MainResult.cpp">singleGS_MainResult.cpp</a> | 21236 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_CaveResult.cpp">singleGS_CaveResult.cpp</a> | 22845 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviMgr.cpp">naviMgr.cpp</a> | 24409 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBore.cpp">aiBore.cpp</a> | 26633 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiCrop.cpp">aiCrop.cpp</a> | 26982 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiTransport.cpp">aiTransport.cpp</a> | 27275 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameSystem.cpp">gameSystem.cpp</a> | 27889 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameSeaMgr.cpp">gameSeaMgr.cpp</a> | 27984 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pathfinder.cpp">pathfinder.cpp</a> | 28318 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiAttack.cpp">aiAttack.cpp</a> | 28457 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/vsCardMgr.cpp">vsCardMgr.cpp</a> | 31094 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiEnter.cpp">aiEnter.cpp</a> | 31721 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_DayEnd.cpp">singleGS_DayEnd.cpp</a> | 31850 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemBridge.cpp">itemBridge.cpp</a> | 32146 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameDynamics.cpp">gameDynamics.cpp</a> | 34058 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/baseGameSectionKantei.cpp">baseGameSectionKantei.cpp</a> | 35202 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gamePlayDataMemCard.cpp">gamePlayDataMemCard.cpp</a> | 36035 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/piki.cpp">piki.cpp</a> | 36373 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameGeneratorCache.cpp">gameGeneratorCache.cpp</a> | 37575 |

### <section id="plugProjectKonoU">plugProjectKonoU</section>
| File | Size (bytes) | File | Size (bytes) |
Expand Down
4 changes: 2 additions & 2 deletions include/Game/BaseItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct CFSMItem : public BaseItem {

inline CFSMItem(int objTypeID)
: BaseItem(objTypeID)
, mStateMachine(nullptr)
, mFsm(nullptr)
, mCurrentState(nullptr)
{
}
Expand All @@ -145,7 +145,7 @@ struct CFSMItem : public BaseItem {

// _000 = VTBL
// _000-_1D8 = BaseItem
CItemFSM* mStateMachine; // _1D8
CItemFSM* mFsm; // _1D8
FSMState<CFSMItem>* mCurrentState; // _1DC
};

Expand Down
98 changes: 45 additions & 53 deletions include/Game/Entities/ItemHoney.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@

namespace Game {

// Type of nectar drop (honey).
enum HoneyKind {
// type of the honey
HONEY_Y, // yellow nectar
HONEY_R, // red nectar (spicy)
HONEY_B // black nectar (bitter)
HONEY_Y = 0, // yellow nectar
HONEY_R = 1, // red nectar (spicy)
HONEY_B = 2, // black nectar (bitter)
};

namespace ItemHoney {

enum cState {
HONEYSTATE_Fall = 0,
HONEYSTATE_Bounce,
HONEYSTATE_Wait,
HONEYSTATE_Shrink,
HONEYSTATE_Touch,
HONEYSTATE_Demo,
HONEYSTATE_COUNT
enum StateID {
HONEY_Fall = 0,
HONEY_Bounce = 1,
HONEY_Wait = 2,
HONEY_Shrink = 3,
HONEY_Touch = 4,
HONEY_Demo = 5,
HONEY_StateCount, // 6
};

struct InitArg : public CreatureInitArg {
inline InitArg(u8 a, u8 b)
inline InitArg(u8 type, bool isDemo)
{
_04 = a;
_05 = b;
mHoneyType = type;
mIsDemo = isDemo;
}

virtual const char* getName() // _08 (weak)
Expand All @@ -45,8 +45,8 @@ struct InitArg : public CreatureInitArg {
}

// _00 = VTBL
u8 _04; // _04
u8 _05; // _05
u8 mHoneyType; // _04
bool mIsDemo; // _05
};

struct Item : public CFSMItem {
Expand All @@ -61,7 +61,7 @@ struct Item : public CFSMItem {
virtual void onEndCapture(); // _9C
virtual void collisionCallback(CollEvent& collEvent); // _EC
virtual void on_movie_end(bool shouldResetAnims); // _114
virtual char* getCreatureName(); // _1A8 (weak)
virtual char* getCreatureName() { return "Honey"; } // _1A8 (weak)

// vtable 2 (MotionListener + BaseItem + self)
virtual void makeTrMatrix(); // _1C4
Expand All @@ -85,17 +85,14 @@ struct Mgr : public FixedSizeItemMgr<Item> {
Mgr();

virtual void onLoadResources(); // _48
virtual u32 generatorGetID(); // _58 (weak)
virtual u32 generatorGetID() { return 'mitu'; } // _58 (weak)
virtual Item* generatorBirth(Vector3f& pos, Vector3f& rot, GenItemParm* genParm); // _5C
virtual void onCreateModel(SysShape::Model* model); // _A0
virtual Item* birth(); // _A4
virtual Item* get(void*); // _AC (weak, thunk at _94)
virtual void* getNext(void*); // _B0 (weak, thunk at _88)
virtual void* getStart(); // _B4 (weak, thunk at _8C)
virtual void* getEnd(); // _B8 (weak, thunk at _90)
virtual ~Mgr(); // _BC (weak)

u8 _7C[0x4]; // _7C - unknown
};

struct FSM : public CItemFSM {
Expand All @@ -111,18 +108,19 @@ struct State : public CItemState {
{
}

virtual void onKeyEvent(CFSMItem* item, const SysShape::KeyEvent& keyEvent); // _24 (weak)
virtual void collisionCallback(CFSMItem* item, CollEvent& collEvent); // _34 (weak)
virtual bool interactAbsorb(CFSMItem* item, InteractAbsorb& interaction); // _38 (weak)
virtual bool absorbable(); // _3C (weak)
virtual void onKeyEvent(CFSMItem* item, const SysShape::KeyEvent& keyEvent) { } // _24 (weak)
virtual void collisionCallback(CFSMItem* item, CollEvent& collEvent) { } // _34 (weak)
virtual bool interactAbsorb(CFSMItem* item, InteractAbsorb& interaction) { return false; } // _38 (weak)
virtual bool absorbable() { return false; } // _3C (weak)

// _00 = VTBL
// _00-_0C = CItemState
char* mName; // _0C, unused but educated guess
};

struct BounceState : public State {
inline BounceState()
: State(HONEYSTATE_Bounce)
: State(HONEY_Bounce)
{
}

Expand All @@ -132,13 +130,12 @@ struct BounceState : public State {
virtual void onKeyEvent(CFSMItem* item, const SysShape::KeyEvent& keyEvent); // _24

// _00 = VTBL
// _00-_0C = State
u32 _0C; // _0C
// _00-_10 = State
};

struct DemoState : public State {
inline DemoState()
: State(HONEYSTATE_Demo)
: State(HONEY_Demo)
{
}

Expand All @@ -148,13 +145,12 @@ struct DemoState : public State {
virtual void onKeyEvent(CFSMItem* item, const SysShape::KeyEvent& keyEvent); // _24

// _00 = VTBL
// _00-_0C = State
u32 _0C; // _0C
// _00-_10 = State
};

struct FallState : public State {
inline FallState()
: State(HONEYSTATE_Fall)
: State(HONEY_Fall)
{
}

Expand All @@ -164,31 +160,29 @@ struct FallState : public State {
virtual void onBounce(CFSMItem* item, Sys::Triangle* tri); // _28

// _00 = VTBL
// _00-_0C = State
u32 _0C; // _0C
// _00-_10 = State
};

struct ShrinkState : public State {
inline ShrinkState()
: State(HONEYSTATE_Shrink)
: State(HONEY_Shrink)
{
}

virtual void init(CFSMItem* item, StateArg* arg); // _08
virtual void exec(CFSMItem* item); // _0C
virtual void cleanup(CFSMItem* item); // _10
virtual void onKeyEvent(CFSMItem* item, const SysShape::KeyEvent& keyEvent); // _24
virtual bool interactAbsorb(CFSMItem* item, InteractAbsorb& interaction); // _38 (weak)
virtual bool absorbable(); // _3C (weak)
virtual void init(CFSMItem* item, StateArg* arg); // _08
virtual void exec(CFSMItem* item); // _0C
virtual void cleanup(CFSMItem* item); // _10
virtual void onKeyEvent(CFSMItem* item, const SysShape::KeyEvent& keyEvent); // _24
virtual bool interactAbsorb(CFSMItem* item, InteractAbsorb& interaction) { return true; } // _38 (weak)
virtual bool absorbable() { return true; } // _3C (weak)

// _00 = VTBL
// _00-_0C = State
u32 _0C; // _0C
// _00-_10 = State
};

struct TouchState : public State {
inline TouchState()
: State(HONEYSTATE_Touch)
: State(HONEY_Touch)
{
}

Expand All @@ -198,17 +192,16 @@ struct TouchState : public State {
virtual void onKeyEvent(CFSMItem* item, const SysShape::KeyEvent& keyEvent); // _24
virtual void collisionCallback(CFSMItem* item, CollEvent& collEvent); // _34
virtual bool interactAbsorb(CFSMItem* item, InteractAbsorb& interaction); // _38
virtual bool absorbable(); // _3C (weak)
virtual bool absorbable() { return true; } // _3C (weak)

// _00 = VTBL
// _00-_0C = State
u32 _0C; // _0C
u8 _10; // _10
// _00-_10 = State
bool mIsJiggling; // _10, has been touched by navi
};

struct WaitState : public State {
inline WaitState()
: State(HONEYSTATE_Wait)
: State(HONEY_Wait)
{
}

Expand All @@ -217,11 +210,10 @@ struct WaitState : public State {
virtual void cleanup(CFSMItem* item); // _10
virtual void collisionCallback(CFSMItem* item, CollEvent& collEvent); // _34
virtual bool interactAbsorb(CFSMItem* item, InteractAbsorb& interaction); // _38
virtual bool absorbable(); // _3C (weak)
virtual bool absorbable() { return true; } // _3C (weak)

// _00 = VTBL
// _00-_0C = State
u32 _0C; // _0C
// _00-_10 = State
};

extern Mgr* mgr;
Expand Down
1 change: 0 additions & 1 deletion include/Game/Entities/ItemPikihead.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ struct Mgr : public FixedSizeItemMgr<Item> {

// _00 = VTBL
// _00-_7C = FixedSizeItemMgr
u8 _7C[0x4]; // _7C, unknown
};

extern Mgr* mgr;
Expand Down
Loading

0 comments on commit 389433a

Please sign in to comment.