DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionFillBottleBase.c
См. документацию.
2{
3 private float m_BaseFillQuantity;
4
5 override void CreateActionComponent()
6 {
7 CCTWaterSurfaceEx waterCheck = CCTWaterSurfaceEx.Cast(m_ActionData.m_Action.m_ConditionTarget);
8 if (!waterCheck)
9 return;
10
11 int liquidType = waterCheck.GetLiquidType();
12 if (liquidType == LIQUID_GASOLINE)
13 {
15 }
16 else if (liquidType == LIQUID_SNOW)
17 {
19 }
20 else
21 {
23 }
24 m_ActionData.m_ActionComponent = new CAContinuousFill(m_BaseFillQuantity, liquidType);
25 }
26
27 // DEPRECATED
28 private int m_liquid_type;
29};
30
32{
33 private const float WATER_DEPTH = 0.5;
34 private const string ALLOWED_WATER_SURFACES = string.Format("%1|%2|%3", UAWaterType.FRESH, UAWaterType.STILL, UAWaterType.SNOW);
35 protected int m_AllowedLiquidMask;
36
38 {
40 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_FILLBOTTLEPOND;
41 m_FullBody = true;
42 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
43 m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
44 m_Text = "#fill";
45
48 }
49
55
56 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
57 {
58 int liquidType = LIQUID_NONE;
60 if (waterCheck)
61 liquidType = waterCheck.GetSurfaceLiquidType(target);
62
63 return liquidType != LIQUID_NONE && Liquid.CanFillContainer(item, liquidType);
64 }
65
66 override bool ActionConditionContinue(ActionData action_data)
67 {
68 return action_data.m_MainItem.GetQuantity() < action_data.m_MainItem.GetQuantityMax();
69 }
70
71 override protected int GetStanceMask(PlayerBase player)
72 {
73 vector water_info = HumanCommandSwim.WaterLevelCheck(player, player.GetPosition());
74 if (water_info[1] > WATER_DEPTH)
75 {
76 return DayZPlayerConstants.STANCEMASK_ERECT;
77 }
78 else
79 {
80 return DayZPlayerConstants.STANCEMASK_CROUCH;
81 }
82 }
83
84 override protected int GetActionCommandEx(ActionData actionData)
85 {
86 int commandUID = DayZPlayerConstants.CMD_ACTIONFB_FILLBOTTLEPOND;
87 Object targetObj = actionData.m_Target.GetObject();
88
89 if (targetObj && (targetObj.IsWell() || targetObj.IsFuelStation()))
90 {
91 commandUID = DayZPlayerConstants.CMD_ACTIONFB_FILLBOTTLEWELL;
92 }
93
94 return commandUID;
95 }
96
98 {
99 //returns in format (totalWaterDepth, characterDepht, 0)
100 vector water_info = HumanCommandSwim.WaterLevelCheck(player, player.GetPosition());
101 if (water_info[1] > WATER_DEPTH)
102 {
103 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
104 }
105 else
106 {
107 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
108 }
109 }
110
111 override bool IsLockTargetOnUse()
112 {
113 return false;
114 }
115
116 // DEPRECATED
117 private const int ALLOWED_LIQUID;
118
119 [Obsolete("CCTWaterSurfaceEx::GetSurfaceLiquidType can be used instead")]
121 {
122 int liquidType = LIQUID_NONE;
123 if ( target.GetObject() )
124 {
125 liquidType = target.GetObject().GetLiquidSourceType();
126 }
127 else
128 {
129 string surfaceType;
130 vector hit_pos = target.GetCursorHitPos();
131 GetGame().SurfaceGetType3D(hit_pos[0], hit_pos[1], hit_pos[2], surfaceType);
132 if (surfaceType == "")
133 {
134 if ( hit_pos[1] <= g_Game.SurfaceGetSeaLevel() + 0.001 )
135 {
136 liquidType = LIQUID_SALTWATER;
137 }
138 }
139 else
140 {
141 liquidType = SurfaceInfo.GetByName(surfaceType).GetLiquidType();
142 }
143 }
144
145 return liquidType & m_AllowedLiquidMask;
146 }
147}
ActionBase ActionData
Определения ActionBase.c:30
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:121
void CCTWaterSurfaceEx(float maximal_target_distance, int allowedLiquidSource)
Определения CCTWaterSurface.c:63
DayZGame g_Game
Определения DayZGame.c:3868
float m_SpecialtyWeight
Определения ActionBase.c:77
int m_StanceMask
Определения ActionBase.c:62
string m_Text
Определения ActionBase.c:58
ref CCIBase m_ConditionItem
Определения ActionBase.c:64
bool m_FullBody
Определения ActionBase.c:61
ref CCTBase m_ConditionTarget
Определения ActionBase.c:65
ActionData m_ActionData
Определения AnimatedActionBase.c:3
void ActionContinuousBase()
Определения ActionContinuousBase.c:124
override bool ActionConditionContinue(ActionData action_data)
Определения ActionFillBottleBase.c:66
int GetLiquidType(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionFillBottleBase.c:120
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionFillBottleBase.c:56
int GetActionCommandEx(ActionData actionData)
Определения ActionFillBottleBase.c:84
const string ALLOWED_WATER_SURFACES
Определения ActionFillBottleBase.c:34
int m_AllowedLiquidMask
Определения ActionFillBottleBase.c:35
const float WATER_DEPTH
Определения ActionFillBottleBase.c:33
void ActionFillBottleBase()
Определения ActionFillBottleBase.c:37
int GetStanceMask(PlayerBase player)
Определения ActionFillBottleBase.c:71
void SetupStance(PlayerBase player)
Определения ActionFillBottleBase.c:97
const int ALLOWED_LIQUID
Определения ActionFillBottleBase.c:117
override bool IsLockTargetOnUse()
Определения ActionFillBottleBase.c:111
override void CreateConditionComponents()
Определения ActionFillBottleBase.c:50
float m_BaseFillQuantity
Определения ActionFillBottleBase.c:3
override void CreateActionComponent()
Определения ActionFillBottleBase.c:5
int m_CommandUID
Определения AnimatedActionBase.c:143
Определения CCINonRuined.c:2
proto float SurfaceGetType3D(float x, float y, float z, out string type)
Y input: Maximum Y to trace down from; Returns: Y position the surface was found.
Определения ObjectTyped.c:2
Определения PlayerBaseClient.c:2
proto int GetLiquidType()
See 'LiquidTypes' in 'constants.c'.
static proto SurfaceInfo GetByName(string name)
Определения SurfaceInfo.c:9
const float DEFAULT
Определения ActionConstants.c:112
const float FUEL
Определения ActionConstants.c:17
const float FILL_SNOW
Определения ActionConstants.c:11
const float FILL_LIQUID
Определения ActionConstants.c:10
const string FRESH
fake
Определения ActionConstants.c:163
const string STILL
Определения ActionConstants.c:164
const string SNOW
Определения ActionConstants.c:165
Определения ActionConstants.c:161
Определения EnConvert.c:106
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
proto native CGame GetGame()
void Obsolete(string msg="")
Определения EnScript.c:371
const int LIQUID_NONE
Определения 3_Game/constants.c:529
const int LIQUID_GROUP_DRINKWATER
Определения 3_Game/constants.c:556
const int LIQUID_GASOLINE
Определения 3_Game/constants.c:545
const int LIQUID_SALTWATER
Определения 3_Game/constants.c:550
const int LIQUID_SNOW
Определения 3_Game/constants.c:549
class HumanCommandLadder HumanCommandSwim()
Определения human.c:673