5056{
5058 {
5059 return true;
5060 }
5061};
5062
5063
5064
5066{
5070
5072
5075
5076
5077
5078
5079
5088
5094
5099
5104
5125 protected bool m_IsResultOfSplit
5126
5128
5133
5134
5135
5137
5141
5142
5143
5145
5148
5149
5150
5156
5157
5165
5168
5169
5171
5172
5174
5175
5180
5181
5186
5187
5189
5190
5192 {
5197
5198 if (!
GetGame().IsDedicatedServer())
5199 {
5201 {
5203
5205 {
5207 }
5208 }
5209
5212 }
5213
5214 m_OldLocation = null;
5215
5217 {
5219 }
5220
5221 if (ConfigIsExisting("headSelectionsToHide"))
5222 {
5225 }
5226
5228 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5229 {
5231 }
5232
5234
5235 m_IsResultOfSplit = false;
5236
5238 }
5239
5241 {
5242 super.InitItemVariables();
5243
5249 m_Count = ConfigGetInt(
"count");
5250
5253
5258
5261
5266
5278
5282
5283
5286 if (ConfigIsExisting("canBeSplit"))
5287 {
5290 }
5291
5293 if (ConfigIsExisting("itemBehaviour"))
5295
5296
5299 RegisterNetSyncVariableInt("m_VarLiquidType");
5300 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5301
5302 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5303 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5304 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5305
5306 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5307 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5308 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5309 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5310
5311 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5312 RegisterNetSyncVariableBool("m_IsTakeable");
5313 RegisterNetSyncVariableBool("m_IsHologram");
5314
5317 {
5320 }
5321
5323
5325 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5327
5328 }
5329
5331 {
5333 }
5334
5336 {
5339 {
5344 }
5345 }
5346
5347 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5348 {
5350 {
5353 }
5354
5356 }
5357
5359 {
5365 }
5366
5368
5370 {
5372
5373 if (!action)
5374 {
5375 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5376 return;
5377 }
5378
5380 if (!ai)
5381 {
5383 return;
5384 }
5385
5387 if (!action_array)
5388 {
5389 action_array = new array<ActionBase_Basic>;
5391 }
5392 if (LogManager.IsActionLogEnable())
5393 {
5394 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5395 }
5396
5397 if (action_array.Find(action) != -1)
5398 {
5399 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5400 }
5401 else
5402 {
5403 action_array.Insert(action);
5404 }
5405 }
5406
5408 {
5410 ActionBase action = player.GetActionManager().GetAction(actionName);
5413
5414 if (action_array)
5415 {
5416 action_array.RemoveItem(action);
5417 }
5418 }
5419
5420
5421
5423 {
5424 ActionOverrideData overrideData = new ActionOverrideData();
5428
5430 if (!actionMap)
5431 {
5434 }
5435
5436 actionMap.Insert(this.
Type(), overrideData);
5437
5438 }
5439
5441
5443
5444
5446 {
5449
5452
5453 string config_to_search = "CfgVehicles";
5454 string muzzle_owner_config;
5455
5457 {
5458 if (IsInherited(Weapon))
5459 config_to_search = "CfgWeapons";
5460
5461 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5462
5463 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5464
5466
5467 if (config_OnFire_subclass_count > 0)
5468 {
5469 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5470
5471 for (int i = 0; i < config_OnFire_subclass_count; i++)
5472 {
5473 string particle_class = "";
5475 string config_OnFire_entry = config_OnFire_class + particle_class;
5476 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5477 WPOF_array.Insert(WPOF);
5478 }
5479
5480
5482 }
5483 }
5484
5486 {
5487 config_to_search = "CfgWeapons";
5488 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5489
5490 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5491
5493
5494 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5495 {
5496 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5497
5498 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5499 {
5500 string particle_class2 = "";
5502 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5503 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5504 WPOBE_array.Insert(WPOBE);
5505 }
5506
5507
5509 }
5510 }
5511 }
5512
5513
5515 {
5518
5520 {
5521 string config_to_search = "CfgVehicles";
5522
5523 if (IsInherited(Weapon))
5524 config_to_search = "CfgWeapons";
5525
5526 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5527 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5528
5529 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5530 {
5531
5533
5535 {
5537 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5539 return;
5540 }
5541
5544
5545
5546
5548 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5549
5550 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5551 {
5552 string particle_class = "";
5554 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5556
5557 if (entry_type == CT_CLASS)
5558 {
5559 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5560 WPOOH_array.Insert(WPOF);
5561 }
5562 }
5563
5564
5566 }
5567 }
5568 }
5569
5571 {
5573 }
5574
5576 {
5578 {
5580
5583
5586
5587 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5588 }
5589 }
5590
5592 {
5594 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5595
5597 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5598
5600 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5601
5603 {
5605 }
5606 }
5607
5609 {
5611 }
5612
5614 {
5617 else
5619
5621 {
5624 }
5625 else
5626 {
5629
5632 }
5633
5635 }
5636
5638 {
5640 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5641 }
5642
5644 {
5646 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5648 }
5649
5651 {
5653 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5654 }
5655
5657 {
5660
5661 OverheatingParticle OP = new OverheatingParticle();
5666
5668 }
5669
5671 {
5674
5675 return -1;
5676 }
5677
5679 {
5681 {
5684
5685 for (int i = count; i > 0; --i)
5686 {
5687 int id = i - 1;
5690
5693
5694 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5695 {
5696 if (p)
5697 {
5700 }
5701 }
5702 }
5703 }
5704 }
5705
5707 {
5709 {
5711 {
5712 int id = i - 1;
5714
5715 if (OP)
5716 {
5718
5719 if (p)
5720 {
5722 }
5723
5724 delete OP;
5725 }
5726 }
5727
5730 }
5731 }
5732
5735 {
5736 return 0.0;
5737 }
5738
5739
5741 {
5742 return 250;
5743 }
5744
5746 {
5747 return 0;
5748 }
5749
5752 {
5754 return true;
5755
5756 return false;
5757 }
5758
5761 {
5764
5766 {
5768 }
5769 else
5770 {
5771
5773 }
5774
5776 }
5777
5784 {
5785 return -1;
5786 }
5787
5788
5789
5790
5792 {
5794 {
5796 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
5797
5798 if (r_index >= 0)
5799 {
5800 InventoryLocation r_il = new InventoryLocation;
5801 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
5802
5803 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
5806 {
5807 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
5808 }
5810 {
5811 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
5812 }
5813
5814 }
5815
5816 player.GetHumanInventory().ClearUserReservedLocation(this);
5817 }
5818
5821 }
5822
5823
5824
5825
5827 {
5828 return ItemBase.m_DebugActionsMask;
5829 }
5830
5832 {
5833 return ItemBase.m_DebugActionsMask & mask;
5834 }
5835
5837 {
5838 ItemBase.m_DebugActionsMask = mask;
5839 }
5840
5842 {
5843 ItemBase.m_DebugActionsMask |= mask;
5844 }
5845
5847 {
5848 ItemBase.m_DebugActionsMask &= ~mask;
5849 }
5850
5852 {
5854 {
5856 }
5857 else
5858 {
5860 }
5861 }
5862
5863
5865 {
5866 if (GetEconomyProfile())
5867 {
5868 float q_max = GetEconomyProfile().GetQuantityMax();
5869 if (q_max > 0)
5870 {
5871 float q_min = GetEconomyProfile().GetQuantityMin();
5872 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
5873
5875 {
5876 ComponentEnergyManager comp = GetCompEM();
5878 {
5880 }
5881 }
5883 {
5885
5886 }
5887
5888 }
5889 }
5890 }
5891
5894 {
5895 EntityAI parent = GetHierarchyParent();
5896
5897 if (parent)
5898 {
5899 InventoryLocation inventory_location_to_lock = new InventoryLocation;
5900 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
5901 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
5902 }
5903 }
5904
5907 {
5908 EntityAI parent = GetHierarchyParent();
5909
5910 if (parent)
5911 {
5912 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
5913 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
5914 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
5915 }
5916 }
5917
5919 {
5920
5921
5922
5923
5925
5927 {
5928 if (ScriptInputUserData.CanStoreInputUserData())
5929 {
5930 ScriptInputUserData ctx = new ScriptInputUserData;
5936 ctx.
Write(use_stack_max);
5939
5941 {
5942 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
5943 }
5944 }
5945 }
5946 else if (!
GetGame().IsMultiplayer())
5947 {
5949 }
5950 }
5951
5953 {
5955 }
5956
5958 {
5960 }
5961
5963 {
5965 }
5966
5968 {
5969
5970 return false;
5971 }
5972
5974 {
5975 return false;
5976 }
5977
5981 {
5982 return false;
5983 }
5984
5986 {
5987 return "";
5988 }
5989
5991
5993 {
5994 return false;
5995 }
5996
5998 {
5999 return true;
6000 }
6001
6002
6003
6005 {
6006 return true;
6007 }
6008
6010 {
6011 return true;
6012 }
6013
6015 {
6016 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6018 }
6019
6021 {
6023 }
6024
6026 {
6028 if (!is_being_placed)
6030 SetSynchDirty();
6031 }
6032
6033
6035
6037 {
6039 }
6040
6042 {
6044 }
6045
6047 {
6048 return 1;
6049 }
6050
6052 {
6053 return false;
6054 }
6055
6057 {
6059 SetSynchDirty();
6060 }
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6097 {
6098 super.OnMovedInsideCargo(container);
6099
6100 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6101 }
6102
6103 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6104 {
6105 super.EEItemLocationChanged(oldLoc,newLoc);
6106
6107 PlayerBase new_player = null;
6108 PlayerBase old_player = null;
6109
6110 if (newLoc.GetParent())
6111 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6112
6113 if (oldLoc.GetParent())
6114 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6115
6117 {
6118 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6119
6120 if (r_index >= 0)
6121 {
6122 InventoryLocation r_il = new InventoryLocation;
6123 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6124
6125 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6128 {
6129 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6130 }
6132 {
6133 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6134 }
6135
6136 }
6137 }
6138
6140 {
6141 if (new_player)
6142 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6143
6144 if (new_player == old_player)
6145 {
6146
6147 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6148 {
6150 {
6151 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6152 {
6153 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6154 }
6155 }
6156 else
6157 {
6158 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6159 }
6160 }
6161
6162 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6163 {
6164 int type = oldLoc.GetType();
6166 {
6167 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6168 }
6170 {
6171 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6172 }
6173 }
6174 if (!m_OldLocation)
6175 {
6176 m_OldLocation = new InventoryLocation;
6177 }
6178 m_OldLocation.Copy(oldLoc);
6179 }
6180 else
6181 {
6182 if (m_OldLocation)
6183 {
6184 m_OldLocation.Reset();
6185 }
6186 }
6187
6189 }
6190 else
6191 {
6192 if (new_player)
6193 {
6194 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6195 if (res_index >= 0)
6196 {
6197 InventoryLocation il = new InventoryLocation;
6198 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6200 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6203 {
6204 il.
GetParent().GetOnReleaseLock().Invoke(it);
6205 }
6207 {
6209 }
6210
6211 }
6212 }
6214 {
6215
6217 }
6218
6219 if (m_OldLocation)
6220 {
6221 m_OldLocation.Reset();
6222 }
6223 }
6224 }
6225
6226 override void EOnContact(IEntity other, Contact extra)
6227 {
6229 {
6230 int liquidType = -1;
6232 if (impactSpeed > 0.0)
6233 {
6235 #ifndef SERVER
6237 #else
6239 SetSynchDirty();
6240 #endif
6242 }
6243 }
6244
6245 #ifdef SERVER
6246 if (GetCompEM() && GetCompEM().IsPlugged())
6247 {
6248 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6249 GetCompEM().UnplugThis();
6250 }
6251 #endif
6252 }
6253
6255
6257 {
6259 }
6260
6262 {
6263
6264 }
6265
6267 {
6268 super.OnItemLocationChanged(old_owner, new_owner);
6269
6270 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6271 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6272
6273 if (!relatedPlayer && playerNew)
6274 relatedPlayer = playerNew;
6275
6276 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6277 {
6279 if (actionMgr)
6280 {
6281 ActionBase currentAction = actionMgr.GetRunningAction();
6282 if (currentAction)
6284 }
6285 }
6286
6287 Man ownerPlayerOld = null;
6288 Man ownerPlayerNew = null;
6289
6290 if (old_owner)
6291 {
6292 if (old_owner.
IsMan())
6293 {
6294 ownerPlayerOld = Man.Cast(old_owner);
6295 }
6296 else
6297 {
6298 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6299 }
6300 }
6301 else
6302 {
6304 {
6306
6307 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6308 {
6309 GetCompEM().UnplugThis();
6310 }
6311 }
6312 }
6313
6314 if (new_owner)
6315 {
6316 if (new_owner.
IsMan())
6317 {
6318 ownerPlayerNew = Man.Cast(new_owner);
6319 }
6320 else
6321 {
6322 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6323 }
6324 }
6325
6326 if (ownerPlayerOld != ownerPlayerNew)
6327 {
6328 if (ownerPlayerOld)
6329 {
6330 array<EntityAI> subItemsExit = new array<EntityAI>;
6332 for (int i = 0; i < subItemsExit.Count(); i++)
6333 {
6336 }
6337 }
6338
6339 if (ownerPlayerNew)
6340 {
6341 array<EntityAI> subItemsEnter = new array<EntityAI>;
6343 for (int j = 0; j < subItemsEnter.Count(); j++)
6344 {
6347 }
6348 }
6349 }
6350 else if (ownerPlayerNew != null)
6351 {
6352 PlayerBase nplayer;
6353 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6354 {
6355 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6357 for (int k = 0; k < subItemsUpdate.Count(); k++)
6358 {
6360 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6361 }
6362 }
6363 }
6364
6365 if (old_owner)
6366 old_owner.OnChildItemRemoved(this);
6367 if (new_owner)
6368 new_owner.OnChildItemReceived(this);
6369 }
6370
6371
6373 {
6374 super.EEDelete(parent);
6375 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6376 if (player)
6377 {
6379
6380 if (player.IsAlive())
6381 {
6382 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6383 if (r_index >= 0)
6384 {
6385 InventoryLocation r_il = new InventoryLocation;
6386 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6387
6388 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6391 {
6392 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6393 }
6395 {
6396 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6397 }
6398
6399 }
6400
6401 player.RemoveQuickBarEntityShortcut(this);
6402 }
6403 }
6404 }
6405
6407 {
6408 super.EEKilled(killer);
6409
6412 {
6413 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6414 {
6415 if (IsMagazine())
6416 {
6417 if (Magazine.Cast(this).GetAmmoCount() > 0)
6418 {
6420 }
6421 }
6422 else
6423 {
6425 }
6426 }
6427 }
6428 }
6429
6431 {
6432 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6433
6434 super.OnWasAttached(parent, slot_id);
6435
6438
6440 }
6441
6443 {
6444 super.OnWasDetached(parent, slot_id);
6445
6448 }
6449
6451 {
6452 int idx;
6455
6456 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6457 if (inventory_slots.Count() < 1)
6458 {
6459 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6460 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6461 }
6462 else
6463 {
6464 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6465 }
6466
6467 idx = inventory_slots.Find(slot);
6468 if (idx < 0)
6469 return "";
6470
6471 return attach_types.Get(idx);
6472 }
6473
6475 {
6476 int idx = -1;
6477 string slot;
6478
6481
6482 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6483 if (inventory_slots.Count() < 1)
6484 {
6485 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6486 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6487 }
6488 else
6489 {
6490 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6491 if (detach_types.Count() < 1)
6492 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6493 }
6494
6495 for (int i = 0; i < inventory_slots.Count(); i++)
6496 {
6497 slot = inventory_slots.Get(i);
6498 }
6499
6500 if (slot != "")
6501 {
6502 if (detach_types.Count() == 1)
6503 idx = 0;
6504 else
6505 idx = inventory_slots.Find(slot);
6506 }
6507 if (idx < 0)
6508 return "";
6509
6510 return detach_types.Get(idx);
6511 }
6512
6514 {
6515
6517
6518
6519 float min_time = 1;
6520 float max_time = 3;
6521 float delay = Math.RandomFloat(min_time, max_time);
6522
6523 explode_timer.Run(delay, this, "DoAmmoExplosion");
6524 }
6525
6527 {
6528 Magazine magazine = Magazine.Cast(this);
6529 int pop_sounds_count = 6;
6530 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6531
6532
6533 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6534 string sound_name = pop_sounds[ sound_idx ];
6536
6537
6538 magazine.ServerAddAmmoCount(-1);
6539
6540
6541 float min_temp_to_explode = 100;
6542
6543 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6544 {
6546 }
6547 }
6548
6549
6550 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6551 {
6552 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6553
6554 const int CHANCE_DAMAGE_CARGO = 4;
6555 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6556 const int CHANCE_DAMAGE_NOTHING = 2;
6557
6559 {
6560 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6561 int chances;
6562 int rnd;
6563
6564 if (GetInventory().GetCargo())
6565 {
6566 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6567 rnd = Math.RandomInt(0,chances);
6568
6569 if (rnd < CHANCE_DAMAGE_CARGO)
6570 {
6572 }
6573 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6574 {
6576 }
6577 }
6578 else
6579 {
6580 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6581 rnd = Math.RandomInt(0,chances);
6582
6583 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6584 {
6586 }
6587 }
6588 }
6589 }
6590
6592 {
6593 if (GetInventory().GetCargo())
6594 {
6595 int item_count = GetInventory().GetCargo().GetItemCount();
6596 if (item_count > 0)
6597 {
6598 int random_pick = Math.RandomInt(0, item_count);
6600 if (!item.IsExplosive())
6601 {
6602 item.AddHealth("","",damage);
6603 return true;
6604 }
6605 }
6606 }
6607 return false;
6608 }
6609
6611 {
6612 int attachment_count = GetInventory().AttachmentCount();
6613 if (attachment_count > 0)
6614 {
6615 int random_pick = Math.RandomInt(0, attachment_count);
6616 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6617 if (!attachment.IsExplosive())
6618 {
6619 attachment.AddHealth("","",damage);
6620 return true;
6621 }
6622 }
6623 return false;
6624 }
6625
6627 {
6629 }
6630
6632 {
6634 return GetInventory().CanRemoveEntity();
6635
6636 return false;
6637 }
6638
6640 {
6642 return;
6643
6645 {
6646 if (ScriptInputUserData.CanStoreInputUserData())
6647 {
6648 ScriptInputUserData ctx = new ScriptInputUserData;
6653 ctx.
Write(destination_entity);
6657 }
6658 }
6659 else if (!
GetGame().IsMultiplayer())
6660 {
6662 }
6663 }
6664
6666 {
6668 return;
6669
6670 float split_quantity_new;
6674 InventoryLocation loc = new InventoryLocation;
6675
6676 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6677 {
6679 split_quantity_new = stack_max;
6680 else
6682
6683 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6684 if (new_item)
6685 {
6686 new_item.SetResultOfSplit(true);
6687 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6689 new_item.SetQuantity(split_quantity_new);
6690 }
6691 }
6692 else if (destination_entity && slot_id == -1)
6693 {
6694 if (quantity > stack_max)
6695 split_quantity_new = stack_max;
6696 else
6697 split_quantity_new = quantity;
6698
6700 {
6703 }
6704
6705 if (new_item)
6706 {
6707 new_item.SetResultOfSplit(true);
6708 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6710 new_item.SetQuantity(split_quantity_new);
6711 }
6712 }
6713 else
6714 {
6715 if (stack_max != 0)
6716 {
6718 {
6720 }
6721
6722 if (split_quantity_new == 0)
6723 {
6724 if (!
GetGame().IsMultiplayer())
6725 player.PhysicalPredictiveDropItem(this);
6726 else
6727 player.ServerDropEntity(this);
6728 return;
6729 }
6730
6732
6733 if (new_item)
6734 {
6735 new_item.SetResultOfSplit(true);
6736 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6738 new_item.SetQuantity(stack_max);
6739 new_item.PlaceOnSurface();
6740 }
6741 }
6742 }
6743 }
6744
6746 {
6748 return;
6749
6750 float split_quantity_new;
6754 InventoryLocation loc = new InventoryLocation;
6755
6756 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6757 {
6759 split_quantity_new = stack_max;
6760 else
6762
6763 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6764 if (new_item)
6765 {
6766 new_item.SetResultOfSplit(true);
6767 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6769 new_item.SetQuantity(split_quantity_new);
6770 }
6771 }
6772 else if (destination_entity && slot_id == -1)
6773 {
6774 if (quantity > stack_max)
6775 split_quantity_new = stack_max;
6776 else
6777 split_quantity_new = quantity;
6778
6780 {
6783 }
6784
6785 if (new_item)
6786 {
6787 new_item.SetResultOfSplit(true);
6788 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6790 new_item.SetQuantity(split_quantity_new);
6791 }
6792 }
6793 else
6794 {
6795 if (stack_max != 0)
6796 {
6798 {
6800 }
6801
6803
6804 if (new_item)
6805 {
6806 new_item.SetResultOfSplit(true);
6807 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6809 new_item.SetQuantity(stack_max);
6810 new_item.PlaceOnSurface();
6811 }
6812 }
6813 }
6814 }
6815
6817 {
6819 return;
6820
6822 {
6823 if (ScriptInputUserData.CanStoreInputUserData())
6824 {
6825 ScriptInputUserData ctx = new ScriptInputUserData;
6830 dst.WriteToContext(ctx);
6832 }
6833 }
6834 else if (!
GetGame().IsMultiplayer())
6835 {
6837 }
6838 }
6839
6841 {
6843 return;
6844
6846 {
6847 if (ScriptInputUserData.CanStoreInputUserData())
6848 {
6849 ScriptInputUserData ctx = new ScriptInputUserData;
6854 ctx.
Write(destination_entity);
6860 }
6861 }
6862 else if (!
GetGame().IsMultiplayer())
6863 {
6865 }
6866 }
6867
6869 {
6871 }
6872
6874 {
6876 return this;
6877
6879 float split_quantity_new;
6881 if (dst.IsValid())
6882 {
6883 int slot_id = dst.GetSlot();
6885
6886 if (quantity > stack_max)
6887 split_quantity_new = stack_max;
6888 else
6889 split_quantity_new = quantity;
6890
6892
6893 if (new_item)
6894 {
6895 new_item.SetResultOfSplit(true);
6896 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6899 }
6900
6901 return new_item;
6902 }
6903
6904 return null;
6905 }
6906
6908 {
6910 return;
6911
6913 float split_quantity_new;
6915 if (destination_entity)
6916 {
6918 if (quantity > stackable)
6919 split_quantity_new = stackable;
6920 else
6921 split_quantity_new = quantity;
6922
6923 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
6924 if (new_item)
6925 {
6926 new_item.SetResultOfSplit(true);
6927 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6929 new_item.SetQuantity(split_quantity_new);
6930 }
6931 }
6932 }
6933
6935 {
6937 return;
6938
6940 {
6941 if (ScriptInputUserData.CanStoreInputUserData())
6942 {
6943 ScriptInputUserData ctx = new ScriptInputUserData;
6948 ItemBase destination_entity =
this;
6949 ctx.
Write(destination_entity);
6953 }
6954 }
6955 else if (!
GetGame().IsMultiplayer())
6956 {
6958 }
6959 }
6960
6962 {
6964 return;
6965
6967 float split_quantity_new;
6969 if (player)
6970 {
6972 if (quantity > stackable)
6973 split_quantity_new = stackable;
6974 else
6975 split_quantity_new = quantity;
6976
6977 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
6978 new_item =
ItemBase.Cast(in_hands);
6979 if (new_item)
6980 {
6981 new_item.SetResultOfSplit(true);
6982 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6984 new_item.SetQuantity(split_quantity_new);
6985 }
6986 }
6987 }
6988
6990 {
6992 return;
6993
6995 float split_quantity_new = Math.Floor(quantity * 0.5);
6996
6998
6999 if (new_item)
7000 {
7001 if (new_item.GetQuantityMax() < split_quantity_new)
7002 {
7003 split_quantity_new = new_item.GetQuantityMax();
7004 }
7005
7006 new_item.SetResultOfSplit(true);
7007 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7008
7010 {
7013 }
7014 else
7015 {
7018 }
7019 }
7020 }
7021
7023 {
7025 return;
7026
7028 float split_quantity_new = Math.Floor(quantity / 2);
7029
7030 InventoryLocation invloc = new InventoryLocation;
7032
7034 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7035
7036 if (new_item)
7037 {
7038 if (new_item.GetQuantityMax() < split_quantity_new)
7039 {
7040 split_quantity_new = new_item.GetQuantityMax();
7041 }
7043 {
7046 }
7047 else
7048 {
7051 }
7052 }
7053 }
7054
7057 {
7058 SetWeightDirty();
7060
7061 if (parent)
7062 parent.OnAttachmentQuantityChangedEx(this, delta);
7063
7065 {
7067 {
7069 }
7071 {
7072 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7074 }
7075 }
7076
7077 }
7078
7081 {
7082
7083 }
7084
7087 {
7089 }
7090
7092 {
7093 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7094
7096 {
7097 if (newLevel == GameConstants.STATE_RUINED)
7098 {
7100 EntityAI parent = GetHierarchyParent();
7101 if (parent && parent.IsFireplace())
7102 {
7103 CargoBase cargo = GetInventory().GetCargo();
7104 if (cargo)
7105 {
7107 {
7109 }
7110 }
7111 }
7112 }
7113
7115 {
7116
7118 return;
7119 }
7120
7121 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7122 {
7124 }
7125 }
7126 }
7127
7128
7130 {
7131 super.OnRightClick();
7132
7134 {
7136 {
7137 if (ScriptInputUserData.CanStoreInputUserData())
7138 {
7139 vector m4[4];
7141
7142 EntityAI root = GetHierarchyRoot();
7143
7144 InventoryLocation dst = new InventoryLocation;
7146 {
7147 if (root)
7148 {
7149 root.GetTransform(m4);
7151 }
7152 else
7153 GetInventory().GetCurrentInventoryLocation(dst);
7154 }
7155 else
7156 {
7158
7159
7160 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7161 {
7162 if (root)
7163 {
7164 root.GetTransform(m4);
7166 }
7167 else
7168 GetInventory().GetCurrentInventoryLocation(dst);
7169 }
7170 else
7171 {
7172 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7173 }
7174 }
7175
7176 ScriptInputUserData ctx = new ScriptInputUserData;
7184 }
7185 }
7186 else if (!
GetGame().IsMultiplayer())
7187 {
7189 }
7190 }
7191 }
7192
7193 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7194 {
7195
7196 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7197 return false;
7198
7199 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7200 return false;
7201
7202
7204 return false;
7205
7206
7207 Magazine mag = Magazine.Cast(this);
7208 if (mag)
7209 {
7210 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7211 return false;
7212
7213 if (stack_max_limit)
7214 {
7215 Magazine other_mag = Magazine.Cast(other_item);
7216 if (other_item)
7217 {
7218 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7219 return false;
7220 }
7221
7222 }
7223 }
7224 else
7225 {
7226
7228 return false;
7229
7231 return false;
7232 }
7233
7234 PlayerBase player = null;
7235 if (CastTo(player, GetHierarchyRootPlayer()))
7236 {
7237 if (player.GetInventory().HasAttachment(this))
7238 return false;
7239
7240 if (player.IsItemsToDelete())
7241 return false;
7242 }
7243
7244 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7245 return false;
7246
7247 int slotID;
7249 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7250 return false;
7251
7252 return true;
7253 }
7254
7256 {
7258 }
7259
7261 {
7262 return m_IsResultOfSplit;
7263 }
7264
7266 {
7267 m_IsResultOfSplit = value;
7268 }
7269
7271 {
7273 }
7274
7276 {
7277 float other_item_quantity = other_item.GetQuantity();
7278 float this_free_space;
7279
7281
7283
7284 if (other_item_quantity > this_free_space)
7285 {
7286 return this_free_space;
7287 }
7288 else
7289 {
7290 return other_item_quantity;
7291 }
7292 }
7293
7295 {
7297 }
7298
7300 {
7302 return;
7303
7304 if (!IsMagazine() && other_item)
7305 {
7307 if (quantity_used != 0)
7308 {
7309 float hp1 = GetHealth01("","");
7310 float hp2 = other_item.GetHealth01("","");
7311 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7312 hpResult = hpResult / (
GetQuantity() + quantity_used);
7313
7314 hpResult *= GetMaxHealth();
7315 Math.Round(hpResult);
7316 SetHealth("", "Health", hpResult);
7317
7319 other_item.AddQuantity(-quantity_used);
7320 }
7321 }
7323 }
7324
7326 {
7327 #ifdef SERVER
7328 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7329 GetHierarchyParent().IncreaseLifetimeUp();
7330 #endif
7331 };
7332
7334 {
7335 PlayerBase p = PlayerBase.Cast(player);
7336
7337 array<int> recipesIds = p.m_Recipes;
7338 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7339 if (moduleRecipesManager)
7340 {
7341 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7342 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7343 }
7344
7345 for (int i = 0;i < recipesIds.Count(); i++)
7346 {
7347 int key = recipesIds.Get(i);
7348 string recipeName = moduleRecipesManager.GetRecipeName(key);
7350 }
7351 }
7352
7353
7354 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7355 {
7356 super.GetDebugActions(outputList);
7357
7358
7363
7364
7368
7372
7373
7376
7377
7379 {
7382 }
7383
7385
7388
7392 }
7393
7394
7395
7396
7398 {
7399 super.OnAction(action_id, player, ctx);
7400 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7401 {
7402 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7403 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7404 PlayerBase p = PlayerBase.Cast(player);
7405 if (
EActions.RECIPES_RANGE_START < 1000)
7406 {
7407 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7408 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7409 }
7410 }
7411 #ifndef SERVER
7412 else if (action_id ==
EActions.WATCH_PLAYER)
7413 {
7414 PluginDeveloper.SetDeveloperItemClientEx(player);
7415 }
7416 #endif
7418 {
7419 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7420 {
7421 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7422 OnDebugButtonPressServer(id + 1);
7423 }
7424
7425 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7426 {
7427 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7429 }
7430
7431 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7432 {
7433 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7435 }
7436
7437 else if (action_id ==
EActions.ADD_QUANTITY)
7438 {
7439 if (IsMagazine())
7440 {
7441 Magazine mag = Magazine.Cast(this);
7442 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7443 }
7444 else
7445 {
7447 }
7448
7449 if (m_EM)
7450 {
7451 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7452 }
7453
7454 }
7455
7456 else if (action_id ==
EActions.REMOVE_QUANTITY)
7457 {
7458 if (IsMagazine())
7459 {
7460 Magazine mag2 = Magazine.Cast(this);
7461 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7462 }
7463 else
7464 {
7466 }
7467 if (m_EM)
7468 {
7469 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7470 }
7471
7472 }
7473
7474 else if (action_id ==
EActions.SET_QUANTITY_0)
7475 {
7477
7478 if (m_EM)
7479 {
7480 m_EM.SetEnergy(0);
7481 }
7482 }
7483
7484 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7485 {
7487
7488 if (m_EM)
7489 {
7490 m_EM.SetEnergy(m_EM.GetEnergyMax());
7491 }
7492 }
7493
7494 else if (action_id ==
EActions.ADD_HEALTH)
7495 {
7496 AddHealth("","",GetMaxHealth("","Health")/5);
7497 }
7498 else if (action_id ==
EActions.REMOVE_HEALTH)
7499 {
7500 AddHealth("","",-GetMaxHealth("","Health")/5);
7501 }
7502 else if (action_id ==
EActions.DESTROY_HEALTH)
7503 {
7504 SetHealth01("","",0);
7505 }
7506 else if (action_id ==
EActions.WATCH_ITEM)
7507 {
7509 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7510 #ifdef DEVELOPER
7511 SetDebugDeveloper_item(this);
7512 #endif
7513 }
7514
7515 else if (action_id ==
EActions.ADD_TEMPERATURE)
7516 {
7517 AddTemperature(20);
7518
7519 }
7520
7521 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7522 {
7523 AddTemperature(-20);
7524
7525 }
7526
7527 else if (action_id ==
EActions.FLIP_FROZEN)
7528 {
7529 SetFrozen(!GetIsFrozen());
7530
7531 }
7532
7533 else if (action_id ==
EActions.ADD_WETNESS)
7534 {
7536
7537 }
7538
7539 else if (action_id ==
EActions.REMOVE_WETNESS)
7540 {
7542
7543 }
7544
7545 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7546 {
7549
7550
7551 }
7552
7553 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7554 {
7557 }
7558
7559 else if (action_id ==
EActions.MAKE_SPECIAL)
7560 {
7561 auto debugParams = DebugSpawnParams.WithPlayer(player);
7562 OnDebugSpawnEx(debugParams);
7563 }
7564
7565 else if (action_id ==
EActions.DELETE)
7566 {
7567 Delete();
7568 }
7569
7570 }
7571
7572
7573 return false;
7574 }
7575
7576
7577
7578
7582
7585
7586
7587
7589 {
7590 return false;
7591 }
7592
7593
7595 {
7596 return true;
7597 }
7598
7599
7601 {
7602 return true;
7603 }
7604
7605
7606
7608 {
7609 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7611 }
7612
7615 {
7616 return null;
7617 }
7618
7620 {
7621 return false;
7622 }
7623
7625 {
7626 return false;
7627 }
7628
7632
7633
7635 {
7636 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7637 return module_repairing.CanRepair(this, item_repair_kit);
7638 }
7639
7640
7641 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7642 {
7643 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7644 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7645 }
7646
7647
7649 {
7650
7651
7652
7653
7654
7655
7656
7657
7658 return 1;
7659 }
7660
7661
7662
7664 {
7666 }
7667
7668
7669
7671 {
7673 }
7674
7675
7684 {
7685 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7686
7687 if (player)
7688 {
7689 player.MessageStatus(text);
7690 }
7691 }
7692
7693
7702 {
7703 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7704
7705 if (player)
7706 {
7707 player.MessageAction(text);
7708 }
7709 }
7710
7711
7720 {
7721 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7722
7723 if (player)
7724 {
7725 player.MessageFriendly(text);
7726 }
7727 }
7728
7729
7738 {
7739 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7740
7741 if (player)
7742 {
7743 player.MessageImportant(text);
7744 }
7745 }
7746
7748 {
7749 return true;
7750 }
7751
7752
7753 override bool KindOf(
string tag)
7754 {
7755 bool found = false;
7756 string item_name = this.
GetType();
7759
7760 int array_size = item_tag_array.Count();
7761 for (int i = 0; i < array_size; i++)
7762 {
7763 if (item_tag_array.Get(i) == tag)
7764 {
7765 found = true;
7766 break;
7767 }
7768 }
7769 return found;
7770 }
7771
7772
7774 {
7775
7776 super.OnRPC(sender, rpc_type,ctx);
7777
7778
7779 switch (rpc_type)
7780 {
7781 #ifndef SERVER
7782 case ERPCs.RPC_SOUND_LOCK_ATTACH:
7783 Param2<bool, string> p = new Param2<bool, string>(false, "");
7784
7786 return;
7787
7788 bool play = p.param1;
7789 string soundSet = p.param2;
7790
7791 if (play)
7792 {
7794 {
7796 {
7798 }
7799 }
7800 else
7801 {
7803 }
7804 }
7805 else
7806 {
7808 }
7809
7810 break;
7811 #endif
7812
7813 }
7814
7816 {
7818 }
7819 }
7820
7821
7822
7823
7825 {
7826 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
7827 return plugin.GetID(
name);
7828 }
7829
7831 {
7832 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
7833 return plugin.GetName(id);
7834 }
7835
7838 {
7839
7840
7841 int varFlags;
7842 if (!ctx.
Read(varFlags))
7843 return;
7844
7845 if (varFlags & ItemVariableFlags.FLOAT)
7846 {
7848 }
7849 }
7850
7852 {
7853
7854 super.SerializeNumericalVars(floats_out);
7855
7856
7857
7859 {
7861 }
7862
7864 {
7866 }
7867
7869 {
7871 }
7872
7874 {
7879 }
7880
7882 {
7884 }
7885 }
7886
7888 {
7889
7890 super.DeSerializeNumericalVars(floats);
7891
7892
7893 int index = 0;
7894 int mask = Math.Round(floats.Get(index));
7895
7896 index++;
7897
7899 {
7901 {
7903 }
7904 else
7905 {
7906 float quantity = floats.Get(index);
7908 }
7909 index++;
7910 }
7911
7913 {
7914 float wet = floats.Get(index);
7916 index++;
7917 }
7918
7920 {
7921 int liquidtype = Math.Round(floats.Get(index));
7923 index++;
7924 }
7925
7927 {
7929 index++;
7931 index++;
7933 index++;
7935 index++;
7936 }
7937
7939 {
7940 int cleanness = Math.Round(floats.Get(index));
7942 index++;
7943 }
7944 }
7945
7947 {
7948 super.WriteVarsToCTX(ctx);
7949
7950
7952 {
7954 }
7955
7957 {
7959 }
7960
7962 {
7964 }
7965
7967 {
7968 int r,g,b,a;
7974 }
7975
7977 {
7979 }
7980 }
7981
7983 {
7984 if (!super.ReadVarsFromCTX(ctx,version))
7985 return false;
7986
7987 int intValue;
7988 float value;
7989
7990 if (version < 140)
7991 {
7992 if (!ctx.
Read(intValue))
7993 return false;
7994
7995 m_VariablesMask = intValue;
7996 }
7997
7999 {
8000 if (!ctx.
Read(value))
8001 return false;
8002
8004 {
8006 }
8007 else
8008 {
8010 }
8011 }
8012
8013 if (version < 140)
8014 {
8016 {
8017 if (!ctx.
Read(value))
8018 return false;
8019 SetTemperatureDirect(value);
8020 }
8021 }
8022
8024 {
8025 if (!ctx.
Read(value))
8026 return false;
8028 }
8029
8031 {
8032 if (!ctx.
Read(intValue))
8033 return false;
8035 }
8036
8038 {
8039 int r,g,b,a;
8041 return false;
8043 return false;
8045 return false;
8047 return false;
8048
8050 }
8051
8053 {
8054 if (!ctx.
Read(intValue))
8055 return false;
8057 }
8058
8059 if (version >= 138 && version < 140)
8060 {
8062 {
8063 if (!ctx.
Read(intValue))
8064 return false;
8065 SetFrozen(intValue);
8066 }
8067 }
8068
8069 return true;
8070 }
8071
8072
8074 {
8077 {
8079 }
8080
8081 if (!super.OnStoreLoad(ctx, version))
8082 {
8084 return false;
8085 }
8086
8087 if (version >= 114)
8088 {
8089 bool hasQuickBarIndexSaved;
8090
8091 if (!ctx.
Read(hasQuickBarIndexSaved))
8092 {
8094 return false;
8095 }
8096
8097 if (hasQuickBarIndexSaved)
8098 {
8099 int itmQBIndex;
8100
8101
8102 if (!ctx.
Read(itmQBIndex))
8103 {
8105 return false;
8106 }
8107
8108 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8109 if (itmQBIndex != -1 && parentPlayer)
8110 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8111 }
8112 }
8113 else
8114 {
8115
8116 PlayerBase player;
8117 int itemQBIndex;
8118 if (version ==
int.
MAX)
8119 {
8120 if (!ctx.
Read(itemQBIndex))
8121 {
8123 return false;
8124 }
8125 }
8126 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8127 {
8128
8129 if (!ctx.
Read(itemQBIndex))
8130 {
8132 return false;
8133 }
8134 if (itemQBIndex != -1 && player)
8135 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8136 }
8137 }
8138
8139 if (version < 140)
8140 {
8141
8142 if (!LoadVariables(ctx, version))
8143 {
8145 return false;
8146 }
8147 }
8148
8149
8151 {
8153 return false;
8154 }
8155 if (version >= 132)
8156 {
8158 if (raib)
8159 {
8161 {
8163 return false;
8164 }
8165 }
8166 }
8167
8169 return true;
8170 }
8171
8172
8173
8175 {
8176 super.OnStoreSave(ctx);
8177
8178 PlayerBase player;
8179 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8180 {
8182
8183 int itemQBIndex = -1;
8184 itemQBIndex = player.FindQuickBarEntityIndex(this);
8185 ctx.
Write(itemQBIndex);
8186 }
8187 else
8188 {
8190 }
8191
8193
8195 if (raib)
8196 {
8198 }
8199 }
8200
8201
8203 {
8204 super.AfterStoreLoad();
8205
8207 {
8209 }
8210
8212 {
8215 }
8216 }
8217
8219 {
8220 super.EEOnAfterLoad();
8221
8223 {
8225 }
8226
8229 }
8230
8232 {
8233 return false;
8234 }
8235
8236
8237
8239 {
8241 {
8242 #ifdef PLATFORM_CONSOLE
8243
8245 {
8247 if (menu)
8248 {
8250 }
8251 }
8252 #endif
8253 }
8254
8256 {
8259 }
8260
8262 {
8263 SetWeightDirty();
8265 }
8267 {
8270 }
8271
8273 {
8276 }
8278 {
8281 }
8282
8283 super.OnVariablesSynchronized();
8284 }
8285
8286
8287
8289 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8290 {
8291 if (!IsServerCheck(allow_client))
8292 return false;
8293
8295 return false;
8296
8299
8300 if (value <= (min + 0.001))
8301 value = min;
8302
8303 if (value == min)
8304 {
8305 if (destroy_config)
8306 {
8307 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8308 if (dstr)
8309 {
8311 this.Delete();
8312 return true;
8313 }
8314 }
8315 else if (destroy_forced)
8316 {
8318 this.Delete();
8319 return true;
8320 }
8321
8323 }
8324
8327
8329 {
8331
8332 if (delta)
8334 }
8335
8337
8338 return false;
8339 }
8340
8341
8343 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8344 {
8346 }
8347
8349 {
8352 }
8353
8355 {
8358 }
8359
8362 {
8363 float value_clamped = Math.Clamp(value, 0, 1);
8365 SetQuantity(result, destroy_config, destroy_forced);
8366 }
8367
8368
8371 {
8373 }
8374
8376 {
8378 }
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8390 {
8391 int slot = -1;
8392 if (GetInventory())
8393 {
8394 InventoryLocation il = new InventoryLocation;
8395 GetInventory().GetCurrentInventoryLocation(il);
8397 }
8398
8400 }
8401
8403 {
8404 float quantity_max = 0;
8405
8407 {
8408 if (attSlotID != -1)
8409 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8410
8411 if (quantity_max <= 0)
8413 }
8414
8415 if (quantity_max <= 0)
8417
8418 return quantity_max;
8419 }
8420
8422 {
8424 }
8425
8427 {
8429 }
8430
8431
8433 {
8435 }
8436
8438 {
8440 }
8441
8443 {
8445 }
8446
8447
8449 {
8450
8451 float weightEx = GetWeightEx();
8452 float special = GetInventoryAndCargoWeight();
8453 return weightEx - special;
8454 }
8455
8456
8458 {
8460 }
8461
8463 {
8465 {
8466 #ifdef DEVELOPER
8467 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8468 {
8469 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8471 }
8472 #endif
8473
8475 }
8476 else if (HasEnergyManager())
8477 {
8478 #ifdef DEVELOPER
8479 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8480 {
8481 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8482 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8483 }
8484 #endif
8485 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8486 }
8487 else
8488 {
8489 #ifdef DEVELOPER
8490 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8491 {
8492 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8493 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8494 }
8495 #endif
8496 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8497 }
8498 }
8499
8502 {
8503 int item_count = 0;
8505
8506 if (GetInventory().GetCargo() != NULL)
8507 {
8508 item_count = GetInventory().GetCargo().GetItemCount();
8509 }
8510
8511 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8512 {
8513 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8514 if (item)
8515 item_count += item.GetNumberOfItems();
8516 }
8517 return item_count;
8518 }
8519
8522 {
8523 float weight = 0;
8524 float wetness = 1;
8525 if (include_wetness)
8528 {
8529 weight = wetness * m_ConfigWeight;
8530 }
8532 {
8533 weight = 1;
8534 }
8535 return weight;
8536 }
8537
8538
8539
8541 {
8542 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8543 {
8544 GameInventory inv = GetInventory();
8545 array<EntityAI> items = new array<EntityAI>;
8547 for (int i = 0; i < items.Count(); i++)
8548 {
8550 if (item)
8551 {
8553 }
8554 }
8555 }
8556 }
8557
8558
8559
8560
8562 {
8563 float energy = 0;
8564 if (HasEnergyManager())
8565 {
8566 energy = GetCompEM().GetEnergy();
8567 }
8568 return energy;
8569 }
8570
8571
8573 {
8574 super.OnEnergyConsumed();
8575
8577 }
8578
8580 {
8581 super.OnEnergyAdded();
8582
8584 }
8585
8586
8588 {
8589 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8590 {
8592 {
8593 float energy_0to1 = GetCompEM().GetEnergy0To1();
8595 }
8596 }
8597 }
8598
8599
8601 {
8602 return ConfigGetFloat("heatIsolation");
8603 }
8604
8606 {
8608 }
8609
8611 {
8612 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8613 if (
GetGame().ConfigIsExisting(paramPath))
8615
8616 return 0.0;
8617 }
8618
8620 {
8621 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8622 if (
GetGame().ConfigIsExisting(paramPath))
8624
8625 return 0.0;
8626 }
8627
8628 override void SetWet(
float value,
bool allow_client =
false)
8629 {
8630 if (!IsServerCheck(allow_client))
8631 return;
8632
8635
8637
8638 m_VarWet = Math.Clamp(value, min, max);
8639
8641 {
8644 }
8645 }
8646
8647 override void AddWet(
float value)
8648 {
8650 }
8651
8653 {
8655 }
8656
8658 {
8660 }
8661
8663 {
8665 }
8666
8668 {
8670 }
8671
8673 {
8675 }
8676
8678 {
8681 if (newLevel != oldLevel)
8682 {
8684 }
8685 }
8686
8688 {
8689 SetWeightDirty();
8690 }
8691
8693 {
8694 return GetWetLevelInternal(
m_VarWet);
8695 }
8696
8697
8698
8700 {
8702 }
8703
8705 {
8707 }
8708
8710 {
8712 }
8713
8715 {
8717 }
8718
8719
8720
8722 {
8723 if (ConfigIsExisting("itemModelLength"))
8724 {
8725 return ConfigGetFloat("itemModelLength");
8726 }
8727 return 0;
8728 }
8729
8731 {
8732 if (ConfigIsExisting("itemAttachOffset"))
8733 {
8734 return ConfigGetFloat("itemAttachOffset");
8735 }
8736 return 0;
8737 }
8738
8739 override void SetCleanness(
int value,
bool allow_client =
false)
8740 {
8741 if (!IsServerCheck(allow_client))
8742 return;
8743
8745
8747
8750 }
8751
8753 {
8755 }
8756
8758 {
8759 return true;
8760 }
8761
8762
8763
8764
8766 {
8768 }
8769
8771 {
8773 }
8774
8775
8776
8777
8778 override void SetColor(
int r,
int g,
int b,
int a)
8779 {
8785 }
8787 override void GetColor(out
int r,out
int g,out
int b,out
int a)
8788 {
8793 }
8794
8796 {
8798 }
8799
8802 {
8803 int r,g,b,a;
8805 r = r/255;
8806 g = g/255;
8807 b = b/255;
8808 a = a/255;
8809 return MiscGameplayFunctions.GetColorString(r, g, b, a);
8810 }
8811
8812
8813
8814 override void SetLiquidType(
int value,
bool allow_client =
false)
8815 {
8816 if (!IsServerCheck(allow_client))
8817 return;
8818
8823 }
8824
8826 {
8827 return ConfigGetInt("varLiquidTypeInit");
8828 }
8829
8831 {
8833 }
8834
8836 {
8838 SetFrozen(false);
8839 }
8840
8843 {
8844 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
8845 }
8846
8847
8850 {
8851 PlayerBase nplayer;
8852 if (PlayerBase.CastTo(nplayer, player))
8853 {
8855
8856 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
8857 }
8858 }
8859
8860
8863 {
8864 PlayerBase nplayer;
8865 if (PlayerBase.CastTo(nplayer,player))
8866 {
8867
8868 nplayer.SetEnableQuickBarEntityShortcut(this,false);
8869
8870 }
8871
8872
8873 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
8874
8875
8876 if (HasEnergyManager())
8877 {
8878 GetCompEM().UpdatePlugState();
8879 }
8880 }
8881
8882
8884 {
8885 super.OnPlacementStarted(player);
8886
8888 }
8889
8890 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
8891 {
8893 {
8894 m_AdminLog.OnPlacementComplete(player,
this);
8895 }
8896
8897 super.OnPlacementComplete(player, position, orientation);
8898 }
8899
8900
8901
8902
8903
8905 {
8907 {
8908 return true;
8909 }
8910 else
8911 {
8912 return false;
8913 }
8914 }
8915
8916
8918 {
8920 {
8922 }
8923 }
8924
8925
8927 {
8929 }
8930
8932 {
8934 }
8935
8936 override void InsertAgent(
int agent,
float count = 1)
8937 {
8938 if (count < 1)
8939 return;
8940
8942 }
8943
8946 {
8948 }
8949
8950
8952 {
8954 }
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
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
8998 {
9000 return false;
9001 return true;
9002 }
9003
9005 {
9006
9008 }
9009
9010
9013 {
9014 super.CheckForRoofLimited(timeTresholdMS);
9015
9017 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9018 {
9019 m_PreviousRoofTestTime = time;
9020 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9021 }
9022 }
9023
9024
9026 {
9028 {
9029 return 0;
9030 }
9031
9032 if (GetInventory().GetAttachmentSlotsCount() != 0)
9033 {
9034 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9035 if (filter)
9036 return filter.GetProtectionLevel(type, false, system);
9037 else
9038 return 0;
9039 }
9040
9041 string subclassPath, entryName;
9042
9043 switch (type)
9044 {
9046 entryName = "biological";
9047 break;
9049 entryName = "chemical";
9050 break;
9051 default:
9052 entryName = "biological";
9053 break;
9054 }
9055
9056 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9057
9059 }
9060
9061
9062
9065 {
9066 if (!IsMagazine())
9068
9070 }
9071
9072
9073
9074
9075
9080 {
9081 return true;
9082 }
9083
9085 {
9087 }
9088
9089
9090
9091
9092
9094 {
9095 if (parent)
9096 {
9097 if (parent.IsInherited(DayZInfected))
9098 return true;
9099
9100 if (!parent.IsRuined())
9101 return true;
9102 }
9103
9104 return true;
9105 }
9106
9108 {
9109 if (!super.CanPutAsAttachment(parent))
9110 {
9111 return false;
9112 }
9113
9114 if (!IsRuined() && !parent.IsRuined())
9115 {
9116 return true;
9117 }
9118
9119 return false;
9120 }
9121
9123 {
9124
9125
9126
9127
9128 return super.CanReceiveItemIntoCargo(item);
9129 }
9130
9132 {
9133
9134
9135
9136
9137 GameInventory attachmentInv = attachment.GetInventory();
9139 {
9140 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9141 return false;
9142 }
9143
9144 InventoryLocation loc = new InventoryLocation();
9145 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9146 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9147 return false;
9148
9149 return super.CanReceiveAttachment(attachment, slotId);
9150 }
9151
9153 {
9154 if (!super.CanReleaseAttachment(attachment))
9155 return false;
9156
9157 return GetInventory().AreChildrenAccessible();
9158 }
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9181 {
9182 int id = muzzle_owner.GetMuzzleID();
9183 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9184
9185 if (WPOF_array)
9186 {
9187 for (int i = 0; i < WPOF_array.Count(); i++)
9188 {
9189 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9190
9191 if (WPOF)
9192 {
9193 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9194 }
9195 }
9196 }
9197 }
9198
9199
9201 {
9202 int id = muzzle_owner.GetMuzzleID();
9204
9205 if (WPOBE_array)
9206 {
9207 for (int i = 0; i < WPOBE_array.Count(); i++)
9208 {
9209 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9210
9211 if (WPOBE)
9212 {
9213 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9214 }
9215 }
9216 }
9217 }
9218
9219
9221 {
9222 int id = muzzle_owner.GetMuzzleID();
9223 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9224
9225 if (WPOOH_array)
9226 {
9227 for (int i = 0; i < WPOOH_array.Count(); i++)
9228 {
9229 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9230
9231 if (WPOOH)
9232 {
9233 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9234 }
9235 }
9236 }
9237 }
9238
9239
9241 {
9242 int id = muzzle_owner.GetMuzzleID();
9243 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9244
9245 if (WPOOH_array)
9246 {
9247 for (int i = 0; i < WPOOH_array.Count(); i++)
9248 {
9249 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9250
9251 if (WPOOH)
9252 {
9253 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9254 }
9255 }
9256 }
9257 }
9258
9259
9261 {
9262 int id = muzzle_owner.GetMuzzleID();
9263 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9264
9265 if (WPOOH_array)
9266 {
9267 for (int i = 0; i < WPOOH_array.Count(); i++)
9268 {
9269 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9270
9271 if (WPOOH)
9272 {
9273 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9274 }
9275 }
9276 }
9277 }
9278
9279
9280
9282 {
9284 {
9285 return true;
9286 }
9287
9288 return false;
9289 }
9290
9292 {
9294 {
9295 return true;
9296 }
9297
9298 return false;
9299 }
9300
9302 {
9304 {
9305 return true;
9306 }
9307
9308 return false;
9309 }
9310
9312 {
9313 return false;
9314 }
9315
9318 {
9319 return UATimeSpent.DEFAULT_DEPLOY;
9320 }
9321
9322
9323
9324
9326 {
9328 SetSynchDirty();
9329 }
9330
9332 {
9334 }
9335
9336
9338 {
9339 return false;
9340 }
9341
9344 {
9345 string att_type = "None";
9346
9347 if (ConfigIsExisting("soundAttType"))
9348 {
9349 att_type = ConfigGetString("soundAttType");
9350 }
9351
9353 }
9354
9356 {
9358 }
9359
9360
9361
9362
9363
9367
9369 {
9372
9374 }
9375
9376
9378 {
9380 return;
9381
9383
9386
9389
9390 SoundParameters params = new SoundParameters();
9394 }
9395
9396
9398 {
9400 return;
9401
9403 SetSynchDirty();
9404
9407 }
9408
9409
9411 {
9413 return;
9414
9416 SetSynchDirty();
9417
9420 }
9421
9423 {
9425 }
9426
9428 {
9430 }
9431
9434 {
9435 if (!
GetGame().IsDedicatedServer())
9436 {
9437 if (ConfigIsExisting("attachSoundSet"))
9438 {
9439 string cfg_path = "";
9440 string soundset = "";
9442
9445 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9446 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9447
9448 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9449 {
9450 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9451 {
9452 if (cfg_slot_array[i] == slot_type)
9453 {
9454 soundset = cfg_soundset_array[i];
9455 break;
9456 }
9457 }
9458 }
9459
9460 if (soundset != "")
9461 {
9462 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9464 }
9465 }
9466 }
9467 }
9468
9470 {
9471
9472 }
9473
9474 void OnApply(PlayerBase player);
9475
9477 {
9478 return 1.0;
9479 };
9480
9482 {
9484 }
9485
9487 {
9489 }
9490
9492
9494 {
9495 SetDynamicPhysicsLifeTime(0.01);
9497 }
9498
9500 {
9501 array<string> zone_names = new array<string>;
9502 GetDamageZones(zone_names);
9503 for (int i = 0; i < zone_names.Count(); i++)
9504 {
9505 SetHealthMax(zone_names.Get(i),"Health");
9506 }
9507 SetHealthMax("","Health");
9508 }
9509
9512 {
9513 float global_health = GetHealth01("","Health");
9514 array<string> zones = new array<string>;
9515 GetDamageZones(zones);
9516
9517 for (int i = 0; i < zones.Count(); i++)
9518 {
9519 SetHealth01(zones.Get(i),"Health",global_health);
9520 }
9521 }
9522
9525 {
9526 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9527 }
9528
9530 {
9531 if (!hasRootAsPlayer)
9532 {
9533 if (refParentIB)
9534 {
9535
9536 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9537 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9538
9539 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9540 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9541
9544 }
9545 else
9546 {
9547
9550 }
9551 }
9552 }
9553
9555 {
9557 {
9558 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9559 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9560 {
9561 float heatPermCoef = 1.0;
9563 while (ent)
9564 {
9565 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9566 ent = ent.GetHierarchyParent();
9567 }
9568
9569 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9570 }
9571 }
9572 }
9573
9575 {
9576
9577 EntityAI parent = GetHierarchyParent();
9578 if (!parent)
9579 {
9580 hasParent = false;
9581 hasRootAsPlayer = false;
9582 }
9583 else
9584 {
9585 hasParent = true;
9586 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9587 refParentIB =
ItemBase.Cast(parent);
9588 }
9589 }
9590
9591 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9592 {
9593
9594 }
9595
9597 {
9598
9599 return false;
9600 }
9601
9603 {
9604
9605
9606 return false;
9607 }
9608
9610 {
9611
9612 return false;
9613 }
9614
9617 {
9618 return !GetIsFrozen() &&
IsOpen();
9619 }
9620
9622 {
9623 bool hasParent = false, hasRootAsPlayer = false;
9625
9626 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9627 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9628
9629 if (wwtu || foodDecay)
9630 {
9634
9635 if (processWetness || processTemperature || processDecay)
9636 {
9638
9639 if (processWetness)
9640 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9641
9642 if (processTemperature)
9644
9645 if (processDecay)
9646 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9647 }
9648 }
9649 }
9650
9653 {
9655 }
9656
9658 {
9661
9662 return super.GetTemperatureFreezeThreshold();
9663 }
9664
9666 {
9669
9670 return super.GetTemperatureThawThreshold();
9671 }
9672
9674 {
9677
9678 return super.GetItemOverheatThreshold();
9679 }
9680
9682 {
9684 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9685
9686 return super.GetTemperatureFreezeTime();
9687 }
9688
9690 {
9692 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9693
9694 return super.GetTemperatureThawTime();
9695 }
9696
9701
9703 {
9704 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
9705 }
9706
9708 {
9709 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
9710 }
9711
9714 {
9716 }
9717
9719 {
9721 }
9722
9724 {
9726 }
9727
9730 {
9731 return null;
9732 }
9733
9736 {
9737 return false;
9738 }
9739
9741 {
9743 {
9746 if (!trg)
9747 {
9749 explosive = this;
9750 }
9751
9752 explosive.PairRemote(trg);
9754
9755 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
9756 trg.SetPersistentPairID(persistentID);
9757 explosive.SetPersistentPairID(persistentID);
9758
9759 return true;
9760 }
9761 return false;
9762 }
9763
9766 {
9767 float ret = 1.0;
9770 ret *= GetHealth01();
9771
9772 return ret;
9773 }
9774
9775 #ifdef DEVELOPER
9776 override void SetDebugItem()
9777 {
9778 super.SetDebugItem();
9779 _itemBase = this;
9780 }
9781
9783 {
9784 string text = super.GetDebugText();
9785
9787 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
9788
9789 return text;
9790 }
9791 #endif
9792
9794 {
9795 return true;
9796 }
9797
9799
9801
9803 {
9806 }
9807
9808
9816
9832}
9833
9835{
9837 if (entity)
9838 {
9839 bool is_item = entity.IsInherited(
ItemBase);
9840 if (is_item && full_quantity)
9841 {
9844 }
9845 }
9846 else
9847 {
9849 return NULL;
9850 }
9851 return entity;
9852}
9853
9855{
9856 if (item)
9857 {
9858 if (health > 0)
9859 item.SetHealth("", "", health);
9860
9861 if (item.CanHaveTemperature())
9862 {
9864 if (item.CanFreeze())
9865 item.SetFrozen(false);
9866 }
9867
9868 if (item.HasEnergyManager())
9869 {
9870 if (quantity >= 0)
9871 {
9872 item.GetCompEM().SetEnergy0To1(quantity);
9873 }
9874 else
9875 {
9877 }
9878 }
9879 else if (item.IsMagazine())
9880 {
9881 Magazine mag = Magazine.Cast(item);
9882 if (quantity >= 0)
9883 {
9884 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
9885 }
9886 else
9887 {
9889 }
9890
9891 }
9892 else
9893 {
9894 if (quantity >= 0)
9895 {
9896 item.SetQuantityNormalized(quantity, false);
9897 }
9898 else
9899 {
9901 }
9902
9903 }
9904 }
9905}
9906
9907#ifdef DEVELOPER
9909#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.