DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ HandlePlayerBody()

void HandlePlayerBody ( ActionData action_data)

This section drops all clothes (and attachments) from the dead player before deleting their body.

См. определение в файле ActionSkinning.c строка 170

171 {
172 PlayerBase body;
173 if (Class.CastTo(body,action_data.m_Target.GetObject()))
174 {
175 if (body.IsRestrained() && body.GetHumanInventory().GetEntityInHands())
176 MiscGameplayFunctions.TransformRestrainItem(body.GetHumanInventory().GetEntityInHands(), null, action_data.m_Player, body);
177
178 //Remove splint if target is wearing one
179 if (body.IsWearingSplint())
180 {
181 EntityAI entity = action_data.m_Player.SpawnEntityOnGroundOnCursorDir("Splint", 0.5);
182 ItemBase newItem = ItemBase.Cast(entity);
183 EntityAI attachment = body.GetItemOnSlot("Splint_Right");
184 if (attachment && attachment.GetType() == "Splint_Applied")
185 {
186 if (newItem)
187 {
188 MiscGameplayFunctions.TransferItemProperties(attachment, newItem);
189 //Lower health level of splint after use
190 if (newItem.GetHealthLevel() < 4)
191 {
192 int newDmgLevel = newItem.GetHealthLevel() + 1;
193 float max = newItem.GetMaxHealth("", "");
194
195 switch (newDmgLevel)
196 {
198 newItem.SetHealth("", "", max * GameConstants.DAMAGE_BADLY_DAMAGED_VALUE);
199 break;
200
202 newItem.SetHealth("", "", max * GameConstants.DAMAGE_DAMAGED_VALUE);
203 break;
204
206 newItem.SetHealth("", "", max * GameConstants.DAMAGE_WORN_VALUE);
207 break;
208
210 newItem.SetHealth("", "", max * GameConstants.DAMAGE_RUINED_VALUE);
211 break;
212
213 default:
214 break;
215 }
216 }
217 }
218
219 attachment.Delete();
220 }
221 }
222
223 int deadBodyLifetime;
224 if (GetCEApi())
225 {
226 deadBodyLifetime = GetCEApi().GetCEGlobalInt("CleanupLifetimeDeadPlayer");
227 if (deadBodyLifetime <= 0)
228 deadBodyLifetime = 3600;
229 }
230
231 DropInventoryItems(body,deadBodyLifetime);
232 }
233 }
void DropInventoryItems(PlayerBase body, float newLifetime)
Определения ActionSkinning.c:235
proto native CEApi GetCEApi()
Get the CE API.
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения Building.c:6
Определения constants.c:659
Определения InventoryItem.c:731
Определения PlayerBaseClient.c:2
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const float DAMAGE_BADLY_DAMAGED_VALUE
Определения constants.c:861
const float DAMAGE_RUINED_VALUE
Определения constants.c:862
const float DAMAGE_DAMAGED_VALUE
Определения constants.c:860
const float DAMAGE_WORN_VALUE
Определения constants.c:859
const int STATE_RUINED
Определения constants.c:846
const int STATE_WORN
Определения constants.c:849
const int STATE_DAMAGED
Определения constants.c:848
const int STATE_BADLY_DAMAGED
Определения constants.c:847

Перекрестные ссылки ActionData, Class::CastTo(), GameConstants::DAMAGE_BADLY_DAMAGED_VALUE, GameConstants::DAMAGE_DAMAGED_VALUE, GameConstants::DAMAGE_RUINED_VALUE, GameConstants::DAMAGE_WORN_VALUE, DropInventoryItems(), GetCEApi(), GameConstants::STATE_BADLY_DAMAGED, GameConstants::STATE_DAMAGED, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.

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