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

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

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

class  ActionDrinkPondContinuousCB
 

Функции

void ActionDrinkPondContinuous ()
 
override bool IsDrink ()
 
override GetInputType ()
 
override bool CanBeUsedInFreelook ()
 
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)
 
int GetLiquidSource (ActionTarget target)
 

Переменные

ActionDrinkPondContinuousCB WATER_DRANK_PER_SEC = 35
 
const string ALLOWED_WATER_SURFACES = string.Format("%1|%2", UAWaterType.FRESH, UAWaterType.STILL)
 

Функции

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
protected
45 {
46 if (item && item.IsHeavyBehaviour())
47 return false;
48
49 return player.CanEatAndDrink();
50 }
Definition EntityAI.c:95

◆ ActionDrinkPondContinuous()

void ActionDrinkPondContinuous ( )
protected
15 {
16 m_CallbackClass = ActionDrinkPondContinuousCB;
17 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DRINKPOND;
18 m_FullBody = true;
19 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
20 m_Text = "#drink";
21 }
int m_CommandUID
Definition ActionBase.c:31
int m_StanceMask
Definition ActionBase.c:33
Definition ActionDrinkPondContinuous.c:2
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

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

◆ CanBeUsedInFreelook()

override bool CanBeUsedInFreelook ( )
protected
34 {
35 return false;
36 }

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
protected
39 {
40 m_ConditionItem = new CCINone();
42 }
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_HOTWATER
Definition constants.c:530
const int LIQUID_GROUP_DRINKWATER
Definition constants.c:533
const int LIQUID_SNOW
Definition constants.c:526

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

◆ GetInputType()

override GetInputType ( )
protected
29 {
31 }
Definition ActionInput.c:522

◆ GetLiquidSource()

int GetLiquidSource ( ActionTarget target)
protected
123 {
124 vector hitPosition = target.GetCursorHitPos();
125 string surfaceType;
126 int liquidSource;
127
128 g_Game.SurfaceGetType3D(hitPosition[0], hitPosition[1], hitPosition[2], surfaceType);
129 string path = "CfgSurfaces " + surfaceType + " liquidType";
130 liquidSource = GetGame().ConfigGetInt(path);
131
132 return liquidSource;
133 }
DayZGame g_Game
Definition DayZGame.c:3815
string path
Definition OptionSelectorMultistate.c:142
Definition EnConvert.c:106
proto native CGame GetGame()

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

Используется в OnFinishProgressServer().

◆ IsDrink()

override bool IsDrink ( )
protected
24 {
25 return true;
26 }

◆ OnEnd()

override void OnEnd ( ActionData action_data)
protected
60 {
61 action_data.m_Player.TryHideItemInHands(false);
62 }

◆ OnEndAnimationLoopServer()

override void OnEndAnimationLoopServer ( ActionData action_data)
protected
86 {
87 if (action_data.m_Player.HasBloodyHands() && !action_data.m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES))
88 {
89 action_data.m_Player.SetBloodyHandsPenalty();
90 }
91 }
provides access to slot configuration
Definition InventorySlots.c:6

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
protected
65 {
66 Param1<float> nacdata = Param1<float>.Cast(action_data.m_ActionComponent.GetACData());
67 float amount = UAQuantityConsumed.DRINK;
68
71 switch (liquidSource)
72 {
74 consumeType = EConsumeType.ENVIRO_WELL;
75 break;
76
77 default:
78 consumeType = EConsumeType.ENVIRO_POND;
79 break;
80 }
81
82 action_data.m_Player.Consume(null, amount, consumeType);
83 }
int GetLiquidSource(ActionTarget target)
Definition ActionDrinkPondContinuous.c:122
EConsumeType
Definition EConsumeType.c:2
Definition ActionConstants.c:4
const float DRINK
Definition ActionConstants.c:14
const int LIQUID_CLEANWATER
Definition constants.c:531

Перекрестные ссылки UAQuantityConsumed::DRINK, GetLiquidSource() и LIQUID_CLEANWATER.

◆ OnStart()

override void OnStart ( ActionData action_data)
protected
53 {
54 super.OnStart(action_data);
55
56 action_data.m_Player.TryHideItemInHands(true);
57 }

◆ ReadFromContext()

override bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
protected
107 {
108 super.ReadFromContext(ctx, action_recive_data);
109
110 if (HasTarget())
111 {
113 if (!ctx.Read(cursorPosition))
114 return false;
115
116 action_recive_data.m_Target.SetCursorHitPos(cursorPosition);
117 }
118
119 return true;
120 }
override bool HasTarget()
Definition ActionInput.c:472

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

◆ WriteToContext()

override void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
protected
94 {
95 super.WriteToContext(ctx, action_data);
96
97 if (HasTarget())
98 {
99 ctx.Write(action_data.m_Target.GetCursorHitPos());
100 return;
101 }
102
103 ctx.Write(vector.Zero);
104 }
static const vector Zero
Definition EnConvert.c:110

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

Переменные

◆ ALLOWED_WATER_SURFACES

const string ALLOWED_WATER_SURFACES = string.Format("%1|%2", UAWaterType.FRESH, UAWaterType.STILL)
protected

◆ WATER_DRANK_PER_SEC

ActionDrinkPondContinuousCB WATER_DRANK_PER_SEC = 35