65 super.OnFinishProgressServer(action_data);
67 Object targetObject = action_data.m_Target.GetObject();
73 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(body, {
Bolt_Base});
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);
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);
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"))
164 GetGame().GetAnalyticsClient().OnActionFinishedGutDeer();
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(
"",
"");
223 int deadBodyLifetime;
226 deadBodyLifetime =
GetCEApi().GetCEGlobalInt(
"CleanupLifetimeDeadPlayer");
227 if (deadBodyLifetime <= 0)
228 deadBodyLifetime = 3600;
254 string cfgAnimalClassPath =
"cfgVehicles " + body.GetType() +
" " +
"Skinning ";
255 vector bodyPosition = body.GetPosition();
257 if (!
g_Game.ConfigIsExisting(cfgAnimalClassPath))
259 Debug.
Log(
"Failed to find class 'Skinning' in the config of: " + body.GetType());
264 int childCount =
g_Game.ConfigGetChildrenCount(cfgAnimalClassPath);
267 string cfgSkinningOrganClass;
269 for (
int i1 = 0; i1 < childCount; i1++)
272 g_Game.ConfigGetChildName(cfgAnimalClassPath, i1, cfgSkinningOrganClass);
273 cfgSkinningOrganClass = cfgAnimalClassPath + cfgSkinningOrganClass +
" ";
274 g_Game.ConfigGetText(cfgSkinningOrganClass +
"item", itemToSpawn);
276 if (itemToSpawn !=
"")
279 int itemSpawnCount =
g_Game.ConfigGetInt(cfgSkinningOrganClass +
"count");
285 GetGame().ConfigGetTextArray(cfgSkinningOrganClass +
"itemZones", itemZones);
286 GetGame().ConfigGetFloatArray(cfgSkinningOrganClass +
"countByZone", itemCount);
287 float transferedPartDmgCoef =
GetGame().ConfigGetFloat(cfgSkinningOrganClass +
"transferPartDamageCoef");
289 if (itemCount.Count() > 0)
292 for (
int z = 0; z < itemZones.Count(); z++)
294 zoneDmg = body.GetHealth01(itemZones[z],
"Health");
295 zoneDmg *= itemCount[z];
300 if (transferedPartDmgCoef > 0 && itemSpawnCount <= 0)
303 for (
int i2 = 0; i2 < itemSpawnCount; i2++)
305 ItemBase spawnResult =
CreateOrgan(action_data.m_Player, bodyPosition, itemToSpawn, cfgSkinningOrganClass, action_data.m_MainItem);
311 if (transferedPartDmgCoef > 0)
313 float partHealth = 0;
314 float partMaxHealth = 0;
315 for (
int z2 = 0; z2 < itemZones.Count(); z2++)
317 partHealth = body.GetHealth(itemZones[z2],
"Health");
318 partMaxHealth = body.GetMaxHealth(itemZones[z2],
"Health");
322 if (partMaxHealth > 0)
324 float itemMaxHealth = spawnResult.GetMaxHealth(
"",
"Health");
325 float partHealthPercent = (partHealth / partMaxHealth) * 100;
326 float itemHealth = (itemMaxHealth / 100) * partHealthPercent;
328 if (transferedPartDmgCoef > 1)
329 transferedPartDmgCoef = 1;
331 float itemHealthCoef = itemHealth * transferedPartDmgCoef;
332 spawnResult.SetHealth(
"",
"Health", itemHealthCoef);
338 float qtCoeff =
GetGame().ConfigGetFloat(cfgSkinningOrganClass +
"quantityCoef");
341 float avgDmgZones = 0;
342 for (
int c2 = 0; c2 < itemZones.Count(); c2++)
344 avgDmgZones += body.GetHealth01(itemZones[c2],
"Health");
347 avgDmgZones = avgDmgZones/itemZones.Count();
348 spawnResult.SetHealth01(
"",
"", avgDmgZones);
352 if (body.CanHaveTemperature() && spawnResult.CanHaveTemperature())
354 spawnResult.SetTemperatureDirect(body.GetTemperature());
355 spawnResult.SetFrozen(body.GetIsFrozen());
359 if ((itemToSpawn ==
"Lard") || (itemToSpawn ==
"Guts"))
361 if (body.IsKindOf(
"SurvivorBase"))
363 spawnResult.InsertAgent(
eAgents.BRAIN, 1);
ItemBase CreateOrgan(PlayerBase player, vector body_pos, string item_to_spawn, string cfg_skinning_organ_class, ItemBase tool)
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.