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_TutorialLogic_ShootingRange.c
Go to the documentation of this file.
1
[
BaseContainerProps
()]
2
class
SCR_TutorialLogic_ShootingRange
:
SCR_BaseTutorialCourseLogic
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
44
RestockAmmoBox
();
45
GetGame
().GetCallqueue().CallLater(
RestockAmmoBox
, 10000,
true
);
46
}
47
48
//------------------------------------------------------------------------------------------------
49
void
RestockAmmoBox
()
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
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
ETargetState
ETargetState
Definition
SCR_FiringRangeTarget.c:8
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetWorld
proto external BaseWorld GetWorld()
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_BaseTutorialCourseLogic
Definition
SCR_BaseTutorialCourseLogic.c:3
SCR_TutorialLogic_ShootingRange
Definition
SCR_TutorialLogic_ShootingRange.c:3
SCR_TutorialLogic_ShootingRange::OnCourseEnd
override void OnCourseEnd()
Definition
SCR_TutorialLogic_ShootingRange.c:70
SCR_TutorialLogic_ShootingRange::RestockAmmoBox
void RestockAmmoBox()
Definition
SCR_TutorialLogic_ShootingRange.c:49
SCR_TutorialLogic_ShootingRange::m_sM249MagResource
ResourceName m_sM249MagResource
Definition
SCR_TutorialLogic_ShootingRange.c:5
SCR_TutorialLogic_ShootingRange::m_sM16MagResource
ResourceName m_sM16MagResource
Definition
SCR_TutorialLogic_ShootingRange.c:4
SCR_TutorialLogic_ShootingRange::OnInputChanged
void OnInputChanged(bool gamepad)
Definition
SCR_TutorialLogic_ShootingRange.c:8
SCR_TutorialLogic_ShootingRange::OnCourseStart
override void OnCourseStart()
Definition
SCR_TutorialLogic_ShootingRange.c:30
EStoragePurpose
EStoragePurpose
Definition
EStoragePurpose.c:13
scripts
Game
GameMode
Tutorial
Stages
ShootingRange
SCR_TutorialLogic_ShootingRange.c
Generated by
1.17.0