DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionRemovePlant.c
См. документацию.
2{
4
6 {
7 m_Text = "#remove_plant";
8 }
9
10 override typename GetInputType()
11 {
13 }
14
20
21 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
22 {
23 GardenBase garden_base;
24 if ( Class.CastTo(garden_base, target.GetObject()))
25 {
26 Slot slot;
27
28 array<string> selections = new array<string>;
29 garden_base.GetActionComponentNameList(target.GetComponentIndex(), selections);
30 string selection;
31
32 for (int s = 0; s < selections.Count(); s++)
33 {
34 selection = selections[s];
35 slot = garden_base.GetSlotBySelection( selection );
36 if (slot)
37 break;
38 }
39
40 if ( slot && slot.GetPlant() )
41 {
42 m_Plant = PlantBase.Cast(slot.GetPlant());
43 if (!m_Plant.IsHarvestable())
44 return true;
45 }
46 }
47 return false;
48 }
49
50 override void OnExecuteServer( ActionData action_data )
51 {
52 if ( m_Plant )
53 m_Plant.RemovePlantEx( action_data.m_Player.GetPosition() );
54 }
55};
ActionBase ActionData
Определения ActionBase.c:30
class ActionTargets ActionTarget
void PlantBase()
Определения PlantBase.c:54
string m_Text
Определения ActionBase.c:58
ref CCIBase m_ConditionItem
Определения ActionBase.c:64
ref CCTBase m_ConditionTarget
Определения ActionBase.c:65
void ActionInteractBase()
Определения ActionInteractBase.c:43
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionRemovePlant.c:21
override GetInputType()
Определения ActionRemovePlant.c:10
void ActionRemovePlant()
Определения ActionRemovePlant.c:5
override void OnExecuteServer(ActionData action_data)
Определения ActionRemovePlant.c:50
override void CreateConditionComponents()
Определения ActionRemovePlant.c:15
PlantBase m_Plant
Определения ActionRemovePlant.c:3
Определения CCINone.c:2
Определения CCTCursor.c:2
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения GardenPlot.c:2
Определения InventoryItem.c:731
Определения PlayerBaseClient.c:2
const float SMALL
Определения ActionConstants.c:111
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.