Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
bot_tests.c
Go to the documentation of this file.
2 {
3 };
4 
6 {
7  EntityAI m_Entity1;
8  EntityAI m_Entity2;
9 
10  void BotTestSwapInternal (Bot bot = NULL, BotStateBase parent = NULL)
11  { }
12 
13  override void OnEntry (BotEventBase e)
14  {
15  super.OnEntry(e);
16  EntityAI j = m_Owner.GetInventory().CreateAttachment("Jeans_Blue");
17  m_Entity1 = j.GetInventory().CreateEntityInCargo("Rag");
18  EntityAI s = m_Owner.GetInventory().CreateInInventory("TacticalShirt_Grey");
19  m_Entity2 = s.GetInventory().CreateEntityInCargo("Roadflare");
20  }
21 
22  override void OnUpdate (float dt)
23  {
24  super.OnUpdate(dt);
25 
26  if (m_Entity1 && m_Entity2)
27  {
28  if (m_Owner.GetInventory().CanSwapEntitiesEx(m_Entity1, m_Entity2))
29  {
30  botDebugPrint("[bot] + " + m_Owner + " -> swap item=" + m_Entity1 + " bot=" + m_Owner);
31  m_Owner.PredictiveSwapEntities(m_Entity1, m_Entity2);
32  }
33  else if (m_Owner.GetInventory().CanSwapEntitiesEx(m_Entity2, m_Entity1))
34  {
35  botDebugPrint("[bot] + " + m_Owner + " <- swap item=" + m_Entity2 + " bot=" + m_Owner);
36  m_Owner.PredictiveSwapEntities(m_Entity2, m_Entity1);
37  }
38  }
39  }
40 };
41 
42 
44 {
45  EntityAI m_Entity1;
46  EntityAI m_Entity2;
47 
48  void BotTestSwapInternalC2H (Bot bot = NULL, BotStateBase parent = NULL)
49  { }
50 
51  override void OnEntry (BotEventBase e)
52  {
53  super.OnEntry(e);
54  EntityAI j = m_Owner.GetInventory().CreateAttachment("Jeans_Blue");
55  m_Entity1 = j.GetInventory().CreateEntityInCargo("Rag");
56  EntityAI s = m_Owner.GetInventory().CreateInInventory("TacticalShirt_Grey");
57  m_Entity2 = s.GetInventory().CreateEntityInCargo("Roadflare");
58  m_Owner.PredictiveTakeEntityToHands(m_Entity2);
59  }
60 
61  override void OnUpdate (float dt)
62  {
63  super.OnUpdate(dt);
64 
65  if (m_Entity1 && m_Entity2)
66  {
67  if (m_Owner.GetInventory().CanSwapEntitiesEx(m_Entity1, m_Entity2))
68  {
69  botDebugPrint("[bot] + " + m_Owner + " -> swap item=" + m_Entity1 + " bot=" + m_Owner);
70  m_Owner.PredictiveSwapEntities(m_Entity1, m_Entity2);
71  }
72  else if (m_Owner.GetInventory().CanSwapEntitiesEx(m_Entity2, m_Entity1))
73  {
74  botDebugPrint("[bot] + " + m_Owner + " <- swap item=" + m_Entity2 + " bot=" + m_Owner);
75  m_Owner.PredictiveSwapEntities(m_Entity2, m_Entity1);
76  }
77  }
78  }
79 };
80 
81 
83 {
84  EntityAI m_Entity1;
85  EntityAI m_Entity2;
86 
87  void BotTestSwapG2H (Bot bot = NULL, BotStateBase parent = NULL)
88  { }
89 
90  override void OnEntry (BotEventBase e)
91  {
92  super.OnEntry(e);
93  EntityAI j = m_Owner.GetInventory().CreateAttachment("Jeans_Blue");
94  m_Entity1 = j.GetInventory().CreateEntityInCargo("Rag");
95  EntityAI s = m_Owner.GetInventory().CreateInInventory("TacticalShirt_Grey");
96  m_Entity2 = s.GetInventory().CreateEntityInCargo("Roadflare");
97  m_Owner.PredictiveDropEntity(m_Entity2);
98  }
99 
100  override void OnUpdate (float dt)
101  {
102  super.OnUpdate(dt);
103 
104  /*if (m_Entity1 && m_Entity2)
105  {
106  if (m_Owner.GetInventory().CanSwapEntities(m_Entity1, m_Entity2))
107  {
108  botDebugPrint("[bot] + " + m_Owner + " -> swap item=" + m_Entity1 + " bot=" + m_Owner);
109  m_Owner.PredictiveSwapEntities(m_Entity1, m_Entity2);
110  }
111  else if (m_Owner.GetInventory().CanSwapEntities(m_Entity2, m_Entity1))
112  {
113  botDebugPrint("[bot] + " + m_Owner + " <- swap item=" + m_Entity2 + " bot=" + m_Owner);
114  m_Owner.PredictiveSwapEntities(m_Entity2, m_Entity1);
115  }
116  }*/
117  }
118 };
119 
BotTestSwapInternal
Definition: bot_tests.c:5
Bot
Definition: bot.c:18
BotStateBase
represent weapon state base
Definition: bot_hunt.c:15
BotTestSwapWithCorpse
Definition: bot_tests.c:1
botDebugPrint
void botDebugPrint(string s)
Definition: bot.c:182
BotEventBase
represents event that triggers transition from state to state
Definition: botevents.c:4
m_Owner
enum ProcessDirectDamageFlags m_Owner
BotTestSwapG2H
Definition: bot_tests.c:82
BotTestSwapInternalC2H
Definition: bot_tests.c:43
EntityAI
Definition: building.c:5