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_AIWaypointArtillerySupport.c
Go to the documentation of this file.
1
class
SCR_AIWaypointArtillerySupportClass
:
SCR_TimedWaypointClass
2
{
3
};
4
5
class
SCR_AIWaypointArtillerySupport
:
SCR_AIWaypoint
6
{
7
[
Attribute
(
"-1"
,
UIWidgets
.EditBox,
desc
:
"Total amount of shots which must be fired at the target. -1 means infinite firing."
)]
8
protected
int
m_iTargetShotCount
;
9
10
[
Attribute
(
typename
.EnumToString(
SCR_EAIArtilleryAmmoType
,
SCR_EAIArtilleryAmmoType
.HIGH_EXPLOSIVE),
UIWidgets
.ComboBox,
desc
:
"Ammo type"
, enumType:
SCR_EAIArtilleryAmmoType
)]
11
protected
SCR_EAIArtilleryAmmoType
m_eAmmoType
;
12
13
[
Attribute
(
"1"
,
UIWidgets
.CheckBox,
desc
:
"When true, the AI group will start firing at given position instantly when the waypoint is selected."
)];
14
protected
bool
m_bActive
;
15
16
//----------------------------------------------------------------------------------------
17
void
SetTargetShotCount
(
int
value,
bool
invokeEvent =
true
)
18
{
19
m_iTargetShotCount
= value;
20
21
if
(
m_OnWaypointPropertiesChanged
&& invokeEvent)
22
m_OnWaypointPropertiesChanged
.Invoke();
23
}
24
25
//----------------------------------------------------------------------------------------
26
void
SetActive
(
bool
value,
bool
invokeEvent =
true
)
27
{
28
m_bActive
= value;
29
30
if
(
m_OnWaypointPropertiesChanged
&& invokeEvent)
31
m_OnWaypointPropertiesChanged
.Invoke();
32
}
33
34
//----------------------------------------------------------------------------------------
35
void
SetAmmoType
(
SCR_EAIArtilleryAmmoType
value,
bool
invokeEvent =
true
)
36
{
37
m_eAmmoType
= value;
38
39
if
(
m_OnWaypointPropertiesChanged
&& invokeEvent)
40
m_OnWaypointPropertiesChanged
.Invoke();
41
}
42
43
//----------------------------------------------------------------------------------------
44
int
GetTargetShotCount
()
45
{
46
return
m_iTargetShotCount
;
47
}
48
49
//----------------------------------------------------------------------------------------
50
bool
IsActive
()
51
{
52
return
m_bActive
;
53
}
54
55
//----------------------------------------------------------------------------------------
56
SCR_EAIArtilleryAmmoType
GetAmmoType
()
57
{
58
return
m_eAmmoType
;
59
}
60
61
//----------------------------------------------------------------------------------------
62
override
SCR_AIWaypointState
CreateWaypointState
(
SCR_AIGroupUtilityComponent
groupUtilityComp)
63
{
64
SCR_AIWaypointArtillerySupportState
wpState =
new
SCR_AIWaypointArtillerySupportState
(groupUtilityComp,
this
);
65
return
wpState;
66
}
67
68
};
69
70
class
SCR_AIWaypointArtillerySupportState
:
SCR_AIWaypointState
71
{
72
protected
SCR_AIStaticArtilleryActivity
m_ArtilleryActivity
;
73
protected
SCR_AIWaypointArtillerySupport
m_ArtilleryWaypoint
;
74
75
//--------------------------------
76
void
SCR_AIWaypointArtillerySupportState
(notnull
SCR_AIGroupUtilityComponent
utility,
SCR_AIWaypoint
waypoint)
77
{
78
m_ArtilleryWaypoint
=
SCR_AIWaypointArtillerySupport
.Cast(waypoint);
79
}
80
81
//--------------------------------
82
override
void
OnSelected
()
83
{
84
super.OnSelected();
85
86
if
(
m_ArtilleryWaypoint
.IsActive())
87
AddArtilleryActivity
();
88
89
m_ArtilleryWaypoint
.GetOnWaypointPropertiesChanged().Insert(
OnWaypointPropertiesChange
);
90
}
91
92
//--------------------------------
93
override
void
OnDeselected
()
94
{
95
super.OnDeselected();
96
97
if
(
m_ArtilleryActivity
)
98
m_ArtilleryActivity
.Complete();
99
}
100
101
//--------------------------------
102
void
OnWaypointPropertiesChange
()
103
{
104
// Cancel previous activity, create a new one
105
106
if
(
m_ArtilleryActivity
)
107
m_ArtilleryActivity
.Complete();
// Complete instead of failing. Because activity fail results in waypoint deselection.
108
109
if
(
m_ArtilleryWaypoint
.IsActive())
110
AddArtilleryActivity
();
111
}
112
113
//--------------------------------
114
protected
void
AddArtilleryActivity
()
115
{
116
int
targetShotCount =
m_ArtilleryWaypoint
.GetTargetShotCount();
117
SCR_EAIArtilleryAmmoType
ammoType =
m_ArtilleryWaypoint
.GetAmmoType();
118
SCR_AIStaticArtilleryActivity
activity =
new
SCR_AIStaticArtilleryActivity
(
m_Utility
,
m_Waypoint
,
m_Waypoint
.GetOrigin(), ammoType, targetShotCount, priorityLevel:
m_ArtilleryWaypoint
.GetPriorityLevel());
119
m_Utility
.AddAction(activity);
120
m_ArtilleryActivity
= activity;
121
}
122
}
SCR_EAIArtilleryAmmoType
SCR_EAIArtilleryAmmoType
Definition
SCR_AIStaticArtilleryVehicleUsageComponent.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
SCR_AIGroupUtilityComponent
Definition
SCR_AIGroupUtilityComponent.c:18
SCR_AIStaticArtilleryActivity
Definition
SCR_AIStaticArtilleryActivity.c:2
SCR_AIWaypointArtillerySupportClass
Definition
SCR_AIWaypointArtillerySupport.c:2
SCR_AIWaypointArtillerySupport
Definition
SCR_AIWaypointArtillerySupport.c:6
SCR_AIWaypointArtillerySupport::SetTargetShotCount
void SetTargetShotCount(int value, bool invokeEvent=true)
Definition
SCR_AIWaypointArtillerySupport.c:17
SCR_AIWaypointArtillerySupport::m_iTargetShotCount
int m_iTargetShotCount
Definition
SCR_AIWaypointArtillerySupport.c:8
SCR_AIWaypointArtillerySupport::GetTargetShotCount
int GetTargetShotCount()
Definition
SCR_AIWaypointArtillerySupport.c:44
SCR_AIWaypointArtillerySupport::CreateWaypointState
override SCR_AIWaypointState CreateWaypointState(SCR_AIGroupUtilityComponent groupUtilityComp)
Definition
SCR_AIWaypointArtillerySupport.c:62
SCR_AIWaypointArtillerySupport::SetAmmoType
void SetAmmoType(SCR_EAIArtilleryAmmoType value, bool invokeEvent=true)
Definition
SCR_AIWaypointArtillerySupport.c:35
SCR_AIWaypointArtillerySupport::m_bActive
bool m_bActive
Definition
SCR_AIWaypointArtillerySupport.c:14
SCR_AIWaypointArtillerySupport::GetAmmoType
SCR_EAIArtilleryAmmoType GetAmmoType()
Definition
SCR_AIWaypointArtillerySupport.c:56
SCR_AIWaypointArtillerySupport::SetActive
void SetActive(bool value, bool invokeEvent=true)
Definition
SCR_AIWaypointArtillerySupport.c:26
SCR_AIWaypointArtillerySupport::m_eAmmoType
SCR_EAIArtilleryAmmoType m_eAmmoType
Definition
SCR_AIWaypointArtillerySupport.c:11
SCR_AIWaypointArtillerySupport::IsActive
bool IsActive()
Definition
SCR_AIWaypointArtillerySupport.c:50
SCR_AIWaypointArtillerySupportState
Definition
SCR_AIWaypointArtillerySupport.c:71
SCR_AIWaypointArtillerySupportState::m_ArtilleryActivity
SCR_AIStaticArtilleryActivity m_ArtilleryActivity
Definition
SCR_AIWaypointArtillerySupport.c:72
SCR_AIWaypointArtillerySupportState::m_ArtilleryWaypoint
SCR_AIWaypointArtillerySupport m_ArtilleryWaypoint
Definition
SCR_AIWaypointArtillerySupport.c:73
SCR_AIWaypointArtillerySupportState::OnSelected
override void OnSelected()
Definition
SCR_AIWaypointArtillerySupport.c:82
SCR_AIWaypointArtillerySupportState::OnWaypointPropertiesChange
void OnWaypointPropertiesChange()
Definition
SCR_AIWaypointArtillerySupport.c:102
SCR_AIWaypointArtillerySupportState::OnDeselected
override void OnDeselected()
Definition
SCR_AIWaypointArtillerySupport.c:93
SCR_AIWaypointArtillerySupportState::SCR_AIWaypointArtillerySupportState
void SCR_AIWaypointArtillerySupportState(notnull SCR_AIGroupUtilityComponent utility, SCR_AIWaypoint waypoint)
Definition
SCR_AIWaypointArtillerySupport.c:76
SCR_AIWaypointArtillerySupportState::AddArtilleryActivity
void AddArtilleryActivity()
Definition
SCR_AIWaypointArtillerySupport.c:114
SCR_AIWaypoint
Definition
SCR_AIWaypoint.c:6
SCR_AIWaypoint::m_OnWaypointPropertiesChanged
ref ScriptInvoker m_OnWaypointPropertiesChanged
Definition
SCR_AIWaypoint.c:13
SCR_AIWaypoint::SCR_AIWaypoint
void SCR_AIWaypoint(IEntitySource src, IEntity parent)
Definition
SCR_AIWaypoint.c:16
SCR_AIWaypointState
Definition
SCR_AIWaypointState.c:7
SCR_AIWaypointState::m_Utility
SCR_AIGroupUtilityComponent m_Utility
Definition
SCR_AIWaypointState.c:8
SCR_AIWaypointState::SCR_AIWaypointState
void SCR_AIWaypointState(notnull SCR_AIGroupUtilityComponent utility, SCR_AIWaypoint waypoint)
Definition
SCR_AIWaypointState.c:11
SCR_AIWaypointState::m_Waypoint
AIWaypoint m_Waypoint
Definition
SCR_AIWaypointState.c:9
SCR_TimedWaypointClass
Definition
SCR_TimedWaypoint.c:2
UIWidgets
Definition
attributes.c:40
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
AI
Group
SCR_AIWaypointArtillerySupport.c
Generated by
1.17.0