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

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

void ActionTurnOffWhileOnGround ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 

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

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

◆ ActionTurnOffWhileOnGround()

void ActionTurnOffWhileOnGround ( )
inlineprivate
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
6 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
7 m_Text = "#switch_off";
8 }
string m_Text
Definition ActionBase.c:58
int m_StanceMask
Definition ActionBase.c:62
int m_CommandUID
Definition AnimatedActionBase.c:143
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

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

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
11 {
12 EntityAI target_entity = EntityAI.Cast( target.GetObject() );
13
15 target_entity.GetInventory().GetCurrentInventoryLocation(loc);
16
17 return ( player.IsAlive() && target_entity.HasEnergyManager() && target_entity.GetCompEM().CanSwitchOff()) && loc.GetType() == InventoryLocationType.GROUND );
18 }
InventoryLocationType
types of Inventory Location
Definition InventoryLocation.c:4
Definition Building.c:6
InventoryLocation.
Definition InventoryLocation.c:29
Definition EntityAI.c:95

◆ OnExecuteServer()

override void OnExecuteServer ( ActionData action_data)
inlineprivate
21 {
22 EntityAI target_entity = EntityAI.Cast( action_data.m_Target.GetObject() );
23
24 if ( target_entity.GetCompEM().CanSwitchOff() )
25 {
26 target_entity.GetCompEM().SwitchOff();
27
28 InformPlayers( action_data.m_Player, action_data.m_Target, UA_FINISHED ); //Success
29 }
30 else
31 {
32 InformPlayers( action_data.m_Player, action_data.m_Target, UA_FAILED ); //Already turned off
33 }
34 }
void InformPlayers(PlayerBase player, ActionTarget target, int state)
DEPRECATED delivers message ids to clients based on given context.
const int UA_FINISHED
Definition constants.c:443
const int UA_FAILED
Definition constants.c:440

Перекрестные ссылки ActionBase::InformPlayers(), UA_FAILED и UA_FINISHED.


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