Isle
Loading...
Searching...
No Matches
act3ammo.h
Go to the documentation of this file.
1#ifndef ACT3AMMO_H
2#define ACT3AMMO_H
3
4#include "legopathactor.h"
6
7class Act3;
8
9// VTABLE: LEGO1 0x100d8460
10// SIZE 0x1a0
15class Act3Ammo : public LegoPathActor {
16public:
18 enum {
19 c_pizza = 0x01,
20 c_donut = 0x02,
21 c_valid = 0x04,
22 c_bit4 = 0x08,
23 c_sharkFood = 0x10
24 };
25
29 Act3Ammo();
30
34 ~Act3Ammo() override;
35
40 void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
41
46 void Animate(float p_time) override; // vtable+0x70
47
51 MxU32 IsValid() { return m_ammoFlag & c_valid; }
52
57 Mx3DPointFloat* GetUnknown0x160() { return m_eq; }
58
63 MxFloat* GetUnknown0x19c() { return &m_unk0x19c; }
64
69 void SetValid(MxBool p_valid)
70 {
71 if (p_valid) {
72 m_ammoFlag |= c_valid;
73 }
74 else {
75 m_ammoFlag &= ~c_valid;
76 }
77 }
78
82 MxU32 IsPizza() { return m_ammoFlag & c_pizza; }
83
87 MxU32 IsDonut() { return m_ammoFlag & c_donut; }
88
93 void SetBit4(MxBool p_bit4)
94 {
95 if (p_bit4) {
96 m_ammoFlag |= c_bit4;
97 }
98 else {
99 m_ammoFlag &= ~c_bit4;
100 }
101 }
102
106 MxU32 IsBit4() { return m_ammoFlag & c_bit4; }
107
112 void SetSharkFood(MxBool p_sharkFood)
113 {
114 if (p_sharkFood) {
115 m_ammoFlag |= c_sharkFood;
116 }
117 else {
118 m_ammoFlag &= ~c_sharkFood;
119 }
120 }
121
125 MxU32 IsSharkFood() { return m_ammoFlag & c_sharkFood; }
126
130 MxFloat GetUnknown0x158() { return m_unk0x158; }
131
136 void SetUnknown0x158(MxFloat p_unk0x158) { m_unk0x158 = p_unk0x158; }
137
143
151 MxResult Create(Act3* p_world, MxU32 p_isPizza, MxS32 p_index);
152
160 MxResult FUN_10053b40(const Vector3& p_srcLoc, const Vector3& p_srcDir, const Vector3& p_srcUp);
161
169 MxResult FUN_10053cb0(LegoPathController* p_p, LegoPathBoundary* p_boundary, MxFloat p_unk0x19c);
170
178
179 // SYNTHETIC: LEGO1 0x10053880
180 // Act3Ammo::`scalar deleting destructor'
181
182private:
190 MxResult FUN_10053db0(float p_param1, const Matrix4& p_param2);
191
195 static Mx3DPointFloat g_unk0x10104f08;
196
200 MxU16 m_ammoFlag; // 0x154
201
205 MxFloat m_unk0x158; // 0x158
206
210 Act3* m_world; // 0x15c
211
215 Mx3DPointFloat m_eq[3]; // 0x160
216
220 MxFloat m_unk0x19c; // 0x19c
221};
222
223#endif // ACT3AMMO_H
Represents an ammo object (pizza or donut) used in Act 3 gameplay sequence.
Definition: act3ammo.h:15
void SetBit4(MxBool p_bit4)
Set or clear the bit4 flag, used internally for special state/behavior (e.g.
Definition: act3ammo.h:93
MxU32 IsPizza()
Returns true if the ammo is a pizza projectile.
Definition: act3ammo.h:82
MxFloat GetUnknown0x158()
Returns a time/duration parameter used in animation transitions.
Definition: act3ammo.h:130
MxU32 IsBit4()
Returns true if the internal bit4 flag is set (special usage, e.g.
Definition: act3ammo.h:106
void SetUnknown0x158(MxFloat p_unk0x158)
Sets a time/duration parameter used for state transitions after collision.
Definition: act3ammo.h:136
void SetSharkFood(MxBool p_sharkFood)
Sets the "shark food" flag if this ammo should become food for a shark.
Definition: act3ammo.h:112
@ c_donut
[AI] The ammo is a donut projectile. [AI]
Definition: act3ammo.h:20
@ c_bit4
[AI] Internal usage (e.g. special event or collision, see SetBit4). [AI]
Definition: act3ammo.h:22
@ c_sharkFood
[AI] Marks this ammo as "shark food" (special event/consumed). [AI]
Definition: act3ammo.h:23
@ c_pizza
[AI] The ammo is a pizza projectile. [AI]
Definition: act3ammo.h:19
@ c_valid
[AI] The ammo is in a valid/active state and available for interaction. [AI]
Definition: act3ammo.h:21
void Animate(float p_time) override
Updates position, animation, and handles collision or end-of-trajectory logic for this ammo.
Definition: act3ammo.cpp:249
MxResult Create(Act3 *p_world, MxU32 p_isPizza, MxS32 p_index)
Creates an ammo (pizza or donut), initializes its ROI, bounding volumes, and enables it in the world.
Definition: act3ammo.cpp:71
Mx3DPointFloat * GetUnknown0x160()
Returns the pointer to the second control point of the quadratic trajectory equation.
Definition: act3ammo.h:57
MxU32 IsDonut()
Returns true if the ammo is a donut projectile.
Definition: act3ammo.h:87
MxResult FUN_10053cb0(LegoPathController *p_p, LegoPathBoundary *p_boundary, MxFloat p_unk0x19c)
Initializes the path controller/boundary and sets up animation and sound when ammo is fired.
Definition: act3ammo.cpp:148
MxU32 IsSharkFood()
Returns true if the ammo became "shark food".
Definition: act3ammo.h:125
void Destroy(MxBool p_fromDestructor) override
Completely removes this ammo object from all managers.
Definition: act3ammo.cpp:39
MxResult FUN_10053b40(const Vector3 &p_srcLoc, const Vector3 &p_srcDir, const Vector3 &p_srcUp)
Sets up trajectory control points for the projectile, calculating a quadratic curve based on origin/d...
Definition: act3ammo.cpp:112
MxU32 IsValid()
Returns true if the ammo is valid (active in game/world).
Definition: act3ammo.h:51
MxFloat * GetUnknown0x19c()
Returns pointer to an internal parameter used in trajectory and animation calculations.
Definition: act3ammo.h:63
Act3Ammo()
Constructs a new Act3Ammo object.
Definition: act3ammo.cpp:24
~Act3Ammo() override
Destructor.
Definition: act3ammo.cpp:32
MxResult Remove()
Removes this ammo instance from the world, cleans up path controller/boundary and notifies managers.
Definition: act3ammo.cpp:52
void SetValid(MxBool p_valid)
Set or clear the valid flag for the object, making it active or inactive in the world.
Definition: act3ammo.h:69
MxResult FUN_10053d30(LegoPathController *p_p, MxFloat p_unk0x19c)
Variant of firing logic (uses only controller and param, also sets bit4).
Definition: act3ammo.cpp:174
[AI] Controls all main logic and progression of Act 3 in LEGO Island, including objects,...
Definition: act3.h:182
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
Definition: legopathactor.h:32
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
[AI] Manager for controlling actors' movement along predefined geometric paths.
4x4 Matrix class with virtual interface for manipulation and transformation.
Definition: matrix.h:24
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
Definition: mxgeometry3d.h:14
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
float MxFloat
[AI]
Definition: mxtypes.h:68
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
unsigned int MxU32
[AI]
Definition: mxtypes.h:32