5755{
5757 {
5758 return true;
5759 }
5760};
5761
5762
5763
5765{
5769
5771
5774
5775
5776
5777
5778
5787
5793
5798
5803
5824 protected bool m_IsResultOfSplit
5825
5827
5832
5833
5834
5836
5840
5841
5842
5844
5847
5848
5849
5855
5856
5864
5867
5868
5870
5871
5873
5874
5879
5880
5885
5886
5888
5889
5891 {
5896
5897 if (!
GetGame().IsDedicatedServer())
5898 {
5900 {
5902
5904 {
5906 }
5907 }
5908
5911 }
5912
5913 m_OldLocation = null;
5914
5916 {
5918 }
5919
5920 if (ConfigIsExisting("headSelectionsToHide"))
5921 {
5924 }
5925
5927 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5928 {
5930 }
5931
5933
5934 m_IsResultOfSplit = false;
5935
5937 }
5938
5940 {
5941 super.InitItemVariables();
5942
5948 m_Count = ConfigGetInt(
"count");
5949
5952
5957
5960
5965
5977
5981
5982
5985 if (ConfigIsExisting("canBeSplit"))
5986 {
5989 }
5990
5992 if (ConfigIsExisting("itemBehaviour"))
5994
5995
5998 RegisterNetSyncVariableInt("m_VarLiquidType");
5999 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6000
6001 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6002 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6003 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6004
6005 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6006 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6007 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6008 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6009
6010 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6011 RegisterNetSyncVariableBool("m_IsTakeable");
6012 RegisterNetSyncVariableBool("m_IsHologram");
6013
6016 {
6019 }
6020
6022
6024 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6026
6027 }
6028
6030 {
6032 }
6033
6035 {
6038 {
6043 }
6044 }
6045
6046 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6047 {
6049 {
6052 }
6053
6055 }
6056
6058 {
6064 }
6065
6067
6069 {
6071
6072 if (!action)
6073 {
6074 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6075 return;
6076 }
6077
6079 if (!ai)
6080 {
6082 return;
6083 }
6084
6086 if (!action_array)
6087 {
6088 action_array = new array<ActionBase_Basic>;
6090 }
6091 if (LogManager.IsActionLogEnable())
6092 {
6093 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6094 }
6095
6096 if (action_array.Find(action) != -1)
6097 {
6098 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6099 }
6100 else
6101 {
6102 action_array.Insert(action);
6103 }
6104 }
6105
6107 {
6109 ActionBase action = player.GetActionManager().GetAction(actionName);
6112
6113 if (action_array)
6114 {
6115 action_array.RemoveItem(action);
6116 }
6117 }
6118
6119
6120
6122 {
6123 ActionOverrideData overrideData = new ActionOverrideData();
6127
6129 if (!actionMap)
6130 {
6133 }
6134
6135 actionMap.Insert(this.
Type(), overrideData);
6136
6137 }
6138
6140
6142
6143
6145 {
6148
6151
6152 string config_to_search = "CfgVehicles";
6153 string muzzle_owner_config;
6154
6156 {
6157 if (IsInherited(Weapon))
6158 config_to_search = "CfgWeapons";
6159
6160 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6161
6162 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6163
6165
6166 if (config_OnFire_subclass_count > 0)
6167 {
6168 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6169
6170 for (int i = 0; i < config_OnFire_subclass_count; i++)
6171 {
6172 string particle_class = "";
6174 string config_OnFire_entry = config_OnFire_class + particle_class;
6175 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6176 WPOF_array.Insert(WPOF);
6177 }
6178
6179
6181 }
6182 }
6183
6185 {
6186 config_to_search = "CfgWeapons";
6187 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6188
6189 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6190
6192
6193 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6194 {
6195 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6196
6197 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6198 {
6199 string particle_class2 = "";
6201 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6202 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6203 WPOBE_array.Insert(WPOBE);
6204 }
6205
6206
6208 }
6209 }
6210 }
6211
6212
6214 {
6217
6219 {
6220 string config_to_search = "CfgVehicles";
6221
6222 if (IsInherited(Weapon))
6223 config_to_search = "CfgWeapons";
6224
6225 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6226 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6227
6228 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6229 {
6230
6232
6234 {
6236 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6238 return;
6239 }
6240
6243
6244
6245
6247 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6248
6249 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6250 {
6251 string particle_class = "";
6253 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6255
6256 if (entry_type == CT_CLASS)
6257 {
6258 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6259 WPOOH_array.Insert(WPOF);
6260 }
6261 }
6262
6263
6265 }
6266 }
6267 }
6268
6270 {
6272 }
6273
6275 {
6277 {
6279
6282
6285
6286 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6287 }
6288 }
6289
6291 {
6293 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6294
6296 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6297
6299 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6300
6302 {
6304 }
6305 }
6306
6308 {
6310 }
6311
6313 {
6316 else
6318
6320 {
6323 }
6324 else
6325 {
6328
6331 }
6332
6334 }
6335
6337 {
6339 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6340 }
6341
6343 {
6345 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6347 }
6348
6350 {
6352 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6353 }
6354
6356 {
6359
6360 OverheatingParticle OP = new OverheatingParticle();
6365
6367 }
6368
6370 {
6373
6374 return -1;
6375 }
6376
6378 {
6380 {
6383
6384 for (int i = count; i > 0; --i)
6385 {
6386 int id = i - 1;
6389
6392
6393 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6394 {
6395 if (p)
6396 {
6399 }
6400 }
6401 }
6402 }
6403 }
6404
6406 {
6408 {
6410 {
6411 int id = i - 1;
6413
6414 if (OP)
6415 {
6417
6418 if (p)
6419 {
6421 }
6422
6423 delete OP;
6424 }
6425 }
6426
6429 }
6430 }
6431
6434 {
6435 return 0.0;
6436 }
6437
6438
6440 {
6441 return 250;
6442 }
6443
6445 {
6446 return 0;
6447 }
6448
6451 {
6453 return true;
6454
6455 return false;
6456 }
6457
6460 {
6463
6465 {
6467 }
6468 else
6469 {
6470
6472 }
6473
6475 }
6476
6483 {
6484 return -1;
6485 }
6486
6487
6488
6489
6491 {
6493 {
6495 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6496
6497 if (r_index >= 0)
6498 {
6499 InventoryLocation r_il = new InventoryLocation;
6500 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6501
6502 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6505 {
6506 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6507 }
6509 {
6510 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6511 }
6512
6513 }
6514
6515 player.GetHumanInventory().ClearUserReservedLocation(this);
6516 }
6517
6520 }
6521
6522
6523
6524
6526 {
6527 return ItemBase.m_DebugActionsMask;
6528 }
6529
6531 {
6532 return ItemBase.m_DebugActionsMask & mask;
6533 }
6534
6536 {
6537 ItemBase.m_DebugActionsMask = mask;
6538 }
6539
6541 {
6542 ItemBase.m_DebugActionsMask |= mask;
6543 }
6544
6546 {
6547 ItemBase.m_DebugActionsMask &= ~mask;
6548 }
6549
6551 {
6553 {
6555 }
6556 else
6557 {
6559 }
6560 }
6561
6562
6564 {
6565 if (GetEconomyProfile())
6566 {
6567 float q_max = GetEconomyProfile().GetQuantityMax();
6568 if (q_max > 0)
6569 {
6570 float q_min = GetEconomyProfile().GetQuantityMin();
6571 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6572
6574 {
6575 ComponentEnergyManager comp = GetCompEM();
6577 {
6579 }
6580 }
6582 {
6584
6585 }
6586
6587 }
6588 }
6589 }
6590
6593 {
6594 EntityAI parent = GetHierarchyParent();
6595
6596 if (parent)
6597 {
6598 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6599 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6600 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6601 }
6602 }
6603
6606 {
6607 EntityAI parent = GetHierarchyParent();
6608
6609 if (parent)
6610 {
6611 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6612 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6613 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6614 }
6615 }
6616
6618 {
6619
6620
6621
6622
6624
6626 {
6627 if (ScriptInputUserData.CanStoreInputUserData())
6628 {
6629 ScriptInputUserData ctx = new ScriptInputUserData;
6635 ctx.
Write(use_stack_max);
6638
6640 {
6641 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6642 }
6643 }
6644 }
6645 else if (!
GetGame().IsMultiplayer())
6646 {
6648 }
6649 }
6650
6652 {
6654 }
6655
6657 {
6659 }
6660
6662 {
6664 }
6665
6667 {
6668
6669 return false;
6670 }
6671
6673 {
6674 return false;
6675 }
6676
6680 {
6681 return false;
6682 }
6683
6685 {
6686 return "";
6687 }
6688
6690
6692 {
6693 return false;
6694 }
6695
6697 {
6698 return true;
6699 }
6700
6701
6702
6704 {
6705 return true;
6706 }
6707
6709 {
6710 return true;
6711 }
6712
6714 {
6715 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6717 }
6718
6720 {
6722 }
6723
6725 {
6727 if (!is_being_placed)
6729 SetSynchDirty();
6730 }
6731
6732
6734
6736 {
6738 }
6739
6741 {
6743 }
6744
6746 {
6747 return 1;
6748 }
6749
6751 {
6752 return false;
6753 }
6754
6756 {
6758 SetSynchDirty();
6759 }
6760
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
6796 {
6797 super.OnMovedInsideCargo(container);
6798
6799 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6800 }
6801
6802 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6803 {
6804 super.EEItemLocationChanged(oldLoc,newLoc);
6805
6806 PlayerBase new_player = null;
6807 PlayerBase old_player = null;
6808
6809 if (newLoc.GetParent())
6810 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6811
6812 if (oldLoc.GetParent())
6813 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6814
6816 {
6817 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6818
6819 if (r_index >= 0)
6820 {
6821 InventoryLocation r_il = new InventoryLocation;
6822 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6823
6824 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6827 {
6828 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6829 }
6831 {
6832 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6833 }
6834
6835 }
6836 }
6837
6839 {
6840 if (new_player)
6841 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6842
6843 if (new_player == old_player)
6844 {
6845
6846 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6847 {
6849 {
6850 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6851 {
6852 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6853 }
6854 }
6855 else
6856 {
6857 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6858 }
6859 }
6860
6861 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6862 {
6863 int type = oldLoc.GetType();
6865 {
6866 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6867 }
6869 {
6870 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6871 }
6872 }
6873 if (!m_OldLocation)
6874 {
6875 m_OldLocation = new InventoryLocation;
6876 }
6877 m_OldLocation.Copy(oldLoc);
6878 }
6879 else
6880 {
6881 if (m_OldLocation)
6882 {
6883 m_OldLocation.Reset();
6884 }
6885 }
6886
6888 }
6889 else
6890 {
6891 if (new_player)
6892 {
6893 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6894 if (res_index >= 0)
6895 {
6896 InventoryLocation il = new InventoryLocation;
6897 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6899 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6902 {
6903 il.
GetParent().GetOnReleaseLock().Invoke(it);
6904 }
6906 {
6908 }
6909
6910 }
6911 }
6913 {
6914
6916 }
6917
6918 if (m_OldLocation)
6919 {
6920 m_OldLocation.Reset();
6921 }
6922 }
6923 }
6924
6925 override void EOnContact(IEntity other, Contact extra)
6926 {
6928 {
6929 int liquidType = -1;
6931 if (impactSpeed > 0.0)
6932 {
6934 #ifndef SERVER
6936 #else
6938 SetSynchDirty();
6939 #endif
6941 }
6942 }
6943
6944 #ifdef SERVER
6945 if (GetCompEM() && GetCompEM().IsPlugged())
6946 {
6947 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6948 GetCompEM().UnplugThis();
6949 }
6950 #endif
6951 }
6952
6954
6956 {
6958 }
6959
6961 {
6962
6963 }
6964
6966 {
6967 super.OnItemLocationChanged(old_owner, new_owner);
6968
6969 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6970 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6971
6972 if (!relatedPlayer && playerNew)
6973 relatedPlayer = playerNew;
6974
6975 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6976 {
6978 if (actionMgr)
6979 {
6980 ActionBase currentAction = actionMgr.GetRunningAction();
6981 if (currentAction)
6983 }
6984 }
6985
6986 Man ownerPlayerOld = null;
6987 Man ownerPlayerNew = null;
6988
6989 if (old_owner)
6990 {
6991 if (old_owner.
IsMan())
6992 {
6993 ownerPlayerOld = Man.Cast(old_owner);
6994 }
6995 else
6996 {
6997 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6998 }
6999 }
7000 else
7001 {
7003 {
7005
7006 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7007 {
7008 GetCompEM().UnplugThis();
7009 }
7010 }
7011 }
7012
7013 if (new_owner)
7014 {
7015 if (new_owner.
IsMan())
7016 {
7017 ownerPlayerNew = Man.Cast(new_owner);
7018 }
7019 else
7020 {
7021 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7022 }
7023 }
7024
7025 if (ownerPlayerOld != ownerPlayerNew)
7026 {
7027 if (ownerPlayerOld)
7028 {
7029 array<EntityAI> subItemsExit = new array<EntityAI>;
7031 for (int i = 0; i < subItemsExit.Count(); i++)
7032 {
7035 }
7036 }
7037
7038 if (ownerPlayerNew)
7039 {
7040 array<EntityAI> subItemsEnter = new array<EntityAI>;
7042 for (int j = 0; j < subItemsEnter.Count(); j++)
7043 {
7046 }
7047 }
7048 }
7049 else if (ownerPlayerNew != null)
7050 {
7051 PlayerBase nplayer;
7052 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7053 {
7054 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7056 for (int k = 0; k < subItemsUpdate.Count(); k++)
7057 {
7059 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7060 }
7061 }
7062 }
7063
7064 if (old_owner)
7065 old_owner.OnChildItemRemoved(this);
7066 if (new_owner)
7067 new_owner.OnChildItemReceived(this);
7068 }
7069
7070
7072 {
7073 super.EEDelete(parent);
7074 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7075 if (player)
7076 {
7078
7079 if (player.IsAlive())
7080 {
7081 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7082 if (r_index >= 0)
7083 {
7084 InventoryLocation r_il = new InventoryLocation;
7085 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7086
7087 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7090 {
7091 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7092 }
7094 {
7095 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7096 }
7097
7098 }
7099
7100 player.RemoveQuickBarEntityShortcut(this);
7101 }
7102 }
7103 }
7104
7106 {
7107 super.EEKilled(killer);
7108
7111 {
7112 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7113 {
7114 if (IsMagazine())
7115 {
7116 if (Magazine.Cast(this).GetAmmoCount() > 0)
7117 {
7119 }
7120 }
7121 else
7122 {
7124 }
7125 }
7126 }
7127 }
7128
7130 {
7131 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7132
7133 super.OnWasAttached(parent, slot_id);
7134
7137
7139 }
7140
7142 {
7143 super.OnWasDetached(parent, slot_id);
7144
7147 }
7148
7150 {
7151 int idx;
7154
7155 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7156 if (inventory_slots.Count() < 1)
7157 {
7158 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7159 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7160 }
7161 else
7162 {
7163 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7164 }
7165
7166 idx = inventory_slots.Find(slot);
7167 if (idx < 0)
7168 return "";
7169
7170 return attach_types.Get(idx);
7171 }
7172
7174 {
7175 int idx = -1;
7176 string slot;
7177
7180
7181 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7182 if (inventory_slots.Count() < 1)
7183 {
7184 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7185 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7186 }
7187 else
7188 {
7189 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7190 if (detach_types.Count() < 1)
7191 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7192 }
7193
7194 for (int i = 0; i < inventory_slots.Count(); i++)
7195 {
7196 slot = inventory_slots.Get(i);
7197 }
7198
7199 if (slot != "")
7200 {
7201 if (detach_types.Count() == 1)
7202 idx = 0;
7203 else
7204 idx = inventory_slots.Find(slot);
7205 }
7206 if (idx < 0)
7207 return "";
7208
7209 return detach_types.Get(idx);
7210 }
7211
7213 {
7214
7216
7217
7218 float min_time = 1;
7219 float max_time = 3;
7220 float delay = Math.RandomFloat(min_time, max_time);
7221
7222 explode_timer.Run(delay, this, "DoAmmoExplosion");
7223 }
7224
7226 {
7227 Magazine magazine = Magazine.Cast(this);
7228 int pop_sounds_count = 6;
7229 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7230
7231
7232 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7233 string sound_name = pop_sounds[ sound_idx ];
7235
7236
7237 magazine.ServerAddAmmoCount(-1);
7238
7239
7240 float min_temp_to_explode = 100;
7241
7242 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7243 {
7245 }
7246 }
7247
7248
7249 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7250 {
7251 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7252
7253 const int CHANCE_DAMAGE_CARGO = 4;
7254 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7255 const int CHANCE_DAMAGE_NOTHING = 2;
7256
7258 {
7259 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7260 int chances;
7261 int rnd;
7262
7263 if (GetInventory().GetCargo())
7264 {
7265 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7266 rnd = Math.RandomInt(0,chances);
7267
7268 if (rnd < CHANCE_DAMAGE_CARGO)
7269 {
7271 }
7272 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7273 {
7275 }
7276 }
7277 else
7278 {
7279 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7280 rnd = Math.RandomInt(0,chances);
7281
7282 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7283 {
7285 }
7286 }
7287 }
7288 }
7289
7291 {
7292 if (GetInventory().GetCargo())
7293 {
7294 int item_count = GetInventory().GetCargo().GetItemCount();
7295 if (item_count > 0)
7296 {
7297 int random_pick = Math.RandomInt(0, item_count);
7299 if (!item.IsExplosive())
7300 {
7301 item.AddHealth("","",damage);
7302 return true;
7303 }
7304 }
7305 }
7306 return false;
7307 }
7308
7310 {
7311 int attachment_count = GetInventory().AttachmentCount();
7312 if (attachment_count > 0)
7313 {
7314 int random_pick = Math.RandomInt(0, attachment_count);
7315 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7316 if (!attachment.IsExplosive())
7317 {
7318 attachment.AddHealth("","",damage);
7319 return true;
7320 }
7321 }
7322 return false;
7323 }
7324
7326 {
7328 }
7329
7331 {
7333 return GetInventory().CanRemoveEntity();
7334
7335 return false;
7336 }
7337
7339 {
7341 return;
7342
7344 {
7345 if (ScriptInputUserData.CanStoreInputUserData())
7346 {
7347 ScriptInputUserData ctx = new ScriptInputUserData;
7352 ctx.
Write(destination_entity);
7356 }
7357 }
7358 else if (!
GetGame().IsMultiplayer())
7359 {
7361 }
7362 }
7363
7365 {
7367 return;
7368
7369 float split_quantity_new;
7373 InventoryLocation loc = new InventoryLocation;
7374
7375 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7376 {
7378 split_quantity_new = stack_max;
7379 else
7381
7382 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7383 if (new_item)
7384 {
7385 new_item.SetResultOfSplit(true);
7386 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7388 new_item.SetQuantity(split_quantity_new);
7389 }
7390 }
7391 else if (destination_entity && slot_id == -1)
7392 {
7393 if (quantity > stack_max)
7394 split_quantity_new = stack_max;
7395 else
7396 split_quantity_new = quantity;
7397
7399 {
7402 }
7403
7404 if (new_item)
7405 {
7406 new_item.SetResultOfSplit(true);
7407 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7409 new_item.SetQuantity(split_quantity_new);
7410 }
7411 }
7412 else
7413 {
7414 if (stack_max != 0)
7415 {
7417 {
7419 }
7420
7421 if (split_quantity_new == 0)
7422 {
7423 if (!
GetGame().IsMultiplayer())
7424 player.PhysicalPredictiveDropItem(this);
7425 else
7426 player.ServerDropEntity(this);
7427 return;
7428 }
7429
7431
7432 if (new_item)
7433 {
7434 new_item.SetResultOfSplit(true);
7435 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7437 new_item.SetQuantity(stack_max);
7438 new_item.PlaceOnSurface();
7439 }
7440 }
7441 }
7442 }
7443
7445 {
7447 return;
7448
7449 float split_quantity_new;
7453 InventoryLocation loc = new InventoryLocation;
7454
7455 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7456 {
7458 split_quantity_new = stack_max;
7459 else
7461
7462 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7463 if (new_item)
7464 {
7465 new_item.SetResultOfSplit(true);
7466 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7468 new_item.SetQuantity(split_quantity_new);
7469 }
7470 }
7471 else if (destination_entity && slot_id == -1)
7472 {
7473 if (quantity > stack_max)
7474 split_quantity_new = stack_max;
7475 else
7476 split_quantity_new = quantity;
7477
7479 {
7482 }
7483
7484 if (new_item)
7485 {
7486 new_item.SetResultOfSplit(true);
7487 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7489 new_item.SetQuantity(split_quantity_new);
7490 }
7491 }
7492 else
7493 {
7494 if (stack_max != 0)
7495 {
7497 {
7499 }
7500
7502
7503 if (new_item)
7504 {
7505 new_item.SetResultOfSplit(true);
7506 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7508 new_item.SetQuantity(stack_max);
7509 new_item.PlaceOnSurface();
7510 }
7511 }
7512 }
7513 }
7514
7516 {
7518 return;
7519
7521 {
7522 if (ScriptInputUserData.CanStoreInputUserData())
7523 {
7524 ScriptInputUserData ctx = new ScriptInputUserData;
7529 dst.WriteToContext(ctx);
7531 }
7532 }
7533 else if (!
GetGame().IsMultiplayer())
7534 {
7536 }
7537 }
7538
7540 {
7542 return;
7543
7545 {
7546 if (ScriptInputUserData.CanStoreInputUserData())
7547 {
7548 ScriptInputUserData ctx = new ScriptInputUserData;
7553 ctx.
Write(destination_entity);
7559 }
7560 }
7561 else if (!
GetGame().IsMultiplayer())
7562 {
7564 }
7565 }
7566
7568 {
7570 }
7571
7573 {
7575 return this;
7576
7578 float split_quantity_new;
7580 if (dst.IsValid())
7581 {
7582 int slot_id = dst.GetSlot();
7584
7585 if (quantity > stack_max)
7586 split_quantity_new = stack_max;
7587 else
7588 split_quantity_new = quantity;
7589
7591
7592 if (new_item)
7593 {
7594 new_item.SetResultOfSplit(true);
7595 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7598 }
7599
7600 return new_item;
7601 }
7602
7603 return null;
7604 }
7605
7607 {
7609 return;
7610
7612 float split_quantity_new;
7614 if (destination_entity)
7615 {
7617 if (quantity > stackable)
7618 split_quantity_new = stackable;
7619 else
7620 split_quantity_new = quantity;
7621
7622 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7623 if (new_item)
7624 {
7625 new_item.SetResultOfSplit(true);
7626 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7628 new_item.SetQuantity(split_quantity_new);
7629 }
7630 }
7631 }
7632
7634 {
7636 return;
7637
7639 {
7640 if (ScriptInputUserData.CanStoreInputUserData())
7641 {
7642 ScriptInputUserData ctx = new ScriptInputUserData;
7647 ItemBase destination_entity =
this;
7648 ctx.
Write(destination_entity);
7652 }
7653 }
7654 else if (!
GetGame().IsMultiplayer())
7655 {
7657 }
7658 }
7659
7661 {
7663 return;
7664
7666 float split_quantity_new;
7668 if (player)
7669 {
7671 if (quantity > stackable)
7672 split_quantity_new = stackable;
7673 else
7674 split_quantity_new = quantity;
7675
7676 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7677 new_item =
ItemBase.Cast(in_hands);
7678 if (new_item)
7679 {
7680 new_item.SetResultOfSplit(true);
7681 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7683 new_item.SetQuantity(split_quantity_new);
7684 }
7685 }
7686 }
7687
7689 {
7691 return;
7692
7694 float split_quantity_new = Math.Floor(quantity * 0.5);
7695
7697
7698 if (new_item)
7699 {
7700 if (new_item.GetQuantityMax() < split_quantity_new)
7701 {
7702 split_quantity_new = new_item.GetQuantityMax();
7703 }
7704
7705 new_item.SetResultOfSplit(true);
7706 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7707
7709 {
7712 }
7713 else
7714 {
7717 }
7718 }
7719 }
7720
7722 {
7724 return;
7725
7727 float split_quantity_new = Math.Floor(quantity / 2);
7728
7729 InventoryLocation invloc = new InventoryLocation;
7731
7733 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7734
7735 if (new_item)
7736 {
7737 if (new_item.GetQuantityMax() < split_quantity_new)
7738 {
7739 split_quantity_new = new_item.GetQuantityMax();
7740 }
7742 {
7745 }
7746 else
7747 {
7750 }
7751 }
7752 }
7753
7756 {
7757 SetWeightDirty();
7759
7760 if (parent)
7761 parent.OnAttachmentQuantityChangedEx(this, delta);
7762
7764 {
7766 {
7768 }
7770 {
7771 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7773 }
7774 }
7775
7776 }
7777
7780 {
7781
7782 }
7783
7786 {
7788 }
7789
7791 {
7792 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7793
7795 {
7796 if (newLevel == GameConstants.STATE_RUINED)
7797 {
7799 EntityAI parent = GetHierarchyParent();
7800 if (parent && parent.IsFireplace())
7801 {
7802 CargoBase cargo = GetInventory().GetCargo();
7803 if (cargo)
7804 {
7806 {
7808 }
7809 }
7810 }
7811 }
7812
7814 {
7815
7817 return;
7818 }
7819
7820 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7821 {
7823 }
7824 }
7825 }
7826
7827
7829 {
7830 super.OnRightClick();
7831
7833 {
7835 {
7836 if (ScriptInputUserData.CanStoreInputUserData())
7837 {
7838 vector m4[4];
7840
7841 EntityAI root = GetHierarchyRoot();
7842
7843 InventoryLocation dst = new InventoryLocation;
7845 {
7846 if (root)
7847 {
7848 root.GetTransform(m4);
7850 }
7851 else
7852 GetInventory().GetCurrentInventoryLocation(dst);
7853 }
7854 else
7855 {
7857
7858
7859 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7860 {
7861 if (root)
7862 {
7863 root.GetTransform(m4);
7865 }
7866 else
7867 GetInventory().GetCurrentInventoryLocation(dst);
7868 }
7869 else
7870 {
7871 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7872 }
7873 }
7874
7875 ScriptInputUserData ctx = new ScriptInputUserData;
7883 }
7884 }
7885 else if (!
GetGame().IsMultiplayer())
7886 {
7888 }
7889 }
7890 }
7891
7892 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7893 {
7894
7895 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7896 return false;
7897
7898 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7899 return false;
7900
7901
7903 return false;
7904
7905
7906 Magazine mag = Magazine.Cast(this);
7907 if (mag)
7908 {
7909 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7910 return false;
7911
7912 if (stack_max_limit)
7913 {
7914 Magazine other_mag = Magazine.Cast(other_item);
7915 if (other_item)
7916 {
7917 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7918 return false;
7919 }
7920
7921 }
7922 }
7923 else
7924 {
7925
7927 return false;
7928
7930 return false;
7931 }
7932
7933 PlayerBase player = null;
7934 if (CastTo(player, GetHierarchyRootPlayer()))
7935 {
7936 if (player.GetInventory().HasAttachment(this))
7937 return false;
7938
7939 if (player.IsItemsToDelete())
7940 return false;
7941 }
7942
7943 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7944 return false;
7945
7946 int slotID;
7948 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7949 return false;
7950
7951 return true;
7952 }
7953
7955 {
7957 }
7958
7960 {
7961 return m_IsResultOfSplit;
7962 }
7963
7965 {
7966 m_IsResultOfSplit = value;
7967 }
7968
7970 {
7972 }
7973
7975 {
7976 float other_item_quantity = other_item.GetQuantity();
7977 float this_free_space;
7978
7980
7982
7983 if (other_item_quantity > this_free_space)
7984 {
7985 return this_free_space;
7986 }
7987 else
7988 {
7989 return other_item_quantity;
7990 }
7991 }
7992
7994 {
7996 }
7997
7999 {
8001 return;
8002
8003 if (!IsMagazine() && other_item)
8004 {
8006 if (quantity_used != 0)
8007 {
8008 float hp1 = GetHealth01("","");
8009 float hp2 = other_item.GetHealth01("","");
8010 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8011 hpResult = hpResult / (
GetQuantity() + quantity_used);
8012
8013 hpResult *= GetMaxHealth();
8014 Math.Round(hpResult);
8015 SetHealth("", "Health", hpResult);
8016
8018 other_item.AddQuantity(-quantity_used);
8019 }
8020 }
8022 }
8023
8025 {
8026 #ifdef SERVER
8027 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8028 GetHierarchyParent().IncreaseLifetimeUp();
8029 #endif
8030 };
8031
8033 {
8034 PlayerBase p = PlayerBase.Cast(player);
8035
8036 array<int> recipesIds = p.m_Recipes;
8037 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8038 if (moduleRecipesManager)
8039 {
8040 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8041 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8042 }
8043
8044 for (int i = 0;i < recipesIds.Count(); i++)
8045 {
8046 int key = recipesIds.Get(i);
8047 string recipeName = moduleRecipesManager.GetRecipeName(key);
8049 }
8050 }
8051
8052
8053 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8054 {
8055 super.GetDebugActions(outputList);
8056
8057
8062
8063
8067
8071
8072
8075
8076
8078 {
8081 }
8082
8084
8087
8091 }
8092
8093
8094
8095
8097 {
8098 super.OnAction(action_id, player, ctx);
8099 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8100 {
8101 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8102 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8103 PlayerBase p = PlayerBase.Cast(player);
8104 if (
EActions.RECIPES_RANGE_START < 1000)
8105 {
8106 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8107 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8108 }
8109 }
8110 #ifndef SERVER
8111 else if (action_id ==
EActions.WATCH_PLAYER)
8112 {
8113 PluginDeveloper.SetDeveloperItemClientEx(player);
8114 }
8115 #endif
8117 {
8118 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8119 {
8120 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8121 OnDebugButtonPressServer(id + 1);
8122 }
8123
8124 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8125 {
8126 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8128 }
8129
8130 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8131 {
8132 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8134 }
8135
8136 else if (action_id ==
EActions.ADD_QUANTITY)
8137 {
8138 if (IsMagazine())
8139 {
8140 Magazine mag = Magazine.Cast(this);
8141 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8142 }
8143 else
8144 {
8146 }
8147
8148 if (m_EM)
8149 {
8150 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8151 }
8152
8153 }
8154
8155 else if (action_id ==
EActions.REMOVE_QUANTITY)
8156 {
8157 if (IsMagazine())
8158 {
8159 Magazine mag2 = Magazine.Cast(this);
8160 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8161 }
8162 else
8163 {
8165 }
8166 if (m_EM)
8167 {
8168 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8169 }
8170
8171 }
8172
8173 else if (action_id ==
EActions.SET_QUANTITY_0)
8174 {
8176
8177 if (m_EM)
8178 {
8179 m_EM.SetEnergy(0);
8180 }
8181 }
8182
8183 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8184 {
8186
8187 if (m_EM)
8188 {
8189 m_EM.SetEnergy(m_EM.GetEnergyMax());
8190 }
8191 }
8192
8193 else if (action_id ==
EActions.ADD_HEALTH)
8194 {
8195 AddHealth("","",GetMaxHealth("","Health")/5);
8196 }
8197 else if (action_id ==
EActions.REMOVE_HEALTH)
8198 {
8199 AddHealth("","",-GetMaxHealth("","Health")/5);
8200 }
8201 else if (action_id ==
EActions.DESTROY_HEALTH)
8202 {
8203 SetHealth01("","",0);
8204 }
8205 else if (action_id ==
EActions.WATCH_ITEM)
8206 {
8208 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8209 #ifdef DEVELOPER
8210 SetDebugDeveloper_item(this);
8211 #endif
8212 }
8213
8214 else if (action_id ==
EActions.ADD_TEMPERATURE)
8215 {
8216 AddTemperature(20);
8217
8218 }
8219
8220 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8221 {
8222 AddTemperature(-20);
8223
8224 }
8225
8226 else if (action_id ==
EActions.FLIP_FROZEN)
8227 {
8228 SetFrozen(!GetIsFrozen());
8229
8230 }
8231
8232 else if (action_id ==
EActions.ADD_WETNESS)
8233 {
8235
8236 }
8237
8238 else if (action_id ==
EActions.REMOVE_WETNESS)
8239 {
8241
8242 }
8243
8244 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8245 {
8248
8249
8250 }
8251
8252 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8253 {
8256 }
8257
8258 else if (action_id ==
EActions.MAKE_SPECIAL)
8259 {
8260 auto debugParams = DebugSpawnParams.WithPlayer(player);
8261 OnDebugSpawnEx(debugParams);
8262 }
8263
8264 else if (action_id ==
EActions.DELETE)
8265 {
8266 Delete();
8267 }
8268
8269 }
8270
8271
8272 return false;
8273 }
8274
8275
8276
8277
8281
8284
8285
8286
8288 {
8289 return false;
8290 }
8291
8292
8294 {
8295 return true;
8296 }
8297
8298
8300 {
8301 return true;
8302 }
8303
8304
8305
8307 {
8308 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8310 }
8311
8314 {
8315 return null;
8316 }
8317
8319 {
8320 return false;
8321 }
8322
8324 {
8325 return false;
8326 }
8327
8331
8332
8334 {
8335 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8336 return module_repairing.CanRepair(this, item_repair_kit);
8337 }
8338
8339
8340 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8341 {
8342 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8343 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8344 }
8345
8346
8348 {
8349
8350
8351
8352
8353
8354
8355
8356
8357 return 1;
8358 }
8359
8360
8361
8363 {
8365 }
8366
8367
8368
8370 {
8372 }
8373
8374
8383 {
8384 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8385
8386 if (player)
8387 {
8388 player.MessageStatus(text);
8389 }
8390 }
8391
8392
8401 {
8402 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8403
8404 if (player)
8405 {
8406 player.MessageAction(text);
8407 }
8408 }
8409
8410
8419 {
8420 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8421
8422 if (player)
8423 {
8424 player.MessageFriendly(text);
8425 }
8426 }
8427
8428
8437 {
8438 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8439
8440 if (player)
8441 {
8442 player.MessageImportant(text);
8443 }
8444 }
8445
8447 {
8448 return true;
8449 }
8450
8451
8452 override bool KindOf(
string tag)
8453 {
8454 bool found = false;
8455 string item_name = this.
GetType();
8458
8459 int array_size = item_tag_array.Count();
8460 for (int i = 0; i < array_size; i++)
8461 {
8462 if (item_tag_array.Get(i) == tag)
8463 {
8464 found = true;
8465 break;
8466 }
8467 }
8468 return found;
8469 }
8470
8471
8473 {
8474
8475 super.OnRPC(sender, rpc_type,ctx);
8476
8477
8478 switch (rpc_type)
8479 {
8480 #ifndef SERVER
8481 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8482 Param2<bool, string> p = new Param2<bool, string>(false, "");
8483
8485 return;
8486
8487 bool play = p.param1;
8488 string soundSet = p.param2;
8489
8490 if (play)
8491 {
8493 {
8495 {
8497 }
8498 }
8499 else
8500 {
8502 }
8503 }
8504 else
8505 {
8507 }
8508
8509 break;
8510 #endif
8511
8512 }
8513
8515 {
8517 }
8518 }
8519
8520
8521
8522
8524 {
8525 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8526 return plugin.GetID(
name);
8527 }
8528
8530 {
8531 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8532 return plugin.GetName(id);
8533 }
8534
8537 {
8538
8539
8540 int varFlags;
8541 if (!ctx.
Read(varFlags))
8542 return;
8543
8544 if (varFlags & ItemVariableFlags.FLOAT)
8545 {
8547 }
8548 }
8549
8551 {
8552
8553 super.SerializeNumericalVars(floats_out);
8554
8555
8556
8558 {
8560 }
8561
8563 {
8565 }
8566
8568 {
8570 }
8571
8573 {
8578 }
8579
8581 {
8583 }
8584 }
8585
8587 {
8588
8589 super.DeSerializeNumericalVars(floats);
8590
8591
8592 int index = 0;
8593 int mask = Math.Round(floats.Get(index));
8594
8595 index++;
8596
8598 {
8600 {
8602 }
8603 else
8604 {
8605 float quantity = floats.Get(index);
8607 }
8608 index++;
8609 }
8610
8612 {
8613 float wet = floats.Get(index);
8615 index++;
8616 }
8617
8619 {
8620 int liquidtype = Math.Round(floats.Get(index));
8622 index++;
8623 }
8624
8626 {
8628 index++;
8630 index++;
8632 index++;
8634 index++;
8635 }
8636
8638 {
8639 int cleanness = Math.Round(floats.Get(index));
8641 index++;
8642 }
8643 }
8644
8646 {
8647 super.WriteVarsToCTX(ctx);
8648
8649
8651 {
8653 }
8654
8656 {
8658 }
8659
8661 {
8663 }
8664
8666 {
8667 int r,g,b,a;
8673 }
8674
8676 {
8678 }
8679 }
8680
8682 {
8683 if (!super.ReadVarsFromCTX(ctx,version))
8684 return false;
8685
8686 int intValue;
8687 float value;
8688
8689 if (version < 140)
8690 {
8691 if (!ctx.
Read(intValue))
8692 return false;
8693
8694 m_VariablesMask = intValue;
8695 }
8696
8698 {
8699 if (!ctx.
Read(value))
8700 return false;
8701
8703 {
8705 }
8706 else
8707 {
8709 }
8710 }
8711
8712 if (version < 140)
8713 {
8715 {
8716 if (!ctx.
Read(value))
8717 return false;
8718 SetTemperatureDirect(value);
8719 }
8720 }
8721
8723 {
8724 if (!ctx.
Read(value))
8725 return false;
8727 }
8728
8730 {
8731 if (!ctx.
Read(intValue))
8732 return false;
8734 }
8735
8737 {
8738 int r,g,b,a;
8740 return false;
8742 return false;
8744 return false;
8746 return false;
8747
8749 }
8750
8752 {
8753 if (!ctx.
Read(intValue))
8754 return false;
8756 }
8757
8758 if (version >= 138 && version < 140)
8759 {
8761 {
8762 if (!ctx.
Read(intValue))
8763 return false;
8764 SetFrozen(intValue);
8765 }
8766 }
8767
8768 return true;
8769 }
8770
8771
8773 {
8776 {
8778 }
8779
8780 if (!super.OnStoreLoad(ctx, version))
8781 {
8783 return false;
8784 }
8785
8786 if (version >= 114)
8787 {
8788 bool hasQuickBarIndexSaved;
8789
8790 if (!ctx.
Read(hasQuickBarIndexSaved))
8791 {
8793 return false;
8794 }
8795
8796 if (hasQuickBarIndexSaved)
8797 {
8798 int itmQBIndex;
8799
8800
8801 if (!ctx.
Read(itmQBIndex))
8802 {
8804 return false;
8805 }
8806
8807 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8808 if (itmQBIndex != -1 && parentPlayer)
8809 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8810 }
8811 }
8812 else
8813 {
8814
8815 PlayerBase player;
8816 int itemQBIndex;
8817 if (version ==
int.
MAX)
8818 {
8819 if (!ctx.
Read(itemQBIndex))
8820 {
8822 return false;
8823 }
8824 }
8825 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8826 {
8827
8828 if (!ctx.
Read(itemQBIndex))
8829 {
8831 return false;
8832 }
8833 if (itemQBIndex != -1 && player)
8834 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8835 }
8836 }
8837
8838 if (version < 140)
8839 {
8840
8841 if (!LoadVariables(ctx, version))
8842 {
8844 return false;
8845 }
8846 }
8847
8848
8850 {
8852 return false;
8853 }
8854 if (version >= 132)
8855 {
8857 if (raib)
8858 {
8860 {
8862 return false;
8863 }
8864 }
8865 }
8866
8868 return true;
8869 }
8870
8871
8872
8874 {
8875 super.OnStoreSave(ctx);
8876
8877 PlayerBase player;
8878 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8879 {
8881
8882 int itemQBIndex = -1;
8883 itemQBIndex = player.FindQuickBarEntityIndex(this);
8884 ctx.
Write(itemQBIndex);
8885 }
8886 else
8887 {
8889 }
8890
8892
8894 if (raib)
8895 {
8897 }
8898 }
8899
8900
8902 {
8903 super.AfterStoreLoad();
8904
8906 {
8908 }
8909
8911 {
8914 }
8915 }
8916
8918 {
8919 super.EEOnAfterLoad();
8920
8922 {
8924 }
8925
8928 }
8929
8931 {
8932 return false;
8933 }
8934
8935
8936
8938 {
8940 {
8941 #ifdef PLATFORM_CONSOLE
8942
8944 {
8946 if (menu)
8947 {
8949 }
8950 }
8951 #endif
8952 }
8953
8955 {
8958 }
8959
8961 {
8962 SetWeightDirty();
8964 }
8966 {
8969 }
8970
8972 {
8975 }
8977 {
8980 }
8981
8982 super.OnVariablesSynchronized();
8983 }
8984
8985
8986
8988 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8989 {
8990 if (!IsServerCheck(allow_client))
8991 return false;
8992
8994 return false;
8995
8998
8999 if (value <= (min + 0.001))
9000 value = min;
9001
9002 if (value == min)
9003 {
9004 if (destroy_config)
9005 {
9006 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9007 if (dstr)
9008 {
9010 this.Delete();
9011 return true;
9012 }
9013 }
9014 else if (destroy_forced)
9015 {
9017 this.Delete();
9018 return true;
9019 }
9020
9022 }
9023
9026
9028 {
9030
9031 if (delta)
9033 }
9034
9036
9037 return false;
9038 }
9039
9040
9042 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9043 {
9045 }
9046
9048 {
9051 }
9052
9054 {
9057 }
9058
9061 {
9062 float value_clamped = Math.Clamp(value, 0, 1);
9064 SetQuantity(result, destroy_config, destroy_forced);
9065 }
9066
9067
9070 {
9072 }
9073
9075 {
9077 }
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9089 {
9090 int slot = -1;
9091 if (GetInventory())
9092 {
9093 InventoryLocation il = new InventoryLocation;
9094 GetInventory().GetCurrentInventoryLocation(il);
9096 }
9097
9099 }
9100
9102 {
9103 float quantity_max = 0;
9104
9106 {
9107 if (attSlotID != -1)
9108 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9109
9110 if (quantity_max <= 0)
9112 }
9113
9114 if (quantity_max <= 0)
9116
9117 return quantity_max;
9118 }
9119
9121 {
9123 }
9124
9126 {
9128 }
9129
9130
9132 {
9134 }
9135
9137 {
9139 }
9140
9142 {
9144 }
9145
9146
9148 {
9149
9150 float weightEx = GetWeightEx();
9151 float special = GetInventoryAndCargoWeight();
9152 return weightEx - special;
9153 }
9154
9155
9157 {
9159 }
9160
9162 {
9164 {
9165 #ifdef DEVELOPER
9166 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9167 {
9168 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9170 }
9171 #endif
9172
9174 }
9175 else if (HasEnergyManager())
9176 {
9177 #ifdef DEVELOPER
9178 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9179 {
9180 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9181 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9182 }
9183 #endif
9184 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9185 }
9186 else
9187 {
9188 #ifdef DEVELOPER
9189 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9190 {
9191 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9192 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9193 }
9194 #endif
9195 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9196 }
9197 }
9198
9201 {
9202 int item_count = 0;
9204
9205 if (GetInventory().GetCargo() != NULL)
9206 {
9207 item_count = GetInventory().GetCargo().GetItemCount();
9208 }
9209
9210 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9211 {
9212 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9213 if (item)
9214 item_count += item.GetNumberOfItems();
9215 }
9216 return item_count;
9217 }
9218
9221 {
9222 float weight = 0;
9223 float wetness = 1;
9224 if (include_wetness)
9227 {
9228 weight = wetness * m_ConfigWeight;
9229 }
9231 {
9232 weight = 1;
9233 }
9234 return weight;
9235 }
9236
9237
9238
9240 {
9241 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9242 {
9243 GameInventory inv = GetInventory();
9244 array<EntityAI> items = new array<EntityAI>;
9246 for (int i = 0; i < items.Count(); i++)
9247 {
9249 if (item)
9250 {
9252 }
9253 }
9254 }
9255 }
9256
9257
9258
9259
9261 {
9262 float energy = 0;
9263 if (HasEnergyManager())
9264 {
9265 energy = GetCompEM().GetEnergy();
9266 }
9267 return energy;
9268 }
9269
9270
9272 {
9273 super.OnEnergyConsumed();
9274
9276 }
9277
9279 {
9280 super.OnEnergyAdded();
9281
9283 }
9284
9285
9287 {
9288 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9289 {
9291 {
9292 float energy_0to1 = GetCompEM().GetEnergy0To1();
9294 }
9295 }
9296 }
9297
9298
9300 {
9301 return ConfigGetFloat("heatIsolation");
9302 }
9303
9305 {
9307 }
9308
9310 {
9311 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9312 if (
GetGame().ConfigIsExisting(paramPath))
9314
9315 return 0.0;
9316 }
9317
9319 {
9320 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9321 if (
GetGame().ConfigIsExisting(paramPath))
9323
9324 return 0.0;
9325 }
9326
9327 override void SetWet(
float value,
bool allow_client =
false)
9328 {
9329 if (!IsServerCheck(allow_client))
9330 return;
9331
9334
9336
9337 m_VarWet = Math.Clamp(value, min, max);
9338
9340 {
9343 }
9344 }
9345
9346 override void AddWet(
float value)
9347 {
9349 }
9350
9352 {
9354 }
9355
9357 {
9359 }
9360
9362 {
9364 }
9365
9367 {
9369 }
9370
9372 {
9374 }
9375
9377 {
9380 if (newLevel != oldLevel)
9381 {
9383 }
9384 }
9385
9387 {
9388 SetWeightDirty();
9389 }
9390
9392 {
9393 return GetWetLevelInternal(
m_VarWet);
9394 }
9395
9396
9397
9399 {
9401 }
9402
9404 {
9406 }
9407
9409 {
9411 }
9412
9414 {
9416 }
9417
9418
9419
9421 {
9422 if (ConfigIsExisting("itemModelLength"))
9423 {
9424 return ConfigGetFloat("itemModelLength");
9425 }
9426 return 0;
9427 }
9428
9430 {
9431 if (ConfigIsExisting("itemAttachOffset"))
9432 {
9433 return ConfigGetFloat("itemAttachOffset");
9434 }
9435 return 0;
9436 }
9437
9438 override void SetCleanness(
int value,
bool allow_client =
false)
9439 {
9440 if (!IsServerCheck(allow_client))
9441 return;
9442
9444
9446
9449 }
9450
9452 {
9454 }
9455
9457 {
9458 return true;
9459 }
9460
9461
9462
9463
9465 {
9467 }
9468
9470 {
9472 }
9473
9474
9475
9476
9477 override void SetColor(
int r,
int g,
int b,
int a)
9478 {
9484 }
9486 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9487 {
9492 }
9493
9495 {
9497 }
9498
9501 {
9502 int r,g,b,a;
9504 r = r/255;
9505 g = g/255;
9506 b = b/255;
9507 a = a/255;
9508 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9509 }
9510
9511
9512
9513 override void SetLiquidType(
int value,
bool allow_client =
false)
9514 {
9515 if (!IsServerCheck(allow_client))
9516 return;
9517
9522 }
9523
9525 {
9526 return ConfigGetInt("varLiquidTypeInit");
9527 }
9528
9530 {
9532 }
9533
9535 {
9537 SetFrozen(false);
9538 }
9539
9542 {
9543 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9544 }
9545
9546
9549 {
9550 PlayerBase nplayer;
9551 if (PlayerBase.CastTo(nplayer, player))
9552 {
9554
9555 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9556 }
9557 }
9558
9559
9562 {
9563 PlayerBase nplayer;
9564 if (PlayerBase.CastTo(nplayer,player))
9565 {
9566
9567 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9568
9569 }
9570
9571
9572 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9573
9574
9575 if (HasEnergyManager())
9576 {
9577 GetCompEM().UpdatePlugState();
9578 }
9579 }
9580
9581
9583 {
9584 super.OnPlacementStarted(player);
9585
9587 }
9588
9589 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9590 {
9592 {
9593 m_AdminLog.OnPlacementComplete(player,
this);
9594 }
9595
9596 super.OnPlacementComplete(player, position, orientation);
9597 }
9598
9599
9600
9601
9602
9604 {
9606 {
9607 return true;
9608 }
9609 else
9610 {
9611 return false;
9612 }
9613 }
9614
9615
9617 {
9619 {
9621 }
9622 }
9623
9624
9626 {
9628 }
9629
9631 {
9633 }
9634
9635 override void InsertAgent(
int agent,
float count = 1)
9636 {
9637 if (count < 1)
9638 return;
9639
9641 }
9642
9645 {
9647 }
9648
9649
9651 {
9653 }
9654
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
9697 {
9699 return false;
9700 return true;
9701 }
9702
9704 {
9705
9707 }
9708
9709
9712 {
9713 super.CheckForRoofLimited(timeTresholdMS);
9714
9716 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9717 {
9718 m_PreviousRoofTestTime = time;
9719 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9720 }
9721 }
9722
9723
9725 {
9727 {
9728 return 0;
9729 }
9730
9731 if (GetInventory().GetAttachmentSlotsCount() != 0)
9732 {
9733 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9734 if (filter)
9735 return filter.GetProtectionLevel(type, false, system);
9736 else
9737 return 0;
9738 }
9739
9740 string subclassPath, entryName;
9741
9742 switch (type)
9743 {
9745 entryName = "biological";
9746 break;
9748 entryName = "chemical";
9749 break;
9750 default:
9751 entryName = "biological";
9752 break;
9753 }
9754
9755 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9756
9758 }
9759
9760
9761
9764 {
9765 if (!IsMagazine())
9767
9769 }
9770
9771
9772
9773
9774
9779 {
9780 return true;
9781 }
9782
9784 {
9786 }
9787
9788
9789
9790
9791
9793 {
9794 if (parent)
9795 {
9796 if (parent.IsInherited(DayZInfected))
9797 return true;
9798
9799 if (!parent.IsRuined())
9800 return true;
9801 }
9802
9803 return true;
9804 }
9805
9807 {
9808 if (!super.CanPutAsAttachment(parent))
9809 {
9810 return false;
9811 }
9812
9813 if (!IsRuined() && !parent.IsRuined())
9814 {
9815 return true;
9816 }
9817
9818 return false;
9819 }
9820
9822 {
9823
9824
9825
9826
9827 return super.CanReceiveItemIntoCargo(item);
9828 }
9829
9831 {
9832
9833
9834
9835
9836 GameInventory attachmentInv = attachment.GetInventory();
9838 {
9839 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9840 return false;
9841 }
9842
9843 InventoryLocation loc = new InventoryLocation();
9844 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9845 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9846 return false;
9847
9848 return super.CanReceiveAttachment(attachment, slotId);
9849 }
9850
9852 {
9853 if (!super.CanReleaseAttachment(attachment))
9854 return false;
9855
9856 return GetInventory().AreChildrenAccessible();
9857 }
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9880 {
9881 int id = muzzle_owner.GetMuzzleID();
9882 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9883
9884 if (WPOF_array)
9885 {
9886 for (int i = 0; i < WPOF_array.Count(); i++)
9887 {
9888 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9889
9890 if (WPOF)
9891 {
9892 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9893 }
9894 }
9895 }
9896 }
9897
9898
9900 {
9901 int id = muzzle_owner.GetMuzzleID();
9903
9904 if (WPOBE_array)
9905 {
9906 for (int i = 0; i < WPOBE_array.Count(); i++)
9907 {
9908 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9909
9910 if (WPOBE)
9911 {
9912 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9913 }
9914 }
9915 }
9916 }
9917
9918
9920 {
9921 int id = muzzle_owner.GetMuzzleID();
9922 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9923
9924 if (WPOOH_array)
9925 {
9926 for (int i = 0; i < WPOOH_array.Count(); i++)
9927 {
9928 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9929
9930 if (WPOOH)
9931 {
9932 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9933 }
9934 }
9935 }
9936 }
9937
9938
9940 {
9941 int id = muzzle_owner.GetMuzzleID();
9942 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9943
9944 if (WPOOH_array)
9945 {
9946 for (int i = 0; i < WPOOH_array.Count(); i++)
9947 {
9948 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9949
9950 if (WPOOH)
9951 {
9952 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9953 }
9954 }
9955 }
9956 }
9957
9958
9960 {
9961 int id = muzzle_owner.GetMuzzleID();
9962 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9963
9964 if (WPOOH_array)
9965 {
9966 for (int i = 0; i < WPOOH_array.Count(); i++)
9967 {
9968 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9969
9970 if (WPOOH)
9971 {
9972 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9973 }
9974 }
9975 }
9976 }
9977
9978
9979
9981 {
9983 {
9984 return true;
9985 }
9986
9987 return false;
9988 }
9989
9991 {
9993 {
9994 return true;
9995 }
9996
9997 return false;
9998 }
9999
10001 {
10003 {
10004 return true;
10005 }
10006
10007 return false;
10008 }
10009
10011 {
10012 return false;
10013 }
10014
10017 {
10018 return UATimeSpent.DEFAULT_DEPLOY;
10019 }
10020
10021
10022
10023
10025 {
10027 SetSynchDirty();
10028 }
10029
10031 {
10033 }
10034
10035
10037 {
10038 return false;
10039 }
10040
10043 {
10044 string att_type = "None";
10045
10046 if (ConfigIsExisting("soundAttType"))
10047 {
10048 att_type = ConfigGetString("soundAttType");
10049 }
10050
10052 }
10053
10055 {
10057 }
10058
10059
10060
10061
10062
10066
10068 {
10071
10073 }
10074
10075
10077 {
10079 return;
10080
10082
10085
10088
10089 SoundParameters params = new SoundParameters();
10093 }
10094
10095
10097 {
10099 return;
10100
10102 SetSynchDirty();
10103
10106 }
10107
10108
10110 {
10112 return;
10113
10115 SetSynchDirty();
10116
10119 }
10120
10122 {
10124 }
10125
10127 {
10129 }
10130
10133 {
10134 if (!
GetGame().IsDedicatedServer())
10135 {
10136 if (ConfigIsExisting("attachSoundSet"))
10137 {
10138 string cfg_path = "";
10139 string soundset = "";
10140 string type_name =
GetType();
10141
10144 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10145 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10146
10147 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10148 {
10149 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10150 {
10151 if (cfg_slot_array[i] == slot_type)
10152 {
10153 soundset = cfg_soundset_array[i];
10154 break;
10155 }
10156 }
10157 }
10158
10159 if (soundset != "")
10160 {
10161 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10163 }
10164 }
10165 }
10166 }
10167
10169 {
10170
10171 }
10172
10173 void OnApply(PlayerBase player);
10174
10176 {
10177 return 1.0;
10178 };
10179
10181 {
10183 }
10184
10186 {
10188 }
10189
10191
10193 {
10194 SetDynamicPhysicsLifeTime(0.01);
10196 }
10197
10199 {
10200 array<string> zone_names = new array<string>;
10201 GetDamageZones(zone_names);
10202 for (int i = 0; i < zone_names.Count(); i++)
10203 {
10204 SetHealthMax(zone_names.Get(i),"Health");
10205 }
10206 SetHealthMax("","Health");
10207 }
10208
10211 {
10212 float global_health = GetHealth01("","Health");
10213 array<string> zones = new array<string>;
10214 GetDamageZones(zones);
10215
10216 for (int i = 0; i < zones.Count(); i++)
10217 {
10218 SetHealth01(zones.Get(i),"Health",global_health);
10219 }
10220 }
10221
10224 {
10225 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10226 }
10227
10229 {
10230 if (!hasRootAsPlayer)
10231 {
10232 if (refParentIB)
10233 {
10234
10235 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10236 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10237
10238 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10239 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10240
10243 }
10244 else
10245 {
10246
10249 }
10250 }
10251 }
10252
10254 {
10256 {
10257 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10258 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10259 {
10260 float heatPermCoef = 1.0;
10262 while (ent)
10263 {
10264 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10265 ent = ent.GetHierarchyParent();
10266 }
10267
10268 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10269 }
10270 }
10271 }
10272
10274 {
10275
10276 EntityAI parent = GetHierarchyParent();
10277 if (!parent)
10278 {
10279 hasParent = false;
10280 hasRootAsPlayer = false;
10281 }
10282 else
10283 {
10284 hasParent = true;
10285 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10286 refParentIB =
ItemBase.Cast(parent);
10287 }
10288 }
10289
10290 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10291 {
10292
10293 }
10294
10296 {
10297
10298 return false;
10299 }
10300
10302 {
10303
10304
10305 return false;
10306 }
10307
10309 {
10310
10311 return false;
10312 }
10313
10316 {
10317 return !GetIsFrozen() &&
IsOpen();
10318 }
10319
10321 {
10322 bool hasParent = false, hasRootAsPlayer = false;
10324
10325 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10326 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10327
10328 if (wwtu || foodDecay)
10329 {
10333
10334 if (processWetness || processTemperature || processDecay)
10335 {
10337
10338 if (processWetness)
10339 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10340
10341 if (processTemperature)
10343
10344 if (processDecay)
10345 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10346 }
10347 }
10348 }
10349
10352 {
10354 }
10355
10357 {
10360
10361 return super.GetTemperatureFreezeThreshold();
10362 }
10363
10365 {
10368
10369 return super.GetTemperatureThawThreshold();
10370 }
10371
10373 {
10376
10377 return super.GetItemOverheatThreshold();
10378 }
10379
10381 {
10383 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10384
10385 return super.GetTemperatureFreezeTime();
10386 }
10387
10389 {
10391 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10392
10393 return super.GetTemperatureThawTime();
10394 }
10395
10400
10402 {
10403 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10404 }
10405
10407 {
10408 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10409 }
10410
10413 {
10415 }
10416
10418 {
10420 }
10421
10423 {
10425 }
10426
10429 {
10430 return null;
10431 }
10432
10435 {
10436 return false;
10437 }
10438
10440 {
10442 {
10445 if (!trg)
10446 {
10448 explosive = this;
10449 }
10450
10451 explosive.PairRemote(trg);
10453
10454 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10455 trg.SetPersistentPairID(persistentID);
10456 explosive.SetPersistentPairID(persistentID);
10457
10458 return true;
10459 }
10460 return false;
10461 }
10462
10465 {
10466 float ret = 1.0;
10469 ret *= GetHealth01();
10470
10471 return ret;
10472 }
10473
10474 #ifdef DEVELOPER
10475 override void SetDebugItem()
10476 {
10477 super.SetDebugItem();
10478 _itemBase = this;
10479 }
10480
10482 {
10483 string text = super.GetDebugText();
10484
10486 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10487
10488 return text;
10489 }
10490 #endif
10491
10493 {
10494 return true;
10495 }
10496
10498
10500
10502 {
10505 }
10506
10507
10515
10531}
10532
10534{
10536 if (entity)
10537 {
10538 bool is_item = entity.IsInherited(
ItemBase);
10539 if (is_item && full_quantity)
10540 {
10543 }
10544 }
10545 else
10546 {
10548 return NULL;
10549 }
10550 return entity;
10551}
10552
10554{
10555 if (item)
10556 {
10557 if (health > 0)
10558 item.SetHealth("", "", health);
10559
10560 if (item.CanHaveTemperature())
10561 {
10563 if (item.CanFreeze())
10564 item.SetFrozen(false);
10565 }
10566
10567 if (item.HasEnergyManager())
10568 {
10569 if (quantity >= 0)
10570 {
10571 item.GetCompEM().SetEnergy0To1(quantity);
10572 }
10573 else
10574 {
10576 }
10577 }
10578 else if (item.IsMagazine())
10579 {
10580 Magazine mag = Magazine.Cast(item);
10581 if (quantity >= 0)
10582 {
10583 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10584 }
10585 else
10586 {
10588 }
10589
10590 }
10591 else
10592 {
10593 if (quantity >= 0)
10594 {
10595 item.SetQuantityNormalized(quantity, false);
10596 }
10597 else
10598 {
10600 }
10601
10602 }
10603 }
10604}
10605
10606#ifdef DEVELOPER
10608#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.