5291{
5293 {
5294 return true;
5295 }
5296};
5297
5298
5299
5301{
5305
5307
5310
5311
5312
5313
5314
5323
5329
5334
5339
5360 protected bool m_IsResultOfSplit
5361
5363
5368
5369
5370
5372
5376
5377
5378
5380
5383
5384
5385
5391
5392
5400
5403
5404
5406
5407
5409
5410
5415
5416
5421
5422
5424
5425
5427 {
5432
5433 if (!
GetGame().IsDedicatedServer())
5434 {
5436 {
5438
5440 {
5442 }
5443 }
5444
5447 }
5448
5449 m_OldLocation = null;
5450
5452 {
5454 }
5455
5456 if (ConfigIsExisting("headSelectionsToHide"))
5457 {
5460 }
5461
5463 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5464 {
5466 }
5467
5469
5470 m_IsResultOfSplit = false;
5471
5473 }
5474
5476 {
5477 super.InitItemVariables();
5478
5484 m_Count = ConfigGetInt(
"count");
5485
5488
5493
5496
5501
5513
5517
5518
5521 if (ConfigIsExisting("canBeSplit"))
5522 {
5525 }
5526
5528 if (ConfigIsExisting("itemBehaviour"))
5530
5531
5534 RegisterNetSyncVariableInt("m_VarLiquidType");
5535 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5536
5537 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5538 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5539 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5540
5541 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5542 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5543 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5544 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5545
5546 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5547 RegisterNetSyncVariableBool("m_IsTakeable");
5548 RegisterNetSyncVariableBool("m_IsHologram");
5549
5552 {
5555 }
5556
5558
5560 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5562
5563 }
5564
5566 {
5568 }
5569
5571 {
5574 {
5579 }
5580 }
5581
5582 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5583 {
5585 {
5588 }
5589
5591 }
5592
5594 {
5600 }
5601
5603
5605 {
5607
5608 if (!action)
5609 {
5610 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5611 return;
5612 }
5613
5615 if (!ai)
5616 {
5618 return;
5619 }
5620
5622 if (!action_array)
5623 {
5624 action_array = new array<ActionBase_Basic>;
5626 }
5627 if (LogManager.IsActionLogEnable())
5628 {
5629 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5630 }
5631
5632 if (action_array.Find(action) != -1)
5633 {
5634 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5635 }
5636 else
5637 {
5638 action_array.Insert(action);
5639 }
5640 }
5641
5643 {
5645 ActionBase action = player.GetActionManager().GetAction(actionName);
5648
5649 if (action_array)
5650 {
5651 action_array.RemoveItem(action);
5652 }
5653 }
5654
5655
5656
5658 {
5659 ActionOverrideData overrideData = new ActionOverrideData();
5663
5665 if (!actionMap)
5666 {
5669 }
5670
5671 actionMap.Insert(this.
Type(), overrideData);
5672
5673 }
5674
5676
5678
5679
5681 {
5684
5687
5688 string config_to_search = "CfgVehicles";
5689 string muzzle_owner_config;
5690
5692 {
5693 if (IsInherited(Weapon))
5694 config_to_search = "CfgWeapons";
5695
5696 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5697
5698 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5699
5701
5702 if (config_OnFire_subclass_count > 0)
5703 {
5704 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5705
5706 for (int i = 0; i < config_OnFire_subclass_count; i++)
5707 {
5708 string particle_class = "";
5710 string config_OnFire_entry = config_OnFire_class + particle_class;
5711 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5712 WPOF_array.Insert(WPOF);
5713 }
5714
5715
5717 }
5718 }
5719
5721 {
5722 config_to_search = "CfgWeapons";
5723 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5724
5725 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5726
5728
5729 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5730 {
5731 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5732
5733 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5734 {
5735 string particle_class2 = "";
5737 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5738 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5739 WPOBE_array.Insert(WPOBE);
5740 }
5741
5742
5744 }
5745 }
5746 }
5747
5748
5750 {
5753
5755 {
5756 string config_to_search = "CfgVehicles";
5757
5758 if (IsInherited(Weapon))
5759 config_to_search = "CfgWeapons";
5760
5761 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5762 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5763
5764 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5765 {
5766
5768
5770 {
5772 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5774 return;
5775 }
5776
5779
5780
5781
5783 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5784
5785 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5786 {
5787 string particle_class = "";
5789 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5791
5792 if (entry_type == CT_CLASS)
5793 {
5794 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5795 WPOOH_array.Insert(WPOF);
5796 }
5797 }
5798
5799
5801 }
5802 }
5803 }
5804
5806 {
5808 }
5809
5811 {
5813 {
5815
5818
5821
5822 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5823 }
5824 }
5825
5827 {
5829 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5830
5832 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5833
5835 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5836
5838 {
5840 }
5841 }
5842
5844 {
5846 }
5847
5849 {
5852 else
5854
5856 {
5859 }
5860 else
5861 {
5864
5867 }
5868
5870 }
5871
5873 {
5875 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5876 }
5877
5879 {
5881 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5883 }
5884
5886 {
5888 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5889 }
5890
5892 {
5895
5896 OverheatingParticle OP = new OverheatingParticle();
5901
5903 }
5904
5906 {
5909
5910 return -1;
5911 }
5912
5914 {
5916 {
5919
5920 for (int i = count; i > 0; --i)
5921 {
5922 int id = i - 1;
5925
5928
5929 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5930 {
5931 if (p)
5932 {
5935 }
5936 }
5937 }
5938 }
5939 }
5940
5942 {
5944 {
5946 {
5947 int id = i - 1;
5949
5950 if (OP)
5951 {
5953
5954 if (p)
5955 {
5957 }
5958
5959 delete OP;
5960 }
5961 }
5962
5965 }
5966 }
5967
5970 {
5971 return 0.0;
5972 }
5973
5974
5976 {
5977 return 250;
5978 }
5979
5981 {
5982 return 0;
5983 }
5984
5987 {
5989 return true;
5990
5991 return false;
5992 }
5993
5996 {
5999
6001 {
6003 }
6004 else
6005 {
6006
6008 }
6009
6011 }
6012
6019 {
6020 return -1;
6021 }
6022
6023
6024
6025
6027 {
6029 {
6031 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6032
6033 if (r_index >= 0)
6034 {
6035 InventoryLocation r_il = new InventoryLocation;
6036 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6037
6038 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6041 {
6042 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6043 }
6045 {
6046 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6047 }
6048
6049 }
6050
6051 player.GetHumanInventory().ClearUserReservedLocation(this);
6052 }
6053
6056 }
6057
6058
6059
6060
6062 {
6063 return ItemBase.m_DebugActionsMask;
6064 }
6065
6067 {
6068 return ItemBase.m_DebugActionsMask & mask;
6069 }
6070
6072 {
6073 ItemBase.m_DebugActionsMask = mask;
6074 }
6075
6077 {
6078 ItemBase.m_DebugActionsMask |= mask;
6079 }
6080
6082 {
6083 ItemBase.m_DebugActionsMask &= ~mask;
6084 }
6085
6087 {
6089 {
6091 }
6092 else
6093 {
6095 }
6096 }
6097
6098
6100 {
6101 if (GetEconomyProfile())
6102 {
6103 float q_max = GetEconomyProfile().GetQuantityMax();
6104 if (q_max > 0)
6105 {
6106 float q_min = GetEconomyProfile().GetQuantityMin();
6107 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6108
6110 {
6111 ComponentEnergyManager comp = GetCompEM();
6113 {
6115 }
6116 }
6118 {
6120
6121 }
6122
6123 }
6124 }
6125 }
6126
6129 {
6130 EntityAI parent = GetHierarchyParent();
6131
6132 if (parent)
6133 {
6134 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6135 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6136 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6137 }
6138 }
6139
6142 {
6143 EntityAI parent = GetHierarchyParent();
6144
6145 if (parent)
6146 {
6147 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6148 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6149 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6150 }
6151 }
6152
6154 {
6155
6156
6157
6158
6160
6162 {
6163 if (ScriptInputUserData.CanStoreInputUserData())
6164 {
6165 ScriptInputUserData ctx = new ScriptInputUserData;
6171 ctx.
Write(use_stack_max);
6174
6176 {
6177 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6178 }
6179 }
6180 }
6181 else if (!
GetGame().IsMultiplayer())
6182 {
6184 }
6185 }
6186
6188 {
6190 }
6191
6193 {
6195 }
6196
6198 {
6200 }
6201
6203 {
6204
6205 return false;
6206 }
6207
6209 {
6210 return false;
6211 }
6212
6216 {
6217 return false;
6218 }
6219
6221 {
6222 return "";
6223 }
6224
6226
6228 {
6229 return false;
6230 }
6231
6233 {
6234 return true;
6235 }
6236
6237
6238
6240 {
6241 return true;
6242 }
6243
6245 {
6246 return true;
6247 }
6248
6250 {
6251 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6253 }
6254
6256 {
6258 }
6259
6261 {
6263 if (!is_being_placed)
6265 SetSynchDirty();
6266 }
6267
6268
6270
6272 {
6274 }
6275
6277 {
6279 }
6280
6282 {
6283 return 1;
6284 }
6285
6287 {
6288 return false;
6289 }
6290
6292 {
6294 SetSynchDirty();
6295 }
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6332 {
6333 super.OnMovedInsideCargo(container);
6334
6335 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6336 }
6337
6338 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6339 {
6340 super.EEItemLocationChanged(oldLoc,newLoc);
6341
6342 PlayerBase new_player = null;
6343 PlayerBase old_player = null;
6344
6345 if (newLoc.GetParent())
6346 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6347
6348 if (oldLoc.GetParent())
6349 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6350
6352 {
6353 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6354
6355 if (r_index >= 0)
6356 {
6357 InventoryLocation r_il = new InventoryLocation;
6358 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6359
6360 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6363 {
6364 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6365 }
6367 {
6368 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6369 }
6370
6371 }
6372 }
6373
6375 {
6376 if (new_player)
6377 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6378
6379 if (new_player == old_player)
6380 {
6381
6382 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6383 {
6385 {
6386 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6387 {
6388 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6389 }
6390 }
6391 else
6392 {
6393 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6394 }
6395 }
6396
6397 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6398 {
6399 int type = oldLoc.GetType();
6401 {
6402 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6403 }
6405 {
6406 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6407 }
6408 }
6409 if (!m_OldLocation)
6410 {
6411 m_OldLocation = new InventoryLocation;
6412 }
6413 m_OldLocation.Copy(oldLoc);
6414 }
6415 else
6416 {
6417 if (m_OldLocation)
6418 {
6419 m_OldLocation.Reset();
6420 }
6421 }
6422
6424 }
6425 else
6426 {
6427 if (new_player)
6428 {
6429 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6430 if (res_index >= 0)
6431 {
6432 InventoryLocation il = new InventoryLocation;
6433 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6435 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6438 {
6439 il.
GetParent().GetOnReleaseLock().Invoke(it);
6440 }
6442 {
6444 }
6445
6446 }
6447 }
6449 {
6450
6452 }
6453
6454 if (m_OldLocation)
6455 {
6456 m_OldLocation.Reset();
6457 }
6458 }
6459 }
6460
6461 override void EOnContact(IEntity other, Contact extra)
6462 {
6464 {
6465 int liquidType = -1;
6467 if (impactSpeed > 0.0)
6468 {
6470 #ifndef SERVER
6472 #else
6474 SetSynchDirty();
6475 #endif
6477 }
6478 }
6479
6480 #ifdef SERVER
6481 if (GetCompEM() && GetCompEM().IsPlugged())
6482 {
6483 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6484 GetCompEM().UnplugThis();
6485 }
6486 #endif
6487 }
6488
6490
6492 {
6494 }
6495
6497 {
6498
6499 }
6500
6502 {
6503 super.OnItemLocationChanged(old_owner, new_owner);
6504
6505 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6506 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6507
6508 if (!relatedPlayer && playerNew)
6509 relatedPlayer = playerNew;
6510
6511 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6512 {
6514 if (actionMgr)
6515 {
6516 ActionBase currentAction = actionMgr.GetRunningAction();
6517 if (currentAction)
6519 }
6520 }
6521
6522 Man ownerPlayerOld = null;
6523 Man ownerPlayerNew = null;
6524
6525 if (old_owner)
6526 {
6527 if (old_owner.
IsMan())
6528 {
6529 ownerPlayerOld = Man.Cast(old_owner);
6530 }
6531 else
6532 {
6533 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6534 }
6535 }
6536 else
6537 {
6539 {
6541
6542 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6543 {
6544 GetCompEM().UnplugThis();
6545 }
6546 }
6547 }
6548
6549 if (new_owner)
6550 {
6551 if (new_owner.
IsMan())
6552 {
6553 ownerPlayerNew = Man.Cast(new_owner);
6554 }
6555 else
6556 {
6557 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6558 }
6559 }
6560
6561 if (ownerPlayerOld != ownerPlayerNew)
6562 {
6563 if (ownerPlayerOld)
6564 {
6565 array<EntityAI> subItemsExit = new array<EntityAI>;
6567 for (int i = 0; i < subItemsExit.Count(); i++)
6568 {
6571 }
6572 }
6573
6574 if (ownerPlayerNew)
6575 {
6576 array<EntityAI> subItemsEnter = new array<EntityAI>;
6578 for (int j = 0; j < subItemsEnter.Count(); j++)
6579 {
6582 }
6583 }
6584 }
6585 else if (ownerPlayerNew != null)
6586 {
6587 PlayerBase nplayer;
6588 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6589 {
6590 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6592 for (int k = 0; k < subItemsUpdate.Count(); k++)
6593 {
6595 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6596 }
6597 }
6598 }
6599
6600 if (old_owner)
6601 old_owner.OnChildItemRemoved(this);
6602 if (new_owner)
6603 new_owner.OnChildItemReceived(this);
6604 }
6605
6606
6608 {
6609 super.EEDelete(parent);
6610 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6611 if (player)
6612 {
6614
6615 if (player.IsAlive())
6616 {
6617 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6618 if (r_index >= 0)
6619 {
6620 InventoryLocation r_il = new InventoryLocation;
6621 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6622
6623 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6626 {
6627 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6628 }
6630 {
6631 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6632 }
6633
6634 }
6635
6636 player.RemoveQuickBarEntityShortcut(this);
6637 }
6638 }
6639 }
6640
6642 {
6643 super.EEKilled(killer);
6644
6647 {
6648 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6649 {
6650 if (IsMagazine())
6651 {
6652 if (Magazine.Cast(this).GetAmmoCount() > 0)
6653 {
6655 }
6656 }
6657 else
6658 {
6660 }
6661 }
6662 }
6663 }
6664
6666 {
6667 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6668
6669 super.OnWasAttached(parent, slot_id);
6670
6673
6675 }
6676
6678 {
6679 super.OnWasDetached(parent, slot_id);
6680
6683 }
6684
6686 {
6687 int idx;
6690
6691 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6692 if (inventory_slots.Count() < 1)
6693 {
6694 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6695 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6696 }
6697 else
6698 {
6699 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6700 }
6701
6702 idx = inventory_slots.Find(slot);
6703 if (idx < 0)
6704 return "";
6705
6706 return attach_types.Get(idx);
6707 }
6708
6710 {
6711 int idx = -1;
6712 string slot;
6713
6716
6717 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6718 if (inventory_slots.Count() < 1)
6719 {
6720 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6721 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6722 }
6723 else
6724 {
6725 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6726 if (detach_types.Count() < 1)
6727 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6728 }
6729
6730 for (int i = 0; i < inventory_slots.Count(); i++)
6731 {
6732 slot = inventory_slots.Get(i);
6733 }
6734
6735 if (slot != "")
6736 {
6737 if (detach_types.Count() == 1)
6738 idx = 0;
6739 else
6740 idx = inventory_slots.Find(slot);
6741 }
6742 if (idx < 0)
6743 return "";
6744
6745 return detach_types.Get(idx);
6746 }
6747
6749 {
6750
6752
6753
6754 float min_time = 1;
6755 float max_time = 3;
6756 float delay = Math.RandomFloat(min_time, max_time);
6757
6758 explode_timer.Run(delay, this, "DoAmmoExplosion");
6759 }
6760
6762 {
6763 Magazine magazine = Magazine.Cast(this);
6764 int pop_sounds_count = 6;
6765 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6766
6767
6768 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6769 string sound_name = pop_sounds[ sound_idx ];
6771
6772
6773 magazine.ServerAddAmmoCount(-1);
6774
6775
6776 float min_temp_to_explode = 100;
6777
6778 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6779 {
6781 }
6782 }
6783
6784
6785 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6786 {
6787 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6788
6789 const int CHANCE_DAMAGE_CARGO = 4;
6790 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6791 const int CHANCE_DAMAGE_NOTHING = 2;
6792
6794 {
6795 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6796 int chances;
6797 int rnd;
6798
6799 if (GetInventory().GetCargo())
6800 {
6801 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6802 rnd = Math.RandomInt(0,chances);
6803
6804 if (rnd < CHANCE_DAMAGE_CARGO)
6805 {
6807 }
6808 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6809 {
6811 }
6812 }
6813 else
6814 {
6815 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6816 rnd = Math.RandomInt(0,chances);
6817
6818 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6819 {
6821 }
6822 }
6823 }
6824 }
6825
6827 {
6828 if (GetInventory().GetCargo())
6829 {
6830 int item_count = GetInventory().GetCargo().GetItemCount();
6831 if (item_count > 0)
6832 {
6833 int random_pick = Math.RandomInt(0, item_count);
6835 if (!item.IsExplosive())
6836 {
6837 item.AddHealth("","",damage);
6838 return true;
6839 }
6840 }
6841 }
6842 return false;
6843 }
6844
6846 {
6847 int attachment_count = GetInventory().AttachmentCount();
6848 if (attachment_count > 0)
6849 {
6850 int random_pick = Math.RandomInt(0, attachment_count);
6851 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6852 if (!attachment.IsExplosive())
6853 {
6854 attachment.AddHealth("","",damage);
6855 return true;
6856 }
6857 }
6858 return false;
6859 }
6860
6862 {
6864 }
6865
6867 {
6869 return GetInventory().CanRemoveEntity();
6870
6871 return false;
6872 }
6873
6875 {
6877 return;
6878
6880 {
6881 if (ScriptInputUserData.CanStoreInputUserData())
6882 {
6883 ScriptInputUserData ctx = new ScriptInputUserData;
6888 ctx.
Write(destination_entity);
6892 }
6893 }
6894 else if (!
GetGame().IsMultiplayer())
6895 {
6897 }
6898 }
6899
6901 {
6903 return;
6904
6905 float split_quantity_new;
6909 InventoryLocation loc = new InventoryLocation;
6910
6911 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6912 {
6914 split_quantity_new = stack_max;
6915 else
6917
6918 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6919 if (new_item)
6920 {
6921 new_item.SetResultOfSplit(true);
6922 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6924 new_item.SetQuantity(split_quantity_new);
6925 }
6926 }
6927 else if (destination_entity && slot_id == -1)
6928 {
6929 if (quantity > stack_max)
6930 split_quantity_new = stack_max;
6931 else
6932 split_quantity_new = quantity;
6933
6935 {
6938 }
6939
6940 if (new_item)
6941 {
6942 new_item.SetResultOfSplit(true);
6943 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6945 new_item.SetQuantity(split_quantity_new);
6946 }
6947 }
6948 else
6949 {
6950 if (stack_max != 0)
6951 {
6953 {
6955 }
6956
6957 if (split_quantity_new == 0)
6958 {
6959 if (!
GetGame().IsMultiplayer())
6960 player.PhysicalPredictiveDropItem(this);
6961 else
6962 player.ServerDropEntity(this);
6963 return;
6964 }
6965
6967
6968 if (new_item)
6969 {
6970 new_item.SetResultOfSplit(true);
6971 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6973 new_item.SetQuantity(stack_max);
6974 new_item.PlaceOnSurface();
6975 }
6976 }
6977 }
6978 }
6979
6981 {
6983 return;
6984
6985 float split_quantity_new;
6989 InventoryLocation loc = new InventoryLocation;
6990
6991 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6992 {
6994 split_quantity_new = stack_max;
6995 else
6997
6998 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6999 if (new_item)
7000 {
7001 new_item.SetResultOfSplit(true);
7002 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7004 new_item.SetQuantity(split_quantity_new);
7005 }
7006 }
7007 else if (destination_entity && slot_id == -1)
7008 {
7009 if (quantity > stack_max)
7010 split_quantity_new = stack_max;
7011 else
7012 split_quantity_new = quantity;
7013
7015 {
7018 }
7019
7020 if (new_item)
7021 {
7022 new_item.SetResultOfSplit(true);
7023 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7025 new_item.SetQuantity(split_quantity_new);
7026 }
7027 }
7028 else
7029 {
7030 if (stack_max != 0)
7031 {
7033 {
7035 }
7036
7038
7039 if (new_item)
7040 {
7041 new_item.SetResultOfSplit(true);
7042 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7044 new_item.SetQuantity(stack_max);
7045 new_item.PlaceOnSurface();
7046 }
7047 }
7048 }
7049 }
7050
7052 {
7054 return;
7055
7057 {
7058 if (ScriptInputUserData.CanStoreInputUserData())
7059 {
7060 ScriptInputUserData ctx = new ScriptInputUserData;
7065 dst.WriteToContext(ctx);
7067 }
7068 }
7069 else if (!
GetGame().IsMultiplayer())
7070 {
7072 }
7073 }
7074
7076 {
7078 return;
7079
7081 {
7082 if (ScriptInputUserData.CanStoreInputUserData())
7083 {
7084 ScriptInputUserData ctx = new ScriptInputUserData;
7089 ctx.
Write(destination_entity);
7095 }
7096 }
7097 else if (!
GetGame().IsMultiplayer())
7098 {
7100 }
7101 }
7102
7104 {
7106 }
7107
7109 {
7111 return this;
7112
7114 float split_quantity_new;
7116 if (dst.IsValid())
7117 {
7118 int slot_id = dst.GetSlot();
7120
7121 if (quantity > stack_max)
7122 split_quantity_new = stack_max;
7123 else
7124 split_quantity_new = quantity;
7125
7127
7128 if (new_item)
7129 {
7130 new_item.SetResultOfSplit(true);
7131 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7134 }
7135
7136 return new_item;
7137 }
7138
7139 return null;
7140 }
7141
7143 {
7145 return;
7146
7148 float split_quantity_new;
7150 if (destination_entity)
7151 {
7153 if (quantity > stackable)
7154 split_quantity_new = stackable;
7155 else
7156 split_quantity_new = quantity;
7157
7158 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7159 if (new_item)
7160 {
7161 new_item.SetResultOfSplit(true);
7162 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7164 new_item.SetQuantity(split_quantity_new);
7165 }
7166 }
7167 }
7168
7170 {
7172 return;
7173
7175 {
7176 if (ScriptInputUserData.CanStoreInputUserData())
7177 {
7178 ScriptInputUserData ctx = new ScriptInputUserData;
7183 ItemBase destination_entity =
this;
7184 ctx.
Write(destination_entity);
7188 }
7189 }
7190 else if (!
GetGame().IsMultiplayer())
7191 {
7193 }
7194 }
7195
7197 {
7199 return;
7200
7202 float split_quantity_new;
7204 if (player)
7205 {
7207 if (quantity > stackable)
7208 split_quantity_new = stackable;
7209 else
7210 split_quantity_new = quantity;
7211
7212 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7213 new_item =
ItemBase.Cast(in_hands);
7214 if (new_item)
7215 {
7216 new_item.SetResultOfSplit(true);
7217 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7219 new_item.SetQuantity(split_quantity_new);
7220 }
7221 }
7222 }
7223
7225 {
7227 return;
7228
7230 float split_quantity_new = Math.Floor(quantity * 0.5);
7231
7233
7234 if (new_item)
7235 {
7236 if (new_item.GetQuantityMax() < split_quantity_new)
7237 {
7238 split_quantity_new = new_item.GetQuantityMax();
7239 }
7240
7241 new_item.SetResultOfSplit(true);
7242 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7243
7245 {
7248 }
7249 else
7250 {
7253 }
7254 }
7255 }
7256
7258 {
7260 return;
7261
7263 float split_quantity_new = Math.Floor(quantity / 2);
7264
7265 InventoryLocation invloc = new InventoryLocation;
7267
7269 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7270
7271 if (new_item)
7272 {
7273 if (new_item.GetQuantityMax() < split_quantity_new)
7274 {
7275 split_quantity_new = new_item.GetQuantityMax();
7276 }
7278 {
7281 }
7282 else
7283 {
7286 }
7287 }
7288 }
7289
7292 {
7293 SetWeightDirty();
7295
7296 if (parent)
7297 parent.OnAttachmentQuantityChangedEx(this, delta);
7298
7300 {
7302 {
7304 }
7306 {
7307 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7309 }
7310 }
7311
7312 }
7313
7316 {
7317
7318 }
7319
7322 {
7324 }
7325
7327 {
7328 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7329
7331 {
7332 if (newLevel == GameConstants.STATE_RUINED)
7333 {
7335 EntityAI parent = GetHierarchyParent();
7336 if (parent && parent.IsFireplace())
7337 {
7338 CargoBase cargo = GetInventory().GetCargo();
7339 if (cargo)
7340 {
7342 {
7344 }
7345 }
7346 }
7347 }
7348
7350 {
7351
7353 return;
7354 }
7355
7356 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7357 {
7359 }
7360 }
7361 }
7362
7363
7365 {
7366 super.OnRightClick();
7367
7369 {
7371 {
7372 if (ScriptInputUserData.CanStoreInputUserData())
7373 {
7374 vector m4[4];
7376
7377 EntityAI root = GetHierarchyRoot();
7378
7379 InventoryLocation dst = new InventoryLocation;
7381 {
7382 if (root)
7383 {
7384 root.GetTransform(m4);
7386 }
7387 else
7388 GetInventory().GetCurrentInventoryLocation(dst);
7389 }
7390 else
7391 {
7393
7394
7395 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7396 {
7397 if (root)
7398 {
7399 root.GetTransform(m4);
7401 }
7402 else
7403 GetInventory().GetCurrentInventoryLocation(dst);
7404 }
7405 else
7406 {
7407 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7408 }
7409 }
7410
7411 ScriptInputUserData ctx = new ScriptInputUserData;
7419 }
7420 }
7421 else if (!
GetGame().IsMultiplayer())
7422 {
7424 }
7425 }
7426 }
7427
7428 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7429 {
7430
7431 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7432 return false;
7433
7434 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7435 return false;
7436
7437
7439 return false;
7440
7441
7442 Magazine mag = Magazine.Cast(this);
7443 if (mag)
7444 {
7445 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7446 return false;
7447
7448 if (stack_max_limit)
7449 {
7450 Magazine other_mag = Magazine.Cast(other_item);
7451 if (other_item)
7452 {
7453 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7454 return false;
7455 }
7456
7457 }
7458 }
7459 else
7460 {
7461
7463 return false;
7464
7466 return false;
7467 }
7468
7469 PlayerBase player = null;
7470 if (CastTo(player, GetHierarchyRootPlayer()))
7471 {
7472 if (player.GetInventory().HasAttachment(this))
7473 return false;
7474
7475 if (player.IsItemsToDelete())
7476 return false;
7477 }
7478
7479 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7480 return false;
7481
7482 int slotID;
7484 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7485 return false;
7486
7487 return true;
7488 }
7489
7491 {
7493 }
7494
7496 {
7497 return m_IsResultOfSplit;
7498 }
7499
7501 {
7502 m_IsResultOfSplit = value;
7503 }
7504
7506 {
7508 }
7509
7511 {
7512 float other_item_quantity = other_item.GetQuantity();
7513 float this_free_space;
7514
7516
7518
7519 if (other_item_quantity > this_free_space)
7520 {
7521 return this_free_space;
7522 }
7523 else
7524 {
7525 return other_item_quantity;
7526 }
7527 }
7528
7530 {
7532 }
7533
7535 {
7537 return;
7538
7539 if (!IsMagazine() && other_item)
7540 {
7542 if (quantity_used != 0)
7543 {
7544 float hp1 = GetHealth01("","");
7545 float hp2 = other_item.GetHealth01("","");
7546 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7547 hpResult = hpResult / (
GetQuantity() + quantity_used);
7548
7549 hpResult *= GetMaxHealth();
7550 Math.Round(hpResult);
7551 SetHealth("", "Health", hpResult);
7552
7554 other_item.AddQuantity(-quantity_used);
7555 }
7556 }
7558 }
7559
7561 {
7562 #ifdef SERVER
7563 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7564 GetHierarchyParent().IncreaseLifetimeUp();
7565 #endif
7566 };
7567
7569 {
7570 PlayerBase p = PlayerBase.Cast(player);
7571
7572 array<int> recipesIds = p.m_Recipes;
7573 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7574 if (moduleRecipesManager)
7575 {
7576 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7577 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7578 }
7579
7580 for (int i = 0;i < recipesIds.Count(); i++)
7581 {
7582 int key = recipesIds.Get(i);
7583 string recipeName = moduleRecipesManager.GetRecipeName(key);
7585 }
7586 }
7587
7588
7589 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7590 {
7591 super.GetDebugActions(outputList);
7592
7593
7598
7599
7603
7607
7608
7611
7612
7614 {
7617 }
7618
7620
7623
7627 }
7628
7629
7630
7631
7633 {
7634 super.OnAction(action_id, player, ctx);
7635 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7636 {
7637 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7638 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7639 PlayerBase p = PlayerBase.Cast(player);
7640 if (
EActions.RECIPES_RANGE_START < 1000)
7641 {
7642 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7643 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7644 }
7645 }
7646 #ifndef SERVER
7647 else if (action_id ==
EActions.WATCH_PLAYER)
7648 {
7649 PluginDeveloper.SetDeveloperItemClientEx(player);
7650 }
7651 #endif
7653 {
7654 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7655 {
7656 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7657 OnDebugButtonPressServer(id + 1);
7658 }
7659
7660 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7661 {
7662 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7664 }
7665
7666 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7667 {
7668 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7670 }
7671
7672 else if (action_id ==
EActions.ADD_QUANTITY)
7673 {
7674 if (IsMagazine())
7675 {
7676 Magazine mag = Magazine.Cast(this);
7677 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7678 }
7679 else
7680 {
7682 }
7683
7684 if (m_EM)
7685 {
7686 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7687 }
7688
7689 }
7690
7691 else if (action_id ==
EActions.REMOVE_QUANTITY)
7692 {
7693 if (IsMagazine())
7694 {
7695 Magazine mag2 = Magazine.Cast(this);
7696 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7697 }
7698 else
7699 {
7701 }
7702 if (m_EM)
7703 {
7704 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7705 }
7706
7707 }
7708
7709 else if (action_id ==
EActions.SET_QUANTITY_0)
7710 {
7712
7713 if (m_EM)
7714 {
7715 m_EM.SetEnergy(0);
7716 }
7717 }
7718
7719 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7720 {
7722
7723 if (m_EM)
7724 {
7725 m_EM.SetEnergy(m_EM.GetEnergyMax());
7726 }
7727 }
7728
7729 else if (action_id ==
EActions.ADD_HEALTH)
7730 {
7731 AddHealth("","",GetMaxHealth("","Health")/5);
7732 }
7733 else if (action_id ==
EActions.REMOVE_HEALTH)
7734 {
7735 AddHealth("","",-GetMaxHealth("","Health")/5);
7736 }
7737 else if (action_id ==
EActions.DESTROY_HEALTH)
7738 {
7739 SetHealth01("","",0);
7740 }
7741 else if (action_id ==
EActions.WATCH_ITEM)
7742 {
7744 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7745 #ifdef DEVELOPER
7746 SetDebugDeveloper_item(this);
7747 #endif
7748 }
7749
7750 else if (action_id ==
EActions.ADD_TEMPERATURE)
7751 {
7752 AddTemperature(20);
7753
7754 }
7755
7756 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7757 {
7758 AddTemperature(-20);
7759
7760 }
7761
7762 else if (action_id ==
EActions.FLIP_FROZEN)
7763 {
7764 SetFrozen(!GetIsFrozen());
7765
7766 }
7767
7768 else if (action_id ==
EActions.ADD_WETNESS)
7769 {
7771
7772 }
7773
7774 else if (action_id ==
EActions.REMOVE_WETNESS)
7775 {
7777
7778 }
7779
7780 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7781 {
7784
7785
7786 }
7787
7788 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7789 {
7792 }
7793
7794 else if (action_id ==
EActions.MAKE_SPECIAL)
7795 {
7796 auto debugParams = DebugSpawnParams.WithPlayer(player);
7797 OnDebugSpawnEx(debugParams);
7798 }
7799
7800 else if (action_id ==
EActions.DELETE)
7801 {
7802 Delete();
7803 }
7804
7805 }
7806
7807
7808 return false;
7809 }
7810
7811
7812
7813
7817
7820
7821
7822
7824 {
7825 return false;
7826 }
7827
7828
7830 {
7831 return true;
7832 }
7833
7834
7836 {
7837 return true;
7838 }
7839
7840
7841
7843 {
7844 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7846 }
7847
7850 {
7851 return null;
7852 }
7853
7855 {
7856 return false;
7857 }
7858
7860 {
7861 return false;
7862 }
7863
7867
7868
7870 {
7871 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7872 return module_repairing.CanRepair(this, item_repair_kit);
7873 }
7874
7875
7876 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7877 {
7878 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7879 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7880 }
7881
7882
7884 {
7885
7886
7887
7888
7889
7890
7891
7892
7893 return 1;
7894 }
7895
7896
7897
7899 {
7901 }
7902
7903
7904
7906 {
7908 }
7909
7910
7919 {
7920 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7921
7922 if (player)
7923 {
7924 player.MessageStatus(text);
7925 }
7926 }
7927
7928
7937 {
7938 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7939
7940 if (player)
7941 {
7942 player.MessageAction(text);
7943 }
7944 }
7945
7946
7955 {
7956 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7957
7958 if (player)
7959 {
7960 player.MessageFriendly(text);
7961 }
7962 }
7963
7964
7973 {
7974 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7975
7976 if (player)
7977 {
7978 player.MessageImportant(text);
7979 }
7980 }
7981
7983 {
7984 return true;
7985 }
7986
7987
7988 override bool KindOf(
string tag)
7989 {
7990 bool found = false;
7991 string item_name = this.
GetType();
7994
7995 int array_size = item_tag_array.Count();
7996 for (int i = 0; i < array_size; i++)
7997 {
7998 if (item_tag_array.Get(i) == tag)
7999 {
8000 found = true;
8001 break;
8002 }
8003 }
8004 return found;
8005 }
8006
8007
8009 {
8010
8011 super.OnRPC(sender, rpc_type,ctx);
8012
8013
8014 switch (rpc_type)
8015 {
8016 #ifndef SERVER
8017 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8018 Param2<bool, string> p = new Param2<bool, string>(false, "");
8019
8021 return;
8022
8023 bool play = p.param1;
8024 string soundSet = p.param2;
8025
8026 if (play)
8027 {
8029 {
8031 {
8033 }
8034 }
8035 else
8036 {
8038 }
8039 }
8040 else
8041 {
8043 }
8044
8045 break;
8046 #endif
8047
8048 }
8049
8051 {
8053 }
8054 }
8055
8056
8057
8058
8060 {
8061 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8062 return plugin.GetID(
name);
8063 }
8064
8066 {
8067 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8068 return plugin.GetName(id);
8069 }
8070
8073 {
8074
8075
8076 int varFlags;
8077 if (!ctx.
Read(varFlags))
8078 return;
8079
8080 if (varFlags & ItemVariableFlags.FLOAT)
8081 {
8083 }
8084 }
8085
8087 {
8088
8089 super.SerializeNumericalVars(floats_out);
8090
8091
8092
8094 {
8096 }
8097
8099 {
8101 }
8102
8104 {
8106 }
8107
8109 {
8114 }
8115
8117 {
8119 }
8120 }
8121
8123 {
8124
8125 super.DeSerializeNumericalVars(floats);
8126
8127
8128 int index = 0;
8129 int mask = Math.Round(floats.Get(index));
8130
8131 index++;
8132
8134 {
8136 {
8138 }
8139 else
8140 {
8141 float quantity = floats.Get(index);
8143 }
8144 index++;
8145 }
8146
8148 {
8149 float wet = floats.Get(index);
8151 index++;
8152 }
8153
8155 {
8156 int liquidtype = Math.Round(floats.Get(index));
8158 index++;
8159 }
8160
8162 {
8164 index++;
8166 index++;
8168 index++;
8170 index++;
8171 }
8172
8174 {
8175 int cleanness = Math.Round(floats.Get(index));
8177 index++;
8178 }
8179 }
8180
8182 {
8183 super.WriteVarsToCTX(ctx);
8184
8185
8187 {
8189 }
8190
8192 {
8194 }
8195
8197 {
8199 }
8200
8202 {
8203 int r,g,b,a;
8209 }
8210
8212 {
8214 }
8215 }
8216
8218 {
8219 if (!super.ReadVarsFromCTX(ctx,version))
8220 return false;
8221
8222 int intValue;
8223 float value;
8224
8225 if (version < 140)
8226 {
8227 if (!ctx.
Read(intValue))
8228 return false;
8229
8230 m_VariablesMask = intValue;
8231 }
8232
8234 {
8235 if (!ctx.
Read(value))
8236 return false;
8237
8239 {
8241 }
8242 else
8243 {
8245 }
8246 }
8247
8248 if (version < 140)
8249 {
8251 {
8252 if (!ctx.
Read(value))
8253 return false;
8254 SetTemperatureDirect(value);
8255 }
8256 }
8257
8259 {
8260 if (!ctx.
Read(value))
8261 return false;
8263 }
8264
8266 {
8267 if (!ctx.
Read(intValue))
8268 return false;
8270 }
8271
8273 {
8274 int r,g,b,a;
8276 return false;
8278 return false;
8280 return false;
8282 return false;
8283
8285 }
8286
8288 {
8289 if (!ctx.
Read(intValue))
8290 return false;
8292 }
8293
8294 if (version >= 138 && version < 140)
8295 {
8297 {
8298 if (!ctx.
Read(intValue))
8299 return false;
8300 SetFrozen(intValue);
8301 }
8302 }
8303
8304 return true;
8305 }
8306
8307
8309 {
8312 {
8314 }
8315
8316 if (!super.OnStoreLoad(ctx, version))
8317 {
8319 return false;
8320 }
8321
8322 if (version >= 114)
8323 {
8324 bool hasQuickBarIndexSaved;
8325
8326 if (!ctx.
Read(hasQuickBarIndexSaved))
8327 {
8329 return false;
8330 }
8331
8332 if (hasQuickBarIndexSaved)
8333 {
8334 int itmQBIndex;
8335
8336
8337 if (!ctx.
Read(itmQBIndex))
8338 {
8340 return false;
8341 }
8342
8343 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8344 if (itmQBIndex != -1 && parentPlayer)
8345 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8346 }
8347 }
8348 else
8349 {
8350
8351 PlayerBase player;
8352 int itemQBIndex;
8353 if (version ==
int.
MAX)
8354 {
8355 if (!ctx.
Read(itemQBIndex))
8356 {
8358 return false;
8359 }
8360 }
8361 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8362 {
8363
8364 if (!ctx.
Read(itemQBIndex))
8365 {
8367 return false;
8368 }
8369 if (itemQBIndex != -1 && player)
8370 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8371 }
8372 }
8373
8374 if (version < 140)
8375 {
8376
8377 if (!LoadVariables(ctx, version))
8378 {
8380 return false;
8381 }
8382 }
8383
8384
8386 {
8388 return false;
8389 }
8390 if (version >= 132)
8391 {
8393 if (raib)
8394 {
8396 {
8398 return false;
8399 }
8400 }
8401 }
8402
8404 return true;
8405 }
8406
8407
8408
8410 {
8411 super.OnStoreSave(ctx);
8412
8413 PlayerBase player;
8414 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8415 {
8417
8418 int itemQBIndex = -1;
8419 itemQBIndex = player.FindQuickBarEntityIndex(this);
8420 ctx.
Write(itemQBIndex);
8421 }
8422 else
8423 {
8425 }
8426
8428
8430 if (raib)
8431 {
8433 }
8434 }
8435
8436
8438 {
8439 super.AfterStoreLoad();
8440
8442 {
8444 }
8445
8447 {
8450 }
8451 }
8452
8454 {
8455 super.EEOnAfterLoad();
8456
8458 {
8460 }
8461
8464 }
8465
8467 {
8468 return false;
8469 }
8470
8471
8472
8474 {
8476 {
8477 #ifdef PLATFORM_CONSOLE
8478
8480 {
8482 if (menu)
8483 {
8485 }
8486 }
8487 #endif
8488 }
8489
8491 {
8494 }
8495
8497 {
8498 SetWeightDirty();
8500 }
8502 {
8505 }
8506
8508 {
8511 }
8513 {
8516 }
8517
8518 super.OnVariablesSynchronized();
8519 }
8520
8521
8522
8524 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8525 {
8526 if (!IsServerCheck(allow_client))
8527 return false;
8528
8530 return false;
8531
8534
8535 if (value <= (min + 0.001))
8536 value = min;
8537
8538 if (value == min)
8539 {
8540 if (destroy_config)
8541 {
8542 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8543 if (dstr)
8544 {
8546 this.Delete();
8547 return true;
8548 }
8549 }
8550 else if (destroy_forced)
8551 {
8553 this.Delete();
8554 return true;
8555 }
8556
8558 }
8559
8562
8564 {
8566
8567 if (delta)
8569 }
8570
8572
8573 return false;
8574 }
8575
8576
8578 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8579 {
8581 }
8582
8584 {
8587 }
8588
8590 {
8593 }
8594
8597 {
8598 float value_clamped = Math.Clamp(value, 0, 1);
8600 SetQuantity(result, destroy_config, destroy_forced);
8601 }
8602
8603
8606 {
8608 }
8609
8611 {
8613 }
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8625 {
8626 int slot = -1;
8627 if (GetInventory())
8628 {
8629 InventoryLocation il = new InventoryLocation;
8630 GetInventory().GetCurrentInventoryLocation(il);
8632 }
8633
8635 }
8636
8638 {
8639 float quantity_max = 0;
8640
8642 {
8643 if (attSlotID != -1)
8644 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8645
8646 if (quantity_max <= 0)
8648 }
8649
8650 if (quantity_max <= 0)
8652
8653 return quantity_max;
8654 }
8655
8657 {
8659 }
8660
8662 {
8664 }
8665
8666
8668 {
8670 }
8671
8673 {
8675 }
8676
8678 {
8680 }
8681
8682
8684 {
8685
8686 float weightEx = GetWeightEx();
8687 float special = GetInventoryAndCargoWeight();
8688 return weightEx - special;
8689 }
8690
8691
8693 {
8695 }
8696
8698 {
8700 {
8701 #ifdef DEVELOPER
8702 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8703 {
8704 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8706 }
8707 #endif
8708
8710 }
8711 else if (HasEnergyManager())
8712 {
8713 #ifdef DEVELOPER
8714 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8715 {
8716 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8717 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8718 }
8719 #endif
8720 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8721 }
8722 else
8723 {
8724 #ifdef DEVELOPER
8725 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8726 {
8727 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8728 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8729 }
8730 #endif
8731 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8732 }
8733 }
8734
8737 {
8738 int item_count = 0;
8740
8741 if (GetInventory().GetCargo() != NULL)
8742 {
8743 item_count = GetInventory().GetCargo().GetItemCount();
8744 }
8745
8746 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8747 {
8748 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8749 if (item)
8750 item_count += item.GetNumberOfItems();
8751 }
8752 return item_count;
8753 }
8754
8757 {
8758 float weight = 0;
8759 float wetness = 1;
8760 if (include_wetness)
8763 {
8764 weight = wetness * m_ConfigWeight;
8765 }
8767 {
8768 weight = 1;
8769 }
8770 return weight;
8771 }
8772
8773
8774
8776 {
8777 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8778 {
8779 GameInventory inv = GetInventory();
8780 array<EntityAI> items = new array<EntityAI>;
8782 for (int i = 0; i < items.Count(); i++)
8783 {
8785 if (item)
8786 {
8788 }
8789 }
8790 }
8791 }
8792
8793
8794
8795
8797 {
8798 float energy = 0;
8799 if (HasEnergyManager())
8800 {
8801 energy = GetCompEM().GetEnergy();
8802 }
8803 return energy;
8804 }
8805
8806
8808 {
8809 super.OnEnergyConsumed();
8810
8812 }
8813
8815 {
8816 super.OnEnergyAdded();
8817
8819 }
8820
8821
8823 {
8824 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8825 {
8827 {
8828 float energy_0to1 = GetCompEM().GetEnergy0To1();
8830 }
8831 }
8832 }
8833
8834
8836 {
8837 return ConfigGetFloat("heatIsolation");
8838 }
8839
8841 {
8843 }
8844
8846 {
8847 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8848 if (
GetGame().ConfigIsExisting(paramPath))
8850
8851 return 0.0;
8852 }
8853
8855 {
8856 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8857 if (
GetGame().ConfigIsExisting(paramPath))
8859
8860 return 0.0;
8861 }
8862
8863 override void SetWet(
float value,
bool allow_client =
false)
8864 {
8865 if (!IsServerCheck(allow_client))
8866 return;
8867
8870
8872
8873 m_VarWet = Math.Clamp(value, min, max);
8874
8876 {
8879 }
8880 }
8881
8882 override void AddWet(
float value)
8883 {
8885 }
8886
8888 {
8890 }
8891
8893 {
8895 }
8896
8898 {
8900 }
8901
8903 {
8905 }
8906
8908 {
8910 }
8911
8913 {
8916 if (newLevel != oldLevel)
8917 {
8919 }
8920 }
8921
8923 {
8924 SetWeightDirty();
8925 }
8926
8928 {
8929 return GetWetLevelInternal(
m_VarWet);
8930 }
8931
8932
8933
8935 {
8937 }
8938
8940 {
8942 }
8943
8945 {
8947 }
8948
8950 {
8952 }
8953
8954
8955
8957 {
8958 if (ConfigIsExisting("itemModelLength"))
8959 {
8960 return ConfigGetFloat("itemModelLength");
8961 }
8962 return 0;
8963 }
8964
8966 {
8967 if (ConfigIsExisting("itemAttachOffset"))
8968 {
8969 return ConfigGetFloat("itemAttachOffset");
8970 }
8971 return 0;
8972 }
8973
8974 override void SetCleanness(
int value,
bool allow_client =
false)
8975 {
8976 if (!IsServerCheck(allow_client))
8977 return;
8978
8980
8982
8985 }
8986
8988 {
8990 }
8991
8993 {
8994 return true;
8995 }
8996
8997
8998
8999
9001 {
9003 }
9004
9006 {
9008 }
9009
9010
9011
9012
9013 override void SetColor(
int r,
int g,
int b,
int a)
9014 {
9020 }
9022 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9023 {
9028 }
9029
9031 {
9033 }
9034
9037 {
9038 int r,g,b,a;
9040 r = r/255;
9041 g = g/255;
9042 b = b/255;
9043 a = a/255;
9044 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9045 }
9046
9047
9048
9049 override void SetLiquidType(
int value,
bool allow_client =
false)
9050 {
9051 if (!IsServerCheck(allow_client))
9052 return;
9053
9058 }
9059
9061 {
9062 return ConfigGetInt("varLiquidTypeInit");
9063 }
9064
9066 {
9068 }
9069
9071 {
9073 SetFrozen(false);
9074 }
9075
9078 {
9079 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9080 }
9081
9082
9085 {
9086 PlayerBase nplayer;
9087 if (PlayerBase.CastTo(nplayer, player))
9088 {
9090
9091 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9092 }
9093 }
9094
9095
9098 {
9099 PlayerBase nplayer;
9100 if (PlayerBase.CastTo(nplayer,player))
9101 {
9102
9103 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9104
9105 }
9106
9107
9108 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9109
9110
9111 if (HasEnergyManager())
9112 {
9113 GetCompEM().UpdatePlugState();
9114 }
9115 }
9116
9117
9119 {
9120 super.OnPlacementStarted(player);
9121
9123 }
9124
9125 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9126 {
9128 {
9129 m_AdminLog.OnPlacementComplete(player,
this);
9130 }
9131
9132 super.OnPlacementComplete(player, position, orientation);
9133 }
9134
9135
9136
9137
9138
9140 {
9142 {
9143 return true;
9144 }
9145 else
9146 {
9147 return false;
9148 }
9149 }
9150
9151
9153 {
9155 {
9157 }
9158 }
9159
9160
9162 {
9164 }
9165
9167 {
9169 }
9170
9171 override void InsertAgent(
int agent,
float count = 1)
9172 {
9173 if (count < 1)
9174 return;
9175
9177 }
9178
9181 {
9183 }
9184
9185
9187 {
9189 }
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9233 {
9235 return false;
9236 return true;
9237 }
9238
9240 {
9241
9243 }
9244
9245
9248 {
9249 super.CheckForRoofLimited(timeTresholdMS);
9250
9252 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9253 {
9254 m_PreviousRoofTestTime = time;
9255 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9256 }
9257 }
9258
9259
9261 {
9263 {
9264 return 0;
9265 }
9266
9267 if (GetInventory().GetAttachmentSlotsCount() != 0)
9268 {
9269 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9270 if (filter)
9271 return filter.GetProtectionLevel(type, false, system);
9272 else
9273 return 0;
9274 }
9275
9276 string subclassPath, entryName;
9277
9278 switch (type)
9279 {
9281 entryName = "biological";
9282 break;
9284 entryName = "chemical";
9285 break;
9286 default:
9287 entryName = "biological";
9288 break;
9289 }
9290
9291 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9292
9294 }
9295
9296
9297
9300 {
9301 if (!IsMagazine())
9303
9305 }
9306
9307
9308
9309
9310
9315 {
9316 return true;
9317 }
9318
9320 {
9322 }
9323
9324
9325
9326
9327
9329 {
9330 if (parent)
9331 {
9332 if (parent.IsInherited(DayZInfected))
9333 return true;
9334
9335 if (!parent.IsRuined())
9336 return true;
9337 }
9338
9339 return true;
9340 }
9341
9343 {
9344 if (!super.CanPutAsAttachment(parent))
9345 {
9346 return false;
9347 }
9348
9349 if (!IsRuined() && !parent.IsRuined())
9350 {
9351 return true;
9352 }
9353
9354 return false;
9355 }
9356
9358 {
9359
9360
9361
9362
9363 return super.CanReceiveItemIntoCargo(item);
9364 }
9365
9367 {
9368
9369
9370
9371
9372 GameInventory attachmentInv = attachment.GetInventory();
9374 {
9375 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9376 return false;
9377 }
9378
9379 InventoryLocation loc = new InventoryLocation();
9380 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9381 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9382 return false;
9383
9384 return super.CanReceiveAttachment(attachment, slotId);
9385 }
9386
9388 {
9389 if (!super.CanReleaseAttachment(attachment))
9390 return false;
9391
9392 return GetInventory().AreChildrenAccessible();
9393 }
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9416 {
9417 int id = muzzle_owner.GetMuzzleID();
9418 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9419
9420 if (WPOF_array)
9421 {
9422 for (int i = 0; i < WPOF_array.Count(); i++)
9423 {
9424 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9425
9426 if (WPOF)
9427 {
9428 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9429 }
9430 }
9431 }
9432 }
9433
9434
9436 {
9437 int id = muzzle_owner.GetMuzzleID();
9439
9440 if (WPOBE_array)
9441 {
9442 for (int i = 0; i < WPOBE_array.Count(); i++)
9443 {
9444 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9445
9446 if (WPOBE)
9447 {
9448 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9449 }
9450 }
9451 }
9452 }
9453
9454
9456 {
9457 int id = muzzle_owner.GetMuzzleID();
9458 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9459
9460 if (WPOOH_array)
9461 {
9462 for (int i = 0; i < WPOOH_array.Count(); i++)
9463 {
9464 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9465
9466 if (WPOOH)
9467 {
9468 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9469 }
9470 }
9471 }
9472 }
9473
9474
9476 {
9477 int id = muzzle_owner.GetMuzzleID();
9478 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9479
9480 if (WPOOH_array)
9481 {
9482 for (int i = 0; i < WPOOH_array.Count(); i++)
9483 {
9484 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9485
9486 if (WPOOH)
9487 {
9488 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9489 }
9490 }
9491 }
9492 }
9493
9494
9496 {
9497 int id = muzzle_owner.GetMuzzleID();
9498 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9499
9500 if (WPOOH_array)
9501 {
9502 for (int i = 0; i < WPOOH_array.Count(); i++)
9503 {
9504 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9505
9506 if (WPOOH)
9507 {
9508 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9509 }
9510 }
9511 }
9512 }
9513
9514
9515
9517 {
9519 {
9520 return true;
9521 }
9522
9523 return false;
9524 }
9525
9527 {
9529 {
9530 return true;
9531 }
9532
9533 return false;
9534 }
9535
9537 {
9539 {
9540 return true;
9541 }
9542
9543 return false;
9544 }
9545
9547 {
9548 return false;
9549 }
9550
9553 {
9554 return UATimeSpent.DEFAULT_DEPLOY;
9555 }
9556
9557
9558
9559
9561 {
9563 SetSynchDirty();
9564 }
9565
9567 {
9569 }
9570
9571
9573 {
9574 return false;
9575 }
9576
9579 {
9580 string att_type = "None";
9581
9582 if (ConfigIsExisting("soundAttType"))
9583 {
9584 att_type = ConfigGetString("soundAttType");
9585 }
9586
9588 }
9589
9591 {
9593 }
9594
9595
9596
9597
9598
9602
9604 {
9607
9609 }
9610
9611
9613 {
9615 return;
9616
9618
9621
9624
9625 SoundParameters params = new SoundParameters();
9629 }
9630
9631
9633 {
9635 return;
9636
9638 SetSynchDirty();
9639
9642 }
9643
9644
9646 {
9648 return;
9649
9651 SetSynchDirty();
9652
9655 }
9656
9658 {
9660 }
9661
9663 {
9665 }
9666
9669 {
9670 if (!
GetGame().IsDedicatedServer())
9671 {
9672 if (ConfigIsExisting("attachSoundSet"))
9673 {
9674 string cfg_path = "";
9675 string soundset = "";
9677
9680 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9681 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9682
9683 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9684 {
9685 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9686 {
9687 if (cfg_slot_array[i] == slot_type)
9688 {
9689 soundset = cfg_soundset_array[i];
9690 break;
9691 }
9692 }
9693 }
9694
9695 if (soundset != "")
9696 {
9697 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9699 }
9700 }
9701 }
9702 }
9703
9705 {
9706
9707 }
9708
9709 void OnApply(PlayerBase player);
9710
9712 {
9713 return 1.0;
9714 };
9715
9717 {
9719 }
9720
9722 {
9724 }
9725
9727
9729 {
9730 SetDynamicPhysicsLifeTime(0.01);
9732 }
9733
9735 {
9736 array<string> zone_names = new array<string>;
9737 GetDamageZones(zone_names);
9738 for (int i = 0; i < zone_names.Count(); i++)
9739 {
9740 SetHealthMax(zone_names.Get(i),"Health");
9741 }
9742 SetHealthMax("","Health");
9743 }
9744
9747 {
9748 float global_health = GetHealth01("","Health");
9749 array<string> zones = new array<string>;
9750 GetDamageZones(zones);
9751
9752 for (int i = 0; i < zones.Count(); i++)
9753 {
9754 SetHealth01(zones.Get(i),"Health",global_health);
9755 }
9756 }
9757
9760 {
9761 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9762 }
9763
9765 {
9766 if (!hasRootAsPlayer)
9767 {
9768 if (refParentIB)
9769 {
9770
9771 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9772 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9773
9774 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9775 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9776
9779 }
9780 else
9781 {
9782
9785 }
9786 }
9787 }
9788
9790 {
9792 {
9793 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9794 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9795 {
9796 float heatPermCoef = 1.0;
9798 while (ent)
9799 {
9800 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9801 ent = ent.GetHierarchyParent();
9802 }
9803
9804 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9805 }
9806 }
9807 }
9808
9810 {
9811
9812 EntityAI parent = GetHierarchyParent();
9813 if (!parent)
9814 {
9815 hasParent = false;
9816 hasRootAsPlayer = false;
9817 }
9818 else
9819 {
9820 hasParent = true;
9821 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9822 refParentIB =
ItemBase.Cast(parent);
9823 }
9824 }
9825
9826 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9827 {
9828
9829 }
9830
9832 {
9833
9834 return false;
9835 }
9836
9838 {
9839
9840
9841 return false;
9842 }
9843
9845 {
9846
9847 return false;
9848 }
9849
9852 {
9853 return !GetIsFrozen() &&
IsOpen();
9854 }
9855
9857 {
9858 bool hasParent = false, hasRootAsPlayer = false;
9860
9861 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9862 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9863
9864 if (wwtu || foodDecay)
9865 {
9869
9870 if (processWetness || processTemperature || processDecay)
9871 {
9873
9874 if (processWetness)
9875 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9876
9877 if (processTemperature)
9879
9880 if (processDecay)
9881 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9882 }
9883 }
9884 }
9885
9888 {
9890 }
9891
9893 {
9896
9897 return super.GetTemperatureFreezeThreshold();
9898 }
9899
9901 {
9904
9905 return super.GetTemperatureThawThreshold();
9906 }
9907
9909 {
9912
9913 return super.GetItemOverheatThreshold();
9914 }
9915
9917 {
9919 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9920
9921 return super.GetTemperatureFreezeTime();
9922 }
9923
9925 {
9927 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9928
9929 return super.GetTemperatureThawTime();
9930 }
9931
9936
9938 {
9939 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
9940 }
9941
9943 {
9944 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
9945 }
9946
9949 {
9951 }
9952
9954 {
9956 }
9957
9959 {
9961 }
9962
9965 {
9966 return null;
9967 }
9968
9971 {
9972 return false;
9973 }
9974
9976 {
9978 {
9981 if (!trg)
9982 {
9984 explosive = this;
9985 }
9986
9987 explosive.PairRemote(trg);
9989
9990 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
9991 trg.SetPersistentPairID(persistentID);
9992 explosive.SetPersistentPairID(persistentID);
9993
9994 return true;
9995 }
9996 return false;
9997 }
9998
10001 {
10002 float ret = 1.0;
10005 ret *= GetHealth01();
10006
10007 return ret;
10008 }
10009
10010 #ifdef DEVELOPER
10011 override void SetDebugItem()
10012 {
10013 super.SetDebugItem();
10014 _itemBase = this;
10015 }
10016
10018 {
10019 string text = super.GetDebugText();
10020
10022 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10023
10024 return text;
10025 }
10026 #endif
10027
10029 {
10030 return true;
10031 }
10032
10034
10036
10038 {
10041 }
10042
10043
10051
10067}
10068
10070{
10072 if (entity)
10073 {
10074 bool is_item = entity.IsInherited(
ItemBase);
10075 if (is_item && full_quantity)
10076 {
10079 }
10080 }
10081 else
10082 {
10084 return NULL;
10085 }
10086 return entity;
10087}
10088
10090{
10091 if (item)
10092 {
10093 if (health > 0)
10094 item.SetHealth("", "", health);
10095
10096 if (item.CanHaveTemperature())
10097 {
10099 if (item.CanFreeze())
10100 item.SetFrozen(false);
10101 }
10102
10103 if (item.HasEnergyManager())
10104 {
10105 if (quantity >= 0)
10106 {
10107 item.GetCompEM().SetEnergy0To1(quantity);
10108 }
10109 else
10110 {
10112 }
10113 }
10114 else if (item.IsMagazine())
10115 {
10116 Magazine mag = Magazine.Cast(item);
10117 if (quantity >= 0)
10118 {
10119 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10120 }
10121 else
10122 {
10124 }
10125
10126 }
10127 else
10128 {
10129 if (quantity >= 0)
10130 {
10131 item.SetQuantityNormalized(quantity, false);
10132 }
10133 else
10134 {
10136 }
10137
10138 }
10139 }
10140}
10141
10142#ifdef DEVELOPER
10144#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.