Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл ActionGetOutTransport.c

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

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

class  GetOutTransportActionData
 

Функции

void ActionGetOutTransport ()
 
override ActionData CreateActionData ()
 
override void CreateConditionComponents ()
 
override GetInputType ()
 
override bool HasProgress ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
void ProcessGetOutActionData (Car car, GetOutTransportActionData got_action_data)
 
override void OnStart (ActionData action_data)
 
override void OnStartServer (ActionData action_data)
 
void Unhide (PlayerBase player)
 
override void OnUpdate (ActionData action_data)
 
override bool CanBeUsedInRestrain ()
 
override bool CanBeUsedInVehicle ()
 
override int GetActionCategory ()
 
override void OnEnd (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 
void ApplyJumpOutDmg (ActionData action_data)
 

Переменные

GetOutTransportActionData m_DmgFactor = 60
 
int m_ShockFactor = 15
 
const int LOW_SPEED_VALUE = 20
 
const int HIGH_SPEED_VALUE = 30
 
const int HEALTH_LOW_SPEED_VALUE = 30
 
const int HEALTH_HIGH_SPEED_VALUE = 70
 

Функции

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
private
54 {
55 HumanCommandVehicle vehCommand = player.GetCommand_Vehicle();
56 if (vehCommand)
57 {
58 Transport trans = vehCommand.GetTransport();
59 if (trans)
60 {
61 int crewIndex = trans.CrewMemberIndex(player);
62 return crewIndex >= 0 && trans.CrewCanGetThrough(crewIndex) && trans.IsAreaAtDoorFree(crewIndex);
63 }
64 }
65
66 return false;
67 }
Definition human.c:690
Definition EntityAI.c:95
Base native class for all motorized wheeled vehicles.
Definition Car.c:80

◆ ActionGetOutTransport()

void ActionGetOutTransport ( )
private
25 {
26 m_StanceMask = DayZPlayerConstants.STANCEMASK_ALL;
27 m_Text = "#leave_vehicle";
28 }
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

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

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

◆ ApplyJumpOutDmg()

void ApplyJumpOutDmg ( ActionData action_data)
private
186 {
189
191 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("LEGS")));
192 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BACK")));
193 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("VEST")));
194 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("HeadGear")));
195 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("Mask")));
196 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BODY")));
197 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("FEET")));
198 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("GLOVES")));
199
200 // -----------------------------------------------
201
202 //Lower shock taken if player uses a helmet
203 ItemBase headGear = ClothingBase.Cast(player.GetItemOnHead());
206 gotActionData.m_ShockTaken *= 0.5;
207
208 // -----------------------------------------------
209
210 int randNum; //value used for probability evaluation
211 randNum = Math.RandomInt(0, 100);
212 if (gotActionData.m_CarSpeed < LOW_SPEED_VALUE)
213 {
214 if (randNum < 20)
215 player.GiveShock(-gotActionData.m_ShockTaken); //To inflict shock, a negative value must be passed
216
217 randNum = Math.RandomIntInclusive(0, PlayerBase.m_BleedingSourcesLow.Count() - 1);
218
219 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesLow[randNum]);
220 }
221 else if (gotActionData.m_CarSpeed >= LOW_SPEED_VALUE && gotActionData.m_CarSpeed < HIGH_SPEED_VALUE)
222 {
223 if (randNum < 50)
224 player.GiveShock(-gotActionData.m_ShockTaken);
225
226 randNum = Math.RandomInt(0, PlayerBase.m_BleedingSourcesUp.Count() - 1);
227
228 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesUp[randNum]);
229 }
230 else if (gotActionData.m_CarSpeed >= HIGH_SPEED_VALUE)
231 {
232 if (!headGear)
233 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection("Head");
234
235 if (randNum < 75)
236 player.GiveShock(-gotActionData.m_ShockTaken);
237 }
238
239 //Damage all currently equipped clothes
241 {
242 //If no item is equipped on slot, slot is ignored
243 if (cloth == null)
244 continue;
245
246 cloth.DecreaseHealth(gotActionData.m_DmgTaken, false);
247 }
248 }
const int LOW_SPEED_VALUE
Definition ActionGetOutTransport.c:18
const int HIGH_SPEED_VALUE
Definition ActionGetOutTransport.c:19
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition DallasMask.c:2
Definition ActionGetOutTransport.c:2
Definition GreatHelm.c:2
Definition InventoryItem.c:731
Definition EnMath.c:7
Definition PlayerBaseClient.c:2
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Перекрестные ссылки Class::CastTo(), HIGH_SPEED_VALUE, LOW_SPEED_VALUE, Math::RandomInt() и Math::RandomIntInclusive().

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

◆ CanBeUsedInRestrain()

override bool CanBeUsedInRestrain ( )
private
137 {
138 return true;
139 }

◆ CanBeUsedInVehicle()

override bool CanBeUsedInVehicle ( )
private
142 {
143 return true;
144 }

◆ CreateActionData()

