Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_MorphineUserAction.c
Go to the documentation of this file.
1
class
SCR_MorphineUserAction
:
SCR_HealingUserAction
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
};
reason
string reason
Definition
ServerBrowserMenuCallbacks.c:41
BaseUserAction::SetCannotPerformReason
void SetCannotPerformReason(string reason)
Definition
BaseUserAction.c:21
BaseUserAction::GetOwner
proto external IEntity GetOwner()
Returns the parent entity of this action.
ChimeraCharacter
Definition
ChimeraCharacter.c:13
IEntity
Definition
IEntity.c:13
SCR_HealingUserAction
Definition
SCR_HealingUserAction.c:2
SCR_HealingUserAction::m_sNotDamaged
LocalizedString m_sNotDamaged
Definition
SCR_HealingUserAction.c:19
SCR_HealingUserAction::m_sAlreadyApplied
LocalizedString m_sAlreadyApplied
Definition
SCR_HealingUserAction.c:10
SCR_HealingUserAction::GetConsumableComponent
SCR_ConsumableItemComponent GetConsumableComponent(notnull ChimeraCharacter userChar)
Definition
SCR_HealingUserAction.c:22
SCR_MorphineUserAction
Definition
SCR_MorphineUserAction.c:2
ECharacterLifeState
ECharacterLifeState
Definition
ECharacterLifeState.c:13
scripts
Game
UserActions
SCR_MorphineUserAction.c
Generated by
1.17.0