5449{
5451 {
5452 return true;
5453 }
5454};
5455
5456
5457
5459{
5463
5465
5468
5469
5470
5471
5472
5481
5487
5492
5497
5518 protected bool m_IsResultOfSplit
5519
5521
5526
5527
5528
5530
5534
5535
5536
5538
5541
5542
5543
5549
5550
5558
5561
5562
5564
5565
5567
5568
5573
5574
5579
5580
5582
5583
5585 {
5590
5591 if (!
GetGame().IsDedicatedServer())
5592 {
5594 {
5596
5598 {
5600 }
5601 }
5602
5605 }
5606
5607 m_OldLocation = null;
5608
5610 {
5612 }
5613
5614 if (ConfigIsExisting("headSelectionsToHide"))
5615 {
5618 }
5619
5621 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5622 {
5624 }
5625
5627
5628 m_IsResultOfSplit = false;
5629
5631 }
5632
5634 {
5635 super.InitItemVariables();
5636
5642 m_Count = ConfigGetInt(
"count");
5643
5646
5651
5654
5659
5671
5675
5676
5679 if (ConfigIsExisting("canBeSplit"))
5680 {
5683 }
5684
5686 if (ConfigIsExisting("itemBehaviour"))
5688
5689
5692 RegisterNetSyncVariableInt("m_VarLiquidType");
5693 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5694
5695 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5696 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5697 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5698
5699 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5700 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5701 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5702 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5703
5704 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5705 RegisterNetSyncVariableBool("m_IsTakeable");
5706 RegisterNetSyncVariableBool("m_IsHologram");
5707
5710 {
5713 }
5714
5716
5718 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5720
5721 }
5722
5724 {
5726 }
5727
5729 {
5732 {
5737 }
5738 }
5739
5740 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5741 {
5743 {
5746 }
5747
5749 }
5750
5752 {
5758 }
5759
5761
5763 {
5765
5766 if (!action)
5767 {
5768 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5769 return;
5770 }
5771
5773 if (!ai)
5774 {
5776 return;
5777 }
5778
5780 if (!action_array)
5781 {
5782 action_array = new array<ActionBase_Basic>;
5784 }
5785 if (LogManager.IsActionLogEnable())
5786 {
5787 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5788 }
5789
5790 if (action_array.Find(action) != -1)
5791 {
5792 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5793 }
5794 else
5795 {
5796 action_array.Insert(action);
5797 }
5798 }
5799
5801 {
5803 ActionBase action = player.GetActionManager().GetAction(actionName);
5806
5807 if (action_array)
5808 {
5809 action_array.RemoveItem(action);
5810 }
5811 }
5812
5813
5814
5816 {
5817 ActionOverrideData overrideData = new ActionOverrideData();
5821
5823 if (!actionMap)
5824 {
5827 }
5828
5829 actionMap.Insert(this.
Type(), overrideData);
5830
5831 }
5832
5834
5836
5837
5839 {
5842
5845
5846 string config_to_search = "CfgVehicles";
5847 string muzzle_owner_config;
5848
5850 {
5851 if (IsInherited(Weapon))
5852 config_to_search = "CfgWeapons";
5853
5854 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5855
5856 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5857
5859
5860 if (config_OnFire_subclass_count > 0)
5861 {
5862 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5863
5864 for (int i = 0; i < config_OnFire_subclass_count; i++)
5865 {
5866 string particle_class = "";
5868 string config_OnFire_entry = config_OnFire_class + particle_class;
5869 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5870 WPOF_array.Insert(WPOF);
5871 }
5872
5873
5875 }
5876 }
5877
5879 {
5880 config_to_search = "CfgWeapons";
5881 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5882
5883 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5884
5886
5887 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5888 {
5889 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5890
5891 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5892 {
5893 string particle_class2 = "";
5895 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5896 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5897 WPOBE_array.Insert(WPOBE);
5898 }
5899
5900
5902 }
5903 }
5904 }
5905
5906
5908 {
5911
5913 {
5914 string config_to_search = "CfgVehicles";
5915
5916 if (IsInherited(Weapon))
5917 config_to_search = "CfgWeapons";
5918
5919 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5920 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5921
5922 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5923 {
5924
5926
5928 {
5930 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5932 return;
5933 }
5934
5937
5938
5939
5941 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5942
5943 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5944 {
5945 string particle_class = "";
5947 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5949
5950 if (entry_type == CT_CLASS)
5951 {
5952 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5953 WPOOH_array.Insert(WPOF);
5954 }
5955 }
5956
5957
5959 }
5960 }
5961 }
5962
5964 {
5966 }
5967
5969 {
5971 {
5973
5976
5979
5980 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5981 }
5982 }
5983
5985 {
5987 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5988
5990 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5991
5993 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5994
5996 {
5998 }
5999 }
6000
6002 {
6004 }
6005
6007 {
6010 else
6012
6014 {
6017 }
6018 else
6019 {
6022
6025 }
6026
6028 }
6029
6031 {
6033 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6034 }
6035
6037 {
6039 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6041 }
6042
6044 {
6046 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6047 }
6048
6050 {
6053
6054 OverheatingParticle OP = new OverheatingParticle();
6059
6061 }
6062
6064 {
6067
6068 return -1;
6069 }
6070
6072 {
6074 {
6077
6078 for (int i = count; i > 0; --i)
6079 {
6080 int id = i - 1;
6083
6086
6087 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6088 {
6089 if (p)
6090 {
6093 }
6094 }
6095 }
6096 }
6097 }
6098
6100 {
6102 {
6104 {
6105 int id = i - 1;
6107
6108 if (OP)
6109 {
6111
6112 if (p)
6113 {
6115 }
6116
6117 delete OP;
6118 }
6119 }
6120
6123 }
6124 }
6125
6128 {
6129 return 0.0;
6130 }
6131
6132
6134 {
6135 return 250;
6136 }
6137
6139 {
6140 return 0;
6141 }
6142
6145 {
6147 return true;
6148
6149 return false;
6150 }
6151
6154 {
6157
6159 {
6161 }
6162 else
6163 {
6164
6166 }
6167
6169 }
6170
6177 {
6178 return -1;
6179 }
6180
6181
6182
6183
6185 {
6187 {
6189 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6190
6191 if (r_index >= 0)
6192 {
6193 InventoryLocation r_il = new InventoryLocation;
6194 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6195
6196 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6199 {
6200 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6201 }
6203 {
6204 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6205 }
6206
6207 }
6208
6209 player.GetHumanInventory().ClearUserReservedLocation(this);
6210 }
6211
6214 }
6215
6216
6217
6218
6220 {
6221 return ItemBase.m_DebugActionsMask;
6222 }
6223
6225 {
6226 return ItemBase.m_DebugActionsMask & mask;
6227 }
6228
6230 {
6231 ItemBase.m_DebugActionsMask = mask;
6232 }
6233
6235 {
6236 ItemBase.m_DebugActionsMask |= mask;
6237 }
6238
6240 {
6241 ItemBase.m_DebugActionsMask &= ~mask;
6242 }
6243
6245 {
6247 {
6249 }
6250 else
6251 {
6253 }
6254 }
6255
6256
6258 {
6259 if (GetEconomyProfile())
6260 {
6261 float q_max = GetEconomyProfile().GetQuantityMax();
6262 if (q_max > 0)
6263 {
6264 float q_min = GetEconomyProfile().GetQuantityMin();
6265 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6266
6268 {
6269 ComponentEnergyManager comp = GetCompEM();
6271 {
6273 }
6274 }
6276 {
6278
6279 }
6280
6281 }
6282 }
6283 }
6284
6287 {
6288 EntityAI parent = GetHierarchyParent();
6289
6290 if (parent)
6291 {
6292 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6293 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6294 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6295 }
6296 }
6297
6300 {
6301 EntityAI parent = GetHierarchyParent();
6302
6303 if (parent)
6304 {
6305 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6306 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6307 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6308 }
6309 }
6310
6312 {
6313
6314
6315
6316
6318
6320 {
6321 if (ScriptInputUserData.CanStoreInputUserData())
6322 {
6323 ScriptInputUserData ctx = new ScriptInputUserData;
6329 ctx.
Write(use_stack_max);
6332
6334 {
6335 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6336 }
6337 }
6338 }
6339 else if (!
GetGame().IsMultiplayer())
6340 {
6342 }
6343 }
6344
6346 {
6348 }
6349
6351 {
6353 }
6354
6356 {
6358 }
6359
6361 {
6362
6363 return false;
6364 }
6365
6367 {
6368 return false;
6369 }
6370
6374 {
6375 return false;
6376 }
6377
6379 {
6380 return "";
6381 }
6382
6384
6386 {
6387 return false;
6388 }
6389
6391 {
6392 return true;
6393 }
6394
6395
6396
6398 {
6399 return true;
6400 }
6401
6403 {
6404 return true;
6405 }
6406
6408 {
6409 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6411 }
6412
6414 {
6416 }
6417
6419 {
6421 if (!is_being_placed)
6423 SetSynchDirty();
6424 }
6425
6426
6428
6430 {
6432 }
6433
6435 {
6437 }
6438
6440 {
6441 return 1;
6442 }
6443
6445 {
6446 return false;
6447 }
6448
6450 {
6452 SetSynchDirty();
6453 }
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6490 {
6491 super.OnMovedInsideCargo(container);
6492
6493 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6494 }
6495
6496 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6497 {
6498 super.EEItemLocationChanged(oldLoc,newLoc);
6499
6500 PlayerBase new_player = null;
6501 PlayerBase old_player = null;
6502
6503 if (newLoc.GetParent())
6504 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6505
6506 if (oldLoc.GetParent())
6507 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6508
6510 {
6511 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6512
6513 if (r_index >= 0)
6514 {
6515 InventoryLocation r_il = new InventoryLocation;
6516 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6517
6518 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6521 {
6522 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6523 }
6525 {
6526 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6527 }
6528
6529 }
6530 }
6531
6533 {
6534 if (new_player)
6535 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6536
6537 if (new_player == old_player)
6538 {
6539
6540 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6541 {
6543 {
6544 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6545 {
6546 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6547 }
6548 }
6549 else
6550 {
6551 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6552 }
6553 }
6554
6555 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6556 {
6557 int type = oldLoc.GetType();
6559 {
6560 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6561 }
6563 {
6564 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6565 }
6566 }
6567 if (!m_OldLocation)
6568 {
6569 m_OldLocation = new InventoryLocation;
6570 }
6571 m_OldLocation.Copy(oldLoc);
6572 }
6573 else
6574 {
6575 if (m_OldLocation)
6576 {
6577 m_OldLocation.Reset();
6578 }
6579 }
6580
6582 }
6583 else
6584 {
6585 if (new_player)
6586 {
6587 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6588 if (res_index >= 0)
6589 {
6590 InventoryLocation il = new InventoryLocation;
6591 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6593 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6596 {
6597 il.
GetParent().GetOnReleaseLock().Invoke(it);
6598 }
6600 {
6602 }
6603
6604 }
6605 }
6607 {
6608
6610 }
6611
6612 if (m_OldLocation)
6613 {
6614 m_OldLocation.Reset();
6615 }
6616 }
6617 }
6618
6619 override void EOnContact(IEntity other, Contact extra)
6620 {
6622 {
6623 int liquidType = -1;
6625 if (impactSpeed > 0.0)
6626 {
6628 #ifndef SERVER
6630 #else
6632 SetSynchDirty();
6633 #endif
6635 }
6636 }
6637
6638 #ifdef SERVER
6639 if (GetCompEM() && GetCompEM().IsPlugged())
6640 {
6641 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6642 GetCompEM().UnplugThis();
6643 }
6644 #endif
6645 }
6646
6648
6650 {
6652 }
6653
6655 {
6656
6657 }
6658
6660 {
6661 super.OnItemLocationChanged(old_owner, new_owner);
6662
6663 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6664 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6665
6666 if (!relatedPlayer && playerNew)
6667 relatedPlayer = playerNew;
6668
6669 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6670 {
6672 if (actionMgr)
6673 {
6674 ActionBase currentAction = actionMgr.GetRunningAction();
6675 if (currentAction)
6677 }
6678 }
6679
6680 Man ownerPlayerOld = null;
6681 Man ownerPlayerNew = null;
6682
6683 if (old_owner)
6684 {
6685 if (old_owner.
IsMan())
6686 {
6687 ownerPlayerOld = Man.Cast(old_owner);
6688 }
6689 else
6690 {
6691 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6692 }
6693 }
6694 else
6695 {
6697 {
6699
6700 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6701 {
6702 GetCompEM().UnplugThis();
6703 }
6704 }
6705 }
6706
6707 if (new_owner)
6708 {
6709 if (new_owner.
IsMan())
6710 {
6711 ownerPlayerNew = Man.Cast(new_owner);
6712 }
6713 else
6714 {
6715 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6716 }
6717 }
6718
6719 if (ownerPlayerOld != ownerPlayerNew)
6720 {
6721 if (ownerPlayerOld)
6722 {
6723 array<EntityAI> subItemsExit = new array<EntityAI>;
6725 for (int i = 0; i < subItemsExit.Count(); i++)
6726 {
6729 }
6730 }
6731
6732 if (ownerPlayerNew)
6733 {
6734 array<EntityAI> subItemsEnter = new array<EntityAI>;
6736 for (int j = 0; j < subItemsEnter.Count(); j++)
6737 {
6740 }
6741 }
6742 }
6743 else if (ownerPlayerNew != null)
6744 {
6745 PlayerBase nplayer;
6746 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6747 {
6748 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6750 for (int k = 0; k < subItemsUpdate.Count(); k++)
6751 {
6753 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6754 }
6755 }
6756 }
6757
6758 if (old_owner)
6759 old_owner.OnChildItemRemoved(this);
6760 if (new_owner)
6761 new_owner.OnChildItemReceived(this);
6762 }
6763
6764
6766 {
6767 super.EEDelete(parent);
6768 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6769 if (player)
6770 {
6772
6773 if (player.IsAlive())
6774 {
6775 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6776 if (r_index >= 0)
6777 {
6778 InventoryLocation r_il = new InventoryLocation;
6779 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6780
6781 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6784 {
6785 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6786 }
6788 {
6789 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6790 }
6791
6792 }
6793
6794 player.RemoveQuickBarEntityShortcut(this);
6795 }
6796 }
6797 }
6798
6800 {
6801 super.EEKilled(killer);
6802
6805 {
6806 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6807 {
6808 if (IsMagazine())
6809 {
6810 if (Magazine.Cast(this).GetAmmoCount() > 0)
6811 {
6813 }
6814 }
6815 else
6816 {
6818 }
6819 }
6820 }
6821 }
6822
6824 {
6825 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6826
6827 super.OnWasAttached(parent, slot_id);
6828
6831
6833 }
6834
6836 {
6837 super.OnWasDetached(parent, slot_id);
6838
6841 }
6842
6844 {
6845 int idx;
6848
6849 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6850 if (inventory_slots.Count() < 1)
6851 {
6852 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6853 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6854 }
6855 else
6856 {
6857 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6858 }
6859
6860 idx = inventory_slots.Find(slot);
6861 if (idx < 0)
6862 return "";
6863
6864 return attach_types.Get(idx);
6865 }
6866
6868 {
6869 int idx = -1;
6870 string slot;
6871
6874
6875 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6876 if (inventory_slots.Count() < 1)
6877 {
6878 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6879 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6880 }
6881 else
6882 {
6883 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6884 if (detach_types.Count() < 1)
6885 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6886 }
6887
6888 for (int i = 0; i < inventory_slots.Count(); i++)
6889 {
6890 slot = inventory_slots.Get(i);
6891 }
6892
6893 if (slot != "")
6894 {
6895 if (detach_types.Count() == 1)
6896 idx = 0;
6897 else
6898 idx = inventory_slots.Find(slot);
6899 }
6900 if (idx < 0)
6901 return "";
6902
6903 return detach_types.Get(idx);
6904 }
6905
6907 {
6908
6910
6911
6912 float min_time = 1;
6913 float max_time = 3;
6914 float delay = Math.RandomFloat(min_time, max_time);
6915
6916 explode_timer.Run(delay, this, "DoAmmoExplosion");
6917 }
6918
6920 {
6921 Magazine magazine = Magazine.Cast(this);
6922 int pop_sounds_count = 6;
6923 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6924
6925
6926 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6927 string sound_name = pop_sounds[ sound_idx ];
6929
6930
6931 magazine.ServerAddAmmoCount(-1);
6932
6933
6934 float min_temp_to_explode = 100;
6935
6936 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
6937 {
6939 }
6940 }
6941
6942
6943 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6944 {
6945 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6946
6947 const int CHANCE_DAMAGE_CARGO = 4;
6948 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6949 const int CHANCE_DAMAGE_NOTHING = 2;
6950
6952 {
6953 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6954 int chances;
6955 int rnd;
6956
6957 if (GetInventory().GetCargo())
6958 {
6959 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6960 rnd = Math.RandomInt(0,chances);
6961
6962 if (rnd < CHANCE_DAMAGE_CARGO)
6963 {
6965 }
6966 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6967 {
6969 }
6970 }
6971 else
6972 {
6973 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6974 rnd = Math.RandomInt(0,chances);
6975
6976 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6977 {
6979 }
6980 }
6981 }
6982 }
6983
6985 {
6986 if (GetInventory().GetCargo())
6987 {
6988 int item_count = GetInventory().GetCargo().GetItemCount();
6989 if (item_count > 0)
6990 {
6991 int random_pick = Math.RandomInt(0, item_count);
6993 if (!item.IsExplosive())
6994 {
6995 item.AddHealth("","",damage);
6996 return true;
6997 }
6998 }
6999 }
7000 return false;
7001 }
7002
7004 {
7005 int attachment_count = GetInventory().AttachmentCount();
7006 if (attachment_count > 0)
7007 {
7008 int random_pick = Math.RandomInt(0, attachment_count);
7009 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7010 if (!attachment.IsExplosive())
7011 {
7012 attachment.AddHealth("","",damage);
7013 return true;
7014 }
7015 }
7016 return false;
7017 }
7018
7020 {
7022 }
7023
7025 {
7027 return GetInventory().CanRemoveEntity();
7028
7029 return false;
7030 }
7031
7033 {
7034
7036 return false;
7037
7038
7040 return false;
7041
7042
7043
7045 if (delta == 0)
7046 return false;
7047
7048
7049 return true;
7050 }
7051
7053 {
7055 {
7056 if (ScriptInputUserData.CanStoreInputUserData())
7057 {
7058 ScriptInputUserData ctx = new ScriptInputUserData;
7063 ctx.
Write(destination_entity);
7067 }
7068 }
7069 else if (!
GetGame().IsMultiplayer())
7070 {
7072 }
7073 }
7074
7076 {
7077 float split_quantity_new;
7081 InventoryLocation loc = new InventoryLocation;
7082
7083 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7084 {
7086 split_quantity_new = stack_max;
7087 else
7089
7091 {
7092 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7093 if (new_item)
7094 {
7095 new_item.SetResultOfSplit(true);
7096 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7098 new_item.
SetQuantity(split_quantity_new,
false,
true);
7099 }
7100 }
7101 }
7102 else if (destination_entity && slot_id == -1)
7103 {
7104 if (quantity > stack_max)
7105 split_quantity_new = stack_max;
7106 else
7107 split_quantity_new = quantity;
7108
7110 {
7112 {
7115 }
7116
7117 if (new_item)
7118 {
7119 new_item.SetResultOfSplit(true);
7120 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7122 new_item.
SetQuantity(split_quantity_new,
false,
true);
7123 }
7124 }
7125 }
7126 else
7127 {
7128 if (stack_max != 0)
7129 {
7131 {
7133 }
7134
7135 if (split_quantity_new == 0)
7136 {
7137 if (!
GetGame().IsMultiplayer())
7138 player.PhysicalPredictiveDropItem(this);
7139 else
7140 player.ServerDropEntity(this);
7141 return;
7142 }
7143
7145 {
7147
7148 if (new_item)
7149 {
7150 new_item.SetResultOfSplit(true);
7151 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7154 new_item.PlaceOnSurface();
7155 }
7156 }
7157 }
7158 }
7159 }
7160
7162 {
7163 float split_quantity_new;
7167 InventoryLocation loc = new InventoryLocation;
7168
7169 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7170 {
7172 split_quantity_new = stack_max;
7173 else
7175
7177 {
7178 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7179 if (new_item)
7180 {
7181 new_item.SetResultOfSplit(true);
7182 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7184 new_item.
SetQuantity(split_quantity_new,
false,
true);
7185 }
7186 }
7187 }
7188 else if (destination_entity && slot_id == -1)
7189 {
7190 if (quantity > stack_max)
7191 split_quantity_new = stack_max;
7192 else
7193 split_quantity_new = quantity;
7194
7196 {
7198 {
7201 }
7202
7203 if (new_item)
7204 {
7205 new_item.SetResultOfSplit(true);
7206 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7208 new_item.
SetQuantity(split_quantity_new,
false,
true);
7209 }
7210 }
7211 }
7212 else
7213 {
7214 if (stack_max != 0)
7215 {
7217 {
7219 }
7220
7222 {
7224
7225 if (new_item)
7226 {
7227 new_item.SetResultOfSplit(true);
7228 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7231 new_item.PlaceOnSurface();
7232 }
7233 }
7234 }
7235 }
7236 }
7237
7239 {
7241 {
7242 if (ScriptInputUserData.CanStoreInputUserData())
7243 {
7244 ScriptInputUserData ctx = new ScriptInputUserData;
7249 dst.WriteToContext(ctx);
7251 }
7252 }
7253 else if (!
GetGame().IsMultiplayer())
7254 {
7256 }
7257 }
7258
7260 {
7262 {
7263 if (ScriptInputUserData.CanStoreInputUserData())
7264 {
7265 ScriptInputUserData ctx = new ScriptInputUserData;
7270 ctx.
Write(destination_entity);
7276 }
7277 }
7278 else if (!
GetGame().IsMultiplayer())
7279 {
7281 }
7282 }
7283
7285 {
7287 }
7288
7290 {
7292 float split_quantity_new;
7294 if (dst.IsValid())
7295 {
7296 int slot_id = dst.GetSlot();
7298
7299 if (quantity > stack_max)
7300 split_quantity_new = stack_max;
7301 else
7302 split_quantity_new = quantity;
7303
7305 {
7307
7308 if (new_item)
7309 {
7310 new_item.SetResultOfSplit(true);
7311 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7313 new_item.
SetQuantity(split_quantity_new,
false,
true);
7314 }
7315
7316 return new_item;
7317 }
7318 }
7319
7320 return null;
7321 }
7322
7324 {
7326 float split_quantity_new;
7328 if (destination_entity)
7329 {
7331 if (quantity > stackable)
7332 split_quantity_new = stackable;
7333 else
7334 split_quantity_new = quantity;
7335
7337 {
7338 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7339 if (new_item)
7340 {
7341 new_item.SetResultOfSplit(true);
7342 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7344 new_item.
SetQuantity(split_quantity_new,
false,
true);
7345 }
7346 }
7347 }
7348 }
7349
7351 {
7353 {
7354 if (ScriptInputUserData.CanStoreInputUserData())
7355 {
7356 ScriptInputUserData ctx = new ScriptInputUserData;
7361 ItemBase destination_entity =
this;
7362 ctx.
Write(destination_entity);
7366 }
7367 }
7368 else if (!
GetGame().IsMultiplayer())
7369 {
7371 }
7372 }
7373
7375 {
7377 float split_quantity_new;
7379 if (player)
7380 {
7382 if (quantity > stackable)
7383 split_quantity_new = stackable;
7384 else
7385 split_quantity_new = quantity;
7386
7388 {
7389 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7390 new_item =
ItemBase.Cast(in_hands);
7391 if (new_item)
7392 {
7393 new_item.SetResultOfSplit(true);
7394 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7396 new_item.SetQuantity(split_quantity_new, false, true);
7397 }
7398 }
7399 }
7400 }
7401
7403 {
7405 float split_quantity_new = Math.Floor(quantity * 0.5);
7406
7408 return;
7409
7411
7412 if (new_item)
7413 {
7414 if (new_item.GetQuantityMax() < split_quantity_new)
7415 {
7416 split_quantity_new = new_item.GetQuantityMax();
7417 }
7418
7419 new_item.SetResultOfSplit(true);
7420 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7421
7423 {
7426 }
7427 else
7428 {
7430 new_item.
SetQuantity(split_quantity_new,
false,
true);
7431 }
7432 }
7433 }
7434
7436 {
7438 float split_quantity_new = Math.Floor(quantity / 2);
7439
7441 return;
7442
7443 InventoryLocation invloc = new InventoryLocation;
7445
7447 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7448
7449 if (new_item)
7450 {
7451 if (new_item.GetQuantityMax() < split_quantity_new)
7452 {
7453 split_quantity_new = new_item.GetQuantityMax();
7454 }
7456 {
7459 }
7460 else if (split_quantity_new > 1)
7461 {
7463 new_item.
SetQuantity(split_quantity_new,
false,
true);
7464 }
7465 }
7466 }
7467
7470 {
7471 SetWeightDirty();
7473
7474 if (parent)
7475 parent.OnAttachmentQuantityChangedEx(this, delta);
7476
7478 {
7480 {
7482 }
7484 {
7485 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7487 }
7488 }
7489
7490 }
7491
7494 {
7495
7496 }
7497
7500 {
7502 }
7503
7505 {
7506 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7507
7509 {
7510 if (newLevel == GameConstants.STATE_RUINED)
7511 {
7513 EntityAI parent = GetHierarchyParent();
7514 if (parent && parent.IsFireplace())
7515 {
7516 CargoBase cargo = GetInventory().GetCargo();
7517 if (cargo)
7518 {
7520 {
7522 }
7523 }
7524 }
7525 }
7526
7528 {
7529
7531 return;
7532 }
7533
7534 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7535 {
7537 }
7538 }
7539 }
7540
7541
7543 {
7544 super.OnRightClick();
7545
7547 {
7549 {
7550 if (ScriptInputUserData.CanStoreInputUserData())
7551 {
7552 EntityAI root = GetHierarchyRoot();
7553 Man playerOwner = GetHierarchyRootPlayer();
7554 InventoryLocation dst = new InventoryLocation;
7555
7556
7557 if (!playerOwner && root && root == this)
7558 {
7560 }
7561 else
7562 {
7563
7564 GetInventory().GetCurrentInventoryLocation(dst);
7566 {
7569 {
7571 }
7572 else
7573 {
7575
7576
7577 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7578 {
7580 }
7581 else
7582 {
7583 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7584 }
7585 }
7586 }
7587 }
7588
7589 ScriptInputUserData ctx = new ScriptInputUserData;
7597 }
7598 }
7599 else if (!
GetGame().IsMultiplayer())
7600 {
7602 }
7603 }
7604 }
7605
7607 {
7608 if (root)
7609 {
7610 vector m4[4];
7611 root.GetTransform(m4);
7612 dst.SetGround(this, m4);
7613 }
7614 else
7615 {
7616 GetInventory().GetCurrentInventoryLocation(dst);
7617 }
7618 }
7619
7620 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7621 {
7622
7623 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7624 return false;
7625
7626 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7627 return false;
7628
7629
7631 return false;
7632
7633
7634 Magazine mag = Magazine.Cast(this);
7635 if (mag)
7636 {
7637 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7638 return false;
7639
7640 if (stack_max_limit)
7641 {
7642 Magazine other_mag = Magazine.Cast(other_item);
7643 if (other_item)
7644 {
7645 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7646 return false;
7647 }
7648
7649 }
7650 }
7651 else
7652 {
7653
7655 return false;
7656
7658 return false;
7659 }
7660
7661 PlayerBase player = null;
7662 if (CastTo(player, GetHierarchyRootPlayer()))
7663 {
7664 if (player.GetInventory().HasAttachment(this))
7665 return false;
7666
7667 if (player.IsItemsToDelete())
7668 return false;
7669 }
7670
7671 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7672 return false;
7673
7674 int slotID;
7676 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7677 return false;
7678
7679 return true;
7680 }
7681
7683 {
7685 }
7686
7688 {
7689 return m_IsResultOfSplit;
7690 }
7691
7693 {
7694 m_IsResultOfSplit = value;
7695 }
7696
7698 {
7700 }
7701
7703 {
7704 float other_item_quantity = other_item.GetQuantity();
7705 float this_free_space;
7706
7708
7710
7711 if (other_item_quantity > this_free_space)
7712 {
7713 return this_free_space;
7714 }
7715 else
7716 {
7717 return other_item_quantity;
7718 }
7719 }
7720
7722 {
7724 }
7725
7727 {
7729 return;
7730
7731 if (!IsMagazine() && other_item)
7732 {
7734 if (quantity_used != 0)
7735 {
7736 float hp1 = GetHealth01("","");
7737 float hp2 = other_item.GetHealth01("","");
7738 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7739 hpResult = hpResult / (
GetQuantity() + quantity_used);
7740
7741 hpResult *= GetMaxHealth();
7742 Math.Round(hpResult);
7743 SetHealth("", "Health", hpResult);
7744
7746 other_item.AddQuantity(-quantity_used);
7747 }
7748 }
7750 }
7751
7753 {
7754 #ifdef SERVER
7755 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7756 GetHierarchyParent().IncreaseLifetimeUp();
7757 #endif
7758 };
7759
7761 {
7762 PlayerBase p = PlayerBase.Cast(player);
7763
7764 array<int> recipesIds = p.m_Recipes;
7765 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7766 if (moduleRecipesManager)
7767 {
7768 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7769 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7770 }
7771
7772 for (int i = 0;i < recipesIds.Count(); i++)
7773 {
7774 int key = recipesIds.Get(i);
7775 string recipeName = moduleRecipesManager.GetRecipeName(key);
7777 }
7778 }
7779
7780
7781 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7782 {
7783 super.GetDebugActions(outputList);
7784
7785
7791
7792
7797
7802
7803
7807
7808
7810 {
7814 }
7815
7818
7819
7823
7825
7826 InventoryLocation loc = new InventoryLocation();
7827 GetInventory().GetCurrentInventoryLocation(loc);
7829 {
7830 if (Gizmo_IsSupported())
7833 }
7834
7836 }
7837
7838
7839
7840
7842 {
7843 super.OnAction(action_id, player, ctx);
7844
7846 {
7847 switch (action_id)
7848 {
7851 return true;
7854 return true;
7855 }
7856 }
7857
7859 {
7860 switch (action_id)
7861 {
7863 Delete();
7864 return true;
7865 }
7866 }
7867
7868 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7869 {
7870 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7871 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7872 PlayerBase p = PlayerBase.Cast(player);
7873 if (
EActions.RECIPES_RANGE_START < 1000)
7874 {
7875 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7876 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7877 }
7878 }
7879 #ifndef SERVER
7880 else if (action_id ==
EActions.WATCH_PLAYER)
7881 {
7882 PluginDeveloper.SetDeveloperItemClientEx(player);
7883 }
7884 #endif
7886 {
7887 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7888 {
7889 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7890 OnDebugButtonPressServer(id + 1);
7891 }
7892
7893 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7894 {
7895 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7897 }
7898
7899 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7900 {
7901 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7903 }
7904
7905 else if (action_id ==
EActions.ADD_QUANTITY)
7906 {
7907 if (IsMagazine())
7908 {
7909 Magazine mag = Magazine.Cast(this);
7910 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7911 }
7912 else
7913 {
7915 }
7916
7917 if (m_EM)
7918 {
7919 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7920 }
7921
7922 }
7923
7924 else if (action_id ==
EActions.REMOVE_QUANTITY)
7925 {
7926 if (IsMagazine())
7927 {
7928 Magazine mag2 = Magazine.Cast(this);
7929 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7930 }
7931 else
7932 {
7934 }
7935 if (m_EM)
7936 {
7937 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7938 }
7939
7940 }
7941
7942 else if (action_id ==
EActions.SET_QUANTITY_0)
7943 {
7945
7946 if (m_EM)
7947 {
7948 m_EM.SetEnergy(0);
7949 }
7950 }
7951
7952 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7953 {
7955
7956 if (m_EM)
7957 {
7958 m_EM.SetEnergy(m_EM.GetEnergyMax());
7959 }
7960 }
7961
7962 else if (action_id ==
EActions.ADD_HEALTH)
7963 {
7964 AddHealth("","",GetMaxHealth("","Health")/5);
7965 }
7966 else if (action_id ==
EActions.REMOVE_HEALTH)
7967 {
7968 AddHealth("","",-GetMaxHealth("","Health")/5);
7969 }
7970 else if (action_id ==
EActions.DESTROY_HEALTH)
7971 {
7972 SetHealth01("","",0);
7973 }
7974 else if (action_id ==
EActions.WATCH_ITEM)
7975 {
7977 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7978 #ifdef DEVELOPER
7979 SetDebugDeveloper_item(this);
7980 #endif
7981 }
7982
7983 else if (action_id ==
EActions.ADD_TEMPERATURE)
7984 {
7985 AddTemperature(20);
7986
7987 }
7988
7989 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7990 {
7991 AddTemperature(-20);
7992
7993 }
7994
7995 else if (action_id ==
EActions.FLIP_FROZEN)
7996 {
7997 SetFrozen(!GetIsFrozen());
7998
7999 }
8000
8001 else if (action_id ==
EActions.ADD_WETNESS)
8002 {
8004
8005 }
8006
8007 else if (action_id ==
EActions.REMOVE_WETNESS)
8008 {
8010
8011 }
8012
8013 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8014 {
8017
8018
8019 }
8020
8021 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8022 {
8025 }
8026
8027 else if (action_id ==
EActions.MAKE_SPECIAL)
8028 {
8029 auto debugParams = DebugSpawnParams.WithPlayer(player);
8030 OnDebugSpawnEx(debugParams);
8031 }
8032
8033 }
8034
8035
8036 return false;
8037 }
8038
8039
8040
8041
8045
8048
8049
8050
8052 {
8053 return false;
8054 }
8055
8056
8058 {
8059 return true;
8060 }
8061
8062
8064 {
8065 return true;
8066 }
8067
8068
8069
8071 {
8072 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8074 }
8075
8078 {
8079 return null;
8080 }
8081
8083 {
8084 return false;
8085 }
8086
8088 {
8089 return false;
8090 }
8091
8095
8096
8098 {
8099 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8100 return module_repairing.CanRepair(this, item_repair_kit);
8101 }
8102
8103
8104 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8105 {
8106 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8107 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8108 }
8109
8110
8112 {
8113
8114
8115
8116
8117
8118
8119
8120
8121 return 1;
8122 }
8123
8124
8125
8127 {
8129 }
8130
8131
8132
8134 {
8136 }
8137
8138
8147 {
8148 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8149
8150 if (player)
8151 {
8152 player.MessageStatus(text);
8153 }
8154 }
8155
8156
8165 {
8166 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8167
8168 if (player)
8169 {
8170 player.MessageAction(text);
8171 }
8172 }
8173
8174
8183 {
8184 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8185
8186 if (player)
8187 {
8188 player.MessageFriendly(text);
8189 }
8190 }
8191
8192
8201 {
8202 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8203
8204 if (player)
8205 {
8206 player.MessageImportant(text);
8207 }
8208 }
8209
8211 {
8212 return true;
8213 }
8214
8215
8216 override bool KindOf(
string tag)
8217 {
8218 bool found = false;
8219 string item_name = this.
GetType();
8222
8223 int array_size = item_tag_array.Count();
8224 for (int i = 0; i < array_size; i++)
8225 {
8226 if (item_tag_array.Get(i) == tag)
8227 {
8228 found = true;
8229 break;
8230 }
8231 }
8232 return found;
8233 }
8234
8235
8237 {
8238
8239 super.OnRPC(sender, rpc_type,ctx);
8240
8241
8242 switch (rpc_type)
8243 {
8244 #ifndef SERVER
8245 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8246 Param2<bool, string> p = new Param2<bool, string>(false, "");
8247
8249 return;
8250
8251 bool play = p.param1;
8252 string soundSet = p.param2;
8253
8254 if (play)
8255 {
8257 {
8259 {
8261 }
8262 }
8263 else
8264 {
8266 }
8267 }
8268 else
8269 {
8271 }
8272
8273 break;
8274 #endif
8275
8276 }
8277
8279 {
8281 }
8282 }
8283
8284
8285
8286
8288 {
8289 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8290 return plugin.GetID(
name);
8291 }
8292
8294 {
8295 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8296 return plugin.GetName(id);
8297 }
8298
8301 {
8302
8303
8304 int varFlags;
8305 if (!ctx.
Read(varFlags))
8306 return;
8307
8308 if (varFlags & ItemVariableFlags.FLOAT)
8309 {
8311 }
8312 }
8313
8315 {
8316
8317 super.SerializeNumericalVars(floats_out);
8318
8319
8320
8322 {
8324 }
8325
8327 {
8329 }
8330
8332 {
8334 }
8335
8337 {
8342 }
8343
8345 {
8347 }
8348 }
8349
8351 {
8352
8353 super.DeSerializeNumericalVars(floats);
8354
8355
8356 int index = 0;
8357 int mask = Math.Round(floats.Get(index));
8358
8359 index++;
8360
8362 {
8364 {
8366 }
8367 else
8368 {
8369 float quantity = floats.Get(index);
8371 }
8372 index++;
8373 }
8374
8376 {
8377 float wet = floats.Get(index);
8379 index++;
8380 }
8381
8383 {
8384 int liquidtype = Math.Round(floats.Get(index));
8386 index++;
8387 }
8388
8390 {
8392 index++;
8394 index++;
8396 index++;
8398 index++;
8399 }
8400
8402 {
8403 int cleanness = Math.Round(floats.Get(index));
8405 index++;
8406 }
8407 }
8408
8410 {
8411 super.WriteVarsToCTX(ctx);
8412
8413
8415 {
8417 }
8418
8420 {
8422 }
8423
8425 {
8427 }
8428
8430 {
8431 int r,g,b,a;
8437 }
8438
8440 {
8442 }
8443 }
8444
8446 {
8447 if (!super.ReadVarsFromCTX(ctx,version))
8448 return false;
8449
8450 int intValue;
8451 float value;
8452
8453 if (version < 140)
8454 {
8455 if (!ctx.
Read(intValue))
8456 return false;
8457
8458 m_VariablesMask = intValue;
8459 }
8460
8462 {
8463 if (!ctx.
Read(value))
8464 return false;
8465
8467 {
8469 }
8470 else
8471 {
8473 }
8474 }
8475
8476 if (version < 140)
8477 {
8479 {
8480 if (!ctx.
Read(value))
8481 return false;
8482 SetTemperatureDirect(value);
8483 }
8484 }
8485
8487 {
8488 if (!ctx.
Read(value))
8489 return false;
8491 }
8492
8494 {
8495 if (!ctx.
Read(intValue))
8496 return false;
8498 }
8499
8501 {
8502 int r,g,b,a;
8504 return false;
8506 return false;
8508 return false;
8510 return false;
8511
8513 }
8514
8516 {
8517 if (!ctx.
Read(intValue))
8518 return false;
8520 }
8521
8522 if (version >= 138 && version < 140)
8523 {
8525 {
8526 if (!ctx.
Read(intValue))
8527 return false;
8528 SetFrozen(intValue);
8529 }
8530 }
8531
8532 return true;
8533 }
8534
8535
8537 {
8540 {
8542 }
8543
8544 if (!super.OnStoreLoad(ctx, version))
8545 {
8547 return false;
8548 }
8549
8550 if (version >= 114)
8551 {
8552 bool hasQuickBarIndexSaved;
8553
8554 if (!ctx.
Read(hasQuickBarIndexSaved))
8555 {
8557 return false;
8558 }
8559
8560 if (hasQuickBarIndexSaved)
8561 {
8562 int itmQBIndex;
8563
8564
8565 if (!ctx.
Read(itmQBIndex))
8566 {
8568 return false;
8569 }
8570
8571 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8572 if (itmQBIndex != -1 && parentPlayer)
8573 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8574 }
8575 }
8576 else
8577 {
8578
8579 PlayerBase player;
8580 int itemQBIndex;
8581 if (version ==
int.
MAX)
8582 {
8583 if (!ctx.
Read(itemQBIndex))
8584 {
8586 return false;
8587 }
8588 }
8589 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8590 {
8591
8592 if (!ctx.
Read(itemQBIndex))
8593 {
8595 return false;
8596 }
8597 if (itemQBIndex != -1 && player)
8598 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8599 }
8600 }
8601
8602 if (version < 140)
8603 {
8604
8605 if (!LoadVariables(ctx, version))
8606 {
8608 return false;
8609 }
8610 }
8611
8612
8614 {
8616 return false;
8617 }
8618 if (version >= 132)
8619 {
8621 if (raib)
8622 {
8624 {
8626 return false;
8627 }
8628 }
8629 }
8630
8632 return true;
8633 }
8634
8635
8636
8638 {
8639 super.OnStoreSave(ctx);
8640
8641 PlayerBase player;
8642 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8643 {
8645
8646 int itemQBIndex = -1;
8647 itemQBIndex = player.FindQuickBarEntityIndex(this);
8648 ctx.
Write(itemQBIndex);
8649 }
8650 else
8651 {
8653 }
8654
8656
8658 if (raib)
8659 {
8661 }
8662 }
8663
8664
8666 {
8667 super.AfterStoreLoad();
8668
8670 {
8672 }
8673
8675 {
8678 }
8679 }
8680
8682 {
8683 super.EEOnAfterLoad();
8684
8686 {
8688 }
8689
8692 }
8693
8695 {
8696 return false;
8697 }
8698
8699
8700
8702 {
8704 {
8705 #ifdef PLATFORM_CONSOLE
8706
8708 {
8710 if (menu)
8711 {
8713 }
8714 }
8715 #endif
8716 }
8717
8719 {
8722 }
8723
8725 {
8726 SetWeightDirty();
8728 }
8730 {
8733 }
8734
8736 {
8739 }
8741 {
8744 }
8745
8746 super.OnVariablesSynchronized();
8747 }
8748
8749
8750
8752 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8753 {
8754 if (!IsServerCheck(allow_client))
8755 return false;
8756
8758 return false;
8759
8762
8763 if (value <= (min + 0.001))
8764 value = min;
8765
8766 if (value == min)
8767 {
8768 if (destroy_config)
8769 {
8770 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8771 if (dstr)
8772 {
8774 this.Delete();
8775 return true;
8776 }
8777 }
8778 else if (destroy_forced)
8779 {
8781 this.Delete();
8782 return true;
8783 }
8784
8786 }
8787
8790
8792 {
8794
8795 if (delta)
8797 }
8798
8800
8801 return false;
8802 }
8803
8804
8806 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8807 {
8809 }
8810
8812 {
8815 }
8816
8818 {
8821 }
8822
8824 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8825 {
8826 float value_clamped = Math.Clamp(value, 0, 1);
8828 SetQuantity(result, destroy_config, destroy_forced);
8829 }
8830
8831
8834 {
8836 }
8837
8839 {
8841 }
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8853 {
8854 int slot = -1;
8855 if (GetInventory())
8856 {
8857 InventoryLocation il = new InventoryLocation;
8858 GetInventory().GetCurrentInventoryLocation(il);
8860 }
8861
8863 }
8864
8866 {
8867 float quantity_max = 0;
8868
8870 {
8871 if (attSlotID != -1)
8872 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8873
8874 if (quantity_max <= 0)
8876 }
8877
8878 if (quantity_max <= 0)
8880
8881 return quantity_max;
8882 }
8883
8885 {
8887 }
8888
8890 {
8892 }
8893
8894
8896 {
8898 }
8899
8901 {
8903 }
8904
8906 {
8908 }
8909
8910
8912 {
8913
8914 float weightEx = GetWeightEx();
8915 float special = GetInventoryAndCargoWeight();
8916 return weightEx - special;
8917 }
8918
8919
8921 {
8923 }
8924
8926 {
8928 {
8929 #ifdef DEVELOPER
8930 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8931 {
8932 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8934 }
8935 #endif
8936
8938 }
8939 else if (HasEnergyManager())
8940 {
8941 #ifdef DEVELOPER
8942 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8943 {
8944 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8945 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8946 }
8947 #endif
8948 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
8949 }
8950 else
8951 {
8952 #ifdef DEVELOPER
8953 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8954 {
8955 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8956 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8957 }
8958 #endif
8959 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
8960 }
8961 }
8962
8965 {
8966 int item_count = 0;
8968
8969 if (GetInventory().GetCargo() != NULL)
8970 {
8971 item_count = GetInventory().GetCargo().GetItemCount();
8972 }
8973
8974 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8975 {
8976 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8977 if (item)
8978 item_count += item.GetNumberOfItems();
8979 }
8980 return item_count;
8981 }
8982
8985 {
8986 float weight = 0;
8987 float wetness = 1;
8988 if (include_wetness)
8991 {
8992 weight = wetness * m_ConfigWeight;
8993 }
8995 {
8996 weight = 1;
8997 }
8998 return weight;
8999 }
9000
9001
9002
9004 {
9005 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9006 {
9007 GameInventory inv = GetInventory();
9008 array<EntityAI> items = new array<EntityAI>;
9010 for (int i = 0; i < items.Count(); i++)
9011 {
9013 if (item)
9014 {
9016 }
9017 }
9018 }
9019 }
9020
9021
9022
9023
9025 {
9026 float energy = 0;
9027 if (HasEnergyManager())
9028 {
9029 energy = GetCompEM().GetEnergy();
9030 }
9031 return energy;
9032 }
9033
9034
9036 {
9037 super.OnEnergyConsumed();
9038
9040 }
9041
9043 {
9044 super.OnEnergyAdded();
9045
9047 }
9048
9049
9051 {
9052 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9053 {
9055 {
9056 float energy_0to1 = GetCompEM().GetEnergy0To1();
9058 }
9059 }
9060 }
9061
9062
9064 {
9065 return ConfigGetFloat("heatIsolation");
9066 }
9067
9069 {
9071 }
9072
9074 {
9075 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9076 if (
GetGame().ConfigIsExisting(paramPath))
9078
9079 return 0.0;
9080 }
9081
9083 {
9084 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9085 if (
GetGame().ConfigIsExisting(paramPath))
9087
9088 return 0.0;
9089 }
9090
9091 override void SetWet(
float value,
bool allow_client =
false)
9092 {
9093 if (!IsServerCheck(allow_client))
9094 return;
9095
9098
9100
9101 m_VarWet = Math.Clamp(value, min, max);
9102
9104 {
9107 }
9108 }
9109
9110 override void AddWet(
float value)
9111 {
9113 }
9114
9116 {
9118 }
9119
9121 {
9123 }
9124
9126 {
9128 }
9129
9131 {
9133 }
9134
9136 {
9138 }
9139
9141 {
9144 if (newLevel != oldLevel)
9145 {
9147 }
9148 }
9149
9151 {
9152 SetWeightDirty();
9153 }
9154
9156 {
9157 return GetWetLevelInternal(
m_VarWet);
9158 }
9159
9160
9161
9163 {
9165 }
9166
9168 {
9170 }
9171
9173 {
9175 }
9176
9178 {
9180 }
9181
9182
9183
9185 {
9186 if (ConfigIsExisting("itemModelLength"))
9187 {
9188 return ConfigGetFloat("itemModelLength");
9189 }
9190 return 0;
9191 }
9192
9194 {
9195 if (ConfigIsExisting("itemAttachOffset"))
9196 {
9197 return ConfigGetFloat("itemAttachOffset");
9198 }
9199 return 0;
9200 }
9201
9202 override void SetCleanness(
int value,
bool allow_client =
false)
9203 {
9204 if (!IsServerCheck(allow_client))
9205 return;
9206
9208
9210
9213 }
9214
9216 {
9218 }
9219
9221 {
9222 return true;
9223 }
9224
9225
9226
9227
9229 {
9231 }
9232
9234 {
9236 }
9237
9238
9239
9240
9241 override void SetColor(
int r,
int g,
int b,
int a)
9242 {
9248 }
9250 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9251 {
9256 }
9257
9259 {
9261 }
9262
9265 {
9266 int r,g,b,a;
9268 r = r/255;
9269 g = g/255;
9270 b = b/255;
9271 a = a/255;
9272 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9273 }
9274
9275
9276
9277 override void SetLiquidType(
int value,
bool allow_client =
false)
9278 {
9279 if (!IsServerCheck(allow_client))
9280 return;
9281
9286 }
9287
9289 {
9290 return ConfigGetInt("varLiquidTypeInit");
9291 }
9292
9294 {
9296 }
9297
9299 {
9301 SetFrozen(false);
9302 }
9303
9306 {
9307 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9308 }
9309
9310
9313 {
9314 PlayerBase nplayer;
9315 if (PlayerBase.CastTo(nplayer, player))
9316 {
9318
9319 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9320 }
9321 }
9322
9323
9326 {
9327 PlayerBase nplayer;
9328 if (PlayerBase.CastTo(nplayer,player))
9329 {
9330
9331 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9332
9333 }
9334
9335
9336 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9337
9338
9339 if (HasEnergyManager())
9340 {
9341 GetCompEM().UpdatePlugState();
9342 }
9343 }
9344
9345
9347 {
9348 super.OnPlacementStarted(player);
9349
9351 }
9352
9353 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9354 {
9356 {
9357 m_AdminLog.OnPlacementComplete(player,
this);
9358 }
9359
9360 super.OnPlacementComplete(player, position, orientation);
9361 }
9362
9363
9364
9365
9366
9368 {
9370 {
9371 return true;
9372 }
9373 else
9374 {
9375 return false;
9376 }
9377 }
9378
9379
9381 {
9383 {
9385 }
9386 }
9387
9388
9390 {
9392 }
9393
9395 {
9397 }
9398
9399 override void InsertAgent(
int agent,
float count = 1)
9400 {
9401 if (count < 1)
9402 return;
9403
9405 }
9406
9409 {
9411 }
9412
9413
9415 {
9417 }
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9461 {
9463 return false;
9464 return true;
9465 }
9466
9468 {
9469
9471 }
9472
9473
9476 {
9477 super.CheckForRoofLimited(timeTresholdMS);
9478
9480 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9481 {
9482 m_PreviousRoofTestTime = time;
9483 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9484 }
9485 }
9486
9487
9489 {
9491 {
9492 return 0;
9493 }
9494
9495 if (GetInventory().GetAttachmentSlotsCount() != 0)
9496 {
9497 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9498 if (filter)
9499 return filter.GetProtectionLevel(type, false, system);
9500 else
9501 return 0;
9502 }
9503
9504 string subclassPath, entryName;
9505
9506 switch (type)
9507 {
9509 entryName = "biological";
9510 break;
9512 entryName = "chemical";
9513 break;
9514 default:
9515 entryName = "biological";
9516 break;
9517 }
9518
9519 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9520
9522 }
9523
9524
9525
9528 {
9529 if (!IsMagazine())
9531
9533 }
9534
9535
9536
9537
9538
9543 {
9544 return true;
9545 }
9546
9548 {
9550 }
9551
9552
9553
9554
9555
9557 {
9558 if (parent)
9559 {
9560 if (parent.IsInherited(DayZInfected))
9561 return true;
9562
9563 if (!parent.IsRuined())
9564 return true;
9565 }
9566
9567 return true;
9568 }
9569
9571 {
9572 if (!super.CanPutAsAttachment(parent))
9573 {
9574 return false;
9575 }
9576
9577 if (!IsRuined() && !parent.IsRuined())
9578 {
9579 return true;
9580 }
9581
9582 return false;
9583 }
9584
9586 {
9587
9588
9589
9590
9591 return super.CanReceiveItemIntoCargo(item);
9592 }
9593
9595 {
9596
9597
9598
9599
9600 GameInventory attachmentInv = attachment.GetInventory();
9602 {
9603 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9604 return false;
9605 }
9606
9607 InventoryLocation loc = new InventoryLocation();
9608 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9609 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9610 return false;
9611
9612 return super.CanReceiveAttachment(attachment, slotId);
9613 }
9614
9616 {
9617 if (!super.CanReleaseAttachment(attachment))
9618 return false;
9619
9620 return GetInventory().AreChildrenAccessible();
9621 }
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9644 {
9645 int id = muzzle_owner.GetMuzzleID();
9646 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9647
9648 if (WPOF_array)
9649 {
9650 for (int i = 0; i < WPOF_array.Count(); i++)
9651 {
9652 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9653
9654 if (WPOF)
9655 {
9656 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9657 }
9658 }
9659 }
9660 }
9661
9662
9664 {
9665 int id = muzzle_owner.GetMuzzleID();
9667
9668 if (WPOBE_array)
9669 {
9670 for (int i = 0; i < WPOBE_array.Count(); i++)
9671 {
9672 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9673
9674 if (WPOBE)
9675 {
9676 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9677 }
9678 }
9679 }
9680 }
9681
9682
9684 {
9685 int id = muzzle_owner.GetMuzzleID();
9686 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9687
9688 if (WPOOH_array)
9689 {
9690 for (int i = 0; i < WPOOH_array.Count(); i++)
9691 {
9692 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9693
9694 if (WPOOH)
9695 {
9696 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9697 }
9698 }
9699 }
9700 }
9701
9702
9704 {
9705 int id = muzzle_owner.GetMuzzleID();
9706 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9707
9708 if (WPOOH_array)
9709 {
9710 for (int i = 0; i < WPOOH_array.Count(); i++)
9711 {
9712 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9713
9714 if (WPOOH)
9715 {
9716 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9717 }
9718 }
9719 }
9720 }
9721
9722
9724 {
9725 int id = muzzle_owner.GetMuzzleID();
9726 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9727
9728 if (WPOOH_array)
9729 {
9730 for (int i = 0; i < WPOOH_array.Count(); i++)
9731 {
9732 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9733
9734 if (WPOOH)
9735 {
9736 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9737 }
9738 }
9739 }
9740 }
9741
9742
9743
9745 {
9747 {
9748 return true;
9749 }
9750
9751 return false;
9752 }
9753
9755 {
9757 {
9758 return true;
9759 }
9760
9761 return false;
9762 }
9763
9765 {
9767 {
9768 return true;
9769 }
9770
9771 return false;
9772 }
9773
9775 {
9776 return false;
9777 }
9778
9781 {
9782 return UATimeSpent.DEFAULT_DEPLOY;
9783 }
9784
9785
9786
9787
9789 {
9791 SetSynchDirty();
9792 }
9793
9795 {
9797 }
9798
9799
9801 {
9802 return false;
9803 }
9804
9807 {
9808 string att_type = "None";
9809
9810 if (ConfigIsExisting("soundAttType"))
9811 {
9812 att_type = ConfigGetString("soundAttType");
9813 }
9814
9816 }
9817
9819 {
9821 }
9822
9823
9824
9825
9826
9832
9834 {
9837
9839 }
9840
9841
9843 {
9845 return;
9846
9848
9851
9854
9855 SoundParameters params = new SoundParameters();
9859 }
9860
9861
9863 {
9865 return;
9866
9868 SetSynchDirty();
9869
9872 }
9873
9874
9876 {
9878 return;
9879
9881 SetSynchDirty();
9882
9885 }
9886
9888 {
9890 }
9891
9893 {
9895 }
9896
9899 {
9900 if (!
GetGame().IsDedicatedServer())
9901 {
9902 if (ConfigIsExisting("attachSoundSet"))
9903 {
9904 string cfg_path = "";
9905 string soundset = "";
9907
9910 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9911 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9912
9913 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9914 {
9915 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9916 {
9917 if (cfg_slot_array[i] == slot_type)
9918 {
9919 soundset = cfg_soundset_array[i];
9920 break;
9921 }
9922 }
9923 }
9924
9925 if (soundset != "")
9926 {
9927 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9929 }
9930 }
9931 }
9932 }
9933
9935 {
9936
9937 }
9938
9939 void OnApply(PlayerBase player);
9940
9942 {
9943 return 1.0;
9944 };
9945
9947 {
9949 }
9950
9952 {
9954 }
9955
9957
9959 {
9960 SetDynamicPhysicsLifeTime(0.01);
9962 }
9963
9965 {
9966 array<string> zone_names = new array<string>;
9967 GetDamageZones(zone_names);
9968 for (int i = 0; i < zone_names.Count(); i++)
9969 {
9970 SetHealthMax(zone_names.Get(i),"Health");
9971 }
9972 SetHealthMax("","Health");
9973 }
9974
9977 {
9978 float global_health = GetHealth01("","Health");
9979 array<string> zones = new array<string>;
9980 GetDamageZones(zones);
9981
9982 for (int i = 0; i < zones.Count(); i++)
9983 {
9984 SetHealth01(zones.Get(i),"Health",global_health);
9985 }
9986 }
9987
9990 {
9991 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9992 }
9993
9995 {
9996 if (!hasRootAsPlayer)
9997 {
9998 if (refParentIB)
9999 {
10000
10001 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10002 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10003
10004 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10005 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10006
10009 }
10010 else
10011 {
10012
10015 }
10016 }
10017 }
10018
10020 {
10022 {
10023 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10024 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10025 {
10026 float heatPermCoef = 1.0;
10028 while (ent)
10029 {
10030 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10031 ent = ent.GetHierarchyParent();
10032 }
10033
10034 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10035 }
10036 }
10037 }
10038
10040 {
10041
10042 EntityAI parent = GetHierarchyParent();
10043 if (!parent)
10044 {
10045 hasParent = false;
10046 hasRootAsPlayer = false;
10047 }
10048 else
10049 {
10050 hasParent = true;
10051 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10052 refParentIB =
ItemBase.Cast(parent);
10053 }
10054 }
10055
10056 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10057 {
10058
10059 }
10060
10062 {
10063
10064 return false;
10065 }
10066
10068 {
10069
10070
10071 return false;
10072 }
10073
10075 {
10076
10077 return false;
10078 }
10079
10082 {
10083 return !GetIsFrozen() &&
IsOpen();
10084 }
10085
10087 {
10088 bool hasParent = false, hasRootAsPlayer = false;
10090
10091 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10092 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10093
10094 if (wwtu || foodDecay)
10095 {
10099
10100 if (processWetness || processTemperature || processDecay)
10101 {
10103
10104 if (processWetness)
10105 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10106
10107 if (processTemperature)
10109
10110 if (processDecay)
10111 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10112 }
10113 }
10114 }
10115
10118 {
10120 }
10121
10123 {
10126
10127 return super.GetTemperatureFreezeThreshold();
10128 }
10129
10131 {
10134
10135 return super.GetTemperatureThawThreshold();
10136 }
10137
10139 {
10142
10143 return super.GetItemOverheatThreshold();
10144 }
10145
10147 {
10149 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10150
10151 return super.GetTemperatureFreezeTime();
10152 }
10153
10155 {
10157 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10158
10159 return super.GetTemperatureThawTime();
10160 }
10161
10166
10168 {
10169 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10170 }
10171
10173 {
10174 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10175 }
10176
10179 {
10181 }
10182
10184 {
10186 }
10187
10189 {
10191 }
10192
10195 {
10196 return null;
10197 }
10198
10201 {
10202 return false;
10203 }
10204
10206 {
10208 {
10211 if (!trg)
10212 {
10214 explosive = this;
10215 }
10216
10217 explosive.PairRemote(trg);
10219
10220 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10221 trg.SetPersistentPairID(persistentID);
10222 explosive.SetPersistentPairID(persistentID);
10223
10224 return true;
10225 }
10226 return false;
10227 }
10228
10231 {
10232 float ret = 1.0;
10235 ret *= GetHealth01();
10236
10237 return ret;
10238 }
10239
10240 #ifdef DEVELOPER
10241 override void SetDebugItem()
10242 {
10243 super.SetDebugItem();
10244 _itemBase = this;
10245 }
10246
10248 {
10249 string text = super.GetDebugText();
10250
10252 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10253
10254 return text;
10255 }
10256 #endif
10257
10259 {
10260 return true;
10261 }
10262
10264
10266
10268 {
10271 }
10272
10273
10281
10297}
10298
10300{
10302 if (entity)
10303 {
10304 bool is_item = entity.IsInherited(
ItemBase);
10305 if (is_item && full_quantity)
10306 {
10309 }
10310 }
10311 else
10312 {
10314 return NULL;
10315 }
10316 return entity;
10317}
10318
10320{
10321 if (item)
10322 {
10323 if (health > 0)
10324 item.SetHealth("", "", health);
10325
10326 if (item.CanHaveTemperature())
10327 {
10329 if (item.CanFreeze())
10330 item.SetFrozen(false);
10331 }
10332
10333 if (item.HasEnergyManager())
10334 {
10335 if (quantity >= 0)
10336 {
10337 item.GetCompEM().SetEnergy0To1(quantity);
10338 }
10339 else
10340 {
10342 }
10343 }
10344 else if (item.IsMagazine())
10345 {
10346 Magazine mag = Magazine.Cast(item);
10347 if (quantity >= 0)
10348 {
10349 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10350 }
10351 else
10352 {
10354 }
10355
10356 }
10357 else
10358 {
10359 if (quantity >= 0)
10360 {
10361 item.SetQuantityNormalized(quantity, false);
10362 }
10363 else
10364 {
10366 }
10367
10368 }
10369 }
10370}
10371
10372#ifdef DEVELOPER
10374#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.