59 if ((container.GetLiquidType() &
LIQUID_WATER) && container.GetQuantity() > 0 && !container.GetIsFrozen() && rags.GetHealthLevel() > 1)
74 float rags_health = rags.GetHealth(
"",
"");
75 int rags_quantity = rags.GetQuantity();
77 float rags_combined_damage = (100 - rags_health) * rags_quantity;
79 int liquid_quantity = container.GetQuantity();
80 int liquid_required = rags_combined_damage * 2;
85 if( liquid_quantity > liquid_required )
87 container.AddQuantity(-liquid_required);
88 heal = rags_combined_damage / rags_quantity;
93 used_ratio = liquid_quantity / liquid_required;
94 heal = (rags_combined_damage / rags_quantity) * used_ratio;
97 heal =
Math.
Clamp(heal, 0, (70 - rags_health));
98 rags.AddHealth(
"",
"",heal);
Super root of all classes in Enforce script.
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
bool m_IngredientDestroy[MAX_NUMBER_OF_INGREDIENTS]
override bool CanDo(ItemBase ingredients[], PlayerBase player)
bool m_IngredientUseSoftSkills[MAX_NUMBER_OF_INGREDIENTS]
override void Do(ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
float m_IngredientAddHealth[MAX_NUMBER_OF_INGREDIENTS]
float m_IngredientSetHealth[MAX_NUMBER_OF_INGREDIENTS]
float m_MinQuantityIngredient[MAX_NUMBER_OF_INGREDIENTS]
float m_MaxQuantityIngredient[MAX_NUMBER_OF_INGREDIENTS]
float m_IngredientAddQuantity[MAX_NUMBER_OF_INGREDIENTS]
float m_MinDamageIngredient[MAX_NUMBER_OF_INGREDIENTS]
float m_MaxDamageIngredient[MAX_NUMBER_OF_INGREDIENTS]
void InsertIngredient(int index, string ingredient, DayZPlayerConstants uid=DayZPlayerConstants.CMD_ACTIONFB_CRAFTING)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.