5639{
5641 {
5642 return true;
5643 }
5644};
5645
5646
5647
5649{
5653
5655
5658
5659
5660
5661
5662
5671
5677
5682
5687
5708 protected bool m_IsResultOfSplit
5709
5711
5716
5717
5718
5720
5724
5725
5726
5728
5731
5732
5733
5739
5740
5748
5751
5752
5754
5755
5757
5758
5763
5764
5769
5770
5772
5773
5775 {
5780
5781 if (!
GetGame().IsDedicatedServer())
5782 {
5784 {
5786
5788 {
5790 }
5791 }
5792
5795 }
5796
5797 m_OldLocation = null;
5798
5800 {
5802 }
5803
5804 if (ConfigIsExisting("headSelectionsToHide"))
5805 {
5808 }
5809
5811 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5812 {
5814 }
5815
5817
5818 m_IsResultOfSplit = false;
5819
5821 }
5822
5824 {
5825 super.InitItemVariables();
5826
5832 m_Count = ConfigGetInt(
"count");
5833
5836
5841
5844
5849
5861
5865
5866
5869 if (ConfigIsExisting("canBeSplit"))
5870 {
5873 }
5874
5876 if (ConfigIsExisting("itemBehaviour"))
5878
5879
5882 RegisterNetSyncVariableInt("m_VarLiquidType");
5883 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5884
5885 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5886 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5887 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5888
5889 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5890 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5891 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5892 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5893
5894 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5895 RegisterNetSyncVariableBool("m_IsTakeable");
5896 RegisterNetSyncVariableBool("m_IsHologram");
5897
5900 {
5903 }
5904
5906
5908 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5910
5911 }
5912
5914 {
5916 }
5917
5919 {
5922 {
5927 }
5928 }
5929
5930 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5931 {
5933 {
5936 }
5937
5939 }
5940
5942 {
5948 }
5949
5951
5953 {
5955
5956 if (!action)
5957 {
5958 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5959 return;
5960 }
5961
5963 if (!ai)
5964 {
5966 return;
5967 }
5968
5970 if (!action_array)
5971 {
5972 action_array = new array<ActionBase_Basic>;
5974 }
5975 if (LogManager.IsActionLogEnable())
5976 {
5977 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5978 }
5979
5980 if (action_array.Find(action) != -1)
5981 {
5982 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5983 }
5984 else
5985 {
5986 action_array.Insert(action);
5987 }
5988 }
5989
5991 {
5993 ActionBase action = player.GetActionManager().GetAction(actionName);
5996
5997 if (action_array)
5998 {
5999 action_array.RemoveItem(action);
6000 }
6001 }
6002
6003
6004
6006 {
6007 ActionOverrideData overrideData = new ActionOverrideData();
6011
6013 if (!actionMap)
6014 {
6017 }
6018
6019 actionMap.Insert(this.
Type(), overrideData);
6020
6021 }
6022
6024
6026
6027
6029 {
6032
6035
6036 string config_to_search = "CfgVehicles";
6037 string muzzle_owner_config;
6038
6040 {
6041 if (IsInherited(Weapon))
6042 config_to_search = "CfgWeapons";
6043
6044 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6045
6046 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6047
6049
6050 if (config_OnFire_subclass_count > 0)
6051 {
6052 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6053
6054 for (int i = 0; i < config_OnFire_subclass_count; i++)
6055 {
6056 string particle_class = "";
6058 string config_OnFire_entry = config_OnFire_class + particle_class;
6059 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6060 WPOF_array.Insert(WPOF);
6061 }
6062
6063
6065 }
6066 }
6067
6069 {
6070 config_to_search = "CfgWeapons";
6071 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6072
6073 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6074
6076
6077 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6078 {
6079 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6080
6081 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6082 {
6083 string particle_class2 = "";
6085 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6086 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6087 WPOBE_array.Insert(WPOBE);
6088 }
6089
6090
6092 }
6093 }
6094 }
6095
6096
6098 {
6101
6103 {
6104 string config_to_search = "CfgVehicles";
6105
6106 if (IsInherited(Weapon))
6107 config_to_search = "CfgWeapons";
6108
6109 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6110 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6111
6112 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6113 {
6114
6116
6118 {
6120 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6122 return;
6123 }
6124
6127
6128
6129
6131 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6132
6133 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6134 {
6135 string particle_class = "";
6137 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6139
6140 if (entry_type == CT_CLASS)
6141 {
6142 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6143 WPOOH_array.Insert(WPOF);
6144 }
6145 }
6146
6147
6149 }
6150 }
6151 }
6152
6154 {
6156 }
6157
6159 {
6161 {
6163
6166
6169
6170 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6171 }
6172 }
6173
6175 {
6177 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6178
6180 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6181
6183 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6184
6186 {
6188 }
6189 }
6190
6192 {
6194 }
6195
6197 {
6200 else
6202
6204 {
6207 }
6208 else
6209 {
6212
6215 }
6216
6218 }
6219
6221 {
6223 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6224 }
6225
6227 {
6229 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6231 }
6232
6234 {
6236 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6237 }
6238
6240 {
6243
6244 OverheatingParticle OP = new OverheatingParticle();
6249
6251 }
6252
6254 {
6257
6258 return -1;
6259 }
6260
6262 {
6264 {
6267
6268 for (int i = count; i > 0; --i)
6269 {
6270 int id = i - 1;
6273
6276
6277 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6278 {
6279 if (p)
6280 {
6283 }
6284 }
6285 }
6286 }
6287 }
6288
6290 {
6292 {
6294 {
6295 int id = i - 1;
6297
6298 if (OP)
6299 {
6301
6302 if (p)
6303 {
6305 }
6306
6307 delete OP;
6308 }
6309 }
6310
6313 }
6314 }
6315
6318 {
6319 return 0.0;
6320 }
6321
6322
6324 {
6325 return 250;
6326 }
6327
6329 {
6330 return 0;
6331 }
6332
6335 {
6337 return true;
6338
6339 return false;
6340 }
6341
6344 {
6347
6349 {
6351 }
6352 else
6353 {
6354
6356 }
6357
6359 }
6360
6367 {
6368 return -1;
6369 }
6370
6371
6372
6373
6375 {
6377 {
6379 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6380
6381 if (r_index >= 0)
6382 {
6383 InventoryLocation r_il = new InventoryLocation;
6384 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6385
6386 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6389 {
6390 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6391 }
6393 {
6394 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6395 }
6396
6397 }
6398
6399 player.GetHumanInventory().ClearUserReservedLocation(this);
6400 }
6401
6404 }
6405
6406
6407
6408
6410 {
6411 return ItemBase.m_DebugActionsMask;
6412 }
6413
6415 {
6416 return ItemBase.m_DebugActionsMask & mask;
6417 }
6418
6420 {
6421 ItemBase.m_DebugActionsMask = mask;
6422 }
6423
6425 {
6426 ItemBase.m_DebugActionsMask |= mask;
6427 }
6428
6430 {
6431 ItemBase.m_DebugActionsMask &= ~mask;
6432 }
6433
6435 {
6437 {
6439 }
6440 else
6441 {
6443 }
6444 }
6445
6446
6448 {
6449 if (GetEconomyProfile())
6450 {
6451 float q_max = GetEconomyProfile().GetQuantityMax();
6452 if (q_max > 0)
6453 {
6454 float q_min = GetEconomyProfile().GetQuantityMin();
6455 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6456
6458 {
6459 ComponentEnergyManager comp = GetCompEM();
6461 {
6463 }
6464 }
6466 {
6468
6469 }
6470
6471 }
6472 }
6473 }
6474
6477 {
6478 EntityAI parent = GetHierarchyParent();
6479
6480 if (parent)
6481 {
6482 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6483 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6484 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6485 }
6486 }
6487
6490 {
6491 EntityAI parent = GetHierarchyParent();
6492
6493 if (parent)
6494 {
6495 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6496 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6497 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6498 }
6499 }
6500
6502 {
6503
6504
6505
6506
6508
6510 {
6511 if (ScriptInputUserData.CanStoreInputUserData())
6512 {
6513 ScriptInputUserData ctx = new ScriptInputUserData;
6519 ctx.
Write(use_stack_max);
6522
6524 {
6525 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6526 }
6527 }
6528 }
6529 else if (!
GetGame().IsMultiplayer())
6530 {
6532 }
6533 }
6534
6536 {
6538 }
6539
6541 {
6543 }
6544
6546 {
6548 }
6549
6551 {
6552
6553 return false;
6554 }
6555
6557 {
6558 return false;
6559 }
6560
6564 {
6565 return false;
6566 }
6567
6569 {
6570 return "";
6571 }
6572
6574
6576 {
6577 return false;
6578 }
6579
6581 {
6582 return true;
6583 }
6584
6585
6586
6588 {
6589 return true;
6590 }
6591
6593 {
6594 return true;
6595 }
6596
6598 {
6599 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6601 }
6602
6604 {
6606 }
6607
6609 {
6611 if (!is_being_placed)
6613 SetSynchDirty();
6614 }
6615
6616
6618
6620 {
6622 }
6623
6625 {
6627 }
6628
6630 {
6631 return 1;
6632 }
6633
6635 {
6636 return false;
6637 }
6638
6640 {
6642 SetSynchDirty();
6643 }
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6680 {
6681 super.OnMovedInsideCargo(container);
6682
6683 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6684 }
6685
6686 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6687 {
6688 super.EEItemLocationChanged(oldLoc,newLoc);
6689
6690 PlayerBase new_player = null;
6691 PlayerBase old_player = null;
6692
6693 if (newLoc.GetParent())
6694 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6695
6696 if (oldLoc.GetParent())
6697 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6698
6700 {
6701 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6702
6703 if (r_index >= 0)
6704 {
6705 InventoryLocation r_il = new InventoryLocation;
6706 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6707
6708 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6711 {
6712 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6713 }
6715 {
6716 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6717 }
6718
6719 }
6720 }
6721
6723 {
6724 if (new_player)
6725 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6726
6727 if (new_player == old_player)
6728 {
6729
6730 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6731 {
6733 {
6734 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6735 {
6736 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6737 }
6738 }
6739 else
6740 {
6741 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6742 }
6743 }
6744
6745 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6746 {
6747 int type = oldLoc.GetType();
6749 {
6750 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6751 }
6753 {
6754 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6755 }
6756 }
6757 if (!m_OldLocation)
6758 {
6759 m_OldLocation = new InventoryLocation;
6760 }
6761 m_OldLocation.Copy(oldLoc);
6762 }
6763 else
6764 {
6765 if (m_OldLocation)
6766 {
6767 m_OldLocation.Reset();
6768 }
6769 }
6770
6772 }
6773 else
6774 {
6775 if (new_player)
6776 {
6777 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6778 if (res_index >= 0)
6779 {
6780 InventoryLocation il = new InventoryLocation;
6781 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6783 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6786 {
6787 il.
GetParent().GetOnReleaseLock().Invoke(it);
6788 }
6790 {
6792 }
6793
6794 }
6795 }
6797 {
6798
6800 }
6801
6802 if (m_OldLocation)
6803 {
6804 m_OldLocation.Reset();
6805 }
6806 }
6807 }
6808
6809 override void EOnContact(IEntity other, Contact extra)
6810 {
6812 {
6813 int liquidType = -1;
6815 if (impactSpeed > 0.0)
6816 {
6818 #ifndef SERVER
6820 #else
6822 SetSynchDirty();
6823 #endif
6825 }
6826 }
6827
6828 #ifdef SERVER
6829 if (GetCompEM() && GetCompEM().IsPlugged())
6830 {
6831 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6832 GetCompEM().UnplugThis();
6833 }
6834 #endif
6835 }
6836
6838
6840 {
6842 }
6843
6845 {
6846
6847 }
6848
6850 {
6851 super.OnItemLocationChanged(old_owner, new_owner);
6852
6853 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6854 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6855
6856 if (!relatedPlayer && playerNew)
6857 relatedPlayer = playerNew;
6858
6859 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6860 {
6862 if (actionMgr)
6863 {
6864 ActionBase currentAction = actionMgr.GetRunningAction();
6865 if (currentAction)
6867 }
6868 }
6869
6870 Man ownerPlayerOld = null;
6871 Man ownerPlayerNew = null;
6872
6873 if (old_owner)
6874 {
6875 if (old_owner.
IsMan())
6876 {
6877 ownerPlayerOld = Man.Cast(old_owner);
6878 }
6879 else
6880 {
6881 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6882 }
6883 }
6884 else
6885 {
6887 {
6889
6890 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6891 {
6892 GetCompEM().UnplugThis();
6893 }
6894 }
6895 }
6896
6897 if (new_owner)
6898 {
6899 if (new_owner.
IsMan())
6900 {
6901 ownerPlayerNew = Man.Cast(new_owner);
6902 }
6903 else
6904 {
6905 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6906 }
6907 }
6908
6909 if (ownerPlayerOld != ownerPlayerNew)
6910 {
6911 if (ownerPlayerOld)
6912 {
6913 array<EntityAI> subItemsExit = new array<EntityAI>;
6915 for (int i = 0; i < subItemsExit.Count(); i++)
6916 {
6919 }
6920 }
6921
6922 if (ownerPlayerNew)
6923 {
6924 array<EntityAI> subItemsEnter = new array<EntityAI>;
6926 for (int j = 0; j < subItemsEnter.Count(); j++)
6927 {
6930 }
6931 }
6932 }
6933 else if (ownerPlayerNew != null)
6934 {
6935 PlayerBase nplayer;
6936 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6937 {
6938 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6940 for (int k = 0; k < subItemsUpdate.Count(); k++)
6941 {
6943 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6944 }
6945 }
6946 }
6947
6948 if (old_owner)
6949 old_owner.OnChildItemRemoved(this);
6950 if (new_owner)
6951 new_owner.OnChildItemReceived(this);
6952 }
6953
6954
6956 {
6957 super.EEDelete(parent);
6958 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6959 if (player)
6960 {
6962
6963 if (player.IsAlive())
6964 {
6965 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6966 if (r_index >= 0)
6967 {
6968 InventoryLocation r_il = new InventoryLocation;
6969 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6970
6971 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6974 {
6975 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6976 }
6978 {
6979 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6980 }
6981
6982 }
6983
6984 player.RemoveQuickBarEntityShortcut(this);
6985 }
6986 }
6987 }
6988
6990 {
6991 super.EEKilled(killer);
6992
6995 {
6996 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6997 {
6998 if (IsMagazine())
6999 {
7000 if (Magazine.Cast(this).GetAmmoCount() > 0)
7001 {
7003 }
7004 }
7005 else
7006 {
7008 }
7009 }
7010 }
7011 }
7012
7014 {
7015 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7016
7017 super.OnWasAttached(parent, slot_id);
7018
7021
7023 }
7024
7026 {
7027 super.OnWasDetached(parent, slot_id);
7028
7031 }
7032
7034 {
7035 int idx;
7038
7039 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7040 if (inventory_slots.Count() < 1)
7041 {
7042 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7043 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7044 }
7045 else
7046 {
7047 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7048 }
7049
7050 idx = inventory_slots.Find(slot);
7051 if (idx < 0)
7052 return "";
7053
7054 return attach_types.Get(idx);
7055 }
7056
7058 {
7059 int idx = -1;
7060 string slot;
7061
7064
7065 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7066 if (inventory_slots.Count() < 1)
7067 {
7068 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7069 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7070 }
7071 else
7072 {
7073 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7074 if (detach_types.Count() < 1)
7075 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7076 }
7077
7078 for (int i = 0; i < inventory_slots.Count(); i++)
7079 {
7080 slot = inventory_slots.Get(i);
7081 }
7082
7083 if (slot != "")
7084 {
7085 if (detach_types.Count() == 1)
7086 idx = 0;
7087 else
7088 idx = inventory_slots.Find(slot);
7089 }
7090 if (idx < 0)
7091 return "";
7092
7093 return detach_types.Get(idx);
7094 }
7095
7097 {
7098
7100
7101
7102 float min_time = 1;
7103 float max_time = 3;
7104 float delay = Math.RandomFloat(min_time, max_time);
7105
7106 explode_timer.Run(delay, this, "DoAmmoExplosion");
7107 }
7108
7110 {
7111 Magazine magazine = Magazine.Cast(this);
7112 int pop_sounds_count = 6;
7113 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7114
7115
7116 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7117 string sound_name = pop_sounds[ sound_idx ];
7119
7120
7121 magazine.ServerAddAmmoCount(-1);
7122
7123
7124 float min_temp_to_explode = 100;
7125
7126 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7127 {
7129 }
7130 }
7131
7132
7133 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7134 {
7135 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7136
7137 const int CHANCE_DAMAGE_CARGO = 4;
7138 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7139 const int CHANCE_DAMAGE_NOTHING = 2;
7140
7142 {
7143 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7144 int chances;
7145 int rnd;
7146
7147 if (GetInventory().GetCargo())
7148 {
7149 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7150 rnd = Math.RandomInt(0,chances);
7151
7152 if (rnd < CHANCE_DAMAGE_CARGO)
7153 {
7155 }
7156 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7157 {
7159 }
7160 }
7161 else
7162 {
7163 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7164 rnd = Math.RandomInt(0,chances);
7165
7166 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7167 {
7169 }
7170 }
7171 }
7172 }
7173
7175 {
7176 if (GetInventory().GetCargo())
7177 {
7178 int item_count = GetInventory().GetCargo().GetItemCount();
7179 if (item_count > 0)
7180 {
7181 int random_pick = Math.RandomInt(0, item_count);
7183 if (!item.IsExplosive())
7184 {
7185 item.AddHealth("","",damage);
7186 return true;
7187 }
7188 }
7189 }
7190 return false;
7191 }
7192
7194 {
7195 int attachment_count = GetInventory().AttachmentCount();
7196 if (attachment_count > 0)
7197 {
7198 int random_pick = Math.RandomInt(0, attachment_count);
7199 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7200 if (!attachment.IsExplosive())
7201 {
7202 attachment.AddHealth("","",damage);
7203 return true;
7204 }
7205 }
7206 return false;
7207 }
7208
7210 {
7212 }
7213
7215 {
7217 return GetInventory().CanRemoveEntity();
7218
7219 return false;
7220 }
7221
7223 {
7225 return;
7226
7228 {
7229 if (ScriptInputUserData.CanStoreInputUserData())
7230 {
7231 ScriptInputUserData ctx = new ScriptInputUserData;
7236 ctx.
Write(destination_entity);
7240 }
7241 }
7242 else if (!
GetGame().IsMultiplayer())
7243 {
7245 }
7246 }
7247
7249 {
7251 return;
7252
7253 float split_quantity_new;
7257 InventoryLocation loc = new InventoryLocation;
7258
7259 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7260 {
7262 split_quantity_new = stack_max;
7263 else
7265
7266 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7267 if (new_item)
7268 {
7269 new_item.SetResultOfSplit(true);
7270 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7272 new_item.SetQuantity(split_quantity_new);
7273 }
7274 }
7275 else if (destination_entity && slot_id == -1)
7276 {
7277 if (quantity > stack_max)
7278 split_quantity_new = stack_max;
7279 else
7280 split_quantity_new = quantity;
7281
7283 {
7286 }
7287
7288 if (new_item)
7289 {
7290 new_item.SetResultOfSplit(true);
7291 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7293 new_item.SetQuantity(split_quantity_new);
7294 }
7295 }
7296 else
7297 {
7298 if (stack_max != 0)
7299 {
7301 {
7303 }
7304
7305 if (split_quantity_new == 0)
7306 {
7307 if (!
GetGame().IsMultiplayer())
7308 player.PhysicalPredictiveDropItem(this);
7309 else
7310 player.ServerDropEntity(this);
7311 return;
7312 }
7313
7315
7316 if (new_item)
7317 {
7318 new_item.SetResultOfSplit(true);
7319 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7321 new_item.SetQuantity(stack_max);
7322 new_item.PlaceOnSurface();
7323 }
7324 }
7325 }
7326 }
7327
7329 {
7331 return;
7332
7333 float split_quantity_new;
7337 InventoryLocation loc = new InventoryLocation;
7338
7339 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7340 {
7342 split_quantity_new = stack_max;
7343 else
7345
7346 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7347 if (new_item)
7348 {
7349 new_item.SetResultOfSplit(true);
7350 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7352 new_item.SetQuantity(split_quantity_new);
7353 }
7354 }
7355 else if (destination_entity && slot_id == -1)
7356 {
7357 if (quantity > stack_max)
7358 split_quantity_new = stack_max;
7359 else
7360 split_quantity_new = quantity;
7361
7363 {
7366 }
7367
7368 if (new_item)
7369 {
7370 new_item.SetResultOfSplit(true);
7371 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7373 new_item.SetQuantity(split_quantity_new);
7374 }
7375 }
7376 else
7377 {
7378 if (stack_max != 0)
7379 {
7381 {
7383 }
7384
7386
7387 if (new_item)
7388 {
7389 new_item.SetResultOfSplit(true);
7390 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7392 new_item.SetQuantity(stack_max);
7393 new_item.PlaceOnSurface();
7394 }
7395 }
7396 }
7397 }
7398
7400 {
7402 return;
7403
7405 {
7406 if (ScriptInputUserData.CanStoreInputUserData())
7407 {
7408 ScriptInputUserData ctx = new ScriptInputUserData;
7413 dst.WriteToContext(ctx);
7415 }
7416 }
7417 else if (!
GetGame().IsMultiplayer())
7418 {
7420 }
7421 }
7422
7424 {
7426 return;
7427
7429 {
7430 if (ScriptInputUserData.CanStoreInputUserData())
7431 {
7432 ScriptInputUserData ctx = new ScriptInputUserData;
7437 ctx.
Write(destination_entity);
7443 }
7444 }
7445 else if (!
GetGame().IsMultiplayer())
7446 {
7448 }
7449 }
7450
7452 {
7454 }
7455
7457 {
7459 return this;
7460
7462 float split_quantity_new;
7464 if (dst.IsValid())
7465 {
7466 int slot_id = dst.GetSlot();
7468
7469 if (quantity > stack_max)
7470 split_quantity_new = stack_max;
7471 else
7472 split_quantity_new = quantity;
7473
7475
7476 if (new_item)
7477 {
7478 new_item.SetResultOfSplit(true);
7479 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7482 }
7483
7484 return new_item;
7485 }
7486
7487 return null;
7488 }
7489
7491 {
7493 return;
7494
7496 float split_quantity_new;
7498 if (destination_entity)
7499 {
7501 if (quantity > stackable)
7502 split_quantity_new = stackable;
7503 else
7504 split_quantity_new = quantity;
7505
7506 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7507 if (new_item)
7508 {
7509 new_item.SetResultOfSplit(true);
7510 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7512 new_item.SetQuantity(split_quantity_new);
7513 }
7514 }
7515 }
7516
7518 {
7520 return;
7521
7523 {
7524 if (ScriptInputUserData.CanStoreInputUserData())
7525 {
7526 ScriptInputUserData ctx = new ScriptInputUserData;
7531 ItemBase destination_entity =
this;
7532 ctx.
Write(destination_entity);
7536 }
7537 }
7538 else if (!
GetGame().IsMultiplayer())
7539 {
7541 }
7542 }
7543
7545 {
7547 return;
7548
7550 float split_quantity_new;
7552 if (player)
7553 {
7555 if (quantity > stackable)
7556 split_quantity_new = stackable;
7557 else
7558 split_quantity_new = quantity;
7559
7560 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7561 new_item =
ItemBase.Cast(in_hands);
7562 if (new_item)
7563 {
7564 new_item.SetResultOfSplit(true);
7565 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7567 new_item.SetQuantity(split_quantity_new);
7568 }
7569 }
7570 }
7571
7573 {
7575 return;
7576
7578 float split_quantity_new = Math.Floor(quantity * 0.5);
7579
7581
7582 if (new_item)
7583 {
7584 if (new_item.GetQuantityMax() < split_quantity_new)
7585 {
7586 split_quantity_new = new_item.GetQuantityMax();
7587 }
7588
7589 new_item.SetResultOfSplit(true);
7590 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7591
7593 {
7596 }
7597 else
7598 {
7601 }
7602 }
7603 }
7604
7606 {
7608 return;
7609
7611 float split_quantity_new = Math.Floor(quantity / 2);
7612
7613 InventoryLocation invloc = new InventoryLocation;
7615
7617 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7618
7619 if (new_item)
7620 {
7621 if (new_item.GetQuantityMax() < split_quantity_new)
7622 {
7623 split_quantity_new = new_item.GetQuantityMax();
7624 }
7626 {
7629 }
7630 else
7631 {
7634 }
7635 }
7636 }
7637
7640 {
7641 SetWeightDirty();
7643
7644 if (parent)
7645 parent.OnAttachmentQuantityChangedEx(this, delta);
7646
7648 {
7650 {
7652 }
7654 {
7655 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7657 }
7658 }
7659
7660 }
7661
7664 {
7665
7666 }
7667
7670 {
7672 }
7673
7675 {
7676 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7677
7679 {
7680 if (newLevel == GameConstants.STATE_RUINED)
7681 {
7683 EntityAI parent = GetHierarchyParent();
7684 if (parent && parent.IsFireplace())
7685 {
7686 CargoBase cargo = GetInventory().GetCargo();
7687 if (cargo)
7688 {
7690 {
7692 }
7693 }
7694 }
7695 }
7696
7698 {
7699
7701 return;
7702 }
7703
7704 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7705 {
7707 }
7708 }
7709 }
7710
7711
7713 {
7714 super.OnRightClick();
7715
7717 {
7719 {
7720 if (ScriptInputUserData.CanStoreInputUserData())
7721 {
7722 vector m4[4];
7724
7725 EntityAI root = GetHierarchyRoot();
7726
7727 InventoryLocation dst = new InventoryLocation;
7729 {
7730 if (root)
7731 {
7732 root.GetTransform(m4);
7734 }
7735 else
7736 GetInventory().GetCurrentInventoryLocation(dst);
7737 }
7738 else
7739 {
7741
7742
7743 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7744 {
7745 if (root)
7746 {
7747 root.GetTransform(m4);
7749 }
7750 else
7751 GetInventory().GetCurrentInventoryLocation(dst);
7752 }
7753 else
7754 {
7755 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7756 }
7757 }
7758
7759 ScriptInputUserData ctx = new ScriptInputUserData;
7767 }
7768 }
7769 else if (!
GetGame().IsMultiplayer())
7770 {
7772 }
7773 }
7774 }
7775
7776 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7777 {
7778
7779 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7780 return false;
7781
7782 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7783 return false;
7784
7785
7787 return false;
7788
7789
7790 Magazine mag = Magazine.Cast(this);
7791 if (mag)
7792 {
7793 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7794 return false;
7795
7796 if (stack_max_limit)
7797 {
7798 Magazine other_mag = Magazine.Cast(other_item);
7799 if (other_item)
7800 {
7801 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7802 return false;
7803 }
7804
7805 }
7806 }
7807 else
7808 {
7809
7811 return false;
7812
7814 return false;
7815 }
7816
7817 PlayerBase player = null;
7818 if (CastTo(player, GetHierarchyRootPlayer()))
7819 {
7820 if (player.GetInventory().HasAttachment(this))
7821 return false;
7822
7823 if (player.IsItemsToDelete())
7824 return false;
7825 }
7826
7827 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7828 return false;
7829
7830 int slotID;
7832 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7833 return false;
7834
7835 return true;
7836 }
7837
7839 {
7841 }
7842
7844 {
7845 return m_IsResultOfSplit;
7846 }
7847
7849 {
7850 m_IsResultOfSplit = value;
7851 }
7852
7854 {
7856 }
7857
7859 {
7860 float other_item_quantity = other_item.GetQuantity();
7861 float this_free_space;
7862
7864
7866
7867 if (other_item_quantity > this_free_space)
7868 {
7869 return this_free_space;
7870 }
7871 else
7872 {
7873 return other_item_quantity;
7874 }
7875 }
7876
7878 {
7880 }
7881
7883 {
7885 return;
7886
7887 if (!IsMagazine() && other_item)
7888 {
7890 if (quantity_used != 0)
7891 {
7892 float hp1 = GetHealth01("","");
7893 float hp2 = other_item.GetHealth01("","");
7894 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7895 hpResult = hpResult / (
GetQuantity() + quantity_used);
7896
7897 hpResult *= GetMaxHealth();
7898 Math.Round(hpResult);
7899 SetHealth("", "Health", hpResult);
7900
7902 other_item.AddQuantity(-quantity_used);
7903 }
7904 }
7906 }
7907
7909 {
7910 #ifdef SERVER
7911 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7912 GetHierarchyParent().IncreaseLifetimeUp();
7913 #endif
7914 };
7915
7917 {
7918 PlayerBase p = PlayerBase.Cast(player);
7919
7920 array<int> recipesIds = p.m_Recipes;
7921 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7922 if (moduleRecipesManager)
7923 {
7924 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7925 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7926 }
7927
7928 for (int i = 0;i < recipesIds.Count(); i++)
7929 {
7930 int key = recipesIds.Get(i);
7931 string recipeName = moduleRecipesManager.GetRecipeName(key);
7933 }
7934 }
7935
7936
7937 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7938 {
7939 super.GetDebugActions(outputList);
7940
7941
7946
7947
7951
7955
7956
7959
7960
7962 {
7965 }
7966
7968
7971
7975 }
7976
7977
7978
7979
7981 {
7982 super.OnAction(action_id, player, ctx);
7983 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7984 {
7985 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7986 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7987 PlayerBase p = PlayerBase.Cast(player);
7988 if (
EActions.RECIPES_RANGE_START < 1000)
7989 {
7990 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7991 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7992 }
7993 }
7994 #ifndef SERVER
7995 else if (action_id ==
EActions.WATCH_PLAYER)
7996 {
7997 PluginDeveloper.SetDeveloperItemClientEx(player);
7998 }
7999 #endif
8001 {
8002 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8003 {
8004 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8005 OnDebugButtonPressServer(id + 1);
8006 }
8007
8008 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8009 {
8010 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8012 }
8013
8014 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8015 {
8016 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8018 }
8019
8020 else if (action_id ==
EActions.ADD_QUANTITY)
8021 {
8022 if (IsMagazine())
8023 {
8024 Magazine mag = Magazine.Cast(this);
8025 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8026 }
8027 else
8028 {
8030 }
8031
8032 if (m_EM)
8033 {
8034 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8035 }
8036
8037 }
8038
8039 else if (action_id ==
EActions.REMOVE_QUANTITY)
8040 {
8041 if (IsMagazine())
8042 {
8043 Magazine mag2 = Magazine.Cast(this);
8044 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8045 }
8046 else
8047 {
8049 }
8050 if (m_EM)
8051 {
8052 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8053 }
8054
8055 }
8056
8057 else if (action_id ==
EActions.SET_QUANTITY_0)
8058 {
8060
8061 if (m_EM)
8062 {
8063 m_EM.SetEnergy(0);
8064 }
8065 }
8066
8067 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8068 {
8070
8071 if (m_EM)
8072 {
8073 m_EM.SetEnergy(m_EM.GetEnergyMax());
8074 }
8075 }
8076
8077 else if (action_id ==
EActions.ADD_HEALTH)
8078 {
8079 AddHealth("","",GetMaxHealth("","Health")/5);
8080 }
8081 else if (action_id ==
EActions.REMOVE_HEALTH)
8082 {
8083 AddHealth("","",-GetMaxHealth("","Health")/5);
8084 }
8085 else if (action_id ==
EActions.DESTROY_HEALTH)
8086 {
8087 SetHealth01("","",0);
8088 }
8089 else if (action_id ==
EActions.WATCH_ITEM)
8090 {
8092 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8093 #ifdef DEVELOPER
8094 SetDebugDeveloper_item(this);
8095 #endif
8096 }
8097
8098 else if (action_id ==
EActions.ADD_TEMPERATURE)
8099 {
8100 AddTemperature(20);
8101
8102 }
8103
8104 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8105 {
8106 AddTemperature(-20);
8107
8108 }
8109
8110 else if (action_id ==
EActions.FLIP_FROZEN)
8111 {
8112 SetFrozen(!GetIsFrozen());
8113
8114 }
8115
8116 else if (action_id ==
EActions.ADD_WETNESS)
8117 {
8119
8120 }
8121
8122 else if (action_id ==
EActions.REMOVE_WETNESS)
8123 {
8125
8126 }
8127
8128 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8129 {
8132
8133
8134 }
8135
8136 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8137 {
8140 }
8141
8142 else if (action_id ==
EActions.MAKE_SPECIAL)
8143 {
8144 auto debugParams = DebugSpawnParams.WithPlayer(player);
8145 OnDebugSpawnEx(debugParams);
8146 }
8147
8148 else if (action_id ==
EActions.DELETE)
8149 {
8150 Delete();
8151 }
8152
8153 }
8154
8155
8156 return false;
8157 }
8158
8159
8160
8161
8165
8168
8169
8170
8172 {
8173 return false;
8174 }
8175
8176
8178 {
8179 return true;
8180 }
8181
8182
8184 {
8185 return true;
8186 }
8187
8188
8189
8191 {
8192 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8194 }
8195
8198 {
8199 return null;
8200 }
8201
8203 {
8204 return false;
8205 }
8206
8208 {
8209 return false;
8210 }
8211
8215
8216
8218 {
8219 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8220 return module_repairing.CanRepair(this, item_repair_kit);
8221 }
8222
8223
8224 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8225 {
8226 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8227 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8228 }
8229
8230
8232 {
8233
8234
8235
8236
8237
8238
8239
8240
8241 return 1;
8242 }
8243
8244
8245
8247 {
8249 }
8250
8251
8252
8254 {
8256 }
8257
8258
8267 {
8268 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8269
8270 if (player)
8271 {
8272 player.MessageStatus(text);
8273 }
8274 }
8275
8276
8285 {
8286 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8287
8288 if (player)
8289 {
8290 player.MessageAction(text);
8291 }
8292 }
8293
8294
8303 {
8304 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8305
8306 if (player)
8307 {
8308 player.MessageFriendly(text);
8309 }
8310 }
8311
8312
8321 {
8322 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8323
8324 if (player)
8325 {
8326 player.MessageImportant(text);
8327 }
8328 }
8329
8331 {
8332 return true;
8333 }
8334
8335
8336 override bool KindOf(
string tag)
8337 {
8338 bool found = false;
8339 string item_name = this.
GetType();
8342
8343 int array_size = item_tag_array.Count();
8344 for (int i = 0; i < array_size; i++)
8345 {
8346 if (item_tag_array.Get(i) == tag)
8347 {
8348 found = true;
8349 break;
8350 }
8351 }
8352 return found;
8353 }
8354
8355
8357 {
8358
8359 super.OnRPC(sender, rpc_type,ctx);
8360
8361
8362 switch (rpc_type)
8363 {
8364 #ifndef SERVER
8365 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8366 Param2<bool, string> p = new Param2<bool, string>(false, "");
8367
8369 return;
8370
8371 bool play = p.param1;
8372 string soundSet = p.param2;
8373
8374 if (play)
8375 {
8377 {
8379 {
8381 }
8382 }
8383 else
8384 {
8386 }
8387 }
8388 else
8389 {
8391 }
8392
8393 break;
8394 #endif
8395
8396 }
8397
8399 {
8401 }
8402 }
8403
8404
8405
8406
8408 {
8409 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8410 return plugin.GetID(
name);
8411 }
8412
8414 {
8415 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8416 return plugin.GetName(id);
8417 }
8418
8421 {
8422
8423
8424 int varFlags;
8425 if (!ctx.
Read(varFlags))
8426 return;
8427
8428 if (varFlags & ItemVariableFlags.FLOAT)
8429 {
8431 }
8432 }
8433
8435 {
8436
8437 super.SerializeNumericalVars(floats_out);
8438
8439
8440
8442 {
8444 }
8445
8447 {
8449 }
8450
8452 {
8454 }
8455
8457 {
8462 }
8463
8465 {
8467 }
8468 }
8469
8471 {
8472
8473 super.DeSerializeNumericalVars(floats);
8474
8475
8476 int index = 0;
8477 int mask = Math.Round(floats.Get(index));
8478
8479 index++;
8480
8482 {
8484 {
8486 }
8487 else
8488 {
8489 float quantity = floats.Get(index);
8491 }
8492 index++;
8493 }
8494
8496 {
8497 float wet = floats.Get(index);
8499 index++;
8500 }
8501
8503 {
8504 int liquidtype = Math.Round(floats.Get(index));
8506 index++;
8507 }
8508
8510 {
8512 index++;
8514 index++;
8516 index++;
8518 index++;
8519 }
8520
8522 {
8523 int cleanness = Math.Round(floats.Get(index));
8525 index++;
8526 }
8527 }
8528
8530 {
8531 super.WriteVarsToCTX(ctx);
8532
8533
8535 {
8537 }
8538
8540 {
8542 }
8543
8545 {
8547 }
8548
8550 {
8551 int r,g,b,a;
8557 }
8558
8560 {
8562 }
8563 }
8564
8566 {
8567 if (!super.ReadVarsFromCTX(ctx,version))
8568 return false;
8569
8570 int intValue;
8571 float value;
8572
8573 if (version < 140)
8574 {
8575 if (!ctx.
Read(intValue))
8576 return false;
8577
8578 m_VariablesMask = intValue;
8579 }
8580
8582 {
8583 if (!ctx.
Read(value))
8584 return false;
8585
8587 {
8589 }
8590 else
8591 {
8593 }
8594 }
8595
8596 if (version < 140)
8597 {
8599 {
8600 if (!ctx.
Read(value))
8601 return false;
8602 SetTemperatureDirect(value);
8603 }
8604 }
8605
8607 {
8608 if (!ctx.
Read(value))
8609 return false;
8611 }
8612
8614 {
8615 if (!ctx.
Read(intValue))
8616 return false;
8618 }
8619
8621 {
8622 int r,g,b,a;
8624 return false;
8626 return false;
8628 return false;
8630 return false;
8631
8633 }
8634
8636 {
8637 if (!ctx.
Read(intValue))
8638 return false;
8640 }
8641
8642 if (version >= 138 && version < 140)
8643 {
8645 {
8646 if (!ctx.
Read(intValue))
8647 return false;
8648 SetFrozen(intValue);
8649 }
8650 }
8651
8652 return true;
8653 }
8654
8655
8657 {
8660 {
8662 }
8663
8664 if (!super.OnStoreLoad(ctx, version))
8665 {
8667 return false;
8668 }
8669
8670 if (version >= 114)
8671 {
8672 bool hasQuickBarIndexSaved;
8673
8674 if (!ctx.
Read(hasQuickBarIndexSaved))
8675 {
8677 return false;
8678 }
8679
8680 if (hasQuickBarIndexSaved)
8681 {
8682 int itmQBIndex;
8683
8684
8685 if (!ctx.
Read(itmQBIndex))
8686 {
8688 return false;
8689 }
8690
8691 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8692 if (itmQBIndex != -1 && parentPlayer)
8693 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8694 }
8695 }
8696 else
8697 {
8698
8699 PlayerBase player;
8700 int itemQBIndex;
8701 if (version ==
int.
MAX)
8702 {
8703 if (!ctx.
Read(itemQBIndex))
8704 {
8706 return false;
8707 }
8708 }
8709 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8710 {
8711
8712 if (!ctx.
Read(itemQBIndex))
8713 {
8715 return false;
8716 }
8717 if (itemQBIndex != -1 && player)
8718 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8719 }
8720 }
8721
8722 if (version < 140)
8723 {
8724
8725 if (!LoadVariables(ctx, version))
8726 {
8728 return false;
8729 }
8730 }
8731
8732
8734 {
8736 return false;
8737 }
8738 if (version >= 132)
8739 {
8741 if (raib)
8742 {
8744 {
8746 return false;
8747 }
8748 }
8749 }
8750
8752 return true;
8753 }
8754
8755
8756
8758 {
8759 super.OnStoreSave(ctx);
8760
8761 PlayerBase player;
8762 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8763 {
8765
8766 int itemQBIndex = -1;
8767 itemQBIndex = player.FindQuickBarEntityIndex(this);
8768 ctx.
Write(itemQBIndex);
8769 }
8770 else
8771 {
8773 }
8774
8776
8778 if (raib)
8779 {
8781 }
8782 }
8783
8784
8786 {
8787 super.AfterStoreLoad();
8788
8790 {
8792 }
8793
8795 {
8798 }
8799 }
8800
8802 {
8803 super.EEOnAfterLoad();
8804
8806 {
8808 }
8809
8812 }
8813
8815 {
8816 return false;
8817 }
8818
8819
8820
8822 {
8824 {
8825 #ifdef PLATFORM_CONSOLE
8826
8828 {
8830 if (menu)
8831 {
8833 }
8834 }
8835 #endif
8836 }
8837
8839 {
8842 }
8843
8845 {
8846 SetWeightDirty();
8848 }
8850 {
8853 }
8854
8856 {
8859 }
8861 {
8864 }
8865
8866 super.OnVariablesSynchronized();
8867 }
8868
8869
8870
8872 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8873 {
8874 if (!IsServerCheck(allow_client))
8875 return false;
8876
8878 return false;
8879
8882
8883 if (value <= (min + 0.001))
8884 value = min;
8885
8886 if (value == min)
8887 {
8888 if (destroy_config)
8889 {
8890 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8891 if (dstr)
8892 {
8894 this.Delete();
8895 return true;
8896 }
8897 }
8898 else if (destroy_forced)
8899 {
8901 this.Delete();
8902 return true;
8903 }
8904
8906 }
8907
8910
8912 {
8914
8915 if (delta)
8917 }
8918
8920
8921 return false;
8922 }
8923
8924
8926 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8927 {
8929 }
8930
8932 {
8935 }
8936
8938 {
8941 }
8942
8945 {
8946 float value_clamped = Math.Clamp(value, 0, 1);
8948 SetQuantity(result, destroy_config, destroy_forced);
8949 }
8950
8951
8954 {
8956 }
8957
8959 {
8961 }
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8973 {
8974 int slot = -1;
8975 if (GetInventory())
8976 {
8977 InventoryLocation il = new InventoryLocation;
8978 GetInventory().GetCurrentInventoryLocation(il);
8980 }
8981
8983 }
8984
8986 {
8987 float quantity_max = 0;
8988
8990 {
8991 if (attSlotID != -1)
8992 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8993
8994 if (quantity_max <= 0)
8996 }
8997
8998 if (quantity_max <= 0)
9000
9001 return quantity_max;
9002 }
9003
9005 {
9007 }
9008
9010 {
9012 }
9013
9014
9016 {
9018 }
9019
9021 {
9023 }
9024
9026 {
9028 }
9029
9030
9032 {
9033
9034 float weightEx = GetWeightEx();
9035 float special = GetInventoryAndCargoWeight();
9036 return weightEx - special;
9037 }
9038
9039
9041 {
9043 }
9044
9046 {
9048 {
9049 #ifdef DEVELOPER
9050 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9051 {
9052 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9054 }
9055 #endif
9056
9058 }
9059 else if (HasEnergyManager())
9060 {
9061 #ifdef DEVELOPER
9062 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9063 {
9064 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9065 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9066 }
9067 #endif
9068 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9069 }
9070 else
9071 {
9072 #ifdef DEVELOPER
9073 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9074 {
9075 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9076 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9077 }
9078 #endif
9079 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9080 }
9081 }
9082
9085 {
9086 int item_count = 0;
9088
9089 if (GetInventory().GetCargo() != NULL)
9090 {
9091 item_count = GetInventory().GetCargo().GetItemCount();
9092 }
9093
9094 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9095 {
9096 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9097 if (item)
9098 item_count += item.GetNumberOfItems();
9099 }
9100 return item_count;
9101 }
9102
9105 {
9106 float weight = 0;
9107 float wetness = 1;
9108 if (include_wetness)
9111 {
9112 weight = wetness * m_ConfigWeight;
9113 }
9115 {
9116 weight = 1;
9117 }
9118 return weight;
9119 }
9120
9121
9122
9124 {
9125 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9126 {
9127 GameInventory inv = GetInventory();
9128 array<EntityAI> items = new array<EntityAI>;
9130 for (int i = 0; i < items.Count(); i++)
9131 {
9133 if (item)
9134 {
9136 }
9137 }
9138 }
9139 }
9140
9141
9142
9143
9145 {
9146 float energy = 0;
9147 if (HasEnergyManager())
9148 {
9149 energy = GetCompEM().GetEnergy();
9150 }
9151 return energy;
9152 }
9153
9154
9156 {
9157 super.OnEnergyConsumed();
9158
9160 }
9161
9163 {
9164 super.OnEnergyAdded();
9165
9167 }
9168
9169
9171 {
9172 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9173 {
9175 {
9176 float energy_0to1 = GetCompEM().GetEnergy0To1();
9178 }
9179 }
9180 }
9181
9182
9184 {
9185 return ConfigGetFloat("heatIsolation");
9186 }
9187
9189 {
9191 }
9192
9194 {
9195 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9196 if (
GetGame().ConfigIsExisting(paramPath))
9198
9199 return 0.0;
9200 }
9201
9203 {
9204 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9205 if (
GetGame().ConfigIsExisting(paramPath))
9207
9208 return 0.0;
9209 }
9210
9211 override void SetWet(
float value,
bool allow_client =
false)
9212 {
9213 if (!IsServerCheck(allow_client))
9214 return;
9215
9218
9220
9221 m_VarWet = Math.Clamp(value, min, max);
9222
9224 {
9227 }
9228 }
9229
9230 override void AddWet(
float value)
9231 {
9233 }
9234
9236 {
9238 }
9239
9241 {
9243 }
9244
9246 {
9248 }
9249
9251 {
9253 }
9254
9256 {
9258 }
9259
9261 {
9264 if (newLevel != oldLevel)
9265 {
9267 }
9268 }
9269
9271 {
9272 SetWeightDirty();
9273 }
9274
9276 {
9277 return GetWetLevelInternal(
m_VarWet);
9278 }
9279
9280
9281
9283 {
9285 }
9286
9288 {
9290 }
9291
9293 {
9295 }
9296
9298 {
9300 }
9301
9302
9303
9305 {
9306 if (ConfigIsExisting("itemModelLength"))
9307 {
9308 return ConfigGetFloat("itemModelLength");
9309 }
9310 return 0;
9311 }
9312
9314 {
9315 if (ConfigIsExisting("itemAttachOffset"))
9316 {
9317 return ConfigGetFloat("itemAttachOffset");
9318 }
9319 return 0;
9320 }
9321
9322 override void SetCleanness(
int value,
bool allow_client =
false)
9323 {
9324 if (!IsServerCheck(allow_client))
9325 return;
9326
9328
9330
9333 }
9334
9336 {
9338 }
9339
9341 {
9342 return true;
9343 }
9344
9345
9346
9347
9349 {
9351 }
9352
9354 {
9356 }
9357
9358
9359
9360
9361 override void SetColor(
int r,
int g,
int b,
int a)
9362 {
9368 }
9370 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9371 {
9376 }
9377
9379 {
9381 }
9382
9385 {
9386 int r,g,b,a;
9388 r = r/255;
9389 g = g/255;
9390 b = b/255;
9391 a = a/255;
9392 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9393 }
9394
9395
9396
9397 override void SetLiquidType(
int value,
bool allow_client =
false)
9398 {
9399 if (!IsServerCheck(allow_client))
9400 return;
9401
9406 }
9407
9409 {
9410 return ConfigGetInt("varLiquidTypeInit");
9411 }
9412
9414 {
9416 }
9417
9419 {
9421 SetFrozen(false);
9422 }
9423
9426 {
9427 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9428 }
9429
9430
9433 {
9434 PlayerBase nplayer;
9435 if (PlayerBase.CastTo(nplayer, player))
9436 {
9438
9439 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9440 }
9441 }
9442
9443
9446 {
9447 PlayerBase nplayer;
9448 if (PlayerBase.CastTo(nplayer,player))
9449 {
9450
9451 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9452
9453 }
9454
9455
9456 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9457
9458
9459 if (HasEnergyManager())
9460 {
9461 GetCompEM().UpdatePlugState();
9462 }
9463 }
9464
9465
9467 {
9468 super.OnPlacementStarted(player);
9469
9471 }
9472
9473 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9474 {
9476 {
9477 m_AdminLog.OnPlacementComplete(player,
this);
9478 }
9479
9480 super.OnPlacementComplete(player, position, orientation);
9481 }
9482
9483
9484
9485
9486
9488 {
9490 {
9491 return true;
9492 }
9493 else
9494 {
9495 return false;
9496 }
9497 }
9498
9499
9501 {
9503 {
9505 }
9506 }
9507
9508
9510 {
9512 }
9513
9515 {
9517 }
9518
9519 override void InsertAgent(
int agent,
float count = 1)
9520 {
9521 if (count < 1)
9522 return;
9523
9525 }
9526
9529 {
9531 }
9532
9533
9535 {
9537 }
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9581 {
9583 return false;
9584 return true;
9585 }
9586
9588 {
9589
9591 }
9592
9593
9596 {
9597 super.CheckForRoofLimited(timeTresholdMS);
9598
9600 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9601 {
9602 m_PreviousRoofTestTime = time;
9603 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9604 }
9605 }
9606
9607
9609 {
9611 {
9612 return 0;
9613 }
9614
9615 if (GetInventory().GetAttachmentSlotsCount() != 0)
9616 {
9617 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9618 if (filter)
9619 return filter.GetProtectionLevel(type, false, system);
9620 else
9621 return 0;
9622 }
9623
9624 string subclassPath, entryName;
9625
9626 switch (type)
9627 {
9629 entryName = "biological";
9630 break;
9632 entryName = "chemical";
9633 break;
9634 default:
9635 entryName = "biological";
9636 break;
9637 }
9638
9639 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9640
9642 }
9643
9644
9645
9648 {
9649 if (!IsMagazine())
9651
9653 }
9654
9655
9656
9657
9658
9663 {
9664 return true;
9665 }
9666
9668 {
9670 }
9671
9672
9673
9674
9675
9677 {
9678 if (parent)
9679 {
9680 if (parent.IsInherited(DayZInfected))
9681 return true;
9682
9683 if (!parent.IsRuined())
9684 return true;
9685 }
9686
9687 return true;
9688 }
9689
9691 {
9692 if (!super.CanPutAsAttachment(parent))
9693 {
9694 return false;
9695 }
9696
9697 if (!IsRuined() && !parent.IsRuined())
9698 {
9699 return true;
9700 }
9701
9702 return false;
9703 }
9704
9706 {
9707
9708
9709
9710
9711 return super.CanReceiveItemIntoCargo(item);
9712 }
9713
9715 {
9716
9717
9718
9719
9720 GameInventory attachmentInv = attachment.GetInventory();
9722 {
9723 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9724 return false;
9725 }
9726
9727 InventoryLocation loc = new InventoryLocation();
9728 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9729 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9730 return false;
9731
9732 return super.CanReceiveAttachment(attachment, slotId);
9733 }
9734
9736 {
9737 if (!super.CanReleaseAttachment(attachment))
9738 return false;
9739
9740 return GetInventory().AreChildrenAccessible();
9741 }
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9764 {
9765 int id = muzzle_owner.GetMuzzleID();
9766 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9767
9768 if (WPOF_array)
9769 {
9770 for (int i = 0; i < WPOF_array.Count(); i++)
9771 {
9772 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9773
9774 if (WPOF)
9775 {
9776 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9777 }
9778 }
9779 }
9780 }
9781
9782
9784 {
9785 int id = muzzle_owner.GetMuzzleID();
9787
9788 if (WPOBE_array)
9789 {
9790 for (int i = 0; i < WPOBE_array.Count(); i++)
9791 {
9792 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9793
9794 if (WPOBE)
9795 {
9796 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9797 }
9798 }
9799 }
9800 }
9801
9802
9804 {
9805 int id = muzzle_owner.GetMuzzleID();
9806 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9807
9808 if (WPOOH_array)
9809 {
9810 for (int i = 0; i < WPOOH_array.Count(); i++)
9811 {
9812 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9813
9814 if (WPOOH)
9815 {
9816 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9817 }
9818 }
9819 }
9820 }
9821
9822
9824 {
9825 int id = muzzle_owner.GetMuzzleID();
9826 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9827
9828 if (WPOOH_array)
9829 {
9830 for (int i = 0; i < WPOOH_array.Count(); i++)
9831 {
9832 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9833
9834 if (WPOOH)
9835 {
9836 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9837 }
9838 }
9839 }
9840 }
9841
9842
9844 {
9845 int id = muzzle_owner.GetMuzzleID();
9846 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9847
9848 if (WPOOH_array)
9849 {
9850 for (int i = 0; i < WPOOH_array.Count(); i++)
9851 {
9852 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9853
9854 if (WPOOH)
9855 {
9856 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9857 }
9858 }
9859 }
9860 }
9861
9862
9863
9865 {
9867 {
9868 return true;
9869 }
9870
9871 return false;
9872 }
9873
9875 {
9877 {
9878 return true;
9879 }
9880
9881 return false;
9882 }
9883
9885 {
9887 {
9888 return true;
9889 }
9890
9891 return false;
9892 }
9893
9895 {
9896 return false;
9897 }
9898
9901 {
9902 return UATimeSpent.DEFAULT_DEPLOY;
9903 }
9904
9905
9906
9907
9909 {
9911 SetSynchDirty();
9912 }
9913
9915 {
9917 }
9918
9919
9921 {
9922 return false;
9923 }
9924
9927 {
9928 string att_type = "None";
9929
9930 if (ConfigIsExisting("soundAttType"))
9931 {
9932 att_type = ConfigGetString("soundAttType");
9933 }
9934
9936 }
9937
9939 {
9941 }
9942
9943
9944
9945
9946
9950
9952 {
9955
9957 }
9958
9959
9961 {
9963 return;
9964
9966
9969
9972
9973 SoundParameters params = new SoundParameters();
9977 }
9978
9979
9981 {
9983 return;
9984
9986 SetSynchDirty();
9987
9990 }
9991
9992
9994 {
9996 return;
9997
9999 SetSynchDirty();
10000
10003 }
10004
10006 {
10008 }
10009
10011 {
10013 }
10014
10017 {
10018 if (!
GetGame().IsDedicatedServer())
10019 {
10020 if (ConfigIsExisting("attachSoundSet"))
10021 {
10022 string cfg_path = "";
10023 string soundset = "";
10024 string type_name =
GetType();
10025
10028 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10029 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10030
10031 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10032 {
10033 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10034 {
10035 if (cfg_slot_array[i] == slot_type)
10036 {
10037 soundset = cfg_soundset_array[i];
10038 break;
10039 }
10040 }
10041 }
10042
10043 if (soundset != "")
10044 {
10045 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10047 }
10048 }
10049 }
10050 }
10051
10053 {
10054
10055 }
10056
10057 void OnApply(PlayerBase player);
10058
10060 {
10061 return 1.0;
10062 };
10063
10065 {
10067 }
10068
10070 {
10072 }
10073
10075
10077 {
10078 SetDynamicPhysicsLifeTime(0.01);
10080 }
10081
10083 {
10084 array<string> zone_names = new array<string>;
10085 GetDamageZones(zone_names);
10086 for (int i = 0; i < zone_names.Count(); i++)
10087 {
10088 SetHealthMax(zone_names.Get(i),"Health");
10089 }
10090 SetHealthMax("","Health");
10091 }
10092
10095 {
10096 float global_health = GetHealth01("","Health");
10097 array<string> zones = new array<string>;
10098 GetDamageZones(zones);
10099
10100 for (int i = 0; i < zones.Count(); i++)
10101 {
10102 SetHealth01(zones.Get(i),"Health",global_health);
10103 }
10104 }
10105
10108 {
10109 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10110 }
10111
10113 {
10114 if (!hasRootAsPlayer)
10115 {
10116 if (refParentIB)
10117 {
10118
10119 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10120 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10121
10122 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10123 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10124
10127 }
10128 else
10129 {
10130
10133 }
10134 }
10135 }
10136
10138 {
10140 {
10141 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10142 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10143 {
10144 float heatPermCoef = 1.0;
10146 while (ent)
10147 {
10148 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10149 ent = ent.GetHierarchyParent();
10150 }
10151
10152 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10153 }
10154 }
10155 }
10156
10158 {
10159
10160 EntityAI parent = GetHierarchyParent();
10161 if (!parent)
10162 {
10163 hasParent = false;
10164 hasRootAsPlayer = false;
10165 }
10166 else
10167 {
10168 hasParent = true;
10169 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10170 refParentIB =
ItemBase.Cast(parent);
10171 }
10172 }
10173
10174 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10175 {
10176
10177 }
10178
10180 {
10181
10182 return false;
10183 }
10184
10186 {
10187
10188
10189 return false;
10190 }
10191
10193 {
10194
10195 return false;
10196 }
10197
10200 {
10201 return !GetIsFrozen() &&
IsOpen();
10202 }
10203
10205 {
10206 bool hasParent = false, hasRootAsPlayer = false;
10208
10209 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10210 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10211
10212 if (wwtu || foodDecay)
10213 {
10217
10218 if (processWetness || processTemperature || processDecay)
10219 {
10221
10222 if (processWetness)
10223 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10224
10225 if (processTemperature)
10227
10228 if (processDecay)
10229 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10230 }
10231 }
10232 }
10233
10236 {
10238 }
10239
10241 {
10244
10245 return super.GetTemperatureFreezeThreshold();
10246 }
10247
10249 {
10252
10253 return super.GetTemperatureThawThreshold();
10254 }
10255
10257 {
10260
10261 return super.GetItemOverheatThreshold();
10262 }
10263
10265 {
10267 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10268
10269 return super.GetTemperatureFreezeTime();
10270 }
10271
10273 {
10275 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10276
10277 return super.GetTemperatureThawTime();
10278 }
10279
10284
10286 {
10287 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10288 }
10289
10291 {
10292 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10293 }
10294
10297 {
10299 }
10300
10302 {
10304 }
10305
10307 {
10309 }
10310
10313 {
10314 return null;
10315 }
10316
10319 {
10320 return false;
10321 }
10322
10324 {
10326 {
10329 if (!trg)
10330 {
10332 explosive = this;
10333 }
10334
10335 explosive.PairRemote(trg);
10337
10338 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10339 trg.SetPersistentPairID(persistentID);
10340 explosive.SetPersistentPairID(persistentID);
10341
10342 return true;
10343 }
10344 return false;
10345 }
10346
10349 {
10350 float ret = 1.0;
10353 ret *= GetHealth01();
10354
10355 return ret;
10356 }
10357
10358 #ifdef DEVELOPER
10359 override void SetDebugItem()
10360 {
10361 super.SetDebugItem();
10362 _itemBase = this;
10363 }
10364
10366 {
10367 string text = super.GetDebugText();
10368
10370 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10371
10372 return text;
10373 }
10374 #endif
10375
10377 {
10378 return true;
10379 }
10380
10382
10384
10386 {
10389 }
10390
10391
10399
10415}
10416
10418{
10420 if (entity)
10421 {
10422 bool is_item = entity.IsInherited(
ItemBase);
10423 if (is_item && full_quantity)
10424 {
10427 }
10428 }
10429 else
10430 {
10432 return NULL;
10433 }
10434 return entity;
10435}
10436
10438{
10439 if (item)
10440 {
10441 if (health > 0)
10442 item.SetHealth("", "", health);
10443
10444 if (item.CanHaveTemperature())
10445 {
10447 if (item.CanFreeze())
10448 item.SetFrozen(false);
10449 }
10450
10451 if (item.HasEnergyManager())
10452 {
10453 if (quantity >= 0)
10454 {
10455 item.GetCompEM().SetEnergy0To1(quantity);
10456 }
10457 else
10458 {
10460 }
10461 }
10462 else if (item.IsMagazine())
10463 {
10464 Magazine mag = Magazine.Cast(item);
10465 if (quantity >= 0)
10466 {
10467 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10468 }
10469 else
10470 {
10472 }
10473
10474 }
10475 else
10476 {
10477 if (quantity >= 0)
10478 {
10479 item.SetQuantityNormalized(quantity, false);
10480 }
10481 else
10482 {
10484 }
10485
10486 }
10487 }
10488}
10489
10490#ifdef DEVELOPER
10492#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.