33 override bool IsMan() {
return true; }
59 if (!m_OnItemAddedToHands)
68 if( !m_OnItemRemovedFromHands )
77 if( m_OnItemAddedToHands )
78 m_OnItemAddedToHands.Invoke( item,
this );
84 if( m_OnItemRemovedFromHands )
85 m_OnItemRemovedFromHands.Invoke( item,
this );
98 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveDropEntity input data not sent yet, cannot allow another input action");
143 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToHands input data not sent yet, cannot allow another input action");
165 if (!
GetGame().IsDedicatedServer() )
176 if (item.GetInventory().GetCurrentInventoryLocation(src_item))
178 if (itemInHands == null)
185 GetInventory().SwapEntities(mode, itemInHands, item);
203 Print(
"[inv] PredictiveMoveItemFromHandsToInventory input data not sent yet, cannot allow another input action");
218 if (
GetHumanInventory().GetEntityInHands().m_OldLocation.GetParent() && GetHumanInventory().GetEntityInHands().m_OldLocation.GetParent().GetHierarchyRootPlayer())
325 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToInventory input data not sent yet, cannot allow another input action");
364 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToCargo input data not sent yet, cannot allow another input action");
403 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityAsAttachment input data not sent yet, cannot allow another input action");
442 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityAsAttachmentEx input data not sent yet, cannot allow another input action");
481 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveSwapEntities input data not sent yet, cannot allow another input action");
487 if (need_j1 || need_j2)
506 syncDebugPrint(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ::SwapImpl(" +
typename.EnumToString(
InventoryMode, mode) +
") item1=" +
Object.GetDebugName(item1) +
" item2=" + item2.GetDebugName(
this));
508 Error(
"[inv] (Man@" +
this +
") SwapEntitiesImpl - cannot swap items!");
514 syncDebugPrint(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" SwapEntitiesImpl - cannot swap or forceswap");
529 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveForceSwapEntities input data not sent yet, cannot allow another input action");
535 if (need_j1 || need_j2)
554 syncDebugPrint(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ForceSwapImpl(" +
typename.EnumToString(
InventoryMode, mode) +
") item1=" +
Object.GetDebugName(item1) +
" item2=" + item2.GetDebugName(
this));
559 syncDebugPrint(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ForceSwapEntitiesImpl - cannot Forceswap");
574 Print(
"[inv] " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetInventory input data not sent yet, cannot allow another input action");
586 if( GetInventory().CanAddAttachment( item ) )
592 for(
int i = 0; i < item.GetInventory().GetSlotIdCount(); i++ )
594 int slot_id = item.GetInventory().GetSlotId(i);
595 EntityAI slot_item = GetInventory().FindAttachment( slot_id );
596 if( slot_item && GetInventory().CanSwapEntitiesEx( item, slot_item ) )
613 bool code = GetInventory().TakeEntityToTargetInventory(mode, target, flags, item);
629 Print(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetCargoEx input data not sent yet, cannot allow another input action");
652 bool code = GetInventory().TakeEntityToTargetCargoEx(mode, cargo, item, row, col);
668 Print(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetCargo input data not sent yet, cannot allow another input action");
711 Print(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetAttachmentEx input data not sent yet, cannot allow another input action");
734 bool code = GetInventory().TakeEntityAsTargetAttachmentEx(mode, target, item, slot);
750 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToTargetAttachment input data not sent yet, cannot allow another input action");
791 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeToDst input data not sent yet, cannot allow another input action");
void syncDebugPrint(string s)
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
FindInventoryLocationType
flags for searching locations in inventory
override string GetDebugName()
Gets the debug name for the ParticleManager.
proto native UIManager GetUIManager()
represents base for cargo storage for entities
protected bool SwapEntitiesImpl(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
proto native void StatInvokeUpdate()
override bool LocalTakeEntityToCargo(notnull EntityAI item)
override bool PredictiveTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
ScriptInvoker GetOnItemRemovedFromHands()
override bool LocalTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
void LocalTakeEntityToHands(EntityAI item)
proto native void SetSpeechRestricted(bool state)
Set speech restriction.
bool JunctureTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
as att ex juncture
override bool ServerTakeEntityAsAttachment(notnull EntityAI item)
override bool PredictiveTakeEntityToCargo(notnull EntityAI item)
proto native float StatGet(string name)
Gets counter value of the specified stat type.
bool JunctureForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
ForceSwap juncture.
proto native UAInterface GetInputInterface()
Returns player's input interface.
override bool ServerTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
void ServerTakeEntityToHands(EntityAI item)
bool JunctureTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
to target att juncture
void OnGameplayDataHandlerSync()
override bool CanDropEntity(notnull EntityAI item)
HumanInventory GetHumanInventory()
inventory
override bool ServerTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
bool ServerReplaceItemInHandsWithNewElsewhere(ReplaceItemWithNewLambdaBase lambda)
bool JunctureDropEntity(notnull EntityAI item)
drop juncture
override bool LocalTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
bool LocalForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
override bool PredictiveDropEntity(notnull EntityAI item)
protected bool TakeEntityToInventoryImpl(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
override bool LocalTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
protected bool TakeEntityToCargoImpl(InventoryMode mode, notnull EntityAI item)
bool ServerReplaceItemElsewhereWithNewInHands(ReplaceItemWithNewLambdaBase lambda)
proto native void StatUpdateByGivenPos(string name, vector pos)
Updates stat counter by given position.
proto native void SetMasterAttenuation(string masterAttenuation)
void PredictiveTakeEntityToHands(EntityAI item)
protected bool ReplaceItemInHandsWithNewImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
hand replace
proto void StatGetAsTime(string name, out string value)
Gets counter value as formatted time string of the specified stat type.
override bool PredictiveTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
bool JunctureTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
to inv juncture
bool JunctureSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
swap juncture
override bool PredictiveTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
override bool ServerTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
bool JunctureTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
to target att ex juncture
override bool PredictiveTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
proto native void SetFaceTexture(string texture_name)
Texture that is used on the Man's face and hands.
void SetInventorySoftLock(bool status)
void OnItemInHandsChanged()
proto native void StatSyncToClient()
protected bool ReplaceItemWithNewImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
!hand -> !hand replace
protected bool TakeEntityToTargetCargoExImpl(InventoryMode mode, notnull CargoBase cargo, notnull EntityAI item, int row, int col)
bool LocalReplaceItemInHandsWithNewElsewhere(ReplaceItemWithNewLambdaBase lambda)
override bool PredictiveTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
protected bool TakeEntityAsAttachmentImpl(InventoryMode mode, notnull EntityAI item)
void TakeEntityToHandsImpl(InventoryMode mode, EntityAI item)
proto native owned string GetMasterAttenuation()
bool ServerForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
protected bool TakeToDstImpl(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
override bool LocalTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
override bool PredictiveTakeEntityAsAttachment(notnull EntityAI item)
protected bool TakeEntityToTargetAttachmentExImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item, int slot)
override bool ServerTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
bool PhysicalPredictiveDropItem(EntityAI entity, bool heavy_item_only=true)
override bool LocalDropEntity(notnull EntityAI item)
proto native bool IsSoundInsideBuilding()
override bool PredictiveTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
void LocalDestroyEntityInHands()
bool IsInTransport()
returns true if man is in transport, false otherwise
void AddItemToDelete(EntityAI item)
override bool ServerTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
bool LocalSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
proto native void StatUpdateByPosition(string name)
Updates stat counter by player's actual position.
override bool IsHealthVisible()
void SetProcessUIWarning(bool state)
protected bool TakeEntityToTargetCargoImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
ScriptInvoker GetOnItemAddedToHands()
proto native void StatUpdate(string name, float value)
Updates stat counter with given value.
bool NeedInventoryJunctureFromServer(notnull EntityAI item, EntityAI currParent, EntityAI newParent)
void EEItemIntoHands(EntityAI item)
proto native owned string GetCurrentWeaponMode()
protected bool TakeEntityToTargetAttachmentImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
override bool LocalTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
proto void StatGetCounter(string name, out string value)
Gets counter value as string of the specified stat type.
bool LocalReplaceItemInHandsWithNew(ReplaceItemWithNewLambdaBase lambda)
override bool ServerTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
override bool ServerTakeEntityToCargo(notnull EntityAI item)
protected bool ReplaceItemInHandsWithNewElsewhereImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
hand replace2
bool JunctureTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
to dst juncture
protected ref ScriptInvoker m_OnItemRemovedFromHands
protected bool TakeEntityToTargetInventoryImpl(InventoryMode mode, notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
override bool ServerTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
void PredictiveMoveItemFromHandsToInventory()
proto native bool IsSpeechRestricted()
Check if player has resctricted speech.
override bool CanBeSkinned()
bool LocalReplaceItemWithNew(ReplaceItemWithNewLambdaBase lambda)
bool PredictiveTakeOrSwapAttachment(notnull EntityAI item)
protected bool ForceSwapEntitiesImpl(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
bool JunctureTakeEntityAsAttachment(notnull EntityAI item)
as att juncture
protected bool TakeEntityAsAttachmentExImpl(InventoryMode mode, notnull EntityAI item, int slot)
bool ServerReplaceItemInHandsWithNew(ReplaceItemWithNewLambdaBase lambda)
proto native void StatUpdateByTime(string name)
Updates stat counter by time.
proto native PlayerIdentity GetIdentity()
Returns player's identity.
proto native EntityAI GetDrivingVehicle()
Returns vehicle which this Man object is driving. If this Man object isn't as driver of any vehicle i...
override bool LocalTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
bool PredictiveSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
void StopDeathDarkeningEffect()
proto native bool IsCameraInsideVehicle()
override bool PredictiveTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
void JunctureDeleteItem(EntityAI item)
proto native bool StatRegister(string name)
proto native void SetFaceMaterial(string material_name)
Material that is used on the Man's face and hands.
override bool PredictiveTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
bool ServerSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
void UpdateInventoryMenu()
bool PredictiveForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
bool LocalReplaceItemElsewhereWithNewInHands(ReplaceItemWithNewLambdaBase lambda)
protected bool DropEntityImpl(InventoryMode mode, notnull EntityAI owner, notnull EntityAI item)
bool JunctureTakeEntityToCargo(notnull EntityAI item)
to cgo juncture
bool JunctureTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
to target inv juncture
override bool LocalTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
bool IsInventorySoftLocked()
protected bool ReplaceItemElsewhereWithNewInHandsImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
!hand replace -> hand
bool ServerReplaceItemWithNew(ReplaceItemWithNewLambdaBase lambda)
override bool LocalTakeEntityAsAttachment(notnull EntityAI item)
override bool LocalTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
void EEItemOutOfHands(EntityAI item)
protected ref ScriptInvoker m_OnItemAddedToHands
bool JunctureTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
to target cgo juncture
void JunctureTakeEntityToHands(notnull EntityAI item)
hand juncture
bool JunctureTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
to target cgo ex juncture
override bool ServerDropEntity(notnull EntityAI item)
script counterpart to engine's class Inventory
bool TakeEntityToCargo(InventoryMode mode, notnull EntityAI item)
moves item to cargo of this intentory
bool TakeEntityAsAttachment(InventoryMode mode, notnull EntityAI item)
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
inventory for plain man/human
override bool TakeEntityAsAttachmentEx(InventoryMode mode, notnull EntityAI item, int slot)
bool ReplaceItemInHandsWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
override bool TakeEntityToInventory(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
override bool DropEntity(InventoryMode mode, EntityAI owner, notnull EntityAI item)
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
bool ReplaceItemInHandsWithNewElsewhere(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
override bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
override bool ReplaceItemWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
proto native EntityAI GetEntityInHands()
bool ReplaceItemElsewhereWithNewInHands(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
override bool ForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
override bool LocalDestroyEntity(notnull EntityAI item)
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
proto native int GetSlot()
returns slot id if current type is Attachment
static string DumpToStringNullSafe(InventoryLocation loc)
The class that will be instanced (moddable)
base class for transformation operations (creating one item from another)
ScriptInvoker Class provide list of callbacks usage:
Base native class for all motorized wheeled vehicles.
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
proto native void SetFlags(ShapeFlags flags)