metaforce/Runtime/Weapon/CFidget.hpp

50 lines
1.3 KiB
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
#include "Runtime/RetroTypes.hpp"
#include "Runtime/Weapon/CGunMotion.hpp"
2021-04-10 01:42:06 -07:00
namespace metaforce {
class CStateManager;
2018-12-07 21:30:43 -08:00
class CFidget {
2017-08-25 21:36:25 -07:00
public:
2018-12-07 21:30:43 -08:00
enum class EState {
NoFidget,
MinorFidget,
MajorFidget,
HolsterBeam,
StillMinorFidget,
StillMajorFidget,
StillHolsterBeam,
Loading
};
2017-08-25 21:36:25 -07:00
private:
2018-12-07 21:30:43 -08:00
EState x0_state = EState::NoFidget;
SamusGun::EFidgetType x4_type = SamusGun::EFidgetType::Invalid;
u32 x8_delayTriggerBits = 0;
// 0: panel, 1: panel reset, 2: adjust nozzle, 3: panel buttons
s32 xc_animSet = -1;
u32 x10_delayTimerEnableBits = 3;
float x14_timeSinceFire = 0.f;
float x18_timeSinceStrikeCooldown = 0.f;
float x1c_timeSinceUnmorph = 0.f;
float x20_timeSinceBobbing = 0.f;
float x24_minorDelayTimer = 0.f;
float x28_majorDelayTimer = 0.f;
float x2c_holsterTimeSinceFire = 0.f;
float x30_timeUntilHolster = 105.f;
bool x34_24_loading = false;
public:
2018-12-07 21:30:43 -08:00
EState GetState() const { return x0_state; }
SamusGun::EFidgetType GetType() const { return x4_type; }
s32 GetAnimSet() const { return xc_animSet; }
EState Update(int fireButtonStates, bool bobbing, bool inStrikeCooldown, float dt, CStateManager& mgr);
void ResetMinor();
void ResetAll();
void DoneLoading() { x34_24_loading = false; }
};
2021-04-10 01:42:06 -07:00
} // namespace metaforce