5068{
5070 {
5071 return true;
5072 }
5073};
5074
5075
5076
5078{
5082
5084
5087
5088
5089
5090
5091
5100
5106
5111
5116
5137 protected bool m_IsResultOfSplit
5138
5140
5145
5146
5147
5149
5153
5154
5155
5157
5160
5161
5162
5168
5169
5177
5180
5181
5183
5184
5186
5187
5192
5193
5198
5199
5201
5202
5204 {
5209
5210 if (!
GetGame().IsDedicatedServer())
5211 {
5213 {
5215
5217 {
5219 }
5220 }
5221
5224 }
5225
5226 m_OldLocation = null;
5227
5229 {
5231 }
5232
5233 if (ConfigIsExisting("headSelectionsToHide"))
5234 {
5237 }
5238
5240 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5241 {
5243 }
5244
5246
5247 m_IsResultOfSplit = false;
5248
5250 }
5251
5253 {
5254 super.InitItemVariables();
5255
5261 m_Count = ConfigGetInt(
"count");
5262
5265
5270
5273
5278
5290
5294
5295
5298 if (ConfigIsExisting("canBeSplit"))
5299 {
5302 }
5303
5305 if (ConfigIsExisting("itemBehaviour"))
5307
5308
5311 RegisterNetSyncVariableInt("m_VarLiquidType");
5312 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5313
5314 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5315 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5316 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5317
5318 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5319 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5320 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5321 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5322
5323 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5324 RegisterNetSyncVariableBool("m_IsTakeable");
5325 RegisterNetSyncVariableBool("m_IsHologram");
5326
5329 {
5332 }
5333
5335
5337 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5339
5340 }
5341
5343 {
5345 }
5346
5348 {
5351 {
5356 }
5357 }
5358
5359 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5360 {
5362 {
5365 }
5366
5368 }
5369
5371 {
5377 }
5378
5380
5382 {
5384
5385 if (!action)
5386 {
5387 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5388 return;
5389 }
5390
5392 if (!ai)
5393 {
5395 return;
5396 }
5397
5399 if (!action_array)
5400 {
5401 action_array = new array<ActionBase_Basic>;
5403 }
5404 if (LogManager.IsActionLogEnable())
5405 {
5406 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5407 }
5408
5409 if (action_array.Find(action) != -1)
5410 {
5411 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5412 }
5413 else
5414 {
5415 action_array.Insert(action);
5416 }
5417 }
5418
5420 {
5422 ActionBase action = player.GetActionManager().GetAction(actionName);
5425
5426 if (action_array)
5427 {
5428 action_array.RemoveItem(action);
5429 }
5430 }
5431
5432
5433
5435 {
5436 ActionOverrideData overrideData = new ActionOverrideData();
5440
5442 if (!actionMap)
5443 {
5446 }
5447
5448 actionMap.Insert(this.
Type(), overrideData);
5449
5450 }
5451
5453
5455
5456
5458 {
5461
5464
5465 string config_to_search = "CfgVehicles";
5466 string muzzle_owner_config;
5467
5469 {
5470 if (IsInherited(Weapon))
5471 config_to_search = "CfgWeapons";
5472
5473 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5474
5475 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5476
5478
5479 if (config_OnFire_subclass_count > 0)
5480 {
5481 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5482
5483 for (int i = 0; i < config_OnFire_subclass_count; i++)
5484 {
5485 string particle_class = "";
5487 string config_OnFire_entry = config_OnFire_class + particle_class;
5488 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5489 WPOF_array.Insert(WPOF);
5490 }
5491
5492
5494 }
5495 }
5496
5498 {
5499 config_to_search = "CfgWeapons";
5500 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5501
5502 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5503
5505
5506 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5507 {
5508 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5509
5510 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5511 {
5512 string particle_class2 = "";
5514 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5515 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5516 WPOBE_array.Insert(WPOBE);
5517 }
5518
5519
5521 }
5522 }
5523 }
5524
5525
5527 {
5530
5532 {
5533 string config_to_search = "CfgVehicles";
5534
5535 if (IsInherited(Weapon))
5536 config_to_search = "CfgWeapons";
5537
5538 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5539 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5540
5541 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5542 {
5543
5545
5547 {
5549 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5551 return;
5552 }
5553
5556
5557
5558
5560 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5561
5562 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5563 {
5564 string particle_class = "";
5566 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5568
5569 if (entry_type == CT_CLASS)
5570 {
5571 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5572 WPOOH_array.Insert(WPOF);
5573 }
5574 }
5575
5576
5578 }
5579 }
5580 }
5581
5583 {
5585 }
5586
5588 {
5590 {
5592
5595
5598
5599 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5600 }
5601 }
5602
5604 {
5606 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5607
5609 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5610
5612 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5613
5615 {
5617 }
5618 }
5619
5621 {
5623 }
5624
5626 {
5629 else
5631
5633 {
5636 }
5637 else
5638 {
5641
5644 }
5645
5647 }
5648
5650 {
5652 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5653 }
5654
5656 {
5658 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5660 }
5661
5663 {
5665 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5666 }
5667
5669 {
5672
5673 OverheatingParticle OP = new OverheatingParticle();
5678
5680 }
5681
5683 {
5686
5687 return -1;
5688 }
5689
5691 {
5693 {
5696
5697 for (int i = count; i > 0; --i)
5698 {
5699 int id = i - 1;
5702
5705
5706 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5707 {
5708 if (p)
5709 {
5712 }
5713 }
5714 }
5715 }
5716 }
5717
5719 {
5721 {
5723 {
5724 int id = i - 1;
5726
5727 if (OP)
5728 {
5730
5731 if (p)
5732 {
5734 }
5735
5736 delete OP;
5737 }
5738 }
5739
5742 }
5743 }
5744
5747 {
5748 return 0.0;
5749 }
5750
5751
5753 {
5754 return 250;
5755 }
5756
5758 {
5759 return 0;
5760 }
5761
5764 {
5766 return true;
5767
5768 return false;
5769 }
5770
5773 {
5776
5778 {
5780 }
5781 else
5782 {
5783
5785 }
5786
5788 }
5789
5796 {
5797 return -1;
5798 }
5799
5800
5801
5802
5804 {
5806 {
5808 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
5809
5810 if (r_index >= 0)
5811 {
5812 InventoryLocation r_il = new InventoryLocation;
5813 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
5814
5815 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
5818 {
5819 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
5820 }
5822 {
5823 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
5824 }
5825
5826 }
5827
5828 player.GetHumanInventory().ClearUserReservedLocation(this);
5829 }
5830
5833 }
5834
5835
5836
5837
5839 {
5840 return ItemBase.m_DebugActionsMask;
5841 }
5842
5844 {
5845 return ItemBase.m_DebugActionsMask & mask;
5846 }
5847
5849 {
5850 ItemBase.m_DebugActionsMask = mask;
5851 }
5852
5854 {
5855 ItemBase.m_DebugActionsMask |= mask;
5856 }
5857
5859 {
5860 ItemBase.m_DebugActionsMask &= ~mask;
5861 }
5862
5864 {
5866 {
5868 }
5869 else
5870 {
5872 }
5873 }
5874
5875
5877 {
5878 if (GetEconomyProfile())
5879 {
5880 float q_max = GetEconomyProfile().GetQuantityMax();
5881 if (q_max > 0)
5882 {
5883 float q_min = GetEconomyProfile().GetQuantityMin();
5884 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
5885
5887 {
5888 ComponentEnergyManager comp = GetCompEM();
5890 {
5892 }
5893 }
5895 {
5897
5898 }
5899
5900 }
5901 }
5902 }
5903
5906 {
5907 EntityAI parent = GetHierarchyParent();
5908
5909 if (parent)
5910 {
5911 InventoryLocation inventory_location_to_lock = new InventoryLocation;
5912 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
5913 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
5914 }
5915 }
5916
5919 {
5920 EntityAI parent = GetHierarchyParent();
5921
5922 if (parent)
5923 {
5924 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
5925 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
5926 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
5927 }
5928 }
5929
5931 {
5932
5933
5934
5935
5937
5939 {
5940 if (ScriptInputUserData.CanStoreInputUserData())
5941 {
5942 ScriptInputUserData ctx = new ScriptInputUserData;
5948 ctx.
Write(use_stack_max);
5951
5953 {
5954 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
5955 }
5956 }
5957 }
5958 else if (!
GetGame().IsMultiplayer())
5959 {
5961 }
5962 }
5963
5965 {
5967 }
5968
5970 {
5972 }
5973
5975 {
5977 }
5978
5980 {
5981
5982 return false;
5983 }
5984
5986 {
5987 return false;
5988 }
5989
5993 {
5994 return false;
5995 }
5996
5998 {
5999 return "";
6000 }
6001
6003
6005 {
6006 return false;
6007 }
6008
6010 {
6011 return true;
6012 }
6013
6014
6015
6017 {
6018 return true;
6019 }
6020
6022 {
6023 return true;
6024 }
6025
6027 {
6028 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6030 }
6031
6033 {
6035 }
6036
6038 {
6040 if (!is_being_placed)
6042 SetSynchDirty();
6043 }
6044
6045
6047
6049 {
6051 }
6052
6054 {
6056 }
6057
6059 {
6060 return 1;
6061 }
6062
6064 {
6065 return false;
6066 }
6067
6069 {
6071 SetSynchDirty();
6072 }
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6109 {
6110 super.OnMovedInsideCargo(container);
6111
6112 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6113 }
6114
6115 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6116 {
6117 super.EEItemLocationChanged(oldLoc,newLoc);
6118
6119 PlayerBase new_player = null;
6120 PlayerBase old_player = null;
6121
6122 if (newLoc.GetParent())
6123 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6124
6125 if (oldLoc.GetParent())
6126 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6127
6129 {
6130 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6131
6132 if (r_index >= 0)
6133 {
6134 InventoryLocation r_il = new InventoryLocation;
6135 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6136
6137 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6140 {
6141 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6142 }
6144 {
6145 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6146 }
6147
6148 }
6149 }
6150
6152 {
6153 if (new_player)
6154 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6155
6156 if (new_player == old_player)
6157 {
6158
6159 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6160 {
6162 {
6163 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6164 {
6165 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6166 }
6167 }
6168 else
6169 {
6170 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6171 }
6172 }
6173
6174 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6175 {
6176 int type = oldLoc.GetType();
6178 {
6179 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6180 }
6182 {
6183 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6184 }
6185 }
6186 if (!m_OldLocation)
6187 {
6188 m_OldLocation = new InventoryLocation;
6189 }
6190 m_OldLocation.Copy(oldLoc);
6191 }
6192 else
6193 {
6194 if (m_OldLocation)
6195 {
6196 m_OldLocation.Reset();
6197 }
6198 }
6199
6201 }
6202 else
6203 {
6204 if (new_player)
6205 {
6206 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6207 if (res_index >= 0)
6208 {
6209 InventoryLocation il = new InventoryLocation;
6210 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6212 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6215 {
6216 il.
GetParent().GetOnReleaseLock().Invoke(it);
6217 }
6219 {
6221 }
6222
6223 }
6224 }
6226 {
6227
6229 }
6230
6231 if (m_OldLocation)
6232 {
6233 m_OldLocation.Reset();
6234 }
6235 }
6236 }
6237
6238 override void EOnContact(IEntity other, Contact extra)
6239 {
6241 {
6242 int liquidType = -1;
6244 if (impactSpeed > 0.0)
6245 {
6247 #ifndef SERVER
6249 #else
6251 SetSynchDirty();
6252 #endif
6254 }
6255 }
6256
6257 #ifdef SERVER
6258 if (GetCompEM() && GetCompEM().IsPlugged())
6259 {
6260 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6261 GetCompEM().UnplugThis();
6262 }
6263 #endif
6264 }
6265
6267
6269 {
6271 }
6272
6274 {
6275
6276 }
6277
6279 {
6280 super.OnItemLocationChanged(old_owner, new_owner);
6281
6282 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6283 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6284
6285 if (!relatedPlayer && playerNew)
6286 relatedPlayer = playerNew;
6287
6288 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6289 {
6291 if (actionMgr)
6292 {
6293 ActionBase currentAction = actionMgr.GetRunningAction();
6294 if (currentAction)
6296 }
6297 }
6298
6299 Man ownerPlayerOld = null;
6300 Man ownerPlayerNew = null;
6301
6302 if (old_owner)
6303 {
6304 if (old_owner.
IsMan())
6305 {
6306 ownerPlayerOld = Man.Cast(old_owner);
6307 }
6308 else
6309 {
6310 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6311 }
6312 }
6313 else
6314 {
6316 {
6318
6319 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6320 {
6321 GetCompEM().UnplugThis();
6322 }
6323 }
6324 }
6325
6326 if (new_owner)
6327 {
6328 if (new_owner.
IsMan())
6329 {
6330 ownerPlayerNew = Man.Cast(new_owner);
6331 }
6332 else
6333 {
6334 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6335 }
6336 }
6337
6338 if (ownerPlayerOld != ownerPlayerNew)
6339 {
6340 if (ownerPlayerOld)
6341 {
6342 array<EntityAI> subItemsExit = new array<EntityAI>;
6344 for (int i = 0; i < subItemsExit.Count(); i++)
6345 {
6348 }
6349 }
6350
6351 if (ownerPlayerNew)
6352 {
6353 array<EntityAI> subItemsEnter = new array<EntityAI>;
6355 for (int j = 0; j < subItemsEnter.Count(); j++)
6356 {
6359 }
6360 }
6361 }
6362 else if (ownerPlayerNew != null)
6363 {
6364 PlayerBase nplayer;
6365 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6366 {
6367 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6369 for (int k = 0; k < subItemsUpdate.Count(); k++)
6370 {
6372 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6373 }
6374 }
6375 }
6376
6377 if (old_owner)
6378 old_owner.OnChildItemRemoved(this);
6379 if (new_owner)
6380 new_owner.OnChildItemReceived(this);
6381 }
6382
6383
6385 {
6386 super.EEDelete(parent);
6387 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6388 if (player)
6389 {
6391
6392 if (player.IsAlive())
6393 {
6394 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6395 if (r_index >= 0)
6396 {
6397 InventoryLocation r_il = new InventoryLocation;
6398 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6399
6400 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6403 {
6404 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6405 }
6407 {
6408 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6409 }
6410
6411 }
6412
6413 player.RemoveQuickBarEntityShortcut(this);
6414 }
6415 }
6416 }
6417
6419 {
6420 super.EEKilled(killer);
6421
6424 {
6425 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6426 {
6427 if (IsMagazine())
6428 {
6429 if (Magazine.Cast(this).GetAmmoCount() > 0)
6430 {
6432 }
6433 }
6434 else
6435 {
6437 }
6438 }
6439 }
6440 }
6441
6443 {
6444 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6445
6446 super.OnWasAttached(parent, slot_id);
6447
6450
6452 }
6453
6455 {
6456 super.OnWasDetached(parent, slot_id);
6457
6460 }
6461
6463 {
6464 int idx;
6467
6468 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6469 if (inventory_slots.Count() < 1)
6470 {
6471 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6472 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6473 }
6474 else
6475 {
6476 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6477 }
6478
6479 idx = inventory_slots.Find(slot);
6480 if (idx < 0)
6481 return "";
6482
6483 return attach_types.Get(idx);
6484 }
6485
6487 {
6488 int idx = -1;
6489 string slot;
6490
6493
6494 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6495 if (inventory_slots.Count() < 1)
6496 {
6497 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6498 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6499 }
6500 else
6501 {
6502 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6503 if (detach_types.Count() < 1)
6504 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6505 }
6506
6507 for (int i = 0; i < inventory_slots.Count(); i++)
6508 {
6509 slot = inventory_slots.Get(i);
6510 }
6511
6512 if (slot != "")
6513 {
6514 if (detach_types.Count() == 1)
6515 idx = 0;
6516 else
6517 idx = inventory_slots.Find(slot);
6518 }
6519 if (idx < 0)
6520 return "";
6521
6522 return detach_types.Get(idx);
6523 }
6524
6526 {
6527
6529
6530
6531 float min_time = 1;
6532 float max_time = 3;
6533 float delay = Math.RandomFloat(min_time, max_time);
6534
6535 explode_timer.Run(delay, this, "DoAmmoExplosion");
6536 }
6537
6539 {
6540 Magazine magazine = Magazine.Cast(this);
6541 int pop_sounds_count = 6;
6542 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6543
6544
6545 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6546 string sound_name = pop_sounds[ sound_idx ];
6548
6549
6550 magazine.ServerAddAmmoCount(-1);
6551
6552
6553 float min_temp_to_explode = 100;
6554
6555 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6556 {
6558 }
6559 }
6560
6561
6562 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6563 {
6564 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6565
6566 const int CHANCE_DAMAGE_CARGO = 4;
6567 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6568 const int CHANCE_DAMAGE_NOTHING = 2;
6569
6571 {
6572 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6573 int chances;
6574 int rnd;
6575
6576 if (GetInventory().GetCargo())
6577 {
6578 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6579 rnd = Math.RandomInt(0,chances);
6580
6581 if (rnd < CHANCE_DAMAGE_CARGO)
6582 {
6584 }
6585 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6586 {
6588 }
6589 }
6590 else
6591 {
6592 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6593 rnd = Math.RandomInt(0,chances);
6594
6595 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6596 {
6598 }
6599 }
6600 }
6601 }
6602
6604 {
6605 if (GetInventory().GetCargo())
6606 {
6607 int item_count = GetInventory().GetCargo().GetItemCount();
6608 if (item_count > 0)
6609 {
6610 int random_pick = Math.RandomInt(0, item_count);
6612 if (!item.IsExplosive())
6613 {
6614 item.AddHealth("","",damage);
6615 return true;
6616 }
6617 }
6618 }
6619 return false;
6620 }
6621
6623 {
6624 int attachment_count = GetInventory().AttachmentCount();
6625 if (attachment_count > 0)
6626 {
6627 int random_pick = Math.RandomInt(0, attachment_count);
6628 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6629 if (!attachment.IsExplosive())
6630 {
6631 attachment.AddHealth("","",damage);
6632 return true;
6633 }
6634 }
6635 return false;
6636 }
6637
6639 {
6641 }
6642
6644 {
6646 return GetInventory().CanRemoveEntity();
6647
6648 return false;
6649 }
6650
6652 {
6654 return;
6655
6657 {
6658 if (ScriptInputUserData.CanStoreInputUserData())
6659 {
6660 ScriptInputUserData ctx = new ScriptInputUserData;
6665 ctx.
Write(destination_entity);
6669 }
6670 }
6671 else if (!
GetGame().IsMultiplayer())
6672 {
6674 }
6675 }
6676
6678 {
6680 return;
6681
6682 float split_quantity_new;
6686 InventoryLocation loc = new InventoryLocation;
6687
6688 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6689 {
6691 split_quantity_new = stack_max;
6692 else
6694
6695 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6696 if (new_item)
6697 {
6698 new_item.SetResultOfSplit(true);
6699 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6701 new_item.SetQuantity(split_quantity_new);
6702 }
6703 }
6704 else if (destination_entity && slot_id == -1)
6705 {
6706 if (quantity > stack_max)
6707 split_quantity_new = stack_max;
6708 else
6709 split_quantity_new = quantity;
6710
6712 {
6715 }
6716
6717 if (new_item)
6718 {
6719 new_item.SetResultOfSplit(true);
6720 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6722 new_item.SetQuantity(split_quantity_new);
6723 }
6724 }
6725 else
6726 {
6727 if (stack_max != 0)
6728 {
6730 {
6732 }
6733
6734 if (split_quantity_new == 0)
6735 {
6736 if (!
GetGame().IsMultiplayer())
6737 player.PhysicalPredictiveDropItem(this);
6738 else
6739 player.ServerDropEntity(this);
6740 return;
6741 }
6742
6744
6745 if (new_item)
6746 {
6747 new_item.SetResultOfSplit(true);
6748 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6750 new_item.SetQuantity(stack_max);
6751 new_item.PlaceOnSurface();
6752 }
6753 }
6754 }
6755 }
6756
6758 {
6760 return;
6761
6762 float split_quantity_new;
6766 InventoryLocation loc = new InventoryLocation;
6767
6768 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6769 {
6771 split_quantity_new = stack_max;
6772 else
6774
6775 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6776 if (new_item)
6777 {
6778 new_item.SetResultOfSplit(true);
6779 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6781 new_item.SetQuantity(split_quantity_new);
6782 }
6783 }
6784 else if (destination_entity && slot_id == -1)
6785 {
6786 if (quantity > stack_max)
6787 split_quantity_new = stack_max;
6788 else
6789 split_quantity_new = quantity;
6790
6792 {
6795 }
6796
6797 if (new_item)
6798 {
6799 new_item.SetResultOfSplit(true);
6800 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6802 new_item.SetQuantity(split_quantity_new);
6803 }
6804 }
6805 else
6806 {
6807 if (stack_max != 0)
6808 {
6810 {
6812 }
6813
6815
6816 if (new_item)
6817 {
6818 new_item.SetResultOfSplit(true);
6819 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6821 new_item.SetQuantity(stack_max);
6822 new_item.PlaceOnSurface();
6823 }
6824 }
6825 }
6826 }
6827
6829 {
6831 return;
6832
6834 {
6835 if (ScriptInputUserData.CanStoreInputUserData())
6836 {
6837 ScriptInputUserData ctx = new ScriptInputUserData;
6842 dst.WriteToContext(ctx);
6844 }
6845 }
6846 else if (!
GetGame().IsMultiplayer())
6847 {
6849 }
6850 }
6851
6853 {
6855 return;
6856
6858 {
6859 if (ScriptInputUserData.CanStoreInputUserData())
6860 {
6861 ScriptInputUserData ctx = new ScriptInputUserData;
6866 ctx.
Write(destination_entity);
6872 }
6873 }
6874 else if (!
GetGame().IsMultiplayer())
6875 {
6877 }
6878 }
6879
6881 {
6883 }
6884
6886 {
6888 return this;
6889
6891 float split_quantity_new;
6893 if (dst.IsValid())
6894 {
6895 int slot_id = dst.GetSlot();
6897
6898 if (quantity > stack_max)
6899 split_quantity_new = stack_max;
6900 else
6901 split_quantity_new = quantity;
6902
6904
6905 if (new_item)
6906 {
6907 new_item.SetResultOfSplit(true);
6908 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6911 }
6912
6913 return new_item;
6914 }
6915
6916 return null;
6917 }
6918
6920 {
6922 return;
6923
6925 float split_quantity_new;
6927 if (destination_entity)
6928 {
6930 if (quantity > stackable)
6931 split_quantity_new = stackable;
6932 else
6933 split_quantity_new = quantity;
6934
6935 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
6936 if (new_item)
6937 {
6938 new_item.SetResultOfSplit(true);
6939 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6941 new_item.SetQuantity(split_quantity_new);
6942 }
6943 }
6944 }
6945
6947 {
6949 return;
6950
6952 {
6953 if (ScriptInputUserData.CanStoreInputUserData())
6954 {
6955 ScriptInputUserData ctx = new ScriptInputUserData;
6960 ItemBase destination_entity =
this;
6961 ctx.
Write(destination_entity);
6965 }
6966 }
6967 else if (!
GetGame().IsMultiplayer())
6968 {
6970 }
6971 }
6972
6974 {
6976 return;
6977
6979 float split_quantity_new;
6981 if (player)
6982 {
6984 if (quantity > stackable)
6985 split_quantity_new = stackable;
6986 else
6987 split_quantity_new = quantity;
6988
6989 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
6990 new_item =
ItemBase.Cast(in_hands);
6991 if (new_item)
6992 {
6993 new_item.SetResultOfSplit(true);
6994 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6996 new_item.SetQuantity(split_quantity_new);
6997 }
6998 }
6999 }
7000
7002 {
7004 return;
7005
7007 float split_quantity_new = Math.Floor(quantity * 0.5);
7008
7010
7011 if (new_item)
7012 {
7013 if (new_item.GetQuantityMax() < split_quantity_new)
7014 {
7015 split_quantity_new = new_item.GetQuantityMax();
7016 }
7017
7018 new_item.SetResultOfSplit(true);
7019 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7020
7022 {
7025 }
7026 else
7027 {
7030 }
7031 }
7032 }
7033
7035 {
7037 return;
7038
7040 float split_quantity_new = Math.Floor(quantity / 2);
7041
7042 InventoryLocation invloc = new InventoryLocation;
7044
7046 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7047
7048 if (new_item)
7049 {
7050 if (new_item.GetQuantityMax() < split_quantity_new)
7051 {
7052 split_quantity_new = new_item.GetQuantityMax();
7053 }
7055 {
7058 }
7059 else
7060 {
7063 }
7064 }
7065 }
7066
7069 {
7070 SetWeightDirty();
7072
7073 if (parent)
7074 parent.OnAttachmentQuantityChangedEx(this, delta);
7075
7077 {
7079 {
7081 }
7083 {
7084 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7086 }
7087 }
7088
7089 }
7090
7093 {
7094
7095 }
7096
7099 {
7101 }
7102
7104 {
7105 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7106
7108 {
7109 if (newLevel == GameConstants.STATE_RUINED)
7110 {
7112 EntityAI parent = GetHierarchyParent();
7113 if (parent && parent.IsFireplace())
7114 {
7115 CargoBase cargo = GetInventory().GetCargo();
7116 if (cargo)
7117 {
7119 {
7121 }
7122 }
7123 }
7124 }
7125
7127 {
7128
7130 return;
7131 }
7132
7133 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7134 {
7136 }
7137 }
7138 }
7139
7140
7142 {
7143 super.OnRightClick();
7144
7146 {
7148 {
7149 if (ScriptInputUserData.CanStoreInputUserData())
7150 {
7151 vector m4[4];
7153
7154 EntityAI root = GetHierarchyRoot();
7155
7156 InventoryLocation dst = new InventoryLocation;
7158 {
7159 if (root)
7160 {
7161 root.GetTransform(m4);
7163 }
7164 else
7165 GetInventory().GetCurrentInventoryLocation(dst);
7166 }
7167 else
7168 {
7170
7171
7172 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7173 {
7174 if (root)
7175 {
7176 root.GetTransform(m4);
7178 }
7179 else
7180 GetInventory().GetCurrentInventoryLocation(dst);
7181 }
7182 else
7183 {
7184 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7185 }
7186 }
7187
7188 ScriptInputUserData ctx = new ScriptInputUserData;
7196 }
7197 }
7198 else if (!
GetGame().IsMultiplayer())
7199 {
7201 }
7202 }
7203 }
7204
7205 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7206 {
7207
7208 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7209 return false;
7210
7211 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7212 return false;
7213
7214
7216 return false;
7217
7218
7219 Magazine mag = Magazine.Cast(this);
7220 if (mag)
7221 {
7222 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7223 return false;
7224
7225 if (stack_max_limit)
7226 {
7227 Magazine other_mag = Magazine.Cast(other_item);
7228 if (other_item)
7229 {
7230 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7231 return false;
7232 }
7233
7234 }
7235 }
7236 else
7237 {
7238
7240 return false;
7241
7243 return false;
7244 }
7245
7246 PlayerBase player = null;
7247 if (CastTo(player, GetHierarchyRootPlayer()))
7248 {
7249 if (player.GetInventory().HasAttachment(this))
7250 return false;
7251
7252 if (player.IsItemsToDelete())
7253 return false;
7254 }
7255
7256 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7257 return false;
7258
7259 int slotID;
7261 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7262 return false;
7263
7264 return true;
7265 }
7266
7268 {
7270 }
7271
7273 {
7274 return m_IsResultOfSplit;
7275 }
7276
7278 {
7279 m_IsResultOfSplit = value;
7280 }
7281
7283 {
7285 }
7286
7288 {
7289 float other_item_quantity = other_item.GetQuantity();
7290 float this_free_space;
7291
7293
7295
7296 if (other_item_quantity > this_free_space)
7297 {
7298 return this_free_space;
7299 }
7300 else
7301 {
7302 return other_item_quantity;
7303 }
7304 }
7305
7307 {
7309 }
7310
7312 {
7314 return;
7315
7316 if (!IsMagazine() && other_item)
7317 {
7319 if (quantity_used != 0)
7320 {
7321 float hp1 = GetHealth01("","");
7322 float hp2 = other_item.GetHealth01("","");
7323 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7324 hpResult = hpResult / (
GetQuantity() + quantity_used);
7325
7326 hpResult *= GetMaxHealth();
7327 Math.Round(hpResult);
7328 SetHealth("", "Health", hpResult);
7329
7331 other_item.AddQuantity(-quantity_used);
7332 }
7333 }
7335 }
7336
7338 {
7339 #ifdef SERVER
7340 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7341 GetHierarchyParent().IncreaseLifetimeUp();
7342 #endif
7343 };
7344
7346 {
7347 PlayerBase p = PlayerBase.Cast(player);
7348
7349 array<int> recipesIds = p.m_Recipes;
7350 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7351 if (moduleRecipesManager)
7352 {
7353 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7354 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7355 }
7356
7357 for (int i = 0;i < recipesIds.Count(); i++)
7358 {
7359 int key = recipesIds.Get(i);
7360 string recipeName = moduleRecipesManager.GetRecipeName(key);
7362 }
7363 }
7364
7365
7366 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7367 {
7368 super.GetDebugActions(outputList);
7369
7370
7375
7376
7380
7384
7385
7388
7389
7391 {
7394 }
7395
7397
7400
7404 }
7405
7406
7407
7408
7410 {
7411 super.OnAction(action_id, player, ctx);
7412 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7413 {
7414 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7415 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7416 PlayerBase p = PlayerBase.Cast(player);
7417 if (
EActions.RECIPES_RANGE_START < 1000)
7418 {
7419 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7420 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7421 }
7422 }
7423 #ifndef SERVER
7424 else if (action_id ==
EActions.WATCH_PLAYER)
7425 {
7426 PluginDeveloper.SetDeveloperItemClientEx(player);
7427 }
7428 #endif
7430 {
7431 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7432 {
7433 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7434 OnDebugButtonPressServer(id + 1);
7435 }
7436
7437 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7438 {
7439 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7441 }
7442
7443 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7444 {
7445 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7447 }
7448
7449 else if (action_id ==
EActions.ADD_QUANTITY)
7450 {
7451 if (IsMagazine())
7452 {
7453 Magazine mag = Magazine.Cast(this);
7454 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7455 }
7456 else
7457 {
7459 }
7460
7461 if (m_EM)
7462 {
7463 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7464 }
7465
7466 }
7467
7468 else if (action_id ==
EActions.REMOVE_QUANTITY)
7469 {
7470 if (IsMagazine())
7471 {
7472 Magazine mag2 = Magazine.Cast(this);
7473 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7474 }
7475 else
7476 {
7478 }
7479 if (m_EM)
7480 {
7481 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7482 }
7483
7484 }
7485
7486 else if (action_id ==
EActions.SET_QUANTITY_0)
7487 {
7489
7490 if (m_EM)
7491 {
7492 m_EM.SetEnergy(0);
7493 }
7494 }
7495
7496 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7497 {
7499
7500 if (m_EM)
7501 {
7502 m_EM.SetEnergy(m_EM.GetEnergyMax());
7503 }
7504 }
7505
7506 else if (action_id ==
EActions.ADD_HEALTH)
7507 {
7508 AddHealth("","",GetMaxHealth("","Health")/5);
7509 }
7510 else if (action_id ==
EActions.REMOVE_HEALTH)
7511 {
7512 AddHealth("","",-GetMaxHealth("","Health")/5);
7513 }
7514 else if (action_id ==
EActions.DESTROY_HEALTH)
7515 {
7516 SetHealth01("","",0);
7517 }
7518 else if (action_id ==
EActions.WATCH_ITEM)
7519 {
7521 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7522 #ifdef DEVELOPER
7523 SetDebugDeveloper_item(this);
7524 #endif
7525 }
7526
7527 else if (action_id ==
EActions.ADD_TEMPERATURE)
7528 {
7529 AddTemperature(20);
7530
7531 }
7532
7533 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7534 {
7535 AddTemperature(-20);
7536
7537 }
7538
7539 else if (action_id ==
EActions.FLIP_FROZEN)
7540 {
7541 SetFrozen(!GetIsFrozen());
7542
7543 }
7544
7545 else if (action_id ==
EActions.ADD_WETNESS)
7546 {
7548
7549 }
7550
7551 else if (action_id ==
EActions.REMOVE_WETNESS)
7552 {
7554
7555 }
7556
7557 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7558 {
7561
7562
7563 }
7564
7565 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7566 {
7569 }
7570
7571 else if (action_id ==
EActions.MAKE_SPECIAL)
7572 {
7573 auto debugParams = DebugSpawnParams.WithPlayer(player);
7574 OnDebugSpawnEx(debugParams);
7575 }
7576
7577 else if (action_id ==
EActions.DELETE)
7578 {
7579 Delete();
7580 }
7581
7582 }
7583
7584
7585 return false;
7586 }
7587
7588
7589
7590
7594
7597
7598
7599
7601 {
7602 return false;
7603 }
7604
7605
7607 {
7608 return true;
7609 }
7610
7611
7613 {
7614 return true;
7615 }
7616
7617
7618
7620 {
7621 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7623 }
7624
7627 {
7628 return null;
7629 }
7630
7632 {
7633 return false;
7634 }
7635
7637 {
7638 return false;
7639 }
7640
7644
7645
7647 {
7648 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7649 return module_repairing.CanRepair(this, item_repair_kit);
7650 }
7651
7652
7653 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7654 {
7655 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7656 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7657 }
7658
7659
7661 {
7662
7663
7664
7665
7666
7667
7668
7669
7670 return 1;
7671 }
7672
7673
7674
7676 {
7678 }
7679
7680
7681
7683 {
7685 }
7686
7687
7696 {
7697 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7698
7699 if (player)
7700 {
7701 player.MessageStatus(text);
7702 }
7703 }
7704
7705
7714 {
7715 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7716
7717 if (player)
7718 {
7719 player.MessageAction(text);
7720 }
7721 }
7722
7723
7732 {
7733 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7734
7735 if (player)
7736 {
7737 player.MessageFriendly(text);
7738 }
7739 }
7740
7741
7750 {
7751 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7752
7753 if (player)
7754 {
7755 player.MessageImportant(text);
7756 }
7757 }
7758
7760 {
7761 return true;
7762 }
7763
7764
7765 override bool KindOf(
string tag)
7766 {
7767 bool found = false;
7768 string item_name = this.
GetType();
7771
7772 int array_size = item_tag_array.Count();
7773 for (int i = 0; i < array_size; i++)
7774 {
7775 if (item_tag_array.Get(i) == tag)
7776 {
7777 found = true;
7778 break;
7779 }
7780 }
7781 return found;
7782 }
7783
7784
7786 {
7787
7788 super.OnRPC(sender, rpc_type,ctx);
7789
7790
7791 switch (rpc_type)
7792 {
7793 #ifndef SERVER
7794 case ERPCs.RPC_SOUND_LOCK_ATTACH:
7795 Param2<bool, string> p = new Param2<bool, string>(false, "");
7796
7798 return;
7799
7800 bool play = p.param1;
7801 string soundSet = p.param2;
7802
7803 if (play)
7804 {
7806 {
7808 {
7810 }
7811 }
7812 else
7813 {
7815 }
7816 }
7817 else
7818 {
7820 }
7821
7822 break;
7823 #endif
7824
7825 }
7826
7828 {
7830 }
7831 }
7832
7833
7834
7835
7837 {
7838 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
7839 return plugin.GetID(
name);
7840 }
7841
7843 {
7844 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
7845 return plugin.GetName(id);
7846 }
7847
7850 {
7851
7852
7853 int varFlags;
7854 if (!ctx.
Read(varFlags))
7855 return;
7856
7857 if (varFlags & ItemVariableFlags.FLOAT)
7858 {
7860 }
7861 }
7862
7864 {
7865
7866 super.SerializeNumericalVars(floats_out);
7867
7868
7869
7871 {
7873 }
7874
7876 {
7878 }
7879
7881 {
7883 }
7884
7886 {
7891 }
7892
7894 {
7896 }
7897 }
7898
7900 {
7901
7902 super.DeSerializeNumericalVars(floats);
7903
7904
7905 int index = 0;
7906 int mask = Math.Round(floats.Get(index));
7907
7908 index++;
7909
7911 {
7913 {
7915 }
7916 else
7917 {
7918 float quantity = floats.Get(index);
7920 }
7921 index++;
7922 }
7923
7925 {
7926 float wet = floats.Get(index);
7928 index++;
7929 }
7930
7932 {
7933 int liquidtype = Math.Round(floats.Get(index));
7935 index++;
7936 }
7937
7939 {
7941 index++;
7943 index++;
7945 index++;
7947 index++;
7948 }
7949
7951 {
7952 int cleanness = Math.Round(floats.Get(index));
7954 index++;
7955 }
7956 }
7957
7959 {
7960 super.WriteVarsToCTX(ctx);
7961
7962
7964 {
7966 }
7967
7969 {
7971 }
7972
7974 {
7976 }
7977
7979 {
7980 int r,g,b,a;
7986 }
7987
7989 {
7991 }
7992 }
7993
7995 {
7996 if (!super.ReadVarsFromCTX(ctx,version))
7997 return false;
7998
7999 int intValue;
8000 float value;
8001
8002 if (version < 140)
8003 {
8004 if (!ctx.
Read(intValue))
8005 return false;
8006
8007 m_VariablesMask = intValue;
8008 }
8009
8011 {
8012 if (!ctx.
Read(value))
8013 return false;
8014
8016 {
8018 }
8019 else
8020 {
8022 }
8023 }
8024
8025 if (version < 140)
8026 {
8028 {
8029 if (!ctx.
Read(value))
8030 return false;
8031 SetTemperatureDirect(value);
8032 }
8033 }
8034
8036 {
8037 if (!ctx.
Read(value))
8038 return false;
8040 }
8041
8043 {
8044 if (!ctx.
Read(intValue))
8045 return false;
8047 }
8048
8050 {
8051 int r,g,b,a;
8053 return false;
8055 return false;
8057 return false;
8059 return false;
8060
8062 }
8063
8065 {
8066 if (!ctx.
Read(intValue))
8067 return false;
8069 }
8070
8071 if (version >= 138 && version < 140)
8072 {
8074 {
8075 if (!ctx.
Read(intValue))
8076 return false;
8077 SetFrozen(intValue);
8078 }
8079 }
8080
8081 return true;
8082 }
8083
8084
8086 {
8089 {
8091 }
8092
8093 if (!super.OnStoreLoad(ctx, version))
8094 {
8096 return false;
8097 }
8098
8099 if (version >= 114)
8100 {
8101 bool hasQuickBarIndexSaved;
8102
8103 if (!ctx.
Read(hasQuickBarIndexSaved))
8104 {
8106 return false;
8107 }
8108
8109 if (hasQuickBarIndexSaved)
8110 {
8111 int itmQBIndex;
8112
8113
8114 if (!ctx.
Read(itmQBIndex))
8115 {
8117 return false;
8118 }
8119
8120 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8121 if (itmQBIndex != -1 && parentPlayer)
8122 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8123 }
8124 }
8125 else
8126 {
8127
8128 PlayerBase player;
8129 int itemQBIndex;
8130 if (version ==
int.
MAX)
8131 {
8132 if (!ctx.
Read(itemQBIndex))
8133 {
8135 return false;
8136 }
8137 }
8138 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8139 {
8140
8141 if (!ctx.
Read(itemQBIndex))
8142 {
8144 return false;
8145 }
8146 if (itemQBIndex != -1 && player)
8147 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8148 }
8149 }
8150
8151 if (version < 140)
8152 {
8153
8154 if (!LoadVariables(ctx, version))
8155 {
8157 return false;
8158 }
8159 }
8160
8161
8163 {
8165 return false;
8166 }
8167 if (version >= 132)
8168 {
8170 if (raib)
8171 {
8173 {
8175 return false;
8176 }
8177 }
8178 }
8179
8181 return true;
8182 }
8183
8184
8185
8187 {
8188 super.OnStoreSave(ctx);
8189
8190 PlayerBase player;
8191 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8192 {
8194
8195 int itemQBIndex = -1;
8196 itemQBIndex = player.FindQuickBarEntityIndex(this);
8197 ctx.
Write(itemQBIndex);
8198 }
8199 else
8200 {
8202 }
8203
8205
8207 if (raib)
8208 {
8210 }
8211 }
8212
8213
8215 {
8216 super.AfterStoreLoad();
8217
8219 {
8221 }
8222
8224 {
8227 }
8228 }
8229
8231 {
8232 super.EEOnAfterLoad();
8233
8235 {
8237 }
8238
8241 }
8242
8244 {
8245 return false;
8246 }
8247
8248
8249
8251 {
8253 {
8254 #ifdef PLATFORM_CONSOLE
8255
8257 {
8259 if (menu)
8260 {
8262 }
8263 }
8264 #endif
8265 }
8266
8268 {
8271 }
8272
8274 {
8275 SetWeightDirty();
8277 }
8279 {
8282 }
8283
8285 {
8288 }
8290 {
8293 }
8294
8295 super.OnVariablesSynchronized();
8296 }
8297
8298
8299
8301 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8302 {
8303 if (!IsServerCheck(allow_client))
8304 return false;
8305
8307 return false;
8308
8311
8312 if (value <= (min + 0.001))
8313 value = min;
8314
8315 if (value == min)
8316 {
8317 if (destroy_config)
8318 {
8319 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8320 if (dstr)
8321 {
8323 this.Delete();
8324 return true;
8325 }
8326 }
8327 else if (destroy_forced)
8328 {
8330 this.Delete();
8331 return true;
8332 }
8333
8335 }
8336
8339
8341 {
8343
8344 if (delta)
8346 }
8347
8349
8350 return false;
8351 }
8352
8353
8355 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8356 {
8358 }
8359
8361 {
8364 }
8365
8367 {
8370 }
8371
8374 {
8375 float value_clamped = Math.Clamp(value, 0, 1);
8377 SetQuantity(result, destroy_config, destroy_forced);
8378 }
8379
8380
8383 {
8385 }
8386
8388 {
8390 }
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8402 {
8403 int slot = -1;
8404 if (GetInventory())
8405 {
8406 InventoryLocation il = new InventoryLocation;
8407 GetInventory().GetCurrentInventoryLocation(il);
8409 }
8410
8412 }
8413
8415 {
8416 float quantity_max = 0;
8417
8419 {
8420 if (attSlotID != -1)
8421 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8422
8423 if (quantity_max <= 0)
8425 }
8426
8427 if (quantity_max <= 0)
8429
8430 return quantity_max;
8431 }
8432
8434 {
8436 }
8437
8439 {
8441 }
8442
8443
8445 {
8447 }
8448
8450 {
8452 }
8453
8455 {
8457 }
8458
8459
8461 {
8462
8463 float weightEx = GetWeightEx();
8464 float special = GetInventoryAndCargoWeight();
8465 return weightEx - special;
8466 }
8467
8468
8470 {
8472 }
8473
8475 {
8477 {
8478 #ifdef DEVELOPER
8479 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8480 {
8481 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8483 }
8484 #endif
8485
8487 }
8488 else if (HasEnergyManager())
8489 {
8490 #ifdef DEVELOPER
8491 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8492 {
8493 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8494 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8495 }
8496 #endif
8497 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8498 }
8499 else
8500 {
8501 #ifdef DEVELOPER
8502 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8503 {
8504 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8505 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8506 }
8507 #endif
8508 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8509 }
8510 }
8511
8514 {
8515 int item_count = 0;
8517
8518 if (GetInventory().GetCargo() != NULL)
8519 {
8520 item_count = GetInventory().GetCargo().GetItemCount();
8521 }
8522
8523 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8524 {
8525 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8526 if (item)
8527 item_count += item.GetNumberOfItems();
8528 }
8529 return item_count;
8530 }
8531
8534 {
8535 float weight = 0;
8536 float wetness = 1;
8537 if (include_wetness)
8540 {
8541 weight = wetness * m_ConfigWeight;
8542 }
8544 {
8545 weight = 1;
8546 }
8547 return weight;
8548 }
8549
8550
8551
8553 {
8554 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8555 {
8556 GameInventory inv = GetInventory();
8557 array<EntityAI> items = new array<EntityAI>;
8559 for (int i = 0; i < items.Count(); i++)
8560 {
8562 if (item)
8563 {
8565 }
8566 }
8567 }
8568 }
8569
8570
8571
8572
8574 {
8575 float energy = 0;
8576 if (HasEnergyManager())
8577 {
8578 energy = GetCompEM().GetEnergy();
8579 }
8580 return energy;
8581 }
8582
8583
8585 {
8586 super.OnEnergyConsumed();
8587
8589 }
8590
8592 {
8593 super.OnEnergyAdded();
8594
8596 }
8597
8598
8600 {
8601 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8602 {
8604 {
8605 float energy_0to1 = GetCompEM().GetEnergy0To1();
8607 }
8608 }
8609 }
8610
8611
8613 {
8614 return ConfigGetFloat("heatIsolation");
8615 }
8616
8618 {
8620 }
8621
8623 {
8624 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8625 if (
GetGame().ConfigIsExisting(paramPath))
8627
8628 return 0.0;
8629 }
8630
8632 {
8633 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8634 if (
GetGame().ConfigIsExisting(paramPath))
8636
8637 return 0.0;
8638 }
8639
8640 override void SetWet(
float value,
bool allow_client =
false)
8641 {
8642 if (!IsServerCheck(allow_client))
8643 return;
8644
8647
8649
8650 m_VarWet = Math.Clamp(value, min, max);
8651
8653 {
8656 }
8657 }
8658
8659 override void AddWet(
float value)
8660 {
8662 }
8663
8665 {
8667 }
8668
8670 {
8672 }
8673
8675 {
8677 }
8678
8680 {
8682 }
8683
8685 {
8687 }
8688
8690 {
8693 if (newLevel != oldLevel)
8694 {
8696 }
8697 }
8698
8700 {
8701 SetWeightDirty();
8702 }
8703
8705 {
8706 return GetWetLevelInternal(
m_VarWet);
8707 }
8708
8709
8710
8712 {
8714 }
8715
8717 {
8719 }
8720
8722 {
8724 }
8725
8727 {
8729 }
8730
8731
8732
8734 {
8735 if (ConfigIsExisting("itemModelLength"))
8736 {
8737 return ConfigGetFloat("itemModelLength");
8738 }
8739 return 0;
8740 }
8741
8743 {
8744 if (ConfigIsExisting("itemAttachOffset"))
8745 {
8746 return ConfigGetFloat("itemAttachOffset");
8747 }
8748 return 0;
8749 }
8750
8751 override void SetCleanness(
int value,
bool allow_client =
false)
8752 {
8753 if (!IsServerCheck(allow_client))
8754 return;
8755
8757
8759
8762 }
8763
8765 {
8767 }
8768
8770 {
8771 return true;
8772 }
8773
8774
8775
8776
8778 {
8780 }
8781
8783 {
8785 }
8786
8787
8788
8789
8790 override void SetColor(
int r,
int g,
int b,
int a)
8791 {
8797 }
8799 override void GetColor(out
int r,out
int g,out
int b,out
int a)
8800 {
8805 }
8806
8808 {
8810 }
8811
8814 {
8815 int r,g,b,a;
8817 r = r/255;
8818 g = g/255;
8819 b = b/255;
8820 a = a/255;
8821 return MiscGameplayFunctions.GetColorString(r, g, b, a);
8822 }
8823
8824
8825
8826 override void SetLiquidType(
int value,
bool allow_client =
false)
8827 {
8828 if (!IsServerCheck(allow_client))
8829 return;
8830
8835 }
8836
8838 {
8839 return ConfigGetInt("varLiquidTypeInit");
8840 }
8841
8843 {
8845 }
8846
8848 {
8850 SetFrozen(false);
8851 }
8852
8855 {
8856 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
8857 }
8858
8859
8862 {
8863 PlayerBase nplayer;
8864 if (PlayerBase.CastTo(nplayer, player))
8865 {
8867
8868 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
8869 }
8870 }
8871
8872
8875 {
8876 PlayerBase nplayer;
8877 if (PlayerBase.CastTo(nplayer,player))
8878 {
8879
8880 nplayer.SetEnableQuickBarEntityShortcut(this,false);
8881
8882 }
8883
8884
8885 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
8886
8887
8888 if (HasEnergyManager())
8889 {
8890 GetCompEM().UpdatePlugState();
8891 }
8892 }
8893
8894
8896 {
8897 super.OnPlacementStarted(player);
8898
8900 }
8901
8902 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
8903 {
8905 {
8906 m_AdminLog.OnPlacementComplete(player,
this);
8907 }
8908
8909 super.OnPlacementComplete(player, position, orientation);
8910 }
8911
8912
8913
8914
8915
8917 {
8919 {
8920 return true;
8921 }
8922 else
8923 {
8924 return false;
8925 }
8926 }
8927
8928
8930 {
8932 {
8934 }
8935 }
8936
8937
8939 {
8941 }
8942
8944 {
8946 }
8947
8948 override void InsertAgent(
int agent,
float count = 1)
8949 {
8950 if (count < 1)
8951 return;
8952
8954 }
8955
8958 {
8960 }
8961
8962
8964 {
8966 }
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9010 {
9012 return false;
9013 return true;
9014 }
9015
9017 {
9018
9020 }
9021
9022
9025 {
9026 super.CheckForRoofLimited(timeTresholdMS);
9027
9029 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9030 {
9031 m_PreviousRoofTestTime = time;
9032 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9033 }
9034 }
9035
9036
9038 {
9040 {
9041 return 0;
9042 }
9043
9044 if (GetInventory().GetAttachmentSlotsCount() != 0)
9045 {
9046 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9047 if (filter)
9048 return filter.GetProtectionLevel(type, false, system);
9049 else
9050 return 0;
9051 }
9052
9053 string subclassPath, entryName;
9054
9055 switch (type)
9056 {
9058 entryName = "biological";
9059 break;
9061 entryName = "chemical";
9062 break;
9063 default:
9064 entryName = "biological";
9065 break;
9066 }
9067
9068 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9069
9071 }
9072
9073
9074
9077 {
9078 if (!IsMagazine())
9080
9082 }
9083
9084
9085
9086
9087
9092 {
9093 return true;
9094 }
9095
9097 {
9099 }
9100
9101
9102
9103
9104
9106 {
9107 if (parent)
9108 {
9109 if (parent.IsInherited(DayZInfected))
9110 return true;
9111
9112 if (!parent.IsRuined())
9113 return true;
9114 }
9115
9116 return true;
9117 }
9118
9120 {
9121 if (!super.CanPutAsAttachment(parent))
9122 {
9123 return false;
9124 }
9125
9126 if (!IsRuined() && !parent.IsRuined())
9127 {
9128 return true;
9129 }
9130
9131 return false;
9132 }
9133
9135 {
9136
9137
9138
9139
9140 return super.CanReceiveItemIntoCargo(item);
9141 }
9142
9144 {
9145
9146
9147
9148
9149 GameInventory attachmentInv = attachment.GetInventory();
9151 {
9152 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9153 return false;
9154 }
9155
9156 InventoryLocation loc = new InventoryLocation();
9157 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9158 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9159 return false;
9160
9161 return super.CanReceiveAttachment(attachment, slotId);
9162 }
9163
9165 {
9166 if (!super.CanReleaseAttachment(attachment))
9167 return false;
9168
9169 return GetInventory().AreChildrenAccessible();
9170 }
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9193 {
9194 int id = muzzle_owner.GetMuzzleID();
9195 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9196
9197 if (WPOF_array)
9198 {
9199 for (int i = 0; i < WPOF_array.Count(); i++)
9200 {
9201 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9202
9203 if (WPOF)
9204 {
9205 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9206 }
9207 }
9208 }
9209 }
9210
9211
9213 {
9214 int id = muzzle_owner.GetMuzzleID();
9216
9217 if (WPOBE_array)
9218 {
9219 for (int i = 0; i < WPOBE_array.Count(); i++)
9220 {
9221 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9222
9223 if (WPOBE)
9224 {
9225 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9226 }
9227 }
9228 }
9229 }
9230
9231
9233 {
9234 int id = muzzle_owner.GetMuzzleID();
9235 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9236
9237 if (WPOOH_array)
9238 {
9239 for (int i = 0; i < WPOOH_array.Count(); i++)
9240 {
9241 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9242
9243 if (WPOOH)
9244 {
9245 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9246 }
9247 }
9248 }
9249 }
9250
9251
9253 {
9254 int id = muzzle_owner.GetMuzzleID();
9255 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9256
9257 if (WPOOH_array)
9258 {
9259 for (int i = 0; i < WPOOH_array.Count(); i++)
9260 {
9261 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9262
9263 if (WPOOH)
9264 {
9265 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9266 }
9267 }
9268 }
9269 }
9270
9271
9273 {
9274 int id = muzzle_owner.GetMuzzleID();
9275 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9276
9277 if (WPOOH_array)
9278 {
9279 for (int i = 0; i < WPOOH_array.Count(); i++)
9280 {
9281 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9282
9283 if (WPOOH)
9284 {
9285 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9286 }
9287 }
9288 }
9289 }
9290
9291
9292
9294 {
9296 {
9297 return true;
9298 }
9299
9300 return false;
9301 }
9302
9304 {
9306 {
9307 return true;
9308 }
9309
9310 return false;
9311 }
9312
9314 {
9316 {
9317 return true;
9318 }
9319
9320 return false;
9321 }
9322
9324 {
9325 return false;
9326 }
9327
9330 {
9331 return UATimeSpent.DEFAULT_DEPLOY;
9332 }
9333
9334
9335
9336
9338 {
9340 SetSynchDirty();
9341 }
9342
9344 {
9346 }
9347
9348
9350 {
9351 return false;
9352 }
9353
9356 {
9357 string att_type = "None";
9358
9359 if (ConfigIsExisting("soundAttType"))
9360 {
9361 att_type = ConfigGetString("soundAttType");
9362 }
9363
9365 }
9366
9368 {
9370 }
9371
9372
9373
9374
9375
9379
9381 {
9384
9386 }
9387
9388
9390 {
9392 return;
9393
9395
9398
9401
9402 SoundParameters params = new SoundParameters();
9406 }
9407
9408
9410 {
9412 return;
9413
9415 SetSynchDirty();
9416
9419 }
9420
9421
9423 {
9425 return;
9426
9428 SetSynchDirty();
9429
9432 }
9433
9435 {
9437 }
9438
9440 {
9442 }
9443
9446 {
9447 if (!
GetGame().IsDedicatedServer())
9448 {
9449 if (ConfigIsExisting("attachSoundSet"))
9450 {
9451 string cfg_path = "";
9452 string soundset = "";
9454
9457 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9458 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9459
9460 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9461 {
9462 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9463 {
9464 if (cfg_slot_array[i] == slot_type)
9465 {
9466 soundset = cfg_soundset_array[i];
9467 break;
9468 }
9469 }
9470 }
9471
9472 if (soundset != "")
9473 {
9474 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9476 }
9477 }
9478 }
9479 }
9480
9482 {
9483
9484 }
9485
9486 void OnApply(PlayerBase player);
9487
9489 {
9490 return 1.0;
9491 };
9492
9494 {
9496 }
9497
9499 {
9501 }
9502
9504
9506 {
9507 SetDynamicPhysicsLifeTime(0.01);
9509 }
9510
9512 {
9513 array<string> zone_names = new array<string>;
9514 GetDamageZones(zone_names);
9515 for (int i = 0; i < zone_names.Count(); i++)
9516 {
9517 SetHealthMax(zone_names.Get(i),"Health");
9518 }
9519 SetHealthMax("","Health");
9520 }
9521
9524 {
9525 float global_health = GetHealth01("","Health");
9526 array<string> zones = new array<string>;
9527 GetDamageZones(zones);
9528
9529 for (int i = 0; i < zones.Count(); i++)
9530 {
9531 SetHealth01(zones.Get(i),"Health",global_health);
9532 }
9533 }
9534
9537 {
9538 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9539 }
9540
9542 {
9543 if (!hasRootAsPlayer)
9544 {
9545 if (refParentIB)
9546 {
9547
9548 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9549 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9550
9551 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9552 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9553
9556 }
9557 else
9558 {
9559
9562 }
9563 }
9564 }
9565
9567 {
9569 {
9570 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9571 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9572 {
9573 float heatPermCoef = 1.0;
9575 while (ent)
9576 {
9577 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9578 ent = ent.GetHierarchyParent();
9579 }
9580
9581 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9582 }
9583 }
9584 }
9585
9587 {
9588
9589 EntityAI parent = GetHierarchyParent();
9590 if (!parent)
9591 {
9592 hasParent = false;
9593 hasRootAsPlayer = false;
9594 }
9595 else
9596 {
9597 hasParent = true;
9598 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9599 refParentIB =
ItemBase.Cast(parent);
9600 }
9601 }
9602
9603 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9604 {
9605
9606 }
9607
9609 {
9610
9611 return false;
9612 }
9613
9615 {
9616
9617
9618 return false;
9619 }
9620
9622 {
9623
9624 return false;
9625 }
9626
9629 {
9630 return !GetIsFrozen() &&
IsOpen();
9631 }
9632
9634 {
9635 bool hasParent = false, hasRootAsPlayer = false;
9637
9638 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9639 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9640
9641 if (wwtu || foodDecay)
9642 {
9646
9647 if (processWetness || processTemperature || processDecay)
9648 {
9650
9651 if (processWetness)
9652 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9653
9654 if (processTemperature)
9656
9657 if (processDecay)
9658 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9659 }
9660 }
9661 }
9662
9665 {
9667 }
9668
9670 {
9673
9674 return super.GetTemperatureFreezeThreshold();
9675 }
9676
9678 {
9681
9682 return super.GetTemperatureThawThreshold();
9683 }
9684
9686 {
9689
9690 return super.GetItemOverheatThreshold();
9691 }
9692
9694 {
9696 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9697
9698 return super.GetTemperatureFreezeTime();
9699 }
9700
9702 {
9704 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9705
9706 return super.GetTemperatureThawTime();
9707 }
9708
9713
9715 {
9716 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
9717 }
9718
9720 {
9721 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
9722 }
9723
9726 {
9728 }
9729
9731 {
9733 }
9734
9736 {
9738 }
9739
9742 {
9743 return null;
9744 }
9745
9748 {
9749 return false;
9750 }
9751
9753 {
9755 {
9758 if (!trg)
9759 {
9761 explosive = this;
9762 }
9763
9764 explosive.PairRemote(trg);
9766
9767 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
9768 trg.SetPersistentPairID(persistentID);
9769 explosive.SetPersistentPairID(persistentID);
9770
9771 return true;
9772 }
9773 return false;
9774 }
9775
9778 {
9779 float ret = 1.0;
9782 ret *= GetHealth01();
9783
9784 return ret;
9785 }
9786
9787 #ifdef DEVELOPER
9788 override void SetDebugItem()
9789 {
9790 super.SetDebugItem();
9791 _itemBase = this;
9792 }
9793
9795 {
9796 string text = super.GetDebugText();
9797
9799 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
9800
9801 return text;
9802 }
9803 #endif
9804
9806 {
9807 return true;
9808 }
9809
9811
9813
9815 {
9818 }
9819
9820
9828
9844}
9845
9847{
9849 if (entity)
9850 {
9851 bool is_item = entity.IsInherited(
ItemBase);
9852 if (is_item && full_quantity)
9853 {
9856 }
9857 }
9858 else
9859 {
9861 return NULL;
9862 }
9863 return entity;
9864}
9865
9867{
9868 if (item)
9869 {
9870 if (health > 0)
9871 item.SetHealth("", "", health);
9872
9873 if (item.CanHaveTemperature())
9874 {
9876 if (item.CanFreeze())
9877 item.SetFrozen(false);
9878 }
9879
9880 if (item.HasEnergyManager())
9881 {
9882 if (quantity >= 0)
9883 {
9884 item.GetCompEM().SetEnergy0To1(quantity);
9885 }
9886 else
9887 {
9889 }
9890 }
9891 else if (item.IsMagazine())
9892 {
9893 Magazine mag = Magazine.Cast(item);
9894 if (quantity >= 0)
9895 {
9896 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
9897 }
9898 else
9899 {
9901 }
9902
9903 }
9904 else
9905 {
9906 if (quantity >= 0)
9907 {
9908 item.SetQuantityNormalized(quantity, false);
9909 }
9910 else
9911 {
9913 }
9914
9915 }
9916 }
9917}
9918
9919#ifdef DEVELOPER
9921#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.