Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MorphineUserAction.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  // Medic character
29  ChimeraCharacter userCharacter = ChimeraCharacter.Cast(user);
30  if (!userCharacter)
31  return false;
32 
33  SCR_ConsumableItemComponent consumableComponent = GetConsumableComponent(userCharacter);
34  if (!consumableComponent)
35  return false;
36 
37  int reason;
38  if (!consumableComponent.GetConsumableEffect().CanApplyEffect(GetOwner(), userCharacter, reason))
39  {
40  if (reason == SCR_EConsumableFailReason.UNDAMAGED)
41  SetCannotPerformReason(m_sNotDamaged);
42  else if (reason == SCR_EConsumableFailReason.ALREADY_APPLIED)
43  SetCannotPerformReason(m_sAlreadyApplied);
44 
45  return false;
46  }
47 
48  return true;
49  }
50 };
ECharacterLifeState
ECharacterLifeState
Definition: ECharacterLifeState.c:12
SCR_HealingUserAction
Definition: SCR_HealingUserAction.c:1
SCR_MorphineUserAction
Definition: SCR_MorphineUserAction.c:1
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128