2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-08-14 21:11:44 +00:00
|
|
|
|
|
|
|
#include "Character/CModelData.hpp"
|
|
|
|
#include "CGSFreeLook.hpp"
|
|
|
|
#include "CGSComboFire.hpp"
|
|
|
|
#include "CGSFidget.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
2016-12-10 02:35:20 +00:00
|
|
|
enum class EGunState
|
|
|
|
{
|
2017-08-26 04:36:25 +00:00
|
|
|
Inactive,
|
|
|
|
Default,
|
2016-12-10 02:35:20 +00:00
|
|
|
FreeLook,
|
|
|
|
ComboFire,
|
2017-08-26 04:36:25 +00:00
|
|
|
Idle,
|
2016-12-10 02:35:20 +00:00
|
|
|
Fidget,
|
2017-08-26 04:36:25 +00:00
|
|
|
Strike,
|
|
|
|
BigStrike
|
2016-12-10 02:35:20 +00:00
|
|
|
};
|
2016-08-14 21:11:44 +00:00
|
|
|
|
|
|
|
class CGunController
|
|
|
|
{
|
|
|
|
CModelData& x0_modelData;
|
|
|
|
CGSFreeLook x4_freeLook;
|
|
|
|
CGSComboFire x1c_comboFire;
|
|
|
|
CGSFidget x30_fidget;
|
2017-08-26 04:36:25 +00:00
|
|
|
EGunState x50_gunState = EGunState::Inactive;
|
|
|
|
s32 x54_curAnimId = -1;
|
|
|
|
bool x58_24_animDone : 1;
|
|
|
|
bool x58_25_enteredComboFire : 1;
|
2016-12-10 02:35:20 +00:00
|
|
|
|
2016-08-14 21:11:44 +00:00
|
|
|
public:
|
2017-01-25 04:40:19 +00:00
|
|
|
CGunController(CModelData& modelData)
|
|
|
|
: x0_modelData(modelData)
|
|
|
|
{
|
2017-08-26 04:36:25 +00:00
|
|
|
x58_24_animDone = true;
|
|
|
|
x58_25_enteredComboFire = false;
|
2017-01-25 04:40:19 +00:00
|
|
|
}
|
|
|
|
|
2017-08-26 04:36:25 +00:00
|
|
|
void UnLoadFidget() { x30_fidget.UnLoadAnim(); }
|
2017-09-04 02:22:46 +00:00
|
|
|
void LoadFidgetAnimAsync(CStateManager& mgr, s32 type, s32 gunId, s32 animSet);
|
|
|
|
void EnterFidget(CStateManager& mgr, s32 type, s32 gunId, s32 animSet);
|
2017-08-26 04:36:25 +00:00
|
|
|
bool IsFidgetLoaded() const { return x30_fidget.IsAnimLoaded(); }
|
|
|
|
s32 GetFreeLookSetId() const { return x4_freeLook.GetSetId(); }
|
|
|
|
bool IsComboOver() const { return x1c_comboFire.IsComboOver(); }
|
|
|
|
void EnterFreeLook(CStateManager& mgr, s32 gunId, s32 setId);
|
|
|
|
void EnterComboFire(CStateManager& mgr, s32 gunId);
|
|
|
|
void EnterStruck(CStateManager& mgr, float angle, bool bigStrike, bool b2);
|
|
|
|
void EnterIdle(CStateManager& mgr);
|
|
|
|
bool Update(float dt, CStateManager& mgr);
|
|
|
|
void ReturnToDefault(CStateManager& mgr, float dt, bool setState);
|
2016-12-10 02:35:20 +00:00
|
|
|
void ReturnToBasePosition(CStateManager&, float);
|
|
|
|
void Reset();
|
2017-09-04 02:22:46 +00:00
|
|
|
s32 GetCurAnimId() const { return x54_curAnimId; }
|
2016-08-14 21:11:44 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|