5741{
5743 {
5744 return true;
5745 }
5746};
5747
5748
5749
5751{
5755
5757
5760
5761
5762
5763
5764
5773
5779
5784
5789
5810 protected bool m_IsResultOfSplit
5811
5813
5818
5819
5820
5822
5826
5827
5828
5830
5833
5834
5835
5841
5842
5850
5853
5854
5856
5857
5859
5860
5865
5866
5871
5872
5874
5875
5877 {
5882
5883 if (!
GetGame().IsDedicatedServer())
5884 {
5886 {
5888
5890 {
5892 }
5893 }
5894
5897 }
5898
5899 m_OldLocation = null;
5900
5902 {
5904 }
5905
5906 if (ConfigIsExisting("headSelectionsToHide"))
5907 {
5910 }
5911
5913 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5914 {
5916 }
5917
5919
5920 m_IsResultOfSplit = false;
5921
5923 }
5924
5926 {
5927 super.InitItemVariables();
5928
5934 m_Count = ConfigGetInt(
"count");
5935
5938
5943
5946
5951
5963
5967
5968
5971 if (ConfigIsExisting("canBeSplit"))
5972 {
5975 }
5976
5978 if (ConfigIsExisting("itemBehaviour"))
5980
5981
5984 RegisterNetSyncVariableInt("m_VarLiquidType");
5985 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5986
5987 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5988 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5989 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5990
5991 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5992 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5993 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5994 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5995
5996 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5997 RegisterNetSyncVariableBool("m_IsTakeable");
5998 RegisterNetSyncVariableBool("m_IsHologram");
5999
6002 {
6005 }
6006
6008
6010 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6012
6013 }
6014
6016 {
6018 }
6019
6021 {
6024 {
6029 }
6030 }
6031
6032 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6033 {
6035 {
6038 }
6039
6041 }
6042
6044 {
6050 }
6051
6053
6055 {
6057
6058 if (!action)
6059 {
6060 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6061 return;
6062 }
6063
6065 if (!ai)
6066 {
6068 return;
6069 }
6070
6072 if (!action_array)
6073 {
6074 action_array = new array<ActionBase_Basic>;
6076 }
6077 if (LogManager.IsActionLogEnable())
6078 {
6079 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6080 }
6081
6082 if (action_array.Find(action) != -1)
6083 {
6084 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6085 }
6086 else
6087 {
6088 action_array.Insert(action);
6089 }
6090 }
6091
6093 {
6095 ActionBase action = player.GetActionManager().GetAction(actionName);
6098
6099 if (action_array)
6100 {
6101 action_array.RemoveItem(action);
6102 }
6103 }
6104
6105
6106
6108 {
6109 ActionOverrideData overrideData = new ActionOverrideData();
6113
6115 if (!actionMap)
6116 {
6119 }
6120
6121 actionMap.Insert(this.
Type(), overrideData);
6122
6123 }
6124
6126
6128
6129
6131 {
6134
6137
6138 string config_to_search = "CfgVehicles";
6139 string muzzle_owner_config;
6140
6142 {
6143 if (IsInherited(Weapon))
6144 config_to_search = "CfgWeapons";
6145
6146 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6147
6148 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6149
6151
6152 if (config_OnFire_subclass_count > 0)
6153 {
6154 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6155
6156 for (int i = 0; i < config_OnFire_subclass_count; i++)
6157 {
6158 string particle_class = "";
6160 string config_OnFire_entry = config_OnFire_class + particle_class;
6161 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6162 WPOF_array.Insert(WPOF);
6163 }
6164
6165
6167 }
6168 }
6169
6171 {
6172 config_to_search = "CfgWeapons";
6173 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6174
6175 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6176
6178
6179 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6180 {
6181 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6182
6183 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6184 {
6185 string particle_class2 = "";
6187 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6188 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6189 WPOBE_array.Insert(WPOBE);
6190 }
6191
6192
6194 }
6195 }
6196 }
6197
6198
6200 {
6203
6205 {
6206 string config_to_search = "CfgVehicles";
6207
6208 if (IsInherited(Weapon))
6209 config_to_search = "CfgWeapons";
6210
6211 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6212 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6213
6214 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6215 {
6216
6218
6220 {
6222 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6224 return;
6225 }
6226
6229
6230
6231
6233 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6234
6235 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6236 {
6237 string particle_class = "";
6239 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6241
6242 if (entry_type == CT_CLASS)
6243 {
6244 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6245 WPOOH_array.Insert(WPOF);
6246 }
6247 }
6248
6249
6251 }
6252 }
6253 }
6254
6256 {
6258 }
6259
6261 {
6263 {
6265
6268
6271
6272 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6273 }
6274 }
6275
6277 {
6279 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6280
6282 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6283
6285 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6286
6288 {
6290 }
6291 }
6292
6294 {
6296 }
6297
6299 {
6302 else
6304
6306 {
6309 }
6310 else
6311 {
6314
6317 }
6318
6320 }
6321
6323 {
6325 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6326 }
6327
6329 {
6331 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6333 }
6334
6336 {
6338 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6339 }
6340
6342 {
6345
6346 OverheatingParticle OP = new OverheatingParticle();
6351
6353 }
6354
6356 {
6359
6360 return -1;
6361 }
6362
6364 {
6366 {
6369
6370 for (int i = count; i > 0; --i)
6371 {
6372 int id = i - 1;
6375
6378
6379 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6380 {
6381 if (p)
6382 {
6385 }
6386 }
6387 }
6388 }
6389 }
6390
6392 {
6394 {
6396 {
6397 int id = i - 1;
6399
6400 if (OP)
6401 {
6403
6404 if (p)
6405 {
6407 }
6408
6409 delete OP;
6410 }
6411 }
6412
6415 }
6416 }
6417
6420 {
6421 return 0.0;
6422 }
6423
6424
6426 {
6427 return 250;
6428 }
6429
6431 {
6432 return 0;
6433 }
6434
6437 {
6439 return true;
6440
6441 return false;
6442 }
6443
6446 {
6449
6451 {
6453 }
6454 else
6455 {
6456
6458 }
6459
6461 }
6462
6469 {
6470 return -1;
6471 }
6472
6473
6474
6475
6477 {
6479 {
6481 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6482
6483 if (r_index >= 0)
6484 {
6485 InventoryLocation r_il = new InventoryLocation;
6486 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6487
6488 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6491 {
6492 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6493 }
6495 {
6496 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6497 }
6498
6499 }
6500
6501 player.GetHumanInventory().ClearUserReservedLocation(this);
6502 }
6503
6506 }
6507
6508
6509
6510
6512 {
6513 return ItemBase.m_DebugActionsMask;
6514 }
6515
6517 {
6518 return ItemBase.m_DebugActionsMask & mask;
6519 }
6520
6522 {
6523 ItemBase.m_DebugActionsMask = mask;
6524 }
6525
6527 {
6528 ItemBase.m_DebugActionsMask |= mask;
6529 }
6530
6532 {
6533 ItemBase.m_DebugActionsMask &= ~mask;
6534 }
6535
6537 {
6539 {
6541 }
6542 else
6543 {
6545 }
6546 }
6547
6548
6550 {
6551 if (GetEconomyProfile())
6552 {
6553 float q_max = GetEconomyProfile().GetQuantityMax();
6554 if (q_max > 0)
6555 {
6556 float q_min = GetEconomyProfile().GetQuantityMin();
6557 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6558
6560 {
6561 ComponentEnergyManager comp = GetCompEM();
6563 {
6565 }
6566 }
6568 {
6570
6571 }
6572
6573 }
6574 }
6575 }
6576
6579 {
6580 EntityAI parent = GetHierarchyParent();
6581
6582 if (parent)
6583 {
6584 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6585 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6586 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6587 }
6588 }
6589
6592 {
6593 EntityAI parent = GetHierarchyParent();
6594
6595 if (parent)
6596 {
6597 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6598 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6599 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6600 }
6601 }
6602
6604 {
6605
6606
6607
6608
6610
6612 {
6613 if (ScriptInputUserData.CanStoreInputUserData())
6614 {
6615 ScriptInputUserData ctx = new ScriptInputUserData;
6621 ctx.
Write(use_stack_max);
6624
6626 {
6627 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6628 }
6629 }
6630 }
6631 else if (!
GetGame().IsMultiplayer())
6632 {
6634 }
6635 }
6636
6638 {
6640 }
6641
6643 {
6645 }
6646
6648 {
6650 }
6651
6653 {
6654
6655 return false;
6656 }
6657
6659 {
6660 return false;
6661 }
6662
6666 {
6667 return false;
6668 }
6669
6671 {
6672 return "";
6673 }
6674
6676
6678 {
6679 return false;
6680 }
6681
6683 {
6684 return true;
6685 }
6686
6687
6688
6690 {
6691 return true;
6692 }
6693
6695 {
6696 return true;
6697 }
6698
6700 {
6701 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6703 }
6704
6706 {
6708 }
6709
6711 {
6713 if (!is_being_placed)
6715 SetSynchDirty();
6716 }
6717
6718
6720
6722 {
6724 }
6725
6727 {
6729 }
6730
6732 {
6733 return 1;
6734 }
6735
6737 {
6738 return false;
6739 }
6740
6742 {
6744 SetSynchDirty();
6745 }
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6782 {
6783 super.OnMovedInsideCargo(container);
6784
6785 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6786 }
6787
6788 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6789 {
6790 super.EEItemLocationChanged(oldLoc,newLoc);
6791
6792 PlayerBase new_player = null;
6793 PlayerBase old_player = null;
6794
6795 if (newLoc.GetParent())
6796 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6797
6798 if (oldLoc.GetParent())
6799 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6800
6802 {
6803 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6804
6805 if (r_index >= 0)
6806 {
6807 InventoryLocation r_il = new InventoryLocation;
6808 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6809
6810 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6813 {
6814 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6815 }
6817 {
6818 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6819 }
6820
6821 }
6822 }
6823
6825 {
6826 if (new_player)
6827 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6828
6829 if (new_player == old_player)
6830 {
6831
6832 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6833 {
6835 {
6836 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6837 {
6838 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6839 }
6840 }
6841 else
6842 {
6843 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6844 }
6845 }
6846
6847 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6848 {
6849 int type = oldLoc.GetType();
6851 {
6852 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6853 }
6855 {
6856 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6857 }
6858 }
6859 if (!m_OldLocation)
6860 {
6861 m_OldLocation = new InventoryLocation;
6862 }
6863 m_OldLocation.Copy(oldLoc);
6864 }
6865 else
6866 {
6867 if (m_OldLocation)
6868 {
6869 m_OldLocation.Reset();
6870 }
6871 }
6872
6874 }
6875 else
6876 {
6877 if (new_player)
6878 {
6879 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6880 if (res_index >= 0)
6881 {
6882 InventoryLocation il = new InventoryLocation;
6883 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6885 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6888 {
6889 il.
GetParent().GetOnReleaseLock().Invoke(it);
6890 }
6892 {
6894 }
6895
6896 }
6897 }
6899 {
6900
6902 }
6903
6904 if (m_OldLocation)
6905 {
6906 m_OldLocation.Reset();
6907 }
6908 }
6909 }
6910
6911 override void EOnContact(IEntity other, Contact extra)
6912 {
6914 {
6915 int liquidType = -1;
6917 if (impactSpeed > 0.0)
6918 {
6920 #ifndef SERVER
6922 #else
6924 SetSynchDirty();
6925 #endif
6927 }
6928 }
6929
6930 #ifdef SERVER
6931 if (GetCompEM() && GetCompEM().IsPlugged())
6932 {
6933 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6934 GetCompEM().UnplugThis();
6935 }
6936 #endif
6937 }
6938
6940
6942 {
6944 }
6945
6947 {
6948
6949 }
6950
6952 {
6953 super.OnItemLocationChanged(old_owner, new_owner);
6954
6955 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6956 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6957
6958 if (!relatedPlayer && playerNew)
6959 relatedPlayer = playerNew;
6960
6961 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6962 {
6964 if (actionMgr)
6965 {
6966 ActionBase currentAction = actionMgr.GetRunningAction();
6967 if (currentAction)
6969 }
6970 }
6971
6972 Man ownerPlayerOld = null;
6973 Man ownerPlayerNew = null;
6974
6975 if (old_owner)
6976 {
6977 if (old_owner.
IsMan())
6978 {
6979 ownerPlayerOld = Man.Cast(old_owner);
6980 }
6981 else
6982 {
6983 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6984 }
6985 }
6986 else
6987 {
6989 {
6991
6992 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6993 {
6994 GetCompEM().UnplugThis();
6995 }
6996 }
6997 }
6998
6999 if (new_owner)
7000 {
7001 if (new_owner.
IsMan())
7002 {
7003 ownerPlayerNew = Man.Cast(new_owner);
7004 }
7005 else
7006 {
7007 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7008 }
7009 }
7010
7011 if (ownerPlayerOld != ownerPlayerNew)
7012 {
7013 if (ownerPlayerOld)
7014 {
7015 array<EntityAI> subItemsExit = new array<EntityAI>;
7017 for (int i = 0; i < subItemsExit.Count(); i++)
7018 {
7021 }
7022 }
7023
7024 if (ownerPlayerNew)
7025 {
7026 array<EntityAI> subItemsEnter = new array<EntityAI>;
7028 for (int j = 0; j < subItemsEnter.Count(); j++)
7029 {
7032 }
7033 }
7034 }
7035 else if (ownerPlayerNew != null)
7036 {
7037 PlayerBase nplayer;
7038 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7039 {
7040 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7042 for (int k = 0; k < subItemsUpdate.Count(); k++)
7043 {
7045 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7046 }
7047 }
7048 }
7049
7050 if (old_owner)
7051 old_owner.OnChildItemRemoved(this);
7052 if (new_owner)
7053 new_owner.OnChildItemReceived(this);
7054 }
7055
7056
7058 {
7059 super.EEDelete(parent);
7060 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7061 if (player)
7062 {
7064
7065 if (player.IsAlive())
7066 {
7067 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7068 if (r_index >= 0)
7069 {
7070 InventoryLocation r_il = new InventoryLocation;
7071 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7072
7073 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7076 {
7077 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7078 }
7080 {
7081 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7082 }
7083
7084 }
7085
7086 player.RemoveQuickBarEntityShortcut(this);
7087 }
7088 }
7089 }
7090
7092 {
7093 super.EEKilled(killer);
7094
7097 {
7098 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7099 {
7100 if (IsMagazine())
7101 {
7102 if (Magazine.Cast(this).GetAmmoCount() > 0)
7103 {
7105 }
7106 }
7107 else
7108 {
7110 }
7111 }
7112 }
7113 }
7114
7116 {
7117 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7118
7119 super.OnWasAttached(parent, slot_id);
7120
7123
7125 }
7126
7128 {
7129 super.OnWasDetached(parent, slot_id);
7130
7133 }
7134
7136 {
7137 int idx;
7140
7141 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7142 if (inventory_slots.Count() < 1)
7143 {
7144 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7145 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7146 }
7147 else
7148 {
7149 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7150 }
7151
7152 idx = inventory_slots.Find(slot);
7153 if (idx < 0)
7154 return "";
7155
7156 return attach_types.Get(idx);
7157 }
7158
7160 {
7161 int idx = -1;
7162 string slot;
7163
7166
7167 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7168 if (inventory_slots.Count() < 1)
7169 {
7170 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7171 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7172 }
7173 else
7174 {
7175 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7176 if (detach_types.Count() < 1)
7177 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7178 }
7179
7180 for (int i = 0; i < inventory_slots.Count(); i++)
7181 {
7182 slot = inventory_slots.Get(i);
7183 }
7184
7185 if (slot != "")
7186 {
7187 if (detach_types.Count() == 1)
7188 idx = 0;
7189 else
7190 idx = inventory_slots.Find(slot);
7191 }
7192 if (idx < 0)
7193 return "";
7194
7195 return detach_types.Get(idx);
7196 }
7197
7199 {
7200
7202
7203
7204 float min_time = 1;
7205 float max_time = 3;
7206 float delay = Math.RandomFloat(min_time, max_time);
7207
7208 explode_timer.Run(delay, this, "DoAmmoExplosion");
7209 }
7210
7212 {
7213 Magazine magazine = Magazine.Cast(this);
7214 int pop_sounds_count = 6;
7215 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7216
7217
7218 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7219 string sound_name = pop_sounds[ sound_idx ];
7221
7222
7223 magazine.ServerAddAmmoCount(-1);
7224
7225
7226 float min_temp_to_explode = 100;
7227
7228 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7229 {
7231 }
7232 }
7233
7234
7235 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7236 {
7237 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7238
7239 const int CHANCE_DAMAGE_CARGO = 4;
7240 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7241 const int CHANCE_DAMAGE_NOTHING = 2;
7242
7244 {
7245 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7246 int chances;
7247 int rnd;
7248
7249 if (GetInventory().GetCargo())
7250 {
7251 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7252 rnd = Math.RandomInt(0,chances);
7253
7254 if (rnd < CHANCE_DAMAGE_CARGO)
7255 {
7257 }
7258 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7259 {
7261 }
7262 }
7263 else
7264 {
7265 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7266 rnd = Math.RandomInt(0,chances);
7267
7268 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7269 {
7271 }
7272 }
7273 }
7274 }
7275
7277 {
7278 if (GetInventory().GetCargo())
7279 {
7280 int item_count = GetInventory().GetCargo().GetItemCount();
7281 if (item_count > 0)
7282 {
7283 int random_pick = Math.RandomInt(0, item_count);
7285 if (!item.IsExplosive())
7286 {
7287 item.AddHealth("","",damage);
7288 return true;
7289 }
7290 }
7291 }
7292 return false;
7293 }
7294
7296 {
7297 int attachment_count = GetInventory().AttachmentCount();
7298 if (attachment_count > 0)
7299 {
7300 int random_pick = Math.RandomInt(0, attachment_count);
7301 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7302 if (!attachment.IsExplosive())
7303 {
7304 attachment.AddHealth("","",damage);
7305 return true;
7306 }
7307 }
7308 return false;
7309 }
7310
7312 {
7314 }
7315
7317 {
7319 return GetInventory().CanRemoveEntity();
7320
7321 return false;
7322 }
7323
7325 {
7327 return;
7328
7330 {
7331 if (ScriptInputUserData.CanStoreInputUserData())
7332 {
7333 ScriptInputUserData ctx = new ScriptInputUserData;
7338 ctx.
Write(destination_entity);
7342 }
7343 }
7344 else if (!
GetGame().IsMultiplayer())
7345 {
7347 }
7348 }
7349
7351 {
7353 return;
7354
7355 float split_quantity_new;
7359 InventoryLocation loc = new InventoryLocation;
7360
7361 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7362 {
7364 split_quantity_new = stack_max;
7365 else
7367
7368 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7369 if (new_item)
7370 {
7371 new_item.SetResultOfSplit(true);
7372 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7374 new_item.SetQuantity(split_quantity_new);
7375 }
7376 }
7377 else if (destination_entity && slot_id == -1)
7378 {
7379 if (quantity > stack_max)
7380 split_quantity_new = stack_max;
7381 else
7382 split_quantity_new = quantity;
7383
7385 {
7388 }
7389
7390 if (new_item)
7391 {
7392 new_item.SetResultOfSplit(true);
7393 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7395 new_item.SetQuantity(split_quantity_new);
7396 }
7397 }
7398 else
7399 {
7400 if (stack_max != 0)
7401 {
7403 {
7405 }
7406
7407 if (split_quantity_new == 0)
7408 {
7409 if (!
GetGame().IsMultiplayer())
7410 player.PhysicalPredictiveDropItem(this);
7411 else
7412 player.ServerDropEntity(this);
7413 return;
7414 }
7415
7417
7418 if (new_item)
7419 {
7420 new_item.SetResultOfSplit(true);
7421 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7423 new_item.SetQuantity(stack_max);
7424 new_item.PlaceOnSurface();
7425 }
7426 }
7427 }
7428 }
7429
7431 {
7433 return;
7434
7435 float split_quantity_new;
7439 InventoryLocation loc = new InventoryLocation;
7440
7441 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7442 {
7444 split_quantity_new = stack_max;
7445 else
7447
7448 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7449 if (new_item)
7450 {
7451 new_item.SetResultOfSplit(true);
7452 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7454 new_item.SetQuantity(split_quantity_new);
7455 }
7456 }
7457 else if (destination_entity && slot_id == -1)
7458 {
7459 if (quantity > stack_max)
7460 split_quantity_new = stack_max;
7461 else
7462 split_quantity_new = quantity;
7463
7465 {
7468 }
7469
7470 if (new_item)
7471 {
7472 new_item.SetResultOfSplit(true);
7473 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7475 new_item.SetQuantity(split_quantity_new);
7476 }
7477 }
7478 else
7479 {
7480 if (stack_max != 0)
7481 {
7483 {
7485 }
7486
7488
7489 if (new_item)
7490 {
7491 new_item.SetResultOfSplit(true);
7492 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7494 new_item.SetQuantity(stack_max);
7495 new_item.PlaceOnSurface();
7496 }
7497 }
7498 }
7499 }
7500
7502 {
7504 return;
7505
7507 {
7508 if (ScriptInputUserData.CanStoreInputUserData())
7509 {
7510 ScriptInputUserData ctx = new ScriptInputUserData;
7515 dst.WriteToContext(ctx);
7517 }
7518 }
7519 else if (!
GetGame().IsMultiplayer())
7520 {
7522 }
7523 }
7524
7526 {
7528 return;
7529
7531 {
7532 if (ScriptInputUserData.CanStoreInputUserData())
7533 {
7534 ScriptInputUserData ctx = new ScriptInputUserData;
7539 ctx.
Write(destination_entity);
7545 }
7546 }
7547 else if (!
GetGame().IsMultiplayer())
7548 {
7550 }
7551 }
7552
7554 {
7556 }
7557
7559 {
7561 return this;
7562
7564 float split_quantity_new;
7566 if (dst.IsValid())
7567 {
7568 int slot_id = dst.GetSlot();
7570
7571 if (quantity > stack_max)
7572 split_quantity_new = stack_max;
7573 else
7574 split_quantity_new = quantity;
7575
7577
7578 if (new_item)
7579 {
7580 new_item.SetResultOfSplit(true);
7581 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7584 }
7585
7586 return new_item;
7587 }
7588
7589 return null;
7590 }
7591
7593 {
7595 return;
7596
7598 float split_quantity_new;
7600 if (destination_entity)
7601 {
7603 if (quantity > stackable)
7604 split_quantity_new = stackable;
7605 else
7606 split_quantity_new = quantity;
7607
7608 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7609 if (new_item)
7610 {
7611 new_item.SetResultOfSplit(true);
7612 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7614 new_item.SetQuantity(split_quantity_new);
7615 }
7616 }
7617 }
7618
7620 {
7622 return;
7623
7625 {
7626 if (ScriptInputUserData.CanStoreInputUserData())
7627 {
7628 ScriptInputUserData ctx = new ScriptInputUserData;
7633 ItemBase destination_entity =
this;
7634 ctx.
Write(destination_entity);
7638 }
7639 }
7640 else if (!
GetGame().IsMultiplayer())
7641 {
7643 }
7644 }
7645
7647 {
7649 return;
7650
7652 float split_quantity_new;
7654 if (player)
7655 {
7657 if (quantity > stackable)
7658 split_quantity_new = stackable;
7659 else
7660 split_quantity_new = quantity;
7661
7662 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7663 new_item =
ItemBase.Cast(in_hands);
7664 if (new_item)
7665 {
7666 new_item.SetResultOfSplit(true);
7667 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7669 new_item.SetQuantity(split_quantity_new);
7670 }
7671 }
7672 }
7673
7675 {
7677 return;
7678
7680 float split_quantity_new = Math.Floor(quantity * 0.5);
7681
7683
7684 if (new_item)
7685 {
7686 if (new_item.GetQuantityMax() < split_quantity_new)
7687 {
7688 split_quantity_new = new_item.GetQuantityMax();
7689 }
7690
7691 new_item.SetResultOfSplit(true);
7692 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7693
7695 {
7698 }
7699 else
7700 {
7703 }
7704 }
7705 }
7706
7708 {
7710 return;
7711
7713 float split_quantity_new = Math.Floor(quantity / 2);
7714
7715 InventoryLocation invloc = new InventoryLocation;
7717
7719 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7720
7721 if (new_item)
7722 {
7723 if (new_item.GetQuantityMax() < split_quantity_new)
7724 {
7725 split_quantity_new = new_item.GetQuantityMax();
7726 }
7728 {
7731 }
7732 else
7733 {
7736 }
7737 }
7738 }
7739
7742 {
7743 SetWeightDirty();
7745
7746 if (parent)
7747 parent.OnAttachmentQuantityChangedEx(this, delta);
7748
7750 {
7752 {
7754 }
7756 {
7757 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7759 }
7760 }
7761
7762 }
7763
7766 {
7767
7768 }
7769
7772 {
7774 }
7775
7777 {
7778 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7779
7781 {
7782 if (newLevel == GameConstants.STATE_RUINED)
7783 {
7785 EntityAI parent = GetHierarchyParent();
7786 if (parent && parent.IsFireplace())
7787 {
7788 CargoBase cargo = GetInventory().GetCargo();
7789 if (cargo)
7790 {
7792 {
7794 }
7795 }
7796 }
7797 }
7798
7800 {
7801
7803 return;
7804 }
7805
7806 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7807 {
7809 }
7810 }
7811 }
7812
7813
7815 {
7816 super.OnRightClick();
7817
7819 {
7821 {
7822 if (ScriptInputUserData.CanStoreInputUserData())
7823 {
7824 vector m4[4];
7826
7827 EntityAI root = GetHierarchyRoot();
7828
7829 InventoryLocation dst = new InventoryLocation;
7831 {
7832 if (root)
7833 {
7834 root.GetTransform(m4);
7836 }
7837 else
7838 GetInventory().GetCurrentInventoryLocation(dst);
7839 }
7840 else
7841 {
7843
7844
7845 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7846 {
7847 if (root)
7848 {
7849 root.GetTransform(m4);
7851 }
7852 else
7853 GetInventory().GetCurrentInventoryLocation(dst);
7854 }
7855 else
7856 {
7857 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7858 }
7859 }
7860
7861 ScriptInputUserData ctx = new ScriptInputUserData;
7869 }
7870 }
7871 else if (!
GetGame().IsMultiplayer())
7872 {
7874 }
7875 }
7876 }
7877
7878 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7879 {
7880
7881 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7882 return false;
7883
7884 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7885 return false;
7886
7887
7889 return false;
7890
7891
7892 Magazine mag = Magazine.Cast(this);
7893 if (mag)
7894 {
7895 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7896 return false;
7897
7898 if (stack_max_limit)
7899 {
7900 Magazine other_mag = Magazine.Cast(other_item);
7901 if (other_item)
7902 {
7903 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7904 return false;
7905 }
7906
7907 }
7908 }
7909 else
7910 {
7911
7913 return false;
7914
7916 return false;
7917 }
7918
7919 PlayerBase player = null;
7920 if (CastTo(player, GetHierarchyRootPlayer()))
7921 {
7922 if (player.GetInventory().HasAttachment(this))
7923 return false;
7924
7925 if (player.IsItemsToDelete())
7926 return false;
7927 }
7928
7929 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7930 return false;
7931
7932 int slotID;
7934 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7935 return false;
7936
7937 return true;
7938 }
7939
7941 {
7943 }
7944
7946 {
7947 return m_IsResultOfSplit;
7948 }
7949
7951 {
7952 m_IsResultOfSplit = value;
7953 }
7954
7956 {
7958 }
7959
7961 {
7962 float other_item_quantity = other_item.GetQuantity();
7963 float this_free_space;
7964
7966
7968
7969 if (other_item_quantity > this_free_space)
7970 {
7971 return this_free_space;
7972 }
7973 else
7974 {
7975 return other_item_quantity;
7976 }
7977 }
7978
7980 {
7982 }
7983
7985 {
7987 return;
7988
7989 if (!IsMagazine() && other_item)
7990 {
7992 if (quantity_used != 0)
7993 {
7994 float hp1 = GetHealth01("","");
7995 float hp2 = other_item.GetHealth01("","");
7996 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7997 hpResult = hpResult / (
GetQuantity() + quantity_used);
7998
7999 hpResult *= GetMaxHealth();
8000 Math.Round(hpResult);
8001 SetHealth("", "Health", hpResult);
8002
8004 other_item.AddQuantity(-quantity_used);
8005 }
8006 }
8008 }
8009
8011 {
8012 #ifdef SERVER
8013 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8014 GetHierarchyParent().IncreaseLifetimeUp();
8015 #endif
8016 };
8017
8019 {
8020 PlayerBase p = PlayerBase.Cast(player);
8021
8022 array<int> recipesIds = p.m_Recipes;
8023 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8024 if (moduleRecipesManager)
8025 {
8026 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8027 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8028 }
8029
8030 for (int i = 0;i < recipesIds.Count(); i++)
8031 {
8032 int key = recipesIds.Get(i);
8033 string recipeName = moduleRecipesManager.GetRecipeName(key);
8035 }
8036 }
8037
8038
8039 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8040 {
8041 super.GetDebugActions(outputList);
8042
8043
8048
8049
8053
8057
8058
8061
8062
8064 {
8067 }
8068
8070
8073
8077 }
8078
8079
8080
8081
8083 {
8084 super.OnAction(action_id, player, ctx);
8085 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8086 {
8087 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8088 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8089 PlayerBase p = PlayerBase.Cast(player);
8090 if (
EActions.RECIPES_RANGE_START < 1000)
8091 {
8092 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8093 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8094 }
8095 }
8096 #ifndef SERVER
8097 else if (action_id ==
EActions.WATCH_PLAYER)
8098 {
8099 PluginDeveloper.SetDeveloperItemClientEx(player);
8100 }
8101 #endif
8103 {
8104 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8105 {
8106 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8107 OnDebugButtonPressServer(id + 1);
8108 }
8109
8110 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8111 {
8112 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8114 }
8115
8116 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8117 {
8118 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8120 }
8121
8122 else if (action_id ==
EActions.ADD_QUANTITY)
8123 {
8124 if (IsMagazine())
8125 {
8126 Magazine mag = Magazine.Cast(this);
8127 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8128 }
8129 else
8130 {
8132 }
8133
8134 if (m_EM)
8135 {
8136 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8137 }
8138
8139 }
8140
8141 else if (action_id ==
EActions.REMOVE_QUANTITY)
8142 {
8143 if (IsMagazine())
8144 {
8145 Magazine mag2 = Magazine.Cast(this);
8146 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8147 }
8148 else
8149 {
8151 }
8152 if (m_EM)
8153 {
8154 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8155 }
8156
8157 }
8158
8159 else if (action_id ==
EActions.SET_QUANTITY_0)
8160 {
8162
8163 if (m_EM)
8164 {
8165 m_EM.SetEnergy(0);
8166 }
8167 }
8168
8169 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8170 {
8172
8173 if (m_EM)
8174 {
8175 m_EM.SetEnergy(m_EM.GetEnergyMax());
8176 }
8177 }
8178
8179 else if (action_id ==
EActions.ADD_HEALTH)
8180 {
8181 AddHealth("","",GetMaxHealth("","Health")/5);
8182 }
8183 else if (action_id ==
EActions.REMOVE_HEALTH)
8184 {
8185 AddHealth("","",-GetMaxHealth("","Health")/5);
8186 }
8187 else if (action_id ==
EActions.DESTROY_HEALTH)
8188 {
8189 SetHealth01("","",0);
8190 }
8191 else if (action_id ==
EActions.WATCH_ITEM)
8192 {
8194 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8195 #ifdef DEVELOPER
8196 SetDebugDeveloper_item(this);
8197 #endif
8198 }
8199
8200 else if (action_id ==
EActions.ADD_TEMPERATURE)
8201 {
8202 AddTemperature(20);
8203
8204 }
8205
8206 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8207 {
8208 AddTemperature(-20);
8209
8210 }
8211
8212 else if (action_id ==
EActions.FLIP_FROZEN)
8213 {
8214 SetFrozen(!GetIsFrozen());
8215
8216 }
8217
8218 else if (action_id ==
EActions.ADD_WETNESS)
8219 {
8221
8222 }
8223
8224 else if (action_id ==
EActions.REMOVE_WETNESS)
8225 {
8227
8228 }
8229
8230 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8231 {
8234
8235
8236 }
8237
8238 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8239 {
8242 }
8243
8244 else if (action_id ==
EActions.MAKE_SPECIAL)
8245 {
8246 auto debugParams = DebugSpawnParams.WithPlayer(player);
8247 OnDebugSpawnEx(debugParams);
8248 }
8249
8250 else if (action_id ==
EActions.DELETE)
8251 {
8252 Delete();
8253 }
8254
8255 }
8256
8257
8258 return false;
8259 }
8260
8261
8262
8263
8267
8270
8271
8272
8274 {
8275 return false;
8276 }
8277
8278
8280 {
8281 return true;
8282 }
8283
8284
8286 {
8287 return true;
8288 }
8289
8290
8291
8293 {
8294 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8296 }
8297
8300 {
8301 return null;
8302 }
8303
8305 {
8306 return false;
8307 }
8308
8310 {
8311 return false;
8312 }
8313
8317
8318
8320 {
8321 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8322 return module_repairing.CanRepair(this, item_repair_kit);
8323 }
8324
8325
8326 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8327 {
8328 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8329 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8330 }
8331
8332
8334 {
8335
8336
8337
8338
8339
8340
8341
8342
8343 return 1;
8344 }
8345
8346
8347
8349 {
8351 }
8352
8353
8354
8356 {
8358 }
8359
8360
8369 {
8370 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8371
8372 if (player)
8373 {
8374 player.MessageStatus(text);
8375 }
8376 }
8377
8378
8387 {
8388 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8389
8390 if (player)
8391 {
8392 player.MessageAction(text);
8393 }
8394 }
8395
8396
8405 {
8406 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8407
8408 if (player)
8409 {
8410 player.MessageFriendly(text);
8411 }
8412 }
8413
8414
8423 {
8424 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8425
8426 if (player)
8427 {
8428 player.MessageImportant(text);
8429 }
8430 }
8431
8433 {
8434 return true;
8435 }
8436
8437
8438 override bool KindOf(
string tag)
8439 {
8440 bool found = false;
8441 string item_name = this.
GetType();
8444
8445 int array_size = item_tag_array.Count();
8446 for (int i = 0; i < array_size; i++)
8447 {
8448 if (item_tag_array.Get(i) == tag)
8449 {
8450 found = true;
8451 break;
8452 }
8453 }
8454 return found;
8455 }
8456
8457
8459 {
8460
8461 super.OnRPC(sender, rpc_type,ctx);
8462
8463
8464 switch (rpc_type)
8465 {
8466 #ifndef SERVER
8467 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8468 Param2<bool, string> p = new Param2<bool, string>(false, "");
8469
8471 return;
8472
8473 bool play = p.param1;
8474 string soundSet = p.param2;
8475
8476 if (play)
8477 {
8479 {
8481 {
8483 }
8484 }
8485 else
8486 {
8488 }
8489 }
8490 else
8491 {
8493 }
8494
8495 break;
8496 #endif
8497
8498 }
8499
8501 {
8503 }
8504 }
8505
8506
8507
8508
8510 {
8511 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8512 return plugin.GetID(
name);
8513 }
8514
8516 {
8517 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8518 return plugin.GetName(id);
8519 }
8520
8523 {
8524
8525
8526 int varFlags;
8527 if (!ctx.
Read(varFlags))
8528 return;
8529
8530 if (varFlags & ItemVariableFlags.FLOAT)
8531 {
8533 }
8534 }
8535
8537 {
8538
8539 super.SerializeNumericalVars(floats_out);
8540
8541
8542
8544 {
8546 }
8547
8549 {
8551 }
8552
8554 {
8556 }
8557
8559 {
8564 }
8565
8567 {
8569 }
8570 }
8571
8573 {
8574
8575 super.DeSerializeNumericalVars(floats);
8576
8577
8578 int index = 0;
8579 int mask = Math.Round(floats.Get(index));
8580
8581 index++;
8582
8584 {
8586 {
8588 }
8589 else
8590 {
8591 float quantity = floats.Get(index);
8593 }
8594 index++;
8595 }
8596
8598 {
8599 float wet = floats.Get(index);
8601 index++;
8602 }
8603
8605 {
8606 int liquidtype = Math.Round(floats.Get(index));
8608 index++;
8609 }
8610
8612 {
8614 index++;
8616 index++;
8618 index++;
8620 index++;
8621 }
8622
8624 {
8625 int cleanness = Math.Round(floats.Get(index));
8627 index++;
8628 }
8629 }
8630
8632 {
8633 super.WriteVarsToCTX(ctx);
8634
8635
8637 {
8639 }
8640
8642 {
8644 }
8645
8647 {
8649 }
8650
8652 {
8653 int r,g,b,a;
8659 }
8660
8662 {
8664 }
8665 }
8666
8668 {
8669 if (!super.ReadVarsFromCTX(ctx,version))
8670 return false;
8671
8672 int intValue;
8673 float value;
8674
8675 if (version < 140)
8676 {
8677 if (!ctx.
Read(intValue))
8678 return false;
8679
8680 m_VariablesMask = intValue;
8681 }
8682
8684 {
8685 if (!ctx.
Read(value))
8686 return false;
8687
8689 {
8691 }
8692 else
8693 {
8695 }
8696 }
8697
8698 if (version < 140)
8699 {
8701 {
8702 if (!ctx.
Read(value))
8703 return false;
8704 SetTemperatureDirect(value);
8705 }
8706 }
8707
8709 {
8710 if (!ctx.
Read(value))
8711 return false;
8713 }
8714
8716 {
8717 if (!ctx.
Read(intValue))
8718 return false;
8720 }
8721
8723 {
8724 int r,g,b,a;
8726 return false;
8728 return false;
8730 return false;
8732 return false;
8733
8735 }
8736
8738 {
8739 if (!ctx.
Read(intValue))
8740 return false;
8742 }
8743
8744 if (version >= 138 && version < 140)
8745 {
8747 {
8748 if (!ctx.
Read(intValue))
8749 return false;
8750 SetFrozen(intValue);
8751 }
8752 }
8753
8754 return true;
8755 }
8756
8757
8759 {
8762 {
8764 }
8765
8766 if (!super.OnStoreLoad(ctx, version))
8767 {
8769 return false;
8770 }
8771
8772 if (version >= 114)
8773 {
8774 bool hasQuickBarIndexSaved;
8775
8776 if (!ctx.
Read(hasQuickBarIndexSaved))
8777 {
8779 return false;
8780 }
8781
8782 if (hasQuickBarIndexSaved)
8783 {
8784 int itmQBIndex;
8785
8786
8787 if (!ctx.
Read(itmQBIndex))
8788 {
8790 return false;
8791 }
8792
8793 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8794 if (itmQBIndex != -1 && parentPlayer)
8795 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8796 }
8797 }
8798 else
8799 {
8800
8801 PlayerBase player;
8802 int itemQBIndex;
8803 if (version ==
int.
MAX)
8804 {
8805 if (!ctx.
Read(itemQBIndex))
8806 {
8808 return false;
8809 }
8810 }
8811 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8812 {
8813
8814 if (!ctx.
Read(itemQBIndex))
8815 {
8817 return false;
8818 }
8819 if (itemQBIndex != -1 && player)
8820 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8821 }
8822 }
8823
8824 if (version < 140)
8825 {
8826
8827 if (!LoadVariables(ctx, version))
8828 {
8830 return false;
8831 }
8832 }
8833
8834
8836 {
8838 return false;
8839 }
8840 if (version >= 132)
8841 {
8843 if (raib)
8844 {
8846 {
8848 return false;
8849 }
8850 }
8851 }
8852
8854 return true;
8855 }
8856
8857
8858
8860 {
8861 super.OnStoreSave(ctx);
8862
8863 PlayerBase player;
8864 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8865 {
8867
8868 int itemQBIndex = -1;
8869 itemQBIndex = player.FindQuickBarEntityIndex(this);
8870 ctx.
Write(itemQBIndex);
8871 }
8872 else
8873 {
8875 }
8876
8878
8880 if (raib)
8881 {
8883 }
8884 }
8885
8886
8888 {
8889 super.AfterStoreLoad();
8890
8892 {
8894 }
8895
8897 {
8900 }
8901 }
8902
8904 {
8905 super.EEOnAfterLoad();
8906
8908 {
8910 }
8911
8914 }
8915
8917 {
8918 return false;
8919 }
8920
8921
8922
8924 {
8926 {
8927 #ifdef PLATFORM_CONSOLE
8928
8930 {
8932 if (menu)
8933 {
8935 }
8936 }
8937 #endif
8938 }
8939
8941 {
8944 }
8945
8947 {
8948 SetWeightDirty();
8950 }
8952 {
8955 }
8956
8958 {
8961 }
8963 {
8966 }
8967
8968 super.OnVariablesSynchronized();
8969 }
8970
8971
8972
8974 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8975 {
8976 if (!IsServerCheck(allow_client))
8977 return false;
8978
8980 return false;
8981
8984
8985 if (value <= (min + 0.001))
8986 value = min;
8987
8988 if (value == min)
8989 {
8990 if (destroy_config)
8991 {
8992 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8993 if (dstr)
8994 {
8996 this.Delete();
8997 return true;
8998 }
8999 }
9000 else if (destroy_forced)
9001 {
9003 this.Delete();
9004 return true;
9005 }
9006
9008 }
9009
9012
9014 {
9016
9017 if (delta)
9019 }
9020
9022
9023 return false;
9024 }
9025
9026
9028 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9029 {
9031 }
9032
9034 {
9037 }
9038
9040 {
9043 }
9044
9047 {
9048 float value_clamped = Math.Clamp(value, 0, 1);
9050 SetQuantity(result, destroy_config, destroy_forced);
9051 }
9052
9053
9056 {
9058 }
9059
9061 {
9063 }
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9075 {
9076 int slot = -1;
9077 if (GetInventory())
9078 {
9079 InventoryLocation il = new InventoryLocation;
9080 GetInventory().GetCurrentInventoryLocation(il);
9082 }
9083
9085 }
9086
9088 {
9089 float quantity_max = 0;
9090
9092 {
9093 if (attSlotID != -1)
9094 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9095
9096 if (quantity_max <= 0)
9098 }
9099
9100 if (quantity_max <= 0)
9102
9103 return quantity_max;
9104 }
9105
9107 {
9109 }
9110
9112 {
9114 }
9115
9116
9118 {
9120 }
9121
9123 {
9125 }
9126
9128 {
9130 }
9131
9132
9134 {
9135
9136 float weightEx = GetWeightEx();
9137 float special = GetInventoryAndCargoWeight();
9138 return weightEx - special;
9139 }
9140
9141
9143 {
9145 }
9146
9148 {
9150 {
9151 #ifdef DEVELOPER
9152 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9153 {
9154 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9156 }
9157 #endif
9158
9160 }
9161 else if (HasEnergyManager())
9162 {
9163 #ifdef DEVELOPER
9164 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9165 {
9166 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9167 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9168 }
9169 #endif
9170 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9171 }
9172 else
9173 {
9174 #ifdef DEVELOPER
9175 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9176 {
9177 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9178 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9179 }
9180 #endif
9181 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9182 }
9183 }
9184
9187 {
9188 int item_count = 0;
9190
9191 if (GetInventory().GetCargo() != NULL)
9192 {
9193 item_count = GetInventory().GetCargo().GetItemCount();
9194 }
9195
9196 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9197 {
9198 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9199 if (item)
9200 item_count += item.GetNumberOfItems();
9201 }
9202 return item_count;
9203 }
9204
9207 {
9208 float weight = 0;
9209 float wetness = 1;
9210 if (include_wetness)
9213 {
9214 weight = wetness * m_ConfigWeight;
9215 }
9217 {
9218 weight = 1;
9219 }
9220 return weight;
9221 }
9222
9223
9224
9226 {
9227 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9228 {
9229 GameInventory inv = GetInventory();
9230 array<EntityAI> items = new array<EntityAI>;
9232 for (int i = 0; i < items.Count(); i++)
9233 {
9235 if (item)
9236 {
9238 }
9239 }
9240 }
9241 }
9242
9243
9244
9245
9247 {
9248 float energy = 0;
9249 if (HasEnergyManager())
9250 {
9251 energy = GetCompEM().GetEnergy();
9252 }
9253 return energy;
9254 }
9255
9256
9258 {
9259 super.OnEnergyConsumed();
9260
9262 }
9263
9265 {
9266 super.OnEnergyAdded();
9267
9269 }
9270
9271
9273 {
9274 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9275 {
9277 {
9278 float energy_0to1 = GetCompEM().GetEnergy0To1();
9280 }
9281 }
9282 }
9283
9284
9286 {
9287 return ConfigGetFloat("heatIsolation");
9288 }
9289
9291 {
9293 }
9294
9296 {
9297 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9298 if (
GetGame().ConfigIsExisting(paramPath))
9300
9301 return 0.0;
9302 }
9303
9305 {
9306 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9307 if (
GetGame().ConfigIsExisting(paramPath))
9309
9310 return 0.0;
9311 }
9312
9313 override void SetWet(
float value,
bool allow_client =
false)
9314 {
9315 if (!IsServerCheck(allow_client))
9316 return;
9317
9320
9322
9323 m_VarWet = Math.Clamp(value, min, max);
9324
9326 {
9329 }
9330 }
9331
9332 override void AddWet(
float value)
9333 {
9335 }
9336
9338 {
9340 }
9341
9343 {
9345 }
9346
9348 {
9350 }
9351
9353 {
9355 }
9356
9358 {
9360 }
9361
9363 {
9366 if (newLevel != oldLevel)
9367 {
9369 }
9370 }
9371
9373 {
9374 SetWeightDirty();
9375 }
9376
9378 {
9379 return GetWetLevelInternal(
m_VarWet);
9380 }
9381
9382
9383
9385 {
9387 }
9388
9390 {
9392 }
9393
9395 {
9397 }
9398
9400 {
9402 }
9403
9404
9405
9407 {
9408 if (ConfigIsExisting("itemModelLength"))
9409 {
9410 return ConfigGetFloat("itemModelLength");
9411 }
9412 return 0;
9413 }
9414
9416 {
9417 if (ConfigIsExisting("itemAttachOffset"))
9418 {
9419 return ConfigGetFloat("itemAttachOffset");
9420 }
9421 return 0;
9422 }
9423
9424 override void SetCleanness(
int value,
bool allow_client =
false)
9425 {
9426 if (!IsServerCheck(allow_client))
9427 return;
9428
9430
9432
9435 }
9436
9438 {
9440 }
9441
9443 {
9444 return true;
9445 }
9446
9447
9448
9449
9451 {
9453 }
9454
9456 {
9458 }
9459
9460
9461
9462
9463 override void SetColor(
int r,
int g,
int b,
int a)
9464 {
9470 }
9472 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9473 {
9478 }
9479
9481 {
9483 }
9484
9487 {
9488 int r,g,b,a;
9490 r = r/255;
9491 g = g/255;
9492 b = b/255;
9493 a = a/255;
9494 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9495 }
9496
9497
9498
9499 override void SetLiquidType(
int value,
bool allow_client =
false)
9500 {
9501 if (!IsServerCheck(allow_client))
9502 return;
9503
9508 }
9509
9511 {
9512 return ConfigGetInt("varLiquidTypeInit");
9513 }
9514
9516 {
9518 }
9519
9521 {
9523 SetFrozen(false);
9524 }
9525
9528 {
9529 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9530 }
9531
9532
9535 {
9536 PlayerBase nplayer;
9537 if (PlayerBase.CastTo(nplayer, player))
9538 {
9540
9541 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9542 }
9543 }
9544
9545
9548 {
9549 PlayerBase nplayer;
9550 if (PlayerBase.CastTo(nplayer,player))
9551 {
9552
9553 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9554
9555 }
9556
9557
9558 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9559
9560
9561 if (HasEnergyManager())
9562 {
9563 GetCompEM().UpdatePlugState();
9564 }
9565 }
9566
9567
9569 {
9570 super.OnPlacementStarted(player);
9571
9573 }
9574
9575 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9576 {
9578 {
9579 m_AdminLog.OnPlacementComplete(player,
this);
9580 }
9581
9582 super.OnPlacementComplete(player, position, orientation);
9583 }
9584
9585
9586
9587
9588
9590 {
9592 {
9593 return true;
9594 }
9595 else
9596 {
9597 return false;
9598 }
9599 }
9600
9601
9603 {
9605 {
9607 }
9608 }
9609
9610
9612 {
9614 }
9615
9617 {
9619 }
9620
9621 override void InsertAgent(
int agent,
float count = 1)
9622 {
9623 if (count < 1)
9624 return;
9625
9627 }
9628
9631 {
9633 }
9634
9635
9637 {
9639 }
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9683 {
9685 return false;
9686 return true;
9687 }
9688
9690 {
9691
9693 }
9694
9695
9698 {
9699 super.CheckForRoofLimited(timeTresholdMS);
9700
9702 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9703 {
9704 m_PreviousRoofTestTime = time;
9705 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9706 }
9707 }
9708
9709
9711 {
9713 {
9714 return 0;
9715 }
9716
9717 if (GetInventory().GetAttachmentSlotsCount() != 0)
9718 {
9719 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9720 if (filter)
9721 return filter.GetProtectionLevel(type, false, system);
9722 else
9723 return 0;
9724 }
9725
9726 string subclassPath, entryName;
9727
9728 switch (type)
9729 {
9731 entryName = "biological";
9732 break;
9734 entryName = "chemical";
9735 break;
9736 default:
9737 entryName = "biological";
9738 break;
9739 }
9740
9741 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9742
9744 }
9745
9746
9747
9750 {
9751 if (!IsMagazine())
9753
9755 }
9756
9757
9758
9759
9760
9765 {
9766 return true;
9767 }
9768
9770 {
9772 }
9773
9774
9775
9776
9777
9779 {
9780 if (parent)
9781 {
9782 if (parent.IsInherited(DayZInfected))
9783 return true;
9784
9785 if (!parent.IsRuined())
9786 return true;
9787 }
9788
9789 return true;
9790 }
9791
9793 {
9794 if (!super.CanPutAsAttachment(parent))
9795 {
9796 return false;
9797 }
9798
9799 if (!IsRuined() && !parent.IsRuined())
9800 {
9801 return true;
9802 }
9803
9804 return false;
9805 }
9806
9808 {
9809
9810
9811
9812
9813 return super.CanReceiveItemIntoCargo(item);
9814 }
9815
9817 {
9818
9819
9820
9821
9822 GameInventory attachmentInv = attachment.GetInventory();
9824 {
9825 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9826 return false;
9827 }
9828
9829 InventoryLocation loc = new InventoryLocation();
9830 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9831 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9832 return false;
9833
9834 return super.CanReceiveAttachment(attachment, slotId);
9835 }
9836
9838 {
9839 if (!super.CanReleaseAttachment(attachment))
9840 return false;
9841
9842 return GetInventory().AreChildrenAccessible();
9843 }
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9866 {
9867 int id = muzzle_owner.GetMuzzleID();
9868 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9869
9870 if (WPOF_array)
9871 {
9872 for (int i = 0; i < WPOF_array.Count(); i++)
9873 {
9874 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9875
9876 if (WPOF)
9877 {
9878 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9879 }
9880 }
9881 }
9882 }
9883
9884
9886 {
9887 int id = muzzle_owner.GetMuzzleID();
9889
9890 if (WPOBE_array)
9891 {
9892 for (int i = 0; i < WPOBE_array.Count(); i++)
9893 {
9894 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9895
9896 if (WPOBE)
9897 {
9898 WPOBE.OnActivate(weapon, 0, 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.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9919 }
9920 }
9921 }
9922 }
9923
9924
9926 {
9927 int id = muzzle_owner.GetMuzzleID();
9928 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9929
9930 if (WPOOH_array)
9931 {
9932 for (int i = 0; i < WPOOH_array.Count(); i++)
9933 {
9934 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9935
9936 if (WPOOH)
9937 {
9938 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9939 }
9940 }
9941 }
9942 }
9943
9944
9946 {
9947 int id = muzzle_owner.GetMuzzleID();
9948 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9949
9950 if (WPOOH_array)
9951 {
9952 for (int i = 0; i < WPOOH_array.Count(); i++)
9953 {
9954 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9955
9956 if (WPOOH)
9957 {
9958 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9959 }
9960 }
9961 }
9962 }
9963
9964
9965
9967 {
9969 {
9970 return true;
9971 }
9972
9973 return false;
9974 }
9975
9977 {
9979 {
9980 return true;
9981 }
9982
9983 return false;
9984 }
9985
9987 {
9989 {
9990 return true;
9991 }
9992
9993 return false;
9994 }
9995
9997 {
9998 return false;
9999 }
10000
10003 {
10004 return UATimeSpent.DEFAULT_DEPLOY;
10005 }
10006
10007
10008
10009
10011 {
10013 SetSynchDirty();
10014 }
10015
10017 {
10019 }
10020
10021
10023 {
10024 return false;
10025 }
10026
10029 {
10030 string att_type = "None";
10031
10032 if (ConfigIsExisting("soundAttType"))
10033 {
10034 att_type = ConfigGetString("soundAttType");
10035 }
10036
10038 }
10039
10041 {
10043 }
10044
10045
10046
10047
10048
10052
10054 {
10057
10059 }
10060
10061
10063 {
10065 return;
10066
10068
10071
10074
10075 SoundParameters params = new SoundParameters();
10079 }
10080
10081
10083 {
10085 return;
10086
10088 SetSynchDirty();
10089
10092 }
10093
10094
10096 {
10098 return;
10099
10101 SetSynchDirty();
10102
10105 }
10106
10108 {
10110 }
10111
10113 {
10115 }
10116
10119 {
10120 if (!
GetGame().IsDedicatedServer())
10121 {
10122 if (ConfigIsExisting("attachSoundSet"))
10123 {
10124 string cfg_path = "";
10125 string soundset = "";
10126 string type_name =
GetType();
10127
10130 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10131 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10132
10133 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10134 {
10135 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10136 {
10137 if (cfg_slot_array[i] == slot_type)
10138 {
10139 soundset = cfg_soundset_array[i];
10140 break;
10141 }
10142 }
10143 }
10144
10145 if (soundset != "")
10146 {
10147 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10149 }
10150 }
10151 }
10152 }
10153
10155 {
10156
10157 }
10158
10159 void OnApply(PlayerBase player);
10160
10162 {
10163 return 1.0;
10164 };
10165
10167 {
10169 }
10170
10172 {
10174 }
10175
10177
10179 {
10180 SetDynamicPhysicsLifeTime(0.01);
10182 }
10183
10185 {
10186 array<string> zone_names = new array<string>;
10187 GetDamageZones(zone_names);
10188 for (int i = 0; i < zone_names.Count(); i++)
10189 {
10190 SetHealthMax(zone_names.Get(i),"Health");
10191 }
10192 SetHealthMax("","Health");
10193 }
10194
10197 {
10198 float global_health = GetHealth01("","Health");
10199 array<string> zones = new array<string>;
10200 GetDamageZones(zones);
10201
10202 for (int i = 0; i < zones.Count(); i++)
10203 {
10204 SetHealth01(zones.Get(i),"Health",global_health);
10205 }
10206 }
10207
10210 {
10211 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10212 }
10213
10215 {
10216 if (!hasRootAsPlayer)
10217 {
10218 if (refParentIB)
10219 {
10220
10221 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10222 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10223
10224 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10225 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10226
10229 }
10230 else
10231 {
10232
10235 }
10236 }
10237 }
10238
10240 {
10242 {
10243 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10244 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10245 {
10246 float heatPermCoef = 1.0;
10248 while (ent)
10249 {
10250 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10251 ent = ent.GetHierarchyParent();
10252 }
10253
10254 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10255 }
10256 }
10257 }
10258
10260 {
10261
10262 EntityAI parent = GetHierarchyParent();
10263 if (!parent)
10264 {
10265 hasParent = false;
10266 hasRootAsPlayer = false;
10267 }
10268 else
10269 {
10270 hasParent = true;
10271 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10272 refParentIB =
ItemBase.Cast(parent);
10273 }
10274 }
10275
10276 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10277 {
10278
10279 }
10280
10282 {
10283
10284 return false;
10285 }
10286
10288 {
10289
10290
10291 return false;
10292 }
10293
10295 {
10296
10297 return false;
10298 }
10299
10302 {
10303 return !GetIsFrozen() &&
IsOpen();
10304 }
10305
10307 {
10308 bool hasParent = false, hasRootAsPlayer = false;
10310
10311 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10312 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10313
10314 if (wwtu || foodDecay)
10315 {
10319
10320 if (processWetness || processTemperature || processDecay)
10321 {
10323
10324 if (processWetness)
10325 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10326
10327 if (processTemperature)
10329
10330 if (processDecay)
10331 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10332 }
10333 }
10334 }
10335
10338 {
10340 }
10341
10343 {
10346
10347 return super.GetTemperatureFreezeThreshold();
10348 }
10349
10351 {
10354
10355 return super.GetTemperatureThawThreshold();
10356 }
10357
10359 {
10362
10363 return super.GetItemOverheatThreshold();
10364 }
10365
10367 {
10369 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10370
10371 return super.GetTemperatureFreezeTime();
10372 }
10373
10375 {
10377 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10378
10379 return super.GetTemperatureThawTime();
10380 }
10381
10386
10388 {
10389 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10390 }
10391
10393 {
10394 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10395 }
10396
10399 {
10401 }
10402
10404 {
10406 }
10407
10409 {
10411 }
10412
10415 {
10416 return null;
10417 }
10418
10421 {
10422 return false;
10423 }
10424
10426 {
10428 {
10431 if (!trg)
10432 {
10434 explosive = this;
10435 }
10436
10437 explosive.PairRemote(trg);
10439
10440 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10441 trg.SetPersistentPairID(persistentID);
10442 explosive.SetPersistentPairID(persistentID);
10443
10444 return true;
10445 }
10446 return false;
10447 }
10448
10451 {
10452 float ret = 1.0;
10455 ret *= GetHealth01();
10456
10457 return ret;
10458 }
10459
10460 #ifdef DEVELOPER
10461 override void SetDebugItem()
10462 {
10463 super.SetDebugItem();
10464 _itemBase = this;
10465 }
10466
10468 {
10469 string text = super.GetDebugText();
10470
10472 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10473
10474 return text;
10475 }
10476 #endif
10477
10479 {
10480 return true;
10481 }
10482
10484
10486
10488 {
10491 }
10492
10493
10501
10517}
10518
10520{
10522 if (entity)
10523 {
10524 bool is_item = entity.IsInherited(
ItemBase);
10525 if (is_item && full_quantity)
10526 {
10529 }
10530 }
10531 else
10532 {
10534 return NULL;
10535 }
10536 return entity;
10537}
10538
10540{
10541 if (item)
10542 {
10543 if (health > 0)
10544 item.SetHealth("", "", health);
10545
10546 if (item.CanHaveTemperature())
10547 {
10549 if (item.CanFreeze())
10550 item.SetFrozen(false);
10551 }
10552
10553 if (item.HasEnergyManager())
10554 {
10555 if (quantity >= 0)
10556 {
10557 item.GetCompEM().SetEnergy0To1(quantity);
10558 }
10559 else
10560 {
10562 }
10563 }
10564 else if (item.IsMagazine())
10565 {
10566 Magazine mag = Magazine.Cast(item);
10567 if (quantity >= 0)
10568 {
10569 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10570 }
10571 else
10572 {
10574 }
10575
10576 }
10577 else
10578 {
10579 if (quantity >= 0)
10580 {
10581 item.SetQuantityNormalized(quantity, false);
10582 }
10583 else
10584 {
10586 }
10587
10588 }
10589 }
10590}
10591
10592#ifdef DEVELOPER
10594#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.