Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ConsumableEffectBase.c
Go to the documentation of this file.
3 {
4  NONE,
11 }
12 
14 enum SCR_EConsumableFailReason
15 {
16  NONE = 0,
17  UNKOWN = 1,
18  IS_BLEEDING = 10,
19  NOT_BLEEDING = 11,
20  ALREADY_APPLIED = 12,
21  DAMAGED = 13,
22  UNDAMAGED = 14
23 }
24 
27 class 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  {
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 }
ECharacterHitZoneGroup
ECharacterHitZoneGroup
Definition: SCR_CharacterDamageManagerComponent.c:1
SCR_EConsumableType
SCR_EConsumableType
Type of consumable gadget.
Definition: SCR_ConsumableEffectBase.c:2
DAMAGED
enum SCR_EConsumableType DAMAGED
UNDAMAGED
@ UNDAMAGED
Definition: SCR_DestructibleBuildingEntity.c:36
NOT_BLEEDING
enum SCR_EConsumableType NOT_BLEEDING
SALINE
@ SALINE
Definition: SCR_ConsumableEffectBase.c:8
ItemUseParameters
Definition: ItemUseParameters.c:15
TOURNIQUET
@ TOURNIQUET
Definition: SCR_ConsumableEffectBase.c:7
MORPHINE
@ MORPHINE
Definition: SCR_ConsumableEffectBase.c:9
UNKOWN
enum SCR_EConsumableType UNKOWN
Attribute
typedef Attribute
Post-process effect of scripted camera.
HEALTH
@ HEALTH
Definition: SCR_ConsumableEffectBase.c:6
ALREADY_APPLIED
enum SCR_EConsumableType ALREADY_APPLIED
MED_KIT
@ MED_KIT
Definition: SCR_ConsumableEffectBase.c:10
NONE
enum SCR_EConsumableType NONE
Reason why consumable cannot be applied.
Definition: SCR_ConsumableEffectBase.c:4
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
BANDAGE
@ BANDAGE
Definition: SCR_ConsumableEffectBase.c:5
IS_BLEEDING
enum SCR_EConsumableType IS_BLEEDING
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180