65 super.OnFinishProgressServer(action_data);
67 Object targetObject = action_data.m_Target.GetObject();
73 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(body, {
Bolt_Base});
83 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem,
UADamageApplied.SKINNING);
86 moduleLifespan.UpdateBloodyHandsVisibility(action_data.m_Player,
true);
87 action_data.m_Player.SetBloodyHandsPenaltyChancePerAgent(
eAgents.SALMONELLA, body.GetSkinningBloodInfectionChance(
eAgents.SALMONELLA));
96 MiscGameplayFunctions.GetHeadBonePos(player,posHead);
97 vector posRandom = MiscGameplayFunctions.GetRandomizedPositionVerified(posHead,body_pos,
UAItemsSpreadRadius.NARROW,player);
105 float item_quantity = 0;
109 GetGame().ConfigGetFloatArray(cfg_skinning_organ_class +
"quantityMinMax", quant_min_max);
110 GetGame().ConfigGetFloatArray(cfg_skinning_organ_class +
"quantityMinMaxCoef", quant_min_max_coef);
113 if (quant_min_max.Count() > 0)
115 float soft_skill_manipulated_value = (quant_min_max.Get(0)+ quant_min_max.Get(1)) / 2;
116 item_quantity =
Math.RandomFloat(soft_skill_manipulated_value, quant_min_max.Get(1));
119 if (quant_min_max_coef.Count() > 0)
121 float coef =
Math.RandomFloat(quant_min_max_coef.Get(0), quant_min_max_coef.Get(1));
122 item_quantity = added_item.GetQuantityMax() * coef;
125 if (
GetGame().ConfigGetFloat(cfg_skinning_organ_class +
"quantity") > 0)
126 item_quantity =
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"quantity");
128 if (
GetGame().ConfigGetFloat(cfg_skinning_organ_class +
"quantityCoef") > 0)
130 float coef2 =
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"quantityCoef");
131 item_quantity = added_item.GetQuantityMax() * coef2;
134 if (item_quantity > 0)
136 item_quantity =
Math.Round(item_quantity);
137 added_item.SetQuantity(item_quantity,
false);
141 float item_apply_tool_damage_coef =
GetGame().ConfigGetFloat(cfg_skinning_organ_class +
"transferToolDamageCoef");
143 if (item_apply_tool_damage_coef > 0)
145 float tool_dmg_coef = 1 - tool.GetHealth01();
146 float organ_dmg_coef = tool_dmg_coef * item_apply_tool_damage_coef;
147 added_item.DecreaseHealthCoef(organ_dmg_coef);
150 added_item.InsertAgent(
eAgents.SALMONELLA, 1);
156 super.OnFinishProgressClient(action_data);
158 if (action_data.m_Target)
160 Object target_obj = action_data.m_Target.GetObject();
162 if (target_obj.IsKindOf(
"Animal_CapreolusCapreolus") || target_obj.IsKindOf(
"Animal_CapreolusCapreolusF") || target_obj.IsKindOf(
"Animal_CervusElaphus") || target_obj.IsKindOf(
"Animal_CervusElaphusF"))
173 if (
Class.CastTo(body,action_data.m_Target.GetObject()))
175 if (body.IsRestrained() && body.GetHumanInventory().GetEntityInHands())
176 MiscGameplayFunctions.TransformRestrainItem(body.GetHumanInventory().GetEntityInHands(), null, action_data.m_Player, body);
179 if (body.IsWearingSplint())
181 EntityAI entity = action_data.m_Player.SpawnEntityOnGroundOnCursorDir(
"Splint", 0.5);
183 EntityAI attachment = body.GetItemOnSlot(
"Splint_Right");
184 if (attachment && attachment.GetType() ==
"Splint_Applied")
188 MiscGameplayFunctions.TransferItemProperties(attachment, newItem);
190 if (newItem.GetHealthLevel() < 4)
192 int newDmgLevel = newItem.GetHealthLevel() + 1;
193 float max = newItem.GetMaxHealth(
"",
"");
198 newItem.SetHealth(
"",
"", max *
GameConstants.DAMAGE_BADLY_DAMAGED_VALUE);
202 newItem.SetHealth(
"",
"", max *
GameConstants.DAMAGE_DAMAGED_VALUE);
206 newItem.SetHealth(
"",
"", max *
GameConstants.DAMAGE_WORN_VALUE);
210 newItem.SetHealth(
"",
"", max *
GameConstants.DAMAGE_RUINED_VALUE);
223 int deadBodyLifetime;
226 deadBodyLifetime = GetCEApi().GetCEGlobalInt(
"CleanupLifetimeDeadPlayer");
227 if (deadBodyLifetime <= 0)
228 deadBodyLifetime = 3600;
254 string cfg_animal_class_path =
"cfgVehicles " + body.GetType() +
" " +
"Skinning ";
255 vector bodyPosition = body.GetPosition();
257 if (!
g_Game.ConfigIsExisting(cfg_animal_class_path))
259 Debug.Log(
"Failed to find class 'Skinning' in the config of: " + body.GetType());
264 int child_count =
g_Game.ConfigGetChildrenCount(cfg_animal_class_path);
266 string item_to_spawn;
267 string cfg_skinning_organ_class;
269 for (
int i1 = 0; i1 < child_count; i1++)
272 g_Game.ConfigGetChildName(cfg_animal_class_path, i1, cfg_skinning_organ_class);
273 cfg_skinning_organ_class = cfg_animal_class_path + cfg_skinning_organ_class +
" ";
274 g_Game.ConfigGetText(cfg_skinning_organ_class +
"item", item_to_spawn);
276 if (item_to_spawn !=
"")
279 int item_count =
g_Game.ConfigGetInt(cfg_skinning_organ_class +
"count");
285 GetGame().ConfigGetTextArray(cfg_skinning_organ_class +
"itemZones", itemZones);
286 GetGame().ConfigGetFloatArray(cfg_skinning_organ_class +
"countByZone", itemCount);
288 if (itemCount.Count() > 0)
291 for (
int z = 0; z < itemZones.Count(); z++)
293 zoneDmg = body.GetHealth01(itemZones[z],
"Health");
294 zoneDmg *= itemCount[z];
295 item_count +=
Math.Floor(zoneDmg);
299 for (
int i2 = 0; i2 < item_count; i2++)
301 ItemBase spawn_result =
CreateOrgan(action_data.m_Player, bodyPosition, item_to_spawn, cfg_skinning_organ_class, action_data.m_MainItem);
305 float qtCoeff =
GetGame().ConfigGetFloat(cfg_skinning_organ_class +
"quantityCoef");
308 float avgDmgZones = 0;
309 for (
int c2 = 0; c2 < itemZones.Count(); c2++)
311 avgDmgZones += body.GetHealth01(itemZones[c2],
"Health");
314 avgDmgZones = avgDmgZones/itemZones.Count();
317 spawn_result.SetHealth01(
"",
"", avgDmgZones);
321 if (body.CanHaveTemperature() && spawn_result.CanHaveTemperature())
323 spawn_result.SetTemperatureDirect(body.GetTemperature());
324 spawn_result.SetFrozen(body.GetIsFrozen());
328 if ((item_to_spawn ==
"Lard") || (item_to_spawn ==
"Guts"))
330 if (body.IsKindOf(
"SurvivorBase"))
332 spawn_result.InsertAgent(
eAgents.BRAIN, 1);
ItemBase CreateOrgan(PlayerBase player, vector body_pos, string item_to_spawn, string cfg_skinning_organ_class, ItemBase tool)
proto native vector Vector(float x, float y, float z)
Vector constructor from components.