override ActionData CreateActionData ( )
private
31 {
33 return data;
34 }
Definition ActionBase.c:21

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
private
38 {
41 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
Definition CCINone.c:2
Definition CCTNone.c:2

Перекрестные ссылки m_ConditionItem и m_ConditionTarget.

◆ GetActionCategory()

override int GetActionCategory ( )
private
147 {
148 return AC_INTERACT;
149 }
const int AC_INTERACT
Definition _constants.c:4

Перекрестные ссылки AC_INTERACT.

◆ GetInputType()

override GetInputType ( )
private
44 {
46 }
Definition ActionInput.c:522

◆ HasProgress()

override bool HasProgress ( )
private
49 {
50 return false;
51 }

◆ OnEnd()

override void OnEnd ( ActionData action_data)
private
152 {
153 if (action_data.m_Player.GetInventory())
154 action_data.m_Player.GetInventory().UnlockInventory(LOCK_FROM_SCRIPT);
155 }

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)
private
158 {
160
161 if (gotActionData.m_WasJumpingOut)
162 {
163 float carSpeed = gotActionData.m_CarSpeed;
164 gotActionData.m_Player.OnJumpOutVehicleFinish(carSpeed);
165
167
168 vector posMS = gotActionData.m_Player.WorldToModel(gotActionData.m_Player.GetPosition());
169 gotActionData.m_Player.DamageAllLegs(gotActionData.m_DmgTaken); //Additionnal leg specific damage dealing
170
172 healthCoef = Math.Clamp(healthCoef, 0.0, 1.0);
173 gotActionData.m_Player.ProcessDirectDamage(DamageType.CUSTOM, gotActionData.m_Player, "", "FallDamageHealth", posMS, healthCoef);
174 }
175
176 if (gotActionData.m_Car)
177 {
179 if (Class.CastTo(car, gotActionData.m_Car))
180 car.ForceUpdateLightsEnd();
181 }
182 }
const int HEALTH_HIGH_SPEED_VALUE
Definition ActionGetOutTransport.c:22
void ApplyJumpOutDmg(ActionData action_data)
Definition ActionGetOutTransport.c:185
const int HEALTH_LOW_SPEED_VALUE
Definition ActionGetOutTransport.c:21
DamageType
exposed from C++ (do not change)
Definition DamageSystem.c:11
Definition CivilianSedan.c:2
Definition EnConvert.c:106
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...

Перекрестные ссылки ApplyJumpOutDmg(), Class::CastTo(), Math::Clamp(), HEALTH_HIGH_SPEED_VALUE, HEALTH_LOW_SPEED_VALUE и Math::InverseLerp().

◆ OnStart()

override void OnStart ( ActionData action_data)
private
81 {
82 super.OnStart(action_data);
83
84 HumanCommandVehicle vehCommand = action_data.m_Player.GetCommand_Vehicle();
85 if (vehCommand)
86 {
87 Transport trans = vehCommand.GetTransport();
88 if (trans)
89 {
91
92 Car car;
93 if (Class.CastTo(car, trans))
95
96 if (!gotActionData.m_WasJumpingOut)
97 vehCommand.GetOutVehicle();
98 else
99 vehCommand.JumpOutVehicle();
100
101 if (car)
102 GetDayZGame().GetBacklit().OnLeaveCar();
103
104 if (action_data.m_Player.GetInventory())
105 action_data.m_Player.GetInventory().LockInventory(LOCK_FROM_SCRIPT);
106 }
107 }
108 }
void ProcessGetOutActionData(Car car, GetOutTransportActionData got_action_data)
Definition ActionGetOutTransport.c:69
DayZGame GetDayZGame()
Definition DayZGame.c:3748

Перекрестные ссылки Class::CastTo(), GetDayZGame() и ProcessGetOutActionData().

◆ OnStartServer()

override void OnStartServer ( ActionData action_data)
private
111 {
112 HumanCommandVehicle vehCommand = action_data.m_Player.GetCommand_Vehicle();
113 if (vehCommand)
114 {
115 Transport trans = vehCommand.GetTransport();
116 if (trans)
117 {
119 if (Class.CastTo(car, trans))
120 car.ForceUpdateLightsStart();
121 }
122 }
123 }

Перекрестные ссылки Class::CastTo().

◆ OnUpdate()

override void OnUpdate ( ActionData action_data)
private
128 {
129 if (action_data.m_State == UA_START)
130 {
131 if (!action_data.m_Player.GetCommand_Vehicle())
133 }
134 }
void End()
called on surrender end request end
const int UA_START
Definition constants.c:439

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

◆ ProcessGetOutActionData()

void ProcessGetOutActionData ( Car car,
GetOutTransportActionData got_action_data )
private
70 {
71 got_action_data.m_StartLocation = got_action_data.m_Player.GetPosition();
72 got_action_data.m_Car = car;
73 float carSpeed = car.GetSpeedometerAbsolute();
74 got_action_data.m_CarSpeed = carSpeed;
75 got_action_data.m_DmgTaken = (carSpeed * carSpeed) / m_DmgFactor; //When using multiplications, wrong value is returned
77 got_action_data.m_WasJumpingOut = carSpeed > 8.0;
78 }
int m_ShockFactor
Definition ActionGetOutTransport.c:15
GetOutTransportActionData m_DmgFactor

Перекрестные ссылки m_DmgFactor и m_ShockFactor.

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

◆ Unhide()

void Unhide ( PlayerBase player)
private

Переменные

◆ HEALTH_HIGH_SPEED_VALUE

const int HEALTH_HIGH_SPEED_VALUE = 70
private

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

◆ HEALTH_LOW_SPEED_VALUE

const int HEALTH_LOW_SPEED_VALUE = 30
private

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

◆ HIGH_SPEED_VALUE

const int HIGH_SPEED_VALUE = 30

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

◆ LOW_SPEED_VALUE

const int LOW_SPEED_VALUE = 20

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

◆ m_DmgFactor

GetOutTransportActionData m_DmgFactor = 60

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

◆ m_ShockFactor

int m_ShockFactor = 15

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