14 enum SCR_EConsumableFailReason
27 class SCR_ConsumableEffectBase : Managed
29 protected TAnimGraphCommand m_iPlayerApplyToSelfCmdId = -1;
30 protected TAnimGraphCommand m_iPlayerApplyToOtherCmdId = -1;
31 protected TAnimGraphCommand m_iPlayerReviveCmdId = -1;
33 [
Attribute(
"true", UIWidgets.CheckBox,
"Whether consumable should be deleted directly after completing use",
category:
"General")]
34 protected bool m_bDeleteOnUse;
36 [
Attribute(
"1", UIWidgets.EditBox,
"Duration of the animation for using consumable on self",
category:
"General")]
37 protected float m_fApplyToSelfDuration;
39 [
Attribute(
"1", UIWidgets.EditBox,
"Duration of the animation for using consumable on other",
category:
"General")]
40 protected float m_fApplyToOtherDuration;
51 bool ActivateEffect(IEntity target, IEntity user, IEntity item,
ItemUseParameters animParams =
null)
53 ChimeraCharacter character = ChimeraCharacter.Cast(user);
57 CharacterControllerComponent controller = character.GetCharacterController();
65 activatedAction = controller.TryUseItemOverrideParams(animParams);
68 activatedAction = controller.TryUseItem(item);
70 return activatedAction;
79 void ApplyEffect(notnull IEntity target, notnull IEntity user, IEntity item,
ItemUseParameters animParams);
87 bool CanApplyEffect(notnull IEntity target, notnull IEntity user, out SCR_EConsumableFailReason failReason = SCR_EConsumableFailReason.NONE);
91 bool UpdateAnimationCommands(IEntity user);
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);
114 bool GetDeleteOnUse()
116 return m_bDeleteOnUse;
121 float GetApplyToOtherDuraction()
123 return m_fApplyToOtherDuration;
129 TAnimGraphCommand GetApplyToSelfAnimCmnd(IEntity user)
131 UpdateAnimationCommands(user);
132 return m_iPlayerApplyToSelfCmdId;
138 TAnimGraphCommand GetApplyToOtherAnimCmnd(IEntity user)
140 UpdateAnimationCommands(user);
141 return m_iPlayerApplyToOtherCmdId;