5430{
5432 {
5433 return true;
5434 }
5435};
5436
5437
5438
5440{
5444
5446
5449
5450
5451
5452
5453
5462
5468
5473
5478
5499 protected bool m_IsResultOfSplit
5500
5502
5507
5508
5509
5511
5515
5516
5517
5519
5522
5523
5524
5530
5531
5539
5542
5543
5545
5546
5548
5549
5554
5555
5560
5561
5563
5564
5566 {
5571
5572 if (!
GetGame().IsDedicatedServer())
5573 {
5575 {
5577
5579 {
5581 }
5582 }
5583
5586 }
5587
5588 m_OldLocation = null;
5589
5591 {
5593 }
5594
5595 if (ConfigIsExisting("headSelectionsToHide"))
5596 {
5599 }
5600
5602 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5603 {
5605 }
5606
5608
5609 m_IsResultOfSplit = false;
5610
5612 }
5613
5615 {
5616 super.InitItemVariables();
5617
5623 m_Count = ConfigGetInt(
"count");
5624
5627
5632
5635
5640
5652
5656
5657
5660 if (ConfigIsExisting("canBeSplit"))
5661 {
5664 }
5665
5667 if (ConfigIsExisting("itemBehaviour"))
5669
5670
5673 RegisterNetSyncVariableInt("m_VarLiquidType");
5674 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5675
5676 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5677 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5678 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5679
5680 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5681 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5682 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5683 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5684
5685 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5686 RegisterNetSyncVariableBool("m_IsTakeable");
5687 RegisterNetSyncVariableBool("m_IsHologram");
5688
5691 {
5694 }
5695
5697
5699 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5701
5702 }
5703
5705 {
5707 }
5708
5710 {
5713 {
5718 }
5719 }
5720
5721 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5722 {
5724 {
5727 }
5728
5730 }
5731
5733 {
5739 }
5740
5742
5744 {
5746
5747 if (!action)
5748 {
5749 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5750 return;
5751 }
5752
5754 if (!ai)
5755 {
5757 return;
5758 }
5759
5761 if (!action_array)
5762 {
5763 action_array = new array<ActionBase_Basic>;
5765 }
5766 if (LogManager.IsActionLogEnable())
5767 {
5768 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5769 }
5770
5771 if (action_array.Find(action) != -1)
5772 {
5773 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5774 }
5775 else
5776 {
5777 action_array.Insert(action);
5778 }
5779 }
5780
5782 {
5784 ActionBase action = player.GetActionManager().GetAction(actionName);
5787
5788 if (action_array)
5789 {
5790 action_array.RemoveItem(action);
5791 }
5792 }
5793
5794
5795
5797 {
5798 ActionOverrideData overrideData = new ActionOverrideData();
5802
5804 if (!actionMap)
5805 {
5808 }
5809
5810 actionMap.Insert(this.
Type(), overrideData);
5811
5812 }
5813
5815
5817
5818
5820 {
5823
5826
5827 string config_to_search = "CfgVehicles";
5828 string muzzle_owner_config;
5829
5831 {
5832 if (IsInherited(Weapon))
5833 config_to_search = "CfgWeapons";
5834
5835 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5836
5837 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5838
5840
5841 if (config_OnFire_subclass_count > 0)
5842 {
5843 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5844
5845 for (int i = 0; i < config_OnFire_subclass_count; i++)
5846 {
5847 string particle_class = "";
5849 string config_OnFire_entry = config_OnFire_class + particle_class;
5850 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5851 WPOF_array.Insert(WPOF);
5852 }
5853
5854
5856 }
5857 }
5858
5860 {
5861 config_to_search = "CfgWeapons";
5862 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5863
5864 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5865
5867
5868 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5869 {
5870 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5871
5872 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5873 {
5874 string particle_class2 = "";
5876 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5877 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5878 WPOBE_array.Insert(WPOBE);
5879 }
5880
5881
5883 }
5884 }
5885 }
5886
5887
5889 {
5892
5894 {
5895 string config_to_search = "CfgVehicles";
5896
5897 if (IsInherited(Weapon))
5898 config_to_search = "CfgWeapons";
5899
5900 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5901 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5902
5903 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5904 {
5905
5907
5909 {
5911 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5913 return;
5914 }
5915
5918
5919
5920
5922 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5923
5924 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5925 {
5926 string particle_class = "";
5928 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5930
5931 if (entry_type == CT_CLASS)
5932 {
5933 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5934 WPOOH_array.Insert(WPOF);
5935 }
5936 }
5937
5938
5940 }
5941 }
5942 }
5943
5945 {
5947 }
5948
5950 {
5952 {
5954
5957
5960
5961 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5962 }
5963 }
5964
5966 {
5968 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5969
5971 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5972
5974 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5975
5977 {
5979 }
5980 }
5981
5983 {
5985 }
5986
5988 {
5991 else
5993
5995 {
5998 }
5999 else
6000 {
6003
6006 }
6007
6009 }
6010
6012 {
6014 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6015 }
6016
6018 {
6020 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6022 }
6023
6025 {
6027 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6028 }
6029
6031 {
6034
6035 OverheatingParticle OP = new OverheatingParticle();
6040
6042 }
6043
6045 {
6048
6049 return -1;
6050 }
6051
6053 {
6055 {
6058
6059 for (int i = count; i > 0; --i)
6060 {
6061 int id = i - 1;
6064
6067
6068 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6069 {
6070 if (p)
6071 {
6074 }
6075 }
6076 }
6077 }
6078 }
6079
6081 {
6083 {
6085 {
6086 int id = i - 1;
6088
6089 if (OP)
6090 {
6092
6093 if (p)
6094 {
6096 }
6097
6098 delete OP;
6099 }
6100 }
6101
6104 }
6105 }
6106
6109 {
6110 return 0.0;
6111 }
6112
6113
6115 {
6116 return 250;
6117 }
6118
6120 {
6121 return 0;
6122 }
6123
6126 {
6128 return true;
6129
6130 return false;
6131 }
6132
6135 {
6138
6140 {
6142 }
6143 else
6144 {
6145
6147 }
6148
6150 }
6151
6158 {
6159 return -1;
6160 }
6161
6162
6163
6164
6166 {
6168 {
6170 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6171
6172 if (r_index >= 0)
6173 {
6174 InventoryLocation r_il = new InventoryLocation;
6175 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6176
6177 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6180 {
6181 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6182 }
6184 {
6185 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6186 }
6187
6188 }
6189
6190 player.GetHumanInventory().ClearUserReservedLocation(this);
6191 }
6192
6195 }
6196
6197
6198
6199
6201 {
6202 return ItemBase.m_DebugActionsMask;
6203 }
6204
6206 {
6207 return ItemBase.m_DebugActionsMask & mask;
6208 }
6209
6211 {
6212 ItemBase.m_DebugActionsMask = mask;
6213 }
6214
6216 {
6217 ItemBase.m_DebugActionsMask |= mask;
6218 }
6219
6221 {
6222 ItemBase.m_DebugActionsMask &= ~mask;
6223 }
6224
6226 {
6228 {
6230 }
6231 else
6232 {
6234 }
6235 }
6236
6237
6239 {
6240 if (GetEconomyProfile())
6241 {
6242 float q_max = GetEconomyProfile().GetQuantityMax();
6243 if (q_max > 0)
6244 {
6245 float q_min = GetEconomyProfile().GetQuantityMin();
6246 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6247
6249 {
6250 ComponentEnergyManager comp = GetCompEM();
6252 {
6254 }
6255 }
6257 {
6259
6260 }
6261
6262 }
6263 }
6264 }
6265
6268 {
6269 EntityAI parent = GetHierarchyParent();
6270
6271 if (parent)
6272 {
6273 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6274 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6275 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6276 }
6277 }
6278
6281 {
6282 EntityAI parent = GetHierarchyParent();
6283
6284 if (parent)
6285 {
6286 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6287 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6288 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6289 }
6290 }
6291
6293 {
6294
6295
6296
6297
6299
6301 {
6302 if (ScriptInputUserData.CanStoreInputUserData())
6303 {
6304 ScriptInputUserData ctx = new ScriptInputUserData;
6310 ctx.
Write(use_stack_max);
6313
6315 {
6316 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6317 }
6318 }
6319 }
6320 else if (!
GetGame().IsMultiplayer())
6321 {
6323 }
6324 }
6325
6327 {
6329 }
6330
6332 {
6334 }
6335
6337 {
6339 }
6340
6342 {
6343
6344 return false;
6345 }
6346
6348 {
6349 return false;
6350 }
6351
6355 {
6356 return false;
6357 }
6358
6360 {
6361 return "";
6362 }
6363
6365
6367 {
6368 return false;
6369 }
6370
6372 {
6373 return true;
6374 }
6375
6376
6377
6379 {
6380 return true;
6381 }
6382
6384 {
6385 return true;
6386 }
6387
6389 {
6390 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6392 }
6393
6395 {
6397 }
6398
6400 {
6402 if (!is_being_placed)
6404 SetSynchDirty();
6405 }
6406
6407
6409
6411 {
6413 }
6414
6416 {
6418 }
6419
6421 {
6422 return 1;
6423 }
6424
6426 {
6427 return false;
6428 }
6429
6431 {
6433 SetSynchDirty();
6434 }
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6471 {
6472 super.OnMovedInsideCargo(container);
6473
6474 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6475 }
6476
6477 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6478 {
6479 super.EEItemLocationChanged(oldLoc,newLoc);
6480
6481 PlayerBase new_player = null;
6482 PlayerBase old_player = null;
6483
6484 if (newLoc.GetParent())
6485 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6486
6487 if (oldLoc.GetParent())
6488 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6489
6491 {
6492 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6493
6494 if (r_index >= 0)
6495 {
6496 InventoryLocation r_il = new InventoryLocation;
6497 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6498
6499 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6502 {
6503 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6504 }
6506 {
6507 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6508 }
6509
6510 }
6511 }
6512
6514 {
6515 if (new_player)
6516 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6517
6518 if (new_player == old_player)
6519 {
6520
6521 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6522 {
6524 {
6525 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6526 {
6527 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6528 }
6529 }
6530 else
6531 {
6532 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6533 }
6534 }
6535
6536 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6537 {
6538 int type = oldLoc.GetType();
6540 {
6541 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6542 }
6544 {
6545 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6546 }
6547 }
6548 if (!m_OldLocation)
6549 {
6550 m_OldLocation = new InventoryLocation;
6551 }
6552 m_OldLocation.Copy(oldLoc);
6553 }
6554 else
6555 {
6556 if (m_OldLocation)
6557 {
6558 m_OldLocation.Reset();
6559 }
6560 }
6561
6563 }
6564 else
6565 {
6566 if (new_player)
6567 {
6568 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6569 if (res_index >= 0)
6570 {
6571 InventoryLocation il = new InventoryLocation;
6572 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6574 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6577 {
6578 il.
GetParent().GetOnReleaseLock().Invoke(it);
6579 }
6581 {
6583 }
6584
6585 }
6586 }
6588 {
6589
6591 }
6592
6593 if (m_OldLocation)
6594 {
6595 m_OldLocation.Reset();
6596 }
6597 }
6598 }
6599
6600 override void EOnContact(IEntity other, Contact extra)
6601 {
6603 {
6604 int liquidType = -1;
6606 if (impactSpeed > 0.0)
6607 {
6609 #ifndef SERVER
6611 #else
6613 SetSynchDirty();
6614 #endif
6616 }
6617 }
6618
6619 #ifdef SERVER
6620 if (GetCompEM() && GetCompEM().IsPlugged())
6621 {
6622 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6623 GetCompEM().UnplugThis();
6624 }
6625 #endif
6626 }
6627
6629
6631 {
6633 }
6634
6636 {
6637
6638 }
6639
6641 {
6642 super.OnItemLocationChanged(old_owner, new_owner);
6643
6644 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6645 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6646
6647 if (!relatedPlayer && playerNew)
6648 relatedPlayer = playerNew;
6649
6650 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6651 {
6653 if (actionMgr)
6654 {
6655 ActionBase currentAction = actionMgr.GetRunningAction();
6656 if (currentAction)
6658 }
6659 }
6660
6661 Man ownerPlayerOld = null;
6662 Man ownerPlayerNew = null;
6663
6664 if (old_owner)
6665 {
6666 if (old_owner.
IsMan())
6667 {
6668 ownerPlayerOld = Man.Cast(old_owner);
6669 }
6670 else
6671 {
6672 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6673 }
6674 }
6675 else
6676 {
6678 {
6680
6681 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6682 {
6683 GetCompEM().UnplugThis();
6684 }
6685 }
6686 }
6687
6688 if (new_owner)
6689 {
6690 if (new_owner.
IsMan())
6691 {
6692 ownerPlayerNew = Man.Cast(new_owner);
6693 }
6694 else
6695 {
6696 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6697 }
6698 }
6699
6700 if (ownerPlayerOld != ownerPlayerNew)
6701 {
6702 if (ownerPlayerOld)
6703 {
6704 array<EntityAI> subItemsExit = new array<EntityAI>;
6706 for (int i = 0; i < subItemsExit.Count(); i++)
6707 {
6710 }
6711 }
6712
6713 if (ownerPlayerNew)
6714 {
6715 array<EntityAI> subItemsEnter = new array<EntityAI>;
6717 for (int j = 0; j < subItemsEnter.Count(); j++)
6718 {
6721 }
6722 }
6723 }
6724 else if (ownerPlayerNew != null)
6725 {
6726 PlayerBase nplayer;
6727 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6728 {
6729 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6731 for (int k = 0; k < subItemsUpdate.Count(); k++)
6732 {
6734 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6735 }
6736 }
6737 }
6738
6739 if (old_owner)
6740 old_owner.OnChildItemRemoved(this);
6741 if (new_owner)
6742 new_owner.OnChildItemReceived(this);
6743 }
6744
6745
6747 {
6748 super.EEDelete(parent);
6749 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6750 if (player)
6751 {
6753
6754 if (player.IsAlive())
6755 {
6756 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6757 if (r_index >= 0)
6758 {
6759 InventoryLocation r_il = new InventoryLocation;
6760 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6761
6762 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6765 {
6766 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6767 }
6769 {
6770 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6771 }
6772
6773 }
6774
6775 player.RemoveQuickBarEntityShortcut(this);
6776 }
6777 }
6778 }
6779
6781 {
6782 super.EEKilled(killer);
6783
6786 {
6787 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6788 {
6789 if (IsMagazine())
6790 {
6791 if (Magazine.Cast(this).GetAmmoCount() > 0)
6792 {
6794 }
6795 }
6796 else
6797 {
6799 }
6800 }
6801 }
6802 }
6803
6805 {
6806 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6807
6808 super.OnWasAttached(parent, slot_id);
6809
6812
6814 }
6815
6817 {
6818 super.OnWasDetached(parent, slot_id);
6819
6822 }
6823
6825 {
6826 int idx;
6829
6830 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6831 if (inventory_slots.Count() < 1)
6832 {
6833 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6834 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6835 }
6836 else
6837 {
6838 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6839 }
6840
6841 idx = inventory_slots.Find(slot);
6842 if (idx < 0)
6843 return "";
6844
6845 return attach_types.Get(idx);
6846 }
6847
6849 {
6850 int idx = -1;
6851 string slot;
6852
6855
6856 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6857 if (inventory_slots.Count() < 1)
6858 {
6859 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6860 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6861 }
6862 else
6863 {
6864 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6865 if (detach_types.Count() < 1)
6866 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6867 }
6868
6869 for (int i = 0; i < inventory_slots.Count(); i++)
6870 {
6871 slot = inventory_slots.Get(i);
6872 }
6873
6874 if (slot != "")
6875 {
6876 if (detach_types.Count() == 1)
6877 idx = 0;
6878 else
6879 idx = inventory_slots.Find(slot);
6880 }
6881 if (idx < 0)
6882 return "";
6883
6884 return detach_types.Get(idx);
6885 }
6886
6888 {
6889
6891
6892
6893 float min_time = 1;
6894 float max_time = 3;
6895 float delay = Math.RandomFloat(min_time, max_time);
6896
6897 explode_timer.Run(delay, this, "DoAmmoExplosion");
6898 }
6899
6901 {
6902 Magazine magazine = Magazine.Cast(this);
6903 int pop_sounds_count = 6;
6904 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6905
6906
6907 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6908 string sound_name = pop_sounds[ sound_idx ];
6910
6911
6912 magazine.ServerAddAmmoCount(-1);
6913
6914
6915 float min_temp_to_explode = 100;
6916
6917 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
6918 {
6920 }
6921 }
6922
6923
6924 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6925 {
6926 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6927
6928 const int CHANCE_DAMAGE_CARGO = 4;
6929 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6930 const int CHANCE_DAMAGE_NOTHING = 2;
6931
6933 {
6934 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6935 int chances;
6936 int rnd;
6937
6938 if (GetInventory().GetCargo())
6939 {
6940 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6941 rnd = Math.RandomInt(0,chances);
6942
6943 if (rnd < CHANCE_DAMAGE_CARGO)
6944 {
6946 }
6947 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6948 {
6950 }
6951 }
6952 else
6953 {
6954 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6955 rnd = Math.RandomInt(0,chances);
6956
6957 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6958 {
6960 }
6961 }
6962 }
6963 }
6964
6966 {
6967 if (GetInventory().GetCargo())
6968 {
6969 int item_count = GetInventory().GetCargo().GetItemCount();
6970 if (item_count > 0)
6971 {
6972 int random_pick = Math.RandomInt(0, item_count);
6974 if (!item.IsExplosive())
6975 {
6976 item.AddHealth("","",damage);
6977 return true;
6978 }
6979 }
6980 }
6981 return false;
6982 }
6983
6985 {
6986 int attachment_count = GetInventory().AttachmentCount();
6987 if (attachment_count > 0)
6988 {
6989 int random_pick = Math.RandomInt(0, attachment_count);
6990 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6991 if (!attachment.IsExplosive())
6992 {
6993 attachment.AddHealth("","",damage);
6994 return true;
6995 }
6996 }
6997 return false;
6998 }
6999
7001 {
7003 }
7004
7006 {
7008 return GetInventory().CanRemoveEntity();
7009
7010 return false;
7011 }
7012
7014 {
7015
7017 return false;
7018
7019
7021 return false;
7022
7023
7024
7026 if (delta == 0)
7027 return false;
7028
7029
7030 return true;
7031 }
7032
7034 {
7036 {
7037 if (ScriptInputUserData.CanStoreInputUserData())
7038 {
7039 ScriptInputUserData ctx = new ScriptInputUserData;
7044 ctx.
Write(destination_entity);
7048 }
7049 }
7050 else if (!
GetGame().IsMultiplayer())
7051 {
7053 }
7054 }
7055
7057 {
7058 float split_quantity_new;
7062 InventoryLocation loc = new InventoryLocation;
7063
7064 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7065 {
7067 split_quantity_new = stack_max;
7068 else
7070
7072 {
7073 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7074 if (new_item)
7075 {
7076 new_item.SetResultOfSplit(true);
7077 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7079 new_item.
SetQuantity(split_quantity_new,
false,
true);
7080 }
7081 }
7082 }
7083 else if (destination_entity && slot_id == -1)
7084 {
7085 if (quantity > stack_max)
7086 split_quantity_new = stack_max;
7087 else
7088 split_quantity_new = quantity;
7089
7091 {
7093 {
7096 }
7097
7098 if (new_item)
7099 {
7100 new_item.SetResultOfSplit(true);
7101 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7103 new_item.
SetQuantity(split_quantity_new,
false,
true);
7104 }
7105 }
7106 }
7107 else
7108 {
7109 if (stack_max != 0)
7110 {
7112 {
7114 }
7115
7116 if (split_quantity_new == 0)
7117 {
7118 if (!
GetGame().IsMultiplayer())
7119 player.PhysicalPredictiveDropItem(this);
7120 else
7121 player.ServerDropEntity(this);
7122 return;
7123 }
7124
7126 {
7128
7129 if (new_item)
7130 {
7131 new_item.SetResultOfSplit(true);
7132 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7135 new_item.PlaceOnSurface();
7136 }
7137 }
7138 }
7139 }
7140 }
7141
7143 {
7144 float split_quantity_new;
7148 InventoryLocation loc = new InventoryLocation;
7149
7150 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7151 {
7153 split_quantity_new = stack_max;
7154 else
7156
7158 {
7159 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7160 if (new_item)
7161 {
7162 new_item.SetResultOfSplit(true);
7163 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7165 new_item.
SetQuantity(split_quantity_new,
false,
true);
7166 }
7167 }
7168 }
7169 else if (destination_entity && slot_id == -1)
7170 {
7171 if (quantity > stack_max)
7172 split_quantity_new = stack_max;
7173 else
7174 split_quantity_new = quantity;
7175
7177 {
7179 {
7182 }
7183
7184 if (new_item)
7185 {
7186 new_item.SetResultOfSplit(true);
7187 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7189 new_item.
SetQuantity(split_quantity_new,
false,
true);
7190 }
7191 }
7192 }
7193 else
7194 {
7195 if (stack_max != 0)
7196 {
7198 {
7200 }
7201
7203 {
7205
7206 if (new_item)
7207 {
7208 new_item.SetResultOfSplit(true);
7209 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7212 new_item.PlaceOnSurface();
7213 }
7214 }
7215 }
7216 }
7217 }
7218
7220 {
7222 {
7223 if (ScriptInputUserData.CanStoreInputUserData())
7224 {
7225 ScriptInputUserData ctx = new ScriptInputUserData;
7230 dst.WriteToContext(ctx);
7232 }
7233 }
7234 else if (!
GetGame().IsMultiplayer())
7235 {
7237 }
7238 }
7239
7241 {
7243 {
7244 if (ScriptInputUserData.CanStoreInputUserData())
7245 {
7246 ScriptInputUserData ctx = new ScriptInputUserData;
7251 ctx.
Write(destination_entity);
7257 }
7258 }
7259 else if (!
GetGame().IsMultiplayer())
7260 {
7262 }
7263 }
7264
7266 {
7268 }
7269
7271 {
7273 float split_quantity_new;
7275 if (dst.IsValid())
7276 {
7277 int slot_id = dst.GetSlot();
7279
7280 if (quantity > stack_max)
7281 split_quantity_new = stack_max;
7282 else
7283 split_quantity_new = quantity;
7284
7286 {
7288
7289 if (new_item)
7290 {
7291 new_item.SetResultOfSplit(true);
7292 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7294 new_item.
SetQuantity(split_quantity_new,
false,
true);
7295 }
7296
7297 return new_item;
7298 }
7299 }
7300
7301 return null;
7302 }
7303
7305 {
7307 float split_quantity_new;
7309 if (destination_entity)
7310 {
7312 if (quantity > stackable)
7313 split_quantity_new = stackable;
7314 else
7315 split_quantity_new = quantity;
7316
7318 {
7319 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7320 if (new_item)
7321 {
7322 new_item.SetResultOfSplit(true);
7323 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7325 new_item.
SetQuantity(split_quantity_new,
false,
true);
7326 }
7327 }
7328 }
7329 }
7330
7332 {
7334 {
7335 if (ScriptInputUserData.CanStoreInputUserData())
7336 {
7337 ScriptInputUserData ctx = new ScriptInputUserData;
7342 ItemBase destination_entity =
this;
7343 ctx.
Write(destination_entity);
7347 }
7348 }
7349 else if (!
GetGame().IsMultiplayer())
7350 {
7352 }
7353 }
7354
7356 {
7358 float split_quantity_new;
7360 if (player)
7361 {
7363 if (quantity > stackable)
7364 split_quantity_new = stackable;
7365 else
7366 split_quantity_new = quantity;
7367
7369 {
7370 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7371 new_item =
ItemBase.Cast(in_hands);
7372 if (new_item)
7373 {
7374 new_item.SetResultOfSplit(true);
7375 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7377 new_item.SetQuantity(split_quantity_new, false, true);
7378 }
7379 }
7380 }
7381 }
7382
7384 {
7386 float split_quantity_new = Math.Floor(quantity * 0.5);
7387
7389 return;
7390
7392
7393 if (new_item)
7394 {
7395 if (new_item.GetQuantityMax() < split_quantity_new)
7396 {
7397 split_quantity_new = new_item.GetQuantityMax();
7398 }
7399
7400 new_item.SetResultOfSplit(true);
7401 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7402
7404 {
7407 }
7408 else
7409 {
7411 new_item.
SetQuantity(split_quantity_new,
false,
true);
7412 }
7413 }
7414 }
7415
7417 {
7419 float split_quantity_new = Math.Floor(quantity / 2);
7420
7422 return;
7423
7424 InventoryLocation invloc = new InventoryLocation;
7426
7428 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7429
7430 if (new_item)
7431 {
7432 if (new_item.GetQuantityMax() < split_quantity_new)
7433 {
7434 split_quantity_new = new_item.GetQuantityMax();
7435 }
7437 {
7440 }
7441 else if (split_quantity_new > 1)
7442 {
7444 new_item.
SetQuantity(split_quantity_new,
false,
true);
7445 }
7446 }
7447 }
7448
7451 {
7452 SetWeightDirty();
7454
7455 if (parent)
7456 parent.OnAttachmentQuantityChangedEx(this, delta);
7457
7459 {
7461 {
7463 }
7465 {
7466 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7468 }
7469 }
7470
7471 }
7472
7475 {
7476
7477 }
7478
7481 {
7483 }
7484
7486 {
7487 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7488
7490 {
7491 if (newLevel == GameConstants.STATE_RUINED)
7492 {
7494 EntityAI parent = GetHierarchyParent();
7495 if (parent && parent.IsFireplace())
7496 {
7497 CargoBase cargo = GetInventory().GetCargo();
7498 if (cargo)
7499 {
7501 {
7503 }
7504 }
7505 }
7506 }
7507
7509 {
7510
7512 return;
7513 }
7514
7515 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7516 {
7518 }
7519 }
7520 }
7521
7522
7524 {
7525 super.OnRightClick();
7526
7528 {
7530 {
7531 if (ScriptInputUserData.CanStoreInputUserData())
7532 {
7533 EntityAI root = GetHierarchyRoot();
7534 Man playerOwner = GetHierarchyRootPlayer();
7535 InventoryLocation dst = new InventoryLocation;
7536
7537
7538 if (!playerOwner && root && root == this)
7539 {
7541 }
7542 else
7543 {
7544
7545 GetInventory().GetCurrentInventoryLocation(dst);
7547 {
7550 {
7552 }
7553 else
7554 {
7556
7557
7558 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7559 {
7561 }
7562 else
7563 {
7564 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7565 }
7566 }
7567 }
7568 }
7569
7570 ScriptInputUserData ctx = new ScriptInputUserData;
7578 }
7579 }
7580 else if (!
GetGame().IsMultiplayer())
7581 {
7583 }
7584 }
7585 }
7586
7588 {
7589 if (root)
7590 {
7591 vector m4[4];
7592 root.GetTransform(m4);
7593 dst.SetGround(this, m4);
7594 }
7595 else
7596 {
7597 GetInventory().GetCurrentInventoryLocation(dst);
7598 }
7599 }
7600
7601 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7602 {
7603
7604 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7605 return false;
7606
7607 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7608 return false;
7609
7610
7612 return false;
7613
7614
7615 Magazine mag = Magazine.Cast(this);
7616 if (mag)
7617 {
7618 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7619 return false;
7620
7621 if (stack_max_limit)
7622 {
7623 Magazine other_mag = Magazine.Cast(other_item);
7624 if (other_item)
7625 {
7626 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7627 return false;
7628 }
7629
7630 }
7631 }
7632 else
7633 {
7634
7636 return false;
7637
7639 return false;
7640 }
7641
7642 PlayerBase player = null;
7643 if (CastTo(player, GetHierarchyRootPlayer()))
7644 {
7645 if (player.GetInventory().HasAttachment(this))
7646 return false;
7647
7648 if (player.IsItemsToDelete())
7649 return false;
7650 }
7651
7652 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7653 return false;
7654
7655 int slotID;
7657 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7658 return false;
7659
7660 return true;
7661 }
7662
7664 {
7666 }
7667
7669 {
7670 return m_IsResultOfSplit;
7671 }
7672
7674 {
7675 m_IsResultOfSplit = value;
7676 }
7677
7679 {
7681 }
7682
7684 {
7685 float other_item_quantity = other_item.GetQuantity();
7686 float this_free_space;
7687
7689
7691
7692 if (other_item_quantity > this_free_space)
7693 {
7694 return this_free_space;
7695 }
7696 else
7697 {
7698 return other_item_quantity;
7699 }
7700 }
7701
7703 {
7705 }
7706
7708 {
7710 return;
7711
7712 if (!IsMagazine() && other_item)
7713 {
7715 if (quantity_used != 0)
7716 {
7717 float hp1 = GetHealth01("","");
7718 float hp2 = other_item.GetHealth01("","");
7719 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7720 hpResult = hpResult / (
GetQuantity() + quantity_used);
7721
7722 hpResult *= GetMaxHealth();
7723 Math.Round(hpResult);
7724 SetHealth("", "Health", hpResult);
7725
7727 other_item.AddQuantity(-quantity_used);
7728 }
7729 }
7731 }
7732
7734 {
7735 #ifdef SERVER
7736 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7737 GetHierarchyParent().IncreaseLifetimeUp();
7738 #endif
7739 };
7740
7742 {
7743 PlayerBase p = PlayerBase.Cast(player);
7744
7745 array<int> recipesIds = p.m_Recipes;
7746 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7747 if (moduleRecipesManager)
7748 {
7749 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7750 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7751 }
7752
7753 for (int i = 0;i < recipesIds.Count(); i++)
7754 {
7755 int key = recipesIds.Get(i);
7756 string recipeName = moduleRecipesManager.GetRecipeName(key);
7758 }
7759 }
7760
7761
7762 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7763 {
7764 super.GetDebugActions(outputList);
7765
7766
7772
7773
7778
7783
7784
7788
7789
7791 {
7795 }
7796
7799
7800
7804
7806
7807 InventoryLocation loc = new InventoryLocation();
7808 GetInventory().GetCurrentInventoryLocation(loc);
7810 {
7811 if (Gizmo_IsSupported())
7814 }
7815
7817 }
7818
7819
7820
7821
7823 {
7824 super.OnAction(action_id, player, ctx);
7825
7827 {
7828 switch (action_id)
7829 {
7832 return true;
7835 return true;
7836 }
7837 }
7838
7840 {
7841 switch (action_id)
7842 {
7844 Delete();
7845 return true;
7846 }
7847 }
7848
7849 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7850 {
7851 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7852 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7853 PlayerBase p = PlayerBase.Cast(player);
7854 if (
EActions.RECIPES_RANGE_START < 1000)
7855 {
7856 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7857 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7858 }
7859 }
7860 #ifndef SERVER
7861 else if (action_id ==
EActions.WATCH_PLAYER)
7862 {
7863 PluginDeveloper.SetDeveloperItemClientEx(player);
7864 }
7865 #endif
7867 {
7868 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7869 {
7870 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7871 OnDebugButtonPressServer(id + 1);
7872 }
7873
7874 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7875 {
7876 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7878 }
7879
7880 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7881 {
7882 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7884 }
7885
7886 else if (action_id ==
EActions.ADD_QUANTITY)
7887 {
7888 if (IsMagazine())
7889 {
7890 Magazine mag = Magazine.Cast(this);
7891 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7892 }
7893 else
7894 {
7896 }
7897
7898 if (m_EM)
7899 {
7900 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7901 }
7902
7903 }
7904
7905 else if (action_id ==
EActions.REMOVE_QUANTITY)
7906 {
7907 if (IsMagazine())
7908 {
7909 Magazine mag2 = Magazine.Cast(this);
7910 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7911 }
7912 else
7913 {
7915 }
7916 if (m_EM)
7917 {
7918 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7919 }
7920
7921 }
7922
7923 else if (action_id ==
EActions.SET_QUANTITY_0)
7924 {
7926
7927 if (m_EM)
7928 {
7929 m_EM.SetEnergy(0);
7930 }
7931 }
7932
7933 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7934 {
7936
7937 if (m_EM)
7938 {
7939 m_EM.SetEnergy(m_EM.GetEnergyMax());
7940 }
7941 }
7942
7943 else if (action_id ==
EActions.ADD_HEALTH)
7944 {
7945 AddHealth("","",GetMaxHealth("","Health")/5);
7946 }
7947 else if (action_id ==
EActions.REMOVE_HEALTH)
7948 {
7949 AddHealth("","",-GetMaxHealth("","Health")/5);
7950 }
7951 else if (action_id ==
EActions.DESTROY_HEALTH)
7952 {
7953 SetHealth01("","",0);
7954 }
7955 else if (action_id ==
EActions.WATCH_ITEM)
7956 {
7958 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7959 #ifdef DEVELOPER
7960 SetDebugDeveloper_item(this);
7961 #endif
7962 }
7963
7964 else if (action_id ==
EActions.ADD_TEMPERATURE)
7965 {
7966 AddTemperature(20);
7967
7968 }
7969
7970 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7971 {
7972 AddTemperature(-20);
7973
7974 }
7975
7976 else if (action_id ==
EActions.FLIP_FROZEN)
7977 {
7978 SetFrozen(!GetIsFrozen());
7979
7980 }
7981
7982 else if (action_id ==
EActions.ADD_WETNESS)
7983 {
7985
7986 }
7987
7988 else if (action_id ==
EActions.REMOVE_WETNESS)
7989 {
7991
7992 }
7993
7994 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7995 {
7998
7999
8000 }
8001
8002 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8003 {
8006 }
8007
8008 else if (action_id ==
EActions.MAKE_SPECIAL)
8009 {
8010 auto debugParams = DebugSpawnParams.WithPlayer(player);
8011 OnDebugSpawnEx(debugParams);
8012 }
8013
8014 }
8015
8016
8017 return false;
8018 }
8019
8020
8021
8022
8026
8029
8030
8031
8033 {
8034 return false;
8035 }
8036
8037
8039 {
8040 return true;
8041 }
8042
8043
8045 {
8046 return true;
8047 }
8048
8049
8050
8052 {
8053 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8055 }
8056
8059 {
8060 return null;
8061 }
8062
8064 {
8065 return false;
8066 }
8067
8069 {
8070 return false;
8071 }
8072
8076
8077
8079 {
8080 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8081 return module_repairing.CanRepair(this, item_repair_kit);
8082 }
8083
8084
8085 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8086 {
8087 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8088 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8089 }
8090
8091
8093 {
8094
8095
8096
8097
8098
8099
8100
8101
8102 return 1;
8103 }
8104
8105
8106
8108 {
8110 }
8111
8112
8113
8115 {
8117 }
8118
8119
8128 {
8129 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8130
8131 if (player)
8132 {
8133 player.MessageStatus(text);
8134 }
8135 }
8136
8137
8146 {
8147 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8148
8149 if (player)
8150 {
8151 player.MessageAction(text);
8152 }
8153 }
8154
8155
8164 {
8165 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8166
8167 if (player)
8168 {
8169 player.MessageFriendly(text);
8170 }
8171 }
8172
8173
8182 {
8183 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8184
8185 if (player)
8186 {
8187 player.MessageImportant(text);
8188 }
8189 }
8190
8192 {
8193 return true;
8194 }
8195
8196
8197 override bool KindOf(
string tag)
8198 {
8199 bool found = false;
8200 string item_name = this.
GetType();
8203
8204 int array_size = item_tag_array.Count();
8205 for (int i = 0; i < array_size; i++)
8206 {
8207 if (item_tag_array.Get(i) == tag)
8208 {
8209 found = true;
8210 break;
8211 }
8212 }
8213 return found;
8214 }
8215
8216
8218 {
8219
8220 super.OnRPC(sender, rpc_type,ctx);
8221
8222
8223 switch (rpc_type)
8224 {
8225 #ifndef SERVER
8226 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8227 Param2<bool, string> p = new Param2<bool, string>(false, "");
8228
8230 return;
8231
8232 bool play = p.param1;
8233 string soundSet = p.param2;
8234
8235 if (play)
8236 {
8238 {
8240 {
8242 }
8243 }
8244 else
8245 {
8247 }
8248 }
8249 else
8250 {
8252 }
8253
8254 break;
8255 #endif
8256
8257 }
8258
8260 {
8262 }
8263 }
8264
8265
8266
8267
8269 {
8270 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8271 return plugin.GetID(
name);
8272 }
8273
8275 {
8276 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8277 return plugin.GetName(id);
8278 }
8279
8282 {
8283
8284
8285 int varFlags;
8286 if (!ctx.
Read(varFlags))
8287 return;
8288
8289 if (varFlags & ItemVariableFlags.FLOAT)
8290 {
8292 }
8293 }
8294
8296 {
8297
8298 super.SerializeNumericalVars(floats_out);
8299
8300
8301
8303 {
8305 }
8306
8308 {
8310 }
8311
8313 {
8315 }
8316
8318 {
8323 }
8324
8326 {
8328 }
8329 }
8330
8332 {
8333
8334 super.DeSerializeNumericalVars(floats);
8335
8336
8337 int index = 0;
8338 int mask = Math.Round(floats.Get(index));
8339
8340 index++;
8341
8343 {
8345 {
8347 }
8348 else
8349 {
8350 float quantity = floats.Get(index);
8352 }
8353 index++;
8354 }
8355
8357 {
8358 float wet = floats.Get(index);
8360 index++;
8361 }
8362
8364 {
8365 int liquidtype = Math.Round(floats.Get(index));
8367 index++;
8368 }
8369
8371 {
8373 index++;
8375 index++;
8377 index++;
8379 index++;
8380 }
8381
8383 {
8384 int cleanness = Math.Round(floats.Get(index));
8386 index++;
8387 }
8388 }
8389
8391 {
8392 super.WriteVarsToCTX(ctx);
8393
8394
8396 {
8398 }
8399
8401 {
8403 }
8404
8406 {
8408 }
8409
8411 {
8412 int r,g,b,a;
8418 }
8419
8421 {
8423 }
8424 }
8425
8427 {
8428 if (!super.ReadVarsFromCTX(ctx,version))
8429 return false;
8430
8431 int intValue;
8432 float value;
8433
8434 if (version < 140)
8435 {
8436 if (!ctx.
Read(intValue))
8437 return false;
8438
8439 m_VariablesMask = intValue;
8440 }
8441
8443 {
8444 if (!ctx.
Read(value))
8445 return false;
8446
8448 {
8450 }
8451 else
8452 {
8454 }
8455 }
8456
8457 if (version < 140)
8458 {
8460 {
8461 if (!ctx.
Read(value))
8462 return false;
8463 SetTemperatureDirect(value);
8464 }
8465 }
8466
8468 {
8469 if (!ctx.
Read(value))
8470 return false;
8472 }
8473
8475 {
8476 if (!ctx.
Read(intValue))
8477 return false;
8479 }
8480
8482 {
8483 int r,g,b,a;
8485 return false;
8487 return false;
8489 return false;
8491 return false;
8492
8494 }
8495
8497 {
8498 if (!ctx.
Read(intValue))
8499 return false;
8501 }
8502
8503 if (version >= 138 && version < 140)
8504 {
8506 {
8507 if (!ctx.
Read(intValue))
8508 return false;
8509 SetFrozen(intValue);
8510 }
8511 }
8512
8513 return true;
8514 }
8515
8516
8518 {
8521 {
8523 }
8524
8525 if (!super.OnStoreLoad(ctx, version))
8526 {
8528 return false;
8529 }
8530
8531 if (version >= 114)
8532 {
8533 bool hasQuickBarIndexSaved;
8534
8535 if (!ctx.
Read(hasQuickBarIndexSaved))
8536 {
8538 return false;
8539 }
8540
8541 if (hasQuickBarIndexSaved)
8542 {
8543 int itmQBIndex;
8544
8545
8546 if (!ctx.
Read(itmQBIndex))
8547 {
8549 return false;
8550 }
8551
8552 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8553 if (itmQBIndex != -1 && parentPlayer)
8554 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8555 }
8556 }
8557 else
8558 {
8559
8560 PlayerBase player;
8561 int itemQBIndex;
8562 if (version ==
int.
MAX)
8563 {
8564 if (!ctx.
Read(itemQBIndex))
8565 {
8567 return false;
8568 }
8569 }
8570 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8571 {
8572
8573 if (!ctx.
Read(itemQBIndex))
8574 {
8576 return false;
8577 }
8578 if (itemQBIndex != -1 && player)
8579 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8580 }
8581 }
8582
8583 if (version < 140)
8584 {
8585
8586 if (!LoadVariables(ctx, version))
8587 {
8589 return false;
8590 }
8591 }
8592
8593
8595 {
8597 return false;
8598 }
8599 if (version >= 132)
8600 {
8602 if (raib)
8603 {
8605 {
8607 return false;
8608 }
8609 }
8610 }
8611
8613 return true;
8614 }
8615
8616
8617
8619 {
8620 super.OnStoreSave(ctx);
8621
8622 PlayerBase player;
8623 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8624 {
8626
8627 int itemQBIndex = -1;
8628 itemQBIndex = player.FindQuickBarEntityIndex(this);
8629 ctx.
Write(itemQBIndex);
8630 }
8631 else
8632 {
8634 }
8635
8637
8639 if (raib)
8640 {
8642 }
8643 }
8644
8645
8647 {
8648 super.AfterStoreLoad();
8649
8651 {
8653 }
8654
8656 {
8659 }
8660 }
8661
8663 {
8664 super.EEOnAfterLoad();
8665
8667 {
8669 }
8670
8673 }
8674
8676 {
8677 return false;
8678 }
8679
8680
8681
8683 {
8685 {
8686 #ifdef PLATFORM_CONSOLE
8687
8689 {
8691 if (menu)
8692 {
8694 }
8695 }
8696 #endif
8697 }
8698
8700 {
8703 }
8704
8706 {
8707 SetWeightDirty();
8709 }
8711 {
8714 }
8715
8717 {
8720 }
8722 {
8725 }
8726
8727 super.OnVariablesSynchronized();
8728 }
8729
8730
8731
8733 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8734 {
8735 if (!IsServerCheck(allow_client))
8736 return false;
8737
8739 return false;
8740
8743
8744 if (value <= (min + 0.001))
8745 value = min;
8746
8747 if (value == min)
8748 {
8749 if (destroy_config)
8750 {
8751 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8752 if (dstr)
8753 {
8755 this.Delete();
8756 return true;
8757 }
8758 }
8759 else if (destroy_forced)
8760 {
8762 this.Delete();
8763 return true;
8764 }
8765
8767 }
8768
8771
8773 {
8775
8776 if (delta)
8778 }
8779
8781
8782 return false;
8783 }
8784
8785
8787 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8788 {
8790 }
8791
8793 {
8796 }
8797
8799 {
8802 }
8803
8805 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8806 {
8807 float value_clamped = Math.Clamp(value, 0, 1);
8809 SetQuantity(result, destroy_config, destroy_forced);
8810 }
8811
8812
8815 {
8817 }
8818
8820 {
8822 }
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8834 {
8835 int slot = -1;
8836 if (GetInventory())
8837 {
8838 InventoryLocation il = new InventoryLocation;
8839 GetInventory().GetCurrentInventoryLocation(il);
8841 }
8842
8844 }
8845
8847 {
8848 float quantity_max = 0;
8849
8851 {
8852 if (attSlotID != -1)
8853 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8854
8855 if (quantity_max <= 0)
8857 }
8858
8859 if (quantity_max <= 0)
8861
8862 return quantity_max;
8863 }
8864
8866 {
8868 }
8869
8871 {
8873 }
8874
8875
8877 {
8879 }
8880
8882 {
8884 }
8885
8887 {
8889 }
8890
8891
8893 {
8894
8895 float weightEx = GetWeightEx();
8896 float special = GetInventoryAndCargoWeight();
8897 return weightEx - special;
8898 }
8899
8900
8902 {
8904 }
8905
8907 {
8909 {
8910 #ifdef DEVELOPER
8911 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8912 {
8913 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8915 }
8916 #endif
8917
8919 }
8920 else if (HasEnergyManager())
8921 {
8922 #ifdef DEVELOPER
8923 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8924 {
8925 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8926 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8927 }
8928 #endif
8929 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
8930 }
8931 else
8932 {
8933 #ifdef DEVELOPER
8934 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8935 {
8936 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8937 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8938 }
8939 #endif
8940 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
8941 }
8942 }
8943
8946 {
8947 int item_count = 0;
8949
8950 if (GetInventory().GetCargo() != NULL)
8951 {
8952 item_count = GetInventory().GetCargo().GetItemCount();
8953 }
8954
8955 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8956 {
8957 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8958 if (item)
8959 item_count += item.GetNumberOfItems();
8960 }
8961 return item_count;
8962 }
8963
8966 {
8967 float weight = 0;
8968 float wetness = 1;
8969 if (include_wetness)
8972 {
8973 weight = wetness * m_ConfigWeight;
8974 }
8976 {
8977 weight = 1;
8978 }
8979 return weight;
8980 }
8981
8982
8983
8985 {
8986 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8987 {
8988 GameInventory inv = GetInventory();
8989 array<EntityAI> items = new array<EntityAI>;
8991 for (int i = 0; i < items.Count(); i++)
8992 {
8994 if (item)
8995 {
8997 }
8998 }
8999 }
9000 }
9001
9002
9003
9004
9006 {
9007 float energy = 0;
9008 if (HasEnergyManager())
9009 {
9010 energy = GetCompEM().GetEnergy();
9011 }
9012 return energy;
9013 }
9014
9015
9017 {
9018 super.OnEnergyConsumed();
9019
9021 }
9022
9024 {
9025 super.OnEnergyAdded();
9026
9028 }
9029
9030
9032 {
9033 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9034 {
9036 {
9037 float energy_0to1 = GetCompEM().GetEnergy0To1();
9039 }
9040 }
9041 }
9042
9043
9045 {
9046 return ConfigGetFloat("heatIsolation");
9047 }
9048
9050 {
9052 }
9053
9055 {
9056 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9057 if (
GetGame().ConfigIsExisting(paramPath))
9059
9060 return 0.0;
9061 }
9062
9064 {
9065 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9066 if (
GetGame().ConfigIsExisting(paramPath))
9068
9069 return 0.0;
9070 }
9071
9072 override void SetWet(
float value,
bool allow_client =
false)
9073 {
9074 if (!IsServerCheck(allow_client))
9075 return;
9076
9079
9081
9082 m_VarWet = Math.Clamp(value, min, max);
9083
9085 {
9088 }
9089 }
9090
9091 override void AddWet(
float value)
9092 {
9094 }
9095
9097 {
9099 }
9100
9102 {
9104 }
9105
9107 {
9109 }
9110
9112 {
9114 }
9115
9117 {
9119 }
9120
9122 {
9125 if (newLevel != oldLevel)
9126 {
9128 }
9129 }
9130
9132 {
9133 SetWeightDirty();
9134 }
9135
9137 {
9138 return GetWetLevelInternal(
m_VarWet);
9139 }
9140
9141
9142
9144 {
9146 }
9147
9149 {
9151 }
9152
9154 {
9156 }
9157
9159 {
9161 }
9162
9163
9164
9166 {
9167 if (ConfigIsExisting("itemModelLength"))
9168 {
9169 return ConfigGetFloat("itemModelLength");
9170 }
9171 return 0;
9172 }
9173
9175 {
9176 if (ConfigIsExisting("itemAttachOffset"))
9177 {
9178 return ConfigGetFloat("itemAttachOffset");
9179 }
9180 return 0;
9181 }
9182
9183 override void SetCleanness(
int value,
bool allow_client =
false)
9184 {
9185 if (!IsServerCheck(allow_client))
9186 return;
9187
9189
9191
9194 }
9195
9197 {
9199 }
9200
9202 {
9203 return true;
9204 }
9205
9206
9207
9208
9210 {
9212 }
9213
9215 {
9217 }
9218
9219
9220
9221
9222 override void SetColor(
int r,
int g,
int b,
int a)
9223 {
9229 }
9231 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9232 {
9237 }
9238
9240 {
9242 }
9243
9246 {
9247 int r,g,b,a;
9249 r = r/255;
9250 g = g/255;
9251 b = b/255;
9252 a = a/255;
9253 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9254 }
9255
9256
9257
9258 override void SetLiquidType(
int value,
bool allow_client =
false)
9259 {
9260 if (!IsServerCheck(allow_client))
9261 return;
9262
9267 }
9268
9270 {
9271 return ConfigGetInt("varLiquidTypeInit");
9272 }
9273
9275 {
9277 }
9278
9280 {
9282 SetFrozen(false);
9283 }
9284
9287 {
9288 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9289 }
9290
9291
9294 {
9295 PlayerBase nplayer;
9296 if (PlayerBase.CastTo(nplayer, player))
9297 {
9299
9300 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9301 }
9302 }
9303
9304
9307 {
9308 PlayerBase nplayer;
9309 if (PlayerBase.CastTo(nplayer,player))
9310 {
9311
9312 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9313
9314 }
9315
9316
9317 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9318
9319
9320 if (HasEnergyManager())
9321 {
9322 GetCompEM().UpdatePlugState();
9323 }
9324 }
9325
9326
9328 {
9329 super.OnPlacementStarted(player);
9330
9332 }
9333
9334 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9335 {
9337 {
9338 m_AdminLog.OnPlacementComplete(player,
this);
9339 }
9340
9341 super.OnPlacementComplete(player, position, orientation);
9342 }
9343
9344
9345
9346
9347
9349 {
9351 {
9352 return true;
9353 }
9354 else
9355 {
9356 return false;
9357 }
9358 }
9359
9360
9362 {
9364 {
9366 }
9367 }
9368
9369
9371 {
9373 }
9374
9376 {
9378 }
9379
9380 override void InsertAgent(
int agent,
float count = 1)
9381 {
9382 if (count < 1)
9383 return;
9384
9386 }
9387
9390 {
9392 }
9393
9394
9396 {
9398 }
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9442 {
9444 return false;
9445 return true;
9446 }
9447
9449 {
9450
9452 }
9453
9454
9457 {
9458 super.CheckForRoofLimited(timeTresholdMS);
9459
9461 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9462 {
9463 m_PreviousRoofTestTime = time;
9464 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9465 }
9466 }
9467
9468
9470 {
9472 {
9473 return 0;
9474 }
9475
9476 if (GetInventory().GetAttachmentSlotsCount() != 0)
9477 {
9478 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9479 if (filter)
9480 return filter.GetProtectionLevel(type, false, system);
9481 else
9482 return 0;
9483 }
9484
9485 string subclassPath, entryName;
9486
9487 switch (type)
9488 {
9490 entryName = "biological";
9491 break;
9493 entryName = "chemical";
9494 break;
9495 default:
9496 entryName = "biological";
9497 break;
9498 }
9499
9500 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9501
9503 }
9504
9505
9506
9509 {
9510 if (!IsMagazine())
9512
9514 }
9515
9516
9517
9518
9519
9524 {
9525 return true;
9526 }
9527
9529 {
9531 }
9532
9533
9534
9535
9536
9538 {
9539 if (parent)
9540 {
9541 if (parent.IsInherited(DayZInfected))
9542 return true;
9543
9544 if (!parent.IsRuined())
9545 return true;
9546 }
9547
9548 return true;
9549 }
9550
9552 {
9553 if (!super.CanPutAsAttachment(parent))
9554 {
9555 return false;
9556 }
9557
9558 if (!IsRuined() && !parent.IsRuined())
9559 {
9560 return true;
9561 }
9562
9563 return false;
9564 }
9565
9567 {
9568
9569
9570
9571
9572 return super.CanReceiveItemIntoCargo(item);
9573 }
9574
9576 {
9577
9578
9579
9580
9581 GameInventory attachmentInv = attachment.GetInventory();
9583 {
9584 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9585 return false;
9586 }
9587
9588 InventoryLocation loc = new InventoryLocation();
9589 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9590 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9591 return false;
9592
9593 return super.CanReceiveAttachment(attachment, slotId);
9594 }
9595
9597 {
9598 if (!super.CanReleaseAttachment(attachment))
9599 return false;
9600
9601 return GetInventory().AreChildrenAccessible();
9602 }
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9625 {
9626 int id = muzzle_owner.GetMuzzleID();
9627 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9628
9629 if (WPOF_array)
9630 {
9631 for (int i = 0; i < WPOF_array.Count(); i++)
9632 {
9633 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9634
9635 if (WPOF)
9636 {
9637 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9638 }
9639 }
9640 }
9641 }
9642
9643
9645 {
9646 int id = muzzle_owner.GetMuzzleID();
9648
9649 if (WPOBE_array)
9650 {
9651 for (int i = 0; i < WPOBE_array.Count(); i++)
9652 {
9653 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9654
9655 if (WPOBE)
9656 {
9657 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9658 }
9659 }
9660 }
9661 }
9662
9663
9665 {
9666 int id = muzzle_owner.GetMuzzleID();
9667 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9668
9669 if (WPOOH_array)
9670 {
9671 for (int i = 0; i < WPOOH_array.Count(); i++)
9672 {
9673 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9674
9675 if (WPOOH)
9676 {
9677 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9678 }
9679 }
9680 }
9681 }
9682
9683
9685 {
9686 int id = muzzle_owner.GetMuzzleID();
9687 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9688
9689 if (WPOOH_array)
9690 {
9691 for (int i = 0; i < WPOOH_array.Count(); i++)
9692 {
9693 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9694
9695 if (WPOOH)
9696 {
9697 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9698 }
9699 }
9700 }
9701 }
9702
9703
9705 {
9706 int id = muzzle_owner.GetMuzzleID();
9707 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9708
9709 if (WPOOH_array)
9710 {
9711 for (int i = 0; i < WPOOH_array.Count(); i++)
9712 {
9713 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9714
9715 if (WPOOH)
9716 {
9717 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9718 }
9719 }
9720 }
9721 }
9722
9723
9724
9726 {
9728 {
9729 return true;
9730 }
9731
9732 return false;
9733 }
9734
9736 {
9738 {
9739 return true;
9740 }
9741
9742 return false;
9743 }
9744
9746 {
9748 {
9749 return true;
9750 }
9751
9752 return false;
9753 }
9754
9756 {
9757 return false;
9758 }
9759
9762 {
9763 return UATimeSpent.DEFAULT_DEPLOY;
9764 }
9765
9766
9767
9768
9770 {
9772 SetSynchDirty();
9773 }
9774
9776 {
9778 }
9779
9780
9782 {
9783 return false;
9784 }
9785
9788 {
9789 string att_type = "None";
9790
9791 if (ConfigIsExisting("soundAttType"))
9792 {
9793 att_type = ConfigGetString("soundAttType");
9794 }
9795
9797 }
9798
9800 {
9802 }
9803
9804
9805
9806
9807
9813
9815 {
9818
9820 }
9821
9822
9824 {
9826 return;
9827
9829
9832
9835
9836 SoundParameters params = new SoundParameters();
9840 }
9841
9842
9844 {
9846 return;
9847
9849 SetSynchDirty();
9850
9853 }
9854
9855
9857 {
9859 return;
9860
9862 SetSynchDirty();
9863
9866 }
9867
9869 {
9871 }
9872
9874 {
9876 }
9877
9880 {
9881 if (!
GetGame().IsDedicatedServer())
9882 {
9883 if (ConfigIsExisting("attachSoundSet"))
9884 {
9885 string cfg_path = "";
9886 string soundset = "";
9888
9891 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9892 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9893
9894 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9895 {
9896 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9897 {
9898 if (cfg_slot_array[i] == slot_type)
9899 {
9900 soundset = cfg_soundset_array[i];
9901 break;
9902 }
9903 }
9904 }
9905
9906 if (soundset != "")
9907 {
9908 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9910 }
9911 }
9912 }
9913 }
9914
9916 {
9917
9918 }
9919
9920 void OnApply(PlayerBase player);
9921
9923 {
9924 return 1.0;
9925 };
9926
9928 {
9930 }
9931
9933 {
9935 }
9936
9938
9940 {
9941 SetDynamicPhysicsLifeTime(0.01);
9943 }
9944
9946 {
9947 array<string> zone_names = new array<string>;
9948 GetDamageZones(zone_names);
9949 for (int i = 0; i < zone_names.Count(); i++)
9950 {
9951 SetHealthMax(zone_names.Get(i),"Health");
9952 }
9953 SetHealthMax("","Health");
9954 }
9955
9958 {
9959 float global_health = GetHealth01("","Health");
9960 array<string> zones = new array<string>;
9961 GetDamageZones(zones);
9962
9963 for (int i = 0; i < zones.Count(); i++)
9964 {
9965 SetHealth01(zones.Get(i),"Health",global_health);
9966 }
9967 }
9968
9971 {
9972 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9973 }
9974
9976 {
9977 if (!hasRootAsPlayer)
9978 {
9979 if (refParentIB)
9980 {
9981
9982 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9983 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9984
9985 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9986 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9987
9990 }
9991 else
9992 {
9993
9996 }
9997 }
9998 }
9999
10001 {
10003 {
10004 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10005 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10006 {
10007 float heatPermCoef = 1.0;
10009 while (ent)
10010 {
10011 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10012 ent = ent.GetHierarchyParent();
10013 }
10014
10015 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10016 }
10017 }
10018 }
10019
10021 {
10022
10023 EntityAI parent = GetHierarchyParent();
10024 if (!parent)
10025 {
10026 hasParent = false;
10027 hasRootAsPlayer = false;
10028 }
10029 else
10030 {
10031 hasParent = true;
10032 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10033 refParentIB =
ItemBase.Cast(parent);
10034 }
10035 }
10036
10037 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10038 {
10039
10040 }
10041
10043 {
10044
10045 return false;
10046 }
10047
10049 {
10050
10051
10052 return false;
10053 }
10054
10056 {
10057
10058 return false;
10059 }
10060
10063 {
10064 return !GetIsFrozen() &&
IsOpen();
10065 }
10066
10068 {
10069 bool hasParent = false, hasRootAsPlayer = false;
10071
10072 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10073 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10074
10075 if (wwtu || foodDecay)
10076 {
10080
10081 if (processWetness || processTemperature || processDecay)
10082 {
10084
10085 if (processWetness)
10086 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10087
10088 if (processTemperature)
10090
10091 if (processDecay)
10092 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10093 }
10094 }
10095 }
10096
10099 {
10101 }
10102
10104 {
10107
10108 return super.GetTemperatureFreezeThreshold();
10109 }
10110
10112 {
10115
10116 return super.GetTemperatureThawThreshold();
10117 }
10118
10120 {
10123
10124 return super.GetItemOverheatThreshold();
10125 }
10126
10128 {
10130 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10131
10132 return super.GetTemperatureFreezeTime();
10133 }
10134
10136 {
10138 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10139
10140 return super.GetTemperatureThawTime();
10141 }
10142
10147
10149 {
10150 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10151 }
10152
10154 {
10155 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10156 }
10157
10160 {
10162 }
10163
10165 {
10167 }
10168
10170 {
10172 }
10173
10176 {
10177 return null;
10178 }
10179
10182 {
10183 return false;
10184 }
10185
10187 {
10189 {
10192 if (!trg)
10193 {
10195 explosive = this;
10196 }
10197
10198 explosive.PairRemote(trg);
10200
10201 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10202 trg.SetPersistentPairID(persistentID);
10203 explosive.SetPersistentPairID(persistentID);
10204
10205 return true;
10206 }
10207 return false;
10208 }
10209
10212 {
10213 float ret = 1.0;
10216 ret *= GetHealth01();
10217
10218 return ret;
10219 }
10220
10221 #ifdef DEVELOPER
10222 override void SetDebugItem()
10223 {
10224 super.SetDebugItem();
10225 _itemBase = this;
10226 }
10227
10229 {
10230 string text = super.GetDebugText();
10231
10233 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10234
10235 return text;
10236 }
10237 #endif
10238
10240 {
10241 return true;
10242 }
10243
10245
10247
10249 {
10252 }
10253
10254
10262
10278}
10279
10281{
10283 if (entity)
10284 {
10285 bool is_item = entity.IsInherited(
ItemBase);
10286 if (is_item && full_quantity)
10287 {
10290 }
10291 }
10292 else
10293 {
10295 return NULL;
10296 }
10297 return entity;
10298}
10299
10301{
10302 if (item)
10303 {
10304 if (health > 0)
10305 item.SetHealth("", "", health);
10306
10307 if (item.CanHaveTemperature())
10308 {
10310 if (item.CanFreeze())
10311 item.SetFrozen(false);
10312 }
10313
10314 if (item.HasEnergyManager())
10315 {
10316 if (quantity >= 0)
10317 {
10318 item.GetCompEM().SetEnergy0To1(quantity);
10319 }
10320 else
10321 {
10323 }
10324 }
10325 else if (item.IsMagazine())
10326 {
10327 Magazine mag = Magazine.Cast(item);
10328 if (quantity >= 0)
10329 {
10330 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10331 }
10332 else
10333 {
10335 }
10336
10337 }
10338 else
10339 {
10340 if (quantity >= 0)
10341 {
10342 item.SetQuantityNormalized(quantity, false);
10343 }
10344 else
10345 {
10347 }
10348
10349 }
10350 }
10351}
10352
10353#ifdef DEVELOPER
10355#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
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...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.