Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SalineBagUserAction.c
Go to the documentation of this file.
2 {
3 
4  //------------------------------------------------------------------------------------------------
7  override void OnActionCanceled(IEntity pOwnerEntity, IEntity pUserEntity)
8  {
9  ChimeraCharacter character = ChimeraCharacter.Cast(pUserEntity);
10  if (!character)
11  return;
12 
13  CharacterControllerComponent controller = character.GetCharacterController();
14  if (!controller)
15  return;
16 
17  if (controller.GetLifeState() != ECharacterLifeState.ALIVE)
18  return;
19 
20  SCR_ConsumableItemComponent consumableComponent = GetConsumableComponent(character);
21  if (consumableComponent)
22  consumableComponent.SetAlternativeModel(false);
23  }
24 
25  //------------------------------------------------------------------------------------------------
26  override bool CanBePerformedScript(IEntity user)
27  {
28  // Target character
29  ChimeraCharacter targetCharacter = ChimeraCharacter.Cast(GetOwner());
30  if (!targetCharacter)
31  return false;
32 
33  // Medic character
34  ChimeraCharacter userCharacter = ChimeraCharacter.Cast(user);
35  if (!userCharacter)
36  return false;
37 
38  SCR_ConsumableItemComponent consumableComponent = GetConsumableComponent(userCharacter);
39  if (!consumableComponent)
40  return false;
41 
42  SCR_ConsumableSalineBag consumableSaline = SCR_ConsumableSalineBag.Cast(consumableComponent.GetConsumableEffect());
43  if (!consumableSaline)
44  return false;
45 
46  int reason;
47  if (consumableSaline.CanApplyEffectToHZ(targetCharacter, userCharacter, m_eHitZoneGroup, reason))
48  return true;
49 
50  if (reason == SCR_EConsumableFailReason.UNDAMAGED)
51  SetCannotPerformReason(m_sNoBloodLoss);
52 
53  if (reason == SCR_EConsumableFailReason.ALREADY_APPLIED)
54  SetCannotPerformReason(m_sAlreadyApplied);
55 
56  return false;
57  }
58 };
m_eHitZoneGroup
protected ECharacterHitZoneGroup m_eHitZoneGroup
Definition: SCR_InventoryHitZonePointUI.c:403
ECharacterLifeState
ECharacterLifeState
Definition: ECharacterLifeState.c:12
SCR_HealingUserAction
Definition: SCR_HealingUserAction.c:1
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
SCR_SalineBagUserAction
Definition: SCR_SalineBagUserAction.c:1