DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл ActionEatSnowContinuous.c

См. исходные тексты.

Структуры данных

class  ActionEatSnowContinuousCB
 

Функции

ActionEatSnowContinuousCB ActionContinuousBaseCB ActionEatSnowContinuous ()
 
override void CreateActionComponent ()
 
override bool IsDrink ()
 
override GetInputType ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnStart (ActionData action_data)
 
override void OnEnd (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void OnEndAnimationLoopServer (ActionData action_data)
 
override void WriteToContext (ParamsWriteContext ctx, ActionData action_data)
 
override bool ReadFromContext (ParamsReadContext ctx, out ActionReciveData action_recive_data)
 

Функции

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
37 {
38 if (item && item.IsHeavyBehaviour())
39 return false;
40
41 return player.CanEatAndDrink();
42 }
Definition EntityAI.c:95

◆ ActionEatSnowContinuous()

12 {
13 m_CallbackClass = ActionEatSnowContinuousCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EATING_SNOW;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
17 m_Text = "#eat";
18 }
int m_CommandUID
Definition ActionBase.c:31
int m_StanceMask
Definition ActionBase.c:33
Definition ActionEatSnowContinuous.c:2
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Используется в ActionConstructor::RegisterActions() и ManBase::SetActions().

◆ CreateActionComponent()

override void CreateActionComponent ( )
12 {
13 m_CallbackClass = ActionEatSnowContinuousCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EATING_SNOW;
15 m_FullBody = true;

Перекрестные ссылки m_CommandUID и m_StanceMask.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
31 {
32 m_ConditionItem = new CCINone();
33 m_ConditionTarget = new CCTWaterSurfaceEx(UAMaxDistances.DEFAULT,LIQUID_SNOW);
34 }
void CCTWaterSurfaceEx(float maximal_target_distance, int allowedLiquidSource)
Definition CCTWaterSurface.c:62
Definition CCINone.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108
const int LIQUID_SNOW
Definition constants.c:526

Перекрестные ссылки CCTWaterSurfaceEx(), UAMaxDistances::DEFAULT и LIQUID_SNOW.

◆ GetInputType()

override GetInputType ( )
26 {
28 }
Definition ActionInput.c:522

◆ IsDrink()

override bool IsDrink ( )
21 {
22 return true;
23 }

◆ OnEnd()

override void OnEnd ( ActionData action_data)
52 {
53 action_data.m_Player.TryHideItemInHands(false);
54 }

◆ OnEndAnimationLoopServer()

override void OnEndAnimationLoopServer ( ActionData action_data)
64 {
65 if (action_data.m_Player.HasBloodyHands() && !action_data.m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES))
66 {
67 action_data.m_Player.SetBloodyHandsPenalty();
68 }
69 }
provides access to slot configuration
Definition InventorySlots.c:6

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
57 {
58 Param1<float> nacdata = Param1<float>.Cast(action_data.m_ActionComponent.GetACData());
59 float amount = UAQuantityConsumed.EAT_NORMAL;
60 action_data.m_Player.Consume(null, amount, EConsumeType.ENVIRO_SNOW);
61 }
EConsumeType
Definition EConsumeType.c:2
Definition ActionConstants.c:4
const float EAT_NORMAL
Definition ActionConstants.c:8

Перекрестные ссылки UAQuantityConsumed::EAT_NORMAL.

◆ OnStart()

override void OnStart ( ActionData action_data)
45 {
46 super.OnStart(action_data);
47
48 action_data.m_Player.TryHideItemInHands(true);
49 }

◆ ReadFromContext()

override bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
85 {
86 super.ReadFromContext(ctx, action_recive_data);
87
88 if (HasTarget())
89 {
91 if (!ctx.Read(cursorPosition))
92 return false;
93
94 action_recive_data.m_Target.SetCursorHitPos(cursorPosition);
95 }
96
97 return true;
98 }
override bool HasTarget()
Definition ActionInput.c:472
Definition EnConvert.c:106

Перекрестные ссылки ActionBase::HasTarget().

◆ WriteToContext()

override void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
72 {
73 super.WriteToContext(ctx, action_data);
74
75 if (HasTarget())
76 {
77 ctx.Write(action_data.m_Target.GetCursorHitPos());
78 return;
79 }
80
81 ctx.Write(vector.Zero);
82 }
static const vector Zero
Definition EnConvert.c:110

Перекрестные ссылки ActionBase::HasTarget() и vector::Zero.