5472{
5474 {
5475 return true;
5476 }
5477};
5478
5479
5480
5482{
5486
5488
5491
5492
5493
5494
5495
5504
5510
5515
5520
5541 protected bool m_IsResultOfSplit
5542
5544
5549
5550
5551
5553
5557
5558
5559
5561
5564
5565
5566
5572
5573
5581
5584
5585
5587
5588
5590
5591
5596
5597
5602
5603
5605
5606
5608 {
5613
5614 if (!
GetGame().IsDedicatedServer())
5615 {
5617 {
5619
5621 {
5623 }
5624 }
5625
5628 }
5629
5630 m_OldLocation = null;
5631
5633 {
5635 }
5636
5637 if (ConfigIsExisting("headSelectionsToHide"))
5638 {
5641 }
5642
5644 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5645 {
5647 }
5648
5650
5651 m_IsResultOfSplit = false;
5652
5654 }
5655
5657 {
5658 super.InitItemVariables();
5659
5665 m_Count = ConfigGetInt(
"count");
5666
5669
5674
5677
5682
5694
5698
5699
5702 if (ConfigIsExisting("canBeSplit"))
5703 {
5706 }
5707
5709 if (ConfigIsExisting("itemBehaviour"))
5711
5712
5715 RegisterNetSyncVariableInt("m_VarLiquidType");
5716 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5717
5718 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5719 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5720 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5721
5722 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5723 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5724 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5725 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5726
5727 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5728 RegisterNetSyncVariableBool("m_IsTakeable");
5729 RegisterNetSyncVariableBool("m_IsHologram");
5730
5733 {
5736 }
5737
5739
5741 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5743
5744 }
5745
5747 {
5749 }
5750
5752 {
5755 {
5760 }
5761 }
5762
5763 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5764 {
5766 {
5769 }
5770
5772 }
5773
5775 {
5781 }
5782
5784
5786 {
5788
5789 if (!action)
5790 {
5791 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5792 return;
5793 }
5794
5796 if (!ai)
5797 {
5799 return;
5800 }
5801
5803 if (!action_array)
5804 {
5805 action_array = new array<ActionBase_Basic>;
5807 }
5808 if (LogManager.IsActionLogEnable())
5809 {
5810 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5811 }
5812
5813 if (action_array.Find(action) != -1)
5814 {
5815 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5816 }
5817 else
5818 {
5819 action_array.Insert(action);
5820 }
5821 }
5822
5824 {
5826 ActionBase action = player.GetActionManager().GetAction(actionName);
5829
5830 if (action_array)
5831 {
5832 action_array.RemoveItem(action);
5833 }
5834 }
5835
5836
5837
5839 {
5840 ActionOverrideData overrideData = new ActionOverrideData();
5844
5846 if (!actionMap)
5847 {
5850 }
5851
5852 actionMap.Insert(this.
Type(), overrideData);
5853
5854 }
5855
5857
5859
5860
5862 {
5865
5868
5869 string config_to_search = "CfgVehicles";
5870 string muzzle_owner_config;
5871
5873 {
5874 if (IsInherited(Weapon))
5875 config_to_search = "CfgWeapons";
5876
5877 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5878
5879 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5880
5882
5883 if (config_OnFire_subclass_count > 0)
5884 {
5885 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5886
5887 for (int i = 0; i < config_OnFire_subclass_count; i++)
5888 {
5889 string particle_class = "";
5891 string config_OnFire_entry = config_OnFire_class + particle_class;
5892 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5893 WPOF_array.Insert(WPOF);
5894 }
5895
5896
5898 }
5899 }
5900
5902 {
5903 config_to_search = "CfgWeapons";
5904 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5905
5906 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5907
5909
5910 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5911 {
5912 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5913
5914 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5915 {
5916 string particle_class2 = "";
5918 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5919 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5920 WPOBE_array.Insert(WPOBE);
5921 }
5922
5923
5925 }
5926 }
5927 }
5928
5929
5931 {
5934
5936 {
5937 string config_to_search = "CfgVehicles";
5938
5939 if (IsInherited(Weapon))
5940 config_to_search = "CfgWeapons";
5941
5942 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5943 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5944
5945 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5946 {
5947
5949
5951 {
5953 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5955 return;
5956 }
5957
5960
5961
5962
5964 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5965
5966 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5967 {
5968 string particle_class = "";
5970 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5972
5973 if (entry_type == CT_CLASS)
5974 {
5975 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5976 WPOOH_array.Insert(WPOF);
5977 }
5978 }
5979
5980
5982 }
5983 }
5984 }
5985
5987 {
5989 }
5990
5992 {
5994 {
5996
5999
6002
6003 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6004 }
6005 }
6006
6008 {
6010 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6011
6013 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6014
6016 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6017
6019 {
6021 }
6022 }
6023
6025 {
6027 }
6028
6030 {
6033 else
6035
6037 {
6040 }
6041 else
6042 {
6045
6048 }
6049
6051 }
6052
6054 {
6056 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6057 }
6058
6060 {
6062 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6064 }
6065
6067 {
6069 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6070 }
6071
6073 {
6076
6077 OverheatingParticle OP = new OverheatingParticle();
6082
6084 }
6085
6087 {
6090
6091 return -1;
6092 }
6093
6095 {
6097 {
6100
6101 for (int i = count; i > 0; --i)
6102 {
6103 int id = i - 1;
6106
6109
6110 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6111 {
6112 if (p)
6113 {
6116 }
6117 }
6118 }
6119 }
6120 }
6121
6123 {
6125 {
6127 {
6128 int id = i - 1;
6130
6131 if (OP)
6132 {
6134
6135 if (p)
6136 {
6138 }
6139
6140 delete OP;
6141 }
6142 }
6143
6146 }
6147 }
6148
6151 {
6152 return 0.0;
6153 }
6154
6155
6157 {
6158 return 250;
6159 }
6160
6162 {
6163 return 0;
6164 }
6165
6168 {
6170 return true;
6171
6172 return false;
6173 }
6174
6177 {
6180
6182 {
6184 }
6185 else
6186 {
6187
6189 }
6190
6192 }
6193
6200 {
6201 return -1;
6202 }
6203
6204
6205
6206
6208 {
6210 {
6212 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6213
6214 if (r_index >= 0)
6215 {
6216 InventoryLocation r_il = new InventoryLocation;
6217 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6218
6219 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6222 {
6223 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6224 }
6226 {
6227 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6228 }
6229
6230 }
6231
6232 player.GetHumanInventory().ClearUserReservedLocation(this);
6233 }
6234
6237 }
6238
6239
6240
6241
6243 {
6244 return ItemBase.m_DebugActionsMask;
6245 }
6246
6248 {
6249 return ItemBase.m_DebugActionsMask & mask;
6250 }
6251
6253 {
6254 ItemBase.m_DebugActionsMask = mask;
6255 }
6256
6258 {
6259 ItemBase.m_DebugActionsMask |= mask;
6260 }
6261
6263 {
6264 ItemBase.m_DebugActionsMask &= ~mask;
6265 }
6266
6268 {
6270 {
6272 }
6273 else
6274 {
6276 }
6277 }
6278
6279
6281 {
6282 if (GetEconomyProfile())
6283 {
6284 float q_max = GetEconomyProfile().GetQuantityMax();
6285 if (q_max > 0)
6286 {
6287 float q_min = GetEconomyProfile().GetQuantityMin();
6288 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6289
6291 {
6292 ComponentEnergyManager comp = GetCompEM();
6294 {
6296 }
6297 }
6299 {
6301
6302 }
6303
6304 }
6305 }
6306 }
6307
6310 {
6311 EntityAI parent = GetHierarchyParent();
6312
6313 if (parent)
6314 {
6315 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6316 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6317 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6318 }
6319 }
6320
6323 {
6324 EntityAI parent = GetHierarchyParent();
6325
6326 if (parent)
6327 {
6328 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6329 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6330 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6331 }
6332 }
6333
6335 {
6336
6337
6338
6339
6341
6343 {
6344 if (ScriptInputUserData.CanStoreInputUserData())
6345 {
6346 ScriptInputUserData ctx = new ScriptInputUserData;
6352 ctx.
Write(use_stack_max);
6355
6357 {
6358 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6359 }
6360 }
6361 }
6362 else if (!
GetGame().IsMultiplayer())
6363 {
6365 }
6366 }
6367
6369 {
6371 }
6372
6374 {
6376 }
6377
6379 {
6381 }
6382
6384 {
6385
6386 return false;
6387 }
6388
6390 {
6391 return false;
6392 }
6393
6397 {
6398 return false;
6399 }
6400
6402 {
6403 return "";
6404 }
6405
6407
6409 {
6410 return false;
6411 }
6412
6414 {
6415 return true;
6416 }
6417
6418
6419
6421 {
6422 return true;
6423 }
6424
6426 {
6427 return true;
6428 }
6429
6431 {
6432 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6434 }
6435
6437 {
6439 }
6440
6442 {
6444 if (!is_being_placed)
6446 SetSynchDirty();
6447 }
6448
6449
6451
6453 {
6455 }
6456
6458 {
6460 }
6461
6463 {
6464 return 1;
6465 }
6466
6468 {
6469 return false;
6470 }
6471
6473 {
6475 SetSynchDirty();
6476 }
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6513 {
6514 super.OnMovedInsideCargo(container);
6515
6516 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6517 }
6518
6519 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6520 {
6521 super.EEItemLocationChanged(oldLoc,newLoc);
6522
6523 PlayerBase new_player = null;
6524 PlayerBase old_player = null;
6525
6526 if (newLoc.GetParent())
6527 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6528
6529 if (oldLoc.GetParent())
6530 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6531
6533 {
6534 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6535
6536 if (r_index >= 0)
6537 {
6538 InventoryLocation r_il = new InventoryLocation;
6539 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6540
6541 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6544 {
6545 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6546 }
6548 {
6549 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6550 }
6551
6552 }
6553 }
6554
6556 {
6557 if (new_player)
6558 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6559
6560 if (new_player == old_player)
6561 {
6562
6563 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6564 {
6566 {
6567 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6568 {
6569 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6570 }
6571 }
6572 else
6573 {
6574 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6575 }
6576 }
6577
6578 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6579 {
6580 int type = oldLoc.GetType();
6582 {
6583 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6584 }
6586 {
6587 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6588 }
6589 }
6590 if (!m_OldLocation)
6591 {
6592 m_OldLocation = new InventoryLocation;
6593 }
6594 m_OldLocation.Copy(oldLoc);
6595 }
6596 else
6597 {
6598 if (m_OldLocation)
6599 {
6600 m_OldLocation.Reset();
6601 }
6602 }
6603
6605 }
6606 else
6607 {
6608 if (new_player)
6609 {
6610 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6611 if (res_index >= 0)
6612 {
6613 InventoryLocation il = new InventoryLocation;
6614 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6616 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6619 {
6620 il.
GetParent().GetOnReleaseLock().Invoke(it);
6621 }
6623 {
6625 }
6626
6627 }
6628 }
6630 {
6631
6633 }
6634
6635 if (m_OldLocation)
6636 {
6637 m_OldLocation.Reset();
6638 }
6639 }
6640 }
6641
6642 override void EOnContact(IEntity other, Contact extra)
6643 {
6645 {
6646 int liquidType = -1;
6648 if (impactSpeed > 0.0)
6649 {
6651 #ifndef SERVER
6653 #else
6655 SetSynchDirty();
6656 #endif
6658 }
6659 }
6660
6661 #ifdef SERVER
6662 if (GetCompEM() && GetCompEM().IsPlugged())
6663 {
6664 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6665 GetCompEM().UnplugThis();
6666 }
6667 #endif
6668 }
6669
6671
6673 {
6675 }
6676
6678 {
6679
6680 }
6681
6683 {
6684 super.OnItemLocationChanged(old_owner, new_owner);
6685
6686 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6687 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6688
6689 if (!relatedPlayer && playerNew)
6690 relatedPlayer = playerNew;
6691
6692 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6693 {
6695 if (actionMgr)
6696 {
6697 ActionBase currentAction = actionMgr.GetRunningAction();
6698 if (currentAction)
6700 }
6701 }
6702
6703 Man ownerPlayerOld = null;
6704 Man ownerPlayerNew = null;
6705
6706 if (old_owner)
6707 {
6708 if (old_owner.
IsMan())
6709 {
6710 ownerPlayerOld = Man.Cast(old_owner);
6711 }
6712 else
6713 {
6714 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6715 }
6716 }
6717 else
6718 {
6720 {
6722
6723 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6724 {
6725 GetCompEM().UnplugThis();
6726 }
6727 }
6728 }
6729
6730 if (new_owner)
6731 {
6732 if (new_owner.
IsMan())
6733 {
6734 ownerPlayerNew = Man.Cast(new_owner);
6735 }
6736 else
6737 {
6738 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6739 }
6740 }
6741
6742 if (ownerPlayerOld != ownerPlayerNew)
6743 {
6744 if (ownerPlayerOld)
6745 {
6746 array<EntityAI> subItemsExit = new array<EntityAI>;
6748 for (int i = 0; i < subItemsExit.Count(); i++)
6749 {
6752 }
6753 }
6754
6755 if (ownerPlayerNew)
6756 {
6757 array<EntityAI> subItemsEnter = new array<EntityAI>;
6759 for (int j = 0; j < subItemsEnter.Count(); j++)
6760 {
6763 }
6764 }
6765 }
6766 else if (ownerPlayerNew != null)
6767 {
6768 PlayerBase nplayer;
6769 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6770 {
6771 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6773 for (int k = 0; k < subItemsUpdate.Count(); k++)
6774 {
6776 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6777 }
6778 }
6779 }
6780
6781 if (old_owner)
6782 old_owner.OnChildItemRemoved(this);
6783 if (new_owner)
6784 new_owner.OnChildItemReceived(this);
6785 }
6786
6787
6789 {
6790 super.EEDelete(parent);
6791 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6792 if (player)
6793 {
6795
6796 if (player.IsAlive())
6797 {
6798 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6799 if (r_index >= 0)
6800 {
6801 InventoryLocation r_il = new InventoryLocation;
6802 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6803
6804 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6807 {
6808 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6809 }
6811 {
6812 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6813 }
6814
6815 }
6816
6817 player.RemoveQuickBarEntityShortcut(this);
6818 }
6819 }
6820 }
6821
6823 {
6824 super.EEKilled(killer);
6825
6828 {
6829 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6830 {
6831 if (IsMagazine())
6832 {
6833 if (Magazine.Cast(this).GetAmmoCount() > 0)
6834 {
6836 }
6837 }
6838 else
6839 {
6841 }
6842 }
6843 }
6844 }
6845
6847 {
6848 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6849
6850 super.OnWasAttached(parent, slot_id);
6851
6854
6856 }
6857
6859 {
6860 super.OnWasDetached(parent, slot_id);
6861
6864 }
6865
6867 {
6868 int idx;
6871
6872 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6873 if (inventory_slots.Count() < 1)
6874 {
6875 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6876 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6877 }
6878 else
6879 {
6880 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6881 }
6882
6883 idx = inventory_slots.Find(slot);
6884 if (idx < 0)
6885 return "";
6886
6887 return attach_types.Get(idx);
6888 }
6889
6891 {
6892 int idx = -1;
6893 string slot;
6894
6897
6898 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6899 if (inventory_slots.Count() < 1)
6900 {
6901 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6902 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6903 }
6904 else
6905 {
6906 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6907 if (detach_types.Count() < 1)
6908 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6909 }
6910
6911 for (int i = 0; i < inventory_slots.Count(); i++)
6912 {
6913 slot = inventory_slots.Get(i);
6914 }
6915
6916 if (slot != "")
6917 {
6918 if (detach_types.Count() == 1)
6919 idx = 0;
6920 else
6921 idx = inventory_slots.Find(slot);
6922 }
6923 if (idx < 0)
6924 return "";
6925
6926 return detach_types.Get(idx);
6927 }
6928
6930 {
6931
6933
6934
6935 float min_time = 1;
6936 float max_time = 3;
6937 float delay = Math.RandomFloat(min_time, max_time);
6938
6939 explode_timer.Run(delay, this, "DoAmmoExplosion");
6940 }
6941
6943 {
6944 Magazine magazine = Magazine.Cast(this);
6945 int pop_sounds_count = 6;
6946 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6947
6948
6949 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6950 string sound_name = pop_sounds[ sound_idx ];
6952
6953
6954 magazine.ServerAddAmmoCount(-1);
6955
6956
6957 float min_temp_to_explode = 100;
6958
6959 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6960 {
6962 }
6963 }
6964
6965
6966 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6967 {
6968 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6969
6970 const int CHANCE_DAMAGE_CARGO = 4;
6971 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6972 const int CHANCE_DAMAGE_NOTHING = 2;
6973
6975 {
6976 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6977 int chances;
6978 int rnd;
6979
6980 if (GetInventory().GetCargo())
6981 {
6982 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6983 rnd = Math.RandomInt(0,chances);
6984
6985 if (rnd < CHANCE_DAMAGE_CARGO)
6986 {
6988 }
6989 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6990 {
6992 }
6993 }
6994 else
6995 {
6996 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6997 rnd = Math.RandomInt(0,chances);
6998
6999 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7000 {
7002 }
7003 }
7004 }
7005 }
7006
7008 {
7009 if (GetInventory().GetCargo())
7010 {
7011 int item_count = GetInventory().GetCargo().GetItemCount();
7012 if (item_count > 0)
7013 {
7014 int random_pick = Math.RandomInt(0, item_count);
7016 if (!item.IsExplosive())
7017 {
7018 item.AddHealth("","",damage);
7019 return true;
7020 }
7021 }
7022 }
7023 return false;
7024 }
7025
7027 {
7028 int attachment_count = GetInventory().AttachmentCount();
7029 if (attachment_count > 0)
7030 {
7031 int random_pick = Math.RandomInt(0, attachment_count);
7032 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7033 if (!attachment.IsExplosive())
7034 {
7035 attachment.AddHealth("","",damage);
7036 return true;
7037 }
7038 }
7039 return false;
7040 }
7041
7043 {
7045 }
7046
7048 {
7050 return GetInventory().CanRemoveEntity();
7051
7052 return false;
7053 }
7054
7056 {
7058 return;
7059
7061 {
7062 if (ScriptInputUserData.CanStoreInputUserData())
7063 {
7064 ScriptInputUserData ctx = new ScriptInputUserData;
7069 ctx.
Write(destination_entity);
7073 }
7074 }
7075 else if (!
GetGame().IsMultiplayer())
7076 {
7078 }
7079 }
7080
7082 {
7084 return;
7085
7086 float split_quantity_new;
7090 InventoryLocation loc = new InventoryLocation;
7091
7092 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7093 {
7095 split_quantity_new = stack_max;
7096 else
7098
7099 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7100 if (new_item)
7101 {
7102 new_item.SetResultOfSplit(true);
7103 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7105 new_item.SetQuantity(split_quantity_new);
7106 }
7107 }
7108 else if (destination_entity && slot_id == -1)
7109 {
7110 if (quantity > stack_max)
7111 split_quantity_new = stack_max;
7112 else
7113 split_quantity_new = quantity;
7114
7116 {
7119 }
7120
7121 if (new_item)
7122 {
7123 new_item.SetResultOfSplit(true);
7124 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7126 new_item.SetQuantity(split_quantity_new);
7127 }
7128 }
7129 else
7130 {
7131 if (stack_max != 0)
7132 {
7134 {
7136 }
7137
7138 if (split_quantity_new == 0)
7139 {
7140 if (!
GetGame().IsMultiplayer())
7141 player.PhysicalPredictiveDropItem(this);
7142 else
7143 player.ServerDropEntity(this);
7144 return;
7145 }
7146
7148
7149 if (new_item)
7150 {
7151 new_item.SetResultOfSplit(true);
7152 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7154 new_item.SetQuantity(stack_max);
7155 new_item.PlaceOnSurface();
7156 }
7157 }
7158 }
7159 }
7160
7162 {
7164 return;
7165
7166 float split_quantity_new;
7170 InventoryLocation loc = new InventoryLocation;
7171
7172 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7173 {
7175 split_quantity_new = stack_max;
7176 else
7178
7179 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7180 if (new_item)
7181 {
7182 new_item.SetResultOfSplit(true);
7183 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7185 new_item.SetQuantity(split_quantity_new);
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 {
7199 }
7200
7201 if (new_item)
7202 {
7203 new_item.SetResultOfSplit(true);
7204 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7206 new_item.SetQuantity(split_quantity_new);
7207 }
7208 }
7209 else
7210 {
7211 if (stack_max != 0)
7212 {
7214 {
7216 }
7217
7219
7220 if (new_item)
7221 {
7222 new_item.SetResultOfSplit(true);
7223 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7225 new_item.SetQuantity(stack_max);
7226 new_item.PlaceOnSurface();
7227 }
7228 }
7229 }
7230 }
7231
7233 {
7235 return;
7236
7238 {
7239 if (ScriptInputUserData.CanStoreInputUserData())
7240 {
7241 ScriptInputUserData ctx = new ScriptInputUserData;
7246 dst.WriteToContext(ctx);
7248 }
7249 }
7250 else if (!
GetGame().IsMultiplayer())
7251 {
7253 }
7254 }
7255
7257 {
7259 return;
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 return this;
7293
7295 float split_quantity_new;
7297 if (dst.IsValid())
7298 {
7299 int slot_id = dst.GetSlot();
7301
7302 if (quantity > stack_max)
7303 split_quantity_new = stack_max;
7304 else
7305 split_quantity_new = quantity;
7306
7308
7309 if (new_item)
7310 {
7311 new_item.SetResultOfSplit(true);
7312 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7315 }
7316
7317 return new_item;
7318 }
7319
7320 return null;
7321 }
7322
7324 {
7326 return;
7327
7329 float split_quantity_new;
7331 if (destination_entity)
7332 {
7334 if (quantity > stackable)
7335 split_quantity_new = stackable;
7336 else
7337 split_quantity_new = quantity;
7338
7339 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7340 if (new_item)
7341 {
7342 new_item.SetResultOfSplit(true);
7343 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7345 new_item.SetQuantity(split_quantity_new);
7346 }
7347 }
7348 }
7349
7351 {
7353 return;
7354
7356 {
7357 if (ScriptInputUserData.CanStoreInputUserData())
7358 {
7359 ScriptInputUserData ctx = new ScriptInputUserData;
7364 ItemBase destination_entity =
this;
7365 ctx.
Write(destination_entity);
7369 }
7370 }
7371 else if (!
GetGame().IsMultiplayer())
7372 {
7374 }
7375 }
7376
7378 {
7380 return;
7381
7383 float split_quantity_new;
7385 if (player)
7386 {
7388 if (quantity > stackable)
7389 split_quantity_new = stackable;
7390 else
7391 split_quantity_new = quantity;
7392
7393 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7394 new_item =
ItemBase.Cast(in_hands);
7395 if (new_item)
7396 {
7397 new_item.SetResultOfSplit(true);
7398 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7400 new_item.SetQuantity(split_quantity_new);
7401 }
7402 }
7403 }
7404
7406 {
7408 return;
7409
7411 float split_quantity_new = Math.Floor(quantity * 0.5);
7412
7414
7415 if (new_item)
7416 {
7417 if (new_item.GetQuantityMax() < split_quantity_new)
7418 {
7419 split_quantity_new = new_item.GetQuantityMax();
7420 }
7421
7422 new_item.SetResultOfSplit(true);
7423 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7424
7426 {
7429 }
7430 else
7431 {
7434 }
7435 }
7436 }
7437
7439 {
7441 return;
7442
7444 float split_quantity_new = Math.Floor(quantity / 2);
7445
7446 InventoryLocation invloc = new InventoryLocation;
7448
7450 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7451
7452 if (new_item)
7453 {
7454 if (new_item.GetQuantityMax() < split_quantity_new)
7455 {
7456 split_quantity_new = new_item.GetQuantityMax();
7457 }
7459 {
7462 }
7463 else
7464 {
7467 }
7468 }
7469 }
7470
7473 {
7474 SetWeightDirty();
7476
7477 if (parent)
7478 parent.OnAttachmentQuantityChangedEx(this, delta);
7479
7481 {
7483 {
7485 }
7487 {
7488 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7490 }
7491 }
7492
7493 }
7494
7497 {
7498
7499 }
7500
7503 {
7505 }
7506
7508 {
7509 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7510
7512 {
7513 if (newLevel == GameConstants.STATE_RUINED)
7514 {
7516 EntityAI parent = GetHierarchyParent();
7517 if (parent && parent.IsFireplace())
7518 {
7519 CargoBase cargo = GetInventory().GetCargo();
7520 if (cargo)
7521 {
7523 {
7525 }
7526 }
7527 }
7528 }
7529
7531 {
7532
7534 return;
7535 }
7536
7537 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7538 {
7540 }
7541 }
7542 }
7543
7544
7546 {
7547 super.OnRightClick();
7548
7550 {
7552 {
7553 if (ScriptInputUserData.CanStoreInputUserData())
7554 {
7555 vector m4[4];
7557
7558 EntityAI root = GetHierarchyRoot();
7559
7560 InventoryLocation dst = new InventoryLocation;
7562 {
7563 if (root)
7564 {
7565 root.GetTransform(m4);
7567 }
7568 else
7569 GetInventory().GetCurrentInventoryLocation(dst);
7570 }
7571 else
7572 {
7574
7575
7576 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7577 {
7578 if (root)
7579 {
7580 root.GetTransform(m4);
7582 }
7583 else
7584 GetInventory().GetCurrentInventoryLocation(dst);
7585 }
7586 else
7587 {
7588 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7589 }
7590 }
7591
7592 ScriptInputUserData ctx = new ScriptInputUserData;
7600 }
7601 }
7602 else if (!
GetGame().IsMultiplayer())
7603 {
7605 }
7606 }
7607 }
7608
7609 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7610 {
7611
7612 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7613 return false;
7614
7615 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7616 return false;
7617
7618
7620 return false;
7621
7622
7623 Magazine mag = Magazine.Cast(this);
7624 if (mag)
7625 {
7626 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7627 return false;
7628
7629 if (stack_max_limit)
7630 {
7631 Magazine other_mag = Magazine.Cast(other_item);
7632 if (other_item)
7633 {
7634 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7635 return false;
7636 }
7637
7638 }
7639 }
7640 else
7641 {
7642
7644 return false;
7645
7647 return false;
7648 }
7649
7650 PlayerBase player = null;
7651 if (CastTo(player, GetHierarchyRootPlayer()))
7652 {
7653 if (player.GetInventory().HasAttachment(this))
7654 return false;
7655
7656 if (player.IsItemsToDelete())
7657 return false;
7658 }
7659
7660 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7661 return false;
7662
7663 int slotID;
7665 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7666 return false;
7667
7668 return true;
7669 }
7670
7672 {
7674 }
7675
7677 {
7678 return m_IsResultOfSplit;
7679 }
7680
7682 {
7683 m_IsResultOfSplit = value;
7684 }
7685
7687 {
7689 }
7690
7692 {
7693 float other_item_quantity = other_item.GetQuantity();
7694 float this_free_space;
7695
7697
7699
7700 if (other_item_quantity > this_free_space)
7701 {
7702 return this_free_space;
7703 }
7704 else
7705 {
7706 return other_item_quantity;
7707 }
7708 }
7709
7711 {
7713 }
7714
7716 {
7718 return;
7719
7720 if (!IsMagazine() && other_item)
7721 {
7723 if (quantity_used != 0)
7724 {
7725 float hp1 = GetHealth01("","");
7726 float hp2 = other_item.GetHealth01("","");
7727 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7728 hpResult = hpResult / (
GetQuantity() + quantity_used);
7729
7730 hpResult *= GetMaxHealth();
7731 Math.Round(hpResult);
7732 SetHealth("", "Health", hpResult);
7733
7735 other_item.AddQuantity(-quantity_used);
7736 }
7737 }
7739 }
7740
7742 {
7743 #ifdef SERVER
7744 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7745 GetHierarchyParent().IncreaseLifetimeUp();
7746 #endif
7747 };
7748
7750 {
7751 PlayerBase p = PlayerBase.Cast(player);
7752
7753 array<int> recipesIds = p.m_Recipes;
7754 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7755 if (moduleRecipesManager)
7756 {
7757 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7758 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7759 }
7760
7761 for (int i = 0;i < recipesIds.Count(); i++)
7762 {
7763 int key = recipesIds.Get(i);
7764 string recipeName = moduleRecipesManager.GetRecipeName(key);
7766 }
7767 }
7768
7769
7770 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7771 {
7772 super.GetDebugActions(outputList);
7773
7774
7779
7780
7784
7788
7789
7792
7793
7795 {
7798 }
7799
7801
7804
7808 }
7809
7810
7811
7812
7814 {
7815 super.OnAction(action_id, player, ctx);
7816 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7817 {
7818 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7819 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7820 PlayerBase p = PlayerBase.Cast(player);
7821 if (
EActions.RECIPES_RANGE_START < 1000)
7822 {
7823 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7824 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7825 }
7826 }
7827 #ifndef SERVER
7828 else if (action_id ==
EActions.WATCH_PLAYER)
7829 {
7830 PluginDeveloper.SetDeveloperItemClientEx(player);
7831 }
7832 #endif
7834 {
7835 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7836 {
7837 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7838 OnDebugButtonPressServer(id + 1);
7839 }
7840
7841 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7842 {
7843 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7845 }
7846
7847 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7848 {
7849 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7851 }
7852
7853 else if (action_id ==
EActions.ADD_QUANTITY)
7854 {
7855 if (IsMagazine())
7856 {
7857 Magazine mag = Magazine.Cast(this);
7858 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7859 }
7860 else
7861 {
7863 }
7864
7865 if (m_EM)
7866 {
7867 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7868 }
7869
7870 }
7871
7872 else if (action_id ==
EActions.REMOVE_QUANTITY)
7873 {
7874 if (IsMagazine())
7875 {
7876 Magazine mag2 = Magazine.Cast(this);
7877 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7878 }
7879 else
7880 {
7882 }
7883 if (m_EM)
7884 {
7885 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7886 }
7887
7888 }
7889
7890 else if (action_id ==
EActions.SET_QUANTITY_0)
7891 {
7893
7894 if (m_EM)
7895 {
7896 m_EM.SetEnergy(0);
7897 }
7898 }
7899
7900 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7901 {
7903
7904 if (m_EM)
7905 {
7906 m_EM.SetEnergy(m_EM.GetEnergyMax());
7907 }
7908 }
7909
7910 else if (action_id ==
EActions.ADD_HEALTH)
7911 {
7912 AddHealth("","",GetMaxHealth("","Health")/5);
7913 }
7914 else if (action_id ==
EActions.REMOVE_HEALTH)
7915 {
7916 AddHealth("","",-GetMaxHealth("","Health")/5);
7917 }
7918 else if (action_id ==
EActions.DESTROY_HEALTH)
7919 {
7920 SetHealth01("","",0);
7921 }
7922 else if (action_id ==
EActions.WATCH_ITEM)
7923 {
7925 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7926 #ifdef DEVELOPER
7927 SetDebugDeveloper_item(this);
7928 #endif
7929 }
7930
7931 else if (action_id ==
EActions.ADD_TEMPERATURE)
7932 {
7933 AddTemperature(20);
7934
7935 }
7936
7937 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7938 {
7939 AddTemperature(-20);
7940
7941 }
7942
7943 else if (action_id ==
EActions.FLIP_FROZEN)
7944 {
7945 SetFrozen(!GetIsFrozen());
7946
7947 }
7948
7949 else if (action_id ==
EActions.ADD_WETNESS)
7950 {
7952
7953 }
7954
7955 else if (action_id ==
EActions.REMOVE_WETNESS)
7956 {
7958
7959 }
7960
7961 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7962 {
7965
7966
7967 }
7968
7969 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7970 {
7973 }
7974
7975 else if (action_id ==
EActions.MAKE_SPECIAL)
7976 {
7977 auto debugParams = DebugSpawnParams.WithPlayer(player);
7978 OnDebugSpawnEx(debugParams);
7979 }
7980
7981 else if (action_id ==
EActions.DELETE)
7982 {
7983 Delete();
7984 }
7985
7986 }
7987
7988
7989 return false;
7990 }
7991
7992
7993
7994
7998
8001
8002
8003
8005 {
8006 return false;
8007 }
8008
8009
8011 {
8012 return true;
8013 }
8014
8015
8017 {
8018 return true;
8019 }
8020
8021
8022
8024 {
8025 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8027 }
8028
8031 {
8032 return null;
8033 }
8034
8036 {
8037 return false;
8038 }
8039
8041 {
8042 return false;
8043 }
8044
8048
8049
8051 {
8052 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8053 return module_repairing.CanRepair(this, item_repair_kit);
8054 }
8055
8056
8057 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8058 {
8059 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8060 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8061 }
8062
8063
8065 {
8066
8067
8068
8069
8070
8071
8072
8073
8074 return 1;
8075 }
8076
8077
8078
8080 {
8082 }
8083
8084
8085
8087 {
8089 }
8090
8091
8100 {
8101 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8102
8103 if (player)
8104 {
8105 player.MessageStatus(text);
8106 }
8107 }
8108
8109
8118 {
8119 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8120
8121 if (player)
8122 {
8123 player.MessageAction(text);
8124 }
8125 }
8126
8127
8136 {
8137 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8138
8139 if (player)
8140 {
8141 player.MessageFriendly(text);
8142 }
8143 }
8144
8145
8154 {
8155 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8156
8157 if (player)
8158 {
8159 player.MessageImportant(text);
8160 }
8161 }
8162
8164 {
8165 return true;
8166 }
8167
8168
8169 override bool KindOf(
string tag)
8170 {
8171 bool found = false;
8172 string item_name = this.
GetType();
8175
8176 int array_size = item_tag_array.Count();
8177 for (int i = 0; i < array_size; i++)
8178 {
8179 if (item_tag_array.Get(i) == tag)
8180 {
8181 found = true;
8182 break;
8183 }
8184 }
8185 return found;
8186 }
8187
8188
8190 {
8191
8192 super.OnRPC(sender, rpc_type,ctx);
8193
8194
8195 switch (rpc_type)
8196 {
8197 #ifndef SERVER
8198 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8199 Param2<bool, string> p = new Param2<bool, string>(false, "");
8200
8202 return;
8203
8204 bool play = p.param1;
8205 string soundSet = p.param2;
8206
8207 if (play)
8208 {
8210 {
8212 {
8214 }
8215 }
8216 else
8217 {
8219 }
8220 }
8221 else
8222 {
8224 }
8225
8226 break;
8227 #endif
8228
8229 }
8230
8232 {
8234 }
8235 }
8236
8237
8238
8239
8241 {
8242 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8243 return plugin.GetID(
name);
8244 }
8245
8247 {
8248 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8249 return plugin.GetName(id);
8250 }
8251
8254 {
8255
8256
8257 int varFlags;
8258 if (!ctx.
Read(varFlags))
8259 return;
8260
8261 if (varFlags & ItemVariableFlags.FLOAT)
8262 {
8264 }
8265 }
8266
8268 {
8269
8270 super.SerializeNumericalVars(floats_out);
8271
8272
8273
8275 {
8277 }
8278
8280 {
8282 }
8283
8285 {
8287 }
8288
8290 {
8295 }
8296
8298 {
8300 }
8301 }
8302
8304 {
8305
8306 super.DeSerializeNumericalVars(floats);
8307
8308
8309 int index = 0;
8310 int mask = Math.Round(floats.Get(index));
8311
8312 index++;
8313
8315 {
8317 {
8319 }
8320 else
8321 {
8322 float quantity = floats.Get(index);
8324 }
8325 index++;
8326 }
8327
8329 {
8330 float wet = floats.Get(index);
8332 index++;
8333 }
8334
8336 {
8337 int liquidtype = Math.Round(floats.Get(index));
8339 index++;
8340 }
8341
8343 {
8345 index++;
8347 index++;
8349 index++;
8351 index++;
8352 }
8353
8355 {
8356 int cleanness = Math.Round(floats.Get(index));
8358 index++;
8359 }
8360 }
8361
8363 {
8364 super.WriteVarsToCTX(ctx);
8365
8366
8368 {
8370 }
8371
8373 {
8375 }
8376
8378 {
8380 }
8381
8383 {
8384 int r,g,b,a;
8390 }
8391
8393 {
8395 }
8396 }
8397
8399 {
8400 if (!super.ReadVarsFromCTX(ctx,version))
8401 return false;
8402
8403 int intValue;
8404 float value;
8405
8406 if (version < 140)
8407 {
8408 if (!ctx.
Read(intValue))
8409 return false;
8410
8411 m_VariablesMask = intValue;
8412 }
8413
8415 {
8416 if (!ctx.
Read(value))
8417 return false;
8418
8420 {
8422 }
8423 else
8424 {
8426 }
8427 }
8428
8429 if (version < 140)
8430 {
8432 {
8433 if (!ctx.
Read(value))
8434 return false;
8435 SetTemperatureDirect(value);
8436 }
8437 }
8438
8440 {
8441 if (!ctx.
Read(value))
8442 return false;
8444 }
8445
8447 {
8448 if (!ctx.
Read(intValue))
8449 return false;
8451 }
8452
8454 {
8455 int r,g,b,a;
8457 return false;
8459 return false;
8461 return false;
8463 return false;
8464
8466 }
8467
8469 {
8470 if (!ctx.
Read(intValue))
8471 return false;
8473 }
8474
8475 if (version >= 138 && version < 140)
8476 {
8478 {
8479 if (!ctx.
Read(intValue))
8480 return false;
8481 SetFrozen(intValue);
8482 }
8483 }
8484
8485 return true;
8486 }
8487
8488
8490 {
8493 {
8495 }
8496
8497 if (!super.OnStoreLoad(ctx, version))
8498 {
8500 return false;
8501 }
8502
8503 if (version >= 114)
8504 {
8505 bool hasQuickBarIndexSaved;
8506
8507 if (!ctx.
Read(hasQuickBarIndexSaved))
8508 {
8510 return false;
8511 }
8512
8513 if (hasQuickBarIndexSaved)
8514 {
8515 int itmQBIndex;
8516
8517
8518 if (!ctx.
Read(itmQBIndex))
8519 {
8521 return false;
8522 }
8523
8524 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8525 if (itmQBIndex != -1 && parentPlayer)
8526 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8527 }
8528 }
8529 else
8530 {
8531
8532 PlayerBase player;
8533 int itemQBIndex;
8534 if (version ==
int.
MAX)
8535 {
8536 if (!ctx.
Read(itemQBIndex))
8537 {
8539 return false;
8540 }
8541 }
8542 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8543 {
8544
8545 if (!ctx.
Read(itemQBIndex))
8546 {
8548 return false;
8549 }
8550 if (itemQBIndex != -1 && player)
8551 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8552 }
8553 }
8554
8555 if (version < 140)
8556 {
8557
8558 if (!LoadVariables(ctx, version))
8559 {
8561 return false;
8562 }
8563 }
8564
8565
8567 {
8569 return false;
8570 }
8571 if (version >= 132)
8572 {
8574 if (raib)
8575 {
8577 {
8579 return false;
8580 }
8581 }
8582 }
8583
8585 return true;
8586 }
8587
8588
8589
8591 {
8592 super.OnStoreSave(ctx);
8593
8594 PlayerBase player;
8595 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8596 {
8598
8599 int itemQBIndex = -1;
8600 itemQBIndex = player.FindQuickBarEntityIndex(this);
8601 ctx.
Write(itemQBIndex);
8602 }
8603 else
8604 {
8606 }
8607
8609
8611 if (raib)
8612 {
8614 }
8615 }
8616
8617
8619 {
8620 super.AfterStoreLoad();
8621
8623 {
8625 }
8626
8628 {
8631 }
8632 }
8633
8635 {
8636 super.EEOnAfterLoad();
8637
8639 {
8641 }
8642
8645 }
8646
8648 {
8649 return false;
8650 }
8651
8652
8653
8655 {
8657 {
8658 #ifdef PLATFORM_CONSOLE
8659
8661 {
8663 if (menu)
8664 {
8666 }
8667 }
8668 #endif
8669 }
8670
8672 {
8675 }
8676
8678 {
8679 SetWeightDirty();
8681 }
8683 {
8686 }
8687
8689 {
8692 }
8694 {
8697 }
8698
8699 super.OnVariablesSynchronized();
8700 }
8701
8702
8703
8705 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8706 {
8707 if (!IsServerCheck(allow_client))
8708 return false;
8709
8711 return false;
8712
8715
8716 if (value <= (min + 0.001))
8717 value = min;
8718
8719 if (value == min)
8720 {
8721 if (destroy_config)
8722 {
8723 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8724 if (dstr)
8725 {
8727 this.Delete();
8728 return true;
8729 }
8730 }
8731 else if (destroy_forced)
8732 {
8734 this.Delete();
8735 return true;
8736 }
8737
8739 }
8740
8743
8745 {
8747
8748 if (delta)
8750 }
8751
8753
8754 return false;
8755 }
8756
8757
8759 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8760 {
8762 }
8763
8765 {
8768 }
8769
8771 {
8774 }
8775
8778 {
8779 float value_clamped = Math.Clamp(value, 0, 1);
8781 SetQuantity(result, destroy_config, destroy_forced);
8782 }
8783
8784
8787 {
8789 }
8790
8792 {
8794 }
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8806 {
8807 int slot = -1;
8808 if (GetInventory())
8809 {
8810 InventoryLocation il = new InventoryLocation;
8811 GetInventory().GetCurrentInventoryLocation(il);
8813 }
8814
8816 }
8817
8819 {
8820 float quantity_max = 0;
8821
8823 {
8824 if (attSlotID != -1)
8825 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8826
8827 if (quantity_max <= 0)
8829 }
8830
8831 if (quantity_max <= 0)
8833
8834 return quantity_max;
8835 }
8836
8838 {
8840 }
8841
8843 {
8845 }
8846
8847
8849 {
8851 }
8852
8854 {
8856 }
8857
8859 {
8861 }
8862
8863
8865 {
8866
8867 float weightEx = GetWeightEx();
8868 float special = GetInventoryAndCargoWeight();
8869 return weightEx - special;
8870 }
8871
8872
8874 {
8876 }
8877
8879 {
8881 {
8882 #ifdef DEVELOPER
8883 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8884 {
8885 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8887 }
8888 #endif
8889
8891 }
8892 else if (HasEnergyManager())
8893 {
8894 #ifdef DEVELOPER
8895 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8896 {
8897 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8898 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8899 }
8900 #endif
8901 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8902 }
8903 else
8904 {
8905 #ifdef DEVELOPER
8906 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8907 {
8908 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8909 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8910 }
8911 #endif
8912 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8913 }
8914 }
8915
8918 {
8919 int item_count = 0;
8921
8922 if (GetInventory().GetCargo() != NULL)
8923 {
8924 item_count = GetInventory().GetCargo().GetItemCount();
8925 }
8926
8927 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8928 {
8929 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8930 if (item)
8931 item_count += item.GetNumberOfItems();
8932 }
8933 return item_count;
8934 }
8935
8938 {
8939 float weight = 0;
8940 float wetness = 1;
8941 if (include_wetness)
8944 {
8945 weight = wetness * m_ConfigWeight;
8946 }
8948 {
8949 weight = 1;
8950 }
8951 return weight;
8952 }
8953
8954
8955
8957 {
8958 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8959 {
8960 GameInventory inv = GetInventory();
8961 array<EntityAI> items = new array<EntityAI>;
8963 for (int i = 0; i < items.Count(); i++)
8964 {
8966 if (item)
8967 {
8969 }
8970 }
8971 }
8972 }
8973
8974
8975
8976
8978 {
8979 float energy = 0;
8980 if (HasEnergyManager())
8981 {
8982 energy = GetCompEM().GetEnergy();
8983 }
8984 return energy;
8985 }
8986
8987
8989 {
8990 super.OnEnergyConsumed();
8991
8993 }
8994
8996 {
8997 super.OnEnergyAdded();
8998
9000 }
9001
9002
9004 {
9005 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9006 {
9008 {
9009 float energy_0to1 = GetCompEM().GetEnergy0To1();
9011 }
9012 }
9013 }
9014
9015
9017 {
9018 return ConfigGetFloat("heatIsolation");
9019 }
9020
9022 {
9024 }
9025
9027 {
9028 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9029 if (
GetGame().ConfigIsExisting(paramPath))
9031
9032 return 0.0;
9033 }
9034
9036 {
9037 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9038 if (
GetGame().ConfigIsExisting(paramPath))
9040
9041 return 0.0;
9042 }
9043
9044 override void SetWet(
float value,
bool allow_client =
false)
9045 {
9046 if (!IsServerCheck(allow_client))
9047 return;
9048
9051
9053
9054 m_VarWet = Math.Clamp(value, min, max);
9055
9057 {
9060 }
9061 }
9062
9063 override void AddWet(
float value)
9064 {
9066 }
9067
9069 {
9071 }
9072
9074 {
9076 }
9077
9079 {
9081 }
9082
9084 {
9086 }
9087
9089 {
9091 }
9092
9094 {
9097 if (newLevel != oldLevel)
9098 {
9100 }
9101 }
9102
9104 {
9105 SetWeightDirty();
9106 }
9107
9109 {
9110 return GetWetLevelInternal(
m_VarWet);
9111 }
9112
9113
9114
9116 {
9118 }
9119
9121 {
9123 }
9124
9126 {
9128 }
9129
9131 {
9133 }
9134
9135
9136
9138 {
9139 if (ConfigIsExisting("itemModelLength"))
9140 {
9141 return ConfigGetFloat("itemModelLength");
9142 }
9143 return 0;
9144 }
9145
9147 {
9148 if (ConfigIsExisting("itemAttachOffset"))
9149 {
9150 return ConfigGetFloat("itemAttachOffset");
9151 }
9152 return 0;
9153 }
9154
9155 override void SetCleanness(
int value,
bool allow_client =
false)
9156 {
9157 if (!IsServerCheck(allow_client))
9158 return;
9159
9161
9163
9166 }
9167
9169 {
9171 }
9172
9174 {
9175 return true;
9176 }
9177
9178
9179
9180
9182 {
9184 }
9185
9187 {
9189 }
9190
9191
9192
9193
9194 override void SetColor(
int r,
int g,
int b,
int a)
9195 {
9201 }
9203 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9204 {
9209 }
9210
9212 {
9214 }
9215
9218 {
9219 int r,g,b,a;
9221 r = r/255;
9222 g = g/255;
9223 b = b/255;
9224 a = a/255;
9225 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9226 }
9227
9228
9229
9230 override void SetLiquidType(
int value,
bool allow_client =
false)
9231 {
9232 if (!IsServerCheck(allow_client))
9233 return;
9234
9239 }
9240
9242 {
9243 return ConfigGetInt("varLiquidTypeInit");
9244 }
9245
9247 {
9249 }
9250
9252 {
9254 SetFrozen(false);
9255 }
9256
9259 {
9260 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9261 }
9262
9263
9266 {
9267 PlayerBase nplayer;
9268 if (PlayerBase.CastTo(nplayer, player))
9269 {
9271
9272 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9273 }
9274 }
9275
9276
9279 {
9280 PlayerBase nplayer;
9281 if (PlayerBase.CastTo(nplayer,player))
9282 {
9283
9284 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9285
9286 }
9287
9288
9289 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9290
9291
9292 if (HasEnergyManager())
9293 {
9294 GetCompEM().UpdatePlugState();
9295 }
9296 }
9297
9298
9300 {
9301 super.OnPlacementStarted(player);
9302
9304 }
9305
9306 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9307 {
9309 {
9310 m_AdminLog.OnPlacementComplete(player,
this);
9311 }
9312
9313 super.OnPlacementComplete(player, position, orientation);
9314 }
9315
9316
9317
9318
9319
9321 {
9323 {
9324 return true;
9325 }
9326 else
9327 {
9328 return false;
9329 }
9330 }
9331
9332
9334 {
9336 {
9338 }
9339 }
9340
9341
9343 {
9345 }
9346
9348 {
9350 }
9351
9352 override void InsertAgent(
int agent,
float count = 1)
9353 {
9354 if (count < 1)
9355 return;
9356
9358 }
9359
9362 {
9364 }
9365
9366
9368 {
9370 }
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9414 {
9416 return false;
9417 return true;
9418 }
9419
9421 {
9422
9424 }
9425
9426
9429 {
9430 super.CheckForRoofLimited(timeTresholdMS);
9431
9433 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9434 {
9435 m_PreviousRoofTestTime = time;
9436 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9437 }
9438 }
9439
9440
9442 {
9444 {
9445 return 0;
9446 }
9447
9448 if (GetInventory().GetAttachmentSlotsCount() != 0)
9449 {
9450 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9451 if (filter)
9452 return filter.GetProtectionLevel(type, false, system);
9453 else
9454 return 0;
9455 }
9456
9457 string subclassPath, entryName;
9458
9459 switch (type)
9460 {
9462 entryName = "biological";
9463 break;
9465 entryName = "chemical";
9466 break;
9467 default:
9468 entryName = "biological";
9469 break;
9470 }
9471
9472 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9473
9475 }
9476
9477
9478
9481 {
9482 if (!IsMagazine())
9484
9486 }
9487
9488
9489
9490
9491
9496 {
9497 return true;
9498 }
9499
9501 {
9503 }
9504
9505
9506
9507
9508
9510 {
9511 if (parent)
9512 {
9513 if (parent.IsInherited(DayZInfected))
9514 return true;
9515
9516 if (!parent.IsRuined())
9517 return true;
9518 }
9519
9520 return true;
9521 }
9522
9524 {
9525 if (!super.CanPutAsAttachment(parent))
9526 {
9527 return false;
9528 }
9529
9530 if (!IsRuined() && !parent.IsRuined())
9531 {
9532 return true;
9533 }
9534
9535 return false;
9536 }
9537
9539 {
9540
9541
9542
9543
9544 return super.CanReceiveItemIntoCargo(item);
9545 }
9546
9548 {
9549
9550
9551
9552
9553 GameInventory attachmentInv = attachment.GetInventory();
9555 {
9556 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9557 return false;
9558 }
9559
9560 InventoryLocation loc = new InventoryLocation();
9561 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9562 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9563 return false;
9564
9565 return super.CanReceiveAttachment(attachment, slotId);
9566 }
9567
9569 {
9570 if (!super.CanReleaseAttachment(attachment))
9571 return false;
9572
9573 return GetInventory().AreChildrenAccessible();
9574 }
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9597 {
9598 int id = muzzle_owner.GetMuzzleID();
9599 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9600
9601 if (WPOF_array)
9602 {
9603 for (int i = 0; i < WPOF_array.Count(); i++)
9604 {
9605 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9606
9607 if (WPOF)
9608 {
9609 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9610 }
9611 }
9612 }
9613 }
9614
9615
9617 {
9618 int id = muzzle_owner.GetMuzzleID();
9620
9621 if (WPOBE_array)
9622 {
9623 for (int i = 0; i < WPOBE_array.Count(); i++)
9624 {
9625 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9626
9627 if (WPOBE)
9628 {
9629 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9630 }
9631 }
9632 }
9633 }
9634
9635
9637 {
9638 int id = muzzle_owner.GetMuzzleID();
9639 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9640
9641 if (WPOOH_array)
9642 {
9643 for (int i = 0; i < WPOOH_array.Count(); i++)
9644 {
9645 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9646
9647 if (WPOOH)
9648 {
9649 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9650 }
9651 }
9652 }
9653 }
9654
9655
9657 {
9658 int id = muzzle_owner.GetMuzzleID();
9659 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9660
9661 if (WPOOH_array)
9662 {
9663 for (int i = 0; i < WPOOH_array.Count(); i++)
9664 {
9665 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9666
9667 if (WPOOH)
9668 {
9669 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9670 }
9671 }
9672 }
9673 }
9674
9675
9677 {
9678 int id = muzzle_owner.GetMuzzleID();
9679 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9680
9681 if (WPOOH_array)
9682 {
9683 for (int i = 0; i < WPOOH_array.Count(); i++)
9684 {
9685 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9686
9687 if (WPOOH)
9688 {
9689 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9690 }
9691 }
9692 }
9693 }
9694
9695
9696
9698 {
9700 {
9701 return true;
9702 }
9703
9704 return false;
9705 }
9706
9708 {
9710 {
9711 return true;
9712 }
9713
9714 return false;
9715 }
9716
9718 {
9720 {
9721 return true;
9722 }
9723
9724 return false;
9725 }
9726
9728 {
9729 return false;
9730 }
9731
9734 {
9735 return UATimeSpent.DEFAULT_DEPLOY;
9736 }
9737
9738
9739
9740
9742 {
9744 SetSynchDirty();
9745 }
9746
9748 {
9750 }
9751
9752
9754 {
9755 return false;
9756 }
9757
9760 {
9761 string att_type = "None";
9762
9763 if (ConfigIsExisting("soundAttType"))
9764 {
9765 att_type = ConfigGetString("soundAttType");
9766 }
9767
9769 }
9770
9772 {
9774 }
9775
9776
9777
9778
9779
9783
9785 {
9788
9790 }
9791
9792
9794 {
9796 return;
9797
9799
9802
9805
9806 SoundParameters params = new SoundParameters();
9810 }
9811
9812
9814 {
9816 return;
9817
9819 SetSynchDirty();
9820
9823 }
9824
9825
9827 {
9829 return;
9830
9832 SetSynchDirty();
9833
9836 }
9837
9839 {
9841 }
9842
9844 {
9846 }
9847
9850 {
9851 if (!
GetGame().IsDedicatedServer())
9852 {
9853 if (ConfigIsExisting("attachSoundSet"))
9854 {
9855 string cfg_path = "";
9856 string soundset = "";
9858
9861 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9862 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9863
9864 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9865 {
9866 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9867 {
9868 if (cfg_slot_array[i] == slot_type)
9869 {
9870 soundset = cfg_soundset_array[i];
9871 break;
9872 }
9873 }
9874 }
9875
9876 if (soundset != "")
9877 {
9878 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9880 }
9881 }
9882 }
9883 }
9884
9886 {
9887
9888 }
9889
9890 void OnApply(PlayerBase player);
9891
9893 {
9894 return 1.0;
9895 };
9896
9898 {
9900 }
9901
9903 {
9905 }
9906
9908
9910 {
9911 SetDynamicPhysicsLifeTime(0.01);
9913 }
9914
9916 {
9917 array<string> zone_names = new array<string>;
9918 GetDamageZones(zone_names);
9919 for (int i = 0; i < zone_names.Count(); i++)
9920 {
9921 SetHealthMax(zone_names.Get(i),"Health");
9922 }
9923 SetHealthMax("","Health");
9924 }
9925
9928 {
9929 float global_health = GetHealth01("","Health");
9930 array<string> zones = new array<string>;
9931 GetDamageZones(zones);
9932
9933 for (int i = 0; i < zones.Count(); i++)
9934 {
9935 SetHealth01(zones.Get(i),"Health",global_health);
9936 }
9937 }
9938
9941 {
9942 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9943 }
9944
9946 {
9947 if (!hasRootAsPlayer)
9948 {
9949 if (refParentIB)
9950 {
9951
9952 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9953 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9954
9955 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9956 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9957
9960 }
9961 else
9962 {
9963
9966 }
9967 }
9968 }
9969
9971 {
9973 {
9974 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9975 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9976 {
9977 float heatPermCoef = 1.0;
9979 while (ent)
9980 {
9981 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9982 ent = ent.GetHierarchyParent();
9983 }
9984
9985 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9986 }
9987 }
9988 }
9989
9991 {
9992
9993 EntityAI parent = GetHierarchyParent();
9994 if (!parent)
9995 {
9996 hasParent = false;
9997 hasRootAsPlayer = false;
9998 }
9999 else
10000 {
10001 hasParent = true;
10002 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10003 refParentIB =
ItemBase.Cast(parent);
10004 }
10005 }
10006
10007 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10008 {
10009
10010 }
10011
10013 {
10014
10015 return false;
10016 }
10017
10019 {
10020
10021
10022 return false;
10023 }
10024
10026 {
10027
10028 return false;
10029 }
10030
10033 {
10034 return !GetIsFrozen() &&
IsOpen();
10035 }
10036
10038 {
10039 bool hasParent = false, hasRootAsPlayer = false;
10041
10042 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10043 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10044
10045 if (wwtu || foodDecay)
10046 {
10050
10051 if (processWetness || processTemperature || processDecay)
10052 {
10054
10055 if (processWetness)
10056 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10057
10058 if (processTemperature)
10060
10061 if (processDecay)
10062 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10063 }
10064 }
10065 }
10066
10069 {
10071 }
10072
10074 {
10077
10078 return super.GetTemperatureFreezeThreshold();
10079 }
10080
10082 {
10085
10086 return super.GetTemperatureThawThreshold();
10087 }
10088
10090 {
10093
10094 return super.GetItemOverheatThreshold();
10095 }
10096
10098 {
10100 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10101
10102 return super.GetTemperatureFreezeTime();
10103 }
10104
10106 {
10108 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10109
10110 return super.GetTemperatureThawTime();
10111 }
10112
10117
10119 {
10120 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10121 }
10122
10124 {
10125 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10126 }
10127
10130 {
10132 }
10133
10135 {
10137 }
10138
10140 {
10142 }
10143
10146 {
10147 return null;
10148 }
10149
10152 {
10153 return false;
10154 }
10155
10157 {
10159 {
10162 if (!trg)
10163 {
10165 explosive = this;
10166 }
10167
10168 explosive.PairRemote(trg);
10170
10171 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10172 trg.SetPersistentPairID(persistentID);
10173 explosive.SetPersistentPairID(persistentID);
10174
10175 return true;
10176 }
10177 return false;
10178 }
10179
10182 {
10183 float ret = 1.0;
10186 ret *= GetHealth01();
10187
10188 return ret;
10189 }
10190
10191 #ifdef DEVELOPER
10192 override void SetDebugItem()
10193 {
10194 super.SetDebugItem();
10195 _itemBase = this;
10196 }
10197
10199 {
10200 string text = super.GetDebugText();
10201
10203 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10204
10205 return text;
10206 }
10207 #endif
10208
10210 {
10211 return true;
10212 }
10213
10215
10217
10219 {
10222 }
10223
10224
10232
10248}
10249
10251{
10253 if (entity)
10254 {
10255 bool is_item = entity.IsInherited(
ItemBase);
10256 if (is_item && full_quantity)
10257 {
10260 }
10261 }
10262 else
10263 {
10265 return NULL;
10266 }
10267 return entity;
10268}
10269
10271{
10272 if (item)
10273 {
10274 if (health > 0)
10275 item.SetHealth("", "", health);
10276
10277 if (item.CanHaveTemperature())
10278 {
10280 if (item.CanFreeze())
10281 item.SetFrozen(false);
10282 }
10283
10284 if (item.HasEnergyManager())
10285 {
10286 if (quantity >= 0)
10287 {
10288 item.GetCompEM().SetEnergy0To1(quantity);
10289 }
10290 else
10291 {
10293 }
10294 }
10295 else if (item.IsMagazine())
10296 {
10297 Magazine mag = Magazine.Cast(item);
10298 if (quantity >= 0)
10299 {
10300 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10301 }
10302 else
10303 {
10305 }
10306
10307 }
10308 else
10309 {
10310 if (quantity >= 0)
10311 {
10312 item.SetQuantityNormalized(quantity, false);
10313 }
10314 else
10315 {
10317 }
10318
10319 }
10320 }
10321}
10322
10323#ifdef DEVELOPER
10325#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
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 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...
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)
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)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
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()
override int GetLiquidType()
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)
void Open()
Implementations only.
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 EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
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 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 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
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
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 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 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.