Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIWaypointArtillerySupport.c
Go to the documentation of this file.
4
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)]
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)
23 }
24
25 //----------------------------------------------------------------------------------------
26 void SetActive(bool value, bool invokeEvent = true)
27 {
28 m_bActive = value;
29
30 if (m_OnWaypointPropertiesChanged && invokeEvent)
32 }
33
34 //----------------------------------------------------------------------------------------
35 void SetAmmoType(SCR_EAIArtilleryAmmoType value, bool invokeEvent = true)
36 {
37 m_eAmmoType = value;
38
39 if (m_OnWaypointPropertiesChanged && invokeEvent)
41 }
42
43 //----------------------------------------------------------------------------------------
45 {
46 return m_iTargetShotCount;
47 }
48
49 //----------------------------------------------------------------------------------------
50 bool IsActive()
51 {
52 return m_bActive;
53 }
54
55 //----------------------------------------------------------------------------------------
60
61 //----------------------------------------------------------------------------------------
63 {
65 return wpState;
66 }
67
68};
69
71{
74
75 //--------------------------------
80
81 //--------------------------------
82 override void OnSelected()
83 {
84 super.OnSelected();
85
86 if (m_ArtilleryWaypoint.IsActive())
88
89 m_ArtilleryWaypoint.GetOnWaypointPropertiesChanged().Insert(OnWaypointPropertiesChange);
90 }
91
92 //--------------------------------
93 override void OnDeselected()
94 {
95 super.OnDeselected();
96
98 m_ArtilleryActivity.Complete();
99 }
100
101 //--------------------------------
103 {
104 // Cancel previous activity, create a new one
105
107 m_ArtilleryActivity.Complete(); // Complete instead of failing. Because activity fail results in waypoint deselection.
108
109 if (m_ArtilleryWaypoint.IsActive())
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}
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void SetTargetShotCount(int value, bool invokeEvent=true)
override SCR_AIWaypointState CreateWaypointState(SCR_AIGroupUtilityComponent groupUtilityComp)
void SetAmmoType(SCR_EAIArtilleryAmmoType value, bool invokeEvent=true)
void SetActive(bool value, bool invokeEvent=true)
SCR_AIWaypointArtillerySupport m_ArtilleryWaypoint
void SCR_AIWaypointArtillerySupportState(notnull SCR_AIGroupUtilityComponent utility, SCR_AIWaypoint waypoint)
ref ScriptInvoker m_OnWaypointPropertiesChanged
void SCR_AIWaypoint(IEntitySource src, IEntity parent)
SCR_AIGroupUtilityComponent m_Utility
void SCR_AIWaypointState(notnull SCR_AIGroupUtilityComponent utility, SCR_AIWaypoint waypoint)
SCR_FieldOfViewSettings Attribute