34 magnum.SyncCylinderRotation();
54 const string ATT_SLOT_CYLINDER =
"RevolverCylinder";
55 const string ATT_SLOT_EJECTOR =
"RevolverEjector";
74 m_LastMuzzleloaded = 0;
156 SelectionBulletHide();
164 for (
int i = 0;
i < GetMuzzleCount();
i++)
166 if (CanChamberFromMag(
i,
mag))
168 if (IsChamberEmpty(
i))
182 if (!FindAttachmentBySlotName(ATT_SLOT_EJECTOR))
183 GetInventory().CreateAttachment(
"Magnum_Ejector");
185 if (!FindAttachmentBySlotName(ATT_SLOT_CYLINDER))
186 GetInventory().CreateAttachment(
"Magnum_Cylinder");
188 ForceSyncSelectionState();
189 SyncCylinderRotation();
226 cylinder.ResetAnimationPhase(
"Rotate_Cylinder",
rot);
227 ejector.ResetAnimationPhase(
"Rotate_Ejector",
rot);
235 cylinder.SetAnimationPhase(
"Rotate_Cylinder",
rot);
236 ejector.SetAnimationPhase(
"Rotate_Ejector",
rot);
243 SetCylinderRotationAnimationPhase(GetCylinderRotation(GetCurrentMuzzle()), reset);
253 SetAttachmentsHealth();
261 for (
int i = 0;
i < GetInventory().AttachmentCount();
i++)
263 entity = GetInventory().GetAttachmentFromIndex(
i);
265 attachment.SetHealth01(
"",
"Health", GetHealth01());
289 for (
int i = 0;
i < GetMuzzleCount();
i++)
343 super.OnDebugSpawn();
347 entity.SpawnEntityOnGroundPos(
"Ammo_357",
entity.GetPosition());
Param4< int, int, string, int > TSelectableActionInfoWithColor
void AddAction(typename actionName)
void RemoveAction(typename actionName)
override bool HasBullet()
override bool HasMagazine()
FirearmActionLoadBullet FirearmActionBase FirearmActionLoadBulletQuick()
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
override int GetCurrentStateID()
override void OnExit(HandEventBase e)
HandStateEquipped OnEntry
enum MagnumStableStateID init
const float MAGNUM_ROTATION_POSITION_2
const float MAGNUM_ROTATION_POSITION_1
const float MAGNUM_ROTATION_POSITION_3
const float MAGNUM_ROTATION_POSITION_4
const float MAGNUM_ROTATION_POSITION_6
@ DEFAULT
default weapon state
const float MAGNUM_ROTATION_POSITION_M1
const float MAGNUM_ROTATION_POSITION_5
const float MAGNUM_ROTATION_POSITION_0
enum FSMTransition WeaponTransition
bool IsSingleState()
Special one for when the weapon only has one singular state (like Magnum)
bool IsChamberFiredOut(int idx)
bool IsChamberFull(int idx)
pair ( action, actionType )
Super root of all classes in Enforce script.
static bool IsWeaponLogEnable()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
Serialization general interface. Serializer API works with:
override void InitStateMachine()
override void HideBullet(int muzzleIndex)
override RecoilBase SpawnRecoilObject()
override bool IsShowingChamberedBullet()
override void ShowBullet(int muzzleIndex)
override void AssembleGun()
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void SetActions()
void SyncCylinderRotation(bool reset=true)
override bool CanEjectBullet()
static float GetCylinderRotation(int muzzleIndex)
override bool CanChamberBullet(int muzzleIndex, Magazine mag)
override void OnFire(int muzzle_index)
override void OnDebugSpawn()
void SetCylinderRotationAnimationPhase(float rot, bool reset=false)
void SetAttachmentsHealth()
charging of weapon without ammo to be chambered
signalize mechanism manipulation
weapon finite state machine
represents weapon's stable state (i.e. the basic states that the weapon will spend the most time in)
represent weapon state base
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float AbsFloat(float f)
Returns absolute value.
const int SAT_DEBUG_ACTION
WeaponActionChamberingTypes