2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 00:27:42 +00:00

CScriptTrigger work

This commit is contained in:
2017-01-14 19:59:37 -08:00
parent e2c671e9b4
commit 65fb75737f
39 changed files with 707 additions and 448 deletions

View File

@@ -10,6 +10,7 @@ namespace urde
// TODO - Phil: Figure out what each of the DetectProjectiles actually mean
enum class ETriggerFlags : u32
{
None = 0,
DetectPlayer = (1 << 0),
DetectAI = (1 << 1),
DetectProjectiles1 = (1 << 2),
@@ -17,19 +18,19 @@ enum class ETriggerFlags : u32
DetectProjectiles3 = (1 << 4),
DetectProjectiles4 = (1 << 5),
DetectBombs = (1 << 6),
Unknown1 = (1 << 7),
DetectPowerBombs = (1 << 7),
DetectProjectiles5 = (1 << 8),
DetectProjectiles6 = (1 << 9),
DetectProjectiles7 = (1 << 10),
KillOnEnter = (1 << 11),
DetectMorphedPlayer = (1 << 12),
ApplyForce = (1 << 13),
UseCollisionImpulses = (1 << 13),
DetectPlayerIfInside = (1 << 14),
Unknown2 = (1 << 15),
UseBooleanIntersection = (1 << 15),
DetectUnmorphedPlayer = (1 << 16),
BlockEnvironmentalEffects = (1 << 17)
};
ENABLE_BITWISE_ENUM(ETriggerFlags)
ENABLE_BITWISE_ENUM(ETriggerFlags);
class CScriptTrigger : public CActor
{
@@ -42,7 +43,7 @@ public:
CObjectTracker(TUniqueId id) : x0_id(id) {}
TUniqueId GetObjectId() const { return x0_id; }
bool operator==(const CObjectTracker& other) { return x0_id == other.x0_id; }
bool operator==(const CObjectTracker& other) const { return x0_id == other.x0_id; }
};
protected:
@@ -56,12 +57,12 @@ protected:
union {
struct
{
bool x148_24_ : 1;
bool x148_24_playerInside : 1;
bool x148_25_ : 1;
bool x148_26_ : 1;
bool x148_27_ : 1;
bool x148_26_deactivateOnEntered : 1;
bool x148_27_deactivateOnExited : 1;
bool x148_28_ : 1;
bool x148_29_ : 1;
bool x148_29_didPhazonDamage : 1;
};
u8 dummy = 0;
};
@@ -72,14 +73,17 @@ public:
ETriggerFlags triggerFlags, bool, bool, bool);
void Accept(IVisitor& visitor);
void Think(float, CStateManager &);
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager &);
virtual void InhabitantRejected(CActor&, CStateManager&) {}
virtual void InhabitantExited(CActor&, CStateManager&) {}
virtual void InhabitantIdle(CActor&, CStateManager&) {}
virtual void InhabitantAdded(CActor&, CStateManager&) {}
CObjectTracker* FindInhabitant(TUniqueId);
void UpdateInhabitants(CStateManager&);
const std::list<CObjectTracker>& GetInhabitants() const;
CObjectTracker* FindObject(TUniqueId);
void UpdateInhabitants(float, CStateManager&);
std::list<CObjectTracker>& GetInhabitants();
rstl::optional_object<zeus::CAABox> GetTouchBounds() const;
void Touch(CActor &, CStateManager &);
zeus::CAABox GetTriggerBoundsWR() const;
};
}