Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TutorialLogic_ShootingRange.c
Go to the documentation of this file.
3{
4 protected ResourceName m_sM16MagResource = "{D8F2CA92583B23D3}Prefabs/Weapons/Magazines/Magazine_556x45_STANAG_30rnd_M855_M856_Last_5Tracer.et";
5 protected ResourceName m_sM249MagResource = "{4FCBBDF274FD2157}Prefabs/Weapons/Magazines/Box_556x45_M249_200rnd_Ball.et";
6
7 //------------------------------------------------------------------------------------------------
8 void OnInputChanged(bool gamepad)
9 {
10 SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
11 if (!tutorial)
12 return;
13
14 if (gamepad)
15 {
16 if (tutorial.GetStageIndexByName("GAMEPAD") == -1)
17 tutorial.InsertStage("GAMEPAD", tutorial.GetActiveStageIndex());
18
19 tutorial.SetStage("GAMEPAD");
20 return;
21 }
22
23 if (tutorial.GetStageIndexByName("KMB") == -1)
24 tutorial.InsertStage("KMB", tutorial.GetActiveStageIndex());
25
26 tutorial.SetStage("KMB");
27 }
28
29 //------------------------------------------------------------------------------------------------
30 override void OnCourseStart()
31 {
32 SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
33 if (!tutorial)
34 return;
35
36 tutorial.SetupTargets("TARGETS_BACK", null, ETargetState.TARGET_DOWN, false);
37 tutorial.SetupTargets("TARGETS_ECHELON_LEFT", null, ETargetState.TARGET_DOWN, false);
38 tutorial.SetupTargets("TARGETS_ECHELON_RIGHT", null, ETargetState.TARGET_DOWN, false);
39 tutorial.SetupTargets("TARGETS_FRONT", null, ETargetState.TARGET_DOWN, false);
40 tutorial.SetupTargets("TARGETS_MIDDLE", null, ETargetState.TARGET_DOWN, false);
41 tutorial.SetupTargets("TARGETS_WRECK_CAR", null, ETargetState.TARGET_DOWN, false);
42 tutorial.SetupTargets("TARGETS_WRECK_TRUCK", null, ETargetState.TARGET_DOWN, false);
43
45 GetGame().GetCallqueue().CallLater(RestockAmmoBox, 10000, true);
46 }
47
48 //------------------------------------------------------------------------------------------------
50 {
51 IEntity ammobox = GetGame().GetWorld().FindEntityByName("Ammobox");
52 if (!ammobox)
53 return;
54
55 SCR_InventoryStorageManagerComponent storageManComp = SCR_InventoryStorageManagerComponent.Cast(ammobox.FindComponent(SCR_InventoryStorageManagerComponent));
56 if (!storageManComp)
57 return;
58
59 int countM16 = storageManComp.CountItem(SCR_ResourceNamePredicate(m_sM16MagResource), EStoragePurpose.PURPOSE_ANY);
60 int countM249 = storageManComp.CountItem(SCR_ResourceNamePredicate(m_sM249MagResource), EStoragePurpose.PURPOSE_ANY);
61
62 if (countM16 == 0)
63 storageManComp.InsertItem(GetGame().SpawnEntityPrefab(Resource.Load(m_sM16MagResource)));
64
65 if (countM249 == 0)
66 storageManComp.InsertItem(GetGame().SpawnEntityPrefab(Resource.Load(m_sM249MagResource)));
67 }
68
69 //------------------------------------------------------------------------------------------------
70 override void OnCourseEnd()
71 {
72 GetGame().OnInputDeviceIsGamepadInvoker().Remove(OnInputChanged);
73 GetGame().GetCallqueue().Remove(RestockAmmoBox);
74
75 SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
76 if (!tutorial)
77 return;
78
79 tutorial.EnableArsenal("Ammobox", false);
80 }
81}
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()
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
EStoragePurpose