Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionKillEntity.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Entity to be killed (Optional if action is attached on Slot that spawns target entity)")]
5 ref SCR_ScenarioFrameworkGet m_Getter;
6
7 [Attribute(desc: "If target entity is Character, it will randomize ragdoll upon death")]
8 bool m_bRandomizeRagdoll;
9
10 //------------------------------------------------------------------------------------------------
11 override void OnActivate(IEntity object)
12 {
13 if (!CanActivate())
14 return;
15
16 IEntity entity;
17 if (!ValidateInputEntity(object, m_Getter, entity))
18 return;
19
20 SCR_DamageManagerComponent damageMananager = SCR_DamageManagerComponent.GetDamageManager(entity);
21 if (damageMananager)
22 damageMananager.Kill(Instigator.CreateInstigator(object));
23
24 if (!m_bRandomizeRagdoll)
25 return;
26
28 if (!animationComponent)
29 {
30 Print(string.Format("ScenarioFramework Action: Entity does not have animation component needed for action %1. Action won't randomize the ragdoll.", this), LogLevel.ERROR);
31 return;
32 }
33
34 vector randomDir = { // always right, front, up, never left, back, down
35 Math.RandomIntInclusive(1, 3),
36 Math.RandomIntInclusive(1, 3),
37 Math.RandomIntInclusive(1, 3)
38 };
39
40 animationComponent.AddRagdollEffectorDamage(vector.One, randomDir.Normalized(), Math.RandomFloatInclusive(0, 50), Math.RandomFloatInclusive(0, 10), Math.RandomFloatInclusive(0, 20));
41 }
42}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
Definition Math.c:13
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute