5358{
5360 {
5361 return true;
5362 }
5363};
5364
5365
5366
5368{
5372
5374
5377
5378
5379
5380
5381
5390
5396
5401
5406
5427 protected bool m_IsResultOfSplit
5428
5430
5435
5436
5437
5439
5443
5444
5445
5447
5450
5451
5452
5458
5459
5467
5470
5471
5473
5474
5476
5477
5482
5483
5488
5489
5491
5492
5494 {
5499
5500 if (!
GetGame().IsDedicatedServer())
5501 {
5503 {
5505
5507 {
5509 }
5510 }
5511
5514 }
5515
5516 m_OldLocation = null;
5517
5519 {
5521 }
5522
5523 if (ConfigIsExisting("headSelectionsToHide"))
5524 {
5527 }
5528
5530 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5531 {
5533 }
5534
5536
5537 m_IsResultOfSplit = false;
5538
5540 }
5541
5543 {
5544 super.InitItemVariables();
5545
5551 m_Count = ConfigGetInt(
"count");
5552
5555
5560
5563
5568
5580
5584
5585
5588 if (ConfigIsExisting("canBeSplit"))
5589 {
5592 }
5593
5595 if (ConfigIsExisting("itemBehaviour"))
5597
5598
5601 RegisterNetSyncVariableInt("m_VarLiquidType");
5602 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5603
5604 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5605 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5606 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5607
5608 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5609 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5610 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5611 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5612
5613 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5614 RegisterNetSyncVariableBool("m_IsTakeable");
5615 RegisterNetSyncVariableBool("m_IsHologram");
5616
5619 {
5622 }
5623
5625
5627 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5629
5630 }
5631
5633 {
5635 }
5636
5638 {
5641 {
5646 }
5647 }
5648
5649 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5650 {
5652 {
5655 }
5656
5658 }
5659
5661 {
5667 }
5668
5670
5672 {
5674
5675 if (!action)
5676 {
5677 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5678 return;
5679 }
5680
5682 if (!ai)
5683 {
5685 return;
5686 }
5687
5689 if (!action_array)
5690 {
5691 action_array = new array<ActionBase_Basic>;
5693 }
5694 if (LogManager.IsActionLogEnable())
5695 {
5696 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5697 }
5698
5699 if (action_array.Find(action) != -1)
5700 {
5701 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5702 }
5703 else
5704 {
5705 action_array.Insert(action);
5706 }
5707 }
5708
5710 {
5712 ActionBase action = player.GetActionManager().GetAction(actionName);
5715
5716 if (action_array)
5717 {
5718 action_array.RemoveItem(action);
5719 }
5720 }
5721
5722
5723
5725 {
5726 ActionOverrideData overrideData = new ActionOverrideData();
5730
5732 if (!actionMap)
5733 {
5736 }
5737
5738 actionMap.Insert(this.
Type(), overrideData);
5739
5740 }
5741
5743
5745
5746
5748 {
5751
5754
5755 string config_to_search = "CfgVehicles";
5756 string muzzle_owner_config;
5757
5759 {
5760 if (IsInherited(Weapon))
5761 config_to_search = "CfgWeapons";
5762
5763 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5764
5765 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5766
5768
5769 if (config_OnFire_subclass_count > 0)
5770 {
5771 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5772
5773 for (int i = 0; i < config_OnFire_subclass_count; i++)
5774 {
5775 string particle_class = "";
5777 string config_OnFire_entry = config_OnFire_class + particle_class;
5778 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5779 WPOF_array.Insert(WPOF);
5780 }
5781
5782
5784 }
5785 }
5786
5788 {
5789 config_to_search = "CfgWeapons";
5790 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5791
5792 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5793
5795
5796 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5797 {
5798 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5799
5800 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5801 {
5802 string particle_class2 = "";
5804 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5805 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5806 WPOBE_array.Insert(WPOBE);
5807 }
5808
5809
5811 }
5812 }
5813 }
5814
5815
5817 {
5820
5822 {
5823 string config_to_search = "CfgVehicles";
5824
5825 if (IsInherited(Weapon))
5826 config_to_search = "CfgWeapons";
5827
5828 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5829 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5830
5831 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5832 {
5833
5835
5837 {
5839 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5841 return;
5842 }
5843
5846
5847
5848
5850 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5851
5852 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5853 {
5854 string particle_class = "";
5856 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5858
5859 if (entry_type == CT_CLASS)
5860 {
5861 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5862 WPOOH_array.Insert(WPOF);
5863 }
5864 }
5865
5866
5868 }
5869 }
5870 }
5871
5873 {
5875 }
5876
5878 {
5880 {
5882
5885
5888
5889 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5890 }
5891 }
5892
5894 {
5896 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5897
5899 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5900
5902 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5903
5905 {
5907 }
5908 }
5909
5911 {
5913 }
5914
5916 {
5919 else
5921
5923 {
5926 }
5927 else
5928 {
5931
5934 }
5935
5937 }
5938
5940 {
5942 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5943 }
5944
5946 {
5948 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5950 }
5951
5953 {
5955 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5956 }
5957
5959 {
5962
5963 OverheatingParticle OP = new OverheatingParticle();
5968
5970 }
5971
5973 {
5976
5977 return -1;
5978 }
5979
5981 {
5983 {
5986
5987 for (int i = count; i > 0; --i)
5988 {
5989 int id = i - 1;
5992
5995
5996 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5997 {
5998 if (p)
5999 {
6002 }
6003 }
6004 }
6005 }
6006 }
6007
6009 {
6011 {
6013 {
6014 int id = i - 1;
6016
6017 if (OP)
6018 {
6020
6021 if (p)
6022 {
6024 }
6025
6026 delete OP;
6027 }
6028 }
6029
6032 }
6033 }
6034
6037 {
6038 return 0.0;
6039 }
6040
6041
6043 {
6044 return 250;
6045 }
6046
6048 {
6049 return 0;
6050 }
6051
6054 {
6056 return true;
6057
6058 return false;
6059 }
6060
6063 {
6066
6068 {
6070 }
6071 else
6072 {
6073
6075 }
6076
6078 }
6079
6086 {
6087 return -1;
6088 }
6089
6090
6091
6092
6094 {
6096 {
6098 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6099
6100 if (r_index >= 0)
6101 {
6102 InventoryLocation r_il = new InventoryLocation;
6103 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6104
6105 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6108 {
6109 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6110 }
6112 {
6113 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6114 }
6115
6116 }
6117
6118 player.GetHumanInventory().ClearUserReservedLocation(this);
6119 }
6120
6123 }
6124
6125
6126
6127
6129 {
6130 return ItemBase.m_DebugActionsMask;
6131 }
6132
6134 {
6135 return ItemBase.m_DebugActionsMask & mask;
6136 }
6137
6139 {
6140 ItemBase.m_DebugActionsMask = mask;
6141 }
6142
6144 {
6145 ItemBase.m_DebugActionsMask |= mask;
6146 }
6147
6149 {
6150 ItemBase.m_DebugActionsMask &= ~mask;
6151 }
6152
6154 {
6156 {
6158 }
6159 else
6160 {
6162 }
6163 }
6164
6165
6167 {
6168 if (GetEconomyProfile())
6169 {
6170 float q_max = GetEconomyProfile().GetQuantityMax();
6171 if (q_max > 0)
6172 {
6173 float q_min = GetEconomyProfile().GetQuantityMin();
6174 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6175
6177 {
6178 ComponentEnergyManager comp = GetCompEM();
6180 {
6182 }
6183 }
6185 {
6187
6188 }
6189
6190 }
6191 }
6192 }
6193
6196 {
6197 EntityAI parent = GetHierarchyParent();
6198
6199 if (parent)
6200 {
6201 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6202 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6203 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6204 }
6205 }
6206
6209 {
6210 EntityAI parent = GetHierarchyParent();
6211
6212 if (parent)
6213 {
6214 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6215 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6216 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6217 }
6218 }
6219
6221 {
6222
6223
6224
6225
6227
6229 {
6230 if (ScriptInputUserData.CanStoreInputUserData())
6231 {
6232 ScriptInputUserData ctx = new ScriptInputUserData;
6238 ctx.
Write(use_stack_max);
6241
6243 {
6244 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6245 }
6246 }
6247 }
6248 else if (!
GetGame().IsMultiplayer())
6249 {
6251 }
6252 }
6253
6255 {
6257 }
6258
6260 {
6262 }
6263
6265 {
6267 }
6268
6270 {
6271
6272 return false;
6273 }
6274
6276 {
6277 return false;
6278 }
6279
6283 {
6284 return false;
6285 }
6286
6288 {
6289 return "";
6290 }
6291
6293
6295 {
6296 return false;
6297 }
6298
6300 {
6301 return true;
6302 }
6303
6304
6305
6307 {
6308 return true;
6309 }
6310
6312 {
6313 return true;
6314 }
6315
6317 {
6318 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6320 }
6321
6323 {
6325 }
6326
6328 {
6330 if (!is_being_placed)
6332 SetSynchDirty();
6333 }
6334
6335
6337
6339 {
6341 }
6342
6344 {
6346 }
6347
6349 {
6350 return 1;
6351 }
6352
6354 {
6355 return false;
6356 }
6357
6359 {
6361 SetSynchDirty();
6362 }
6363
6364
6365
6366
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
6399 {
6400 super.OnMovedInsideCargo(container);
6401
6402 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6403 }
6404
6405 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6406 {
6407 super.EEItemLocationChanged(oldLoc,newLoc);
6408
6409 PlayerBase new_player = null;
6410 PlayerBase old_player = null;
6411
6412 if (newLoc.GetParent())
6413 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6414
6415 if (oldLoc.GetParent())
6416 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6417
6419 {
6420 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6421
6422 if (r_index >= 0)
6423 {
6424 InventoryLocation r_il = new InventoryLocation;
6425 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6426
6427 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6430 {
6431 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6432 }
6434 {
6435 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6436 }
6437
6438 }
6439 }
6440
6442 {
6443 if (new_player)
6444 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6445
6446 if (new_player == old_player)
6447 {
6448
6449 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6450 {
6452 {
6453 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6454 {
6455 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6456 }
6457 }
6458 else
6459 {
6460 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6461 }
6462 }
6463
6464 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6465 {
6466 int type = oldLoc.GetType();
6468 {
6469 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6470 }
6472 {
6473 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6474 }
6475 }
6476 if (!m_OldLocation)
6477 {
6478 m_OldLocation = new InventoryLocation;
6479 }
6480 m_OldLocation.Copy(oldLoc);
6481 }
6482 else
6483 {
6484 if (m_OldLocation)
6485 {
6486 m_OldLocation.Reset();
6487 }
6488 }
6489
6491 }
6492 else
6493 {
6494 if (new_player)
6495 {
6496 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6497 if (res_index >= 0)
6498 {
6499 InventoryLocation il = new InventoryLocation;
6500 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6502 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6505 {
6506 il.
GetParent().GetOnReleaseLock().Invoke(it);
6507 }
6509 {
6511 }
6512
6513 }
6514 }
6516 {
6517
6519 }
6520
6521 if (m_OldLocation)
6522 {
6523 m_OldLocation.Reset();
6524 }
6525 }
6526 }
6527
6528 override void EOnContact(IEntity other, Contact extra)
6529 {
6531 {
6532 int liquidType = -1;
6534 if (impactSpeed > 0.0)
6535 {
6537 #ifndef SERVER
6539 #else
6541 SetSynchDirty();
6542 #endif
6544 }
6545 }
6546
6547 #ifdef SERVER
6548 if (GetCompEM() && GetCompEM().IsPlugged())
6549 {
6550 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6551 GetCompEM().UnplugThis();
6552 }
6553 #endif
6554 }
6555
6557
6559 {
6561 }
6562
6564 {
6565
6566 }
6567
6569 {
6570 super.OnItemLocationChanged(old_owner, new_owner);
6571
6572 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6573 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6574
6575 if (!relatedPlayer && playerNew)
6576 relatedPlayer = playerNew;
6577
6578 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6579 {
6581 if (actionMgr)
6582 {
6583 ActionBase currentAction = actionMgr.GetRunningAction();
6584 if (currentAction)
6586 }
6587 }
6588
6589 Man ownerPlayerOld = null;
6590 Man ownerPlayerNew = null;
6591
6592 if (old_owner)
6593 {
6594 if (old_owner.
IsMan())
6595 {
6596 ownerPlayerOld = Man.Cast(old_owner);
6597 }
6598 else
6599 {
6600 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6601 }
6602 }
6603 else
6604 {
6606 {
6608
6609 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6610 {
6611 GetCompEM().UnplugThis();
6612 }
6613 }
6614 }
6615
6616 if (new_owner)
6617 {
6618 if (new_owner.
IsMan())
6619 {
6620 ownerPlayerNew = Man.Cast(new_owner);
6621 }
6622 else
6623 {
6624 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6625 }
6626 }
6627
6628 if (ownerPlayerOld != ownerPlayerNew)
6629 {
6630 if (ownerPlayerOld)
6631 {
6632 array<EntityAI> subItemsExit = new array<EntityAI>;
6634 for (int i = 0; i < subItemsExit.Count(); i++)
6635 {
6638 }
6639 }
6640
6641 if (ownerPlayerNew)
6642 {
6643 array<EntityAI> subItemsEnter = new array<EntityAI>;
6645 for (int j = 0; j < subItemsEnter.Count(); j++)
6646 {
6649 }
6650 }
6651 }
6652 else if (ownerPlayerNew != null)
6653 {
6654 PlayerBase nplayer;
6655 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6656 {
6657 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6659 for (int k = 0; k < subItemsUpdate.Count(); k++)
6660 {
6662 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6663 }
6664 }
6665 }
6666
6667 if (old_owner)
6668 old_owner.OnChildItemRemoved(this);
6669 if (new_owner)
6670 new_owner.OnChildItemReceived(this);
6671 }
6672
6673
6675 {
6676 super.EEDelete(parent);
6677 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6678 if (player)
6679 {
6681
6682 if (player.IsAlive())
6683 {
6684 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6685 if (r_index >= 0)
6686 {
6687 InventoryLocation r_il = new InventoryLocation;
6688 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6689
6690 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6693 {
6694 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6695 }
6697 {
6698 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6699 }
6700
6701 }
6702
6703 player.RemoveQuickBarEntityShortcut(this);
6704 }
6705 }
6706 }
6707
6709 {
6710 super.EEKilled(killer);
6711
6714 {
6715 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6716 {
6717 if (IsMagazine())
6718 {
6719 if (Magazine.Cast(this).GetAmmoCount() > 0)
6720 {
6722 }
6723 }
6724 else
6725 {
6727 }
6728 }
6729 }
6730 }
6731
6733 {
6734 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6735
6736 super.OnWasAttached(parent, slot_id);
6737
6740
6742 }
6743
6745 {
6746 super.OnWasDetached(parent, slot_id);
6747
6750 }
6751
6753 {
6754 int idx;
6757
6758 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6759 if (inventory_slots.Count() < 1)
6760 {
6761 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6762 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6763 }
6764 else
6765 {
6766 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6767 }
6768
6769 idx = inventory_slots.Find(slot);
6770 if (idx < 0)
6771 return "";
6772
6773 return attach_types.Get(idx);
6774 }
6775
6777 {
6778 int idx = -1;
6779 string slot;
6780
6783
6784 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6785 if (inventory_slots.Count() < 1)
6786 {
6787 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6788 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6789 }
6790 else
6791 {
6792 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6793 if (detach_types.Count() < 1)
6794 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6795 }
6796
6797 for (int i = 0; i < inventory_slots.Count(); i++)
6798 {
6799 slot = inventory_slots.Get(i);
6800 }
6801
6802 if (slot != "")
6803 {
6804 if (detach_types.Count() == 1)
6805 idx = 0;
6806 else
6807 idx = inventory_slots.Find(slot);
6808 }
6809 if (idx < 0)
6810 return "";
6811
6812 return detach_types.Get(idx);
6813 }
6814
6816 {
6817
6819
6820
6821 float min_time = 1;
6822 float max_time = 3;
6823 float delay = Math.RandomFloat(min_time, max_time);
6824
6825 explode_timer.Run(delay, this, "DoAmmoExplosion");
6826 }
6827
6829 {
6830 Magazine magazine = Magazine.Cast(this);
6831 int pop_sounds_count = 6;
6832 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6833
6834
6835 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6836 string sound_name = pop_sounds[ sound_idx ];
6838
6839
6840 magazine.ServerAddAmmoCount(-1);
6841
6842
6843 float min_temp_to_explode = 100;
6844
6845 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6846 {
6848 }
6849 }
6850
6851
6852 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6853 {
6854 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6855
6856 const int CHANCE_DAMAGE_CARGO = 4;
6857 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6858 const int CHANCE_DAMAGE_NOTHING = 2;
6859
6861 {
6862 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6863 int chances;
6864 int rnd;
6865
6866 if (GetInventory().GetCargo())
6867 {
6868 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6869 rnd = Math.RandomInt(0,chances);
6870
6871 if (rnd < CHANCE_DAMAGE_CARGO)
6872 {
6874 }
6875 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6876 {
6878 }
6879 }
6880 else
6881 {
6882 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6883 rnd = Math.RandomInt(0,chances);
6884
6885 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6886 {
6888 }
6889 }
6890 }
6891 }
6892
6894 {
6895 if (GetInventory().GetCargo())
6896 {
6897 int item_count = GetInventory().GetCargo().GetItemCount();
6898 if (item_count > 0)
6899 {
6900 int random_pick = Math.RandomInt(0, item_count);
6902 if (!item.IsExplosive())
6903 {
6904 item.AddHealth("","",damage);
6905 return true;
6906 }
6907 }
6908 }
6909 return false;
6910 }
6911
6913 {
6914 int attachment_count = GetInventory().AttachmentCount();
6915 if (attachment_count > 0)
6916 {
6917 int random_pick = Math.RandomInt(0, attachment_count);
6918 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6919 if (!attachment.IsExplosive())
6920 {
6921 attachment.AddHealth("","",damage);
6922 return true;
6923 }
6924 }
6925 return false;
6926 }
6927
6929 {
6931 }
6932
6934 {
6936 return GetInventory().CanRemoveEntity();
6937
6938 return false;
6939 }
6940
6942 {
6944 return;
6945
6947 {
6948 if (ScriptInputUserData.CanStoreInputUserData())
6949 {
6950 ScriptInputUserData ctx = new ScriptInputUserData;
6955 ctx.
Write(destination_entity);
6959 }
6960 }
6961 else if (!
GetGame().IsMultiplayer())
6962 {
6964 }
6965 }
6966
6968 {
6970 return;
6971
6972 float split_quantity_new;
6976 InventoryLocation loc = new InventoryLocation;
6977
6978 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6979 {
6981 split_quantity_new = stack_max;
6982 else
6984
6985 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6986 if (new_item)
6987 {
6988 new_item.SetResultOfSplit(true);
6989 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6991 new_item.SetQuantity(split_quantity_new);
6992 }
6993 }
6994 else if (destination_entity && slot_id == -1)
6995 {
6996 if (quantity > stack_max)
6997 split_quantity_new = stack_max;
6998 else
6999 split_quantity_new = quantity;
7000
7002 {
7005 }
7006
7007 if (new_item)
7008 {
7009 new_item.SetResultOfSplit(true);
7010 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7012 new_item.SetQuantity(split_quantity_new);
7013 }
7014 }
7015 else
7016 {
7017 if (stack_max != 0)
7018 {
7020 {
7022 }
7023
7024 if (split_quantity_new == 0)
7025 {
7026 if (!
GetGame().IsMultiplayer())
7027 player.PhysicalPredictiveDropItem(this);
7028 else
7029 player.ServerDropEntity(this);
7030 return;
7031 }
7032
7034
7035 if (new_item)
7036 {
7037 new_item.SetResultOfSplit(true);
7038 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7040 new_item.SetQuantity(stack_max);
7041 new_item.PlaceOnSurface();
7042 }
7043 }
7044 }
7045 }
7046
7048 {
7050 return;
7051
7052 float split_quantity_new;
7056 InventoryLocation loc = new InventoryLocation;
7057
7058 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7059 {
7061 split_quantity_new = stack_max;
7062 else
7064
7065 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7066 if (new_item)
7067 {
7068 new_item.SetResultOfSplit(true);
7069 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7071 new_item.SetQuantity(split_quantity_new);
7072 }
7073 }
7074 else if (destination_entity && slot_id == -1)
7075 {
7076 if (quantity > stack_max)
7077 split_quantity_new = stack_max;
7078 else
7079 split_quantity_new = quantity;
7080
7082 {
7085 }
7086
7087 if (new_item)
7088 {
7089 new_item.SetResultOfSplit(true);
7090 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7092 new_item.SetQuantity(split_quantity_new);
7093 }
7094 }
7095 else
7096 {
7097 if (stack_max != 0)
7098 {
7100 {
7102 }
7103
7105
7106 if (new_item)
7107 {
7108 new_item.SetResultOfSplit(true);
7109 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7111 new_item.SetQuantity(stack_max);
7112 new_item.PlaceOnSurface();
7113 }
7114 }
7115 }
7116 }
7117
7119 {
7121 return;
7122
7124 {
7125 if (ScriptInputUserData.CanStoreInputUserData())
7126 {
7127 ScriptInputUserData ctx = new ScriptInputUserData;
7132 dst.WriteToContext(ctx);
7134 }
7135 }
7136 else if (!
GetGame().IsMultiplayer())
7137 {
7139 }
7140 }
7141
7143 {
7145 return;
7146
7148 {
7149 if (ScriptInputUserData.CanStoreInputUserData())
7150 {
7151 ScriptInputUserData ctx = new ScriptInputUserData;
7156 ctx.
Write(destination_entity);
7162 }
7163 }
7164 else if (!
GetGame().IsMultiplayer())
7165 {
7167 }
7168 }
7169
7171 {
7173 }
7174
7176 {
7178 return this;
7179
7181 float split_quantity_new;
7183 if (dst.IsValid())
7184 {
7185 int slot_id = dst.GetSlot();
7187
7188 if (quantity > stack_max)
7189 split_quantity_new = stack_max;
7190 else
7191 split_quantity_new = quantity;
7192
7194
7195 if (new_item)
7196 {
7197 new_item.SetResultOfSplit(true);
7198 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7201 }
7202
7203 return new_item;
7204 }
7205
7206 return null;
7207 }
7208
7210 {
7212 return;
7213
7215 float split_quantity_new;
7217 if (destination_entity)
7218 {
7220 if (quantity > stackable)
7221 split_quantity_new = stackable;
7222 else
7223 split_quantity_new = quantity;
7224
7225 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7226 if (new_item)
7227 {
7228 new_item.SetResultOfSplit(true);
7229 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7231 new_item.SetQuantity(split_quantity_new);
7232 }
7233 }
7234 }
7235
7237 {
7239 return;
7240
7242 {
7243 if (ScriptInputUserData.CanStoreInputUserData())
7244 {
7245 ScriptInputUserData ctx = new ScriptInputUserData;
7250 ItemBase destination_entity =
this;
7251 ctx.
Write(destination_entity);
7255 }
7256 }
7257 else if (!
GetGame().IsMultiplayer())
7258 {
7260 }
7261 }
7262
7264 {
7266 return;
7267
7269 float split_quantity_new;
7271 if (player)
7272 {
7274 if (quantity > stackable)
7275 split_quantity_new = stackable;
7276 else
7277 split_quantity_new = quantity;
7278
7279 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7280 new_item =
ItemBase.Cast(in_hands);
7281 if (new_item)
7282 {
7283 new_item.SetResultOfSplit(true);
7284 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7286 new_item.SetQuantity(split_quantity_new);
7287 }
7288 }
7289 }
7290
7292 {
7294 return;
7295
7297 float split_quantity_new = Math.Floor(quantity * 0.5);
7298
7300
7301 if (new_item)
7302 {
7303 if (new_item.GetQuantityMax() < split_quantity_new)
7304 {
7305 split_quantity_new = new_item.GetQuantityMax();
7306 }
7307
7308 new_item.SetResultOfSplit(true);
7309 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7310
7312 {
7315 }
7316 else
7317 {
7320 }
7321 }
7322 }
7323
7325 {
7327 return;
7328
7330 float split_quantity_new = Math.Floor(quantity / 2);
7331
7332 InventoryLocation invloc = new InventoryLocation;
7334
7336 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7337
7338 if (new_item)
7339 {
7340 if (new_item.GetQuantityMax() < split_quantity_new)
7341 {
7342 split_quantity_new = new_item.GetQuantityMax();
7343 }
7345 {
7348 }
7349 else
7350 {
7353 }
7354 }
7355 }
7356
7359 {
7360 SetWeightDirty();
7362
7363 if (parent)
7364 parent.OnAttachmentQuantityChangedEx(this, delta);
7365
7367 {
7369 {
7371 }
7373 {
7374 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7376 }
7377 }
7378
7379 }
7380
7383 {
7384
7385 }
7386
7389 {
7391 }
7392
7394 {
7395 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7396
7398 {
7399 if (newLevel == GameConstants.STATE_RUINED)
7400 {
7402 EntityAI parent = GetHierarchyParent();
7403 if (parent && parent.IsFireplace())
7404 {
7405 CargoBase cargo = GetInventory().GetCargo();
7406 if (cargo)
7407 {
7409 {
7411 }
7412 }
7413 }
7414 }
7415
7417 {
7418
7420 return;
7421 }
7422
7423 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7424 {
7426 }
7427 }
7428 }
7429
7430
7432 {
7433 super.OnRightClick();
7434
7436 {
7438 {
7439 if (ScriptInputUserData.CanStoreInputUserData())
7440 {
7441 vector m4[4];
7443
7444 EntityAI root = GetHierarchyRoot();
7445
7446 InventoryLocation dst = new InventoryLocation;
7448 {
7449 if (root)
7450 {
7451 root.GetTransform(m4);
7453 }
7454 else
7455 GetInventory().GetCurrentInventoryLocation(dst);
7456 }
7457 else
7458 {
7460
7461
7462 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7463 {
7464 if (root)
7465 {
7466 root.GetTransform(m4);
7468 }
7469 else
7470 GetInventory().GetCurrentInventoryLocation(dst);
7471 }
7472 else
7473 {
7474 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7475 }
7476 }
7477
7478 ScriptInputUserData ctx = new ScriptInputUserData;
7486 }
7487 }
7488 else if (!
GetGame().IsMultiplayer())
7489 {
7491 }
7492 }
7493 }
7494
7495 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7496 {
7497
7498 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7499 return false;
7500
7501 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7502 return false;
7503
7504
7506 return false;
7507
7508
7509 Magazine mag = Magazine.Cast(this);
7510 if (mag)
7511 {
7512 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7513 return false;
7514
7515 if (stack_max_limit)
7516 {
7517 Magazine other_mag = Magazine.Cast(other_item);
7518 if (other_item)
7519 {
7520 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7521 return false;
7522 }
7523
7524 }
7525 }
7526 else
7527 {
7528
7530 return false;
7531
7533 return false;
7534 }
7535
7536 PlayerBase player = null;
7537 if (CastTo(player, GetHierarchyRootPlayer()))
7538 {
7539 if (player.GetInventory().HasAttachment(this))
7540 return false;
7541
7542 if (player.IsItemsToDelete())
7543 return false;
7544 }
7545
7546 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7547 return false;
7548
7549 int slotID;
7551 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7552 return false;
7553
7554 return true;
7555 }
7556
7558 {
7560 }
7561
7563 {
7564 return m_IsResultOfSplit;
7565 }
7566
7568 {
7569 m_IsResultOfSplit = value;
7570 }
7571
7573 {
7575 }
7576
7578 {
7579 float other_item_quantity = other_item.GetQuantity();
7580 float this_free_space;
7581
7583
7585
7586 if (other_item_quantity > this_free_space)
7587 {
7588 return this_free_space;
7589 }
7590 else
7591 {
7592 return other_item_quantity;
7593 }
7594 }
7595
7597 {
7599 }
7600
7602 {
7604 return;
7605
7606 if (!IsMagazine() && other_item)
7607 {
7609 if (quantity_used != 0)
7610 {
7611 float hp1 = GetHealth01("","");
7612 float hp2 = other_item.GetHealth01("","");
7613 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7614 hpResult = hpResult / (
GetQuantity() + quantity_used);
7615
7616 hpResult *= GetMaxHealth();
7617 Math.Round(hpResult);
7618 SetHealth("", "Health", hpResult);
7619
7621 other_item.AddQuantity(-quantity_used);
7622 }
7623 }
7625 }
7626
7628 {
7629 #ifdef SERVER
7630 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7631 GetHierarchyParent().IncreaseLifetimeUp();
7632 #endif
7633 };
7634
7636 {
7637 PlayerBase p = PlayerBase.Cast(player);
7638
7639 array<int> recipesIds = p.m_Recipes;
7640 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7641 if (moduleRecipesManager)
7642 {
7643 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7644 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7645 }
7646
7647 for (int i = 0;i < recipesIds.Count(); i++)
7648 {
7649 int key = recipesIds.Get(i);
7650 string recipeName = moduleRecipesManager.GetRecipeName(key);
7652 }
7653 }
7654
7655
7656 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7657 {
7658 super.GetDebugActions(outputList);
7659
7660
7665
7666
7670
7674
7675
7678
7679
7681 {
7684 }
7685
7687
7690
7694 }
7695
7696
7697
7698
7700 {
7701 super.OnAction(action_id, player, ctx);
7702 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7703 {
7704 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7705 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7706 PlayerBase p = PlayerBase.Cast(player);
7707 if (
EActions.RECIPES_RANGE_START < 1000)
7708 {
7709 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7710 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7711 }
7712 }
7713 #ifndef SERVER
7714 else if (action_id ==
EActions.WATCH_PLAYER)
7715 {
7716 PluginDeveloper.SetDeveloperItemClientEx(player);
7717 }
7718 #endif
7720 {
7721 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7722 {
7723 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7724 OnDebugButtonPressServer(id + 1);
7725 }
7726
7727 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7728 {
7729 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7731 }
7732
7733 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7734 {
7735 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7737 }
7738
7739 else if (action_id ==
EActions.ADD_QUANTITY)
7740 {
7741 if (IsMagazine())
7742 {
7743 Magazine mag = Magazine.Cast(this);
7744 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7745 }
7746 else
7747 {
7749 }
7750
7751 if (m_EM)
7752 {
7753 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7754 }
7755
7756 }
7757
7758 else if (action_id ==
EActions.REMOVE_QUANTITY)
7759 {
7760 if (IsMagazine())
7761 {
7762 Magazine mag2 = Magazine.Cast(this);
7763 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7764 }
7765 else
7766 {
7768 }
7769 if (m_EM)
7770 {
7771 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7772 }
7773
7774 }
7775
7776 else if (action_id ==
EActions.SET_QUANTITY_0)
7777 {
7779
7780 if (m_EM)
7781 {
7782 m_EM.SetEnergy(0);
7783 }
7784 }
7785
7786 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7787 {
7789
7790 if (m_EM)
7791 {
7792 m_EM.SetEnergy(m_EM.GetEnergyMax());
7793 }
7794 }
7795
7796 else if (action_id ==
EActions.ADD_HEALTH)
7797 {
7798 AddHealth("","",GetMaxHealth("","Health")/5);
7799 }
7800 else if (action_id ==
EActions.REMOVE_HEALTH)
7801 {
7802 AddHealth("","",-GetMaxHealth("","Health")/5);
7803 }
7804 else if (action_id ==
EActions.DESTROY_HEALTH)
7805 {
7806 SetHealth01("","",0);
7807 }
7808 else if (action_id ==
EActions.WATCH_ITEM)
7809 {
7811 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7812 #ifdef DEVELOPER
7813 SetDebugDeveloper_item(this);
7814 #endif
7815 }
7816
7817 else if (action_id ==
EActions.ADD_TEMPERATURE)
7818 {
7819 AddTemperature(20);
7820
7821 }
7822
7823 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7824 {
7825 AddTemperature(-20);
7826
7827 }
7828
7829 else if (action_id ==
EActions.FLIP_FROZEN)
7830 {
7831 SetFrozen(!GetIsFrozen());
7832
7833 }
7834
7835 else if (action_id ==
EActions.ADD_WETNESS)
7836 {
7838
7839 }
7840
7841 else if (action_id ==
EActions.REMOVE_WETNESS)
7842 {
7844
7845 }
7846
7847 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7848 {
7851
7852
7853 }
7854
7855 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7856 {
7859 }
7860
7861 else if (action_id ==
EActions.MAKE_SPECIAL)
7862 {
7863 auto debugParams = DebugSpawnParams.WithPlayer(player);
7864 OnDebugSpawnEx(debugParams);
7865 }
7866
7867 else if (action_id ==
EActions.DELETE)
7868 {
7869 Delete();
7870 }
7871
7872 }
7873
7874
7875 return false;
7876 }
7877
7878
7879
7880
7884
7887
7888
7889
7891 {
7892 return false;
7893 }
7894
7895
7897 {
7898 return true;
7899 }
7900
7901
7903 {
7904 return true;
7905 }
7906
7907
7908
7910 {
7911 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7913 }
7914
7917 {
7918 return null;
7919 }
7920
7922 {
7923 return false;
7924 }
7925
7927 {
7928 return false;
7929 }
7930
7934
7935
7937 {
7938 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7939 return module_repairing.CanRepair(this, item_repair_kit);
7940 }
7941
7942
7943 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7944 {
7945 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7946 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7947 }
7948
7949
7951 {
7952
7953
7954
7955
7956
7957
7958
7959
7960 return 1;
7961 }
7962
7963
7964
7966 {
7968 }
7969
7970
7971
7973 {
7975 }
7976
7977
7986 {
7987 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7988
7989 if (player)
7990 {
7991 player.MessageStatus(text);
7992 }
7993 }
7994
7995
8004 {
8005 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8006
8007 if (player)
8008 {
8009 player.MessageAction(text);
8010 }
8011 }
8012
8013
8022 {
8023 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8024
8025 if (player)
8026 {
8027 player.MessageFriendly(text);
8028 }
8029 }
8030
8031
8040 {
8041 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8042
8043 if (player)
8044 {
8045 player.MessageImportant(text);
8046 }
8047 }
8048
8050 {
8051 return true;
8052 }
8053
8054
8055 override bool KindOf(
string tag)
8056 {
8057 bool found = false;
8058 string item_name = this.
GetType();
8061
8062 int array_size = item_tag_array.Count();
8063 for (int i = 0; i < array_size; i++)
8064 {
8065 if (item_tag_array.Get(i) == tag)
8066 {
8067 found = true;
8068 break;
8069 }
8070 }
8071 return found;
8072 }
8073
8074
8076 {
8077
8078 super.OnRPC(sender, rpc_type,ctx);
8079
8080
8081 switch (rpc_type)
8082 {
8083 #ifndef SERVER
8084 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8085 Param2<bool, string> p = new Param2<bool, string>(false, "");
8086
8088 return;
8089
8090 bool play = p.param1;
8091 string soundSet = p.param2;
8092
8093 if (play)
8094 {
8096 {
8098 {
8100 }
8101 }
8102 else
8103 {
8105 }
8106 }
8107 else
8108 {
8110 }
8111
8112 break;
8113 #endif
8114
8115 }
8116
8118 {
8120 }
8121 }
8122
8123
8124
8125
8127 {
8128 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8129 return plugin.GetID(
name);
8130 }
8131
8133 {
8134 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8135 return plugin.GetName(id);
8136 }
8137
8140 {
8141
8142
8143 int varFlags;
8144 if (!ctx.
Read(varFlags))
8145 return;
8146
8147 if (varFlags & ItemVariableFlags.FLOAT)
8148 {
8150 }
8151 }
8152
8154 {
8155
8156 super.SerializeNumericalVars(floats_out);
8157
8158
8159
8161 {
8163 }
8164
8166 {
8168 }
8169
8171 {
8173 }
8174
8176 {
8181 }
8182
8184 {
8186 }
8187 }
8188
8190 {
8191
8192 super.DeSerializeNumericalVars(floats);
8193
8194
8195 int index = 0;
8196 int mask = Math.Round(floats.Get(index));
8197
8198 index++;
8199
8201 {
8203 {
8205 }
8206 else
8207 {
8208 float quantity = floats.Get(index);
8210 }
8211 index++;
8212 }
8213
8215 {
8216 float wet = floats.Get(index);
8218 index++;
8219 }
8220
8222 {
8223 int liquidtype = Math.Round(floats.Get(index));
8225 index++;
8226 }
8227
8229 {
8231 index++;
8233 index++;
8235 index++;
8237 index++;
8238 }
8239
8241 {
8242 int cleanness = Math.Round(floats.Get(index));
8244 index++;
8245 }
8246 }
8247
8249 {
8250 super.WriteVarsToCTX(ctx);
8251
8252
8254 {
8256 }
8257
8259 {
8261 }
8262
8264 {
8266 }
8267
8269 {
8270 int r,g,b,a;
8276 }
8277
8279 {
8281 }
8282 }
8283
8285 {
8286 if (!super.ReadVarsFromCTX(ctx,version))
8287 return false;
8288
8289 int intValue;
8290 float value;
8291
8292 if (version < 140)
8293 {
8294 if (!ctx.
Read(intValue))
8295 return false;
8296
8297 m_VariablesMask = intValue;
8298 }
8299
8301 {
8302 if (!ctx.
Read(value))
8303 return false;
8304
8306 {
8308 }
8309 else
8310 {
8312 }
8313 }
8314
8315 if (version < 140)
8316 {
8318 {
8319 if (!ctx.
Read(value))
8320 return false;
8321 SetTemperatureDirect(value);
8322 }
8323 }
8324
8326 {
8327 if (!ctx.
Read(value))
8328 return false;
8330 }
8331
8333 {
8334 if (!ctx.
Read(intValue))
8335 return false;
8337 }
8338
8340 {
8341 int r,g,b,a;
8343 return false;
8345 return false;
8347 return false;
8349 return false;
8350
8352 }
8353
8355 {
8356 if (!ctx.
Read(intValue))
8357 return false;
8359 }
8360
8361 if (version >= 138 && version < 140)
8362 {
8364 {
8365 if (!ctx.
Read(intValue))
8366 return false;
8367 SetFrozen(intValue);
8368 }
8369 }
8370
8371 return true;
8372 }
8373
8374
8376 {
8379 {
8381 }
8382
8383 if (!super.OnStoreLoad(ctx, version))
8384 {
8386 return false;
8387 }
8388
8389 if (version >= 114)
8390 {
8391 bool hasQuickBarIndexSaved;
8392
8393 if (!ctx.
Read(hasQuickBarIndexSaved))
8394 {
8396 return false;
8397 }
8398
8399 if (hasQuickBarIndexSaved)
8400 {
8401 int itmQBIndex;
8402
8403
8404 if (!ctx.
Read(itmQBIndex))
8405 {
8407 return false;
8408 }
8409
8410 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8411 if (itmQBIndex != -1 && parentPlayer)
8412 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8413 }
8414 }
8415 else
8416 {
8417
8418 PlayerBase player;
8419 int itemQBIndex;
8420 if (version ==
int.
MAX)
8421 {
8422 if (!ctx.
Read(itemQBIndex))
8423 {
8425 return false;
8426 }
8427 }
8428 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8429 {
8430
8431 if (!ctx.
Read(itemQBIndex))
8432 {
8434 return false;
8435 }
8436 if (itemQBIndex != -1 && player)
8437 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8438 }
8439 }
8440
8441 if (version < 140)
8442 {
8443
8444 if (!LoadVariables(ctx, version))
8445 {
8447 return false;
8448 }
8449 }
8450
8451
8453 {
8455 return false;
8456 }
8457 if (version >= 132)
8458 {
8460 if (raib)
8461 {
8463 {
8465 return false;
8466 }
8467 }
8468 }
8469
8471 return true;
8472 }
8473
8474
8475
8477 {
8478 super.OnStoreSave(ctx);
8479
8480 PlayerBase player;
8481 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8482 {
8484
8485 int itemQBIndex = -1;
8486 itemQBIndex = player.FindQuickBarEntityIndex(this);
8487 ctx.
Write(itemQBIndex);
8488 }
8489 else
8490 {
8492 }
8493
8495
8497 if (raib)
8498 {
8500 }
8501 }
8502
8503
8505 {
8506 super.AfterStoreLoad();
8507
8509 {
8511 }
8512
8514 {
8517 }
8518 }
8519
8521 {
8522 super.EEOnAfterLoad();
8523
8525 {
8527 }
8528
8531 }
8532
8534 {
8535 return false;
8536 }
8537
8538
8539
8541 {
8543 {
8544 #ifdef PLATFORM_CONSOLE
8545
8547 {
8549 if (menu)
8550 {
8552 }
8553 }
8554 #endif
8555 }
8556
8558 {
8561 }
8562
8564 {
8565 SetWeightDirty();
8567 }
8569 {
8572 }
8573
8575 {
8578 }
8580 {
8583 }
8584
8585 super.OnVariablesSynchronized();
8586 }
8587
8588
8589
8591 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8592 {
8593 if (!IsServerCheck(allow_client))
8594 return false;
8595
8597 return false;
8598
8601
8602 if (value <= (min + 0.001))
8603 value = min;
8604
8605 if (value == min)
8606 {
8607 if (destroy_config)
8608 {
8609 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8610 if (dstr)
8611 {
8613 this.Delete();
8614 return true;
8615 }
8616 }
8617 else if (destroy_forced)
8618 {
8620 this.Delete();
8621 return true;
8622 }
8623
8625 }
8626
8629
8631 {
8633
8634 if (delta)
8636 }
8637
8639
8640 return false;
8641 }
8642
8643
8645 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8646 {
8648 }
8649
8651 {
8654 }
8655
8657 {
8660 }
8661
8664 {
8665 float value_clamped = Math.Clamp(value, 0, 1);
8667 SetQuantity(result, destroy_config, destroy_forced);
8668 }
8669
8670
8673 {
8675 }
8676
8678 {
8680 }
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8692 {
8693 int slot = -1;
8694 if (GetInventory())
8695 {
8696 InventoryLocation il = new InventoryLocation;
8697 GetInventory().GetCurrentInventoryLocation(il);
8699 }
8700
8702 }
8703
8705 {
8706 float quantity_max = 0;
8707
8709 {
8710 if (attSlotID != -1)
8711 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8712
8713 if (quantity_max <= 0)
8715 }
8716
8717 if (quantity_max <= 0)
8719
8720 return quantity_max;
8721 }
8722
8724 {
8726 }
8727
8729 {
8731 }
8732
8733
8735 {
8737 }
8738
8740 {
8742 }
8743
8745 {
8747 }
8748
8749
8751 {
8752
8753 float weightEx = GetWeightEx();
8754 float special = GetInventoryAndCargoWeight();
8755 return weightEx - special;
8756 }
8757
8758
8760 {
8762 }
8763
8765 {
8767 {
8768 #ifdef DEVELOPER
8769 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8770 {
8771 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8773 }
8774 #endif
8775
8777 }
8778 else if (HasEnergyManager())
8779 {
8780 #ifdef DEVELOPER
8781 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8782 {
8783 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8784 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8785 }
8786 #endif
8787 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8788 }
8789 else
8790 {
8791 #ifdef DEVELOPER
8792 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8793 {
8794 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8795 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8796 }
8797 #endif
8798 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8799 }
8800 }
8801
8804 {
8805 int item_count = 0;
8807
8808 if (GetInventory().GetCargo() != NULL)
8809 {
8810 item_count = GetInventory().GetCargo().GetItemCount();
8811 }
8812
8813 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8814 {
8815 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8816 if (item)
8817 item_count += item.GetNumberOfItems();
8818 }
8819 return item_count;
8820 }
8821
8824 {
8825 float weight = 0;
8826 float wetness = 1;
8827 if (include_wetness)
8830 {
8831 weight = wetness * m_ConfigWeight;
8832 }
8834 {
8835 weight = 1;
8836 }
8837 return weight;
8838 }
8839
8840
8841
8843 {
8844 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8845 {
8846 GameInventory inv = GetInventory();
8847 array<EntityAI> items = new array<EntityAI>;
8849 for (int i = 0; i < items.Count(); i++)
8850 {
8852 if (item)
8853 {
8855 }
8856 }
8857 }
8858 }
8859
8860
8861
8862
8864 {
8865 float energy = 0;
8866 if (HasEnergyManager())
8867 {
8868 energy = GetCompEM().GetEnergy();
8869 }
8870 return energy;
8871 }
8872
8873
8875 {
8876 super.OnEnergyConsumed();
8877
8879 }
8880
8882 {
8883 super.OnEnergyAdded();
8884
8886 }
8887
8888
8890 {
8891 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8892 {
8894 {
8895 float energy_0to1 = GetCompEM().GetEnergy0To1();
8897 }
8898 }
8899 }
8900
8901
8903 {
8904 return ConfigGetFloat("heatIsolation");
8905 }
8906
8908 {
8910 }
8911
8913 {
8914 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8915 if (
GetGame().ConfigIsExisting(paramPath))
8917
8918 return 0.0;
8919 }
8920
8922 {
8923 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8924 if (
GetGame().ConfigIsExisting(paramPath))
8926
8927 return 0.0;
8928 }
8929
8930 override void SetWet(
float value,
bool allow_client =
false)
8931 {
8932 if (!IsServerCheck(allow_client))
8933 return;
8934
8937
8939
8940 m_VarWet = Math.Clamp(value, min, max);
8941
8943 {
8946 }
8947 }
8948
8949 override void AddWet(
float value)
8950 {
8952 }
8953
8955 {
8957 }
8958
8960 {
8962 }
8963
8965 {
8967 }
8968
8970 {
8972 }
8973
8975 {
8977 }
8978
8980 {
8983 if (newLevel != oldLevel)
8984 {
8986 }
8987 }
8988
8990 {
8991 SetWeightDirty();
8992 }
8993
8995 {
8996 return GetWetLevelInternal(
m_VarWet);
8997 }
8998
8999
9000
9002 {
9004 }
9005
9007 {
9009 }
9010
9012 {
9014 }
9015
9017 {
9019 }
9020
9021
9022
9024 {
9025 if (ConfigIsExisting("itemModelLength"))
9026 {
9027 return ConfigGetFloat("itemModelLength");
9028 }
9029 return 0;
9030 }
9031
9033 {
9034 if (ConfigIsExisting("itemAttachOffset"))
9035 {
9036 return ConfigGetFloat("itemAttachOffset");
9037 }
9038 return 0;
9039 }
9040
9041 override void SetCleanness(
int value,
bool allow_client =
false)
9042 {
9043 if (!IsServerCheck(allow_client))
9044 return;
9045
9047
9049
9052 }
9053
9055 {
9057 }
9058
9060 {
9061 return true;
9062 }
9063
9064
9065
9066
9068 {
9070 }
9071
9073 {
9075 }
9076
9077
9078
9079
9080 override void SetColor(
int r,
int g,
int b,
int a)
9081 {
9087 }
9089 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9090 {
9095 }
9096
9098 {
9100 }
9101
9104 {
9105 int r,g,b,a;
9107 r = r/255;
9108 g = g/255;
9109 b = b/255;
9110 a = a/255;
9111 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9112 }
9113
9114
9115
9116 override void SetLiquidType(
int value,
bool allow_client =
false)
9117 {
9118 if (!IsServerCheck(allow_client))
9119 return;
9120
9125 }
9126
9128 {
9129 return ConfigGetInt("varLiquidTypeInit");
9130 }
9131
9133 {
9135 }
9136
9138 {
9140 SetFrozen(false);
9141 }
9142
9145 {
9146 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9147 }
9148
9149
9152 {
9153 PlayerBase nplayer;
9154 if (PlayerBase.CastTo(nplayer, player))
9155 {
9157
9158 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9159 }
9160 }
9161
9162
9165 {
9166 PlayerBase nplayer;
9167 if (PlayerBase.CastTo(nplayer,player))
9168 {
9169
9170 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9171
9172 }
9173
9174
9175 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9176
9177
9178 if (HasEnergyManager())
9179 {
9180 GetCompEM().UpdatePlugState();
9181 }
9182 }
9183
9184
9186 {
9187 super.OnPlacementStarted(player);
9188
9190 }
9191
9192 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9193 {
9195 {
9196 m_AdminLog.OnPlacementComplete(player,
this);
9197 }
9198
9199 super.OnPlacementComplete(player, position, orientation);
9200 }
9201
9202
9203
9204
9205
9207 {
9209 {
9210 return true;
9211 }
9212 else
9213 {
9214 return false;
9215 }
9216 }
9217
9218
9220 {
9222 {
9224 }
9225 }
9226
9227
9229 {
9231 }
9232
9234 {
9236 }
9237
9238 override void InsertAgent(
int agent,
float count = 1)
9239 {
9240 if (count < 1)
9241 return;
9242
9244 }
9245
9248 {
9250 }
9251
9252
9254 {
9256 }
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9300 {
9302 return false;
9303 return true;
9304 }
9305
9307 {
9308
9310 }
9311
9312
9315 {
9316 super.CheckForRoofLimited(timeTresholdMS);
9317
9319 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9320 {
9321 m_PreviousRoofTestTime = time;
9322 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9323 }
9324 }
9325
9326
9328 {
9330 {
9331 return 0;
9332 }
9333
9334 if (GetInventory().GetAttachmentSlotsCount() != 0)
9335 {
9336 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9337 if (filter)
9338 return filter.GetProtectionLevel(type, false, system);
9339 else
9340 return 0;
9341 }
9342
9343 string subclassPath, entryName;
9344
9345 switch (type)
9346 {
9348 entryName = "biological";
9349 break;
9351 entryName = "chemical";
9352 break;
9353 default:
9354 entryName = "biological";
9355 break;
9356 }
9357
9358 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9359
9361 }
9362
9363
9364
9367 {
9368 if (!IsMagazine())
9370
9372 }
9373
9374
9375
9376
9377
9382 {
9383 return true;
9384 }
9385
9387 {
9389 }
9390
9391
9392
9393
9394
9396 {
9397 if (parent)
9398 {
9399 if (parent.IsInherited(DayZInfected))
9400 return true;
9401
9402 if (!parent.IsRuined())
9403 return true;
9404 }
9405
9406 return true;
9407 }
9408
9410 {
9411 if (!super.CanPutAsAttachment(parent))
9412 {
9413 return false;
9414 }
9415
9416 if (!IsRuined() && !parent.IsRuined())
9417 {
9418 return true;
9419 }
9420
9421 return false;
9422 }
9423
9425 {
9426
9427
9428
9429
9430 return super.CanReceiveItemIntoCargo(item);
9431 }
9432
9434 {
9435
9436
9437
9438
9439 GameInventory attachmentInv = attachment.GetInventory();
9441 {
9442 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9443 return false;
9444 }
9445
9446 InventoryLocation loc = new InventoryLocation();
9447 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9448 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9449 return false;
9450
9451 return super.CanReceiveAttachment(attachment, slotId);
9452 }
9453
9455 {
9456 if (!super.CanReleaseAttachment(attachment))
9457 return false;
9458
9459 return GetInventory().AreChildrenAccessible();
9460 }
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9483 {
9484 int id = muzzle_owner.GetMuzzleID();
9485 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9486
9487 if (WPOF_array)
9488 {
9489 for (int i = 0; i < WPOF_array.Count(); i++)
9490 {
9491 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9492
9493 if (WPOF)
9494 {
9495 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9496 }
9497 }
9498 }
9499 }
9500
9501
9503 {
9504 int id = muzzle_owner.GetMuzzleID();
9506
9507 if (WPOBE_array)
9508 {
9509 for (int i = 0; i < WPOBE_array.Count(); i++)
9510 {
9511 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9512
9513 if (WPOBE)
9514 {
9515 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9516 }
9517 }
9518 }
9519 }
9520
9521
9523 {
9524 int id = muzzle_owner.GetMuzzleID();
9525 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9526
9527 if (WPOOH_array)
9528 {
9529 for (int i = 0; i < WPOOH_array.Count(); i++)
9530 {
9531 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9532
9533 if (WPOOH)
9534 {
9535 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9536 }
9537 }
9538 }
9539 }
9540
9541
9543 {
9544 int id = muzzle_owner.GetMuzzleID();
9545 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9546
9547 if (WPOOH_array)
9548 {
9549 for (int i = 0; i < WPOOH_array.Count(); i++)
9550 {
9551 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9552
9553 if (WPOOH)
9554 {
9555 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9556 }
9557 }
9558 }
9559 }
9560
9561
9563 {
9564 int id = muzzle_owner.GetMuzzleID();
9565 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9566
9567 if (WPOOH_array)
9568 {
9569 for (int i = 0; i < WPOOH_array.Count(); i++)
9570 {
9571 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9572
9573 if (WPOOH)
9574 {
9575 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9576 }
9577 }
9578 }
9579 }
9580
9581
9582
9584 {
9586 {
9587 return true;
9588 }
9589
9590 return false;
9591 }
9592
9594 {
9596 {
9597 return true;
9598 }
9599
9600 return false;
9601 }
9602
9604 {
9606 {
9607 return true;
9608 }
9609
9610 return false;
9611 }
9612
9614 {
9615 return false;
9616 }
9617
9620 {
9621 return UATimeSpent.DEFAULT_DEPLOY;
9622 }
9623
9624
9625
9626
9628 {
9630 SetSynchDirty();
9631 }
9632
9634 {
9636 }
9637
9638
9640 {
9641 return false;
9642 }
9643
9646 {
9647 string att_type = "None";
9648
9649 if (ConfigIsExisting("soundAttType"))
9650 {
9651 att_type = ConfigGetString("soundAttType");
9652 }
9653
9655 }
9656
9658 {
9660 }
9661
9662
9663
9664
9665
9669
9671 {
9674
9676 }
9677
9678
9680 {
9682 return;
9683
9685
9688
9691
9692 SoundParameters params = new SoundParameters();
9696 }
9697
9698
9700 {
9702 return;
9703
9705 SetSynchDirty();
9706
9709 }
9710
9711
9713 {
9715 return;
9716
9718 SetSynchDirty();
9719
9722 }
9723
9725 {
9727 }
9728
9730 {
9732 }
9733
9736 {
9737 if (!
GetGame().IsDedicatedServer())
9738 {
9739 if (ConfigIsExisting("attachSoundSet"))
9740 {
9741 string cfg_path = "";
9742 string soundset = "";
9744
9747 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9748 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9749
9750 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9751 {
9752 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9753 {
9754 if (cfg_slot_array[i] == slot_type)
9755 {
9756 soundset = cfg_soundset_array[i];
9757 break;
9758 }
9759 }
9760 }
9761
9762 if (soundset != "")
9763 {
9764 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9766 }
9767 }
9768 }
9769 }
9770
9772 {
9773
9774 }
9775
9776 void OnApply(PlayerBase player);
9777
9779 {
9780 return 1.0;
9781 };
9782
9784 {
9786 }
9787
9789 {
9791 }
9792
9794
9796 {
9797 SetDynamicPhysicsLifeTime(0.01);
9799 }
9800
9802 {
9803 array<string> zone_names = new array<string>;
9804 GetDamageZones(zone_names);
9805 for (int i = 0; i < zone_names.Count(); i++)
9806 {
9807 SetHealthMax(zone_names.Get(i),"Health");
9808 }
9809 SetHealthMax("","Health");
9810 }
9811
9814 {
9815 float global_health = GetHealth01("","Health");
9816 array<string> zones = new array<string>;
9817 GetDamageZones(zones);
9818
9819 for (int i = 0; i < zones.Count(); i++)
9820 {
9821 SetHealth01(zones.Get(i),"Health",global_health);
9822 }
9823 }
9824
9827 {
9828 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9829 }
9830
9832 {
9833 if (!hasRootAsPlayer)
9834 {
9835 if (refParentIB)
9836 {
9837
9838 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9839 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9840
9841 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9842 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9843
9846 }
9847 else
9848 {
9849
9852 }
9853 }
9854 }
9855
9857 {
9859 {
9860 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9861 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9862 {
9863 float heatPermCoef = 1.0;
9865 while (ent)
9866 {
9867 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9868 ent = ent.GetHierarchyParent();
9869 }
9870
9871 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9872 }
9873 }
9874 }
9875
9877 {
9878
9879 EntityAI parent = GetHierarchyParent();
9880 if (!parent)
9881 {
9882 hasParent = false;
9883 hasRootAsPlayer = false;
9884 }
9885 else
9886 {
9887 hasParent = true;
9888 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9889 refParentIB =
ItemBase.Cast(parent);
9890 }
9891 }
9892
9893 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9894 {
9895
9896 }
9897
9899 {
9900
9901 return false;
9902 }
9903
9905 {
9906
9907
9908 return false;
9909 }
9910
9912 {
9913
9914 return false;
9915 }
9916
9919 {
9920 return !GetIsFrozen() &&
IsOpen();
9921 }
9922
9924 {
9925 bool hasParent = false, hasRootAsPlayer = false;
9927
9928 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9929 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9930
9931 if (wwtu || foodDecay)
9932 {
9936
9937 if (processWetness || processTemperature || processDecay)
9938 {
9940
9941 if (processWetness)
9942 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9943
9944 if (processTemperature)
9946
9947 if (processDecay)
9948 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9949 }
9950 }
9951 }
9952
9955 {
9957 }
9958
9960 {
9963
9964 return super.GetTemperatureFreezeThreshold();
9965 }
9966
9968 {
9971
9972 return super.GetTemperatureThawThreshold();
9973 }
9974
9976 {
9979
9980 return super.GetItemOverheatThreshold();
9981 }
9982
9984 {
9986 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9987
9988 return super.GetTemperatureFreezeTime();
9989 }
9990
9992 {
9994 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9995
9996 return super.GetTemperatureThawTime();
9997 }
9998
10003
10005 {
10006 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10007 }
10008
10010 {
10011 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10012 }
10013
10016 {
10018 }
10019
10021 {
10023 }
10024
10026 {
10028 }
10029
10032 {
10033 return null;
10034 }
10035
10038 {
10039 return false;
10040 }
10041
10043 {
10045 {
10048 if (!trg)
10049 {
10051 explosive = this;
10052 }
10053
10054 explosive.PairRemote(trg);
10056
10057 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10058 trg.SetPersistentPairID(persistentID);
10059 explosive.SetPersistentPairID(persistentID);
10060
10061 return true;
10062 }
10063 return false;
10064 }
10065
10068 {
10069 float ret = 1.0;
10072 ret *= GetHealth01();
10073
10074 return ret;
10075 }
10076
10077 #ifdef DEVELOPER
10078 override void SetDebugItem()
10079 {
10080 super.SetDebugItem();
10081 _itemBase = this;
10082 }
10083
10085 {
10086 string text = super.GetDebugText();
10087
10089 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10090
10091 return text;
10092 }
10093 #endif
10094
10096 {
10097 return true;
10098 }
10099
10101
10103
10105 {
10108 }
10109
10110
10118
10134}
10135
10137{
10139 if (entity)
10140 {
10141 bool is_item = entity.IsInherited(
ItemBase);
10142 if (is_item && full_quantity)
10143 {
10146 }
10147 }
10148 else
10149 {
10151 return NULL;
10152 }
10153 return entity;
10154}
10155
10157{
10158 if (item)
10159 {
10160 if (health > 0)
10161 item.SetHealth("", "", health);
10162
10163 if (item.CanHaveTemperature())
10164 {
10166 if (item.CanFreeze())
10167 item.SetFrozen(false);
10168 }
10169
10170 if (item.HasEnergyManager())
10171 {
10172 if (quantity >= 0)
10173 {
10174 item.GetCompEM().SetEnergy0To1(quantity);
10175 }
10176 else
10177 {
10179 }
10180 }
10181 else if (item.IsMagazine())
10182 {
10183 Magazine mag = Magazine.Cast(item);
10184 if (quantity >= 0)
10185 {
10186 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10187 }
10188 else
10189 {
10191 }
10192
10193 }
10194 else
10195 {
10196 if (quantity >= 0)
10197 {
10198 item.SetQuantityNormalized(quantity, false);
10199 }
10200 else
10201 {
10203 }
10204
10205 }
10206 }
10207}
10208
10209#ifdef DEVELOPER
10211#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.