23 override void CreateActionComponent()
50 Object targetObject = target.GetObject();
52 if (targetObject.CanBeSkinned() && !targetObject.IsAlive())
55 if (
Class.CastTo(target_EAI, targetObject) && target_EAI.CanBeSkinnedWith(item))
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);
92 return body_pos +
Vector(
Math.RandomFloat01() - 0.5, 0,
Math.RandomFloat01() - 0.5);
108 added_item.PlaceOnSurface();
111 float item_quantity = 0;
115 GetGame().ConfigGetFloatArray(cfg_skinning_organ_class +
"quantityMinMax", quant_min_max);
116 GetGame().ConfigGetFloatArray(cfg_skinning_organ_class +
"quantityMinMaxCoef", quant_min_max_coef);
120 if (quant_min_max.Count() > 0)
122 float soft_skill_manipulated_value = (quant_min_max.Get(0)+ quant_min_max.Get(1)) / 2;
123 float min_quantity = player.GetSoftSkillsManager().AddSpecialtyBonus(soft_skill_manipulated_value, this.
GetSpecialtyWeight());
124 item_quantity =
Math.RandomFloat(min_quantity, quant_min_max.Get(1));
127 if (quant_min_max_coef.Count() > 0)
129 float coef =
Math.RandomFloat(quant_min_max_coef.Get(0), quant_min_max_coef.Get(1));
130 item_quantity = added_item.GetQuantityMax() * coef;
133 if (
GetGame().ConfigGetFloat(cfg_skinning_organ_class +
"quantity") > 0)
134 item_quantity =
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"quantity");
136 if (
GetGame().ConfigGetFloat(cfg_skinning_organ_class +
"quantityCoef") > 0)
138 float coef2 =
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"quantityCoef");
139 item_quantity = added_item.GetQuantityMax() * coef2;
142 if (item_quantity > 0)
144 item_quantity =
Math.Round(item_quantity);
145 added_item.SetQuantity(item_quantity,
false);
149 float item_apply_tool_damage_coef =
GetGame().ConfigGetFloat(cfg_skinning_organ_class +
"transferToolDamageCoef");
151 if (item_apply_tool_damage_coef > 0)
153 float tool_dmg_coef = 1 - tool.GetHealth01();
154 float organ_dmg_coef = tool_dmg_coef * item_apply_tool_damage_coef;
155 added_item.DecreaseHealthCoef(organ_dmg_coef);
158 added_item.InsertAgent(
eAgents.SALMONELLA, 1);
164 super.OnFinishProgressClient(action_data);
166 if (action_data.m_Target)
168 Object target_obj = action_data.m_Target.GetObject();
170 if (target_obj.IsKindOf(
"Animal_CapreolusCapreolus") || target_obj.IsKindOf(
"Animal_CapreolusCapreolusF") || target_obj.IsKindOf(
"Animal_CervusElaphus") || target_obj.IsKindOf(
"Animal_CervusElaphusF"))
172 GetGame().GetAnalyticsClient().OnActionFinishedGutDeer();
181 if (
Class.CastTo(body,action_data.m_Target.GetObject()))
183 if (body.IsRestrained() && body.GetHumanInventory().GetEntityInHands())
184 MiscGameplayFunctions.TransformRestrainItem(body.GetHumanInventory().GetEntityInHands(),
null, action_data.m_Player, body);
187 if (body.IsWearingSplint())
189 EntityAI entity = action_data.m_Player.SpawnEntityOnGroundOnCursorDir(
"Splint", 0.5);
191 EntityAI attachment = body.GetItemOnSlot(
"Splint_Right");
192 if (attachment && attachment.GetType() ==
"Splint_Applied")
196 MiscGameplayFunctions.TransferItemProperties(attachment, newItem);
198 if (newItem.GetHealthLevel() < 4)
200 int newDmgLevel = newItem.GetHealthLevel() + 1;
201 float max = newItem.GetMaxHealth(
"",
"");
206 newItem.SetHealth(
"",
"", max *
GameConstants.DAMAGE_BADLY_DAMAGED_VALUE);
210 newItem.SetHealth(
"",
"", max *
GameConstants.DAMAGE_DAMAGED_VALUE);
214 newItem.SetHealth(
"",
"", max *
GameConstants.DAMAGE_WORN_VALUE);
218 newItem.SetHealth(
"",
"", max *
GameConstants.DAMAGE_RUINED_VALUE);
231 int deadBodyLifetime;
234 deadBodyLifetime =
GetCEApi().GetCEGlobalInt(
"CleanupLifetimeDeadPlayer");
235 if (deadBodyLifetime <= 0)
236 deadBodyLifetime = 3600;
251 child.SetLifetime(newLifetime);
252 body.GetInventory().DropEntity(
InventoryMode.SERVER, body, child);
262 string cfg_animal_class_path =
"cfgVehicles " + body.GetType() +
" " +
"Skinning ";
263 vector bodyPosition = body.GetPosition();
266 int child_count =
g_Game.ConfigGetChildrenCount(cfg_animal_class_path);
268 string item_to_spawn;
269 string cfg_skinning_organ_class;
271 for (
int i1 = 0; i1 < child_count; i1++)
274 g_Game.ConfigGetChildName(cfg_animal_class_path, i1, cfg_skinning_organ_class);
275 cfg_skinning_organ_class = cfg_animal_class_path + cfg_skinning_organ_class +
" ";
276 g_Game.ConfigGetText(cfg_skinning_organ_class +
"item", item_to_spawn);
278 if (item_to_spawn !=
"")
281 int item_count =
g_Game.ConfigGetInt(cfg_skinning_organ_class +
"count");
287 GetGame().ConfigGetTextArray(cfg_skinning_organ_class +
"itemZones", itemZones);
288 GetGame().ConfigGetFloatArray(cfg_skinning_organ_class +
"countByZone", itemCount);
290 if (itemCount.Count() > 0)
293 for (
int z = 0; z < itemZones.Count(); z++)
295 zoneDmg = body.GetHealth01(itemZones[z],
"Health");
296 zoneDmg *= itemCount[z];
297 item_count +=
Math.Floor(zoneDmg);
301 for (
int i2 = 0; i2 < item_count; i2++)
303 ItemBase spawn_result =
CreateOrgan(action_data.m_Player, bodyPosition, item_to_spawn, cfg_skinning_organ_class, action_data.m_MainItem);
307 float qtCoeff =
GetGame().ConfigGetFloat(cfg_skinning_organ_class +
"quantityCoef");
310 float avgDmgZones = 0;
311 for (
int c2 = 0; c2 < itemZones.Count(); c2++)
313 avgDmgZones += body.GetHealth01(itemZones[c2],
"Health");
316 avgDmgZones = avgDmgZones/itemZones.Count();
319 spawn_result.SetHealth01(
"",
"", avgDmgZones);
323 if ((item_to_spawn ==
"Lard") || (item_to_spawn ==
"Guts"))
325 if (body.IsKindOf(
"SurvivorBase"))
327 spawn_result.InsertAgent(
eAgents.BRAIN, 1);