2283 {
2285 return;
2286
2287 if (!IsMagazine() && other_item)
2288 {
2290 if (quantity_used != 0)
2291 {
2292 float hp1 = GetHealth01("","");
2293 float hp2 = other_item.GetHealth01("","");
2294 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
2295 hpResult = hpResult / (
GetQuantity() + quantity_used);
2296
2297 hpResult *= GetMaxHealth();
2298 Math.Round(hpResult);
2299 SetHealth("", "Health", hpResult);
2300
2302 other_item.AddQuantity(-quantity_used);
2303 }
2304 }
2306 }
override float GetQuantity()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
void OnCombine(ItemBase other_item)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)