Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
weaponejectcasingandchamberfromattmag.c
Go to the documentation of this file.
1
2
class
WeaponEjectCasing
extends
WeaponStateBase
3
{
4
void
WeaponEjectCasing
(
Weapon_Base
w = NULL,
WeaponStateBase
parent = NULL) { }
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
{
15
m_weapon
.EjectCasing(mi);
16
}
17
m_weapon
.EffectBulletHide(mi);
18
m_weapon
.SelectionBulletHide();
19
}
20
}
21
};
22
23
class
WeaponEjectCasingMultiMuzzle
extends
WeaponStateBase
24
{
25
void
WeaponEjectCasingMultiMuzzle
(
Weapon_Base
w = NULL,
WeaponStateBase
parent = NULL) { }
26
27
override
void
OnEntry
(
WeaponEventBase
e)
28
{
29
super.OnEntry(e);
30
if
(e)
31
{
32
if
(
LogManager
.
IsWeaponLogEnable
()) {
wpnDebugPrint
(
"[wpnfsm] "
+
Object
.GetDebugName(
m_weapon
) +
" ejected fired out casing multi muzzle"
); }
33
for
(
int
i = 0; i <
m_weapon
.GetMuzzleCount(); i++ )
34
{
35
if
(
m_weapon
.IsChamberFiredOut(i))
36
{
37
m_weapon
.EjectCasing(i);
38
m_weapon
.EffectBulletHide(i);
39
m_weapon
.HideBullet(i);
40
}
41
}
42
}
43
}
44
45
override
bool
IsWaitingForActionFinish
()
46
{
47
return
false
;
48
}
49
};
50
51
class
WeaponEjectCasing_W4T
extends
WeaponEjectCasingMultiMuzzle
52
{
53
override
bool
IsWaitingForActionFinish
() {
return
true
; }
54
};
55
56
class
WeaponEjectAllMuzzles
extends
WeaponStateBase
57
{
58
Magazine m_dstMagazine;
59
void
WeaponEjectAllMuzzles
(
Weapon_Base
w = NULL,
WeaponStateBase
parent = NULL) { }
60
61
override
void
OnEntry
(
WeaponEventBase
e)
62
{
63
super.OnEntry(e);
64
if
(e)
65
{
66
Magnum_Cylinder cylinder = Magnum_Cylinder.Cast(
m_weapon
.GetAttachmentByType(Magnum_Cylinder));
67
if
(cylinder)
68
{
69
cylinder.HideSelection(
"bullet"
);
70
cylinder.HideSelection(
"bullet_2"
);
71
cylinder.HideSelection(
"bullet_3"
);
72
cylinder.HideSelection(
"bullet_4"
);
73
cylinder.HideSelection(
"bullet_5"
);
74
cylinder.HideSelection(
"bullet_6"
);
75
76
cylinder.HideSelection(
"bullet_nose"
);
77
cylinder.HideSelection(
"bullet_nose_2"
);
78
cylinder.HideSelection(
"bullet_nose_3"
);
79
cylinder.HideSelection(
"bullet_nose_4"
);
80
cylinder.HideSelection(
"bullet_nose_5"
);
81
cylinder.HideSelection(
"bullet_nose_6"
);
82
}
83
84
85
if
(
LogManager
.
IsWeaponLogEnable
()) {
wpnDebugPrint
(
"[wpnfsm] "
+
Object
.GetDebugName(
m_weapon
) +
" ejected bullets from all muzzles"
); }
86
for
(
int
i = 0; i <
m_weapon
.GetMuzzleCount(); i++ )
87
{
88
if
(
m_weapon
.IsChamberFiredOut(i))
89
{
90
m_weapon
.EjectCasing(i);
91
m_weapon
.EffectBulletHide(i);
92
m_weapon
.HideBullet(i);
93
continue
;
94
}
95
96
if
(!
m_weapon
.IsChamberEmpty(i))
97
{
98
DayZPlayer
p = e.
m_player
;
99
if
(
m_dstMagazine
&&
m_dstMagazine
.GetAmmoCount() <
m_dstMagazine
.GetAmmoMax() )
100
{
101
m_weapon
.CreateRound(i);
102
ejectBulletAndStoreInMagazine
(
m_weapon
,i,
m_dstMagazine
,p);
103
}
104
else
105
{
106
m_weapon
.CreateRound(i);
107
ejectBulletAndStoreInMagazine
(
m_weapon
,i,null,p);
108
}
109
m_weapon
.EffectBulletHide(i);
110
m_weapon
.HideBullet(i);
111
}
112
}
113
m_weapon
.SetWeaponOpen(
false
);
114
m_weapon
.SetCharged(
true
);
115
}
116
//m_weapon.SelectionBulletHide();
117
}
118
119
override
bool
IsWaitingForActionFinish
()
120
{
121
return
false
;
122
}
123
};
124
125
// eject casing and load bullet from att mag (no anim)
126
class
WeaponEjectCasingAndChamberFromAttMag
extends
WeaponEjectCasing
127
{
128
override
void
OnEntry
(
WeaponEventBase
e)
129
{
130
super.OnEntry(e);
131
if
(e)
132
{
133
int
mi =
m_weapon
.GetCurrentMuzzle();
134
pushToChamberFromAttachedMagazine
(
m_weapon
, mi);
135
}
136
}
137
override
void
OnExit
(
WeaponEventBase
e)
138
{
139
super.OnExit(e);
140
}
141
};
142
143
class
WeaponEjectCasingAndChamberFromAttMag_W4T
extends
WeaponEjectCasingAndChamberFromAttMag
144
{
145
override
bool
IsWaitingForActionFinish
() {
return
true
; }
146
};
147
wpnDebugPrint
void wpnDebugPrint(string s)
Definition
debug.c:9
DayZPlayer
Definition
dayzplayerimplement.c:87
LogManager
Definition
debug.c:692
LogManager::IsWeaponLogEnable
static bool IsWeaponLogEnable()
Definition
debug.c:816
Object
Definition
objecttyped.c:2
Weapon_Base
shorthand
Definition
boltactionrifle_base.c:6
WeaponEjectAllMuzzles
Definition
weaponchamberfromattmag.c:93
WeaponEjectCasingAndChamberFromAttMag
Definition
weaponejectcasingandchamberfromattmag.c:144
WeaponEjectCasingAndChamberFromAttMag::IsWaitingForActionFinish
override bool IsWaitingForActionFinish()
Definition
weaponejectcasingandchamberfromattmag.c:145
WeaponEjectCasing
Definition
weaponejectcasingandchamberfromattmag.c:127
WeaponEjectCasing::OnEntry
override void OnEntry(WeaponEventBase e)
Definition
weaponejectcasingandchamberfromattmag.c:128
WeaponEjectCasing::OnExit
override void OnExit(WeaponEventBase e)
Definition
weaponejectcasingandchamberfromattmag.c:137
WeaponEjectCasingMultiMuzzle
Definition
weaponejectcasingandchamberfromattmag.c:52
WeaponEjectCasingMultiMuzzle::IsWaitingForActionFinish
override bool IsWaitingForActionFinish()
Definition
weaponejectcasingandchamberfromattmag.c:53
WeaponEventBase
signalize mechanism manipulation
Definition
events.c:35
WeaponEventBase::m_player
DayZPlayer m_player
Definition
events.c:37
WeaponStateBase
represent weapon state base
Definition
bullethide.c:2
WeaponStateBase::WeaponEjectAllMuzzles
void WeaponEjectAllMuzzles(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
Definition
weaponejectcasingandchamberfromattmag.c:59
WeaponStateBase::m_weapon
Weapon_Base m_weapon
Definition
weaponstatebase.c:12
WeaponStateBase::OnEntry
override void OnEntry(WeaponEventBase e)
Definition
weaponejectcasingandchamberfromattmag.c:6
WeaponStateBase::WeaponStateBase
void WeaponStateBase(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
internal state id used for load/restore
Definition
weaponstatebase.c:17
WeaponStateBase::WeaponEjectCasing
void WeaponEjectCasing(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
Definition
weaponejectcasingandchamberfromattmag.c:4
WeaponStateBase::WeaponEjectCasingMultiMuzzle
void WeaponEjectCasingMultiMuzzle(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
Definition
weaponejectcasingandchamberfromattmag.c:25
WeaponStateBase::m_dstMagazine
Magazine m_dstMagazine
Definition
riflerechambering.c:5
WeaponStateBase::IsWaitingForActionFinish
override bool IsWaitingForActionFinish()
Definition
weaponejectcasingandchamberfromattmag.c:45
m_weapon
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
Definition
guards.c:604
ejectBulletAndStoreInMagazine
void ejectBulletAndStoreInMagazine(Weapon_Base weapon, int muzzleIndex, Magazine mag, DayZPlayer p)
Definition
weapon_utils.c:58
pushToChamberFromAttachedMagazine
bool pushToChamberFromAttachedMagazine(Weapon_Base weapon, int muzzleIndex)
Definition
weapon_utils.c:1
Games
Dayz
scripts
4_world
entities
firearms
fsm
states
weaponejectcasingandchamberfromattmag.c
Generated by
1.17.0