5746{
5748 {
5749 return true;
5750 }
5751};
5752
5753
5754
5756{
5760
5762
5765
5766
5767
5768
5769
5778
5784
5789
5794
5815 protected bool m_IsResultOfSplit
5816
5818
5823
5824
5825
5827
5831
5832
5833
5835
5838
5839
5840
5846
5847
5855
5858
5859
5861
5862
5864
5865
5870
5871
5876
5877
5879
5880
5882 {
5887
5888 if (!
GetGame().IsDedicatedServer())
5889 {
5891 {
5893
5895 {
5897 }
5898 }
5899
5902 }
5903
5904 m_OldLocation = null;
5905
5907 {
5909 }
5910
5911 if (ConfigIsExisting("headSelectionsToHide"))
5912 {
5915 }
5916
5918 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5919 {
5921 }
5922
5924
5925 m_IsResultOfSplit = false;
5926
5928 }
5929
5931 {
5932 super.InitItemVariables();
5933
5939 m_Count = ConfigGetInt(
"count");
5940
5943
5948
5951
5956
5968
5972
5973
5976 if (ConfigIsExisting("canBeSplit"))
5977 {
5980 }
5981
5983 if (ConfigIsExisting("itemBehaviour"))
5985
5986
5989 RegisterNetSyncVariableInt("m_VarLiquidType");
5990 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5991
5992 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5993 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5994 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5995
5996 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5997 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5998 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5999 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6000
6001 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6002 RegisterNetSyncVariableBool("m_IsTakeable");
6003 RegisterNetSyncVariableBool("m_IsHologram");
6004
6007 {
6010 }
6011
6013
6015 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6017
6018 }
6019
6021 {
6023 }
6024
6026 {
6029 {
6034 }
6035 }
6036
6037 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6038 {
6040 {
6043 }
6044
6046 }
6047
6049 {
6055 }
6056
6058
6060 {
6062
6063 if (!action)
6064 {
6065 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6066 return;
6067 }
6068
6070 if (!ai)
6071 {
6073 return;
6074 }
6075
6077 if (!action_array)
6078 {
6079 action_array = new array<ActionBase_Basic>;
6081 }
6082 if (LogManager.IsActionLogEnable())
6083 {
6084 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6085 }
6086
6087 if (action_array.Find(action) != -1)
6088 {
6089 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6090 }
6091 else
6092 {
6093 action_array.Insert(action);
6094 }
6095 }
6096
6098 {
6100 ActionBase action = player.GetActionManager().GetAction(actionName);
6103
6104 if (action_array)
6105 {
6106 action_array.RemoveItem(action);
6107 }
6108 }
6109
6110
6111
6113 {
6114 ActionOverrideData overrideData = new ActionOverrideData();
6118
6120 if (!actionMap)
6121 {
6124 }
6125
6126 actionMap.Insert(this.
Type(), overrideData);
6127
6128 }
6129
6131
6133
6134
6136 {
6139
6142
6143 string config_to_search = "CfgVehicles";
6144 string muzzle_owner_config;
6145
6147 {
6148 if (IsInherited(Weapon))
6149 config_to_search = "CfgWeapons";
6150
6151 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6152
6153 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6154
6156
6157 if (config_OnFire_subclass_count > 0)
6158 {
6159 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6160
6161 for (int i = 0; i < config_OnFire_subclass_count; i++)
6162 {
6163 string particle_class = "";
6165 string config_OnFire_entry = config_OnFire_class + particle_class;
6166 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6167 WPOF_array.Insert(WPOF);
6168 }
6169
6170
6172 }
6173 }
6174
6176 {
6177 config_to_search = "CfgWeapons";
6178 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6179
6180 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6181
6183
6184 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6185 {
6186 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6187
6188 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6189 {
6190 string particle_class2 = "";
6192 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6193 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6194 WPOBE_array.Insert(WPOBE);
6195 }
6196
6197
6199 }
6200 }
6201 }
6202
6203
6205 {
6208
6210 {
6211 string config_to_search = "CfgVehicles";
6212
6213 if (IsInherited(Weapon))
6214 config_to_search = "CfgWeapons";
6215
6216 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6217 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6218
6219 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6220 {
6221
6223
6225 {
6227 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6229 return;
6230 }
6231
6234
6235
6236
6238 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6239
6240 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6241 {
6242 string particle_class = "";
6244 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6246
6247 if (entry_type == CT_CLASS)
6248 {
6249 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6250 WPOOH_array.Insert(WPOF);
6251 }
6252 }
6253
6254
6256 }
6257 }
6258 }
6259
6261 {
6263 }
6264
6266 {
6268 {
6270
6273
6276
6277 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6278 }
6279 }
6280
6282 {
6284 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6285
6287 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6288
6290 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6291
6293 {
6295 }
6296 }
6297
6299 {
6301 }
6302
6304 {
6307 else
6309
6311 {
6314 }
6315 else
6316 {
6319
6322 }
6323
6325 }
6326
6328 {
6330 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6331 }
6332
6334 {
6336 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6338 }
6339
6341 {
6343 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6344 }
6345
6347 {
6350
6351 OverheatingParticle OP = new OverheatingParticle();
6356
6358 }
6359
6361 {
6364
6365 return -1;
6366 }
6367
6369 {
6371 {
6374
6375 for (int i = count; i > 0; --i)
6376 {
6377 int id = i - 1;
6380
6383
6384 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6385 {
6386 if (p)
6387 {
6390 }
6391 }
6392 }
6393 }
6394 }
6395
6397 {
6399 {
6401 {
6402 int id = i - 1;
6404
6405 if (OP)
6406 {
6408
6409 if (p)
6410 {
6412 }
6413
6414 delete OP;
6415 }
6416 }
6417
6420 }
6421 }
6422
6425 {
6426 return 0.0;
6427 }
6428
6429
6431 {
6432 return 250;
6433 }
6434
6436 {
6437 return 0;
6438 }
6439
6442 {
6444 return true;
6445
6446 return false;
6447 }
6448
6451 {
6454
6456 {
6458 }
6459 else
6460 {
6461
6463 }
6464
6466 }
6467
6474 {
6475 return -1;
6476 }
6477
6478
6479
6480
6482 {
6484 {
6486 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6487
6488 if (r_index >= 0)
6489 {
6490 InventoryLocation r_il = new InventoryLocation;
6491 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6492
6493 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6496 {
6497 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6498 }
6500 {
6501 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6502 }
6503
6504 }
6505
6506 player.GetHumanInventory().ClearUserReservedLocation(this);
6507 }
6508
6511 }
6512
6513
6514
6515
6517 {
6518 return ItemBase.m_DebugActionsMask;
6519 }
6520
6522 {
6523 return ItemBase.m_DebugActionsMask & mask;
6524 }
6525
6527 {
6528 ItemBase.m_DebugActionsMask = mask;
6529 }
6530
6532 {
6533 ItemBase.m_DebugActionsMask |= mask;
6534 }
6535
6537 {
6538 ItemBase.m_DebugActionsMask &= ~mask;
6539 }
6540
6542 {
6544 {
6546 }
6547 else
6548 {
6550 }
6551 }
6552
6553
6555 {
6556 if (GetEconomyProfile())
6557 {
6558 float q_max = GetEconomyProfile().GetQuantityMax();
6559 if (q_max > 0)
6560 {
6561 float q_min = GetEconomyProfile().GetQuantityMin();
6562 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6563
6565 {
6566 ComponentEnergyManager comp = GetCompEM();
6568 {
6570 }
6571 }
6573 {
6575
6576 }
6577
6578 }
6579 }
6580 }
6581
6584 {
6585 EntityAI parent = GetHierarchyParent();
6586
6587 if (parent)
6588 {
6589 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6590 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6591 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6592 }
6593 }
6594
6597 {
6598 EntityAI parent = GetHierarchyParent();
6599
6600 if (parent)
6601 {
6602 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6603 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6604 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6605 }
6606 }
6607
6609 {
6610
6611
6612
6613
6615
6617 {
6618 if (ScriptInputUserData.CanStoreInputUserData())
6619 {
6620 ScriptInputUserData ctx = new ScriptInputUserData;
6626 ctx.
Write(use_stack_max);
6629
6631 {
6632 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6633 }
6634 }
6635 }
6636 else if (!
GetGame().IsMultiplayer())
6637 {
6639 }
6640 }
6641
6643 {
6645 }
6646
6648 {
6650 }
6651
6653 {
6655 }
6656
6658 {
6659
6660 return false;
6661 }
6662
6664 {
6665 return false;
6666 }
6667
6671 {
6672 return false;
6673 }
6674
6676 {
6677 return "";
6678 }
6679
6681
6683 {
6684 return false;
6685 }
6686
6688 {
6689 return true;
6690 }
6691
6692
6693
6695 {
6696 return true;
6697 }
6698
6700 {
6701 return true;
6702 }
6703
6705 {
6706 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6708 }
6709
6711 {
6713 }
6714
6716 {
6718 if (!is_being_placed)
6720 SetSynchDirty();
6721 }
6722
6723
6725
6727 {
6729 }
6730
6732 {
6734 }
6735
6737 {
6738 return 1;
6739 }
6740
6742 {
6743 return false;
6744 }
6745
6747 {
6749 SetSynchDirty();
6750 }
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6787 {
6788 super.OnMovedInsideCargo(container);
6789
6790 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6791 }
6792
6793 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6794 {
6795 super.EEItemLocationChanged(oldLoc,newLoc);
6796
6797 PlayerBase new_player = null;
6798 PlayerBase old_player = null;
6799
6800 if (newLoc.GetParent())
6801 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6802
6803 if (oldLoc.GetParent())
6804 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6805
6807 {
6808 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6809
6810 if (r_index >= 0)
6811 {
6812 InventoryLocation r_il = new InventoryLocation;
6813 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6814
6815 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6818 {
6819 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6820 }
6822 {
6823 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6824 }
6825
6826 }
6827 }
6828
6830 {
6831 if (new_player)
6832 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6833
6834 if (new_player == old_player)
6835 {
6836
6837 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6838 {
6840 {
6841 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6842 {
6843 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6844 }
6845 }
6846 else
6847 {
6848 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6849 }
6850 }
6851
6852 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6853 {
6854 int type = oldLoc.GetType();
6856 {
6857 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6858 }
6860 {
6861 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6862 }
6863 }
6864 if (!m_OldLocation)
6865 {
6866 m_OldLocation = new InventoryLocation;
6867 }
6868 m_OldLocation.Copy(oldLoc);
6869 }
6870 else
6871 {
6872 if (m_OldLocation)
6873 {
6874 m_OldLocation.Reset();
6875 }
6876 }
6877
6879 }
6880 else
6881 {
6882 if (new_player)
6883 {
6884 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6885 if (res_index >= 0)
6886 {
6887 InventoryLocation il = new InventoryLocation;
6888 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6890 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6893 {
6894 il.
GetParent().GetOnReleaseLock().Invoke(it);
6895 }
6897 {
6899 }
6900
6901 }
6902 }
6904 {
6905
6907 }
6908
6909 if (m_OldLocation)
6910 {
6911 m_OldLocation.Reset();
6912 }
6913 }
6914 }
6915
6916 override void EOnContact(IEntity other, Contact extra)
6917 {
6919 {
6920 int liquidType = -1;
6922 if (impactSpeed > 0.0)
6923 {
6925 #ifndef SERVER
6927 #else
6929 SetSynchDirty();
6930 #endif
6932 }
6933 }
6934
6935 #ifdef SERVER
6936 if (GetCompEM() && GetCompEM().IsPlugged())
6937 {
6938 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6939 GetCompEM().UnplugThis();
6940 }
6941 #endif
6942 }
6943
6945
6947 {
6949 }
6950
6952 {
6953
6954 }
6955
6957 {
6958 super.OnItemLocationChanged(old_owner, new_owner);
6959
6960 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6961 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6962
6963 if (!relatedPlayer && playerNew)
6964 relatedPlayer = playerNew;
6965
6966 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6967 {
6969 if (actionMgr)
6970 {
6971 ActionBase currentAction = actionMgr.GetRunningAction();
6972 if (currentAction)
6974 }
6975 }
6976
6977 Man ownerPlayerOld = null;
6978 Man ownerPlayerNew = null;
6979
6980 if (old_owner)
6981 {
6982 if (old_owner.
IsMan())
6983 {
6984 ownerPlayerOld = Man.Cast(old_owner);
6985 }
6986 else
6987 {
6988 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6989 }
6990 }
6991 else
6992 {
6994 {
6996
6997 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6998 {
6999 GetCompEM().UnplugThis();
7000 }
7001 }
7002 }
7003
7004 if (new_owner)
7005 {
7006 if (new_owner.
IsMan())
7007 {
7008 ownerPlayerNew = Man.Cast(new_owner);
7009 }
7010 else
7011 {
7012 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7013 }
7014 }
7015
7016 if (ownerPlayerOld != ownerPlayerNew)
7017 {
7018 if (ownerPlayerOld)
7019 {
7020 array<EntityAI> subItemsExit = new array<EntityAI>;
7022 for (int i = 0; i < subItemsExit.Count(); i++)
7023 {
7026 }
7027 }
7028
7029 if (ownerPlayerNew)
7030 {
7031 array<EntityAI> subItemsEnter = new array<EntityAI>;
7033 for (int j = 0; j < subItemsEnter.Count(); j++)
7034 {
7037 }
7038 }
7039 }
7040 else if (ownerPlayerNew != null)
7041 {
7042 PlayerBase nplayer;
7043 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7044 {
7045 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7047 for (int k = 0; k < subItemsUpdate.Count(); k++)
7048 {
7050 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7051 }
7052 }
7053 }
7054
7055 if (old_owner)
7056 old_owner.OnChildItemRemoved(this);
7057 if (new_owner)
7058 new_owner.OnChildItemReceived(this);
7059 }
7060
7061
7063 {
7064 super.EEDelete(parent);
7065 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7066 if (player)
7067 {
7069
7070 if (player.IsAlive())
7071 {
7072 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7073 if (r_index >= 0)
7074 {
7075 InventoryLocation r_il = new InventoryLocation;
7076 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7077
7078 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7081 {
7082 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7083 }
7085 {
7086 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7087 }
7088
7089 }
7090
7091 player.RemoveQuickBarEntityShortcut(this);
7092 }
7093 }
7094 }
7095
7097 {
7098 super.EEKilled(killer);
7099
7102 {
7103 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7104 {
7105 if (IsMagazine())
7106 {
7107 if (Magazine.Cast(this).GetAmmoCount() > 0)
7108 {
7110 }
7111 }
7112 else
7113 {
7115 }
7116 }
7117 }
7118 }
7119
7121 {
7122 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7123
7124 super.OnWasAttached(parent, slot_id);
7125
7128
7130 }
7131
7133 {
7134 super.OnWasDetached(parent, slot_id);
7135
7138 }
7139
7141 {
7142 int idx;
7145
7146 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7147 if (inventory_slots.Count() < 1)
7148 {
7149 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7150 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7151 }
7152 else
7153 {
7154 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7155 }
7156
7157 idx = inventory_slots.Find(slot);
7158 if (idx < 0)
7159 return "";
7160
7161 return attach_types.Get(idx);
7162 }
7163
7165 {
7166 int idx = -1;
7167 string slot;
7168
7171
7172 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7173 if (inventory_slots.Count() < 1)
7174 {
7175 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7176 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7177 }
7178 else
7179 {
7180 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7181 if (detach_types.Count() < 1)
7182 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7183 }
7184
7185 for (int i = 0; i < inventory_slots.Count(); i++)
7186 {
7187 slot = inventory_slots.Get(i);
7188 }
7189
7190 if (slot != "")
7191 {
7192 if (detach_types.Count() == 1)
7193 idx = 0;
7194 else
7195 idx = inventory_slots.Find(slot);
7196 }
7197 if (idx < 0)
7198 return "";
7199
7200 return detach_types.Get(idx);
7201 }
7202
7204 {
7205
7207
7208
7209 float min_time = 1;
7210 float max_time = 3;
7211 float delay = Math.RandomFloat(min_time, max_time);
7212
7213 explode_timer.Run(delay, this, "DoAmmoExplosion");
7214 }
7215
7217 {
7218 Magazine magazine = Magazine.Cast(this);
7219 int pop_sounds_count = 6;
7220 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7221
7222
7223 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7224 string sound_name = pop_sounds[ sound_idx ];
7226
7227
7228 magazine.ServerAddAmmoCount(-1);
7229
7230
7231 float min_temp_to_explode = 100;
7232
7233 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7234 {
7236 }
7237 }
7238
7239
7240 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7241 {
7242 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7243
7244 const int CHANCE_DAMAGE_CARGO = 4;
7245 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7246 const int CHANCE_DAMAGE_NOTHING = 2;
7247
7249 {
7250 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7251 int chances;
7252 int rnd;
7253
7254 if (GetInventory().GetCargo())
7255 {
7256 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7257 rnd = Math.RandomInt(0,chances);
7258
7259 if (rnd < CHANCE_DAMAGE_CARGO)
7260 {
7262 }
7263 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7264 {
7266 }
7267 }
7268 else
7269 {
7270 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7271 rnd = Math.RandomInt(0,chances);
7272
7273 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7274 {
7276 }
7277 }
7278 }
7279 }
7280
7282 {
7283 if (GetInventory().GetCargo())
7284 {
7285 int item_count = GetInventory().GetCargo().GetItemCount();
7286 if (item_count > 0)
7287 {
7288 int random_pick = Math.RandomInt(0, item_count);
7290 if (!item.IsExplosive())
7291 {
7292 item.AddHealth("","",damage);
7293 return true;
7294 }
7295 }
7296 }
7297 return false;
7298 }
7299
7301 {
7302 int attachment_count = GetInventory().AttachmentCount();
7303 if (attachment_count > 0)
7304 {
7305 int random_pick = Math.RandomInt(0, attachment_count);
7306 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7307 if (!attachment.IsExplosive())
7308 {
7309 attachment.AddHealth("","",damage);
7310 return true;
7311 }
7312 }
7313 return false;
7314 }
7315
7317 {
7319 }
7320
7322 {
7324 return GetInventory().CanRemoveEntity();
7325
7326 return false;
7327 }
7328
7330 {
7332 return;
7333
7335 {
7336 if (ScriptInputUserData.CanStoreInputUserData())
7337 {
7338 ScriptInputUserData ctx = new ScriptInputUserData;
7343 ctx.
Write(destination_entity);
7347 }
7348 }
7349 else if (!
GetGame().IsMultiplayer())
7350 {
7352 }
7353 }
7354
7356 {
7358 return;
7359
7360 float split_quantity_new;
7364 InventoryLocation loc = new InventoryLocation;
7365
7366 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7367 {
7369 split_quantity_new = stack_max;
7370 else
7372
7373 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7374 if (new_item)
7375 {
7376 new_item.SetResultOfSplit(true);
7377 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7379 new_item.SetQuantity(split_quantity_new);
7380 }
7381 }
7382 else if (destination_entity && slot_id == -1)
7383 {
7384 if (quantity > stack_max)
7385 split_quantity_new = stack_max;
7386 else
7387 split_quantity_new = quantity;
7388
7390 {
7393 }
7394
7395 if (new_item)
7396 {
7397 new_item.SetResultOfSplit(true);
7398 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7400 new_item.SetQuantity(split_quantity_new);
7401 }
7402 }
7403 else
7404 {
7405 if (stack_max != 0)
7406 {
7408 {
7410 }
7411
7412 if (split_quantity_new == 0)
7413 {
7414 if (!
GetGame().IsMultiplayer())
7415 player.PhysicalPredictiveDropItem(this);
7416 else
7417 player.ServerDropEntity(this);
7418 return;
7419 }
7420
7422
7423 if (new_item)
7424 {
7425 new_item.SetResultOfSplit(true);
7426 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7428 new_item.SetQuantity(stack_max);
7429 new_item.PlaceOnSurface();
7430 }
7431 }
7432 }
7433 }
7434
7436 {
7438 return;
7439
7440 float split_quantity_new;
7444 InventoryLocation loc = new InventoryLocation;
7445
7446 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7447 {
7449 split_quantity_new = stack_max;
7450 else
7452
7453 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7454 if (new_item)
7455 {
7456 new_item.SetResultOfSplit(true);
7457 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7459 new_item.SetQuantity(split_quantity_new);
7460 }
7461 }
7462 else if (destination_entity && slot_id == -1)
7463 {
7464 if (quantity > stack_max)
7465 split_quantity_new = stack_max;
7466 else
7467 split_quantity_new = quantity;
7468
7470 {
7473 }
7474
7475 if (new_item)
7476 {
7477 new_item.SetResultOfSplit(true);
7478 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7480 new_item.SetQuantity(split_quantity_new);
7481 }
7482 }
7483 else
7484 {
7485 if (stack_max != 0)
7486 {
7488 {
7490 }
7491
7493
7494 if (new_item)
7495 {
7496 new_item.SetResultOfSplit(true);
7497 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7499 new_item.SetQuantity(stack_max);
7500 new_item.PlaceOnSurface();
7501 }
7502 }
7503 }
7504 }
7505
7507 {
7509 return;
7510
7512 {
7513 if (ScriptInputUserData.CanStoreInputUserData())
7514 {
7515 ScriptInputUserData ctx = new ScriptInputUserData;
7520 dst.WriteToContext(ctx);
7522 }
7523 }
7524 else if (!
GetGame().IsMultiplayer())
7525 {
7527 }
7528 }
7529
7531 {
7533 return;
7534
7536 {
7537 if (ScriptInputUserData.CanStoreInputUserData())
7538 {
7539 ScriptInputUserData ctx = new ScriptInputUserData;
7544 ctx.
Write(destination_entity);
7550 }
7551 }
7552 else if (!
GetGame().IsMultiplayer())
7553 {
7555 }
7556 }
7557
7559 {
7561 }
7562
7564 {
7566 return this;
7567
7569 float split_quantity_new;
7571 if (dst.IsValid())
7572 {
7573 int slot_id = dst.GetSlot();
7575
7576 if (quantity > stack_max)
7577 split_quantity_new = stack_max;
7578 else
7579 split_quantity_new = quantity;
7580
7582
7583 if (new_item)
7584 {
7585 new_item.SetResultOfSplit(true);
7586 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7589 }
7590
7591 return new_item;
7592 }
7593
7594 return null;
7595 }
7596
7598 {
7600 return;
7601
7603 float split_quantity_new;
7605 if (destination_entity)
7606 {
7608 if (quantity > stackable)
7609 split_quantity_new = stackable;
7610 else
7611 split_quantity_new = quantity;
7612
7613 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7614 if (new_item)
7615 {
7616 new_item.SetResultOfSplit(true);
7617 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7619 new_item.SetQuantity(split_quantity_new);
7620 }
7621 }
7622 }
7623
7625 {
7627 return;
7628
7630 {
7631 if (ScriptInputUserData.CanStoreInputUserData())
7632 {
7633 ScriptInputUserData ctx = new ScriptInputUserData;
7638 ItemBase destination_entity =
this;
7639 ctx.
Write(destination_entity);
7643 }
7644 }
7645 else if (!
GetGame().IsMultiplayer())
7646 {
7648 }
7649 }
7650
7652 {
7654 return;
7655
7657 float split_quantity_new;
7659 if (player)
7660 {
7662 if (quantity > stackable)
7663 split_quantity_new = stackable;
7664 else
7665 split_quantity_new = quantity;
7666
7667 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7668 new_item =
ItemBase.Cast(in_hands);
7669 if (new_item)
7670 {
7671 new_item.SetResultOfSplit(true);
7672 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7674 new_item.SetQuantity(split_quantity_new);
7675 }
7676 }
7677 }
7678
7680 {
7682 return;
7683
7685 float split_quantity_new = Math.Floor(quantity * 0.5);
7686
7688
7689 if (new_item)
7690 {
7691 if (new_item.GetQuantityMax() < split_quantity_new)
7692 {
7693 split_quantity_new = new_item.GetQuantityMax();
7694 }
7695
7696 new_item.SetResultOfSplit(true);
7697 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7698
7700 {
7703 }
7704 else
7705 {
7708 }
7709 }
7710 }
7711
7713 {
7715 return;
7716
7718 float split_quantity_new = Math.Floor(quantity / 2);
7719
7720 InventoryLocation invloc = new InventoryLocation;
7722
7724 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7725
7726 if (new_item)
7727 {
7728 if (new_item.GetQuantityMax() < split_quantity_new)
7729 {
7730 split_quantity_new = new_item.GetQuantityMax();
7731 }
7733 {
7736 }
7737 else
7738 {
7741 }
7742 }
7743 }
7744
7747 {
7748 SetWeightDirty();
7750
7751 if (parent)
7752 parent.OnAttachmentQuantityChangedEx(this, delta);
7753
7755 {
7757 {
7759 }
7761 {
7762 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7764 }
7765 }
7766
7767 }
7768
7771 {
7772
7773 }
7774
7777 {
7779 }
7780
7782 {
7783 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7784
7786 {
7787 if (newLevel == GameConstants.STATE_RUINED)
7788 {
7790 EntityAI parent = GetHierarchyParent();
7791 if (parent && parent.IsFireplace())
7792 {
7793 CargoBase cargo = GetInventory().GetCargo();
7794 if (cargo)
7795 {
7797 {
7799 }
7800 }
7801 }
7802 }
7803
7805 {
7806
7808 return;
7809 }
7810
7811 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7812 {
7814 }
7815 }
7816 }
7817
7818
7820 {
7821 super.OnRightClick();
7822
7824 {
7826 {
7827 if (ScriptInputUserData.CanStoreInputUserData())
7828 {
7829 vector m4[4];
7831
7832 EntityAI root = GetHierarchyRoot();
7833
7834 InventoryLocation dst = new InventoryLocation;
7836 {
7837 if (root)
7838 {
7839 root.GetTransform(m4);
7841 }
7842 else
7843 GetInventory().GetCurrentInventoryLocation(dst);
7844 }
7845 else
7846 {
7848
7849
7850 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7851 {
7852 if (root)
7853 {
7854 root.GetTransform(m4);
7856 }
7857 else
7858 GetInventory().GetCurrentInventoryLocation(dst);
7859 }
7860 else
7861 {
7862 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7863 }
7864 }
7865
7866 ScriptInputUserData ctx = new ScriptInputUserData;
7874 }
7875 }
7876 else if (!
GetGame().IsMultiplayer())
7877 {
7879 }
7880 }
7881 }
7882
7883 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7884 {
7885
7886 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7887 return false;
7888
7889 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7890 return false;
7891
7892
7894 return false;
7895
7896
7897 Magazine mag = Magazine.Cast(this);
7898 if (mag)
7899 {
7900 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7901 return false;
7902
7903 if (stack_max_limit)
7904 {
7905 Magazine other_mag = Magazine.Cast(other_item);
7906 if (other_item)
7907 {
7908 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7909 return false;
7910 }
7911
7912 }
7913 }
7914 else
7915 {
7916
7918 return false;
7919
7921 return false;
7922 }
7923
7924 PlayerBase player = null;
7925 if (CastTo(player, GetHierarchyRootPlayer()))
7926 {
7927 if (player.GetInventory().HasAttachment(this))
7928 return false;
7929
7930 if (player.IsItemsToDelete())
7931 return false;
7932 }
7933
7934 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7935 return false;
7936
7937 int slotID;
7939 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7940 return false;
7941
7942 return true;
7943 }
7944
7946 {
7948 }
7949
7951 {
7952 return m_IsResultOfSplit;
7953 }
7954
7956 {
7957 m_IsResultOfSplit = value;
7958 }
7959
7961 {
7963 }
7964
7966 {
7967 float other_item_quantity = other_item.GetQuantity();
7968 float this_free_space;
7969
7971
7973
7974 if (other_item_quantity > this_free_space)
7975 {
7976 return this_free_space;
7977 }
7978 else
7979 {
7980 return other_item_quantity;
7981 }
7982 }
7983
7985 {
7987 }
7988
7990 {
7992 return;
7993
7994 if (!IsMagazine() && other_item)
7995 {
7997 if (quantity_used != 0)
7998 {
7999 float hp1 = GetHealth01("","");
8000 float hp2 = other_item.GetHealth01("","");
8001 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8002 hpResult = hpResult / (
GetQuantity() + quantity_used);
8003
8004 hpResult *= GetMaxHealth();
8005 Math.Round(hpResult);
8006 SetHealth("", "Health", hpResult);
8007
8009 other_item.AddQuantity(-quantity_used);
8010 }
8011 }
8013 }
8014
8016 {
8017 #ifdef SERVER
8018 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8019 GetHierarchyParent().IncreaseLifetimeUp();
8020 #endif
8021 };
8022
8024 {
8025 PlayerBase p = PlayerBase.Cast(player);
8026
8027 array<int> recipesIds = p.m_Recipes;
8028 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8029 if (moduleRecipesManager)
8030 {
8031 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8032 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8033 }
8034
8035 for (int i = 0;i < recipesIds.Count(); i++)
8036 {
8037 int key = recipesIds.Get(i);
8038 string recipeName = moduleRecipesManager.GetRecipeName(key);
8040 }
8041 }
8042
8043
8044 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8045 {
8046 super.GetDebugActions(outputList);
8047
8048
8053
8054
8058
8062
8063
8066
8067
8069 {
8072 }
8073
8075
8078
8082 }
8083
8084
8085
8086
8088 {
8089 super.OnAction(action_id, player, ctx);
8090 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8091 {
8092 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8093 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8094 PlayerBase p = PlayerBase.Cast(player);
8095 if (
EActions.RECIPES_RANGE_START < 1000)
8096 {
8097 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8098 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8099 }
8100 }
8101 #ifndef SERVER
8102 else if (action_id ==
EActions.WATCH_PLAYER)
8103 {
8104 PluginDeveloper.SetDeveloperItemClientEx(player);
8105 }
8106 #endif
8108 {
8109 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8110 {
8111 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8112 OnDebugButtonPressServer(id + 1);
8113 }
8114
8115 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8116 {
8117 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8119 }
8120
8121 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8122 {
8123 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8125 }
8126
8127 else if (action_id ==
EActions.ADD_QUANTITY)
8128 {
8129 if (IsMagazine())
8130 {
8131 Magazine mag = Magazine.Cast(this);
8132 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8133 }
8134 else
8135 {
8137 }
8138
8139 if (m_EM)
8140 {
8141 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8142 }
8143
8144 }
8145
8146 else if (action_id ==
EActions.REMOVE_QUANTITY)
8147 {
8148 if (IsMagazine())
8149 {
8150 Magazine mag2 = Magazine.Cast(this);
8151 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8152 }
8153 else
8154 {
8156 }
8157 if (m_EM)
8158 {
8159 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8160 }
8161
8162 }
8163
8164 else if (action_id ==
EActions.SET_QUANTITY_0)
8165 {
8167
8168 if (m_EM)
8169 {
8170 m_EM.SetEnergy(0);
8171 }
8172 }
8173
8174 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8175 {
8177
8178 if (m_EM)
8179 {
8180 m_EM.SetEnergy(m_EM.GetEnergyMax());
8181 }
8182 }
8183
8184 else if (action_id ==
EActions.ADD_HEALTH)
8185 {
8186 AddHealth("","",GetMaxHealth("","Health")/5);
8187 }
8188 else if (action_id ==
EActions.REMOVE_HEALTH)
8189 {
8190 AddHealth("","",-GetMaxHealth("","Health")/5);
8191 }
8192 else if (action_id ==
EActions.DESTROY_HEALTH)
8193 {
8194 SetHealth01("","",0);
8195 }
8196 else if (action_id ==
EActions.WATCH_ITEM)
8197 {
8199 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8200 #ifdef DEVELOPER
8201 SetDebugDeveloper_item(this);
8202 #endif
8203 }
8204
8205 else if (action_id ==
EActions.ADD_TEMPERATURE)
8206 {
8207 AddTemperature(20);
8208
8209 }
8210
8211 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8212 {
8213 AddTemperature(-20);
8214
8215 }
8216
8217 else if (action_id ==
EActions.FLIP_FROZEN)
8218 {
8219 SetFrozen(!GetIsFrozen());
8220
8221 }
8222
8223 else if (action_id ==
EActions.ADD_WETNESS)
8224 {
8226
8227 }
8228
8229 else if (action_id ==
EActions.REMOVE_WETNESS)
8230 {
8232
8233 }
8234
8235 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8236 {
8239
8240
8241 }
8242
8243 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8244 {
8247 }
8248
8249 else if (action_id ==
EActions.MAKE_SPECIAL)
8250 {
8251 auto debugParams = DebugSpawnParams.WithPlayer(player);
8252 OnDebugSpawnEx(debugParams);
8253 }
8254
8255 else if (action_id ==
EActions.DELETE)
8256 {
8257 Delete();
8258 }
8259
8260 }
8261
8262
8263 return false;
8264 }
8265
8266
8267
8268
8272
8275
8276
8277
8279 {
8280 return false;
8281 }
8282
8283
8285 {
8286 return true;
8287 }
8288
8289
8291 {
8292 return true;
8293 }
8294
8295
8296
8298 {
8299 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8301 }
8302
8305 {
8306 return null;
8307 }
8308
8310 {
8311 return false;
8312 }
8313
8315 {
8316 return false;
8317 }
8318
8322
8323
8325 {
8326 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8327 return module_repairing.CanRepair(this, item_repair_kit);
8328 }
8329
8330
8331 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8332 {
8333 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8334 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8335 }
8336
8337
8339 {
8340
8341
8342
8343
8344
8345
8346
8347
8348 return 1;
8349 }
8350
8351
8352
8354 {
8356 }
8357
8358
8359
8361 {
8363 }
8364
8365
8374 {
8375 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8376
8377 if (player)
8378 {
8379 player.MessageStatus(text);
8380 }
8381 }
8382
8383
8392 {
8393 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8394
8395 if (player)
8396 {
8397 player.MessageAction(text);
8398 }
8399 }
8400
8401
8410 {
8411 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8412
8413 if (player)
8414 {
8415 player.MessageFriendly(text);
8416 }
8417 }
8418
8419
8428 {
8429 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8430
8431 if (player)
8432 {
8433 player.MessageImportant(text);
8434 }
8435 }
8436
8438 {
8439 return true;
8440 }
8441
8442
8443 override bool KindOf(
string tag)
8444 {
8445 bool found = false;
8446 string item_name = this.
GetType();
8449
8450 int array_size = item_tag_array.Count();
8451 for (int i = 0; i < array_size; i++)
8452 {
8453 if (item_tag_array.Get(i) == tag)
8454 {
8455 found = true;
8456 break;
8457 }
8458 }
8459 return found;
8460 }
8461
8462
8464 {
8465
8466 super.OnRPC(sender, rpc_type,ctx);
8467
8468
8469 switch (rpc_type)
8470 {
8471 #ifndef SERVER
8472 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8473 Param2<bool, string> p = new Param2<bool, string>(false, "");
8474
8476 return;
8477
8478 bool play = p.param1;
8479 string soundSet = p.param2;
8480
8481 if (play)
8482 {
8484 {
8486 {
8488 }
8489 }
8490 else
8491 {
8493 }
8494 }
8495 else
8496 {
8498 }
8499
8500 break;
8501 #endif
8502
8503 }
8504
8506 {
8508 }
8509 }
8510
8511
8512
8513
8515 {
8516 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8517 return plugin.GetID(
name);
8518 }
8519
8521 {
8522 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8523 return plugin.GetName(id);
8524 }
8525
8528 {
8529
8530
8531 int varFlags;
8532 if (!ctx.
Read(varFlags))
8533 return;
8534
8535 if (varFlags & ItemVariableFlags.FLOAT)
8536 {
8538 }
8539 }
8540
8542 {
8543
8544 super.SerializeNumericalVars(floats_out);
8545
8546
8547
8549 {
8551 }
8552
8554 {
8556 }
8557
8559 {
8561 }
8562
8564 {
8569 }
8570
8572 {
8574 }
8575 }
8576
8578 {
8579
8580 super.DeSerializeNumericalVars(floats);
8581
8582
8583 int index = 0;
8584 int mask = Math.Round(floats.Get(index));
8585
8586 index++;
8587
8589 {
8591 {
8593 }
8594 else
8595 {
8596 float quantity = floats.Get(index);
8598 }
8599 index++;
8600 }
8601
8603 {
8604 float wet = floats.Get(index);
8606 index++;
8607 }
8608
8610 {
8611 int liquidtype = Math.Round(floats.Get(index));
8613 index++;
8614 }
8615
8617 {
8619 index++;
8621 index++;
8623 index++;
8625 index++;
8626 }
8627
8629 {
8630 int cleanness = Math.Round(floats.Get(index));
8632 index++;
8633 }
8634 }
8635
8637 {
8638 super.WriteVarsToCTX(ctx);
8639
8640
8642 {
8644 }
8645
8647 {
8649 }
8650
8652 {
8654 }
8655
8657 {
8658 int r,g,b,a;
8664 }
8665
8667 {
8669 }
8670 }
8671
8673 {
8674 if (!super.ReadVarsFromCTX(ctx,version))
8675 return false;
8676
8677 int intValue;
8678 float value;
8679
8680 if (version < 140)
8681 {
8682 if (!ctx.
Read(intValue))
8683 return false;
8684
8685 m_VariablesMask = intValue;
8686 }
8687
8689 {
8690 if (!ctx.
Read(value))
8691 return false;
8692
8694 {
8696 }
8697 else
8698 {
8700 }
8701 }
8702
8703 if (version < 140)
8704 {
8706 {
8707 if (!ctx.
Read(value))
8708 return false;
8709 SetTemperatureDirect(value);
8710 }
8711 }
8712
8714 {
8715 if (!ctx.
Read(value))
8716 return false;
8718 }
8719
8721 {
8722 if (!ctx.
Read(intValue))
8723 return false;
8725 }
8726
8728 {
8729 int r,g,b,a;
8731 return false;
8733 return false;
8735 return false;
8737 return false;
8738
8740 }
8741
8743 {
8744 if (!ctx.
Read(intValue))
8745 return false;
8747 }
8748
8749 if (version >= 138 && version < 140)
8750 {
8752 {
8753 if (!ctx.
Read(intValue))
8754 return false;
8755 SetFrozen(intValue);
8756 }
8757 }
8758
8759 return true;
8760 }
8761
8762
8764 {
8767 {
8769 }
8770
8771 if (!super.OnStoreLoad(ctx, version))
8772 {
8774 return false;
8775 }
8776
8777 if (version >= 114)
8778 {
8779 bool hasQuickBarIndexSaved;
8780
8781 if (!ctx.
Read(hasQuickBarIndexSaved))
8782 {
8784 return false;
8785 }
8786
8787 if (hasQuickBarIndexSaved)
8788 {
8789 int itmQBIndex;
8790
8791
8792 if (!ctx.
Read(itmQBIndex))
8793 {
8795 return false;
8796 }
8797
8798 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8799 if (itmQBIndex != -1 && parentPlayer)
8800 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8801 }
8802 }
8803 else
8804 {
8805
8806 PlayerBase player;
8807 int itemQBIndex;
8808 if (version ==
int.
MAX)
8809 {
8810 if (!ctx.
Read(itemQBIndex))
8811 {
8813 return false;
8814 }
8815 }
8816 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8817 {
8818
8819 if (!ctx.
Read(itemQBIndex))
8820 {
8822 return false;
8823 }
8824 if (itemQBIndex != -1 && player)
8825 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8826 }
8827 }
8828
8829 if (version < 140)
8830 {
8831
8832 if (!LoadVariables(ctx, version))
8833 {
8835 return false;
8836 }
8837 }
8838
8839
8841 {
8843 return false;
8844 }
8845 if (version >= 132)
8846 {
8848 if (raib)
8849 {
8851 {
8853 return false;
8854 }
8855 }
8856 }
8857
8859 return true;
8860 }
8861
8862
8863
8865 {
8866 super.OnStoreSave(ctx);
8867
8868 PlayerBase player;
8869 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8870 {
8872
8873 int itemQBIndex = -1;
8874 itemQBIndex = player.FindQuickBarEntityIndex(this);
8875 ctx.
Write(itemQBIndex);
8876 }
8877 else
8878 {
8880 }
8881
8883
8885 if (raib)
8886 {
8888 }
8889 }
8890
8891
8893 {
8894 super.AfterStoreLoad();
8895
8897 {
8899 }
8900
8902 {
8905 }
8906 }
8907
8909 {
8910 super.EEOnAfterLoad();
8911
8913 {
8915 }
8916
8919 }
8920
8922 {
8923 return false;
8924 }
8925
8926
8927
8929 {
8931 {
8932 #ifdef PLATFORM_CONSOLE
8933
8935 {
8937 if (menu)
8938 {
8940 }
8941 }
8942 #endif
8943 }
8944
8946 {
8949 }
8950
8952 {
8953 SetWeightDirty();
8955 }
8957 {
8960 }
8961
8963 {
8966 }
8968 {
8971 }
8972
8973 super.OnVariablesSynchronized();
8974 }
8975
8976
8977
8979 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8980 {
8981 if (!IsServerCheck(allow_client))
8982 return false;
8983
8985 return false;
8986
8989
8990 if (value <= (min + 0.001))
8991 value = min;
8992
8993 if (value == min)
8994 {
8995 if (destroy_config)
8996 {
8997 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8998 if (dstr)
8999 {
9001 this.Delete();
9002 return true;
9003 }
9004 }
9005 else if (destroy_forced)
9006 {
9008 this.Delete();
9009 return true;
9010 }
9011
9013 }
9014
9017
9019 {
9021
9022 if (delta)
9024 }
9025
9027
9028 return false;
9029 }
9030
9031
9033 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9034 {
9036 }
9037
9039 {
9042 }
9043
9045 {
9048 }
9049
9052 {
9053 float value_clamped = Math.Clamp(value, 0, 1);
9055 SetQuantity(result, destroy_config, destroy_forced);
9056 }
9057
9058
9061 {
9063 }
9064
9066 {
9068 }
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9080 {
9081 int slot = -1;
9082 if (GetInventory())
9083 {
9084 InventoryLocation il = new InventoryLocation;
9085 GetInventory().GetCurrentInventoryLocation(il);
9087 }
9088
9090 }
9091
9093 {
9094 float quantity_max = 0;
9095
9097 {
9098 if (attSlotID != -1)
9099 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9100
9101 if (quantity_max <= 0)
9103 }
9104
9105 if (quantity_max <= 0)
9107
9108 return quantity_max;
9109 }
9110
9112 {
9114 }
9115
9117 {
9119 }
9120
9121
9123 {
9125 }
9126
9128 {
9130 }
9131
9133 {
9135 }
9136
9137
9139 {
9140
9141 float weightEx = GetWeightEx();
9142 float special = GetInventoryAndCargoWeight();
9143 return weightEx - special;
9144 }
9145
9146
9148 {
9150 }
9151
9153 {
9155 {
9156 #ifdef DEVELOPER
9157 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9158 {
9159 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9161 }
9162 #endif
9163
9165 }
9166 else if (HasEnergyManager())
9167 {
9168 #ifdef DEVELOPER
9169 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9170 {
9171 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9172 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9173 }
9174 #endif
9175 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9176 }
9177 else
9178 {
9179 #ifdef DEVELOPER
9180 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9181 {
9182 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9183 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9184 }
9185 #endif
9186 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9187 }
9188 }
9189
9192 {
9193 int item_count = 0;
9195
9196 if (GetInventory().GetCargo() != NULL)
9197 {
9198 item_count = GetInventory().GetCargo().GetItemCount();
9199 }
9200
9201 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9202 {
9203 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9204 if (item)
9205 item_count += item.GetNumberOfItems();
9206 }
9207 return item_count;
9208 }
9209
9212 {
9213 float weight = 0;
9214 float wetness = 1;
9215 if (include_wetness)
9218 {
9219 weight = wetness * m_ConfigWeight;
9220 }
9222 {
9223 weight = 1;
9224 }
9225 return weight;
9226 }
9227
9228
9229
9231 {
9232 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9233 {
9234 GameInventory inv = GetInventory();
9235 array<EntityAI> items = new array<EntityAI>;
9237 for (int i = 0; i < items.Count(); i++)
9238 {
9240 if (item)
9241 {
9243 }
9244 }
9245 }
9246 }
9247
9248
9249
9250
9252 {
9253 float energy = 0;
9254 if (HasEnergyManager())
9255 {
9256 energy = GetCompEM().GetEnergy();
9257 }
9258 return energy;
9259 }
9260
9261
9263 {
9264 super.OnEnergyConsumed();
9265
9267 }
9268
9270 {
9271 super.OnEnergyAdded();
9272
9274 }
9275
9276
9278 {
9279 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9280 {
9282 {
9283 float energy_0to1 = GetCompEM().GetEnergy0To1();
9285 }
9286 }
9287 }
9288
9289
9291 {
9292 return ConfigGetFloat("heatIsolation");
9293 }
9294
9296 {
9298 }
9299
9301 {
9302 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9303 if (
GetGame().ConfigIsExisting(paramPath))
9305
9306 return 0.0;
9307 }
9308
9310 {
9311 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9312 if (
GetGame().ConfigIsExisting(paramPath))
9314
9315 return 0.0;
9316 }
9317
9318 override void SetWet(
float value,
bool allow_client =
false)
9319 {
9320 if (!IsServerCheck(allow_client))
9321 return;
9322
9325
9327
9328 m_VarWet = Math.Clamp(value, min, max);
9329
9331 {
9334 }
9335 }
9336
9337 override void AddWet(
float value)
9338 {
9340 }
9341
9343 {
9345 }
9346
9348 {
9350 }
9351
9353 {
9355 }
9356
9358 {
9360 }
9361
9363 {
9365 }
9366
9368 {
9371 if (newLevel != oldLevel)
9372 {
9374 }
9375 }
9376
9378 {
9379 SetWeightDirty();
9380 }
9381
9383 {
9384 return GetWetLevelInternal(
m_VarWet);
9385 }
9386
9387
9388
9390 {
9392 }
9393
9395 {
9397 }
9398
9400 {
9402 }
9403
9405 {
9407 }
9408
9409
9410
9412 {
9413 if (ConfigIsExisting("itemModelLength"))
9414 {
9415 return ConfigGetFloat("itemModelLength");
9416 }
9417 return 0;
9418 }
9419
9421 {
9422 if (ConfigIsExisting("itemAttachOffset"))
9423 {
9424 return ConfigGetFloat("itemAttachOffset");
9425 }
9426 return 0;
9427 }
9428
9429 override void SetCleanness(
int value,
bool allow_client =
false)
9430 {
9431 if (!IsServerCheck(allow_client))
9432 return;
9433
9435
9437
9440 }
9441
9443 {
9445 }
9446
9448 {
9449 return true;
9450 }
9451
9452
9453
9454
9456 {
9458 }
9459
9461 {
9463 }
9464
9465
9466
9467
9468 override void SetColor(
int r,
int g,
int b,
int a)
9469 {
9475 }
9477 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9478 {
9483 }
9484
9486 {
9488 }
9489
9492 {
9493 int r,g,b,a;
9495 r = r/255;
9496 g = g/255;
9497 b = b/255;
9498 a = a/255;
9499 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9500 }
9501
9502
9503
9504 override void SetLiquidType(
int value,
bool allow_client =
false)
9505 {
9506 if (!IsServerCheck(allow_client))
9507 return;
9508
9513 }
9514
9516 {
9517 return ConfigGetInt("varLiquidTypeInit");
9518 }
9519
9521 {
9523 }
9524
9526 {
9528 SetFrozen(false);
9529 }
9530
9533 {
9534 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9535 }
9536
9537
9540 {
9541 PlayerBase nplayer;
9542 if (PlayerBase.CastTo(nplayer, player))
9543 {
9545
9546 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9547 }
9548 }
9549
9550
9553 {
9554 PlayerBase nplayer;
9555 if (PlayerBase.CastTo(nplayer,player))
9556 {
9557
9558 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9559
9560 }
9561
9562
9563 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9564
9565
9566 if (HasEnergyManager())
9567 {
9568 GetCompEM().UpdatePlugState();
9569 }
9570 }
9571
9572
9574 {
9575 super.OnPlacementStarted(player);
9576
9578 }
9579
9580 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9581 {
9583 {
9584 m_AdminLog.OnPlacementComplete(player,
this);
9585 }
9586
9587 super.OnPlacementComplete(player, position, orientation);
9588 }
9589
9590
9591
9592
9593
9595 {
9597 {
9598 return true;
9599 }
9600 else
9601 {
9602 return false;
9603 }
9604 }
9605
9606
9608 {
9610 {
9612 }
9613 }
9614
9615
9617 {
9619 }
9620
9622 {
9624 }
9625
9626 override void InsertAgent(
int agent,
float count = 1)
9627 {
9628 if (count < 1)
9629 return;
9630
9632 }
9633
9636 {
9638 }
9639
9640
9642 {
9644 }
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9688 {
9690 return false;
9691 return true;
9692 }
9693
9695 {
9696
9698 }
9699
9700
9703 {
9704 super.CheckForRoofLimited(timeTresholdMS);
9705
9707 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9708 {
9709 m_PreviousRoofTestTime = time;
9710 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9711 }
9712 }
9713
9714
9716 {
9718 {
9719 return 0;
9720 }
9721
9722 if (GetInventory().GetAttachmentSlotsCount() != 0)
9723 {
9724 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9725 if (filter)
9726 return filter.GetProtectionLevel(type, false, system);
9727 else
9728 return 0;
9729 }
9730
9731 string subclassPath, entryName;
9732
9733 switch (type)
9734 {
9736 entryName = "biological";
9737 break;
9739 entryName = "chemical";
9740 break;
9741 default:
9742 entryName = "biological";
9743 break;
9744 }
9745
9746 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9747
9749 }
9750
9751
9752
9755 {
9756 if (!IsMagazine())
9758
9760 }
9761
9762
9763
9764
9765
9770 {
9771 return true;
9772 }
9773
9775 {
9777 }
9778
9779
9780
9781
9782
9784 {
9785 if (parent)
9786 {
9787 if (parent.IsInherited(DayZInfected))
9788 return true;
9789
9790 if (!parent.IsRuined())
9791 return true;
9792 }
9793
9794 return true;
9795 }
9796
9798 {
9799 if (!super.CanPutAsAttachment(parent))
9800 {
9801 return false;
9802 }
9803
9804 if (!IsRuined() && !parent.IsRuined())
9805 {
9806 return true;
9807 }
9808
9809 return false;
9810 }
9811
9813 {
9814
9815
9816
9817
9818 return super.CanReceiveItemIntoCargo(item);
9819 }
9820
9822 {
9823
9824
9825
9826
9827 GameInventory attachmentInv = attachment.GetInventory();
9829 {
9830 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9831 return false;
9832 }
9833
9834 InventoryLocation loc = new InventoryLocation();
9835 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9836 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9837 return false;
9838
9839 return super.CanReceiveAttachment(attachment, slotId);
9840 }
9841
9843 {
9844 if (!super.CanReleaseAttachment(attachment))
9845 return false;
9846
9847 return GetInventory().AreChildrenAccessible();
9848 }
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9871 {
9872 int id = muzzle_owner.GetMuzzleID();
9873 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9874
9875 if (WPOF_array)
9876 {
9877 for (int i = 0; i < WPOF_array.Count(); i++)
9878 {
9879 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9880
9881 if (WPOF)
9882 {
9883 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9884 }
9885 }
9886 }
9887 }
9888
9889
9891 {
9892 int id = muzzle_owner.GetMuzzleID();
9894
9895 if (WPOBE_array)
9896 {
9897 for (int i = 0; i < WPOBE_array.Count(); i++)
9898 {
9899 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9900
9901 if (WPOBE)
9902 {
9903 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9904 }
9905 }
9906 }
9907 }
9908
9909
9911 {
9912 int id = muzzle_owner.GetMuzzleID();
9913 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9914
9915 if (WPOOH_array)
9916 {
9917 for (int i = 0; i < WPOOH_array.Count(); i++)
9918 {
9919 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9920
9921 if (WPOOH)
9922 {
9923 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9924 }
9925 }
9926 }
9927 }
9928
9929
9931 {
9932 int id = muzzle_owner.GetMuzzleID();
9933 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9934
9935 if (WPOOH_array)
9936 {
9937 for (int i = 0; i < WPOOH_array.Count(); i++)
9938 {
9939 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9940
9941 if (WPOOH)
9942 {
9943 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9944 }
9945 }
9946 }
9947 }
9948
9949
9951 {
9952 int id = muzzle_owner.GetMuzzleID();
9953 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9954
9955 if (WPOOH_array)
9956 {
9957 for (int i = 0; i < WPOOH_array.Count(); i++)
9958 {
9959 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9960
9961 if (WPOOH)
9962 {
9963 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9964 }
9965 }
9966 }
9967 }
9968
9969
9970
9972 {
9974 {
9975 return true;
9976 }
9977
9978 return false;
9979 }
9980
9982 {
9984 {
9985 return true;
9986 }
9987
9988 return false;
9989 }
9990
9992 {
9994 {
9995 return true;
9996 }
9997
9998 return false;
9999 }
10000
10002 {
10003 return false;
10004 }
10005
10008 {
10009 return UATimeSpent.DEFAULT_DEPLOY;
10010 }
10011
10012
10013
10014
10016 {
10018 SetSynchDirty();
10019 }
10020
10022 {
10024 }
10025
10026
10028 {
10029 return false;
10030 }
10031
10034 {
10035 string att_type = "None";
10036
10037 if (ConfigIsExisting("soundAttType"))
10038 {
10039 att_type = ConfigGetString("soundAttType");
10040 }
10041
10043 }
10044
10046 {
10048 }
10049
10050
10051
10052
10053
10057
10059 {
10062
10064 }
10065
10066
10068 {
10070 return;
10071
10073
10076
10079
10080 SoundParameters params = new SoundParameters();
10084 }
10085
10086
10088 {
10090 return;
10091
10093 SetSynchDirty();
10094
10097 }
10098
10099
10101 {
10103 return;
10104
10106 SetSynchDirty();
10107
10110 }
10111
10113 {
10115 }
10116
10118 {
10120 }
10121
10124 {
10125 if (!
GetGame().IsDedicatedServer())
10126 {
10127 if (ConfigIsExisting("attachSoundSet"))
10128 {
10129 string cfg_path = "";
10130 string soundset = "";
10131 string type_name =
GetType();
10132
10135 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10136 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10137
10138 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10139 {
10140 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10141 {
10142 if (cfg_slot_array[i] == slot_type)
10143 {
10144 soundset = cfg_soundset_array[i];
10145 break;
10146 }
10147 }
10148 }
10149
10150 if (soundset != "")
10151 {
10152 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10154 }
10155 }
10156 }
10157 }
10158
10160 {
10161
10162 }
10163
10164 void OnApply(PlayerBase player);
10165
10167 {
10168 return 1.0;
10169 };
10170
10172 {
10174 }
10175
10177 {
10179 }
10180
10182
10184 {
10185 SetDynamicPhysicsLifeTime(0.01);
10187 }
10188
10190 {
10191 array<string> zone_names = new array<string>;
10192 GetDamageZones(zone_names);
10193 for (int i = 0; i < zone_names.Count(); i++)
10194 {
10195 SetHealthMax(zone_names.Get(i),"Health");
10196 }
10197 SetHealthMax("","Health");
10198 }
10199
10202 {
10203 float global_health = GetHealth01("","Health");
10204 array<string> zones = new array<string>;
10205 GetDamageZones(zones);
10206
10207 for (int i = 0; i < zones.Count(); i++)
10208 {
10209 SetHealth01(zones.Get(i),"Health",global_health);
10210 }
10211 }
10212
10215 {
10216 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10217 }
10218
10220 {
10221 if (!hasRootAsPlayer)
10222 {
10223 if (refParentIB)
10224 {
10225
10226 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10227 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10228
10229 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10230 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10231
10234 }
10235 else
10236 {
10237
10240 }
10241 }
10242 }
10243
10245 {
10247 {
10248 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10249 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10250 {
10251 float heatPermCoef = 1.0;
10253 while (ent)
10254 {
10255 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10256 ent = ent.GetHierarchyParent();
10257 }
10258
10259 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10260 }
10261 }
10262 }
10263
10265 {
10266
10267 EntityAI parent = GetHierarchyParent();
10268 if (!parent)
10269 {
10270 hasParent = false;
10271 hasRootAsPlayer = false;
10272 }
10273 else
10274 {
10275 hasParent = true;
10276 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10277 refParentIB =
ItemBase.Cast(parent);
10278 }
10279 }
10280
10281 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10282 {
10283
10284 }
10285
10287 {
10288
10289 return false;
10290 }
10291
10293 {
10294
10295
10296 return false;
10297 }
10298
10300 {
10301
10302 return false;
10303 }
10304
10307 {
10308 return !GetIsFrozen() &&
IsOpen();
10309 }
10310
10312 {
10313 bool hasParent = false, hasRootAsPlayer = false;
10315
10316 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10317 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10318
10319 if (wwtu || foodDecay)
10320 {
10324
10325 if (processWetness || processTemperature || processDecay)
10326 {
10328
10329 if (processWetness)
10330 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10331
10332 if (processTemperature)
10334
10335 if (processDecay)
10336 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10337 }
10338 }
10339 }
10340
10343 {
10345 }
10346
10348 {
10351
10352 return super.GetTemperatureFreezeThreshold();
10353 }
10354
10356 {
10359
10360 return super.GetTemperatureThawThreshold();
10361 }
10362
10364 {
10367
10368 return super.GetItemOverheatThreshold();
10369 }
10370
10372 {
10374 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10375
10376 return super.GetTemperatureFreezeTime();
10377 }
10378
10380 {
10382 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10383
10384 return super.GetTemperatureThawTime();
10385 }
10386
10391
10393 {
10394 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10395 }
10396
10398 {
10399 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10400 }
10401
10404 {
10406 }
10407
10409 {
10411 }
10412
10414 {
10416 }
10417
10420 {
10421 return null;
10422 }
10423
10426 {
10427 return false;
10428 }
10429
10431 {
10433 {
10436 if (!trg)
10437 {
10439 explosive = this;
10440 }
10441
10442 explosive.PairRemote(trg);
10444
10445 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10446 trg.SetPersistentPairID(persistentID);
10447 explosive.SetPersistentPairID(persistentID);
10448
10449 return true;
10450 }
10451 return false;
10452 }
10453
10456 {
10457 float ret = 1.0;
10460 ret *= GetHealth01();
10461
10462 return ret;
10463 }
10464
10465 #ifdef DEVELOPER
10466 override void SetDebugItem()
10467 {
10468 super.SetDebugItem();
10469 _itemBase = this;
10470 }
10471
10473 {
10474 string text = super.GetDebugText();
10475
10477 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10478
10479 return text;
10480 }
10481 #endif
10482
10484 {
10485 return true;
10486 }
10487
10489
10491
10493 {
10496 }
10497
10498
10506
10522}
10523
10525{
10527 if (entity)
10528 {
10529 bool is_item = entity.IsInherited(
ItemBase);
10530 if (is_item && full_quantity)
10531 {
10534 }
10535 }
10536 else
10537 {
10539 return NULL;
10540 }
10541 return entity;
10542}
10543
10545{
10546 if (item)
10547 {
10548 if (health > 0)
10549 item.SetHealth("", "", health);
10550
10551 if (item.CanHaveTemperature())
10552 {
10554 if (item.CanFreeze())
10555 item.SetFrozen(false);
10556 }
10557
10558 if (item.HasEnergyManager())
10559 {
10560 if (quantity >= 0)
10561 {
10562 item.GetCompEM().SetEnergy0To1(quantity);
10563 }
10564 else
10565 {
10567 }
10568 }
10569 else if (item.IsMagazine())
10570 {
10571 Magazine mag = Magazine.Cast(item);
10572 if (quantity >= 0)
10573 {
10574 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10575 }
10576 else
10577 {
10579 }
10580
10581 }
10582 else
10583 {
10584 if (quantity >= 0)
10585 {
10586 item.SetQuantityNormalized(quantity, false);
10587 }
10588 else
10589 {
10591 }
10592
10593 }
10594 }
10595}
10596
10597#ifdef DEVELOPER
10599#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.