DayZ 1.28
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 if (!super.ActionCondition(player, target, item))
24 return false;
25
26 GardenBase garden_base;
27 if ( Class.CastTo(garden_base, target.GetObject()))
28 {
29 Slot slot;
30
31 array<string> selections = new array<string>;
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 if ( slot && slot.GetPlant() )
44 {
45 m_Plant = PlantBase.Cast(slot.GetPlant());
46 if (!m_Plant.IsHarvestable())
47 return true;
48 }
49 }
50 return false;
51 }
52
53 override void OnExecuteServer(ActionData action_data)
54 {
55 super.OnExecuteServer(action_data);
56
57 if (m_Plant)
58 m_Plant.RemovePlantEx(action_data.m_Player.GetPosition());
59 }
60};
ActionBase ActionData
Определения ActionBase.c:30
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:121
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:53
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
Определения 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.