5235{
5237 {
5238 return true;
5239 }
5240};
5241
5242
5243
5245{
5249
5251
5254
5255
5256
5257
5258
5267
5273
5278
5283
5304 protected bool m_IsResultOfSplit
5305
5307
5312
5313
5314
5316
5320
5321
5322
5324
5327
5328
5329
5335
5336
5344
5347
5348
5350
5351
5353
5354
5359
5360
5365
5366
5368
5369
5371 {
5376
5377 if (!
GetGame().IsDedicatedServer())
5378 {
5380 {
5382
5384 {
5386 }
5387 }
5388
5391 }
5392
5393 m_OldLocation = null;
5394
5396 {
5398 }
5399
5400 if (ConfigIsExisting("headSelectionsToHide"))
5401 {
5404 }
5405
5407 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5408 {
5410 }
5411
5413
5414 m_IsResultOfSplit = false;
5415
5417 }
5418
5420 {
5421 super.InitItemVariables();
5422
5428 m_Count = ConfigGetInt(
"count");
5429
5432
5437
5440
5445
5457
5461
5462
5465 if (ConfigIsExisting("canBeSplit"))
5466 {
5469 }
5470
5472 if (ConfigIsExisting("itemBehaviour"))
5474
5475
5478 RegisterNetSyncVariableInt("m_VarLiquidType");
5479 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5480
5481 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5482 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5483 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5484
5485 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5486 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5487 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5488 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5489
5490 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5491 RegisterNetSyncVariableBool("m_IsTakeable");
5492 RegisterNetSyncVariableBool("m_IsHologram");
5493
5496 {
5499 }
5500
5502
5504 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5506
5507 }
5508
5510 {
5512 }
5513
5515 {
5518 {
5523 }
5524 }
5525
5526 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5527 {
5529 {
5532 }
5533
5535 }
5536
5538 {
5544 }
5545
5547
5549 {
5551
5552 if (!action)
5553 {
5554 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5555 return;
5556 }
5557
5559 if (!ai)
5560 {
5562 return;
5563 }
5564
5566 if (!action_array)
5567 {
5568 action_array = new array<ActionBase_Basic>;
5570 }
5571 if (LogManager.IsActionLogEnable())
5572 {
5573 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5574 }
5575
5576 if (action_array.Find(action) != -1)
5577 {
5578 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5579 }
5580 else
5581 {
5582 action_array.Insert(action);
5583 }
5584 }
5585
5587 {
5589 ActionBase action = player.GetActionManager().GetAction(actionName);
5592
5593 if (action_array)
5594 {
5595 action_array.RemoveItem(action);
5596 }
5597 }
5598
5599
5600
5602 {
5603 ActionOverrideData overrideData = new ActionOverrideData();
5607
5609 if (!actionMap)
5610 {
5613 }
5614
5615 actionMap.Insert(this.
Type(), overrideData);
5616
5617 }
5618
5620
5622
5623
5625 {
5628
5631
5632 string config_to_search = "CfgVehicles";
5633 string muzzle_owner_config;
5634
5636 {
5637 if (IsInherited(Weapon))
5638 config_to_search = "CfgWeapons";
5639
5640 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5641
5642 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5643
5645
5646 if (config_OnFire_subclass_count > 0)
5647 {
5648 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5649
5650 for (int i = 0; i < config_OnFire_subclass_count; i++)
5651 {
5652 string particle_class = "";
5654 string config_OnFire_entry = config_OnFire_class + particle_class;
5655 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5656 WPOF_array.Insert(WPOF);
5657 }
5658
5659
5661 }
5662 }
5663
5665 {
5666 config_to_search = "CfgWeapons";
5667 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5668
5669 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5670
5672
5673 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5674 {
5675 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5676
5677 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5678 {
5679 string particle_class2 = "";
5681 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5682 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5683 WPOBE_array.Insert(WPOBE);
5684 }
5685
5686
5688 }
5689 }
5690 }
5691
5692
5694 {
5697
5699 {
5700 string config_to_search = "CfgVehicles";
5701
5702 if (IsInherited(Weapon))
5703 config_to_search = "CfgWeapons";
5704
5705 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5706 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5707
5708 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5709 {
5710
5712
5714 {
5716 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5718 return;
5719 }
5720
5723
5724
5725
5727 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5728
5729 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5730 {
5731 string particle_class = "";
5733 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5735
5736 if (entry_type == CT_CLASS)
5737 {
5738 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5739 WPOOH_array.Insert(WPOF);
5740 }
5741 }
5742
5743
5745 }
5746 }
5747 }
5748
5750 {
5752 }
5753
5755 {
5757 {
5759
5762
5765
5766 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5767 }
5768 }
5769
5771 {
5773 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5774
5776 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5777
5779 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5780
5782 {
5784 }
5785 }
5786
5788 {
5790 }
5791
5793 {
5796 else
5798
5800 {
5803 }
5804 else
5805 {
5808
5811 }
5812
5814 }
5815
5817 {
5819 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5820 }
5821
5823 {
5825 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5827 }
5828
5830 {
5832 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5833 }
5834
5836 {
5839
5840 OverheatingParticle OP = new OverheatingParticle();
5845
5847 }
5848
5850 {
5853
5854 return -1;
5855 }
5856
5858 {
5860 {
5863
5864 for (int i = count; i > 0; --i)
5865 {
5866 int id = i - 1;
5869
5872
5873 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5874 {
5875 if (p)
5876 {
5879 }
5880 }
5881 }
5882 }
5883 }
5884
5886 {
5888 {
5890 {
5891 int id = i - 1;
5893
5894 if (OP)
5895 {
5897
5898 if (p)
5899 {
5901 }
5902
5903 delete OP;
5904 }
5905 }
5906
5909 }
5910 }
5911
5914 {
5915 return 0.0;
5916 }
5917
5918
5920 {
5921 return 250;
5922 }
5923
5925 {
5926 return 0;
5927 }
5928
5931 {
5933 return true;
5934
5935 return false;
5936 }
5937
5940 {
5943
5945 {
5947 }
5948 else
5949 {
5950
5952 }
5953
5955 }
5956
5963 {
5964 return -1;
5965 }
5966
5967
5968
5969
5971 {
5973 {
5975 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
5976
5977 if (r_index >= 0)
5978 {
5979 InventoryLocation r_il = new InventoryLocation;
5980 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
5981
5982 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
5985 {
5986 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
5987 }
5989 {
5990 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
5991 }
5992
5993 }
5994
5995 player.GetHumanInventory().ClearUserReservedLocation(this);
5996 }
5997
6000 }
6001
6002
6003
6004
6006 {
6007 return ItemBase.m_DebugActionsMask;
6008 }
6009
6011 {
6012 return ItemBase.m_DebugActionsMask & mask;
6013 }
6014
6016 {
6017 ItemBase.m_DebugActionsMask = mask;
6018 }
6019
6021 {
6022 ItemBase.m_DebugActionsMask |= mask;
6023 }
6024
6026 {
6027 ItemBase.m_DebugActionsMask &= ~mask;
6028 }
6029
6031 {
6033 {
6035 }
6036 else
6037 {
6039 }
6040 }
6041
6042
6044 {
6045 if (GetEconomyProfile())
6046 {
6047 float q_max = GetEconomyProfile().GetQuantityMax();
6048 if (q_max > 0)
6049 {
6050 float q_min = GetEconomyProfile().GetQuantityMin();
6051 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6052
6054 {
6055 ComponentEnergyManager comp = GetCompEM();
6057 {
6059 }
6060 }
6062 {
6064
6065 }
6066
6067 }
6068 }
6069 }
6070
6073 {
6074 EntityAI parent = GetHierarchyParent();
6075
6076 if (parent)
6077 {
6078 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6079 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6080 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6081 }
6082 }
6083
6086 {
6087 EntityAI parent = GetHierarchyParent();
6088
6089 if (parent)
6090 {
6091 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6092 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6093 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6094 }
6095 }
6096
6098 {
6099
6100
6101
6102
6104
6106 {
6107 if (ScriptInputUserData.CanStoreInputUserData())
6108 {
6109 ScriptInputUserData ctx = new ScriptInputUserData;
6115 ctx.
Write(use_stack_max);
6118
6120 {
6121 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6122 }
6123 }
6124 }
6125 else if (!
GetGame().IsMultiplayer())
6126 {
6128 }
6129 }
6130
6132 {
6134 }
6135
6137 {
6139 }
6140
6142 {
6144 }
6145
6147 {
6148
6149 return false;
6150 }
6151
6153 {
6154 return false;
6155 }
6156
6160 {
6161 return false;
6162 }
6163
6165 {
6166 return "";
6167 }
6168
6170
6172 {
6173 return false;
6174 }
6175
6177 {
6178 return true;
6179 }
6180
6181
6182
6184 {
6185 return true;
6186 }
6187
6189 {
6190 return true;
6191 }
6192
6194 {
6195 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6197 }
6198
6200 {
6202 }
6203
6205 {
6207 if (!is_being_placed)
6209 SetSynchDirty();
6210 }
6211
6212
6214
6216 {
6218 }
6219
6221 {
6223 }
6224
6226 {
6227 return 1;
6228 }
6229
6231 {
6232 return false;
6233 }
6234
6236 {
6238 SetSynchDirty();
6239 }
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6276 {
6277 super.OnMovedInsideCargo(container);
6278
6279 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6280 }
6281
6282 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6283 {
6284 super.EEItemLocationChanged(oldLoc,newLoc);
6285
6286 PlayerBase new_player = null;
6287 PlayerBase old_player = null;
6288
6289 if (newLoc.GetParent())
6290 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6291
6292 if (oldLoc.GetParent())
6293 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6294
6296 {
6297 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6298
6299 if (r_index >= 0)
6300 {
6301 InventoryLocation r_il = new InventoryLocation;
6302 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6303
6304 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6307 {
6308 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6309 }
6311 {
6312 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6313 }
6314
6315 }
6316 }
6317
6319 {
6320 if (new_player)
6321 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6322
6323 if (new_player == old_player)
6324 {
6325
6326 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6327 {
6329 {
6330 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6331 {
6332 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6333 }
6334 }
6335 else
6336 {
6337 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6338 }
6339 }
6340
6341 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6342 {
6343 int type = oldLoc.GetType();
6345 {
6346 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6347 }
6349 {
6350 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6351 }
6352 }
6353 if (!m_OldLocation)
6354 {
6355 m_OldLocation = new InventoryLocation;
6356 }
6357 m_OldLocation.Copy(oldLoc);
6358 }
6359 else
6360 {
6361 if (m_OldLocation)
6362 {
6363 m_OldLocation.Reset();
6364 }
6365 }
6366
6368 }
6369 else
6370 {
6371 if (new_player)
6372 {
6373 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6374 if (res_index >= 0)
6375 {
6376 InventoryLocation il = new InventoryLocation;
6377 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6379 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6382 {
6383 il.
GetParent().GetOnReleaseLock().Invoke(it);
6384 }
6386 {
6388 }
6389
6390 }
6391 }
6393 {
6394
6396 }
6397
6398 if (m_OldLocation)
6399 {
6400 m_OldLocation.Reset();
6401 }
6402 }
6403 }
6404
6405 override void EOnContact(IEntity other, Contact extra)
6406 {
6408 {
6409 int liquidType = -1;
6411 if (impactSpeed > 0.0)
6412 {
6414 #ifndef SERVER
6416 #else
6418 SetSynchDirty();
6419 #endif
6421 }
6422 }
6423
6424 #ifdef SERVER
6425 if (GetCompEM() && GetCompEM().IsPlugged())
6426 {
6427 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6428 GetCompEM().UnplugThis();
6429 }
6430 #endif
6431 }
6432
6434
6436 {
6438 }
6439
6441 {
6442
6443 }
6444
6446 {
6447 super.OnItemLocationChanged(old_owner, new_owner);
6448
6449 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6450 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6451
6452 if (!relatedPlayer && playerNew)
6453 relatedPlayer = playerNew;
6454
6455 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6456 {
6458 if (actionMgr)
6459 {
6460 ActionBase currentAction = actionMgr.GetRunningAction();
6461 if (currentAction)
6463 }
6464 }
6465
6466 Man ownerPlayerOld = null;
6467 Man ownerPlayerNew = null;
6468
6469 if (old_owner)
6470 {
6471 if (old_owner.
IsMan())
6472 {
6473 ownerPlayerOld = Man.Cast(old_owner);
6474 }
6475 else
6476 {
6477 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6478 }
6479 }
6480 else
6481 {
6483 {
6485
6486 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6487 {
6488 GetCompEM().UnplugThis();
6489 }
6490 }
6491 }
6492
6493 if (new_owner)
6494 {
6495 if (new_owner.
IsMan())
6496 {
6497 ownerPlayerNew = Man.Cast(new_owner);
6498 }
6499 else
6500 {
6501 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6502 }
6503 }
6504
6505 if (ownerPlayerOld != ownerPlayerNew)
6506 {
6507 if (ownerPlayerOld)
6508 {
6509 array<EntityAI> subItemsExit = new array<EntityAI>;
6511 for (int i = 0; i < subItemsExit.Count(); i++)
6512 {
6515 }
6516 }
6517
6518 if (ownerPlayerNew)
6519 {
6520 array<EntityAI> subItemsEnter = new array<EntityAI>;
6522 for (int j = 0; j < subItemsEnter.Count(); j++)
6523 {
6526 }
6527 }
6528 }
6529 else if (ownerPlayerNew != null)
6530 {
6531 PlayerBase nplayer;
6532 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6533 {
6534 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6536 for (int k = 0; k < subItemsUpdate.Count(); k++)
6537 {
6539 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6540 }
6541 }
6542 }
6543
6544 if (old_owner)
6545 old_owner.OnChildItemRemoved(this);
6546 if (new_owner)
6547 new_owner.OnChildItemReceived(this);
6548 }
6549
6550
6552 {
6553 super.EEDelete(parent);
6554 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6555 if (player)
6556 {
6558
6559 if (player.IsAlive())
6560 {
6561 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6562 if (r_index >= 0)
6563 {
6564 InventoryLocation r_il = new InventoryLocation;
6565 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6566
6567 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6570 {
6571 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6572 }
6574 {
6575 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6576 }
6577
6578 }
6579
6580 player.RemoveQuickBarEntityShortcut(this);
6581 }
6582 }
6583 }
6584
6586 {
6587 super.EEKilled(killer);
6588
6591 {
6592 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6593 {
6594 if (IsMagazine())
6595 {
6596 if (Magazine.Cast(this).GetAmmoCount() > 0)
6597 {
6599 }
6600 }
6601 else
6602 {
6604 }
6605 }
6606 }
6607 }
6608
6610 {
6611 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6612
6613 super.OnWasAttached(parent, slot_id);
6614
6617
6619 }
6620
6622 {
6623 super.OnWasDetached(parent, slot_id);
6624
6627 }
6628
6630 {
6631 int idx;
6634
6635 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6636 if (inventory_slots.Count() < 1)
6637 {
6638 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6639 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6640 }
6641 else
6642 {
6643 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6644 }
6645
6646 idx = inventory_slots.Find(slot);
6647 if (idx < 0)
6648 return "";
6649
6650 return attach_types.Get(idx);
6651 }
6652
6654 {
6655 int idx = -1;
6656 string slot;
6657
6660
6661 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6662 if (inventory_slots.Count() < 1)
6663 {
6664 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6665 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6666 }
6667 else
6668 {
6669 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6670 if (detach_types.Count() < 1)
6671 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6672 }
6673
6674 for (int i = 0; i < inventory_slots.Count(); i++)
6675 {
6676 slot = inventory_slots.Get(i);
6677 }
6678
6679 if (slot != "")
6680 {
6681 if (detach_types.Count() == 1)
6682 idx = 0;
6683 else
6684 idx = inventory_slots.Find(slot);
6685 }
6686 if (idx < 0)
6687 return "";
6688
6689 return detach_types.Get(idx);
6690 }
6691
6693 {
6694
6696
6697
6698 float min_time = 1;
6699 float max_time = 3;
6700 float delay = Math.RandomFloat(min_time, max_time);
6701
6702 explode_timer.Run(delay, this, "DoAmmoExplosion");
6703 }
6704
6706 {
6707 Magazine magazine = Magazine.Cast(this);
6708 int pop_sounds_count = 6;
6709 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6710
6711
6712 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6713 string sound_name = pop_sounds[ sound_idx ];
6715
6716
6717 magazine.ServerAddAmmoCount(-1);
6718
6719
6720 float min_temp_to_explode = 100;
6721
6722 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6723 {
6725 }
6726 }
6727
6728
6729 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6730 {
6731 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6732
6733 const int CHANCE_DAMAGE_CARGO = 4;
6734 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6735 const int CHANCE_DAMAGE_NOTHING = 2;
6736
6738 {
6739 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6740 int chances;
6741 int rnd;
6742
6743 if (GetInventory().GetCargo())
6744 {
6745 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6746 rnd = Math.RandomInt(0,chances);
6747
6748 if (rnd < CHANCE_DAMAGE_CARGO)
6749 {
6751 }
6752 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6753 {
6755 }
6756 }
6757 else
6758 {
6759 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6760 rnd = Math.RandomInt(0,chances);
6761
6762 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6763 {
6765 }
6766 }
6767 }
6768 }
6769
6771 {
6772 if (GetInventory().GetCargo())
6773 {
6774 int item_count = GetInventory().GetCargo().GetItemCount();
6775 if (item_count > 0)
6776 {
6777 int random_pick = Math.RandomInt(0, item_count);
6779 if (!item.IsExplosive())
6780 {
6781 item.AddHealth("","",damage);
6782 return true;
6783 }
6784 }
6785 }
6786 return false;
6787 }
6788
6790 {
6791 int attachment_count = GetInventory().AttachmentCount();
6792 if (attachment_count > 0)
6793 {
6794 int random_pick = Math.RandomInt(0, attachment_count);
6795 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6796 if (!attachment.IsExplosive())
6797 {
6798 attachment.AddHealth("","",damage);
6799 return true;
6800 }
6801 }
6802 return false;
6803 }
6804
6806 {
6808 }
6809
6811 {
6813 return GetInventory().CanRemoveEntity();
6814
6815 return false;
6816 }
6817
6819 {
6821 return;
6822
6824 {
6825 if (ScriptInputUserData.CanStoreInputUserData())
6826 {
6827 ScriptInputUserData ctx = new ScriptInputUserData;
6832 ctx.
Write(destination_entity);
6836 }
6837 }
6838 else if (!
GetGame().IsMultiplayer())
6839 {
6841 }
6842 }
6843
6845 {
6847 return;
6848
6849 float split_quantity_new;
6853 InventoryLocation loc = new InventoryLocation;
6854
6855 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6856 {
6858 split_quantity_new = stack_max;
6859 else
6861
6862 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6863 if (new_item)
6864 {
6865 new_item.SetResultOfSplit(true);
6866 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6868 new_item.SetQuantity(split_quantity_new);
6869 }
6870 }
6871 else if (destination_entity && slot_id == -1)
6872 {
6873 if (quantity > stack_max)
6874 split_quantity_new = stack_max;
6875 else
6876 split_quantity_new = quantity;
6877
6879 {
6882 }
6883
6884 if (new_item)
6885 {
6886 new_item.SetResultOfSplit(true);
6887 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6889 new_item.SetQuantity(split_quantity_new);
6890 }
6891 }
6892 else
6893 {
6894 if (stack_max != 0)
6895 {
6897 {
6899 }
6900
6901 if (split_quantity_new == 0)
6902 {
6903 if (!
GetGame().IsMultiplayer())
6904 player.PhysicalPredictiveDropItem(this);
6905 else
6906 player.ServerDropEntity(this);
6907 return;
6908 }
6909
6911
6912 if (new_item)
6913 {
6914 new_item.SetResultOfSplit(true);
6915 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6917 new_item.SetQuantity(stack_max);
6918 new_item.PlaceOnSurface();
6919 }
6920 }
6921 }
6922 }
6923
6925 {
6927 return;
6928
6929 float split_quantity_new;
6933 InventoryLocation loc = new InventoryLocation;
6934
6935 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6936 {
6938 split_quantity_new = stack_max;
6939 else
6941
6942 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6943 if (new_item)
6944 {
6945 new_item.SetResultOfSplit(true);
6946 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6948 new_item.SetQuantity(split_quantity_new);
6949 }
6950 }
6951 else if (destination_entity && slot_id == -1)
6952 {
6953 if (quantity > stack_max)
6954 split_quantity_new = stack_max;
6955 else
6956 split_quantity_new = quantity;
6957
6959 {
6962 }
6963
6964 if (new_item)
6965 {
6966 new_item.SetResultOfSplit(true);
6967 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6969 new_item.SetQuantity(split_quantity_new);
6970 }
6971 }
6972 else
6973 {
6974 if (stack_max != 0)
6975 {
6977 {
6979 }
6980
6982
6983 if (new_item)
6984 {
6985 new_item.SetResultOfSplit(true);
6986 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6988 new_item.SetQuantity(stack_max);
6989 new_item.PlaceOnSurface();
6990 }
6991 }
6992 }
6993 }
6994
6996 {
6998 return;
6999
7001 {
7002 if (ScriptInputUserData.CanStoreInputUserData())
7003 {
7004 ScriptInputUserData ctx = new ScriptInputUserData;
7009 dst.WriteToContext(ctx);
7011 }
7012 }
7013 else if (!
GetGame().IsMultiplayer())
7014 {
7016 }
7017 }
7018
7020 {
7022 return;
7023
7025 {
7026 if (ScriptInputUserData.CanStoreInputUserData())
7027 {
7028 ScriptInputUserData ctx = new ScriptInputUserData;
7033 ctx.
Write(destination_entity);
7039 }
7040 }
7041 else if (!
GetGame().IsMultiplayer())
7042 {
7044 }
7045 }
7046
7048 {
7050 }
7051
7053 {
7055 return this;
7056
7058 float split_quantity_new;
7060 if (dst.IsValid())
7061 {
7062 int slot_id = dst.GetSlot();
7064
7065 if (quantity > stack_max)
7066 split_quantity_new = stack_max;
7067 else
7068 split_quantity_new = quantity;
7069
7071
7072 if (new_item)
7073 {
7074 new_item.SetResultOfSplit(true);
7075 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7078 }
7079
7080 return new_item;
7081 }
7082
7083 return null;
7084 }
7085
7087 {
7089 return;
7090
7092 float split_quantity_new;
7094 if (destination_entity)
7095 {
7097 if (quantity > stackable)
7098 split_quantity_new = stackable;
7099 else
7100 split_quantity_new = quantity;
7101
7102 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7103 if (new_item)
7104 {
7105 new_item.SetResultOfSplit(true);
7106 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7108 new_item.SetQuantity(split_quantity_new);
7109 }
7110 }
7111 }
7112
7114 {
7116 return;
7117
7119 {
7120 if (ScriptInputUserData.CanStoreInputUserData())
7121 {
7122 ScriptInputUserData ctx = new ScriptInputUserData;
7127 ItemBase destination_entity =
this;
7128 ctx.
Write(destination_entity);
7132 }
7133 }
7134 else if (!
GetGame().IsMultiplayer())
7135 {
7137 }
7138 }
7139
7141 {
7143 return;
7144
7146 float split_quantity_new;
7148 if (player)
7149 {
7151 if (quantity > stackable)
7152 split_quantity_new = stackable;
7153 else
7154 split_quantity_new = quantity;
7155
7156 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7157 new_item =
ItemBase.Cast(in_hands);
7158 if (new_item)
7159 {
7160 new_item.SetResultOfSplit(true);
7161 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7163 new_item.SetQuantity(split_quantity_new);
7164 }
7165 }
7166 }
7167
7169 {
7171 return;
7172
7174 float split_quantity_new = Math.Floor(quantity * 0.5);
7175
7177
7178 if (new_item)
7179 {
7180 if (new_item.GetQuantityMax() < split_quantity_new)
7181 {
7182 split_quantity_new = new_item.GetQuantityMax();
7183 }
7184
7185 new_item.SetResultOfSplit(true);
7186 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7187
7189 {
7192 }
7193 else
7194 {
7197 }
7198 }
7199 }
7200
7202 {
7204 return;
7205
7207 float split_quantity_new = Math.Floor(quantity / 2);
7208
7209 InventoryLocation invloc = new InventoryLocation;
7211
7213 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7214
7215 if (new_item)
7216 {
7217 if (new_item.GetQuantityMax() < split_quantity_new)
7218 {
7219 split_quantity_new = new_item.GetQuantityMax();
7220 }
7222 {
7225 }
7226 else
7227 {
7230 }
7231 }
7232 }
7233
7236 {
7237 SetWeightDirty();
7239
7240 if (parent)
7241 parent.OnAttachmentQuantityChangedEx(this, delta);
7242
7244 {
7246 {
7248 }
7250 {
7251 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7253 }
7254 }
7255
7256 }
7257
7260 {
7261
7262 }
7263
7266 {
7268 }
7269
7271 {
7272 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7273
7275 {
7276 if (newLevel == GameConstants.STATE_RUINED)
7277 {
7279 EntityAI parent = GetHierarchyParent();
7280 if (parent && parent.IsFireplace())
7281 {
7282 CargoBase cargo = GetInventory().GetCargo();
7283 if (cargo)
7284 {
7286 {
7288 }
7289 }
7290 }
7291 }
7292
7294 {
7295
7297 return;
7298 }
7299
7300 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7301 {
7303 }
7304 }
7305 }
7306
7307
7309 {
7310 super.OnRightClick();
7311
7313 {
7315 {
7316 if (ScriptInputUserData.CanStoreInputUserData())
7317 {
7318 vector m4[4];
7320
7321 EntityAI root = GetHierarchyRoot();
7322
7323 InventoryLocation dst = new InventoryLocation;
7325 {
7326 if (root)
7327 {
7328 root.GetTransform(m4);
7330 }
7331 else
7332 GetInventory().GetCurrentInventoryLocation(dst);
7333 }
7334 else
7335 {
7337
7338
7339 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7340 {
7341 if (root)
7342 {
7343 root.GetTransform(m4);
7345 }
7346 else
7347 GetInventory().GetCurrentInventoryLocation(dst);
7348 }
7349 else
7350 {
7351 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7352 }
7353 }
7354
7355 ScriptInputUserData ctx = new ScriptInputUserData;
7363 }
7364 }
7365 else if (!
GetGame().IsMultiplayer())
7366 {
7368 }
7369 }
7370 }
7371
7372 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7373 {
7374
7375 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7376 return false;
7377
7378 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7379 return false;
7380
7381
7383 return false;
7384
7385
7386 Magazine mag = Magazine.Cast(this);
7387 if (mag)
7388 {
7389 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7390 return false;
7391
7392 if (stack_max_limit)
7393 {
7394 Magazine other_mag = Magazine.Cast(other_item);
7395 if (other_item)
7396 {
7397 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7398 return false;
7399 }
7400
7401 }
7402 }
7403 else
7404 {
7405
7407 return false;
7408
7410 return false;
7411 }
7412
7413 PlayerBase player = null;
7414 if (CastTo(player, GetHierarchyRootPlayer()))
7415 {
7416 if (player.GetInventory().HasAttachment(this))
7417 return false;
7418
7419 if (player.IsItemsToDelete())
7420 return false;
7421 }
7422
7423 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7424 return false;
7425
7426 int slotID;
7428 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7429 return false;
7430
7431 return true;
7432 }
7433
7435 {
7437 }
7438
7440 {
7441 return m_IsResultOfSplit;
7442 }
7443
7445 {
7446 m_IsResultOfSplit = value;
7447 }
7448
7450 {
7452 }
7453
7455 {
7456 float other_item_quantity = other_item.GetQuantity();
7457 float this_free_space;
7458
7460
7462
7463 if (other_item_quantity > this_free_space)
7464 {
7465 return this_free_space;
7466 }
7467 else
7468 {
7469 return other_item_quantity;
7470 }
7471 }
7472
7474 {
7476 }
7477
7479 {
7481 return;
7482
7483 if (!IsMagazine() && other_item)
7484 {
7486 if (quantity_used != 0)
7487 {
7488 float hp1 = GetHealth01("","");
7489 float hp2 = other_item.GetHealth01("","");
7490 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7491 hpResult = hpResult / (
GetQuantity() + quantity_used);
7492
7493 hpResult *= GetMaxHealth();
7494 Math.Round(hpResult);
7495 SetHealth("", "Health", hpResult);
7496
7498 other_item.AddQuantity(-quantity_used);
7499 }
7500 }
7502 }
7503
7505 {
7506 #ifdef SERVER
7507 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7508 GetHierarchyParent().IncreaseLifetimeUp();
7509 #endif
7510 };
7511
7513 {
7514 PlayerBase p = PlayerBase.Cast(player);
7515
7516 array<int> recipesIds = p.m_Recipes;
7517 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7518 if (moduleRecipesManager)
7519 {
7520 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7521 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7522 }
7523
7524 for (int i = 0;i < recipesIds.Count(); i++)
7525 {
7526 int key = recipesIds.Get(i);
7527 string recipeName = moduleRecipesManager.GetRecipeName(key);
7529 }
7530 }
7531
7532
7533 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7534 {
7535 super.GetDebugActions(outputList);
7536
7537
7542
7543
7547
7551
7552
7555
7556
7558 {
7561 }
7562
7564
7567
7571 }
7572
7573
7574
7575
7577 {
7578 super.OnAction(action_id, player, ctx);
7579 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7580 {
7581 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7582 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7583 PlayerBase p = PlayerBase.Cast(player);
7584 if (
EActions.RECIPES_RANGE_START < 1000)
7585 {
7586 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7587 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7588 }
7589 }
7590 #ifndef SERVER
7591 else if (action_id ==
EActions.WATCH_PLAYER)
7592 {
7593 PluginDeveloper.SetDeveloperItemClientEx(player);
7594 }
7595 #endif
7597 {
7598 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7599 {
7600 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7601 OnDebugButtonPressServer(id + 1);
7602 }
7603
7604 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7605 {
7606 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7608 }
7609
7610 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7611 {
7612 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7614 }
7615
7616 else if (action_id ==
EActions.ADD_QUANTITY)
7617 {
7618 if (IsMagazine())
7619 {
7620 Magazine mag = Magazine.Cast(this);
7621 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7622 }
7623 else
7624 {
7626 }
7627
7628 if (m_EM)
7629 {
7630 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7631 }
7632
7633 }
7634
7635 else if (action_id ==
EActions.REMOVE_QUANTITY)
7636 {
7637 if (IsMagazine())
7638 {
7639 Magazine mag2 = Magazine.Cast(this);
7640 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7641 }
7642 else
7643 {
7645 }
7646 if (m_EM)
7647 {
7648 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7649 }
7650
7651 }
7652
7653 else if (action_id ==
EActions.SET_QUANTITY_0)
7654 {
7656
7657 if (m_EM)
7658 {
7659 m_EM.SetEnergy(0);
7660 }
7661 }
7662
7663 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7664 {
7666
7667 if (m_EM)
7668 {
7669 m_EM.SetEnergy(m_EM.GetEnergyMax());
7670 }
7671 }
7672
7673 else if (action_id ==
EActions.ADD_HEALTH)
7674 {
7675 AddHealth("","",GetMaxHealth("","Health")/5);
7676 }
7677 else if (action_id ==
EActions.REMOVE_HEALTH)
7678 {
7679 AddHealth("","",-GetMaxHealth("","Health")/5);
7680 }
7681 else if (action_id ==
EActions.DESTROY_HEALTH)
7682 {
7683 SetHealth01("","",0);
7684 }
7685 else if (action_id ==
EActions.WATCH_ITEM)
7686 {
7688 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7689 #ifdef DEVELOPER
7690 SetDebugDeveloper_item(this);
7691 #endif
7692 }
7693
7694 else if (action_id ==
EActions.ADD_TEMPERATURE)
7695 {
7696 AddTemperature(20);
7697
7698 }
7699
7700 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7701 {
7702 AddTemperature(-20);
7703
7704 }
7705
7706 else if (action_id ==
EActions.FLIP_FROZEN)
7707 {
7708 SetFrozen(!GetIsFrozen());
7709
7710 }
7711
7712 else if (action_id ==
EActions.ADD_WETNESS)
7713 {
7715
7716 }
7717
7718 else if (action_id ==
EActions.REMOVE_WETNESS)
7719 {
7721
7722 }
7723
7724 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7725 {
7728
7729
7730 }
7731
7732 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7733 {
7736 }
7737
7738 else if (action_id ==
EActions.MAKE_SPECIAL)
7739 {
7740 auto debugParams = DebugSpawnParams.WithPlayer(player);
7741 OnDebugSpawnEx(debugParams);
7742 }
7743
7744 else if (action_id ==
EActions.DELETE)
7745 {
7746 Delete();
7747 }
7748
7749 }
7750
7751
7752 return false;
7753 }
7754
7755
7756
7757
7761
7764
7765
7766
7768 {
7769 return false;
7770 }
7771
7772
7774 {
7775 return true;
7776 }
7777
7778
7780 {
7781 return true;
7782 }
7783
7784
7785
7787 {
7788 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7790 }
7791
7794 {
7795 return null;
7796 }
7797
7799 {
7800 return false;
7801 }
7802
7804 {
7805 return false;
7806 }
7807
7811
7812
7814 {
7815 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7816 return module_repairing.CanRepair(this, item_repair_kit);
7817 }
7818
7819
7820 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7821 {
7822 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7823 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7824 }
7825
7826
7828 {
7829
7830
7831
7832
7833
7834
7835
7836
7837 return 1;
7838 }
7839
7840
7841
7843 {
7845 }
7846
7847
7848
7850 {
7852 }
7853
7854
7863 {
7864 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7865
7866 if (player)
7867 {
7868 player.MessageStatus(text);
7869 }
7870 }
7871
7872
7881 {
7882 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7883
7884 if (player)
7885 {
7886 player.MessageAction(text);
7887 }
7888 }
7889
7890
7899 {
7900 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7901
7902 if (player)
7903 {
7904 player.MessageFriendly(text);
7905 }
7906 }
7907
7908
7917 {
7918 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7919
7920 if (player)
7921 {
7922 player.MessageImportant(text);
7923 }
7924 }
7925
7927 {
7928 return true;
7929 }
7930
7931
7932 override bool KindOf(
string tag)
7933 {
7934 bool found = false;
7935 string item_name = this.
GetType();
7938
7939 int array_size = item_tag_array.Count();
7940 for (int i = 0; i < array_size; i++)
7941 {
7942 if (item_tag_array.Get(i) == tag)
7943 {
7944 found = true;
7945 break;
7946 }
7947 }
7948 return found;
7949 }
7950
7951
7953 {
7954
7955 super.OnRPC(sender, rpc_type,ctx);
7956
7957
7958 switch (rpc_type)
7959 {
7960 #ifndef SERVER
7961 case ERPCs.RPC_SOUND_LOCK_ATTACH:
7962 Param2<bool, string> p = new Param2<bool, string>(false, "");
7963
7965 return;
7966
7967 bool play = p.param1;
7968 string soundSet = p.param2;
7969
7970 if (play)
7971 {
7973 {
7975 {
7977 }
7978 }
7979 else
7980 {
7982 }
7983 }
7984 else
7985 {
7987 }
7988
7989 break;
7990 #endif
7991
7992 }
7993
7995 {
7997 }
7998 }
7999
8000
8001
8002
8004 {
8005 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8006 return plugin.GetID(
name);
8007 }
8008
8010 {
8011 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8012 return plugin.GetName(id);
8013 }
8014
8017 {
8018
8019
8020 int varFlags;
8021 if (!ctx.
Read(varFlags))
8022 return;
8023
8024 if (varFlags & ItemVariableFlags.FLOAT)
8025 {
8027 }
8028 }
8029
8031 {
8032
8033 super.SerializeNumericalVars(floats_out);
8034
8035
8036
8038 {
8040 }
8041
8043 {
8045 }
8046
8048 {
8050 }
8051
8053 {
8058 }
8059
8061 {
8063 }
8064 }
8065
8067 {
8068
8069 super.DeSerializeNumericalVars(floats);
8070
8071
8072 int index = 0;
8073 int mask = Math.Round(floats.Get(index));
8074
8075 index++;
8076
8078 {
8080 {
8082 }
8083 else
8084 {
8085 float quantity = floats.Get(index);
8087 }
8088 index++;
8089 }
8090
8092 {
8093 float wet = floats.Get(index);
8095 index++;
8096 }
8097
8099 {
8100 int liquidtype = Math.Round(floats.Get(index));
8102 index++;
8103 }
8104
8106 {
8108 index++;
8110 index++;
8112 index++;
8114 index++;
8115 }
8116
8118 {
8119 int cleanness = Math.Round(floats.Get(index));
8121 index++;
8122 }
8123 }
8124
8126 {
8127 super.WriteVarsToCTX(ctx);
8128
8129
8131 {
8133 }
8134
8136 {
8138 }
8139
8141 {
8143 }
8144
8146 {
8147 int r,g,b,a;
8153 }
8154
8156 {
8158 }
8159 }
8160
8162 {
8163 if (!super.ReadVarsFromCTX(ctx,version))
8164 return false;
8165
8166 int intValue;
8167 float value;
8168
8169 if (version < 140)
8170 {
8171 if (!ctx.
Read(intValue))
8172 return false;
8173
8174 m_VariablesMask = intValue;
8175 }
8176
8178 {
8179 if (!ctx.
Read(value))
8180 return false;
8181
8183 {
8185 }
8186 else
8187 {
8189 }
8190 }
8191
8192 if (version < 140)
8193 {
8195 {
8196 if (!ctx.
Read(value))
8197 return false;
8198 SetTemperatureDirect(value);
8199 }
8200 }
8201
8203 {
8204 if (!ctx.
Read(value))
8205 return false;
8207 }
8208
8210 {
8211 if (!ctx.
Read(intValue))
8212 return false;
8214 }
8215
8217 {
8218 int r,g,b,a;
8220 return false;
8222 return false;
8224 return false;
8226 return false;
8227
8229 }
8230
8232 {
8233 if (!ctx.
Read(intValue))
8234 return false;
8236 }
8237
8238 if (version >= 138 && version < 140)
8239 {
8241 {
8242 if (!ctx.
Read(intValue))
8243 return false;
8244 SetFrozen(intValue);
8245 }
8246 }
8247
8248 return true;
8249 }
8250
8251
8253 {
8256 {
8258 }
8259
8260 if (!super.OnStoreLoad(ctx, version))
8261 {
8263 return false;
8264 }
8265
8266 if (version >= 114)
8267 {
8268 bool hasQuickBarIndexSaved;
8269
8270 if (!ctx.
Read(hasQuickBarIndexSaved))
8271 {
8273 return false;
8274 }
8275
8276 if (hasQuickBarIndexSaved)
8277 {
8278 int itmQBIndex;
8279
8280
8281 if (!ctx.
Read(itmQBIndex))
8282 {
8284 return false;
8285 }
8286
8287 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8288 if (itmQBIndex != -1 && parentPlayer)
8289 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8290 }
8291 }
8292 else
8293 {
8294
8295 PlayerBase player;
8296 int itemQBIndex;
8297 if (version ==
int.
MAX)
8298 {
8299 if (!ctx.
Read(itemQBIndex))
8300 {
8302 return false;
8303 }
8304 }
8305 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8306 {
8307
8308 if (!ctx.
Read(itemQBIndex))
8309 {
8311 return false;
8312 }
8313 if (itemQBIndex != -1 && player)
8314 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8315 }
8316 }
8317
8318 if (version < 140)
8319 {
8320
8321 if (!LoadVariables(ctx, version))
8322 {
8324 return false;
8325 }
8326 }
8327
8328
8330 {
8332 return false;
8333 }
8334 if (version >= 132)
8335 {
8337 if (raib)
8338 {
8340 {
8342 return false;
8343 }
8344 }
8345 }
8346
8348 return true;
8349 }
8350
8351
8352
8354 {
8355 super.OnStoreSave(ctx);
8356
8357 PlayerBase player;
8358 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8359 {
8361
8362 int itemQBIndex = -1;
8363 itemQBIndex = player.FindQuickBarEntityIndex(this);
8364 ctx.
Write(itemQBIndex);
8365 }
8366 else
8367 {
8369 }
8370
8372
8374 if (raib)
8375 {
8377 }
8378 }
8379
8380
8382 {
8383 super.AfterStoreLoad();
8384
8386 {
8388 }
8389
8391 {
8394 }
8395 }
8396
8398 {
8399 super.EEOnAfterLoad();
8400
8402 {
8404 }
8405
8408 }
8409
8411 {
8412 return false;
8413 }
8414
8415
8416
8418 {
8420 {
8421 #ifdef PLATFORM_CONSOLE
8422
8424 {
8426 if (menu)
8427 {
8429 }
8430 }
8431 #endif
8432 }
8433
8435 {
8438 }
8439
8441 {
8442 SetWeightDirty();
8444 }
8446 {
8449 }
8450
8452 {
8455 }
8457 {
8460 }
8461
8462 super.OnVariablesSynchronized();
8463 }
8464
8465
8466
8468 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8469 {
8470 if (!IsServerCheck(allow_client))
8471 return false;
8472
8474 return false;
8475
8478
8479 if (value <= (min + 0.001))
8480 value = min;
8481
8482 if (value == min)
8483 {
8484 if (destroy_config)
8485 {
8486 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8487 if (dstr)
8488 {
8490 this.Delete();
8491 return true;
8492 }
8493 }
8494 else if (destroy_forced)
8495 {
8497 this.Delete();
8498 return true;
8499 }
8500
8502 }
8503
8506
8508 {
8510
8511 if (delta)
8513 }
8514
8516
8517 return false;
8518 }
8519
8520
8522 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8523 {
8525 }
8526
8528 {
8531 }
8532
8534 {
8537 }
8538
8541 {
8542 float value_clamped = Math.Clamp(value, 0, 1);
8544 SetQuantity(result, destroy_config, destroy_forced);
8545 }
8546
8547
8550 {
8552 }
8553
8555 {
8557 }
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8569 {
8570 int slot = -1;
8571 if (GetInventory())
8572 {
8573 InventoryLocation il = new InventoryLocation;
8574 GetInventory().GetCurrentInventoryLocation(il);
8576 }
8577
8579 }
8580
8582 {
8583 float quantity_max = 0;
8584
8586 {
8587 if (attSlotID != -1)
8588 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8589
8590 if (quantity_max <= 0)
8592 }
8593
8594 if (quantity_max <= 0)
8596
8597 return quantity_max;
8598 }
8599
8601 {
8603 }
8604
8606 {
8608 }
8609
8610
8612 {
8614 }
8615
8617 {
8619 }
8620
8622 {
8624 }
8625
8626
8628 {
8629
8630 float weightEx = GetWeightEx();
8631 float special = GetInventoryAndCargoWeight();
8632 return weightEx - special;
8633 }
8634
8635
8637 {
8639 }
8640
8642 {
8644 {
8645 #ifdef DEVELOPER
8646 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8647 {
8648 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8650 }
8651 #endif
8652
8654 }
8655 else if (HasEnergyManager())
8656 {
8657 #ifdef DEVELOPER
8658 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8659 {
8660 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8661 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8662 }
8663 #endif
8664 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8665 }
8666 else
8667 {
8668 #ifdef DEVELOPER
8669 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8670 {
8671 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8672 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8673 }
8674 #endif
8675 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8676 }
8677 }
8678
8681 {
8682 int item_count = 0;
8684
8685 if (GetInventory().GetCargo() != NULL)
8686 {
8687 item_count = GetInventory().GetCargo().GetItemCount();
8688 }
8689
8690 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8691 {
8692 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8693 if (item)
8694 item_count += item.GetNumberOfItems();
8695 }
8696 return item_count;
8697 }
8698
8701 {
8702 float weight = 0;
8703 float wetness = 1;
8704 if (include_wetness)
8707 {
8708 weight = wetness * m_ConfigWeight;
8709 }
8711 {
8712 weight = 1;
8713 }
8714 return weight;
8715 }
8716
8717
8718
8720 {
8721 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8722 {
8723 GameInventory inv = GetInventory();
8724 array<EntityAI> items = new array<EntityAI>;
8726 for (int i = 0; i < items.Count(); i++)
8727 {
8729 if (item)
8730 {
8732 }
8733 }
8734 }
8735 }
8736
8737
8738
8739
8741 {
8742 float energy = 0;
8743 if (HasEnergyManager())
8744 {
8745 energy = GetCompEM().GetEnergy();
8746 }
8747 return energy;
8748 }
8749
8750
8752 {
8753 super.OnEnergyConsumed();
8754
8756 }
8757
8759 {
8760 super.OnEnergyAdded();
8761
8763 }
8764
8765
8767 {
8768 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8769 {
8771 {
8772 float energy_0to1 = GetCompEM().GetEnergy0To1();
8774 }
8775 }
8776 }
8777
8778
8780 {
8781 return ConfigGetFloat("heatIsolation");
8782 }
8783
8785 {
8787 }
8788
8790 {
8791 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8792 if (
GetGame().ConfigIsExisting(paramPath))
8794
8795 return 0.0;
8796 }
8797
8799 {
8800 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8801 if (
GetGame().ConfigIsExisting(paramPath))
8803
8804 return 0.0;
8805 }
8806
8807 override void SetWet(
float value,
bool allow_client =
false)
8808 {
8809 if (!IsServerCheck(allow_client))
8810 return;
8811
8814
8816
8817 m_VarWet = Math.Clamp(value, min, max);
8818
8820 {
8823 }
8824 }
8825
8826 override void AddWet(
float value)
8827 {
8829 }
8830
8832 {
8834 }
8835
8837 {
8839 }
8840
8842 {
8844 }
8845
8847 {
8849 }
8850
8852 {
8854 }
8855
8857 {
8860 if (newLevel != oldLevel)
8861 {
8863 }
8864 }
8865
8867 {
8868 SetWeightDirty();
8869 }
8870
8872 {
8873 return GetWetLevelInternal(
m_VarWet);
8874 }
8875
8876
8877
8879 {
8881 }
8882
8884 {
8886 }
8887
8889 {
8891 }
8892
8894 {
8896 }
8897
8898
8899
8901 {
8902 if (ConfigIsExisting("itemModelLength"))
8903 {
8904 return ConfigGetFloat("itemModelLength");
8905 }
8906 return 0;
8907 }
8908
8910 {
8911 if (ConfigIsExisting("itemAttachOffset"))
8912 {
8913 return ConfigGetFloat("itemAttachOffset");
8914 }
8915 return 0;
8916 }
8917
8918 override void SetCleanness(
int value,
bool allow_client =
false)
8919 {
8920 if (!IsServerCheck(allow_client))
8921 return;
8922
8924
8926
8929 }
8930
8932 {
8934 }
8935
8937 {
8938 return true;
8939 }
8940
8941
8942
8943
8945 {
8947 }
8948
8950 {
8952 }
8953
8954
8955
8956
8957 override void SetColor(
int r,
int g,
int b,
int a)
8958 {
8964 }
8966 override void GetColor(out
int r,out
int g,out
int b,out
int a)
8967 {
8972 }
8973
8975 {
8977 }
8978
8981 {
8982 int r,g,b,a;
8984 r = r/255;
8985 g = g/255;
8986 b = b/255;
8987 a = a/255;
8988 return MiscGameplayFunctions.GetColorString(r, g, b, a);
8989 }
8990
8991
8992
8993 override void SetLiquidType(
int value,
bool allow_client =
false)
8994 {
8995 if (!IsServerCheck(allow_client))
8996 return;
8997
9002 }
9003
9005 {
9006 return ConfigGetInt("varLiquidTypeInit");
9007 }
9008
9010 {
9012 }
9013
9015 {
9017 SetFrozen(false);
9018 }
9019
9022 {
9023 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9024 }
9025
9026
9029 {
9030 PlayerBase nplayer;
9031 if (PlayerBase.CastTo(nplayer, player))
9032 {
9034
9035 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9036 }
9037 }
9038
9039
9042 {
9043 PlayerBase nplayer;
9044 if (PlayerBase.CastTo(nplayer,player))
9045 {
9046
9047 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9048
9049 }
9050
9051
9052 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9053
9054
9055 if (HasEnergyManager())
9056 {
9057 GetCompEM().UpdatePlugState();
9058 }
9059 }
9060
9061
9063 {
9064 super.OnPlacementStarted(player);
9065
9067 }
9068
9069 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9070 {
9072 {
9073 m_AdminLog.OnPlacementComplete(player,
this);
9074 }
9075
9076 super.OnPlacementComplete(player, position, orientation);
9077 }
9078
9079
9080
9081
9082
9084 {
9086 {
9087 return true;
9088 }
9089 else
9090 {
9091 return false;
9092 }
9093 }
9094
9095
9097 {
9099 {
9101 }
9102 }
9103
9104
9106 {
9108 }
9109
9111 {
9113 }
9114
9115 override void InsertAgent(
int agent,
float count = 1)
9116 {
9117 if (count < 1)
9118 return;
9119
9121 }
9122
9125 {
9127 }
9128
9129
9131 {
9133 }
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9177 {
9179 return false;
9180 return true;
9181 }
9182
9184 {
9185
9187 }
9188
9189
9192 {
9193 super.CheckForRoofLimited(timeTresholdMS);
9194
9196 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9197 {
9198 m_PreviousRoofTestTime = time;
9199 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9200 }
9201 }
9202
9203
9205 {
9207 {
9208 return 0;
9209 }
9210
9211 if (GetInventory().GetAttachmentSlotsCount() != 0)
9212 {
9213 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9214 if (filter)
9215 return filter.GetProtectionLevel(type, false, system);
9216 else
9217 return 0;
9218 }
9219
9220 string subclassPath, entryName;
9221
9222 switch (type)
9223 {
9225 entryName = "biological";
9226 break;
9228 entryName = "chemical";
9229 break;
9230 default:
9231 entryName = "biological";
9232 break;
9233 }
9234
9235 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9236
9238 }
9239
9240
9241
9244 {
9245 if (!IsMagazine())
9247
9249 }
9250
9251
9252
9253
9254
9259 {
9260 return true;
9261 }
9262
9264 {
9266 }
9267
9268
9269
9270
9271
9273 {
9274 if (parent)
9275 {
9276 if (parent.IsInherited(DayZInfected))
9277 return true;
9278
9279 if (!parent.IsRuined())
9280 return true;
9281 }
9282
9283 return true;
9284 }
9285
9287 {
9288 if (!super.CanPutAsAttachment(parent))
9289 {
9290 return false;
9291 }
9292
9293 if (!IsRuined() && !parent.IsRuined())
9294 {
9295 return true;
9296 }
9297
9298 return false;
9299 }
9300
9302 {
9303
9304
9305
9306
9307 return super.CanReceiveItemIntoCargo(item);
9308 }
9309
9311 {
9312
9313
9314
9315
9316 GameInventory attachmentInv = attachment.GetInventory();
9318 {
9319 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9320 return false;
9321 }
9322
9323 InventoryLocation loc = new InventoryLocation();
9324 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9325 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9326 return false;
9327
9328 return super.CanReceiveAttachment(attachment, slotId);
9329 }
9330
9332 {
9333 if (!super.CanReleaseAttachment(attachment))
9334 return false;
9335
9336 return GetInventory().AreChildrenAccessible();
9337 }
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9360 {
9361 int id = muzzle_owner.GetMuzzleID();
9362 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9363
9364 if (WPOF_array)
9365 {
9366 for (int i = 0; i < WPOF_array.Count(); i++)
9367 {
9368 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9369
9370 if (WPOF)
9371 {
9372 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9373 }
9374 }
9375 }
9376 }
9377
9378
9380 {
9381 int id = muzzle_owner.GetMuzzleID();
9383
9384 if (WPOBE_array)
9385 {
9386 for (int i = 0; i < WPOBE_array.Count(); i++)
9387 {
9388 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9389
9390 if (WPOBE)
9391 {
9392 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9393 }
9394 }
9395 }
9396 }
9397
9398
9400 {
9401 int id = muzzle_owner.GetMuzzleID();
9402 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9403
9404 if (WPOOH_array)
9405 {
9406 for (int i = 0; i < WPOOH_array.Count(); i++)
9407 {
9408 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9409
9410 if (WPOOH)
9411 {
9412 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9413 }
9414 }
9415 }
9416 }
9417
9418
9420 {
9421 int id = muzzle_owner.GetMuzzleID();
9422 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9423
9424 if (WPOOH_array)
9425 {
9426 for (int i = 0; i < WPOOH_array.Count(); i++)
9427 {
9428 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9429
9430 if (WPOOH)
9431 {
9432 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9433 }
9434 }
9435 }
9436 }
9437
9438
9440 {
9441 int id = muzzle_owner.GetMuzzleID();
9442 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9443
9444 if (WPOOH_array)
9445 {
9446 for (int i = 0; i < WPOOH_array.Count(); i++)
9447 {
9448 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9449
9450 if (WPOOH)
9451 {
9452 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9453 }
9454 }
9455 }
9456 }
9457
9458
9459
9461 {
9463 {
9464 return true;
9465 }
9466
9467 return false;
9468 }
9469
9471 {
9473 {
9474 return true;
9475 }
9476
9477 return false;
9478 }
9479
9481 {
9483 {
9484 return true;
9485 }
9486
9487 return false;
9488 }
9489
9491 {
9492 return false;
9493 }
9494
9497 {
9498 return UATimeSpent.DEFAULT_DEPLOY;
9499 }
9500
9501
9502
9503
9505 {
9507 SetSynchDirty();
9508 }
9509
9511 {
9513 }
9514
9515
9517 {
9518 return false;
9519 }
9520
9523 {
9524 string att_type = "None";
9525
9526 if (ConfigIsExisting("soundAttType"))
9527 {
9528 att_type = ConfigGetString("soundAttType");
9529 }
9530
9532 }
9533
9535 {
9537 }
9538
9539
9540
9541
9542
9546
9548 {
9551
9553 }
9554
9555
9557 {
9559 return;
9560
9562
9565
9568
9569 SoundParameters params = new SoundParameters();
9573 }
9574
9575
9577 {
9579 return;
9580
9582 SetSynchDirty();
9583
9586 }
9587
9588
9590 {
9592 return;
9593
9595 SetSynchDirty();
9596
9599 }
9600
9602 {
9604 }
9605
9607 {
9609 }
9610
9613 {
9614 if (!
GetGame().IsDedicatedServer())
9615 {
9616 if (ConfigIsExisting("attachSoundSet"))
9617 {
9618 string cfg_path = "";
9619 string soundset = "";
9621
9624 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9625 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9626
9627 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9628 {
9629 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9630 {
9631 if (cfg_slot_array[i] == slot_type)
9632 {
9633 soundset = cfg_soundset_array[i];
9634 break;
9635 }
9636 }
9637 }
9638
9639 if (soundset != "")
9640 {
9641 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9643 }
9644 }
9645 }
9646 }
9647
9649 {
9650
9651 }
9652
9653 void OnApply(PlayerBase player);
9654
9656 {
9657 return 1.0;
9658 };
9659
9661 {
9663 }
9664
9666 {
9668 }
9669
9671
9673 {
9674 SetDynamicPhysicsLifeTime(0.01);
9676 }
9677
9679 {
9680 array<string> zone_names = new array<string>;
9681 GetDamageZones(zone_names);
9682 for (int i = 0; i < zone_names.Count(); i++)
9683 {
9684 SetHealthMax(zone_names.Get(i),"Health");
9685 }
9686 SetHealthMax("","Health");
9687 }
9688
9691 {
9692 float global_health = GetHealth01("","Health");
9693 array<string> zones = new array<string>;
9694 GetDamageZones(zones);
9695
9696 for (int i = 0; i < zones.Count(); i++)
9697 {
9698 SetHealth01(zones.Get(i),"Health",global_health);
9699 }
9700 }
9701
9704 {
9705 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9706 }
9707
9709 {
9710 if (!hasRootAsPlayer)
9711 {
9712 if (refParentIB)
9713 {
9714
9715 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9716 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9717
9718 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9719 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9720
9723 }
9724 else
9725 {
9726
9729 }
9730 }
9731 }
9732
9734 {
9736 {
9737 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9738 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9739 {
9740 float heatPermCoef = 1.0;
9742 while (ent)
9743 {
9744 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9745 ent = ent.GetHierarchyParent();
9746 }
9747
9748 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9749 }
9750 }
9751 }
9752
9754 {
9755
9756 EntityAI parent = GetHierarchyParent();
9757 if (!parent)
9758 {
9759 hasParent = false;
9760 hasRootAsPlayer = false;
9761 }
9762 else
9763 {
9764 hasParent = true;
9765 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9766 refParentIB =
ItemBase.Cast(parent);
9767 }
9768 }
9769
9770 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9771 {
9772
9773 }
9774
9776 {
9777
9778 return false;
9779 }
9780
9782 {
9783
9784
9785 return false;
9786 }
9787
9789 {
9790
9791 return false;
9792 }
9793
9796 {
9797 return !GetIsFrozen() &&
IsOpen();
9798 }
9799
9801 {
9802 bool hasParent = false, hasRootAsPlayer = false;
9804
9805 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9806 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9807
9808 if (wwtu || foodDecay)
9809 {
9813
9814 if (processWetness || processTemperature || processDecay)
9815 {
9817
9818 if (processWetness)
9819 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9820
9821 if (processTemperature)
9823
9824 if (processDecay)
9825 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9826 }
9827 }
9828 }
9829
9832 {
9834 }
9835
9837 {
9840
9841 return super.GetTemperatureFreezeThreshold();
9842 }
9843
9845 {
9848
9849 return super.GetTemperatureThawThreshold();
9850 }
9851
9853 {
9856
9857 return super.GetItemOverheatThreshold();
9858 }
9859
9861 {
9863 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9864
9865 return super.GetTemperatureFreezeTime();
9866 }
9867
9869 {
9871 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9872
9873 return super.GetTemperatureThawTime();
9874 }
9875
9880
9882 {
9883 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
9884 }
9885
9887 {
9888 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
9889 }
9890
9893 {
9895 }
9896
9898 {
9900 }
9901
9903 {
9905 }
9906
9909 {
9910 return null;
9911 }
9912
9915 {
9916 return false;
9917 }
9918
9920 {
9922 {
9925 if (!trg)
9926 {
9928 explosive = this;
9929 }
9930
9931 explosive.PairRemote(trg);
9933
9934 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
9935 trg.SetPersistentPairID(persistentID);
9936 explosive.SetPersistentPairID(persistentID);
9937
9938 return true;
9939 }
9940 return false;
9941 }
9942
9945 {
9946 float ret = 1.0;
9949 ret *= GetHealth01();
9950
9951 return ret;
9952 }
9953
9954 #ifdef DEVELOPER
9955 override void SetDebugItem()
9956 {
9957 super.SetDebugItem();
9958 _itemBase = this;
9959 }
9960
9962 {
9963 string text = super.GetDebugText();
9964
9966 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
9967
9968 return text;
9969 }
9970 #endif
9971
9973 {
9974 return true;
9975 }
9976
9978
9980
9982 {
9985 }
9986
9987
9995
10011}
10012
10014{
10016 if (entity)
10017 {
10018 bool is_item = entity.IsInherited(
ItemBase);
10019 if (is_item && full_quantity)
10020 {
10023 }
10024 }
10025 else
10026 {
10028 return NULL;
10029 }
10030 return entity;
10031}
10032
10034{
10035 if (item)
10036 {
10037 if (health > 0)
10038 item.SetHealth("", "", health);
10039
10040 if (item.CanHaveTemperature())
10041 {
10043 if (item.CanFreeze())
10044 item.SetFrozen(false);
10045 }
10046
10047 if (item.HasEnergyManager())
10048 {
10049 if (quantity >= 0)
10050 {
10051 item.GetCompEM().SetEnergy0To1(quantity);
10052 }
10053 else
10054 {
10056 }
10057 }
10058 else if (item.IsMagazine())
10059 {
10060 Magazine mag = Magazine.Cast(item);
10061 if (quantity >= 0)
10062 {
10063 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10064 }
10065 else
10066 {
10068 }
10069
10070 }
10071 else
10072 {
10073 if (quantity >= 0)
10074 {
10075 item.SetQuantityNormalized(quantity, false);
10076 }
10077 else
10078 {
10080 }
10081
10082 }
10083 }
10084}
10085
10086#ifdef DEVELOPER
10088#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.