Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TutorialLogic_Medical.c
Go to the documentation of this file.
3{
5 //------------------------------------------------------------------------------------------------
6 override void OnCourseStart()
7 {
8 IEntity victim = GetGame().GetWorld().FindEntityByName("Victim");
9 if (!victim)
10 return;
11
14 return;
15
16 //prepare injuries on victim
17 m_VictimDamageManager.AddParticularBleeding("LThigh");
18 m_VictimDamageManager.AddParticularBleeding("Chest");
19 m_VictimDamageManager.GetHitZoneByName("LThigh").SetHealth(0);
20 m_VictimDamageManager.GetHitZoneByName("Chest").SetHealth(0);
21 m_VictimDamageManager.ForceUnconsciousness();
22
23 GetGame().GetCallqueue().Remove(RefreshVictimBloodLevel);
24 GetGame().GetCallqueue().Remove(RefreshVictimResilience);
25 GetGame().GetCallqueue().CallLater(RefreshVictimBloodLevel, 1000, true);
26 GetGame().GetCallqueue().CallLater(RefreshVictimResilience, 1000, true);
27
28 IEntity vehicle = GetGame().GetWorld().FindEntityByName("AccidentJeep");
29 if (!vehicle)
30 return;
31
33 if (!compartmentAccess)
34 return;
35
36 //Lock jeep to prevent players from driving away with it.
37 SCR_BaseLockComponent spawnProtectionComponent = SCR_BaseLockComponent.Cast(vehicle.FindComponent(SCR_BaseLockComponent));
38 if (spawnProtectionComponent)
39 spawnProtectionComponent.SetLocked(true);
40
41 compartmentAccess.MoveInVehicle(vehicle, ECompartmentType.PILOT);
42 }
43
44 //------------------------------------------------------------------------------------------------
45 override void OnCourseEnd()
46 {
47 GetGame().GetCallqueue().Remove(RefreshVictimBloodLevel);
48 GetGame().GetCallqueue().Remove(RefreshVictimResilience);
49
50 SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
51 if (!tutorial)
52 return;
53
54 tutorial.InsertIntoGarbage("AccidentJeep");
55 tutorial.InsertIntoGarbage("Victim");
56 }
57
58 //------------------------------------------------------------------------------------------------
61 {
63 {
64 GetGame().GetCallqueue().Remove(RefreshVictimResilience);
65 return;
66 }
67
68 m_VictimDamageManager.GetResilienceHitZone().SetHealth(0);
69 }
70
71 //------------------------------------------------------------------------------------------------
74 {
76 {
77 GetGame().GetCallqueue().Remove(RefreshVictimResilience);
78 return;
79 }
80
81 m_VictimDamageManager.GetBloodHitZone().SetHealth(2000);
82 }
83}
ECompartmentType
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
proto external Managed FindComponent(typename typeName)
proto external BaseWorld GetWorld()
bool MoveInVehicle(IEntity vehicle, ECompartmentType compartmentType, bool performWhenPaused=false, BaseCompartmentSlot customSlot=null)
SCR_CharacterDamageManagerComponent m_VictimDamageManager