5718{
5720 {
5721 return true;
5722 }
5723};
5724
5725
5726
5728{
5732
5734
5737
5738
5739
5740
5741
5750
5756
5761
5766
5787 protected bool m_IsResultOfSplit
5788
5790
5795
5796
5797
5799
5803
5804
5805
5807
5810
5811
5812
5818
5819
5827
5830
5831
5833
5834
5836
5837
5842
5843
5848
5849
5851
5852
5854 {
5859
5860 if (!
GetGame().IsDedicatedServer())
5861 {
5863 {
5865
5867 {
5869 }
5870 }
5871
5874 }
5875
5876 m_OldLocation = null;
5877
5879 {
5881 }
5882
5883 if (ConfigIsExisting("headSelectionsToHide"))
5884 {
5887 }
5888
5890 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5891 {
5893 }
5894
5896
5897 m_IsResultOfSplit = false;
5898
5900 }
5901
5903 {
5904 super.InitItemVariables();
5905
5911 m_Count = ConfigGetInt(
"count");
5912
5915
5920
5923
5928
5940
5944
5945
5948 if (ConfigIsExisting("canBeSplit"))
5949 {
5952 }
5953
5955 if (ConfigIsExisting("itemBehaviour"))
5957
5958
5961 RegisterNetSyncVariableInt("m_VarLiquidType");
5962 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5963
5964 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5965 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5966 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5967
5968 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5969 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5970 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5971 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5972
5973 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5974 RegisterNetSyncVariableBool("m_IsTakeable");
5975 RegisterNetSyncVariableBool("m_IsHologram");
5976
5979 {
5982 }
5983
5985
5987 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5989
5990 }
5991
5993 {
5995 }
5996
5998 {
6001 {
6006 }
6007 }
6008
6009 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6010 {
6012 {
6015 }
6016
6018 }
6019
6021 {
6027 }
6028
6030
6032 {
6034
6035 if (!action)
6036 {
6037 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6038 return;
6039 }
6040
6042 if (!ai)
6043 {
6045 return;
6046 }
6047
6049 if (!action_array)
6050 {
6051 action_array = new array<ActionBase_Basic>;
6053 }
6054 if (LogManager.IsActionLogEnable())
6055 {
6056 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6057 }
6058
6059 if (action_array.Find(action) != -1)
6060 {
6061 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6062 }
6063 else
6064 {
6065 action_array.Insert(action);
6066 }
6067 }
6068
6070 {
6072 ActionBase action = player.GetActionManager().GetAction(actionName);
6075
6076 if (action_array)
6077 {
6078 action_array.RemoveItem(action);
6079 }
6080 }
6081
6082
6083
6085 {
6086 ActionOverrideData overrideData = new ActionOverrideData();
6090
6092 if (!actionMap)
6093 {
6096 }
6097
6098 actionMap.Insert(this.
Type(), overrideData);
6099
6100 }
6101
6103
6105
6106
6108 {
6111
6114
6115 string config_to_search = "CfgVehicles";
6116 string muzzle_owner_config;
6117
6119 {
6120 if (IsInherited(Weapon))
6121 config_to_search = "CfgWeapons";
6122
6123 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6124
6125 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6126
6128
6129 if (config_OnFire_subclass_count > 0)
6130 {
6131 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6132
6133 for (int i = 0; i < config_OnFire_subclass_count; i++)
6134 {
6135 string particle_class = "";
6137 string config_OnFire_entry = config_OnFire_class + particle_class;
6138 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6139 WPOF_array.Insert(WPOF);
6140 }
6141
6142
6144 }
6145 }
6146
6148 {
6149 config_to_search = "CfgWeapons";
6150 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6151
6152 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6153
6155
6156 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6157 {
6158 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6159
6160 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6161 {
6162 string particle_class2 = "";
6164 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6165 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6166 WPOBE_array.Insert(WPOBE);
6167 }
6168
6169
6171 }
6172 }
6173 }
6174
6175
6177 {
6180
6182 {
6183 string config_to_search = "CfgVehicles";
6184
6185 if (IsInherited(Weapon))
6186 config_to_search = "CfgWeapons";
6187
6188 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6189 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6190
6191 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6192 {
6193
6195
6197 {
6199 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6201 return;
6202 }
6203
6206
6207
6208
6210 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6211
6212 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6213 {
6214 string particle_class = "";
6216 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6218
6219 if (entry_type == CT_CLASS)
6220 {
6221 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6222 WPOOH_array.Insert(WPOF);
6223 }
6224 }
6225
6226
6228 }
6229 }
6230 }
6231
6233 {
6235 }
6236
6238 {
6240 {
6242
6245
6248
6249 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6250 }
6251 }
6252
6254 {
6256 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6257
6259 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6260
6262 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6263
6265 {
6267 }
6268 }
6269
6271 {
6273 }
6274
6276 {
6279 else
6281
6283 {
6286 }
6287 else
6288 {
6291
6294 }
6295
6297 }
6298
6300 {
6302 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6303 }
6304
6306 {
6308 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6310 }
6311
6313 {
6315 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6316 }
6317
6319 {
6322
6323 OverheatingParticle OP = new OverheatingParticle();
6328
6330 }
6331
6333 {
6336
6337 return -1;
6338 }
6339
6341 {
6343 {
6346
6347 for (int i = count; i > 0; --i)
6348 {
6349 int id = i - 1;
6352
6355
6356 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6357 {
6358 if (p)
6359 {
6362 }
6363 }
6364 }
6365 }
6366 }
6367
6369 {
6371 {
6373 {
6374 int id = i - 1;
6376
6377 if (OP)
6378 {
6380
6381 if (p)
6382 {
6384 }
6385
6386 delete OP;
6387 }
6388 }
6389
6392 }
6393 }
6394
6397 {
6398 return 0.0;
6399 }
6400
6401
6403 {
6404 return 250;
6405 }
6406
6408 {
6409 return 0;
6410 }
6411
6414 {
6416 return true;
6417
6418 return false;
6419 }
6420
6423 {
6426
6428 {
6430 }
6431 else
6432 {
6433
6435 }
6436
6438 }
6439
6446 {
6447 return -1;
6448 }
6449
6450
6451
6452
6454 {
6456 {
6458 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6459
6460 if (r_index >= 0)
6461 {
6462 InventoryLocation r_il = new InventoryLocation;
6463 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6464
6465 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6468 {
6469 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6470 }
6472 {
6473 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6474 }
6475
6476 }
6477
6478 player.GetHumanInventory().ClearUserReservedLocation(this);
6479 }
6480
6483 }
6484
6485
6486
6487
6489 {
6490 return ItemBase.m_DebugActionsMask;
6491 }
6492
6494 {
6495 return ItemBase.m_DebugActionsMask & mask;
6496 }
6497
6499 {
6500 ItemBase.m_DebugActionsMask = mask;
6501 }
6502
6504 {
6505 ItemBase.m_DebugActionsMask |= mask;
6506 }
6507
6509 {
6510 ItemBase.m_DebugActionsMask &= ~mask;
6511 }
6512
6514 {
6516 {
6518 }
6519 else
6520 {
6522 }
6523 }
6524
6525
6527 {
6528 if (GetEconomyProfile())
6529 {
6530 float q_max = GetEconomyProfile().GetQuantityMax();
6531 if (q_max > 0)
6532 {
6533 float q_min = GetEconomyProfile().GetQuantityMin();
6534 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6535
6537 {
6538 ComponentEnergyManager comp = GetCompEM();
6540 {
6542 }
6543 }
6545 {
6547
6548 }
6549
6550 }
6551 }
6552 }
6553
6556 {
6557 EntityAI parent = GetHierarchyParent();
6558
6559 if (parent)
6560 {
6561 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6562 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6563 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6564 }
6565 }
6566
6569 {
6570 EntityAI parent = GetHierarchyParent();
6571
6572 if (parent)
6573 {
6574 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6575 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6576 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6577 }
6578 }
6579
6581 {
6582
6583
6584
6585
6587
6589 {
6590 if (ScriptInputUserData.CanStoreInputUserData())
6591 {
6592 ScriptInputUserData ctx = new ScriptInputUserData;
6598 ctx.
Write(use_stack_max);
6601
6603 {
6604 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6605 }
6606 }
6607 }
6608 else if (!
GetGame().IsMultiplayer())
6609 {
6611 }
6612 }
6613
6615 {
6617 }
6618
6620 {
6622 }
6623
6625 {
6627 }
6628
6630 {
6631
6632 return false;
6633 }
6634
6636 {
6637 return false;
6638 }
6639
6643 {
6644 return false;
6645 }
6646
6648 {
6649 return "";
6650 }
6651
6653
6655 {
6656 return false;
6657 }
6658
6660 {
6661 return true;
6662 }
6663
6664
6665
6667 {
6668 return true;
6669 }
6670
6672 {
6673 return true;
6674 }
6675
6677 {
6678 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6680 }
6681
6683 {
6685 }
6686
6688 {
6690 if (!is_being_placed)
6692 SetSynchDirty();
6693 }
6694
6695
6697
6699 {
6701 }
6702
6704 {
6706 }
6707
6709 {
6710 return 1;
6711 }
6712
6714 {
6715 return false;
6716 }
6717
6719 {
6721 SetSynchDirty();
6722 }
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6759 {
6760 super.OnMovedInsideCargo(container);
6761
6762 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6763 }
6764
6765 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6766 {
6767 super.EEItemLocationChanged(oldLoc,newLoc);
6768
6769 PlayerBase new_player = null;
6770 PlayerBase old_player = null;
6771
6772 if (newLoc.GetParent())
6773 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6774
6775 if (oldLoc.GetParent())
6776 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6777
6779 {
6780 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6781
6782 if (r_index >= 0)
6783 {
6784 InventoryLocation r_il = new InventoryLocation;
6785 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6786
6787 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6790 {
6791 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6792 }
6794 {
6795 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6796 }
6797
6798 }
6799 }
6800
6802 {
6803 if (new_player)
6804 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6805
6806 if (new_player == old_player)
6807 {
6808
6809 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6810 {
6812 {
6813 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6814 {
6815 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6816 }
6817 }
6818 else
6819 {
6820 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6821 }
6822 }
6823
6824 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6825 {
6826 int type = oldLoc.GetType();
6828 {
6829 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6830 }
6832 {
6833 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6834 }
6835 }
6836 if (!m_OldLocation)
6837 {
6838 m_OldLocation = new InventoryLocation;
6839 }
6840 m_OldLocation.Copy(oldLoc);
6841 }
6842 else
6843 {
6844 if (m_OldLocation)
6845 {
6846 m_OldLocation.Reset();
6847 }
6848 }
6849
6851 }
6852 else
6853 {
6854 if (new_player)
6855 {
6856 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6857 if (res_index >= 0)
6858 {
6859 InventoryLocation il = new InventoryLocation;
6860 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6862 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6865 {
6866 il.
GetParent().GetOnReleaseLock().Invoke(it);
6867 }
6869 {
6871 }
6872
6873 }
6874 }
6876 {
6877
6879 }
6880
6881 if (m_OldLocation)
6882 {
6883 m_OldLocation.Reset();
6884 }
6885 }
6886 }
6887
6888 override void EOnContact(IEntity other, Contact extra)
6889 {
6891 {
6892 int liquidType = -1;
6894 if (impactSpeed > 0.0)
6895 {
6897 #ifndef SERVER
6899 #else
6901 SetSynchDirty();
6902 #endif
6904 }
6905 }
6906
6907 #ifdef SERVER
6908 if (GetCompEM() && GetCompEM().IsPlugged())
6909 {
6910 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6911 GetCompEM().UnplugThis();
6912 }
6913 #endif
6914 }
6915
6917
6919 {
6921 }
6922
6924 {
6925
6926 }
6927
6929 {
6930 super.OnItemLocationChanged(old_owner, new_owner);
6931
6932 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6933 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6934
6935 if (!relatedPlayer && playerNew)
6936 relatedPlayer = playerNew;
6937
6938 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6939 {
6941 if (actionMgr)
6942 {
6943 ActionBase currentAction = actionMgr.GetRunningAction();
6944 if (currentAction)
6946 }
6947 }
6948
6949 Man ownerPlayerOld = null;
6950 Man ownerPlayerNew = null;
6951
6952 if (old_owner)
6953 {
6954 if (old_owner.
IsMan())
6955 {
6956 ownerPlayerOld = Man.Cast(old_owner);
6957 }
6958 else
6959 {
6960 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6961 }
6962 }
6963 else
6964 {
6966 {
6968
6969 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6970 {
6971 GetCompEM().UnplugThis();
6972 }
6973 }
6974 }
6975
6976 if (new_owner)
6977 {
6978 if (new_owner.
IsMan())
6979 {
6980 ownerPlayerNew = Man.Cast(new_owner);
6981 }
6982 else
6983 {
6984 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6985 }
6986 }
6987
6988 if (ownerPlayerOld != ownerPlayerNew)
6989 {
6990 if (ownerPlayerOld)
6991 {
6992 array<EntityAI> subItemsExit = new array<EntityAI>;
6994 for (int i = 0; i < subItemsExit.Count(); i++)
6995 {
6998 }
6999 }
7000
7001 if (ownerPlayerNew)
7002 {
7003 array<EntityAI> subItemsEnter = new array<EntityAI>;
7005 for (int j = 0; j < subItemsEnter.Count(); j++)
7006 {
7009 }
7010 }
7011 }
7012 else if (ownerPlayerNew != null)
7013 {
7014 PlayerBase nplayer;
7015 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7016 {
7017 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7019 for (int k = 0; k < subItemsUpdate.Count(); k++)
7020 {
7022 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7023 }
7024 }
7025 }
7026
7027 if (old_owner)
7028 old_owner.OnChildItemRemoved(this);
7029 if (new_owner)
7030 new_owner.OnChildItemReceived(this);
7031 }
7032
7033
7035 {
7036 super.EEDelete(parent);
7037 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7038 if (player)
7039 {
7041
7042 if (player.IsAlive())
7043 {
7044 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7045 if (r_index >= 0)
7046 {
7047 InventoryLocation r_il = new InventoryLocation;
7048 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7049
7050 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7053 {
7054 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7055 }
7057 {
7058 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7059 }
7060
7061 }
7062
7063 player.RemoveQuickBarEntityShortcut(this);
7064 }
7065 }
7066 }
7067
7069 {
7070 super.EEKilled(killer);
7071
7074 {
7075 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7076 {
7077 if (IsMagazine())
7078 {
7079 if (Magazine.Cast(this).GetAmmoCount() > 0)
7080 {
7082 }
7083 }
7084 else
7085 {
7087 }
7088 }
7089 }
7090 }
7091
7093 {
7094 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7095
7096 super.OnWasAttached(parent, slot_id);
7097
7100
7102 }
7103
7105 {
7106 super.OnWasDetached(parent, slot_id);
7107
7110 }
7111
7113 {
7114 int idx;
7117
7118 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7119 if (inventory_slots.Count() < 1)
7120 {
7121 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7122 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7123 }
7124 else
7125 {
7126 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7127 }
7128
7129 idx = inventory_slots.Find(slot);
7130 if (idx < 0)
7131 return "";
7132
7133 return attach_types.Get(idx);
7134 }
7135
7137 {
7138 int idx = -1;
7139 string slot;
7140
7143
7144 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7145 if (inventory_slots.Count() < 1)
7146 {
7147 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7148 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7149 }
7150 else
7151 {
7152 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7153 if (detach_types.Count() < 1)
7154 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7155 }
7156
7157 for (int i = 0; i < inventory_slots.Count(); i++)
7158 {
7159 slot = inventory_slots.Get(i);
7160 }
7161
7162 if (slot != "")
7163 {
7164 if (detach_types.Count() == 1)
7165 idx = 0;
7166 else
7167 idx = inventory_slots.Find(slot);
7168 }
7169 if (idx < 0)
7170 return "";
7171
7172 return detach_types.Get(idx);
7173 }
7174
7176 {
7177
7179
7180
7181 float min_time = 1;
7182 float max_time = 3;
7183 float delay = Math.RandomFloat(min_time, max_time);
7184
7185 explode_timer.Run(delay, this, "DoAmmoExplosion");
7186 }
7187
7189 {
7190 Magazine magazine = Magazine.Cast(this);
7191 int pop_sounds_count = 6;
7192 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7193
7194
7195 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7196 string sound_name = pop_sounds[ sound_idx ];
7198
7199
7200 magazine.ServerAddAmmoCount(-1);
7201
7202
7203 float min_temp_to_explode = 100;
7204
7205 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7206 {
7208 }
7209 }
7210
7211
7212 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7213 {
7214 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7215
7216 const int CHANCE_DAMAGE_CARGO = 4;
7217 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7218 const int CHANCE_DAMAGE_NOTHING = 2;
7219
7221 {
7222 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7223 int chances;
7224 int rnd;
7225
7226 if (GetInventory().GetCargo())
7227 {
7228 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7229 rnd = Math.RandomInt(0,chances);
7230
7231 if (rnd < CHANCE_DAMAGE_CARGO)
7232 {
7234 }
7235 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7236 {
7238 }
7239 }
7240 else
7241 {
7242 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7243 rnd = Math.RandomInt(0,chances);
7244
7245 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7246 {
7248 }
7249 }
7250 }
7251 }
7252
7254 {
7255 if (GetInventory().GetCargo())
7256 {
7257 int item_count = GetInventory().GetCargo().GetItemCount();
7258 if (item_count > 0)
7259 {
7260 int random_pick = Math.RandomInt(0, item_count);
7262 if (!item.IsExplosive())
7263 {
7264 item.AddHealth("","",damage);
7265 return true;
7266 }
7267 }
7268 }
7269 return false;
7270 }
7271
7273 {
7274 int attachment_count = GetInventory().AttachmentCount();
7275 if (attachment_count > 0)
7276 {
7277 int random_pick = Math.RandomInt(0, attachment_count);
7278 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7279 if (!attachment.IsExplosive())
7280 {
7281 attachment.AddHealth("","",damage);
7282 return true;
7283 }
7284 }
7285 return false;
7286 }
7287
7289 {
7291 }
7292
7294 {
7296 return GetInventory().CanRemoveEntity();
7297
7298 return false;
7299 }
7300
7302 {
7304 return;
7305
7307 {
7308 if (ScriptInputUserData.CanStoreInputUserData())
7309 {
7310 ScriptInputUserData ctx = new ScriptInputUserData;
7315 ctx.
Write(destination_entity);
7319 }
7320 }
7321 else if (!
GetGame().IsMultiplayer())
7322 {
7324 }
7325 }
7326
7328 {
7330 return;
7331
7332 float split_quantity_new;
7336 InventoryLocation loc = new InventoryLocation;
7337
7338 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7339 {
7341 split_quantity_new = stack_max;
7342 else
7344
7345 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7346 if (new_item)
7347 {
7348 new_item.SetResultOfSplit(true);
7349 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7351 new_item.SetQuantity(split_quantity_new);
7352 }
7353 }
7354 else if (destination_entity && slot_id == -1)
7355 {
7356 if (quantity > stack_max)
7357 split_quantity_new = stack_max;
7358 else
7359 split_quantity_new = quantity;
7360
7362 {
7365 }
7366
7367 if (new_item)
7368 {
7369 new_item.SetResultOfSplit(true);
7370 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7372 new_item.SetQuantity(split_quantity_new);
7373 }
7374 }
7375 else
7376 {
7377 if (stack_max != 0)
7378 {
7380 {
7382 }
7383
7384 if (split_quantity_new == 0)
7385 {
7386 if (!
GetGame().IsMultiplayer())
7387 player.PhysicalPredictiveDropItem(this);
7388 else
7389 player.ServerDropEntity(this);
7390 return;
7391 }
7392
7394
7395 if (new_item)
7396 {
7397 new_item.SetResultOfSplit(true);
7398 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7400 new_item.SetQuantity(stack_max);
7401 new_item.PlaceOnSurface();
7402 }
7403 }
7404 }
7405 }
7406
7408 {
7410 return;
7411
7412 float split_quantity_new;
7416 InventoryLocation loc = new InventoryLocation;
7417
7418 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7419 {
7421 split_quantity_new = stack_max;
7422 else
7424
7425 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7426 if (new_item)
7427 {
7428 new_item.SetResultOfSplit(true);
7429 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7431 new_item.SetQuantity(split_quantity_new);
7432 }
7433 }
7434 else if (destination_entity && slot_id == -1)
7435 {
7436 if (quantity > stack_max)
7437 split_quantity_new = stack_max;
7438 else
7439 split_quantity_new = quantity;
7440
7442 {
7445 }
7446
7447 if (new_item)
7448 {
7449 new_item.SetResultOfSplit(true);
7450 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7452 new_item.SetQuantity(split_quantity_new);
7453 }
7454 }
7455 else
7456 {
7457 if (stack_max != 0)
7458 {
7460 {
7462 }
7463
7465
7466 if (new_item)
7467 {
7468 new_item.SetResultOfSplit(true);
7469 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7471 new_item.SetQuantity(stack_max);
7472 new_item.PlaceOnSurface();
7473 }
7474 }
7475 }
7476 }
7477
7479 {
7481 return;
7482
7484 {
7485 if (ScriptInputUserData.CanStoreInputUserData())
7486 {
7487 ScriptInputUserData ctx = new ScriptInputUserData;
7492 dst.WriteToContext(ctx);
7494 }
7495 }
7496 else if (!
GetGame().IsMultiplayer())
7497 {
7499 }
7500 }
7501
7503 {
7505 return;
7506
7508 {
7509 if (ScriptInputUserData.CanStoreInputUserData())
7510 {
7511 ScriptInputUserData ctx = new ScriptInputUserData;
7516 ctx.
Write(destination_entity);
7522 }
7523 }
7524 else if (!
GetGame().IsMultiplayer())
7525 {
7527 }
7528 }
7529
7531 {
7533 }
7534
7536 {
7538 return this;
7539
7541 float split_quantity_new;
7543 if (dst.IsValid())
7544 {
7545 int slot_id = dst.GetSlot();
7547
7548 if (quantity > stack_max)
7549 split_quantity_new = stack_max;
7550 else
7551 split_quantity_new = quantity;
7552
7554
7555 if (new_item)
7556 {
7557 new_item.SetResultOfSplit(true);
7558 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7561 }
7562
7563 return new_item;
7564 }
7565
7566 return null;
7567 }
7568
7570 {
7572 return;
7573
7575 float split_quantity_new;
7577 if (destination_entity)
7578 {
7580 if (quantity > stackable)
7581 split_quantity_new = stackable;
7582 else
7583 split_quantity_new = quantity;
7584
7585 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7586 if (new_item)
7587 {
7588 new_item.SetResultOfSplit(true);
7589 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7591 new_item.SetQuantity(split_quantity_new);
7592 }
7593 }
7594 }
7595
7597 {
7599 return;
7600
7602 {
7603 if (ScriptInputUserData.CanStoreInputUserData())
7604 {
7605 ScriptInputUserData ctx = new ScriptInputUserData;
7610 ItemBase destination_entity =
this;
7611 ctx.
Write(destination_entity);
7615 }
7616 }
7617 else if (!
GetGame().IsMultiplayer())
7618 {
7620 }
7621 }
7622
7624 {
7626 return;
7627
7629 float split_quantity_new;
7631 if (player)
7632 {
7634 if (quantity > stackable)
7635 split_quantity_new = stackable;
7636 else
7637 split_quantity_new = quantity;
7638
7639 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7640 new_item =
ItemBase.Cast(in_hands);
7641 if (new_item)
7642 {
7643 new_item.SetResultOfSplit(true);
7644 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7646 new_item.SetQuantity(split_quantity_new);
7647 }
7648 }
7649 }
7650
7652 {
7654 return;
7655
7657 float split_quantity_new = Math.Floor(quantity * 0.5);
7658
7660
7661 if (new_item)
7662 {
7663 if (new_item.GetQuantityMax() < split_quantity_new)
7664 {
7665 split_quantity_new = new_item.GetQuantityMax();
7666 }
7667
7668 new_item.SetResultOfSplit(true);
7669 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7670
7672 {
7675 }
7676 else
7677 {
7680 }
7681 }
7682 }
7683
7685 {
7687 return;
7688
7690 float split_quantity_new = Math.Floor(quantity / 2);
7691
7692 InventoryLocation invloc = new InventoryLocation;
7694
7696 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7697
7698 if (new_item)
7699 {
7700 if (new_item.GetQuantityMax() < split_quantity_new)
7701 {
7702 split_quantity_new = new_item.GetQuantityMax();
7703 }
7705 {
7708 }
7709 else
7710 {
7713 }
7714 }
7715 }
7716
7719 {
7720 SetWeightDirty();
7722
7723 if (parent)
7724 parent.OnAttachmentQuantityChangedEx(this, delta);
7725
7727 {
7729 {
7731 }
7733 {
7734 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7736 }
7737 }
7738
7739 }
7740
7743 {
7744
7745 }
7746
7749 {
7751 }
7752
7754 {
7755 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7756
7758 {
7759 if (newLevel == GameConstants.STATE_RUINED)
7760 {
7762 EntityAI parent = GetHierarchyParent();
7763 if (parent && parent.IsFireplace())
7764 {
7765 CargoBase cargo = GetInventory().GetCargo();
7766 if (cargo)
7767 {
7769 {
7771 }
7772 }
7773 }
7774 }
7775
7777 {
7778
7780 return;
7781 }
7782
7783 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7784 {
7786 }
7787 }
7788 }
7789
7790
7792 {
7793 super.OnRightClick();
7794
7796 {
7798 {
7799 if (ScriptInputUserData.CanStoreInputUserData())
7800 {
7801 vector m4[4];
7803
7804 EntityAI root = GetHierarchyRoot();
7805
7806 InventoryLocation dst = new InventoryLocation;
7808 {
7809 if (root)
7810 {
7811 root.GetTransform(m4);
7813 }
7814 else
7815 GetInventory().GetCurrentInventoryLocation(dst);
7816 }
7817 else
7818 {
7820
7821
7822 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7823 {
7824 if (root)
7825 {
7826 root.GetTransform(m4);
7828 }
7829 else
7830 GetInventory().GetCurrentInventoryLocation(dst);
7831 }
7832 else
7833 {
7834 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7835 }
7836 }
7837
7838 ScriptInputUserData ctx = new ScriptInputUserData;
7846 }
7847 }
7848 else if (!
GetGame().IsMultiplayer())
7849 {
7851 }
7852 }
7853 }
7854
7855 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7856 {
7857
7858 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7859 return false;
7860
7861 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7862 return false;
7863
7864
7866 return false;
7867
7868
7869 Magazine mag = Magazine.Cast(this);
7870 if (mag)
7871 {
7872 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7873 return false;
7874
7875 if (stack_max_limit)
7876 {
7877 Magazine other_mag = Magazine.Cast(other_item);
7878 if (other_item)
7879 {
7880 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7881 return false;
7882 }
7883
7884 }
7885 }
7886 else
7887 {
7888
7890 return false;
7891
7893 return false;
7894 }
7895
7896 PlayerBase player = null;
7897 if (CastTo(player, GetHierarchyRootPlayer()))
7898 {
7899 if (player.GetInventory().HasAttachment(this))
7900 return false;
7901
7902 if (player.IsItemsToDelete())
7903 return false;
7904 }
7905
7906 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7907 return false;
7908
7909 int slotID;
7911 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7912 return false;
7913
7914 return true;
7915 }
7916
7918 {
7920 }
7921
7923 {
7924 return m_IsResultOfSplit;
7925 }
7926
7928 {
7929 m_IsResultOfSplit = value;
7930 }
7931
7933 {
7935 }
7936
7938 {
7939 float other_item_quantity = other_item.GetQuantity();
7940 float this_free_space;
7941
7943
7945
7946 if (other_item_quantity > this_free_space)
7947 {
7948 return this_free_space;
7949 }
7950 else
7951 {
7952 return other_item_quantity;
7953 }
7954 }
7955
7957 {
7959 }
7960
7962 {
7964 return;
7965
7966 if (!IsMagazine() && other_item)
7967 {
7969 if (quantity_used != 0)
7970 {
7971 float hp1 = GetHealth01("","");
7972 float hp2 = other_item.GetHealth01("","");
7973 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7974 hpResult = hpResult / (
GetQuantity() + quantity_used);
7975
7976 hpResult *= GetMaxHealth();
7977 Math.Round(hpResult);
7978 SetHealth("", "Health", hpResult);
7979
7981 other_item.AddQuantity(-quantity_used);
7982 }
7983 }
7985 }
7986
7988 {
7989 #ifdef SERVER
7990 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7991 GetHierarchyParent().IncreaseLifetimeUp();
7992 #endif
7993 };
7994
7996 {
7997 PlayerBase p = PlayerBase.Cast(player);
7998
7999 array<int> recipesIds = p.m_Recipes;
8000 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8001 if (moduleRecipesManager)
8002 {
8003 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8004 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8005 }
8006
8007 for (int i = 0;i < recipesIds.Count(); i++)
8008 {
8009 int key = recipesIds.Get(i);
8010 string recipeName = moduleRecipesManager.GetRecipeName(key);
8012 }
8013 }
8014
8015
8016 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8017 {
8018 super.GetDebugActions(outputList);
8019
8020
8025
8026
8030
8034
8035
8038
8039
8041 {
8044 }
8045
8047
8050
8054 }
8055
8056
8057
8058
8060 {
8061 super.OnAction(action_id, player, ctx);
8062 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8063 {
8064 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8065 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8066 PlayerBase p = PlayerBase.Cast(player);
8067 if (
EActions.RECIPES_RANGE_START < 1000)
8068 {
8069 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8070 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8071 }
8072 }
8073 #ifndef SERVER
8074 else if (action_id ==
EActions.WATCH_PLAYER)
8075 {
8076 PluginDeveloper.SetDeveloperItemClientEx(player);
8077 }
8078 #endif
8080 {
8081 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8082 {
8083 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8084 OnDebugButtonPressServer(id + 1);
8085 }
8086
8087 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8088 {
8089 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8091 }
8092
8093 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8094 {
8095 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8097 }
8098
8099 else if (action_id ==
EActions.ADD_QUANTITY)
8100 {
8101 if (IsMagazine())
8102 {
8103 Magazine mag = Magazine.Cast(this);
8104 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8105 }
8106 else
8107 {
8109 }
8110
8111 if (m_EM)
8112 {
8113 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8114 }
8115
8116 }
8117
8118 else if (action_id ==
EActions.REMOVE_QUANTITY)
8119 {
8120 if (IsMagazine())
8121 {
8122 Magazine mag2 = Magazine.Cast(this);
8123 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8124 }
8125 else
8126 {
8128 }
8129 if (m_EM)
8130 {
8131 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8132 }
8133
8134 }
8135
8136 else if (action_id ==
EActions.SET_QUANTITY_0)
8137 {
8139
8140 if (m_EM)
8141 {
8142 m_EM.SetEnergy(0);
8143 }
8144 }
8145
8146 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8147 {
8149
8150 if (m_EM)
8151 {
8152 m_EM.SetEnergy(m_EM.GetEnergyMax());
8153 }
8154 }
8155
8156 else if (action_id ==
EActions.ADD_HEALTH)
8157 {
8158 AddHealth("","",GetMaxHealth("","Health")/5);
8159 }
8160 else if (action_id ==
EActions.REMOVE_HEALTH)
8161 {
8162 AddHealth("","",-GetMaxHealth("","Health")/5);
8163 }
8164 else if (action_id ==
EActions.DESTROY_HEALTH)
8165 {
8166 SetHealth01("","",0);
8167 }
8168 else if (action_id ==
EActions.WATCH_ITEM)
8169 {
8171 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8172 #ifdef DEVELOPER
8173 SetDebugDeveloper_item(this);
8174 #endif
8175 }
8176
8177 else if (action_id ==
EActions.ADD_TEMPERATURE)
8178 {
8179 AddTemperature(20);
8180
8181 }
8182
8183 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8184 {
8185 AddTemperature(-20);
8186
8187 }
8188
8189 else if (action_id ==
EActions.FLIP_FROZEN)
8190 {
8191 SetFrozen(!GetIsFrozen());
8192
8193 }
8194
8195 else if (action_id ==
EActions.ADD_WETNESS)
8196 {
8198
8199 }
8200
8201 else if (action_id ==
EActions.REMOVE_WETNESS)
8202 {
8204
8205 }
8206
8207 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8208 {
8211
8212
8213 }
8214
8215 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8216 {
8219 }
8220
8221 else if (action_id ==
EActions.MAKE_SPECIAL)
8222 {
8223 auto debugParams = DebugSpawnParams.WithPlayer(player);
8224 OnDebugSpawnEx(debugParams);
8225 }
8226
8227 else if (action_id ==
EActions.DELETE)
8228 {
8229 Delete();
8230 }
8231
8232 }
8233
8234
8235 return false;
8236 }
8237
8238
8239
8240
8244
8247
8248
8249
8251 {
8252 return false;
8253 }
8254
8255
8257 {
8258 return true;
8259 }
8260
8261
8263 {
8264 return true;
8265 }
8266
8267
8268
8270 {
8271 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8273 }
8274
8277 {
8278 return null;
8279 }
8280
8282 {
8283 return false;
8284 }
8285
8287 {
8288 return false;
8289 }
8290
8294
8295
8297 {
8298 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8299 return module_repairing.CanRepair(this, item_repair_kit);
8300 }
8301
8302
8303 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8304 {
8305 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8306 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8307 }
8308
8309
8311 {
8312
8313
8314
8315
8316
8317
8318
8319
8320 return 1;
8321 }
8322
8323
8324
8326 {
8328 }
8329
8330
8331
8333 {
8335 }
8336
8337
8346 {
8347 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8348
8349 if (player)
8350 {
8351 player.MessageStatus(text);
8352 }
8353 }
8354
8355
8364 {
8365 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8366
8367 if (player)
8368 {
8369 player.MessageAction(text);
8370 }
8371 }
8372
8373
8382 {
8383 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8384
8385 if (player)
8386 {
8387 player.MessageFriendly(text);
8388 }
8389 }
8390
8391
8400 {
8401 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8402
8403 if (player)
8404 {
8405 player.MessageImportant(text);
8406 }
8407 }
8408
8410 {
8411 return true;
8412 }
8413
8414
8415 override bool KindOf(
string tag)
8416 {
8417 bool found = false;
8418 string item_name = this.
GetType();
8421
8422 int array_size = item_tag_array.Count();
8423 for (int i = 0; i < array_size; i++)
8424 {
8425 if (item_tag_array.Get(i) == tag)
8426 {
8427 found = true;
8428 break;
8429 }
8430 }
8431 return found;
8432 }
8433
8434
8436 {
8437
8438 super.OnRPC(sender, rpc_type,ctx);
8439
8440
8441 switch (rpc_type)
8442 {
8443 #ifndef SERVER
8444 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8445 Param2<bool, string> p = new Param2<bool, string>(false, "");
8446
8448 return;
8449
8450 bool play = p.param1;
8451 string soundSet = p.param2;
8452
8453 if (play)
8454 {
8456 {
8458 {
8460 }
8461 }
8462 else
8463 {
8465 }
8466 }
8467 else
8468 {
8470 }
8471
8472 break;
8473 #endif
8474
8475 }
8476
8478 {
8480 }
8481 }
8482
8483
8484
8485
8487 {
8488 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8489 return plugin.GetID(
name);
8490 }
8491
8493 {
8494 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8495 return plugin.GetName(id);
8496 }
8497
8500 {
8501
8502
8503 int varFlags;
8504 if (!ctx.
Read(varFlags))
8505 return;
8506
8507 if (varFlags & ItemVariableFlags.FLOAT)
8508 {
8510 }
8511 }
8512
8514 {
8515
8516 super.SerializeNumericalVars(floats_out);
8517
8518
8519
8521 {
8523 }
8524
8526 {
8528 }
8529
8531 {
8533 }
8534
8536 {
8541 }
8542
8544 {
8546 }
8547 }
8548
8550 {
8551
8552 super.DeSerializeNumericalVars(floats);
8553
8554
8555 int index = 0;
8556 int mask = Math.Round(floats.Get(index));
8557
8558 index++;
8559
8561 {
8563 {
8565 }
8566 else
8567 {
8568 float quantity = floats.Get(index);
8570 }
8571 index++;
8572 }
8573
8575 {
8576 float wet = floats.Get(index);
8578 index++;
8579 }
8580
8582 {
8583 int liquidtype = Math.Round(floats.Get(index));
8585 index++;
8586 }
8587
8589 {
8591 index++;
8593 index++;
8595 index++;
8597 index++;
8598 }
8599
8601 {
8602 int cleanness = Math.Round(floats.Get(index));
8604 index++;
8605 }
8606 }
8607
8609 {
8610 super.WriteVarsToCTX(ctx);
8611
8612
8614 {
8616 }
8617
8619 {
8621 }
8622
8624 {
8626 }
8627
8629 {
8630 int r,g,b,a;
8636 }
8637
8639 {
8641 }
8642 }
8643
8645 {
8646 if (!super.ReadVarsFromCTX(ctx,version))
8647 return false;
8648
8649 int intValue;
8650 float value;
8651
8652 if (version < 140)
8653 {
8654 if (!ctx.
Read(intValue))
8655 return false;
8656
8657 m_VariablesMask = intValue;
8658 }
8659
8661 {
8662 if (!ctx.
Read(value))
8663 return false;
8664
8666 {
8668 }
8669 else
8670 {
8672 }
8673 }
8674
8675 if (version < 140)
8676 {
8678 {
8679 if (!ctx.
Read(value))
8680 return false;
8681 SetTemperatureDirect(value);
8682 }
8683 }
8684
8686 {
8687 if (!ctx.
Read(value))
8688 return false;
8690 }
8691
8693 {
8694 if (!ctx.
Read(intValue))
8695 return false;
8697 }
8698
8700 {
8701 int r,g,b,a;
8703 return false;
8705 return false;
8707 return false;
8709 return false;
8710
8712 }
8713
8715 {
8716 if (!ctx.
Read(intValue))
8717 return false;
8719 }
8720
8721 if (version >= 138 && version < 140)
8722 {
8724 {
8725 if (!ctx.
Read(intValue))
8726 return false;
8727 SetFrozen(intValue);
8728 }
8729 }
8730
8731 return true;
8732 }
8733
8734
8736 {
8739 {
8741 }
8742
8743 if (!super.OnStoreLoad(ctx, version))
8744 {
8746 return false;
8747 }
8748
8749 if (version >= 114)
8750 {
8751 bool hasQuickBarIndexSaved;
8752
8753 if (!ctx.
Read(hasQuickBarIndexSaved))
8754 {
8756 return false;
8757 }
8758
8759 if (hasQuickBarIndexSaved)
8760 {
8761 int itmQBIndex;
8762
8763
8764 if (!ctx.
Read(itmQBIndex))
8765 {
8767 return false;
8768 }
8769
8770 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8771 if (itmQBIndex != -1 && parentPlayer)
8772 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8773 }
8774 }
8775 else
8776 {
8777
8778 PlayerBase player;
8779 int itemQBIndex;
8780 if (version ==
int.
MAX)
8781 {
8782 if (!ctx.
Read(itemQBIndex))
8783 {
8785 return false;
8786 }
8787 }
8788 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8789 {
8790
8791 if (!ctx.
Read(itemQBIndex))
8792 {
8794 return false;
8795 }
8796 if (itemQBIndex != -1 && player)
8797 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8798 }
8799 }
8800
8801 if (version < 140)
8802 {
8803
8804 if (!LoadVariables(ctx, version))
8805 {
8807 return false;
8808 }
8809 }
8810
8811
8813 {
8815 return false;
8816 }
8817 if (version >= 132)
8818 {
8820 if (raib)
8821 {
8823 {
8825 return false;
8826 }
8827 }
8828 }
8829
8831 return true;
8832 }
8833
8834
8835
8837 {
8838 super.OnStoreSave(ctx);
8839
8840 PlayerBase player;
8841 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8842 {
8844
8845 int itemQBIndex = -1;
8846 itemQBIndex = player.FindQuickBarEntityIndex(this);
8847 ctx.
Write(itemQBIndex);
8848 }
8849 else
8850 {
8852 }
8853
8855
8857 if (raib)
8858 {
8860 }
8861 }
8862
8863
8865 {
8866 super.AfterStoreLoad();
8867
8869 {
8871 }
8872
8874 {
8877 }
8878 }
8879
8881 {
8882 super.EEOnAfterLoad();
8883
8885 {
8887 }
8888
8891 }
8892
8894 {
8895 return false;
8896 }
8897
8898
8899
8901 {
8903 {
8904 #ifdef PLATFORM_CONSOLE
8905
8907 {
8909 if (menu)
8910 {
8912 }
8913 }
8914 #endif
8915 }
8916
8918 {
8921 }
8922
8924 {
8925 SetWeightDirty();
8927 }
8929 {
8932 }
8933
8935 {
8938 }
8940 {
8943 }
8944
8945 super.OnVariablesSynchronized();
8946 }
8947
8948
8949
8951 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8952 {
8953 if (!IsServerCheck(allow_client))
8954 return false;
8955
8957 return false;
8958
8961
8962 if (value <= (min + 0.001))
8963 value = min;
8964
8965 if (value == min)
8966 {
8967 if (destroy_config)
8968 {
8969 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8970 if (dstr)
8971 {
8973 this.Delete();
8974 return true;
8975 }
8976 }
8977 else if (destroy_forced)
8978 {
8980 this.Delete();
8981 return true;
8982 }
8983
8985 }
8986
8989
8991 {
8993
8994 if (delta)
8996 }
8997
8999
9000 return false;
9001 }
9002
9003
9005 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9006 {
9008 }
9009
9011 {
9014 }
9015
9017 {
9020 }
9021
9024 {
9025 float value_clamped = Math.Clamp(value, 0, 1);
9027 SetQuantity(result, destroy_config, destroy_forced);
9028 }
9029
9030
9033 {
9035 }
9036
9038 {
9040 }
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9052 {
9053 int slot = -1;
9054 if (GetInventory())
9055 {
9056 InventoryLocation il = new InventoryLocation;
9057 GetInventory().GetCurrentInventoryLocation(il);
9059 }
9060
9062 }
9063
9065 {
9066 float quantity_max = 0;
9067
9069 {
9070 if (attSlotID != -1)
9071 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9072
9073 if (quantity_max <= 0)
9075 }
9076
9077 if (quantity_max <= 0)
9079
9080 return quantity_max;
9081 }
9082
9084 {
9086 }
9087
9089 {
9091 }
9092
9093
9095 {
9097 }
9098
9100 {
9102 }
9103
9105 {
9107 }
9108
9109
9111 {
9112
9113 float weightEx = GetWeightEx();
9114 float special = GetInventoryAndCargoWeight();
9115 return weightEx - special;
9116 }
9117
9118
9120 {
9122 }
9123
9125 {
9127 {
9128 #ifdef DEVELOPER
9129 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9130 {
9131 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9133 }
9134 #endif
9135
9137 }
9138 else if (HasEnergyManager())
9139 {
9140 #ifdef DEVELOPER
9141 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9142 {
9143 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9144 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9145 }
9146 #endif
9147 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9148 }
9149 else
9150 {
9151 #ifdef DEVELOPER
9152 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9153 {
9154 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9155 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9156 }
9157 #endif
9158 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9159 }
9160 }
9161
9164 {
9165 int item_count = 0;
9167
9168 if (GetInventory().GetCargo() != NULL)
9169 {
9170 item_count = GetInventory().GetCargo().GetItemCount();
9171 }
9172
9173 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9174 {
9175 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9176 if (item)
9177 item_count += item.GetNumberOfItems();
9178 }
9179 return item_count;
9180 }
9181
9184 {
9185 float weight = 0;
9186 float wetness = 1;
9187 if (include_wetness)
9190 {
9191 weight = wetness * m_ConfigWeight;
9192 }
9194 {
9195 weight = 1;
9196 }
9197 return weight;
9198 }
9199
9200
9201
9203 {
9204 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9205 {
9206 GameInventory inv = GetInventory();
9207 array<EntityAI> items = new array<EntityAI>;
9209 for (int i = 0; i < items.Count(); i++)
9210 {
9212 if (item)
9213 {
9215 }
9216 }
9217 }
9218 }
9219
9220
9221
9222
9224 {
9225 float energy = 0;
9226 if (HasEnergyManager())
9227 {
9228 energy = GetCompEM().GetEnergy();
9229 }
9230 return energy;
9231 }
9232
9233
9235 {
9236 super.OnEnergyConsumed();
9237
9239 }
9240
9242 {
9243 super.OnEnergyAdded();
9244
9246 }
9247
9248
9250 {
9251 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9252 {
9254 {
9255 float energy_0to1 = GetCompEM().GetEnergy0To1();
9257 }
9258 }
9259 }
9260
9261
9263 {
9264 return ConfigGetFloat("heatIsolation");
9265 }
9266
9268 {
9270 }
9271
9273 {
9274 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9275 if (
GetGame().ConfigIsExisting(paramPath))
9277
9278 return 0.0;
9279 }
9280
9282 {
9283 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9284 if (
GetGame().ConfigIsExisting(paramPath))
9286
9287 return 0.0;
9288 }
9289
9290 override void SetWet(
float value,
bool allow_client =
false)
9291 {
9292 if (!IsServerCheck(allow_client))
9293 return;
9294
9297
9299
9300 m_VarWet = Math.Clamp(value, min, max);
9301
9303 {
9306 }
9307 }
9308
9309 override void AddWet(
float value)
9310 {
9312 }
9313
9315 {
9317 }
9318
9320 {
9322 }
9323
9325 {
9327 }
9328
9330 {
9332 }
9333
9335 {
9337 }
9338
9340 {
9343 if (newLevel != oldLevel)
9344 {
9346 }
9347 }
9348
9350 {
9351 SetWeightDirty();
9352 }
9353
9355 {
9356 return GetWetLevelInternal(
m_VarWet);
9357 }
9358
9359
9360
9362 {
9364 }
9365
9367 {
9369 }
9370
9372 {
9374 }
9375
9377 {
9379 }
9380
9381
9382
9384 {
9385 if (ConfigIsExisting("itemModelLength"))
9386 {
9387 return ConfigGetFloat("itemModelLength");
9388 }
9389 return 0;
9390 }
9391
9393 {
9394 if (ConfigIsExisting("itemAttachOffset"))
9395 {
9396 return ConfigGetFloat("itemAttachOffset");
9397 }
9398 return 0;
9399 }
9400
9401 override void SetCleanness(
int value,
bool allow_client =
false)
9402 {
9403 if (!IsServerCheck(allow_client))
9404 return;
9405
9407
9409
9412 }
9413
9415 {
9417 }
9418
9420 {
9421 return true;
9422 }
9423
9424
9425
9426
9428 {
9430 }
9431
9433 {
9435 }
9436
9437
9438
9439
9440 override void SetColor(
int r,
int g,
int b,
int a)
9441 {
9447 }
9449 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9450 {
9455 }
9456
9458 {
9460 }
9461
9464 {
9465 int r,g,b,a;
9467 r = r/255;
9468 g = g/255;
9469 b = b/255;
9470 a = a/255;
9471 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9472 }
9473
9474
9475
9476 override void SetLiquidType(
int value,
bool allow_client =
false)
9477 {
9478 if (!IsServerCheck(allow_client))
9479 return;
9480
9485 }
9486
9488 {
9489 return ConfigGetInt("varLiquidTypeInit");
9490 }
9491
9493 {
9495 }
9496
9498 {
9500 SetFrozen(false);
9501 }
9502
9505 {
9506 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9507 }
9508
9509
9512 {
9513 PlayerBase nplayer;
9514 if (PlayerBase.CastTo(nplayer, player))
9515 {
9517
9518 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9519 }
9520 }
9521
9522
9525 {
9526 PlayerBase nplayer;
9527 if (PlayerBase.CastTo(nplayer,player))
9528 {
9529
9530 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9531
9532 }
9533
9534
9535 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9536
9537
9538 if (HasEnergyManager())
9539 {
9540 GetCompEM().UpdatePlugState();
9541 }
9542 }
9543
9544
9546 {
9547 super.OnPlacementStarted(player);
9548
9550 }
9551
9552 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9553 {
9555 {
9556 m_AdminLog.OnPlacementComplete(player,
this);
9557 }
9558
9559 super.OnPlacementComplete(player, position, orientation);
9560 }
9561
9562
9563
9564
9565
9567 {
9569 {
9570 return true;
9571 }
9572 else
9573 {
9574 return false;
9575 }
9576 }
9577
9578
9580 {
9582 {
9584 }
9585 }
9586
9587
9589 {
9591 }
9592
9594 {
9596 }
9597
9598 override void InsertAgent(
int agent,
float count = 1)
9599 {
9600 if (count < 1)
9601 return;
9602
9604 }
9605
9608 {
9610 }
9611
9612
9614 {
9616 }
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9660 {
9662 return false;
9663 return true;
9664 }
9665
9667 {
9668
9670 }
9671
9672
9675 {
9676 super.CheckForRoofLimited(timeTresholdMS);
9677
9679 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9680 {
9681 m_PreviousRoofTestTime = time;
9682 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9683 }
9684 }
9685
9686
9688 {
9690 {
9691 return 0;
9692 }
9693
9694 if (GetInventory().GetAttachmentSlotsCount() != 0)
9695 {
9696 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9697 if (filter)
9698 return filter.GetProtectionLevel(type, false, system);
9699 else
9700 return 0;
9701 }
9702
9703 string subclassPath, entryName;
9704
9705 switch (type)
9706 {
9708 entryName = "biological";
9709 break;
9711 entryName = "chemical";
9712 break;
9713 default:
9714 entryName = "biological";
9715 break;
9716 }
9717
9718 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9719
9721 }
9722
9723
9724
9727 {
9728 if (!IsMagazine())
9730
9732 }
9733
9734
9735
9736
9737
9742 {
9743 return true;
9744 }
9745
9747 {
9749 }
9750
9751
9752
9753
9754
9756 {
9757 if (parent)
9758 {
9759 if (parent.IsInherited(DayZInfected))
9760 return true;
9761
9762 if (!parent.IsRuined())
9763 return true;
9764 }
9765
9766 return true;
9767 }
9768
9770 {
9771 if (!super.CanPutAsAttachment(parent))
9772 {
9773 return false;
9774 }
9775
9776 if (!IsRuined() && !parent.IsRuined())
9777 {
9778 return true;
9779 }
9780
9781 return false;
9782 }
9783
9785 {
9786
9787
9788
9789
9790 return super.CanReceiveItemIntoCargo(item);
9791 }
9792
9794 {
9795
9796
9797
9798
9799 GameInventory attachmentInv = attachment.GetInventory();
9801 {
9802 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9803 return false;
9804 }
9805
9806 InventoryLocation loc = new InventoryLocation();
9807 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9808 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9809 return false;
9810
9811 return super.CanReceiveAttachment(attachment, slotId);
9812 }
9813
9815 {
9816 if (!super.CanReleaseAttachment(attachment))
9817 return false;
9818
9819 return GetInventory().AreChildrenAccessible();
9820 }
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9843 {
9844 int id = muzzle_owner.GetMuzzleID();
9845 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9846
9847 if (WPOF_array)
9848 {
9849 for (int i = 0; i < WPOF_array.Count(); i++)
9850 {
9851 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9852
9853 if (WPOF)
9854 {
9855 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9856 }
9857 }
9858 }
9859 }
9860
9861
9863 {
9864 int id = muzzle_owner.GetMuzzleID();
9866
9867 if (WPOBE_array)
9868 {
9869 for (int i = 0; i < WPOBE_array.Count(); i++)
9870 {
9871 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9872
9873 if (WPOBE)
9874 {
9875 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9876 }
9877 }
9878 }
9879 }
9880
9881
9883 {
9884 int id = muzzle_owner.GetMuzzleID();
9885 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9886
9887 if (WPOOH_array)
9888 {
9889 for (int i = 0; i < WPOOH_array.Count(); i++)
9890 {
9891 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9892
9893 if (WPOOH)
9894 {
9895 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9896 }
9897 }
9898 }
9899 }
9900
9901
9903 {
9904 int id = muzzle_owner.GetMuzzleID();
9905 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9906
9907 if (WPOOH_array)
9908 {
9909 for (int i = 0; i < WPOOH_array.Count(); i++)
9910 {
9911 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9912
9913 if (WPOOH)
9914 {
9915 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9916 }
9917 }
9918 }
9919 }
9920
9921
9923 {
9924 int id = muzzle_owner.GetMuzzleID();
9925 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9926
9927 if (WPOOH_array)
9928 {
9929 for (int i = 0; i < WPOOH_array.Count(); i++)
9930 {
9931 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9932
9933 if (WPOOH)
9934 {
9935 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9936 }
9937 }
9938 }
9939 }
9940
9941
9942
9944 {
9946 {
9947 return true;
9948 }
9949
9950 return false;
9951 }
9952
9954 {
9956 {
9957 return true;
9958 }
9959
9960 return false;
9961 }
9962
9964 {
9966 {
9967 return true;
9968 }
9969
9970 return false;
9971 }
9972
9974 {
9975 return false;
9976 }
9977
9980 {
9981 return UATimeSpent.DEFAULT_DEPLOY;
9982 }
9983
9984
9985
9986
9988 {
9990 SetSynchDirty();
9991 }
9992
9994 {
9996 }
9997
9998
10000 {
10001 return false;
10002 }
10003
10006 {
10007 string att_type = "None";
10008
10009 if (ConfigIsExisting("soundAttType"))
10010 {
10011 att_type = ConfigGetString("soundAttType");
10012 }
10013
10015 }
10016
10018 {
10020 }
10021
10022
10023
10024
10025
10029
10031 {
10034
10036 }
10037
10038
10040 {
10042 return;
10043
10045
10048
10051
10052 SoundParameters params = new SoundParameters();
10056 }
10057
10058
10060 {
10062 return;
10063
10065 SetSynchDirty();
10066
10069 }
10070
10071
10073 {
10075 return;
10076
10078 SetSynchDirty();
10079
10082 }
10083
10085 {
10087 }
10088
10090 {
10092 }
10093
10096 {
10097 if (!
GetGame().IsDedicatedServer())
10098 {
10099 if (ConfigIsExisting("attachSoundSet"))
10100 {
10101 string cfg_path = "";
10102 string soundset = "";
10103 string type_name =
GetType();
10104
10107 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10108 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10109
10110 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10111 {
10112 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10113 {
10114 if (cfg_slot_array[i] == slot_type)
10115 {
10116 soundset = cfg_soundset_array[i];
10117 break;
10118 }
10119 }
10120 }
10121
10122 if (soundset != "")
10123 {
10124 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10126 }
10127 }
10128 }
10129 }
10130
10132 {
10133
10134 }
10135
10136 void OnApply(PlayerBase player);
10137
10139 {
10140 return 1.0;
10141 };
10142
10144 {
10146 }
10147
10149 {
10151 }
10152
10154
10156 {
10157 SetDynamicPhysicsLifeTime(0.01);
10159 }
10160
10162 {
10163 array<string> zone_names = new array<string>;
10164 GetDamageZones(zone_names);
10165 for (int i = 0; i < zone_names.Count(); i++)
10166 {
10167 SetHealthMax(zone_names.Get(i),"Health");
10168 }
10169 SetHealthMax("","Health");
10170 }
10171
10174 {
10175 float global_health = GetHealth01("","Health");
10176 array<string> zones = new array<string>;
10177 GetDamageZones(zones);
10178
10179 for (int i = 0; i < zones.Count(); i++)
10180 {
10181 SetHealth01(zones.Get(i),"Health",global_health);
10182 }
10183 }
10184
10187 {
10188 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10189 }
10190
10192 {
10193 if (!hasRootAsPlayer)
10194 {
10195 if (refParentIB)
10196 {
10197
10198 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10199 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10200
10201 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10202 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10203
10206 }
10207 else
10208 {
10209
10212 }
10213 }
10214 }
10215
10217 {
10219 {
10220 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10221 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10222 {
10223 float heatPermCoef = 1.0;
10225 while (ent)
10226 {
10227 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10228 ent = ent.GetHierarchyParent();
10229 }
10230
10231 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10232 }
10233 }
10234 }
10235
10237 {
10238
10239 EntityAI parent = GetHierarchyParent();
10240 if (!parent)
10241 {
10242 hasParent = false;
10243 hasRootAsPlayer = false;
10244 }
10245 else
10246 {
10247 hasParent = true;
10248 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10249 refParentIB =
ItemBase.Cast(parent);
10250 }
10251 }
10252
10253 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10254 {
10255
10256 }
10257
10259 {
10260
10261 return false;
10262 }
10263
10265 {
10266
10267
10268 return false;
10269 }
10270
10272 {
10273
10274 return false;
10275 }
10276
10279 {
10280 return !GetIsFrozen() &&
IsOpen();
10281 }
10282
10284 {
10285 bool hasParent = false, hasRootAsPlayer = false;
10287
10288 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10289 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10290
10291 if (wwtu || foodDecay)
10292 {
10296
10297 if (processWetness || processTemperature || processDecay)
10298 {
10300
10301 if (processWetness)
10302 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10303
10304 if (processTemperature)
10306
10307 if (processDecay)
10308 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10309 }
10310 }
10311 }
10312
10315 {
10317 }
10318
10320 {
10323
10324 return super.GetTemperatureFreezeThreshold();
10325 }
10326
10328 {
10331
10332 return super.GetTemperatureThawThreshold();
10333 }
10334
10336 {
10339
10340 return super.GetItemOverheatThreshold();
10341 }
10342
10344 {
10346 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10347
10348 return super.GetTemperatureFreezeTime();
10349 }
10350
10352 {
10354 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10355
10356 return super.GetTemperatureThawTime();
10357 }
10358
10363
10365 {
10366 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10367 }
10368
10370 {
10371 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10372 }
10373
10376 {
10378 }
10379
10381 {
10383 }
10384
10386 {
10388 }
10389
10392 {
10393 return null;
10394 }
10395
10398 {
10399 return false;
10400 }
10401
10403 {
10405 {
10408 if (!trg)
10409 {
10411 explosive = this;
10412 }
10413
10414 explosive.PairRemote(trg);
10416
10417 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10418 trg.SetPersistentPairID(persistentID);
10419 explosive.SetPersistentPairID(persistentID);
10420
10421 return true;
10422 }
10423 return false;
10424 }
10425
10428 {
10429 float ret = 1.0;
10432 ret *= GetHealth01();
10433
10434 return ret;
10435 }
10436
10437 #ifdef DEVELOPER
10438 override void SetDebugItem()
10439 {
10440 super.SetDebugItem();
10441 _itemBase = this;
10442 }
10443
10445 {
10446 string text = super.GetDebugText();
10447
10449 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10450
10451 return text;
10452 }
10453 #endif
10454
10456 {
10457 return true;
10458 }
10459
10461
10463
10465 {
10468 }
10469
10470
10478
10494}
10495
10497{
10499 if (entity)
10500 {
10501 bool is_item = entity.IsInherited(
ItemBase);
10502 if (is_item && full_quantity)
10503 {
10506 }
10507 }
10508 else
10509 {
10511 return NULL;
10512 }
10513 return entity;
10514}
10515
10517{
10518 if (item)
10519 {
10520 if (health > 0)
10521 item.SetHealth("", "", health);
10522
10523 if (item.CanHaveTemperature())
10524 {
10526 if (item.CanFreeze())
10527 item.SetFrozen(false);
10528 }
10529
10530 if (item.HasEnergyManager())
10531 {
10532 if (quantity >= 0)
10533 {
10534 item.GetCompEM().SetEnergy0To1(quantity);
10535 }
10536 else
10537 {
10539 }
10540 }
10541 else if (item.IsMagazine())
10542 {
10543 Magazine mag = Magazine.Cast(item);
10544 if (quantity >= 0)
10545 {
10546 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10547 }
10548 else
10549 {
10551 }
10552
10553 }
10554 else
10555 {
10556 if (quantity >= 0)
10557 {
10558 item.SetQuantityNormalized(quantity, false);
10559 }
10560 else
10561 {
10563 }
10564
10565 }
10566 }
10567}
10568
10569#ifdef DEVELOPER
10571#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.