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);
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));
95 vector posHead = MiscGameplayFunctions.GetPlayerHeadPosition(player);
104 float item_quantity = 0;
108 g_Game.ConfigGetFloatArray(cfg_skinning_organ_class +
"quantityMinMax", quant_min_max);
109 g_Game.ConfigGetFloatArray(cfg_skinning_organ_class +
"quantityMinMaxCoef", quant_min_max_coef);
112 if (quant_min_max.Count() > 0)
114 float soft_skill_manipulated_value = (quant_min_max.Get(0)+ quant_min_max.Get(1)) / 2;
115 item_quantity =
Math.
RandomFloat(soft_skill_manipulated_value, quant_min_max.Get(1));
118 if (quant_min_max_coef.Count() > 0)
120 float coef =
Math.
RandomFloat(quant_min_max_coef.Get(0), quant_min_max_coef.Get(1));
121 item_quantity = added_item.GetQuantityMax() * coef;
124 if (
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"quantity") > 0)
125 item_quantity =
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"quantity");
127 if (
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"quantityCoef") > 0)
129 float coef2 =
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"quantityCoef");
130 item_quantity = added_item.GetQuantityMax() * coef2;
133 if (item_quantity > 0)
135 item_quantity =
Math.
Round(item_quantity);
140 float item_apply_tool_damage_coef =
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"transferToolDamageCoef");
142 if (item_apply_tool_damage_coef > 0)
144 float tool_dmg_coef = 1 - tool.GetHealth01();
145 float organ_dmg_coef = tool_dmg_coef * item_apply_tool_damage_coef;
146 added_item.DecreaseHealthCoef(organ_dmg_coef);
149 added_item.InsertAgent(
eAgents.SALMONELLA, 1);
155 super.OnFinishProgressClient(action_data);
164 g_Game.GetAnalyticsClient().OnActionFinishedGutDeer();
175 if (body.IsRestrained() && body.GetEntityInHands())
176 MiscGameplayFunctions.TransformRestrainItem(body.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;
243 child.SetLifetime(newLifetime);
244 body.GetInventory().DropEntity(
InventoryMode.SERVER, body, child);
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 g_Game.ConfigGetTextArray(cfgSkinningOrganClass +
"itemZones", itemZones);
286 g_Game.ConfigGetFloatArray(cfgSkinningOrganClass +
"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];
299 float transferedPartDmgCoef =
g_Game.ConfigGetFloat(cfgSkinningOrganClass +
"transferPartDamageCoef");
300 if (transferedPartDmgCoef > 0 && itemSpawnCount <= 0)
303 for (
int i2 = 0; i2 < itemSpawnCount; i2++)
311 if (transferedPartDmgCoef > 0)
313 float partHealth = 0;
314 float partMaxHealth = 0;
317 for (
int z2 = 0; z2 < itemZones.Count(); z2++)
319 partHealth = body.GetHealth(itemZones[z2],
"Health");
320 partMaxHealth = body.GetMaxHealth(itemZones[z2],
"Health");
324 if (partMaxHealth > 0)
326 float itemMaxHealth = spawnResult.GetMaxHealth(
"",
"Health");
327 float partHealthPercent = (partHealth / partMaxHealth) * 100;
328 float itemHealth = (itemMaxHealth / 100) * partHealthPercent;
330 if (transferedPartDmgCoef > 1)
331 transferedPartDmgCoef = 1;
333 float itemHealthCoef = itemHealth * transferedPartDmgCoef;
334 spawnResult.SetHealth(
"",
"Health", itemHealthCoef);
340 float qtCoeff =
g_Game.ConfigGetFloat(cfgSkinningOrganClass +
"quantityCoef");
343 float avgDmgZones = 0;
344 for (
int c2 = 0; c2 < itemZones.Count(); c2++)
346 avgDmgZones += body.GetHealth01(itemZones[c2],
"Health");
349 avgDmgZones = avgDmgZones/itemZones.Count();
350 spawnResult.SetHealth01(
"",
"", avgDmgZones);
354 if (body.CanHaveTemperature() && spawnResult.CanHaveTemperature())
356 spawnResult.SetTemperatureDirect(body.GetTemperature());
357 spawnResult.SetFrozen(body.GetIsFrozen());
361 if ((itemToSpawn ==
"Lard") || (itemToSpawn ==
"Guts"))
363 if (body.IsKindOf(
"SurvivorBase"))
365 spawnResult.InsertAgent(
eAgents.BRAIN, 1);
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void CreateConditionComponents()
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
void DropInventoryItems(PlayerBase body, float newLifetime)
vector GetRandomPos(vector body_pos)
void HandlePlayerBody(ActionData action_data)
This section drops all clothes (and attachments) from the dead player before deleting their body.
ActionSkinningCB ActionContinuousBaseCB ActionSkinning()
ItemBase CreateOrgan(PlayerBase player, vector body_pos, string item_to_spawn, string cfg_skinning_organ_class, ItemBase tool)
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
proto native CEApi GetCEApi()
Get the CE API.
const int ECE_PLACE_ON_SURFACE
PluginBase GetPlugin(typename plugin_type)
void OnFinishProgressClient(ActionData action_data)
void OnFinishProgressServer(ActionData action_data)
ref ActionTarget m_Target
override void CreateActionComponent()
override bool TrackNaturalInstinctsAchievement()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Super root of all classes in Enforce script.
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.
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
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
const float DAMAGE_RUINED_VALUE
const float DAMAGE_DAMAGED_VALUE
const float DAMAGE_WORN_VALUE
const int STATE_BADLY_DAMAGED
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float Floor(float f)
Returns floor of value.
static proto float Round(float f)
Returns mathematical round of value.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].