25 RplComponent.DeleteRplEntity(item,
false);
31 ref SCR_SalineMovedCallback m_SalineMovedCallback =
new SCR_SalineMovedCallback();
40 bool AddSalineBagToSlot(IEntity target,
ECharacterHitZoneGroup eHitZoneGroup, IEntity salineBag,
float itemRegenerationDuration)
42 if (!target || !salineBag)
45 RplComponent rplComp = RplComponent.Cast(target.FindComponent(RplComponent));
46 if (rplComp && rplComp.IsProxy())
50 if (!SalineStorageComp)
53 SCR_InventoryStorageManagerComponent storageMan = SCR_InventoryStorageManagerComponent.Cast(
GetOwner().FindComponent(SCR_InventoryStorageManagerComponent));
58 for (
int i, count = SalineStorageComp.GetSlotsCount(); i < count; i++)
61 if (!salineTargetSlot)
64 if (salineTargetSlot.GetAssociatedHZGroup() != eHitZoneGroup)
67 if (salineTargetSlot.GetItem(i) == salineBag)
70 if (salineTargetSlot.GetItem(i))
72 Debug.Error(
"salineBagSlot already contained some item");
79 if (!salineTargetSlot)
82 SCR_CharacterInventoryStorageComponent charInventoryStorageComp = SCR_CharacterInventoryStorageComponent.Cast(
GetOwner().FindComponent(SCR_CharacterInventoryStorageComponent));
83 if (!charInventoryStorageComp)
86 m_SalineMovedCallback.m_SalineBag = salineBag;
87 m_SalineMovedCallback.m_CharInventoryStorageComp = charInventoryStorageComp;
88 m_SalineMovedCallback.m_fItemRegenerationDuration = itemRegenerationDuration;
90 if (storageMan.TryMoveItemToStorage(salineBag, SalineStorageComp, salineTargetSlot.GetID(), m_SalineMovedCallback))
97 if (!invComp.GetParentSlot())
99 if (storageMan.TryInsertItemInStorage(salineBag, SalineStorageComp, salineTargetSlot.GetID(), m_SalineMovedCallback))
104 if (storageMan.TryMoveItemToStorage(salineBag, SalineStorageComp, salineTargetSlot.GetID(), m_SalineMovedCallback))
112 override void OnAddedToSlot(IEntity item,
int slotID)
114 ChimeraCharacter
char = ChimeraCharacter.Cast(
GetOwner());
126 damageMgr.SetSalineBaggedGroup(salineSlot.GetAssociatedHZGroup(),
true);
130 override void OnRemovedFromSlot(IEntity item,
int slotID)
132 ChimeraCharacter
char = ChimeraCharacter.Cast(
GetOwner());
144 damageMgr.SetSalineBaggedGroup(salineSlot.GetAssociatedHZGroup(),
false);
148 override protected bool ShouldPreviewAttachedItems()