7494{
7496 {
7497 return true;
7498 }
7499};
7500
7501
7502
7504{
7508
7510
7513
7514
7515
7516
7517
7526
7532
7537
7542
7563 protected bool m_IsResultOfSplit
7564
7566
7571
7572
7573
7575
7579
7580
7581
7583
7586
7587
7588
7594
7595
7603
7606
7607
7609
7610
7612
7613
7618
7619
7624
7625
7627
7628
7630 {
7635
7636 if (!
GetGame().IsDedicatedServer())
7637 {
7639 {
7641
7643 {
7645 }
7646 }
7647
7650 }
7651
7652 m_OldLocation = null;
7653
7655 {
7657 }
7658
7659 if (ConfigIsExisting("headSelectionsToHide"))
7660 {
7663 }
7664
7666 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7667 {
7669 }
7670
7672
7673 m_IsResultOfSplit = false;
7674
7676 }
7677
7679 {
7680 super.InitItemVariables();
7681
7687 m_Count = ConfigGetInt(
"count");
7688
7691
7696
7699
7704
7716
7720
7721
7724 if (ConfigIsExisting("canBeSplit"))
7725 {
7728 }
7729
7731 if (ConfigIsExisting("itemBehaviour"))
7733
7734
7737 RegisterNetSyncVariableInt("m_VarLiquidType");
7738 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7739
7740 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7741 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7742 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7743
7744 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7745 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7746 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7747 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7748
7749 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7750 RegisterNetSyncVariableBool("m_IsTakeable");
7751 RegisterNetSyncVariableBool("m_IsHologram");
7752
7755 {
7758 }
7759
7761
7763 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7765
7766 }
7767
7769 {
7771 }
7772
7774 {
7777 {
7782 }
7783 }
7784
7785 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7786 {
7788 {
7791 }
7792
7794 }
7795
7797 {
7803 }
7804
7806
7808 {
7810
7811 if (!action)
7812 {
7813 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7814 return;
7815 }
7816
7818 if (!ai)
7819 {
7821 return;
7822 }
7823
7825 if (!action_array)
7826 {
7827 action_array = new array<ActionBase_Basic>;
7829 }
7830 if (LogManager.IsActionLogEnable())
7831 {
7832 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7833 }
7834
7835 if (action_array.Find(action) != -1)
7836 {
7837 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7838 }
7839 else
7840 {
7841 action_array.Insert(action);
7842 }
7843 }
7844
7846 {
7848 ActionBase action = player.GetActionManager().GetAction(actionName);
7851
7852 if (action_array)
7853 {
7854 action_array.RemoveItem(action);
7855 }
7856 }
7857
7858
7859
7861 {
7862 ActionOverrideData overrideData = new ActionOverrideData();
7866
7868 if (!actionMap)
7869 {
7872 }
7873
7874 actionMap.Insert(this.
Type(), overrideData);
7875
7876 }
7877
7879
7881
7882
7884 {
7887
7890
7891 string config_to_search = "CfgVehicles";
7892 string muzzle_owner_config;
7893
7895 {
7896 if (IsInherited(Weapon))
7897 config_to_search = "CfgWeapons";
7898
7899 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7900
7901 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7902
7904
7905 if (config_OnFire_subclass_count > 0)
7906 {
7907 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7908
7909 for (int i = 0; i < config_OnFire_subclass_count; i++)
7910 {
7911 string particle_class = "";
7913 string config_OnFire_entry = config_OnFire_class + particle_class;
7914 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7915 WPOF_array.Insert(WPOF);
7916 }
7917
7918
7920 }
7921 }
7922
7924 {
7925 config_to_search = "CfgWeapons";
7926 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7927
7928 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7929
7931
7932 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7933 {
7934 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7935
7936 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7937 {
7938 string particle_class2 = "";
7940 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7941 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7942 WPOBE_array.Insert(WPOBE);
7943 }
7944
7945
7947 }
7948 }
7949 }
7950
7951
7953 {
7956
7958 {
7959 string config_to_search = "CfgVehicles";
7960
7961 if (IsInherited(Weapon))
7962 config_to_search = "CfgWeapons";
7963
7964 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7965 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7966
7967 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7968 {
7969
7971
7973 {
7975 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7977 return;
7978 }
7979
7982
7983
7984
7986 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7987
7988 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7989 {
7990 string particle_class = "";
7992 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7994
7995 if (entry_type == CT_CLASS)
7996 {
7997 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7998 WPOOH_array.Insert(WPOF);
7999 }
8000 }
8001
8002
8004 }
8005 }
8006 }
8007
8009 {
8011 }
8012
8014 {
8016 {
8018
8021
8024
8025 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8026 }
8027 }
8028
8030 {
8032 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8033
8035 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8036
8038 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8039
8041 {
8043 }
8044 }
8045
8047 {
8049 }
8050
8052 {
8055 else
8057
8059 {
8062 }
8063 else
8064 {
8067
8070 }
8071
8073 }
8074
8076 {
8078 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8079 }
8080
8082 {
8084 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8086 }
8087
8089 {
8091 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8092 }
8093
8095 {
8098
8099 OverheatingParticle OP = new OverheatingParticle();
8104
8106 }
8107
8109 {
8112
8113 return -1;
8114 }
8115
8117 {
8119 {
8122
8123 for (int i = count; i > 0; --i)
8124 {
8125 int id = i - 1;
8128
8131
8132 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8133 {
8134 if (p)
8135 {
8138 }
8139 }
8140 }
8141 }
8142 }
8143
8145 {
8147 {
8149 {
8150 int id = i - 1;
8152
8153 if (OP)
8154 {
8156
8157 if (p)
8158 {
8160 }
8161
8162 delete OP;
8163 }
8164 }
8165
8168 }
8169 }
8170
8173 {
8174 return 0.0;
8175 }
8176
8177
8179 {
8180 return 250;
8181 }
8182
8184 {
8185 return 0;
8186 }
8187
8190 {
8192 return true;
8193
8194 return false;
8195 }
8196
8199 {
8202
8204 {
8206 }
8207 else
8208 {
8209
8211 }
8212
8214 }
8215
8222 {
8223 return -1;
8224 }
8225
8226
8227
8228
8230 {
8232 {
8234 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8235
8236 if (r_index >= 0)
8237 {
8238 InventoryLocation r_il = new InventoryLocation;
8239 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8240
8241 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8244 {
8245 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8246 }
8248 {
8249 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8250 }
8251
8252 }
8253
8254 player.GetHumanInventory().ClearUserReservedLocation(this);
8255 }
8256
8259 }
8260
8261
8262
8263
8265 {
8266 return ItemBase.m_DebugActionsMask;
8267 }
8268
8270 {
8271 return ItemBase.m_DebugActionsMask & mask;
8272 }
8273
8275 {
8276 ItemBase.m_DebugActionsMask = mask;
8277 }
8278
8280 {
8281 ItemBase.m_DebugActionsMask |= mask;
8282 }
8283
8285 {
8286 ItemBase.m_DebugActionsMask &= ~mask;
8287 }
8288
8290 {
8292 {
8294 }
8295 else
8296 {
8298 }
8299 }
8300
8301
8303 {
8304 if (GetEconomyProfile())
8305 {
8306 float q_max = GetEconomyProfile().GetQuantityMax();
8307 if (q_max > 0)
8308 {
8309 float q_min = GetEconomyProfile().GetQuantityMin();
8310 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8311
8313 {
8314 ComponentEnergyManager comp = GetCompEM();
8316 {
8318 }
8319 }
8321 {
8323
8324 }
8325
8326 }
8327 }
8328 }
8329
8332 {
8333 EntityAI parent = GetHierarchyParent();
8334
8335 if (parent)
8336 {
8337 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8338 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8339 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8340 }
8341 }
8342
8345 {
8346 EntityAI parent = GetHierarchyParent();
8347
8348 if (parent)
8349 {
8350 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8351 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8352 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8353 }
8354 }
8355
8357 {
8358
8359
8360
8361
8363
8365 {
8366 if (ScriptInputUserData.CanStoreInputUserData())
8367 {
8368 ScriptInputUserData ctx = new ScriptInputUserData;
8374 ctx.
Write(use_stack_max);
8377
8379 {
8380 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8381 }
8382 }
8383 }
8384 else if (!
GetGame().IsMultiplayer())
8385 {
8387 }
8388 }
8389
8391 {
8393 }
8394
8396 {
8398 }
8399
8401 {
8403 }
8404
8406 {
8407
8408 return false;
8409 }
8410
8412 {
8413 return false;
8414 }
8415
8419 {
8420 return false;
8421 }
8422
8424 {
8425 return "";
8426 }
8427
8429
8431 {
8432 return false;
8433 }
8434
8436 {
8437 return true;
8438 }
8439
8440
8441
8443 {
8444 return true;
8445 }
8446
8448 {
8449 return true;
8450 }
8451
8453 {
8454 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8456 }
8457
8459 {
8461 }
8462
8464 {
8466 if (!is_being_placed)
8468 SetSynchDirty();
8469 }
8470
8471
8473
8475 {
8477 }
8478
8480 {
8482 }
8483
8485 {
8486 return 1;
8487 }
8488
8490 {
8491 return false;
8492 }
8493
8495 {
8497 SetSynchDirty();
8498 }
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8535 {
8536 super.OnMovedInsideCargo(container);
8537
8538 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8539 }
8540
8541 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8542 {
8543 super.EEItemLocationChanged(oldLoc,newLoc);
8544
8545 PlayerBase new_player = null;
8546 PlayerBase old_player = null;
8547
8548 if (newLoc.GetParent())
8549 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8550
8551 if (oldLoc.GetParent())
8552 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8553
8555 {
8556 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8557
8558 if (r_index >= 0)
8559 {
8560 InventoryLocation r_il = new InventoryLocation;
8561 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8562
8563 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8566 {
8567 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8568 }
8570 {
8571 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8572 }
8573
8574 }
8575 }
8576
8578 {
8579 if (new_player)
8580 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8581
8582 if (new_player == old_player)
8583 {
8584
8585 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8586 {
8588 {
8589 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8590 {
8591 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8592 }
8593 }
8594 else
8595 {
8596 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8597 }
8598 }
8599
8600 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8601 {
8602 int type = oldLoc.GetType();
8604 {
8605 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8606 }
8608 {
8609 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8610 }
8611 }
8612 if (!m_OldLocation)
8613 {
8614 m_OldLocation = new InventoryLocation;
8615 }
8616 m_OldLocation.Copy(oldLoc);
8617 }
8618 else
8619 {
8620 if (m_OldLocation)
8621 {
8622 m_OldLocation.Reset();
8623 }
8624 }
8625
8627 }
8628 else
8629 {
8630 if (new_player)
8631 {
8632 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8633 if (res_index >= 0)
8634 {
8635 InventoryLocation il = new InventoryLocation;
8636 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8638 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8641 {
8642 il.
GetParent().GetOnReleaseLock().Invoke(it);
8643 }
8645 {
8647 }
8648
8649 }
8650 }
8652 {
8653
8655 }
8656
8657 if (m_OldLocation)
8658 {
8659 m_OldLocation.Reset();
8660 }
8661 }
8662 }
8663
8664 override void EOnContact(IEntity other, Contact extra)
8665 {
8667 {
8668 int liquidType = -1;
8670 if (impactSpeed > 0.0)
8671 {
8673 #ifndef SERVER
8675 #else
8677 SetSynchDirty();
8678 #endif
8680 }
8681 }
8682
8683 #ifdef SERVER
8684 if (GetCompEM() && GetCompEM().IsPlugged())
8685 {
8686 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8687 GetCompEM().UnplugThis();
8688 }
8689 #endif
8690 }
8691
8693
8695 {
8697 }
8698
8700 {
8701
8702 }
8703
8705 {
8706 super.OnItemLocationChanged(old_owner, new_owner);
8707
8708 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8709 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8710
8711 if (!relatedPlayer && playerNew)
8712 relatedPlayer = playerNew;
8713
8714 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8715 {
8717 if (actionMgr)
8718 {
8719 ActionBase currentAction = actionMgr.GetRunningAction();
8720 if (currentAction)
8722 }
8723 }
8724
8725 Man ownerPlayerOld = null;
8726 Man ownerPlayerNew = null;
8727
8728 if (old_owner)
8729 {
8730 if (old_owner.
IsMan())
8731 {
8732 ownerPlayerOld = Man.Cast(old_owner);
8733 }
8734 else
8735 {
8736 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8737 }
8738 }
8739 else
8740 {
8742 {
8744
8745 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8746 {
8747 GetCompEM().UnplugThis();
8748 }
8749 }
8750 }
8751
8752 if (new_owner)
8753 {
8754 if (new_owner.
IsMan())
8755 {
8756 ownerPlayerNew = Man.Cast(new_owner);
8757 }
8758 else
8759 {
8760 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8761 }
8762 }
8763
8764 if (ownerPlayerOld != ownerPlayerNew)
8765 {
8766 if (ownerPlayerOld)
8767 {
8768 array<EntityAI> subItemsExit = new array<EntityAI>;
8770 for (int i = 0; i < subItemsExit.Count(); i++)
8771 {
8774 }
8775 }
8776
8777 if (ownerPlayerNew)
8778 {
8779 array<EntityAI> subItemsEnter = new array<EntityAI>;
8781 for (int j = 0; j < subItemsEnter.Count(); j++)
8782 {
8785 }
8786 }
8787 }
8788 else if (ownerPlayerNew != null)
8789 {
8790 PlayerBase nplayer;
8791 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8792 {
8793 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8795 for (int k = 0; k < subItemsUpdate.Count(); k++)
8796 {
8798 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8799 }
8800 }
8801 }
8802
8803 if (old_owner)
8804 old_owner.OnChildItemRemoved(this);
8805 if (new_owner)
8806 new_owner.OnChildItemReceived(this);
8807 }
8808
8809
8811 {
8812 super.EEDelete(parent);
8813 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8814 if (player)
8815 {
8817
8818 if (player.IsAlive())
8819 {
8820 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8821 if (r_index >= 0)
8822 {
8823 InventoryLocation r_il = new InventoryLocation;
8824 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8825
8826 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8829 {
8830 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8831 }
8833 {
8834 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8835 }
8836
8837 }
8838
8839 player.RemoveQuickBarEntityShortcut(this);
8840 }
8841 }
8842 }
8843
8845 {
8846 super.EEKilled(killer);
8847
8850 {
8851 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8852 {
8853 if (IsMagazine())
8854 {
8855 if (Magazine.Cast(this).GetAmmoCount() > 0)
8856 {
8858 }
8859 }
8860 else
8861 {
8863 }
8864 }
8865 }
8866 }
8867
8869 {
8870 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8871
8872 super.OnWasAttached(parent, slot_id);
8873
8876
8878 }
8879
8881 {
8882 super.OnWasDetached(parent, slot_id);
8883
8886 }
8887
8889 {
8890 int idx;
8893
8894 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8895 if (inventory_slots.Count() < 1)
8896 {
8897 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8898 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8899 }
8900 else
8901 {
8902 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8903 }
8904
8905 idx = inventory_slots.Find(slot);
8906 if (idx < 0)
8907 return "";
8908
8909 return attach_types.Get(idx);
8910 }
8911
8913 {
8914 int idx = -1;
8915 string slot;
8916
8919
8920 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8921 if (inventory_slots.Count() < 1)
8922 {
8923 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8924 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8925 }
8926 else
8927 {
8928 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8929 if (detach_types.Count() < 1)
8930 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8931 }
8932
8933 for (int i = 0; i < inventory_slots.Count(); i++)
8934 {
8935 slot = inventory_slots.Get(i);
8936 }
8937
8938 if (slot != "")
8939 {
8940 if (detach_types.Count() == 1)
8941 idx = 0;
8942 else
8943 idx = inventory_slots.Find(slot);
8944 }
8945 if (idx < 0)
8946 return "";
8947
8948 return detach_types.Get(idx);
8949 }
8950
8952 {
8953
8955
8956
8957 float min_time = 1;
8958 float max_time = 3;
8959 float delay = Math.RandomFloat(min_time, max_time);
8960
8961 explode_timer.Run(delay, this, "DoAmmoExplosion");
8962 }
8963
8965 {
8966 Magazine magazine = Magazine.Cast(this);
8967 int pop_sounds_count = 6;
8968 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8969
8970
8971 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8972 string sound_name = pop_sounds[ sound_idx ];
8974
8975
8976 magazine.ServerAddAmmoCount(-1);
8977
8978
8979 float min_temp_to_explode = 100;
8980
8981 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8982 {
8984 }
8985 }
8986
8987
8988 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8989 {
8990 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8991
8992 const int CHANCE_DAMAGE_CARGO = 4;
8993 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8994 const int CHANCE_DAMAGE_NOTHING = 2;
8995
8997 {
8998 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8999 int chances;
9000 int rnd;
9001
9002 if (GetInventory().GetCargo())
9003 {
9004 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9005 rnd = Math.RandomInt(0,chances);
9006
9007 if (rnd < CHANCE_DAMAGE_CARGO)
9008 {
9010 }
9011 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9012 {
9014 }
9015 }
9016 else
9017 {
9018 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9019 rnd = Math.RandomInt(0,chances);
9020
9021 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9022 {
9024 }
9025 }
9026 }
9027 }
9028
9030 {
9031 if (GetInventory().GetCargo())
9032 {
9033 int item_count = GetInventory().GetCargo().GetItemCount();
9034 if (item_count > 0)
9035 {
9036 int random_pick = Math.RandomInt(0, item_count);
9038 if (!item.IsExplosive())
9039 {
9040 item.AddHealth("","",damage);
9041 return true;
9042 }
9043 }
9044 }
9045 return false;
9046 }
9047
9049 {
9050 int attachment_count = GetInventory().AttachmentCount();
9051 if (attachment_count > 0)
9052 {
9053 int random_pick = Math.RandomInt(0, attachment_count);
9054 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9055 if (!attachment.IsExplosive())
9056 {
9057 attachment.AddHealth("","",damage);
9058 return true;
9059 }
9060 }
9061 return false;
9062 }
9063
9065 {
9067 }
9068
9070 {
9072 return GetInventory().CanRemoveEntity();
9073
9074 return false;
9075 }
9076
9078 {
9080 return;
9081
9083 {
9084 if (ScriptInputUserData.CanStoreInputUserData())
9085 {
9086 ScriptInputUserData ctx = new ScriptInputUserData;
9091 ctx.
Write(destination_entity);
9095 }
9096 }
9097 else if (!
GetGame().IsMultiplayer())
9098 {
9100 }
9101 }
9102
9104 {
9106 return;
9107
9108 float split_quantity_new;
9112 InventoryLocation loc = new InventoryLocation;
9113
9114 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9115 {
9117 split_quantity_new = stack_max;
9118 else
9120
9121 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9122 if (new_item)
9123 {
9124 new_item.SetResultOfSplit(true);
9125 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9127 new_item.SetQuantity(split_quantity_new);
9128 }
9129 }
9130 else if (destination_entity && slot_id == -1)
9131 {
9132 if (quantity > stack_max)
9133 split_quantity_new = stack_max;
9134 else
9135 split_quantity_new = quantity;
9136
9138 {
9141 }
9142
9143 if (new_item)
9144 {
9145 new_item.SetResultOfSplit(true);
9146 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9148 new_item.SetQuantity(split_quantity_new);
9149 }
9150 }
9151 else
9152 {
9153 if (stack_max != 0)
9154 {
9156 {
9158 }
9159
9160 if (split_quantity_new == 0)
9161 {
9162 if (!
GetGame().IsMultiplayer())
9163 player.PhysicalPredictiveDropItem(this);
9164 else
9165 player.ServerDropEntity(this);
9166 return;
9167 }
9168
9170
9171 if (new_item)
9172 {
9173 new_item.SetResultOfSplit(true);
9174 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9176 new_item.SetQuantity(stack_max);
9177 new_item.PlaceOnSurface();
9178 }
9179 }
9180 }
9181 }
9182
9184 {
9186 return;
9187
9188 float split_quantity_new;
9192 InventoryLocation loc = new InventoryLocation;
9193
9194 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9195 {
9197 split_quantity_new = stack_max;
9198 else
9200
9201 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9202 if (new_item)
9203 {
9204 new_item.SetResultOfSplit(true);
9205 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9207 new_item.SetQuantity(split_quantity_new);
9208 }
9209 }
9210 else if (destination_entity && slot_id == -1)
9211 {
9212 if (quantity > stack_max)
9213 split_quantity_new = stack_max;
9214 else
9215 split_quantity_new = quantity;
9216
9218 {
9221 }
9222
9223 if (new_item)
9224 {
9225 new_item.SetResultOfSplit(true);
9226 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9228 new_item.SetQuantity(split_quantity_new);
9229 }
9230 }
9231 else
9232 {
9233 if (stack_max != 0)
9234 {
9236 {
9238 }
9239
9241
9242 if (new_item)
9243 {
9244 new_item.SetResultOfSplit(true);
9245 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9247 new_item.SetQuantity(stack_max);
9248 new_item.PlaceOnSurface();
9249 }
9250 }
9251 }
9252 }
9253
9255 {
9257 return;
9258
9260 {
9261 if (ScriptInputUserData.CanStoreInputUserData())
9262 {
9263 ScriptInputUserData ctx = new ScriptInputUserData;
9268 dst.WriteToContext(ctx);
9270 }
9271 }
9272 else if (!
GetGame().IsMultiplayer())
9273 {
9275 }
9276 }
9277
9279 {
9281 return;
9282
9284 {
9285 if (ScriptInputUserData.CanStoreInputUserData())
9286 {
9287 ScriptInputUserData ctx = new ScriptInputUserData;
9292 ctx.
Write(destination_entity);
9298 }
9299 }
9300 else if (!
GetGame().IsMultiplayer())
9301 {
9303 }
9304 }
9305
9307 {
9309 }
9310
9312 {
9314 return this;
9315
9317 float split_quantity_new;
9319 if (dst.IsValid())
9320 {
9321 int slot_id = dst.GetSlot();
9323
9324 if (quantity > stack_max)
9325 split_quantity_new = stack_max;
9326 else
9327 split_quantity_new = quantity;
9328
9330
9331 if (new_item)
9332 {
9333 new_item.SetResultOfSplit(true);
9334 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9337 }
9338
9339 return new_item;
9340 }
9341
9342 return null;
9343 }
9344
9346 {
9348 return;
9349
9351 float split_quantity_new;
9353 if (destination_entity)
9354 {
9356 if (quantity > stackable)
9357 split_quantity_new = stackable;
9358 else
9359 split_quantity_new = quantity;
9360
9361 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9362 if (new_item)
9363 {
9364 new_item.SetResultOfSplit(true);
9365 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9367 new_item.SetQuantity(split_quantity_new);
9368 }
9369 }
9370 }
9371
9373 {
9375 return;
9376
9378 {
9379 if (ScriptInputUserData.CanStoreInputUserData())
9380 {
9381 ScriptInputUserData ctx = new ScriptInputUserData;
9386 ItemBase destination_entity =
this;
9387 ctx.
Write(destination_entity);
9391 }
9392 }
9393 else if (!
GetGame().IsMultiplayer())
9394 {
9396 }
9397 }
9398
9400 {
9402 return;
9403
9405 float split_quantity_new;
9407 if (player)
9408 {
9410 if (quantity > stackable)
9411 split_quantity_new = stackable;
9412 else
9413 split_quantity_new = quantity;
9414
9415 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9416 new_item =
ItemBase.Cast(in_hands);
9417 if (new_item)
9418 {
9419 new_item.SetResultOfSplit(true);
9420 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9422 new_item.SetQuantity(split_quantity_new);
9423 }
9424 }
9425 }
9426
9428 {
9430 return;
9431
9433 float split_quantity_new = Math.Floor(quantity * 0.5);
9434
9436
9437 if (new_item)
9438 {
9439 if (new_item.GetQuantityMax() < split_quantity_new)
9440 {
9441 split_quantity_new = new_item.GetQuantityMax();
9442 }
9443
9444 new_item.SetResultOfSplit(true);
9445 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9446
9448 {
9451 }
9452 else
9453 {
9456 }
9457 }
9458 }
9459
9461 {
9463 return;
9464
9466 float split_quantity_new = Math.Floor(quantity / 2);
9467
9468 InventoryLocation invloc = new InventoryLocation;
9470
9472 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9473
9474 if (new_item)
9475 {
9476 if (new_item.GetQuantityMax() < split_quantity_new)
9477 {
9478 split_quantity_new = new_item.GetQuantityMax();
9479 }
9481 {
9484 }
9485 else
9486 {
9489 }
9490 }
9491 }
9492
9495 {
9496 SetWeightDirty();
9498
9499 if (parent)
9500 parent.OnAttachmentQuantityChangedEx(this, delta);
9501
9503 {
9505 {
9507 }
9509 {
9510 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9512 }
9513 }
9514
9515 }
9516
9519 {
9520
9521 }
9522
9525 {
9527 }
9528
9530 {
9531 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9532
9534 {
9535 if (newLevel == GameConstants.STATE_RUINED)
9536 {
9538 EntityAI parent = GetHierarchyParent();
9539 if (parent && parent.IsFireplace())
9540 {
9541 CargoBase cargo = GetInventory().GetCargo();
9542 if (cargo)
9543 {
9545 {
9547 }
9548 }
9549 }
9550 }
9551
9553 {
9554
9556 return;
9557 }
9558
9559 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9560 {
9562 }
9563 }
9564 }
9565
9566
9568 {
9569 super.OnRightClick();
9570
9572 {
9574 {
9575 if (ScriptInputUserData.CanStoreInputUserData())
9576 {
9577 vector m4[4];
9579
9580 EntityAI root = GetHierarchyRoot();
9581
9582 InventoryLocation dst = new InventoryLocation;
9584 {
9585 if (root)
9586 {
9587 root.GetTransform(m4);
9589 }
9590 else
9591 GetInventory().GetCurrentInventoryLocation(dst);
9592 }
9593 else
9594 {
9596
9597
9598 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9599 {
9600 if (root)
9601 {
9602 root.GetTransform(m4);
9604 }
9605 else
9606 GetInventory().GetCurrentInventoryLocation(dst);
9607 }
9608 else
9609 {
9610 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9611 }
9612 }
9613
9614 ScriptInputUserData ctx = new ScriptInputUserData;
9622 }
9623 }
9624 else if (!
GetGame().IsMultiplayer())
9625 {
9627 }
9628 }
9629 }
9630
9631 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9632 {
9633
9634 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9635 return false;
9636
9637 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9638 return false;
9639
9640
9642 return false;
9643
9644
9645 Magazine mag = Magazine.Cast(this);
9646 if (mag)
9647 {
9648 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9649 return false;
9650
9651 if (stack_max_limit)
9652 {
9653 Magazine other_mag = Magazine.Cast(other_item);
9654 if (other_item)
9655 {
9656 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9657 return false;
9658 }
9659
9660 }
9661 }
9662 else
9663 {
9664
9666 return false;
9667
9669 return false;
9670 }
9671
9672 PlayerBase player = null;
9673 if (CastTo(player, GetHierarchyRootPlayer()))
9674 {
9675 if (player.GetInventory().HasAttachment(this))
9676 return false;
9677
9678 if (player.IsItemsToDelete())
9679 return false;
9680 }
9681
9682 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9683 return false;
9684
9685 int slotID;
9687 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9688 return false;
9689
9690 return true;
9691 }
9692
9694 {
9696 }
9697
9699 {
9700 return m_IsResultOfSplit;
9701 }
9702
9704 {
9705 m_IsResultOfSplit = value;
9706 }
9707
9709 {
9711 }
9712
9714 {
9715 float other_item_quantity = other_item.GetQuantity();
9716 float this_free_space;
9717
9719
9721
9722 if (other_item_quantity > this_free_space)
9723 {
9724 return this_free_space;
9725 }
9726 else
9727 {
9728 return other_item_quantity;
9729 }
9730 }
9731
9733 {
9735 }
9736
9738 {
9740 return;
9741
9742 if (!IsMagazine() && other_item)
9743 {
9745 if (quantity_used != 0)
9746 {
9747 float hp1 = GetHealth01("","");
9748 float hp2 = other_item.GetHealth01("","");
9749 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9750 hpResult = hpResult / (
GetQuantity() + quantity_used);
9751
9752 hpResult *= GetMaxHealth();
9753 Math.Round(hpResult);
9754 SetHealth("", "Health", hpResult);
9755
9757 other_item.AddQuantity(-quantity_used);
9758 }
9759 }
9761 }
9762
9764 {
9765 #ifdef SERVER
9766 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9767 GetHierarchyParent().IncreaseLifetimeUp();
9768 #endif
9769 };
9770
9772 {
9773 PlayerBase p = PlayerBase.Cast(player);
9774
9775 array<int> recipesIds = p.m_Recipes;
9776 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9777 if (moduleRecipesManager)
9778 {
9779 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9780 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9781 }
9782
9783 for (int i = 0;i < recipesIds.Count(); i++)
9784 {
9785 int key = recipesIds.Get(i);
9786 string recipeName = moduleRecipesManager.GetRecipeName(key);
9788 }
9789 }
9790
9791
9792 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9793 {
9794 super.GetDebugActions(outputList);
9795
9796
9801
9802
9806
9810
9811
9814
9815
9817 {
9820 }
9821
9823
9826
9830 }
9831
9832
9833
9834
9836 {
9837 super.OnAction(action_id, player, ctx);
9838 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9839 {
9840 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9841 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9842 PlayerBase p = PlayerBase.Cast(player);
9843 if (
EActions.RECIPES_RANGE_START < 1000)
9844 {
9845 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9846 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9847 }
9848 }
9849 #ifndef SERVER
9850 else if (action_id ==
EActions.WATCH_PLAYER)
9851 {
9852 PluginDeveloper.SetDeveloperItemClientEx(player);
9853 }
9854 #endif
9856 {
9857 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9858 {
9859 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9860 OnDebugButtonPressServer(id + 1);
9861 }
9862
9863 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9864 {
9865 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9867 }
9868
9869 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9870 {
9871 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9873 }
9874
9875 else if (action_id ==
EActions.ADD_QUANTITY)
9876 {
9877 if (IsMagazine())
9878 {
9879 Magazine mag = Magazine.Cast(this);
9880 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9881 }
9882 else
9883 {
9885 }
9886
9887 if (m_EM)
9888 {
9889 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9890 }
9891
9892 }
9893
9894 else if (action_id ==
EActions.REMOVE_QUANTITY)
9895 {
9896 if (IsMagazine())
9897 {
9898 Magazine mag2 = Magazine.Cast(this);
9899 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9900 }
9901 else
9902 {
9904 }
9905 if (m_EM)
9906 {
9907 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9908 }
9909
9910 }
9911
9912 else if (action_id ==
EActions.SET_QUANTITY_0)
9913 {
9915
9916 if (m_EM)
9917 {
9918 m_EM.SetEnergy(0);
9919 }
9920 }
9921
9922 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9923 {
9925
9926 if (m_EM)
9927 {
9928 m_EM.SetEnergy(m_EM.GetEnergyMax());
9929 }
9930 }
9931
9932 else if (action_id ==
EActions.ADD_HEALTH)
9933 {
9934 AddHealth("","",GetMaxHealth("","Health")/5);
9935 }
9936 else if (action_id ==
EActions.REMOVE_HEALTH)
9937 {
9938 AddHealth("","",-GetMaxHealth("","Health")/5);
9939 }
9940 else if (action_id ==
EActions.DESTROY_HEALTH)
9941 {
9942 SetHealth01("","",0);
9943 }
9944 else if (action_id ==
EActions.WATCH_ITEM)
9945 {
9947 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9948 #ifdef DEVELOPER
9949 SetDebugDeveloper_item(this);
9950 #endif
9951 }
9952
9953 else if (action_id ==
EActions.ADD_TEMPERATURE)
9954 {
9955 AddTemperature(20);
9956
9957 }
9958
9959 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9960 {
9961 AddTemperature(-20);
9962
9963 }
9964
9965 else if (action_id ==
EActions.FLIP_FROZEN)
9966 {
9967 SetFrozen(!GetIsFrozen());
9968
9969 }
9970
9971 else if (action_id ==
EActions.ADD_WETNESS)
9972 {
9974
9975 }
9976
9977 else if (action_id ==
EActions.REMOVE_WETNESS)
9978 {
9980
9981 }
9982
9983 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9984 {
9987
9988
9989 }
9990
9991 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9992 {
9995 }
9996
9997 else if (action_id ==
EActions.MAKE_SPECIAL)
9998 {
9999 auto debugParams = DebugSpawnParams.WithPlayer(player);
10000 OnDebugSpawnEx(debugParams);
10001 }
10002
10003 else if (action_id ==
EActions.DELETE)
10004 {
10005 Delete();
10006 }
10007
10008 }
10009
10010
10011 return false;
10012 }
10013
10014
10015
10016
10020
10023
10024
10025
10027 {
10028 return false;
10029 }
10030
10031
10033 {
10034 return true;
10035 }
10036
10037
10039 {
10040 return true;
10041 }
10042
10043
10044
10046 {
10047 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10049 }
10050
10053 {
10054 return null;
10055 }
10056
10058 {
10059 return false;
10060 }
10061
10063 {
10064 return false;
10065 }
10066
10070
10071
10073 {
10074 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10075 return module_repairing.CanRepair(this, item_repair_kit);
10076 }
10077
10078
10079 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10080 {
10081 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10082 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10083 }
10084
10085
10087 {
10088
10089
10090
10091
10092
10093
10094
10095
10096 return 1;
10097 }
10098
10099
10100
10102 {
10104 }
10105
10106
10107
10109 {
10111 }
10112
10113
10122 {
10123 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10124
10125 if (player)
10126 {
10127 player.MessageStatus(text);
10128 }
10129 }
10130
10131
10140 {
10141 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10142
10143 if (player)
10144 {
10145 player.MessageAction(text);
10146 }
10147 }
10148
10149
10158 {
10159 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10160
10161 if (player)
10162 {
10163 player.MessageFriendly(text);
10164 }
10165 }
10166
10167
10176 {
10177 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10178
10179 if (player)
10180 {
10181 player.MessageImportant(text);
10182 }
10183 }
10184
10186 {
10187 return true;
10188 }
10189
10190
10191 override bool KindOf(
string tag)
10192 {
10193 bool found = false;
10194 string item_name = this.
GetType();
10197
10198 int array_size = item_tag_array.Count();
10199 for (int i = 0; i < array_size; i++)
10200 {
10201 if (item_tag_array.Get(i) == tag)
10202 {
10203 found = true;
10204 break;
10205 }
10206 }
10207 return found;
10208 }
10209
10210
10212 {
10213
10214 super.OnRPC(sender, rpc_type,ctx);
10215
10216
10217 switch (rpc_type)
10218 {
10219 #ifndef SERVER
10220 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10221 Param2<bool, string> p = new Param2<bool, string>(false, "");
10222
10224 return;
10225
10226 bool play = p.param1;
10227 string soundSet = p.param2;
10228
10229 if (play)
10230 {
10232 {
10234 {
10236 }
10237 }
10238 else
10239 {
10241 }
10242 }
10243 else
10244 {
10246 }
10247
10248 break;
10249 #endif
10250
10251 }
10252
10254 {
10256 }
10257 }
10258
10259
10260
10261
10263 {
10264 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10265 return plugin.GetID(
name);
10266 }
10267
10269 {
10270 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10271 return plugin.GetName(id);
10272 }
10273
10276 {
10277
10278
10279 int varFlags;
10280 if (!ctx.
Read(varFlags))
10281 return;
10282
10283 if (varFlags & ItemVariableFlags.FLOAT)
10284 {
10286 }
10287 }
10288
10290 {
10291
10292 super.SerializeNumericalVars(floats_out);
10293
10294
10295
10297 {
10299 }
10300
10302 {
10304 }
10305
10307 {
10309 }
10310
10312 {
10317 }
10318
10320 {
10322 }
10323 }
10324
10326 {
10327
10328 super.DeSerializeNumericalVars(floats);
10329
10330
10331 int index = 0;
10332 int mask = Math.Round(floats.Get(index));
10333
10334 index++;
10335
10337 {
10339 {
10341 }
10342 else
10343 {
10344 float quantity = floats.Get(index);
10345 SetQuantity(quantity,
true,
false,
false,
false);
10346 }
10347 index++;
10348 }
10349
10351 {
10352 float wet = floats.Get(index);
10354 index++;
10355 }
10356
10358 {
10359 int liquidtype = Math.Round(floats.Get(index));
10361 index++;
10362 }
10363
10365 {
10367 index++;
10369 index++;
10371 index++;
10373 index++;
10374 }
10375
10377 {
10378 int cleanness = Math.Round(floats.Get(index));
10380 index++;
10381 }
10382 }
10383
10385 {
10386 super.WriteVarsToCTX(ctx);
10387
10388
10390 {
10392 }
10393
10395 {
10397 }
10398
10400 {
10402 }
10403
10405 {
10406 int r,g,b,a;
10412 }
10413
10415 {
10417 }
10418 }
10419
10421 {
10422 if (!super.ReadVarsFromCTX(ctx,version))
10423 return false;
10424
10425 int intValue;
10426 float value;
10427
10428 if (version < 140)
10429 {
10430 if (!ctx.
Read(intValue))
10431 return false;
10432
10433 m_VariablesMask = intValue;
10434 }
10435
10437 {
10438 if (!ctx.
Read(value))
10439 return false;
10440
10442 {
10444 }
10445 else
10446 {
10448 }
10449 }
10450
10451 if (version < 140)
10452 {
10454 {
10455 if (!ctx.
Read(value))
10456 return false;
10457 SetTemperatureDirect(value);
10458 }
10459 }
10460
10462 {
10463 if (!ctx.
Read(value))
10464 return false;
10466 }
10467
10469 {
10470 if (!ctx.
Read(intValue))
10471 return false;
10473 }
10474
10476 {
10477 int r,g,b,a;
10479 return false;
10481 return false;
10483 return false;
10485 return false;
10486
10488 }
10489
10491 {
10492 if (!ctx.
Read(intValue))
10493 return false;
10495 }
10496
10497 if (version >= 138 && version < 140)
10498 {
10500 {
10501 if (!ctx.
Read(intValue))
10502 return false;
10503 SetFrozen(intValue);
10504 }
10505 }
10506
10507 return true;
10508 }
10509
10510
10512 {
10515 {
10517 }
10518
10519 if (!super.OnStoreLoad(ctx, version))
10520 {
10522 return false;
10523 }
10524
10525 if (version >= 114)
10526 {
10527 bool hasQuickBarIndexSaved;
10528
10529 if (!ctx.
Read(hasQuickBarIndexSaved))
10530 {
10532 return false;
10533 }
10534
10535 if (hasQuickBarIndexSaved)
10536 {
10537 int itmQBIndex;
10538
10539
10540 if (!ctx.
Read(itmQBIndex))
10541 {
10543 return false;
10544 }
10545
10546 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10547 if (itmQBIndex != -1 && parentPlayer)
10548 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10549 }
10550 }
10551 else
10552 {
10553
10554 PlayerBase player;
10555 int itemQBIndex;
10556 if (version ==
int.
MAX)
10557 {
10558 if (!ctx.
Read(itemQBIndex))
10559 {
10561 return false;
10562 }
10563 }
10564 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10565 {
10566
10567 if (!ctx.
Read(itemQBIndex))
10568 {
10570 return false;
10571 }
10572 if (itemQBIndex != -1 && player)
10573 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10574 }
10575 }
10576
10577 if (version < 140)
10578 {
10579
10580 if (!LoadVariables(ctx, version))
10581 {
10583 return false;
10584 }
10585 }
10586
10587
10589 {
10591 return false;
10592 }
10593 if (version >= 132)
10594 {
10596 if (raib)
10597 {
10599 {
10601 return false;
10602 }
10603 }
10604 }
10605
10607 return true;
10608 }
10609
10610
10611
10613 {
10614 super.OnStoreSave(ctx);
10615
10616 PlayerBase player;
10617 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10618 {
10620
10621 int itemQBIndex = -1;
10622 itemQBIndex = player.FindQuickBarEntityIndex(this);
10623 ctx.
Write(itemQBIndex);
10624 }
10625 else
10626 {
10628 }
10629
10631
10633 if (raib)
10634 {
10636 }
10637 }
10638
10639
10641 {
10642 super.AfterStoreLoad();
10643
10645 {
10647 }
10648
10650 {
10653 }
10654 }
10655
10657 {
10658 super.EEOnAfterLoad();
10659
10661 {
10663 }
10664
10667 }
10668
10670 {
10671 return false;
10672 }
10673
10674
10675
10677 {
10679 {
10680 #ifdef PLATFORM_CONSOLE
10681
10683 {
10685 if (menu)
10686 {
10688 }
10689 }
10690 #endif
10691 }
10692
10694 {
10697 }
10698
10700 {
10701 SetWeightDirty();
10703 }
10705 {
10708 }
10709
10711 {
10714 }
10716 {
10719 }
10720
10721 super.OnVariablesSynchronized();
10722 }
10723
10724
10725
10727 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10728 {
10729 if (!IsServerCheck(allow_client))
10730 return false;
10731
10733 return false;
10734
10737
10738 if (value <= (min + 0.001))
10739 value = min;
10740
10741 if (value == min)
10742 {
10743 if (destroy_config)
10744 {
10745 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10746 if (dstr)
10747 {
10749 this.Delete();
10750 return true;
10751 }
10752 }
10753 else if (destroy_forced)
10754 {
10756 this.Delete();
10757 return true;
10758 }
10759
10761 }
10762
10765
10767 {
10769
10770 if (delta)
10772 }
10773
10775
10776 return false;
10777 }
10778
10779
10781 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10782 {
10784 }
10785
10787 {
10790 }
10791
10793 {
10796 }
10797
10800 {
10801 float value_clamped = Math.Clamp(value, 0, 1);
10803 SetQuantity(result, destroy_config, destroy_forced);
10804 }
10805
10806
10809 {
10811 }
10812
10814 {
10816 }
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10828 {
10829 int slot = -1;
10830 if (GetInventory())
10831 {
10832 InventoryLocation il = new InventoryLocation;
10833 GetInventory().GetCurrentInventoryLocation(il);
10835 }
10836
10838 }
10839
10841 {
10842 float quantity_max = 0;
10843
10845 {
10846 if (attSlotID != -1)
10847 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10848
10849 if (quantity_max <= 0)
10851 }
10852
10853 if (quantity_max <= 0)
10855
10856 return quantity_max;
10857 }
10858
10860 {
10862 }
10863
10865 {
10867 }
10868
10869
10871 {
10873 }
10874
10876 {
10878 }
10879
10881 {
10883 }
10884
10885
10887 {
10888
10889 float weightEx = GetWeightEx();
10890 float special = GetInventoryAndCargoWeight();
10891 return weightEx - special;
10892 }
10893
10894
10896 {
10898 }
10899
10901 {
10903 {
10904 #ifdef DEVELOPER
10905 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10906 {
10907 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10909 }
10910 #endif
10911
10912 return GetQuantity() * GetConfigWeightModified();
10913 }
10914 else if (HasEnergyManager())
10915 {
10916 #ifdef DEVELOPER
10917 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10918 {
10919 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10920 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10921 }
10922 #endif
10923 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10924 }
10925 else
10926 {
10927 #ifdef DEVELOPER
10928 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10929 {
10930 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10931 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10932 }
10933 #endif
10934 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10935 }
10936 }
10937
10940 {
10941 int item_count = 0;
10943
10944 if (GetInventory().GetCargo() != NULL)
10945 {
10946 item_count = GetInventory().GetCargo().GetItemCount();
10947 }
10948
10949 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10950 {
10951 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10952 if (item)
10953 item_count += item.GetNumberOfItems();
10954 }
10955 return item_count;
10956 }
10957
10960 {
10961 float weight = 0;
10962 float wetness = 1;
10963 if (include_wetness)
10966 {
10967 weight = wetness * m_ConfigWeight;
10968 }
10970 {
10971 weight = 1;
10972 }
10973 return weight;
10974 }
10975
10976
10977
10979 {
10980 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10981 {
10982 GameInventory inv = GetInventory();
10983 array<EntityAI> items = new array<EntityAI>;
10985 for (int i = 0; i < items.Count(); i++)
10986 {
10988 if (item)
10989 {
10991 }
10992 }
10993 }
10994 }
10995
10996
10997
10998
11000 {
11001 float energy = 0;
11002 if (HasEnergyManager())
11003 {
11004 energy = GetCompEM().GetEnergy();
11005 }
11006 return energy;
11007 }
11008
11009
11011 {
11012 super.OnEnergyConsumed();
11013
11015 }
11016
11018 {
11019 super.OnEnergyAdded();
11020
11022 }
11023
11024
11026 {
11027 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11028 {
11030 {
11031 float energy_0to1 = GetCompEM().GetEnergy0To1();
11033 }
11034 }
11035 }
11036
11037
11039 {
11040 return ConfigGetFloat("heatIsolation");
11041 }
11042
11044 {
11046 }
11047
11049 {
11050 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11051 if (
GetGame().ConfigIsExisting(paramPath))
11053
11054 return 0.0;
11055 }
11056
11058 {
11059 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11060 if (
GetGame().ConfigIsExisting(paramPath))
11062
11063 return 0.0;
11064 }
11065
11066 override void SetWet(
float value,
bool allow_client =
false)
11067 {
11068 if (!IsServerCheck(allow_client))
11069 return;
11070
11073
11075
11076 m_VarWet = Math.Clamp(value, min, max);
11077
11079 {
11082 }
11083 }
11084
11085 override void AddWet(
float value)
11086 {
11088 }
11089
11091 {
11093 }
11094
11096 {
11098 }
11099
11101 {
11103 }
11104
11106 {
11108 }
11109
11111 {
11113 }
11114
11115 override void OnWetChanged(
float newVal,
float oldVal)
11116 {
11119 if (newLevel != oldLevel)
11120 {
11122 }
11123 }
11124
11126 {
11127 SetWeightDirty();
11128 }
11129
11131 {
11132 return GetWetLevelInternal(
m_VarWet);
11133 }
11134
11135
11136
11138 {
11140 }
11141
11143 {
11145 }
11146
11148 {
11150 }
11151
11153 {
11155 }
11156
11157
11158
11160 {
11161 if (ConfigIsExisting("itemModelLength"))
11162 {
11163 return ConfigGetFloat("itemModelLength");
11164 }
11165 return 0;
11166 }
11167
11169 {
11170 if (ConfigIsExisting("itemAttachOffset"))
11171 {
11172 return ConfigGetFloat("itemAttachOffset");
11173 }
11174 return 0;
11175 }
11176
11177 override void SetCleanness(
int value,
bool allow_client =
false)
11178 {
11179 if (!IsServerCheck(allow_client))
11180 return;
11181
11183
11185
11188 }
11189
11191 {
11193 }
11194
11196 {
11197 return true;
11198 }
11199
11200
11201
11202
11204 {
11206 }
11207
11209 {
11211 }
11212
11213
11214
11215
11216 override void SetColor(
int r,
int g,
int b,
int a)
11217 {
11223 }
11225 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11226 {
11231 }
11232
11234 {
11236 }
11237
11240 {
11241 int r,g,b,a;
11243 r = r/255;
11244 g = g/255;
11245 b = b/255;
11246 a = a/255;
11247 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11248 }
11249
11250
11251
11252 override void SetLiquidType(
int value,
bool allow_client =
false)
11253 {
11254 if (!IsServerCheck(allow_client))
11255 return;
11256
11261 }
11262
11264 {
11265 return ConfigGetInt("varLiquidTypeInit");
11266 }
11267
11269 {
11271 }
11272
11274 {
11276 SetFrozen(false);
11277 }
11278
11281 {
11282 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11283 }
11284
11285
11288 {
11289 PlayerBase nplayer;
11290 if (PlayerBase.CastTo(nplayer, player))
11291 {
11293
11294 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11295 }
11296 }
11297
11298
11301 {
11302 PlayerBase nplayer;
11303 if (PlayerBase.CastTo(nplayer,player))
11304 {
11305
11306 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11307
11308 }
11309
11310
11311 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11312
11313
11314 if (HasEnergyManager())
11315 {
11316 GetCompEM().UpdatePlugState();
11317 }
11318 }
11319
11320
11322 {
11323 super.OnPlacementStarted(player);
11324
11326 }
11327
11328 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11329 {
11331 {
11332 m_AdminLog.OnPlacementComplete(player,
this);
11333 }
11334
11335 super.OnPlacementComplete(player, position, orientation);
11336 }
11337
11338
11339
11340
11341
11343 {
11345 {
11346 return true;
11347 }
11348 else
11349 {
11350 return false;
11351 }
11352 }
11353
11354
11356 {
11358 {
11360 }
11361 }
11362
11363
11365 {
11367 }
11368
11370 {
11372 }
11373
11374 override void InsertAgent(
int agent,
float count = 1)
11375 {
11376 if (count < 1)
11377 return;
11378
11380 }
11381
11384 {
11386 }
11387
11388
11390 {
11392 }
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11436 {
11438 return false;
11439 return true;
11440 }
11441
11443 {
11444
11446 }
11447
11448
11451 {
11452 super.CheckForRoofLimited(timeTresholdMS);
11453
11455 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11456 {
11457 m_PreviousRoofTestTime = time;
11458 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11459 }
11460 }
11461
11462
11464 {
11466 {
11467 return 0;
11468 }
11469
11470 if (GetInventory().GetAttachmentSlotsCount() != 0)
11471 {
11472 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11473 if (filter)
11474 return filter.GetProtectionLevel(type, false, system);
11475 else
11476 return 0;
11477 }
11478
11479 string subclassPath, entryName;
11480
11481 switch (type)
11482 {
11484 entryName = "biological";
11485 break;
11487 entryName = "chemical";
11488 break;
11489 default:
11490 entryName = "biological";
11491 break;
11492 }
11493
11494 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11495
11497 }
11498
11499
11500
11503 {
11504 if (!IsMagazine())
11506
11508 }
11509
11510
11511
11512
11513
11518 {
11519 return true;
11520 }
11521
11523 {
11525 }
11526
11527
11528
11529
11530
11532 {
11533 if (parent)
11534 {
11535 if (parent.IsInherited(DayZInfected))
11536 return true;
11537
11538 if (!parent.IsRuined())
11539 return true;
11540 }
11541
11542 return true;
11543 }
11544
11546 {
11547 if (!super.CanPutAsAttachment(parent))
11548 {
11549 return false;
11550 }
11551
11552 if (!IsRuined() && !parent.IsRuined())
11553 {
11554 return true;
11555 }
11556
11557 return false;
11558 }
11559
11561 {
11562
11563
11564
11565
11566 return super.CanReceiveItemIntoCargo(item);
11567 }
11568
11570 {
11571
11572
11573
11574
11575 GameInventory attachmentInv = attachment.GetInventory();
11577 {
11578 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11579 return false;
11580 }
11581
11582 InventoryLocation loc = new InventoryLocation();
11583 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11584 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11585 return false;
11586
11587 return super.CanReceiveAttachment(attachment, slotId);
11588 }
11589
11591 {
11592 if (!super.CanReleaseAttachment(attachment))
11593 return false;
11594
11595 return GetInventory().AreChildrenAccessible();
11596 }
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11619 {
11620 int id = muzzle_owner.GetMuzzleID();
11621 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11622
11623 if (WPOF_array)
11624 {
11625 for (int i = 0; i < WPOF_array.Count(); i++)
11626 {
11627 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11628
11629 if (WPOF)
11630 {
11631 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11632 }
11633 }
11634 }
11635 }
11636
11637
11639 {
11640 int id = muzzle_owner.GetMuzzleID();
11642
11643 if (WPOBE_array)
11644 {
11645 for (int i = 0; i < WPOBE_array.Count(); i++)
11646 {
11647 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11648
11649 if (WPOBE)
11650 {
11651 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11652 }
11653 }
11654 }
11655 }
11656
11657
11659 {
11660 int id = muzzle_owner.GetMuzzleID();
11661 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11662
11663 if (WPOOH_array)
11664 {
11665 for (int i = 0; i < WPOOH_array.Count(); i++)
11666 {
11667 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11668
11669 if (WPOOH)
11670 {
11671 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11672 }
11673 }
11674 }
11675 }
11676
11677
11679 {
11680 int id = muzzle_owner.GetMuzzleID();
11681 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11682
11683 if (WPOOH_array)
11684 {
11685 for (int i = 0; i < WPOOH_array.Count(); i++)
11686 {
11687 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11688
11689 if (WPOOH)
11690 {
11691 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11692 }
11693 }
11694 }
11695 }
11696
11697
11699 {
11700 int id = muzzle_owner.GetMuzzleID();
11701 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11702
11703 if (WPOOH_array)
11704 {
11705 for (int i = 0; i < WPOOH_array.Count(); i++)
11706 {
11707 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11708
11709 if (WPOOH)
11710 {
11711 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11712 }
11713 }
11714 }
11715 }
11716
11717
11718
11720 {
11722 {
11723 return true;
11724 }
11725
11726 return false;
11727 }
11728
11730 {
11732 {
11733 return true;
11734 }
11735
11736 return false;
11737 }
11738
11740 {
11742 {
11743 return true;
11744 }
11745
11746 return false;
11747 }
11748
11750 {
11751 return false;
11752 }
11753
11756 {
11757 return UATimeSpent.DEFAULT_DEPLOY;
11758 }
11759
11760
11761
11762
11764 {
11766 SetSynchDirty();
11767 }
11768
11770 {
11772 }
11773
11774
11776 {
11777 return false;
11778 }
11779
11782 {
11783 string att_type = "None";
11784
11785 if (ConfigIsExisting("soundAttType"))
11786 {
11787 att_type = ConfigGetString("soundAttType");
11788 }
11789
11791 }
11792
11794 {
11796 }
11797
11798
11799
11800
11801
11805
11807 {
11810
11812 }
11813
11814
11816 {
11818 return;
11819
11821
11824
11827
11828 SoundParameters params = new SoundParameters();
11832 }
11833
11834
11836 {
11838 return;
11839
11841 SetSynchDirty();
11842
11845 }
11846
11847
11849 {
11851 return;
11852
11854 SetSynchDirty();
11855
11858 }
11859
11861 {
11863 }
11864
11866 {
11868 }
11869
11872 {
11873 if (!
GetGame().IsDedicatedServer())
11874 {
11875 if (ConfigIsExisting("attachSoundSet"))
11876 {
11877 string cfg_path = "";
11878 string soundset = "";
11879 string type_name =
GetType();
11880
11883 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11884 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11885
11886 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11887 {
11888 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11889 {
11890 if (cfg_slot_array[i] == slot_type)
11891 {
11892 soundset = cfg_soundset_array[i];
11893 break;
11894 }
11895 }
11896 }
11897
11898 if (soundset != "")
11899 {
11900 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11902 }
11903 }
11904 }
11905 }
11906
11908 {
11909
11910 }
11911
11912 void OnApply(PlayerBase player);
11913
11915 {
11916 return 1.0;
11917 };
11918
11920 {
11922 }
11923
11925 {
11927 }
11928
11930
11932 {
11933 SetDynamicPhysicsLifeTime(0.01);
11935 }
11936
11938 {
11939 array<string> zone_names = new array<string>;
11940 GetDamageZones(zone_names);
11941 for (int i = 0; i < zone_names.Count(); i++)
11942 {
11943 SetHealthMax(zone_names.Get(i),"Health");
11944 }
11945 SetHealthMax("","Health");
11946 }
11947
11950 {
11951 float global_health = GetHealth01("","Health");
11952 array<string> zones = new array<string>;
11953 GetDamageZones(zones);
11954
11955 for (int i = 0; i < zones.Count(); i++)
11956 {
11957 SetHealth01(zones.Get(i),"Health",global_health);
11958 }
11959 }
11960
11963 {
11964 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11965 }
11966
11968 {
11969 if (!hasRootAsPlayer)
11970 {
11971 if (refParentIB)
11972 {
11973
11974 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11975 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11976
11977 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11978 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11979
11982 }
11983 else
11984 {
11985
11988 }
11989 }
11990 }
11991
11993 {
11995 {
11996 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11997 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11998 {
11999 float heatPermCoef = 1.0;
12001 while (ent)
12002 {
12003 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12004 ent = ent.GetHierarchyParent();
12005 }
12006
12007 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12008 }
12009 }
12010 }
12011
12013 {
12014
12015 EntityAI parent = GetHierarchyParent();
12016 if (!parent)
12017 {
12018 hasParent = false;
12019 hasRootAsPlayer = false;
12020 }
12021 else
12022 {
12023 hasParent = true;
12024 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12025 refParentIB =
ItemBase.Cast(parent);
12026 }
12027 }
12028
12029 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12030 {
12031
12032 }
12033
12035 {
12036
12037 return false;
12038 }
12039
12041 {
12042
12043
12044 return false;
12045 }
12046
12048 {
12049
12050 return false;
12051 }
12052
12055 {
12056 return !GetIsFrozen() &&
IsOpen();
12057 }
12058
12060 {
12061 bool hasParent = false, hasRootAsPlayer = false;
12063
12064 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12065 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12066
12067 if (wwtu || foodDecay)
12068 {
12072
12073 if (processWetness || processTemperature || processDecay)
12074 {
12076
12077 if (processWetness)
12078 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12079
12080 if (processTemperature)
12082
12083 if (processDecay)
12084 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12085 }
12086 }
12087 }
12088
12091 {
12093 }
12094
12096 {
12099
12100 return super.GetTemperatureFreezeThreshold();
12101 }
12102
12104 {
12107
12108 return super.GetTemperatureThawThreshold();
12109 }
12110
12112 {
12115
12116 return super.GetItemOverheatThreshold();
12117 }
12118
12120 {
12122 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12123
12124 return super.GetTemperatureFreezeTime();
12125 }
12126
12128 {
12130 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12131
12132 return super.GetTemperatureThawTime();
12133 }
12134
12139
12141 {
12142 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12143 }
12144
12146 {
12147 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12148 }
12149
12152 {
12154 }
12155
12157 {
12159 }
12160
12162 {
12164 }
12165
12168 {
12169 return null;
12170 }
12171
12174 {
12175 return false;
12176 }
12177
12179 {
12181 {
12184 if (!trg)
12185 {
12187 explosive = this;
12188 }
12189
12190 explosive.PairRemote(trg);
12192
12193 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12194 trg.SetPersistentPairID(persistentID);
12195 explosive.SetPersistentPairID(persistentID);
12196
12197 return true;
12198 }
12199 return false;
12200 }
12201
12204 {
12205 float ret = 1.0;
12208 ret *= GetHealth01();
12209
12210 return ret;
12211 }
12212
12213 #ifdef DEVELOPER
12214 override void SetDebugItem()
12215 {
12216 super.SetDebugItem();
12217 _itemBase = this;
12218 }
12219
12221 {
12222 string text = super.GetDebugText();
12223
12225 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12226
12227 return text;
12228 }
12229 #endif
12230
12232 {
12233 return true;
12234 }
12235
12237
12239
12241 {
12244 }
12245
12246
12254
12270}
12271
12273{
12275 if (entity)
12276 {
12277 bool is_item = entity.IsInherited(
ItemBase);
12278 if (is_item && full_quantity)
12279 {
12282 }
12283 }
12284 else
12285 {
12287 return NULL;
12288 }
12289 return entity;
12290}
12291
12293{
12294 if (item)
12295 {
12296 if (health > 0)
12297 item.SetHealth("", "", health);
12298
12299 if (item.CanHaveTemperature())
12300 {
12302 if (item.CanFreeze())
12303 item.SetFrozen(false);
12304 }
12305
12306 if (item.HasEnergyManager())
12307 {
12308 if (quantity >= 0)
12309 {
12310 item.GetCompEM().SetEnergy0To1(quantity);
12311 }
12312 else
12313 {
12315 }
12316 }
12317 else if (item.IsMagazine())
12318 {
12319 Magazine mag = Magazine.Cast(item);
12320 if (quantity >= 0)
12321 {
12322 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12323 }
12324 else
12325 {
12327 }
12328
12329 }
12330 else
12331 {
12332 if (quantity >= 0)
12333 {
12334 item.SetQuantityNormalized(quantity, false);
12335 }
12336 else
12337 {
12339 }
12340
12341 }
12342 }
12343}
12344
12345#ifdef DEVELOPER
12347#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.