DayZ 1.24
Loading...
Searching...
No Matches
SmptAnimMeta.c File Reference

Go to the source code of this file.

Classes

class  SmptAnimMetaBase
 
class  SmptAnimMetaADD
 

Enumerations

enum  eAnimFinishType { SUCCESS , FAILURE }
 

Functions

void SmptAnimMetaBase ()
 
void Init (ParamsReadContext ctx, SymptomManager manager, PlayerBase player)
 
bool IsPlaying ()
 
bool IsDestroyReqested ()
 
void AnimFinished (eAnimFinishType type)
 
EAnimPlayState PlayRequest ()
 
EAnimPlayState Play ()
 
void Update (HumanMovementState movement_state)
 

Variables

enum eAnimFinishType m_IsPlaying
 
SymptomManager m_Manager
 
PlayerBase m_Player
 
int m_AnimID
 
int m_SymptomType
 
int m_StateType
 
bool m_DestroyRequested
 
bool m_Canceled
 
class SmptAnimMetaFB extends SmptAnimMetaBase m_CalledAnimStart
 

Enumeration Type Documentation

◆ eAnimFinishType

Enumerator
SUCCESS 
FAILURE 

Definition at line 1 of file SmptAnimMeta.c.

2{
5}
@ FAILURE
Definition SmptAnimMeta.c:4
@ SUCCESS
Definition SmptAnimMeta.c:3

Function Documentation

◆ AnimFinished()

void AnimFinished ( eAnimFinishType type)

Definition at line 38 of file SmptAnimMeta.c.

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 }
bool m_DestroyRequested
PlayerBase m_Player
SymptomManager m_Manager
eAnimFinishType
Definition SmptAnimMeta.c:2
SymptomBase GetCurrentPrimaryActiveSymptom()
DayZPlayerInstanceType
defined in C++
proto native CGame GetGame()

References SymptomManager::GetCurrentPrimaryActiveSymptom(), GetGame(), m_DestroyRequested, m_Manager, and m_Player.

◆ Init()

override void Init ( ParamsReadContext ctx,
SymptomManager manager,
PlayerBase player )

Definition at line 22 of file SmptAnimMeta.c.

23 {
26 }

References m_Manager, and m_Player.

◆ IsDestroyReqested()

bool IsDestroyReqested ( )

Definition at line 33 of file SmptAnimMeta.c.

34 {
35 return m_DestroyRequested;
36 }

References m_DestroyRequested.

◆ IsPlaying()

bool IsPlaying ( )

Definition at line 28 of file SmptAnimMeta.c.

29 {
30 return m_IsPlaying;
31 }
enum eAnimFinishType m_IsPlaying

References m_IsPlaying.

◆ Play()

override EAnimPlayState Play ( )
protected

Definition at line 134 of file SmptAnimMeta.c.

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 }
int m_AnimID
EAnimPlayState
class HumanCommandWeapons HumanCommandAdditives()
Definition human.c:1086

References HumanCommandAdditives(), m_AnimID, m_IsPlaying, and m_Player.

Referenced by UIScriptedMenu::Connect(), UIScriptedMenu::OnClick(), and UIScriptedMenu::OnKeyPress().

◆ PlayRequest()

EAnimPlayState PlayRequest ( )

Definition at line 61 of file SmptAnimMeta.c.

62 {
64
65 if (played == EAnimPlayState.FAILED)
67 return played;
68 }
EAnimPlayState Play()
void OnAnimationFinished(eAnimFinishType type=eAnimFinishType.SUCCESS)

References m_Manager, SymptomManager::OnAnimationFinished(), and SmptAnimMetaBase::Play().

◆ SmptAnimMetaBase()

void SmptAnimMetaBase ( )

Definition at line 18 of file SmptAnimMeta.c.

19 {
20 }

◆ Update()

override void Update ( HumanMovementState movement_state)
protected

Definition at line 158 of file SmptAnimMeta.c.

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 }
class SmptAnimMetaFB extends SmptAnimMetaBase m_CalledAnimStart
void OnAnimationStarted()

References HumanCommandAdditives(), m_CalledAnimStart, m_IsPlaying, m_Manager, m_Player, SymptomManager::OnAnimationFinished(), and SymptomManager::OnAnimationStarted().

Variable Documentation

◆ m_AnimID

int m_AnimID

Definition at line 12 of file SmptAnimMeta.c.

Referenced by SmptAnimMetaBase::Init(), SmptAnimMetaBase::Play(), and Play().

◆ m_CalledAnimStart

class SmptAnimMetaFB extends SmptAnimMetaBase m_CalledAnimStart
protected

Referenced by Update().

◆ m_Canceled

bool m_Canceled

Definition at line 16 of file SmptAnimMeta.c.

Referenced by EndActionComponent(), and SmptAnimMetaBase::Play().

◆ m_DestroyRequested

bool m_DestroyRequested

Definition at line 15 of file SmptAnimMeta.c.

Referenced by AnimFinished(), and IsDestroyReqested().

◆ m_IsPlaying

enum eAnimFinishType m_IsPlaying

Referenced by IsPlaying(), Play(), and Update().

◆ m_Manager

SymptomManager m_Manager

Definition at line 10 of file SmptAnimMeta.c.

Referenced by AnimFinished(), Init(), PlayRequest(), and Update().

◆ m_Player

PlayerBase m_Player

Definition at line 11 of file SmptAnimMeta.c.

Referenced by AnimFinished(), Init(), Play(), and Update().

◆ m_StateType

int m_StateType

Definition at line 14 of file SmptAnimMeta.c.

◆ m_SymptomType

int m_SymptomType

Definition at line 13 of file SmptAnimMeta.c.

Referenced by SymptomBase::OnInit().