6 [
Attribute(
"0", UIWidgets.ComboBox,
"Which consumabletype will be checked for conditions", enums:ParamEnumArray.FromEnum(
SCR_EConsumableType) )]
9 [
Attribute(
"#AR-FailReason_AlreadyApplied", UIWidgets.EditBox,
"String for already applied healing gadgets")]
12 [
Attribute(
"#AR-FailReason_NotBleeding", UIWidgets.EditBox,
"String for when target hitzone isn't bleeding")]
15 [
Attribute(
"#AR-FailReason_NoBloodLoss", UIWidgets.EditBox,
"String for when blood hitzone isn't damaged")]
18 [
Attribute(
"#AR-FailReason_NotDamaged", UIWidgets.EditBox,
"String for when target hitzone isn't damaged")]
22 protected SCR_ConsumableItemComponent GetConsumableComponent(notnull ChimeraCharacter userChar)
24 CharacterControllerComponent controller = userChar.GetCharacterController();
28 IEntity item = controller.GetAttachedGadgetAtLeftHandSlot();
32 return SCR_ConsumableItemComponent.Cast(item.FindComponent(SCR_ConsumableItemComponent));;
36 override bool CanBeShownScript(IEntity user)
43 ChimeraCharacter targetCharacter = ChimeraCharacter.Cast(
GetOwner());
48 ChimeraCharacter userCharacter = ChimeraCharacter.Cast(user);
53 CharacterControllerComponent userController = userCharacter.GetCharacterController();
54 if (!userController || userController.IsUsingItem())
58 if (userCharacter.IsInVehicle() && !HealingAllowedFromSeat(userCharacter))
62 SCR_ConsumableItemComponent consumableComponent = GetConsumableComponent(userCharacter);
63 if (!consumableComponent || consumableComponent.GetConsumableType() != m_eConsumableType)
68 if (!damageMan || damageMan.GetState() ==
EDamageState.DESTROYED)
78 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
81 ChimeraCharacter targetCharacter = ChimeraCharacter.Cast(
GetOwner());
86 ChimeraCharacter userCharacter = ChimeraCharacter.Cast(pUserEntity);
94 IEntity item = userController.GetAttachedGadgetAtLeftHandSlot();
98 SCR_ConsumableItemComponent consumableComponent = GetConsumableComponent(userCharacter);
99 if (!consumableComponent)
102 consumableComponent.SetTargetCharacter(targetCharacter);
104 if (!consumableEffect)
107 TAnimGraphCommand desiredCmd;
108 if (pOwnerEntity == pUserEntity)
109 desiredCmd = consumableEffect.GetApplyToSelfAnimCmnd(pOwnerEntity);
111 desiredCmd = consumableEffect.GetApplyToOtherAnimCmnd(pOwnerEntity);
114 if (targetController && targetController.IsUnconscious())
115 desiredCmd = consumableEffect.GetReviveAnimCmnd(pOwnerEntity);
118 if (!targetDamageMan)
123 params.SetAllowMovementDuringAction(
false);
124 params.SetKeepInHandAfterSuccess(
true);
125 params.SetCommandID(desiredCmd);
126 params.SetCommandIntArg(1);
127 params.SetCommandFloatArg(0.0);
128 params.SetMaxAnimLength(consumableEffect.GetApplyToOtherDuraction());
131 consumableEffect.ActivateEffect(pOwnerEntity, pUserEntity, item,
params);
135 bool HealingAllowedFromSeat(ChimeraCharacter
char)
140 CompartmentAccessComponent compartmentAccess =
char.GetCompartmentAccessComponent();
141 if (!compartmentAccess)
148 return doctorSlot.AllowHealingFromCompartment();