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

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

void ActionRestrainTarget ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override int GetStanceMask (PlayerBase player)
 
override bool ActionConditionContinue (ActionData action_data)
 
override void OnStartServer (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void OnFinishProgressClient (ActionData action_data)
 
- Закрытые члены унаследованные от ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

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

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

◆ ActionRestrainTarget()

void ActionRestrainTarget ( )
inlineprivate
26 {
28 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_RESTRAINTARGET;
29 m_FullBody = true;
30 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
32 m_Text = "#restrain";
33 }
bool m_FullBody
Definition ActionBase.c:61
string m_Text
Definition ActionBase.c:58
float m_SpecialtyWeight
Definition ActionBase.c:77
int m_StanceMask
Definition ActionBase.c:62
Definition ActionRestrainTarget.c:2
int m_CommandUID
Definition AnimatedActionBase.c:143
m_CallbackClass
Definition AnimatedActionBase.c:145
Definition EntityAI.c:95
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

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

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
42 {
43 PlayerBase other_player = PlayerBase.Cast(target.GetObject());
44 if (!other_player)
45 return false;
46 if ( player.GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_SERVER )
47 {
48 return other_player.CanBeRestrained();
49 }
50 else
51 {
52 return !other_player.IsRestrained();
53 }
54
55 }
Definition PlayerBaseClient.c:2
DayZPlayerInstanceType
defined in C++
Definition dayzplayer.c:1068

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)
inlineprivate
66 {
67 PlayerBase target_player = PlayerBase.Cast(action_data.m_Target.GetObject());
68
69 if ( GetGame().IsServer() && GetGame().IsMultiplayer() )
70 {
71 if ( target_player.IsSurrendered() || !target_player.CanBeRestrained() )
72 {
73 return false;
74 }
75 }
76 if ( GetGame().IsServer() )
77 {
79
80 if ( callback.GetActionComponentProgress() > 0.75 && !target_player.IsRestrainPrelocked() )
81 {
82 target_player.SetRestrainPrelocked(true);
83 }
84
85 return !GetGame().GetMission().IsPlayerDisconnecting(target_player);
86
87 }
88 return true;
89 }
proto native CGame GetGame()

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

◆ CreateConditionComponents()

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

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

◆ GetStanceMask()

override int GetStanceMask ( PlayerBase player)
inlineprivate
58 {
59 if ( player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_PRONE))
60 return DayZPlayerConstants.STANCEMASK_CROUCH;
61 else
62 return DayZPlayerConstants.STANCEMASK_ERECT;
63 }

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)
inlineprivate
110 {
111 super.OnEndServer(action_data);
112
113 PlayerBase target_player = PlayerBase.Cast(action_data.m_Target.GetObject());
114 if (target_player)
115 {
116 target_player.SetRestrainStarted(false);
117 target_player.SetRestrainPrelocked(false);
118 }
119 }

◆ OnFinishProgressClient()

override void OnFinishProgressClient ( ActionData action_data)
inlineprivate
152 {
153 super.OnFinishProgressClient( action_data );
154
155 GetGame().GetAnalyticsClient().OnActionRestrain();
156 }

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

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
inlineprivate
122 {
123 PlayerBase target_player = PlayerBase.Cast(action_data.m_Target.GetObject());
125
126 if (CanReceiveAction(action_data.m_Target) && !target_player.IsRestrained())
127 {
128 EntityAI item_in_hands_target = target_player.GetHumanInventory().GetEntityInHands();
129 EntityAI item_in_hands_source = source_player.GetHumanInventory().GetEntityInHands();
130
132 {
133 Error("Restraining target failed, nothing in hands");
134 return;
135 }
136
137 string new_item_name = MiscGameplayFunctions.ObtainRestrainItemTargetClassname(item_in_hands_source);
139 {
141 MiscGameplayFunctions.TurnItemInHandsIntoItemEx(target_player, lambda2);
142 }
143 else
144 {
146 source_player.LocalReplaceItemInHandsWithNewElsewhere(lambda);
147 }
148 }
149 }
void RestrainTargetPlayerLambda(EntityAI old_item, string new_item_type, PlayerBase player)
Definition ActionRestrainTarget.c:212
bool CanReceiveAction(ActionTarget target)
Definition ActionBase.c:690
Definition ActionRestrainTarget.c:160
Definition Building.c:6
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

Перекрестные ссылки ActionBase::CanReceiveAction(), Error() и RestrainTargetPlayerLambda().

◆ OnStartServer()

override void OnStartServer ( ActionData action_data)
inlineprivate
92 {
93 super.OnStartServer(action_data);
94
95 PlayerBase target_player = PlayerBase.Cast(action_data.m_Target.GetObject());
96 if ( target_player.IsSurrendered() )
97 {
99 target_player.EndSurrenderRequest(sdr);
100 }
101 else if ( target_player.IsEmotePlaying() )
102 {
103 target_player.m_EmoteManager.ServerRequestEmoteCancel();
104 }
105
106 target_player.SetRestrainStarted(true);
107 }

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