2class BotEventEntityInHands : BotEventBase { };
4class BotSpawnEntityInHands
extends BotStateBase
8 void BotSpawnEntityInHands (Bot bot = NULL, BotStateBase parent = NULL,
string new_type =
"")
10 if (new_type ==
string.
Empty)
16 override void OnEntry (BotEventBase e)
26 override void OnExit (BotEventBase e) { super.
OnExit(e); }
35 botDebugPrint(
"[bot] + " +
m_Owner +
" hand item=" + inHands +
" bot=" +
m_Owner);
36 m_Bot.ProcessEvent(
new BotEventEntityInHands(
m_Owner, inHands));
41class BotEventEntityInHandsOpened : BotEventBase { };
43class BotOpenEntityInHands
extends BotStateBase
47 override void OnEntry (BotEventBase e)
53 BotEventEntityInHands ev_ih = BotEventEntityInHands.Cast(e);
60 botDebugPrint(
"[bot] + " +
m_Owner +
" will open edible item=" + b +
" bot=" +
m_Owner);
67 override void OnAbort (BotEventBase e) { super.OnAbort(e); }
69 override void OnExit (BotEventBase e)
79 botDebugSpam(
"[bot] + " +
m_Owner +
" wait for opened item inHands=" + inHands +
" bot=" +
m_Owner);
82 string t_str = inHands.GetType();
84 if (t_str.
IndexOf(
"_Opened") != -1)
86 botDebugPrint(
"[bot] + " +
m_Owner +
" opened item=" + inHands +
" bot=" +
m_Owner);
87 m_Bot.ProcessEvent(
new BotEventEntityInHandsOpened(
m_Owner, inHands));
94class Bot_TestSpawnOpen
extends BotStateBase
97 ref BotSpawnEntityInHands m_Spawning;
98 ref BotOpenEntityInHands m_Opening;
100 void Bot_TestSpawnOpen (Bot bot = NULL, BotStateBase parent = NULL,
string new_type =
"")
105 m_FSM =
new BotFSM(
this);
107 m_Spawning =
new BotSpawnEntityInHands(m_Bot,
this);
108 m_Opening =
new BotOpenEntityInHands(m_Bot,
this);
111 BotEventBase __EntInH__ =
new BotEventEntityInHands;
114 m_FSM.AddTransition(
new BotTransition( m_Spawning, __EntInH__, m_Opening));
118 m_FSM.SetInitialState(m_Spawning);
122 override void OnExit (BotEventBase e) { super.
OnExit(e); }
123 override void OnUpdate (
float dt) { super.OnUpdate(dt); }
127class BotEventHandsEmpty : BotEventBase { };
129class BotWaitForEmptyHands
extends BotStateBase
132 override void OnAbort (BotEventBase e) { super.OnAbort(e); }
133 override void OnExit (BotEventBase e) { super.
OnExit(e); }
140 botDebugSpam(
"[bot] + " +
m_Owner +
" waiting for empty hands, inHands=" + inHands +
" bot=" +
m_Owner);
143 botDebugPrint(
"[bot] + " +
m_Owner +
" hand slot empty. bot=" +
m_Owner);
144 m_Bot.ProcessEvent(
new BotEventHandsEmpty(
m_Owner, inHands));
149class BotWaitForChangeInHands
extends BotStateBase
159class BotDropEntityInHands
extends BotWaitForChangeInHands
163 override void OnEntry (BotEventBase e)
171 botDebugPrint(
"[bot] + " +
m_Owner +
" dropping item=" + inHands +
" bot=" +
m_Owner);
173 m_Owner.PredictiveDropEntity(inHands);
178 override void OnAbort (BotEventBase e) { super.OnAbort(e); }
179 override void OnExit (BotEventBase e) { super.
OnExit(e); }
180 override void OnUpdate (
float dt) { super.OnUpdate(dt); }
183class BotEatEntityInHands
extends BotWaitForChangeInHands
187 override void OnEntry (BotEventBase e)
194 botDebugPrint(
"[bot] + " +
m_Owner +
" eating item=" + inHands +
" bot=" +
m_Owner);
199 ActionManagerClient cli_mgr = ActionManagerClient.Cast(mgr);
203 target =
new ActionTarget(inHands, null, -1, vector.Zero, -1);
204 cli_mgr.PerformAction(AT_EAT, target, inHands);
211 override void OnAbort (BotEventBase e) { super.OnAbort(e); }
212 override void OnExit (BotEventBase e) { super.
OnExit(e); }
213 override void OnUpdate (
float dt) { super.OnUpdate(dt); }
218class BotDestroyEntityInHands
extends BotWaitForChangeInHands
222 override void OnEntry (BotEventBase e)
229 botDebugPrint(
"[bot] + " +
m_Owner +
" deleting item=" + inHands +
" bot=" +
m_Owner);
235 override void OnAbort (BotEventBase e) { super.OnAbort(e); }
236 override void OnExit (BotEventBase e) { super.
OnExit(e); }
237 override void OnUpdate (
float dt) { super.OnUpdate(dt); }
241class Bot_TestSpawnOpenDrop
extends Bot_TestSpawnOpen
243 ref BotDropEntityInHands m_Dropping;
245 void Bot_TestSpawnOpenDrop (Bot bot = NULL, BotStateBase parent = NULL,
string new_type =
"")
247 m_Dropping =
new BotDropEntityInHands(m_Bot,
this);
250 BotEventBase __EntOpn__ =
new BotEventEntityInHandsOpened;
251 BotEventBase __HndChg__ =
new BotEventOnItemInHandsChanged;
254 m_FSM.AddTransition(
new BotTransition( m_Opening, __EntOpn__, m_Dropping));
255 m_FSM.AddTransition(
new BotTransition( m_Dropping, __HndChg__, NULL));
259 override void OnExit (BotEventBase e) { super.
OnExit(e); }
260 override void OnUpdate (
float dt) { super.OnUpdate(dt); }
263class Bot_TestSpawnOpenDestroy
extends Bot_TestSpawnOpen
265 ref BotDestroyEntityInHands m_Destroying;
267 void Bot_TestSpawnOpenDestroy (Bot bot = NULL, BotStateBase parent = NULL,
string new_type =
"")
269 m_Destroying =
new BotDestroyEntityInHands(m_Bot,
this);
272 BotEventBase __EntOpn__ =
new BotEventEntityInHandsOpened;
273 BotEventBase __HndChg__ =
new BotEventOnItemInHandsChanged;
276 m_FSM.AddTransition(
new BotTransition( m_Opening, __EntOpn__, m_Destroying));
277 m_FSM.AddTransition(
new BotTransition( m_Destroying, __HndChg__, NULL));
281 override void OnExit (BotEventBase e) { super.
OnExit(e); }
282 override void OnUpdate (
float dt) { super.OnUpdate(dt); }
285class Bot_TestSpawnOpenEat
extends Bot_TestSpawnOpen
287 ref BotEatEntityInHands m_Eating;
289 void Bot_TestSpawnOpenEat (Bot bot = NULL, BotStateBase parent = NULL,
string new_type =
"")
291 m_Eating =
new BotEatEntityInHands(m_Bot,
this);
294 BotEventBase __EntOpn__ =
new BotEventEntityInHandsOpened;
295 BotEventBase __HndChg__ =
new BotEventOnItemInHandsChanged;
298 m_FSM.AddTransition(
new BotTransition( m_Opening, __EntOpn__, m_Eating));
299 m_FSM.AddTransition(
new BotTransition( m_Eating, __HndChg__, NULL));
302 override void OnEntry (BotEventBase e)
307 override void OnExit (BotEventBase e)
eBleedingSourceType m_Type
void ActionManagerBase(PlayerBase player)
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
HandStateEquipped OnEntry
enum ProcessDirectDamageFlags m_Owner
class WeaponChambering_Chamber_OnEntry extends WeaponChambering_Base OnExit
proto native EntityAI GetEntityInHands()
Returns the current entity in hands.
override void OnEntry(HandEventBase e)
override void OnExit(WeaponEventBase e)
DayZPlayerInstanceType
defined in C++
proto native int IndexOf(string sample)
Finds 'sample' in 'str'. Returns -1 when not found.