5329{
5331 {
5332 return true;
5333 }
5334};
5335
5336
5337
5339{
5343
5345
5348
5349
5350
5351
5352
5361
5367
5372
5377
5398 protected bool m_IsResultOfSplit
5399
5401
5406
5407
5408
5410
5414
5415
5416
5418
5421
5422
5423
5429
5430
5438
5441
5442
5444
5445
5447
5448
5453
5454
5459
5460
5462
5463
5465 {
5470
5471 if (!
GetGame().IsDedicatedServer())
5472 {
5474 {
5476
5478 {
5480 }
5481 }
5482
5485 }
5486
5487 m_OldLocation = null;
5488
5490 {
5492 }
5493
5494 if (ConfigIsExisting("headSelectionsToHide"))
5495 {
5498 }
5499
5501 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5502 {
5504 }
5505
5507
5508 m_IsResultOfSplit = false;
5509
5511 }
5512
5514 {
5515 super.InitItemVariables();
5516
5522 m_Count = ConfigGetInt(
"count");
5523
5526
5531
5534
5539
5551
5555
5556
5559 if (ConfigIsExisting("canBeSplit"))
5560 {
5563 }
5564
5566 if (ConfigIsExisting("itemBehaviour"))
5568
5569
5572 RegisterNetSyncVariableInt("m_VarLiquidType");
5573 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5574
5575 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5576 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5577 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5578
5579 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5580 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5581 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5582 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5583
5584 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5585 RegisterNetSyncVariableBool("m_IsTakeable");
5586 RegisterNetSyncVariableBool("m_IsHologram");
5587
5590 {
5593 }
5594
5596
5598 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5600
5601 }
5602
5604 {
5606 }
5607
5609 {
5612 {
5617 }
5618 }
5619
5620 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5621 {
5623 {
5626 }
5627
5629 }
5630
5632 {
5638 }
5639
5641
5643 {
5645
5646 if (!action)
5647 {
5648 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5649 return;
5650 }
5651
5653 if (!ai)
5654 {
5656 return;
5657 }
5658
5660 if (!action_array)
5661 {
5662 action_array = new array<ActionBase_Basic>;
5664 }
5665 if (LogManager.IsActionLogEnable())
5666 {
5667 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5668 }
5669
5670 if (action_array.Find(action) != -1)
5671 {
5672 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5673 }
5674 else
5675 {
5676 action_array.Insert(action);
5677 }
5678 }
5679
5681 {
5683 ActionBase action = player.GetActionManager().GetAction(actionName);
5686
5687 if (action_array)
5688 {
5689 action_array.RemoveItem(action);
5690 }
5691 }
5692
5693
5694
5696 {
5697 ActionOverrideData overrideData = new ActionOverrideData();
5701
5703 if (!actionMap)
5704 {
5707 }
5708
5709 actionMap.Insert(this.
Type(), overrideData);
5710
5711 }
5712
5714
5716
5717
5719 {
5722
5725
5726 string config_to_search = "CfgVehicles";
5727 string muzzle_owner_config;
5728
5730 {
5731 if (IsInherited(Weapon))
5732 config_to_search = "CfgWeapons";
5733
5734 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5735
5736 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5737
5739
5740 if (config_OnFire_subclass_count > 0)
5741 {
5742 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5743
5744 for (int i = 0; i < config_OnFire_subclass_count; i++)
5745 {
5746 string particle_class = "";
5748 string config_OnFire_entry = config_OnFire_class + particle_class;
5749 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5750 WPOF_array.Insert(WPOF);
5751 }
5752
5753
5755 }
5756 }
5757
5759 {
5760 config_to_search = "CfgWeapons";
5761 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5762
5763 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5764
5766
5767 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5768 {
5769 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5770
5771 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5772 {
5773 string particle_class2 = "";
5775 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5776 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5777 WPOBE_array.Insert(WPOBE);
5778 }
5779
5780
5782 }
5783 }
5784 }
5785
5786
5788 {
5791
5793 {
5794 string config_to_search = "CfgVehicles";
5795
5796 if (IsInherited(Weapon))
5797 config_to_search = "CfgWeapons";
5798
5799 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5800 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5801
5802 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5803 {
5804
5806
5808 {
5810 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5812 return;
5813 }
5814
5817
5818
5819
5821 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5822
5823 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5824 {
5825 string particle_class = "";
5827 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5829
5830 if (entry_type == CT_CLASS)
5831 {
5832 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5833 WPOOH_array.Insert(WPOF);
5834 }
5835 }
5836
5837
5839 }
5840 }
5841 }
5842
5844 {
5846 }
5847
5849 {
5851 {
5853
5856
5859
5860 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5861 }
5862 }
5863
5865 {
5867 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5868
5870 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5871
5873 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5874
5876 {
5878 }
5879 }
5880
5882 {
5884 }
5885
5887 {
5890 else
5892
5894 {
5897 }
5898 else
5899 {
5902
5905 }
5906
5908 }
5909
5911 {
5913 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5914 }
5915
5917 {
5919 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5921 }
5922
5924 {
5926 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5927 }
5928
5930 {
5933
5934 OverheatingParticle OP = new OverheatingParticle();
5939
5941 }
5942
5944 {
5947
5948 return -1;
5949 }
5950
5952 {
5954 {
5957
5958 for (int i = count; i > 0; --i)
5959 {
5960 int id = i - 1;
5963
5966
5967 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5968 {
5969 if (p)
5970 {
5973 }
5974 }
5975 }
5976 }
5977 }
5978
5980 {
5982 {
5984 {
5985 int id = i - 1;
5987
5988 if (OP)
5989 {
5991
5992 if (p)
5993 {
5995 }
5996
5997 delete OP;
5998 }
5999 }
6000
6003 }
6004 }
6005
6008 {
6009 return 0.0;
6010 }
6011
6012
6014 {
6015 return 250;
6016 }
6017
6019 {
6020 return 0;
6021 }
6022
6025 {
6027 return true;
6028
6029 return false;
6030 }
6031
6034 {
6037
6039 {
6041 }
6042 else
6043 {
6044
6046 }
6047
6049 }
6050
6057 {
6058 return -1;
6059 }
6060
6061
6062
6063
6065 {
6067 {
6069 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6070
6071 if (r_index >= 0)
6072 {
6073 InventoryLocation r_il = new InventoryLocation;
6074 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6075
6076 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6079 {
6080 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6081 }
6083 {
6084 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6085 }
6086
6087 }
6088
6089 player.GetHumanInventory().ClearUserReservedLocation(this);
6090 }
6091
6094 }
6095
6096
6097
6098
6100 {
6101 return ItemBase.m_DebugActionsMask;
6102 }
6103
6105 {
6106 return ItemBase.m_DebugActionsMask & mask;
6107 }
6108
6110 {
6111 ItemBase.m_DebugActionsMask = mask;
6112 }
6113
6115 {
6116 ItemBase.m_DebugActionsMask |= mask;
6117 }
6118
6120 {
6121 ItemBase.m_DebugActionsMask &= ~mask;
6122 }
6123
6125 {
6127 {
6129 }
6130 else
6131 {
6133 }
6134 }
6135
6136
6138 {
6139 if (GetEconomyProfile())
6140 {
6141 float q_max = GetEconomyProfile().GetQuantityMax();
6142 if (q_max > 0)
6143 {
6144 float q_min = GetEconomyProfile().GetQuantityMin();
6145 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6146
6148 {
6149 ComponentEnergyManager comp = GetCompEM();
6151 {
6153 }
6154 }
6156 {
6158
6159 }
6160
6161 }
6162 }
6163 }
6164
6167 {
6168 EntityAI parent = GetHierarchyParent();
6169
6170 if (parent)
6171 {
6172 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6173 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6174 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6175 }
6176 }
6177
6180 {
6181 EntityAI parent = GetHierarchyParent();
6182
6183 if (parent)
6184 {
6185 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6186 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6187 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6188 }
6189 }
6190
6192 {
6193
6194
6195
6196
6198
6200 {
6201 if (ScriptInputUserData.CanStoreInputUserData())
6202 {
6203 ScriptInputUserData ctx = new ScriptInputUserData;
6209 ctx.
Write(use_stack_max);
6212
6214 {
6215 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6216 }
6217 }
6218 }
6219 else if (!
GetGame().IsMultiplayer())
6220 {
6222 }
6223 }
6224
6226 {
6228 }
6229
6231 {
6233 }
6234
6236 {
6238 }
6239
6241 {
6242
6243 return false;
6244 }
6245
6247 {
6248 return false;
6249 }
6250
6254 {
6255 return false;
6256 }
6257
6259 {
6260 return "";
6261 }
6262
6264
6266 {
6267 return false;
6268 }
6269
6271 {
6272 return true;
6273 }
6274
6275
6276
6278 {
6279 return true;
6280 }
6281
6283 {
6284 return true;
6285 }
6286
6288 {
6289 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6291 }
6292
6294 {
6296 }
6297
6299 {
6301 if (!is_being_placed)
6303 SetSynchDirty();
6304 }
6305
6306
6308
6310 {
6312 }
6313
6315 {
6317 }
6318
6320 {
6321 return 1;
6322 }
6323
6325 {
6326 return false;
6327 }
6328
6330 {
6332 SetSynchDirty();
6333 }
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6370 {
6371 super.OnMovedInsideCargo(container);
6372
6373 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6374 }
6375
6376 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6377 {
6378 super.EEItemLocationChanged(oldLoc,newLoc);
6379
6380 PlayerBase new_player = null;
6381 PlayerBase old_player = null;
6382
6383 if (newLoc.GetParent())
6384 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6385
6386 if (oldLoc.GetParent())
6387 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6388
6390 {
6391 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6392
6393 if (r_index >= 0)
6394 {
6395 InventoryLocation r_il = new InventoryLocation;
6396 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6397
6398 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6401 {
6402 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6403 }
6405 {
6406 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6407 }
6408
6409 }
6410 }
6411
6413 {
6414 if (new_player)
6415 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6416
6417 if (new_player == old_player)
6418 {
6419
6420 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6421 {
6423 {
6424 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6425 {
6426 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6427 }
6428 }
6429 else
6430 {
6431 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6432 }
6433 }
6434
6435 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6436 {
6437 int type = oldLoc.GetType();
6439 {
6440 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6441 }
6443 {
6444 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6445 }
6446 }
6447 if (!m_OldLocation)
6448 {
6449 m_OldLocation = new InventoryLocation;
6450 }
6451 m_OldLocation.Copy(oldLoc);
6452 }
6453 else
6454 {
6455 if (m_OldLocation)
6456 {
6457 m_OldLocation.Reset();
6458 }
6459 }
6460
6462 }
6463 else
6464 {
6465 if (new_player)
6466 {
6467 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6468 if (res_index >= 0)
6469 {
6470 InventoryLocation il = new InventoryLocation;
6471 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6473 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6476 {
6477 il.
GetParent().GetOnReleaseLock().Invoke(it);
6478 }
6480 {
6482 }
6483
6484 }
6485 }
6487 {
6488
6490 }
6491
6492 if (m_OldLocation)
6493 {
6494 m_OldLocation.Reset();
6495 }
6496 }
6497 }
6498
6499 override void EOnContact(IEntity other, Contact extra)
6500 {
6502 {
6503 int liquidType = -1;
6505 if (impactSpeed > 0.0)
6506 {
6508 #ifndef SERVER
6510 #else
6512 SetSynchDirty();
6513 #endif
6515 }
6516 }
6517
6518 #ifdef SERVER
6519 if (GetCompEM() && GetCompEM().IsPlugged())
6520 {
6521 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6522 GetCompEM().UnplugThis();
6523 }
6524 #endif
6525 }
6526
6528
6530 {
6532 }
6533
6535 {
6536
6537 }
6538
6540 {
6541 super.OnItemLocationChanged(old_owner, new_owner);
6542
6543 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6544 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6545
6546 if (!relatedPlayer && playerNew)
6547 relatedPlayer = playerNew;
6548
6549 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6550 {
6552 if (actionMgr)
6553 {
6554 ActionBase currentAction = actionMgr.GetRunningAction();
6555 if (currentAction)
6557 }
6558 }
6559
6560 Man ownerPlayerOld = null;
6561 Man ownerPlayerNew = null;
6562
6563 if (old_owner)
6564 {
6565 if (old_owner.
IsMan())
6566 {
6567 ownerPlayerOld = Man.Cast(old_owner);
6568 }
6569 else
6570 {
6571 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6572 }
6573 }
6574 else
6575 {
6577 {
6579
6580 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6581 {
6582 GetCompEM().UnplugThis();
6583 }
6584 }
6585 }
6586
6587 if (new_owner)
6588 {
6589 if (new_owner.
IsMan())
6590 {
6591 ownerPlayerNew = Man.Cast(new_owner);
6592 }
6593 else
6594 {
6595 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6596 }
6597 }
6598
6599 if (ownerPlayerOld != ownerPlayerNew)
6600 {
6601 if (ownerPlayerOld)
6602 {
6603 array<EntityAI> subItemsExit = new array<EntityAI>;
6605 for (int i = 0; i < subItemsExit.Count(); i++)
6606 {
6609 }
6610 }
6611
6612 if (ownerPlayerNew)
6613 {
6614 array<EntityAI> subItemsEnter = new array<EntityAI>;
6616 for (int j = 0; j < subItemsEnter.Count(); j++)
6617 {
6620 }
6621 }
6622 }
6623 else if (ownerPlayerNew != null)
6624 {
6625 PlayerBase nplayer;
6626 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6627 {
6628 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6630 for (int k = 0; k < subItemsUpdate.Count(); k++)
6631 {
6633 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6634 }
6635 }
6636 }
6637
6638 if (old_owner)
6639 old_owner.OnChildItemRemoved(this);
6640 if (new_owner)
6641 new_owner.OnChildItemReceived(this);
6642 }
6643
6644
6646 {
6647 super.EEDelete(parent);
6648 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6649 if (player)
6650 {
6652
6653 if (player.IsAlive())
6654 {
6655 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6656 if (r_index >= 0)
6657 {
6658 InventoryLocation r_il = new InventoryLocation;
6659 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6660
6661 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6664 {
6665 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6666 }
6668 {
6669 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6670 }
6671
6672 }
6673
6674 player.RemoveQuickBarEntityShortcut(this);
6675 }
6676 }
6677 }
6678
6680 {
6681 super.EEKilled(killer);
6682
6685 {
6686 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6687 {
6688 if (IsMagazine())
6689 {
6690 if (Magazine.Cast(this).GetAmmoCount() > 0)
6691 {
6693 }
6694 }
6695 else
6696 {
6698 }
6699 }
6700 }
6701 }
6702
6704 {
6705 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6706
6707 super.OnWasAttached(parent, slot_id);
6708
6711
6713 }
6714
6716 {
6717 super.OnWasDetached(parent, slot_id);
6718
6721 }
6722
6724 {
6725 int idx;
6728
6729 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6730 if (inventory_slots.Count() < 1)
6731 {
6732 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6733 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6734 }
6735 else
6736 {
6737 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6738 }
6739
6740 idx = inventory_slots.Find(slot);
6741 if (idx < 0)
6742 return "";
6743
6744 return attach_types.Get(idx);
6745 }
6746
6748 {
6749 int idx = -1;
6750 string slot;
6751
6754
6755 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6756 if (inventory_slots.Count() < 1)
6757 {
6758 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6759 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6760 }
6761 else
6762 {
6763 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6764 if (detach_types.Count() < 1)
6765 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6766 }
6767
6768 for (int i = 0; i < inventory_slots.Count(); i++)
6769 {
6770 slot = inventory_slots.Get(i);
6771 }
6772
6773 if (slot != "")
6774 {
6775 if (detach_types.Count() == 1)
6776 idx = 0;
6777 else
6778 idx = inventory_slots.Find(slot);
6779 }
6780 if (idx < 0)
6781 return "";
6782
6783 return detach_types.Get(idx);
6784 }
6785
6787 {
6788
6790
6791
6792 float min_time = 1;
6793 float max_time = 3;
6794 float delay = Math.RandomFloat(min_time, max_time);
6795
6796 explode_timer.Run(delay, this, "DoAmmoExplosion");
6797 }
6798
6800 {
6801 Magazine magazine = Magazine.Cast(this);
6802 int pop_sounds_count = 6;
6803 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6804
6805
6806 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6807 string sound_name = pop_sounds[ sound_idx ];
6809
6810
6811 magazine.ServerAddAmmoCount(-1);
6812
6813
6814 float min_temp_to_explode = 100;
6815
6816 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6817 {
6819 }
6820 }
6821
6822
6823 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6824 {
6825 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6826
6827 const int CHANCE_DAMAGE_CARGO = 4;
6828 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6829 const int CHANCE_DAMAGE_NOTHING = 2;
6830
6832 {
6833 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6834 int chances;
6835 int rnd;
6836
6837 if (GetInventory().GetCargo())
6838 {
6839 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6840 rnd = Math.RandomInt(0,chances);
6841
6842 if (rnd < CHANCE_DAMAGE_CARGO)
6843 {
6845 }
6846 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6847 {
6849 }
6850 }
6851 else
6852 {
6853 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6854 rnd = Math.RandomInt(0,chances);
6855
6856 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6857 {
6859 }
6860 }
6861 }
6862 }
6863
6865 {
6866 if (GetInventory().GetCargo())
6867 {
6868 int item_count = GetInventory().GetCargo().GetItemCount();
6869 if (item_count > 0)
6870 {
6871 int random_pick = Math.RandomInt(0, item_count);
6873 if (!item.IsExplosive())
6874 {
6875 item.AddHealth("","",damage);
6876 return true;
6877 }
6878 }
6879 }
6880 return false;
6881 }
6882
6884 {
6885 int attachment_count = GetInventory().AttachmentCount();
6886 if (attachment_count > 0)
6887 {
6888 int random_pick = Math.RandomInt(0, attachment_count);
6889 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6890 if (!attachment.IsExplosive())
6891 {
6892 attachment.AddHealth("","",damage);
6893 return true;
6894 }
6895 }
6896 return false;
6897 }
6898
6900 {
6902 }
6903
6905 {
6907 return GetInventory().CanRemoveEntity();
6908
6909 return false;
6910 }
6911
6913 {
6915 return;
6916
6918 {
6919 if (ScriptInputUserData.CanStoreInputUserData())
6920 {
6921 ScriptInputUserData ctx = new ScriptInputUserData;
6926 ctx.
Write(destination_entity);
6930 }
6931 }
6932 else if (!
GetGame().IsMultiplayer())
6933 {
6935 }
6936 }
6937
6939 {
6941 return;
6942
6943 float split_quantity_new;
6947 InventoryLocation loc = new InventoryLocation;
6948
6949 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6950 {
6952 split_quantity_new = stack_max;
6953 else
6955
6956 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6957 if (new_item)
6958 {
6959 new_item.SetResultOfSplit(true);
6960 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6962 new_item.SetQuantity(split_quantity_new);
6963 }
6964 }
6965 else if (destination_entity && slot_id == -1)
6966 {
6967 if (quantity > stack_max)
6968 split_quantity_new = stack_max;
6969 else
6970 split_quantity_new = quantity;
6971
6973 {
6976 }
6977
6978 if (new_item)
6979 {
6980 new_item.SetResultOfSplit(true);
6981 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6983 new_item.SetQuantity(split_quantity_new);
6984 }
6985 }
6986 else
6987 {
6988 if (stack_max != 0)
6989 {
6991 {
6993 }
6994
6995 if (split_quantity_new == 0)
6996 {
6997 if (!
GetGame().IsMultiplayer())
6998 player.PhysicalPredictiveDropItem(this);
6999 else
7000 player.ServerDropEntity(this);
7001 return;
7002 }
7003
7005
7006 if (new_item)
7007 {
7008 new_item.SetResultOfSplit(true);
7009 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7011 new_item.SetQuantity(stack_max);
7012 new_item.PlaceOnSurface();
7013 }
7014 }
7015 }
7016 }
7017
7019 {
7021 return;
7022
7023 float split_quantity_new;
7027 InventoryLocation loc = new InventoryLocation;
7028
7029 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7030 {
7032 split_quantity_new = stack_max;
7033 else
7035
7036 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7037 if (new_item)
7038 {
7039 new_item.SetResultOfSplit(true);
7040 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7042 new_item.SetQuantity(split_quantity_new);
7043 }
7044 }
7045 else if (destination_entity && slot_id == -1)
7046 {
7047 if (quantity > stack_max)
7048 split_quantity_new = stack_max;
7049 else
7050 split_quantity_new = quantity;
7051
7053 {
7056 }
7057
7058 if (new_item)
7059 {
7060 new_item.SetResultOfSplit(true);
7061 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7063 new_item.SetQuantity(split_quantity_new);
7064 }
7065 }
7066 else
7067 {
7068 if (stack_max != 0)
7069 {
7071 {
7073 }
7074
7076
7077 if (new_item)
7078 {
7079 new_item.SetResultOfSplit(true);
7080 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7082 new_item.SetQuantity(stack_max);
7083 new_item.PlaceOnSurface();
7084 }
7085 }
7086 }
7087 }
7088
7090 {
7092 return;
7093
7095 {
7096 if (ScriptInputUserData.CanStoreInputUserData())
7097 {
7098 ScriptInputUserData ctx = new ScriptInputUserData;
7103 dst.WriteToContext(ctx);
7105 }
7106 }
7107 else if (!
GetGame().IsMultiplayer())
7108 {
7110 }
7111 }
7112
7114 {
7116 return;
7117
7119 {
7120 if (ScriptInputUserData.CanStoreInputUserData())
7121 {
7122 ScriptInputUserData ctx = new ScriptInputUserData;
7127 ctx.
Write(destination_entity);
7133 }
7134 }
7135 else if (!
GetGame().IsMultiplayer())
7136 {
7138 }
7139 }
7140
7142 {
7144 }
7145
7147 {
7149 return this;
7150
7152 float split_quantity_new;
7154 if (dst.IsValid())
7155 {
7156 int slot_id = dst.GetSlot();
7158
7159 if (quantity > stack_max)
7160 split_quantity_new = stack_max;
7161 else
7162 split_quantity_new = quantity;
7163
7165
7166 if (new_item)
7167 {
7168 new_item.SetResultOfSplit(true);
7169 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7172 }
7173
7174 return new_item;
7175 }
7176
7177 return null;
7178 }
7179
7181 {
7183 return;
7184
7186 float split_quantity_new;
7188 if (destination_entity)
7189 {
7191 if (quantity > stackable)
7192 split_quantity_new = stackable;
7193 else
7194 split_quantity_new = quantity;
7195
7196 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7197 if (new_item)
7198 {
7199 new_item.SetResultOfSplit(true);
7200 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7202 new_item.SetQuantity(split_quantity_new);
7203 }
7204 }
7205 }
7206
7208 {
7210 return;
7211
7213 {
7214 if (ScriptInputUserData.CanStoreInputUserData())
7215 {
7216 ScriptInputUserData ctx = new ScriptInputUserData;
7221 ItemBase destination_entity =
this;
7222 ctx.
Write(destination_entity);
7226 }
7227 }
7228 else if (!
GetGame().IsMultiplayer())
7229 {
7231 }
7232 }
7233
7235 {
7237 return;
7238
7240 float split_quantity_new;
7242 if (player)
7243 {
7245 if (quantity > stackable)
7246 split_quantity_new = stackable;
7247 else
7248 split_quantity_new = quantity;
7249
7250 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7251 new_item =
ItemBase.Cast(in_hands);
7252 if (new_item)
7253 {
7254 new_item.SetResultOfSplit(true);
7255 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7257 new_item.SetQuantity(split_quantity_new);
7258 }
7259 }
7260 }
7261
7263 {
7265 return;
7266
7268 float split_quantity_new = Math.Floor(quantity * 0.5);
7269
7271
7272 if (new_item)
7273 {
7274 if (new_item.GetQuantityMax() < split_quantity_new)
7275 {
7276 split_quantity_new = new_item.GetQuantityMax();
7277 }
7278
7279 new_item.SetResultOfSplit(true);
7280 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7281
7283 {
7286 }
7287 else
7288 {
7291 }
7292 }
7293 }
7294
7296 {
7298 return;
7299
7301 float split_quantity_new = Math.Floor(quantity / 2);
7302
7303 InventoryLocation invloc = new InventoryLocation;
7305
7307 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7308
7309 if (new_item)
7310 {
7311 if (new_item.GetQuantityMax() < split_quantity_new)
7312 {
7313 split_quantity_new = new_item.GetQuantityMax();
7314 }
7316 {
7319 }
7320 else
7321 {
7324 }
7325 }
7326 }
7327
7330 {
7331 SetWeightDirty();
7333
7334 if (parent)
7335 parent.OnAttachmentQuantityChangedEx(this, delta);
7336
7338 {
7340 {
7342 }
7344 {
7345 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7347 }
7348 }
7349
7350 }
7351
7354 {
7355
7356 }
7357
7360 {
7362 }
7363
7365 {
7366 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7367
7369 {
7370 if (newLevel == GameConstants.STATE_RUINED)
7371 {
7373 EntityAI parent = GetHierarchyParent();
7374 if (parent && parent.IsFireplace())
7375 {
7376 CargoBase cargo = GetInventory().GetCargo();
7377 if (cargo)
7378 {
7380 {
7382 }
7383 }
7384 }
7385 }
7386
7388 {
7389
7391 return;
7392 }
7393
7394 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7395 {
7397 }
7398 }
7399 }
7400
7401
7403 {
7404 super.OnRightClick();
7405
7407 {
7409 {
7410 if (ScriptInputUserData.CanStoreInputUserData())
7411 {
7412 vector m4[4];
7414
7415 EntityAI root = GetHierarchyRoot();
7416
7417 InventoryLocation dst = new InventoryLocation;
7419 {
7420 if (root)
7421 {
7422 root.GetTransform(m4);
7424 }
7425 else
7426 GetInventory().GetCurrentInventoryLocation(dst);
7427 }
7428 else
7429 {
7431
7432
7433 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7434 {
7435 if (root)
7436 {
7437 root.GetTransform(m4);
7439 }
7440 else
7441 GetInventory().GetCurrentInventoryLocation(dst);
7442 }
7443 else
7444 {
7445 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7446 }
7447 }
7448
7449 ScriptInputUserData ctx = new ScriptInputUserData;
7457 }
7458 }
7459 else if (!
GetGame().IsMultiplayer())
7460 {
7462 }
7463 }
7464 }
7465
7466 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7467 {
7468
7469 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7470 return false;
7471
7472 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7473 return false;
7474
7475
7477 return false;
7478
7479
7480 Magazine mag = Magazine.Cast(this);
7481 if (mag)
7482 {
7483 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7484 return false;
7485
7486 if (stack_max_limit)
7487 {
7488 Magazine other_mag = Magazine.Cast(other_item);
7489 if (other_item)
7490 {
7491 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7492 return false;
7493 }
7494
7495 }
7496 }
7497 else
7498 {
7499
7501 return false;
7502
7504 return false;
7505 }
7506
7507 PlayerBase player = null;
7508 if (CastTo(player, GetHierarchyRootPlayer()))
7509 {
7510 if (player.GetInventory().HasAttachment(this))
7511 return false;
7512
7513 if (player.IsItemsToDelete())
7514 return false;
7515 }
7516
7517 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7518 return false;
7519
7520 int slotID;
7522 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7523 return false;
7524
7525 return true;
7526 }
7527
7529 {
7531 }
7532
7534 {
7535 return m_IsResultOfSplit;
7536 }
7537
7539 {
7540 m_IsResultOfSplit = value;
7541 }
7542
7544 {
7546 }
7547
7549 {
7550 float other_item_quantity = other_item.GetQuantity();
7551 float this_free_space;
7552
7554
7556
7557 if (other_item_quantity > this_free_space)
7558 {
7559 return this_free_space;
7560 }
7561 else
7562 {
7563 return other_item_quantity;
7564 }
7565 }
7566
7568 {
7570 }
7571
7573 {
7575 return;
7576
7577 if (!IsMagazine() && other_item)
7578 {
7580 if (quantity_used != 0)
7581 {
7582 float hp1 = GetHealth01("","");
7583 float hp2 = other_item.GetHealth01("","");
7584 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7585 hpResult = hpResult / (
GetQuantity() + quantity_used);
7586
7587 hpResult *= GetMaxHealth();
7588 Math.Round(hpResult);
7589 SetHealth("", "Health", hpResult);
7590
7592 other_item.AddQuantity(-quantity_used);
7593 }
7594 }
7596 }
7597
7599 {
7600 #ifdef SERVER
7601 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7602 GetHierarchyParent().IncreaseLifetimeUp();
7603 #endif
7604 };
7605
7607 {
7608 PlayerBase p = PlayerBase.Cast(player);
7609
7610 array<int> recipesIds = p.m_Recipes;
7611 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7612 if (moduleRecipesManager)
7613 {
7614 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7615 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7616 }
7617
7618 for (int i = 0;i < recipesIds.Count(); i++)
7619 {
7620 int key = recipesIds.Get(i);
7621 string recipeName = moduleRecipesManager.GetRecipeName(key);
7623 }
7624 }
7625
7626
7627 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7628 {
7629 super.GetDebugActions(outputList);
7630
7631
7636
7637
7641
7645
7646
7649
7650
7652 {
7655 }
7656
7658
7661
7665 }
7666
7667
7668
7669
7671 {
7672 super.OnAction(action_id, player, ctx);
7673 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7674 {
7675 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7676 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7677 PlayerBase p = PlayerBase.Cast(player);
7678 if (
EActions.RECIPES_RANGE_START < 1000)
7679 {
7680 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7681 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7682 }
7683 }
7684 #ifndef SERVER
7685 else if (action_id ==
EActions.WATCH_PLAYER)
7686 {
7687 PluginDeveloper.SetDeveloperItemClientEx(player);
7688 }
7689 #endif
7691 {
7692 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7693 {
7694 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7695 OnDebugButtonPressServer(id + 1);
7696 }
7697
7698 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7699 {
7700 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7702 }
7703
7704 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7705 {
7706 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7708 }
7709
7710 else if (action_id ==
EActions.ADD_QUANTITY)
7711 {
7712 if (IsMagazine())
7713 {
7714 Magazine mag = Magazine.Cast(this);
7715 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7716 }
7717 else
7718 {
7720 }
7721
7722 if (m_EM)
7723 {
7724 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7725 }
7726
7727 }
7728
7729 else if (action_id ==
EActions.REMOVE_QUANTITY)
7730 {
7731 if (IsMagazine())
7732 {
7733 Magazine mag2 = Magazine.Cast(this);
7734 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7735 }
7736 else
7737 {
7739 }
7740 if (m_EM)
7741 {
7742 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7743 }
7744
7745 }
7746
7747 else if (action_id ==
EActions.SET_QUANTITY_0)
7748 {
7750
7751 if (m_EM)
7752 {
7753 m_EM.SetEnergy(0);
7754 }
7755 }
7756
7757 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7758 {
7760
7761 if (m_EM)
7762 {
7763 m_EM.SetEnergy(m_EM.GetEnergyMax());
7764 }
7765 }
7766
7767 else if (action_id ==
EActions.ADD_HEALTH)
7768 {
7769 AddHealth("","",GetMaxHealth("","Health")/5);
7770 }
7771 else if (action_id ==
EActions.REMOVE_HEALTH)
7772 {
7773 AddHealth("","",-GetMaxHealth("","Health")/5);
7774 }
7775 else if (action_id ==
EActions.DESTROY_HEALTH)
7776 {
7777 SetHealth01("","",0);
7778 }
7779 else if (action_id ==
EActions.WATCH_ITEM)
7780 {
7782 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7783 #ifdef DEVELOPER
7784 SetDebugDeveloper_item(this);
7785 #endif
7786 }
7787
7788 else if (action_id ==
EActions.ADD_TEMPERATURE)
7789 {
7790 AddTemperature(20);
7791
7792 }
7793
7794 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7795 {
7796 AddTemperature(-20);
7797
7798 }
7799
7800 else if (action_id ==
EActions.FLIP_FROZEN)
7801 {
7802 SetFrozen(!GetIsFrozen());
7803
7804 }
7805
7806 else if (action_id ==
EActions.ADD_WETNESS)
7807 {
7809
7810 }
7811
7812 else if (action_id ==
EActions.REMOVE_WETNESS)
7813 {
7815
7816 }
7817
7818 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7819 {
7822
7823
7824 }
7825
7826 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7827 {
7830 }
7831
7832 else if (action_id ==
EActions.MAKE_SPECIAL)
7833 {
7834 auto debugParams = DebugSpawnParams.WithPlayer(player);
7835 OnDebugSpawnEx(debugParams);
7836 }
7837
7838 else if (action_id ==
EActions.DELETE)
7839 {
7840 Delete();
7841 }
7842
7843 }
7844
7845
7846 return false;
7847 }
7848
7849
7850
7851
7855
7858
7859
7860
7862 {
7863 return false;
7864 }
7865
7866
7868 {
7869 return true;
7870 }
7871
7872
7874 {
7875 return true;
7876 }
7877
7878
7879
7881 {
7882 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7884 }
7885
7888 {
7889 return null;
7890 }
7891
7893 {
7894 return false;
7895 }
7896
7898 {
7899 return false;
7900 }
7901
7905
7906
7908 {
7909 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7910 return module_repairing.CanRepair(this, item_repair_kit);
7911 }
7912
7913
7914 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7915 {
7916 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7917 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7918 }
7919
7920
7922 {
7923
7924
7925
7926
7927
7928
7929
7930
7931 return 1;
7932 }
7933
7934
7935
7937 {
7939 }
7940
7941
7942
7944 {
7946 }
7947
7948
7957 {
7958 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7959
7960 if (player)
7961 {
7962 player.MessageStatus(text);
7963 }
7964 }
7965
7966
7975 {
7976 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7977
7978 if (player)
7979 {
7980 player.MessageAction(text);
7981 }
7982 }
7983
7984
7993 {
7994 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7995
7996 if (player)
7997 {
7998 player.MessageFriendly(text);
7999 }
8000 }
8001
8002
8011 {
8012 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8013
8014 if (player)
8015 {
8016 player.MessageImportant(text);
8017 }
8018 }
8019
8021 {
8022 return true;
8023 }
8024
8025
8026 override bool KindOf(
string tag)
8027 {
8028 bool found = false;
8029 string item_name = this.
GetType();
8032
8033 int array_size = item_tag_array.Count();
8034 for (int i = 0; i < array_size; i++)
8035 {
8036 if (item_tag_array.Get(i) == tag)
8037 {
8038 found = true;
8039 break;
8040 }
8041 }
8042 return found;
8043 }
8044
8045
8047 {
8048
8049 super.OnRPC(sender, rpc_type,ctx);
8050
8051
8052 switch (rpc_type)
8053 {
8054 #ifndef SERVER
8055 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8056 Param2<bool, string> p = new Param2<bool, string>(false, "");
8057
8059 return;
8060
8061 bool play = p.param1;
8062 string soundSet = p.param2;
8063
8064 if (play)
8065 {
8067 {
8069 {
8071 }
8072 }
8073 else
8074 {
8076 }
8077 }
8078 else
8079 {
8081 }
8082
8083 break;
8084 #endif
8085
8086 }
8087
8089 {
8091 }
8092 }
8093
8094
8095
8096
8098 {
8099 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8100 return plugin.GetID(
name);
8101 }
8102
8104 {
8105 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8106 return plugin.GetName(id);
8107 }
8108
8111 {
8112
8113
8114 int varFlags;
8115 if (!ctx.
Read(varFlags))
8116 return;
8117
8118 if (varFlags & ItemVariableFlags.FLOAT)
8119 {
8121 }
8122 }
8123
8125 {
8126
8127 super.SerializeNumericalVars(floats_out);
8128
8129
8130
8132 {
8134 }
8135
8137 {
8139 }
8140
8142 {
8144 }
8145
8147 {
8152 }
8153
8155 {
8157 }
8158 }
8159
8161 {
8162
8163 super.DeSerializeNumericalVars(floats);
8164
8165
8166 int index = 0;
8167 int mask = Math.Round(floats.Get(index));
8168
8169 index++;
8170
8172 {
8174 {
8176 }
8177 else
8178 {
8179 float quantity = floats.Get(index);
8181 }
8182 index++;
8183 }
8184
8186 {
8187 float wet = floats.Get(index);
8189 index++;
8190 }
8191
8193 {
8194 int liquidtype = Math.Round(floats.Get(index));
8196 index++;
8197 }
8198
8200 {
8202 index++;
8204 index++;
8206 index++;
8208 index++;
8209 }
8210
8212 {
8213 int cleanness = Math.Round(floats.Get(index));
8215 index++;
8216 }
8217 }
8218
8220 {
8221 super.WriteVarsToCTX(ctx);
8222
8223
8225 {
8227 }
8228
8230 {
8232 }
8233
8235 {
8237 }
8238
8240 {
8241 int r,g,b,a;
8247 }
8248
8250 {
8252 }
8253 }
8254
8256 {
8257 if (!super.ReadVarsFromCTX(ctx,version))
8258 return false;
8259
8260 int intValue;
8261 float value;
8262
8263 if (version < 140)
8264 {
8265 if (!ctx.
Read(intValue))
8266 return false;
8267
8268 m_VariablesMask = intValue;
8269 }
8270
8272 {
8273 if (!ctx.
Read(value))
8274 return false;
8275
8277 {
8279 }
8280 else
8281 {
8283 }
8284 }
8285
8286 if (version < 140)
8287 {
8289 {
8290 if (!ctx.
Read(value))
8291 return false;
8292 SetTemperatureDirect(value);
8293 }
8294 }
8295
8297 {
8298 if (!ctx.
Read(value))
8299 return false;
8301 }
8302
8304 {
8305 if (!ctx.
Read(intValue))
8306 return false;
8308 }
8309
8311 {
8312 int r,g,b,a;
8314 return false;
8316 return false;
8318 return false;
8320 return false;
8321
8323 }
8324
8326 {
8327 if (!ctx.
Read(intValue))
8328 return false;
8330 }
8331
8332 if (version >= 138 && version < 140)
8333 {
8335 {
8336 if (!ctx.
Read(intValue))
8337 return false;
8338 SetFrozen(intValue);
8339 }
8340 }
8341
8342 return true;
8343 }
8344
8345
8347 {
8350 {
8352 }
8353
8354 if (!super.OnStoreLoad(ctx, version))
8355 {
8357 return false;
8358 }
8359
8360 if (version >= 114)
8361 {
8362 bool hasQuickBarIndexSaved;
8363
8364 if (!ctx.
Read(hasQuickBarIndexSaved))
8365 {
8367 return false;
8368 }
8369
8370 if (hasQuickBarIndexSaved)
8371 {
8372 int itmQBIndex;
8373
8374
8375 if (!ctx.
Read(itmQBIndex))
8376 {
8378 return false;
8379 }
8380
8381 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8382 if (itmQBIndex != -1 && parentPlayer)
8383 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8384 }
8385 }
8386 else
8387 {
8388
8389 PlayerBase player;
8390 int itemQBIndex;
8391 if (version ==
int.
MAX)
8392 {
8393 if (!ctx.
Read(itemQBIndex))
8394 {
8396 return false;
8397 }
8398 }
8399 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8400 {
8401
8402 if (!ctx.
Read(itemQBIndex))
8403 {
8405 return false;
8406 }
8407 if (itemQBIndex != -1 && player)
8408 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8409 }
8410 }
8411
8412 if (version < 140)
8413 {
8414
8415 if (!LoadVariables(ctx, version))
8416 {
8418 return false;
8419 }
8420 }
8421
8422
8424 {
8426 return false;
8427 }
8428 if (version >= 132)
8429 {
8431 if (raib)
8432 {
8434 {
8436 return false;
8437 }
8438 }
8439 }
8440
8442 return true;
8443 }
8444
8445
8446
8448 {
8449 super.OnStoreSave(ctx);
8450
8451 PlayerBase player;
8452 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8453 {
8455
8456 int itemQBIndex = -1;
8457 itemQBIndex = player.FindQuickBarEntityIndex(this);
8458 ctx.
Write(itemQBIndex);
8459 }
8460 else
8461 {
8463 }
8464
8466
8468 if (raib)
8469 {
8471 }
8472 }
8473
8474
8476 {
8477 super.AfterStoreLoad();
8478
8480 {
8482 }
8483
8485 {
8488 }
8489 }
8490
8492 {
8493 super.EEOnAfterLoad();
8494
8496 {
8498 }
8499
8502 }
8503
8505 {
8506 return false;
8507 }
8508
8509
8510
8512 {
8514 {
8515 #ifdef PLATFORM_CONSOLE
8516
8518 {
8520 if (menu)
8521 {
8523 }
8524 }
8525 #endif
8526 }
8527
8529 {
8532 }
8533
8535 {
8536 SetWeightDirty();
8538 }
8540 {
8543 }
8544
8546 {
8549 }
8551 {
8554 }
8555
8556 super.OnVariablesSynchronized();
8557 }
8558
8559
8560
8562 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8563 {
8564 if (!IsServerCheck(allow_client))
8565 return false;
8566
8568 return false;
8569
8572
8573 if (value <= (min + 0.001))
8574 value = min;
8575
8576 if (value == min)
8577 {
8578 if (destroy_config)
8579 {
8580 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8581 if (dstr)
8582 {
8584 this.Delete();
8585 return true;
8586 }
8587 }
8588 else if (destroy_forced)
8589 {
8591 this.Delete();
8592 return true;
8593 }
8594
8596 }
8597
8600
8602 {
8604
8605 if (delta)
8607 }
8608
8610
8611 return false;
8612 }
8613
8614
8616 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8617 {
8619 }
8620
8622 {
8625 }
8626
8628 {
8631 }
8632
8635 {
8636 float value_clamped = Math.Clamp(value, 0, 1);
8638 SetQuantity(result, destroy_config, destroy_forced);
8639 }
8640
8641
8644 {
8646 }
8647
8649 {
8651 }
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8663 {
8664 int slot = -1;
8665 if (GetInventory())
8666 {
8667 InventoryLocation il = new InventoryLocation;
8668 GetInventory().GetCurrentInventoryLocation(il);
8670 }
8671
8673 }
8674
8676 {
8677 float quantity_max = 0;
8678
8680 {
8681 if (attSlotID != -1)
8682 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8683
8684 if (quantity_max <= 0)
8686 }
8687
8688 if (quantity_max <= 0)
8690
8691 return quantity_max;
8692 }
8693
8695 {
8697 }
8698
8700 {
8702 }
8703
8704
8706 {
8708 }
8709
8711 {
8713 }
8714
8716 {
8718 }
8719
8720
8722 {
8723
8724 float weightEx = GetWeightEx();
8725 float special = GetInventoryAndCargoWeight();
8726 return weightEx - special;
8727 }
8728
8729
8731 {
8733 }
8734
8736 {
8738 {
8739 #ifdef DEVELOPER
8740 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8741 {
8742 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8744 }
8745 #endif
8746
8748 }
8749 else if (HasEnergyManager())
8750 {
8751 #ifdef DEVELOPER
8752 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8753 {
8754 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8755 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8756 }
8757 #endif
8758 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8759 }
8760 else
8761 {
8762 #ifdef DEVELOPER
8763 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8764 {
8765 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8766 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8767 }
8768 #endif
8769 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8770 }
8771 }
8772
8775 {
8776 int item_count = 0;
8778
8779 if (GetInventory().GetCargo() != NULL)
8780 {
8781 item_count = GetInventory().GetCargo().GetItemCount();
8782 }
8783
8784 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8785 {
8786 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8787 if (item)
8788 item_count += item.GetNumberOfItems();
8789 }
8790 return item_count;
8791 }
8792
8795 {
8796 float weight = 0;
8797 float wetness = 1;
8798 if (include_wetness)
8801 {
8802 weight = wetness * m_ConfigWeight;
8803 }
8805 {
8806 weight = 1;
8807 }
8808 return weight;
8809 }
8810
8811
8812
8814 {
8815 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8816 {
8817 GameInventory inv = GetInventory();
8818 array<EntityAI> items = new array<EntityAI>;
8820 for (int i = 0; i < items.Count(); i++)
8821 {
8823 if (item)
8824 {
8826 }
8827 }
8828 }
8829 }
8830
8831
8832
8833
8835 {
8836 float energy = 0;
8837 if (HasEnergyManager())
8838 {
8839 energy = GetCompEM().GetEnergy();
8840 }
8841 return energy;
8842 }
8843
8844
8846 {
8847 super.OnEnergyConsumed();
8848
8850 }
8851
8853 {
8854 super.OnEnergyAdded();
8855
8857 }
8858
8859
8861 {
8862 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8863 {
8865 {
8866 float energy_0to1 = GetCompEM().GetEnergy0To1();
8868 }
8869 }
8870 }
8871
8872
8874 {
8875 return ConfigGetFloat("heatIsolation");
8876 }
8877
8879 {
8881 }
8882
8884 {
8885 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8886 if (
GetGame().ConfigIsExisting(paramPath))
8888
8889 return 0.0;
8890 }
8891
8893 {
8894 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8895 if (
GetGame().ConfigIsExisting(paramPath))
8897
8898 return 0.0;
8899 }
8900
8901 override void SetWet(
float value,
bool allow_client =
false)
8902 {
8903 if (!IsServerCheck(allow_client))
8904 return;
8905
8908
8910
8911 m_VarWet = Math.Clamp(value, min, max);
8912
8914 {
8917 }
8918 }
8919
8920 override void AddWet(
float value)
8921 {
8923 }
8924
8926 {
8928 }
8929
8931 {
8933 }
8934
8936 {
8938 }
8939
8941 {
8943 }
8944
8946 {
8948 }
8949
8951 {
8954 if (newLevel != oldLevel)
8955 {
8957 }
8958 }
8959
8961 {
8962 SetWeightDirty();
8963 }
8964
8966 {
8967 return GetWetLevelInternal(
m_VarWet);
8968 }
8969
8970
8971
8973 {
8975 }
8976
8978 {
8980 }
8981
8983 {
8985 }
8986
8988 {
8990 }
8991
8992
8993
8995 {
8996 if (ConfigIsExisting("itemModelLength"))
8997 {
8998 return ConfigGetFloat("itemModelLength");
8999 }
9000 return 0;
9001 }
9002
9004 {
9005 if (ConfigIsExisting("itemAttachOffset"))
9006 {
9007 return ConfigGetFloat("itemAttachOffset");
9008 }
9009 return 0;
9010 }
9011
9012 override void SetCleanness(
int value,
bool allow_client =
false)
9013 {
9014 if (!IsServerCheck(allow_client))
9015 return;
9016
9018
9020
9023 }
9024
9026 {
9028 }
9029
9031 {
9032 return true;
9033 }
9034
9035
9036
9037
9039 {
9041 }
9042
9044 {
9046 }
9047
9048
9049
9050
9051 override void SetColor(
int r,
int g,
int b,
int a)
9052 {
9058 }
9060 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9061 {
9066 }
9067
9069 {
9071 }
9072
9075 {
9076 int r,g,b,a;
9078 r = r/255;
9079 g = g/255;
9080 b = b/255;
9081 a = a/255;
9082 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9083 }
9084
9085
9086
9087 override void SetLiquidType(
int value,
bool allow_client =
false)
9088 {
9089 if (!IsServerCheck(allow_client))
9090 return;
9091
9096 }
9097
9099 {
9100 return ConfigGetInt("varLiquidTypeInit");
9101 }
9102
9104 {
9106 }
9107
9109 {
9111 SetFrozen(false);
9112 }
9113
9116 {
9117 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9118 }
9119
9120
9123 {
9124 PlayerBase nplayer;
9125 if (PlayerBase.CastTo(nplayer, player))
9126 {
9128
9129 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9130 }
9131 }
9132
9133
9136 {
9137 PlayerBase nplayer;
9138 if (PlayerBase.CastTo(nplayer,player))
9139 {
9140
9141 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9142
9143 }
9144
9145
9146 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9147
9148
9149 if (HasEnergyManager())
9150 {
9151 GetCompEM().UpdatePlugState();
9152 }
9153 }
9154
9155
9157 {
9158 super.OnPlacementStarted(player);
9159
9161 }
9162
9163 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9164 {
9166 {
9167 m_AdminLog.OnPlacementComplete(player,
this);
9168 }
9169
9170 super.OnPlacementComplete(player, position, orientation);
9171 }
9172
9173
9174
9175
9176
9178 {
9180 {
9181 return true;
9182 }
9183 else
9184 {
9185 return false;
9186 }
9187 }
9188
9189
9191 {
9193 {
9195 }
9196 }
9197
9198
9200 {
9202 }
9203
9205 {
9207 }
9208
9209 override void InsertAgent(
int agent,
float count = 1)
9210 {
9211 if (count < 1)
9212 return;
9213
9215 }
9216
9219 {
9221 }
9222
9223
9225 {
9227 }
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9271 {
9273 return false;
9274 return true;
9275 }
9276
9278 {
9279
9281 }
9282
9283
9286 {
9287 super.CheckForRoofLimited(timeTresholdMS);
9288
9290 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9291 {
9292 m_PreviousRoofTestTime = time;
9293 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9294 }
9295 }
9296
9297
9299 {
9301 {
9302 return 0;
9303 }
9304
9305 if (GetInventory().GetAttachmentSlotsCount() != 0)
9306 {
9307 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9308 if (filter)
9309 return filter.GetProtectionLevel(type, false, system);
9310 else
9311 return 0;
9312 }
9313
9314 string subclassPath, entryName;
9315
9316 switch (type)
9317 {
9319 entryName = "biological";
9320 break;
9322 entryName = "chemical";
9323 break;
9324 default:
9325 entryName = "biological";
9326 break;
9327 }
9328
9329 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9330
9332 }
9333
9334
9335
9338 {
9339 if (!IsMagazine())
9341
9343 }
9344
9345
9346
9347
9348
9353 {
9354 return true;
9355 }
9356
9358 {
9360 }
9361
9362
9363
9364
9365
9367 {
9368 if (parent)
9369 {
9370 if (parent.IsInherited(DayZInfected))
9371 return true;
9372
9373 if (!parent.IsRuined())
9374 return true;
9375 }
9376
9377 return true;
9378 }
9379
9381 {
9382 if (!super.CanPutAsAttachment(parent))
9383 {
9384 return false;
9385 }
9386
9387 if (!IsRuined() && !parent.IsRuined())
9388 {
9389 return true;
9390 }
9391
9392 return false;
9393 }
9394
9396 {
9397
9398
9399
9400
9401 return super.CanReceiveItemIntoCargo(item);
9402 }
9403
9405 {
9406
9407
9408
9409
9410 GameInventory attachmentInv = attachment.GetInventory();
9412 {
9413 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9414 return false;
9415 }
9416
9417 InventoryLocation loc = new InventoryLocation();
9418 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9419 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9420 return false;
9421
9422 return super.CanReceiveAttachment(attachment, slotId);
9423 }
9424
9426 {
9427 if (!super.CanReleaseAttachment(attachment))
9428 return false;
9429
9430 return GetInventory().AreChildrenAccessible();
9431 }
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9454 {
9455 int id = muzzle_owner.GetMuzzleID();
9456 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9457
9458 if (WPOF_array)
9459 {
9460 for (int i = 0; i < WPOF_array.Count(); i++)
9461 {
9462 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9463
9464 if (WPOF)
9465 {
9466 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9467 }
9468 }
9469 }
9470 }
9471
9472
9474 {
9475 int id = muzzle_owner.GetMuzzleID();
9477
9478 if (WPOBE_array)
9479 {
9480 for (int i = 0; i < WPOBE_array.Count(); i++)
9481 {
9482 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9483
9484 if (WPOBE)
9485 {
9486 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9487 }
9488 }
9489 }
9490 }
9491
9492
9494 {
9495 int id = muzzle_owner.GetMuzzleID();
9496 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9497
9498 if (WPOOH_array)
9499 {
9500 for (int i = 0; i < WPOOH_array.Count(); i++)
9501 {
9502 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9503
9504 if (WPOOH)
9505 {
9506 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9507 }
9508 }
9509 }
9510 }
9511
9512
9514 {
9515 int id = muzzle_owner.GetMuzzleID();
9516 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9517
9518 if (WPOOH_array)
9519 {
9520 for (int i = 0; i < WPOOH_array.Count(); i++)
9521 {
9522 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9523
9524 if (WPOOH)
9525 {
9526 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9527 }
9528 }
9529 }
9530 }
9531
9532
9534 {
9535 int id = muzzle_owner.GetMuzzleID();
9536 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9537
9538 if (WPOOH_array)
9539 {
9540 for (int i = 0; i < WPOOH_array.Count(); i++)
9541 {
9542 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9543
9544 if (WPOOH)
9545 {
9546 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9547 }
9548 }
9549 }
9550 }
9551
9552
9553
9555 {
9557 {
9558 return true;
9559 }
9560
9561 return false;
9562 }
9563
9565 {
9567 {
9568 return true;
9569 }
9570
9571 return false;
9572 }
9573
9575 {
9577 {
9578 return true;
9579 }
9580
9581 return false;
9582 }
9583
9585 {
9586 return false;
9587 }
9588
9591 {
9592 return UATimeSpent.DEFAULT_DEPLOY;
9593 }
9594
9595
9596
9597
9599 {
9601 SetSynchDirty();
9602 }
9603
9605 {
9607 }
9608
9609
9611 {
9612 return false;
9613 }
9614
9617 {
9618 string att_type = "None";
9619
9620 if (ConfigIsExisting("soundAttType"))
9621 {
9622 att_type = ConfigGetString("soundAttType");
9623 }
9624
9626 }
9627
9629 {
9631 }
9632
9633
9634
9635
9636
9640
9642 {
9645
9647 }
9648
9649
9651 {
9653 return;
9654
9656
9659
9662
9663 SoundParameters params = new SoundParameters();
9667 }
9668
9669
9671 {
9673 return;
9674
9676 SetSynchDirty();
9677
9680 }
9681
9682
9684 {
9686 return;
9687
9689 SetSynchDirty();
9690
9693 }
9694
9696 {
9698 }
9699
9701 {
9703 }
9704
9707 {
9708 if (!
GetGame().IsDedicatedServer())
9709 {
9710 if (ConfigIsExisting("attachSoundSet"))
9711 {
9712 string cfg_path = "";
9713 string soundset = "";
9715
9718 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9719 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9720
9721 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9722 {
9723 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9724 {
9725 if (cfg_slot_array[i] == slot_type)
9726 {
9727 soundset = cfg_soundset_array[i];
9728 break;
9729 }
9730 }
9731 }
9732
9733 if (soundset != "")
9734 {
9735 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9737 }
9738 }
9739 }
9740 }
9741
9743 {
9744
9745 }
9746
9747 void OnApply(PlayerBase player);
9748
9750 {
9751 return 1.0;
9752 };
9753
9755 {
9757 }
9758
9760 {
9762 }
9763
9765
9767 {
9768 SetDynamicPhysicsLifeTime(0.01);
9770 }
9771
9773 {
9774 array<string> zone_names = new array<string>;
9775 GetDamageZones(zone_names);
9776 for (int i = 0; i < zone_names.Count(); i++)
9777 {
9778 SetHealthMax(zone_names.Get(i),"Health");
9779 }
9780 SetHealthMax("","Health");
9781 }
9782
9785 {
9786 float global_health = GetHealth01("","Health");
9787 array<string> zones = new array<string>;
9788 GetDamageZones(zones);
9789
9790 for (int i = 0; i < zones.Count(); i++)
9791 {
9792 SetHealth01(zones.Get(i),"Health",global_health);
9793 }
9794 }
9795
9798 {
9799 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9800 }
9801
9803 {
9804 if (!hasRootAsPlayer)
9805 {
9806 if (refParentIB)
9807 {
9808
9809 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9810 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9811
9812 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9813 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9814
9817 }
9818 else
9819 {
9820
9823 }
9824 }
9825 }
9826
9828 {
9830 {
9831 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9832 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9833 {
9834 float heatPermCoef = 1.0;
9836 while (ent)
9837 {
9838 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9839 ent = ent.GetHierarchyParent();
9840 }
9841
9842 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9843 }
9844 }
9845 }
9846
9848 {
9849
9850 EntityAI parent = GetHierarchyParent();
9851 if (!parent)
9852 {
9853 hasParent = false;
9854 hasRootAsPlayer = false;
9855 }
9856 else
9857 {
9858 hasParent = true;
9859 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9860 refParentIB =
ItemBase.Cast(parent);
9861 }
9862 }
9863
9864 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9865 {
9866
9867 }
9868
9870 {
9871
9872 return false;
9873 }
9874
9876 {
9877
9878
9879 return false;
9880 }
9881
9883 {
9884
9885 return false;
9886 }
9887
9890 {
9891 return !GetIsFrozen() &&
IsOpen();
9892 }
9893
9895 {
9896 bool hasParent = false, hasRootAsPlayer = false;
9898
9899 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9900 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9901
9902 if (wwtu || foodDecay)
9903 {
9907
9908 if (processWetness || processTemperature || processDecay)
9909 {
9911
9912 if (processWetness)
9913 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9914
9915 if (processTemperature)
9917
9918 if (processDecay)
9919 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9920 }
9921 }
9922 }
9923
9926 {
9928 }
9929
9931 {
9934
9935 return super.GetTemperatureFreezeThreshold();
9936 }
9937
9939 {
9942
9943 return super.GetTemperatureThawThreshold();
9944 }
9945
9947 {
9950
9951 return super.GetItemOverheatThreshold();
9952 }
9953
9955 {
9957 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9958
9959 return super.GetTemperatureFreezeTime();
9960 }
9961
9963 {
9965 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9966
9967 return super.GetTemperatureThawTime();
9968 }
9969
9974
9976 {
9977 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
9978 }
9979
9981 {
9982 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
9983 }
9984
9987 {
9989 }
9990
9992 {
9994 }
9995
9997 {
9999 }
10000
10003 {
10004 return null;
10005 }
10006
10009 {
10010 return false;
10011 }
10012
10014 {
10016 {
10019 if (!trg)
10020 {
10022 explosive = this;
10023 }
10024
10025 explosive.PairRemote(trg);
10027
10028 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10029 trg.SetPersistentPairID(persistentID);
10030 explosive.SetPersistentPairID(persistentID);
10031
10032 return true;
10033 }
10034 return false;
10035 }
10036
10039 {
10040 float ret = 1.0;
10043 ret *= GetHealth01();
10044
10045 return ret;
10046 }
10047
10048 #ifdef DEVELOPER
10049 override void SetDebugItem()
10050 {
10051 super.SetDebugItem();
10052 _itemBase = this;
10053 }
10054
10056 {
10057 string text = super.GetDebugText();
10058
10060 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10061
10062 return text;
10063 }
10064 #endif
10065
10067 {
10068 return true;
10069 }
10070
10072
10074
10076 {
10079 }
10080
10081
10089
10105}
10106
10108{
10110 if (entity)
10111 {
10112 bool is_item = entity.IsInherited(
ItemBase);
10113 if (is_item && full_quantity)
10114 {
10117 }
10118 }
10119 else
10120 {
10122 return NULL;
10123 }
10124 return entity;
10125}
10126
10128{
10129 if (item)
10130 {
10131 if (health > 0)
10132 item.SetHealth("", "", health);
10133
10134 if (item.CanHaveTemperature())
10135 {
10137 if (item.CanFreeze())
10138 item.SetFrozen(false);
10139 }
10140
10141 if (item.HasEnergyManager())
10142 {
10143 if (quantity >= 0)
10144 {
10145 item.GetCompEM().SetEnergy0To1(quantity);
10146 }
10147 else
10148 {
10150 }
10151 }
10152 else if (item.IsMagazine())
10153 {
10154 Magazine mag = Magazine.Cast(item);
10155 if (quantity >= 0)
10156 {
10157 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10158 }
10159 else
10160 {
10162 }
10163
10164 }
10165 else
10166 {
10167 if (quantity >= 0)
10168 {
10169 item.SetQuantityNormalized(quantity, false);
10170 }
10171 else
10172 {
10174 }
10175
10176 }
10177 }
10178}
10179
10180#ifdef DEVELOPER
10182#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.