2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-25 05:46:28 +00:00
|
|
|
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <optional>
|
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "Runtime/GCNTypes.hpp"
|
2020-04-11 06:02:28 +00:00
|
|
|
#include "Runtime/Character/CharacterCommon.hpp"
|
2019-09-23 19:00:23 +00:00
|
|
|
#include "Runtime/World/CActor.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CAABox.hpp>
|
2016-04-25 05:46:28 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2018-12-08 05:30:43 +00:00
|
|
|
class CScriptCoverPoint : public CActor {
|
2020-04-11 05:50:10 +00:00
|
|
|
bool xe8_26_landHere : 1;
|
|
|
|
bool xe8_27_wallHang : 1;
|
|
|
|
bool xe8_28_stay : 1;
|
2020-04-11 06:02:28 +00:00
|
|
|
bool xe8_29_ : 1;
|
|
|
|
bool xe8_30_attackDirection : 1;
|
2018-12-08 05:30:43 +00:00
|
|
|
float xec_cosHorizontalAngle;
|
|
|
|
float xf0_sinVerticalAngle;
|
|
|
|
float xf4_coverTime;
|
2020-04-11 05:50:10 +00:00
|
|
|
bool xf8_24_crouch : 1;
|
2020-04-20 04:57:50 +00:00
|
|
|
bool xf8_25_inUse : 1 = false;
|
2018-12-08 05:30:43 +00:00
|
|
|
TUniqueId xfa_occupant = kInvalidUniqueId;
|
|
|
|
TUniqueId xfc_retreating = kInvalidUniqueId;
|
2019-06-12 02:05:17 +00:00
|
|
|
std::optional<zeus::CAABox> x100_touchBounds;
|
2018-12-08 05:30:43 +00:00
|
|
|
float x11c_timeLeft = 0.f;
|
|
|
|
|
2016-04-25 05:46:28 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CScriptCoverPoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, zeus::CTransform xf, bool active,
|
|
|
|
u32 flags, bool crouch, float horizontalAngle, float verticalAngle, float coverTime);
|
2016-04-25 05:46:28 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void Accept(IVisitor& visitor) override;
|
|
|
|
void Think(float, CStateManager&) override;
|
2020-04-05 11:54:02 +00:00
|
|
|
void AddToRenderer(const zeus::CFrustum&, CStateManager&) override {}
|
2019-08-09 12:45:18 +00:00
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
2020-04-09 17:28:20 +00:00
|
|
|
void Render(CStateManager&) override {}
|
2019-08-09 12:45:18 +00:00
|
|
|
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
2018-12-08 05:30:43 +00:00
|
|
|
void SetInUse(bool inUse);
|
|
|
|
bool GetInUse(TUniqueId uid) const;
|
|
|
|
bool ShouldLandHere() const { return xe8_26_landHere; }
|
|
|
|
bool ShouldWallHang() const { return xe8_27_wallHang; }
|
|
|
|
bool ShouldStay() const { return xe8_28_stay; }
|
|
|
|
bool ShouldCrouch() const { return xf8_24_crouch; }
|
|
|
|
bool Blown(const zeus::CVector3f& pos) const;
|
|
|
|
float GetSinSqVerticalAngle() const;
|
|
|
|
float GetCosHorizontalAngle() const { return xec_cosHorizontalAngle; }
|
2020-04-11 06:02:28 +00:00
|
|
|
pas::ECoverDirection GetAttackDirection() const {
|
2020-04-11 06:09:58 +00:00
|
|
|
return xe8_30_attackDirection ? pas::ECoverDirection::Right : pas::ECoverDirection::Left;
|
2020-04-11 06:02:28 +00:00
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
void Reserve(TUniqueId id) { xfa_occupant = id; }
|
2016-04-25 05:46:28 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|