Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
handreplacingiteminhands.c
Go to the documentation of this file.
1
class
HandStartReplacingItemInHands
extends
HandStateBase
2
{
3
void
HandStartReplacingItemInHands
(Man player = NULL,
HandStateBase
parent = NULL)
4
{ }
5
6
override
void
OnEntry
(
HandEventBase
e)
7
{
8
super.OnEntry(e);
9
10
Man player = e.m_Player;
11
EntityAI
itemInHands = player.GetEntityInHands();
12
13
InventoryLocation
src =
new
InventoryLocation
;
14
if
(itemInHands.GetInventory().GetCurrentInventoryLocation(src))
15
{
16
HandEventDestroyAndReplaceWithNew
edr =
HandEventDestroyAndReplaceWithNew
.Cast(e);
17
if
(edr)
18
{
19
if
(
LogManager
.
IsInventoryHFSMLogEnable
())
hndDebugPrint
(
"[hndfsm] HandStartReplacingItemInHands about to execute lambda"
);
20
21
HumanInventoryWithFSM
inv =
HumanInventoryWithFSM
.Cast(player.GetInventory());
22
edr.m_Lambda.Execute(inv);
23
//player.GetItemAccessor().OnItemInHandsChanged();
24
return
;
25
}
26
else
27
Error
(
"[hndfsm] HandStartReplacingItemInHands - not a HandEventDestroyAndReplaceWithNew event"
);
28
}
29
else
30
Error
(
"[hndfsm] HandStartReplacingItemInHands - itemInHands has no InventoryLocation"
);
31
}
32
33
override
void
OnAbort
(
HandEventBase
e)
34
{
35
super.OnAbort(e);
36
}
37
38
override
void
OnExit
(
HandEventBase
e)
39
{
40
super.OnExit(e);
41
}
42
43
override
bool
IsWaitingForActionFinish
() {
return
true
; }
44
};
45
46
47
class
HandReplacingItemInHands
extends
HandStateBase
48
{
49
ref
HandStartReplacingItemInHands
m_Replacing
;
50
51
void
HandReplacingItemInHands
(Man player = NULL,
HandStateBase
parent = NULL)
52
{
53
// setup nested state machine
54
m_Replacing
=
new
HandStartReplacingItemInHands
(player,
this
);
55
56
// events:
57
HandEventBase
_fin_ =
new
HandEventHumanCommandActionFinished;
58
59
m_FSM
=
new
HandFSM
(
this
);
// @NOTE: set owner of the submachine fsm
60
61
m_FSM
.AddTransition(
new
HandTransition
(
m_Replacing
, _fin_, NULL ));
62
63
m_FSM
.SetInitialState(
m_Replacing
);
64
}
65
66
override
void
OnEntry
(
HandEventBase
e)
67
{
68
super.OnEntry(e);
69
}
70
71
override
void
OnAbort
(
HandEventBase
e)
72
{
73
super.OnAbort(e);
74
}
75
76
override
void
OnExit
(
HandEventBase
e)
77
{
78
super.OnExit(e);
79
}
80
};
81
82
EntityAI
Definition
inventoryitem.c:2
HandEventBase
Abstracted event, not to be used, only inherited.
Definition
hand_events.c:212
HandEventDestroyAndReplaceWithNew
Definition
hand_events.c:826
HandFSM
Hand finite state machine.
HandStateBase
represent hand state base
Definition
handanimatedforceswapping.c:4
HandStateBase::HandStartReplacingItemInHands
void HandStartReplacingItemInHands(Man player=NULL, HandStateBase parent=NULL)
Definition
handreplacingiteminhands.c:3
HandStateBase::OnAbort
override void OnAbort(HandEventBase e)
Definition
handreplacingiteminhands.c:33
HandStateBase::m_Replacing
ref HandStartReplacingItemElsewhereWithNewInHands m_Replacing
Definition
handreplacingitemelsewherewithnewinhands.c:40
HandStateBase::OnEntry
override void OnEntry(HandEventBase e)
Definition
handreplacingiteminhands.c:6
HandStateBase::HandReplacingItemInHands
void HandReplacingItemInHands(Man player=NULL, HandStateBase parent=NULL)
Definition
handreplacingiteminhands.c:51
HandStateBase::m_FSM
ref HandFSM m_FSM
hierarchical parent state of this state (or null)
Definition
handstatebase.c:10
HandStateBase::HandStateBase
void HandStateBase(Man player=NULL, HandStateBase parent=NULL)
nested state machine (or null)
Definition
handstatebase.c:11
HandStateBase::OnExit
override void OnExit(HandEventBase e)
Definition
handreplacingiteminhands.c:38
HandStateBase::IsWaitingForActionFinish
override bool IsWaitingForActionFinish()
Definition
handreplacingiteminhands.c:43
HumanInventoryWithFSM
HumanInventory... with FSM (synchronous, no anims).
Definition
humaninventorywithfsm.c:6
InventoryLocation
InventoryLocation.
Definition
inventorylocation.c:30
LogManager
Definition
debug.c:692
LogManager::IsInventoryHFSMLogEnable
static bool IsInventoryHFSMLogEnable()
Definition
debug.c:766
Error
void Error(string err)
Messagebox with error message.
Definition
endebug.c:90
hndDebugPrint
void hndDebugPrint(string s)
Definition
handfsm.c:1
HandTransition
FSMTransition< HandStateBase, HandEventBase, HandActionBase, HandGuardBase > HandTransition
Definition
handfsm.c:28
Games
Dayz
scripts
3_game
systems
inventory
handreplacingiteminhands.c
Generated by
1.17.0