Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ConsumableEffectBase.c
Go to the documentation of this file.
1
12
14enum SCR_EConsumableFailReason
15{
16 NONE = 0,
17 UNKOWN = 1,
21 DAMAGED = 13,
22 UNDAMAGED = 14
23}
24
27class SCR_ConsumableEffectBase : Managed
28{
29 protected TAnimGraphCommand m_iPlayerApplyToSelfCmdId = -1;
30 protected TAnimGraphCommand m_iPlayerApplyToOtherCmdId = -1;
31 protected TAnimGraphCommand m_iPlayerReviveCmdId = -1;
32
33 [Attribute("true", UIWidgets.CheckBox, "Whether consumable should be deleted directly after completing use", category: "General")]
34 protected bool m_bDeleteOnUse;
35
36 [Attribute("1", UIWidgets.EditBox, "Duration of the animation for using consumable on self", category: "General")]
37 protected float m_fApplyToSelfDuration;
38
39 [Attribute("1", UIWidgets.EditBox, "Duration of the animation for using consumable on other", category: "General")]
40 protected float m_fApplyToOtherDuration;
41
42 SCR_EConsumableType m_eConsumableType;
43
44 //------------------------------------------------------------------------------------------------
51 bool ActivateEffect(IEntity target, IEntity user, IEntity item, ItemUseParameters animParams = null)
52 {
53 ChimeraCharacter character = ChimeraCharacter.Cast(user);
54 if (!character)
55 return false;
56
57 CharacterControllerComponent controller = character.GetCharacterController();
58 if (!controller)
59 return false;
60
61 bool activatedAction;
62
63 if (animParams)
64 {
65 activatedAction = controller.TryUseItemOverrideParams(animParams);
66 }
67 else
68 activatedAction = controller.TryUseItem(item);
69
70 return activatedAction;
71 }
72
73 //------------------------------------------------------------------------------------------------
79 void ApplyEffect(notnull IEntity target, notnull IEntity user, IEntity item, ItemUseParameters animParams);
80
81 //------------------------------------------------------------------------------------------------
87 bool CanApplyEffect(notnull IEntity target, notnull IEntity user, out SCR_EConsumableFailReason failReason = SCR_EConsumableFailReason.NONE);
88
89 //------------------------------------------------------------------------------------------------
91 bool UpdateAnimationCommands(IEntity user);
92
93 //------------------------------------------------------------------------------------------------
97 ItemUseParameters GetAnimationParameters(IEntity item, notnull IEntity target, ECharacterHitZoneGroup group = ECharacterHitZoneGroup.VIRTUAL)
98 {
99 ItemUseParameters params = ItemUseParameters();
100 params.SetEntity(item);
101 params.SetAllowMovementDuringAction(false);
102 params.SetKeepInHandAfterSuccess(false);
103 params.SetCommandID(GetApplyToSelfAnimCmnd(target));
104 params.SetCommandIntArg(1);
105 params.SetCommandFloatArg(0.0);
106 params.SetMaxAnimLength(m_fApplyToSelfDuration);
107 params.SetIntParam(0);
108
109 return params;
110 }
111
112 //------------------------------------------------------------------------------------------------
114 bool GetDeleteOnUse()
115 {
116 return m_bDeleteOnUse;
117 }
118
119 //------------------------------------------------------------------------------------------------
121 float GetApplyToOtherDuraction()
122 {
123 return m_fApplyToOtherDuration;
124 }
125
126 //------------------------------------------------------------------------------------------------
129 TAnimGraphCommand GetApplyToSelfAnimCmnd(IEntity user)
130 {
131 UpdateAnimationCommands(user);
132 return m_iPlayerApplyToSelfCmdId;
133 }
134
135 //------------------------------------------------------------------------------------------------
138 TAnimGraphCommand GetApplyToOtherAnimCmnd(IEntity user)
139 {
140 UpdateAnimationCommands(user);
141 return m_iPlayerApplyToOtherCmdId;
142 }
143}
int TAnimGraphCommand
Definition ECommandIDs.c:1
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
enum SCR_EConsumableType DAMAGED
enum SCR_EConsumableType ALREADY_APPLIED
enum SCR_EConsumableType NOT_BLEEDING
enum SCR_EConsumableType IS_BLEEDING
enum SCR_EConsumableType UNKOWN
SCR_EConsumableType
Type of consumable gadget.
void ActivateEffect(EResourcePlayerInteractionType interactionType, SCR_ResourceComponent resourceComponentFrom, SCR_ResourceComponent resourceComponentTo, EResourceType resourceType, float resourceValue)
enum EVehicleType IEntity
@ NONE
When Shape is created and not initialized yet.
Definition ShapeType.c:15
SCR_FieldOfViewSettings Attribute