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_OverrideCharacterMedicalEditorAttribute.c
Go to the documentation of this file.
1
4
// Script File
5
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
6
class
SCR_OverrideCharacterMedicalEditorAttribute
:
SCR_BaseEditorAttribute
7
{
8
override
SCR_BaseEditorAttributeVar
ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
9
{
10
SCR_EditableEntityComponent
editableEntity =
SCR_EditableEntityComponent
.Cast(item);
11
if
(!editableEntity)
12
return
null;
13
14
IEntity
owner = editableEntity.GetOwner();
15
if
(!owner)
16
return
null;
17
18
ChimeraCharacter
character =
ChimeraCharacter
.Cast(owner);
19
if
(!character)
20
return
null;
21
22
SCR_CharacterDamageManagerComponent
characterDamageManager =
SCR_CharacterDamageManagerComponent
.Cast(character.GetDamageManager());
23
if
(!characterDamageManager)
24
return
null;
25
26
if
(characterDamageManager.GetState() ==
EDamageState
.DESTROYED)
27
return
null;
28
29
return
SCR_BaseEditorAttributeVar
.
CreateBool
(characterDamageManager.
GetOverrideCharacterMedicalGMAttribute
());
30
}
31
32
override
void
UpdateInterlinkedVariables(
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
bool
isInit =
false
)
33
{
34
if
(isInit)
35
{
36
manager.SetAttributeAsSubAttribute(
SCR_CharRegenEditorAttribute
);
37
manager.SetAttributeAsSubAttribute(
SCR_CharBleedingEditorAttribute
);
38
manager.SetAttributeAsSubAttribute(
SCR_CharUnconsciousnessEditorAttribute
);
39
}
40
41
bool
isOverridden = var && var.
GetBool
();
42
43
manager.SetAttributeEnabled(
SCR_CharRegenEditorAttribute
, isOverridden);
44
manager.SetAttributeEnabled(
SCR_CharBleedingEditorAttribute
, isOverridden);
45
manager.SetAttributeEnabled(
SCR_CharUnconsciousnessEditorAttribute
, isOverridden);
46
}
47
48
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
49
{
50
if
(!var)
51
return
;
52
53
SCR_EditableEntityComponent
editableEntity =
SCR_EditableEntityComponent
.Cast(item);
54
if
(!editableEntity)
55
return
;
56
57
IEntity
owner = editableEntity.GetOwner();
58
if
(!owner)
59
return
;
60
61
ChimeraCharacter
character =
ChimeraCharacter
.Cast(owner);
62
if
(!character)
63
return
;
64
65
SCR_CharacterDamageManagerComponent
characterDamageManager =
SCR_CharacterDamageManagerComponent
.Cast(character.GetDamageManager());
66
if
(!characterDamageManager || characterDamageManager.GetState() ==
EDamageState
.DESTROYED)
67
return
;
68
69
bool
value = var.
GetBool
();
70
71
if
(!value)
72
{
73
SCR_GameModeHealthSettings gameModeHealthSettings = SCR_GameModeHealthSettings.Cast(
GetGame
().
GetGameMode
().FindComponent(SCR_GameModeHealthSettings));
74
if
(!gameModeHealthSettings)
75
return
;
76
77
characterDamageManager.
SetBleedingScale
(gameModeHealthSettings.GetBleedingScale(),
false
);
78
characterDamageManager.
SetRegenScale
(gameModeHealthSettings.GetRegenScale(),
false
);
79
characterDamageManager.
SetPermitUnconsciousness
(gameModeHealthSettings.IsUnconsciousnessPermitted(),
true
);
80
}
81
82
characterDamageManager.
SetOverrideCharacterMedicalGMAttribute
(value);
83
}
84
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition
SCR_BaseGameModeComponent.c:15
ChimeraCharacter
Definition
ChimeraCharacter.c:13
IEntity
Definition
IEntity.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_CharBleedingEditorAttribute
Definition
SCR_CharBleedingEditorAttribute.c:3
SCR_CharRegenEditorAttribute
Definition
SCR_CharRegenEditorAttribute.c:3
SCR_CharUnconsciousnessEditorAttribute
Definition
SCR_CharUnconsciousnessEditorAttribute.c:3
SCR_CharacterDamageManagerComponent
Definition
SCR_CharacterDamageManagerComponent.c:19
SCR_CharacterDamageManagerComponent::SetOverrideCharacterMedicalGMAttribute
void SetOverrideCharacterMedicalGMAttribute(bool permit)
Definition
SCR_CharacterDamageManagerComponent.c:827
SCR_CharacterDamageManagerComponent::SetBleedingScale
void SetBleedingScale(float rate, bool changed)
Definition
SCR_CharacterDamageManagerComponent.c:743
SCR_CharacterDamageManagerComponent::SetPermitUnconsciousness
void SetPermitUnconsciousness(bool permit, bool changed)
Definition
SCR_CharacterDamageManagerComponent.c:820
SCR_CharacterDamageManagerComponent::GetOverrideCharacterMedicalGMAttribute
bool GetOverrideCharacterMedicalGMAttribute()
Definition
SCR_CharacterDamageManagerComponent.c:833
SCR_CharacterDamageManagerComponent::SetRegenScale
void SetRegenScale(float rate, bool changed)
Definition
SCR_CharacterDamageManagerComponent.c:759
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_OverrideCharacterMedicalEditorAttribute
Definition
SCR_OverrideCharacterMedicalEditorAttribute.c:7
EDamageState
EDamageState
Definition
EDamageState.c:13
scripts
Game
Editor
Containers
Attributes
SCR_OverrideCharacterMedicalEditorAttribute.c
Generated by
1.17.0