itemTreasure.cpp close to done

This commit is contained in:
PikHacker 2022-12-30 04:29:26 -05:00 committed by EpochFlame
parent ad8135bf8a
commit 514adabbd8
5 changed files with 423 additions and 694 deletions

View File

@ -26,10 +26,10 @@ struct FSM : public ItemFSM<Item> {
};
struct State : public ItemState<Item> {
// inline State(int stateID)
// : ItemState(stateID)
// {
// }
inline State(int stateID)
: ItemState(stateID)
{
}
virtual void onDamage(Item*, f32); // _20 (weak)
@ -38,10 +38,14 @@ struct State : public ItemState<Item> {
};
struct NormalState : public State {
// inline State(int stateID)
// : ItemState(stateID)
// {
// }
NormalState()
: State(0)
{
}
inline NormalState(int stateID)
: State(stateID)
{
}
virtual void init(Item*, StateArg*); // _08
virtual void exec(Item*); // _0C
@ -50,9 +54,12 @@ struct NormalState : public State {
// _00 = VTBL
// _00-_0C = State
int _0C;
};
struct Item : public WorkItem<Item, FSM, State> {
Item();
struct DummyShape : public SysShape::MtxObject {
virtual Matrixf* getMatrix(int); // _08 (weak)
@ -81,23 +88,33 @@ struct Item : public WorkItem<Item, FSM, State> {
void releasePellet();
void setTreasure(Pellet*);
void setLife();
void getCurrMaxLife();
void getWorkRadius();
void isVisible();
f32 getCurrMaxLife();
f32 getWorkRadius();
bool isVisible();
// unused/inline
void createTreasure();
// _00 = VTABLE
// _00-_1EC = WorkItem
DummyShape m_dummyShape; // _1EC
f32 m_life; // _1F4
f32 m_depth; // _1F8
f32 m_currStageLife; // _1F4
f32 m_totalLife; // _1F8
Pellet* m_pellet; // _1FC
Matrixf _200; // _200
f32 _230; // _230
Matrixf m_matrix; // _200
f32 m_instantDamage; // _230
};
struct TreasureParms : public CreatureParms {
struct Parms : public Parameters {
inline Parms(); // probably
inline Parms()
: Parameters(nullptr, "Plant::Property")
, m_p000(this, 'p000', "ライフ(0)", 250.0f, 1.0f, 60000.0f)
, m_p001(this, 'p001', "ライフ(1)", 750.0f, 1.0f, 60000.0f)
, m_p002(this, 'p002', "ライフ(2)", 1200.0f, 1.0f, 60000.0f)
, m_p003(this, 'p003', "ライフ(3)", 1500.0f, 1.0f, 60000.0f)
{
}
Parm<f32> m_p000; // _E8, max life when current depth >= 75% of max depth
Parm<f32> m_p001; // _110, max life when 75% > current depth >= 50% of max depth
@ -123,8 +140,8 @@ struct Mgr : public TNodeItemMgr {
virtual BaseItem* birth(); // _BC
// _00 = VTBL
// _00-_64 = TNodeItemMgr
u8 _64[0x4]; // _64, unknown
// _00-_88 = TNodeItemMgr
TreasureParms* m_parameters; // _88
};
extern Mgr* mgr;

View File

@ -4,8 +4,13 @@
#include "PSM/EventBase.h"
#include "PSM/ObjBase.h"
namespace Game {
struct BaseItem;
} // namespace Game
namespace PSM {
struct WorkItem : public EventBase {
WorkItem(Game::BaseItem*);
// vtable 2
/**
* @reifiedAddress{804637A0}

View File

@ -29,6 +29,10 @@ struct TOtakaraApS : public TSimple2 {
};
struct TOtakaraAp : public TBase {
TOtakaraAp()
: TBase()
{
}
virtual bool create(Arg*); // _08
virtual void forceKill(); // _0C (weak)
virtual void fade(); // _10 (weak)

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@
#include "Game/Entities/ItemHoney.h"
#include "Radar.h"
#define CandypopTriggerSize 350.0f
#define FindCandypopTriggerSize 350.0f
#define FindRedOnionTriggerSize 125.0f
#define FindYellowOnionTriggerSize 1600.0f
#define FindBlueOnionTriggerSize 750.0f
@ -212,7 +212,7 @@ bool Navi::demoCheck()
if ((color == Purple || color == White) && (color != Purple || purpleflag) && (color != White || whiteflag)) {
Sys::Sphere bounds;
cPom->getBoundingSphere(bounds);
bounds.m_radius += CandypopTriggerSize;
bounds.m_radius += FindCandypopTriggerSize;
if (checkDemoNaviAndPiki(bounds)) {
if (color == White) {
MoviePlayArg arg("g38_find_whitepom", nullptr, nullptr, 0);