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_CombatEngineering.c
Go to the documentation of this file.
1
[
BaseContainerProps
()]
2
class
SCR_TutorialLogic_CombatEngineering
:
SCR_BaseTutorialCourseLogic
3
{
4
bool
m_bBuildingVoiceLinePlayed;
5
protected
const
ResourceName
CONSTRUCTION_TRUCK_PREFAB
=
"{F54F833E747C1B77}Prefabs/Vehicles/Wheeled/M923A1/Tutorial_Engineering_Truck.et"
;
6
protected
const
ResourceName
MACHINEGUN_NEST_PREFAB
=
"{6E9DCCF936BF17B9}PrefabsEditable/Auto/Compositions/Slotted/SlotFlatSmall/E_MachineGunNest_S_US_02.et"
;
7
8
//------------------------------------------------------------------------------------------------
9
void
HandleArlevilleSupplies
(
bool
refill)
10
{
11
IEntity
ent =
GetGame
().
GetWorld
().FindEntityByName(
"ARLEVILLE_SUPPLY_STORAGE"
);
12
if
(!ent)
13
return
;
14
15
SCR_ResourceComponent resComp = SCR_ResourceComponent.FindResourceComponent(ent);
16
if
(!resComp)
17
return
;
18
19
SCR_ResourceContainer
resourceContainer = resComp.GetContainer(
EResourceType
.SUPPLIES);
20
if
(!resourceContainer)
21
return
;
22
23
resourceContainer.
DepleteResourceValue
();
24
25
if
(refill)
26
resourceContainer.
IncreaseResourceValue
(810);
27
}
28
29
//------------------------------------------------------------------------------------------------
30
protected
void
OnEntitySpawned
(
IEntity
ent)
31
{
32
if
(!ent)
33
return
;
34
35
ResourceName
spawnedEntityResourceName = ent.
GetPrefabData
().GetPrefabName();
36
if
(spawnedEntityResourceName ==
MACHINEGUN_NEST_PREFAB
)
37
{
38
ent.
SetName
(
"BUILDING_GUNNEST"
);
39
return
;
40
}
41
42
if
(spawnedEntityResourceName !=
CONSTRUCTION_TRUCK_PREFAB
)
43
return
;
44
45
ent.
SetName
(
"BUILDING_VEHICLE"
);
46
SlotManagerComponent slotMan = SlotManagerComponent.Cast(ent.
FindComponent
(SlotManagerComponent));
47
if
(!slotMan)
48
return
;
49
50
EntitySlotInfo
slot = slotMan.GetSlotByName(
"EngineerBox"
);
51
if
(!slot)
52
return
;
53
54
IEntity
box = slot.GetAttachedEntity();
55
if
(!box)
56
return
;
57
58
SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
59
if
(tutorial)
60
tutorial.BlockBuildingModeAccess(box,
true
);
61
}
62
63
//------------------------------------------------------------------------------------------------
64
override
void
OnCourseStart
()
65
{
66
SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
67
if
(!tutorial)
68
return
;
69
70
IEntity
service =
GetGame
().
GetWorld
().FindEntityByName(
"VEHICLE_REQUESTING_BOARD"
);
71
if
(service)
72
{
73
SCR_CampaignBuildingProviderComponent buildingComponent = SCR_CampaignBuildingProviderComponent.Cast(service.
FindComponent
(SCR_CampaignBuildingProviderComponent));
74
if
(buildingComponent)
75
buildingComponent.RemovePlayerCooldowns(1);
76
}
77
78
SCR_EntityHelper
.DeleteEntityAndChildren(
GetGame
().GetWorld().FindEntityByName(
"BUILDING_VEHICLE"
));
79
SCR_EntityHelper
.DeleteEntityAndChildren(
GetGame
().GetWorld().FindEntityByName(
"BUILDING_GUNNEST"
));
80
81
tutorial.GetOnEntitySpawned().Insert(
OnEntitySpawned
);
82
}
83
84
//------------------------------------------------------------------------------------------------
85
override
void
OnCourseEnd
()
86
{
87
m_bBuildingVoiceLinePlayed =
false
;
88
HandleArlevilleSupplies
(
false
);
89
90
SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
91
if
(!tutorial)
92
return
;
93
94
tutorial.GetOnEntitySpawned().Remove(
OnEntitySpawned
);
95
96
IEntity
service =
GetGame
().
GetWorld
().FindEntityByName(
"VEHICLE_REQUESTING_BOARD"
);
97
if
(service)
98
tutorial.BlockBuildingModeAccess(service,
false
);
99
100
IEntity
vehicle =
GetGame
().
GetWorld
().FindEntityByName(
"BUILDING_VEHICLE"
);
101
if
(!vehicle)
102
return
;
103
104
tutorial.ChangeVehicleLockState(vehicle,
true
);
105
tutorial.InsertIntoGarbage(vehicle);
106
}
107
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
EResourceType
EResourceType
Definition
SCR_ResourceContainer.c:2
EntitySlotInfo
Adds ability to attach an object to a slot.
Definition
EntitySlotInfo.c:9
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetWorld
proto external BaseWorld GetWorld()
IEntity::SetName
proto external void SetName(string name)
IEntity::GetPrefabData
proto external EntityPrefabData GetPrefabData()
ResourceName
Definition
ResourceName.c:13
SCR_BaseTutorialCourseLogic
Definition
SCR_BaseTutorialCourseLogic.c:3
SCR_EntityHelper
Definition
SCR_EntityHelper.c:2
SCR_ResourceContainer
Definition
SCR_ResourceContainer.c:35
SCR_ResourceContainer::DepleteResourceValue
bool DepleteResourceValue(bool notifyChange=true)
Definition
SCR_ResourceContainer.c:547
SCR_ResourceContainer::IncreaseResourceValue
bool IncreaseResourceValue(float value, bool notifyChange=true)
Definition
SCR_ResourceContainer.c:529
SCR_TutorialLogic_CombatEngineering
Definition
SCR_TutorialLogic_CombatEngineering.c:3
SCR_TutorialLogic_CombatEngineering::OnCourseEnd
override void OnCourseEnd()
Definition
SCR_TutorialLogic_CombatEngineering.c:85
SCR_TutorialLogic_CombatEngineering::OnEntitySpawned
void OnEntitySpawned(IEntity ent)
Definition
SCR_TutorialLogic_CombatEngineering.c:30
SCR_TutorialLogic_CombatEngineering::OnCourseStart
override void OnCourseStart()
Definition
SCR_TutorialLogic_CombatEngineering.c:64
SCR_TutorialLogic_CombatEngineering::MACHINEGUN_NEST_PREFAB
const ResourceName MACHINEGUN_NEST_PREFAB
Definition
SCR_TutorialLogic_CombatEngineering.c:6
SCR_TutorialLogic_CombatEngineering::HandleArlevilleSupplies
void HandleArlevilleSupplies(bool refill)
Definition
SCR_TutorialLogic_CombatEngineering.c:9
SCR_TutorialLogic_CombatEngineering::CONSTRUCTION_TRUCK_PREFAB
const ResourceName CONSTRUCTION_TRUCK_PREFAB
Definition
SCR_TutorialLogic_CombatEngineering.c:5
scripts
Game
GameMode
Tutorial
Stages
CombatEngineeringCourse
SCR_TutorialLogic_CombatEngineering.c
Generated by
1.17.0