Link 4 script objects & renaming from MPR

Former-commit-id: ac3887c54088adddef1ddd84421e5754a618f210
This commit is contained in:
2023-10-17 17:36:08 -04:00
parent 79d5df69e1
commit 06be29dc5c
35 changed files with 306 additions and 281 deletions

View File

@@ -43,7 +43,7 @@ struct SMazeCell {
}
};
class CMazeState {
class CSinglePathMaze {
CRandom16 x0_rand;
SMazeCell x4_cells[skMazeRows * skMazeCols];
int x84_enterCol;
@@ -61,15 +61,15 @@ public:
kS_Left = 3,
};
CMazeState(int enterCol, int enterRow, int targetCol, int targetRow);
void Reset(int seed);
void Initialize();
void GenerateObstacles();
CSinglePathMaze(int enterCol, int enterRow, int targetCol, int targetRow);
void CreateMaze(int seed);
void SolveMaze();
void AddGimmicks();
SMazeCell& GetCell(uint col, uint row);
const SMazeCell& GetCell(uint col, uint row) const;
SMazeCell& GetCellInline(uint col, uint row) { return x4_cells[col + row * skMazeCols]; } // ????
inline SMazeCell& GetCell(uint idx) { return x4_cells[idx]; }
SMazeCell& MazePoint(uint col, uint row);
const SMazeCell& GetMazePoint(uint col, uint row) const;
SMazeCell& MazePointInline(uint col, uint row) { return x4_cells[col + row * skMazeCols]; } // ????
inline SMazeCell& MazePoint(uint idx) { return x4_cells[idx]; }
};
class CScriptMazeNode : public CActor {
@@ -111,11 +111,17 @@ private:
bool x13c_25_hasGate : 1;
bool x13c_26_gateActive : 1;
void GenerateObjects(CStateManager& mgr);
void Reset(CStateManager& mgr);
void SendScriptMsgs(CStateManager& mgr, EScriptObjectMessage msg);
void GenerateBarrier(CStateManager& mgr);
void DeleteBarrier(CStateManager& mgr);
void SendBarrierMsg(CStateManager& mgr, EScriptObjectMessage msg);
static uint sMazeSeeds[300];
// hack for SendBarrierMsg
static inline void DeliverScriptMsg(CStateManager& mgr, CEntity* to, TUniqueId sender,
EScriptObjectMessage msg) {
mgr.DeliverScriptMsg(to, sender, msg);
}
};
#endif // _CSCRIPTMAZENODE

View File

@@ -40,7 +40,7 @@ public:
float GetPossibility() const;
CPlayerState::EItemType GetItem() const;
void SetSpawned();
void SetWasGenerated();
};
#endif // _CSCRIPTPICKUP

View File

@@ -13,16 +13,18 @@ public:
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender,
CStateManager& stateMgr) override;
// float GetNothingPossibility() const;
private:
CVector3f x34_position;
float x40_frequency;
float x44_delayTimer;
void ResetDelayTimer();
void GetGeneratorIds(CStateManager& mgr, TUniqueId sender,
rstl::vector< TUniqueId >& idsOut) const;
float GetPickupTemplates(CStateManager& mgr,
rstl::vector< rstl::pair< float, TEditorId > >& idsOut) const;
void GeneratePickup(CStateManager& mgr, TEditorId templateId, TUniqueId generatorId) const;
void ResetSpawnNothingCounter();
void GetTargets(CStateManager& mgr, TUniqueId sender, rstl::vector< TUniqueId >& idsOut) const;
float GetSpawnablePickups(CStateManager& mgr,
rstl::vector< rstl::pair< float, TEditorId > >& idsOut) const;
void SpawnPickup(CStateManager& mgr, TEditorId templateId, TUniqueId generatorId) const;
};
#endif // _CSCRIPTPICKUPGENERATOR

View File

@@ -4,14 +4,6 @@
#include "MetroidPrime/ScriptObjects/CScriptTrigger.hpp"
class CScriptSteam : public CScriptTrigger {
bool x150_;
CAssetId x154_texture;
float x158_;
float x15c_alphaInDur;
float x160_alphaOutDur;
float x164_;
float x168_;
public:
CScriptSteam(TUniqueId, const rstl::string& name, const CEntityInfo& info, const CVector3f& pos,
const CAABox&, const CDamageInfo& dInfo, const CVector3f& orientedForce,
@@ -21,6 +13,22 @@ public:
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
void Think(float, CStateManager&);
void Accept(IVisitor&);
private:
bool x150_;
CAssetId x154_texture;
float x158_strength;
float x15c_alphaInDur;
float x160_alphaOutDur;
float x164_maxDist;
float x168_ooMaxDist;
float GetMaxDist() const { return x164_maxDist; }
float GetStrength() const { return x158_strength; }
float GetOOMaxDist() const { return x168_ooMaxDist; }
CAssetId GetTextureId() const { return x154_texture; }
float GetFadeOutRate() const { return x160_alphaOutDur; }
float GetFadeInRate() const { return x15c_alphaInDur; }
};
#endif // _CSCRIPTSTEAM