5443{
5445 {
5446 return true;
5447 }
5448};
5449
5450
5451
5453{
5457
5459
5462
5463
5464
5465
5466
5475
5481
5486
5491
5512 protected bool m_IsResultOfSplit
5513
5515
5520
5521
5522
5524
5528
5529
5530
5532
5535
5536
5537
5543
5544
5552
5555
5556
5558
5559
5561
5562
5567
5568
5573
5574
5576
5577
5579 {
5584
5585 if (!
GetGame().IsDedicatedServer())
5586 {
5588 {
5590
5592 {
5594 }
5595 }
5596
5599 }
5600
5601 m_OldLocation = null;
5602
5604 {
5606 }
5607
5608 if (ConfigIsExisting("headSelectionsToHide"))
5609 {
5612 }
5613
5615 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5616 {
5618 }
5619
5621
5622 m_IsResultOfSplit = false;
5623
5625 }
5626
5628 {
5629 super.InitItemVariables();
5630
5636 m_Count = ConfigGetInt(
"count");
5637
5640
5645
5648
5653
5665
5669
5670
5673 if (ConfigIsExisting("canBeSplit"))
5674 {
5677 }
5678
5680 if (ConfigIsExisting("itemBehaviour"))
5682
5683
5686 RegisterNetSyncVariableInt("m_VarLiquidType");
5687 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5688
5689 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5690 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5691 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5692
5693 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5694 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5695 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5696 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5697
5698 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5699 RegisterNetSyncVariableBool("m_IsTakeable");
5700 RegisterNetSyncVariableBool("m_IsHologram");
5701
5704 {
5707 }
5708
5710
5712 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5714
5715 }
5716
5718 {
5720 }
5721
5723 {
5726 {
5731 }
5732 }
5733
5734 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5735 {
5737 {
5740 }
5741
5743 }
5744
5746 {
5752 }
5753
5755
5757 {
5759
5760 if (!action)
5761 {
5762 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5763 return;
5764 }
5765
5767 if (!ai)
5768 {
5770 return;
5771 }
5772
5774 if (!action_array)
5775 {
5776 action_array = new array<ActionBase_Basic>;
5778 }
5779 if (LogManager.IsActionLogEnable())
5780 {
5781 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5782 }
5783
5784 if (action_array.Find(action) != -1)
5785 {
5786 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5787 }
5788 else
5789 {
5790 action_array.Insert(action);
5791 }
5792 }
5793
5795 {
5797 ActionBase action = player.GetActionManager().GetAction(actionName);
5800
5801 if (action_array)
5802 {
5803 action_array.RemoveItem(action);
5804 }
5805 }
5806
5807
5808
5810 {
5811 ActionOverrideData overrideData = new ActionOverrideData();
5815
5817 if (!actionMap)
5818 {
5821 }
5822
5823 actionMap.Insert(this.
Type(), overrideData);
5824
5825 }
5826
5828
5830
5831
5833 {
5836
5839
5840 string config_to_search = "CfgVehicles";
5841 string muzzle_owner_config;
5842
5844 {
5845 if (IsInherited(Weapon))
5846 config_to_search = "CfgWeapons";
5847
5848 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5849
5850 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5851
5853
5854 if (config_OnFire_subclass_count > 0)
5855 {
5856 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5857
5858 for (int i = 0; i < config_OnFire_subclass_count; i++)
5859 {
5860 string particle_class = "";
5862 string config_OnFire_entry = config_OnFire_class + particle_class;
5863 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5864 WPOF_array.Insert(WPOF);
5865 }
5866
5867
5869 }
5870 }
5871
5873 {
5874 config_to_search = "CfgWeapons";
5875 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5876
5877 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5878
5880
5881 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5882 {
5883 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5884
5885 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5886 {
5887 string particle_class2 = "";
5889 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5890 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5891 WPOBE_array.Insert(WPOBE);
5892 }
5893
5894
5896 }
5897 }
5898 }
5899
5900
5902 {
5905
5907 {
5908 string config_to_search = "CfgVehicles";
5909
5910 if (IsInherited(Weapon))
5911 config_to_search = "CfgWeapons";
5912
5913 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5914 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5915
5916 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5917 {
5918
5920
5922 {
5924 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5926 return;
5927 }
5928
5931
5932
5933
5935 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5936
5937 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5938 {
5939 string particle_class = "";
5941 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5943
5944 if (entry_type == CT_CLASS)
5945 {
5946 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5947 WPOOH_array.Insert(WPOF);
5948 }
5949 }
5950
5951
5953 }
5954 }
5955 }
5956
5958 {
5960 }
5961
5963 {
5965 {
5967
5970
5973
5974 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5975 }
5976 }
5977
5979 {
5981 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5982
5984 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5985
5987 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5988
5990 {
5992 }
5993 }
5994
5996 {
5998 }
5999
6001 {
6004 else
6006
6008 {
6011 }
6012 else
6013 {
6016
6019 }
6020
6022 }
6023
6025 {
6027 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6028 }
6029
6031 {
6033 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6035 }
6036
6038 {
6040 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6041 }
6042
6044 {
6047
6048 OverheatingParticle OP = new OverheatingParticle();
6053
6055 }
6056
6058 {
6061
6062 return -1;
6063 }
6064
6066 {
6068 {
6071
6072 for (int i = count; i > 0; --i)
6073 {
6074 int id = i - 1;
6077
6080
6081 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6082 {
6083 if (p)
6084 {
6087 }
6088 }
6089 }
6090 }
6091 }
6092
6094 {
6096 {
6098 {
6099 int id = i - 1;
6101
6102 if (OP)
6103 {
6105
6106 if (p)
6107 {
6109 }
6110
6111 delete OP;
6112 }
6113 }
6114
6117 }
6118 }
6119
6122 {
6123 return 0.0;
6124 }
6125
6126
6128 {
6129 return 250;
6130 }
6131
6133 {
6134 return 0;
6135 }
6136
6139 {
6141 return true;
6142
6143 return false;
6144 }
6145
6148 {
6151
6153 {
6155 }
6156 else
6157 {
6158
6160 }
6161
6163 }
6164
6171 {
6172 return -1;
6173 }
6174
6175
6176
6177
6179 {
6181 {
6183 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6184
6185 if (r_index >= 0)
6186 {
6187 InventoryLocation r_il = new InventoryLocation;
6188 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6189
6190 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6193 {
6194 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6195 }
6197 {
6198 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6199 }
6200
6201 }
6202
6203 player.GetHumanInventory().ClearUserReservedLocation(this);
6204 }
6205
6208 }
6209
6210
6211
6212
6214 {
6215 return ItemBase.m_DebugActionsMask;
6216 }
6217
6219 {
6220 return ItemBase.m_DebugActionsMask & mask;
6221 }
6222
6224 {
6225 ItemBase.m_DebugActionsMask = mask;
6226 }
6227
6229 {
6230 ItemBase.m_DebugActionsMask |= mask;
6231 }
6232
6234 {
6235 ItemBase.m_DebugActionsMask &= ~mask;
6236 }
6237
6239 {
6241 {
6243 }
6244 else
6245 {
6247 }
6248 }
6249
6250
6252 {
6253 if (GetEconomyProfile())
6254 {
6255 float q_max = GetEconomyProfile().GetQuantityMax();
6256 if (q_max > 0)
6257 {
6258 float q_min = GetEconomyProfile().GetQuantityMin();
6259 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6260
6262 {
6263 ComponentEnergyManager comp = GetCompEM();
6265 {
6267 }
6268 }
6270 {
6272
6273 }
6274
6275 }
6276 }
6277 }
6278
6281 {
6282 EntityAI parent = GetHierarchyParent();
6283
6284 if (parent)
6285 {
6286 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6287 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6288 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6289 }
6290 }
6291
6294 {
6295 EntityAI parent = GetHierarchyParent();
6296
6297 if (parent)
6298 {
6299 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6300 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6301 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6302 }
6303 }
6304
6306 {
6307
6308
6309
6310
6312
6314 {
6315 if (ScriptInputUserData.CanStoreInputUserData())
6316 {
6317 ScriptInputUserData ctx = new ScriptInputUserData;
6323 ctx.
Write(use_stack_max);
6326
6328 {
6329 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6330 }
6331 }
6332 }
6333 else if (!
GetGame().IsMultiplayer())
6334 {
6336 }
6337 }
6338
6340 {
6342 }
6343
6345 {
6347 }
6348
6350 {
6352 }
6353
6355 {
6356
6357 return false;
6358 }
6359
6361 {
6362 return false;
6363 }
6364
6368 {
6369 return false;
6370 }
6371
6373 {
6374 return "";
6375 }
6376
6378
6380 {
6381 return false;
6382 }
6383
6385 {
6386 return true;
6387 }
6388
6389
6390
6392 {
6393 return true;
6394 }
6395
6397 {
6398 return true;
6399 }
6400
6402 {
6403 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6405 }
6406
6408 {
6410 }
6411
6413 {
6415 if (!is_being_placed)
6417 SetSynchDirty();
6418 }
6419
6420
6422
6424 {
6426 }
6427
6429 {
6431 }
6432
6434 {
6435 return 1;
6436 }
6437
6439 {
6440 return false;
6441 }
6442
6444 {
6446 SetSynchDirty();
6447 }
6448
6449
6450
6451
6452
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
6484 {
6485 super.OnMovedInsideCargo(container);
6486
6487 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6488 }
6489
6490 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6491 {
6492 super.EEItemLocationChanged(oldLoc,newLoc);
6493
6494 PlayerBase new_player = null;
6495 PlayerBase old_player = null;
6496
6497 if (newLoc.GetParent())
6498 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6499
6500 if (oldLoc.GetParent())
6501 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6502
6504 {
6505 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6506
6507 if (r_index >= 0)
6508 {
6509 InventoryLocation r_il = new InventoryLocation;
6510 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6511
6512 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6515 {
6516 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6517 }
6519 {
6520 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6521 }
6522
6523 }
6524 }
6525
6527 {
6528 if (new_player)
6529 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6530
6531 if (new_player == old_player)
6532 {
6533
6534 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6535 {
6537 {
6538 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6539 {
6540 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6541 }
6542 }
6543 else
6544 {
6545 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6546 }
6547 }
6548
6549 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6550 {
6551 int type = oldLoc.GetType();
6553 {
6554 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6555 }
6557 {
6558 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6559 }
6560 }
6561 if (!m_OldLocation)
6562 {
6563 m_OldLocation = new InventoryLocation;
6564 }
6565 m_OldLocation.Copy(oldLoc);
6566 }
6567 else
6568 {
6569 if (m_OldLocation)
6570 {
6571 m_OldLocation.Reset();
6572 }
6573 }
6574
6576 }
6577 else
6578 {
6579 if (new_player)
6580 {
6581 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6582 if (res_index >= 0)
6583 {
6584 InventoryLocation il = new InventoryLocation;
6585 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6587 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6590 {
6591 il.
GetParent().GetOnReleaseLock().Invoke(it);
6592 }
6594 {
6596 }
6597
6598 }
6599 }
6601 {
6602
6604 }
6605
6606 if (m_OldLocation)
6607 {
6608 m_OldLocation.Reset();
6609 }
6610 }
6611 }
6612
6613 override void EOnContact(IEntity other, Contact extra)
6614 {
6616 {
6617 int liquidType = -1;
6619 if (impactSpeed > 0.0)
6620 {
6622 #ifndef SERVER
6624 #else
6626 SetSynchDirty();
6627 #endif
6629 }
6630 }
6631
6632 #ifdef SERVER
6633 if (GetCompEM() && GetCompEM().IsPlugged())
6634 {
6635 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6636 GetCompEM().UnplugThis();
6637 }
6638 #endif
6639 }
6640
6642
6644 {
6646 }
6647
6649 {
6650
6651 }
6652
6654 {
6655 super.OnItemLocationChanged(old_owner, new_owner);
6656
6657 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6658 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6659
6660 if (!relatedPlayer && playerNew)
6661 relatedPlayer = playerNew;
6662
6663 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6664 {
6666 if (actionMgr)
6667 {
6668 ActionBase currentAction = actionMgr.GetRunningAction();
6669 if (currentAction)
6671 }
6672 }
6673
6674 Man ownerPlayerOld = null;
6675 Man ownerPlayerNew = null;
6676
6677 if (old_owner)
6678 {
6679 if (old_owner.
IsMan())
6680 {
6681 ownerPlayerOld = Man.Cast(old_owner);
6682 }
6683 else
6684 {
6685 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6686 }
6687 }
6688 else
6689 {
6691 {
6693
6694 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6695 {
6696 GetCompEM().UnplugThis();
6697 }
6698 }
6699 }
6700
6701 if (new_owner)
6702 {
6703 if (new_owner.
IsMan())
6704 {
6705 ownerPlayerNew = Man.Cast(new_owner);
6706 }
6707 else
6708 {
6709 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6710 }
6711 }
6712
6713 if (ownerPlayerOld != ownerPlayerNew)
6714 {
6715 if (ownerPlayerOld)
6716 {
6717 array<EntityAI> subItemsExit = new array<EntityAI>;
6719 for (int i = 0; i < subItemsExit.Count(); i++)
6720 {
6723 }
6724 }
6725
6726 if (ownerPlayerNew)
6727 {
6728 array<EntityAI> subItemsEnter = new array<EntityAI>;
6730 for (int j = 0; j < subItemsEnter.Count(); j++)
6731 {
6734 }
6735 }
6736 }
6737 else if (ownerPlayerNew != null)
6738 {
6739 PlayerBase nplayer;
6740 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6741 {
6742 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6744 for (int k = 0; k < subItemsUpdate.Count(); k++)
6745 {
6747 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6748 }
6749 }
6750 }
6751
6752 if (old_owner)
6753 old_owner.OnChildItemRemoved(this);
6754 if (new_owner)
6755 new_owner.OnChildItemReceived(this);
6756 }
6757
6758
6760 {
6761 super.EEDelete(parent);
6762 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6763 if (player)
6764 {
6766
6767 if (player.IsAlive())
6768 {
6769 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6770 if (r_index >= 0)
6771 {
6772 InventoryLocation r_il = new InventoryLocation;
6773 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6774
6775 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6778 {
6779 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6780 }
6782 {
6783 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6784 }
6785
6786 }
6787
6788 player.RemoveQuickBarEntityShortcut(this);
6789 }
6790 }
6791 }
6792
6794 {
6795 super.EEKilled(killer);
6796
6799 {
6800 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6801 {
6802 if (IsMagazine())
6803 {
6804 if (Magazine.Cast(this).GetAmmoCount() > 0)
6805 {
6807 }
6808 }
6809 else
6810 {
6812 }
6813 }
6814 }
6815 }
6816
6818 {
6819 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6820
6821 super.OnWasAttached(parent, slot_id);
6822
6825
6827 }
6828
6830 {
6831 super.OnWasDetached(parent, slot_id);
6832
6835 }
6836
6838 {
6839 int idx;
6842
6843 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6844 if (inventory_slots.Count() < 1)
6845 {
6846 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6847 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6848 }
6849 else
6850 {
6851 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6852 }
6853
6854 idx = inventory_slots.Find(slot);
6855 if (idx < 0)
6856 return "";
6857
6858 return attach_types.Get(idx);
6859 }
6860
6862 {
6863 int idx = -1;
6864 string slot;
6865
6868
6869 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6870 if (inventory_slots.Count() < 1)
6871 {
6872 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6873 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6874 }
6875 else
6876 {
6877 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6878 if (detach_types.Count() < 1)
6879 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6880 }
6881
6882 for (int i = 0; i < inventory_slots.Count(); i++)
6883 {
6884 slot = inventory_slots.Get(i);
6885 }
6886
6887 if (slot != "")
6888 {
6889 if (detach_types.Count() == 1)
6890 idx = 0;
6891 else
6892 idx = inventory_slots.Find(slot);
6893 }
6894 if (idx < 0)
6895 return "";
6896
6897 return detach_types.Get(idx);
6898 }
6899
6901 {
6902
6904
6905
6906 float min_time = 1;
6907 float max_time = 3;
6908 float delay = Math.RandomFloat(min_time, max_time);
6909
6910 explode_timer.Run(delay, this, "DoAmmoExplosion");
6911 }
6912
6914 {
6915 Magazine magazine = Magazine.Cast(this);
6916 int pop_sounds_count = 6;
6917 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6918
6919
6920 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6921 string sound_name = pop_sounds[ sound_idx ];
6923
6924
6925 magazine.ServerAddAmmoCount(-1);
6926
6927
6928 float min_temp_to_explode = 100;
6929
6930 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
6931 {
6933 }
6934 }
6935
6936
6937 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6938 {
6939 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6940
6941 const int CHANCE_DAMAGE_CARGO = 4;
6942 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6943 const int CHANCE_DAMAGE_NOTHING = 2;
6944
6946 {
6947 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6948 int chances;
6949 int rnd;
6950
6951 if (GetInventory().GetCargo())
6952 {
6953 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6954 rnd = Math.RandomInt(0,chances);
6955
6956 if (rnd < CHANCE_DAMAGE_CARGO)
6957 {
6959 }
6960 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6961 {
6963 }
6964 }
6965 else
6966 {
6967 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6968 rnd = Math.RandomInt(0,chances);
6969
6970 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6971 {
6973 }
6974 }
6975 }
6976 }
6977
6979 {
6980 if (GetInventory().GetCargo())
6981 {
6982 int item_count = GetInventory().GetCargo().GetItemCount();
6983 if (item_count > 0)
6984 {
6985 int random_pick = Math.RandomInt(0, item_count);
6987 if (!item.IsExplosive())
6988 {
6989 item.AddHealth("","",damage);
6990 return true;
6991 }
6992 }
6993 }
6994 return false;
6995 }
6996
6998 {
6999 int attachment_count = GetInventory().AttachmentCount();
7000 if (attachment_count > 0)
7001 {
7002 int random_pick = Math.RandomInt(0, attachment_count);
7003 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7004 if (!attachment.IsExplosive())
7005 {
7006 attachment.AddHealth("","",damage);
7007 return true;
7008 }
7009 }
7010 return false;
7011 }
7012
7014 {
7016 }
7017
7019 {
7021 return GetInventory().CanRemoveEntity();
7022
7023 return false;
7024 }
7025
7027 {
7028
7030 return false;
7031
7032
7034 return false;
7035
7036
7037
7039 if (delta == 0)
7040 return false;
7041
7042
7043 return true;
7044 }
7045
7047 {
7049 {
7050 if (ScriptInputUserData.CanStoreInputUserData())
7051 {
7052 ScriptInputUserData ctx = new ScriptInputUserData;
7057 ctx.
Write(destination_entity);
7061 }
7062 }
7063 else if (!
GetGame().IsMultiplayer())
7064 {
7066 }
7067 }
7068
7070 {
7071 float split_quantity_new;
7075 InventoryLocation loc = new InventoryLocation;
7076
7077 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7078 {
7080 split_quantity_new = stack_max;
7081 else
7083
7085 {
7086 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7087 if (new_item)
7088 {
7089 new_item.SetResultOfSplit(true);
7090 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7092 new_item.
SetQuantity(split_quantity_new,
false,
true);
7093 }
7094 }
7095 }
7096 else if (destination_entity && slot_id == -1)
7097 {
7098 if (quantity > stack_max)
7099 split_quantity_new = stack_max;
7100 else
7101 split_quantity_new = quantity;
7102
7104 {
7106 {
7109 }
7110
7111 if (new_item)
7112 {
7113 new_item.SetResultOfSplit(true);
7114 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7116 new_item.
SetQuantity(split_quantity_new,
false,
true);
7117 }
7118 }
7119 }
7120 else
7121 {
7122 if (stack_max != 0)
7123 {
7125 {
7127 }
7128
7129 if (split_quantity_new == 0)
7130 {
7131 if (!
GetGame().IsMultiplayer())
7132 player.PhysicalPredictiveDropItem(this);
7133 else
7134 player.ServerDropEntity(this);
7135 return;
7136 }
7137
7139 {
7141
7142 if (new_item)
7143 {
7144 new_item.SetResultOfSplit(true);
7145 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7148 new_item.PlaceOnSurface();
7149 }
7150 }
7151 }
7152 }
7153 }
7154
7156 {
7157 float split_quantity_new;
7161 InventoryLocation loc = new InventoryLocation;
7162
7163 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7164 {
7166 split_quantity_new = stack_max;
7167 else
7169
7171 {
7172 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7173 if (new_item)
7174 {
7175 new_item.SetResultOfSplit(true);
7176 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7178 new_item.
SetQuantity(split_quantity_new,
false,
true);
7179 }
7180 }
7181 }
7182 else if (destination_entity && slot_id == -1)
7183 {
7184 if (quantity > stack_max)
7185 split_quantity_new = stack_max;
7186 else
7187 split_quantity_new = quantity;
7188
7190 {
7192 {
7195 }
7196
7197 if (new_item)
7198 {
7199 new_item.SetResultOfSplit(true);
7200 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7202 new_item.
SetQuantity(split_quantity_new,
false,
true);
7203 }
7204 }
7205 }
7206 else
7207 {
7208 if (stack_max != 0)
7209 {
7211 {
7213 }
7214
7216 {
7218
7219 if (new_item)
7220 {
7221 new_item.SetResultOfSplit(true);
7222 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7225 new_item.PlaceOnSurface();
7226 }
7227 }
7228 }
7229 }
7230 }
7231
7233 {
7235 {
7236 if (ScriptInputUserData.CanStoreInputUserData())
7237 {
7238 ScriptInputUserData ctx = new ScriptInputUserData;
7243 dst.WriteToContext(ctx);
7245 }
7246 }
7247 else if (!
GetGame().IsMultiplayer())
7248 {
7250 }
7251 }
7252
7254 {
7256 {
7257 if (ScriptInputUserData.CanStoreInputUserData())
7258 {
7259 ScriptInputUserData ctx = new ScriptInputUserData;
7264 ctx.
Write(destination_entity);
7270 }
7271 }
7272 else if (!
GetGame().IsMultiplayer())
7273 {
7275 }
7276 }
7277
7279 {
7281 }
7282
7284 {
7286 float split_quantity_new;
7288 if (dst.IsValid())
7289 {
7290 int slot_id = dst.GetSlot();
7292
7293 if (quantity > stack_max)
7294 split_quantity_new = stack_max;
7295 else
7296 split_quantity_new = quantity;
7297
7299 {
7301
7302 if (new_item)
7303 {
7304 new_item.SetResultOfSplit(true);
7305 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7307 new_item.
SetQuantity(split_quantity_new,
false,
true);
7308 }
7309
7310 return new_item;
7311 }
7312 }
7313
7314 return null;
7315 }
7316
7318 {
7320 float split_quantity_new;
7322 if (destination_entity)
7323 {
7325 if (quantity > stackable)
7326 split_quantity_new = stackable;
7327 else
7328 split_quantity_new = quantity;
7329
7331 {
7332 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7333 if (new_item)
7334 {
7335 new_item.SetResultOfSplit(true);
7336 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7338 new_item.
SetQuantity(split_quantity_new,
false,
true);
7339 }
7340 }
7341 }
7342 }
7343
7345 {
7347 {
7348 if (ScriptInputUserData.CanStoreInputUserData())
7349 {
7350 ScriptInputUserData ctx = new ScriptInputUserData;
7355 ItemBase destination_entity =
this;
7356 ctx.
Write(destination_entity);
7360 }
7361 }
7362 else if (!
GetGame().IsMultiplayer())
7363 {
7365 }
7366 }
7367
7369 {
7371 float split_quantity_new;
7373 if (player)
7374 {
7376 if (quantity > stackable)
7377 split_quantity_new = stackable;
7378 else
7379 split_quantity_new = quantity;
7380
7382 {
7383 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7384 new_item =
ItemBase.Cast(in_hands);
7385 if (new_item)
7386 {
7387 new_item.SetResultOfSplit(true);
7388 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7390 new_item.SetQuantity(split_quantity_new, false, true);
7391 }
7392 }
7393 }
7394 }
7395
7397 {
7399 float split_quantity_new = Math.Floor(quantity * 0.5);
7400
7402 return;
7403
7405
7406 if (new_item)
7407 {
7408 if (new_item.GetQuantityMax() < split_quantity_new)
7409 {
7410 split_quantity_new = new_item.GetQuantityMax();
7411 }
7412
7413 new_item.SetResultOfSplit(true);
7414 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7415
7417 {
7420 }
7421 else
7422 {
7424 new_item.
SetQuantity(split_quantity_new,
false,
true);
7425 }
7426 }
7427 }
7428
7430 {
7432 float split_quantity_new = Math.Floor(quantity / 2);
7433
7435 return;
7436
7437 InventoryLocation invloc = new InventoryLocation;
7439
7441 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7442
7443 if (new_item)
7444 {
7445 if (new_item.GetQuantityMax() < split_quantity_new)
7446 {
7447 split_quantity_new = new_item.GetQuantityMax();
7448 }
7450 {
7453 }
7454 else if (split_quantity_new > 1)
7455 {
7457 new_item.
SetQuantity(split_quantity_new,
false,
true);
7458 }
7459 }
7460 }
7461
7464 {
7465 SetWeightDirty();
7467
7468 if (parent)
7469 parent.OnAttachmentQuantityChangedEx(this, delta);
7470
7472 {
7474 {
7476 }
7478 {
7479 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7481 }
7482 }
7483
7484 }
7485
7488 {
7489
7490 }
7491
7494 {
7496 }
7497
7499 {
7500 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7501
7503 {
7504 if (newLevel == GameConstants.STATE_RUINED)
7505 {
7507 EntityAI parent = GetHierarchyParent();
7508 if (parent && parent.IsFireplace())
7509 {
7510 CargoBase cargo = GetInventory().GetCargo();
7511 if (cargo)
7512 {
7514 {
7516 }
7517 }
7518 }
7519 }
7520
7522 {
7523
7525 return;
7526 }
7527
7528 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7529 {
7531 }
7532 }
7533 }
7534
7535
7537 {
7538 super.OnRightClick();
7539
7541 {
7543 {
7544 if (ScriptInputUserData.CanStoreInputUserData())
7545 {
7546 EntityAI root = GetHierarchyRoot();
7547 Man playerOwner = GetHierarchyRootPlayer();
7548 InventoryLocation dst = new InventoryLocation;
7549
7550
7551 if (!playerOwner && root && root == this)
7552 {
7554 }
7555 else
7556 {
7557
7558 GetInventory().GetCurrentInventoryLocation(dst);
7560 {
7563 {
7565 }
7566 else
7567 {
7569
7570
7571 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7572 {
7574 }
7575 else
7576 {
7577 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7578 }
7579 }
7580 }
7581 }
7582
7583 ScriptInputUserData ctx = new ScriptInputUserData;
7591 }
7592 }
7593 else if (!
GetGame().IsMultiplayer())
7594 {
7596 }
7597 }
7598 }
7599
7601 {
7602 if (root)
7603 {
7604 vector m4[4];
7605 root.GetTransform(m4);
7606 dst.SetGround(this, m4);
7607 }
7608 else
7609 {
7610 GetInventory().GetCurrentInventoryLocation(dst);
7611 }
7612 }
7613
7614 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7615 {
7616
7617 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7618 return false;
7619
7620 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7621 return false;
7622
7623
7625 return false;
7626
7627
7628 Magazine mag = Magazine.Cast(this);
7629 if (mag)
7630 {
7631 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7632 return false;
7633
7634 if (stack_max_limit)
7635 {
7636 Magazine other_mag = Magazine.Cast(other_item);
7637 if (other_item)
7638 {
7639 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7640 return false;
7641 }
7642
7643 }
7644 }
7645 else
7646 {
7647
7649 return false;
7650
7652 return false;
7653 }
7654
7655 PlayerBase player = null;
7656 if (CastTo(player, GetHierarchyRootPlayer()))
7657 {
7658 if (player.GetInventory().HasAttachment(this))
7659 return false;
7660
7661 if (player.IsItemsToDelete())
7662 return false;
7663 }
7664
7665 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7666 return false;
7667
7668 int slotID;
7670 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7671 return false;
7672
7673 return true;
7674 }
7675
7677 {
7679 }
7680
7682 {
7683 return m_IsResultOfSplit;
7684 }
7685
7687 {
7688 m_IsResultOfSplit = value;
7689 }
7690
7692 {
7694 }
7695
7697 {
7698 float other_item_quantity = other_item.GetQuantity();
7699 float this_free_space;
7700
7702
7704
7705 if (other_item_quantity > this_free_space)
7706 {
7707 return this_free_space;
7708 }
7709 else
7710 {
7711 return other_item_quantity;
7712 }
7713 }
7714
7716 {
7718 }
7719
7721 {
7723 return;
7724
7725 if (!IsMagazine() && other_item)
7726 {
7728 if (quantity_used != 0)
7729 {
7730 float hp1 = GetHealth01("","");
7731 float hp2 = other_item.GetHealth01("","");
7732 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7733 hpResult = hpResult / (
GetQuantity() + quantity_used);
7734
7735 hpResult *= GetMaxHealth();
7736 Math.Round(hpResult);
7737 SetHealth("", "Health", hpResult);
7738
7740 other_item.AddQuantity(-quantity_used);
7741 }
7742 }
7744 }
7745
7747 {
7748 #ifdef SERVER
7749 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7750 GetHierarchyParent().IncreaseLifetimeUp();
7751 #endif
7752 };
7753
7755 {
7756 PlayerBase p = PlayerBase.Cast(player);
7757
7758 array<int> recipesIds = p.m_Recipes;
7759 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7760 if (moduleRecipesManager)
7761 {
7762 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7763 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7764 }
7765
7766 for (int i = 0;i < recipesIds.Count(); i++)
7767 {
7768 int key = recipesIds.Get(i);
7769 string recipeName = moduleRecipesManager.GetRecipeName(key);
7771 }
7772 }
7773
7774
7775 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7776 {
7777 super.GetDebugActions(outputList);
7778
7779
7785
7786
7791
7796
7797
7801
7802
7804 {
7808 }
7809
7812
7813
7817
7819
7820 InventoryLocation loc = new InventoryLocation();
7821 GetInventory().GetCurrentInventoryLocation(loc);
7823 {
7824 if (Gizmo_IsSupported())
7827 }
7828
7830 }
7831
7832
7833
7834
7836 {
7837 super.OnAction(action_id, player, ctx);
7838
7840 {
7841 switch (action_id)
7842 {
7845 return true;
7848 return true;
7849 }
7850 }
7851
7853 {
7854 switch (action_id)
7855 {
7857 Delete();
7858 return true;
7859 }
7860 }
7861
7862 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7863 {
7864 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7865 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7866 PlayerBase p = PlayerBase.Cast(player);
7867 if (
EActions.RECIPES_RANGE_START < 1000)
7868 {
7869 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7870 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7871 }
7872 }
7873 #ifndef SERVER
7874 else if (action_id ==
EActions.WATCH_PLAYER)
7875 {
7876 PluginDeveloper.SetDeveloperItemClientEx(player);
7877 }
7878 #endif
7880 {
7881 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7882 {
7883 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7884 OnDebugButtonPressServer(id + 1);
7885 }
7886
7887 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7888 {
7889 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7891 }
7892
7893 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7894 {
7895 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7897 }
7898
7899 else if (action_id ==
EActions.ADD_QUANTITY)
7900 {
7901 if (IsMagazine())
7902 {
7903 Magazine mag = Magazine.Cast(this);
7904 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7905 }
7906 else
7907 {
7909 }
7910
7911 if (m_EM)
7912 {
7913 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7914 }
7915
7916 }
7917
7918 else if (action_id ==
EActions.REMOVE_QUANTITY)
7919 {
7920 if (IsMagazine())
7921 {
7922 Magazine mag2 = Magazine.Cast(this);
7923 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7924 }
7925 else
7926 {
7928 }
7929 if (m_EM)
7930 {
7931 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7932 }
7933
7934 }
7935
7936 else if (action_id ==
EActions.SET_QUANTITY_0)
7937 {
7939
7940 if (m_EM)
7941 {
7942 m_EM.SetEnergy(0);
7943 }
7944 }
7945
7946 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7947 {
7949
7950 if (m_EM)
7951 {
7952 m_EM.SetEnergy(m_EM.GetEnergyMax());
7953 }
7954 }
7955
7956 else if (action_id ==
EActions.ADD_HEALTH)
7957 {
7958 AddHealth("","",GetMaxHealth("","Health")/5);
7959 }
7960 else if (action_id ==
EActions.REMOVE_HEALTH)
7961 {
7962 AddHealth("","",-GetMaxHealth("","Health")/5);
7963 }
7964 else if (action_id ==
EActions.DESTROY_HEALTH)
7965 {
7966 SetHealth01("","",0);
7967 }
7968 else if (action_id ==
EActions.WATCH_ITEM)
7969 {
7971 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7972 #ifdef DEVELOPER
7973 SetDebugDeveloper_item(this);
7974 #endif
7975 }
7976
7977 else if (action_id ==
EActions.ADD_TEMPERATURE)
7978 {
7979 AddTemperature(20);
7980
7981 }
7982
7983 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7984 {
7985 AddTemperature(-20);
7986
7987 }
7988
7989 else if (action_id ==
EActions.FLIP_FROZEN)
7990 {
7991 SetFrozen(!GetIsFrozen());
7992
7993 }
7994
7995 else if (action_id ==
EActions.ADD_WETNESS)
7996 {
7998
7999 }
8000
8001 else if (action_id ==
EActions.REMOVE_WETNESS)
8002 {
8004
8005 }
8006
8007 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8008 {
8011
8012
8013 }
8014
8015 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8016 {
8019 }
8020
8021 else if (action_id ==
EActions.MAKE_SPECIAL)
8022 {
8023 auto debugParams = DebugSpawnParams.WithPlayer(player);
8024 OnDebugSpawnEx(debugParams);
8025 }
8026
8027 }
8028
8029
8030 return false;
8031 }
8032
8033
8034
8035
8039
8042
8043
8044
8046 {
8047 return false;
8048 }
8049
8050
8052 {
8053 return true;
8054 }
8055
8056
8058 {
8059 return true;
8060 }
8061
8062
8063
8065 {
8066 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8068 }
8069
8072 {
8073 return null;
8074 }
8075
8077 {
8078 return false;
8079 }
8080
8082 {
8083 return false;
8084 }
8085
8089
8090
8092 {
8093 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8094 return module_repairing.CanRepair(this, item_repair_kit);
8095 }
8096
8097
8098 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8099 {
8100 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8101 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8102 }
8103
8104
8106 {
8107
8108
8109
8110
8111
8112
8113
8114
8115 return 1;
8116 }
8117
8118
8119
8121 {
8123 }
8124
8125
8126
8128 {
8130 }
8131
8132
8141 {
8142 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8143
8144 if (player)
8145 {
8146 player.MessageStatus(text);
8147 }
8148 }
8149
8150
8159 {
8160 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8161
8162 if (player)
8163 {
8164 player.MessageAction(text);
8165 }
8166 }
8167
8168
8177 {
8178 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8179
8180 if (player)
8181 {
8182 player.MessageFriendly(text);
8183 }
8184 }
8185
8186
8195 {
8196 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8197
8198 if (player)
8199 {
8200 player.MessageImportant(text);
8201 }
8202 }
8203
8205 {
8206 return true;
8207 }
8208
8209
8210 override bool KindOf(
string tag)
8211 {
8212 bool found = false;
8213 string item_name = this.
GetType();
8216
8217 int array_size = item_tag_array.Count();
8218 for (int i = 0; i < array_size; i++)
8219 {
8220 if (item_tag_array.Get(i) == tag)
8221 {
8222 found = true;
8223 break;
8224 }
8225 }
8226 return found;
8227 }
8228
8229
8231 {
8232
8233 super.OnRPC(sender, rpc_type,ctx);
8234
8235
8236 switch (rpc_type)
8237 {
8238 #ifndef SERVER
8239 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8240 Param2<bool, string> p = new Param2<bool, string>(false, "");
8241
8243 return;
8244
8245 bool play = p.param1;
8246 string soundSet = p.param2;
8247
8248 if (play)
8249 {
8251 {
8253 {
8255 }
8256 }
8257 else
8258 {
8260 }
8261 }
8262 else
8263 {
8265 }
8266
8267 break;
8268 #endif
8269
8270 }
8271
8273 {
8275 }
8276 }
8277
8278
8279
8280
8282 {
8283 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8284 return plugin.GetID(
name);
8285 }
8286
8288 {
8289 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8290 return plugin.GetName(id);
8291 }
8292
8295 {
8296
8297
8298 int varFlags;
8299 if (!ctx.
Read(varFlags))
8300 return;
8301
8302 if (varFlags & ItemVariableFlags.FLOAT)
8303 {
8305 }
8306 }
8307
8309 {
8310
8311 super.SerializeNumericalVars(floats_out);
8312
8313
8314
8316 {
8318 }
8319
8321 {
8323 }
8324
8326 {
8328 }
8329
8331 {
8336 }
8337
8339 {
8341 }
8342 }
8343
8345 {
8346
8347 super.DeSerializeNumericalVars(floats);
8348
8349
8350 int index = 0;
8351 int mask = Math.Round(floats.Get(index));
8352
8353 index++;
8354
8356 {
8358 {
8360 }
8361 else
8362 {
8363 float quantity = floats.Get(index);
8365 }
8366 index++;
8367 }
8368
8370 {
8371 float wet = floats.Get(index);
8373 index++;
8374 }
8375
8377 {
8378 int liquidtype = Math.Round(floats.Get(index));
8380 index++;
8381 }
8382
8384 {
8386 index++;
8388 index++;
8390 index++;
8392 index++;
8393 }
8394
8396 {
8397 int cleanness = Math.Round(floats.Get(index));
8399 index++;
8400 }
8401 }
8402
8404 {
8405 super.WriteVarsToCTX(ctx);
8406
8407
8409 {
8411 }
8412
8414 {
8416 }
8417
8419 {
8421 }
8422
8424 {
8425 int r,g,b,a;
8431 }
8432
8434 {
8436 }
8437 }
8438
8440 {
8441 if (!super.ReadVarsFromCTX(ctx,version))
8442 return false;
8443
8444 int intValue;
8445 float value;
8446
8447 if (version < 140)
8448 {
8449 if (!ctx.
Read(intValue))
8450 return false;
8451
8452 m_VariablesMask = intValue;
8453 }
8454
8456 {
8457 if (!ctx.
Read(value))
8458 return false;
8459
8461 {
8463 }
8464 else
8465 {
8467 }
8468 }
8469
8470 if (version < 140)
8471 {
8473 {
8474 if (!ctx.
Read(value))
8475 return false;
8476 SetTemperatureDirect(value);
8477 }
8478 }
8479
8481 {
8482 if (!ctx.
Read(value))
8483 return false;
8485 }
8486
8488 {
8489 if (!ctx.
Read(intValue))
8490 return false;
8492 }
8493
8495 {
8496 int r,g,b,a;
8498 return false;
8500 return false;
8502 return false;
8504 return false;
8505
8507 }
8508
8510 {
8511 if (!ctx.
Read(intValue))
8512 return false;
8514 }
8515
8516 if (version >= 138 && version < 140)
8517 {
8519 {
8520 if (!ctx.
Read(intValue))
8521 return false;
8522 SetFrozen(intValue);
8523 }
8524 }
8525
8526 return true;
8527 }
8528
8529
8531 {
8534 {
8536 }
8537
8538 if (!super.OnStoreLoad(ctx, version))
8539 {
8541 return false;
8542 }
8543
8544 if (version >= 114)
8545 {
8546 bool hasQuickBarIndexSaved;
8547
8548 if (!ctx.
Read(hasQuickBarIndexSaved))
8549 {
8551 return false;
8552 }
8553
8554 if (hasQuickBarIndexSaved)
8555 {
8556 int itmQBIndex;
8557
8558
8559 if (!ctx.
Read(itmQBIndex))
8560 {
8562 return false;
8563 }
8564
8565 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8566 if (itmQBIndex != -1 && parentPlayer)
8567 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8568 }
8569 }
8570 else
8571 {
8572
8573 PlayerBase player;
8574 int itemQBIndex;
8575 if (version ==
int.
MAX)
8576 {
8577 if (!ctx.
Read(itemQBIndex))
8578 {
8580 return false;
8581 }
8582 }
8583 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8584 {
8585
8586 if (!ctx.
Read(itemQBIndex))
8587 {
8589 return false;
8590 }
8591 if (itemQBIndex != -1 && player)
8592 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8593 }
8594 }
8595
8596 if (version < 140)
8597 {
8598
8599 if (!LoadVariables(ctx, version))
8600 {
8602 return false;
8603 }
8604 }
8605
8606
8608 {
8610 return false;
8611 }
8612 if (version >= 132)
8613 {
8615 if (raib)
8616 {
8618 {
8620 return false;
8621 }
8622 }
8623 }
8624
8626 return true;
8627 }
8628
8629
8630
8632 {
8633 super.OnStoreSave(ctx);
8634
8635 PlayerBase player;
8636 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8637 {
8639
8640 int itemQBIndex = -1;
8641 itemQBIndex = player.FindQuickBarEntityIndex(this);
8642 ctx.
Write(itemQBIndex);
8643 }
8644 else
8645 {
8647 }
8648
8650
8652 if (raib)
8653 {
8655 }
8656 }
8657
8658
8660 {
8661 super.AfterStoreLoad();
8662
8664 {
8666 }
8667
8669 {
8672 }
8673 }
8674
8676 {
8677 super.EEOnAfterLoad();
8678
8680 {
8682 }
8683
8686 }
8687
8689 {
8690 return false;
8691 }
8692
8693
8694
8696 {
8698 {
8699 #ifdef PLATFORM_CONSOLE
8700
8702 {
8704 if (menu)
8705 {
8707 }
8708 }
8709 #endif
8710 }
8711
8713 {
8716 }
8717
8719 {
8720 SetWeightDirty();
8722 }
8724 {
8727 }
8728
8730 {
8733 }
8735 {
8738 }
8739
8740 super.OnVariablesSynchronized();
8741 }
8742
8743
8744
8746 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8747 {
8748 if (!IsServerCheck(allow_client))
8749 return false;
8750
8752 return false;
8753
8756
8757 if (value <= (min + 0.001))
8758 value = min;
8759
8760 if (value == min)
8761 {
8762 if (destroy_config)
8763 {
8764 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8765 if (dstr)
8766 {
8768 this.Delete();
8769 return true;
8770 }
8771 }
8772 else if (destroy_forced)
8773 {
8775 this.Delete();
8776 return true;
8777 }
8778
8780 }
8781
8784
8786 {
8788
8789 if (delta)
8791 }
8792
8794
8795 return false;
8796 }
8797
8798
8800 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8801 {
8803 }
8804
8806 {
8809 }
8810
8812 {
8815 }
8816
8818 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8819 {
8820 float value_clamped = Math.Clamp(value, 0, 1);
8822 SetQuantity(result, destroy_config, destroy_forced);
8823 }
8824
8825
8828 {
8830 }
8831
8833 {
8835 }
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8847 {
8848 int slot = -1;
8849 if (GetInventory())
8850 {
8851 InventoryLocation il = new InventoryLocation;
8852 GetInventory().GetCurrentInventoryLocation(il);
8854 }
8855
8857 }
8858
8860 {
8861 float quantity_max = 0;
8862
8864 {
8865 if (attSlotID != -1)
8866 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8867
8868 if (quantity_max <= 0)
8870 }
8871
8872 if (quantity_max <= 0)
8874
8875 return quantity_max;
8876 }
8877
8879 {
8881 }
8882
8884 {
8886 }
8887
8888
8890 {
8892 }
8893
8895 {
8897 }
8898
8900 {
8902 }
8903
8904
8906 {
8907
8908 float weightEx = GetWeightEx();
8909 float special = GetInventoryAndCargoWeight();
8910 return weightEx - special;
8911 }
8912
8913
8915 {
8917 }
8918
8920 {
8922 {
8923 #ifdef DEVELOPER
8924 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8925 {
8926 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8928 }
8929 #endif
8930
8932 }
8933 else if (HasEnergyManager())
8934 {
8935 #ifdef DEVELOPER
8936 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8937 {
8938 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8939 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8940 }
8941 #endif
8942 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
8943 }
8944 else
8945 {
8946 #ifdef DEVELOPER
8947 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8948 {
8949 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8950 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8951 }
8952 #endif
8953 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
8954 }
8955 }
8956
8959 {
8960 int item_count = 0;
8962
8963 if (GetInventory().GetCargo() != NULL)
8964 {
8965 item_count = GetInventory().GetCargo().GetItemCount();
8966 }
8967
8968 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8969 {
8970 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8971 if (item)
8972 item_count += item.GetNumberOfItems();
8973 }
8974 return item_count;
8975 }
8976
8979 {
8980 float weight = 0;
8981 float wetness = 1;
8982 if (include_wetness)
8985 {
8986 weight = wetness * m_ConfigWeight;
8987 }
8989 {
8990 weight = 1;
8991 }
8992 return weight;
8993 }
8994
8995
8996
8998 {
8999 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9000 {
9001 GameInventory inv = GetInventory();
9002 array<EntityAI> items = new array<EntityAI>;
9004 for (int i = 0; i < items.Count(); i++)
9005 {
9007 if (item)
9008 {
9010 }
9011 }
9012 }
9013 }
9014
9015
9016
9017
9019 {
9020 float energy = 0;
9021 if (HasEnergyManager())
9022 {
9023 energy = GetCompEM().GetEnergy();
9024 }
9025 return energy;
9026 }
9027
9028
9030 {
9031 super.OnEnergyConsumed();
9032
9034 }
9035
9037 {
9038 super.OnEnergyAdded();
9039
9041 }
9042
9043
9045 {
9046 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9047 {
9049 {
9050 float energy_0to1 = GetCompEM().GetEnergy0To1();
9052 }
9053 }
9054 }
9055
9056
9058 {
9059 return ConfigGetFloat("heatIsolation");
9060 }
9061
9063 {
9065 }
9066
9068 {
9069 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9070 if (
GetGame().ConfigIsExisting(paramPath))
9072
9073 return 0.0;
9074 }
9075
9077 {
9078 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9079 if (
GetGame().ConfigIsExisting(paramPath))
9081
9082 return 0.0;
9083 }
9084
9085 override void SetWet(
float value,
bool allow_client =
false)
9086 {
9087 if (!IsServerCheck(allow_client))
9088 return;
9089
9092
9094
9095 m_VarWet = Math.Clamp(value, min, max);
9096
9098 {
9101 }
9102 }
9103
9104 override void AddWet(
float value)
9105 {
9107 }
9108
9110 {
9112 }
9113
9115 {
9117 }
9118
9120 {
9122 }
9123
9125 {
9127 }
9128
9130 {
9132 }
9133
9135 {
9138 if (newLevel != oldLevel)
9139 {
9141 }
9142 }
9143
9145 {
9146 SetWeightDirty();
9147 }
9148
9150 {
9151 return GetWetLevelInternal(
m_VarWet);
9152 }
9153
9154
9155
9157 {
9159 }
9160
9162 {
9164 }
9165
9167 {
9169 }
9170
9172 {
9174 }
9175
9176
9177
9179 {
9180 if (ConfigIsExisting("itemModelLength"))
9181 {
9182 return ConfigGetFloat("itemModelLength");
9183 }
9184 return 0;
9185 }
9186
9188 {
9189 if (ConfigIsExisting("itemAttachOffset"))
9190 {
9191 return ConfigGetFloat("itemAttachOffset");
9192 }
9193 return 0;
9194 }
9195
9196 override void SetCleanness(
int value,
bool allow_client =
false)
9197 {
9198 if (!IsServerCheck(allow_client))
9199 return;
9200
9202
9204
9207 }
9208
9210 {
9212 }
9213
9215 {
9216 return true;
9217 }
9218
9219
9220
9221
9223 {
9225 }
9226
9228 {
9230 }
9231
9232
9233
9234
9235 override void SetColor(
int r,
int g,
int b,
int a)
9236 {
9242 }
9244 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9245 {
9250 }
9251
9253 {
9255 }
9256
9259 {
9260 int r,g,b,a;
9262 r = r/255;
9263 g = g/255;
9264 b = b/255;
9265 a = a/255;
9266 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9267 }
9268
9269
9270
9271 override void SetLiquidType(
int value,
bool allow_client =
false)
9272 {
9273 if (!IsServerCheck(allow_client))
9274 return;
9275
9280 }
9281
9283 {
9284 return ConfigGetInt("varLiquidTypeInit");
9285 }
9286
9288 {
9290 }
9291
9293 {
9295 SetFrozen(false);
9296 }
9297
9300 {
9301 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9302 }
9303
9304
9307 {
9308 PlayerBase nplayer;
9309 if (PlayerBase.CastTo(nplayer, player))
9310 {
9312
9313 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9314 }
9315 }
9316
9317
9320 {
9321 PlayerBase nplayer;
9322 if (PlayerBase.CastTo(nplayer,player))
9323 {
9324
9325 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9326
9327 }
9328
9329
9330 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9331
9332
9333 if (HasEnergyManager())
9334 {
9335 GetCompEM().UpdatePlugState();
9336 }
9337 }
9338
9339
9341 {
9342 super.OnPlacementStarted(player);
9343
9345 }
9346
9347 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9348 {
9350 {
9351 m_AdminLog.OnPlacementComplete(player,
this);
9352 }
9353
9354 super.OnPlacementComplete(player, position, orientation);
9355 }
9356
9357
9358
9359
9360
9362 {
9364 {
9365 return true;
9366 }
9367 else
9368 {
9369 return false;
9370 }
9371 }
9372
9373
9375 {
9377 {
9379 }
9380 }
9381
9382
9384 {
9386 }
9387
9389 {
9391 }
9392
9393 override void InsertAgent(
int agent,
float count = 1)
9394 {
9395 if (count < 1)
9396 return;
9397
9399 }
9400
9403 {
9405 }
9406
9407
9409 {
9411 }
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9455 {
9457 return false;
9458 return true;
9459 }
9460
9462 {
9463
9465 }
9466
9467
9470 {
9471 super.CheckForRoofLimited(timeTresholdMS);
9472
9474 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9475 {
9476 m_PreviousRoofTestTime = time;
9477 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9478 }
9479 }
9480
9481
9483 {
9485 {
9486 return 0;
9487 }
9488
9489 if (GetInventory().GetAttachmentSlotsCount() != 0)
9490 {
9491 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9492 if (filter)
9493 return filter.GetProtectionLevel(type, false, system);
9494 else
9495 return 0;
9496 }
9497
9498 string subclassPath, entryName;
9499
9500 switch (type)
9501 {
9503 entryName = "biological";
9504 break;
9506 entryName = "chemical";
9507 break;
9508 default:
9509 entryName = "biological";
9510 break;
9511 }
9512
9513 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9514
9516 }
9517
9518
9519
9522 {
9523 if (!IsMagazine())
9525
9527 }
9528
9529
9530
9531
9532
9537 {
9538 return true;
9539 }
9540
9542 {
9544 }
9545
9546
9547
9548
9549
9551 {
9552 if (parent)
9553 {
9554 if (parent.IsInherited(DayZInfected))
9555 return true;
9556
9557 if (!parent.IsRuined())
9558 return true;
9559 }
9560
9561 return true;
9562 }
9563
9565 {
9566 if (!super.CanPutAsAttachment(parent))
9567 {
9568 return false;
9569 }
9570
9571 if (!IsRuined() && !parent.IsRuined())
9572 {
9573 return true;
9574 }
9575
9576 return false;
9577 }
9578
9580 {
9581
9582
9583
9584
9585 return super.CanReceiveItemIntoCargo(item);
9586 }
9587
9589 {
9590
9591
9592
9593
9594 GameInventory attachmentInv = attachment.GetInventory();
9596 {
9597 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9598 return false;
9599 }
9600
9601 InventoryLocation loc = new InventoryLocation();
9602 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9603 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9604 return false;
9605
9606 return super.CanReceiveAttachment(attachment, slotId);
9607 }
9608
9610 {
9611 if (!super.CanReleaseAttachment(attachment))
9612 return false;
9613
9614 return GetInventory().AreChildrenAccessible();
9615 }
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9638 {
9639 int id = muzzle_owner.GetMuzzleID();
9640 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9641
9642 if (WPOF_array)
9643 {
9644 for (int i = 0; i < WPOF_array.Count(); i++)
9645 {
9646 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9647
9648 if (WPOF)
9649 {
9650 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9651 }
9652 }
9653 }
9654 }
9655
9656
9658 {
9659 int id = muzzle_owner.GetMuzzleID();
9661
9662 if (WPOBE_array)
9663 {
9664 for (int i = 0; i < WPOBE_array.Count(); i++)
9665 {
9666 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9667
9668 if (WPOBE)
9669 {
9670 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9671 }
9672 }
9673 }
9674 }
9675
9676
9678 {
9679 int id = muzzle_owner.GetMuzzleID();
9680 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9681
9682 if (WPOOH_array)
9683 {
9684 for (int i = 0; i < WPOOH_array.Count(); i++)
9685 {
9686 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9687
9688 if (WPOOH)
9689 {
9690 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9691 }
9692 }
9693 }
9694 }
9695
9696
9698 {
9699 int id = muzzle_owner.GetMuzzleID();
9700 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9701
9702 if (WPOOH_array)
9703 {
9704 for (int i = 0; i < WPOOH_array.Count(); i++)
9705 {
9706 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9707
9708 if (WPOOH)
9709 {
9710 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9711 }
9712 }
9713 }
9714 }
9715
9716
9718 {
9719 int id = muzzle_owner.GetMuzzleID();
9720 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9721
9722 if (WPOOH_array)
9723 {
9724 for (int i = 0; i < WPOOH_array.Count(); i++)
9725 {
9726 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9727
9728 if (WPOOH)
9729 {
9730 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9731 }
9732 }
9733 }
9734 }
9735
9736
9737
9739 {
9741 {
9742 return true;
9743 }
9744
9745 return false;
9746 }
9747
9749 {
9751 {
9752 return true;
9753 }
9754
9755 return false;
9756 }
9757
9759 {
9761 {
9762 return true;
9763 }
9764
9765 return false;
9766 }
9767
9769 {
9770 return false;
9771 }
9772
9775 {
9776 return UATimeSpent.DEFAULT_DEPLOY;
9777 }
9778
9779
9780
9781
9783 {
9785 SetSynchDirty();
9786 }
9787
9789 {
9791 }
9792
9793
9795 {
9796 return false;
9797 }
9798
9801 {
9802 string att_type = "None";
9803
9804 if (ConfigIsExisting("soundAttType"))
9805 {
9806 att_type = ConfigGetString("soundAttType");
9807 }
9808
9810 }
9811
9813 {
9815 }
9816
9817
9818
9819
9820
9826
9828 {
9831
9833 }
9834
9835
9837 {
9839 return;
9840
9842
9845
9848
9849 SoundParameters params = new SoundParameters();
9853 }
9854
9855
9857 {
9859 return;
9860
9862 SetSynchDirty();
9863
9866 }
9867
9868
9870 {
9872 return;
9873
9875 SetSynchDirty();
9876
9879 }
9880
9882 {
9884 }
9885
9887 {
9889 }
9890
9893 {
9894 if (!
GetGame().IsDedicatedServer())
9895 {
9896 if (ConfigIsExisting("attachSoundSet"))
9897 {
9898 string cfg_path = "";
9899 string soundset = "";
9901
9904 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9905 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9906
9907 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9908 {
9909 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9910 {
9911 if (cfg_slot_array[i] == slot_type)
9912 {
9913 soundset = cfg_soundset_array[i];
9914 break;
9915 }
9916 }
9917 }
9918
9919 if (soundset != "")
9920 {
9921 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9923 }
9924 }
9925 }
9926 }
9927
9929 {
9930
9931 }
9932
9933 void OnApply(PlayerBase player);
9934
9936 {
9937 return 1.0;
9938 };
9939
9941 {
9943 }
9944
9946 {
9948 }
9949
9951
9953 {
9954 SetDynamicPhysicsLifeTime(0.01);
9956 }
9957
9959 {
9960 array<string> zone_names = new array<string>;
9961 GetDamageZones(zone_names);
9962 for (int i = 0; i < zone_names.Count(); i++)
9963 {
9964 SetHealthMax(zone_names.Get(i),"Health");
9965 }
9966 SetHealthMax("","Health");
9967 }
9968
9971 {
9972 float global_health = GetHealth01("","Health");
9973 array<string> zones = new array<string>;
9974 GetDamageZones(zones);
9975
9976 for (int i = 0; i < zones.Count(); i++)
9977 {
9978 SetHealth01(zones.Get(i),"Health",global_health);
9979 }
9980 }
9981
9984 {
9985 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9986 }
9987
9989 {
9990 if (!hasRootAsPlayer)
9991 {
9992 if (refParentIB)
9993 {
9994
9995 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9996 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9997
9998 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9999 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10000
10003 }
10004 else
10005 {
10006
10009 }
10010 }
10011 }
10012
10014 {
10016 {
10017 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10018 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10019 {
10020 float heatPermCoef = 1.0;
10022 while (ent)
10023 {
10024 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10025 ent = ent.GetHierarchyParent();
10026 }
10027
10028 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10029 }
10030 }
10031 }
10032
10034 {
10035
10036 EntityAI parent = GetHierarchyParent();
10037 if (!parent)
10038 {
10039 hasParent = false;
10040 hasRootAsPlayer = false;
10041 }
10042 else
10043 {
10044 hasParent = true;
10045 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10046 refParentIB =
ItemBase.Cast(parent);
10047 }
10048 }
10049
10050 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10051 {
10052
10053 }
10054
10056 {
10057
10058 return false;
10059 }
10060
10062 {
10063
10064
10065 return false;
10066 }
10067
10069 {
10070
10071 return false;
10072 }
10073
10076 {
10077 return !GetIsFrozen() &&
IsOpen();
10078 }
10079
10081 {
10082 bool hasParent = false, hasRootAsPlayer = false;
10084
10085 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10086 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10087
10088 if (wwtu || foodDecay)
10089 {
10093
10094 if (processWetness || processTemperature || processDecay)
10095 {
10097
10098 if (processWetness)
10099 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10100
10101 if (processTemperature)
10103
10104 if (processDecay)
10105 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10106 }
10107 }
10108 }
10109
10112 {
10114 }
10115
10117 {
10120
10121 return super.GetTemperatureFreezeThreshold();
10122 }
10123
10125 {
10128
10129 return super.GetTemperatureThawThreshold();
10130 }
10131
10133 {
10136
10137 return super.GetItemOverheatThreshold();
10138 }
10139
10141 {
10143 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10144
10145 return super.GetTemperatureFreezeTime();
10146 }
10147
10149 {
10151 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10152
10153 return super.GetTemperatureThawTime();
10154 }
10155
10160
10162 {
10163 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10164 }
10165
10167 {
10168 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10169 }
10170
10173 {
10175 }
10176
10178 {
10180 }
10181
10183 {
10185 }
10186
10189 {
10190 return null;
10191 }
10192
10195 {
10196 return false;
10197 }
10198
10200 {
10202 {
10205 if (!trg)
10206 {
10208 explosive = this;
10209 }
10210
10211 explosive.PairRemote(trg);
10213
10214 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10215 trg.SetPersistentPairID(persistentID);
10216 explosive.SetPersistentPairID(persistentID);
10217
10218 return true;
10219 }
10220 return false;
10221 }
10222
10225 {
10226 float ret = 1.0;
10229 ret *= GetHealth01();
10230
10231 return ret;
10232 }
10233
10234 #ifdef DEVELOPER
10235 override void SetDebugItem()
10236 {
10237 super.SetDebugItem();
10238 _itemBase = this;
10239 }
10240
10242 {
10243 string text = super.GetDebugText();
10244
10246 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10247
10248 return text;
10249 }
10250 #endif
10251
10253 {
10254 return true;
10255 }
10256
10258
10260
10262 {
10265 }
10266
10267
10275
10291}
10292
10294{
10296 if (entity)
10297 {
10298 bool is_item = entity.IsInherited(
ItemBase);
10299 if (is_item && full_quantity)
10300 {
10303 }
10304 }
10305 else
10306 {
10308 return NULL;
10309 }
10310 return entity;
10311}
10312
10314{
10315 if (item)
10316 {
10317 if (health > 0)
10318 item.SetHealth("", "", health);
10319
10320 if (item.CanHaveTemperature())
10321 {
10323 if (item.CanFreeze())
10324 item.SetFrozen(false);
10325 }
10326
10327 if (item.HasEnergyManager())
10328 {
10329 if (quantity >= 0)
10330 {
10331 item.GetCompEM().SetEnergy0To1(quantity);
10332 }
10333 else
10334 {
10336 }
10337 }
10338 else if (item.IsMagazine())
10339 {
10340 Magazine mag = Magazine.Cast(item);
10341 if (quantity >= 0)
10342 {
10343 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10344 }
10345 else
10346 {
10348 }
10349
10350 }
10351 else
10352 {
10353 if (quantity >= 0)
10354 {
10355 item.SetQuantityNormalized(quantity, false);
10356 }
10357 else
10358 {
10360 }
10361
10362 }
10363 }
10364}
10365
10366#ifdef DEVELOPER
10368#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.