8 proto native
EntityAI GetDrivingVehicle();
10 proto native owned
string GetCurrentWeaponMode();
13 proto native
void SetSpeechRestricted(
bool state);
15 proto native
bool IsSpeechRestricted();
18 proto native
void SetFaceTexture(
string texture_name);
20 proto native
void SetFaceMaterial(
string material_name);
22 proto native
bool IsSoundInsideBuilding();
23 proto native
bool IsCameraInsideVehicle();
25 proto native owned
string GetMasterAttenuation();
26 proto native
void SetMasterAttenuation(
string masterAttenuation);
38 override bool IsHealthVisible()
74 if (!m_OnItemAddedToHands)
77 return m_OnItemAddedToHands;
83 if( !m_OnItemRemovedFromHands )
86 return m_OnItemRemovedFromHands;
92 if( m_OnItemAddedToHands )
93 m_OnItemAddedToHands.Invoke( item,
this );
99 if( m_OnItemRemovedFromHands )
100 m_OnItemRemovedFromHands.Invoke( item,
this );
104 bool JunctureDropEntity (notnull
EntityAI item)
109 override bool PredictiveDropEntity (notnull
EntityAI item)
113 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveDropEntity input data not sent yet, cannot allow another input action");
117 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(),
this))
118 return JunctureDropEntity(item);
123 override bool LocalDropEntity (notnull
EntityAI item)
128 override bool ServerDropEntity (notnull
EntityAI item)
136 bool code = GetHumanInventory().DropEntity(mode, owner, item);
137 UpdateInventoryMenu();
142 override bool CanDropEntity (notnull
EntityAI item) {
return true; }
146 bool NeedInventoryJunctureFromServer (notnull
EntityAI item,
EntityAI currParent,
EntityAI newParent) {
return false; }
149 void JunctureTakeEntityToHands (notnull
EntityAI item)
154 void PredictiveTakeEntityToHands (
EntityAI item)
158 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToHands input data not sent yet, cannot allow another input action");
162 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(),
this))
163 JunctureTakeEntityToHands(item);
168 void LocalTakeEntityToHands (
EntityAI item)
173 void ServerTakeEntityToHands (
EntityAI item)
180 if (!
GetGame().IsDedicatedServer() )
183 il.SetHands(
this, item);
188 EntityAI itemInHands = GetHumanInventory().GetEntityInHands();
191 if (item.GetInventory().GetCurrentInventoryLocation(src_item))
193 if (itemInHands ==
null)
196 hand_dst.SetHands(
this, item);
197 GetHumanInventory().TakeToDst(mode, src_item, hand_dst);
199 else if (GetHumanInventory().CanSwapEntitiesEx(itemInHands, item))
200 GetInventory().SwapEntities(mode, itemInHands, item);
201 UpdateInventoryMenu();
206 void LocalDestroyEntityInHands ()
208 if (
LogManager.IsSyncLogEnable())
syncDebugPrint(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" Destroy IH=" + GetHumanInventory().GetEntityInHands());
209 GetHumanInventory().LocalDestroyEntity(GetHumanInventory().GetEntityInHands());
210 UpdateInventoryMenu();
213 void PredictiveMoveItemFromHandsToInventory ()
218 Print(
"[inv] PredictiveMoveItemFromHandsToInventory input data not sent yet, cannot allow another input action");
224 if (NeedInventoryJunctureFromServer( GetHumanInventory().GetEntityInHands(),
this,
this))
228 if (GetHumanInventory().GetEntityInHands().m_OldLocation && GetHumanInventory().GetEntityInHands().m_OldLocation.IsValid())
231 GetHumanInventory().GetEntityInHands().GetInventory().GetCurrentInventoryLocation(invLoc);
233 if (GetHumanInventory().GetEntityInHands().m_OldLocation.GetParent() && GetHumanInventory().GetEntityInHands().m_OldLocation.GetParent().GetHierarchyRootPlayer())
235 if (GetHumanInventory().LocationCanMoveEntity(invLoc, GetHumanInventory().GetEntityInHands().m_OldLocation))
237 if (GetHumanInventory().
TakeToDst(invMode, invLoc,GetHumanInventory().GetEntityInHands().m_OldLocation))
239 UpdateInventoryMenu();
247 UpdateInventoryMenu();
254 bool code = GetHumanInventory().ReplaceItemWithNew(mode, lambda);
255 UpdateInventoryMenu();
274 bool code = GetHumanInventory().ReplaceItemElsewhereWithNewInHands(mode, lambda);
275 UpdateInventoryMenu();
281 return ReplaceItemElsewhereWithNewInHandsImpl(
InventoryMode.LOCAL, lambda);
286 return ReplaceItemElsewhereWithNewInHandsImpl(
InventoryMode.SERVER, lambda);
294 bool code = GetHumanInventory().ReplaceItemInHandsWithNew(mode, lambda);
295 UpdateInventoryMenu();
301 return ReplaceItemInHandsWithNewImpl(
InventoryMode.LOCAL, lambda);
306 return ReplaceItemInHandsWithNewImpl(
InventoryMode.SERVER, lambda);
313 if (
LogManager.IsSyncLogEnable())
syncDebugPrint(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" Replace HND->elsewhere lambda=" + lambda.DumpToString());
314 bool code = GetHumanInventory().ReplaceItemInHandsWithNewElsewhere(mode, lambda);
315 UpdateInventoryMenu();
321 return ReplaceItemInHandsWithNewElsewhereImpl(
InventoryMode.LOCAL, lambda);
326 return ReplaceItemInHandsWithNewElsewhereImpl(
InventoryMode.SERVER, lambda);
333 return TakeEntityToInventoryImpl(
InventoryMode.JUNCTURE, flags, item);
340 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToInventory input data not sent yet, cannot allow another input action");
344 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(),
this))
345 return JunctureTakeEntityToInventory(flags, item);
347 return TakeEntityToInventoryImpl(
InventoryMode.PREDICTIVE, flags, item);
352 return TakeEntityToInventoryImpl(
InventoryMode.LOCAL, flags, item);
357 return TakeEntityToInventoryImpl(
InventoryMode.SERVER, flags, item);
363 bool code = GetHumanInventory().TakeEntityToInventory(mode, flags, item);
364 UpdateInventoryMenu();
370 bool JunctureTakeEntityToCargo (notnull
EntityAI item)
375 override bool PredictiveTakeEntityToCargo (notnull
EntityAI item)
379 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToCargo input data not sent yet, cannot allow another input action");
383 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(),
this))
384 return JunctureTakeEntityToCargo(item);
386 return TakeEntityToCargoImpl(
InventoryMode.PREDICTIVE, item);
389 override bool LocalTakeEntityToCargo (notnull
EntityAI item)
394 override bool ServerTakeEntityToCargo (notnull
EntityAI item)
402 bool code = GetHumanInventory().TakeEntityToCargo(mode, item);
403 UpdateInventoryMenu();
409 bool JunctureTakeEntityAsAttachment (notnull
EntityAI item)
411 return TakeEntityAsAttachmentImpl(
InventoryMode.JUNCTURE, item);
414 override bool PredictiveTakeEntityAsAttachment (notnull
EntityAI item)
418 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityAsAttachment input data not sent yet, cannot allow another input action");
422 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(),
this))
423 return JunctureTakeEntityAsAttachment(item);
425 return TakeEntityAsAttachmentImpl(
InventoryMode.PREDICTIVE, item);
428 override bool LocalTakeEntityAsAttachment (notnull
EntityAI item)
430 return TakeEntityAsAttachmentImpl(
InventoryMode.LOCAL, item);
433 override bool ServerTakeEntityAsAttachment (notnull
EntityAI item)
435 return TakeEntityAsAttachmentImpl(
InventoryMode.SERVER, item);
441 bool code = GetHumanInventory().TakeEntityAsAttachment(mode, item);
442 UpdateInventoryMenu();
448 bool JunctureTakeEntityAsAttachmentEx (notnull
EntityAI item,
int slot)
450 return TakeEntityAsAttachmentExImpl(
InventoryMode.JUNCTURE, item, slot);
453 override bool PredictiveTakeEntityAsAttachmentEx (notnull
EntityAI item,
int slot)
457 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityAsAttachmentEx input data not sent yet, cannot allow another input action");
461 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(),
this))
462 return JunctureTakeEntityAsAttachmentEx(item, slot);
464 return TakeEntityAsAttachmentExImpl(
InventoryMode.PREDICTIVE, item, slot);
467 override bool LocalTakeEntityAsAttachmentEx (notnull
EntityAI item,
int slot)
469 return TakeEntityAsAttachmentExImpl(
InventoryMode.LOCAL, item, slot);
472 override bool ServerTakeEntityAsAttachmentEx (notnull
EntityAI item,
int slot)
474 return TakeEntityAsAttachmentExImpl(
InventoryMode.SERVER, item, slot);
480 bool code = GetHumanInventory().TakeEntityAsAttachmentEx(mode, item, slot);
481 UpdateInventoryMenu();
489 return SwapEntitiesImpl(
InventoryMode.JUNCTURE, item1, item2);
492 bool PredictiveSwapEntities (notnull
EntityAI item1, notnull
EntityAI item2)
496 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveSwapEntities input data not sent yet, cannot allow another input action");
500 bool need_j1 = NeedInventoryJunctureFromServer(item1, item1.GetHierarchyParent(), item2.GetHierarchyParent());
501 bool need_j2 = NeedInventoryJunctureFromServer(item2, item2.GetHierarchyParent(), item1.GetHierarchyParent());
502 if (need_j1 || need_j2)
503 return SwapEntitiesImpl(
InventoryMode.JUNCTURE, item1, item2);
505 return SwapEntitiesImpl(
InventoryMode.PREDICTIVE, item1, item2);
523 Error(
"[inv] (Man@" +
this +
") SwapEntitiesImpl - cannot swap items!");
525 code = GetHumanInventory().SwapEntities(mode, item1, item2);
527 UpdateInventoryMenu();
537 return ForceSwapEntitiesImpl(
InventoryMode.JUNCTURE, item1, item2, item2_dst);
544 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveForceSwapEntities input data not sent yet, cannot allow another input action");
548 bool need_j1 = NeedInventoryJunctureFromServer(item1, item1.GetHierarchyParent(), item2.GetHierarchyParent());
549 bool need_j2 = NeedInventoryJunctureFromServer(item2, item2.GetHierarchyParent(), item1.GetHierarchyParent());
550 if (need_j1 || need_j2)
551 return ForceSwapEntitiesImpl(
InventoryMode.JUNCTURE, item1, item2, item2_dst);
553 return ForceSwapEntitiesImpl(
InventoryMode.PREDICTIVE, item1, item2, item2_dst);
558 return ForceSwapEntitiesImpl(
InventoryMode.LOCAL, item1, item2, item2_dst);
563 return ForceSwapEntitiesImpl(
InventoryMode.SERVER, item1, item2, item2_dst);
570 code = GetHumanInventory().ForceSwapEntities(mode, item1, item2, item2_dst);
572 UpdateInventoryMenu();
582 return TakeEntityToTargetInventoryImpl(
InventoryMode.JUNCTURE, target, flags, item);
589 Print(
"[inv] " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetInventory input data not sent yet, cannot allow another input action");
593 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), target))
594 return JunctureTakeEntityToTargetInventory(target, flags, item);
596 return TakeEntityToTargetInventoryImpl(
InventoryMode.PREDICTIVE, target, flags, item);
599 bool PredictiveTakeOrSwapAttachment( notnull
EntityAI item )
601 if( GetInventory().CanAddAttachment( item ) )
603 return PredictiveTakeEntityAsAttachment( item );
607 for(
int i = 0; i < item.GetInventory().GetSlotIdCount(); i++ )
609 int slot_id = item.GetInventory().GetSlotId(i);
610 EntityAI slot_item = GetInventory().FindAttachment( slot_id );
611 if( slot_item && GetInventory().CanSwapEntitiesEx( item, slot_item ) )
613 return PredictiveSwapEntities(item, slot_item);
622 return TakeEntityToTargetInventoryImpl(
InventoryMode.LOCAL, target, flags, item);
628 bool code = GetInventory().TakeEntityToTargetInventory(mode, target, flags, item);
629 UpdateInventoryMenu();
635 bool JunctureTakeEntityToTargetCargoEx (notnull
CargoBase cargo, notnull
EntityAI item,
int row,
int col)
637 return TakeEntityToTargetCargoExImpl(
InventoryMode.JUNCTURE, cargo, item, row, col);
640 override bool PredictiveTakeEntityToTargetCargoEx (notnull
CargoBase cargo, notnull
EntityAI item,
int row,
int col)
644 Print(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetCargoEx input data not sent yet, cannot allow another input action");
648 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), cargo.GetCargoOwner()))
649 return JunctureTakeEntityToTargetCargoEx(cargo, item, row, col);
651 return TakeEntityToTargetCargoExImpl(
InventoryMode.PREDICTIVE, cargo, item, row, col);
654 override bool LocalTakeEntityToTargetCargoEx (notnull
CargoBase cargo, notnull
EntityAI item,
int row,
int col)
656 return TakeEntityToTargetCargoExImpl(
InventoryMode.LOCAL, cargo, item, row, col);
659 override bool ServerTakeEntityToTargetCargoEx (notnull
CargoBase cargo, notnull
EntityAI item,
int row,
int col)
661 return TakeEntityToTargetCargoExImpl(
InventoryMode.SERVER, cargo, item, row, col);
667 bool code = GetInventory().TakeEntityToTargetCargoEx(mode, cargo, item, row, col);
668 UpdateInventoryMenu();
674 bool JunctureTakeEntityToTargetCargo (notnull
EntityAI target, notnull
EntityAI item)
676 return TakeEntityToTargetCargoImpl(
InventoryMode.JUNCTURE, target, item);
679 override bool PredictiveTakeEntityToTargetCargo (notnull
EntityAI target, notnull
EntityAI item)
683 Print(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetCargo input data not sent yet, cannot allow another input action");
687 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), target))
688 return JunctureTakeEntityToTargetCargo(target, item);
690 return TakeEntityToTargetCargoImpl(
InventoryMode.PREDICTIVE, target, item);
693 override bool LocalTakeEntityToTargetCargo (notnull
EntityAI target, notnull
EntityAI item)
695 return TakeEntityToTargetCargoImpl(
InventoryMode.LOCAL, target, item);
698 override bool ServerTakeEntityToTargetCargo (notnull
EntityAI target, notnull
EntityAI item)
701 return TakeEntityToTargetCargoImpl(
InventoryMode.SERVER, target, item);
703 return TakeEntityToTargetCargoImpl(
InventoryMode.SERVER, target, item);
711 UpdateInventoryMenu();
717 bool JunctureTakeEntityToTargetAttachmentEx (notnull
EntityAI target, notnull
EntityAI item,
int slot)
719 return TakeEntityToTargetAttachmentExImpl(
InventoryMode.JUNCTURE, target, item, slot);
722 override bool PredictiveTakeEntityToTargetAttachmentEx (notnull
EntityAI target, notnull
EntityAI item,
int slot)
726 Print(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetAttachmentEx input data not sent yet, cannot allow another input action");
730 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), target))
731 return JunctureTakeEntityToTargetAttachmentEx(target, item, slot);
733 return TakeEntityToTargetAttachmentExImpl(
InventoryMode.PREDICTIVE, target, item, slot);
736 override bool LocalTakeEntityToTargetAttachmentEx (notnull
EntityAI target, notnull
EntityAI item,
int slot)
738 return TakeEntityToTargetAttachmentExImpl(
InventoryMode.LOCAL, target, item, slot);
741 override bool ServerTakeEntityToTargetAttachmentEx (notnull
EntityAI target, notnull
EntityAI item,
int slot)
743 return TakeEntityToTargetAttachmentExImpl(
InventoryMode.SERVER, target, item, slot);
749 bool code = GetInventory().TakeEntityAsTargetAttachmentEx(mode, target, item, slot);
750 UpdateInventoryMenu();
756 bool JunctureTakeEntityToTargetAttachment (notnull
EntityAI target, notnull
EntityAI item)
758 return TakeEntityToTargetAttachmentImpl(
InventoryMode.JUNCTURE, target, item);
761 override bool PredictiveTakeEntityToTargetAttachment (notnull
EntityAI target, notnull
EntityAI item)
765 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToTargetAttachment input data not sent yet, cannot allow another input action");
769 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), target))
770 return JunctureTakeEntityToTargetAttachment(target, item);
772 return TakeEntityToTargetAttachmentImpl(
InventoryMode.PREDICTIVE, target, item);
775 override bool LocalTakeEntityToTargetAttachment (notnull
EntityAI target, notnull
EntityAI item)
777 return TakeEntityToTargetAttachmentImpl(
InventoryMode.LOCAL, target, item);
780 override bool ServerTakeEntityToTargetAttachment (notnull
EntityAI target, notnull
EntityAI item)
782 return TakeEntityToTargetAttachmentImpl(
InventoryMode.SERVER, target, item);
790 return TakeEntityToTargetAttachmentExImpl(mode, target, item, il.GetSlot());
806 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeToDst input data not sent yet, cannot allow another input action");
810 if (NeedInventoryJunctureFromServer(src.GetItem(), src.GetParent(), dst.GetParent()))
811 return JunctureTakeToDst(src, dst);
829 bool code = GetHumanInventory().TakeToDst(mode, src, dst);
830 UpdateInventoryMenu();
836 void JunctureDeleteItem(
EntityAI item)
846 void UpdateInventoryMenu();
853 proto native
bool StatRegister(
string name );
858 proto native
float StatGet(
string name );
864 proto
void StatGetCounter(
string name, out
string value );
870 proto
void StatGetAsTime(
string name, out
string value );
876 proto native
void StatUpdate(
string name,
float value );
882 proto native
void StatUpdateByTime(
string name );
888 proto native
void StatUpdateByPosition(
string name );
894 proto native
void StatUpdateByGivenPos(
string name,
vector pos );
898 proto native
void StatInvokeUpdate();
902 proto native
void StatSyncToClient();
905 bool IsInventorySoftLocked()
910 void SetInventorySoftLock(
bool status);
918 void StopDeathDarkeningEffect();
919 bool PhysicalPredictiveDropItem(
EntityAI entity,
bool heavy_item_only =
true);
920 void SetProcessUIWarning(
bool state);
921 void OnGameplayDataHandlerSync();