4912{
4914 {
4915 return true;
4916 }
4917};
4918
4919
4920
4922{
4926
4928
4931
4932
4933
4934
4935
4944
4950
4955
4960
4981 protected bool m_IsResultOfSplit
4982
4984
4989
4990
4991
4993
4997
4998
4999
5001
5004
5005
5006
5012
5013
5021
5024
5025
5027
5028
5030
5031
5036
5037
5042
5043
5045
5046
5048 {
5053
5054 if (!
GetGame().IsDedicatedServer())
5055 {
5057 {
5059
5061 {
5063 }
5064 }
5065
5068 }
5069
5070 m_OldLocation = null;
5071
5073 {
5075 }
5076
5077 if (ConfigIsExisting("headSelectionsToHide"))
5078 {
5081 }
5082
5084 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5085 {
5087 }
5088
5090
5091 m_IsResultOfSplit = false;
5092
5094 }
5095
5097 {
5098 super.InitItemVariables();
5099
5105 m_Count = ConfigGetInt(
"count");
5106
5109
5114
5117
5122
5134
5138
5139
5142 if (ConfigIsExisting("canBeSplit"))
5143 {
5146 }
5147
5149 if (ConfigIsExisting("itemBehaviour"))
5151
5152
5155 RegisterNetSyncVariableInt("m_VarLiquidType");
5156 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5157
5158 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5159 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5160 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5161
5162 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5163 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5164 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5165 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5166
5167 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5168 RegisterNetSyncVariableBool("m_IsTakeable");
5169 RegisterNetSyncVariableBool("m_IsHologram");
5170
5173 {
5176 }
5177
5179
5181 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5183
5184 }
5185
5187 {
5189 }
5190
5192 {
5195 {
5200 }
5201 }
5202
5203 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5204 {
5206 {
5209 }
5210
5212 }
5213
5215 {
5221 }
5222
5224
5226 {
5228
5229 if (!action)
5230 {
5231 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5232 return;
5233 }
5234
5236 if (!ai)
5237 {
5239 return;
5240 }
5241
5243 if (!action_array)
5244 {
5245 action_array = new array<ActionBase_Basic>;
5247 }
5248 if (LogManager.IsActionLogEnable())
5249 {
5250 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5251 }
5252
5253 if (action_array.Find(action) != -1)
5254 {
5255 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5256 }
5257 else
5258 {
5259 action_array.Insert(action);
5260 }
5261 }
5262
5264 {
5266 ActionBase action = player.GetActionManager().GetAction(actionName);
5269
5270 if (action_array)
5271 {
5272 action_array.RemoveItem(action);
5273 }
5274 }
5275
5276
5277
5279 {
5280 ActionOverrideData overrideData = new ActionOverrideData();
5284
5286 if (!actionMap)
5287 {
5290 }
5291
5292 actionMap.Insert(this.
Type(), overrideData);
5293
5294 }
5295
5297
5299
5300
5302 {
5305
5308
5309 string config_to_search = "CfgVehicles";
5310 string muzzle_owner_config;
5311
5313 {
5314 if (IsInherited(Weapon))
5315 config_to_search = "CfgWeapons";
5316
5317 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5318
5319 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5320
5322
5323 if (config_OnFire_subclass_count > 0)
5324 {
5325 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5326
5327 for (int i = 0; i < config_OnFire_subclass_count; i++)
5328 {
5329 string particle_class = "";
5331 string config_OnFire_entry = config_OnFire_class + particle_class;
5332 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5333 WPOF_array.Insert(WPOF);
5334 }
5335
5336
5338 }
5339 }
5340
5342 {
5343 config_to_search = "CfgWeapons";
5344 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5345
5346 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5347
5349
5350 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5351 {
5352 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5353
5354 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5355 {
5356 string particle_class2 = "";
5358 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5359 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5360 WPOBE_array.Insert(WPOBE);
5361 }
5362
5363
5365 }
5366 }
5367 }
5368
5369
5371 {
5374
5376 {
5377 string config_to_search = "CfgVehicles";
5378
5379 if (IsInherited(Weapon))
5380 config_to_search = "CfgWeapons";
5381
5382 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5383 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5384
5385 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5386 {
5387
5389
5391 {
5393 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5395 return;
5396 }
5397
5400
5401
5402
5404 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5405
5406 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5407 {
5408 string particle_class = "";
5410 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5412
5413 if (entry_type == CT_CLASS)
5414 {
5415 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5416 WPOOH_array.Insert(WPOF);
5417 }
5418 }
5419
5420
5422 }
5423 }
5424 }
5425
5427 {
5429 }
5430
5432 {
5434 {
5436
5439
5442
5443 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5444 }
5445 }
5446
5448 {
5450 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5451
5453 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5454
5456 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5457
5459 {
5461 }
5462 }
5463
5465 {
5467 }
5468
5470 {
5473 else
5475
5477 {
5480 }
5481 else
5482 {
5485
5488 }
5489
5491 }
5492
5494 {
5496 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5497 }
5498
5500 {
5502 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5504 }
5505
5507 {
5509 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5510 }
5511
5513 {
5516
5517 OverheatingParticle OP = new OverheatingParticle();
5522
5524 }
5525
5527 {
5530
5531 return -1;
5532 }
5533
5535 {
5537 {
5540
5541 for (int i = count; i > 0; --i)
5542 {
5543 int id = i - 1;
5546
5549
5550 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5551 {
5552 if (p)
5553 {
5556 }
5557 }
5558 }
5559 }
5560 }
5561
5563 {
5565 {
5567 {
5568 int id = i - 1;
5570
5571 if (OP)
5572 {
5574
5575 if (p)
5576 {
5578 }
5579
5580 delete OP;
5581 }
5582 }
5583
5586 }
5587 }
5588
5591 {
5592 return 0.0;
5593 }
5594
5595
5597 {
5598 return 250;
5599 }
5600
5602 {
5603 return 0;
5604 }
5605
5608 {
5610 return true;
5611
5612 return false;
5613 }
5614
5617 {
5620
5622 {
5624 }
5625 else
5626 {
5627
5629 }
5630
5632 }
5633
5640 {
5641 return -1;
5642 }
5643
5644
5645
5646
5648 {
5650 {
5652 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
5653
5654 if (r_index >= 0)
5655 {
5656 InventoryLocation r_il = new InventoryLocation;
5657 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
5658
5659 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
5662 {
5663 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
5664 }
5666 {
5667 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
5668 }
5669
5670 }
5671
5672 player.GetHumanInventory().ClearUserReservedLocation(this);
5673 }
5674
5677 }
5678
5679
5680
5681
5683 {
5684 return ItemBase.m_DebugActionsMask;
5685 }
5686
5688 {
5689 return ItemBase.m_DebugActionsMask & mask;
5690 }
5691
5693 {
5694 ItemBase.m_DebugActionsMask = mask;
5695 }
5696
5698 {
5699 ItemBase.m_DebugActionsMask |= mask;
5700 }
5701
5703 {
5704 ItemBase.m_DebugActionsMask &= ~mask;
5705 }
5706
5708 {
5710 {
5712 }
5713 else
5714 {
5716 }
5717 }
5718
5719
5721 {
5722 if (GetEconomyProfile())
5723 {
5724 float q_max = GetEconomyProfile().GetQuantityMax();
5725 if (q_max > 0)
5726 {
5727 float q_min = GetEconomyProfile().GetQuantityMin();
5728 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
5729
5731 {
5732 ComponentEnergyManager comp = GetCompEM();
5734 {
5736 }
5737 }
5739 {
5741
5742 }
5743
5744 }
5745 }
5746 }
5747
5750 {
5751 EntityAI parent = GetHierarchyParent();
5752
5753 if (parent)
5754 {
5755 InventoryLocation inventory_location_to_lock = new InventoryLocation;
5756 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
5757 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
5758 }
5759 }
5760
5763 {
5764 EntityAI parent = GetHierarchyParent();
5765
5766 if (parent)
5767 {
5768 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
5769 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
5770 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
5771 }
5772 }
5773
5775 {
5776
5777
5778
5779
5781
5783 {
5784 if (ScriptInputUserData.CanStoreInputUserData())
5785 {
5786 ScriptInputUserData ctx = new ScriptInputUserData;
5792 ctx.
Write(use_stack_max);
5795
5797 {
5798 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
5799 }
5800 }
5801 }
5802 else if (!
GetGame().IsMultiplayer())
5803 {
5805 }
5806 }
5807
5809 {
5811 }
5812
5814 {
5816 }
5817
5819 {
5821 }
5822
5824 {
5825
5826 return false;
5827 }
5828
5830 {
5831 return false;
5832 }
5833
5837 {
5838 return false;
5839 }
5840
5842 {
5843 return "";
5844 }
5845
5847
5849 {
5850 return false;
5851 }
5852
5854 {
5855 return true;
5856 }
5857
5858
5859
5861 {
5862 return true;
5863 }
5864
5866 {
5867 return true;
5868 }
5869
5871 {
5872 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
5874 }
5875
5877 {
5879 }
5880
5882 {
5884 if (!is_being_placed)
5886 SetSynchDirty();
5887 }
5888
5889
5891
5893 {
5895 }
5896
5898 {
5900 }
5901
5903 {
5904 return 1;
5905 }
5906
5908 {
5909 return false;
5910 }
5911
5913 {
5915 SetSynchDirty();
5916 }
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5953 {
5954 super.OnMovedInsideCargo(container);
5955
5956 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
5957 }
5958
5959 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
5960 {
5961 super.EEItemLocationChanged(oldLoc,newLoc);
5962
5963 PlayerBase new_player = null;
5964 PlayerBase old_player = null;
5965
5966 if (newLoc.GetParent())
5967 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
5968
5969 if (oldLoc.GetParent())
5970 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
5971
5973 {
5974 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
5975
5976 if (r_index >= 0)
5977 {
5978 InventoryLocation r_il = new InventoryLocation;
5979 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
5980
5981 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
5984 {
5985 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
5986 }
5988 {
5989 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
5990 }
5991
5992 }
5993 }
5994
5996 {
5997 if (new_player)
5998 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
5999
6000 if (new_player == old_player)
6001 {
6002
6003 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6004 {
6006 {
6007 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6008 {
6009 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6010 }
6011 }
6012 else
6013 {
6014 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6015 }
6016 }
6017
6018 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6019 {
6020 int type = oldLoc.GetType();
6022 {
6023 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6024 }
6026 {
6027 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6028 }
6029 }
6030 if (!m_OldLocation)
6031 {
6032 m_OldLocation = new InventoryLocation;
6033 }
6034 m_OldLocation.Copy(oldLoc);
6035 }
6036 else
6037 {
6038 if (m_OldLocation)
6039 {
6040 m_OldLocation.Reset();
6041 }
6042 }
6043
6045 }
6046 else
6047 {
6048 if (new_player)
6049 {
6050 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6051 if (res_index >= 0)
6052 {
6053 InventoryLocation il = new InventoryLocation;
6054 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6056 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6059 {
6060 il.
GetParent().GetOnReleaseLock().Invoke(it);
6061 }
6063 {
6065 }
6066
6067 }
6068 }
6070 {
6071
6073 }
6074
6075 if (m_OldLocation)
6076 {
6077 m_OldLocation.Reset();
6078 }
6079 }
6080 }
6081
6082 override void EOnContact(IEntity other, Contact extra)
6083 {
6085 {
6086 int liquidType = -1;
6088 if (impactSpeed > 0.0)
6089 {
6091 #ifndef SERVER
6093 #else
6095 SetSynchDirty();
6096 #endif
6098 }
6099 }
6100
6101 #ifdef SERVER
6102 if (GetCompEM() && GetCompEM().IsPlugged())
6103 {
6104 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6105 GetCompEM().UnplugThis();
6106 }
6107 #endif
6108 }
6109
6111
6113 {
6115 }
6116
6118 {
6119
6120 }
6121
6123 {
6124 super.OnItemLocationChanged(old_owner, new_owner);
6125
6126 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6127 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6128
6129 if (!relatedPlayer && playerNew)
6130 relatedPlayer = playerNew;
6131
6132 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6133 {
6135 if (actionMgr)
6136 {
6137 ActionBase currentAction = actionMgr.GetRunningAction();
6138 if (currentAction)
6140 }
6141 }
6142
6143 Man ownerPlayerOld = null;
6144 Man ownerPlayerNew = null;
6145
6146 if (old_owner)
6147 {
6148 if (old_owner.
IsMan())
6149 {
6150 ownerPlayerOld = Man.Cast(old_owner);
6151 }
6152 else
6153 {
6154 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6155 }
6156 }
6157 else
6158 {
6160 {
6162
6163 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6164 {
6165 GetCompEM().UnplugThis();
6166 }
6167 }
6168 }
6169
6170 if (new_owner)
6171 {
6172 if (new_owner.
IsMan())
6173 {
6174 ownerPlayerNew = Man.Cast(new_owner);
6175 }
6176 else
6177 {
6178 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6179 }
6180 }
6181
6182 if (ownerPlayerOld != ownerPlayerNew)
6183 {
6184 if (ownerPlayerOld)
6185 {
6186 array<EntityAI> subItemsExit = new array<EntityAI>;
6188 for (int i = 0; i < subItemsExit.Count(); i++)
6189 {
6192 }
6193 }
6194
6195 if (ownerPlayerNew)
6196 {
6197 array<EntityAI> subItemsEnter = new array<EntityAI>;
6199 for (int j = 0; j < subItemsEnter.Count(); j++)
6200 {
6203 }
6204 }
6205 }
6206 else if (ownerPlayerNew != null)
6207 {
6208 PlayerBase nplayer;
6209 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6210 {
6211 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6213 for (int k = 0; k < subItemsUpdate.Count(); k++)
6214 {
6216 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6217 }
6218 }
6219 }
6220
6221 if (old_owner)
6222 old_owner.OnChildItemRemoved(this);
6223 if (new_owner)
6224 new_owner.OnChildItemReceived(this);
6225 }
6226
6227
6229 {
6230 super.EEDelete(parent);
6231 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6232 if (player)
6233 {
6235
6236 if (player.IsAlive())
6237 {
6238 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6239 if (r_index >= 0)
6240 {
6241 InventoryLocation r_il = new InventoryLocation;
6242 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6243
6244 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6247 {
6248 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6249 }
6251 {
6252 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6253 }
6254
6255 }
6256
6257 player.RemoveQuickBarEntityShortcut(this);
6258 }
6259 }
6260 }
6261
6263 {
6264 super.EEKilled(killer);
6265
6268 {
6269 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6270 {
6271 if (IsMagazine())
6272 {
6273 if (Magazine.Cast(this).GetAmmoCount() > 0)
6274 {
6276 }
6277 }
6278 else
6279 {
6281 }
6282 }
6283 }
6284 }
6285
6287 {
6288 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6289
6290 super.OnWasAttached(parent, slot_id);
6291
6294
6296 }
6297
6299 {
6300 super.OnWasDetached(parent, slot_id);
6301
6304 }
6305
6307 {
6308 int idx;
6311
6312 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6313 if (inventory_slots.Count() < 1)
6314 {
6315 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6316 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6317 }
6318 else
6319 {
6320 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6321 }
6322
6323 idx = inventory_slots.Find(slot);
6324 if (idx < 0)
6325 return "";
6326
6327 return attach_types.Get(idx);
6328 }
6329
6331 {
6332 int idx = -1;
6333 string slot;
6334
6337
6338 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6339 if (inventory_slots.Count() < 1)
6340 {
6341 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6342 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6343 }
6344 else
6345 {
6346 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6347 if (detach_types.Count() < 1)
6348 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6349 }
6350
6351 for (int i = 0; i < inventory_slots.Count(); i++)
6352 {
6353 slot = inventory_slots.Get(i);
6354 }
6355
6356 if (slot != "")
6357 {
6358 if (detach_types.Count() == 1)
6359 idx = 0;
6360 else
6361 idx = inventory_slots.Find(slot);
6362 }
6363 if (idx < 0)
6364 return "";
6365
6366 return detach_types.Get(idx);
6367 }
6368
6370 {
6371
6373
6374
6375 float min_time = 1;
6376 float max_time = 3;
6377 float delay = Math.RandomFloat(min_time, max_time);
6378
6379 explode_timer.Run(delay, this, "DoAmmoExplosion");
6380 }
6381
6383 {
6384 Magazine magazine = Magazine.Cast(this);
6385 int pop_sounds_count = 6;
6386 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6387
6388
6389 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6390 string sound_name = pop_sounds[ sound_idx ];
6392
6393
6394 magazine.ServerAddAmmoCount(-1);
6395
6396
6397 float min_temp_to_explode = 100;
6398
6399 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6400 {
6402 }
6403 }
6404
6405
6406 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6407 {
6408 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6409
6410 const int CHANCE_DAMAGE_CARGO = 4;
6411 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6412 const int CHANCE_DAMAGE_NOTHING = 2;
6413
6415 {
6416 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6417 int chances;
6418 int rnd;
6419
6420 if (GetInventory().GetCargo())
6421 {
6422 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6423 rnd = Math.RandomInt(0,chances);
6424
6425 if (rnd < CHANCE_DAMAGE_CARGO)
6426 {
6428 }
6429 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6430 {
6432 }
6433 }
6434 else
6435 {
6436 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6437 rnd = Math.RandomInt(0,chances);
6438
6439 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6440 {
6442 }
6443 }
6444 }
6445 }
6446
6448 {
6449 if (GetInventory().GetCargo())
6450 {
6451 int item_count = GetInventory().GetCargo().GetItemCount();
6452 if (item_count > 0)
6453 {
6454 int random_pick = Math.RandomInt(0, item_count);
6456 if (!item.IsExplosive())
6457 {
6458 item.AddHealth("","",damage);
6459 return true;
6460 }
6461 }
6462 }
6463 return false;
6464 }
6465
6467 {
6468 int attachment_count = GetInventory().AttachmentCount();
6469 if (attachment_count > 0)
6470 {
6471 int random_pick = Math.RandomInt(0, attachment_count);
6472 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6473 if (!attachment.IsExplosive())
6474 {
6475 attachment.AddHealth("","",damage);
6476 return true;
6477 }
6478 }
6479 return false;
6480 }
6481
6483 {
6485 }
6486
6488 {
6490 return GetInventory().CanRemoveEntity();
6491
6492 return false;
6493 }
6494
6496 {
6498 return;
6499
6501 {
6502 if (ScriptInputUserData.CanStoreInputUserData())
6503 {
6504 ScriptInputUserData ctx = new ScriptInputUserData;
6509 ctx.
Write(destination_entity);
6513 }
6514 }
6515 else if (!
GetGame().IsMultiplayer())
6516 {
6518 }
6519 }
6520
6522 {
6524 return;
6525
6526 float split_quantity_new;
6530 InventoryLocation loc = new InventoryLocation;
6531
6532 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6533 {
6535 split_quantity_new = stack_max;
6536 else
6538
6539 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6540 if (new_item)
6541 {
6542 new_item.SetResultOfSplit(true);
6543 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6545 new_item.SetQuantity(split_quantity_new);
6546 }
6547 }
6548 else if (destination_entity && slot_id == -1)
6549 {
6550 if (quantity > stack_max)
6551 split_quantity_new = stack_max;
6552 else
6553 split_quantity_new = quantity;
6554
6556 {
6559 }
6560
6561 if (new_item)
6562 {
6563 new_item.SetResultOfSplit(true);
6564 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6566 new_item.SetQuantity(split_quantity_new);
6567 }
6568 }
6569 else
6570 {
6571 if (stack_max != 0)
6572 {
6574 {
6576 }
6577
6578 if (split_quantity_new == 0)
6579 {
6580 if (!
GetGame().IsMultiplayer())
6581 player.PhysicalPredictiveDropItem(this);
6582 else
6583 player.ServerDropEntity(this);
6584 return;
6585 }
6586
6588
6589 if (new_item)
6590 {
6591 new_item.SetResultOfSplit(true);
6592 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6594 new_item.SetQuantity(stack_max);
6595 new_item.PlaceOnSurface();
6596 }
6597 }
6598 }
6599 }
6600
6602 {
6604 return;
6605
6606 float split_quantity_new;
6610 InventoryLocation loc = new InventoryLocation;
6611
6612 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6613 {
6615 split_quantity_new = stack_max;
6616 else
6618
6619 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6620 if (new_item)
6621 {
6622 new_item.SetResultOfSplit(true);
6623 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6625 new_item.SetQuantity(split_quantity_new);
6626 }
6627 }
6628 else if (destination_entity && slot_id == -1)
6629 {
6630 if (quantity > stack_max)
6631 split_quantity_new = stack_max;
6632 else
6633 split_quantity_new = quantity;
6634
6636 {
6639 }
6640
6641 if (new_item)
6642 {
6643 new_item.SetResultOfSplit(true);
6644 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6646 new_item.SetQuantity(split_quantity_new);
6647 }
6648 }
6649 else
6650 {
6651 if (stack_max != 0)
6652 {
6654 {
6656 }
6657
6659
6660 if (new_item)
6661 {
6662 new_item.SetResultOfSplit(true);
6663 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6665 new_item.SetQuantity(stack_max);
6666 new_item.PlaceOnSurface();
6667 }
6668 }
6669 }
6670 }
6671
6673 {
6675 return;
6676
6678 {
6679 if (ScriptInputUserData.CanStoreInputUserData())
6680 {
6681 ScriptInputUserData ctx = new ScriptInputUserData;
6686 dst.WriteToContext(ctx);
6688 }
6689 }
6690 else if (!
GetGame().IsMultiplayer())
6691 {
6693 }
6694 }
6695
6697 {
6699 return;
6700
6702 {
6703 if (ScriptInputUserData.CanStoreInputUserData())
6704 {
6705 ScriptInputUserData ctx = new ScriptInputUserData;
6710 ctx.
Write(destination_entity);
6716 }
6717 }
6718 else if (!
GetGame().IsMultiplayer())
6719 {
6721 }
6722 }
6723
6725 {
6727 }
6728
6730 {
6732 return this;
6733
6735 float split_quantity_new;
6737 if (dst.IsValid())
6738 {
6739 int slot_id = dst.GetSlot();
6741
6742 if (quantity > stack_max)
6743 split_quantity_new = stack_max;
6744 else
6745 split_quantity_new = quantity;
6746
6748
6749 if (new_item)
6750 {
6751 new_item.SetResultOfSplit(true);
6752 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6755 }
6756
6757 return new_item;
6758 }
6759
6760 return null;
6761 }
6762
6764 {
6766 return;
6767
6769 float split_quantity_new;
6771 if (destination_entity)
6772 {
6774 if (quantity > stackable)
6775 split_quantity_new = stackable;
6776 else
6777 split_quantity_new = quantity;
6778
6779 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
6780 if (new_item)
6781 {
6782 new_item.SetResultOfSplit(true);
6783 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6785 new_item.SetQuantity(split_quantity_new);
6786 }
6787 }
6788 }
6789
6791 {
6793 return;
6794
6796 {
6797 if (ScriptInputUserData.CanStoreInputUserData())
6798 {
6799 ScriptInputUserData ctx = new ScriptInputUserData;
6804 ItemBase destination_entity =
this;
6805 ctx.
Write(destination_entity);
6809 }
6810 }
6811 else if (!
GetGame().IsMultiplayer())
6812 {
6814 }
6815 }
6816
6818 {
6820 return;
6821
6823 float split_quantity_new;
6825 if (player)
6826 {
6828 if (quantity > stackable)
6829 split_quantity_new = stackable;
6830 else
6831 split_quantity_new = quantity;
6832
6833 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
6834 new_item =
ItemBase.Cast(in_hands);
6835 if (new_item)
6836 {
6837 new_item.SetResultOfSplit(true);
6838 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6840 new_item.SetQuantity(split_quantity_new);
6841 }
6842 }
6843 }
6844
6846 {
6848 return;
6849
6851 float split_quantity_new = Math.Floor(quantity * 0.5);
6852
6854
6855 if (new_item)
6856 {
6857 if (new_item.GetQuantityMax() < split_quantity_new)
6858 {
6859 split_quantity_new = new_item.GetQuantityMax();
6860 }
6861
6862 new_item.SetResultOfSplit(true);
6863 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6864
6866 {
6869 }
6870 else
6871 {
6874 }
6875 }
6876 }
6877
6879 {
6881 return;
6882
6884 float split_quantity_new = Math.Floor(quantity / 2);
6885
6886 InventoryLocation invloc = new InventoryLocation;
6888
6890 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
6891
6892 if (new_item)
6893 {
6894 if (new_item.GetQuantityMax() < split_quantity_new)
6895 {
6896 split_quantity_new = new_item.GetQuantityMax();
6897 }
6899 {
6902 }
6903 else
6904 {
6907 }
6908 }
6909 }
6910
6913 {
6914 SetWeightDirty();
6916
6917 if (parent)
6918 parent.OnAttachmentQuantityChangedEx(this, delta);
6919
6921 {
6923 {
6925 }
6927 {
6928 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
6930 }
6931 }
6932
6933 }
6934
6937 {
6938
6939 }
6940
6943 {
6945 }
6946
6948 {
6949 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
6950
6952 {
6953 if (newLevel == GameConstants.STATE_RUINED)
6954 {
6956 EntityAI parent = GetHierarchyParent();
6957 if (parent && parent.IsFireplace())
6958 {
6959 CargoBase cargo = GetInventory().GetCargo();
6960 if (cargo)
6961 {
6963 {
6965 }
6966 }
6967 }
6968 }
6969
6971 {
6972
6974 return;
6975 }
6976
6977 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
6978 {
6980 }
6981 }
6982 }
6983
6984
6986 {
6987 super.OnRightClick();
6988
6990 {
6992 {
6993 if (ScriptInputUserData.CanStoreInputUserData())
6994 {
6995 vector m4[4];
6997
6998 EntityAI root = GetHierarchyRoot();
6999
7000 InventoryLocation dst = new InventoryLocation;
7002 {
7003 if (root)
7004 {
7005 root.GetTransform(m4);
7007 }
7008 else
7009 GetInventory().GetCurrentInventoryLocation(dst);
7010 }
7011 else
7012 {
7014
7015
7016 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7017 {
7018 if (root)
7019 {
7020 root.GetTransform(m4);
7022 }
7023 else
7024 GetInventory().GetCurrentInventoryLocation(dst);
7025 }
7026 else
7027 {
7028 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7029 }
7030 }
7031
7032 ScriptInputUserData ctx = new ScriptInputUserData;
7040 }
7041 }
7042 else if (!
GetGame().IsMultiplayer())
7043 {
7045 }
7046 }
7047 }
7048
7049 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7050 {
7051
7052 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7053 return false;
7054
7055 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7056 return false;
7057
7058
7060 return false;
7061
7062
7063 Magazine mag = Magazine.Cast(this);
7064 if (mag)
7065 {
7066 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7067 return false;
7068
7069 if (stack_max_limit)
7070 {
7071 Magazine other_mag = Magazine.Cast(other_item);
7072 if (other_item)
7073 {
7074 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7075 return false;
7076 }
7077
7078 }
7079 }
7080 else
7081 {
7082
7084 return false;
7085
7087 return false;
7088 }
7089
7090 PlayerBase player = null;
7091 if (CastTo(player, GetHierarchyRootPlayer()))
7092 {
7093 if (player.GetInventory().HasAttachment(this))
7094 return false;
7095
7096 if (player.IsItemsToDelete())
7097 return false;
7098 }
7099
7100 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7101 return false;
7102
7103 int slotID;
7105 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7106 return false;
7107
7108 return true;
7109 }
7110
7112 {
7114 }
7115
7117 {
7118 return m_IsResultOfSplit;
7119 }
7120
7122 {
7123 m_IsResultOfSplit = value;
7124 }
7125
7127 {
7129 }
7130
7132 {
7133 float other_item_quantity = other_item.GetQuantity();
7134 float this_free_space;
7135
7137
7139
7140 if (other_item_quantity > this_free_space)
7141 {
7142 return this_free_space;
7143 }
7144 else
7145 {
7146 return other_item_quantity;
7147 }
7148 }
7149
7151 {
7153 }
7154
7156 {
7158 return;
7159
7160 if (!IsMagazine() && other_item)
7161 {
7163 if (quantity_used != 0)
7164 {
7165 float hp1 = GetHealth01("","");
7166 float hp2 = other_item.GetHealth01("","");
7167 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7168 hpResult = hpResult / (
GetQuantity() + quantity_used);
7169
7170 hpResult *= GetMaxHealth();
7171 Math.Round(hpResult);
7172 SetHealth("", "Health", hpResult);
7173
7175 other_item.AddQuantity(-quantity_used);
7176 }
7177 }
7179 }
7180
7182 {
7183 #ifdef SERVER
7184 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7185 GetHierarchyParent().IncreaseLifetimeUp();
7186 #endif
7187 };
7188
7190 {
7191 PlayerBase p = PlayerBase.Cast(player);
7192
7193 array<int> recipesIds = p.m_Recipes;
7194 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7195 if (moduleRecipesManager)
7196 {
7197 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7198 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7199 }
7200
7201 for (int i = 0;i < recipesIds.Count(); i++)
7202 {
7203 int key = recipesIds.Get(i);
7204 string recipeName = moduleRecipesManager.GetRecipeName(key);
7206 }
7207 }
7208
7209
7210 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7211 {
7212 super.GetDebugActions(outputList);
7213
7214
7219
7220
7224
7228
7229
7232
7233
7235 {
7238 }
7239
7241
7244
7248 }
7249
7250
7251
7252
7254 {
7255 super.OnAction(action_id, player, ctx);
7256 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7257 {
7258 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7259 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7260 PlayerBase p = PlayerBase.Cast(player);
7261 if (
EActions.RECIPES_RANGE_START < 1000)
7262 {
7263 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7264 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7265 }
7266 }
7267 #ifndef SERVER
7268 else if (action_id ==
EActions.WATCH_PLAYER)
7269 {
7270 PluginDeveloper.SetDeveloperItemClientEx(player);
7271 }
7272 #endif
7274 {
7275 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7276 {
7277 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7278 OnDebugButtonPressServer(id + 1);
7279 }
7280
7281 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7282 {
7283 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7285 }
7286
7287 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7288 {
7289 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7291 }
7292
7293 else if (action_id ==
EActions.ADD_QUANTITY)
7294 {
7295 if (IsMagazine())
7296 {
7297 Magazine mag = Magazine.Cast(this);
7298 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7299 }
7300 else
7301 {
7303 }
7304
7305 if (m_EM)
7306 {
7307 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7308 }
7309
7310 }
7311
7312 else if (action_id ==
EActions.REMOVE_QUANTITY)
7313 {
7314 if (IsMagazine())
7315 {
7316 Magazine mag2 = Magazine.Cast(this);
7317 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7318 }
7319 else
7320 {
7322 }
7323 if (m_EM)
7324 {
7325 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7326 }
7327
7328 }
7329
7330 else if (action_id ==
EActions.SET_QUANTITY_0)
7331 {
7333
7334 if (m_EM)
7335 {
7336 m_EM.SetEnergy(0);
7337 }
7338 }
7339
7340 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7341 {
7343
7344 if (m_EM)
7345 {
7346 m_EM.SetEnergy(m_EM.GetEnergyMax());
7347 }
7348 }
7349
7350 else if (action_id ==
EActions.ADD_HEALTH)
7351 {
7352 AddHealth("","",GetMaxHealth("","Health")/5);
7353 }
7354 else if (action_id ==
EActions.REMOVE_HEALTH)
7355 {
7356 AddHealth("","",-GetMaxHealth("","Health")/5);
7357 }
7358 else if (action_id ==
EActions.DESTROY_HEALTH)
7359 {
7360 SetHealth01("","",0);
7361 }
7362 else if (action_id ==
EActions.WATCH_ITEM)
7363 {
7365 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7366 #ifdef DEVELOPER
7367 SetDebugDeveloper_item(this);
7368 #endif
7369 }
7370
7371 else if (action_id ==
EActions.ADD_TEMPERATURE)
7372 {
7373 AddTemperature(20);
7374
7375 }
7376
7377 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7378 {
7379 AddTemperature(-20);
7380
7381 }
7382
7383 else if (action_id ==
EActions.FLIP_FROZEN)
7384 {
7385 SetFrozen(!GetIsFrozen());
7386
7387 }
7388
7389 else if (action_id ==
EActions.ADD_WETNESS)
7390 {
7392
7393 }
7394
7395 else if (action_id ==
EActions.REMOVE_WETNESS)
7396 {
7398
7399 }
7400
7401 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7402 {
7405
7406
7407 }
7408
7409 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7410 {
7413 }
7414
7415 else if (action_id ==
EActions.MAKE_SPECIAL)
7416 {
7417 auto debugParams = DebugSpawnParams.WithPlayer(player);
7418 OnDebugSpawnEx(debugParams);
7419 }
7420
7421 else if (action_id ==
EActions.DELETE)
7422 {
7423 Delete();
7424 }
7425
7426 }
7427
7428
7429 return false;
7430 }
7431
7432
7433
7434
7438
7441
7442
7443
7445 {
7446 return false;
7447 }
7448
7449
7451 {
7452 return true;
7453 }
7454
7455
7457 {
7458 return true;
7459 }
7460
7461
7462
7464 {
7465 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7467 }
7468
7471 {
7472 return null;
7473 }
7474
7476 {
7477 return false;
7478 }
7479
7481 {
7482 return false;
7483 }
7484
7488
7489
7491 {
7492 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7493 return module_repairing.CanRepair(this, item_repair_kit);
7494 }
7495
7496
7497 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7498 {
7499 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7500 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7501 }
7502
7503
7505 {
7506
7507
7508
7509
7510
7511
7512
7513
7514 return 1;
7515 }
7516
7517
7518
7520 {
7522 }
7523
7524
7525
7527 {
7529 }
7530
7531
7540 {
7541 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7542
7543 if (player)
7544 {
7545 player.MessageStatus(text);
7546 }
7547 }
7548
7549
7558 {
7559 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7560
7561 if (player)
7562 {
7563 player.MessageAction(text);
7564 }
7565 }
7566
7567
7576 {
7577 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7578
7579 if (player)
7580 {
7581 player.MessageFriendly(text);
7582 }
7583 }
7584
7585
7594 {
7595 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7596
7597 if (player)
7598 {
7599 player.MessageImportant(text);
7600 }
7601 }
7602
7604 {
7605 return true;
7606 }
7607
7608
7609 override bool KindOf(
string tag)
7610 {
7611 bool found = false;
7612 string item_name = this.
GetType();
7615
7616 int array_size = item_tag_array.Count();
7617 for (int i = 0; i < array_size; i++)
7618 {
7619 if (item_tag_array.Get(i) == tag)
7620 {
7621 found = true;
7622 break;
7623 }
7624 }
7625 return found;
7626 }
7627
7628
7630 {
7631
7632 super.OnRPC(sender, rpc_type,ctx);
7633
7634
7635 switch (rpc_type)
7636 {
7637 #ifndef SERVER
7638 case ERPCs.RPC_SOUND_LOCK_ATTACH:
7639 Param2<bool, string> p = new Param2<bool, string>(false, "");
7640
7642 return;
7643
7644 bool play = p.param1;
7645 string soundSet = p.param2;
7646
7647 if (play)
7648 {
7650 {
7652 {
7654 }
7655 }
7656 else
7657 {
7659 }
7660 }
7661 else
7662 {
7664 }
7665
7666 break;
7667 #endif
7668
7669 }
7670
7672 {
7674 }
7675 }
7676
7677
7678
7679
7681 {
7682 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
7683 return plugin.GetID(
name);
7684 }
7685
7687 {
7688 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
7689 return plugin.GetName(id);
7690 }
7691
7694 {
7695
7696
7697 int varFlags;
7698 if (!ctx.
Read(varFlags))
7699 return;
7700
7701 if (varFlags & ItemVariableFlags.FLOAT)
7702 {
7704 }
7705 }
7706
7708 {
7709
7710 super.SerializeNumericalVars(floats_out);
7711
7712
7713
7715 {
7717 }
7718
7720 {
7722 }
7723
7725 {
7727 }
7728
7730 {
7735 }
7736
7738 {
7740 }
7741 }
7742
7744 {
7745
7746 super.DeSerializeNumericalVars(floats);
7747
7748
7749 int index = 0;
7750 int mask = Math.Round(floats.Get(index));
7751
7752 index++;
7753
7755 {
7757 {
7759 }
7760 else
7761 {
7762 float quantity = floats.Get(index);
7764 }
7765 index++;
7766 }
7767
7769 {
7770 float wet = floats.Get(index);
7772 index++;
7773 }
7774
7776 {
7777 int liquidtype = Math.Round(floats.Get(index));
7779 index++;
7780 }
7781
7783 {
7785 index++;
7787 index++;
7789 index++;
7791 index++;
7792 }
7793
7795 {
7796 int cleanness = Math.Round(floats.Get(index));
7798 index++;
7799 }
7800 }
7801
7803 {
7804 super.WriteVarsToCTX(ctx);
7805
7806
7808 {
7810 }
7811
7813 {
7815 }
7816
7818 {
7820 }
7821
7823 {
7824 int r,g,b,a;
7830 }
7831
7833 {
7835 }
7836 }
7837
7839 {
7840 if (!super.ReadVarsFromCTX(ctx,version))
7841 return false;
7842
7843 int intValue;
7844 float value;
7845
7846 if (version < 140)
7847 {
7848 if (!ctx.
Read(intValue))
7849 return false;
7850
7851 m_VariablesMask = intValue;
7852 }
7853
7855 {
7856 if (!ctx.
Read(value))
7857 return false;
7858
7860 {
7862 }
7863 else
7864 {
7866 }
7867 }
7868
7869 if (version < 140)
7870 {
7872 {
7873 if (!ctx.
Read(value))
7874 return false;
7875 SetTemperatureDirect(value);
7876 }
7877 }
7878
7880 {
7881 if (!ctx.
Read(value))
7882 return false;
7884 }
7885
7887 {
7888 if (!ctx.
Read(intValue))
7889 return false;
7891 }
7892
7894 {
7895 int r,g,b,a;
7897 return false;
7899 return false;
7901 return false;
7903 return false;
7904
7906 }
7907
7909 {
7910 if (!ctx.
Read(intValue))
7911 return false;
7913 }
7914
7915 if (version >= 138 && version < 140)
7916 {
7918 {
7919 if (!ctx.
Read(intValue))
7920 return false;
7921 SetFrozen(intValue);
7922 }
7923 }
7924
7925 return true;
7926 }
7927
7928
7930 {
7933 {
7935 }
7936
7937 if (!super.OnStoreLoad(ctx, version))
7938 {
7940 return false;
7941 }
7942
7943 if (version >= 114)
7944 {
7945 bool hasQuickBarIndexSaved;
7946
7947 if (!ctx.
Read(hasQuickBarIndexSaved))
7948 {
7950 return false;
7951 }
7952
7953 if (hasQuickBarIndexSaved)
7954 {
7955 int itmQBIndex;
7956
7957
7958 if (!ctx.
Read(itmQBIndex))
7959 {
7961 return false;
7962 }
7963
7964 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
7965 if (itmQBIndex != -1 && parentPlayer)
7966 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
7967 }
7968 }
7969 else
7970 {
7971
7972 PlayerBase player;
7973 int itemQBIndex;
7974 if (version ==
int.
MAX)
7975 {
7976 if (!ctx.
Read(itemQBIndex))
7977 {
7979 return false;
7980 }
7981 }
7982 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
7983 {
7984
7985 if (!ctx.
Read(itemQBIndex))
7986 {
7988 return false;
7989 }
7990 if (itemQBIndex != -1 && player)
7991 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
7992 }
7993 }
7994
7995 if (version < 140)
7996 {
7997
7998 if (!LoadVariables(ctx, version))
7999 {
8001 return false;
8002 }
8003 }
8004
8005
8007 {
8009 return false;
8010 }
8011 if (version >= 132)
8012 {
8014 if (raib)
8015 {
8017 {
8019 return false;
8020 }
8021 }
8022 }
8023
8025 return true;
8026 }
8027
8028
8029
8031 {
8032 super.OnStoreSave(ctx);
8033
8034 PlayerBase player;
8035 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8036 {
8038
8039 int itemQBIndex = -1;
8040 itemQBIndex = player.FindQuickBarEntityIndex(this);
8041 ctx.
Write(itemQBIndex);
8042 }
8043 else
8044 {
8046 }
8047
8049
8051 if (raib)
8052 {
8054 }
8055 }
8056
8057
8059 {
8060 super.AfterStoreLoad();
8061
8063 {
8065 }
8066
8068 {
8071 }
8072 }
8073
8075 {
8076 super.EEOnAfterLoad();
8077
8079 {
8081 }
8082
8085 }
8086
8088 {
8089 return false;
8090 }
8091
8092
8093
8095 {
8097 {
8098 #ifdef PLATFORM_CONSOLE
8099
8101 {
8103 if (menu)
8104 {
8106 }
8107 }
8108 #endif
8109 }
8110
8112 {
8115 }
8116
8118 {
8119 SetWeightDirty();
8121 }
8123 {
8126 }
8127
8129 {
8132 }
8134 {
8137 }
8138
8139 super.OnVariablesSynchronized();
8140 }
8141
8142
8143
8145 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8146 {
8147 if (!IsServerCheck(allow_client))
8148 return false;
8149
8151 return false;
8152
8155
8156 if (value <= (min + 0.001))
8157 value = min;
8158
8159 if (value == min)
8160 {
8161 if (destroy_config)
8162 {
8163 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8164 if (dstr)
8165 {
8167 this.Delete();
8168 return true;
8169 }
8170 }
8171 else if (destroy_forced)
8172 {
8174 this.Delete();
8175 return true;
8176 }
8177
8179 }
8180
8183
8185 {
8187
8188 if (delta)
8190 }
8191
8193
8194 return false;
8195 }
8196
8197
8199 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8200 {
8202 }
8203
8205 {
8208 }
8209
8211 {
8214 }
8215
8218 {
8219 float value_clamped = Math.Clamp(value, 0, 1);
8221 SetQuantity(result, destroy_config, destroy_forced);
8222 }
8223
8224
8227 {
8229 }
8230
8232 {
8234 }
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8246 {
8247 int slot = -1;
8248 if (GetInventory())
8249 {
8250 InventoryLocation il = new InventoryLocation;
8251 GetInventory().GetCurrentInventoryLocation(il);
8253 }
8254
8256 }
8257
8259 {
8260 float quantity_max = 0;
8261
8263 {
8264 if (attSlotID != -1)
8265 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8266
8267 if (quantity_max <= 0)
8269 }
8270
8271 if (quantity_max <= 0)
8273
8274 return quantity_max;
8275 }
8276
8278 {
8280 }
8281
8283 {
8285 }
8286
8287
8289 {
8291 }
8292
8294 {
8296 }
8297
8299 {
8301 }
8302
8303
8305 {
8306
8307 float weightEx = GetWeightEx();
8308 float special = GetInventoryAndCargoWeight();
8309 return weightEx - special;
8310 }
8311
8312
8314 {
8316 }
8317
8319 {
8321 {
8322 #ifdef DEVELOPER
8323 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8324 {
8325 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8327 }
8328 #endif
8329
8331 }
8332 else if (HasEnergyManager())
8333 {
8334 #ifdef DEVELOPER
8335 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8336 {
8337 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8338 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8339 }
8340 #endif
8341 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8342 }
8343 else
8344 {
8345 #ifdef DEVELOPER
8346 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8347 {
8348 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8349 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8350 }
8351 #endif
8352 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8353 }
8354 }
8355
8358 {
8359 int item_count = 0;
8361
8362 if (GetInventory().GetCargo() != NULL)
8363 {
8364 item_count = GetInventory().GetCargo().GetItemCount();
8365 }
8366
8367 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8368 {
8369 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8370 if (item)
8371 item_count += item.GetNumberOfItems();
8372 }
8373 return item_count;
8374 }
8375
8378 {
8379 float weight = 0;
8380 float wetness = 1;
8381 if (include_wetness)
8384 {
8385 weight = wetness * m_ConfigWeight;
8386 }
8388 {
8389 weight = 1;
8390 }
8391 return weight;
8392 }
8393
8394
8395
8397 {
8398 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8399 {
8400 GameInventory inv = GetInventory();
8401 array<EntityAI> items = new array<EntityAI>;
8403 for (int i = 0; i < items.Count(); i++)
8404 {
8406 if (item)
8407 {
8409 }
8410 }
8411 }
8412 }
8413
8414
8415
8416
8418 {
8419 float energy = 0;
8420 if (HasEnergyManager())
8421 {
8422 energy = GetCompEM().GetEnergy();
8423 }
8424 return energy;
8425 }
8426
8427
8429 {
8430 super.OnEnergyConsumed();
8431
8433 }
8434
8436 {
8437 super.OnEnergyAdded();
8438
8440 }
8441
8442
8444 {
8445 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8446 {
8448 {
8449 float energy_0to1 = GetCompEM().GetEnergy0To1();
8451 }
8452 }
8453 }
8454
8455
8457 {
8458 return ConfigGetFloat("heatIsolation");
8459 }
8460
8462 {
8464 }
8465
8467 {
8468 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8469 if (
GetGame().ConfigIsExisting(paramPath))
8471
8472 return 0.0;
8473 }
8474
8476 {
8477 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8478 if (
GetGame().ConfigIsExisting(paramPath))
8480
8481 return 0.0;
8482 }
8483
8484 override void SetWet(
float value,
bool allow_client =
false)
8485 {
8486 if (!IsServerCheck(allow_client))
8487 return;
8488
8491
8493
8494 m_VarWet = Math.Clamp(value, min, max);
8495
8497 {
8500 }
8501 }
8502
8503 override void AddWet(
float value)
8504 {
8506 }
8507
8509 {
8511 }
8512
8514 {
8516 }
8517
8519 {
8521 }
8522
8524 {
8526 }
8527
8529 {
8531 }
8532
8534 {
8537 if (newLevel != oldLevel)
8538 {
8540 }
8541 }
8542
8544 {
8545 SetWeightDirty();
8546 }
8547
8549 {
8550 return GetWetLevelInternal(
m_VarWet);
8551 }
8552
8553
8554
8556 {
8558 }
8559
8561 {
8563 }
8564
8566 {
8568 }
8569
8571 {
8573 }
8574
8575
8576
8578 {
8579 if (ConfigIsExisting("itemModelLength"))
8580 {
8581 return ConfigGetFloat("itemModelLength");
8582 }
8583 return 0;
8584 }
8585
8587 {
8588 if (ConfigIsExisting("itemAttachOffset"))
8589 {
8590 return ConfigGetFloat("itemAttachOffset");
8591 }
8592 return 0;
8593 }
8594
8595 override void SetCleanness(
int value,
bool allow_client =
false)
8596 {
8597 if (!IsServerCheck(allow_client))
8598 return;
8599
8601
8603
8606 }
8607
8609 {
8611 }
8612
8614 {
8615 return true;
8616 }
8617
8618
8619
8620
8622 {
8624 }
8625
8627 {
8629 }
8630
8631
8632
8633
8634 override void SetColor(
int r,
int g,
int b,
int a)
8635 {
8641 }
8643 override void GetColor(out
int r,out
int g,out
int b,out
int a)
8644 {
8649 }
8650
8652 {
8654 }
8655
8658 {
8659 int r,g,b,a;
8661 r = r/255;
8662 g = g/255;
8663 b = b/255;
8664 a = a/255;
8665 return MiscGameplayFunctions.GetColorString(r, g, b, a);
8666 }
8667
8668
8669
8670 override void SetLiquidType(
int value,
bool allow_client =
false)
8671 {
8672 if (!IsServerCheck(allow_client))
8673 return;
8674
8679 }
8680
8682 {
8683 return ConfigGetInt("varLiquidTypeInit");
8684 }
8685
8687 {
8689 }
8690
8692 {
8694 SetFrozen(false);
8695 }
8696
8699 {
8700 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
8701 }
8702
8703
8706 {
8707 PlayerBase nplayer;
8708 if (PlayerBase.CastTo(nplayer, player))
8709 {
8711
8712 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
8713 }
8714 }
8715
8716
8719 {
8720 PlayerBase nplayer;
8721 if (PlayerBase.CastTo(nplayer,player))
8722 {
8723
8724 nplayer.SetEnableQuickBarEntityShortcut(this,false);
8725
8726 }
8727
8728
8729 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
8730
8731
8732 if (HasEnergyManager())
8733 {
8734 GetCompEM().UpdatePlugState();
8735 }
8736 }
8737
8738
8740 {
8741 super.OnPlacementStarted(player);
8742
8744 }
8745
8746 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
8747 {
8749 {
8750 m_AdminLog.OnPlacementComplete(player,
this);
8751 }
8752
8753 super.OnPlacementComplete(player, position, orientation);
8754 }
8755
8756
8757
8758
8759
8761 {
8763 {
8764 return true;
8765 }
8766 else
8767 {
8768 return false;
8769 }
8770 }
8771
8772
8774 {
8776 {
8778 }
8779 }
8780
8781
8783 {
8785 }
8786
8788 {
8790 }
8791
8792 override void InsertAgent(
int agent,
float count = 1)
8793 {
8794 if (count < 1)
8795 return;
8796
8798 }
8799
8802 {
8804 }
8805
8806
8808 {
8810 }
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8854 {
8856 return false;
8857 return true;
8858 }
8859
8861 {
8862
8864 }
8865
8866
8869 {
8870 super.CheckForRoofLimited(timeTresholdMS);
8871
8873 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
8874 {
8875 m_PreviousRoofTestTime = time;
8876 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
8877 }
8878 }
8879
8880
8882 {
8884 {
8885 return 0;
8886 }
8887
8888 if (GetInventory().GetAttachmentSlotsCount() != 0)
8889 {
8890 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
8891 if (filter)
8892 return filter.GetProtectionLevel(type, false, system);
8893 else
8894 return 0;
8895 }
8896
8897 string subclassPath, entryName;
8898
8899 switch (type)
8900 {
8902 entryName = "biological";
8903 break;
8905 entryName = "chemical";
8906 break;
8907 default:
8908 entryName = "biological";
8909 break;
8910 }
8911
8912 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
8913
8915 }
8916
8917
8918
8921 {
8922 if (!IsMagazine())
8924
8926 }
8927
8928
8929
8930
8931
8936 {
8937 return true;
8938 }
8939
8941 {
8943 }
8944
8945
8946
8947
8948
8950 {
8951 if (parent)
8952 {
8953 if (parent.IsInherited(DayZInfected))
8954 return true;
8955
8956 if (!parent.IsRuined())
8957 return true;
8958 }
8959
8960 return true;
8961 }
8962
8964 {
8965 if (!super.CanPutAsAttachment(parent))
8966 {
8967 return false;
8968 }
8969
8970 if (!IsRuined() && !parent.IsRuined())
8971 {
8972 return true;
8973 }
8974
8975 return false;
8976 }
8977
8979 {
8980
8981
8982
8983
8984 return super.CanReceiveItemIntoCargo(item);
8985 }
8986
8988 {
8989
8990
8991
8992
8993 GameInventory attachmentInv = attachment.GetInventory();
8995 {
8996 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
8997 return false;
8998 }
8999
9000 InventoryLocation loc = new InventoryLocation();
9001 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9002 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9003 return false;
9004
9005 return super.CanReceiveAttachment(attachment, slotId);
9006 }
9007
9009 {
9010 if (!super.CanReleaseAttachment(attachment))
9011 return false;
9012
9013 return GetInventory().AreChildrenAccessible();
9014 }
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9037 {
9038 int id = muzzle_owner.GetMuzzleID();
9039 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9040
9041 if (WPOF_array)
9042 {
9043 for (int i = 0; i < WPOF_array.Count(); i++)
9044 {
9045 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9046
9047 if (WPOF)
9048 {
9049 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9050 }
9051 }
9052 }
9053 }
9054
9055
9057 {
9058 int id = muzzle_owner.GetMuzzleID();
9060
9061 if (WPOBE_array)
9062 {
9063 for (int i = 0; i < WPOBE_array.Count(); i++)
9064 {
9065 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9066
9067 if (WPOBE)
9068 {
9069 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9070 }
9071 }
9072 }
9073 }
9074
9075
9077 {
9078 int id = muzzle_owner.GetMuzzleID();
9079 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9080
9081 if (WPOOH_array)
9082 {
9083 for (int i = 0; i < WPOOH_array.Count(); i++)
9084 {
9085 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9086
9087 if (WPOOH)
9088 {
9089 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9090 }
9091 }
9092 }
9093 }
9094
9095
9097 {
9098 int id = muzzle_owner.GetMuzzleID();
9099 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9100
9101 if (WPOOH_array)
9102 {
9103 for (int i = 0; i < WPOOH_array.Count(); i++)
9104 {
9105 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9106
9107 if (WPOOH)
9108 {
9109 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9110 }
9111 }
9112 }
9113 }
9114
9115
9117 {
9118 int id = muzzle_owner.GetMuzzleID();
9119 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9120
9121 if (WPOOH_array)
9122 {
9123 for (int i = 0; i < WPOOH_array.Count(); i++)
9124 {
9125 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9126
9127 if (WPOOH)
9128 {
9129 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9130 }
9131 }
9132 }
9133 }
9134
9135
9136
9138 {
9140 {
9141 return true;
9142 }
9143
9144 return false;
9145 }
9146
9148 {
9150 {
9151 return true;
9152 }
9153
9154 return false;
9155 }
9156
9158 {
9160 {
9161 return true;
9162 }
9163
9164 return false;
9165 }
9166
9168 {
9169 return false;
9170 }
9171
9174 {
9175 return UATimeSpent.DEFAULT_DEPLOY;
9176 }
9177
9178
9179
9180
9182 {
9184 SetSynchDirty();
9185 }
9186
9188 {
9190 }
9191
9192
9194 {
9195 return false;
9196 }
9197
9200 {
9201 string att_type = "None";
9202
9203 if (ConfigIsExisting("soundAttType"))
9204 {
9205 att_type = ConfigGetString("soundAttType");
9206 }
9207
9209 }
9210
9212 {
9214 }
9215
9216
9217
9218
9219
9223
9225 {
9228
9230 }
9231
9232
9234 {
9236 return;
9237
9239
9242
9245
9246 SoundParameters params = new SoundParameters();
9250 }
9251
9252
9254 {
9256 return;
9257
9259 SetSynchDirty();
9260
9263 }
9264
9265
9267 {
9269 return;
9270
9272 SetSynchDirty();
9273
9276 }
9277
9279 {
9281 }
9282
9284 {
9286 }
9287
9290 {
9291 if (!
GetGame().IsDedicatedServer())
9292 {
9293 if (ConfigIsExisting("attachSoundSet"))
9294 {
9295 string cfg_path = "";
9296 string soundset = "";
9298
9301 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9302 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9303
9304 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9305 {
9306 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9307 {
9308 if (cfg_slot_array[i] == slot_type)
9309 {
9310 soundset = cfg_soundset_array[i];
9311 break;
9312 }
9313 }
9314 }
9315
9316 if (soundset != "")
9317 {
9318 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9320 }
9321 }
9322 }
9323 }
9324
9326 {
9327
9328 }
9329
9330 void OnApply(PlayerBase player);
9331
9333 {
9334 return 1.0;
9335 };
9336
9338 {
9340 }
9341
9343 {
9345 }
9346
9348
9350 {
9351 SetDynamicPhysicsLifeTime(0.01);
9353 }
9354
9356 {
9357 array<string> zone_names = new array<string>;
9358 GetDamageZones(zone_names);
9359 for (int i = 0; i < zone_names.Count(); i++)
9360 {
9361 SetHealthMax(zone_names.Get(i),"Health");
9362 }
9363 SetHealthMax("","Health");
9364 }
9365
9368 {
9369 float global_health = GetHealth01("","Health");
9370 array<string> zones = new array<string>;
9371 GetDamageZones(zones);
9372
9373 for (int i = 0; i < zones.Count(); i++)
9374 {
9375 SetHealth01(zones.Get(i),"Health",global_health);
9376 }
9377 }
9378
9381 {
9382 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9383 }
9384
9386 {
9387 if (!hasRootAsPlayer)
9388 {
9389 if (refParentIB)
9390 {
9391
9392 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9393 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9394
9395 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9396 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9397
9400 }
9401 else
9402 {
9403
9406 }
9407 }
9408 }
9409
9411 {
9413 {
9414 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9415 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9416 {
9417 float heatPermCoef = 1.0;
9419 while (ent)
9420 {
9421 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9422 ent = ent.GetHierarchyParent();
9423 }
9424
9425 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9426 }
9427 }
9428 }
9429
9431 {
9432
9433 EntityAI parent = GetHierarchyParent();
9434 if (!parent)
9435 {
9436 hasParent = false;
9437 hasRootAsPlayer = false;
9438 }
9439 else
9440 {
9441 hasParent = true;
9442 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9443 refParentIB =
ItemBase.Cast(parent);
9444 }
9445 }
9446
9447 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9448 {
9449
9450 }
9451
9453 {
9454
9455 return false;
9456 }
9457
9459 {
9460
9461
9462 return false;
9463 }
9464
9466 {
9467
9468 return false;
9469 }
9470
9473 {
9474 return !GetIsFrozen() &&
IsOpen();
9475 }
9476
9478 {
9479 bool hasParent = false, hasRootAsPlayer = false;
9481
9482 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9483 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9484
9485 if (wwtu || foodDecay)
9486 {
9490
9491 if (processWetness || processTemperature || processDecay)
9492 {
9494
9495 if (processWetness)
9496 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9497
9498 if (processTemperature)
9500
9501 if (processDecay)
9502 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9503 }
9504 }
9505 }
9506
9509 {
9511 }
9512
9514 {
9517
9518 return super.GetTemperatureFreezeThreshold();
9519 }
9520
9522 {
9525
9526 return super.GetTemperatureThawThreshold();
9527 }
9528
9530 {
9533
9534 return super.GetItemOverheatThreshold();
9535 }
9536
9538 {
9540 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9541
9542 return super.GetTemperatureFreezeTime();
9543 }
9544
9546 {
9548 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9549
9550 return super.GetTemperatureThawTime();
9551 }
9552
9557
9559 {
9560 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
9561 }
9562
9564 {
9565 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
9566 }
9567
9570 {
9572 }
9573
9575 {
9577 }
9578
9580 {
9582 }
9583
9586 {
9587 return null;
9588 }
9589
9592 {
9593 return false;
9594 }
9595
9597 {
9599 {
9602 if (!trg)
9603 {
9605 explosive = this;
9606 }
9607
9608 explosive.PairRemote(trg);
9610
9611 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
9612 trg.SetPersistentPairID(persistentID);
9613 explosive.SetPersistentPairID(persistentID);
9614
9615 return true;
9616 }
9617 return false;
9618 }
9619
9622 {
9623 float ret = 1.0;
9626 ret *= GetHealth01();
9627
9628 return ret;
9629 }
9630
9631 #ifdef DEVELOPER
9632 override void SetDebugItem()
9633 {
9634 super.SetDebugItem();
9635 _itemBase = this;
9636 }
9637
9639 {
9640 string text = super.GetDebugText();
9641
9643 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
9644
9645 return text;
9646 }
9647 #endif
9648
9650 {
9651 return true;
9652 }
9653
9655
9657
9659 {
9662 }
9663
9664
9672
9688}
9689
9691{
9693 if (entity)
9694 {
9695 bool is_item = entity.IsInherited(
ItemBase);
9696 if (is_item && full_quantity)
9697 {
9700 }
9701 }
9702 else
9703 {
9705 return NULL;
9706 }
9707 return entity;
9708}
9709
9711{
9712 if (item)
9713 {
9714 if (health > 0)
9715 item.SetHealth("", "", health);
9716
9717 if (item.CanHaveTemperature())
9718 {
9720 if (item.CanFreeze())
9721 item.SetFrozen(false);
9722 }
9723
9724 if (item.HasEnergyManager())
9725 {
9726 if (quantity >= 0)
9727 {
9728 item.GetCompEM().SetEnergy0To1(quantity);
9729 }
9730 else
9731 {
9733 }
9734 }
9735 else if (item.IsMagazine())
9736 {
9737 Magazine mag = Magazine.Cast(item);
9738 if (quantity >= 0)
9739 {
9740 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
9741 }
9742 else
9743 {
9745 }
9746
9747 }
9748 else
9749 {
9750 if (quantity >= 0)
9751 {
9752 item.SetQuantityNormalized(quantity, false);
9753 }
9754 else
9755 {
9757 }
9758
9759 }
9760 }
9761}
9762
9763#ifdef DEVELOPER
9765#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.