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_CharUnconsciousnessEditorAttribute.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
2
class
SCR_CharUnconsciousnessEditorAttribute
:
SCR_BaseEditorAttribute
3
{
4
override
SCR_BaseEditorAttributeVar
ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
5
{
6
SCR_EditableEntityComponent
editableEntity =
SCR_EditableEntityComponent
.Cast(item);
7
if
(!editableEntity)
8
return
null;
9
10
IEntity
owner = editableEntity.GetOwner();
11
if
(!owner)
12
return
null;
13
14
ChimeraCharacter
character =
ChimeraCharacter
.Cast(owner);
15
if
(!character)
16
return
null;
17
18
SCR_CharacterDamageManagerComponent
characterDamageManager =
SCR_CharacterDamageManagerComponent
.Cast(character.GetDamageManager());
19
if
(!characterDamageManager)
20
return
null;
21
22
if
(characterDamageManager.GetState() ==
EDamageState
.DESTROYED)
23
return
null;
24
25
return
SCR_BaseEditorAttributeVar
.
CreateBool
(characterDamageManager.
GetPermitUnconsciousness
());
26
}
27
28
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
29
{
30
if
(!var)
31
return
;
32
33
SCR_EditableEntityComponent
editableEntity =
SCR_EditableEntityComponent
.Cast(item);
34
if
(!editableEntity)
35
return
;
36
37
ChimeraCharacter
character =
ChimeraCharacter
.Cast(editableEntity.GetOwner());
38
if
(!character)
39
return
;
40
41
SCR_CharacterDamageManagerComponent
characterDamageManager =
SCR_CharacterDamageManagerComponent
.Cast(character.GetDamageManager());
42
if
(!characterDamageManager)
43
return
;
44
45
CharacterControllerComponent controller = character.GetCharacterController();
46
if
(!controller)
47
return
;
48
49
ECharacterLifeState
lifeState = controller.GetLifeState();
50
if
(lifeState ==
ECharacterLifeState
.DEAD)
51
return
;
52
53
if
(!characterDamageManager.IsDamageHandlingEnabled())
54
return
;
55
56
//Neutralize character if unconsciousness is disabled and character is already unconscious
57
if
(lifeState ==
ECharacterLifeState
.INCAPACITATED && !var.
GetBool
())
58
characterDamageManager.Kill(
Instigator
.CreateInstigatorGM());
59
60
characterDamageManager.
SetPermitUnconsciousness
(var.
GetBool
(),
true
);
61
}
62
};
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
ChimeraCharacter
Definition
ChimeraCharacter.c:13
IEntity
Definition
IEntity.c:13
Instigator
Definition
Instigator.c:13
SCR_BaseEditorAttributeCustomTitle
Definition
SCR_BaseEditorAttribute.c:876
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition
SCR_BaseEditorAttribute.c:4
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::CreateBool
static SCR_BaseEditorAttributeVar CreateBool(bool value)
Definition
SCR_BaseEditorAttributeVar.c:119
SCR_BaseEditorAttributeVar::GetBool
bool GetBool()
Definition
SCR_BaseEditorAttributeVar.c:56
SCR_CharUnconsciousnessEditorAttribute
Definition
SCR_CharUnconsciousnessEditorAttribute.c:3
SCR_CharacterDamageManagerComponent
Definition
SCR_CharacterDamageManagerComponent.c:19
SCR_CharacterDamageManagerComponent::GetPermitUnconsciousness
bool GetPermitUnconsciousness()
Returns whether unconsciousness is permitted. Character prefab has highest authority,...
Definition
SCR_CharacterDamageManagerComponent.c:777
SCR_CharacterDamageManagerComponent::SetPermitUnconsciousness
void SetPermitUnconsciousness(bool permit, bool changed)
Definition
SCR_CharacterDamageManagerComponent.c:820
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
ECharacterLifeState
ECharacterLifeState
Definition
ECharacterLifeState.c:13
EDamageState
EDamageState
Definition
EDamageState.c:13
scripts
Game
Editor
Containers
Attributes
SCR_CharUnconsciousnessEditorAttribute.c
Generated by
1.17.0