Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AISmartActionComponent.c
Go to the documentation of this file.
4
5void SCR_AIActionUserInvoker_Callback(AIAgent actionUser);
7typedef ScriptInvokerBase<SCR_AIActionUserInvoker_Callback> SCR_AIActionUserInvoker;
8
10{
14
15 //------------------------------------------------------------------------------------------------
18 void ReserveAction(AIAgent owner)
19 {
20 // listen on death of the owner
21 IEntity ent = owner.GetControlledEntity();
22 if (!ent)
23 return;
26 m_pDamageManager.GetOnDamageStateChanged().Insert(OnDamageStateChanged);
27 SetActionAccessible(false);
28 }
29
30 //------------------------------------------------------------------------------------------------
33 {
35 {
36 m_pDamageManager.GetOnDamageStateChanged().Remove(OnDamageStateChanged);
37 m_pDamageManager = null;
38 }
39 SetActionAccessible(true);
40 }
41
42 //------------------------------------------------------------------------------------------------
45 {
46 if (state == EDamageState.DESTROYED)
48 }
49
50 //------------------------------------------------------------------------------------------------
51 override void OnActionEnd(IEntity owner)
52 {
53 super.OnActionEnd(owner);
56 Event_EOnActionEnd.Invoke(GetUser());
57 }
58
59 //------------------------------------------------------------------------------------------------
60 override void OnActionFailed(IEntity owner)
61 {
62 super.OnActionFailed(owner);
65 Event_EOnActionFailed.Invoke(GetUser());
66 }
67
68 //------------------------------------------------------------------------------------------------
71 // Invokers for the completion of the smartaction to be used by the children //
73 {
74 if (!Event_EOnActionEnd && createNew)
76 return Event_EOnActionEnd;
77 }
78
79 //------------------------------------------------------------------------------------------------
88
89 //------------------------------------------------------------------------------------------------
90 override void OnDelete(IEntity owner)
91 {
93 m_pDamageManager.GetOnDamageStateChanged().Remove(OnDamageStateChanged);
94 }
95}
ScriptInvokerBase< SCR_AIActionUserInvoker_Callback > SCR_AIActionUserInvoker
func SCR_AIActionUserInvoker_Callback
proto external Managed FindComponent(typename typeName)
ref SCR_AIActionUserInvoker Event_EOnActionFailed
void OnDamageStateChanged(EDamageState state)
SCR_AIActionUserInvoker GetOnActionEnd(bool createNew=true)
ref SCR_AIActionUserInvoker Event_EOnActionEnd
SCR_CharacterDamageManagerComponent m_pDamageManager
override void OnActionFailed(IEntity owner)
override void OnActionEnd(IEntity owner)
SCR_AIActionUserInvoker GetOnActionFailed(bool createNew=true)
override void OnDelete(IEntity owner)
EDamageState