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

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

void ActionPlugIn ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 
void Process (ActionData action_data)
 
override void OnExecuteClient (ActionData action_data)
 
ItemBase GetAttachedDevice (ItemBase parent)
 

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

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

◆ ActionPlugIn()

void ActionPlugIn ( )
inlineprivate
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
6 m_Text = "#plug_in";
7 }
string m_Text
Definition ActionBase.c:58
int m_CommandUID
Definition AnimatedActionBase.c:143
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

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

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
16 {
17 if (player.IsPlacingLocal())
18 return false;
19
20 ItemBase targetIB = ItemBase.Cast(target.GetObject());
21
22 //Prevent plugging to items in inventory
23 if (targetIB && targetIB.GetHierarchyRoot() == targetIB && item)
24 {
25 if (item.HasEnergyManager() && !item.GetCompEM().IsPlugged() && targetIB.HasEnergyManager() && targetIB.GetCompEM().CanReceivePlugFrom(item))
26 {
27 return true;
28 }
29
31 //Will only ever affect batteries
33 {
34 return attachedDevice.GetCompEM().HasFreeSocket();
35 }
36 }
37
38 return false;
39 }
ItemBase GetAttachedDevice(ItemBase parent)
Definition ActionPlugIn.c:87
Definition InventoryItem.c:731
Definition EntityAI.c:95

Перекрестные ссылки GetAttachedDevice().

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
10 {
13 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINonRuined.c:2
Definition CCTNonRuined.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108

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

◆ GetAttachedDevice()

ItemBase GetAttachedDevice ( ItemBase parent)
inlineprivate
88 {
89 if (parent.IsInherited(CarBattery) || parent.IsInherited(TruckBattery))
90 {
91 ItemBase parentAttachment = ItemBase.Cast(parent.GetAttachmentByType(MetalWire));
93 parentAttachment = ItemBase.Cast(parent.GetAttachmentByType(BarbedWire));
94
95 return parentAttachment;
96 }
97
98 return null;
99 }
Definition CarBattery.c:1
Definition TruckBattery.c:1

Используется в ActionCondition() и OnExecuteServer().

◆ OnExecuteClient()

override void OnExecuteClient ( ActionData action_data)
inlineprivate
80 {
81 if (!action_data.m_Player.IsPlacingLocal())
82 action_data.m_Player.PlacingStartLocal(action_data.m_MainItem);
83 else
85 }
void Process()
Definition EffectManager.c:743

Перекрестные ссылки Process().

◆ OnExecuteServer()

override void OnExecuteServer ( ActionData action_data)
inlineprivate
42 {
43 ItemBase targetIB = ItemBase.Cast(action_data.m_Target.GetObject());
44
45 if (targetIB.HasEnergyManager())
46 {
50
51 action_data.m_MainItem.GetCompEM().PlugThisInto(targetIB);
52
53 if (!g_Game.IsDedicatedServer())
54 {
55 if (!action_data.m_Player.IsPlacingLocal())
56 {
57 action_data.m_Player.PlacingStartLocal(action_data.m_MainItem);
59 }
60 }
61 else
62 {
63 if (!action_data.m_Player.IsPlacingServer())
64 {
65 action_data.m_Player.PlacingStartServer(action_data.m_MainItem);
67 }
68 }
69 }
70 }
DayZGame g_Game
Definition DayZGame.c:3815

Перекрестные ссылки g_Game, GetAttachedDevice() и Process().

◆ Process()

void Process ( ActionData action_data)
inlineprivate
73 {
74 ItemBase targetIB = ItemBase.Cast(action_data.m_Target.GetObject());
75
76 targetIB.GetInventory().TakeEntityAsAttachment(InventoryMode.LOCAL, action_data.m_MainItem);
77 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22

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