DayZ 1.24
Loading...
Searching...
No Matches
SmptAnimMeta.c
Go to the documentation of this file.
6
8{
17
19 {
20 }
21
27
28 bool IsPlaying()
29 {
30 return m_IsPlaying;
31 }
32
34 {
35 return m_DestroyRequested;
36 }
37
39 {
40 m_DestroyRequested = true;
42
43 if (type == eAnimFinishType.FAILURE)// <--------------- FAILED
44 {
45 if (m_Player.GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_SERVER || !GetGame().IsMultiplayer())
46 {
47 if (Symptom)
48 Symptom.AnimationPlayFailed();
49 }
50 }
51 else if (type == eAnimFinishType.SUCCESS)// <--------------- SUCCESS
52 {
53 if (m_Player.GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_SERVER || !GetGame().IsMultiplayer())
54 {
55 if (Symptom)
56 Symptom.AnimationFinish();
57 }
58 }
59 }
60
69
70 protected EAnimPlayState Play();
71
73
74};
75
77{
80
82 {
83 if (m_Player)
85 }
86
92
94 {
95 m_Canceled = false;
96
97 HumanCommandActionCallback callback = m_Player.GetCommand_Action();
98
99 if (!callback)
100 callback = m_Player.GetCommandModifier_Action();
101 if (callback)
102 {
103 callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_INTERRUPT);
104 m_Canceled = true;
105 }
106
107 if (!m_Canceled)
108 {
110
111 if (anim_callback)
112 {
114 m_IsPlaying = true;
116 return EAnimPlayState.OK;
117 }
118 else
119 return EAnimPlayState.FAILED;
120 }
121 return EAnimPlayState.POSTPONED;
122 }
123}
124
126{
129 {
130 super.Init(ctx, manager, player);
132 }
133
135 {
136 HumanCommandActionCallback callback = m_Player.GetCommand_Action();
137 if (!callback)
138 callback = m_Player.GetCommandModifier_Action();
139 if (!callback)
140 {
141 HumanCommandWeapons hcw = m_Player.GetCommandModifier_Weapons();
142 if (hcw && !hcw.IsActionFinished())
143 return EAnimPlayState.FAILED;
144
145 HumanCommandAdditives ad = m_Player.GetCommandModifier_Additives();
146 if (ad)
147 {
148 //Print("------------------ Playing -----------------");
149 ad.StartModifier(m_AnimID);
150 m_IsPlaying = true;
151
152 return EAnimPlayState.OK;
153 }
154 }
155 return EAnimPlayState.FAILED;
156 }
157
159 {
160 if (m_IsPlaying)
161 {
162 HumanCommandAdditives ad = m_Player.GetCommandModifier_Additives();
163 if (!ad || !ad.IsModifierActive())
164 {
165 //Print("------------------ Not Playing -----------------");
167 }
168 else
169 {
171 {
173 m_CalledAnimStart = true;
174 }
175 }
176 }
177 }
178}
179
180
182{
184 {
185 //if( movement_state.m_iMovement == DayZPlayerConstants.MOVEMENTIDX_WALK || movement_state.m_iMovement == DayZPlayerConstants.MOVEMENTIDX_RUN || movement_state.m_iMovement == DayZPlayerConstants.MOVEMENTIDX_SPRINT)
186 if (movement_state.m_iMovement != DayZPlayerConstants.MOVEMENTIDX_IDLE || movement_state.IsInProne())
187 {
188 HumanCommandAdditives ad = m_Player.GetCommandModifier_Additives();
189 if (ad && ad.IsModifierActive())
190 ad.CancelModifier();
191 }
192
193 super.Update(movement_state);
194 }
195}
int m_StanceMask
Definition ActionBase.c:53
float m_Duration
override Widget Init()
Definition DayZGame.c:120
bool m_IsPlaying
Whether the Effect is currently playing.
Definition Effect.c:37
DayZPlayer m_Player
Definition Hand_Events.c:42
EAnimPlayState Play()
EAnimPlayState PlayRequest()
bool m_DestroyRequested
class SmptAnimMetaFB extends SmptAnimMetaBase m_CalledAnimStart
int m_SymptomType
int m_AnimID
PlayerBase m_Player
bool IsDestroyReqested()
enum eAnimFinishType m_IsPlaying
bool m_Canceled
bool IsPlaying()
int m_StateType
void SmptAnimMetaBase()
SymptomManager m_Manager
void AnimFinished(eAnimFinishType type)
eAnimFinishType
Definition SmptAnimMeta.c:2
@ FAILURE
Definition SmptAnimMeta.c:4
@ SUCCESS
Definition SmptAnimMeta.c:3
EAnimPlayState
static bool ReadPlayerSymptomADDParams(ParamsReadContext pCtx, out int type)
static bool ReadPlayerSymptomFBParams(ParamsReadContext pCtx, out DayZPlayerConstants anim_id, out int stance_mask, out float duration)
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
override void Update(HumanMovementState movement_state)
override EAnimPlayState Play()
override void Init(ParamsReadContext ctx, SymptomManager manager, PlayerBase player)
SymptomBase GetCurrentPrimaryActiveSymptom()
void OnAnimationFinished(eAnimFinishType type=eAnimFinishType.SUCCESS)
void OnAnimationStarted()
DayZPlayerInstanceType
defined in C++
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()
proto native volatile void Update()
class HumanCommandWeapons HumanCommandAdditives()
Definition human.c:1086