7693{
7695 {
7696 return true;
7697 }
7698};
7699
7700
7701
7703{
7707
7709
7712
7713
7714
7715
7716
7725
7731
7736
7741
7762 protected bool m_IsResultOfSplit
7763
7765
7770
7771
7772
7774
7778
7779
7780
7782
7785
7786
7787
7793
7794
7802
7805
7806
7808
7809
7811
7812
7817
7818
7823
7824
7826
7827
7829 {
7834
7835 if (!
GetGame().IsDedicatedServer())
7836 {
7838 {
7840
7842 {
7844 }
7845 }
7846
7849 }
7850
7851 m_OldLocation = null;
7852
7854 {
7856 }
7857
7858 if (ConfigIsExisting("headSelectionsToHide"))
7859 {
7862 }
7863
7865 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7866 {
7868 }
7869
7871
7872 m_IsResultOfSplit = false;
7873
7875 }
7876
7878 {
7879 super.InitItemVariables();
7880
7886 m_Count = ConfigGetInt(
"count");
7887
7890
7895
7898
7903
7915
7919
7920
7923 if (ConfigIsExisting("canBeSplit"))
7924 {
7927 }
7928
7930 if (ConfigIsExisting("itemBehaviour"))
7932
7933
7936 RegisterNetSyncVariableInt("m_VarLiquidType");
7937 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7938
7939 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7940 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7941 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7942
7943 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7944 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7945 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7946 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7947
7948 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7949 RegisterNetSyncVariableBool("m_IsTakeable");
7950 RegisterNetSyncVariableBool("m_IsHologram");
7951
7954 {
7957 }
7958
7960
7962 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7964
7965 }
7966
7968 {
7970 }
7971
7973 {
7976 {
7981 }
7982 }
7983
7984 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7985 {
7987 {
7990 }
7991
7993 }
7994
7996 {
8002 }
8003
8005
8007 {
8009
8010 if (!action)
8011 {
8012 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8013 return;
8014 }
8015
8017 if (!ai)
8018 {
8020 return;
8021 }
8022
8024 if (!action_array)
8025 {
8026 action_array = new array<ActionBase_Basic>;
8028 }
8029 if (LogManager.IsActionLogEnable())
8030 {
8031 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8032 }
8033
8034 if (action_array.Find(action) != -1)
8035 {
8036 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8037 }
8038 else
8039 {
8040 action_array.Insert(action);
8041 }
8042 }
8043
8045 {
8047 ActionBase action = player.GetActionManager().GetAction(actionName);
8050
8051 if (action_array)
8052 {
8053 action_array.RemoveItem(action);
8054 }
8055 }
8056
8057
8058
8060 {
8061 ActionOverrideData overrideData = new ActionOverrideData();
8065
8067 if (!actionMap)
8068 {
8071 }
8072
8073 actionMap.Insert(this.
Type(), overrideData);
8074
8075 }
8076
8078
8080
8081
8083 {
8086
8089
8090 string config_to_search = "CfgVehicles";
8091 string muzzle_owner_config;
8092
8094 {
8095 if (IsInherited(Weapon))
8096 config_to_search = "CfgWeapons";
8097
8098 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8099
8100 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8101
8103
8104 if (config_OnFire_subclass_count > 0)
8105 {
8106 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8107
8108 for (int i = 0; i < config_OnFire_subclass_count; i++)
8109 {
8110 string particle_class = "";
8112 string config_OnFire_entry = config_OnFire_class + particle_class;
8113 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8114 WPOF_array.Insert(WPOF);
8115 }
8116
8117
8119 }
8120 }
8121
8123 {
8124 config_to_search = "CfgWeapons";
8125 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8126
8127 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8128
8130
8131 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8132 {
8133 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8134
8135 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8136 {
8137 string particle_class2 = "";
8139 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8140 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8141 WPOBE_array.Insert(WPOBE);
8142 }
8143
8144
8146 }
8147 }
8148 }
8149
8150
8152 {
8155
8157 {
8158 string config_to_search = "CfgVehicles";
8159
8160 if (IsInherited(Weapon))
8161 config_to_search = "CfgWeapons";
8162
8163 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8164 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8165
8166 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8167 {
8168
8170
8172 {
8174 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8176 return;
8177 }
8178
8181
8182
8183
8185 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8186
8187 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8188 {
8189 string particle_class = "";
8191 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8193
8194 if (entry_type == CT_CLASS)
8195 {
8196 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8197 WPOOH_array.Insert(WPOF);
8198 }
8199 }
8200
8201
8203 }
8204 }
8205 }
8206
8208 {
8210 }
8211
8213 {
8215 {
8217
8220
8223
8224 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8225 }
8226 }
8227
8229 {
8231 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8232
8234 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8235
8237 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8238
8240 {
8242 }
8243 }
8244
8246 {
8248 }
8249
8251 {
8254 else
8256
8258 {
8261 }
8262 else
8263 {
8266
8269 }
8270
8272 }
8273
8275 {
8277 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8278 }
8279
8281 {
8283 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8285 }
8286
8288 {
8290 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8291 }
8292
8294 {
8297
8298 OverheatingParticle OP = new OverheatingParticle();
8303
8305 }
8306
8308 {
8311
8312 return -1;
8313 }
8314
8316 {
8318 {
8321
8322 for (int i = count; i > 0; --i)
8323 {
8324 int id = i - 1;
8327
8330
8331 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8332 {
8333 if (p)
8334 {
8337 }
8338 }
8339 }
8340 }
8341 }
8342
8344 {
8346 {
8348 {
8349 int id = i - 1;
8351
8352 if (OP)
8353 {
8355
8356 if (p)
8357 {
8359 }
8360
8361 delete OP;
8362 }
8363 }
8364
8367 }
8368 }
8369
8372 {
8373 return 0.0;
8374 }
8375
8376
8378 {
8379 return 250;
8380 }
8381
8383 {
8384 return 0;
8385 }
8386
8389 {
8391 return true;
8392
8393 return false;
8394 }
8395
8398 {
8401
8403 {
8405 }
8406 else
8407 {
8408
8410 }
8411
8413 }
8414
8421 {
8422 return -1;
8423 }
8424
8425
8426
8427
8429 {
8431 {
8433 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8434
8435 if (r_index >= 0)
8436 {
8437 InventoryLocation r_il = new InventoryLocation;
8438 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8439
8440 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8443 {
8444 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8445 }
8447 {
8448 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8449 }
8450
8451 }
8452
8453 player.GetHumanInventory().ClearUserReservedLocation(this);
8454 }
8455
8458 }
8459
8460
8461
8462
8464 {
8465 return ItemBase.m_DebugActionsMask;
8466 }
8467
8469 {
8470 return ItemBase.m_DebugActionsMask & mask;
8471 }
8472
8474 {
8475 ItemBase.m_DebugActionsMask = mask;
8476 }
8477
8479 {
8480 ItemBase.m_DebugActionsMask |= mask;
8481 }
8482
8484 {
8485 ItemBase.m_DebugActionsMask &= ~mask;
8486 }
8487
8489 {
8491 {
8493 }
8494 else
8495 {
8497 }
8498 }
8499
8500
8502 {
8503 if (GetEconomyProfile())
8504 {
8505 float q_max = GetEconomyProfile().GetQuantityMax();
8506 if (q_max > 0)
8507 {
8508 float q_min = GetEconomyProfile().GetQuantityMin();
8509 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8510
8512 {
8513 ComponentEnergyManager comp = GetCompEM();
8515 {
8517 }
8518 }
8520 {
8522
8523 }
8524
8525 }
8526 }
8527 }
8528
8531 {
8532 EntityAI parent = GetHierarchyParent();
8533
8534 if (parent)
8535 {
8536 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8537 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8538 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8539 }
8540 }
8541
8544 {
8545 EntityAI parent = GetHierarchyParent();
8546
8547 if (parent)
8548 {
8549 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8550 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8551 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8552 }
8553 }
8554
8556 {
8557
8558
8559
8560
8562
8564 {
8565 if (ScriptInputUserData.CanStoreInputUserData())
8566 {
8567 ScriptInputUserData ctx = new ScriptInputUserData;
8573 ctx.
Write(use_stack_max);
8576
8578 {
8579 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8580 }
8581 }
8582 }
8583 else if (!
GetGame().IsMultiplayer())
8584 {
8586 }
8587 }
8588
8590 {
8592 }
8593
8595 {
8597 }
8598
8600 {
8602 }
8603
8605 {
8606
8607 return false;
8608 }
8609
8611 {
8612 return false;
8613 }
8614
8618 {
8619 return false;
8620 }
8621
8623 {
8624 return "";
8625 }
8626
8628
8630 {
8631 return false;
8632 }
8633
8635 {
8636 return true;
8637 }
8638
8639
8640
8642 {
8643 return true;
8644 }
8645
8647 {
8648 return true;
8649 }
8650
8652 {
8653 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8655 }
8656
8658 {
8660 }
8661
8663 {
8665 if (!is_being_placed)
8667 SetSynchDirty();
8668 }
8669
8670
8672
8674 {
8676 }
8677
8679 {
8681 }
8682
8684 {
8685 return 1;
8686 }
8687
8689 {
8690 return false;
8691 }
8692
8694 {
8696 SetSynchDirty();
8697 }
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8734 {
8735 super.OnMovedInsideCargo(container);
8736
8737 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8738 }
8739
8740 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8741 {
8742 super.EEItemLocationChanged(oldLoc,newLoc);
8743
8744 PlayerBase new_player = null;
8745 PlayerBase old_player = null;
8746
8747 if (newLoc.GetParent())
8748 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8749
8750 if (oldLoc.GetParent())
8751 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8752
8754 {
8755 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8756
8757 if (r_index >= 0)
8758 {
8759 InventoryLocation r_il = new InventoryLocation;
8760 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8761
8762 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8765 {
8766 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8767 }
8769 {
8770 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8771 }
8772
8773 }
8774 }
8775
8777 {
8778 if (new_player)
8779 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8780
8781 if (new_player == old_player)
8782 {
8783
8784 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8785 {
8787 {
8788 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8789 {
8790 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8791 }
8792 }
8793 else
8794 {
8795 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8796 }
8797 }
8798
8799 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8800 {
8801 int type = oldLoc.GetType();
8803 {
8804 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8805 }
8807 {
8808 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8809 }
8810 }
8811 if (!m_OldLocation)
8812 {
8813 m_OldLocation = new InventoryLocation;
8814 }
8815 m_OldLocation.Copy(oldLoc);
8816 }
8817 else
8818 {
8819 if (m_OldLocation)
8820 {
8821 m_OldLocation.Reset();
8822 }
8823 }
8824
8826 }
8827 else
8828 {
8829 if (new_player)
8830 {
8831 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8832 if (res_index >= 0)
8833 {
8834 InventoryLocation il = new InventoryLocation;
8835 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8837 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8840 {
8841 il.
GetParent().GetOnReleaseLock().Invoke(it);
8842 }
8844 {
8846 }
8847
8848 }
8849 }
8851 {
8852
8854 }
8855
8856 if (m_OldLocation)
8857 {
8858 m_OldLocation.Reset();
8859 }
8860 }
8861 }
8862
8863 override void EOnContact(IEntity other, Contact extra)
8864 {
8866 {
8867 int liquidType = -1;
8869 if (impactSpeed > 0.0)
8870 {
8872 #ifndef SERVER
8874 #else
8876 SetSynchDirty();
8877 #endif
8879 }
8880 }
8881
8882 #ifdef SERVER
8883 if (GetCompEM() && GetCompEM().IsPlugged())
8884 {
8885 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8886 GetCompEM().UnplugThis();
8887 }
8888 #endif
8889 }
8890
8892
8894 {
8896 }
8897
8899 {
8900
8901 }
8902
8904 {
8905 super.OnItemLocationChanged(old_owner, new_owner);
8906
8907 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8908 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8909
8910 if (!relatedPlayer && playerNew)
8911 relatedPlayer = playerNew;
8912
8913 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8914 {
8916 if (actionMgr)
8917 {
8918 ActionBase currentAction = actionMgr.GetRunningAction();
8919 if (currentAction)
8921 }
8922 }
8923
8924 Man ownerPlayerOld = null;
8925 Man ownerPlayerNew = null;
8926
8927 if (old_owner)
8928 {
8929 if (old_owner.
IsMan())
8930 {
8931 ownerPlayerOld = Man.Cast(old_owner);
8932 }
8933 else
8934 {
8935 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8936 }
8937 }
8938 else
8939 {
8941 {
8943
8944 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8945 {
8946 GetCompEM().UnplugThis();
8947 }
8948 }
8949 }
8950
8951 if (new_owner)
8952 {
8953 if (new_owner.
IsMan())
8954 {
8955 ownerPlayerNew = Man.Cast(new_owner);
8956 }
8957 else
8958 {
8959 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8960 }
8961 }
8962
8963 if (ownerPlayerOld != ownerPlayerNew)
8964 {
8965 if (ownerPlayerOld)
8966 {
8967 array<EntityAI> subItemsExit = new array<EntityAI>;
8969 for (int i = 0; i < subItemsExit.Count(); i++)
8970 {
8973 }
8974 }
8975
8976 if (ownerPlayerNew)
8977 {
8978 array<EntityAI> subItemsEnter = new array<EntityAI>;
8980 for (int j = 0; j < subItemsEnter.Count(); j++)
8981 {
8984 }
8985 }
8986 }
8987 else if (ownerPlayerNew != null)
8988 {
8989 PlayerBase nplayer;
8990 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8991 {
8992 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8994 for (int k = 0; k < subItemsUpdate.Count(); k++)
8995 {
8997 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8998 }
8999 }
9000 }
9001
9002 if (old_owner)
9003 old_owner.OnChildItemRemoved(this);
9004 if (new_owner)
9005 new_owner.OnChildItemReceived(this);
9006 }
9007
9008
9010 {
9011 super.EEDelete(parent);
9012 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9013 if (player)
9014 {
9016
9017 if (player.IsAlive())
9018 {
9019 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9020 if (r_index >= 0)
9021 {
9022 InventoryLocation r_il = new InventoryLocation;
9023 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9024
9025 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9028 {
9029 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9030 }
9032 {
9033 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9034 }
9035
9036 }
9037
9038 player.RemoveQuickBarEntityShortcut(this);
9039 }
9040 }
9041 }
9042
9044 {
9045 super.EEKilled(killer);
9046
9049 {
9050 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9051 {
9052 if (IsMagazine())
9053 {
9054 if (Magazine.Cast(this).GetAmmoCount() > 0)
9055 {
9057 }
9058 }
9059 else
9060 {
9062 }
9063 }
9064 }
9065 }
9066
9068 {
9069 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9070
9071 super.OnWasAttached(parent, slot_id);
9072
9075
9077 }
9078
9080 {
9081 super.OnWasDetached(parent, slot_id);
9082
9085 }
9086
9088 {
9089 int idx;
9092
9093 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9094 if (inventory_slots.Count() < 1)
9095 {
9096 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9097 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9098 }
9099 else
9100 {
9101 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9102 }
9103
9104 idx = inventory_slots.Find(slot);
9105 if (idx < 0)
9106 return "";
9107
9108 return attach_types.Get(idx);
9109 }
9110
9112 {
9113 int idx = -1;
9114 string slot;
9115
9118
9119 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9120 if (inventory_slots.Count() < 1)
9121 {
9122 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9123 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9124 }
9125 else
9126 {
9127 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9128 if (detach_types.Count() < 1)
9129 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9130 }
9131
9132 for (int i = 0; i < inventory_slots.Count(); i++)
9133 {
9134 slot = inventory_slots.Get(i);
9135 }
9136
9137 if (slot != "")
9138 {
9139 if (detach_types.Count() == 1)
9140 idx = 0;
9141 else
9142 idx = inventory_slots.Find(slot);
9143 }
9144 if (idx < 0)
9145 return "";
9146
9147 return detach_types.Get(idx);
9148 }
9149
9151 {
9152
9154
9155
9156 float min_time = 1;
9157 float max_time = 3;
9158 float delay = Math.RandomFloat(min_time, max_time);
9159
9160 explode_timer.Run(delay, this, "DoAmmoExplosion");
9161 }
9162
9164 {
9165 Magazine magazine = Magazine.Cast(this);
9166 int pop_sounds_count = 6;
9167 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9168
9169
9170 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9171 string sound_name = pop_sounds[ sound_idx ];
9173
9174
9175 magazine.ServerAddAmmoCount(-1);
9176
9177
9178 float min_temp_to_explode = 100;
9179
9180 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9181 {
9183 }
9184 }
9185
9186
9187 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9188 {
9189 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9190
9191 const int CHANCE_DAMAGE_CARGO = 4;
9192 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9193 const int CHANCE_DAMAGE_NOTHING = 2;
9194
9196 {
9197 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9198 int chances;
9199 int rnd;
9200
9201 if (GetInventory().GetCargo())
9202 {
9203 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9204 rnd = Math.RandomInt(0,chances);
9205
9206 if (rnd < CHANCE_DAMAGE_CARGO)
9207 {
9209 }
9210 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9211 {
9213 }
9214 }
9215 else
9216 {
9217 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9218 rnd = Math.RandomInt(0,chances);
9219
9220 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9221 {
9223 }
9224 }
9225 }
9226 }
9227
9229 {
9230 if (GetInventory().GetCargo())
9231 {
9232 int item_count = GetInventory().GetCargo().GetItemCount();
9233 if (item_count > 0)
9234 {
9235 int random_pick = Math.RandomInt(0, item_count);
9237 if (!item.IsExplosive())
9238 {
9239 item.AddHealth("","",damage);
9240 return true;
9241 }
9242 }
9243 }
9244 return false;
9245 }
9246
9248 {
9249 int attachment_count = GetInventory().AttachmentCount();
9250 if (attachment_count > 0)
9251 {
9252 int random_pick = Math.RandomInt(0, attachment_count);
9253 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9254 if (!attachment.IsExplosive())
9255 {
9256 attachment.AddHealth("","",damage);
9257 return true;
9258 }
9259 }
9260 return false;
9261 }
9262
9264 {
9266 }
9267
9269 {
9271 return GetInventory().CanRemoveEntity();
9272
9273 return false;
9274 }
9275
9277 {
9278
9280 return false;
9281
9282
9284 return false;
9285
9286
9287
9289 if (delta == 0)
9290 return false;
9291
9292
9293 return true;
9294 }
9295
9297 {
9299 {
9300 if (ScriptInputUserData.CanStoreInputUserData())
9301 {
9302 ScriptInputUserData ctx = new ScriptInputUserData;
9307 ctx.
Write(destination_entity);
9311 }
9312 }
9313 else if (!
GetGame().IsMultiplayer())
9314 {
9316 }
9317 }
9318
9320 {
9321 float split_quantity_new;
9325 InventoryLocation loc = new InventoryLocation;
9326
9327 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9328 {
9330 split_quantity_new = stack_max;
9331 else
9333
9335 {
9336 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9337 if (new_item)
9338 {
9339 new_item.SetResultOfSplit(true);
9340 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9342 new_item.
SetQuantity(split_quantity_new,
false,
true);
9343 }
9344 }
9345 }
9346 else if (destination_entity && slot_id == -1)
9347 {
9348 if (quantity > stack_max)
9349 split_quantity_new = stack_max;
9350 else
9351 split_quantity_new = quantity;
9352
9354 {
9356 {
9359 }
9360
9361 if (new_item)
9362 {
9363 new_item.SetResultOfSplit(true);
9364 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9366 new_item.
SetQuantity(split_quantity_new,
false,
true);
9367 }
9368 }
9369 }
9370 else
9371 {
9372 if (stack_max != 0)
9373 {
9375 {
9377 }
9378
9379 if (split_quantity_new == 0)
9380 {
9381 if (!
GetGame().IsMultiplayer())
9382 player.PhysicalPredictiveDropItem(this);
9383 else
9384 player.ServerDropEntity(this);
9385 return;
9386 }
9387
9389 {
9391
9392 if (new_item)
9393 {
9394 new_item.SetResultOfSplit(true);
9395 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9398 new_item.PlaceOnSurface();
9399 }
9400 }
9401 }
9402 }
9403 }
9404
9406 {
9407 float split_quantity_new;
9411 InventoryLocation loc = new InventoryLocation;
9412
9413 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9414 {
9416 split_quantity_new = stack_max;
9417 else
9419
9421 {
9422 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9423 if (new_item)
9424 {
9425 new_item.SetResultOfSplit(true);
9426 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9428 new_item.
SetQuantity(split_quantity_new,
false,
true);
9429 }
9430 }
9431 }
9432 else if (destination_entity && slot_id == -1)
9433 {
9434 if (quantity > stack_max)
9435 split_quantity_new = stack_max;
9436 else
9437 split_quantity_new = quantity;
9438
9440 {
9442 {
9445 }
9446
9447 if (new_item)
9448 {
9449 new_item.SetResultOfSplit(true);
9450 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9452 new_item.
SetQuantity(split_quantity_new,
false,
true);
9453 }
9454 }
9455 }
9456 else
9457 {
9458 if (stack_max != 0)
9459 {
9461 {
9463 }
9464
9466 {
9468
9469 if (new_item)
9470 {
9471 new_item.SetResultOfSplit(true);
9472 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9475 new_item.PlaceOnSurface();
9476 }
9477 }
9478 }
9479 }
9480 }
9481
9483 {
9485 {
9486 if (ScriptInputUserData.CanStoreInputUserData())
9487 {
9488 ScriptInputUserData ctx = new ScriptInputUserData;
9493 dst.WriteToContext(ctx);
9495 }
9496 }
9497 else if (!
GetGame().IsMultiplayer())
9498 {
9500 }
9501 }
9502
9504 {
9506 {
9507 if (ScriptInputUserData.CanStoreInputUserData())
9508 {
9509 ScriptInputUserData ctx = new ScriptInputUserData;
9514 ctx.
Write(destination_entity);
9520 }
9521 }
9522 else if (!
GetGame().IsMultiplayer())
9523 {
9525 }
9526 }
9527
9529 {
9531 }
9532
9534 {
9536 float split_quantity_new;
9538 if (dst.IsValid())
9539 {
9540 int slot_id = dst.GetSlot();
9542
9543 if (quantity > stack_max)
9544 split_quantity_new = stack_max;
9545 else
9546 split_quantity_new = quantity;
9547
9549 {
9551
9552 if (new_item)
9553 {
9554 new_item.SetResultOfSplit(true);
9555 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9557 new_item.
SetQuantity(split_quantity_new,
false,
true);
9558 }
9559
9560 return new_item;
9561 }
9562 }
9563
9564 return null;
9565 }
9566
9568 {
9570 float split_quantity_new;
9572 if (destination_entity)
9573 {
9575 if (quantity > stackable)
9576 split_quantity_new = stackable;
9577 else
9578 split_quantity_new = quantity;
9579
9581 {
9582 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9583 if (new_item)
9584 {
9585 new_item.SetResultOfSplit(true);
9586 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9588 new_item.
SetQuantity(split_quantity_new,
false,
true);
9589 }
9590 }
9591 }
9592 }
9593
9595 {
9597 {
9598 if (ScriptInputUserData.CanStoreInputUserData())
9599 {
9600 ScriptInputUserData ctx = new ScriptInputUserData;
9605 ItemBase destination_entity =
this;
9606 ctx.
Write(destination_entity);
9610 }
9611 }
9612 else if (!
GetGame().IsMultiplayer())
9613 {
9615 }
9616 }
9617
9619 {
9621 float split_quantity_new;
9623 if (player)
9624 {
9626 if (quantity > stackable)
9627 split_quantity_new = stackable;
9628 else
9629 split_quantity_new = quantity;
9630
9632 {
9633 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9634 new_item =
ItemBase.Cast(in_hands);
9635 if (new_item)
9636 {
9637 new_item.SetResultOfSplit(true);
9638 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9640 new_item.SetQuantity(split_quantity_new, false, true);
9641 }
9642 }
9643 }
9644 }
9645
9647 {
9649 float split_quantity_new = Math.Floor(quantity * 0.5);
9650
9652 return;
9653
9655
9656 if (new_item)
9657 {
9658 if (new_item.GetQuantityMax() < split_quantity_new)
9659 {
9660 split_quantity_new = new_item.GetQuantityMax();
9661 }
9662
9663 new_item.SetResultOfSplit(true);
9664 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9665
9667 {
9670 }
9671 else
9672 {
9674 new_item.
SetQuantity(split_quantity_new,
false,
true);
9675 }
9676 }
9677 }
9678
9680 {
9682 float split_quantity_new = Math.Floor(quantity / 2);
9683
9685 return;
9686
9687 InventoryLocation invloc = new InventoryLocation;
9689
9691 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9692
9693 if (new_item)
9694 {
9695 if (new_item.GetQuantityMax() < split_quantity_new)
9696 {
9697 split_quantity_new = new_item.GetQuantityMax();
9698 }
9700 {
9703 }
9704 else if (split_quantity_new > 1)
9705 {
9707 new_item.
SetQuantity(split_quantity_new,
false,
true);
9708 }
9709 }
9710 }
9711
9714 {
9715 SetWeightDirty();
9717
9718 if (parent)
9719 parent.OnAttachmentQuantityChangedEx(this, delta);
9720
9722 {
9724 {
9726 }
9728 {
9729 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9731 }
9732 }
9733
9734 }
9735
9738 {
9739
9740 }
9741
9744 {
9746 }
9747
9749 {
9750 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9751
9753 {
9754 if (newLevel == GameConstants.STATE_RUINED)
9755 {
9757 EntityAI parent = GetHierarchyParent();
9758 if (parent && parent.IsFireplace())
9759 {
9760 CargoBase cargo = GetInventory().GetCargo();
9761 if (cargo)
9762 {
9764 {
9766 }
9767 }
9768 }
9769 }
9770
9772 {
9773
9775 return;
9776 }
9777
9778 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9779 {
9781 }
9782 }
9783 }
9784
9785
9787 {
9788 super.OnRightClick();
9789
9791 {
9793 {
9794 if (ScriptInputUserData.CanStoreInputUserData())
9795 {
9796 EntityAI root = GetHierarchyRoot();
9797 Man playerOwner = GetHierarchyRootPlayer();
9798 InventoryLocation dst = new InventoryLocation;
9799
9800
9801 if (!playerOwner && root && root == this)
9802 {
9804 }
9805 else
9806 {
9807
9808 GetInventory().GetCurrentInventoryLocation(dst);
9810 {
9813 {
9815 }
9816 else
9817 {
9819
9820
9821 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9822 {
9824 }
9825 else
9826 {
9827 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9828 }
9829 }
9830 }
9831 }
9832
9833 ScriptInputUserData ctx = new ScriptInputUserData;
9841 }
9842 }
9843 else if (!
GetGame().IsMultiplayer())
9844 {
9846 }
9847 }
9848 }
9849
9851 {
9852 if (root)
9853 {
9854 vector m4[4];
9855 root.GetTransform(m4);
9856 dst.SetGround(this, m4);
9857 }
9858 else
9859 {
9860 GetInventory().GetCurrentInventoryLocation(dst);
9861 }
9862 }
9863
9864 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9865 {
9866
9867 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9868 return false;
9869
9870 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9871 return false;
9872
9873
9875 return false;
9876
9877
9878 Magazine mag = Magazine.Cast(this);
9879 if (mag)
9880 {
9881 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9882 return false;
9883
9884 if (stack_max_limit)
9885 {
9886 Magazine other_mag = Magazine.Cast(other_item);
9887 if (other_item)
9888 {
9889 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9890 return false;
9891 }
9892
9893 }
9894 }
9895 else
9896 {
9897
9899 return false;
9900
9902 return false;
9903 }
9904
9905 PlayerBase player = null;
9906 if (CastTo(player, GetHierarchyRootPlayer()))
9907 {
9908 if (player.GetInventory().HasAttachment(this))
9909 return false;
9910
9911 if (player.IsItemsToDelete())
9912 return false;
9913 }
9914
9915 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9916 return false;
9917
9918 int slotID;
9920 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9921 return false;
9922
9923 return true;
9924 }
9925
9927 {
9929 }
9930
9932 {
9933 return m_IsResultOfSplit;
9934 }
9935
9937 {
9938 m_IsResultOfSplit = value;
9939 }
9940
9942 {
9944 }
9945
9947 {
9948 float other_item_quantity = other_item.GetQuantity();
9949 float this_free_space;
9950
9952
9954
9955 if (other_item_quantity > this_free_space)
9956 {
9957 return this_free_space;
9958 }
9959 else
9960 {
9961 return other_item_quantity;
9962 }
9963 }
9964
9966 {
9968 }
9969
9971 {
9973 return;
9974
9975 if (!IsMagazine() && other_item)
9976 {
9978 if (quantity_used != 0)
9979 {
9980 float hp1 = GetHealth01("","");
9981 float hp2 = other_item.GetHealth01("","");
9982 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9983 hpResult = hpResult / (
GetQuantity() + quantity_used);
9984
9985 hpResult *= GetMaxHealth();
9986 Math.Round(hpResult);
9987 SetHealth("", "Health", hpResult);
9988
9990 other_item.AddQuantity(-quantity_used);
9991 }
9992 }
9994 }
9995
9997 {
9998 #ifdef SERVER
9999 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10000 GetHierarchyParent().IncreaseLifetimeUp();
10001 #endif
10002 };
10003
10005 {
10006 PlayerBase p = PlayerBase.Cast(player);
10007
10008 array<int> recipesIds = p.m_Recipes;
10009 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10010 if (moduleRecipesManager)
10011 {
10012 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10013 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10014 }
10015
10016 for (int i = 0;i < recipesIds.Count(); i++)
10017 {
10018 int key = recipesIds.Get(i);
10019 string recipeName = moduleRecipesManager.GetRecipeName(key);
10021 }
10022 }
10023
10024
10025 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10026 {
10027 super.GetDebugActions(outputList);
10028
10029
10035
10036
10041
10046
10047
10051
10052
10054 {
10058 }
10059
10062
10063
10067
10069
10070 InventoryLocation loc = new InventoryLocation();
10071 GetInventory().GetCurrentInventoryLocation(loc);
10073 {
10074 if (Gizmo_IsSupported())
10077 }
10078
10080 }
10081
10082
10083
10084
10086 {
10087 super.OnAction(action_id, player, ctx);
10088
10090 {
10091 switch (action_id)
10092 {
10095 return true;
10098 return true;
10099 }
10100 }
10101
10103 {
10104 switch (action_id)
10105 {
10107 Delete();
10108 return true;
10109 }
10110 }
10111
10112 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10113 {
10114 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10115 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10116 PlayerBase p = PlayerBase.Cast(player);
10117 if (
EActions.RECIPES_RANGE_START < 1000)
10118 {
10119 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10120 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10121 }
10122 }
10123 #ifndef SERVER
10124 else if (action_id ==
EActions.WATCH_PLAYER)
10125 {
10126 PluginDeveloper.SetDeveloperItemClientEx(player);
10127 }
10128 #endif
10130 {
10131 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10132 {
10133 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10134 OnDebugButtonPressServer(id + 1);
10135 }
10136
10137 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10138 {
10139 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10141 }
10142
10143 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10144 {
10145 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10147 }
10148
10149 else if (action_id ==
EActions.ADD_QUANTITY)
10150 {
10151 if (IsMagazine())
10152 {
10153 Magazine mag = Magazine.Cast(this);
10154 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10155 }
10156 else
10157 {
10159 }
10160
10161 if (m_EM)
10162 {
10163 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10164 }
10165
10166 }
10167
10168 else if (action_id ==
EActions.REMOVE_QUANTITY)
10169 {
10170 if (IsMagazine())
10171 {
10172 Magazine mag2 = Magazine.Cast(this);
10173 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10174 }
10175 else
10176 {
10178 }
10179 if (m_EM)
10180 {
10181 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10182 }
10183
10184 }
10185
10186 else if (action_id ==
EActions.SET_QUANTITY_0)
10187 {
10189
10190 if (m_EM)
10191 {
10192 m_EM.SetEnergy(0);
10193 }
10194 }
10195
10196 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10197 {
10199
10200 if (m_EM)
10201 {
10202 m_EM.SetEnergy(m_EM.GetEnergyMax());
10203 }
10204 }
10205
10206 else if (action_id ==
EActions.ADD_HEALTH)
10207 {
10208 AddHealth("","",GetMaxHealth("","Health")/5);
10209 }
10210 else if (action_id ==
EActions.REMOVE_HEALTH)
10211 {
10212 AddHealth("","",-GetMaxHealth("","Health")/5);
10213 }
10214 else if (action_id ==
EActions.DESTROY_HEALTH)
10215 {
10216 SetHealth01("","",0);
10217 }
10218 else if (action_id ==
EActions.WATCH_ITEM)
10219 {
10221 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10222 #ifdef DEVELOPER
10223 SetDebugDeveloper_item(this);
10224 #endif
10225 }
10226
10227 else if (action_id ==
EActions.ADD_TEMPERATURE)
10228 {
10229 AddTemperature(20);
10230
10231 }
10232
10233 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10234 {
10235 AddTemperature(-20);
10236
10237 }
10238
10239 else if (action_id ==
EActions.FLIP_FROZEN)
10240 {
10241 SetFrozen(!GetIsFrozen());
10242
10243 }
10244
10245 else if (action_id ==
EActions.ADD_WETNESS)
10246 {
10248
10249 }
10250
10251 else if (action_id ==
EActions.REMOVE_WETNESS)
10252 {
10254
10255 }
10256
10257 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10258 {
10261
10262
10263 }
10264
10265 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10266 {
10269 }
10270
10271 else if (action_id ==
EActions.MAKE_SPECIAL)
10272 {
10273 auto debugParams = DebugSpawnParams.WithPlayer(player);
10274 OnDebugSpawnEx(debugParams);
10275 }
10276
10277 }
10278
10279
10280 return false;
10281 }
10282
10283
10284
10285
10289
10292
10293
10294
10296 {
10297 return false;
10298 }
10299
10300
10302 {
10303 return true;
10304 }
10305
10306
10308 {
10309 return true;
10310 }
10311
10312
10313
10315 {
10316 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10318 }
10319
10322 {
10323 return null;
10324 }
10325
10327 {
10328 return false;
10329 }
10330
10332 {
10333 return false;
10334 }
10335
10339
10340
10342 {
10343 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10344 return module_repairing.CanRepair(this, item_repair_kit);
10345 }
10346
10347
10348 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10349 {
10350 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10351 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10352 }
10353
10354
10356 {
10357
10358
10359
10360
10361
10362
10363
10364
10365 return 1;
10366 }
10367
10368
10369
10371 {
10373 }
10374
10375
10376
10378 {
10380 }
10381
10382
10391 {
10392 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10393
10394 if (player)
10395 {
10396 player.MessageStatus(text);
10397 }
10398 }
10399
10400
10409 {
10410 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10411
10412 if (player)
10413 {
10414 player.MessageAction(text);
10415 }
10416 }
10417
10418
10427 {
10428 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10429
10430 if (player)
10431 {
10432 player.MessageFriendly(text);
10433 }
10434 }
10435
10436
10445 {
10446 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10447
10448 if (player)
10449 {
10450 player.MessageImportant(text);
10451 }
10452 }
10453
10455 {
10456 return true;
10457 }
10458
10459
10460 override bool KindOf(
string tag)
10461 {
10462 bool found = false;
10463 string item_name = this.
GetType();
10466
10467 int array_size = item_tag_array.Count();
10468 for (int i = 0; i < array_size; i++)
10469 {
10470 if (item_tag_array.Get(i) == tag)
10471 {
10472 found = true;
10473 break;
10474 }
10475 }
10476 return found;
10477 }
10478
10479
10481 {
10482
10483 super.OnRPC(sender, rpc_type,ctx);
10484
10485
10486 switch (rpc_type)
10487 {
10488 #ifndef SERVER
10489 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10490 Param2<bool, string> p = new Param2<bool, string>(false, "");
10491
10493 return;
10494
10495 bool play = p.param1;
10496 string soundSet = p.param2;
10497
10498 if (play)
10499 {
10501 {
10503 {
10505 }
10506 }
10507 else
10508 {
10510 }
10511 }
10512 else
10513 {
10515 }
10516
10517 break;
10518 #endif
10519
10520 }
10521
10523 {
10525 }
10526 }
10527
10528
10529
10530
10532 {
10533 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10534 return plugin.GetID(
name);
10535 }
10536
10538 {
10539 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10540 return plugin.GetName(id);
10541 }
10542
10545 {
10546
10547
10548 int varFlags;
10549 if (!ctx.
Read(varFlags))
10550 return;
10551
10552 if (varFlags & ItemVariableFlags.FLOAT)
10553 {
10555 }
10556 }
10557
10559 {
10560
10561 super.SerializeNumericalVars(floats_out);
10562
10563
10564
10566 {
10568 }
10569
10571 {
10573 }
10574
10576 {
10578 }
10579
10581 {
10586 }
10587
10589 {
10591 }
10592 }
10593
10595 {
10596
10597 super.DeSerializeNumericalVars(floats);
10598
10599
10600 int index = 0;
10601 int mask = Math.Round(floats.Get(index));
10602
10603 index++;
10604
10606 {
10608 {
10610 }
10611 else
10612 {
10613 float quantity = floats.Get(index);
10614 SetQuantity(quantity,
true,
false,
false,
false);
10615 }
10616 index++;
10617 }
10618
10620 {
10621 float wet = floats.Get(index);
10623 index++;
10624 }
10625
10627 {
10628 int liquidtype = Math.Round(floats.Get(index));
10630 index++;
10631 }
10632
10634 {
10636 index++;
10638 index++;
10640 index++;
10642 index++;
10643 }
10644
10646 {
10647 int cleanness = Math.Round(floats.Get(index));
10649 index++;
10650 }
10651 }
10652
10654 {
10655 super.WriteVarsToCTX(ctx);
10656
10657
10659 {
10661 }
10662
10664 {
10666 }
10667
10669 {
10671 }
10672
10674 {
10675 int r,g,b,a;
10681 }
10682
10684 {
10686 }
10687 }
10688
10690 {
10691 if (!super.ReadVarsFromCTX(ctx,version))
10692 return false;
10693
10694 int intValue;
10695 float value;
10696
10697 if (version < 140)
10698 {
10699 if (!ctx.
Read(intValue))
10700 return false;
10701
10702 m_VariablesMask = intValue;
10703 }
10704
10706 {
10707 if (!ctx.
Read(value))
10708 return false;
10709
10711 {
10713 }
10714 else
10715 {
10717 }
10718 }
10719
10720 if (version < 140)
10721 {
10723 {
10724 if (!ctx.
Read(value))
10725 return false;
10726 SetTemperatureDirect(value);
10727 }
10728 }
10729
10731 {
10732 if (!ctx.
Read(value))
10733 return false;
10735 }
10736
10738 {
10739 if (!ctx.
Read(intValue))
10740 return false;
10742 }
10743
10745 {
10746 int r,g,b,a;
10748 return false;
10750 return false;
10752 return false;
10754 return false;
10755
10757 }
10758
10760 {
10761 if (!ctx.
Read(intValue))
10762 return false;
10764 }
10765
10766 if (version >= 138 && version < 140)
10767 {
10769 {
10770 if (!ctx.
Read(intValue))
10771 return false;
10772 SetFrozen(intValue);
10773 }
10774 }
10775
10776 return true;
10777 }
10778
10779
10781 {
10784 {
10786 }
10787
10788 if (!super.OnStoreLoad(ctx, version))
10789 {
10791 return false;
10792 }
10793
10794 if (version >= 114)
10795 {
10796 bool hasQuickBarIndexSaved;
10797
10798 if (!ctx.
Read(hasQuickBarIndexSaved))
10799 {
10801 return false;
10802 }
10803
10804 if (hasQuickBarIndexSaved)
10805 {
10806 int itmQBIndex;
10807
10808
10809 if (!ctx.
Read(itmQBIndex))
10810 {
10812 return false;
10813 }
10814
10815 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10816 if (itmQBIndex != -1 && parentPlayer)
10817 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10818 }
10819 }
10820 else
10821 {
10822
10823 PlayerBase player;
10824 int itemQBIndex;
10825 if (version ==
int.
MAX)
10826 {
10827 if (!ctx.
Read(itemQBIndex))
10828 {
10830 return false;
10831 }
10832 }
10833 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10834 {
10835
10836 if (!ctx.
Read(itemQBIndex))
10837 {
10839 return false;
10840 }
10841 if (itemQBIndex != -1 && player)
10842 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10843 }
10844 }
10845
10846 if (version < 140)
10847 {
10848
10849 if (!LoadVariables(ctx, version))
10850 {
10852 return false;
10853 }
10854 }
10855
10856
10858 {
10860 return false;
10861 }
10862 if (version >= 132)
10863 {
10865 if (raib)
10866 {
10868 {
10870 return false;
10871 }
10872 }
10873 }
10874
10876 return true;
10877 }
10878
10879
10880
10882 {
10883 super.OnStoreSave(ctx);
10884
10885 PlayerBase player;
10886 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10887 {
10889
10890 int itemQBIndex = -1;
10891 itemQBIndex = player.FindQuickBarEntityIndex(this);
10892 ctx.
Write(itemQBIndex);
10893 }
10894 else
10895 {
10897 }
10898
10900
10902 if (raib)
10903 {
10905 }
10906 }
10907
10908
10910 {
10911 super.AfterStoreLoad();
10912
10914 {
10916 }
10917
10919 {
10922 }
10923 }
10924
10926 {
10927 super.EEOnAfterLoad();
10928
10930 {
10932 }
10933
10936 }
10937
10939 {
10940 return false;
10941 }
10942
10943
10944
10946 {
10948 {
10949 #ifdef PLATFORM_CONSOLE
10950
10952 {
10954 if (menu)
10955 {
10957 }
10958 }
10959 #endif
10960 }
10961
10963 {
10966 }
10967
10969 {
10970 SetWeightDirty();
10972 }
10974 {
10977 }
10978
10980 {
10983 }
10985 {
10988 }
10989
10990 super.OnVariablesSynchronized();
10991 }
10992
10993
10994
10996 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10997 {
10998 if (!IsServerCheck(allow_client))
10999 return false;
11000
11002 return false;
11003
11006
11007 if (value <= (min + 0.001))
11008 value = min;
11009
11010 if (value == min)
11011 {
11012 if (destroy_config)
11013 {
11014 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11015 if (dstr)
11016 {
11018 this.Delete();
11019 return true;
11020 }
11021 }
11022 else if (destroy_forced)
11023 {
11025 this.Delete();
11026 return true;
11027 }
11028
11030 }
11031
11034
11036 {
11038
11039 if (delta)
11041 }
11042
11044
11045 return false;
11046 }
11047
11048
11050 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11051 {
11053 }
11054
11056 {
11059 }
11060
11062 {
11065 }
11066
11068 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11069 {
11070 float value_clamped = Math.Clamp(value, 0, 1);
11072 SetQuantity(result, destroy_config, destroy_forced);
11073 }
11074
11075
11078 {
11080 }
11081
11083 {
11085 }
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11097 {
11098 int slot = -1;
11099 if (GetInventory())
11100 {
11101 InventoryLocation il = new InventoryLocation;
11102 GetInventory().GetCurrentInventoryLocation(il);
11104 }
11105
11107 }
11108
11110 {
11111 float quantity_max = 0;
11112
11114 {
11115 if (attSlotID != -1)
11116 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11117
11118 if (quantity_max <= 0)
11120 }
11121
11122 if (quantity_max <= 0)
11124
11125 return quantity_max;
11126 }
11127
11129 {
11131 }
11132
11134 {
11136 }
11137
11138
11140 {
11142 }
11143
11145 {
11147 }
11148
11150 {
11152 }
11153
11154
11156 {
11157
11158 float weightEx = GetWeightEx();
11159 float special = GetInventoryAndCargoWeight();
11160 return weightEx - special;
11161 }
11162
11163
11165 {
11167 }
11168
11170 {
11172 {
11173 #ifdef DEVELOPER
11174 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11175 {
11176 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11178 }
11179 #endif
11180
11181 return GetQuantity() * GetConfigWeightModified();
11182 }
11183 else if (HasEnergyManager())
11184 {
11185 #ifdef DEVELOPER
11186 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11187 {
11188 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11189 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11190 }
11191 #endif
11192 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11193 }
11194 else
11195 {
11196 #ifdef DEVELOPER
11197 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11198 {
11199 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11200 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11201 }
11202 #endif
11203 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11204 }
11205 }
11206
11209 {
11210 int item_count = 0;
11212
11213 if (GetInventory().GetCargo() != NULL)
11214 {
11215 item_count = GetInventory().GetCargo().GetItemCount();
11216 }
11217
11218 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11219 {
11220 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11221 if (item)
11222 item_count += item.GetNumberOfItems();
11223 }
11224 return item_count;
11225 }
11226
11229 {
11230 float weight = 0;
11231 float wetness = 1;
11232 if (include_wetness)
11235 {
11236 weight = wetness * m_ConfigWeight;
11237 }
11239 {
11240 weight = 1;
11241 }
11242 return weight;
11243 }
11244
11245
11246
11248 {
11249 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11250 {
11251 GameInventory inv = GetInventory();
11252 array<EntityAI> items = new array<EntityAI>;
11254 for (int i = 0; i < items.Count(); i++)
11255 {
11257 if (item)
11258 {
11260 }
11261 }
11262 }
11263 }
11264
11265
11266
11267
11269 {
11270 float energy = 0;
11271 if (HasEnergyManager())
11272 {
11273 energy = GetCompEM().GetEnergy();
11274 }
11275 return energy;
11276 }
11277
11278
11280 {
11281 super.OnEnergyConsumed();
11282
11284 }
11285
11287 {
11288 super.OnEnergyAdded();
11289
11291 }
11292
11293
11295 {
11296 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11297 {
11299 {
11300 float energy_0to1 = GetCompEM().GetEnergy0To1();
11302 }
11303 }
11304 }
11305
11306
11308 {
11309 return ConfigGetFloat("heatIsolation");
11310 }
11311
11313 {
11315 }
11316
11318 {
11319 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11320 if (
GetGame().ConfigIsExisting(paramPath))
11322
11323 return 0.0;
11324 }
11325
11327 {
11328 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11329 if (
GetGame().ConfigIsExisting(paramPath))
11331
11332 return 0.0;
11333 }
11334
11335 override void SetWet(
float value,
bool allow_client =
false)
11336 {
11337 if (!IsServerCheck(allow_client))
11338 return;
11339
11342
11344
11345 m_VarWet = Math.Clamp(value, min, max);
11346
11348 {
11351 }
11352 }
11353
11354 override void AddWet(
float value)
11355 {
11357 }
11358
11360 {
11362 }
11363
11365 {
11367 }
11368
11370 {
11372 }
11373
11375 {
11377 }
11378
11380 {
11382 }
11383
11384 override void OnWetChanged(
float newVal,
float oldVal)
11385 {
11388 if (newLevel != oldLevel)
11389 {
11391 }
11392 }
11393
11395 {
11396 SetWeightDirty();
11397 }
11398
11400 {
11401 return GetWetLevelInternal(
m_VarWet);
11402 }
11403
11404
11405
11407 {
11409 }
11410
11412 {
11414 }
11415
11417 {
11419 }
11420
11422 {
11424 }
11425
11426
11427
11429 {
11430 if (ConfigIsExisting("itemModelLength"))
11431 {
11432 return ConfigGetFloat("itemModelLength");
11433 }
11434 return 0;
11435 }
11436
11438 {
11439 if (ConfigIsExisting("itemAttachOffset"))
11440 {
11441 return ConfigGetFloat("itemAttachOffset");
11442 }
11443 return 0;
11444 }
11445
11446 override void SetCleanness(
int value,
bool allow_client =
false)
11447 {
11448 if (!IsServerCheck(allow_client))
11449 return;
11450
11452
11454
11457 }
11458
11460 {
11462 }
11463
11465 {
11466 return true;
11467 }
11468
11469
11470
11471
11473 {
11475 }
11476
11478 {
11480 }
11481
11482
11483
11484
11485 override void SetColor(
int r,
int g,
int b,
int a)
11486 {
11492 }
11494 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11495 {
11500 }
11501
11503 {
11505 }
11506
11509 {
11510 int r,g,b,a;
11512 r = r/255;
11513 g = g/255;
11514 b = b/255;
11515 a = a/255;
11516 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11517 }
11518
11519
11520
11521 override void SetLiquidType(
int value,
bool allow_client =
false)
11522 {
11523 if (!IsServerCheck(allow_client))
11524 return;
11525
11530 }
11531
11533 {
11534 return ConfigGetInt("varLiquidTypeInit");
11535 }
11536
11538 {
11540 }
11541
11543 {
11545 SetFrozen(false);
11546 }
11547
11550 {
11551 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11552 }
11553
11554
11557 {
11558 PlayerBase nplayer;
11559 if (PlayerBase.CastTo(nplayer, player))
11560 {
11562
11563 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11564 }
11565 }
11566
11567
11570 {
11571 PlayerBase nplayer;
11572 if (PlayerBase.CastTo(nplayer,player))
11573 {
11574
11575 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11576
11577 }
11578
11579
11580 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11581
11582
11583 if (HasEnergyManager())
11584 {
11585 GetCompEM().UpdatePlugState();
11586 }
11587 }
11588
11589
11591 {
11592 super.OnPlacementStarted(player);
11593
11595 }
11596
11597 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11598 {
11600 {
11601 m_AdminLog.OnPlacementComplete(player,
this);
11602 }
11603
11604 super.OnPlacementComplete(player, position, orientation);
11605 }
11606
11607
11608
11609
11610
11612 {
11614 {
11615 return true;
11616 }
11617 else
11618 {
11619 return false;
11620 }
11621 }
11622
11623
11625 {
11627 {
11629 }
11630 }
11631
11632
11634 {
11636 }
11637
11639 {
11641 }
11642
11643 override void InsertAgent(
int agent,
float count = 1)
11644 {
11645 if (count < 1)
11646 return;
11647
11649 }
11650
11653 {
11655 }
11656
11657
11659 {
11661 }
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11705 {
11707 return false;
11708 return true;
11709 }
11710
11712 {
11713
11715 }
11716
11717
11720 {
11721 super.CheckForRoofLimited(timeTresholdMS);
11722
11724 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11725 {
11726 m_PreviousRoofTestTime = time;
11727 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11728 }
11729 }
11730
11731
11733 {
11735 {
11736 return 0;
11737 }
11738
11739 if (GetInventory().GetAttachmentSlotsCount() != 0)
11740 {
11741 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11742 if (filter)
11743 return filter.GetProtectionLevel(type, false, system);
11744 else
11745 return 0;
11746 }
11747
11748 string subclassPath, entryName;
11749
11750 switch (type)
11751 {
11753 entryName = "biological";
11754 break;
11756 entryName = "chemical";
11757 break;
11758 default:
11759 entryName = "biological";
11760 break;
11761 }
11762
11763 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11764
11766 }
11767
11768
11769
11772 {
11773 if (!IsMagazine())
11775
11777 }
11778
11779
11780
11781
11782
11787 {
11788 return true;
11789 }
11790
11792 {
11794 }
11795
11796
11797
11798
11799
11801 {
11802 if (parent)
11803 {
11804 if (parent.IsInherited(DayZInfected))
11805 return true;
11806
11807 if (!parent.IsRuined())
11808 return true;
11809 }
11810
11811 return true;
11812 }
11813
11815 {
11816 if (!super.CanPutAsAttachment(parent))
11817 {
11818 return false;
11819 }
11820
11821 if (!IsRuined() && !parent.IsRuined())
11822 {
11823 return true;
11824 }
11825
11826 return false;
11827 }
11828
11830 {
11831
11832
11833
11834
11835 return super.CanReceiveItemIntoCargo(item);
11836 }
11837
11839 {
11840
11841
11842
11843
11844 GameInventory attachmentInv = attachment.GetInventory();
11846 {
11847 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11848 return false;
11849 }
11850
11851 InventoryLocation loc = new InventoryLocation();
11852 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11853 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11854 return false;
11855
11856 return super.CanReceiveAttachment(attachment, slotId);
11857 }
11858
11860 {
11861 if (!super.CanReleaseAttachment(attachment))
11862 return false;
11863
11864 return GetInventory().AreChildrenAccessible();
11865 }
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11888 {
11889 int id = muzzle_owner.GetMuzzleID();
11890 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11891
11892 if (WPOF_array)
11893 {
11894 for (int i = 0; i < WPOF_array.Count(); i++)
11895 {
11896 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11897
11898 if (WPOF)
11899 {
11900 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11901 }
11902 }
11903 }
11904 }
11905
11906
11908 {
11909 int id = muzzle_owner.GetMuzzleID();
11911
11912 if (WPOBE_array)
11913 {
11914 for (int i = 0; i < WPOBE_array.Count(); i++)
11915 {
11916 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11917
11918 if (WPOBE)
11919 {
11920 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11921 }
11922 }
11923 }
11924 }
11925
11926
11928 {
11929 int id = muzzle_owner.GetMuzzleID();
11930 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11931
11932 if (WPOOH_array)
11933 {
11934 for (int i = 0; i < WPOOH_array.Count(); i++)
11935 {
11936 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11937
11938 if (WPOOH)
11939 {
11940 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11941 }
11942 }
11943 }
11944 }
11945
11946
11948 {
11949 int id = muzzle_owner.GetMuzzleID();
11950 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11951
11952 if (WPOOH_array)
11953 {
11954 for (int i = 0; i < WPOOH_array.Count(); i++)
11955 {
11956 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11957
11958 if (WPOOH)
11959 {
11960 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11961 }
11962 }
11963 }
11964 }
11965
11966
11968 {
11969 int id = muzzle_owner.GetMuzzleID();
11970 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11971
11972 if (WPOOH_array)
11973 {
11974 for (int i = 0; i < WPOOH_array.Count(); i++)
11975 {
11976 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11977
11978 if (WPOOH)
11979 {
11980 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11981 }
11982 }
11983 }
11984 }
11985
11986
11987
11989 {
11991 {
11992 return true;
11993 }
11994
11995 return false;
11996 }
11997
11999 {
12001 {
12002 return true;
12003 }
12004
12005 return false;
12006 }
12007
12009 {
12011 {
12012 return true;
12013 }
12014
12015 return false;
12016 }
12017
12019 {
12020 return false;
12021 }
12022
12025 {
12026 return UATimeSpent.DEFAULT_DEPLOY;
12027 }
12028
12029
12030
12031
12033 {
12035 SetSynchDirty();
12036 }
12037
12039 {
12041 }
12042
12043
12045 {
12046 return false;
12047 }
12048
12051 {
12052 string att_type = "None";
12053
12054 if (ConfigIsExisting("soundAttType"))
12055 {
12056 att_type = ConfigGetString("soundAttType");
12057 }
12058
12060 }
12061
12063 {
12065 }
12066
12067
12068
12069
12070
12076
12078 {
12081
12083 }
12084
12085
12087 {
12089 return;
12090
12092
12095
12098
12099 SoundParameters params = new SoundParameters();
12103 }
12104
12105
12107 {
12109 return;
12110
12112 SetSynchDirty();
12113
12116 }
12117
12118
12120 {
12122 return;
12123
12125 SetSynchDirty();
12126
12129 }
12130
12132 {
12134 }
12135
12137 {
12139 }
12140
12143 {
12144 if (!
GetGame().IsDedicatedServer())
12145 {
12146 if (ConfigIsExisting("attachSoundSet"))
12147 {
12148 string cfg_path = "";
12149 string soundset = "";
12150 string type_name =
GetType();
12151
12154 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12155 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12156
12157 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12158 {
12159 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12160 {
12161 if (cfg_slot_array[i] == slot_type)
12162 {
12163 soundset = cfg_soundset_array[i];
12164 break;
12165 }
12166 }
12167 }
12168
12169 if (soundset != "")
12170 {
12171 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12173 }
12174 }
12175 }
12176 }
12177
12179 {
12180
12181 }
12182
12183 void OnApply(PlayerBase player);
12184
12186 {
12187 return 1.0;
12188 };
12189
12191 {
12193 }
12194
12196 {
12198 }
12199
12201
12203 {
12204 SetDynamicPhysicsLifeTime(0.01);
12206 }
12207
12209 {
12210 array<string> zone_names = new array<string>;
12211 GetDamageZones(zone_names);
12212 for (int i = 0; i < zone_names.Count(); i++)
12213 {
12214 SetHealthMax(zone_names.Get(i),"Health");
12215 }
12216 SetHealthMax("","Health");
12217 }
12218
12221 {
12222 float global_health = GetHealth01("","Health");
12223 array<string> zones = new array<string>;
12224 GetDamageZones(zones);
12225
12226 for (int i = 0; i < zones.Count(); i++)
12227 {
12228 SetHealth01(zones.Get(i),"Health",global_health);
12229 }
12230 }
12231
12234 {
12235 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12236 }
12237
12239 {
12240 if (!hasRootAsPlayer)
12241 {
12242 if (refParentIB)
12243 {
12244
12245 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12246 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12247
12248 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12249 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12250
12253 }
12254 else
12255 {
12256
12259 }
12260 }
12261 }
12262
12264 {
12266 {
12267 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12268 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12269 {
12270 float heatPermCoef = 1.0;
12272 while (ent)
12273 {
12274 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12275 ent = ent.GetHierarchyParent();
12276 }
12277
12278 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12279 }
12280 }
12281 }
12282
12284 {
12285
12286 EntityAI parent = GetHierarchyParent();
12287 if (!parent)
12288 {
12289 hasParent = false;
12290 hasRootAsPlayer = false;
12291 }
12292 else
12293 {
12294 hasParent = true;
12295 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12296 refParentIB =
ItemBase.Cast(parent);
12297 }
12298 }
12299
12300 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12301 {
12302
12303 }
12304
12306 {
12307
12308 return false;
12309 }
12310
12312 {
12313
12314
12315 return false;
12316 }
12317
12319 {
12320
12321 return false;
12322 }
12323
12326 {
12327 return !GetIsFrozen() &&
IsOpen();
12328 }
12329
12331 {
12332 bool hasParent = false, hasRootAsPlayer = false;
12334
12335 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12336 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12337
12338 if (wwtu || foodDecay)
12339 {
12343
12344 if (processWetness || processTemperature || processDecay)
12345 {
12347
12348 if (processWetness)
12349 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12350
12351 if (processTemperature)
12353
12354 if (processDecay)
12355 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12356 }
12357 }
12358 }
12359
12362 {
12364 }
12365
12367 {
12370
12371 return super.GetTemperatureFreezeThreshold();
12372 }
12373
12375 {
12378
12379 return super.GetTemperatureThawThreshold();
12380 }
12381
12383 {
12386
12387 return super.GetItemOverheatThreshold();
12388 }
12389
12391 {
12393 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12394
12395 return super.GetTemperatureFreezeTime();
12396 }
12397
12399 {
12401 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12402
12403 return super.GetTemperatureThawTime();
12404 }
12405
12410
12412 {
12413 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12414 }
12415
12417 {
12418 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12419 }
12420
12423 {
12425 }
12426
12428 {
12430 }
12431
12433 {
12435 }
12436
12439 {
12440 return null;
12441 }
12442
12445 {
12446 return false;
12447 }
12448
12450 {
12452 {
12455 if (!trg)
12456 {
12458 explosive = this;
12459 }
12460
12461 explosive.PairRemote(trg);
12463
12464 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12465 trg.SetPersistentPairID(persistentID);
12466 explosive.SetPersistentPairID(persistentID);
12467
12468 return true;
12469 }
12470 return false;
12471 }
12472
12475 {
12476 float ret = 1.0;
12479 ret *= GetHealth01();
12480
12481 return ret;
12482 }
12483
12484 #ifdef DEVELOPER
12485 override void SetDebugItem()
12486 {
12487 super.SetDebugItem();
12488 _itemBase = this;
12489 }
12490
12492 {
12493 string text = super.GetDebugText();
12494
12496 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12497
12498 return text;
12499 }
12500 #endif
12501
12503 {
12504 return true;
12505 }
12506
12508
12510
12512 {
12515 }
12516
12517
12525
12541}
12542
12544{
12546 if (entity)
12547 {
12548 bool is_item = entity.IsInherited(
ItemBase);
12549 if (is_item && full_quantity)
12550 {
12553 }
12554 }
12555 else
12556 {
12558 return NULL;
12559 }
12560 return entity;
12561}
12562
12564{
12565 if (item)
12566 {
12567 if (health > 0)
12568 item.SetHealth("", "", health);
12569
12570 if (item.CanHaveTemperature())
12571 {
12573 if (item.CanFreeze())
12574 item.SetFrozen(false);
12575 }
12576
12577 if (item.HasEnergyManager())
12578 {
12579 if (quantity >= 0)
12580 {
12581 item.GetCompEM().SetEnergy0To1(quantity);
12582 }
12583 else
12584 {
12586 }
12587 }
12588 else if (item.IsMagazine())
12589 {
12590 Magazine mag = Magazine.Cast(item);
12591 if (quantity >= 0)
12592 {
12593 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12594 }
12595 else
12596 {
12598 }
12599
12600 }
12601 else
12602 {
12603 if (quantity >= 0)
12604 {
12605 item.SetQuantityNormalized(quantity, false);
12606 }
12607 else
12608 {
12610 }
12611
12612 }
12613 }
12614}
12615
12616#ifdef DEVELOPER
12618#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
Open
Implementations only.
override void EEOnCECreate()
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 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)
bool ShouldSplitQuantity(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)
override 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...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
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()
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)
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 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 void GizmoSelectObject(Object object)
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 native void GizmoSelectPhysics(Physics physics)
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
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 string GetFoldSoundset()
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 string GetLoopFoldSoundset()
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.