DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionPickUpMotorBike.c
См. документацию.
2{
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
6 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
7 m_Text = "#STR_PickUpBike";
8 }
9
11 {
14 }
15
16 override bool HasProgress()
17 {
18 return false;
19 }
20
21 override bool IsLockTargetOnUse()
22 {
23 return false;
24 }
25
26 override bool IsInstant()
27 {
28 return true;
29 }
30
31 override bool CanBeUsedInVehicle()
32 {
33 return false;
34 }
35
36 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
37 {
38 Motorbike trans = null;
39
40 if (!target)
41 {
42 return false;
43 }
44
45 if (!Class.CastTo(trans, target.GetObject()))
46 {
47 return false;
48 }
49
50 if (player.GetItemInHands() && player.GetItemInHands().IsHeavyBehaviour())
51 {
52 return false;
53 }
54
55 int componentIndex = target.GetComponentIndex();
56 int crew_index = trans.CrewPositionIndex(componentIndex);
57
58 // not targetting a seat
59 if (crew_index >= 0)
60 {
61 return false;
62 }
63
64 return trans.CanPickUp();
65 }
66
67 override void Start(ActionData action_data)
68 {
69 super.Start( action_data );
70
71 Motorbike trans = Motorbike.Cast(action_data.m_Target.GetObject());
72 if (trans)
73 {
74 trans.PickUp();
75 }
76 }
77
78 override int GetActionCategory()
79 {
80 return AC_INTERACT;
81 }
82
83 override bool AddActionJuncture(ActionData action_data)
84 {
85 Transport trans = Transport.Cast(action_data.m_Target.GetObject());
86 bool accepted = false;
87 int nextSeat = trans.CrewPositionIndex( action_data.m_Target.GetComponentIndex() );
88 Transport transport = Transport.Cast(action_data.m_Target.GetObject());
90 if (transport)
91 {
92 il.SetVehicle(transport, action_data.m_Player, nextSeat);
93
94 //Lock target
95 if (GetGame().AddInventoryJunctureEx(action_data.m_Player, action_data.m_Player, il, true, 10000))
96 {
97 accepted = true;
98 action_data.m_ReservedInventoryLocations.Insert(il);
99 }
100 }
101
102 return accepted;
103 }
104};
string m_Text
Определения ActionBase.c:57
ref CCIBase m_ConditionItem
Определения ActionBase.c:63
ref CCTBase m_ConditionTarget
Определения ActionBase.c:64
int m_StanceMask
Определения ActionBase.c:61
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:125
PlayerBase m_Player
Определения ActionBase.c:40
ref ActionTarget m_Target
Определения ActionBase.c:39
ref array< ref InventoryLocation > m_ReservedInventoryLocations
Определения ActionBase.c:42
Определения ActionBase.c:22
void ActionInteractBase()
Определения ActionInteractBase.c:43
override void CreateConditionComponents()
Определения ActionPickUpMotorBike.c:10
void ActionPickUpMotorbike()
Определения ActionPickUpMotorBike.c:3
override bool IsInstant()
Определения ActionPickUpMotorBike.c:26
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionPickUpMotorBike.c:36
override bool AddActionJuncture(ActionData action_data)
Определения ActionPickUpMotorBike.c:83
override bool HasProgress()
Определения ActionPickUpMotorBike.c:16
override bool IsLockTargetOnUse()
Определения ActionPickUpMotorBike.c:21
override bool CanBeUsedInVehicle()
Определения ActionPickUpMotorBike.c:31
override int GetActionCategory()
Определения ActionPickUpMotorBike.c:78
override void Start(ActionData action_data)
Определения ActionPickUpMotorBike.c:67
int m_CommandUID
Определения AnimatedActionBase.c:147
Определения CCINone.c:2
Определения CCTCursor.c:2
Super root of all classes in Enforce script.
Определения EnScript.c:11
proto native void SetVehicle(notnull EntityAI parent, EntityAI e, int idx)
InventoryLocation.
Определения InventoryLocation.c:30
Определения PlayerBaseClient.c:2
Native class for boats - handles physics simulation.
Определения Boat.c:29
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
DayZGame GetGame()
Определения gameplay.c:636
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.