Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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_AIInfoReaction_UnderFire
Definition: SCR_AIInfoReaction.c:41
SCR_AIActionBase
Definition: SCR_AIAction.c:1
EMessageType_Info
EMessageType_Info
Definition: SCR_AIMessage.c:1
SCR_AIHealActivity
Definition: SCR_AIHealActivity.c:1
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_AIInfoReaction_FoundCorpse
Definition: SCR_AIInfoReaction.c:88
AIActionBase
Definition: AIActionBase.c:12
SCR_AIResupplyActivity
Definition: SCR_AIResupplyActivity.c:1
SCR_AIMessage_Wounded
Definition: SCR_AIMessage.c:202
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_AIInfoReaction
Definition: SCR_AIInfoReaction.c:6
SCR_AIInfoReaction_Wounded
Definition: SCR_AIInfoReaction.c:47
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
BaseContainerProps
class SCR_AIInfoReaction BaseContainerProps
SCR_AIMessage_NoAmmo
Definition: SCR_AIMessage.c:131
SCR_AIInfoReaction_NoAmmo
Definition: SCR_AIInfoReaction.c:27
SCR_AIMessageBase
Definition: SCR_AIMessage.c:44