5757{
5759 {
5760 return true;
5761 }
5762};
5763
5764
5765
5767{
5771
5773
5776
5777
5778
5779
5780
5789
5795
5800
5805
5826 protected bool m_IsResultOfSplit
5827
5829
5834
5835
5836
5838
5842
5843
5844
5846
5849
5850
5851
5857
5858
5866
5869
5870
5872
5873
5875
5876
5881
5882
5887
5888
5890
5891
5893 {
5898
5899 if (!
GetGame().IsDedicatedServer())
5900 {
5902 {
5904
5906 {
5908 }
5909 }
5910
5913 }
5914
5915 m_OldLocation = null;
5916
5918 {
5920 }
5921
5922 if (ConfigIsExisting("headSelectionsToHide"))
5923 {
5926 }
5927
5929 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5930 {
5932 }
5933
5935
5936 m_IsResultOfSplit = false;
5937
5939 }
5940
5942 {
5943 super.InitItemVariables();
5944
5950 m_Count = ConfigGetInt(
"count");
5951
5954
5959
5962
5967
5979
5983
5984
5987 if (ConfigIsExisting("canBeSplit"))
5988 {
5991 }
5992
5994 if (ConfigIsExisting("itemBehaviour"))
5996
5997
6000 RegisterNetSyncVariableInt("m_VarLiquidType");
6001 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6002
6003 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6004 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6005 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6006
6007 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6008 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6009 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6010 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6011
6012 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6013 RegisterNetSyncVariableBool("m_IsTakeable");
6014 RegisterNetSyncVariableBool("m_IsHologram");
6015
6018 {
6021 }
6022
6024
6026 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6028
6029 }
6030
6032 {
6034 }
6035
6037 {
6040 {
6045 }
6046 }
6047
6048 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6049 {
6051 {
6054 }
6055
6057 }
6058
6060 {
6066 }
6067
6069
6071 {
6073
6074 if (!action)
6075 {
6076 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6077 return;
6078 }
6079
6081 if (!ai)
6082 {
6084 return;
6085 }
6086
6088 if (!action_array)
6089 {
6090 action_array = new array<ActionBase_Basic>;
6092 }
6093 if (LogManager.IsActionLogEnable())
6094 {
6095 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6096 }
6097
6098 if (action_array.Find(action) != -1)
6099 {
6100 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6101 }
6102 else
6103 {
6104 action_array.Insert(action);
6105 }
6106 }
6107
6109 {
6111 ActionBase action = player.GetActionManager().GetAction(actionName);
6114
6115 if (action_array)
6116 {
6117 action_array.RemoveItem(action);
6118 }
6119 }
6120
6121
6122
6124 {
6125 ActionOverrideData overrideData = new ActionOverrideData();
6129
6131 if (!actionMap)
6132 {
6135 }
6136
6137 actionMap.Insert(this.
Type(), overrideData);
6138
6139 }
6140
6142
6144
6145
6147 {
6150
6153
6154 string config_to_search = "CfgVehicles";
6155 string muzzle_owner_config;
6156
6158 {
6159 if (IsInherited(Weapon))
6160 config_to_search = "CfgWeapons";
6161
6162 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6163
6164 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6165
6167
6168 if (config_OnFire_subclass_count > 0)
6169 {
6170 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6171
6172 for (int i = 0; i < config_OnFire_subclass_count; i++)
6173 {
6174 string particle_class = "";
6176 string config_OnFire_entry = config_OnFire_class + particle_class;
6177 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6178 WPOF_array.Insert(WPOF);
6179 }
6180
6181
6183 }
6184 }
6185
6187 {
6188 config_to_search = "CfgWeapons";
6189 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6190
6191 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6192
6194
6195 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6196 {
6197 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6198
6199 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6200 {
6201 string particle_class2 = "";
6203 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6204 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6205 WPOBE_array.Insert(WPOBE);
6206 }
6207
6208
6210 }
6211 }
6212 }
6213
6214
6216 {
6219
6221 {
6222 string config_to_search = "CfgVehicles";
6223
6224 if (IsInherited(Weapon))
6225 config_to_search = "CfgWeapons";
6226
6227 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6228 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6229
6230 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6231 {
6232
6234
6236 {
6238 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6240 return;
6241 }
6242
6245
6246
6247
6249 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6250
6251 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6252 {
6253 string particle_class = "";
6255 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6257
6258 if (entry_type == CT_CLASS)
6259 {
6260 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6261 WPOOH_array.Insert(WPOF);
6262 }
6263 }
6264
6265
6267 }
6268 }
6269 }
6270
6272 {
6274 }
6275
6277 {
6279 {
6281
6284
6287
6288 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6289 }
6290 }
6291
6293 {
6295 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6296
6298 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6299
6301 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6302
6304 {
6306 }
6307 }
6308
6310 {
6312 }
6313
6315 {
6318 else
6320
6322 {
6325 }
6326 else
6327 {
6330
6333 }
6334
6336 }
6337
6339 {
6341 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6342 }
6343
6345 {
6347 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6349 }
6350
6352 {
6354 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6355 }
6356
6358 {
6361
6362 OverheatingParticle OP = new OverheatingParticle();
6367
6369 }
6370
6372 {
6375
6376 return -1;
6377 }
6378
6380 {
6382 {
6385
6386 for (int i = count; i > 0; --i)
6387 {
6388 int id = i - 1;
6391
6394
6395 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6396 {
6397 if (p)
6398 {
6401 }
6402 }
6403 }
6404 }
6405 }
6406
6408 {
6410 {
6412 {
6413 int id = i - 1;
6415
6416 if (OP)
6417 {
6419
6420 if (p)
6421 {
6423 }
6424
6425 delete OP;
6426 }
6427 }
6428
6431 }
6432 }
6433
6436 {
6437 return 0.0;
6438 }
6439
6440
6442 {
6443 return 250;
6444 }
6445
6447 {
6448 return 0;
6449 }
6450
6453 {
6455 return true;
6456
6457 return false;
6458 }
6459
6462 {
6465
6467 {
6469 }
6470 else
6471 {
6472
6474 }
6475
6477 }
6478
6485 {
6486 return -1;
6487 }
6488
6489
6490
6491
6493 {
6495 {
6497 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6498
6499 if (r_index >= 0)
6500 {
6501 InventoryLocation r_il = new InventoryLocation;
6502 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6503
6504 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6507 {
6508 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6509 }
6511 {
6512 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6513 }
6514
6515 }
6516
6517 player.GetHumanInventory().ClearUserReservedLocation(this);
6518 }
6519
6522 }
6523
6524
6525
6526
6528 {
6529 return ItemBase.m_DebugActionsMask;
6530 }
6531
6533 {
6534 return ItemBase.m_DebugActionsMask & mask;
6535 }
6536
6538 {
6539 ItemBase.m_DebugActionsMask = mask;
6540 }
6541
6543 {
6544 ItemBase.m_DebugActionsMask |= mask;
6545 }
6546
6548 {
6549 ItemBase.m_DebugActionsMask &= ~mask;
6550 }
6551
6553 {
6555 {
6557 }
6558 else
6559 {
6561 }
6562 }
6563
6564
6566 {
6567 if (GetEconomyProfile())
6568 {
6569 float q_max = GetEconomyProfile().GetQuantityMax();
6570 if (q_max > 0)
6571 {
6572 float q_min = GetEconomyProfile().GetQuantityMin();
6573 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6574
6576 {
6577 ComponentEnergyManager comp = GetCompEM();
6579 {
6581 }
6582 }
6584 {
6586
6587 }
6588
6589 }
6590 }
6591 }
6592
6595 {
6596 EntityAI parent = GetHierarchyParent();
6597
6598 if (parent)
6599 {
6600 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6601 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6602 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6603 }
6604 }
6605
6608 {
6609 EntityAI parent = GetHierarchyParent();
6610
6611 if (parent)
6612 {
6613 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6614 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6615 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6616 }
6617 }
6618
6620 {
6621
6622
6623
6624
6626
6628 {
6629 if (ScriptInputUserData.CanStoreInputUserData())
6630 {
6631 ScriptInputUserData ctx = new ScriptInputUserData;
6637 ctx.
Write(use_stack_max);
6640
6642 {
6643 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6644 }
6645 }
6646 }
6647 else if (!
GetGame().IsMultiplayer())
6648 {
6650 }
6651 }
6652
6654 {
6656 }
6657
6659 {
6661 }
6662
6664 {
6666 }
6667
6669 {
6670
6671 return false;
6672 }
6673
6675 {
6676 return false;
6677 }
6678
6682 {
6683 return false;
6684 }
6685
6687 {
6688 return "";
6689 }
6690
6692
6694 {
6695 return false;
6696 }
6697
6699 {
6700 return true;
6701 }
6702
6703
6704
6706 {
6707 return true;
6708 }
6709
6711 {
6712 return true;
6713 }
6714
6716 {
6717 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6719 }
6720
6722 {
6724 }
6725
6727 {
6729 if (!is_being_placed)
6731 SetSynchDirty();
6732 }
6733
6734
6736
6738 {
6740 }
6741
6743 {
6745 }
6746
6748 {
6749 return 1;
6750 }
6751
6753 {
6754 return false;
6755 }
6756
6758 {
6760 SetSynchDirty();
6761 }
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6798 {
6799 super.OnMovedInsideCargo(container);
6800
6801 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6802 }
6803
6804 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6805 {
6806 super.EEItemLocationChanged(oldLoc,newLoc);
6807
6808 PlayerBase new_player = null;
6809 PlayerBase old_player = null;
6810
6811 if (newLoc.GetParent())
6812 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6813
6814 if (oldLoc.GetParent())
6815 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6816
6818 {
6819 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6820
6821 if (r_index >= 0)
6822 {
6823 InventoryLocation r_il = new InventoryLocation;
6824 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6825
6826 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6829 {
6830 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6831 }
6833 {
6834 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6835 }
6836
6837 }
6838 }
6839
6841 {
6842 if (new_player)
6843 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6844
6845 if (new_player == old_player)
6846 {
6847
6848 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6849 {
6851 {
6852 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6853 {
6854 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6855 }
6856 }
6857 else
6858 {
6859 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6860 }
6861 }
6862
6863 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6864 {
6865 int type = oldLoc.GetType();
6867 {
6868 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6869 }
6871 {
6872 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6873 }
6874 }
6875 if (!m_OldLocation)
6876 {
6877 m_OldLocation = new InventoryLocation;
6878 }
6879 m_OldLocation.Copy(oldLoc);
6880 }
6881 else
6882 {
6883 if (m_OldLocation)
6884 {
6885 m_OldLocation.Reset();
6886 }
6887 }
6888
6890 }
6891 else
6892 {
6893 if (new_player)
6894 {
6895 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6896 if (res_index >= 0)
6897 {
6898 InventoryLocation il = new InventoryLocation;
6899 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6901 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6904 {
6905 il.
GetParent().GetOnReleaseLock().Invoke(it);
6906 }
6908 {
6910 }
6911
6912 }
6913 }
6915 {
6916
6918 }
6919
6920 if (m_OldLocation)
6921 {
6922 m_OldLocation.Reset();
6923 }
6924 }
6925 }
6926
6927 override void EOnContact(IEntity other, Contact extra)
6928 {
6930 {
6931 int liquidType = -1;
6933 if (impactSpeed > 0.0)
6934 {
6936 #ifndef SERVER
6938 #else
6940 SetSynchDirty();
6941 #endif
6943 }
6944 }
6945
6946 #ifdef SERVER
6947 if (GetCompEM() && GetCompEM().IsPlugged())
6948 {
6949 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6950 GetCompEM().UnplugThis();
6951 }
6952 #endif
6953 }
6954
6956
6958 {
6960 }
6961
6963 {
6964
6965 }
6966
6968 {
6969 super.OnItemLocationChanged(old_owner, new_owner);
6970
6971 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6972 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6973
6974 if (!relatedPlayer && playerNew)
6975 relatedPlayer = playerNew;
6976
6977 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6978 {
6980 if (actionMgr)
6981 {
6982 ActionBase currentAction = actionMgr.GetRunningAction();
6983 if (currentAction)
6985 }
6986 }
6987
6988 Man ownerPlayerOld = null;
6989 Man ownerPlayerNew = null;
6990
6991 if (old_owner)
6992 {
6993 if (old_owner.
IsMan())
6994 {
6995 ownerPlayerOld = Man.Cast(old_owner);
6996 }
6997 else
6998 {
6999 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7000 }
7001 }
7002 else
7003 {
7005 {
7007
7008 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7009 {
7010 GetCompEM().UnplugThis();
7011 }
7012 }
7013 }
7014
7015 if (new_owner)
7016 {
7017 if (new_owner.
IsMan())
7018 {
7019 ownerPlayerNew = Man.Cast(new_owner);
7020 }
7021 else
7022 {
7023 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7024 }
7025 }
7026
7027 if (ownerPlayerOld != ownerPlayerNew)
7028 {
7029 if (ownerPlayerOld)
7030 {
7031 array<EntityAI> subItemsExit = new array<EntityAI>;
7033 for (int i = 0; i < subItemsExit.Count(); i++)
7034 {
7037 }
7038 }
7039
7040 if (ownerPlayerNew)
7041 {
7042 array<EntityAI> subItemsEnter = new array<EntityAI>;
7044 for (int j = 0; j < subItemsEnter.Count(); j++)
7045 {
7048 }
7049 }
7050 }
7051 else if (ownerPlayerNew != null)
7052 {
7053 PlayerBase nplayer;
7054 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7055 {
7056 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7058 for (int k = 0; k < subItemsUpdate.Count(); k++)
7059 {
7061 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7062 }
7063 }
7064 }
7065
7066 if (old_owner)
7067 old_owner.OnChildItemRemoved(this);
7068 if (new_owner)
7069 new_owner.OnChildItemReceived(this);
7070 }
7071
7072
7074 {
7075 super.EEDelete(parent);
7076 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7077 if (player)
7078 {
7080
7081 if (player.IsAlive())
7082 {
7083 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7084 if (r_index >= 0)
7085 {
7086 InventoryLocation r_il = new InventoryLocation;
7087 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7088
7089 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7092 {
7093 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7094 }
7096 {
7097 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7098 }
7099
7100 }
7101
7102 player.RemoveQuickBarEntityShortcut(this);
7103 }
7104 }
7105 }
7106
7108 {
7109 super.EEKilled(killer);
7110
7113 {
7114 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7115 {
7116 if (IsMagazine())
7117 {
7118 if (Magazine.Cast(this).GetAmmoCount() > 0)
7119 {
7121 }
7122 }
7123 else
7124 {
7126 }
7127 }
7128 }
7129 }
7130
7132 {
7133 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7134
7135 super.OnWasAttached(parent, slot_id);
7136
7139
7141 }
7142
7144 {
7145 super.OnWasDetached(parent, slot_id);
7146
7149 }
7150
7152 {
7153 int idx;
7156
7157 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7158 if (inventory_slots.Count() < 1)
7159 {
7160 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7161 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7162 }
7163 else
7164 {
7165 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7166 }
7167
7168 idx = inventory_slots.Find(slot);
7169 if (idx < 0)
7170 return "";
7171
7172 return attach_types.Get(idx);
7173 }
7174
7176 {
7177 int idx = -1;
7178 string slot;
7179
7182
7183 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7184 if (inventory_slots.Count() < 1)
7185 {
7186 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7187 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7188 }
7189 else
7190 {
7191 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7192 if (detach_types.Count() < 1)
7193 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7194 }
7195
7196 for (int i = 0; i < inventory_slots.Count(); i++)
7197 {
7198 slot = inventory_slots.Get(i);
7199 }
7200
7201 if (slot != "")
7202 {
7203 if (detach_types.Count() == 1)
7204 idx = 0;
7205 else
7206 idx = inventory_slots.Find(slot);
7207 }
7208 if (idx < 0)
7209 return "";
7210
7211 return detach_types.Get(idx);
7212 }
7213
7215 {
7216
7218
7219
7220 float min_time = 1;
7221 float max_time = 3;
7222 float delay = Math.RandomFloat(min_time, max_time);
7223
7224 explode_timer.Run(delay, this, "DoAmmoExplosion");
7225 }
7226
7228 {
7229 Magazine magazine = Magazine.Cast(this);
7230 int pop_sounds_count = 6;
7231 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7232
7233
7234 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7235 string sound_name = pop_sounds[ sound_idx ];
7237
7238
7239 magazine.ServerAddAmmoCount(-1);
7240
7241
7242 float min_temp_to_explode = 100;
7243
7244 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7245 {
7247 }
7248 }
7249
7250
7251 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7252 {
7253 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7254
7255 const int CHANCE_DAMAGE_CARGO = 4;
7256 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7257 const int CHANCE_DAMAGE_NOTHING = 2;
7258
7260 {
7261 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7262 int chances;
7263 int rnd;
7264
7265 if (GetInventory().GetCargo())
7266 {
7267 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7268 rnd = Math.RandomInt(0,chances);
7269
7270 if (rnd < CHANCE_DAMAGE_CARGO)
7271 {
7273 }
7274 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7275 {
7277 }
7278 }
7279 else
7280 {
7281 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7282 rnd = Math.RandomInt(0,chances);
7283
7284 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7285 {
7287 }
7288 }
7289 }
7290 }
7291
7293 {
7294 if (GetInventory().GetCargo())
7295 {
7296 int item_count = GetInventory().GetCargo().GetItemCount();
7297 if (item_count > 0)
7298 {
7299 int random_pick = Math.RandomInt(0, item_count);
7301 if (!item.IsExplosive())
7302 {
7303 item.AddHealth("","",damage);
7304 return true;
7305 }
7306 }
7307 }
7308 return false;
7309 }
7310
7312 {
7313 int attachment_count = GetInventory().AttachmentCount();
7314 if (attachment_count > 0)
7315 {
7316 int random_pick = Math.RandomInt(0, attachment_count);
7317 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7318 if (!attachment.IsExplosive())
7319 {
7320 attachment.AddHealth("","",damage);
7321 return true;
7322 }
7323 }
7324 return false;
7325 }
7326
7328 {
7330 }
7331
7333 {
7335 return GetInventory().CanRemoveEntity();
7336
7337 return false;
7338 }
7339
7341 {
7343 return;
7344
7346 {
7347 if (ScriptInputUserData.CanStoreInputUserData())
7348 {
7349 ScriptInputUserData ctx = new ScriptInputUserData;
7354 ctx.
Write(destination_entity);
7358 }
7359 }
7360 else if (!
GetGame().IsMultiplayer())
7361 {
7363 }
7364 }
7365
7367 {
7369 return;
7370
7371 float split_quantity_new;
7375 InventoryLocation loc = new InventoryLocation;
7376
7377 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7378 {
7380 split_quantity_new = stack_max;
7381 else
7383
7384 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7385 if (new_item)
7386 {
7387 new_item.SetResultOfSplit(true);
7388 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7390 new_item.SetQuantity(split_quantity_new);
7391 }
7392 }
7393 else if (destination_entity && slot_id == -1)
7394 {
7395 if (quantity > stack_max)
7396 split_quantity_new = stack_max;
7397 else
7398 split_quantity_new = quantity;
7399
7401 {
7404 }
7405
7406 if (new_item)
7407 {
7408 new_item.SetResultOfSplit(true);
7409 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7411 new_item.SetQuantity(split_quantity_new);
7412 }
7413 }
7414 else
7415 {
7416 if (stack_max != 0)
7417 {
7419 {
7421 }
7422
7423 if (split_quantity_new == 0)
7424 {
7425 if (!
GetGame().IsMultiplayer())
7426 player.PhysicalPredictiveDropItem(this);
7427 else
7428 player.ServerDropEntity(this);
7429 return;
7430 }
7431
7433
7434 if (new_item)
7435 {
7436 new_item.SetResultOfSplit(true);
7437 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7439 new_item.SetQuantity(stack_max);
7440 new_item.PlaceOnSurface();
7441 }
7442 }
7443 }
7444 }
7445
7447 {
7449 return;
7450
7451 float split_quantity_new;
7455 InventoryLocation loc = new InventoryLocation;
7456
7457 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7458 {
7460 split_quantity_new = stack_max;
7461 else
7463
7464 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7465 if (new_item)
7466 {
7467 new_item.SetResultOfSplit(true);
7468 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7470 new_item.SetQuantity(split_quantity_new);
7471 }
7472 }
7473 else if (destination_entity && slot_id == -1)
7474 {
7475 if (quantity > stack_max)
7476 split_quantity_new = stack_max;
7477 else
7478 split_quantity_new = quantity;
7479
7481 {
7484 }
7485
7486 if (new_item)
7487 {
7488 new_item.SetResultOfSplit(true);
7489 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7491 new_item.SetQuantity(split_quantity_new);
7492 }
7493 }
7494 else
7495 {
7496 if (stack_max != 0)
7497 {
7499 {
7501 }
7502
7504
7505 if (new_item)
7506 {
7507 new_item.SetResultOfSplit(true);
7508 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7510 new_item.SetQuantity(stack_max);
7511 new_item.PlaceOnSurface();
7512 }
7513 }
7514 }
7515 }
7516
7518 {
7520 return;
7521
7523 {
7524 if (ScriptInputUserData.CanStoreInputUserData())
7525 {
7526 ScriptInputUserData ctx = new ScriptInputUserData;
7531 dst.WriteToContext(ctx);
7533 }
7534 }
7535 else if (!
GetGame().IsMultiplayer())
7536 {
7538 }
7539 }
7540
7542 {
7544 return;
7545
7547 {
7548 if (ScriptInputUserData.CanStoreInputUserData())
7549 {
7550 ScriptInputUserData ctx = new ScriptInputUserData;
7555 ctx.
Write(destination_entity);
7561 }
7562 }
7563 else if (!
GetGame().IsMultiplayer())
7564 {
7566 }
7567 }
7568
7570 {
7572 }
7573
7575 {
7577 return this;
7578
7580 float split_quantity_new;
7582 if (dst.IsValid())
7583 {
7584 int slot_id = dst.GetSlot();
7586
7587 if (quantity > stack_max)
7588 split_quantity_new = stack_max;
7589 else
7590 split_quantity_new = quantity;
7591
7593
7594 if (new_item)
7595 {
7596 new_item.SetResultOfSplit(true);
7597 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7600 }
7601
7602 return new_item;
7603 }
7604
7605 return null;
7606 }
7607
7609 {
7611 return;
7612
7614 float split_quantity_new;
7616 if (destination_entity)
7617 {
7619 if (quantity > stackable)
7620 split_quantity_new = stackable;
7621 else
7622 split_quantity_new = quantity;
7623
7624 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7625 if (new_item)
7626 {
7627 new_item.SetResultOfSplit(true);
7628 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7630 new_item.SetQuantity(split_quantity_new);
7631 }
7632 }
7633 }
7634
7636 {
7638 return;
7639
7641 {
7642 if (ScriptInputUserData.CanStoreInputUserData())
7643 {
7644 ScriptInputUserData ctx = new ScriptInputUserData;
7649 ItemBase destination_entity =
this;
7650 ctx.
Write(destination_entity);
7654 }
7655 }
7656 else if (!
GetGame().IsMultiplayer())
7657 {
7659 }
7660 }
7661
7663 {
7665 return;
7666
7668 float split_quantity_new;
7670 if (player)
7671 {
7673 if (quantity > stackable)
7674 split_quantity_new = stackable;
7675 else
7676 split_quantity_new = quantity;
7677
7678 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7679 new_item =
ItemBase.Cast(in_hands);
7680 if (new_item)
7681 {
7682 new_item.SetResultOfSplit(true);
7683 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7685 new_item.SetQuantity(split_quantity_new);
7686 }
7687 }
7688 }
7689
7691 {
7693 return;
7694
7696 float split_quantity_new = Math.Floor(quantity * 0.5);
7697
7699
7700 if (new_item)
7701 {
7702 if (new_item.GetQuantityMax() < split_quantity_new)
7703 {
7704 split_quantity_new = new_item.GetQuantityMax();
7705 }
7706
7707 new_item.SetResultOfSplit(true);
7708 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7709
7711 {
7714 }
7715 else
7716 {
7719 }
7720 }
7721 }
7722
7724 {
7726 return;
7727
7729 float split_quantity_new = Math.Floor(quantity / 2);
7730
7731 InventoryLocation invloc = new InventoryLocation;
7733
7735 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7736
7737 if (new_item)
7738 {
7739 if (new_item.GetQuantityMax() < split_quantity_new)
7740 {
7741 split_quantity_new = new_item.GetQuantityMax();
7742 }
7744 {
7747 }
7748 else
7749 {
7752 }
7753 }
7754 }
7755
7758 {
7759 SetWeightDirty();
7761
7762 if (parent)
7763 parent.OnAttachmentQuantityChangedEx(this, delta);
7764
7766 {
7768 {
7770 }
7772 {
7773 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7775 }
7776 }
7777
7778 }
7779
7782 {
7783
7784 }
7785
7788 {
7790 }
7791
7793 {
7794 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7795
7797 {
7798 if (newLevel == GameConstants.STATE_RUINED)
7799 {
7801 EntityAI parent = GetHierarchyParent();
7802 if (parent && parent.IsFireplace())
7803 {
7804 CargoBase cargo = GetInventory().GetCargo();
7805 if (cargo)
7806 {
7808 {
7810 }
7811 }
7812 }
7813 }
7814
7816 {
7817
7819 return;
7820 }
7821
7822 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7823 {
7825 }
7826 }
7827 }
7828
7829
7831 {
7832 super.OnRightClick();
7833
7835 {
7837 {
7838 if (ScriptInputUserData.CanStoreInputUserData())
7839 {
7840 vector m4[4];
7842
7843 EntityAI root = GetHierarchyRoot();
7844
7845 InventoryLocation dst = new InventoryLocation;
7847 {
7848 if (root)
7849 {
7850 root.GetTransform(m4);
7852 }
7853 else
7854 GetInventory().GetCurrentInventoryLocation(dst);
7855 }
7856 else
7857 {
7859
7860
7861 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7862 {
7863 if (root)
7864 {
7865 root.GetTransform(m4);
7867 }
7868 else
7869 GetInventory().GetCurrentInventoryLocation(dst);
7870 }
7871 else
7872 {
7873 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7874 }
7875 }
7876
7877 ScriptInputUserData ctx = new ScriptInputUserData;
7885 }
7886 }
7887 else if (!
GetGame().IsMultiplayer())
7888 {
7890 }
7891 }
7892 }
7893
7894 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7895 {
7896
7897 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7898 return false;
7899
7900 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7901 return false;
7902
7903
7905 return false;
7906
7907
7908 Magazine mag = Magazine.Cast(this);
7909 if (mag)
7910 {
7911 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7912 return false;
7913
7914 if (stack_max_limit)
7915 {
7916 Magazine other_mag = Magazine.Cast(other_item);
7917 if (other_item)
7918 {
7919 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7920 return false;
7921 }
7922
7923 }
7924 }
7925 else
7926 {
7927
7929 return false;
7930
7932 return false;
7933 }
7934
7935 PlayerBase player = null;
7936 if (CastTo(player, GetHierarchyRootPlayer()))
7937 {
7938 if (player.GetInventory().HasAttachment(this))
7939 return false;
7940
7941 if (player.IsItemsToDelete())
7942 return false;
7943 }
7944
7945 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7946 return false;
7947
7948 int slotID;
7950 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7951 return false;
7952
7953 return true;
7954 }
7955
7957 {
7959 }
7960
7962 {
7963 return m_IsResultOfSplit;
7964 }
7965
7967 {
7968 m_IsResultOfSplit = value;
7969 }
7970
7972 {
7974 }
7975
7977 {
7978 float other_item_quantity = other_item.GetQuantity();
7979 float this_free_space;
7980
7982
7984
7985 if (other_item_quantity > this_free_space)
7986 {
7987 return this_free_space;
7988 }
7989 else
7990 {
7991 return other_item_quantity;
7992 }
7993 }
7994
7996 {
7998 }
7999
8001 {
8003 return;
8004
8005 if (!IsMagazine() && other_item)
8006 {
8008 if (quantity_used != 0)
8009 {
8010 float hp1 = GetHealth01("","");
8011 float hp2 = other_item.GetHealth01("","");
8012 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8013 hpResult = hpResult / (
GetQuantity() + quantity_used);
8014
8015 hpResult *= GetMaxHealth();
8016 Math.Round(hpResult);
8017 SetHealth("", "Health", hpResult);
8018
8020 other_item.AddQuantity(-quantity_used);
8021 }
8022 }
8024 }
8025
8027 {
8028 #ifdef SERVER
8029 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8030 GetHierarchyParent().IncreaseLifetimeUp();
8031 #endif
8032 };
8033
8035 {
8036 PlayerBase p = PlayerBase.Cast(player);
8037
8038 array<int> recipesIds = p.m_Recipes;
8039 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8040 if (moduleRecipesManager)
8041 {
8042 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8043 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8044 }
8045
8046 for (int i = 0;i < recipesIds.Count(); i++)
8047 {
8048 int key = recipesIds.Get(i);
8049 string recipeName = moduleRecipesManager.GetRecipeName(key);
8051 }
8052 }
8053
8054
8055 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8056 {
8057 super.GetDebugActions(outputList);
8058
8059
8064
8065
8069
8073
8074
8077
8078
8080 {
8083 }
8084
8086
8089
8093 }
8094
8095
8096
8097
8099 {
8100 super.OnAction(action_id, player, ctx);
8101 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8102 {
8103 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8104 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8105 PlayerBase p = PlayerBase.Cast(player);
8106 if (
EActions.RECIPES_RANGE_START < 1000)
8107 {
8108 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8109 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8110 }
8111 }
8112 #ifndef SERVER
8113 else if (action_id ==
EActions.WATCH_PLAYER)
8114 {
8115 PluginDeveloper.SetDeveloperItemClientEx(player);
8116 }
8117 #endif
8119 {
8120 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8121 {
8122 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8123 OnDebugButtonPressServer(id + 1);
8124 }
8125
8126 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8127 {
8128 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8130 }
8131
8132 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8133 {
8134 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8136 }
8137
8138 else if (action_id ==
EActions.ADD_QUANTITY)
8139 {
8140 if (IsMagazine())
8141 {
8142 Magazine mag = Magazine.Cast(this);
8143 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8144 }
8145 else
8146 {
8148 }
8149
8150 if (m_EM)
8151 {
8152 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8153 }
8154
8155 }
8156
8157 else if (action_id ==
EActions.REMOVE_QUANTITY)
8158 {
8159 if (IsMagazine())
8160 {
8161 Magazine mag2 = Magazine.Cast(this);
8162 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8163 }
8164 else
8165 {
8167 }
8168 if (m_EM)
8169 {
8170 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8171 }
8172
8173 }
8174
8175 else if (action_id ==
EActions.SET_QUANTITY_0)
8176 {
8178
8179 if (m_EM)
8180 {
8181 m_EM.SetEnergy(0);
8182 }
8183 }
8184
8185 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8186 {
8188
8189 if (m_EM)
8190 {
8191 m_EM.SetEnergy(m_EM.GetEnergyMax());
8192 }
8193 }
8194
8195 else if (action_id ==
EActions.ADD_HEALTH)
8196 {
8197 AddHealth("","",GetMaxHealth("","Health")/5);
8198 }
8199 else if (action_id ==
EActions.REMOVE_HEALTH)
8200 {
8201 AddHealth("","",-GetMaxHealth("","Health")/5);
8202 }
8203 else if (action_id ==
EActions.DESTROY_HEALTH)
8204 {
8205 SetHealth01("","",0);
8206 }
8207 else if (action_id ==
EActions.WATCH_ITEM)
8208 {
8210 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8211 #ifdef DEVELOPER
8212 SetDebugDeveloper_item(this);
8213 #endif
8214 }
8215
8216 else if (action_id ==
EActions.ADD_TEMPERATURE)
8217 {
8218 AddTemperature(20);
8219
8220 }
8221
8222 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8223 {
8224 AddTemperature(-20);
8225
8226 }
8227
8228 else if (action_id ==
EActions.FLIP_FROZEN)
8229 {
8230 SetFrozen(!GetIsFrozen());
8231
8232 }
8233
8234 else if (action_id ==
EActions.ADD_WETNESS)
8235 {
8237
8238 }
8239
8240 else if (action_id ==
EActions.REMOVE_WETNESS)
8241 {
8243
8244 }
8245
8246 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8247 {
8250
8251
8252 }
8253
8254 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8255 {
8258 }
8259
8260 else if (action_id ==
EActions.MAKE_SPECIAL)
8261 {
8262 auto debugParams = DebugSpawnParams.WithPlayer(player);
8263 OnDebugSpawnEx(debugParams);
8264 }
8265
8266 else if (action_id ==
EActions.DELETE)
8267 {
8268 Delete();
8269 }
8270
8271 }
8272
8273
8274 return false;
8275 }
8276
8277
8278
8279
8283
8286
8287
8288
8290 {
8291 return false;
8292 }
8293
8294
8296 {
8297 return true;
8298 }
8299
8300
8302 {
8303 return true;
8304 }
8305
8306
8307
8309 {
8310 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8312 }
8313
8316 {
8317 return null;
8318 }
8319
8321 {
8322 return false;
8323 }
8324
8326 {
8327 return false;
8328 }
8329
8333
8334
8336 {
8337 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8338 return module_repairing.CanRepair(this, item_repair_kit);
8339 }
8340
8341
8342 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8343 {
8344 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8345 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8346 }
8347
8348
8350 {
8351
8352
8353
8354
8355
8356
8357
8358
8359 return 1;
8360 }
8361
8362
8363
8365 {
8367 }
8368
8369
8370
8372 {
8374 }
8375
8376
8385 {
8386 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8387
8388 if (player)
8389 {
8390 player.MessageStatus(text);
8391 }
8392 }
8393
8394
8403 {
8404 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8405
8406 if (player)
8407 {
8408 player.MessageAction(text);
8409 }
8410 }
8411
8412
8421 {
8422 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8423
8424 if (player)
8425 {
8426 player.MessageFriendly(text);
8427 }
8428 }
8429
8430
8439 {
8440 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8441
8442 if (player)
8443 {
8444 player.MessageImportant(text);
8445 }
8446 }
8447
8449 {
8450 return true;
8451 }
8452
8453
8454 override bool KindOf(
string tag)
8455 {
8456 bool found = false;
8457 string item_name = this.
GetType();
8460
8461 int array_size = item_tag_array.Count();
8462 for (int i = 0; i < array_size; i++)
8463 {
8464 if (item_tag_array.Get(i) == tag)
8465 {
8466 found = true;
8467 break;
8468 }
8469 }
8470 return found;
8471 }
8472
8473
8475 {
8476
8477 super.OnRPC(sender, rpc_type,ctx);
8478
8479
8480 switch (rpc_type)
8481 {
8482 #ifndef SERVER
8483 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8484 Param2<bool, string> p = new Param2<bool, string>(false, "");
8485
8487 return;
8488
8489 bool play = p.param1;
8490 string soundSet = p.param2;
8491
8492 if (play)
8493 {
8495 {
8497 {
8499 }
8500 }
8501 else
8502 {
8504 }
8505 }
8506 else
8507 {
8509 }
8510
8511 break;
8512 #endif
8513
8514 }
8515
8517 {
8519 }
8520 }
8521
8522
8523
8524
8526 {
8527 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8528 return plugin.GetID(
name);
8529 }
8530
8532 {
8533 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8534 return plugin.GetName(id);
8535 }
8536
8539 {
8540
8541
8542 int varFlags;
8543 if (!ctx.
Read(varFlags))
8544 return;
8545
8546 if (varFlags & ItemVariableFlags.FLOAT)
8547 {
8549 }
8550 }
8551
8553 {
8554
8555 super.SerializeNumericalVars(floats_out);
8556
8557
8558
8560 {
8562 }
8563
8565 {
8567 }
8568
8570 {
8572 }
8573
8575 {
8580 }
8581
8583 {
8585 }
8586 }
8587
8589 {
8590
8591 super.DeSerializeNumericalVars(floats);
8592
8593
8594 int index = 0;
8595 int mask = Math.Round(floats.Get(index));
8596
8597 index++;
8598
8600 {
8602 {
8604 }
8605 else
8606 {
8607 float quantity = floats.Get(index);
8609 }
8610 index++;
8611 }
8612
8614 {
8615 float wet = floats.Get(index);
8617 index++;
8618 }
8619
8621 {
8622 int liquidtype = Math.Round(floats.Get(index));
8624 index++;
8625 }
8626
8628 {
8630 index++;
8632 index++;
8634 index++;
8636 index++;
8637 }
8638
8640 {
8641 int cleanness = Math.Round(floats.Get(index));
8643 index++;
8644 }
8645 }
8646
8648 {
8649 super.WriteVarsToCTX(ctx);
8650
8651
8653 {
8655 }
8656
8658 {
8660 }
8661
8663 {
8665 }
8666
8668 {
8669 int r,g,b,a;
8675 }
8676
8678 {
8680 }
8681 }
8682
8684 {
8685 if (!super.ReadVarsFromCTX(ctx,version))
8686 return false;
8687
8688 int intValue;
8689 float value;
8690
8691 if (version < 140)
8692 {
8693 if (!ctx.
Read(intValue))
8694 return false;
8695
8696 m_VariablesMask = intValue;
8697 }
8698
8700 {
8701 if (!ctx.
Read(value))
8702 return false;
8703
8705 {
8707 }
8708 else
8709 {
8711 }
8712 }
8713
8714 if (version < 140)
8715 {
8717 {
8718 if (!ctx.
Read(value))
8719 return false;
8720 SetTemperatureDirect(value);
8721 }
8722 }
8723
8725 {
8726 if (!ctx.
Read(value))
8727 return false;
8729 }
8730
8732 {
8733 if (!ctx.
Read(intValue))
8734 return false;
8736 }
8737
8739 {
8740 int r,g,b,a;
8742 return false;
8744 return false;
8746 return false;
8748 return false;
8749
8751 }
8752
8754 {
8755 if (!ctx.
Read(intValue))
8756 return false;
8758 }
8759
8760 if (version >= 138 && version < 140)
8761 {
8763 {
8764 if (!ctx.
Read(intValue))
8765 return false;
8766 SetFrozen(intValue);
8767 }
8768 }
8769
8770 return true;
8771 }
8772
8773
8775 {
8778 {
8780 }
8781
8782 if (!super.OnStoreLoad(ctx, version))
8783 {
8785 return false;
8786 }
8787
8788 if (version >= 114)
8789 {
8790 bool hasQuickBarIndexSaved;
8791
8792 if (!ctx.
Read(hasQuickBarIndexSaved))
8793 {
8795 return false;
8796 }
8797
8798 if (hasQuickBarIndexSaved)
8799 {
8800 int itmQBIndex;
8801
8802
8803 if (!ctx.
Read(itmQBIndex))
8804 {
8806 return false;
8807 }
8808
8809 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8810 if (itmQBIndex != -1 && parentPlayer)
8811 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8812 }
8813 }
8814 else
8815 {
8816
8817 PlayerBase player;
8818 int itemQBIndex;
8819 if (version ==
int.
MAX)
8820 {
8821 if (!ctx.
Read(itemQBIndex))
8822 {
8824 return false;
8825 }
8826 }
8827 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8828 {
8829
8830 if (!ctx.
Read(itemQBIndex))
8831 {
8833 return false;
8834 }
8835 if (itemQBIndex != -1 && player)
8836 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8837 }
8838 }
8839
8840 if (version < 140)
8841 {
8842
8843 if (!LoadVariables(ctx, version))
8844 {
8846 return false;
8847 }
8848 }
8849
8850
8852 {
8854 return false;
8855 }
8856 if (version >= 132)
8857 {
8859 if (raib)
8860 {
8862 {
8864 return false;
8865 }
8866 }
8867 }
8868
8870 return true;
8871 }
8872
8873
8874
8876 {
8877 super.OnStoreSave(ctx);
8878
8879 PlayerBase player;
8880 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8881 {
8883
8884 int itemQBIndex = -1;
8885 itemQBIndex = player.FindQuickBarEntityIndex(this);
8886 ctx.
Write(itemQBIndex);
8887 }
8888 else
8889 {
8891 }
8892
8894
8896 if (raib)
8897 {
8899 }
8900 }
8901
8902
8904 {
8905 super.AfterStoreLoad();
8906
8908 {
8910 }
8911
8913 {
8916 }
8917 }
8918
8920 {
8921 super.EEOnAfterLoad();
8922
8924 {
8926 }
8927
8930 }
8931
8933 {
8934 return false;
8935 }
8936
8937
8938
8940 {
8942 {
8943 #ifdef PLATFORM_CONSOLE
8944
8946 {
8948 if (menu)
8949 {
8951 }
8952 }
8953 #endif
8954 }
8955
8957 {
8960 }
8961
8963 {
8964 SetWeightDirty();
8966 }
8968 {
8971 }
8972
8974 {
8977 }
8979 {
8982 }
8983
8984 super.OnVariablesSynchronized();
8985 }
8986
8987
8988
8990 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8991 {
8992 if (!IsServerCheck(allow_client))
8993 return false;
8994
8996 return false;
8997
9000
9001 if (value <= (min + 0.001))
9002 value = min;
9003
9004 if (value == min)
9005 {
9006 if (destroy_config)
9007 {
9008 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9009 if (dstr)
9010 {
9012 this.Delete();
9013 return true;
9014 }
9015 }
9016 else if (destroy_forced)
9017 {
9019 this.Delete();
9020 return true;
9021 }
9022
9024 }
9025
9028
9030 {
9032
9033 if (delta)
9035 }
9036
9038
9039 return false;
9040 }
9041
9042
9044 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9045 {
9047 }
9048
9050 {
9053 }
9054
9056 {
9059 }
9060
9063 {
9064 float value_clamped = Math.Clamp(value, 0, 1);
9066 SetQuantity(result, destroy_config, destroy_forced);
9067 }
9068
9069
9072 {
9074 }
9075
9077 {
9079 }
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9091 {
9092 int slot = -1;
9093 if (GetInventory())
9094 {
9095 InventoryLocation il = new InventoryLocation;
9096 GetInventory().GetCurrentInventoryLocation(il);
9098 }
9099
9101 }
9102
9104 {
9105 float quantity_max = 0;
9106
9108 {
9109 if (attSlotID != -1)
9110 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9111
9112 if (quantity_max <= 0)
9114 }
9115
9116 if (quantity_max <= 0)
9118
9119 return quantity_max;
9120 }
9121
9123 {
9125 }
9126
9128 {
9130 }
9131
9132
9134 {
9136 }
9137
9139 {
9141 }
9142
9144 {
9146 }
9147
9148
9150 {
9151
9152 float weightEx = GetWeightEx();
9153 float special = GetInventoryAndCargoWeight();
9154 return weightEx - special;
9155 }
9156
9157
9159 {
9161 }
9162
9164 {
9166 {
9167 #ifdef DEVELOPER
9168 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9169 {
9170 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9172 }
9173 #endif
9174
9176 }
9177 else if (HasEnergyManager())
9178 {
9179 #ifdef DEVELOPER
9180 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9181 {
9182 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9183 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9184 }
9185 #endif
9186 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9187 }
9188 else
9189 {
9190 #ifdef DEVELOPER
9191 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9192 {
9193 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9194 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9195 }
9196 #endif
9197 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9198 }
9199 }
9200
9203 {
9204 int item_count = 0;
9206
9207 if (GetInventory().GetCargo() != NULL)
9208 {
9209 item_count = GetInventory().GetCargo().GetItemCount();
9210 }
9211
9212 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9213 {
9214 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9215 if (item)
9216 item_count += item.GetNumberOfItems();
9217 }
9218 return item_count;
9219 }
9220
9223 {
9224 float weight = 0;
9225 float wetness = 1;
9226 if (include_wetness)
9229 {
9230 weight = wetness * m_ConfigWeight;
9231 }
9233 {
9234 weight = 1;
9235 }
9236 return weight;
9237 }
9238
9239
9240
9242 {
9243 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9244 {
9245 GameInventory inv = GetInventory();
9246 array<EntityAI> items = new array<EntityAI>;
9248 for (int i = 0; i < items.Count(); i++)
9249 {
9251 if (item)
9252 {
9254 }
9255 }
9256 }
9257 }
9258
9259
9260
9261
9263 {
9264 float energy = 0;
9265 if (HasEnergyManager())
9266 {
9267 energy = GetCompEM().GetEnergy();
9268 }
9269 return energy;
9270 }
9271
9272
9274 {
9275 super.OnEnergyConsumed();
9276
9278 }
9279
9281 {
9282 super.OnEnergyAdded();
9283
9285 }
9286
9287
9289 {
9290 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9291 {
9293 {
9294 float energy_0to1 = GetCompEM().GetEnergy0To1();
9296 }
9297 }
9298 }
9299
9300
9302 {
9303 return ConfigGetFloat("heatIsolation");
9304 }
9305
9307 {
9309 }
9310
9312 {
9313 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9314 if (
GetGame().ConfigIsExisting(paramPath))
9316
9317 return 0.0;
9318 }
9319
9321 {
9322 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9323 if (
GetGame().ConfigIsExisting(paramPath))
9325
9326 return 0.0;
9327 }
9328
9329 override void SetWet(
float value,
bool allow_client =
false)
9330 {
9331 if (!IsServerCheck(allow_client))
9332 return;
9333
9336
9338
9339 m_VarWet = Math.Clamp(value, min, max);
9340
9342 {
9345 }
9346 }
9347
9348 override void AddWet(
float value)
9349 {
9351 }
9352
9354 {
9356 }
9357
9359 {
9361 }
9362
9364 {
9366 }
9367
9369 {
9371 }
9372
9374 {
9376 }
9377
9379 {
9382 if (newLevel != oldLevel)
9383 {
9385 }
9386 }
9387
9389 {
9390 SetWeightDirty();
9391 }
9392
9394 {
9395 return GetWetLevelInternal(
m_VarWet);
9396 }
9397
9398
9399
9401 {
9403 }
9404
9406 {
9408 }
9409
9411 {
9413 }
9414
9416 {
9418 }
9419
9420
9421
9423 {
9424 if (ConfigIsExisting("itemModelLength"))
9425 {
9426 return ConfigGetFloat("itemModelLength");
9427 }
9428 return 0;
9429 }
9430
9432 {
9433 if (ConfigIsExisting("itemAttachOffset"))
9434 {
9435 return ConfigGetFloat("itemAttachOffset");
9436 }
9437 return 0;
9438 }
9439
9440 override void SetCleanness(
int value,
bool allow_client =
false)
9441 {
9442 if (!IsServerCheck(allow_client))
9443 return;
9444
9446
9448
9451 }
9452
9454 {
9456 }
9457
9459 {
9460 return true;
9461 }
9462
9463
9464
9465
9467 {
9469 }
9470
9472 {
9474 }
9475
9476
9477
9478
9479 override void SetColor(
int r,
int g,
int b,
int a)
9480 {
9486 }
9488 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9489 {
9494 }
9495
9497 {
9499 }
9500
9503 {
9504 int r,g,b,a;
9506 r = r/255;
9507 g = g/255;
9508 b = b/255;
9509 a = a/255;
9510 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9511 }
9512
9513
9514
9515 override void SetLiquidType(
int value,
bool allow_client =
false)
9516 {
9517 if (!IsServerCheck(allow_client))
9518 return;
9519
9524 }
9525
9527 {
9528 return ConfigGetInt("varLiquidTypeInit");
9529 }
9530
9532 {
9534 }
9535
9537 {
9539 SetFrozen(false);
9540 }
9541
9544 {
9545 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9546 }
9547
9548
9551 {
9552 PlayerBase nplayer;
9553 if (PlayerBase.CastTo(nplayer, player))
9554 {
9556
9557 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9558 }
9559 }
9560
9561
9564 {
9565 PlayerBase nplayer;
9566 if (PlayerBase.CastTo(nplayer,player))
9567 {
9568
9569 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9570
9571 }
9572
9573
9574 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9575
9576
9577 if (HasEnergyManager())
9578 {
9579 GetCompEM().UpdatePlugState();
9580 }
9581 }
9582
9583
9585 {
9586 super.OnPlacementStarted(player);
9587
9589 }
9590
9591 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9592 {
9594 {
9595 m_AdminLog.OnPlacementComplete(player,
this);
9596 }
9597
9598 super.OnPlacementComplete(player, position, orientation);
9599 }
9600
9601
9602
9603
9604
9606 {
9608 {
9609 return true;
9610 }
9611 else
9612 {
9613 return false;
9614 }
9615 }
9616
9617
9619 {
9621 {
9623 }
9624 }
9625
9626
9628 {
9630 }
9631
9633 {
9635 }
9636
9637 override void InsertAgent(
int agent,
float count = 1)
9638 {
9639 if (count < 1)
9640 return;
9641
9643 }
9644
9647 {
9649 }
9650
9651
9653 {
9655 }
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9699 {
9701 return false;
9702 return true;
9703 }
9704
9706 {
9707
9709 }
9710
9711
9714 {
9715 super.CheckForRoofLimited(timeTresholdMS);
9716
9718 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9719 {
9720 m_PreviousRoofTestTime = time;
9721 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9722 }
9723 }
9724
9725
9727 {
9729 {
9730 return 0;
9731 }
9732
9733 if (GetInventory().GetAttachmentSlotsCount() != 0)
9734 {
9735 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9736 if (filter)
9737 return filter.GetProtectionLevel(type, false, system);
9738 else
9739 return 0;
9740 }
9741
9742 string subclassPath, entryName;
9743
9744 switch (type)
9745 {
9747 entryName = "biological";
9748 break;
9750 entryName = "chemical";
9751 break;
9752 default:
9753 entryName = "biological";
9754 break;
9755 }
9756
9757 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9758
9760 }
9761
9762
9763
9766 {
9767 if (!IsMagazine())
9769
9771 }
9772
9773
9774
9775
9776
9781 {
9782 return true;
9783 }
9784
9786 {
9788 }
9789
9790
9791
9792
9793
9795 {
9796 if (parent)
9797 {
9798 if (parent.IsInherited(DayZInfected))
9799 return true;
9800
9801 if (!parent.IsRuined())
9802 return true;
9803 }
9804
9805 return true;
9806 }
9807
9809 {
9810 if (!super.CanPutAsAttachment(parent))
9811 {
9812 return false;
9813 }
9814
9815 if (!IsRuined() && !parent.IsRuined())
9816 {
9817 return true;
9818 }
9819
9820 return false;
9821 }
9822
9824 {
9825
9826
9827
9828
9829 return super.CanReceiveItemIntoCargo(item);
9830 }
9831
9833 {
9834
9835
9836
9837
9838 GameInventory attachmentInv = attachment.GetInventory();
9840 {
9841 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9842 return false;
9843 }
9844
9845 InventoryLocation loc = new InventoryLocation();
9846 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9847 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9848 return false;
9849
9850 return super.CanReceiveAttachment(attachment, slotId);
9851 }
9852
9854 {
9855 if (!super.CanReleaseAttachment(attachment))
9856 return false;
9857
9858 return GetInventory().AreChildrenAccessible();
9859 }
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9882 {
9883 int id = muzzle_owner.GetMuzzleID();
9884 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9885
9886 if (WPOF_array)
9887 {
9888 for (int i = 0; i < WPOF_array.Count(); i++)
9889 {
9890 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9891
9892 if (WPOF)
9893 {
9894 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9895 }
9896 }
9897 }
9898 }
9899
9900
9902 {
9903 int id = muzzle_owner.GetMuzzleID();
9905
9906 if (WPOBE_array)
9907 {
9908 for (int i = 0; i < WPOBE_array.Count(); i++)
9909 {
9910 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9911
9912 if (WPOBE)
9913 {
9914 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9915 }
9916 }
9917 }
9918 }
9919
9920
9922 {
9923 int id = muzzle_owner.GetMuzzleID();
9924 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9925
9926 if (WPOOH_array)
9927 {
9928 for (int i = 0; i < WPOOH_array.Count(); i++)
9929 {
9930 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9931
9932 if (WPOOH)
9933 {
9934 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9935 }
9936 }
9937 }
9938 }
9939
9940
9942 {
9943 int id = muzzle_owner.GetMuzzleID();
9944 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9945
9946 if (WPOOH_array)
9947 {
9948 for (int i = 0; i < WPOOH_array.Count(); i++)
9949 {
9950 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9951
9952 if (WPOOH)
9953 {
9954 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9955 }
9956 }
9957 }
9958 }
9959
9960
9962 {
9963 int id = muzzle_owner.GetMuzzleID();
9964 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9965
9966 if (WPOOH_array)
9967 {
9968 for (int i = 0; i < WPOOH_array.Count(); i++)
9969 {
9970 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9971
9972 if (WPOOH)
9973 {
9974 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9975 }
9976 }
9977 }
9978 }
9979
9980
9981
9983 {
9985 {
9986 return true;
9987 }
9988
9989 return false;
9990 }
9991
9993 {
9995 {
9996 return true;
9997 }
9998
9999 return false;
10000 }
10001
10003 {
10005 {
10006 return true;
10007 }
10008
10009 return false;
10010 }
10011
10013 {
10014 return false;
10015 }
10016
10019 {
10020 return UATimeSpent.DEFAULT_DEPLOY;
10021 }
10022
10023
10024
10025
10027 {
10029 SetSynchDirty();
10030 }
10031
10033 {
10035 }
10036
10037
10039 {
10040 return false;
10041 }
10042
10045 {
10046 string att_type = "None";
10047
10048 if (ConfigIsExisting("soundAttType"))
10049 {
10050 att_type = ConfigGetString("soundAttType");
10051 }
10052
10054 }
10055
10057 {
10059 }
10060
10061
10062
10063
10064
10068
10070 {
10073
10075 }
10076
10077
10079 {
10081 return;
10082
10084
10087
10090
10091 SoundParameters params = new SoundParameters();
10095 }
10096
10097
10099 {
10101 return;
10102
10104 SetSynchDirty();
10105
10108 }
10109
10110
10112 {
10114 return;
10115
10117 SetSynchDirty();
10118
10121 }
10122
10124 {
10126 }
10127
10129 {
10131 }
10132
10135 {
10136 if (!
GetGame().IsDedicatedServer())
10137 {
10138 if (ConfigIsExisting("attachSoundSet"))
10139 {
10140 string cfg_path = "";
10141 string soundset = "";
10142 string type_name =
GetType();
10143
10146 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10147 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10148
10149 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10150 {
10151 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10152 {
10153 if (cfg_slot_array[i] == slot_type)
10154 {
10155 soundset = cfg_soundset_array[i];
10156 break;
10157 }
10158 }
10159 }
10160
10161 if (soundset != "")
10162 {
10163 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10165 }
10166 }
10167 }
10168 }
10169
10171 {
10172
10173 }
10174
10175 void OnApply(PlayerBase player);
10176
10178 {
10179 return 1.0;
10180 };
10181
10183 {
10185 }
10186
10188 {
10190 }
10191
10193
10195 {
10196 SetDynamicPhysicsLifeTime(0.01);
10198 }
10199
10201 {
10202 array<string> zone_names = new array<string>;
10203 GetDamageZones(zone_names);
10204 for (int i = 0; i < zone_names.Count(); i++)
10205 {
10206 SetHealthMax(zone_names.Get(i),"Health");
10207 }
10208 SetHealthMax("","Health");
10209 }
10210
10213 {
10214 float global_health = GetHealth01("","Health");
10215 array<string> zones = new array<string>;
10216 GetDamageZones(zones);
10217
10218 for (int i = 0; i < zones.Count(); i++)
10219 {
10220 SetHealth01(zones.Get(i),"Health",global_health);
10221 }
10222 }
10223
10226 {
10227 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10228 }
10229
10231 {
10232 if (!hasRootAsPlayer)
10233 {
10234 if (refParentIB)
10235 {
10236
10237 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10238 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10239
10240 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10241 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10242
10245 }
10246 else
10247 {
10248
10251 }
10252 }
10253 }
10254
10256 {
10258 {
10259 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10260 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10261 {
10262 float heatPermCoef = 1.0;
10264 while (ent)
10265 {
10266 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10267 ent = ent.GetHierarchyParent();
10268 }
10269
10270 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10271 }
10272 }
10273 }
10274
10276 {
10277
10278 EntityAI parent = GetHierarchyParent();
10279 if (!parent)
10280 {
10281 hasParent = false;
10282 hasRootAsPlayer = false;
10283 }
10284 else
10285 {
10286 hasParent = true;
10287 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10288 refParentIB =
ItemBase.Cast(parent);
10289 }
10290 }
10291
10292 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10293 {
10294
10295 }
10296
10298 {
10299
10300 return false;
10301 }
10302
10304 {
10305
10306
10307 return false;
10308 }
10309
10311 {
10312
10313 return false;
10314 }
10315
10318 {
10319 return !GetIsFrozen() &&
IsOpen();
10320 }
10321
10323 {
10324 bool hasParent = false, hasRootAsPlayer = false;
10326
10327 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10328 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10329
10330 if (wwtu || foodDecay)
10331 {
10335
10336 if (processWetness || processTemperature || processDecay)
10337 {
10339
10340 if (processWetness)
10341 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10342
10343 if (processTemperature)
10345
10346 if (processDecay)
10347 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10348 }
10349 }
10350 }
10351
10354 {
10356 }
10357
10359 {
10362
10363 return super.GetTemperatureFreezeThreshold();
10364 }
10365
10367 {
10370
10371 return super.GetTemperatureThawThreshold();
10372 }
10373
10375 {
10378
10379 return super.GetItemOverheatThreshold();
10380 }
10381
10383 {
10385 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10386
10387 return super.GetTemperatureFreezeTime();
10388 }
10389
10391 {
10393 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10394
10395 return super.GetTemperatureThawTime();
10396 }
10397
10402
10404 {
10405 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10406 }
10407
10409 {
10410 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10411 }
10412
10415 {
10417 }
10418
10420 {
10422 }
10423
10425 {
10427 }
10428
10431 {
10432 return null;
10433 }
10434
10437 {
10438 return false;
10439 }
10440
10442 {
10444 {
10447 if (!trg)
10448 {
10450 explosive = this;
10451 }
10452
10453 explosive.PairRemote(trg);
10455
10456 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10457 trg.SetPersistentPairID(persistentID);
10458 explosive.SetPersistentPairID(persistentID);
10459
10460 return true;
10461 }
10462 return false;
10463 }
10464
10467 {
10468 float ret = 1.0;
10471 ret *= GetHealth01();
10472
10473 return ret;
10474 }
10475
10476 #ifdef DEVELOPER
10477 override void SetDebugItem()
10478 {
10479 super.SetDebugItem();
10480 _itemBase = this;
10481 }
10482
10484 {
10485 string text = super.GetDebugText();
10486
10488 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10489
10490 return text;
10491 }
10492 #endif
10493
10495 {
10496 return true;
10497 }
10498
10500
10502
10504 {
10507 }
10508
10509
10517
10533}
10534
10536{
10538 if (entity)
10539 {
10540 bool is_item = entity.IsInherited(
ItemBase);
10541 if (is_item && full_quantity)
10542 {
10545 }
10546 }
10547 else
10548 {
10550 return NULL;
10551 }
10552 return entity;
10553}
10554
10556{
10557 if (item)
10558 {
10559 if (health > 0)
10560 item.SetHealth("", "", health);
10561
10562 if (item.CanHaveTemperature())
10563 {
10565 if (item.CanFreeze())
10566 item.SetFrozen(false);
10567 }
10568
10569 if (item.HasEnergyManager())
10570 {
10571 if (quantity >= 0)
10572 {
10573 item.GetCompEM().SetEnergy0To1(quantity);
10574 }
10575 else
10576 {
10578 }
10579 }
10580 else if (item.IsMagazine())
10581 {
10582 Magazine mag = Magazine.Cast(item);
10583 if (quantity >= 0)
10584 {
10585 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10586 }
10587 else
10588 {
10590 }
10591
10592 }
10593 else
10594 {
10595 if (quantity >= 0)
10596 {
10597 item.SetQuantityNormalized(quantity, false);
10598 }
10599 else
10600 {
10602 }
10603
10604 }
10605 }
10606}
10607
10608#ifdef DEVELOPER
10610#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.