5701{
5703 {
5704 return true;
5705 }
5706};
5707
5708
5709
5711{
5715
5717
5720
5721
5722
5723
5724
5733
5739
5744
5749
5770 protected bool m_IsResultOfSplit
5771
5773
5778
5779
5780
5782
5786
5787
5788
5790
5793
5794
5795
5801
5802
5810
5813
5814
5816
5817
5819
5820
5825
5826
5831
5832
5834
5835
5837 {
5842
5843 if (!
GetGame().IsDedicatedServer())
5844 {
5846 {
5848
5850 {
5852 }
5853 }
5854
5857 }
5858
5859 m_OldLocation = null;
5860
5862 {
5864 }
5865
5866 if (ConfigIsExisting("headSelectionsToHide"))
5867 {
5870 }
5871
5873 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5874 {
5876 }
5877
5879
5880 m_IsResultOfSplit = false;
5881
5883 }
5884
5886 {
5887 super.InitItemVariables();
5888
5894 m_Count = ConfigGetInt(
"count");
5895
5898
5903
5906
5911
5923
5927
5928
5931 if (ConfigIsExisting("canBeSplit"))
5932 {
5935 }
5936
5938 if (ConfigIsExisting("itemBehaviour"))
5940
5941
5944 RegisterNetSyncVariableInt("m_VarLiquidType");
5945 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5946
5947 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5948 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5949 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5950
5951 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5952 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5953 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5954 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5955
5956 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5957 RegisterNetSyncVariableBool("m_IsTakeable");
5958 RegisterNetSyncVariableBool("m_IsHologram");
5959
5962 {
5965 }
5966
5968
5970 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5972
5973 }
5974
5976 {
5978 }
5979
5981 {
5984 {
5989 }
5990 }
5991
5992 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5993 {
5995 {
5998 }
5999
6001 }
6002
6004 {
6010 }
6011
6013
6015 {
6017
6018 if (!action)
6019 {
6020 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6021 return;
6022 }
6023
6025 if (!ai)
6026 {
6028 return;
6029 }
6030
6032 if (!action_array)
6033 {
6034 action_array = new array<ActionBase_Basic>;
6036 }
6037 if (LogManager.IsActionLogEnable())
6038 {
6039 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6040 }
6041
6042 if (action_array.Find(action) != -1)
6043 {
6044 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6045 }
6046 else
6047 {
6048 action_array.Insert(action);
6049 }
6050 }
6051
6053 {
6055 ActionBase action = player.GetActionManager().GetAction(actionName);
6058
6059 if (action_array)
6060 {
6061 action_array.RemoveItem(action);
6062 }
6063 }
6064
6065
6066
6068 {
6069 ActionOverrideData overrideData = new ActionOverrideData();
6073
6075 if (!actionMap)
6076 {
6079 }
6080
6081 actionMap.Insert(this.
Type(), overrideData);
6082
6083 }
6084
6086
6088
6089
6091 {
6094
6097
6098 string config_to_search = "CfgVehicles";
6099 string muzzle_owner_config;
6100
6102 {
6103 if (IsInherited(Weapon))
6104 config_to_search = "CfgWeapons";
6105
6106 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6107
6108 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6109
6111
6112 if (config_OnFire_subclass_count > 0)
6113 {
6114 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6115
6116 for (int i = 0; i < config_OnFire_subclass_count; i++)
6117 {
6118 string particle_class = "";
6120 string config_OnFire_entry = config_OnFire_class + particle_class;
6121 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6122 WPOF_array.Insert(WPOF);
6123 }
6124
6125
6127 }
6128 }
6129
6131 {
6132 config_to_search = "CfgWeapons";
6133 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6134
6135 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6136
6138
6139 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6140 {
6141 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6142
6143 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6144 {
6145 string particle_class2 = "";
6147 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6148 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6149 WPOBE_array.Insert(WPOBE);
6150 }
6151
6152
6154 }
6155 }
6156 }
6157
6158
6160 {
6163
6165 {
6166 string config_to_search = "CfgVehicles";
6167
6168 if (IsInherited(Weapon))
6169 config_to_search = "CfgWeapons";
6170
6171 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6172 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6173
6174 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6175 {
6176
6178
6180 {
6182 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6184 return;
6185 }
6186
6189
6190
6191
6193 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6194
6195 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6196 {
6197 string particle_class = "";
6199 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6201
6202 if (entry_type == CT_CLASS)
6203 {
6204 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6205 WPOOH_array.Insert(WPOF);
6206 }
6207 }
6208
6209
6211 }
6212 }
6213 }
6214
6216 {
6218 }
6219
6221 {
6223 {
6225
6228
6231
6232 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6233 }
6234 }
6235
6237 {
6239 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6240
6242 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6243
6245 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6246
6248 {
6250 }
6251 }
6252
6254 {
6256 }
6257
6259 {
6262 else
6264
6266 {
6269 }
6270 else
6271 {
6274
6277 }
6278
6280 }
6281
6283 {
6285 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6286 }
6287
6289 {
6291 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6293 }
6294
6296 {
6298 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6299 }
6300
6302 {
6305
6306 OverheatingParticle OP = new OverheatingParticle();
6311
6313 }
6314
6316 {
6319
6320 return -1;
6321 }
6322
6324 {
6326 {
6329
6330 for (int i = count; i > 0; --i)
6331 {
6332 int id = i - 1;
6335
6338
6339 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6340 {
6341 if (p)
6342 {
6345 }
6346 }
6347 }
6348 }
6349 }
6350
6352 {
6354 {
6356 {
6357 int id = i - 1;
6359
6360 if (OP)
6361 {
6363
6364 if (p)
6365 {
6367 }
6368
6369 delete OP;
6370 }
6371 }
6372
6375 }
6376 }
6377
6380 {
6381 return 0.0;
6382 }
6383
6384
6386 {
6387 return 250;
6388 }
6389
6391 {
6392 return 0;
6393 }
6394
6397 {
6399 return true;
6400
6401 return false;
6402 }
6403
6406 {
6409
6411 {
6413 }
6414 else
6415 {
6416
6418 }
6419
6421 }
6422
6429 {
6430 return -1;
6431 }
6432
6433
6434
6435
6437 {
6439 {
6441 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6442
6443 if (r_index >= 0)
6444 {
6445 InventoryLocation r_il = new InventoryLocation;
6446 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6447
6448 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6451 {
6452 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6453 }
6455 {
6456 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6457 }
6458
6459 }
6460
6461 player.GetHumanInventory().ClearUserReservedLocation(this);
6462 }
6463
6466 }
6467
6468
6469
6470
6472 {
6473 return ItemBase.m_DebugActionsMask;
6474 }
6475
6477 {
6478 return ItemBase.m_DebugActionsMask & mask;
6479 }
6480
6482 {
6483 ItemBase.m_DebugActionsMask = mask;
6484 }
6485
6487 {
6488 ItemBase.m_DebugActionsMask |= mask;
6489 }
6490
6492 {
6493 ItemBase.m_DebugActionsMask &= ~mask;
6494 }
6495
6497 {
6499 {
6501 }
6502 else
6503 {
6505 }
6506 }
6507
6508
6510 {
6511 if (GetEconomyProfile())
6512 {
6513 float q_max = GetEconomyProfile().GetQuantityMax();
6514 if (q_max > 0)
6515 {
6516 float q_min = GetEconomyProfile().GetQuantityMin();
6517 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6518
6520 {
6521 ComponentEnergyManager comp = GetCompEM();
6523 {
6525 }
6526 }
6528 {
6530
6531 }
6532
6533 }
6534 }
6535 }
6536
6539 {
6540 EntityAI parent = GetHierarchyParent();
6541
6542 if (parent)
6543 {
6544 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6545 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6546 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6547 }
6548 }
6549
6552 {
6553 EntityAI parent = GetHierarchyParent();
6554
6555 if (parent)
6556 {
6557 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6558 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6559 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6560 }
6561 }
6562
6564 {
6565
6566
6567
6568
6570
6572 {
6573 if (ScriptInputUserData.CanStoreInputUserData())
6574 {
6575 ScriptInputUserData ctx = new ScriptInputUserData;
6581 ctx.
Write(use_stack_max);
6584
6586 {
6587 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6588 }
6589 }
6590 }
6591 else if (!
GetGame().IsMultiplayer())
6592 {
6594 }
6595 }
6596
6598 {
6600 }
6601
6603 {
6605 }
6606
6608 {
6610 }
6611
6613 {
6614
6615 return false;
6616 }
6617
6619 {
6620 return false;
6621 }
6622
6626 {
6627 return false;
6628 }
6629
6631 {
6632 return "";
6633 }
6634
6636
6638 {
6639 return false;
6640 }
6641
6643 {
6644 return true;
6645 }
6646
6647
6648
6650 {
6651 return true;
6652 }
6653
6655 {
6656 return true;
6657 }
6658
6660 {
6661 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6663 }
6664
6666 {
6668 }
6669
6671 {
6673 if (!is_being_placed)
6675 SetSynchDirty();
6676 }
6677
6678
6680
6682 {
6684 }
6685
6687 {
6689 }
6690
6692 {
6693 return 1;
6694 }
6695
6697 {
6698 return false;
6699 }
6700
6702 {
6704 SetSynchDirty();
6705 }
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6742 {
6743 super.OnMovedInsideCargo(container);
6744
6745 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6746 }
6747
6748 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6749 {
6750 super.EEItemLocationChanged(oldLoc,newLoc);
6751
6752 PlayerBase new_player = null;
6753 PlayerBase old_player = null;
6754
6755 if (newLoc.GetParent())
6756 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6757
6758 if (oldLoc.GetParent())
6759 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6760
6762 {
6763 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6764
6765 if (r_index >= 0)
6766 {
6767 InventoryLocation r_il = new InventoryLocation;
6768 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6769
6770 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6773 {
6774 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6775 }
6777 {
6778 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6779 }
6780
6781 }
6782 }
6783
6785 {
6786 if (new_player)
6787 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6788
6789 if (new_player == old_player)
6790 {
6791
6792 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6793 {
6795 {
6796 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6797 {
6798 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6799 }
6800 }
6801 else
6802 {
6803 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6804 }
6805 }
6806
6807 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6808 {
6809 int type = oldLoc.GetType();
6811 {
6812 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6813 }
6815 {
6816 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6817 }
6818 }
6819 if (!m_OldLocation)
6820 {
6821 m_OldLocation = new InventoryLocation;
6822 }
6823 m_OldLocation.Copy(oldLoc);
6824 }
6825 else
6826 {
6827 if (m_OldLocation)
6828 {
6829 m_OldLocation.Reset();
6830 }
6831 }
6832
6834 }
6835 else
6836 {
6837 if (new_player)
6838 {
6839 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6840 if (res_index >= 0)
6841 {
6842 InventoryLocation il = new InventoryLocation;
6843 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6845 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6848 {
6849 il.
GetParent().GetOnReleaseLock().Invoke(it);
6850 }
6852 {
6854 }
6855
6856 }
6857 }
6859 {
6860
6862 }
6863
6864 if (m_OldLocation)
6865 {
6866 m_OldLocation.Reset();
6867 }
6868 }
6869 }
6870
6871 override void EOnContact(IEntity other, Contact extra)
6872 {
6874 {
6875 int liquidType = -1;
6877 if (impactSpeed > 0.0)
6878 {
6880 #ifndef SERVER
6882 #else
6884 SetSynchDirty();
6885 #endif
6887 }
6888 }
6889
6890 #ifdef SERVER
6891 if (GetCompEM() && GetCompEM().IsPlugged())
6892 {
6893 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6894 GetCompEM().UnplugThis();
6895 }
6896 #endif
6897 }
6898
6900
6902 {
6904 }
6905
6907 {
6908
6909 }
6910
6912 {
6913 super.OnItemLocationChanged(old_owner, new_owner);
6914
6915 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6916 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6917
6918 if (!relatedPlayer && playerNew)
6919 relatedPlayer = playerNew;
6920
6921 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6922 {
6924 if (actionMgr)
6925 {
6926 ActionBase currentAction = actionMgr.GetRunningAction();
6927 if (currentAction)
6929 }
6930 }
6931
6932 Man ownerPlayerOld = null;
6933 Man ownerPlayerNew = null;
6934
6935 if (old_owner)
6936 {
6937 if (old_owner.
IsMan())
6938 {
6939 ownerPlayerOld = Man.Cast(old_owner);
6940 }
6941 else
6942 {
6943 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6944 }
6945 }
6946 else
6947 {
6949 {
6951
6952 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6953 {
6954 GetCompEM().UnplugThis();
6955 }
6956 }
6957 }
6958
6959 if (new_owner)
6960 {
6961 if (new_owner.
IsMan())
6962 {
6963 ownerPlayerNew = Man.Cast(new_owner);
6964 }
6965 else
6966 {
6967 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6968 }
6969 }
6970
6971 if (ownerPlayerOld != ownerPlayerNew)
6972 {
6973 if (ownerPlayerOld)
6974 {
6975 array<EntityAI> subItemsExit = new array<EntityAI>;
6977 for (int i = 0; i < subItemsExit.Count(); i++)
6978 {
6981 }
6982 }
6983
6984 if (ownerPlayerNew)
6985 {
6986 array<EntityAI> subItemsEnter = new array<EntityAI>;
6988 for (int j = 0; j < subItemsEnter.Count(); j++)
6989 {
6992 }
6993 }
6994 }
6995 else if (ownerPlayerNew != null)
6996 {
6997 PlayerBase nplayer;
6998 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6999 {
7000 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7002 for (int k = 0; k < subItemsUpdate.Count(); k++)
7003 {
7005 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7006 }
7007 }
7008 }
7009
7010 if (old_owner)
7011 old_owner.OnChildItemRemoved(this);
7012 if (new_owner)
7013 new_owner.OnChildItemReceived(this);
7014 }
7015
7016
7018 {
7019 super.EEDelete(parent);
7020 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7021 if (player)
7022 {
7024
7025 if (player.IsAlive())
7026 {
7027 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7028 if (r_index >= 0)
7029 {
7030 InventoryLocation r_il = new InventoryLocation;
7031 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7032
7033 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7036 {
7037 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7038 }
7040 {
7041 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7042 }
7043
7044 }
7045
7046 player.RemoveQuickBarEntityShortcut(this);
7047 }
7048 }
7049 }
7050
7052 {
7053 super.EEKilled(killer);
7054
7057 {
7058 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7059 {
7060 if (IsMagazine())
7061 {
7062 if (Magazine.Cast(this).GetAmmoCount() > 0)
7063 {
7065 }
7066 }
7067 else
7068 {
7070 }
7071 }
7072 }
7073 }
7074
7076 {
7077 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7078
7079 super.OnWasAttached(parent, slot_id);
7080
7083
7085 }
7086
7088 {
7089 super.OnWasDetached(parent, slot_id);
7090
7093 }
7094
7096 {
7097 int idx;
7100
7101 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7102 if (inventory_slots.Count() < 1)
7103 {
7104 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7105 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7106 }
7107 else
7108 {
7109 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7110 }
7111
7112 idx = inventory_slots.Find(slot);
7113 if (idx < 0)
7114 return "";
7115
7116 return attach_types.Get(idx);
7117 }
7118
7120 {
7121 int idx = -1;
7122 string slot;
7123
7126
7127 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7128 if (inventory_slots.Count() < 1)
7129 {
7130 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7131 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7132 }
7133 else
7134 {
7135 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7136 if (detach_types.Count() < 1)
7137 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7138 }
7139
7140 for (int i = 0; i < inventory_slots.Count(); i++)
7141 {
7142 slot = inventory_slots.Get(i);
7143 }
7144
7145 if (slot != "")
7146 {
7147 if (detach_types.Count() == 1)
7148 idx = 0;
7149 else
7150 idx = inventory_slots.Find(slot);
7151 }
7152 if (idx < 0)
7153 return "";
7154
7155 return detach_types.Get(idx);
7156 }
7157
7159 {
7160
7162
7163
7164 float min_time = 1;
7165 float max_time = 3;
7166 float delay = Math.RandomFloat(min_time, max_time);
7167
7168 explode_timer.Run(delay, this, "DoAmmoExplosion");
7169 }
7170
7172 {
7173 Magazine magazine = Magazine.Cast(this);
7174 int pop_sounds_count = 6;
7175 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7176
7177
7178 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7179 string sound_name = pop_sounds[ sound_idx ];
7181
7182
7183 magazine.ServerAddAmmoCount(-1);
7184
7185
7186 float min_temp_to_explode = 100;
7187
7188 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7189 {
7191 }
7192 }
7193
7194
7195 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7196 {
7197 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7198
7199 const int CHANCE_DAMAGE_CARGO = 4;
7200 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7201 const int CHANCE_DAMAGE_NOTHING = 2;
7202
7204 {
7205 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7206 int chances;
7207 int rnd;
7208
7209 if (GetInventory().GetCargo())
7210 {
7211 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7212 rnd = Math.RandomInt(0,chances);
7213
7214 if (rnd < CHANCE_DAMAGE_CARGO)
7215 {
7217 }
7218 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7219 {
7221 }
7222 }
7223 else
7224 {
7225 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7226 rnd = Math.RandomInt(0,chances);
7227
7228 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7229 {
7231 }
7232 }
7233 }
7234 }
7235
7237 {
7238 if (GetInventory().GetCargo())
7239 {
7240 int item_count = GetInventory().GetCargo().GetItemCount();
7241 if (item_count > 0)
7242 {
7243 int random_pick = Math.RandomInt(0, item_count);
7245 if (!item.IsExplosive())
7246 {
7247 item.AddHealth("","",damage);
7248 return true;
7249 }
7250 }
7251 }
7252 return false;
7253 }
7254
7256 {
7257 int attachment_count = GetInventory().AttachmentCount();
7258 if (attachment_count > 0)
7259 {
7260 int random_pick = Math.RandomInt(0, attachment_count);
7261 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7262 if (!attachment.IsExplosive())
7263 {
7264 attachment.AddHealth("","",damage);
7265 return true;
7266 }
7267 }
7268 return false;
7269 }
7270
7272 {
7274 }
7275
7277 {
7279 return GetInventory().CanRemoveEntity();
7280
7281 return false;
7282 }
7283
7285 {
7287 return;
7288
7290 {
7291 if (ScriptInputUserData.CanStoreInputUserData())
7292 {
7293 ScriptInputUserData ctx = new ScriptInputUserData;
7298 ctx.
Write(destination_entity);
7302 }
7303 }
7304 else if (!
GetGame().IsMultiplayer())
7305 {
7307 }
7308 }
7309
7311 {
7313 return;
7314
7315 float split_quantity_new;
7319 InventoryLocation loc = new InventoryLocation;
7320
7321 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7322 {
7324 split_quantity_new = stack_max;
7325 else
7327
7328 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7329 if (new_item)
7330 {
7331 new_item.SetResultOfSplit(true);
7332 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7334 new_item.SetQuantity(split_quantity_new);
7335 }
7336 }
7337 else if (destination_entity && slot_id == -1)
7338 {
7339 if (quantity > stack_max)
7340 split_quantity_new = stack_max;
7341 else
7342 split_quantity_new = quantity;
7343
7345 {
7348 }
7349
7350 if (new_item)
7351 {
7352 new_item.SetResultOfSplit(true);
7353 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7355 new_item.SetQuantity(split_quantity_new);
7356 }
7357 }
7358 else
7359 {
7360 if (stack_max != 0)
7361 {
7363 {
7365 }
7366
7367 if (split_quantity_new == 0)
7368 {
7369 if (!
GetGame().IsMultiplayer())
7370 player.PhysicalPredictiveDropItem(this);
7371 else
7372 player.ServerDropEntity(this);
7373 return;
7374 }
7375
7377
7378 if (new_item)
7379 {
7380 new_item.SetResultOfSplit(true);
7381 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7383 new_item.SetQuantity(stack_max);
7384 new_item.PlaceOnSurface();
7385 }
7386 }
7387 }
7388 }
7389
7391 {
7393 return;
7394
7395 float split_quantity_new;
7399 InventoryLocation loc = new InventoryLocation;
7400
7401 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7402 {
7404 split_quantity_new = stack_max;
7405 else
7407
7408 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7409 if (new_item)
7410 {
7411 new_item.SetResultOfSplit(true);
7412 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7414 new_item.SetQuantity(split_quantity_new);
7415 }
7416 }
7417 else if (destination_entity && slot_id == -1)
7418 {
7419 if (quantity > stack_max)
7420 split_quantity_new = stack_max;
7421 else
7422 split_quantity_new = quantity;
7423
7425 {
7428 }
7429
7430 if (new_item)
7431 {
7432 new_item.SetResultOfSplit(true);
7433 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7435 new_item.SetQuantity(split_quantity_new);
7436 }
7437 }
7438 else
7439 {
7440 if (stack_max != 0)
7441 {
7443 {
7445 }
7446
7448
7449 if (new_item)
7450 {
7451 new_item.SetResultOfSplit(true);
7452 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7454 new_item.SetQuantity(stack_max);
7455 new_item.PlaceOnSurface();
7456 }
7457 }
7458 }
7459 }
7460
7462 {
7464 return;
7465
7467 {
7468 if (ScriptInputUserData.CanStoreInputUserData())
7469 {
7470 ScriptInputUserData ctx = new ScriptInputUserData;
7475 dst.WriteToContext(ctx);
7477 }
7478 }
7479 else if (!
GetGame().IsMultiplayer())
7480 {
7482 }
7483 }
7484
7486 {
7488 return;
7489
7491 {
7492 if (ScriptInputUserData.CanStoreInputUserData())
7493 {
7494 ScriptInputUserData ctx = new ScriptInputUserData;
7499 ctx.
Write(destination_entity);
7505 }
7506 }
7507 else if (!
GetGame().IsMultiplayer())
7508 {
7510 }
7511 }
7512
7514 {
7516 }
7517
7519 {
7521 return this;
7522
7524 float split_quantity_new;
7526 if (dst.IsValid())
7527 {
7528 int slot_id = dst.GetSlot();
7530
7531 if (quantity > stack_max)
7532 split_quantity_new = stack_max;
7533 else
7534 split_quantity_new = quantity;
7535
7537
7538 if (new_item)
7539 {
7540 new_item.SetResultOfSplit(true);
7541 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7544 }
7545
7546 return new_item;
7547 }
7548
7549 return null;
7550 }
7551
7553 {
7555 return;
7556
7558 float split_quantity_new;
7560 if (destination_entity)
7561 {
7563 if (quantity > stackable)
7564 split_quantity_new = stackable;
7565 else
7566 split_quantity_new = quantity;
7567
7568 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7569 if (new_item)
7570 {
7571 new_item.SetResultOfSplit(true);
7572 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7574 new_item.SetQuantity(split_quantity_new);
7575 }
7576 }
7577 }
7578
7580 {
7582 return;
7583
7585 {
7586 if (ScriptInputUserData.CanStoreInputUserData())
7587 {
7588 ScriptInputUserData ctx = new ScriptInputUserData;
7593 ItemBase destination_entity =
this;
7594 ctx.
Write(destination_entity);
7598 }
7599 }
7600 else if (!
GetGame().IsMultiplayer())
7601 {
7603 }
7604 }
7605
7607 {
7609 return;
7610
7612 float split_quantity_new;
7614 if (player)
7615 {
7617 if (quantity > stackable)
7618 split_quantity_new = stackable;
7619 else
7620 split_quantity_new = quantity;
7621
7622 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7623 new_item =
ItemBase.Cast(in_hands);
7624 if (new_item)
7625 {
7626 new_item.SetResultOfSplit(true);
7627 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7629 new_item.SetQuantity(split_quantity_new);
7630 }
7631 }
7632 }
7633
7635 {
7637 return;
7638
7640 float split_quantity_new = Math.Floor(quantity * 0.5);
7641
7643
7644 if (new_item)
7645 {
7646 if (new_item.GetQuantityMax() < split_quantity_new)
7647 {
7648 split_quantity_new = new_item.GetQuantityMax();
7649 }
7650
7651 new_item.SetResultOfSplit(true);
7652 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7653
7655 {
7658 }
7659 else
7660 {
7663 }
7664 }
7665 }
7666
7668 {
7670 return;
7671
7673 float split_quantity_new = Math.Floor(quantity / 2);
7674
7675 InventoryLocation invloc = new InventoryLocation;
7677
7679 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7680
7681 if (new_item)
7682 {
7683 if (new_item.GetQuantityMax() < split_quantity_new)
7684 {
7685 split_quantity_new = new_item.GetQuantityMax();
7686 }
7688 {
7691 }
7692 else
7693 {
7696 }
7697 }
7698 }
7699
7702 {
7703 SetWeightDirty();
7705
7706 if (parent)
7707 parent.OnAttachmentQuantityChangedEx(this, delta);
7708
7710 {
7712 {
7714 }
7716 {
7717 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7719 }
7720 }
7721
7722 }
7723
7726 {
7727
7728 }
7729
7732 {
7734 }
7735
7737 {
7738 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7739
7741 {
7742 if (newLevel == GameConstants.STATE_RUINED)
7743 {
7745 EntityAI parent = GetHierarchyParent();
7746 if (parent && parent.IsFireplace())
7747 {
7748 CargoBase cargo = GetInventory().GetCargo();
7749 if (cargo)
7750 {
7752 {
7754 }
7755 }
7756 }
7757 }
7758
7760 {
7761
7763 return;
7764 }
7765
7766 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7767 {
7769 }
7770 }
7771 }
7772
7773
7775 {
7776 super.OnRightClick();
7777
7779 {
7781 {
7782 if (ScriptInputUserData.CanStoreInputUserData())
7783 {
7784 vector m4[4];
7786
7787 EntityAI root = GetHierarchyRoot();
7788
7789 InventoryLocation dst = new InventoryLocation;
7791 {
7792 if (root)
7793 {
7794 root.GetTransform(m4);
7796 }
7797 else
7798 GetInventory().GetCurrentInventoryLocation(dst);
7799 }
7800 else
7801 {
7803
7804
7805 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7806 {
7807 if (root)
7808 {
7809 root.GetTransform(m4);
7811 }
7812 else
7813 GetInventory().GetCurrentInventoryLocation(dst);
7814 }
7815 else
7816 {
7817 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7818 }
7819 }
7820
7821 ScriptInputUserData ctx = new ScriptInputUserData;
7829 }
7830 }
7831 else if (!
GetGame().IsMultiplayer())
7832 {
7834 }
7835 }
7836 }
7837
7838 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7839 {
7840
7841 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7842 return false;
7843
7844 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7845 return false;
7846
7847
7849 return false;
7850
7851
7852 Magazine mag = Magazine.Cast(this);
7853 if (mag)
7854 {
7855 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7856 return false;
7857
7858 if (stack_max_limit)
7859 {
7860 Magazine other_mag = Magazine.Cast(other_item);
7861 if (other_item)
7862 {
7863 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7864 return false;
7865 }
7866
7867 }
7868 }
7869 else
7870 {
7871
7873 return false;
7874
7876 return false;
7877 }
7878
7879 PlayerBase player = null;
7880 if (CastTo(player, GetHierarchyRootPlayer()))
7881 {
7882 if (player.GetInventory().HasAttachment(this))
7883 return false;
7884
7885 if (player.IsItemsToDelete())
7886 return false;
7887 }
7888
7889 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7890 return false;
7891
7892 int slotID;
7894 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7895 return false;
7896
7897 return true;
7898 }
7899
7901 {
7903 }
7904
7906 {
7907 return m_IsResultOfSplit;
7908 }
7909
7911 {
7912 m_IsResultOfSplit = value;
7913 }
7914
7916 {
7918 }
7919
7921 {
7922 float other_item_quantity = other_item.GetQuantity();
7923 float this_free_space;
7924
7926
7928
7929 if (other_item_quantity > this_free_space)
7930 {
7931 return this_free_space;
7932 }
7933 else
7934 {
7935 return other_item_quantity;
7936 }
7937 }
7938
7940 {
7942 }
7943
7945 {
7947 return;
7948
7949 if (!IsMagazine() && other_item)
7950 {
7952 if (quantity_used != 0)
7953 {
7954 float hp1 = GetHealth01("","");
7955 float hp2 = other_item.GetHealth01("","");
7956 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7957 hpResult = hpResult / (
GetQuantity() + quantity_used);
7958
7959 hpResult *= GetMaxHealth();
7960 Math.Round(hpResult);
7961 SetHealth("", "Health", hpResult);
7962
7964 other_item.AddQuantity(-quantity_used);
7965 }
7966 }
7968 }
7969
7971 {
7972 #ifdef SERVER
7973 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7974 GetHierarchyParent().IncreaseLifetimeUp();
7975 #endif
7976 };
7977
7979 {
7980 PlayerBase p = PlayerBase.Cast(player);
7981
7982 array<int> recipesIds = p.m_Recipes;
7983 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7984 if (moduleRecipesManager)
7985 {
7986 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7987 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7988 }
7989
7990 for (int i = 0;i < recipesIds.Count(); i++)
7991 {
7992 int key = recipesIds.Get(i);
7993 string recipeName = moduleRecipesManager.GetRecipeName(key);
7995 }
7996 }
7997
7998
7999 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8000 {
8001 super.GetDebugActions(outputList);
8002
8003
8008
8009
8013
8017
8018
8021
8022
8024 {
8027 }
8028
8030
8033
8037 }
8038
8039
8040
8041
8043 {
8044 super.OnAction(action_id, player, ctx);
8045 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8046 {
8047 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8048 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8049 PlayerBase p = PlayerBase.Cast(player);
8050 if (
EActions.RECIPES_RANGE_START < 1000)
8051 {
8052 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8053 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8054 }
8055 }
8056 #ifndef SERVER
8057 else if (action_id ==
EActions.WATCH_PLAYER)
8058 {
8059 PluginDeveloper.SetDeveloperItemClientEx(player);
8060 }
8061 #endif
8063 {
8064 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8065 {
8066 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8067 OnDebugButtonPressServer(id + 1);
8068 }
8069
8070 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8071 {
8072 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8074 }
8075
8076 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8077 {
8078 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8080 }
8081
8082 else if (action_id ==
EActions.ADD_QUANTITY)
8083 {
8084 if (IsMagazine())
8085 {
8086 Magazine mag = Magazine.Cast(this);
8087 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8088 }
8089 else
8090 {
8092 }
8093
8094 if (m_EM)
8095 {
8096 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8097 }
8098
8099 }
8100
8101 else if (action_id ==
EActions.REMOVE_QUANTITY)
8102 {
8103 if (IsMagazine())
8104 {
8105 Magazine mag2 = Magazine.Cast(this);
8106 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8107 }
8108 else
8109 {
8111 }
8112 if (m_EM)
8113 {
8114 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8115 }
8116
8117 }
8118
8119 else if (action_id ==
EActions.SET_QUANTITY_0)
8120 {
8122
8123 if (m_EM)
8124 {
8125 m_EM.SetEnergy(0);
8126 }
8127 }
8128
8129 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8130 {
8132
8133 if (m_EM)
8134 {
8135 m_EM.SetEnergy(m_EM.GetEnergyMax());
8136 }
8137 }
8138
8139 else if (action_id ==
EActions.ADD_HEALTH)
8140 {
8141 AddHealth("","",GetMaxHealth("","Health")/5);
8142 }
8143 else if (action_id ==
EActions.REMOVE_HEALTH)
8144 {
8145 AddHealth("","",-GetMaxHealth("","Health")/5);
8146 }
8147 else if (action_id ==
EActions.DESTROY_HEALTH)
8148 {
8149 SetHealth01("","",0);
8150 }
8151 else if (action_id ==
EActions.WATCH_ITEM)
8152 {
8154 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8155 #ifdef DEVELOPER
8156 SetDebugDeveloper_item(this);
8157 #endif
8158 }
8159
8160 else if (action_id ==
EActions.ADD_TEMPERATURE)
8161 {
8162 AddTemperature(20);
8163
8164 }
8165
8166 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8167 {
8168 AddTemperature(-20);
8169
8170 }
8171
8172 else if (action_id ==
EActions.FLIP_FROZEN)
8173 {
8174 SetFrozen(!GetIsFrozen());
8175
8176 }
8177
8178 else if (action_id ==
EActions.ADD_WETNESS)
8179 {
8181
8182 }
8183
8184 else if (action_id ==
EActions.REMOVE_WETNESS)
8185 {
8187
8188 }
8189
8190 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8191 {
8194
8195
8196 }
8197
8198 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8199 {
8202 }
8203
8204 else if (action_id ==
EActions.MAKE_SPECIAL)
8205 {
8206 auto debugParams = DebugSpawnParams.WithPlayer(player);
8207 OnDebugSpawnEx(debugParams);
8208 }
8209
8210 else if (action_id ==
EActions.DELETE)
8211 {
8212 Delete();
8213 }
8214
8215 }
8216
8217
8218 return false;
8219 }
8220
8221
8222
8223
8227
8230
8231
8232
8234 {
8235 return false;
8236 }
8237
8238
8240 {
8241 return true;
8242 }
8243
8244
8246 {
8247 return true;
8248 }
8249
8250
8251
8253 {
8254 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8256 }
8257
8260 {
8261 return null;
8262 }
8263
8265 {
8266 return false;
8267 }
8268
8270 {
8271 return false;
8272 }
8273
8277
8278
8280 {
8281 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8282 return module_repairing.CanRepair(this, item_repair_kit);
8283 }
8284
8285
8286 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8287 {
8288 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8289 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8290 }
8291
8292
8294 {
8295
8296
8297
8298
8299
8300
8301
8302
8303 return 1;
8304 }
8305
8306
8307
8309 {
8311 }
8312
8313
8314
8316 {
8318 }
8319
8320
8329 {
8330 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8331
8332 if (player)
8333 {
8334 player.MessageStatus(text);
8335 }
8336 }
8337
8338
8347 {
8348 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8349
8350 if (player)
8351 {
8352 player.MessageAction(text);
8353 }
8354 }
8355
8356
8365 {
8366 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8367
8368 if (player)
8369 {
8370 player.MessageFriendly(text);
8371 }
8372 }
8373
8374
8383 {
8384 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8385
8386 if (player)
8387 {
8388 player.MessageImportant(text);
8389 }
8390 }
8391
8393 {
8394 return true;
8395 }
8396
8397
8398 override bool KindOf(
string tag)
8399 {
8400 bool found = false;
8401 string item_name = this.
GetType();
8404
8405 int array_size = item_tag_array.Count();
8406 for (int i = 0; i < array_size; i++)
8407 {
8408 if (item_tag_array.Get(i) == tag)
8409 {
8410 found = true;
8411 break;
8412 }
8413 }
8414 return found;
8415 }
8416
8417
8419 {
8420
8421 super.OnRPC(sender, rpc_type,ctx);
8422
8423
8424 switch (rpc_type)
8425 {
8426 #ifndef SERVER
8427 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8428 Param2<bool, string> p = new Param2<bool, string>(false, "");
8429
8431 return;
8432
8433 bool play = p.param1;
8434 string soundSet = p.param2;
8435
8436 if (play)
8437 {
8439 {
8441 {
8443 }
8444 }
8445 else
8446 {
8448 }
8449 }
8450 else
8451 {
8453 }
8454
8455 break;
8456 #endif
8457
8458 }
8459
8461 {
8463 }
8464 }
8465
8466
8467
8468
8470 {
8471 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8472 return plugin.GetID(
name);
8473 }
8474
8476 {
8477 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8478 return plugin.GetName(id);
8479 }
8480
8483 {
8484
8485
8486 int varFlags;
8487 if (!ctx.
Read(varFlags))
8488 return;
8489
8490 if (varFlags & ItemVariableFlags.FLOAT)
8491 {
8493 }
8494 }
8495
8497 {
8498
8499 super.SerializeNumericalVars(floats_out);
8500
8501
8502
8504 {
8506 }
8507
8509 {
8511 }
8512
8514 {
8516 }
8517
8519 {
8524 }
8525
8527 {
8529 }
8530 }
8531
8533 {
8534
8535 super.DeSerializeNumericalVars(floats);
8536
8537
8538 int index = 0;
8539 int mask = Math.Round(floats.Get(index));
8540
8541 index++;
8542
8544 {
8546 {
8548 }
8549 else
8550 {
8551 float quantity = floats.Get(index);
8553 }
8554 index++;
8555 }
8556
8558 {
8559 float wet = floats.Get(index);
8561 index++;
8562 }
8563
8565 {
8566 int liquidtype = Math.Round(floats.Get(index));
8568 index++;
8569 }
8570
8572 {
8574 index++;
8576 index++;
8578 index++;
8580 index++;
8581 }
8582
8584 {
8585 int cleanness = Math.Round(floats.Get(index));
8587 index++;
8588 }
8589 }
8590
8592 {
8593 super.WriteVarsToCTX(ctx);
8594
8595
8597 {
8599 }
8600
8602 {
8604 }
8605
8607 {
8609 }
8610
8612 {
8613 int r,g,b,a;
8619 }
8620
8622 {
8624 }
8625 }
8626
8628 {
8629 if (!super.ReadVarsFromCTX(ctx,version))
8630 return false;
8631
8632 int intValue;
8633 float value;
8634
8635 if (version < 140)
8636 {
8637 if (!ctx.
Read(intValue))
8638 return false;
8639
8640 m_VariablesMask = intValue;
8641 }
8642
8644 {
8645 if (!ctx.
Read(value))
8646 return false;
8647
8649 {
8651 }
8652 else
8653 {
8655 }
8656 }
8657
8658 if (version < 140)
8659 {
8661 {
8662 if (!ctx.
Read(value))
8663 return false;
8664 SetTemperatureDirect(value);
8665 }
8666 }
8667
8669 {
8670 if (!ctx.
Read(value))
8671 return false;
8673 }
8674
8676 {
8677 if (!ctx.
Read(intValue))
8678 return false;
8680 }
8681
8683 {
8684 int r,g,b,a;
8686 return false;
8688 return false;
8690 return false;
8692 return false;
8693
8695 }
8696
8698 {
8699 if (!ctx.
Read(intValue))
8700 return false;
8702 }
8703
8704 if (version >= 138 && version < 140)
8705 {
8707 {
8708 if (!ctx.
Read(intValue))
8709 return false;
8710 SetFrozen(intValue);
8711 }
8712 }
8713
8714 return true;
8715 }
8716
8717
8719 {
8722 {
8724 }
8725
8726 if (!super.OnStoreLoad(ctx, version))
8727 {
8729 return false;
8730 }
8731
8732 if (version >= 114)
8733 {
8734 bool hasQuickBarIndexSaved;
8735
8736 if (!ctx.
Read(hasQuickBarIndexSaved))
8737 {
8739 return false;
8740 }
8741
8742 if (hasQuickBarIndexSaved)
8743 {
8744 int itmQBIndex;
8745
8746
8747 if (!ctx.
Read(itmQBIndex))
8748 {
8750 return false;
8751 }
8752
8753 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8754 if (itmQBIndex != -1 && parentPlayer)
8755 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8756 }
8757 }
8758 else
8759 {
8760
8761 PlayerBase player;
8762 int itemQBIndex;
8763 if (version ==
int.
MAX)
8764 {
8765 if (!ctx.
Read(itemQBIndex))
8766 {
8768 return false;
8769 }
8770 }
8771 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8772 {
8773
8774 if (!ctx.
Read(itemQBIndex))
8775 {
8777 return false;
8778 }
8779 if (itemQBIndex != -1 && player)
8780 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8781 }
8782 }
8783
8784 if (version < 140)
8785 {
8786
8787 if (!LoadVariables(ctx, version))
8788 {
8790 return false;
8791 }
8792 }
8793
8794
8796 {
8798 return false;
8799 }
8800 if (version >= 132)
8801 {
8803 if (raib)
8804 {
8806 {
8808 return false;
8809 }
8810 }
8811 }
8812
8814 return true;
8815 }
8816
8817
8818
8820 {
8821 super.OnStoreSave(ctx);
8822
8823 PlayerBase player;
8824 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8825 {
8827
8828 int itemQBIndex = -1;
8829 itemQBIndex = player.FindQuickBarEntityIndex(this);
8830 ctx.
Write(itemQBIndex);
8831 }
8832 else
8833 {
8835 }
8836
8838
8840 if (raib)
8841 {
8843 }
8844 }
8845
8846
8848 {
8849 super.AfterStoreLoad();
8850
8852 {
8854 }
8855
8857 {
8860 }
8861 }
8862
8864 {
8865 super.EEOnAfterLoad();
8866
8868 {
8870 }
8871
8874 }
8875
8877 {
8878 return false;
8879 }
8880
8881
8882
8884 {
8886 {
8887 #ifdef PLATFORM_CONSOLE
8888
8890 {
8892 if (menu)
8893 {
8895 }
8896 }
8897 #endif
8898 }
8899
8901 {
8904 }
8905
8907 {
8908 SetWeightDirty();
8910 }
8912 {
8915 }
8916
8918 {
8921 }
8923 {
8926 }
8927
8928 super.OnVariablesSynchronized();
8929 }
8930
8931
8932
8934 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8935 {
8936 if (!IsServerCheck(allow_client))
8937 return false;
8938
8940 return false;
8941
8944
8945 if (value <= (min + 0.001))
8946 value = min;
8947
8948 if (value == min)
8949 {
8950 if (destroy_config)
8951 {
8952 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8953 if (dstr)
8954 {
8956 this.Delete();
8957 return true;
8958 }
8959 }
8960 else if (destroy_forced)
8961 {
8963 this.Delete();
8964 return true;
8965 }
8966
8968 }
8969
8972
8974 {
8976
8977 if (delta)
8979 }
8980
8982
8983 return false;
8984 }
8985
8986
8988 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8989 {
8991 }
8992
8994 {
8997 }
8998
9000 {
9003 }
9004
9007 {
9008 float value_clamped = Math.Clamp(value, 0, 1);
9010 SetQuantity(result, destroy_config, destroy_forced);
9011 }
9012
9013
9016 {
9018 }
9019
9021 {
9023 }
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9035 {
9036 int slot = -1;
9037 if (GetInventory())
9038 {
9039 InventoryLocation il = new InventoryLocation;
9040 GetInventory().GetCurrentInventoryLocation(il);
9042 }
9043
9045 }
9046
9048 {
9049 float quantity_max = 0;
9050
9052 {
9053 if (attSlotID != -1)
9054 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9055
9056 if (quantity_max <= 0)
9058 }
9059
9060 if (quantity_max <= 0)
9062
9063 return quantity_max;
9064 }
9065
9067 {
9069 }
9070
9072 {
9074 }
9075
9076
9078 {
9080 }
9081
9083 {
9085 }
9086
9088 {
9090 }
9091
9092
9094 {
9095
9096 float weightEx = GetWeightEx();
9097 float special = GetInventoryAndCargoWeight();
9098 return weightEx - special;
9099 }
9100
9101
9103 {
9105 }
9106
9108 {
9110 {
9111 #ifdef DEVELOPER
9112 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9113 {
9114 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9116 }
9117 #endif
9118
9120 }
9121 else if (HasEnergyManager())
9122 {
9123 #ifdef DEVELOPER
9124 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9125 {
9126 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9127 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9128 }
9129 #endif
9130 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9131 }
9132 else
9133 {
9134 #ifdef DEVELOPER
9135 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9136 {
9137 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9138 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9139 }
9140 #endif
9141 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9142 }
9143 }
9144
9147 {
9148 int item_count = 0;
9150
9151 if (GetInventory().GetCargo() != NULL)
9152 {
9153 item_count = GetInventory().GetCargo().GetItemCount();
9154 }
9155
9156 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9157 {
9158 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9159 if (item)
9160 item_count += item.GetNumberOfItems();
9161 }
9162 return item_count;
9163 }
9164
9167 {
9168 float weight = 0;
9169 float wetness = 1;
9170 if (include_wetness)
9173 {
9174 weight = wetness * m_ConfigWeight;
9175 }
9177 {
9178 weight = 1;
9179 }
9180 return weight;
9181 }
9182
9183
9184
9186 {
9187 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9188 {
9189 GameInventory inv = GetInventory();
9190 array<EntityAI> items = new array<EntityAI>;
9192 for (int i = 0; i < items.Count(); i++)
9193 {
9195 if (item)
9196 {
9198 }
9199 }
9200 }
9201 }
9202
9203
9204
9205
9207 {
9208 float energy = 0;
9209 if (HasEnergyManager())
9210 {
9211 energy = GetCompEM().GetEnergy();
9212 }
9213 return energy;
9214 }
9215
9216
9218 {
9219 super.OnEnergyConsumed();
9220
9222 }
9223
9225 {
9226 super.OnEnergyAdded();
9227
9229 }
9230
9231
9233 {
9234 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9235 {
9237 {
9238 float energy_0to1 = GetCompEM().GetEnergy0To1();
9240 }
9241 }
9242 }
9243
9244
9246 {
9247 return ConfigGetFloat("heatIsolation");
9248 }
9249
9251 {
9253 }
9254
9256 {
9257 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9258 if (
GetGame().ConfigIsExisting(paramPath))
9260
9261 return 0.0;
9262 }
9263
9265 {
9266 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9267 if (
GetGame().ConfigIsExisting(paramPath))
9269
9270 return 0.0;
9271 }
9272
9273 override void SetWet(
float value,
bool allow_client =
false)
9274 {
9275 if (!IsServerCheck(allow_client))
9276 return;
9277
9280
9282
9283 m_VarWet = Math.Clamp(value, min, max);
9284
9286 {
9289 }
9290 }
9291
9292 override void AddWet(
float value)
9293 {
9295 }
9296
9298 {
9300 }
9301
9303 {
9305 }
9306
9308 {
9310 }
9311
9313 {
9315 }
9316
9318 {
9320 }
9321
9323 {
9326 if (newLevel != oldLevel)
9327 {
9329 }
9330 }
9331
9333 {
9334 SetWeightDirty();
9335 }
9336
9338 {
9339 return GetWetLevelInternal(
m_VarWet);
9340 }
9341
9342
9343
9345 {
9347 }
9348
9350 {
9352 }
9353
9355 {
9357 }
9358
9360 {
9362 }
9363
9364
9365
9367 {
9368 if (ConfigIsExisting("itemModelLength"))
9369 {
9370 return ConfigGetFloat("itemModelLength");
9371 }
9372 return 0;
9373 }
9374
9376 {
9377 if (ConfigIsExisting("itemAttachOffset"))
9378 {
9379 return ConfigGetFloat("itemAttachOffset");
9380 }
9381 return 0;
9382 }
9383
9384 override void SetCleanness(
int value,
bool allow_client =
false)
9385 {
9386 if (!IsServerCheck(allow_client))
9387 return;
9388
9390
9392
9395 }
9396
9398 {
9400 }
9401
9403 {
9404 return true;
9405 }
9406
9407
9408
9409
9411 {
9413 }
9414
9416 {
9418 }
9419
9420
9421
9422
9423 override void SetColor(
int r,
int g,
int b,
int a)
9424 {
9430 }
9432 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9433 {
9438 }
9439
9441 {
9443 }
9444
9447 {
9448 int r,g,b,a;
9450 r = r/255;
9451 g = g/255;
9452 b = b/255;
9453 a = a/255;
9454 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9455 }
9456
9457
9458
9459 override void SetLiquidType(
int value,
bool allow_client =
false)
9460 {
9461 if (!IsServerCheck(allow_client))
9462 return;
9463
9468 }
9469
9471 {
9472 return ConfigGetInt("varLiquidTypeInit");
9473 }
9474
9476 {
9478 }
9479
9481 {
9483 SetFrozen(false);
9484 }
9485
9488 {
9489 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9490 }
9491
9492
9495 {
9496 PlayerBase nplayer;
9497 if (PlayerBase.CastTo(nplayer, player))
9498 {
9500
9501 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9502 }
9503 }
9504
9505
9508 {
9509 PlayerBase nplayer;
9510 if (PlayerBase.CastTo(nplayer,player))
9511 {
9512
9513 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9514
9515 }
9516
9517
9518 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9519
9520
9521 if (HasEnergyManager())
9522 {
9523 GetCompEM().UpdatePlugState();
9524 }
9525 }
9526
9527
9529 {
9530 super.OnPlacementStarted(player);
9531
9533 }
9534
9535 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9536 {
9538 {
9539 m_AdminLog.OnPlacementComplete(player,
this);
9540 }
9541
9542 super.OnPlacementComplete(player, position, orientation);
9543 }
9544
9545
9546
9547
9548
9550 {
9552 {
9553 return true;
9554 }
9555 else
9556 {
9557 return false;
9558 }
9559 }
9560
9561
9563 {
9565 {
9567 }
9568 }
9569
9570
9572 {
9574 }
9575
9577 {
9579 }
9580
9581 override void InsertAgent(
int agent,
float count = 1)
9582 {
9583 if (count < 1)
9584 return;
9585
9587 }
9588
9591 {
9593 }
9594
9595
9597 {
9599 }
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
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
9643 {
9645 return false;
9646 return true;
9647 }
9648
9650 {
9651
9653 }
9654
9655
9658 {
9659 super.CheckForRoofLimited(timeTresholdMS);
9660
9662 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9663 {
9664 m_PreviousRoofTestTime = time;
9665 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9666 }
9667 }
9668
9669
9671 {
9673 {
9674 return 0;
9675 }
9676
9677 if (GetInventory().GetAttachmentSlotsCount() != 0)
9678 {
9679 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9680 if (filter)
9681 return filter.GetProtectionLevel(type, false, system);
9682 else
9683 return 0;
9684 }
9685
9686 string subclassPath, entryName;
9687
9688 switch (type)
9689 {
9691 entryName = "biological";
9692 break;
9694 entryName = "chemical";
9695 break;
9696 default:
9697 entryName = "biological";
9698 break;
9699 }
9700
9701 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9702
9704 }
9705
9706
9707
9710 {
9711 if (!IsMagazine())
9713
9715 }
9716
9717
9718
9719
9720
9725 {
9726 return true;
9727 }
9728
9730 {
9732 }
9733
9734
9735
9736
9737
9739 {
9740 if (parent)
9741 {
9742 if (parent.IsInherited(DayZInfected))
9743 return true;
9744
9745 if (!parent.IsRuined())
9746 return true;
9747 }
9748
9749 return true;
9750 }
9751
9753 {
9754 if (!super.CanPutAsAttachment(parent))
9755 {
9756 return false;
9757 }
9758
9759 if (!IsRuined() && !parent.IsRuined())
9760 {
9761 return true;
9762 }
9763
9764 return false;
9765 }
9766
9768 {
9769
9770
9771
9772
9773 return super.CanReceiveItemIntoCargo(item);
9774 }
9775
9777 {
9778
9779
9780
9781
9782 GameInventory attachmentInv = attachment.GetInventory();
9784 {
9785 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9786 return false;
9787 }
9788
9789 InventoryLocation loc = new InventoryLocation();
9790 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9791 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9792 return false;
9793
9794 return super.CanReceiveAttachment(attachment, slotId);
9795 }
9796
9798 {
9799 if (!super.CanReleaseAttachment(attachment))
9800 return false;
9801
9802 return GetInventory().AreChildrenAccessible();
9803 }
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9826 {
9827 int id = muzzle_owner.GetMuzzleID();
9828 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9829
9830 if (WPOF_array)
9831 {
9832 for (int i = 0; i < WPOF_array.Count(); i++)
9833 {
9834 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9835
9836 if (WPOF)
9837 {
9838 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9839 }
9840 }
9841 }
9842 }
9843
9844
9846 {
9847 int id = muzzle_owner.GetMuzzleID();
9849
9850 if (WPOBE_array)
9851 {
9852 for (int i = 0; i < WPOBE_array.Count(); i++)
9853 {
9854 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9855
9856 if (WPOBE)
9857 {
9858 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9859 }
9860 }
9861 }
9862 }
9863
9864
9866 {
9867 int id = muzzle_owner.GetMuzzleID();
9868 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9869
9870 if (WPOOH_array)
9871 {
9872 for (int i = 0; i < WPOOH_array.Count(); i++)
9873 {
9874 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9875
9876 if (WPOOH)
9877 {
9878 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9879 }
9880 }
9881 }
9882 }
9883
9884
9886 {
9887 int id = muzzle_owner.GetMuzzleID();
9888 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9889
9890 if (WPOOH_array)
9891 {
9892 for (int i = 0; i < WPOOH_array.Count(); i++)
9893 {
9894 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9895
9896 if (WPOOH)
9897 {
9898 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9899 }
9900 }
9901 }
9902 }
9903
9904
9906 {
9907 int id = muzzle_owner.GetMuzzleID();
9908 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9909
9910 if (WPOOH_array)
9911 {
9912 for (int i = 0; i < WPOOH_array.Count(); i++)
9913 {
9914 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9915
9916 if (WPOOH)
9917 {
9918 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9919 }
9920 }
9921 }
9922 }
9923
9924
9925
9927 {
9929 {
9930 return true;
9931 }
9932
9933 return false;
9934 }
9935
9937 {
9939 {
9940 return true;
9941 }
9942
9943 return false;
9944 }
9945
9947 {
9949 {
9950 return true;
9951 }
9952
9953 return false;
9954 }
9955
9957 {
9958 return false;
9959 }
9960
9963 {
9964 return UATimeSpent.DEFAULT_DEPLOY;
9965 }
9966
9967
9968
9969
9971 {
9973 SetSynchDirty();
9974 }
9975
9977 {
9979 }
9980
9981
9983 {
9984 return false;
9985 }
9986
9989 {
9990 string att_type = "None";
9991
9992 if (ConfigIsExisting("soundAttType"))
9993 {
9994 att_type = ConfigGetString("soundAttType");
9995 }
9996
9998 }
9999
10001 {
10003 }
10004
10005
10006
10007
10008
10012
10014 {
10017
10019 }
10020
10021
10023 {
10025 return;
10026
10028
10031
10034
10035 SoundParameters params = new SoundParameters();
10039 }
10040
10041
10043 {
10045 return;
10046
10048 SetSynchDirty();
10049
10052 }
10053
10054
10056 {
10058 return;
10059
10061 SetSynchDirty();
10062
10065 }
10066
10068 {
10070 }
10071
10073 {
10075 }
10076
10079 {
10080 if (!
GetGame().IsDedicatedServer())
10081 {
10082 if (ConfigIsExisting("attachSoundSet"))
10083 {
10084 string cfg_path = "";
10085 string soundset = "";
10086 string type_name =
GetType();
10087
10090 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10091 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10092
10093 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10094 {
10095 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10096 {
10097 if (cfg_slot_array[i] == slot_type)
10098 {
10099 soundset = cfg_soundset_array[i];
10100 break;
10101 }
10102 }
10103 }
10104
10105 if (soundset != "")
10106 {
10107 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10109 }
10110 }
10111 }
10112 }
10113
10115 {
10116
10117 }
10118
10119 void OnApply(PlayerBase player);
10120
10122 {
10123 return 1.0;
10124 };
10125
10127 {
10129 }
10130
10132 {
10134 }
10135
10137
10139 {
10140 SetDynamicPhysicsLifeTime(0.01);
10142 }
10143
10145 {
10146 array<string> zone_names = new array<string>;
10147 GetDamageZones(zone_names);
10148 for (int i = 0; i < zone_names.Count(); i++)
10149 {
10150 SetHealthMax(zone_names.Get(i),"Health");
10151 }
10152 SetHealthMax("","Health");
10153 }
10154
10157 {
10158 float global_health = GetHealth01("","Health");
10159 array<string> zones = new array<string>;
10160 GetDamageZones(zones);
10161
10162 for (int i = 0; i < zones.Count(); i++)
10163 {
10164 SetHealth01(zones.Get(i),"Health",global_health);
10165 }
10166 }
10167
10170 {
10171 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10172 }
10173
10175 {
10176 if (!hasRootAsPlayer)
10177 {
10178 if (refParentIB)
10179 {
10180
10181 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10182 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10183
10184 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10185 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10186
10189 }
10190 else
10191 {
10192
10195 }
10196 }
10197 }
10198
10200 {
10202 {
10203 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10204 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10205 {
10206 float heatPermCoef = 1.0;
10208 while (ent)
10209 {
10210 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10211 ent = ent.GetHierarchyParent();
10212 }
10213
10214 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10215 }
10216 }
10217 }
10218
10220 {
10221
10222 EntityAI parent = GetHierarchyParent();
10223 if (!parent)
10224 {
10225 hasParent = false;
10226 hasRootAsPlayer = false;
10227 }
10228 else
10229 {
10230 hasParent = true;
10231 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10232 refParentIB =
ItemBase.Cast(parent);
10233 }
10234 }
10235
10236 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10237 {
10238
10239 }
10240
10242 {
10243
10244 return false;
10245 }
10246
10248 {
10249
10250
10251 return false;
10252 }
10253
10255 {
10256
10257 return false;
10258 }
10259
10262 {
10263 return !GetIsFrozen() &&
IsOpen();
10264 }
10265
10267 {
10268 bool hasParent = false, hasRootAsPlayer = false;
10270
10271 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10272 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10273
10274 if (wwtu || foodDecay)
10275 {
10279
10280 if (processWetness || processTemperature || processDecay)
10281 {
10283
10284 if (processWetness)
10285 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10286
10287 if (processTemperature)
10289
10290 if (processDecay)
10291 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10292 }
10293 }
10294 }
10295
10298 {
10300 }
10301
10303 {
10306
10307 return super.GetTemperatureFreezeThreshold();
10308 }
10309
10311 {
10314
10315 return super.GetTemperatureThawThreshold();
10316 }
10317
10319 {
10322
10323 return super.GetItemOverheatThreshold();
10324 }
10325
10327 {
10329 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10330
10331 return super.GetTemperatureFreezeTime();
10332 }
10333
10335 {
10337 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10338
10339 return super.GetTemperatureThawTime();
10340 }
10341
10346
10348 {
10349 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10350 }
10351
10353 {
10354 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10355 }
10356
10359 {
10361 }
10362
10364 {
10366 }
10367
10369 {
10371 }
10372
10375 {
10376 return null;
10377 }
10378
10381 {
10382 return false;
10383 }
10384
10386 {
10388 {
10391 if (!trg)
10392 {
10394 explosive = this;
10395 }
10396
10397 explosive.PairRemote(trg);
10399
10400 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10401 trg.SetPersistentPairID(persistentID);
10402 explosive.SetPersistentPairID(persistentID);
10403
10404 return true;
10405 }
10406 return false;
10407 }
10408
10411 {
10412 float ret = 1.0;
10415 ret *= GetHealth01();
10416
10417 return ret;
10418 }
10419
10420 #ifdef DEVELOPER
10421 override void SetDebugItem()
10422 {
10423 super.SetDebugItem();
10424 _itemBase = this;
10425 }
10426
10428 {
10429 string text = super.GetDebugText();
10430
10432 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10433
10434 return text;
10435 }
10436 #endif
10437
10439 {
10440 return true;
10441 }
10442
10444
10446
10448 {
10451 }
10452
10453
10461
10477}
10478
10480{
10482 if (entity)
10483 {
10484 bool is_item = entity.IsInherited(
ItemBase);
10485 if (is_item && full_quantity)
10486 {
10489 }
10490 }
10491 else
10492 {
10494 return NULL;
10495 }
10496 return entity;
10497}
10498
10500{
10501 if (item)
10502 {
10503 if (health > 0)
10504 item.SetHealth("", "", health);
10505
10506 if (item.CanHaveTemperature())
10507 {
10509 if (item.CanFreeze())
10510 item.SetFrozen(false);
10511 }
10512
10513 if (item.HasEnergyManager())
10514 {
10515 if (quantity >= 0)
10516 {
10517 item.GetCompEM().SetEnergy0To1(quantity);
10518 }
10519 else
10520 {
10522 }
10523 }
10524 else if (item.IsMagazine())
10525 {
10526 Magazine mag = Magazine.Cast(item);
10527 if (quantity >= 0)
10528 {
10529 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10530 }
10531 else
10532 {
10534 }
10535
10536 }
10537 else
10538 {
10539 if (quantity >= 0)
10540 {
10541 item.SetQuantityNormalized(quantity, false);
10542 }
10543 else
10544 {
10546 }
10547
10548 }
10549 }
10550}
10551
10552#ifdef DEVELOPER
10554#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.