663 {
664 if (pItem)
665 {
667 bool isParentWet = false;
668 bool parentContainsLiquid = false;
669 InventoryLocation iLoc = new InventoryLocation();
670
671 if (pItem.GetInventory().GetCurrentInventoryLocation(iLoc))
672 {
674 if (parent)
675 {
677 if (parentItem)
678 {
679 if (parentItem.GetWet() >= GameConstants.STATE_SOAKING_WET)
680 isParentWet = true;
681
682 if ((parentItem.GetLiquidType() != 0) && (parentItem.GetQuantity() > 0))
683 parentContainsLiquid = true;
684 }
685 else
686 isParentWet = true;
687
690 }
691 }
692
693 if (isParentWet || parentContainsLiquid)
694 {
695 float soakingCoef = 0;
696 if (parentContainsLiquid)
697 {
698 soakingCoef = pItem.GetSoakingIncrement("parentWithLiquid");
699 LogDryWetProcess(
string.Format(
"%1 (soak coef=%2/s, current wetness=%3) [parent contains liquid]", pItem.GetDisplayName(), soakingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
700 }
701 else if (isParentWet && parentItem)
702 {
703 if (pItem.GetWet() < parentItem.GetWet())
705
706 LogDryWetProcess(
string.Format(
"%1 (soak coef=%2/s, current wetness=%3) [parent wet]", pItem.GetDisplayName(), soakingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
707 }
708 else
709 {
711 LogDryWetProcess(
string.Format(
"%1 (soak coef=%2/s, current wetness=%3) [normal]", pItem.GetDisplayName(), soakingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
712 }
713
714 pItem.AddWet(soakingCoef);
715
716 if (pItem.GetInventory().GetCargo())
717 {
718 int inItemCount = pItem.GetInventory().GetCargo().GetItemCount();
719 for (int i = 0; i < inItemCount; ++i)
720 {
722 if (Class.CastTo(inItem, pItem.GetInventory().GetCargo().GetItem(i)))
724 }
725 }
726
727 int attCount = pItem.GetInventory().AttachmentCount();
728 if (attCount > 0)
729 {
730 for (int attIdx = 0; attIdx < attCount; ++attIdx)
731 {
732 EntityAI attachment = pItem.GetInventory().GetAttachmentFromIndex(attIdx);
734 if (itemAtt)
736 }
737 }
738 }
739 }
740 }
class GP5GasMask extends MaskBase ItemBase
void ApplyWetnessToItem(ItemBase pItem)
void LogDryWetProcess(string message, bool indented=false)
proto native EntityAI GetParent()
returns parent of current inventory location