Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BandageUserAction.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 CanBeShownScript(IEntity user)
27 {
28 if (!super.CanBeShownScript(user))
29 return false;
30
31 // Target character
32 ChimeraCharacter targetCharacter = ChimeraCharacter.Cast(GetOwner());
33 if (!targetCharacter)
34 return false;
35
36 SCR_CharacterDamageManagerComponent charDamMan = SCR_CharacterDamageManagerComponent.Cast(targetCharacter.GetDamageManager());
37 if (!charDamMan || charDamMan.GetGroupDamageOverTime(m_eHitZoneGroup, EDamageType.BLEEDING) == 0)
38 {
40 return false;
41 }
42
43 return true;
44 }
45};
void SetCannotPerformReason(string reason)
proto external IEntity GetOwner()
Returns the parent entity of this action.
override float GetGroupDamageOverTime(ECharacterHitZoneGroup hitZoneGroup, EDamageType damageType)
ECharacterHitZoneGroup m_eHitZoneGroup
SCR_ConsumableItemComponent GetConsumableComponent(notnull ChimeraCharacter userChar)
ECharacterLifeState
EDamageType
Definition EDamageType.c:13