DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionRemoveSeed
+ Граф наследования:ActionRemoveSeed:

Закрытые члены

void ActionRemoveSeed ()
 
override GetInputType ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool InventoryReservation (ActionData action_data)
 
override void OnExecuteClient (ActionData action_data)
 

Закрытые данные

SeedBase m_Seed
 

Подробное описание

Конструктор(ы)

◆ ActionRemoveSeed()

void ActionRemoveSeed ( )
inlineprivate
6 {
7 m_Text = "#take";
8 }
string m_Text
Definition ActionBase.c:58

Перекрестные ссылки ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
22 {
23 if ( player.GetCommand_Vehicle() )
24 return false;
25
27 if ( Class.CastTo( garden_base, target.GetObject() ) )
28 {
29 Slot slot;
30
32 garden_base.GetActionComponentNameList( target.GetComponentIndex(), selections );
33 string selection;
34
35 for (int s = 0; s < selections.Count(); s++)
36 {
37 selection = selections[s];
38 slot = garden_base.GetSlotBySelection( selection );
39 if ( slot )
40 break;
41 }
42
43 //Can only remove seed if slot is not watered to prevent VME
44 if ( slot && slot.GetSeed() )
45 {
46 if ( slot.GetWateredState() != 0 )
47 return false;
48
49 m_Seed = SeedBase.Cast( slot.GetSeed() );
50
51 if ( m_Seed )
52 {
53 if ( player.GetInventory().CanAddEntityIntoInventory( m_Seed ) && m_Seed.GetHierarchyRootPlayer() != player )
54 return true;
55 else
56 return player.GetInventory().CanAddEntityIntoHands( m_Seed );
57 }
58 }
59 }
60 return false;
61 }
SeedBase m_Seed
Definition ActionRemoveSeed.c:3
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition GardenPlot.c:2
Definition EntityAI.c:95
Definition cultivation.c:53
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo() и m_Seed.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
16 {
19 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINone.c:2
Definition CCTCursor.c:2
Definition ActionConstants.c:106
const float SMALL
Definition ActionConstants.c:107

Перекрестные ссылки ActionBase::m_ConditionItem, ActionBase::m_ConditionTarget и UAMaxDistances::SMALL.

◆ GetInputType()

override GetInputType ( )
inlineprivate
11 {
13 }
Definition ActionInput.c:522

◆ InventoryReservation()

override bool InventoryReservation ( ActionData action_data)
inlineprivate
64 {
65 bool success = true;
66
68
69 if ( m_Seed )
70 {
71 action_data.m_Player.GetInventory().FindFreeLocationFor( m_Seed , FindInventoryLocationType.ANY, il );
72 if ( action_data.m_Player.GetInventory().HasInventoryReservation( m_Seed, il ) )
73 {
74 success = false;
75 }
76 else
77 {
78 action_data.m_Player.GetInventory().AddInventoryReservationEx( m_Seed, il, GameInventory.c_InventoryReservationTimeoutMS );
79 }
80 }
81
82 if ( success )
83 {
84 if ( il )
85 action_data.m_ReservedInventoryLocations.Insert( il );
86 }
87
88 return success;
89 }
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:17
script counterpart to engine's class Inventory
Definition Inventory.c:79
const int c_InventoryReservationTimeoutMS
reservations
Definition Inventory.c:712
InventoryLocation.
Definition InventoryLocation.c:29

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutMS и m_Seed.

◆ OnExecuteClient()

override void OnExecuteClient ( ActionData action_data)
inlineprivate
92 {
93 super.OnExecuteClient(action_data);
94
95 PlayerBase player = action_data.m_Player;
96 float stackable;
98
99 //We place in inventory
100 if ( !player.GetInventory().CanAddEntityIntoHands( m_Seed ) )
101 {
102 il = action_data.m_ReservedInventoryLocations.Get( 0 );
104 m_Seed.GetInventory().GetCurrentInventoryLocation( targetInventoryLocation );
105
106 stackable = m_Seed.GetTargetQuantityMax( il.GetSlot() );
107
109 if ( stackable == 0 || stackable >= m_Seed.GetQuantity() )
110 {
111 player.PredictiveTakeToDst( targetInventoryLocation, il );
112 }
113 else
114 {
115 m_Seed.SplitIntoStackMaxToInventoryLocationClient( il );
116 }
117 }
118 else
119 {
120 //We place in hands
122 stackable = m_Seed.GetTargetQuantityMax( -1 );
123
124 if ( stackable == 0 || stackable >= m_Seed.GetQuantity() )
125 {
126 action_data.m_Player.PredictiveTakeEntityToHands( m_Seed );
127 }
128 else
129 {
130 il = new InventoryLocation;
131 il.SetHands( action_data.m_Player, m_Seed );
132 m_Seed.SplitIntoStackMaxToInventoryLocationClient( il );
133 }
134 }
135 }
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:921
Definition PlayerBaseClient.c:2

Перекрестные ссылки ActionBase::ClearInventoryReservationEx() и m_Seed.

Поля

◆ m_Seed

SeedBase m_Seed
private

Объявления и описания членов класса находятся в файле: