5364{
5366 {
5367 return true;
5368 }
5369};
5370
5371
5372
5374{
5378
5380
5383
5384
5385
5386
5387
5396
5402
5407
5412
5433 protected bool m_IsResultOfSplit
5434
5436
5441
5442
5443
5445
5449
5450
5451
5453
5456
5457
5458
5464
5465
5473
5476
5477
5479
5480
5482
5483
5488
5489
5494
5495
5497
5498
5500 {
5505
5506 if (!
GetGame().IsDedicatedServer())
5507 {
5509 {
5511
5513 {
5515 }
5516 }
5517
5520 }
5521
5522 m_OldLocation = null;
5523
5525 {
5527 }
5528
5529 if (ConfigIsExisting("headSelectionsToHide"))
5530 {
5533 }
5534
5536 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5537 {
5539 }
5540
5542
5543 m_IsResultOfSplit = false;
5544
5546 }
5547
5549 {
5550 super.InitItemVariables();
5551
5557 m_Count = ConfigGetInt(
"count");
5558
5561
5566
5569
5574
5586
5590
5591
5594 if (ConfigIsExisting("canBeSplit"))
5595 {
5598 }
5599
5601 if (ConfigIsExisting("itemBehaviour"))
5603
5604
5607 RegisterNetSyncVariableInt("m_VarLiquidType");
5608 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5609
5610 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5611 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5612 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5613
5614 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5615 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5616 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5617 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5618
5619 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5620 RegisterNetSyncVariableBool("m_IsTakeable");
5621 RegisterNetSyncVariableBool("m_IsHologram");
5622
5625 {
5628 }
5629
5631
5633 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5635
5636 }
5637
5639 {
5641 }
5642
5644 {
5647 {
5652 }
5653 }
5654
5655 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5656 {
5658 {
5661 }
5662
5664 }
5665
5667 {
5673 }
5674
5676
5678 {
5680
5681 if (!action)
5682 {
5683 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5684 return;
5685 }
5686
5688 if (!ai)
5689 {
5691 return;
5692 }
5693
5695 if (!action_array)
5696 {
5697 action_array = new array<ActionBase_Basic>;
5699 }
5700 if (LogManager.IsActionLogEnable())
5701 {
5702 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5703 }
5704
5705 if (action_array.Find(action) != -1)
5706 {
5707 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5708 }
5709 else
5710 {
5711 action_array.Insert(action);
5712 }
5713 }
5714
5716 {
5718 ActionBase action = player.GetActionManager().GetAction(actionName);
5721
5722 if (action_array)
5723 {
5724 action_array.RemoveItem(action);
5725 }
5726 }
5727
5728
5729
5731 {
5732 ActionOverrideData overrideData = new ActionOverrideData();
5736
5738 if (!actionMap)
5739 {
5742 }
5743
5744 actionMap.Insert(this.
Type(), overrideData);
5745
5746 }
5747
5749
5751
5752
5754 {
5757
5760
5761 string config_to_search = "CfgVehicles";
5762 string muzzle_owner_config;
5763
5765 {
5766 if (IsInherited(Weapon))
5767 config_to_search = "CfgWeapons";
5768
5769 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5770
5771 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5772
5774
5775 if (config_OnFire_subclass_count > 0)
5776 {
5777 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5778
5779 for (int i = 0; i < config_OnFire_subclass_count; i++)
5780 {
5781 string particle_class = "";
5783 string config_OnFire_entry = config_OnFire_class + particle_class;
5784 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5785 WPOF_array.Insert(WPOF);
5786 }
5787
5788
5790 }
5791 }
5792
5794 {
5795 config_to_search = "CfgWeapons";
5796 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5797
5798 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5799
5801
5802 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5803 {
5804 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5805
5806 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5807 {
5808 string particle_class2 = "";
5810 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5811 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5812 WPOBE_array.Insert(WPOBE);
5813 }
5814
5815
5817 }
5818 }
5819 }
5820
5821
5823 {
5826
5828 {
5829 string config_to_search = "CfgVehicles";
5830
5831 if (IsInherited(Weapon))
5832 config_to_search = "CfgWeapons";
5833
5834 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5835 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5836
5837 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5838 {
5839
5841
5843 {
5845 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5847 return;
5848 }
5849
5852
5853
5854
5856 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5857
5858 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5859 {
5860 string particle_class = "";
5862 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5864
5865 if (entry_type == CT_CLASS)
5866 {
5867 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5868 WPOOH_array.Insert(WPOF);
5869 }
5870 }
5871
5872
5874 }
5875 }
5876 }
5877
5879 {
5881 }
5882
5884 {
5886 {
5888
5891
5894
5895 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5896 }
5897 }
5898
5900 {
5902 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5903
5905 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5906
5908 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5909
5911 {
5913 }
5914 }
5915
5917 {
5919 }
5920
5922 {
5925 else
5927
5929 {
5932 }
5933 else
5934 {
5937
5940 }
5941
5943 }
5944
5946 {
5948 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5949 }
5950
5952 {
5954 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5956 }
5957
5959 {
5961 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5962 }
5963
5965 {
5968
5969 OverheatingParticle OP = new OverheatingParticle();
5974
5976 }
5977
5979 {
5982
5983 return -1;
5984 }
5985
5987 {
5989 {
5992
5993 for (int i = count; i > 0; --i)
5994 {
5995 int id = i - 1;
5998
6001
6002 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6003 {
6004 if (p)
6005 {
6008 }
6009 }
6010 }
6011 }
6012 }
6013
6015 {
6017 {
6019 {
6020 int id = i - 1;
6022
6023 if (OP)
6024 {
6026
6027 if (p)
6028 {
6030 }
6031
6032 delete OP;
6033 }
6034 }
6035
6038 }
6039 }
6040
6043 {
6044 return 0.0;
6045 }
6046
6047
6049 {
6050 return 250;
6051 }
6052
6054 {
6055 return 0;
6056 }
6057
6060 {
6062 return true;
6063
6064 return false;
6065 }
6066
6069 {
6072
6074 {
6076 }
6077 else
6078 {
6079
6081 }
6082
6084 }
6085
6092 {
6093 return -1;
6094 }
6095
6096
6097
6098
6100 {
6102 {
6104 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6105
6106 if (r_index >= 0)
6107 {
6108 InventoryLocation r_il = new InventoryLocation;
6109 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6110
6111 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6114 {
6115 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6116 }
6118 {
6119 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6120 }
6121
6122 }
6123
6124 player.GetHumanInventory().ClearUserReservedLocation(this);
6125 }
6126
6129 }
6130
6131
6132
6133
6135 {
6136 return ItemBase.m_DebugActionsMask;
6137 }
6138
6140 {
6141 return ItemBase.m_DebugActionsMask & mask;
6142 }
6143
6145 {
6146 ItemBase.m_DebugActionsMask = mask;
6147 }
6148
6150 {
6151 ItemBase.m_DebugActionsMask |= mask;
6152 }
6153
6155 {
6156 ItemBase.m_DebugActionsMask &= ~mask;
6157 }
6158
6160 {
6162 {
6164 }
6165 else
6166 {
6168 }
6169 }
6170
6171
6173 {
6174 if (GetEconomyProfile())
6175 {
6176 float q_max = GetEconomyProfile().GetQuantityMax();
6177 if (q_max > 0)
6178 {
6179 float q_min = GetEconomyProfile().GetQuantityMin();
6180 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6181
6183 {
6184 ComponentEnergyManager comp = GetCompEM();
6186 {
6188 }
6189 }
6191 {
6193
6194 }
6195
6196 }
6197 }
6198 }
6199
6202 {
6203 EntityAI parent = GetHierarchyParent();
6204
6205 if (parent)
6206 {
6207 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6208 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6209 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6210 }
6211 }
6212
6215 {
6216 EntityAI parent = GetHierarchyParent();
6217
6218 if (parent)
6219 {
6220 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6221 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6222 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6223 }
6224 }
6225
6227 {
6228
6229
6230
6231
6233
6235 {
6236 if (ScriptInputUserData.CanStoreInputUserData())
6237 {
6238 ScriptInputUserData ctx = new ScriptInputUserData;
6244 ctx.
Write(use_stack_max);
6247
6249 {
6250 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6251 }
6252 }
6253 }
6254 else if (!
GetGame().IsMultiplayer())
6255 {
6257 }
6258 }
6259
6261 {
6263 }
6264
6266 {
6268 }
6269
6271 {
6273 }
6274
6276 {
6277
6278 return false;
6279 }
6280
6282 {
6283 return false;
6284 }
6285
6289 {
6290 return false;
6291 }
6292
6294 {
6295 return "";
6296 }
6297
6299
6301 {
6302 return false;
6303 }
6304
6306 {
6307 return true;
6308 }
6309
6310
6311
6313 {
6314 return true;
6315 }
6316
6318 {
6319 return true;
6320 }
6321
6323 {
6324 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6326 }
6327
6329 {
6331 }
6332
6334 {
6336 if (!is_being_placed)
6338 SetSynchDirty();
6339 }
6340
6341
6343
6345 {
6347 }
6348
6350 {
6352 }
6353
6355 {
6356 return 1;
6357 }
6358
6360 {
6361 return false;
6362 }
6363
6365 {
6367 SetSynchDirty();
6368 }
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6405 {
6406 super.OnMovedInsideCargo(container);
6407
6408 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6409 }
6410
6411 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6412 {
6413 super.EEItemLocationChanged(oldLoc,newLoc);
6414
6415 PlayerBase new_player = null;
6416 PlayerBase old_player = null;
6417
6418 if (newLoc.GetParent())
6419 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6420
6421 if (oldLoc.GetParent())
6422 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6423
6425 {
6426 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6427
6428 if (r_index >= 0)
6429 {
6430 InventoryLocation r_il = new InventoryLocation;
6431 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6432
6433 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6436 {
6437 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6438 }
6440 {
6441 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6442 }
6443
6444 }
6445 }
6446
6448 {
6449 if (new_player)
6450 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6451
6452 if (new_player == old_player)
6453 {
6454
6455 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6456 {
6458 {
6459 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6460 {
6461 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6462 }
6463 }
6464 else
6465 {
6466 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6467 }
6468 }
6469
6470 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6471 {
6472 int type = oldLoc.GetType();
6474 {
6475 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6476 }
6478 {
6479 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6480 }
6481 }
6482 if (!m_OldLocation)
6483 {
6484 m_OldLocation = new InventoryLocation;
6485 }
6486 m_OldLocation.Copy(oldLoc);
6487 }
6488 else
6489 {
6490 if (m_OldLocation)
6491 {
6492 m_OldLocation.Reset();
6493 }
6494 }
6495
6497 }
6498 else
6499 {
6500 if (new_player)
6501 {
6502 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6503 if (res_index >= 0)
6504 {
6505 InventoryLocation il = new InventoryLocation;
6506 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6508 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6511 {
6512 il.
GetParent().GetOnReleaseLock().Invoke(it);
6513 }
6515 {
6517 }
6518
6519 }
6520 }
6522 {
6523
6525 }
6526
6527 if (m_OldLocation)
6528 {
6529 m_OldLocation.Reset();
6530 }
6531 }
6532 }
6533
6534 override void EOnContact(IEntity other, Contact extra)
6535 {
6537 {
6538 int liquidType = -1;
6540 if (impactSpeed > 0.0)
6541 {
6543 #ifndef SERVER
6545 #else
6547 SetSynchDirty();
6548 #endif
6550 }
6551 }
6552
6553 #ifdef SERVER
6554 if (GetCompEM() && GetCompEM().IsPlugged())
6555 {
6556 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6557 GetCompEM().UnplugThis();
6558 }
6559 #endif
6560 }
6561
6563
6565 {
6567 }
6568
6570 {
6571
6572 }
6573
6575 {
6576 super.OnItemLocationChanged(old_owner, new_owner);
6577
6578 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6579 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6580
6581 if (!relatedPlayer && playerNew)
6582 relatedPlayer = playerNew;
6583
6584 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6585 {
6587 if (actionMgr)
6588 {
6589 ActionBase currentAction = actionMgr.GetRunningAction();
6590 if (currentAction)
6592 }
6593 }
6594
6595 Man ownerPlayerOld = null;
6596 Man ownerPlayerNew = null;
6597
6598 if (old_owner)
6599 {
6600 if (old_owner.
IsMan())
6601 {
6602 ownerPlayerOld = Man.Cast(old_owner);
6603 }
6604 else
6605 {
6606 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6607 }
6608 }
6609 else
6610 {
6612 {
6614
6615 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6616 {
6617 GetCompEM().UnplugThis();
6618 }
6619 }
6620 }
6621
6622 if (new_owner)
6623 {
6624 if (new_owner.
IsMan())
6625 {
6626 ownerPlayerNew = Man.Cast(new_owner);
6627 }
6628 else
6629 {
6630 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6631 }
6632 }
6633
6634 if (ownerPlayerOld != ownerPlayerNew)
6635 {
6636 if (ownerPlayerOld)
6637 {
6638 array<EntityAI> subItemsExit = new array<EntityAI>;
6640 for (int i = 0; i < subItemsExit.Count(); i++)
6641 {
6644 }
6645 }
6646
6647 if (ownerPlayerNew)
6648 {
6649 array<EntityAI> subItemsEnter = new array<EntityAI>;
6651 for (int j = 0; j < subItemsEnter.Count(); j++)
6652 {
6655 }
6656 }
6657 }
6658 else if (ownerPlayerNew != null)
6659 {
6660 PlayerBase nplayer;
6661 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6662 {
6663 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6665 for (int k = 0; k < subItemsUpdate.Count(); k++)
6666 {
6668 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6669 }
6670 }
6671 }
6672
6673 if (old_owner)
6674 old_owner.OnChildItemRemoved(this);
6675 if (new_owner)
6676 new_owner.OnChildItemReceived(this);
6677 }
6678
6679
6681 {
6682 super.EEDelete(parent);
6683 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6684 if (player)
6685 {
6687
6688 if (player.IsAlive())
6689 {
6690 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6691 if (r_index >= 0)
6692 {
6693 InventoryLocation r_il = new InventoryLocation;
6694 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6695
6696 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6699 {
6700 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6701 }
6703 {
6704 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6705 }
6706
6707 }
6708
6709 player.RemoveQuickBarEntityShortcut(this);
6710 }
6711 }
6712 }
6713
6715 {
6716 super.EEKilled(killer);
6717
6720 {
6721 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6722 {
6723 if (IsMagazine())
6724 {
6725 if (Magazine.Cast(this).GetAmmoCount() > 0)
6726 {
6728 }
6729 }
6730 else
6731 {
6733 }
6734 }
6735 }
6736 }
6737
6739 {
6740 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6741
6742 super.OnWasAttached(parent, slot_id);
6743
6746
6748 }
6749
6751 {
6752 super.OnWasDetached(parent, slot_id);
6753
6756 }
6757
6759 {
6760 int idx;
6763
6764 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6765 if (inventory_slots.Count() < 1)
6766 {
6767 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6768 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6769 }
6770 else
6771 {
6772 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6773 }
6774
6775 idx = inventory_slots.Find(slot);
6776 if (idx < 0)
6777 return "";
6778
6779 return attach_types.Get(idx);
6780 }
6781
6783 {
6784 int idx = -1;
6785 string slot;
6786
6789
6790 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6791 if (inventory_slots.Count() < 1)
6792 {
6793 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6794 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6795 }
6796 else
6797 {
6798 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6799 if (detach_types.Count() < 1)
6800 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6801 }
6802
6803 for (int i = 0; i < inventory_slots.Count(); i++)
6804 {
6805 slot = inventory_slots.Get(i);
6806 }
6807
6808 if (slot != "")
6809 {
6810 if (detach_types.Count() == 1)
6811 idx = 0;
6812 else
6813 idx = inventory_slots.Find(slot);
6814 }
6815 if (idx < 0)
6816 return "";
6817
6818 return detach_types.Get(idx);
6819 }
6820
6822 {
6823
6825
6826
6827 float min_time = 1;
6828 float max_time = 3;
6829 float delay = Math.RandomFloat(min_time, max_time);
6830
6831 explode_timer.Run(delay, this, "DoAmmoExplosion");
6832 }
6833
6835 {
6836 Magazine magazine = Magazine.Cast(this);
6837 int pop_sounds_count = 6;
6838 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6839
6840
6841 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6842 string sound_name = pop_sounds[ sound_idx ];
6844
6845
6846 magazine.ServerAddAmmoCount(-1);
6847
6848
6849 float min_temp_to_explode = 100;
6850
6851 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6852 {
6854 }
6855 }
6856
6857
6858 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6859 {
6860 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6861
6862 const int CHANCE_DAMAGE_CARGO = 4;
6863 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6864 const int CHANCE_DAMAGE_NOTHING = 2;
6865
6867 {
6868 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6869 int chances;
6870 int rnd;
6871
6872 if (GetInventory().GetCargo())
6873 {
6874 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6875 rnd = Math.RandomInt(0,chances);
6876
6877 if (rnd < CHANCE_DAMAGE_CARGO)
6878 {
6880 }
6881 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6882 {
6884 }
6885 }
6886 else
6887 {
6888 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6889 rnd = Math.RandomInt(0,chances);
6890
6891 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6892 {
6894 }
6895 }
6896 }
6897 }
6898
6900 {
6901 if (GetInventory().GetCargo())
6902 {
6903 int item_count = GetInventory().GetCargo().GetItemCount();
6904 if (item_count > 0)
6905 {
6906 int random_pick = Math.RandomInt(0, item_count);
6908 if (!item.IsExplosive())
6909 {
6910 item.AddHealth("","",damage);
6911 return true;
6912 }
6913 }
6914 }
6915 return false;
6916 }
6917
6919 {
6920 int attachment_count = GetInventory().AttachmentCount();
6921 if (attachment_count > 0)
6922 {
6923 int random_pick = Math.RandomInt(0, attachment_count);
6924 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6925 if (!attachment.IsExplosive())
6926 {
6927 attachment.AddHealth("","",damage);
6928 return true;
6929 }
6930 }
6931 return false;
6932 }
6933
6935 {
6937 }
6938
6940 {
6942 return GetInventory().CanRemoveEntity();
6943
6944 return false;
6945 }
6946
6948 {
6950 return;
6951
6953 {
6954 if (ScriptInputUserData.CanStoreInputUserData())
6955 {
6956 ScriptInputUserData ctx = new ScriptInputUserData;
6961 ctx.
Write(destination_entity);
6965 }
6966 }
6967 else if (!
GetGame().IsMultiplayer())
6968 {
6970 }
6971 }
6972
6974 {
6976 return;
6977
6978 float split_quantity_new;
6982 InventoryLocation loc = new InventoryLocation;
6983
6984 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6985 {
6987 split_quantity_new = stack_max;
6988 else
6990
6991 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6992 if (new_item)
6993 {
6994 new_item.SetResultOfSplit(true);
6995 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6997 new_item.SetQuantity(split_quantity_new);
6998 }
6999 }
7000 else if (destination_entity && slot_id == -1)
7001 {
7002 if (quantity > stack_max)
7003 split_quantity_new = stack_max;
7004 else
7005 split_quantity_new = quantity;
7006
7008 {
7011 }
7012
7013 if (new_item)
7014 {
7015 new_item.SetResultOfSplit(true);
7016 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7018 new_item.SetQuantity(split_quantity_new);
7019 }
7020 }
7021 else
7022 {
7023 if (stack_max != 0)
7024 {
7026 {
7028 }
7029
7030 if (split_quantity_new == 0)
7031 {
7032 if (!
GetGame().IsMultiplayer())
7033 player.PhysicalPredictiveDropItem(this);
7034 else
7035 player.ServerDropEntity(this);
7036 return;
7037 }
7038
7040
7041 if (new_item)
7042 {
7043 new_item.SetResultOfSplit(true);
7044 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7046 new_item.SetQuantity(stack_max);
7047 new_item.PlaceOnSurface();
7048 }
7049 }
7050 }
7051 }
7052
7054 {
7056 return;
7057
7058 float split_quantity_new;
7062 InventoryLocation loc = new InventoryLocation;
7063
7064 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7065 {
7067 split_quantity_new = stack_max;
7068 else
7070
7071 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7072 if (new_item)
7073 {
7074 new_item.SetResultOfSplit(true);
7075 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7077 new_item.SetQuantity(split_quantity_new);
7078 }
7079 }
7080 else if (destination_entity && slot_id == -1)
7081 {
7082 if (quantity > stack_max)
7083 split_quantity_new = stack_max;
7084 else
7085 split_quantity_new = quantity;
7086
7088 {
7091 }
7092
7093 if (new_item)
7094 {
7095 new_item.SetResultOfSplit(true);
7096 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7098 new_item.SetQuantity(split_quantity_new);
7099 }
7100 }
7101 else
7102 {
7103 if (stack_max != 0)
7104 {
7106 {
7108 }
7109
7111
7112 if (new_item)
7113 {
7114 new_item.SetResultOfSplit(true);
7115 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7117 new_item.SetQuantity(stack_max);
7118 new_item.PlaceOnSurface();
7119 }
7120 }
7121 }
7122 }
7123
7125 {
7127 return;
7128
7130 {
7131 if (ScriptInputUserData.CanStoreInputUserData())
7132 {
7133 ScriptInputUserData ctx = new ScriptInputUserData;
7138 dst.WriteToContext(ctx);
7140 }
7141 }
7142 else if (!
GetGame().IsMultiplayer())
7143 {
7145 }
7146 }
7147
7149 {
7151 return;
7152
7154 {
7155 if (ScriptInputUserData.CanStoreInputUserData())
7156 {
7157 ScriptInputUserData ctx = new ScriptInputUserData;
7162 ctx.
Write(destination_entity);
7168 }
7169 }
7170 else if (!
GetGame().IsMultiplayer())
7171 {
7173 }
7174 }
7175
7177 {
7179 }
7180
7182 {
7184 return this;
7185
7187 float split_quantity_new;
7189 if (dst.IsValid())
7190 {
7191 int slot_id = dst.GetSlot();
7193
7194 if (quantity > stack_max)
7195 split_quantity_new = stack_max;
7196 else
7197 split_quantity_new = quantity;
7198
7200
7201 if (new_item)
7202 {
7203 new_item.SetResultOfSplit(true);
7204 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7207 }
7208
7209 return new_item;
7210 }
7211
7212 return null;
7213 }
7214
7216 {
7218 return;
7219
7221 float split_quantity_new;
7223 if (destination_entity)
7224 {
7226 if (quantity > stackable)
7227 split_quantity_new = stackable;
7228 else
7229 split_quantity_new = quantity;
7230
7231 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7232 if (new_item)
7233 {
7234 new_item.SetResultOfSplit(true);
7235 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7237 new_item.SetQuantity(split_quantity_new);
7238 }
7239 }
7240 }
7241
7243 {
7245 return;
7246
7248 {
7249 if (ScriptInputUserData.CanStoreInputUserData())
7250 {
7251 ScriptInputUserData ctx = new ScriptInputUserData;
7256 ItemBase destination_entity =
this;
7257 ctx.
Write(destination_entity);
7261 }
7262 }
7263 else if (!
GetGame().IsMultiplayer())
7264 {
7266 }
7267 }
7268
7270 {
7272 return;
7273
7275 float split_quantity_new;
7277 if (player)
7278 {
7280 if (quantity > stackable)
7281 split_quantity_new = stackable;
7282 else
7283 split_quantity_new = quantity;
7284
7285 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7286 new_item =
ItemBase.Cast(in_hands);
7287 if (new_item)
7288 {
7289 new_item.SetResultOfSplit(true);
7290 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7292 new_item.SetQuantity(split_quantity_new);
7293 }
7294 }
7295 }
7296
7298 {
7300 return;
7301
7303 float split_quantity_new = Math.Floor(quantity * 0.5);
7304
7306
7307 if (new_item)
7308 {
7309 if (new_item.GetQuantityMax() < split_quantity_new)
7310 {
7311 split_quantity_new = new_item.GetQuantityMax();
7312 }
7313
7314 new_item.SetResultOfSplit(true);
7315 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7316
7318 {
7321 }
7322 else
7323 {
7326 }
7327 }
7328 }
7329
7331 {
7333 return;
7334
7336 float split_quantity_new = Math.Floor(quantity / 2);
7337
7338 InventoryLocation invloc = new InventoryLocation;
7340
7342 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7343
7344 if (new_item)
7345 {
7346 if (new_item.GetQuantityMax() < split_quantity_new)
7347 {
7348 split_quantity_new = new_item.GetQuantityMax();
7349 }
7351 {
7354 }
7355 else
7356 {
7359 }
7360 }
7361 }
7362
7365 {
7366 SetWeightDirty();
7368
7369 if (parent)
7370 parent.OnAttachmentQuantityChangedEx(this, delta);
7371
7373 {
7375 {
7377 }
7379 {
7380 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7382 }
7383 }
7384
7385 }
7386
7389 {
7390
7391 }
7392
7395 {
7397 }
7398
7400 {
7401 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7402
7404 {
7405 if (newLevel == GameConstants.STATE_RUINED)
7406 {
7408 EntityAI parent = GetHierarchyParent();
7409 if (parent && parent.IsFireplace())
7410 {
7411 CargoBase cargo = GetInventory().GetCargo();
7412 if (cargo)
7413 {
7415 {
7417 }
7418 }
7419 }
7420 }
7421
7423 {
7424
7426 return;
7427 }
7428
7429 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7430 {
7432 }
7433 }
7434 }
7435
7436
7438 {
7439 super.OnRightClick();
7440
7442 {
7444 {
7445 if (ScriptInputUserData.CanStoreInputUserData())
7446 {
7447 vector m4[4];
7449
7450 EntityAI root = GetHierarchyRoot();
7451
7452 InventoryLocation dst = new InventoryLocation;
7454 {
7455 if (root)
7456 {
7457 root.GetTransform(m4);
7459 }
7460 else
7461 GetInventory().GetCurrentInventoryLocation(dst);
7462 }
7463 else
7464 {
7466
7467
7468 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7469 {
7470 if (root)
7471 {
7472 root.GetTransform(m4);
7474 }
7475 else
7476 GetInventory().GetCurrentInventoryLocation(dst);
7477 }
7478 else
7479 {
7480 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7481 }
7482 }
7483
7484 ScriptInputUserData ctx = new ScriptInputUserData;
7492 }
7493 }
7494 else if (!
GetGame().IsMultiplayer())
7495 {
7497 }
7498 }
7499 }
7500
7501 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7502 {
7503
7504 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7505 return false;
7506
7507 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7508 return false;
7509
7510
7512 return false;
7513
7514
7515 Magazine mag = Magazine.Cast(this);
7516 if (mag)
7517 {
7518 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7519 return false;
7520
7521 if (stack_max_limit)
7522 {
7523 Magazine other_mag = Magazine.Cast(other_item);
7524 if (other_item)
7525 {
7526 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7527 return false;
7528 }
7529
7530 }
7531 }
7532 else
7533 {
7534
7536 return false;
7537
7539 return false;
7540 }
7541
7542 PlayerBase player = null;
7543 if (CastTo(player, GetHierarchyRootPlayer()))
7544 {
7545 if (player.GetInventory().HasAttachment(this))
7546 return false;
7547
7548 if (player.IsItemsToDelete())
7549 return false;
7550 }
7551
7552 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7553 return false;
7554
7555 int slotID;
7557 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7558 return false;
7559
7560 return true;
7561 }
7562
7564 {
7566 }
7567
7569 {
7570 return m_IsResultOfSplit;
7571 }
7572
7574 {
7575 m_IsResultOfSplit = value;
7576 }
7577
7579 {
7581 }
7582
7584 {
7585 float other_item_quantity = other_item.GetQuantity();
7586 float this_free_space;
7587
7589
7591
7592 if (other_item_quantity > this_free_space)
7593 {
7594 return this_free_space;
7595 }
7596 else
7597 {
7598 return other_item_quantity;
7599 }
7600 }
7601
7603 {
7605 }
7606
7608 {
7610 return;
7611
7612 if (!IsMagazine() && other_item)
7613 {
7615 if (quantity_used != 0)
7616 {
7617 float hp1 = GetHealth01("","");
7618 float hp2 = other_item.GetHealth01("","");
7619 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7620 hpResult = hpResult / (
GetQuantity() + quantity_used);
7621
7622 hpResult *= GetMaxHealth();
7623 Math.Round(hpResult);
7624 SetHealth("", "Health", hpResult);
7625
7627 other_item.AddQuantity(-quantity_used);
7628 }
7629 }
7631 }
7632
7634 {
7635 #ifdef SERVER
7636 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7637 GetHierarchyParent().IncreaseLifetimeUp();
7638 #endif
7639 };
7640
7642 {
7643 PlayerBase p = PlayerBase.Cast(player);
7644
7645 array<int> recipesIds = p.m_Recipes;
7646 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7647 if (moduleRecipesManager)
7648 {
7649 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7650 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7651 }
7652
7653 for (int i = 0;i < recipesIds.Count(); i++)
7654 {
7655 int key = recipesIds.Get(i);
7656 string recipeName = moduleRecipesManager.GetRecipeName(key);
7658 }
7659 }
7660
7661
7662 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7663 {
7664 super.GetDebugActions(outputList);
7665
7666
7671
7672
7676
7680
7681
7684
7685
7687 {
7690 }
7691
7693
7696
7700 }
7701
7702
7703
7704
7706 {
7707 super.OnAction(action_id, player, ctx);
7708 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7709 {
7710 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7711 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7712 PlayerBase p = PlayerBase.Cast(player);
7713 if (
EActions.RECIPES_RANGE_START < 1000)
7714 {
7715 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7716 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7717 }
7718 }
7719 #ifndef SERVER
7720 else if (action_id ==
EActions.WATCH_PLAYER)
7721 {
7722 PluginDeveloper.SetDeveloperItemClientEx(player);
7723 }
7724 #endif
7726 {
7727 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7728 {
7729 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7730 OnDebugButtonPressServer(id + 1);
7731 }
7732
7733 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7734 {
7735 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7737 }
7738
7739 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7740 {
7741 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7743 }
7744
7745 else if (action_id ==
EActions.ADD_QUANTITY)
7746 {
7747 if (IsMagazine())
7748 {
7749 Magazine mag = Magazine.Cast(this);
7750 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7751 }
7752 else
7753 {
7755 }
7756
7757 if (m_EM)
7758 {
7759 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7760 }
7761
7762 }
7763
7764 else if (action_id ==
EActions.REMOVE_QUANTITY)
7765 {
7766 if (IsMagazine())
7767 {
7768 Magazine mag2 = Magazine.Cast(this);
7769 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7770 }
7771 else
7772 {
7774 }
7775 if (m_EM)
7776 {
7777 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7778 }
7779
7780 }
7781
7782 else if (action_id ==
EActions.SET_QUANTITY_0)
7783 {
7785
7786 if (m_EM)
7787 {
7788 m_EM.SetEnergy(0);
7789 }
7790 }
7791
7792 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7793 {
7795
7796 if (m_EM)
7797 {
7798 m_EM.SetEnergy(m_EM.GetEnergyMax());
7799 }
7800 }
7801
7802 else if (action_id ==
EActions.ADD_HEALTH)
7803 {
7804 AddHealth("","",GetMaxHealth("","Health")/5);
7805 }
7806 else if (action_id ==
EActions.REMOVE_HEALTH)
7807 {
7808 AddHealth("","",-GetMaxHealth("","Health")/5);
7809 }
7810 else if (action_id ==
EActions.DESTROY_HEALTH)
7811 {
7812 SetHealth01("","",0);
7813 }
7814 else if (action_id ==
EActions.WATCH_ITEM)
7815 {
7817 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7818 #ifdef DEVELOPER
7819 SetDebugDeveloper_item(this);
7820 #endif
7821 }
7822
7823 else if (action_id ==
EActions.ADD_TEMPERATURE)
7824 {
7825 AddTemperature(20);
7826
7827 }
7828
7829 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7830 {
7831 AddTemperature(-20);
7832
7833 }
7834
7835 else if (action_id ==
EActions.FLIP_FROZEN)
7836 {
7837 SetFrozen(!GetIsFrozen());
7838
7839 }
7840
7841 else if (action_id ==
EActions.ADD_WETNESS)
7842 {
7844
7845 }
7846
7847 else if (action_id ==
EActions.REMOVE_WETNESS)
7848 {
7850
7851 }
7852
7853 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7854 {
7857
7858
7859 }
7860
7861 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7862 {
7865 }
7866
7867 else if (action_id ==
EActions.MAKE_SPECIAL)
7868 {
7869 auto debugParams = DebugSpawnParams.WithPlayer(player);
7870 OnDebugSpawnEx(debugParams);
7871 }
7872
7873 else if (action_id ==
EActions.DELETE)
7874 {
7875 Delete();
7876 }
7877
7878 }
7879
7880
7881 return false;
7882 }
7883
7884
7885
7886
7890
7893
7894
7895
7897 {
7898 return false;
7899 }
7900
7901
7903 {
7904 return true;
7905 }
7906
7907
7909 {
7910 return true;
7911 }
7912
7913
7914
7916 {
7917 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7919 }
7920
7923 {
7924 return null;
7925 }
7926
7928 {
7929 return false;
7930 }
7931
7933 {
7934 return false;
7935 }
7936
7940
7941
7943 {
7944 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7945 return module_repairing.CanRepair(this, item_repair_kit);
7946 }
7947
7948
7949 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7950 {
7951 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7952 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7953 }
7954
7955
7957 {
7958
7959
7960
7961
7962
7963
7964
7965
7966 return 1;
7967 }
7968
7969
7970
7972 {
7974 }
7975
7976
7977
7979 {
7981 }
7982
7983
7992 {
7993 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7994
7995 if (player)
7996 {
7997 player.MessageStatus(text);
7998 }
7999 }
8000
8001
8010 {
8011 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8012
8013 if (player)
8014 {
8015 player.MessageAction(text);
8016 }
8017 }
8018
8019
8028 {
8029 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8030
8031 if (player)
8032 {
8033 player.MessageFriendly(text);
8034 }
8035 }
8036
8037
8046 {
8047 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8048
8049 if (player)
8050 {
8051 player.MessageImportant(text);
8052 }
8053 }
8054
8056 {
8057 return true;
8058 }
8059
8060
8061 override bool KindOf(
string tag)
8062 {
8063 bool found = false;
8064 string item_name = this.
GetType();
8067
8068 int array_size = item_tag_array.Count();
8069 for (int i = 0; i < array_size; i++)
8070 {
8071 if (item_tag_array.Get(i) == tag)
8072 {
8073 found = true;
8074 break;
8075 }
8076 }
8077 return found;
8078 }
8079
8080
8082 {
8083
8084 super.OnRPC(sender, rpc_type,ctx);
8085
8086
8087 switch (rpc_type)
8088 {
8089 #ifndef SERVER
8090 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8091 Param2<bool, string> p = new Param2<bool, string>(false, "");
8092
8094 return;
8095
8096 bool play = p.param1;
8097 string soundSet = p.param2;
8098
8099 if (play)
8100 {
8102 {
8104 {
8106 }
8107 }
8108 else
8109 {
8111 }
8112 }
8113 else
8114 {
8116 }
8117
8118 break;
8119 #endif
8120
8121 }
8122
8124 {
8126 }
8127 }
8128
8129
8130
8131
8133 {
8134 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8135 return plugin.GetID(
name);
8136 }
8137
8139 {
8140 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8141 return plugin.GetName(id);
8142 }
8143
8146 {
8147
8148
8149 int varFlags;
8150 if (!ctx.
Read(varFlags))
8151 return;
8152
8153 if (varFlags & ItemVariableFlags.FLOAT)
8154 {
8156 }
8157 }
8158
8160 {
8161
8162 super.SerializeNumericalVars(floats_out);
8163
8164
8165
8167 {
8169 }
8170
8172 {
8174 }
8175
8177 {
8179 }
8180
8182 {
8187 }
8188
8190 {
8192 }
8193 }
8194
8196 {
8197
8198 super.DeSerializeNumericalVars(floats);
8199
8200
8201 int index = 0;
8202 int mask = Math.Round(floats.Get(index));
8203
8204 index++;
8205
8207 {
8209 {
8211 }
8212 else
8213 {
8214 float quantity = floats.Get(index);
8216 }
8217 index++;
8218 }
8219
8221 {
8222 float wet = floats.Get(index);
8224 index++;
8225 }
8226
8228 {
8229 int liquidtype = Math.Round(floats.Get(index));
8231 index++;
8232 }
8233
8235 {
8237 index++;
8239 index++;
8241 index++;
8243 index++;
8244 }
8245
8247 {
8248 int cleanness = Math.Round(floats.Get(index));
8250 index++;
8251 }
8252 }
8253
8255 {
8256 super.WriteVarsToCTX(ctx);
8257
8258
8260 {
8262 }
8263
8265 {
8267 }
8268
8270 {
8272 }
8273
8275 {
8276 int r,g,b,a;
8282 }
8283
8285 {
8287 }
8288 }
8289
8291 {
8292 if (!super.ReadVarsFromCTX(ctx,version))
8293 return false;
8294
8295 int intValue;
8296 float value;
8297
8298 if (version < 140)
8299 {
8300 if (!ctx.
Read(intValue))
8301 return false;
8302
8303 m_VariablesMask = intValue;
8304 }
8305
8307 {
8308 if (!ctx.
Read(value))
8309 return false;
8310
8312 {
8314 }
8315 else
8316 {
8318 }
8319 }
8320
8321 if (version < 140)
8322 {
8324 {
8325 if (!ctx.
Read(value))
8326 return false;
8327 SetTemperatureDirect(value);
8328 }
8329 }
8330
8332 {
8333 if (!ctx.
Read(value))
8334 return false;
8336 }
8337
8339 {
8340 if (!ctx.
Read(intValue))
8341 return false;
8343 }
8344
8346 {
8347 int r,g,b,a;
8349 return false;
8351 return false;
8353 return false;
8355 return false;
8356
8358 }
8359
8361 {
8362 if (!ctx.
Read(intValue))
8363 return false;
8365 }
8366
8367 if (version >= 138 && version < 140)
8368 {
8370 {
8371 if (!ctx.
Read(intValue))
8372 return false;
8373 SetFrozen(intValue);
8374 }
8375 }
8376
8377 return true;
8378 }
8379
8380
8382 {
8385 {
8387 }
8388
8389 if (!super.OnStoreLoad(ctx, version))
8390 {
8392 return false;
8393 }
8394
8395 if (version >= 114)
8396 {
8397 bool hasQuickBarIndexSaved;
8398
8399 if (!ctx.
Read(hasQuickBarIndexSaved))
8400 {
8402 return false;
8403 }
8404
8405 if (hasQuickBarIndexSaved)
8406 {
8407 int itmQBIndex;
8408
8409
8410 if (!ctx.
Read(itmQBIndex))
8411 {
8413 return false;
8414 }
8415
8416 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8417 if (itmQBIndex != -1 && parentPlayer)
8418 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8419 }
8420 }
8421 else
8422 {
8423
8424 PlayerBase player;
8425 int itemQBIndex;
8426 if (version ==
int.
MAX)
8427 {
8428 if (!ctx.
Read(itemQBIndex))
8429 {
8431 return false;
8432 }
8433 }
8434 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8435 {
8436
8437 if (!ctx.
Read(itemQBIndex))
8438 {
8440 return false;
8441 }
8442 if (itemQBIndex != -1 && player)
8443 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8444 }
8445 }
8446
8447 if (version < 140)
8448 {
8449
8450 if (!LoadVariables(ctx, version))
8451 {
8453 return false;
8454 }
8455 }
8456
8457
8459 {
8461 return false;
8462 }
8463 if (version >= 132)
8464 {
8466 if (raib)
8467 {
8469 {
8471 return false;
8472 }
8473 }
8474 }
8475
8477 return true;
8478 }
8479
8480
8481
8483 {
8484 super.OnStoreSave(ctx);
8485
8486 PlayerBase player;
8487 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8488 {
8490
8491 int itemQBIndex = -1;
8492 itemQBIndex = player.FindQuickBarEntityIndex(this);
8493 ctx.
Write(itemQBIndex);
8494 }
8495 else
8496 {
8498 }
8499
8501
8503 if (raib)
8504 {
8506 }
8507 }
8508
8509
8511 {
8512 super.AfterStoreLoad();
8513
8515 {
8517 }
8518
8520 {
8523 }
8524 }
8525
8527 {
8528 super.EEOnAfterLoad();
8529
8531 {
8533 }
8534
8537 }
8538
8540 {
8541 return false;
8542 }
8543
8544
8545
8547 {
8549 {
8550 #ifdef PLATFORM_CONSOLE
8551
8553 {
8555 if (menu)
8556 {
8558 }
8559 }
8560 #endif
8561 }
8562
8564 {
8567 }
8568
8570 {
8571 SetWeightDirty();
8573 }
8575 {
8578 }
8579
8581 {
8584 }
8586 {
8589 }
8590
8591 super.OnVariablesSynchronized();
8592 }
8593
8594
8595
8597 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8598 {
8599 if (!IsServerCheck(allow_client))
8600 return false;
8601
8603 return false;
8604
8607
8608 if (value <= (min + 0.001))
8609 value = min;
8610
8611 if (value == min)
8612 {
8613 if (destroy_config)
8614 {
8615 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8616 if (dstr)
8617 {
8619 this.Delete();
8620 return true;
8621 }
8622 }
8623 else if (destroy_forced)
8624 {
8626 this.Delete();
8627 return true;
8628 }
8629
8631 }
8632
8635
8637 {
8639
8640 if (delta)
8642 }
8643
8645
8646 return false;
8647 }
8648
8649
8651 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8652 {
8654 }
8655
8657 {
8660 }
8661
8663 {
8666 }
8667
8670 {
8671 float value_clamped = Math.Clamp(value, 0, 1);
8673 SetQuantity(result, destroy_config, destroy_forced);
8674 }
8675
8676
8679 {
8681 }
8682
8684 {
8686 }
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8698 {
8699 int slot = -1;
8700 if (GetInventory())
8701 {
8702 InventoryLocation il = new InventoryLocation;
8703 GetInventory().GetCurrentInventoryLocation(il);
8705 }
8706
8708 }
8709
8711 {
8712 float quantity_max = 0;
8713
8715 {
8716 if (attSlotID != -1)
8717 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8718
8719 if (quantity_max <= 0)
8721 }
8722
8723 if (quantity_max <= 0)
8725
8726 return quantity_max;
8727 }
8728
8730 {
8732 }
8733
8735 {
8737 }
8738
8739
8741 {
8743 }
8744
8746 {
8748 }
8749
8751 {
8753 }
8754
8755
8757 {
8758
8759 float weightEx = GetWeightEx();
8760 float special = GetInventoryAndCargoWeight();
8761 return weightEx - special;
8762 }
8763
8764
8766 {
8768 }
8769
8771 {
8773 {
8774 #ifdef DEVELOPER
8775 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8776 {
8777 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8779 }
8780 #endif
8781
8783 }
8784 else if (HasEnergyManager())
8785 {
8786 #ifdef DEVELOPER
8787 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8788 {
8789 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8790 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8791 }
8792 #endif
8793 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8794 }
8795 else
8796 {
8797 #ifdef DEVELOPER
8798 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8799 {
8800 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8801 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8802 }
8803 #endif
8804 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8805 }
8806 }
8807
8810 {
8811 int item_count = 0;
8813
8814 if (GetInventory().GetCargo() != NULL)
8815 {
8816 item_count = GetInventory().GetCargo().GetItemCount();
8817 }
8818
8819 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8820 {
8821 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8822 if (item)
8823 item_count += item.GetNumberOfItems();
8824 }
8825 return item_count;
8826 }
8827
8830 {
8831 float weight = 0;
8832 float wetness = 1;
8833 if (include_wetness)
8836 {
8837 weight = wetness * m_ConfigWeight;
8838 }
8840 {
8841 weight = 1;
8842 }
8843 return weight;
8844 }
8845
8846
8847
8849 {
8850 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8851 {
8852 GameInventory inv = GetInventory();
8853 array<EntityAI> items = new array<EntityAI>;
8855 for (int i = 0; i < items.Count(); i++)
8856 {
8858 if (item)
8859 {
8861 }
8862 }
8863 }
8864 }
8865
8866
8867
8868
8870 {
8871 float energy = 0;
8872 if (HasEnergyManager())
8873 {
8874 energy = GetCompEM().GetEnergy();
8875 }
8876 return energy;
8877 }
8878
8879
8881 {
8882 super.OnEnergyConsumed();
8883
8885 }
8886
8888 {
8889 super.OnEnergyAdded();
8890
8892 }
8893
8894
8896 {
8897 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8898 {
8900 {
8901 float energy_0to1 = GetCompEM().GetEnergy0To1();
8903 }
8904 }
8905 }
8906
8907
8909 {
8910 return ConfigGetFloat("heatIsolation");
8911 }
8912
8914 {
8916 }
8917
8919 {
8920 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8921 if (
GetGame().ConfigIsExisting(paramPath))
8923
8924 return 0.0;
8925 }
8926
8928 {
8929 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8930 if (
GetGame().ConfigIsExisting(paramPath))
8932
8933 return 0.0;
8934 }
8935
8936 override void SetWet(
float value,
bool allow_client =
false)
8937 {
8938 if (!IsServerCheck(allow_client))
8939 return;
8940
8943
8945
8946 m_VarWet = Math.Clamp(value, min, max);
8947
8949 {
8952 }
8953 }
8954
8955 override void AddWet(
float value)
8956 {
8958 }
8959
8961 {
8963 }
8964
8966 {
8968 }
8969
8971 {
8973 }
8974
8976 {
8978 }
8979
8981 {
8983 }
8984
8986 {
8989 if (newLevel != oldLevel)
8990 {
8992 }
8993 }
8994
8996 {
8997 SetWeightDirty();
8998 }
8999
9001 {
9002 return GetWetLevelInternal(
m_VarWet);
9003 }
9004
9005
9006
9008 {
9010 }
9011
9013 {
9015 }
9016
9018 {
9020 }
9021
9023 {
9025 }
9026
9027
9028
9030 {
9031 if (ConfigIsExisting("itemModelLength"))
9032 {
9033 return ConfigGetFloat("itemModelLength");
9034 }
9035 return 0;
9036 }
9037
9039 {
9040 if (ConfigIsExisting("itemAttachOffset"))
9041 {
9042 return ConfigGetFloat("itemAttachOffset");
9043 }
9044 return 0;
9045 }
9046
9047 override void SetCleanness(
int value,
bool allow_client =
false)
9048 {
9049 if (!IsServerCheck(allow_client))
9050 return;
9051
9053
9055
9058 }
9059
9061 {
9063 }
9064
9066 {
9067 return true;
9068 }
9069
9070
9071
9072
9074 {
9076 }
9077
9079 {
9081 }
9082
9083
9084
9085
9086 override void SetColor(
int r,
int g,
int b,
int a)
9087 {
9093 }
9095 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9096 {
9101 }
9102
9104 {
9106 }
9107
9110 {
9111 int r,g,b,a;
9113 r = r/255;
9114 g = g/255;
9115 b = b/255;
9116 a = a/255;
9117 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9118 }
9119
9120
9121
9122 override void SetLiquidType(
int value,
bool allow_client =
false)
9123 {
9124 if (!IsServerCheck(allow_client))
9125 return;
9126
9131 }
9132
9134 {
9135 return ConfigGetInt("varLiquidTypeInit");
9136 }
9137
9139 {
9141 }
9142
9144 {
9146 SetFrozen(false);
9147 }
9148
9151 {
9152 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9153 }
9154
9155
9158 {
9159 PlayerBase nplayer;
9160 if (PlayerBase.CastTo(nplayer, player))
9161 {
9163
9164 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9165 }
9166 }
9167
9168
9171 {
9172 PlayerBase nplayer;
9173 if (PlayerBase.CastTo(nplayer,player))
9174 {
9175
9176 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9177
9178 }
9179
9180
9181 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9182
9183
9184 if (HasEnergyManager())
9185 {
9186 GetCompEM().UpdatePlugState();
9187 }
9188 }
9189
9190
9192 {
9193 super.OnPlacementStarted(player);
9194
9196 }
9197
9198 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9199 {
9201 {
9202 m_AdminLog.OnPlacementComplete(player,
this);
9203 }
9204
9205 super.OnPlacementComplete(player, position, orientation);
9206 }
9207
9208
9209
9210
9211
9213 {
9215 {
9216 return true;
9217 }
9218 else
9219 {
9220 return false;
9221 }
9222 }
9223
9224
9226 {
9228 {
9230 }
9231 }
9232
9233
9235 {
9237 }
9238
9240 {
9242 }
9243
9244 override void InsertAgent(
int agent,
float count = 1)
9245 {
9246 if (count < 1)
9247 return;
9248
9250 }
9251
9254 {
9256 }
9257
9258
9260 {
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
9299
9300
9301
9302
9303
9304
9306 {
9308 return false;
9309 return true;
9310 }
9311
9313 {
9314
9316 }
9317
9318
9321 {
9322 super.CheckForRoofLimited(timeTresholdMS);
9323
9325 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9326 {
9327 m_PreviousRoofTestTime = time;
9328 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9329 }
9330 }
9331
9332
9334 {
9336 {
9337 return 0;
9338 }
9339
9340 if (GetInventory().GetAttachmentSlotsCount() != 0)
9341 {
9342 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9343 if (filter)
9344 return filter.GetProtectionLevel(type, false, system);
9345 else
9346 return 0;
9347 }
9348
9349 string subclassPath, entryName;
9350
9351 switch (type)
9352 {
9354 entryName = "biological";
9355 break;
9357 entryName = "chemical";
9358 break;
9359 default:
9360 entryName = "biological";
9361 break;
9362 }
9363
9364 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9365
9367 }
9368
9369
9370
9373 {
9374 if (!IsMagazine())
9376
9378 }
9379
9380
9381
9382
9383
9388 {
9389 return true;
9390 }
9391
9393 {
9395 }
9396
9397
9398
9399
9400
9402 {
9403 if (parent)
9404 {
9405 if (parent.IsInherited(DayZInfected))
9406 return true;
9407
9408 if (!parent.IsRuined())
9409 return true;
9410 }
9411
9412 return true;
9413 }
9414
9416 {
9417 if (!super.CanPutAsAttachment(parent))
9418 {
9419 return false;
9420 }
9421
9422 if (!IsRuined() && !parent.IsRuined())
9423 {
9424 return true;
9425 }
9426
9427 return false;
9428 }
9429
9431 {
9432
9433
9434
9435
9436 return super.CanReceiveItemIntoCargo(item);
9437 }
9438
9440 {
9441
9442
9443
9444
9445 GameInventory attachmentInv = attachment.GetInventory();
9447 {
9448 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9449 return false;
9450 }
9451
9452 InventoryLocation loc = new InventoryLocation();
9453 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9454 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9455 return false;
9456
9457 return super.CanReceiveAttachment(attachment, slotId);
9458 }
9459
9461 {
9462 if (!super.CanReleaseAttachment(attachment))
9463 return false;
9464
9465 return GetInventory().AreChildrenAccessible();
9466 }
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9489 {
9490 int id = muzzle_owner.GetMuzzleID();
9491 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9492
9493 if (WPOF_array)
9494 {
9495 for (int i = 0; i < WPOF_array.Count(); i++)
9496 {
9497 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9498
9499 if (WPOF)
9500 {
9501 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9502 }
9503 }
9504 }
9505 }
9506
9507
9509 {
9510 int id = muzzle_owner.GetMuzzleID();
9512
9513 if (WPOBE_array)
9514 {
9515 for (int i = 0; i < WPOBE_array.Count(); i++)
9516 {
9517 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9518
9519 if (WPOBE)
9520 {
9521 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9522 }
9523 }
9524 }
9525 }
9526
9527
9529 {
9530 int id = muzzle_owner.GetMuzzleID();
9531 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9532
9533 if (WPOOH_array)
9534 {
9535 for (int i = 0; i < WPOOH_array.Count(); i++)
9536 {
9537 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9538
9539 if (WPOOH)
9540 {
9541 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9542 }
9543 }
9544 }
9545 }
9546
9547
9549 {
9550 int id = muzzle_owner.GetMuzzleID();
9551 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9552
9553 if (WPOOH_array)
9554 {
9555 for (int i = 0; i < WPOOH_array.Count(); i++)
9556 {
9557 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9558
9559 if (WPOOH)
9560 {
9561 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9562 }
9563 }
9564 }
9565 }
9566
9567
9569 {
9570 int id = muzzle_owner.GetMuzzleID();
9571 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9572
9573 if (WPOOH_array)
9574 {
9575 for (int i = 0; i < WPOOH_array.Count(); i++)
9576 {
9577 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9578
9579 if (WPOOH)
9580 {
9581 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9582 }
9583 }
9584 }
9585 }
9586
9587
9588
9590 {
9592 {
9593 return true;
9594 }
9595
9596 return false;
9597 }
9598
9600 {
9602 {
9603 return true;
9604 }
9605
9606 return false;
9607 }
9608
9610 {
9612 {
9613 return true;
9614 }
9615
9616 return false;
9617 }
9618
9620 {
9621 return false;
9622 }
9623
9626 {
9627 return UATimeSpent.DEFAULT_DEPLOY;
9628 }
9629
9630
9631
9632
9634 {
9636 SetSynchDirty();
9637 }
9638
9640 {
9642 }
9643
9644
9646 {
9647 return false;
9648 }
9649
9652 {
9653 string att_type = "None";
9654
9655 if (ConfigIsExisting("soundAttType"))
9656 {
9657 att_type = ConfigGetString("soundAttType");
9658 }
9659
9661 }
9662
9664 {
9666 }
9667
9668
9669
9670
9671
9675
9677 {
9680
9682 }
9683
9684
9686 {
9688 return;
9689
9691
9694
9697
9698 SoundParameters params = new SoundParameters();
9702 }
9703
9704
9706 {
9708 return;
9709
9711 SetSynchDirty();
9712
9715 }
9716
9717
9719 {
9721 return;
9722
9724 SetSynchDirty();
9725
9728 }
9729
9731 {
9733 }
9734
9736 {
9738 }
9739
9742 {
9743 if (!
GetGame().IsDedicatedServer())
9744 {
9745 if (ConfigIsExisting("attachSoundSet"))
9746 {
9747 string cfg_path = "";
9748 string soundset = "";
9750
9753 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9754 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9755
9756 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9757 {
9758 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9759 {
9760 if (cfg_slot_array[i] == slot_type)
9761 {
9762 soundset = cfg_soundset_array[i];
9763 break;
9764 }
9765 }
9766 }
9767
9768 if (soundset != "")
9769 {
9770 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9772 }
9773 }
9774 }
9775 }
9776
9778 {
9779
9780 }
9781
9782 void OnApply(PlayerBase player);
9783
9785 {
9786 return 1.0;
9787 };
9788
9790 {
9792 }
9793
9795 {
9797 }
9798
9800
9802 {
9803 SetDynamicPhysicsLifeTime(0.01);
9805 }
9806
9808 {
9809 array<string> zone_names = new array<string>;
9810 GetDamageZones(zone_names);
9811 for (int i = 0; i < zone_names.Count(); i++)
9812 {
9813 SetHealthMax(zone_names.Get(i),"Health");
9814 }
9815 SetHealthMax("","Health");
9816 }
9817
9820 {
9821 float global_health = GetHealth01("","Health");
9822 array<string> zones = new array<string>;
9823 GetDamageZones(zones);
9824
9825 for (int i = 0; i < zones.Count(); i++)
9826 {
9827 SetHealth01(zones.Get(i),"Health",global_health);
9828 }
9829 }
9830
9833 {
9834 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9835 }
9836
9838 {
9839 if (!hasRootAsPlayer)
9840 {
9841 if (refParentIB)
9842 {
9843
9844 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9845 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9846
9847 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9848 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9849
9852 }
9853 else
9854 {
9855
9858 }
9859 }
9860 }
9861
9863 {
9865 {
9866 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9867 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9868 {
9869 float heatPermCoef = 1.0;
9871 while (ent)
9872 {
9873 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9874 ent = ent.GetHierarchyParent();
9875 }
9876
9877 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9878 }
9879 }
9880 }
9881
9883 {
9884
9885 EntityAI parent = GetHierarchyParent();
9886 if (!parent)
9887 {
9888 hasParent = false;
9889 hasRootAsPlayer = false;
9890 }
9891 else
9892 {
9893 hasParent = true;
9894 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9895 refParentIB =
ItemBase.Cast(parent);
9896 }
9897 }
9898
9899 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9900 {
9901
9902 }
9903
9905 {
9906
9907 return false;
9908 }
9909
9911 {
9912
9913
9914 return false;
9915 }
9916
9918 {
9919
9920 return false;
9921 }
9922
9925 {
9926 return !GetIsFrozen() &&
IsOpen();
9927 }
9928
9930 {
9931 bool hasParent = false, hasRootAsPlayer = false;
9933
9934 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9935 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9936
9937 if (wwtu || foodDecay)
9938 {
9942
9943 if (processWetness || processTemperature || processDecay)
9944 {
9946
9947 if (processWetness)
9948 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9949
9950 if (processTemperature)
9952
9953 if (processDecay)
9954 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9955 }
9956 }
9957 }
9958
9961 {
9963 }
9964
9966 {
9969
9970 return super.GetTemperatureFreezeThreshold();
9971 }
9972
9974 {
9977
9978 return super.GetTemperatureThawThreshold();
9979 }
9980
9982 {
9985
9986 return super.GetItemOverheatThreshold();
9987 }
9988
9990 {
9992 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9993
9994 return super.GetTemperatureFreezeTime();
9995 }
9996
9998 {
10000 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10001
10002 return super.GetTemperatureThawTime();
10003 }
10004
10009
10011 {
10012 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10013 }
10014
10016 {
10017 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10018 }
10019
10022 {
10024 }
10025
10027 {
10029 }
10030
10032 {
10034 }
10035
10038 {
10039 return null;
10040 }
10041
10044 {
10045 return false;
10046 }
10047
10049 {
10051 {
10054 if (!trg)
10055 {
10057 explosive = this;
10058 }
10059
10060 explosive.PairRemote(trg);
10062
10063 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10064 trg.SetPersistentPairID(persistentID);
10065 explosive.SetPersistentPairID(persistentID);
10066
10067 return true;
10068 }
10069 return false;
10070 }
10071
10074 {
10075 float ret = 1.0;
10078 ret *= GetHealth01();
10079
10080 return ret;
10081 }
10082
10083 #ifdef DEVELOPER
10084 override void SetDebugItem()
10085 {
10086 super.SetDebugItem();
10087 _itemBase = this;
10088 }
10089
10091 {
10092 string text = super.GetDebugText();
10093
10095 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10096
10097 return text;
10098 }
10099 #endif
10100
10102 {
10103 return true;
10104 }
10105
10107
10109
10111 {
10114 }
10115
10116
10124
10140}
10141
10143{
10145 if (entity)
10146 {
10147 bool is_item = entity.IsInherited(
ItemBase);
10148 if (is_item && full_quantity)
10149 {
10152 }
10153 }
10154 else
10155 {
10157 return NULL;
10158 }
10159 return entity;
10160}
10161
10163{
10164 if (item)
10165 {
10166 if (health > 0)
10167 item.SetHealth("", "", health);
10168
10169 if (item.CanHaveTemperature())
10170 {
10172 if (item.CanFreeze())
10173 item.SetFrozen(false);
10174 }
10175
10176 if (item.HasEnergyManager())
10177 {
10178 if (quantity >= 0)
10179 {
10180 item.GetCompEM().SetEnergy0To1(quantity);
10181 }
10182 else
10183 {
10185 }
10186 }
10187 else if (item.IsMagazine())
10188 {
10189 Magazine mag = Magazine.Cast(item);
10190 if (quantity >= 0)
10191 {
10192 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10193 }
10194 else
10195 {
10197 }
10198
10199 }
10200 else
10201 {
10202 if (quantity >= 0)
10203 {
10204 item.SetQuantityNormalized(quantity, false);
10205 }
10206 else
10207 {
10209 }
10210
10211 }
10212 }
10213}
10214
10215#ifdef DEVELOPER
10217#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.