Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIInfoReaction.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
2// INFO REACTION BASE
3//------------------------------------------------------------------------------------------------
4
7{
8 // Don't use, it's here for backwards compatibility, not guaranteed to work in all classes
9 [Attribute(defvalue: "", uiwidget: UIWidgets.EditBox, desc: "Don't use, it's here for backwards compatibility, not guaranteed to work in all classes", params: "bt")]
10 string m_OverrideBehaviorTree;
11
12 [Attribute("0", UIWidgets.ComboBox, "Type of event activating the reaction", "", ParamEnumArray.FromEnum(EMessageType_Info) )]
13 EMessageType_Info m_eType;
14
15 void PerformReaction(notnull SCR_AIUtilityComponent utility, SCR_AIMessageBase message) {}
16 void PerformReaction(notnull SCR_AIGroupUtilityComponent utility, SCR_AIMessageBase message) {}
17};
18
19
20//------------------------------------------------------------------------------------------------
21// INFO REACTIONS - Reactions on different info inputs from children (groups or agents)
22//------------------------------------------------------------------------------------------------
23
24
25// Scheduled for deletion
28{
29 override void PerformReaction(notnull SCR_AIGroupUtilityComponent utility, SCR_AIMessageBase message)
30 {
31 auto msg = SCR_AIMessage_NoAmmo.Cast(message);
32 if(!msg)
33 return;
34
35 auto activity = new SCR_AIResupplyActivity(utility, null, msg.m_entityToSupply, msg.m_MagazineWell, priorityLevel: utility.GetCurrentAction().EvaluatePriorityLevel());
36 utility.AddAction(activity);
37 }
38};
39
42{
43 // TODO: retreat to last safe position
44};
45
48{
49 override void PerformReaction(notnull SCR_AIGroupUtilityComponent utility, SCR_AIMessageBase message)
50 {
51 auto msg = SCR_AIMessage_Wounded.Cast(message);
52 if(!msg)
53 return;
54 AIAgent aiAgent = msg.GetSender();
55 AIGroup aiGroup = utility.m_Owner;
56 SCR_AIActionBase currentAction = SCR_AIActionBase.Cast(utility.GetCurrentAction());
57 if (!currentAction || !aiAgent)
58 return;
59
60 float priorityLevelClamped = currentAction.GetRestrictedPriorityLevel();
61
62 IEntity woundedEntity = msg.m_WoundedEntity;
63
64 // Ignore message if we already have an activity to heal this soldier
65 array<ref AIActionBase> actions = {};
66 utility.GetActions(actions);
67 foreach (AIActionBase action : actions)
68 {
69 SCR_AIHealActivity healActivity = SCR_AIHealActivity.Cast(action);
70
71 if (!healActivity)
72 continue;
73
74 // Return if we are already healing this soldier
75 if (healActivity.m_EntityToHeal.m_Value == woundedEntity)
76 {
77 healActivity.SetPriorityLevel(priorityLevelClamped);
78 return;
79 }
80 }
81
82 auto activity = new SCR_AIHealActivity(utility, null, woundedEntity, priorityLevel: priorityLevelClamped);
83 utility.AddAction(activity);
84 }
85};
86
89{
90 // TODO: planning move to corpse location?
91};
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
EMessageType_Info
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_FieldOfViewSettings Attribute