Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CharBleedingEditorAttribute.c
Go to the documentation of this file.
3 {
4  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
5  {
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.CreateFloat(characterDamageManager.GetDOTScale());
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  IEntity owner = editableEntity.GetOwner();
38  if (!owner)
39  return;
40 
41  ChimeraCharacter character = ChimeraCharacter.Cast(owner);
42  if (!character)
43  return;
44 
45  SCR_CharacterDamageManagerComponent characterDamageManager = SCR_CharacterDamageManagerComponent.Cast(character.GetDamageManager());
46  if (!characterDamageManager)
47  return;
48 
49  if (characterDamageManager.GetState() == EDamageState.DESTROYED)
50  return;
51 
52  if (!characterDamageManager.IsDamageHandlingEnabled())
53  return;
54 
55  characterDamageManager.SetDOTScale(var.GetFloat(), true);
56  }
57 };
SCR_CharBleedingEditorAttribute
Definition: SCR_CharBleedingEditorAttribute.c:2
EDamageState
EDamageState
Definition: EDamageState.c:12
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_BaseValueListEditorAttribute
Definition: SCR_BaseValueListEditorAttribute.c:5
SCR_CharacterDamageManagerComponent
Definition: SCR_CharacterDamageManagerComponent.c:18
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468