5824{
5826 {
5827 return true;
5828 }
5829};
5830
5831
5832
5834{
5838
5840
5843
5844
5845
5846
5847
5856
5862
5867
5872
5893 protected bool m_IsResultOfSplit
5894
5896
5901
5902
5903
5905
5909
5910
5911
5913
5916
5917
5918
5924
5925
5933
5936
5937
5939
5940
5942
5943
5948
5949
5954
5955
5957
5958
5960 {
5965
5966 if (!
GetGame().IsDedicatedServer())
5967 {
5969 {
5971
5973 {
5975 }
5976 }
5977
5980 }
5981
5982 m_OldLocation = null;
5983
5985 {
5987 }
5988
5989 if (ConfigIsExisting("headSelectionsToHide"))
5990 {
5993 }
5994
5996 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5997 {
5999 }
6000
6002
6003 m_IsResultOfSplit = false;
6004
6006 }
6007
6009 {
6010 super.InitItemVariables();
6011
6017 m_Count = ConfigGetInt(
"count");
6018
6021
6026
6029
6034
6046
6050
6051
6054 if (ConfigIsExisting("canBeSplit"))
6055 {
6058 }
6059
6061 if (ConfigIsExisting("itemBehaviour"))
6063
6064
6067 RegisterNetSyncVariableInt("m_VarLiquidType");
6068 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6069
6070 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6071 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6072 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6073
6074 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6075 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6076 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6077 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6078
6079 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6080 RegisterNetSyncVariableBool("m_IsTakeable");
6081 RegisterNetSyncVariableBool("m_IsHologram");
6082
6085 {
6088 }
6089
6091
6093 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6095
6096 }
6097
6099 {
6101 }
6102
6104 {
6107 {
6112 }
6113 }
6114
6115 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6116 {
6118 {
6121 }
6122
6124 }
6125
6127 {
6133 }
6134
6136
6138 {
6140
6141 if (!action)
6142 {
6143 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6144 return;
6145 }
6146
6148 if (!ai)
6149 {
6151 return;
6152 }
6153
6155 if (!action_array)
6156 {
6157 action_array = new array<ActionBase_Basic>;
6159 }
6160 if (LogManager.IsActionLogEnable())
6161 {
6162 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6163 }
6164
6165 if (action_array.Find(action) != -1)
6166 {
6167 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6168 }
6169 else
6170 {
6171 action_array.Insert(action);
6172 }
6173 }
6174
6176 {
6178 ActionBase action = player.GetActionManager().GetAction(actionName);
6181
6182 if (action_array)
6183 {
6184 action_array.RemoveItem(action);
6185 }
6186 }
6187
6188
6189
6191 {
6192 ActionOverrideData overrideData = new ActionOverrideData();
6196
6198 if (!actionMap)
6199 {
6202 }
6203
6204 actionMap.Insert(this.
Type(), overrideData);
6205
6206 }
6207
6209
6211
6212
6214 {
6217
6220
6221 string config_to_search = "CfgVehicles";
6222 string muzzle_owner_config;
6223
6225 {
6226 if (IsInherited(Weapon))
6227 config_to_search = "CfgWeapons";
6228
6229 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6230
6231 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6232
6234
6235 if (config_OnFire_subclass_count > 0)
6236 {
6237 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6238
6239 for (int i = 0; i < config_OnFire_subclass_count; i++)
6240 {
6241 string particle_class = "";
6243 string config_OnFire_entry = config_OnFire_class + particle_class;
6244 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6245 WPOF_array.Insert(WPOF);
6246 }
6247
6248
6250 }
6251 }
6252
6254 {
6255 config_to_search = "CfgWeapons";
6256 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6257
6258 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6259
6261
6262 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6263 {
6264 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6265
6266 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6267 {
6268 string particle_class2 = "";
6270 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6271 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6272 WPOBE_array.Insert(WPOBE);
6273 }
6274
6275
6277 }
6278 }
6279 }
6280
6281
6283 {
6286
6288 {
6289 string config_to_search = "CfgVehicles";
6290
6291 if (IsInherited(Weapon))
6292 config_to_search = "CfgWeapons";
6293
6294 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6295 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6296
6297 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6298 {
6299
6301
6303 {
6305 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6307 return;
6308 }
6309
6312
6313
6314
6316 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6317
6318 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6319 {
6320 string particle_class = "";
6322 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6324
6325 if (entry_type == CT_CLASS)
6326 {
6327 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6328 WPOOH_array.Insert(WPOF);
6329 }
6330 }
6331
6332
6334 }
6335 }
6336 }
6337
6339 {
6341 }
6342
6344 {
6346 {
6348
6351
6354
6355 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6356 }
6357 }
6358
6360 {
6362 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6363
6365 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6366
6368 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6369
6371 {
6373 }
6374 }
6375
6377 {
6379 }
6380
6382 {
6385 else
6387
6389 {
6392 }
6393 else
6394 {
6397
6400 }
6401
6403 }
6404
6406 {
6408 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6409 }
6410
6412 {
6414 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6416 }
6417
6419 {
6421 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6422 }
6423
6425 {
6428
6429 OverheatingParticle OP = new OverheatingParticle();
6434
6436 }
6437
6439 {
6442
6443 return -1;
6444 }
6445
6447 {
6449 {
6452
6453 for (int i = count; i > 0; --i)
6454 {
6455 int id = i - 1;
6458
6461
6462 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6463 {
6464 if (p)
6465 {
6468 }
6469 }
6470 }
6471 }
6472 }
6473
6475 {
6477 {
6479 {
6480 int id = i - 1;
6482
6483 if (OP)
6484 {
6486
6487 if (p)
6488 {
6490 }
6491
6492 delete OP;
6493 }
6494 }
6495
6498 }
6499 }
6500
6503 {
6504 return 0.0;
6505 }
6506
6507
6509 {
6510 return 250;
6511 }
6512
6514 {
6515 return 0;
6516 }
6517
6520 {
6522 return true;
6523
6524 return false;
6525 }
6526
6529 {
6532
6534 {
6536 }
6537 else
6538 {
6539
6541 }
6542
6544 }
6545
6552 {
6553 return -1;
6554 }
6555
6556
6557
6558
6560 {
6562 {
6564 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6565
6566 if (r_index >= 0)
6567 {
6568 InventoryLocation r_il = new InventoryLocation;
6569 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6570
6571 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6574 {
6575 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6576 }
6578 {
6579 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6580 }
6581
6582 }
6583
6584 player.GetHumanInventory().ClearUserReservedLocation(this);
6585 }
6586
6589 }
6590
6591
6592
6593
6595 {
6596 return ItemBase.m_DebugActionsMask;
6597 }
6598
6600 {
6601 return ItemBase.m_DebugActionsMask & mask;
6602 }
6603
6605 {
6606 ItemBase.m_DebugActionsMask = mask;
6607 }
6608
6610 {
6611 ItemBase.m_DebugActionsMask |= mask;
6612 }
6613
6615 {
6616 ItemBase.m_DebugActionsMask &= ~mask;
6617 }
6618
6620 {
6622 {
6624 }
6625 else
6626 {
6628 }
6629 }
6630
6631
6633 {
6634 if (GetEconomyProfile())
6635 {
6636 float q_max = GetEconomyProfile().GetQuantityMax();
6637 if (q_max > 0)
6638 {
6639 float q_min = GetEconomyProfile().GetQuantityMin();
6640 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6641
6643 {
6644 ComponentEnergyManager comp = GetCompEM();
6646 {
6648 }
6649 }
6651 {
6653
6654 }
6655
6656 }
6657 }
6658 }
6659
6662 {
6663 EntityAI parent = GetHierarchyParent();
6664
6665 if (parent)
6666 {
6667 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6668 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6669 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6670 }
6671 }
6672
6675 {
6676 EntityAI parent = GetHierarchyParent();
6677
6678 if (parent)
6679 {
6680 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6681 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6682 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6683 }
6684 }
6685
6687 {
6688
6689
6690
6691
6693
6695 {
6696 if (ScriptInputUserData.CanStoreInputUserData())
6697 {
6698 ScriptInputUserData ctx = new ScriptInputUserData;
6704 ctx.
Write(use_stack_max);
6707
6709 {
6710 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6711 }
6712 }
6713 }
6714 else if (!
GetGame().IsMultiplayer())
6715 {
6717 }
6718 }
6719
6721 {
6723 }
6724
6726 {
6728 }
6729
6731 {
6733 }
6734
6736 {
6737
6738 return false;
6739 }
6740
6742 {
6743 return false;
6744 }
6745
6749 {
6750 return false;
6751 }
6752
6754 {
6755 return "";
6756 }
6757
6759
6761 {
6762 return false;
6763 }
6764
6766 {
6767 return true;
6768 }
6769
6770
6771
6773 {
6774 return true;
6775 }
6776
6778 {
6779 return true;
6780 }
6781
6783 {
6784 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6786 }
6787
6789 {
6791 }
6792
6794 {
6796 if (!is_being_placed)
6798 SetSynchDirty();
6799 }
6800
6801
6803
6805 {
6807 }
6808
6810 {
6812 }
6813
6815 {
6816 return 1;
6817 }
6818
6820 {
6821 return false;
6822 }
6823
6825 {
6827 SetSynchDirty();
6828 }
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6865 {
6866 super.OnMovedInsideCargo(container);
6867
6868 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6869 }
6870
6871 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6872 {
6873 super.EEItemLocationChanged(oldLoc,newLoc);
6874
6875 PlayerBase new_player = null;
6876 PlayerBase old_player = null;
6877
6878 if (newLoc.GetParent())
6879 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6880
6881 if (oldLoc.GetParent())
6882 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6883
6885 {
6886 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6887
6888 if (r_index >= 0)
6889 {
6890 InventoryLocation r_il = new InventoryLocation;
6891 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6892
6893 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6896 {
6897 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6898 }
6900 {
6901 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6902 }
6903
6904 }
6905 }
6906
6908 {
6909 if (new_player)
6910 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6911
6912 if (new_player == old_player)
6913 {
6914
6915 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6916 {
6918 {
6919 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6920 {
6921 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6922 }
6923 }
6924 else
6925 {
6926 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6927 }
6928 }
6929
6930 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6931 {
6932 int type = oldLoc.GetType();
6934 {
6935 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6936 }
6938 {
6939 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6940 }
6941 }
6942 if (!m_OldLocation)
6943 {
6944 m_OldLocation = new InventoryLocation;
6945 }
6946 m_OldLocation.Copy(oldLoc);
6947 }
6948 else
6949 {
6950 if (m_OldLocation)
6951 {
6952 m_OldLocation.Reset();
6953 }
6954 }
6955
6957 }
6958 else
6959 {
6960 if (new_player)
6961 {
6962 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6963 if (res_index >= 0)
6964 {
6965 InventoryLocation il = new InventoryLocation;
6966 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6968 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6971 {
6972 il.
GetParent().GetOnReleaseLock().Invoke(it);
6973 }
6975 {
6977 }
6978
6979 }
6980 }
6982 {
6983
6985 }
6986
6987 if (m_OldLocation)
6988 {
6989 m_OldLocation.Reset();
6990 }
6991 }
6992 }
6993
6994 override void EOnContact(IEntity other, Contact extra)
6995 {
6997 {
6998 int liquidType = -1;
7000 if (impactSpeed > 0.0)
7001 {
7003 #ifndef SERVER
7005 #else
7007 SetSynchDirty();
7008 #endif
7010 }
7011 }
7012
7013 #ifdef SERVER
7014 if (GetCompEM() && GetCompEM().IsPlugged())
7015 {
7016 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7017 GetCompEM().UnplugThis();
7018 }
7019 #endif
7020 }
7021
7023
7025 {
7027 }
7028
7030 {
7031
7032 }
7033
7035 {
7036 super.OnItemLocationChanged(old_owner, new_owner);
7037
7038 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7039 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7040
7041 if (!relatedPlayer && playerNew)
7042 relatedPlayer = playerNew;
7043
7044 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7045 {
7047 if (actionMgr)
7048 {
7049 ActionBase currentAction = actionMgr.GetRunningAction();
7050 if (currentAction)
7052 }
7053 }
7054
7055 Man ownerPlayerOld = null;
7056 Man ownerPlayerNew = null;
7057
7058 if (old_owner)
7059 {
7060 if (old_owner.
IsMan())
7061 {
7062 ownerPlayerOld = Man.Cast(old_owner);
7063 }
7064 else
7065 {
7066 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7067 }
7068 }
7069 else
7070 {
7072 {
7074
7075 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7076 {
7077 GetCompEM().UnplugThis();
7078 }
7079 }
7080 }
7081
7082 if (new_owner)
7083 {
7084 if (new_owner.
IsMan())
7085 {
7086 ownerPlayerNew = Man.Cast(new_owner);
7087 }
7088 else
7089 {
7090 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7091 }
7092 }
7093
7094 if (ownerPlayerOld != ownerPlayerNew)
7095 {
7096 if (ownerPlayerOld)
7097 {
7098 array<EntityAI> subItemsExit = new array<EntityAI>;
7100 for (int i = 0; i < subItemsExit.Count(); i++)
7101 {
7104 }
7105 }
7106
7107 if (ownerPlayerNew)
7108 {
7109 array<EntityAI> subItemsEnter = new array<EntityAI>;
7111 for (int j = 0; j < subItemsEnter.Count(); j++)
7112 {
7115 }
7116 }
7117 }
7118 else if (ownerPlayerNew != null)
7119 {
7120 PlayerBase nplayer;
7121 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7122 {
7123 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7125 for (int k = 0; k < subItemsUpdate.Count(); k++)
7126 {
7128 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7129 }
7130 }
7131 }
7132
7133 if (old_owner)
7134 old_owner.OnChildItemRemoved(this);
7135 if (new_owner)
7136 new_owner.OnChildItemReceived(this);
7137 }
7138
7139
7141 {
7142 super.EEDelete(parent);
7143 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7144 if (player)
7145 {
7147
7148 if (player.IsAlive())
7149 {
7150 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7151 if (r_index >= 0)
7152 {
7153 InventoryLocation r_il = new InventoryLocation;
7154 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7155
7156 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7159 {
7160 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7161 }
7163 {
7164 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7165 }
7166
7167 }
7168
7169 player.RemoveQuickBarEntityShortcut(this);
7170 }
7171 }
7172 }
7173
7175 {
7176 super.EEKilled(killer);
7177
7180 {
7181 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7182 {
7183 if (IsMagazine())
7184 {
7185 if (Magazine.Cast(this).GetAmmoCount() > 0)
7186 {
7188 }
7189 }
7190 else
7191 {
7193 }
7194 }
7195 }
7196 }
7197
7199 {
7200 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7201
7202 super.OnWasAttached(parent, slot_id);
7203
7206
7208 }
7209
7211 {
7212 super.OnWasDetached(parent, slot_id);
7213
7216 }
7217
7219 {
7220 int idx;
7223
7224 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7225 if (inventory_slots.Count() < 1)
7226 {
7227 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7228 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7229 }
7230 else
7231 {
7232 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7233 }
7234
7235 idx = inventory_slots.Find(slot);
7236 if (idx < 0)
7237 return "";
7238
7239 return attach_types.Get(idx);
7240 }
7241
7243 {
7244 int idx = -1;
7245 string slot;
7246
7249
7250 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7251 if (inventory_slots.Count() < 1)
7252 {
7253 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7254 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7255 }
7256 else
7257 {
7258 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7259 if (detach_types.Count() < 1)
7260 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7261 }
7262
7263 for (int i = 0; i < inventory_slots.Count(); i++)
7264 {
7265 slot = inventory_slots.Get(i);
7266 }
7267
7268 if (slot != "")
7269 {
7270 if (detach_types.Count() == 1)
7271 idx = 0;
7272 else
7273 idx = inventory_slots.Find(slot);
7274 }
7275 if (idx < 0)
7276 return "";
7277
7278 return detach_types.Get(idx);
7279 }
7280
7282 {
7283
7285
7286
7287 float min_time = 1;
7288 float max_time = 3;
7289 float delay = Math.RandomFloat(min_time, max_time);
7290
7291 explode_timer.Run(delay, this, "DoAmmoExplosion");
7292 }
7293
7295 {
7296 Magazine magazine = Magazine.Cast(this);
7297 int pop_sounds_count = 6;
7298 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7299
7300
7301 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7302 string sound_name = pop_sounds[ sound_idx ];
7304
7305
7306 magazine.ServerAddAmmoCount(-1);
7307
7308
7309 float min_temp_to_explode = 100;
7310
7311 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7312 {
7314 }
7315 }
7316
7317
7318 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7319 {
7320 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7321
7322 const int CHANCE_DAMAGE_CARGO = 4;
7323 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7324 const int CHANCE_DAMAGE_NOTHING = 2;
7325
7327 {
7328 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7329 int chances;
7330 int rnd;
7331
7332 if (GetInventory().GetCargo())
7333 {
7334 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7335 rnd = Math.RandomInt(0,chances);
7336
7337 if (rnd < CHANCE_DAMAGE_CARGO)
7338 {
7340 }
7341 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7342 {
7344 }
7345 }
7346 else
7347 {
7348 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7349 rnd = Math.RandomInt(0,chances);
7350
7351 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7352 {
7354 }
7355 }
7356 }
7357 }
7358
7360 {
7361 if (GetInventory().GetCargo())
7362 {
7363 int item_count = GetInventory().GetCargo().GetItemCount();
7364 if (item_count > 0)
7365 {
7366 int random_pick = Math.RandomInt(0, item_count);
7368 if (!item.IsExplosive())
7369 {
7370 item.AddHealth("","",damage);
7371 return true;
7372 }
7373 }
7374 }
7375 return false;
7376 }
7377
7379 {
7380 int attachment_count = GetInventory().AttachmentCount();
7381 if (attachment_count > 0)
7382 {
7383 int random_pick = Math.RandomInt(0, attachment_count);
7384 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7385 if (!attachment.IsExplosive())
7386 {
7387 attachment.AddHealth("","",damage);
7388 return true;
7389 }
7390 }
7391 return false;
7392 }
7393
7395 {
7397 }
7398
7400 {
7402 return GetInventory().CanRemoveEntity();
7403
7404 return false;
7405 }
7406
7408 {
7410 return;
7411
7413 {
7414 if (ScriptInputUserData.CanStoreInputUserData())
7415 {
7416 ScriptInputUserData ctx = new ScriptInputUserData;
7421 ctx.
Write(destination_entity);
7425 }
7426 }
7427 else if (!
GetGame().IsMultiplayer())
7428 {
7430 }
7431 }
7432
7434 {
7436 return;
7437
7438 float split_quantity_new;
7442 InventoryLocation loc = new InventoryLocation;
7443
7444 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7445 {
7447 split_quantity_new = stack_max;
7448 else
7450
7451 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7452 if (new_item)
7453 {
7454 new_item.SetResultOfSplit(true);
7455 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7457 new_item.SetQuantity(split_quantity_new);
7458 }
7459 }
7460 else if (destination_entity && slot_id == -1)
7461 {
7462 if (quantity > stack_max)
7463 split_quantity_new = stack_max;
7464 else
7465 split_quantity_new = quantity;
7466
7468 {
7471 }
7472
7473 if (new_item)
7474 {
7475 new_item.SetResultOfSplit(true);
7476 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7478 new_item.SetQuantity(split_quantity_new);
7479 }
7480 }
7481 else
7482 {
7483 if (stack_max != 0)
7484 {
7486 {
7488 }
7489
7490 if (split_quantity_new == 0)
7491 {
7492 if (!
GetGame().IsMultiplayer())
7493 player.PhysicalPredictiveDropItem(this);
7494 else
7495 player.ServerDropEntity(this);
7496 return;
7497 }
7498
7500
7501 if (new_item)
7502 {
7503 new_item.SetResultOfSplit(true);
7504 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7506 new_item.SetQuantity(stack_max);
7507 new_item.PlaceOnSurface();
7508 }
7509 }
7510 }
7511 }
7512
7514 {
7516 return;
7517
7518 float split_quantity_new;
7522 InventoryLocation loc = new InventoryLocation;
7523
7524 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7525 {
7527 split_quantity_new = stack_max;
7528 else
7530
7531 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7532 if (new_item)
7533 {
7534 new_item.SetResultOfSplit(true);
7535 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7537 new_item.SetQuantity(split_quantity_new);
7538 }
7539 }
7540 else if (destination_entity && slot_id == -1)
7541 {
7542 if (quantity > stack_max)
7543 split_quantity_new = stack_max;
7544 else
7545 split_quantity_new = quantity;
7546
7548 {
7551 }
7552
7553 if (new_item)
7554 {
7555 new_item.SetResultOfSplit(true);
7556 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7558 new_item.SetQuantity(split_quantity_new);
7559 }
7560 }
7561 else
7562 {
7563 if (stack_max != 0)
7564 {
7566 {
7568 }
7569
7571
7572 if (new_item)
7573 {
7574 new_item.SetResultOfSplit(true);
7575 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7577 new_item.SetQuantity(stack_max);
7578 new_item.PlaceOnSurface();
7579 }
7580 }
7581 }
7582 }
7583
7585 {
7587 return;
7588
7590 {
7591 if (ScriptInputUserData.CanStoreInputUserData())
7592 {
7593 ScriptInputUserData ctx = new ScriptInputUserData;
7598 dst.WriteToContext(ctx);
7600 }
7601 }
7602 else if (!
GetGame().IsMultiplayer())
7603 {
7605 }
7606 }
7607
7609 {
7611 return;
7612
7614 {
7615 if (ScriptInputUserData.CanStoreInputUserData())
7616 {
7617 ScriptInputUserData ctx = new ScriptInputUserData;
7622 ctx.
Write(destination_entity);
7628 }
7629 }
7630 else if (!
GetGame().IsMultiplayer())
7631 {
7633 }
7634 }
7635
7637 {
7639 }
7640
7642 {
7644 return this;
7645
7647 float split_quantity_new;
7649 if (dst.IsValid())
7650 {
7651 int slot_id = dst.GetSlot();
7653
7654 if (quantity > stack_max)
7655 split_quantity_new = stack_max;
7656 else
7657 split_quantity_new = quantity;
7658
7660
7661 if (new_item)
7662 {
7663 new_item.SetResultOfSplit(true);
7664 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7667 }
7668
7669 return new_item;
7670 }
7671
7672 return null;
7673 }
7674
7676 {
7678 return;
7679
7681 float split_quantity_new;
7683 if (destination_entity)
7684 {
7686 if (quantity > stackable)
7687 split_quantity_new = stackable;
7688 else
7689 split_quantity_new = quantity;
7690
7691 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7692 if (new_item)
7693 {
7694 new_item.SetResultOfSplit(true);
7695 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7697 new_item.SetQuantity(split_quantity_new);
7698 }
7699 }
7700 }
7701
7703 {
7705 return;
7706
7708 {
7709 if (ScriptInputUserData.CanStoreInputUserData())
7710 {
7711 ScriptInputUserData ctx = new ScriptInputUserData;
7716 ItemBase destination_entity =
this;
7717 ctx.
Write(destination_entity);
7721 }
7722 }
7723 else if (!
GetGame().IsMultiplayer())
7724 {
7726 }
7727 }
7728
7730 {
7732 return;
7733
7735 float split_quantity_new;
7737 if (player)
7738 {
7740 if (quantity > stackable)
7741 split_quantity_new = stackable;
7742 else
7743 split_quantity_new = quantity;
7744
7745 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7746 new_item =
ItemBase.Cast(in_hands);
7747 if (new_item)
7748 {
7749 new_item.SetResultOfSplit(true);
7750 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7752 new_item.SetQuantity(split_quantity_new);
7753 }
7754 }
7755 }
7756
7758 {
7760 return;
7761
7763 float split_quantity_new = Math.Floor(quantity * 0.5);
7764
7766
7767 if (new_item)
7768 {
7769 if (new_item.GetQuantityMax() < split_quantity_new)
7770 {
7771 split_quantity_new = new_item.GetQuantityMax();
7772 }
7773
7774 new_item.SetResultOfSplit(true);
7775 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7776
7778 {
7781 }
7782 else
7783 {
7786 }
7787 }
7788 }
7789
7791 {
7793 return;
7794
7796 float split_quantity_new = Math.Floor(quantity / 2);
7797
7798 InventoryLocation invloc = new InventoryLocation;
7800
7802 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7803
7804 if (new_item)
7805 {
7806 if (new_item.GetQuantityMax() < split_quantity_new)
7807 {
7808 split_quantity_new = new_item.GetQuantityMax();
7809 }
7811 {
7814 }
7815 else
7816 {
7819 }
7820 }
7821 }
7822
7825 {
7826 SetWeightDirty();
7828
7829 if (parent)
7830 parent.OnAttachmentQuantityChangedEx(this, delta);
7831
7833 {
7835 {
7837 }
7839 {
7840 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7842 }
7843 }
7844
7845 }
7846
7849 {
7850
7851 }
7852
7855 {
7857 }
7858
7860 {
7861 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7862
7864 {
7865 if (newLevel == GameConstants.STATE_RUINED)
7866 {
7868 EntityAI parent = GetHierarchyParent();
7869 if (parent && parent.IsFireplace())
7870 {
7871 CargoBase cargo = GetInventory().GetCargo();
7872 if (cargo)
7873 {
7875 {
7877 }
7878 }
7879 }
7880 }
7881
7883 {
7884
7886 return;
7887 }
7888
7889 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7890 {
7892 }
7893 }
7894 }
7895
7896
7898 {
7899 super.OnRightClick();
7900
7902 {
7904 {
7905 if (ScriptInputUserData.CanStoreInputUserData())
7906 {
7907 vector m4[4];
7909
7910 EntityAI root = GetHierarchyRoot();
7911
7912 InventoryLocation dst = new InventoryLocation;
7914 {
7915 if (root)
7916 {
7917 root.GetTransform(m4);
7919 }
7920 else
7921 GetInventory().GetCurrentInventoryLocation(dst);
7922 }
7923 else
7924 {
7926
7927
7928 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7929 {
7930 if (root)
7931 {
7932 root.GetTransform(m4);
7934 }
7935 else
7936 GetInventory().GetCurrentInventoryLocation(dst);
7937 }
7938 else
7939 {
7940 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7941 }
7942 }
7943
7944 ScriptInputUserData ctx = new ScriptInputUserData;
7952 }
7953 }
7954 else if (!
GetGame().IsMultiplayer())
7955 {
7957 }
7958 }
7959 }
7960
7961 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7962 {
7963
7964 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7965 return false;
7966
7967 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7968 return false;
7969
7970
7972 return false;
7973
7974
7975 Magazine mag = Magazine.Cast(this);
7976 if (mag)
7977 {
7978 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7979 return false;
7980
7981 if (stack_max_limit)
7982 {
7983 Magazine other_mag = Magazine.Cast(other_item);
7984 if (other_item)
7985 {
7986 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7987 return false;
7988 }
7989
7990 }
7991 }
7992 else
7993 {
7994
7996 return false;
7997
7999 return false;
8000 }
8001
8002 PlayerBase player = null;
8003 if (CastTo(player, GetHierarchyRootPlayer()))
8004 {
8005 if (player.GetInventory().HasAttachment(this))
8006 return false;
8007
8008 if (player.IsItemsToDelete())
8009 return false;
8010 }
8011
8012 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8013 return false;
8014
8015 int slotID;
8017 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8018 return false;
8019
8020 return true;
8021 }
8022
8024 {
8026 }
8027
8029 {
8030 return m_IsResultOfSplit;
8031 }
8032
8034 {
8035 m_IsResultOfSplit = value;
8036 }
8037
8039 {
8041 }
8042
8044 {
8045 float other_item_quantity = other_item.GetQuantity();
8046 float this_free_space;
8047
8049
8051
8052 if (other_item_quantity > this_free_space)
8053 {
8054 return this_free_space;
8055 }
8056 else
8057 {
8058 return other_item_quantity;
8059 }
8060 }
8061
8063 {
8065 }
8066
8068 {
8070 return;
8071
8072 if (!IsMagazine() && other_item)
8073 {
8075 if (quantity_used != 0)
8076 {
8077 float hp1 = GetHealth01("","");
8078 float hp2 = other_item.GetHealth01("","");
8079 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8080 hpResult = hpResult / (
GetQuantity() + quantity_used);
8081
8082 hpResult *= GetMaxHealth();
8083 Math.Round(hpResult);
8084 SetHealth("", "Health", hpResult);
8085
8087 other_item.AddQuantity(-quantity_used);
8088 }
8089 }
8091 }
8092
8094 {
8095 #ifdef SERVER
8096 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8097 GetHierarchyParent().IncreaseLifetimeUp();
8098 #endif
8099 };
8100
8102 {
8103 PlayerBase p = PlayerBase.Cast(player);
8104
8105 array<int> recipesIds = p.m_Recipes;
8106 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8107 if (moduleRecipesManager)
8108 {
8109 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8110 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8111 }
8112
8113 for (int i = 0;i < recipesIds.Count(); i++)
8114 {
8115 int key = recipesIds.Get(i);
8116 string recipeName = moduleRecipesManager.GetRecipeName(key);
8118 }
8119 }
8120
8121
8122 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8123 {
8124 super.GetDebugActions(outputList);
8125
8126
8131
8132
8136
8140
8141
8144
8145
8147 {
8150 }
8151
8153
8156
8160 }
8161
8162
8163
8164
8166 {
8167 super.OnAction(action_id, player, ctx);
8168 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8169 {
8170 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8171 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8172 PlayerBase p = PlayerBase.Cast(player);
8173 if (
EActions.RECIPES_RANGE_START < 1000)
8174 {
8175 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8176 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8177 }
8178 }
8179 #ifndef SERVER
8180 else if (action_id ==
EActions.WATCH_PLAYER)
8181 {
8182 PluginDeveloper.SetDeveloperItemClientEx(player);
8183 }
8184 #endif
8186 {
8187 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8188 {
8189 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8190 OnDebugButtonPressServer(id + 1);
8191 }
8192
8193 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8194 {
8195 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8197 }
8198
8199 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8200 {
8201 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8203 }
8204
8205 else if (action_id ==
EActions.ADD_QUANTITY)
8206 {
8207 if (IsMagazine())
8208 {
8209 Magazine mag = Magazine.Cast(this);
8210 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8211 }
8212 else
8213 {
8215 }
8216
8217 if (m_EM)
8218 {
8219 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8220 }
8221
8222 }
8223
8224 else if (action_id ==
EActions.REMOVE_QUANTITY)
8225 {
8226 if (IsMagazine())
8227 {
8228 Magazine mag2 = Magazine.Cast(this);
8229 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8230 }
8231 else
8232 {
8234 }
8235 if (m_EM)
8236 {
8237 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8238 }
8239
8240 }
8241
8242 else if (action_id ==
EActions.SET_QUANTITY_0)
8243 {
8245
8246 if (m_EM)
8247 {
8248 m_EM.SetEnergy(0);
8249 }
8250 }
8251
8252 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8253 {
8255
8256 if (m_EM)
8257 {
8258 m_EM.SetEnergy(m_EM.GetEnergyMax());
8259 }
8260 }
8261
8262 else if (action_id ==
EActions.ADD_HEALTH)
8263 {
8264 AddHealth("","",GetMaxHealth("","Health")/5);
8265 }
8266 else if (action_id ==
EActions.REMOVE_HEALTH)
8267 {
8268 AddHealth("","",-GetMaxHealth("","Health")/5);
8269 }
8270 else if (action_id ==
EActions.DESTROY_HEALTH)
8271 {
8272 SetHealth01("","",0);
8273 }
8274 else if (action_id ==
EActions.WATCH_ITEM)
8275 {
8277 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8278 #ifdef DEVELOPER
8279 SetDebugDeveloper_item(this);
8280 #endif
8281 }
8282
8283 else if (action_id ==
EActions.ADD_TEMPERATURE)
8284 {
8285 AddTemperature(20);
8286
8287 }
8288
8289 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8290 {
8291 AddTemperature(-20);
8292
8293 }
8294
8295 else if (action_id ==
EActions.FLIP_FROZEN)
8296 {
8297 SetFrozen(!GetIsFrozen());
8298
8299 }
8300
8301 else if (action_id ==
EActions.ADD_WETNESS)
8302 {
8304
8305 }
8306
8307 else if (action_id ==
EActions.REMOVE_WETNESS)
8308 {
8310
8311 }
8312
8313 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8314 {
8317
8318
8319 }
8320
8321 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8322 {
8325 }
8326
8327 else if (action_id ==
EActions.MAKE_SPECIAL)
8328 {
8329 auto debugParams = DebugSpawnParams.WithPlayer(player);
8330 OnDebugSpawnEx(debugParams);
8331 }
8332
8333 else if (action_id ==
EActions.DELETE)
8334 {
8335 Delete();
8336 }
8337
8338 }
8339
8340
8341 return false;
8342 }
8343
8344
8345
8346
8350
8353
8354
8355
8357 {
8358 return false;
8359 }
8360
8361
8363 {
8364 return true;
8365 }
8366
8367
8369 {
8370 return true;
8371 }
8372
8373
8374
8376 {
8377 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8379 }
8380
8383 {
8384 return null;
8385 }
8386
8388 {
8389 return false;
8390 }
8391
8393 {
8394 return false;
8395 }
8396
8400
8401
8403 {
8404 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8405 return module_repairing.CanRepair(this, item_repair_kit);
8406 }
8407
8408
8409 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8410 {
8411 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8412 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8413 }
8414
8415
8417 {
8418
8419
8420
8421
8422
8423
8424
8425
8426 return 1;
8427 }
8428
8429
8430
8432 {
8434 }
8435
8436
8437
8439 {
8441 }
8442
8443
8452 {
8453 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8454
8455 if (player)
8456 {
8457 player.MessageStatus(text);
8458 }
8459 }
8460
8461
8470 {
8471 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8472
8473 if (player)
8474 {
8475 player.MessageAction(text);
8476 }
8477 }
8478
8479
8488 {
8489 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8490
8491 if (player)
8492 {
8493 player.MessageFriendly(text);
8494 }
8495 }
8496
8497
8506 {
8507 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8508
8509 if (player)
8510 {
8511 player.MessageImportant(text);
8512 }
8513 }
8514
8516 {
8517 return true;
8518 }
8519
8520
8521 override bool KindOf(
string tag)
8522 {
8523 bool found = false;
8524 string item_name = this.
GetType();
8527
8528 int array_size = item_tag_array.Count();
8529 for (int i = 0; i < array_size; i++)
8530 {
8531 if (item_tag_array.Get(i) == tag)
8532 {
8533 found = true;
8534 break;
8535 }
8536 }
8537 return found;
8538 }
8539
8540
8542 {
8543
8544 super.OnRPC(sender, rpc_type,ctx);
8545
8546
8547 switch (rpc_type)
8548 {
8549 #ifndef SERVER
8550 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8551 Param2<bool, string> p = new Param2<bool, string>(false, "");
8552
8554 return;
8555
8556 bool play = p.param1;
8557 string soundSet = p.param2;
8558
8559 if (play)
8560 {
8562 {
8564 {
8566 }
8567 }
8568 else
8569 {
8571 }
8572 }
8573 else
8574 {
8576 }
8577
8578 break;
8579 #endif
8580
8581 }
8582
8584 {
8586 }
8587 }
8588
8589
8590
8591
8593 {
8594 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8595 return plugin.GetID(
name);
8596 }
8597
8599 {
8600 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8601 return plugin.GetName(id);
8602 }
8603
8606 {
8607
8608
8609 int varFlags;
8610 if (!ctx.
Read(varFlags))
8611 return;
8612
8613 if (varFlags & ItemVariableFlags.FLOAT)
8614 {
8616 }
8617 }
8618
8620 {
8621
8622 super.SerializeNumericalVars(floats_out);
8623
8624
8625
8627 {
8629 }
8630
8632 {
8634 }
8635
8637 {
8639 }
8640
8642 {
8647 }
8648
8650 {
8652 }
8653 }
8654
8656 {
8657
8658 super.DeSerializeNumericalVars(floats);
8659
8660
8661 int index = 0;
8662 int mask = Math.Round(floats.Get(index));
8663
8664 index++;
8665
8667 {
8669 {
8671 }
8672 else
8673 {
8674 float quantity = floats.Get(index);
8676 }
8677 index++;
8678 }
8679
8681 {
8682 float wet = floats.Get(index);
8684 index++;
8685 }
8686
8688 {
8689 int liquidtype = Math.Round(floats.Get(index));
8691 index++;
8692 }
8693
8695 {
8697 index++;
8699 index++;
8701 index++;
8703 index++;
8704 }
8705
8707 {
8708 int cleanness = Math.Round(floats.Get(index));
8710 index++;
8711 }
8712 }
8713
8715 {
8716 super.WriteVarsToCTX(ctx);
8717
8718
8720 {
8722 }
8723
8725 {
8727 }
8728
8730 {
8732 }
8733
8735 {
8736 int r,g,b,a;
8742 }
8743
8745 {
8747 }
8748 }
8749
8751 {
8752 if (!super.ReadVarsFromCTX(ctx,version))
8753 return false;
8754
8755 int intValue;
8756 float value;
8757
8758 if (version < 140)
8759 {
8760 if (!ctx.
Read(intValue))
8761 return false;
8762
8763 m_VariablesMask = intValue;
8764 }
8765
8767 {
8768 if (!ctx.
Read(value))
8769 return false;
8770
8772 {
8774 }
8775 else
8776 {
8778 }
8779 }
8780
8781 if (version < 140)
8782 {
8784 {
8785 if (!ctx.
Read(value))
8786 return false;
8787 SetTemperatureDirect(value);
8788 }
8789 }
8790
8792 {
8793 if (!ctx.
Read(value))
8794 return false;
8796 }
8797
8799 {
8800 if (!ctx.
Read(intValue))
8801 return false;
8803 }
8804
8806 {
8807 int r,g,b,a;
8809 return false;
8811 return false;
8813 return false;
8815 return false;
8816
8818 }
8819
8821 {
8822 if (!ctx.
Read(intValue))
8823 return false;
8825 }
8826
8827 if (version >= 138 && version < 140)
8828 {
8830 {
8831 if (!ctx.
Read(intValue))
8832 return false;
8833 SetFrozen(intValue);
8834 }
8835 }
8836
8837 return true;
8838 }
8839
8840
8842 {
8845 {
8847 }
8848
8849 if (!super.OnStoreLoad(ctx, version))
8850 {
8852 return false;
8853 }
8854
8855 if (version >= 114)
8856 {
8857 bool hasQuickBarIndexSaved;
8858
8859 if (!ctx.
Read(hasQuickBarIndexSaved))
8860 {
8862 return false;
8863 }
8864
8865 if (hasQuickBarIndexSaved)
8866 {
8867 int itmQBIndex;
8868
8869
8870 if (!ctx.
Read(itmQBIndex))
8871 {
8873 return false;
8874 }
8875
8876 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8877 if (itmQBIndex != -1 && parentPlayer)
8878 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8879 }
8880 }
8881 else
8882 {
8883
8884 PlayerBase player;
8885 int itemQBIndex;
8886 if (version ==
int.
MAX)
8887 {
8888 if (!ctx.
Read(itemQBIndex))
8889 {
8891 return false;
8892 }
8893 }
8894 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8895 {
8896
8897 if (!ctx.
Read(itemQBIndex))
8898 {
8900 return false;
8901 }
8902 if (itemQBIndex != -1 && player)
8903 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8904 }
8905 }
8906
8907 if (version < 140)
8908 {
8909
8910 if (!LoadVariables(ctx, version))
8911 {
8913 return false;
8914 }
8915 }
8916
8917
8919 {
8921 return false;
8922 }
8923 if (version >= 132)
8924 {
8926 if (raib)
8927 {
8929 {
8931 return false;
8932 }
8933 }
8934 }
8935
8937 return true;
8938 }
8939
8940
8941
8943 {
8944 super.OnStoreSave(ctx);
8945
8946 PlayerBase player;
8947 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8948 {
8950
8951 int itemQBIndex = -1;
8952 itemQBIndex = player.FindQuickBarEntityIndex(this);
8953 ctx.
Write(itemQBIndex);
8954 }
8955 else
8956 {
8958 }
8959
8961
8963 if (raib)
8964 {
8966 }
8967 }
8968
8969
8971 {
8972 super.AfterStoreLoad();
8973
8975 {
8977 }
8978
8980 {
8983 }
8984 }
8985
8987 {
8988 super.EEOnAfterLoad();
8989
8991 {
8993 }
8994
8997 }
8998
9000 {
9001 return false;
9002 }
9003
9004
9005
9007 {
9009 {
9010 #ifdef PLATFORM_CONSOLE
9011
9013 {
9015 if (menu)
9016 {
9018 }
9019 }
9020 #endif
9021 }
9022
9024 {
9027 }
9028
9030 {
9031 SetWeightDirty();
9033 }
9035 {
9038 }
9039
9041 {
9044 }
9046 {
9049 }
9050
9051 super.OnVariablesSynchronized();
9052 }
9053
9054
9055
9057 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9058 {
9059 if (!IsServerCheck(allow_client))
9060 return false;
9061
9063 return false;
9064
9067
9068 if (value <= (min + 0.001))
9069 value = min;
9070
9071 if (value == min)
9072 {
9073 if (destroy_config)
9074 {
9075 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9076 if (dstr)
9077 {
9079 this.Delete();
9080 return true;
9081 }
9082 }
9083 else if (destroy_forced)
9084 {
9086 this.Delete();
9087 return true;
9088 }
9089
9091 }
9092
9095
9097 {
9099
9100 if (delta)
9102 }
9103
9105
9106 return false;
9107 }
9108
9109
9111 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9112 {
9114 }
9115
9117 {
9120 }
9121
9123 {
9126 }
9127
9130 {
9131 float value_clamped = Math.Clamp(value, 0, 1);
9133 SetQuantity(result, destroy_config, destroy_forced);
9134 }
9135
9136
9139 {
9141 }
9142
9144 {
9146 }
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9158 {
9159 int slot = -1;
9160 if (GetInventory())
9161 {
9162 InventoryLocation il = new InventoryLocation;
9163 GetInventory().GetCurrentInventoryLocation(il);
9165 }
9166
9168 }
9169
9171 {
9172 float quantity_max = 0;
9173
9175 {
9176 if (attSlotID != -1)
9177 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9178
9179 if (quantity_max <= 0)
9181 }
9182
9183 if (quantity_max <= 0)
9185
9186 return quantity_max;
9187 }
9188
9190 {
9192 }
9193
9195 {
9197 }
9198
9199
9201 {
9203 }
9204
9206 {
9208 }
9209
9211 {
9213 }
9214
9215
9217 {
9218
9219 float weightEx = GetWeightEx();
9220 float special = GetInventoryAndCargoWeight();
9221 return weightEx - special;
9222 }
9223
9224
9226 {
9228 }
9229
9231 {
9233 {
9234 #ifdef DEVELOPER
9235 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9236 {
9237 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9239 }
9240 #endif
9241
9243 }
9244 else if (HasEnergyManager())
9245 {
9246 #ifdef DEVELOPER
9247 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9248 {
9249 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9250 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9251 }
9252 #endif
9253 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9254 }
9255 else
9256 {
9257 #ifdef DEVELOPER
9258 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9259 {
9260 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9261 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9262 }
9263 #endif
9264 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9265 }
9266 }
9267
9270 {
9271 int item_count = 0;
9273
9274 if (GetInventory().GetCargo() != NULL)
9275 {
9276 item_count = GetInventory().GetCargo().GetItemCount();
9277 }
9278
9279 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9280 {
9281 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9282 if (item)
9283 item_count += item.GetNumberOfItems();
9284 }
9285 return item_count;
9286 }
9287
9290 {
9291 float weight = 0;
9292 float wetness = 1;
9293 if (include_wetness)
9296 {
9297 weight = wetness * m_ConfigWeight;
9298 }
9300 {
9301 weight = 1;
9302 }
9303 return weight;
9304 }
9305
9306
9307
9309 {
9310 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9311 {
9312 GameInventory inv = GetInventory();
9313 array<EntityAI> items = new array<EntityAI>;
9315 for (int i = 0; i < items.Count(); i++)
9316 {
9318 if (item)
9319 {
9321 }
9322 }
9323 }
9324 }
9325
9326
9327
9328
9330 {
9331 float energy = 0;
9332 if (HasEnergyManager())
9333 {
9334 energy = GetCompEM().GetEnergy();
9335 }
9336 return energy;
9337 }
9338
9339
9341 {
9342 super.OnEnergyConsumed();
9343
9345 }
9346
9348 {
9349 super.OnEnergyAdded();
9350
9352 }
9353
9354
9356 {
9357 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9358 {
9360 {
9361 float energy_0to1 = GetCompEM().GetEnergy0To1();
9363 }
9364 }
9365 }
9366
9367
9369 {
9370 return ConfigGetFloat("heatIsolation");
9371 }
9372
9374 {
9376 }
9377
9379 {
9380 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9381 if (
GetGame().ConfigIsExisting(paramPath))
9383
9384 return 0.0;
9385 }
9386
9388 {
9389 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9390 if (
GetGame().ConfigIsExisting(paramPath))
9392
9393 return 0.0;
9394 }
9395
9396 override void SetWet(
float value,
bool allow_client =
false)
9397 {
9398 if (!IsServerCheck(allow_client))
9399 return;
9400
9403
9405
9406 m_VarWet = Math.Clamp(value, min, max);
9407
9409 {
9412 }
9413 }
9414
9415 override void AddWet(
float value)
9416 {
9418 }
9419
9421 {
9423 }
9424
9426 {
9428 }
9429
9431 {
9433 }
9434
9436 {
9438 }
9439
9441 {
9443 }
9444
9446 {
9449 if (newLevel != oldLevel)
9450 {
9452 }
9453 }
9454
9456 {
9457 SetWeightDirty();
9458 }
9459
9461 {
9462 return GetWetLevelInternal(
m_VarWet);
9463 }
9464
9465
9466
9468 {
9470 }
9471
9473 {
9475 }
9476
9478 {
9480 }
9481
9483 {
9485 }
9486
9487
9488
9490 {
9491 if (ConfigIsExisting("itemModelLength"))
9492 {
9493 return ConfigGetFloat("itemModelLength");
9494 }
9495 return 0;
9496 }
9497
9499 {
9500 if (ConfigIsExisting("itemAttachOffset"))
9501 {
9502 return ConfigGetFloat("itemAttachOffset");
9503 }
9504 return 0;
9505 }
9506
9507 override void SetCleanness(
int value,
bool allow_client =
false)
9508 {
9509 if (!IsServerCheck(allow_client))
9510 return;
9511
9513
9515
9518 }
9519
9521 {
9523 }
9524
9526 {
9527 return true;
9528 }
9529
9530
9531
9532
9534 {
9536 }
9537
9539 {
9541 }
9542
9543
9544
9545
9546 override void SetColor(
int r,
int g,
int b,
int a)
9547 {
9553 }
9555 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9556 {
9561 }
9562
9564 {
9566 }
9567
9570 {
9571 int r,g,b,a;
9573 r = r/255;
9574 g = g/255;
9575 b = b/255;
9576 a = a/255;
9577 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9578 }
9579
9580
9581
9582 override void SetLiquidType(
int value,
bool allow_client =
false)
9583 {
9584 if (!IsServerCheck(allow_client))
9585 return;
9586
9591 }
9592
9594 {
9595 return ConfigGetInt("varLiquidTypeInit");
9596 }
9597
9599 {
9601 }
9602
9604 {
9606 SetFrozen(false);
9607 }
9608
9611 {
9612 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9613 }
9614
9615
9618 {
9619 PlayerBase nplayer;
9620 if (PlayerBase.CastTo(nplayer, player))
9621 {
9623
9624 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9625 }
9626 }
9627
9628
9631 {
9632 PlayerBase nplayer;
9633 if (PlayerBase.CastTo(nplayer,player))
9634 {
9635
9636 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9637
9638 }
9639
9640
9641 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9642
9643
9644 if (HasEnergyManager())
9645 {
9646 GetCompEM().UpdatePlugState();
9647 }
9648 }
9649
9650
9652 {
9653 super.OnPlacementStarted(player);
9654
9656 }
9657
9658 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9659 {
9661 {
9662 m_AdminLog.OnPlacementComplete(player,
this);
9663 }
9664
9665 super.OnPlacementComplete(player, position, orientation);
9666 }
9667
9668
9669
9670
9671
9673 {
9675 {
9676 return true;
9677 }
9678 else
9679 {
9680 return false;
9681 }
9682 }
9683
9684
9686 {
9688 {
9690 }
9691 }
9692
9693
9695 {
9697 }
9698
9700 {
9702 }
9703
9704 override void InsertAgent(
int agent,
float count = 1)
9705 {
9706 if (count < 1)
9707 return;
9708
9710 }
9711
9714 {
9716 }
9717
9718
9720 {
9722 }
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9766 {
9768 return false;
9769 return true;
9770 }
9771
9773 {
9774
9776 }
9777
9778
9781 {
9782 super.CheckForRoofLimited(timeTresholdMS);
9783
9785 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9786 {
9787 m_PreviousRoofTestTime = time;
9788 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9789 }
9790 }
9791
9792
9794 {
9796 {
9797 return 0;
9798 }
9799
9800 if (GetInventory().GetAttachmentSlotsCount() != 0)
9801 {
9802 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9803 if (filter)
9804 return filter.GetProtectionLevel(type, false, system);
9805 else
9806 return 0;
9807 }
9808
9809 string subclassPath, entryName;
9810
9811 switch (type)
9812 {
9814 entryName = "biological";
9815 break;
9817 entryName = "chemical";
9818 break;
9819 default:
9820 entryName = "biological";
9821 break;
9822 }
9823
9824 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9825
9827 }
9828
9829
9830
9833 {
9834 if (!IsMagazine())
9836
9838 }
9839
9840
9841
9842
9843
9848 {
9849 return true;
9850 }
9851
9853 {
9855 }
9856
9857
9858
9859
9860
9862 {
9863 if (parent)
9864 {
9865 if (parent.IsInherited(DayZInfected))
9866 return true;
9867
9868 if (!parent.IsRuined())
9869 return true;
9870 }
9871
9872 return true;
9873 }
9874
9876 {
9877 if (!super.CanPutAsAttachment(parent))
9878 {
9879 return false;
9880 }
9881
9882 if (!IsRuined() && !parent.IsRuined())
9883 {
9884 return true;
9885 }
9886
9887 return false;
9888 }
9889
9891 {
9892
9893
9894
9895
9896 return super.CanReceiveItemIntoCargo(item);
9897 }
9898
9900 {
9901
9902
9903
9904
9905 GameInventory attachmentInv = attachment.GetInventory();
9907 {
9908 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9909 return false;
9910 }
9911
9912 InventoryLocation loc = new InventoryLocation();
9913 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9914 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9915 return false;
9916
9917 return super.CanReceiveAttachment(attachment, slotId);
9918 }
9919
9921 {
9922 if (!super.CanReleaseAttachment(attachment))
9923 return false;
9924
9925 return GetInventory().AreChildrenAccessible();
9926 }
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9949 {
9950 int id = muzzle_owner.GetMuzzleID();
9951 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9952
9953 if (WPOF_array)
9954 {
9955 for (int i = 0; i < WPOF_array.Count(); i++)
9956 {
9957 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9958
9959 if (WPOF)
9960 {
9961 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9962 }
9963 }
9964 }
9965 }
9966
9967
9969 {
9970 int id = muzzle_owner.GetMuzzleID();
9972
9973 if (WPOBE_array)
9974 {
9975 for (int i = 0; i < WPOBE_array.Count(); i++)
9976 {
9977 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9978
9979 if (WPOBE)
9980 {
9981 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9982 }
9983 }
9984 }
9985 }
9986
9987
9989 {
9990 int id = muzzle_owner.GetMuzzleID();
9991 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9992
9993 if (WPOOH_array)
9994 {
9995 for (int i = 0; i < WPOOH_array.Count(); i++)
9996 {
9997 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9998
9999 if (WPOOH)
10000 {
10001 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10002 }
10003 }
10004 }
10005 }
10006
10007
10009 {
10010 int id = muzzle_owner.GetMuzzleID();
10011 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10012
10013 if (WPOOH_array)
10014 {
10015 for (int i = 0; i < WPOOH_array.Count(); i++)
10016 {
10017 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10018
10019 if (WPOOH)
10020 {
10021 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10022 }
10023 }
10024 }
10025 }
10026
10027
10029 {
10030 int id = muzzle_owner.GetMuzzleID();
10031 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10032
10033 if (WPOOH_array)
10034 {
10035 for (int i = 0; i < WPOOH_array.Count(); i++)
10036 {
10037 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10038
10039 if (WPOOH)
10040 {
10041 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10042 }
10043 }
10044 }
10045 }
10046
10047
10048
10050 {
10052 {
10053 return true;
10054 }
10055
10056 return false;
10057 }
10058
10060 {
10062 {
10063 return true;
10064 }
10065
10066 return false;
10067 }
10068
10070 {
10072 {
10073 return true;
10074 }
10075
10076 return false;
10077 }
10078
10080 {
10081 return false;
10082 }
10083
10086 {
10087 return UATimeSpent.DEFAULT_DEPLOY;
10088 }
10089
10090
10091
10092
10094 {
10096 SetSynchDirty();
10097 }
10098
10100 {
10102 }
10103
10104
10106 {
10107 return false;
10108 }
10109
10112 {
10113 string att_type = "None";
10114
10115 if (ConfigIsExisting("soundAttType"))
10116 {
10117 att_type = ConfigGetString("soundAttType");
10118 }
10119
10121 }
10122
10124 {
10126 }
10127
10128
10129
10130
10131
10135
10137 {
10140
10142 }
10143
10144
10146 {
10148 return;
10149
10151
10154
10157
10158 SoundParameters params = new SoundParameters();
10162 }
10163
10164
10166 {
10168 return;
10169
10171 SetSynchDirty();
10172
10175 }
10176
10177
10179 {
10181 return;
10182
10184 SetSynchDirty();
10185
10188 }
10189
10191 {
10193 }
10194
10196 {
10198 }
10199
10202 {
10203 if (!
GetGame().IsDedicatedServer())
10204 {
10205 if (ConfigIsExisting("attachSoundSet"))
10206 {
10207 string cfg_path = "";
10208 string soundset = "";
10209 string type_name =
GetType();
10210
10213 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10214 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10215
10216 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10217 {
10218 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10219 {
10220 if (cfg_slot_array[i] == slot_type)
10221 {
10222 soundset = cfg_soundset_array[i];
10223 break;
10224 }
10225 }
10226 }
10227
10228 if (soundset != "")
10229 {
10230 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10232 }
10233 }
10234 }
10235 }
10236
10238 {
10239
10240 }
10241
10242 void OnApply(PlayerBase player);
10243
10245 {
10246 return 1.0;
10247 };
10248
10250 {
10252 }
10253
10255 {
10257 }
10258
10260
10262 {
10263 SetDynamicPhysicsLifeTime(0.01);
10265 }
10266
10268 {
10269 array<string> zone_names = new array<string>;
10270 GetDamageZones(zone_names);
10271 for (int i = 0; i < zone_names.Count(); i++)
10272 {
10273 SetHealthMax(zone_names.Get(i),"Health");
10274 }
10275 SetHealthMax("","Health");
10276 }
10277
10280 {
10281 float global_health = GetHealth01("","Health");
10282 array<string> zones = new array<string>;
10283 GetDamageZones(zones);
10284
10285 for (int i = 0; i < zones.Count(); i++)
10286 {
10287 SetHealth01(zones.Get(i),"Health",global_health);
10288 }
10289 }
10290
10293 {
10294 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10295 }
10296
10298 {
10299 if (!hasRootAsPlayer)
10300 {
10301 if (refParentIB)
10302 {
10303
10304 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10305 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10306
10307 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10308 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10309
10312 }
10313 else
10314 {
10315
10318 }
10319 }
10320 }
10321
10323 {
10325 {
10326 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10327 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10328 {
10329 float heatPermCoef = 1.0;
10331 while (ent)
10332 {
10333 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10334 ent = ent.GetHierarchyParent();
10335 }
10336
10337 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10338 }
10339 }
10340 }
10341
10343 {
10344
10345 EntityAI parent = GetHierarchyParent();
10346 if (!parent)
10347 {
10348 hasParent = false;
10349 hasRootAsPlayer = false;
10350 }
10351 else
10352 {
10353 hasParent = true;
10354 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10355 refParentIB =
ItemBase.Cast(parent);
10356 }
10357 }
10358
10359 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10360 {
10361
10362 }
10363
10365 {
10366
10367 return false;
10368 }
10369
10371 {
10372
10373
10374 return false;
10375 }
10376
10378 {
10379
10380 return false;
10381 }
10382
10385 {
10386 return !GetIsFrozen() &&
IsOpen();
10387 }
10388
10390 {
10391 bool hasParent = false, hasRootAsPlayer = false;
10393
10394 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10395 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10396
10397 if (wwtu || foodDecay)
10398 {
10402
10403 if (processWetness || processTemperature || processDecay)
10404 {
10406
10407 if (processWetness)
10408 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10409
10410 if (processTemperature)
10412
10413 if (processDecay)
10414 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10415 }
10416 }
10417 }
10418
10421 {
10423 }
10424
10426 {
10429
10430 return super.GetTemperatureFreezeThreshold();
10431 }
10432
10434 {
10437
10438 return super.GetTemperatureThawThreshold();
10439 }
10440
10442 {
10445
10446 return super.GetItemOverheatThreshold();
10447 }
10448
10450 {
10452 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10453
10454 return super.GetTemperatureFreezeTime();
10455 }
10456
10458 {
10460 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10461
10462 return super.GetTemperatureThawTime();
10463 }
10464
10469
10471 {
10472 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10473 }
10474
10476 {
10477 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10478 }
10479
10482 {
10484 }
10485
10487 {
10489 }
10490
10492 {
10494 }
10495
10498 {
10499 return null;
10500 }
10501
10504 {
10505 return false;
10506 }
10507
10509 {
10511 {
10514 if (!trg)
10515 {
10517 explosive = this;
10518 }
10519
10520 explosive.PairRemote(trg);
10522
10523 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10524 trg.SetPersistentPairID(persistentID);
10525 explosive.SetPersistentPairID(persistentID);
10526
10527 return true;
10528 }
10529 return false;
10530 }
10531
10534 {
10535 float ret = 1.0;
10538 ret *= GetHealth01();
10539
10540 return ret;
10541 }
10542
10543 #ifdef DEVELOPER
10544 override void SetDebugItem()
10545 {
10546 super.SetDebugItem();
10547 _itemBase = this;
10548 }
10549
10551 {
10552 string text = super.GetDebugText();
10553
10555 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10556
10557 return text;
10558 }
10559 #endif
10560
10562 {
10563 return true;
10564 }
10565
10567
10569
10571 {
10574 }
10575
10576
10584
10600}
10601
10603{
10605 if (entity)
10606 {
10607 bool is_item = entity.IsInherited(
ItemBase);
10608 if (is_item && full_quantity)
10609 {
10612 }
10613 }
10614 else
10615 {
10617 return NULL;
10618 }
10619 return entity;
10620}
10621
10623{
10624 if (item)
10625 {
10626 if (health > 0)
10627 item.SetHealth("", "", health);
10628
10629 if (item.CanHaveTemperature())
10630 {
10632 if (item.CanFreeze())
10633 item.SetFrozen(false);
10634 }
10635
10636 if (item.HasEnergyManager())
10637 {
10638 if (quantity >= 0)
10639 {
10640 item.GetCompEM().SetEnergy0To1(quantity);
10641 }
10642 else
10643 {
10645 }
10646 }
10647 else if (item.IsMagazine())
10648 {
10649 Magazine mag = Magazine.Cast(item);
10650 if (quantity >= 0)
10651 {
10652 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10653 }
10654 else
10655 {
10657 }
10658
10659 }
10660 else
10661 {
10662 if (quantity >= 0)
10663 {
10664 item.SetQuantityNormalized(quantity, false);
10665 }
10666 else
10667 {
10669 }
10670
10671 }
10672 }
10673}
10674
10675#ifdef DEVELOPER
10677#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.