5363{
5365 {
5366 return true;
5367 }
5368};
5369
5370
5371
5373{
5377
5379
5382
5383
5384
5385
5386
5395
5401
5406
5411
5432 protected bool m_IsResultOfSplit
5433
5435
5440
5441
5442
5444
5448
5449
5450
5452
5455
5456
5457
5463
5464
5472
5475
5476
5478
5479
5481
5482
5487
5488
5493
5494
5496
5497
5499 {
5504
5505 if (!
GetGame().IsDedicatedServer())
5506 {
5508 {
5510
5512 {
5514 }
5515 }
5516
5519 }
5520
5521 m_OldLocation = null;
5522
5524 {
5526 }
5527
5528 if (ConfigIsExisting("headSelectionsToHide"))
5529 {
5532 }
5533
5535 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5536 {
5538 }
5539
5541
5542 m_IsResultOfSplit = false;
5543
5545 }
5546
5548 {
5549 super.InitItemVariables();
5550
5556 m_Count = ConfigGetInt(
"count");
5557
5560
5565
5568
5573
5585
5589
5590
5593 if (ConfigIsExisting("canBeSplit"))
5594 {
5597 }
5598
5600 if (ConfigIsExisting("itemBehaviour"))
5602
5603
5606 RegisterNetSyncVariableInt("m_VarLiquidType");
5607 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5608
5609 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5610 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5611 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5612
5613 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5614 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5615 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5616 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5617
5618 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5619 RegisterNetSyncVariableBool("m_IsTakeable");
5620 RegisterNetSyncVariableBool("m_IsHologram");
5621
5624 {
5627 }
5628
5630
5632 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5634
5635 }
5636
5638 {
5640 }
5641
5643 {
5646 {
5651 }
5652 }
5653
5654 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5655 {
5657 {
5660 }
5661
5663 }
5664
5666 {
5672 }
5673
5675
5677 {
5679
5680 if (!action)
5681 {
5682 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5683 return;
5684 }
5685
5687 if (!ai)
5688 {
5690 return;
5691 }
5692
5694 if (!action_array)
5695 {
5696 action_array = new array<ActionBase_Basic>;
5698 }
5699 if (LogManager.IsActionLogEnable())
5700 {
5701 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5702 }
5703
5704 if (action_array.Find(action) != -1)
5705 {
5706 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5707 }
5708 else
5709 {
5710 action_array.Insert(action);
5711 }
5712 }
5713
5715 {
5717 ActionBase action = player.GetActionManager().GetAction(actionName);
5720
5721 if (action_array)
5722 {
5723 action_array.RemoveItem(action);
5724 }
5725 }
5726
5727
5728
5730 {
5731 ActionOverrideData overrideData = new ActionOverrideData();
5735
5737 if (!actionMap)
5738 {
5741 }
5742
5743 actionMap.Insert(this.
Type(), overrideData);
5744
5745 }
5746
5748
5750
5751
5753 {
5756
5759
5760 string config_to_search = "CfgVehicles";
5761 string muzzle_owner_config;
5762
5764 {
5765 if (IsInherited(Weapon))
5766 config_to_search = "CfgWeapons";
5767
5768 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5769
5770 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5771
5773
5774 if (config_OnFire_subclass_count > 0)
5775 {
5776 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5777
5778 for (int i = 0; i < config_OnFire_subclass_count; i++)
5779 {
5780 string particle_class = "";
5782 string config_OnFire_entry = config_OnFire_class + particle_class;
5783 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5784 WPOF_array.Insert(WPOF);
5785 }
5786
5787
5789 }
5790 }
5791
5793 {
5794 config_to_search = "CfgWeapons";
5795 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5796
5797 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5798
5800
5801 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5802 {
5803 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5804
5805 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5806 {
5807 string particle_class2 = "";
5809 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5810 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5811 WPOBE_array.Insert(WPOBE);
5812 }
5813
5814
5816 }
5817 }
5818 }
5819
5820
5822 {
5825
5827 {
5828 string config_to_search = "CfgVehicles";
5829
5830 if (IsInherited(Weapon))
5831 config_to_search = "CfgWeapons";
5832
5833 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5834 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5835
5836 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5837 {
5838
5840
5842 {
5844 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5846 return;
5847 }
5848
5851
5852
5853
5855 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5856
5857 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5858 {
5859 string particle_class = "";
5861 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5863
5864 if (entry_type == CT_CLASS)
5865 {
5866 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5867 WPOOH_array.Insert(WPOF);
5868 }
5869 }
5870
5871
5873 }
5874 }
5875 }
5876
5878 {
5880 }
5881
5883 {
5885 {
5887
5890
5893
5894 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5895 }
5896 }
5897
5899 {
5901 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5902
5904 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5905
5907 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5908
5910 {
5912 }
5913 }
5914
5916 {
5918 }
5919
5921 {
5924 else
5926
5928 {
5931 }
5932 else
5933 {
5936
5939 }
5940
5942 }
5943
5945 {
5947 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5948 }
5949
5951 {
5953 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5955 }
5956
5958 {
5960 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5961 }
5962
5964 {
5967
5968 OverheatingParticle OP = new OverheatingParticle();
5973
5975 }
5976
5978 {
5981
5982 return -1;
5983 }
5984
5986 {
5988 {
5991
5992 for (int i = count; i > 0; --i)
5993 {
5994 int id = i - 1;
5997
6000
6001 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6002 {
6003 if (p)
6004 {
6007 }
6008 }
6009 }
6010 }
6011 }
6012
6014 {
6016 {
6018 {
6019 int id = i - 1;
6021
6022 if (OP)
6023 {
6025
6026 if (p)
6027 {
6029 }
6030
6031 delete OP;
6032 }
6033 }
6034
6037 }
6038 }
6039
6042 {
6043 return 0.0;
6044 }
6045
6046
6048 {
6049 return 250;
6050 }
6051
6053 {
6054 return 0;
6055 }
6056
6059 {
6061 return true;
6062
6063 return false;
6064 }
6065
6068 {
6071
6073 {
6075 }
6076 else
6077 {
6078
6080 }
6081
6083 }
6084
6091 {
6092 return -1;
6093 }
6094
6095
6096
6097
6099 {
6101 {
6103 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6104
6105 if (r_index >= 0)
6106 {
6107 InventoryLocation r_il = new InventoryLocation;
6108 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6109
6110 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6113 {
6114 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6115 }
6117 {
6118 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6119 }
6120
6121 }
6122
6123 player.GetHumanInventory().ClearUserReservedLocation(this);
6124 }
6125
6128 }
6129
6130
6131
6132
6134 {
6135 return ItemBase.m_DebugActionsMask;
6136 }
6137
6139 {
6140 return ItemBase.m_DebugActionsMask & mask;
6141 }
6142
6144 {
6145 ItemBase.m_DebugActionsMask = mask;
6146 }
6147
6149 {
6150 ItemBase.m_DebugActionsMask |= mask;
6151 }
6152
6154 {
6155 ItemBase.m_DebugActionsMask &= ~mask;
6156 }
6157
6159 {
6161 {
6163 }
6164 else
6165 {
6167 }
6168 }
6169
6170
6172 {
6173 if (GetEconomyProfile())
6174 {
6175 float q_max = GetEconomyProfile().GetQuantityMax();
6176 if (q_max > 0)
6177 {
6178 float q_min = GetEconomyProfile().GetQuantityMin();
6179 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6180
6182 {
6183 ComponentEnergyManager comp = GetCompEM();
6185 {
6187 }
6188 }
6190 {
6192
6193 }
6194
6195 }
6196 }
6197 }
6198
6201 {
6202 EntityAI parent = GetHierarchyParent();
6203
6204 if (parent)
6205 {
6206 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6207 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6208 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6209 }
6210 }
6211
6214 {
6215 EntityAI parent = GetHierarchyParent();
6216
6217 if (parent)
6218 {
6219 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6220 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6221 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6222 }
6223 }
6224
6226 {
6227
6228
6229
6230
6232
6234 {
6235 if (ScriptInputUserData.CanStoreInputUserData())
6236 {
6237 ScriptInputUserData ctx = new ScriptInputUserData;
6243 ctx.
Write(use_stack_max);
6246
6248 {
6249 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6250 }
6251 }
6252 }
6253 else if (!
GetGame().IsMultiplayer())
6254 {
6256 }
6257 }
6258
6260 {
6262 }
6263
6265 {
6267 }
6268
6270 {
6272 }
6273
6275 {
6276
6277 return false;
6278 }
6279
6281 {
6282 return false;
6283 }
6284
6288 {
6289 return false;
6290 }
6291
6293 {
6294 return "";
6295 }
6296
6298
6300 {
6301 return false;
6302 }
6303
6305 {
6306 return true;
6307 }
6308
6309
6310
6312 {
6313 return true;
6314 }
6315
6317 {
6318 return true;
6319 }
6320
6322 {
6323 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6325 }
6326
6328 {
6330 }
6331
6333 {
6335 if (!is_being_placed)
6337 SetSynchDirty();
6338 }
6339
6340
6342
6344 {
6346 }
6347
6349 {
6351 }
6352
6354 {
6355 return 1;
6356 }
6357
6359 {
6360 return false;
6361 }
6362
6364 {
6366 SetSynchDirty();
6367 }
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6404 {
6405 super.OnMovedInsideCargo(container);
6406
6407 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6408 }
6409
6410 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6411 {
6412 super.EEItemLocationChanged(oldLoc,newLoc);
6413
6414 PlayerBase new_player = null;
6415 PlayerBase old_player = null;
6416
6417 if (newLoc.GetParent())
6418 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6419
6420 if (oldLoc.GetParent())
6421 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6422
6424 {
6425 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6426
6427 if (r_index >= 0)
6428 {
6429 InventoryLocation r_il = new InventoryLocation;
6430 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6431
6432 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6435 {
6436 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6437 }
6439 {
6440 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6441 }
6442
6443 }
6444 }
6445
6447 {
6448 if (new_player)
6449 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6450
6451 if (new_player == old_player)
6452 {
6453
6454 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6455 {
6457 {
6458 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6459 {
6460 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6461 }
6462 }
6463 else
6464 {
6465 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6466 }
6467 }
6468
6469 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6470 {
6471 int type = oldLoc.GetType();
6473 {
6474 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6475 }
6477 {
6478 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6479 }
6480 }
6481 if (!m_OldLocation)
6482 {
6483 m_OldLocation = new InventoryLocation;
6484 }
6485 m_OldLocation.Copy(oldLoc);
6486 }
6487 else
6488 {
6489 if (m_OldLocation)
6490 {
6491 m_OldLocation.Reset();
6492 }
6493 }
6494
6496 }
6497 else
6498 {
6499 if (new_player)
6500 {
6501 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6502 if (res_index >= 0)
6503 {
6504 InventoryLocation il = new InventoryLocation;
6505 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6507 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6510 {
6511 il.
GetParent().GetOnReleaseLock().Invoke(it);
6512 }
6514 {
6516 }
6517
6518 }
6519 }
6521 {
6522
6524 }
6525
6526 if (m_OldLocation)
6527 {
6528 m_OldLocation.Reset();
6529 }
6530 }
6531 }
6532
6533 override void EOnContact(IEntity other, Contact extra)
6534 {
6536 {
6537 int liquidType = -1;
6539 if (impactSpeed > 0.0)
6540 {
6542 #ifndef SERVER
6544 #else
6546 SetSynchDirty();
6547 #endif
6549 }
6550 }
6551
6552 #ifdef SERVER
6553 if (GetCompEM() && GetCompEM().IsPlugged())
6554 {
6555 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6556 GetCompEM().UnplugThis();
6557 }
6558 #endif
6559 }
6560
6562
6564 {
6566 }
6567
6569 {
6570
6571 }
6572
6574 {
6575 super.OnItemLocationChanged(old_owner, new_owner);
6576
6577 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6578 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6579
6580 if (!relatedPlayer && playerNew)
6581 relatedPlayer = playerNew;
6582
6583 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6584 {
6586 if (actionMgr)
6587 {
6588 ActionBase currentAction = actionMgr.GetRunningAction();
6589 if (currentAction)
6591 }
6592 }
6593
6594 Man ownerPlayerOld = null;
6595 Man ownerPlayerNew = null;
6596
6597 if (old_owner)
6598 {
6599 if (old_owner.
IsMan())
6600 {
6601 ownerPlayerOld = Man.Cast(old_owner);
6602 }
6603 else
6604 {
6605 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6606 }
6607 }
6608 else
6609 {
6611 {
6613
6614 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6615 {
6616 GetCompEM().UnplugThis();
6617 }
6618 }
6619 }
6620
6621 if (new_owner)
6622 {
6623 if (new_owner.
IsMan())
6624 {
6625 ownerPlayerNew = Man.Cast(new_owner);
6626 }
6627 else
6628 {
6629 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6630 }
6631 }
6632
6633 if (ownerPlayerOld != ownerPlayerNew)
6634 {
6635 if (ownerPlayerOld)
6636 {
6637 array<EntityAI> subItemsExit = new array<EntityAI>;
6639 for (int i = 0; i < subItemsExit.Count(); i++)
6640 {
6643 }
6644 }
6645
6646 if (ownerPlayerNew)
6647 {
6648 array<EntityAI> subItemsEnter = new array<EntityAI>;
6650 for (int j = 0; j < subItemsEnter.Count(); j++)
6651 {
6654 }
6655 }
6656 }
6657 else if (ownerPlayerNew != null)
6658 {
6659 PlayerBase nplayer;
6660 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6661 {
6662 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6664 for (int k = 0; k < subItemsUpdate.Count(); k++)
6665 {
6667 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6668 }
6669 }
6670 }
6671
6672 if (old_owner)
6673 old_owner.OnChildItemRemoved(this);
6674 if (new_owner)
6675 new_owner.OnChildItemReceived(this);
6676 }
6677
6678
6680 {
6681 super.EEDelete(parent);
6682 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6683 if (player)
6684 {
6686
6687 if (player.IsAlive())
6688 {
6689 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6690 if (r_index >= 0)
6691 {
6692 InventoryLocation r_il = new InventoryLocation;
6693 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6694
6695 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6698 {
6699 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6700 }
6702 {
6703 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6704 }
6705
6706 }
6707
6708 player.RemoveQuickBarEntityShortcut(this);
6709 }
6710 }
6711 }
6712
6714 {
6715 super.EEKilled(killer);
6716
6719 {
6720 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6721 {
6722 if (IsMagazine())
6723 {
6724 if (Magazine.Cast(this).GetAmmoCount() > 0)
6725 {
6727 }
6728 }
6729 else
6730 {
6732 }
6733 }
6734 }
6735 }
6736
6738 {
6739 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6740
6741 super.OnWasAttached(parent, slot_id);
6742
6745
6747 }
6748
6750 {
6751 super.OnWasDetached(parent, slot_id);
6752
6755 }
6756
6758 {
6759 int idx;
6762
6763 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6764 if (inventory_slots.Count() < 1)
6765 {
6766 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6767 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6768 }
6769 else
6770 {
6771 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6772 }
6773
6774 idx = inventory_slots.Find(slot);
6775 if (idx < 0)
6776 return "";
6777
6778 return attach_types.Get(idx);
6779 }
6780
6782 {
6783 int idx = -1;
6784 string slot;
6785
6788
6789 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6790 if (inventory_slots.Count() < 1)
6791 {
6792 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6793 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6794 }
6795 else
6796 {
6797 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6798 if (detach_types.Count() < 1)
6799 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6800 }
6801
6802 for (int i = 0; i < inventory_slots.Count(); i++)
6803 {
6804 slot = inventory_slots.Get(i);
6805 }
6806
6807 if (slot != "")
6808 {
6809 if (detach_types.Count() == 1)
6810 idx = 0;
6811 else
6812 idx = inventory_slots.Find(slot);
6813 }
6814 if (idx < 0)
6815 return "";
6816
6817 return detach_types.Get(idx);
6818 }
6819
6821 {
6822
6824
6825
6826 float min_time = 1;
6827 float max_time = 3;
6828 float delay = Math.RandomFloat(min_time, max_time);
6829
6830 explode_timer.Run(delay, this, "DoAmmoExplosion");
6831 }
6832
6834 {
6835 Magazine magazine = Magazine.Cast(this);
6836 int pop_sounds_count = 6;
6837 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6838
6839
6840 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6841 string sound_name = pop_sounds[ sound_idx ];
6843
6844
6845 magazine.ServerAddAmmoCount(-1);
6846
6847
6848 float min_temp_to_explode = 100;
6849
6850 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
6851 {
6853 }
6854 }
6855
6856
6857 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6858 {
6859 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6860
6861 const int CHANCE_DAMAGE_CARGO = 4;
6862 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6863 const int CHANCE_DAMAGE_NOTHING = 2;
6864
6866 {
6867 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6868 int chances;
6869 int rnd;
6870
6871 if (GetInventory().GetCargo())
6872 {
6873 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6874 rnd = Math.RandomInt(0,chances);
6875
6876 if (rnd < CHANCE_DAMAGE_CARGO)
6877 {
6879 }
6880 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6881 {
6883 }
6884 }
6885 else
6886 {
6887 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6888 rnd = Math.RandomInt(0,chances);
6889
6890 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6891 {
6893 }
6894 }
6895 }
6896 }
6897
6899 {
6900 if (GetInventory().GetCargo())
6901 {
6902 int item_count = GetInventory().GetCargo().GetItemCount();
6903 if (item_count > 0)
6904 {
6905 int random_pick = Math.RandomInt(0, item_count);
6907 if (!item.IsExplosive())
6908 {
6909 item.AddHealth("","",damage);
6910 return true;
6911 }
6912 }
6913 }
6914 return false;
6915 }
6916
6918 {
6919 int attachment_count = GetInventory().AttachmentCount();
6920 if (attachment_count > 0)
6921 {
6922 int random_pick = Math.RandomInt(0, attachment_count);
6923 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6924 if (!attachment.IsExplosive())
6925 {
6926 attachment.AddHealth("","",damage);
6927 return true;
6928 }
6929 }
6930 return false;
6931 }
6932
6934 {
6936 }
6937
6939 {
6941 return GetInventory().CanRemoveEntity();
6942
6943 return false;
6944 }
6945
6947 {
6948
6950 return false;
6951
6952
6954 return false;
6955
6956
6957
6959 if (delta == 0)
6960 return false;
6961
6962
6963 return true;
6964 }
6965
6967 {
6969 {
6970 if (ScriptInputUserData.CanStoreInputUserData())
6971 {
6972 ScriptInputUserData ctx = new ScriptInputUserData;
6977 ctx.
Write(destination_entity);
6981 }
6982 }
6983 else if (!
GetGame().IsMultiplayer())
6984 {
6986 }
6987 }
6988
6990 {
6991 float split_quantity_new;
6995 InventoryLocation loc = new InventoryLocation;
6996
6997 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6998 {
7000 split_quantity_new = stack_max;
7001 else
7003
7005 {
7006 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7007 if (new_item)
7008 {
7009 new_item.SetResultOfSplit(true);
7010 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7012 new_item.
SetQuantity(split_quantity_new,
false,
true);
7013 }
7014 }
7015 }
7016 else if (destination_entity && slot_id == -1)
7017 {
7018 if (quantity > stack_max)
7019 split_quantity_new = stack_max;
7020 else
7021 split_quantity_new = quantity;
7022
7024 {
7026 {
7029 }
7030
7031 if (new_item)
7032 {
7033 new_item.SetResultOfSplit(true);
7034 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7036 new_item.
SetQuantity(split_quantity_new,
false,
true);
7037 }
7038 }
7039 }
7040 else
7041 {
7042 if (stack_max != 0)
7043 {
7045 {
7047 }
7048
7049 if (split_quantity_new == 0)
7050 {
7051 if (!
GetGame().IsMultiplayer())
7052 player.PhysicalPredictiveDropItem(this);
7053 else
7054 player.ServerDropEntity(this);
7055 return;
7056 }
7057
7059 {
7061
7062 if (new_item)
7063 {
7064 new_item.SetResultOfSplit(true);
7065 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7068 new_item.PlaceOnSurface();
7069 }
7070 }
7071 }
7072 }
7073 }
7074
7076 {
7077 float split_quantity_new;
7081 InventoryLocation loc = new InventoryLocation;
7082
7083 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7084 {
7086 split_quantity_new = stack_max;
7087 else
7089
7091 {
7092 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7093 if (new_item)
7094 {
7095 new_item.SetResultOfSplit(true);
7096 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7098 new_item.
SetQuantity(split_quantity_new,
false,
true);
7099 }
7100 }
7101 }
7102 else if (destination_entity && slot_id == -1)
7103 {
7104 if (quantity > stack_max)
7105 split_quantity_new = stack_max;
7106 else
7107 split_quantity_new = quantity;
7108
7110 {
7112 {
7115 }
7116
7117 if (new_item)
7118 {
7119 new_item.SetResultOfSplit(true);
7120 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7122 new_item.
SetQuantity(split_quantity_new,
false,
true);
7123 }
7124 }
7125 }
7126 else
7127 {
7128 if (stack_max != 0)
7129 {
7131 {
7133 }
7134
7136 {
7138
7139 if (new_item)
7140 {
7141 new_item.SetResultOfSplit(true);
7142 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7145 new_item.PlaceOnSurface();
7146 }
7147 }
7148 }
7149 }
7150 }
7151
7153 {
7155 {
7156 if (ScriptInputUserData.CanStoreInputUserData())
7157 {
7158 ScriptInputUserData ctx = new ScriptInputUserData;
7163 dst.WriteToContext(ctx);
7165 }
7166 }
7167 else if (!
GetGame().IsMultiplayer())
7168 {
7170 }
7171 }
7172
7174 {
7176 {
7177 if (ScriptInputUserData.CanStoreInputUserData())
7178 {
7179 ScriptInputUserData ctx = new ScriptInputUserData;
7184 ctx.
Write(destination_entity);
7190 }
7191 }
7192 else if (!
GetGame().IsMultiplayer())
7193 {
7195 }
7196 }
7197
7199 {
7201 }
7202
7204 {
7206 float split_quantity_new;
7208 if (dst.IsValid())
7209 {
7210 int slot_id = dst.GetSlot();
7212
7213 if (quantity > stack_max)
7214 split_quantity_new = stack_max;
7215 else
7216 split_quantity_new = quantity;
7217
7219 {
7221
7222 if (new_item)
7223 {
7224 new_item.SetResultOfSplit(true);
7225 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7227 new_item.
SetQuantity(split_quantity_new,
false,
true);
7228 }
7229
7230 return new_item;
7231 }
7232 }
7233
7234 return null;
7235 }
7236
7238 {
7240 float split_quantity_new;
7242 if (destination_entity)
7243 {
7245 if (quantity > stackable)
7246 split_quantity_new = stackable;
7247 else
7248 split_quantity_new = quantity;
7249
7251 {
7252 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7253 if (new_item)
7254 {
7255 new_item.SetResultOfSplit(true);
7256 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7258 new_item.
SetQuantity(split_quantity_new,
false,
true);
7259 }
7260 }
7261 }
7262 }
7263
7265 {
7267 {
7268 if (ScriptInputUserData.CanStoreInputUserData())
7269 {
7270 ScriptInputUserData ctx = new ScriptInputUserData;
7275 ItemBase destination_entity =
this;
7276 ctx.
Write(destination_entity);
7280 }
7281 }
7282 else if (!
GetGame().IsMultiplayer())
7283 {
7285 }
7286 }
7287
7289 {
7291 float split_quantity_new;
7293 if (player)
7294 {
7296 if (quantity > stackable)
7297 split_quantity_new = stackable;
7298 else
7299 split_quantity_new = quantity;
7300
7302 {
7303 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7304 new_item =
ItemBase.Cast(in_hands);
7305 if (new_item)
7306 {
7307 new_item.SetResultOfSplit(true);
7308 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7310 new_item.SetQuantity(split_quantity_new, false, true);
7311 }
7312 }
7313 }
7314 }
7315
7317 {
7319 float split_quantity_new = Math.Floor(quantity * 0.5);
7320
7322 return;
7323
7325
7326 if (new_item)
7327 {
7328 if (new_item.GetQuantityMax() < split_quantity_new)
7329 {
7330 split_quantity_new = new_item.GetQuantityMax();
7331 }
7332
7333 new_item.SetResultOfSplit(true);
7334 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7335
7337 {
7340 }
7341 else
7342 {
7344 new_item.
SetQuantity(split_quantity_new,
false,
true);
7345 }
7346 }
7347 }
7348
7350 {
7352 float split_quantity_new = Math.Floor(quantity / 2);
7353
7355 return;
7356
7357 InventoryLocation invloc = new InventoryLocation;
7359
7361 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7362
7363 if (new_item)
7364 {
7365 if (new_item.GetQuantityMax() < split_quantity_new)
7366 {
7367 split_quantity_new = new_item.GetQuantityMax();
7368 }
7370 {
7373 }
7374 else if (split_quantity_new > 1)
7375 {
7377 new_item.
SetQuantity(split_quantity_new,
false,
true);
7378 }
7379 }
7380 }
7381
7384 {
7385 SetWeightDirty();
7387
7388 if (parent)
7389 parent.OnAttachmentQuantityChangedEx(this, delta);
7390
7392 {
7394 {
7396 }
7398 {
7399 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7401 }
7402 }
7403
7404 }
7405
7408 {
7409
7410 }
7411
7414 {
7416 }
7417
7419 {
7420 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7421
7423 {
7424 if (newLevel == GameConstants.STATE_RUINED)
7425 {
7427 EntityAI parent = GetHierarchyParent();
7428 if (parent && parent.IsFireplace())
7429 {
7430 CargoBase cargo = GetInventory().GetCargo();
7431 if (cargo)
7432 {
7434 {
7436 }
7437 }
7438 }
7439 }
7440
7442 {
7443
7445 return;
7446 }
7447
7448 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7449 {
7451 }
7452 }
7453 }
7454
7455
7457 {
7458 super.OnRightClick();
7459
7461 {
7463 {
7464 if (ScriptInputUserData.CanStoreInputUserData())
7465 {
7466 EntityAI root = GetHierarchyRoot();
7467 Man playerOwner = GetHierarchyRootPlayer();
7468 InventoryLocation dst = new InventoryLocation;
7469
7470
7471 if (!playerOwner && root && root == this)
7472 {
7474 }
7475 else
7476 {
7477
7478 GetInventory().GetCurrentInventoryLocation(dst);
7480 {
7483 {
7485 }
7486 else
7487 {
7489
7490
7491 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7492 {
7494 }
7495 else
7496 {
7497 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7498 }
7499 }
7500 }
7501 }
7502
7503 ScriptInputUserData ctx = new ScriptInputUserData;
7511 }
7512 }
7513 else if (!
GetGame().IsMultiplayer())
7514 {
7516 }
7517 }
7518 }
7519
7521 {
7522 if (root)
7523 {
7524 vector m4[4];
7525 root.GetTransform(m4);
7526 dst.SetGround(this, m4);
7527 }
7528 else
7529 {
7530 GetInventory().GetCurrentInventoryLocation(dst);
7531 }
7532 }
7533
7534 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7535 {
7536
7537 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7538 return false;
7539
7540 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7541 return false;
7542
7543
7545 return false;
7546
7547
7548 Magazine mag = Magazine.Cast(this);
7549 if (mag)
7550 {
7551 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7552 return false;
7553
7554 if (stack_max_limit)
7555 {
7556 Magazine other_mag = Magazine.Cast(other_item);
7557 if (other_item)
7558 {
7559 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7560 return false;
7561 }
7562
7563 }
7564 }
7565 else
7566 {
7567
7569 return false;
7570
7572 return false;
7573 }
7574
7575 PlayerBase player = null;
7576 if (CastTo(player, GetHierarchyRootPlayer()))
7577 {
7578 if (player.GetInventory().HasAttachment(this))
7579 return false;
7580
7581 if (player.IsItemsToDelete())
7582 return false;
7583 }
7584
7585 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7586 return false;
7587
7588 int slotID;
7590 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7591 return false;
7592
7593 return true;
7594 }
7595
7597 {
7599 }
7600
7602 {
7603 return m_IsResultOfSplit;
7604 }
7605
7607 {
7608 m_IsResultOfSplit = value;
7609 }
7610
7612 {
7614 }
7615
7617 {
7618 float other_item_quantity = other_item.GetQuantity();
7619 float this_free_space;
7620
7622
7624
7625 if (other_item_quantity > this_free_space)
7626 {
7627 return this_free_space;
7628 }
7629 else
7630 {
7631 return other_item_quantity;
7632 }
7633 }
7634
7636 {
7638 }
7639
7641 {
7643 return;
7644
7645 if (!IsMagazine() && other_item)
7646 {
7648 if (quantity_used != 0)
7649 {
7650 float hp1 = GetHealth01("","");
7651 float hp2 = other_item.GetHealth01("","");
7652 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7653 hpResult = hpResult / (
GetQuantity() + quantity_used);
7654
7655 hpResult *= GetMaxHealth();
7656 Math.Round(hpResult);
7657 SetHealth("", "Health", hpResult);
7658
7660 other_item.AddQuantity(-quantity_used);
7661 }
7662 }
7664 }
7665
7667 {
7668 #ifdef SERVER
7669 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7670 GetHierarchyParent().IncreaseLifetimeUp();
7671 #endif
7672 };
7673
7675 {
7676 PlayerBase p = PlayerBase.Cast(player);
7677
7678 array<int> recipesIds = p.m_Recipes;
7679 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7680 if (moduleRecipesManager)
7681 {
7682 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7683 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7684 }
7685
7686 for (int i = 0;i < recipesIds.Count(); i++)
7687 {
7688 int key = recipesIds.Get(i);
7689 string recipeName = moduleRecipesManager.GetRecipeName(key);
7691 }
7692 }
7693
7694
7695 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7696 {
7697 super.GetDebugActions(outputList);
7698
7699
7705
7706
7711
7716
7717
7721
7722
7724 {
7728 }
7729
7732
7733
7737
7739
7740 InventoryLocation loc = new InventoryLocation();
7741 GetInventory().GetCurrentInventoryLocation(loc);
7743 {
7744 if (Gizmo_IsSupported())
7747 }
7748
7750 }
7751
7752
7753
7754
7756 {
7757 super.OnAction(action_id, player, ctx);
7758
7760 {
7761 switch (action_id)
7762 {
7765 return true;
7768 return true;
7769 }
7770 }
7771
7773 {
7774 switch (action_id)
7775 {
7777 Delete();
7778 return true;
7779 }
7780 }
7781
7782 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7783 {
7784 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7785 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7786 PlayerBase p = PlayerBase.Cast(player);
7787 if (
EActions.RECIPES_RANGE_START < 1000)
7788 {
7789 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7790 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7791 }
7792 }
7793 #ifndef SERVER
7794 else if (action_id ==
EActions.WATCH_PLAYER)
7795 {
7796 PluginDeveloper.SetDeveloperItemClientEx(player);
7797 }
7798 #endif
7800 {
7801 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7802 {
7803 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7804 OnDebugButtonPressServer(id + 1);
7805 }
7806
7807 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7808 {
7809 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7811 }
7812
7813 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7814 {
7815 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7817 }
7818
7819 else if (action_id ==
EActions.ADD_QUANTITY)
7820 {
7821 if (IsMagazine())
7822 {
7823 Magazine mag = Magazine.Cast(this);
7824 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7825 }
7826 else
7827 {
7829 }
7830
7831 if (m_EM)
7832 {
7833 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7834 }
7835
7836 }
7837
7838 else if (action_id ==
EActions.REMOVE_QUANTITY)
7839 {
7840 if (IsMagazine())
7841 {
7842 Magazine mag2 = Magazine.Cast(this);
7843 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7844 }
7845 else
7846 {
7848 }
7849 if (m_EM)
7850 {
7851 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7852 }
7853
7854 }
7855
7856 else if (action_id ==
EActions.SET_QUANTITY_0)
7857 {
7859
7860 if (m_EM)
7861 {
7862 m_EM.SetEnergy(0);
7863 }
7864 }
7865
7866 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7867 {
7869
7870 if (m_EM)
7871 {
7872 m_EM.SetEnergy(m_EM.GetEnergyMax());
7873 }
7874 }
7875
7876 else if (action_id ==
EActions.ADD_HEALTH)
7877 {
7878 AddHealth("","",GetMaxHealth("","Health")/5);
7879 }
7880 else if (action_id ==
EActions.REMOVE_HEALTH)
7881 {
7882 AddHealth("","",-GetMaxHealth("","Health")/5);
7883 }
7884 else if (action_id ==
EActions.DESTROY_HEALTH)
7885 {
7886 SetHealth01("","",0);
7887 }
7888 else if (action_id ==
EActions.WATCH_ITEM)
7889 {
7891 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7892 #ifdef DEVELOPER
7893 SetDebugDeveloper_item(this);
7894 #endif
7895 }
7896
7897 else if (action_id ==
EActions.ADD_TEMPERATURE)
7898 {
7899 AddTemperature(20);
7900
7901 }
7902
7903 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7904 {
7905 AddTemperature(-20);
7906
7907 }
7908
7909 else if (action_id ==
EActions.FLIP_FROZEN)
7910 {
7911 SetFrozen(!GetIsFrozen());
7912
7913 }
7914
7915 else if (action_id ==
EActions.ADD_WETNESS)
7916 {
7918
7919 }
7920
7921 else if (action_id ==
EActions.REMOVE_WETNESS)
7922 {
7924
7925 }
7926
7927 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7928 {
7931
7932
7933 }
7934
7935 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7936 {
7939 }
7940
7941 else if (action_id ==
EActions.MAKE_SPECIAL)
7942 {
7943 auto debugParams = DebugSpawnParams.WithPlayer(player);
7944 OnDebugSpawnEx(debugParams);
7945 }
7946
7947 }
7948
7949
7950 return false;
7951 }
7952
7953
7954
7955
7959
7962
7963
7964
7966 {
7967 return false;
7968 }
7969
7970
7972 {
7973 return true;
7974 }
7975
7976
7978 {
7979 return true;
7980 }
7981
7982
7983
7985 {
7986 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7988 }
7989
7992 {
7993 return null;
7994 }
7995
7997 {
7998 return false;
7999 }
8000
8002 {
8003 return false;
8004 }
8005
8009
8010
8012 {
8013 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8014 return module_repairing.CanRepair(this, item_repair_kit);
8015 }
8016
8017
8018 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8019 {
8020 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8021 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8022 }
8023
8024
8026 {
8027
8028
8029
8030
8031
8032
8033
8034
8035 return 1;
8036 }
8037
8038
8039
8041 {
8043 }
8044
8045
8046
8048 {
8050 }
8051
8052
8061 {
8062 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8063
8064 if (player)
8065 {
8066 player.MessageStatus(text);
8067 }
8068 }
8069
8070
8079 {
8080 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8081
8082 if (player)
8083 {
8084 player.MessageAction(text);
8085 }
8086 }
8087
8088
8097 {
8098 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8099
8100 if (player)
8101 {
8102 player.MessageFriendly(text);
8103 }
8104 }
8105
8106
8115 {
8116 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8117
8118 if (player)
8119 {
8120 player.MessageImportant(text);
8121 }
8122 }
8123
8125 {
8126 return true;
8127 }
8128
8129
8130 override bool KindOf(
string tag)
8131 {
8132 bool found = false;
8133 string item_name = this.
GetType();
8136
8137 int array_size = item_tag_array.Count();
8138 for (int i = 0; i < array_size; i++)
8139 {
8140 if (item_tag_array.Get(i) == tag)
8141 {
8142 found = true;
8143 break;
8144 }
8145 }
8146 return found;
8147 }
8148
8149
8151 {
8152
8153 super.OnRPC(sender, rpc_type,ctx);
8154
8155
8156 switch (rpc_type)
8157 {
8158 #ifndef SERVER
8159 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8160 Param2<bool, string> p = new Param2<bool, string>(false, "");
8161
8163 return;
8164
8165 bool play = p.param1;
8166 string soundSet = p.param2;
8167
8168 if (play)
8169 {
8171 {
8173 {
8175 }
8176 }
8177 else
8178 {
8180 }
8181 }
8182 else
8183 {
8185 }
8186
8187 break;
8188 #endif
8189
8190 }
8191
8193 {
8195 }
8196 }
8197
8198
8199
8200
8202 {
8203 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8204 return plugin.GetID(
name);
8205 }
8206
8208 {
8209 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8210 return plugin.GetName(id);
8211 }
8212
8215 {
8216
8217
8218 int varFlags;
8219 if (!ctx.
Read(varFlags))
8220 return;
8221
8222 if (varFlags & ItemVariableFlags.FLOAT)
8223 {
8225 }
8226 }
8227
8229 {
8230
8231 super.SerializeNumericalVars(floats_out);
8232
8233
8234
8236 {
8238 }
8239
8241 {
8243 }
8244
8246 {
8248 }
8249
8251 {
8256 }
8257
8259 {
8261 }
8262 }
8263
8265 {
8266
8267 super.DeSerializeNumericalVars(floats);
8268
8269
8270 int index = 0;
8271 int mask = Math.Round(floats.Get(index));
8272
8273 index++;
8274
8276 {
8278 {
8280 }
8281 else
8282 {
8283 float quantity = floats.Get(index);
8285 }
8286 index++;
8287 }
8288
8290 {
8291 float wet = floats.Get(index);
8293 index++;
8294 }
8295
8297 {
8298 int liquidtype = Math.Round(floats.Get(index));
8300 index++;
8301 }
8302
8304 {
8306 index++;
8308 index++;
8310 index++;
8312 index++;
8313 }
8314
8316 {
8317 int cleanness = Math.Round(floats.Get(index));
8319 index++;
8320 }
8321 }
8322
8324 {
8325 super.WriteVarsToCTX(ctx);
8326
8327
8329 {
8331 }
8332
8334 {
8336 }
8337
8339 {
8341 }
8342
8344 {
8345 int r,g,b,a;
8351 }
8352
8354 {
8356 }
8357 }
8358
8360 {
8361 if (!super.ReadVarsFromCTX(ctx,version))
8362 return false;
8363
8364 int intValue;
8365 float value;
8366
8367 if (version < 140)
8368 {
8369 if (!ctx.
Read(intValue))
8370 return false;
8371
8372 m_VariablesMask = intValue;
8373 }
8374
8376 {
8377 if (!ctx.
Read(value))
8378 return false;
8379
8381 {
8383 }
8384 else
8385 {
8387 }
8388 }
8389
8390 if (version < 140)
8391 {
8393 {
8394 if (!ctx.
Read(value))
8395 return false;
8396 SetTemperatureDirect(value);
8397 }
8398 }
8399
8401 {
8402 if (!ctx.
Read(value))
8403 return false;
8405 }
8406
8408 {
8409 if (!ctx.
Read(intValue))
8410 return false;
8412 }
8413
8415 {
8416 int r,g,b,a;
8418 return false;
8420 return false;
8422 return false;
8424 return false;
8425
8427 }
8428
8430 {
8431 if (!ctx.
Read(intValue))
8432 return false;
8434 }
8435
8436 if (version >= 138 && version < 140)
8437 {
8439 {
8440 if (!ctx.
Read(intValue))
8441 return false;
8442 SetFrozen(intValue);
8443 }
8444 }
8445
8446 return true;
8447 }
8448
8449
8451 {
8454 {
8456 }
8457
8458 if (!super.OnStoreLoad(ctx, version))
8459 {
8461 return false;
8462 }
8463
8464 if (version >= 114)
8465 {
8466 bool hasQuickBarIndexSaved;
8467
8468 if (!ctx.
Read(hasQuickBarIndexSaved))
8469 {
8471 return false;
8472 }
8473
8474 if (hasQuickBarIndexSaved)
8475 {
8476 int itmQBIndex;
8477
8478
8479 if (!ctx.
Read(itmQBIndex))
8480 {
8482 return false;
8483 }
8484
8485 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8486 if (itmQBIndex != -1 && parentPlayer)
8487 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8488 }
8489 }
8490 else
8491 {
8492
8493 PlayerBase player;
8494 int itemQBIndex;
8495 if (version ==
int.
MAX)
8496 {
8497 if (!ctx.
Read(itemQBIndex))
8498 {
8500 return false;
8501 }
8502 }
8503 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8504 {
8505
8506 if (!ctx.
Read(itemQBIndex))
8507 {
8509 return false;
8510 }
8511 if (itemQBIndex != -1 && player)
8512 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8513 }
8514 }
8515
8516 if (version < 140)
8517 {
8518
8519 if (!LoadVariables(ctx, version))
8520 {
8522 return false;
8523 }
8524 }
8525
8526
8528 {
8530 return false;
8531 }
8532 if (version >= 132)
8533 {
8535 if (raib)
8536 {
8538 {
8540 return false;
8541 }
8542 }
8543 }
8544
8546 return true;
8547 }
8548
8549
8550
8552 {
8553 super.OnStoreSave(ctx);
8554
8555 PlayerBase player;
8556 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8557 {
8559
8560 int itemQBIndex = -1;
8561 itemQBIndex = player.FindQuickBarEntityIndex(this);
8562 ctx.
Write(itemQBIndex);
8563 }
8564 else
8565 {
8567 }
8568
8570
8572 if (raib)
8573 {
8575 }
8576 }
8577
8578
8580 {
8581 super.AfterStoreLoad();
8582
8584 {
8586 }
8587
8589 {
8592 }
8593 }
8594
8596 {
8597 super.EEOnAfterLoad();
8598
8600 {
8602 }
8603
8606 }
8607
8609 {
8610 return false;
8611 }
8612
8613
8614
8616 {
8618 {
8619 #ifdef PLATFORM_CONSOLE
8620
8622 {
8624 if (menu)
8625 {
8627 }
8628 }
8629 #endif
8630 }
8631
8633 {
8636 }
8637
8639 {
8640 SetWeightDirty();
8642 }
8644 {
8647 }
8648
8650 {
8653 }
8655 {
8658 }
8659
8660 super.OnVariablesSynchronized();
8661 }
8662
8663
8664
8666 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8667 {
8668 if (!IsServerCheck(allow_client))
8669 return false;
8670
8672 return false;
8673
8676
8677 if (value <= (min + 0.001))
8678 value = min;
8679
8680 if (value == min)
8681 {
8682 if (destroy_config)
8683 {
8684 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8685 if (dstr)
8686 {
8688 this.Delete();
8689 return true;
8690 }
8691 }
8692 else if (destroy_forced)
8693 {
8695 this.Delete();
8696 return true;
8697 }
8698
8700 }
8701
8704
8706 {
8708
8709 if (delta)
8711 }
8712
8714
8715 return false;
8716 }
8717
8718
8720 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8721 {
8723 }
8724
8726 {
8729 }
8730
8732 {
8735 }
8736
8738 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8739 {
8740 float value_clamped = Math.Clamp(value, 0, 1);
8742 SetQuantity(result, destroy_config, destroy_forced);
8743 }
8744
8745
8748 {
8750 }
8751
8753 {
8755 }
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8767 {
8768 int slot = -1;
8769 if (GetInventory())
8770 {
8771 InventoryLocation il = new InventoryLocation;
8772 GetInventory().GetCurrentInventoryLocation(il);
8774 }
8775
8777 }
8778
8780 {
8781 float quantity_max = 0;
8782
8784 {
8785 if (attSlotID != -1)
8786 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8787
8788 if (quantity_max <= 0)
8790 }
8791
8792 if (quantity_max <= 0)
8794
8795 return quantity_max;
8796 }
8797
8799 {
8801 }
8802
8804 {
8806 }
8807
8808
8810 {
8812 }
8813
8815 {
8817 }
8818
8820 {
8822 }
8823
8824
8826 {
8827
8828 float weightEx = GetWeightEx();
8829 float special = GetInventoryAndCargoWeight();
8830 return weightEx - special;
8831 }
8832
8833
8835 {
8837 }
8838
8840 {
8842 {
8843 #ifdef DEVELOPER
8844 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8845 {
8846 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8848 }
8849 #endif
8850
8852 }
8853 else if (HasEnergyManager())
8854 {
8855 #ifdef DEVELOPER
8856 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8857 {
8858 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8859 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8860 }
8861 #endif
8862 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
8863 }
8864 else
8865 {
8866 #ifdef DEVELOPER
8867 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8868 {
8869 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8870 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8871 }
8872 #endif
8873 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
8874 }
8875 }
8876
8879 {
8880 int item_count = 0;
8882
8883 if (GetInventory().GetCargo() != NULL)
8884 {
8885 item_count = GetInventory().GetCargo().GetItemCount();
8886 }
8887
8888 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8889 {
8890 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8891 if (item)
8892 item_count += item.GetNumberOfItems();
8893 }
8894 return item_count;
8895 }
8896
8899 {
8900 float weight = 0;
8901 float wetness = 1;
8902 if (include_wetness)
8905 {
8906 weight = wetness * m_ConfigWeight;
8907 }
8909 {
8910 weight = 1;
8911 }
8912 return weight;
8913 }
8914
8915
8916
8918 {
8919 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8920 {
8921 GameInventory inv = GetInventory();
8922 array<EntityAI> items = new array<EntityAI>;
8924 for (int i = 0; i < items.Count(); i++)
8925 {
8927 if (item)
8928 {
8930 }
8931 }
8932 }
8933 }
8934
8935
8936
8937
8939 {
8940 float energy = 0;
8941 if (HasEnergyManager())
8942 {
8943 energy = GetCompEM().GetEnergy();
8944 }
8945 return energy;
8946 }
8947
8948
8950 {
8951 super.OnEnergyConsumed();
8952
8954 }
8955
8957 {
8958 super.OnEnergyAdded();
8959
8961 }
8962
8963
8965 {
8966 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8967 {
8969 {
8970 float energy_0to1 = GetCompEM().GetEnergy0To1();
8972 }
8973 }
8974 }
8975
8976
8978 {
8979 return ConfigGetFloat("heatIsolation");
8980 }
8981
8983 {
8985 }
8986
8988 {
8989 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8990 if (
GetGame().ConfigIsExisting(paramPath))
8992
8993 return 0.0;
8994 }
8995
8997 {
8998 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8999 if (
GetGame().ConfigIsExisting(paramPath))
9001
9002 return 0.0;
9003 }
9004
9005 override void SetWet(
float value,
bool allow_client =
false)
9006 {
9007 if (!IsServerCheck(allow_client))
9008 return;
9009
9012
9014
9015 m_VarWet = Math.Clamp(value, min, max);
9016
9018 {
9021 }
9022 }
9023
9024 override void AddWet(
float value)
9025 {
9027 }
9028
9030 {
9032 }
9033
9035 {
9037 }
9038
9040 {
9042 }
9043
9045 {
9047 }
9048
9050 {
9052 }
9053
9055 {
9058 if (newLevel != oldLevel)
9059 {
9061 }
9062 }
9063
9065 {
9066 SetWeightDirty();
9067 }
9068
9070 {
9071 return GetWetLevelInternal(
m_VarWet);
9072 }
9073
9074
9075
9077 {
9079 }
9080
9082 {
9084 }
9085
9087 {
9089 }
9090
9092 {
9094 }
9095
9096
9097
9099 {
9100 if (ConfigIsExisting("itemModelLength"))
9101 {
9102 return ConfigGetFloat("itemModelLength");
9103 }
9104 return 0;
9105 }
9106
9108 {
9109 if (ConfigIsExisting("itemAttachOffset"))
9110 {
9111 return ConfigGetFloat("itemAttachOffset");
9112 }
9113 return 0;
9114 }
9115
9116 override void SetCleanness(
int value,
bool allow_client =
false)
9117 {
9118 if (!IsServerCheck(allow_client))
9119 return;
9120
9122
9124
9127 }
9128
9130 {
9132 }
9133
9135 {
9136 return true;
9137 }
9138
9139
9140
9141
9143 {
9145 }
9146
9148 {
9150 }
9151
9152
9153
9154
9155 override void SetColor(
int r,
int g,
int b,
int a)
9156 {
9162 }
9164 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9165 {
9170 }
9171
9173 {
9175 }
9176
9179 {
9180 int r,g,b,a;
9182 r = r/255;
9183 g = g/255;
9184 b = b/255;
9185 a = a/255;
9186 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9187 }
9188
9189
9190
9191 override void SetLiquidType(
int value,
bool allow_client =
false)
9192 {
9193 if (!IsServerCheck(allow_client))
9194 return;
9195
9200 }
9201
9203 {
9204 return ConfigGetInt("varLiquidTypeInit");
9205 }
9206
9208 {
9210 }
9211
9213 {
9215 SetFrozen(false);
9216 }
9217
9220 {
9221 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9222 }
9223
9224
9227 {
9228 PlayerBase nplayer;
9229 if (PlayerBase.CastTo(nplayer, player))
9230 {
9232
9233 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9234 }
9235 }
9236
9237
9240 {
9241 PlayerBase nplayer;
9242 if (PlayerBase.CastTo(nplayer,player))
9243 {
9244
9245 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9246
9247 }
9248
9249
9250 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9251
9252
9253 if (HasEnergyManager())
9254 {
9255 GetCompEM().UpdatePlugState();
9256 }
9257 }
9258
9259
9261 {
9262 super.OnPlacementStarted(player);
9263
9265 }
9266
9267 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9268 {
9270 {
9271 m_AdminLog.OnPlacementComplete(player,
this);
9272 }
9273
9274 super.OnPlacementComplete(player, position, orientation);
9275 }
9276
9277
9278
9279
9280
9282 {
9284 {
9285 return true;
9286 }
9287 else
9288 {
9289 return false;
9290 }
9291 }
9292
9293
9295 {
9297 {
9299 }
9300 }
9301
9302
9304 {
9306 }
9307
9309 {
9311 }
9312
9313 override void InsertAgent(
int agent,
float count = 1)
9314 {
9315 if (count < 1)
9316 return;
9317
9319 }
9320
9323 {
9325 }
9326
9327
9329 {
9331 }
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9375 {
9377 return false;
9378 return true;
9379 }
9380
9382 {
9383
9385 }
9386
9387
9390 {
9391 super.CheckForRoofLimited(timeTresholdMS);
9392
9394 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9395 {
9396 m_PreviousRoofTestTime = time;
9397 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9398 }
9399 }
9400
9401
9403 {
9405 {
9406 return 0;
9407 }
9408
9409 if (GetInventory().GetAttachmentSlotsCount() != 0)
9410 {
9411 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9412 if (filter)
9413 return filter.GetProtectionLevel(type, false, system);
9414 else
9415 return 0;
9416 }
9417
9418 string subclassPath, entryName;
9419
9420 switch (type)
9421 {
9423 entryName = "biological";
9424 break;
9426 entryName = "chemical";
9427 break;
9428 default:
9429 entryName = "biological";
9430 break;
9431 }
9432
9433 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9434
9436 }
9437
9438
9439
9442 {
9443 if (!IsMagazine())
9445
9447 }
9448
9449
9450
9451
9452
9457 {
9458 return true;
9459 }
9460
9462 {
9464 }
9465
9466
9467
9468
9469
9471 {
9472 if (parent)
9473 {
9474 if (parent.IsInherited(DayZInfected))
9475 return true;
9476
9477 if (!parent.IsRuined())
9478 return true;
9479 }
9480
9481 return true;
9482 }
9483
9485 {
9486 if (!super.CanPutAsAttachment(parent))
9487 {
9488 return false;
9489 }
9490
9491 if (!IsRuined() && !parent.IsRuined())
9492 {
9493 return true;
9494 }
9495
9496 return false;
9497 }
9498
9500 {
9501
9502
9503
9504
9505 return super.CanReceiveItemIntoCargo(item);
9506 }
9507
9509 {
9510
9511
9512
9513
9514 GameInventory attachmentInv = attachment.GetInventory();
9516 {
9517 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9518 return false;
9519 }
9520
9521 InventoryLocation loc = new InventoryLocation();
9522 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9523 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9524 return false;
9525
9526 return super.CanReceiveAttachment(attachment, slotId);
9527 }
9528
9530 {
9531 if (!super.CanReleaseAttachment(attachment))
9532 return false;
9533
9534 return GetInventory().AreChildrenAccessible();
9535 }
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9558 {
9559 int id = muzzle_owner.GetMuzzleID();
9560 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9561
9562 if (WPOF_array)
9563 {
9564 for (int i = 0; i < WPOF_array.Count(); i++)
9565 {
9566 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9567
9568 if (WPOF)
9569 {
9570 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9571 }
9572 }
9573 }
9574 }
9575
9576
9578 {
9579 int id = muzzle_owner.GetMuzzleID();
9581
9582 if (WPOBE_array)
9583 {
9584 for (int i = 0; i < WPOBE_array.Count(); i++)
9585 {
9586 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9587
9588 if (WPOBE)
9589 {
9590 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9591 }
9592 }
9593 }
9594 }
9595
9596
9598 {
9599 int id = muzzle_owner.GetMuzzleID();
9600 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9601
9602 if (WPOOH_array)
9603 {
9604 for (int i = 0; i < WPOOH_array.Count(); i++)
9605 {
9606 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9607
9608 if (WPOOH)
9609 {
9610 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9611 }
9612 }
9613 }
9614 }
9615
9616
9618 {
9619 int id = muzzle_owner.GetMuzzleID();
9620 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9621
9622 if (WPOOH_array)
9623 {
9624 for (int i = 0; i < WPOOH_array.Count(); i++)
9625 {
9626 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9627
9628 if (WPOOH)
9629 {
9630 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9631 }
9632 }
9633 }
9634 }
9635
9636
9638 {
9639 int id = muzzle_owner.GetMuzzleID();
9640 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9641
9642 if (WPOOH_array)
9643 {
9644 for (int i = 0; i < WPOOH_array.Count(); i++)
9645 {
9646 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9647
9648 if (WPOOH)
9649 {
9650 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9651 }
9652 }
9653 }
9654 }
9655
9656
9657
9659 {
9661 {
9662 return true;
9663 }
9664
9665 return false;
9666 }
9667
9669 {
9671 {
9672 return true;
9673 }
9674
9675 return false;
9676 }
9677
9679 {
9681 {
9682 return true;
9683 }
9684
9685 return false;
9686 }
9687
9689 {
9690 return false;
9691 }
9692
9695 {
9696 return UATimeSpent.DEFAULT_DEPLOY;
9697 }
9698
9699
9700
9701
9703 {
9705 SetSynchDirty();
9706 }
9707
9709 {
9711 }
9712
9713
9715 {
9716 return false;
9717 }
9718
9721 {
9722 string att_type = "None";
9723
9724 if (ConfigIsExisting("soundAttType"))
9725 {
9726 att_type = ConfigGetString("soundAttType");
9727 }
9728
9730 }
9731
9733 {
9735 }
9736
9737
9738
9739
9740
9746
9748 {
9751
9753 }
9754
9755
9757 {
9759 return;
9760
9762
9765
9768
9769 SoundParameters params = new SoundParameters();
9773 }
9774
9775
9777 {
9779 return;
9780
9782 SetSynchDirty();
9783
9786 }
9787
9788
9790 {
9792 return;
9793
9795 SetSynchDirty();
9796
9799 }
9800
9802 {
9804 }
9805
9807 {
9809 }
9810
9813 {
9814 if (!
GetGame().IsDedicatedServer())
9815 {
9816 if (ConfigIsExisting("attachSoundSet"))
9817 {
9818 string cfg_path = "";
9819 string soundset = "";
9821
9824 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9825 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9826
9827 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9828 {
9829 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9830 {
9831 if (cfg_slot_array[i] == slot_type)
9832 {
9833 soundset = cfg_soundset_array[i];
9834 break;
9835 }
9836 }
9837 }
9838
9839 if (soundset != "")
9840 {
9841 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9843 }
9844 }
9845 }
9846 }
9847
9849 {
9850
9851 }
9852
9853 void OnApply(PlayerBase player);
9854
9856 {
9857 return 1.0;
9858 };
9859
9861 {
9863 }
9864
9866 {
9868 }
9869
9871
9873 {
9874 SetDynamicPhysicsLifeTime(0.01);
9876 }
9877
9879 {
9880 array<string> zone_names = new array<string>;
9881 GetDamageZones(zone_names);
9882 for (int i = 0; i < zone_names.Count(); i++)
9883 {
9884 SetHealthMax(zone_names.Get(i),"Health");
9885 }
9886 SetHealthMax("","Health");
9887 }
9888
9891 {
9892 float global_health = GetHealth01("","Health");
9893 array<string> zones = new array<string>;
9894 GetDamageZones(zones);
9895
9896 for (int i = 0; i < zones.Count(); i++)
9897 {
9898 SetHealth01(zones.Get(i),"Health",global_health);
9899 }
9900 }
9901
9904 {
9905 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9906 }
9907
9909 {
9910 if (!hasRootAsPlayer)
9911 {
9912 if (refParentIB)
9913 {
9914
9915 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9916 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9917
9918 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9919 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9920
9923 }
9924 else
9925 {
9926
9929 }
9930 }
9931 }
9932
9934 {
9936 {
9937 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9938 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
9939 {
9940 float heatPermCoef = 1.0;
9942 while (ent)
9943 {
9944 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9945 ent = ent.GetHierarchyParent();
9946 }
9947
9948 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9949 }
9950 }
9951 }
9952
9954 {
9955
9956 EntityAI parent = GetHierarchyParent();
9957 if (!parent)
9958 {
9959 hasParent = false;
9960 hasRootAsPlayer = false;
9961 }
9962 else
9963 {
9964 hasParent = true;
9965 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9966 refParentIB =
ItemBase.Cast(parent);
9967 }
9968 }
9969
9970 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9971 {
9972
9973 }
9974
9976 {
9977
9978 return false;
9979 }
9980
9982 {
9983
9984
9985 return false;
9986 }
9987
9989 {
9990
9991 return false;
9992 }
9993
9996 {
9997 return !GetIsFrozen() &&
IsOpen();
9998 }
9999
10001 {
10002 bool hasParent = false, hasRootAsPlayer = false;
10004
10005 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10006 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10007
10008 if (wwtu || foodDecay)
10009 {
10013
10014 if (processWetness || processTemperature || processDecay)
10015 {
10017
10018 if (processWetness)
10019 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10020
10021 if (processTemperature)
10023
10024 if (processDecay)
10025 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10026 }
10027 }
10028 }
10029
10032 {
10034 }
10035
10037 {
10040
10041 return super.GetTemperatureFreezeThreshold();
10042 }
10043
10045 {
10048
10049 return super.GetTemperatureThawThreshold();
10050 }
10051
10053 {
10056
10057 return super.GetItemOverheatThreshold();
10058 }
10059
10061 {
10063 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10064
10065 return super.GetTemperatureFreezeTime();
10066 }
10067
10069 {
10071 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10072
10073 return super.GetTemperatureThawTime();
10074 }
10075
10080
10082 {
10083 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10084 }
10085
10087 {
10088 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10089 }
10090
10093 {
10095 }
10096
10098 {
10100 }
10101
10103 {
10105 }
10106
10109 {
10110 return null;
10111 }
10112
10115 {
10116 return false;
10117 }
10118
10120 {
10122 {
10125 if (!trg)
10126 {
10128 explosive = this;
10129 }
10130
10131 explosive.PairRemote(trg);
10133
10134 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10135 trg.SetPersistentPairID(persistentID);
10136 explosive.SetPersistentPairID(persistentID);
10137
10138 return true;
10139 }
10140 return false;
10141 }
10142
10145 {
10146 float ret = 1.0;
10149 ret *= GetHealth01();
10150
10151 return ret;
10152 }
10153
10154 #ifdef DEVELOPER
10155 override void SetDebugItem()
10156 {
10157 super.SetDebugItem();
10158 _itemBase = this;
10159 }
10160
10162 {
10163 string text = super.GetDebugText();
10164
10166 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10167
10168 return text;
10169 }
10170 #endif
10171
10173 {
10174 return true;
10175 }
10176
10178
10180
10182 {
10185 }
10186
10187
10195
10211}
10212
10214{
10216 if (entity)
10217 {
10218 bool is_item = entity.IsInherited(
ItemBase);
10219 if (is_item && full_quantity)
10220 {
10223 }
10224 }
10225 else
10226 {
10228 return NULL;
10229 }
10230 return entity;
10231}
10232
10234{
10235 if (item)
10236 {
10237 if (health > 0)
10238 item.SetHealth("", "", health);
10239
10240 if (item.CanHaveTemperature())
10241 {
10243 if (item.CanFreeze())
10244 item.SetFrozen(false);
10245 }
10246
10247 if (item.HasEnergyManager())
10248 {
10249 if (quantity >= 0)
10250 {
10251 item.GetCompEM().SetEnergy0To1(quantity);
10252 }
10253 else
10254 {
10256 }
10257 }
10258 else if (item.IsMagazine())
10259 {
10260 Magazine mag = Magazine.Cast(item);
10261 if (quantity >= 0)
10262 {
10263 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10264 }
10265 else
10266 {
10268 }
10269
10270 }
10271 else
10272 {
10273 if (quantity >= 0)
10274 {
10275 item.SetQuantityNormalized(quantity, false);
10276 }
10277 else
10278 {
10280 }
10281
10282 }
10283 }
10284}
10285
10286#ifdef DEVELOPER
10288#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.