DayZ 1.24
Loading...
Searching...
No Matches
WeaponEjectCasingAndChamberFromAttMag.c
Go to the documentation of this file.
1
3{
5
6 override void OnEntry(WeaponEventBase e)
7 {
8 super.OnEntry(e);
9 if (e)
10 {
11 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ejected fired out casing");
12 int mi = m_weapon.GetCurrentMuzzle();
13 if (m_weapon.IsChamberFiredOut(mi))
14 m_weapon.EjectCasing(mi);
15 m_weapon.EffectBulletHide(mi);
16 m_weapon.SelectionBulletHide();
17 }
18 }
19};
20
22{
24
25 override void OnEntry(WeaponEventBase e)
26 {
27 super.OnEntry(e);
28 if (e)
29 {
30 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ejected fired out casing multi muzzle");
31 for (int i = 0; i < m_weapon.GetMuzzleCount(); i++)
32 {
33 if (m_weapon.IsChamberFiredOut(i))
34 {
35 m_weapon.EjectCasing(i);
36 m_weapon.EffectBulletHide(i);
37 m_weapon.HideBullet(i);
38 }
39 }
40 }
41 }
42
44 {
45 return false;
46 }
47};
48
50{
51 override bool IsWaitingForActionFinish() { return true; }
52};
53
55{
56 Magazine m_dstMagazine;
58
59 override void OnEntry(WeaponEventBase e)
60 {
61 super.OnEntry(e);
62 if (e)
63 {
65 if (cylinder)
66 {
67 cylinder.HideSelection("bullet");
68 cylinder.HideSelection("bullet_2");
69 cylinder.HideSelection("bullet_3");
70 cylinder.HideSelection("bullet_4");
71 cylinder.HideSelection("bullet_5");
72 cylinder.HideSelection("bullet_6");
73
74 cylinder.HideSelection("bullet_nose");
75 cylinder.HideSelection("bullet_nose_2");
76 cylinder.HideSelection("bullet_nose_3");
77 cylinder.HideSelection("bullet_nose_4");
78 cylinder.HideSelection("bullet_nose_5");
79 cylinder.HideSelection("bullet_nose_6");
80 }
81
82
83 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ejected bullets from all muzzles");
84 for (int i = 0; i < m_weapon.GetMuzzleCount(); i++)
85 {
86 if (m_weapon.IsChamberFiredOut(i))
87 {
88 m_weapon.EjectCasing(i);
89 m_weapon.EffectBulletHide(i);
90 m_weapon.HideBullet(i);
91 continue;
92 }
93
94 if (!m_weapon.IsChamberEmpty(i))
95 {
96 DayZPlayer p = e.m_player;
97 if (m_dstMagazine && m_dstMagazine.GetAmmoCount() < m_dstMagazine.GetAmmoMax())
98 {
99 m_weapon.CreateRound(i);
100 ejectBulletAndStoreInMagazine(m_weapon, i, m_dstMagazine, p);
101 }
102 else
103 {
104 m_weapon.CreateRound(i);
106 }
107 m_weapon.EffectBulletHide(i);
108 m_weapon.HideBullet(i);
109 }
110 }
111 m_weapon.SetWeaponOpen(false);
112 m_weapon.SetCharged(true);
113 }
114 //m_weapon.SelectionBulletHide();
115 }
116
118 {
119 return false;
120 }
121};
122
123// eject casing and load bullet from att mag (no anim)
125{
126 override void OnEntry(WeaponEventBase e)
127 {
128 super.OnEntry(e);
129 if (e)
130 {
131 int mi = m_weapon.GetCurrentMuzzle();
133 }
134 }
135 override void OnExit(WeaponEventBase e)
136 {
137 super.OnExit(e);
138 }
139};
140
145
void wpnDebugPrint(string s)
Definition Debug.c:9
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
Definition Guards.c:602
static bool IsWeaponLogEnable()
Definition Debug.c:799
override void OnEntry(WeaponEventBase e)
override void OnExit(WeaponEventBase e)
signalize mechanism manipulation
Definition Events.c:35
represent weapon state base
Definition BulletHide.c:2
void WeaponEjectCasingMultiMuzzle(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
override void OnEntry(WeaponEventBase e)
void WeaponEjectAllMuzzles(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
void WeaponEjectCasing(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
void ejectBulletAndStoreInMagazine(Weapon_Base weapon, int muzzleIndex, Magazine mag, DayZPlayer p)
bool pushToChamberFromAttachedMagazine(Weapon_Base weapon, int muzzleIndex)
Definition weapon_utils.c:1