5406{
5408 {
5409 return true;
5410 }
5411};
5412
5413
5414
5416{
5420
5422
5425
5426
5427
5428
5429
5438
5444
5449
5454
5475 protected bool m_IsResultOfSplit
5476
5478
5483
5484
5485
5487
5491
5492
5493
5495
5498
5499
5500
5506
5507
5515
5518
5519
5521
5522
5524
5525
5530
5531
5536
5537
5539
5540
5542 {
5547
5548 if (!
GetGame().IsDedicatedServer())
5549 {
5551 {
5553
5555 {
5557 }
5558 }
5559
5562 }
5563
5564 m_OldLocation = null;
5565
5567 {
5569 }
5570
5571 if (ConfigIsExisting("headSelectionsToHide"))
5572 {
5575 }
5576
5578 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5579 {
5581 }
5582
5584
5585 m_IsResultOfSplit = false;
5586
5588 }
5589
5591 {
5592 super.InitItemVariables();
5593
5599 m_Count = ConfigGetInt(
"count");
5600
5603
5608
5611
5616
5628
5632
5633
5636 if (ConfigIsExisting("canBeSplit"))
5637 {
5640 }
5641
5643 if (ConfigIsExisting("itemBehaviour"))
5645
5646
5649 RegisterNetSyncVariableInt("m_VarLiquidType");
5650 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5651
5652 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5653 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5654 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5655
5656 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5657 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5658 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5659 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5660
5661 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5662 RegisterNetSyncVariableBool("m_IsTakeable");
5663 RegisterNetSyncVariableBool("m_IsHologram");
5664
5667 {
5670 }
5671
5673
5675 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5677
5678 }
5679
5681 {
5683 }
5684
5686 {
5689 {
5694 }
5695 }
5696
5697 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5698 {
5700 {
5703 }
5704
5706 }
5707
5709 {
5715 }
5716
5718
5720 {
5722
5723 if (!action)
5724 {
5725 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5726 return;
5727 }
5728
5730 if (!ai)
5731 {
5733 return;
5734 }
5735
5737 if (!action_array)
5738 {
5739 action_array = new array<ActionBase_Basic>;
5741 }
5742 if (LogManager.IsActionLogEnable())
5743 {
5744 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5745 }
5746
5747 if (action_array.Find(action) != -1)
5748 {
5749 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5750 }
5751 else
5752 {
5753 action_array.Insert(action);
5754 }
5755 }
5756
5758 {
5760 ActionBase action = player.GetActionManager().GetAction(actionName);
5763
5764 if (action_array)
5765 {
5766 action_array.RemoveItem(action);
5767 }
5768 }
5769
5770
5771
5773 {
5774 ActionOverrideData overrideData = new ActionOverrideData();
5778
5780 if (!actionMap)
5781 {
5784 }
5785
5786 actionMap.Insert(this.
Type(), overrideData);
5787
5788 }
5789
5791
5793
5794
5796 {
5799
5802
5803 string config_to_search = "CfgVehicles";
5804 string muzzle_owner_config;
5805
5807 {
5808 if (IsInherited(Weapon))
5809 config_to_search = "CfgWeapons";
5810
5811 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5812
5813 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5814
5816
5817 if (config_OnFire_subclass_count > 0)
5818 {
5819 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5820
5821 for (int i = 0; i < config_OnFire_subclass_count; i++)
5822 {
5823 string particle_class = "";
5825 string config_OnFire_entry = config_OnFire_class + particle_class;
5826 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5827 WPOF_array.Insert(WPOF);
5828 }
5829
5830
5832 }
5833 }
5834
5836 {
5837 config_to_search = "CfgWeapons";
5838 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5839
5840 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5841
5843
5844 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5845 {
5846 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5847
5848 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5849 {
5850 string particle_class2 = "";
5852 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5853 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5854 WPOBE_array.Insert(WPOBE);
5855 }
5856
5857
5859 }
5860 }
5861 }
5862
5863
5865 {
5868
5870 {
5871 string config_to_search = "CfgVehicles";
5872
5873 if (IsInherited(Weapon))
5874 config_to_search = "CfgWeapons";
5875
5876 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5877 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5878
5879 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5880 {
5881
5883
5885 {
5887 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5889 return;
5890 }
5891
5894
5895
5896
5898 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5899
5900 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5901 {
5902 string particle_class = "";
5904 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5906
5907 if (entry_type == CT_CLASS)
5908 {
5909 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5910 WPOOH_array.Insert(WPOF);
5911 }
5912 }
5913
5914
5916 }
5917 }
5918 }
5919
5921 {
5923 }
5924
5926 {
5928 {
5930
5933
5936
5937 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5938 }
5939 }
5940
5942 {
5944 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5945
5947 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5948
5950 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5951
5953 {
5955 }
5956 }
5957
5959 {
5961 }
5962
5964 {
5967 else
5969
5971 {
5974 }
5975 else
5976 {
5979
5982 }
5983
5985 }
5986
5988 {
5990 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5991 }
5992
5994 {
5996 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5998 }
5999
6001 {
6003 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6004 }
6005
6007 {
6010
6011 OverheatingParticle OP = new OverheatingParticle();
6016
6018 }
6019
6021 {
6024
6025 return -1;
6026 }
6027
6029 {
6031 {
6034
6035 for (int i = count; i > 0; --i)
6036 {
6037 int id = i - 1;
6040
6043
6044 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6045 {
6046 if (p)
6047 {
6050 }
6051 }
6052 }
6053 }
6054 }
6055
6057 {
6059 {
6061 {
6062 int id = i - 1;
6064
6065 if (OP)
6066 {
6068
6069 if (p)
6070 {
6072 }
6073
6074 delete OP;
6075 }
6076 }
6077
6080 }
6081 }
6082
6085 {
6086 return 0.0;
6087 }
6088
6089
6091 {
6092 return 250;
6093 }
6094
6096 {
6097 return 0;
6098 }
6099
6102 {
6104 return true;
6105
6106 return false;
6107 }
6108
6111 {
6114
6116 {
6118 }
6119 else
6120 {
6121
6123 }
6124
6126 }
6127
6134 {
6135 return -1;
6136 }
6137
6138
6139
6140
6142 {
6144 {
6146 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6147
6148 if (r_index >= 0)
6149 {
6150 InventoryLocation r_il = new InventoryLocation;
6151 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6152
6153 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6156 {
6157 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6158 }
6160 {
6161 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6162 }
6163
6164 }
6165
6166 player.GetHumanInventory().ClearUserReservedLocation(this);
6167 }
6168
6171 }
6172
6173
6174
6175
6177 {
6178 return ItemBase.m_DebugActionsMask;
6179 }
6180
6182 {
6183 return ItemBase.m_DebugActionsMask & mask;
6184 }
6185
6187 {
6188 ItemBase.m_DebugActionsMask = mask;
6189 }
6190
6192 {
6193 ItemBase.m_DebugActionsMask |= mask;
6194 }
6195
6197 {
6198 ItemBase.m_DebugActionsMask &= ~mask;
6199 }
6200
6202 {
6204 {
6206 }
6207 else
6208 {
6210 }
6211 }
6212
6213
6215 {
6216 if (GetEconomyProfile())
6217 {
6218 float q_max = GetEconomyProfile().GetQuantityMax();
6219 if (q_max > 0)
6220 {
6221 float q_min = GetEconomyProfile().GetQuantityMin();
6222 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6223
6225 {
6226 ComponentEnergyManager comp = GetCompEM();
6228 {
6230 }
6231 }
6233 {
6235
6236 }
6237
6238 }
6239 }
6240 }
6241
6244 {
6245 EntityAI parent = GetHierarchyParent();
6246
6247 if (parent)
6248 {
6249 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6250 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6251 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6252 }
6253 }
6254
6257 {
6258 EntityAI parent = GetHierarchyParent();
6259
6260 if (parent)
6261 {
6262 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6263 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6264 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6265 }
6266 }
6267
6269 {
6270
6271
6272
6273
6275
6277 {
6278 if (ScriptInputUserData.CanStoreInputUserData())
6279 {
6280 ScriptInputUserData ctx = new ScriptInputUserData;
6286 ctx.
Write(use_stack_max);
6289
6291 {
6292 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6293 }
6294 }
6295 }
6296 else if (!
GetGame().IsMultiplayer())
6297 {
6299 }
6300 }
6301
6303 {
6305 }
6306
6308 {
6310 }
6311
6313 {
6315 }
6316
6318 {
6319
6320 return false;
6321 }
6322
6324 {
6325 return false;
6326 }
6327
6331 {
6332 return false;
6333 }
6334
6336 {
6337 return "";
6338 }
6339
6341
6343 {
6344 return false;
6345 }
6346
6348 {
6349 return true;
6350 }
6351
6352
6353
6355 {
6356 return true;
6357 }
6358
6360 {
6361 return true;
6362 }
6363
6365 {
6366 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6368 }
6369
6371 {
6373 }
6374
6376 {
6378 if (!is_being_placed)
6380 SetSynchDirty();
6381 }
6382
6383
6385
6387 {
6389 }
6390
6392 {
6394 }
6395
6397 {
6398 return 1;
6399 }
6400
6402 {
6403 return false;
6404 }
6405
6407 {
6409 SetSynchDirty();
6410 }
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6447 {
6448 super.OnMovedInsideCargo(container);
6449
6450 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6451 }
6452
6453 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6454 {
6455 super.EEItemLocationChanged(oldLoc,newLoc);
6456
6457 PlayerBase new_player = null;
6458 PlayerBase old_player = null;
6459
6460 if (newLoc.GetParent())
6461 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6462
6463 if (oldLoc.GetParent())
6464 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6465
6467 {
6468 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6469
6470 if (r_index >= 0)
6471 {
6472 InventoryLocation r_il = new InventoryLocation;
6473 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6474
6475 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6478 {
6479 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6480 }
6482 {
6483 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6484 }
6485
6486 }
6487 }
6488
6490 {
6491 if (new_player)
6492 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6493
6494 if (new_player == old_player)
6495 {
6496
6497 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6498 {
6500 {
6501 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6502 {
6503 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6504 }
6505 }
6506 else
6507 {
6508 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6509 }
6510 }
6511
6512 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6513 {
6514 int type = oldLoc.GetType();
6516 {
6517 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6518 }
6520 {
6521 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6522 }
6523 }
6524 if (!m_OldLocation)
6525 {
6526 m_OldLocation = new InventoryLocation;
6527 }
6528 m_OldLocation.Copy(oldLoc);
6529 }
6530 else
6531 {
6532 if (m_OldLocation)
6533 {
6534 m_OldLocation.Reset();
6535 }
6536 }
6537
6539 }
6540 else
6541 {
6542 if (new_player)
6543 {
6544 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6545 if (res_index >= 0)
6546 {
6547 InventoryLocation il = new InventoryLocation;
6548 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6550 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6553 {
6554 il.
GetParent().GetOnReleaseLock().Invoke(it);
6555 }
6557 {
6559 }
6560
6561 }
6562 }
6564 {
6565
6567 }
6568
6569 if (m_OldLocation)
6570 {
6571 m_OldLocation.Reset();
6572 }
6573 }
6574 }
6575
6576 override void EOnContact(IEntity other, Contact extra)
6577 {
6579 {
6580 int liquidType = -1;
6582 if (impactSpeed > 0.0)
6583 {
6585 #ifndef SERVER
6587 #else
6589 SetSynchDirty();
6590 #endif
6592 }
6593 }
6594
6595 #ifdef SERVER
6596 if (GetCompEM() && GetCompEM().IsPlugged())
6597 {
6598 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6599 GetCompEM().UnplugThis();
6600 }
6601 #endif
6602 }
6603
6605
6607 {
6609 }
6610
6612 {
6613
6614 }
6615
6617 {
6618 super.OnItemLocationChanged(old_owner, new_owner);
6619
6620 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6621 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6622
6623 if (!relatedPlayer && playerNew)
6624 relatedPlayer = playerNew;
6625
6626 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6627 {
6629 if (actionMgr)
6630 {
6631 ActionBase currentAction = actionMgr.GetRunningAction();
6632 if (currentAction)
6634 }
6635 }
6636
6637 Man ownerPlayerOld = null;
6638 Man ownerPlayerNew = null;
6639
6640 if (old_owner)
6641 {
6642 if (old_owner.
IsMan())
6643 {
6644 ownerPlayerOld = Man.Cast(old_owner);
6645 }
6646 else
6647 {
6648 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6649 }
6650 }
6651 else
6652 {
6654 {
6656
6657 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6658 {
6659 GetCompEM().UnplugThis();
6660 }
6661 }
6662 }
6663
6664 if (new_owner)
6665 {
6666 if (new_owner.
IsMan())
6667 {
6668 ownerPlayerNew = Man.Cast(new_owner);
6669 }
6670 else
6671 {
6672 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6673 }
6674 }
6675
6676 if (ownerPlayerOld != ownerPlayerNew)
6677 {
6678 if (ownerPlayerOld)
6679 {
6680 array<EntityAI> subItemsExit = new array<EntityAI>;
6682 for (int i = 0; i < subItemsExit.Count(); i++)
6683 {
6686 }
6687 }
6688
6689 if (ownerPlayerNew)
6690 {
6691 array<EntityAI> subItemsEnter = new array<EntityAI>;
6693 for (int j = 0; j < subItemsEnter.Count(); j++)
6694 {
6697 }
6698 }
6699 }
6700 else if (ownerPlayerNew != null)
6701 {
6702 PlayerBase nplayer;
6703 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6704 {
6705 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6707 for (int k = 0; k < subItemsUpdate.Count(); k++)
6708 {
6710 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6711 }
6712 }
6713 }
6714
6715 if (old_owner)
6716 old_owner.OnChildItemRemoved(this);
6717 if (new_owner)
6718 new_owner.OnChildItemReceived(this);
6719 }
6720
6721
6723 {
6724 super.EEDelete(parent);
6725 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6726 if (player)
6727 {
6729
6730 if (player.IsAlive())
6731 {
6732 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6733 if (r_index >= 0)
6734 {
6735 InventoryLocation r_il = new InventoryLocation;
6736 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6737
6738 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6741 {
6742 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6743 }
6745 {
6746 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6747 }
6748
6749 }
6750
6751 player.RemoveQuickBarEntityShortcut(this);
6752 }
6753 }
6754 }
6755
6757 {
6758 super.EEKilled(killer);
6759
6762 {
6763 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6764 {
6765 if (IsMagazine())
6766 {
6767 if (Magazine.Cast(this).GetAmmoCount() > 0)
6768 {
6770 }
6771 }
6772 else
6773 {
6775 }
6776 }
6777 }
6778 }
6779
6781 {
6782 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6783
6784 super.OnWasAttached(parent, slot_id);
6785
6788
6790 }
6791
6793 {
6794 super.OnWasDetached(parent, slot_id);
6795
6798 }
6799
6801 {
6802 int idx;
6805
6806 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6807 if (inventory_slots.Count() < 1)
6808 {
6809 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6810 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6811 }
6812 else
6813 {
6814 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6815 }
6816
6817 idx = inventory_slots.Find(slot);
6818 if (idx < 0)
6819 return "";
6820
6821 return attach_types.Get(idx);
6822 }
6823
6825 {
6826 int idx = -1;
6827 string slot;
6828
6831
6832 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6833 if (inventory_slots.Count() < 1)
6834 {
6835 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6836 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6837 }
6838 else
6839 {
6840 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6841 if (detach_types.Count() < 1)
6842 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6843 }
6844
6845 for (int i = 0; i < inventory_slots.Count(); i++)
6846 {
6847 slot = inventory_slots.Get(i);
6848 }
6849
6850 if (slot != "")
6851 {
6852 if (detach_types.Count() == 1)
6853 idx = 0;
6854 else
6855 idx = inventory_slots.Find(slot);
6856 }
6857 if (idx < 0)
6858 return "";
6859
6860 return detach_types.Get(idx);
6861 }
6862
6864 {
6865
6867
6868
6869 float min_time = 1;
6870 float max_time = 3;
6871 float delay = Math.RandomFloat(min_time, max_time);
6872
6873 explode_timer.Run(delay, this, "DoAmmoExplosion");
6874 }
6875
6877 {
6878 Magazine magazine = Magazine.Cast(this);
6879 int pop_sounds_count = 6;
6880 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6881
6882
6883 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6884 string sound_name = pop_sounds[ sound_idx ];
6886
6887
6888 magazine.ServerAddAmmoCount(-1);
6889
6890
6891 float min_temp_to_explode = 100;
6892
6893 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
6894 {
6896 }
6897 }
6898
6899
6900 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6901 {
6902 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6903
6904 const int CHANCE_DAMAGE_CARGO = 4;
6905 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6906 const int CHANCE_DAMAGE_NOTHING = 2;
6907
6909 {
6910 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6911 int chances;
6912 int rnd;
6913
6914 if (GetInventory().GetCargo())
6915 {
6916 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6917 rnd = Math.RandomInt(0,chances);
6918
6919 if (rnd < CHANCE_DAMAGE_CARGO)
6920 {
6922 }
6923 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6924 {
6926 }
6927 }
6928 else
6929 {
6930 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6931 rnd = Math.RandomInt(0,chances);
6932
6933 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6934 {
6936 }
6937 }
6938 }
6939 }
6940
6942 {
6943 if (GetInventory().GetCargo())
6944 {
6945 int item_count = GetInventory().GetCargo().GetItemCount();
6946 if (item_count > 0)
6947 {
6948 int random_pick = Math.RandomInt(0, item_count);
6950 if (!item.IsExplosive())
6951 {
6952 item.AddHealth("","",damage);
6953 return true;
6954 }
6955 }
6956 }
6957 return false;
6958 }
6959
6961 {
6962 int attachment_count = GetInventory().AttachmentCount();
6963 if (attachment_count > 0)
6964 {
6965 int random_pick = Math.RandomInt(0, attachment_count);
6966 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6967 if (!attachment.IsExplosive())
6968 {
6969 attachment.AddHealth("","",damage);
6970 return true;
6971 }
6972 }
6973 return false;
6974 }
6975
6977 {
6979 }
6980
6982 {
6984 return GetInventory().CanRemoveEntity();
6985
6986 return false;
6987 }
6988
6990 {
6991
6993 return false;
6994
6995
6997 return false;
6998
6999
7000
7002 if (delta == 0)
7003 return false;
7004
7005
7006 return true;
7007 }
7008
7010 {
7012 {
7013 if (ScriptInputUserData.CanStoreInputUserData())
7014 {
7015 ScriptInputUserData ctx = new ScriptInputUserData;
7020 ctx.
Write(destination_entity);
7024 }
7025 }
7026 else if (!
GetGame().IsMultiplayer())
7027 {
7029 }
7030 }
7031
7033 {
7034 float split_quantity_new;
7038 InventoryLocation loc = new InventoryLocation;
7039
7040 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7041 {
7043 split_quantity_new = stack_max;
7044 else
7046
7048 {
7049 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7050 if (new_item)
7051 {
7052 new_item.SetResultOfSplit(true);
7053 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7055 new_item.
SetQuantity(split_quantity_new,
false,
true);
7056 }
7057 }
7058 }
7059 else if (destination_entity && slot_id == -1)
7060 {
7061 if (quantity > stack_max)
7062 split_quantity_new = stack_max;
7063 else
7064 split_quantity_new = quantity;
7065
7067 {
7069 {
7072 }
7073
7074 if (new_item)
7075 {
7076 new_item.SetResultOfSplit(true);
7077 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7079 new_item.
SetQuantity(split_quantity_new,
false,
true);
7080 }
7081 }
7082 }
7083 else
7084 {
7085 if (stack_max != 0)
7086 {
7088 {
7090 }
7091
7092 if (split_quantity_new == 0)
7093 {
7094 if (!
GetGame().IsMultiplayer())
7095 player.PhysicalPredictiveDropItem(this);
7096 else
7097 player.ServerDropEntity(this);
7098 return;
7099 }
7100
7102 {
7104
7105 if (new_item)
7106 {
7107 new_item.SetResultOfSplit(true);
7108 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7111 new_item.PlaceOnSurface();
7112 }
7113 }
7114 }
7115 }
7116 }
7117
7119 {
7120 float split_quantity_new;
7124 InventoryLocation loc = new InventoryLocation;
7125
7126 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7127 {
7129 split_quantity_new = stack_max;
7130 else
7132
7134 {
7135 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7136 if (new_item)
7137 {
7138 new_item.SetResultOfSplit(true);
7139 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7141 new_item.
SetQuantity(split_quantity_new,
false,
true);
7142 }
7143 }
7144 }
7145 else if (destination_entity && slot_id == -1)
7146 {
7147 if (quantity > stack_max)
7148 split_quantity_new = stack_max;
7149 else
7150 split_quantity_new = quantity;
7151
7153 {
7155 {
7158 }
7159
7160 if (new_item)
7161 {
7162 new_item.SetResultOfSplit(true);
7163 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7165 new_item.
SetQuantity(split_quantity_new,
false,
true);
7166 }
7167 }
7168 }
7169 else
7170 {
7171 if (stack_max != 0)
7172 {
7174 {
7176 }
7177
7179 {
7181
7182 if (new_item)
7183 {
7184 new_item.SetResultOfSplit(true);
7185 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7188 new_item.PlaceOnSurface();
7189 }
7190 }
7191 }
7192 }
7193 }
7194
7196 {
7198 {
7199 if (ScriptInputUserData.CanStoreInputUserData())
7200 {
7201 ScriptInputUserData ctx = new ScriptInputUserData;
7206 dst.WriteToContext(ctx);
7208 }
7209 }
7210 else if (!
GetGame().IsMultiplayer())
7211 {
7213 }
7214 }
7215
7217 {
7219 {
7220 if (ScriptInputUserData.CanStoreInputUserData())
7221 {
7222 ScriptInputUserData ctx = new ScriptInputUserData;
7227 ctx.
Write(destination_entity);
7233 }
7234 }
7235 else if (!
GetGame().IsMultiplayer())
7236 {
7238 }
7239 }
7240
7242 {
7244 }
7245
7247 {
7249 float split_quantity_new;
7251 if (dst.IsValid())
7252 {
7253 int slot_id = dst.GetSlot();
7255
7256 if (quantity > stack_max)
7257 split_quantity_new = stack_max;
7258 else
7259 split_quantity_new = quantity;
7260
7262 {
7264
7265 if (new_item)
7266 {
7267 new_item.SetResultOfSplit(true);
7268 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7270 new_item.
SetQuantity(split_quantity_new,
false,
true);
7271 }
7272
7273 return new_item;
7274 }
7275 }
7276
7277 return null;
7278 }
7279
7281 {
7283 float split_quantity_new;
7285 if (destination_entity)
7286 {
7288 if (quantity > stackable)
7289 split_quantity_new = stackable;
7290 else
7291 split_quantity_new = quantity;
7292
7294 {
7295 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7296 if (new_item)
7297 {
7298 new_item.SetResultOfSplit(true);
7299 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7301 new_item.
SetQuantity(split_quantity_new,
false,
true);
7302 }
7303 }
7304 }
7305 }
7306
7308 {
7310 {
7311 if (ScriptInputUserData.CanStoreInputUserData())
7312 {
7313 ScriptInputUserData ctx = new ScriptInputUserData;
7318 ItemBase destination_entity =
this;
7319 ctx.
Write(destination_entity);
7323 }
7324 }
7325 else if (!
GetGame().IsMultiplayer())
7326 {
7328 }
7329 }
7330
7332 {
7334 float split_quantity_new;
7336 if (player)
7337 {
7339 if (quantity > stackable)
7340 split_quantity_new = stackable;
7341 else
7342 split_quantity_new = quantity;
7343
7345 {
7346 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7347 new_item =
ItemBase.Cast(in_hands);
7348 if (new_item)
7349 {
7350 new_item.SetResultOfSplit(true);
7351 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7353 new_item.SetQuantity(split_quantity_new, false, true);
7354 }
7355 }
7356 }
7357 }
7358
7360 {
7362 float split_quantity_new = Math.Floor(quantity * 0.5);
7363
7365 return;
7366
7368
7369 if (new_item)
7370 {
7371 if (new_item.GetQuantityMax() < split_quantity_new)
7372 {
7373 split_quantity_new = new_item.GetQuantityMax();
7374 }
7375
7376 new_item.SetResultOfSplit(true);
7377 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7378
7380 {
7383 }
7384 else
7385 {
7387 new_item.
SetQuantity(split_quantity_new,
false,
true);
7388 }
7389 }
7390 }
7391
7393 {
7395 float split_quantity_new = Math.Floor(quantity / 2);
7396
7398 return;
7399
7400 InventoryLocation invloc = new InventoryLocation;
7402
7404 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7405
7406 if (new_item)
7407 {
7408 if (new_item.GetQuantityMax() < split_quantity_new)
7409 {
7410 split_quantity_new = new_item.GetQuantityMax();
7411 }
7413 {
7416 }
7417 else if (split_quantity_new > 1)
7418 {
7420 new_item.
SetQuantity(split_quantity_new,
false,
true);
7421 }
7422 }
7423 }
7424
7427 {
7428 SetWeightDirty();
7430
7431 if (parent)
7432 parent.OnAttachmentQuantityChangedEx(this, delta);
7433
7435 {
7437 {
7439 }
7441 {
7442 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7444 }
7445 }
7446
7447 }
7448
7451 {
7452
7453 }
7454
7457 {
7459 }
7460
7462 {
7463 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7464
7466 {
7467 if (newLevel == GameConstants.STATE_RUINED)
7468 {
7470 EntityAI parent = GetHierarchyParent();
7471 if (parent && parent.IsFireplace())
7472 {
7473 CargoBase cargo = GetInventory().GetCargo();
7474 if (cargo)
7475 {
7477 {
7479 }
7480 }
7481 }
7482 }
7483
7485 {
7486
7488 return;
7489 }
7490
7491 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7492 {
7494 }
7495 }
7496 }
7497
7498
7500 {
7501 super.OnRightClick();
7502
7504 {
7506 {
7507 if (ScriptInputUserData.CanStoreInputUserData())
7508 {
7509 EntityAI root = GetHierarchyRoot();
7510 Man playerOwner = GetHierarchyRootPlayer();
7511 InventoryLocation dst = new InventoryLocation;
7512
7513
7514 if (!playerOwner && root && root == this)
7515 {
7517 }
7518 else
7519 {
7520
7521 GetInventory().GetCurrentInventoryLocation(dst);
7523 {
7526 {
7528 }
7529 else
7530 {
7532
7533
7534 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7535 {
7537 }
7538 else
7539 {
7540 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7541 }
7542 }
7543 }
7544 }
7545
7546 ScriptInputUserData ctx = new ScriptInputUserData;
7554 }
7555 }
7556 else if (!
GetGame().IsMultiplayer())
7557 {
7559 }
7560 }
7561 }
7562
7564 {
7565 if (root)
7566 {
7567 vector m4[4];
7568 root.GetTransform(m4);
7569 dst.SetGround(this, m4);
7570 }
7571 else
7572 {
7573 GetInventory().GetCurrentInventoryLocation(dst);
7574 }
7575 }
7576
7577 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7578 {
7579
7580 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7581 return false;
7582
7583 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7584 return false;
7585
7586
7588 return false;
7589
7590
7591 Magazine mag = Magazine.Cast(this);
7592 if (mag)
7593 {
7594 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7595 return false;
7596
7597 if (stack_max_limit)
7598 {
7599 Magazine other_mag = Magazine.Cast(other_item);
7600 if (other_item)
7601 {
7602 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7603 return false;
7604 }
7605
7606 }
7607 }
7608 else
7609 {
7610
7612 return false;
7613
7615 return false;
7616 }
7617
7618 PlayerBase player = null;
7619 if (CastTo(player, GetHierarchyRootPlayer()))
7620 {
7621 if (player.GetInventory().HasAttachment(this))
7622 return false;
7623
7624 if (player.IsItemsToDelete())
7625 return false;
7626 }
7627
7628 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7629 return false;
7630
7631 int slotID;
7633 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7634 return false;
7635
7636 return true;
7637 }
7638
7640 {
7642 }
7643
7645 {
7646 return m_IsResultOfSplit;
7647 }
7648
7650 {
7651 m_IsResultOfSplit = value;
7652 }
7653
7655 {
7657 }
7658
7660 {
7661 float other_item_quantity = other_item.GetQuantity();
7662 float this_free_space;
7663
7665
7667
7668 if (other_item_quantity > this_free_space)
7669 {
7670 return this_free_space;
7671 }
7672 else
7673 {
7674 return other_item_quantity;
7675 }
7676 }
7677
7679 {
7681 }
7682
7684 {
7686 return;
7687
7688 if (!IsMagazine() && other_item)
7689 {
7691 if (quantity_used != 0)
7692 {
7693 float hp1 = GetHealth01("","");
7694 float hp2 = other_item.GetHealth01("","");
7695 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7696 hpResult = hpResult / (
GetQuantity() + quantity_used);
7697
7698 hpResult *= GetMaxHealth();
7699 Math.Round(hpResult);
7700 SetHealth("", "Health", hpResult);
7701
7703 other_item.AddQuantity(-quantity_used);
7704 }
7705 }
7707 }
7708
7710 {
7711 #ifdef SERVER
7712 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7713 GetHierarchyParent().IncreaseLifetimeUp();
7714 #endif
7715 };
7716
7718 {
7719 PlayerBase p = PlayerBase.Cast(player);
7720
7721 array<int> recipesIds = p.m_Recipes;
7722 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7723 if (moduleRecipesManager)
7724 {
7725 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7726 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7727 }
7728
7729 for (int i = 0;i < recipesIds.Count(); i++)
7730 {
7731 int key = recipesIds.Get(i);
7732 string recipeName = moduleRecipesManager.GetRecipeName(key);
7734 }
7735 }
7736
7737
7738 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7739 {
7740 super.GetDebugActions(outputList);
7741
7742
7748
7749
7754
7759
7760
7764
7765
7767 {
7771 }
7772
7775
7776
7780
7782
7783 InventoryLocation loc = new InventoryLocation();
7784 GetInventory().GetCurrentInventoryLocation(loc);
7786 {
7787 if (Gizmo_IsSupported())
7790 }
7791
7793 }
7794
7795
7796
7797
7799 {
7800 super.OnAction(action_id, player, ctx);
7801
7803 {
7804 switch (action_id)
7805 {
7808 return true;
7811 return true;
7812 }
7813 }
7814
7816 {
7817 switch (action_id)
7818 {
7820 Delete();
7821 return true;
7822 }
7823 }
7824
7825 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7826 {
7827 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7828 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7829 PlayerBase p = PlayerBase.Cast(player);
7830 if (
EActions.RECIPES_RANGE_START < 1000)
7831 {
7832 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7833 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7834 }
7835 }
7836 #ifndef SERVER
7837 else if (action_id ==
EActions.WATCH_PLAYER)
7838 {
7839 PluginDeveloper.SetDeveloperItemClientEx(player);
7840 }
7841 #endif
7843 {
7844 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7845 {
7846 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7847 OnDebugButtonPressServer(id + 1);
7848 }
7849
7850 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7851 {
7852 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7854 }
7855
7856 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7857 {
7858 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7860 }
7861
7862 else if (action_id ==
EActions.ADD_QUANTITY)
7863 {
7864 if (IsMagazine())
7865 {
7866 Magazine mag = Magazine.Cast(this);
7867 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7868 }
7869 else
7870 {
7872 }
7873
7874 if (m_EM)
7875 {
7876 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7877 }
7878
7879 }
7880
7881 else if (action_id ==
EActions.REMOVE_QUANTITY)
7882 {
7883 if (IsMagazine())
7884 {
7885 Magazine mag2 = Magazine.Cast(this);
7886 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7887 }
7888 else
7889 {
7891 }
7892 if (m_EM)
7893 {
7894 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7895 }
7896
7897 }
7898
7899 else if (action_id ==
EActions.SET_QUANTITY_0)
7900 {
7902
7903 if (m_EM)
7904 {
7905 m_EM.SetEnergy(0);
7906 }
7907 }
7908
7909 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7910 {
7912
7913 if (m_EM)
7914 {
7915 m_EM.SetEnergy(m_EM.GetEnergyMax());
7916 }
7917 }
7918
7919 else if (action_id ==
EActions.ADD_HEALTH)
7920 {
7921 AddHealth("","",GetMaxHealth("","Health")/5);
7922 }
7923 else if (action_id ==
EActions.REMOVE_HEALTH)
7924 {
7925 AddHealth("","",-GetMaxHealth("","Health")/5);
7926 }
7927 else if (action_id ==
EActions.DESTROY_HEALTH)
7928 {
7929 SetHealth01("","",0);
7930 }
7931 else if (action_id ==
EActions.WATCH_ITEM)
7932 {
7934 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7935 #ifdef DEVELOPER
7936 SetDebugDeveloper_item(this);
7937 #endif
7938 }
7939
7940 else if (action_id ==
EActions.ADD_TEMPERATURE)
7941 {
7942 AddTemperature(20);
7943
7944 }
7945
7946 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7947 {
7948 AddTemperature(-20);
7949
7950 }
7951
7952 else if (action_id ==
EActions.FLIP_FROZEN)
7953 {
7954 SetFrozen(!GetIsFrozen());
7955
7956 }
7957
7958 else if (action_id ==
EActions.ADD_WETNESS)
7959 {
7961
7962 }
7963
7964 else if (action_id ==
EActions.REMOVE_WETNESS)
7965 {
7967
7968 }
7969
7970 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7971 {
7974
7975
7976 }
7977
7978 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7979 {
7982 }
7983
7984 else if (action_id ==
EActions.MAKE_SPECIAL)
7985 {
7986 auto debugParams = DebugSpawnParams.WithPlayer(player);
7987 OnDebugSpawnEx(debugParams);
7988 }
7989
7990 }
7991
7992
7993 return false;
7994 }
7995
7996
7997
7998
8002
8005
8006
8007
8009 {
8010 return false;
8011 }
8012
8013
8015 {
8016 return true;
8017 }
8018
8019
8021 {
8022 return true;
8023 }
8024
8025
8026
8028 {
8029 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8031 }
8032
8035 {
8036 return null;
8037 }
8038
8040 {
8041 return false;
8042 }
8043
8045 {
8046 return false;
8047 }
8048
8052
8053
8055 {
8056 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8057 return module_repairing.CanRepair(this, item_repair_kit);
8058 }
8059
8060
8061 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8062 {
8063 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8064 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8065 }
8066
8067
8069 {
8070
8071
8072
8073
8074
8075
8076
8077
8078 return 1;
8079 }
8080
8081
8082
8084 {
8086 }
8087
8088
8089
8091 {
8093 }
8094
8095
8104 {
8105 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8106
8107 if (player)
8108 {
8109 player.MessageStatus(text);
8110 }
8111 }
8112
8113
8122 {
8123 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8124
8125 if (player)
8126 {
8127 player.MessageAction(text);
8128 }
8129 }
8130
8131
8140 {
8141 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8142
8143 if (player)
8144 {
8145 player.MessageFriendly(text);
8146 }
8147 }
8148
8149
8158 {
8159 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8160
8161 if (player)
8162 {
8163 player.MessageImportant(text);
8164 }
8165 }
8166
8168 {
8169 return true;
8170 }
8171
8172
8173 override bool KindOf(
string tag)
8174 {
8175 bool found = false;
8176 string item_name = this.
GetType();
8179
8180 int array_size = item_tag_array.Count();
8181 for (int i = 0; i < array_size; i++)
8182 {
8183 if (item_tag_array.Get(i) == tag)
8184 {
8185 found = true;
8186 break;
8187 }
8188 }
8189 return found;
8190 }
8191
8192
8194 {
8195
8196 super.OnRPC(sender, rpc_type,ctx);
8197
8198
8199 switch (rpc_type)
8200 {
8201 #ifndef SERVER
8202 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8203 Param2<bool, string> p = new Param2<bool, string>(false, "");
8204
8206 return;
8207
8208 bool play = p.param1;
8209 string soundSet = p.param2;
8210
8211 if (play)
8212 {
8214 {
8216 {
8218 }
8219 }
8220 else
8221 {
8223 }
8224 }
8225 else
8226 {
8228 }
8229
8230 break;
8231 #endif
8232
8233 }
8234
8236 {
8238 }
8239 }
8240
8241
8242
8243
8245 {
8246 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8247 return plugin.GetID(
name);
8248 }
8249
8251 {
8252 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8253 return plugin.GetName(id);
8254 }
8255
8258 {
8259
8260
8261 int varFlags;
8262 if (!ctx.
Read(varFlags))
8263 return;
8264
8265 if (varFlags & ItemVariableFlags.FLOAT)
8266 {
8268 }
8269 }
8270
8272 {
8273
8274 super.SerializeNumericalVars(floats_out);
8275
8276
8277
8279 {
8281 }
8282
8284 {
8286 }
8287
8289 {
8291 }
8292
8294 {
8299 }
8300
8302 {
8304 }
8305 }
8306
8308 {
8309
8310 super.DeSerializeNumericalVars(floats);
8311
8312
8313 int index = 0;
8314 int mask = Math.Round(floats.Get(index));
8315
8316 index++;
8317
8319 {
8321 {
8323 }
8324 else
8325 {
8326 float quantity = floats.Get(index);
8328 }
8329 index++;
8330 }
8331
8333 {
8334 float wet = floats.Get(index);
8336 index++;
8337 }
8338
8340 {
8341 int liquidtype = Math.Round(floats.Get(index));
8343 index++;
8344 }
8345
8347 {
8349 index++;
8351 index++;
8353 index++;
8355 index++;
8356 }
8357
8359 {
8360 int cleanness = Math.Round(floats.Get(index));
8362 index++;
8363 }
8364 }
8365
8367 {
8368 super.WriteVarsToCTX(ctx);
8369
8370
8372 {
8374 }
8375
8377 {
8379 }
8380
8382 {
8384 }
8385
8387 {
8388 int r,g,b,a;
8394 }
8395
8397 {
8399 }
8400 }
8401
8403 {
8404 if (!super.ReadVarsFromCTX(ctx,version))
8405 return false;
8406
8407 int intValue;
8408 float value;
8409
8410 if (version < 140)
8411 {
8412 if (!ctx.
Read(intValue))
8413 return false;
8414
8415 m_VariablesMask = intValue;
8416 }
8417
8419 {
8420 if (!ctx.
Read(value))
8421 return false;
8422
8424 {
8426 }
8427 else
8428 {
8430 }
8431 }
8432
8433 if (version < 140)
8434 {
8436 {
8437 if (!ctx.
Read(value))
8438 return false;
8439 SetTemperatureDirect(value);
8440 }
8441 }
8442
8444 {
8445 if (!ctx.
Read(value))
8446 return false;
8448 }
8449
8451 {
8452 if (!ctx.
Read(intValue))
8453 return false;
8455 }
8456
8458 {
8459 int r,g,b,a;
8461 return false;
8463 return false;
8465 return false;
8467 return false;
8468
8470 }
8471
8473 {
8474 if (!ctx.
Read(intValue))
8475 return false;
8477 }
8478
8479 if (version >= 138 && version < 140)
8480 {
8482 {
8483 if (!ctx.
Read(intValue))
8484 return false;
8485 SetFrozen(intValue);
8486 }
8487 }
8488
8489 return true;
8490 }
8491
8492
8494 {
8497 {
8499 }
8500
8501 if (!super.OnStoreLoad(ctx, version))
8502 {
8504 return false;
8505 }
8506
8507 if (version >= 114)
8508 {
8509 bool hasQuickBarIndexSaved;
8510
8511 if (!ctx.
Read(hasQuickBarIndexSaved))
8512 {
8514 return false;
8515 }
8516
8517 if (hasQuickBarIndexSaved)
8518 {
8519 int itmQBIndex;
8520
8521
8522 if (!ctx.
Read(itmQBIndex))
8523 {
8525 return false;
8526 }
8527
8528 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8529 if (itmQBIndex != -1 && parentPlayer)
8530 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8531 }
8532 }
8533 else
8534 {
8535
8536 PlayerBase player;
8537 int itemQBIndex;
8538 if (version ==
int.
MAX)
8539 {
8540 if (!ctx.
Read(itemQBIndex))
8541 {
8543 return false;
8544 }
8545 }
8546 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8547 {
8548
8549 if (!ctx.
Read(itemQBIndex))
8550 {
8552 return false;
8553 }
8554 if (itemQBIndex != -1 && player)
8555 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8556 }
8557 }
8558
8559 if (version < 140)
8560 {
8561
8562 if (!LoadVariables(ctx, version))
8563 {
8565 return false;
8566 }
8567 }
8568
8569
8571 {
8573 return false;
8574 }
8575 if (version >= 132)
8576 {
8578 if (raib)
8579 {
8581 {
8583 return false;
8584 }
8585 }
8586 }
8587
8589 return true;
8590 }
8591
8592
8593
8595 {
8596 super.OnStoreSave(ctx);
8597
8598 PlayerBase player;
8599 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8600 {
8602
8603 int itemQBIndex = -1;
8604 itemQBIndex = player.FindQuickBarEntityIndex(this);
8605 ctx.
Write(itemQBIndex);
8606 }
8607 else
8608 {
8610 }
8611
8613
8615 if (raib)
8616 {
8618 }
8619 }
8620
8621
8623 {
8624 super.AfterStoreLoad();
8625
8627 {
8629 }
8630
8632 {
8635 }
8636 }
8637
8639 {
8640 super.EEOnAfterLoad();
8641
8643 {
8645 }
8646
8649 }
8650
8652 {
8653 return false;
8654 }
8655
8656
8657
8659 {
8661 {
8662 #ifdef PLATFORM_CONSOLE
8663
8665 {
8667 if (menu)
8668 {
8670 }
8671 }
8672 #endif
8673 }
8674
8676 {
8679 }
8680
8682 {
8683 SetWeightDirty();
8685 }
8687 {
8690 }
8691
8693 {
8696 }
8698 {
8701 }
8702
8703 super.OnVariablesSynchronized();
8704 }
8705
8706
8707
8709 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8710 {
8711 if (!IsServerCheck(allow_client))
8712 return false;
8713
8715 return false;
8716
8719
8720 if (value <= (min + 0.001))
8721 value = min;
8722
8723 if (value == min)
8724 {
8725 if (destroy_config)
8726 {
8727 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8728 if (dstr)
8729 {
8731 this.Delete();
8732 return true;
8733 }
8734 }
8735 else if (destroy_forced)
8736 {
8738 this.Delete();
8739 return true;
8740 }
8741
8743 }
8744
8747
8749 {
8751
8752 if (delta)
8754 }
8755
8757
8758 return false;
8759 }
8760
8761
8763 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8764 {
8766 }
8767
8769 {
8772 }
8773
8775 {
8778 }
8779
8781 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8782 {
8783 float value_clamped = Math.Clamp(value, 0, 1);
8785 SetQuantity(result, destroy_config, destroy_forced);
8786 }
8787
8788
8791 {
8793 }
8794
8796 {
8798 }
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8810 {
8811 int slot = -1;
8812 if (GetInventory())
8813 {
8814 InventoryLocation il = new InventoryLocation;
8815 GetInventory().GetCurrentInventoryLocation(il);
8817 }
8818
8820 }
8821
8823 {
8824 float quantity_max = 0;
8825
8827 {
8828 if (attSlotID != -1)
8829 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8830
8831 if (quantity_max <= 0)
8833 }
8834
8835 if (quantity_max <= 0)
8837
8838 return quantity_max;
8839 }
8840
8842 {
8844 }
8845
8847 {
8849 }
8850
8851
8853 {
8855 }
8856
8858 {
8860 }
8861
8863 {
8865 }
8866
8867
8869 {
8870
8871 float weightEx = GetWeightEx();
8872 float special = GetInventoryAndCargoWeight();
8873 return weightEx - special;
8874 }
8875
8876
8878 {
8880 }
8881
8883 {
8885 {
8886 #ifdef DEVELOPER
8887 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8888 {
8889 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8891 }
8892 #endif
8893
8895 }
8896 else if (HasEnergyManager())
8897 {
8898 #ifdef DEVELOPER
8899 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8900 {
8901 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8902 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8903 }
8904 #endif
8905 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
8906 }
8907 else
8908 {
8909 #ifdef DEVELOPER
8910 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8911 {
8912 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8913 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8914 }
8915 #endif
8916 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
8917 }
8918 }
8919
8922 {
8923 int item_count = 0;
8925
8926 if (GetInventory().GetCargo() != NULL)
8927 {
8928 item_count = GetInventory().GetCargo().GetItemCount();
8929 }
8930
8931 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8932 {
8933 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8934 if (item)
8935 item_count += item.GetNumberOfItems();
8936 }
8937 return item_count;
8938 }
8939
8942 {
8943 float weight = 0;
8944 float wetness = 1;
8945 if (include_wetness)
8948 {
8949 weight = wetness * m_ConfigWeight;
8950 }
8952 {
8953 weight = 1;
8954 }
8955 return weight;
8956 }
8957
8958
8959
8961 {
8962 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8963 {
8964 GameInventory inv = GetInventory();
8965 array<EntityAI> items = new array<EntityAI>;
8967 for (int i = 0; i < items.Count(); i++)
8968 {
8970 if (item)
8971 {
8973 }
8974 }
8975 }
8976 }
8977
8978
8979
8980
8982 {
8983 float energy = 0;
8984 if (HasEnergyManager())
8985 {
8986 energy = GetCompEM().GetEnergy();
8987 }
8988 return energy;
8989 }
8990
8991
8993 {
8994 super.OnEnergyConsumed();
8995
8997 }
8998
9000 {
9001 super.OnEnergyAdded();
9002
9004 }
9005
9006
9008 {
9009 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9010 {
9012 {
9013 float energy_0to1 = GetCompEM().GetEnergy0To1();
9015 }
9016 }
9017 }
9018
9019
9021 {
9022 return ConfigGetFloat("heatIsolation");
9023 }
9024
9026 {
9028 }
9029
9031 {
9032 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9033 if (
GetGame().ConfigIsExisting(paramPath))
9035
9036 return 0.0;
9037 }
9038
9040 {
9041 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9042 if (
GetGame().ConfigIsExisting(paramPath))
9044
9045 return 0.0;
9046 }
9047
9048 override void SetWet(
float value,
bool allow_client =
false)
9049 {
9050 if (!IsServerCheck(allow_client))
9051 return;
9052
9055
9057
9058 m_VarWet = Math.Clamp(value, min, max);
9059
9061 {
9064 }
9065 }
9066
9067 override void AddWet(
float value)
9068 {
9070 }
9071
9073 {
9075 }
9076
9078 {
9080 }
9081
9083 {
9085 }
9086
9088 {
9090 }
9091
9093 {
9095 }
9096
9098 {
9101 if (newLevel != oldLevel)
9102 {
9104 }
9105 }
9106
9108 {
9109 SetWeightDirty();
9110 }
9111
9113 {
9114 return GetWetLevelInternal(
m_VarWet);
9115 }
9116
9117
9118
9120 {
9122 }
9123
9125 {
9127 }
9128
9130 {
9132 }
9133
9135 {
9137 }
9138
9139
9140
9142 {
9143 if (ConfigIsExisting("itemModelLength"))
9144 {
9145 return ConfigGetFloat("itemModelLength");
9146 }
9147 return 0;
9148 }
9149
9151 {
9152 if (ConfigIsExisting("itemAttachOffset"))
9153 {
9154 return ConfigGetFloat("itemAttachOffset");
9155 }
9156 return 0;
9157 }
9158
9159 override void SetCleanness(
int value,
bool allow_client =
false)
9160 {
9161 if (!IsServerCheck(allow_client))
9162 return;
9163
9165
9167
9170 }
9171
9173 {
9175 }
9176
9178 {
9179 return true;
9180 }
9181
9182
9183
9184
9186 {
9188 }
9189
9191 {
9193 }
9194
9195
9196
9197
9198 override void SetColor(
int r,
int g,
int b,
int a)
9199 {
9205 }
9207 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9208 {
9213 }
9214
9216 {
9218 }
9219
9222 {
9223 int r,g,b,a;
9225 r = r/255;
9226 g = g/255;
9227 b = b/255;
9228 a = a/255;
9229 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9230 }
9231
9232
9233
9234 override void SetLiquidType(
int value,
bool allow_client =
false)
9235 {
9236 if (!IsServerCheck(allow_client))
9237 return;
9238
9243 }
9244
9246 {
9247 return ConfigGetInt("varLiquidTypeInit");
9248 }
9249
9251 {
9253 }
9254
9256 {
9258 SetFrozen(false);
9259 }
9260
9263 {
9264 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9265 }
9266
9267
9270 {
9271 PlayerBase nplayer;
9272 if (PlayerBase.CastTo(nplayer, player))
9273 {
9275
9276 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9277 }
9278 }
9279
9280
9283 {
9284 PlayerBase nplayer;
9285 if (PlayerBase.CastTo(nplayer,player))
9286 {
9287
9288 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9289
9290 }
9291
9292
9293 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9294
9295
9296 if (HasEnergyManager())
9297 {
9298 GetCompEM().UpdatePlugState();
9299 }
9300 }
9301
9302
9304 {
9305 super.OnPlacementStarted(player);
9306
9308 }
9309
9310 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9311 {
9313 {
9314 m_AdminLog.OnPlacementComplete(player,
this);
9315 }
9316
9317 super.OnPlacementComplete(player, position, orientation);
9318 }
9319
9320
9321
9322
9323
9325 {
9327 {
9328 return true;
9329 }
9330 else
9331 {
9332 return false;
9333 }
9334 }
9335
9336
9338 {
9340 {
9342 }
9343 }
9344
9345
9347 {
9349 }
9350
9352 {
9354 }
9355
9356 override void InsertAgent(
int agent,
float count = 1)
9357 {
9358 if (count < 1)
9359 return;
9360
9362 }
9363
9366 {
9368 }
9369
9370
9372 {
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
9413
9414
9415
9416
9418 {
9420 return false;
9421 return true;
9422 }
9423
9425 {
9426
9428 }
9429
9430
9433 {
9434 super.CheckForRoofLimited(timeTresholdMS);
9435
9437 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9438 {
9439 m_PreviousRoofTestTime = time;
9440 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9441 }
9442 }
9443
9444
9446 {
9448 {
9449 return 0;
9450 }
9451
9452 if (GetInventory().GetAttachmentSlotsCount() != 0)
9453 {
9454 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9455 if (filter)
9456 return filter.GetProtectionLevel(type, false, system);
9457 else
9458 return 0;
9459 }
9460
9461 string subclassPath, entryName;
9462
9463 switch (type)
9464 {
9466 entryName = "biological";
9467 break;
9469 entryName = "chemical";
9470 break;
9471 default:
9472 entryName = "biological";
9473 break;
9474 }
9475
9476 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9477
9479 }
9480
9481
9482
9485 {
9486 if (!IsMagazine())
9488
9490 }
9491
9492
9493
9494
9495
9500 {
9501 return true;
9502 }
9503
9505 {
9507 }
9508
9509
9510
9511
9512
9514 {
9515 if (parent)
9516 {
9517 if (parent.IsInherited(DayZInfected))
9518 return true;
9519
9520 if (!parent.IsRuined())
9521 return true;
9522 }
9523
9524 return true;
9525 }
9526
9528 {
9529 if (!super.CanPutAsAttachment(parent))
9530 {
9531 return false;
9532 }
9533
9534 if (!IsRuined() && !parent.IsRuined())
9535 {
9536 return true;
9537 }
9538
9539 return false;
9540 }
9541
9543 {
9544
9545
9546
9547
9548 return super.CanReceiveItemIntoCargo(item);
9549 }
9550
9552 {
9553
9554
9555
9556
9557 GameInventory attachmentInv = attachment.GetInventory();
9559 {
9560 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9561 return false;
9562 }
9563
9564 InventoryLocation loc = new InventoryLocation();
9565 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9566 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9567 return false;
9568
9569 return super.CanReceiveAttachment(attachment, slotId);
9570 }
9571
9573 {
9574 if (!super.CanReleaseAttachment(attachment))
9575 return false;
9576
9577 return GetInventory().AreChildrenAccessible();
9578 }
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9601 {
9602 int id = muzzle_owner.GetMuzzleID();
9603 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9604
9605 if (WPOF_array)
9606 {
9607 for (int i = 0; i < WPOF_array.Count(); i++)
9608 {
9609 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9610
9611 if (WPOF)
9612 {
9613 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9614 }
9615 }
9616 }
9617 }
9618
9619
9621 {
9622 int id = muzzle_owner.GetMuzzleID();
9624
9625 if (WPOBE_array)
9626 {
9627 for (int i = 0; i < WPOBE_array.Count(); i++)
9628 {
9629 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9630
9631 if (WPOBE)
9632 {
9633 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9634 }
9635 }
9636 }
9637 }
9638
9639
9641 {
9642 int id = muzzle_owner.GetMuzzleID();
9643 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9644
9645 if (WPOOH_array)
9646 {
9647 for (int i = 0; i < WPOOH_array.Count(); i++)
9648 {
9649 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9650
9651 if (WPOOH)
9652 {
9653 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9654 }
9655 }
9656 }
9657 }
9658
9659
9661 {
9662 int id = muzzle_owner.GetMuzzleID();
9663 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9664
9665 if (WPOOH_array)
9666 {
9667 for (int i = 0; i < WPOOH_array.Count(); i++)
9668 {
9669 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9670
9671 if (WPOOH)
9672 {
9673 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9674 }
9675 }
9676 }
9677 }
9678
9679
9681 {
9682 int id = muzzle_owner.GetMuzzleID();
9683 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9684
9685 if (WPOOH_array)
9686 {
9687 for (int i = 0; i < WPOOH_array.Count(); i++)
9688 {
9689 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9690
9691 if (WPOOH)
9692 {
9693 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9694 }
9695 }
9696 }
9697 }
9698
9699
9700
9702 {
9704 {
9705 return true;
9706 }
9707
9708 return false;
9709 }
9710
9712 {
9714 {
9715 return true;
9716 }
9717
9718 return false;
9719 }
9720
9722 {
9724 {
9725 return true;
9726 }
9727
9728 return false;
9729 }
9730
9732 {
9733 return false;
9734 }
9735
9738 {
9739 return UATimeSpent.DEFAULT_DEPLOY;
9740 }
9741
9742
9743
9744
9746 {
9748 SetSynchDirty();
9749 }
9750
9752 {
9754 }
9755
9756
9758 {
9759 return false;
9760 }
9761
9764 {
9765 string att_type = "None";
9766
9767 if (ConfigIsExisting("soundAttType"))
9768 {
9769 att_type = ConfigGetString("soundAttType");
9770 }
9771
9773 }
9774
9776 {
9778 }
9779
9780
9781
9782
9783
9789
9791 {
9794
9796 }
9797
9798
9800 {
9802 return;
9803
9805
9808
9811
9812 SoundParameters params = new SoundParameters();
9816 }
9817
9818
9820 {
9822 return;
9823
9825 SetSynchDirty();
9826
9829 }
9830
9831
9833 {
9835 return;
9836
9838 SetSynchDirty();
9839
9842 }
9843
9845 {
9847 }
9848
9850 {
9852 }
9853
9856 {
9857 if (!
GetGame().IsDedicatedServer())
9858 {
9859 if (ConfigIsExisting("attachSoundSet"))
9860 {
9861 string cfg_path = "";
9862 string soundset = "";
9864
9867 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9868 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9869
9870 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9871 {
9872 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9873 {
9874 if (cfg_slot_array[i] == slot_type)
9875 {
9876 soundset = cfg_soundset_array[i];
9877 break;
9878 }
9879 }
9880 }
9881
9882 if (soundset != "")
9883 {
9884 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9886 }
9887 }
9888 }
9889 }
9890
9892 {
9893
9894 }
9895
9896 void OnApply(PlayerBase player);
9897
9899 {
9900 return 1.0;
9901 };
9902
9904 {
9906 }
9907
9909 {
9911 }
9912
9914
9916 {
9917 SetDynamicPhysicsLifeTime(0.01);
9919 }
9920
9922 {
9923 array<string> zone_names = new array<string>;
9924 GetDamageZones(zone_names);
9925 for (int i = 0; i < zone_names.Count(); i++)
9926 {
9927 SetHealthMax(zone_names.Get(i),"Health");
9928 }
9929 SetHealthMax("","Health");
9930 }
9931
9934 {
9935 float global_health = GetHealth01("","Health");
9936 array<string> zones = new array<string>;
9937 GetDamageZones(zones);
9938
9939 for (int i = 0; i < zones.Count(); i++)
9940 {
9941 SetHealth01(zones.Get(i),"Health",global_health);
9942 }
9943 }
9944
9947 {
9948 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9949 }
9950
9952 {
9953 if (!hasRootAsPlayer)
9954 {
9955 if (refParentIB)
9956 {
9957
9958 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9959 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9960
9961 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9962 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9963
9966 }
9967 else
9968 {
9969
9972 }
9973 }
9974 }
9975
9977 {
9979 {
9980 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9981 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
9982 {
9983 float heatPermCoef = 1.0;
9985 while (ent)
9986 {
9987 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9988 ent = ent.GetHierarchyParent();
9989 }
9990
9991 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9992 }
9993 }
9994 }
9995
9997 {
9998
9999 EntityAI parent = GetHierarchyParent();
10000 if (!parent)
10001 {
10002 hasParent = false;
10003 hasRootAsPlayer = false;
10004 }
10005 else
10006 {
10007 hasParent = true;
10008 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10009 refParentIB =
ItemBase.Cast(parent);
10010 }
10011 }
10012
10013 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10014 {
10015
10016 }
10017
10019 {
10020
10021 return false;
10022 }
10023
10025 {
10026
10027
10028 return false;
10029 }
10030
10032 {
10033
10034 return false;
10035 }
10036
10039 {
10040 return !GetIsFrozen() &&
IsOpen();
10041 }
10042
10044 {
10045 bool hasParent = false, hasRootAsPlayer = false;
10047
10048 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10049 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10050
10051 if (wwtu || foodDecay)
10052 {
10056
10057 if (processWetness || processTemperature || processDecay)
10058 {
10060
10061 if (processWetness)
10062 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10063
10064 if (processTemperature)
10066
10067 if (processDecay)
10068 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10069 }
10070 }
10071 }
10072
10075 {
10077 }
10078
10080 {
10083
10084 return super.GetTemperatureFreezeThreshold();
10085 }
10086
10088 {
10091
10092 return super.GetTemperatureThawThreshold();
10093 }
10094
10096 {
10099
10100 return super.GetItemOverheatThreshold();
10101 }
10102
10104 {
10106 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10107
10108 return super.GetTemperatureFreezeTime();
10109 }
10110
10112 {
10114 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10115
10116 return super.GetTemperatureThawTime();
10117 }
10118
10123
10125 {
10126 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10127 }
10128
10130 {
10131 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10132 }
10133
10136 {
10138 }
10139
10141 {
10143 }
10144
10146 {
10148 }
10149
10152 {
10153 return null;
10154 }
10155
10158 {
10159 return false;
10160 }
10161
10163 {
10165 {
10168 if (!trg)
10169 {
10171 explosive = this;
10172 }
10173
10174 explosive.PairRemote(trg);
10176
10177 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10178 trg.SetPersistentPairID(persistentID);
10179 explosive.SetPersistentPairID(persistentID);
10180
10181 return true;
10182 }
10183 return false;
10184 }
10185
10188 {
10189 float ret = 1.0;
10192 ret *= GetHealth01();
10193
10194 return ret;
10195 }
10196
10197 #ifdef DEVELOPER
10198 override void SetDebugItem()
10199 {
10200 super.SetDebugItem();
10201 _itemBase = this;
10202 }
10203
10205 {
10206 string text = super.GetDebugText();
10207
10209 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10210
10211 return text;
10212 }
10213 #endif
10214
10216 {
10217 return true;
10218 }
10219
10221
10223
10225 {
10228 }
10229
10230
10238
10254}
10255
10257{
10259 if (entity)
10260 {
10261 bool is_item = entity.IsInherited(
ItemBase);
10262 if (is_item && full_quantity)
10263 {
10266 }
10267 }
10268 else
10269 {
10271 return NULL;
10272 }
10273 return entity;
10274}
10275
10277{
10278 if (item)
10279 {
10280 if (health > 0)
10281 item.SetHealth("", "", health);
10282
10283 if (item.CanHaveTemperature())
10284 {
10286 if (item.CanFreeze())
10287 item.SetFrozen(false);
10288 }
10289
10290 if (item.HasEnergyManager())
10291 {
10292 if (quantity >= 0)
10293 {
10294 item.GetCompEM().SetEnergy0To1(quantity);
10295 }
10296 else
10297 {
10299 }
10300 }
10301 else if (item.IsMagazine())
10302 {
10303 Magazine mag = Magazine.Cast(item);
10304 if (quantity >= 0)
10305 {
10306 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10307 }
10308 else
10309 {
10311 }
10312
10313 }
10314 else
10315 {
10316 if (quantity >= 0)
10317 {
10318 item.SetQuantityNormalized(quantity, false);
10319 }
10320 else
10321 {
10323 }
10324
10325 }
10326 }
10327}
10328
10329#ifdef DEVELOPER
10331#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.