Send message to owner player in grey color.
7546{
7548 {
7549 return true;
7550 }
7551};
7552
7553
7554
7556{
7560
7562
7565
7566
7567
7568
7569
7578
7584
7589
7594
7615 protected bool m_IsResultOfSplit
7616
7618
7623
7624
7625
7627
7631
7632
7633
7635
7638
7639
7640
7646
7647
7655
7658
7659
7661
7662
7664
7665
7670
7671
7676
7677
7679
7680
7682 {
7687
7688 if (!
GetGame().IsDedicatedServer())
7689 {
7691 {
7693
7695 {
7697 }
7698 }
7699
7702 }
7703
7704 m_OldLocation = null;
7705
7707 {
7709 }
7710
7711 if (ConfigIsExisting("headSelectionsToHide"))
7712 {
7715 }
7716
7718 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7719 {
7721 }
7722
7724
7725 m_IsResultOfSplit = false;
7726
7728 }
7729
7731 {
7732 super.InitItemVariables();
7733
7739 m_Count = ConfigGetInt(
"count");
7740
7743
7748
7751
7756
7768
7772
7773
7776 if (ConfigIsExisting("canBeSplit"))
7777 {
7780 }
7781
7783 if (ConfigIsExisting("itemBehaviour"))
7785
7786
7789 RegisterNetSyncVariableInt("m_VarLiquidType");
7790 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7791
7792 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7793 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7794 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7795
7796 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7797 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7798 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7799 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7800
7801 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7802 RegisterNetSyncVariableBool("m_IsTakeable");
7803 RegisterNetSyncVariableBool("m_IsHologram");
7804
7807 {
7810 }
7811
7813
7815 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7817
7818 }
7819
7821 {
7823 }
7824
7826 {
7829 {
7834 }
7835 }
7836
7837 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7838 {
7840 {
7843 }
7844
7846 }
7847
7849 {
7855 }
7856
7858
7860 {
7862
7863 if (!action)
7864 {
7865 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7866 return;
7867 }
7868
7870 if (!ai)
7871 {
7873 return;
7874 }
7875
7877 if (!action_array)
7878 {
7879 action_array = new array<ActionBase_Basic>;
7881 }
7882 if (LogManager.IsActionLogEnable())
7883 {
7884 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7885 }
7886
7887 if (action_array.Find(action) != -1)
7888 {
7889 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7890 }
7891 else
7892 {
7893 action_array.Insert(action);
7894 }
7895 }
7896
7898 {
7900 ActionBase action = player.GetActionManager().GetAction(actionName);
7903
7904 if (action_array)
7905 {
7906 action_array.RemoveItem(action);
7907 }
7908 }
7909
7910
7911
7913 {
7914 ActionOverrideData overrideData = new ActionOverrideData();
7918
7920 if (!actionMap)
7921 {
7924 }
7925
7926 actionMap.Insert(this.
Type(), overrideData);
7927
7928 }
7929
7931
7933
7934
7936 {
7939
7942
7943 string config_to_search = "CfgVehicles";
7944 string muzzle_owner_config;
7945
7947 {
7948 if (IsInherited(Weapon))
7949 config_to_search = "CfgWeapons";
7950
7951 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7952
7953 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7954
7956
7957 if (config_OnFire_subclass_count > 0)
7958 {
7959 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7960
7961 for (int i = 0; i < config_OnFire_subclass_count; i++)
7962 {
7963 string particle_class = "";
7965 string config_OnFire_entry = config_OnFire_class + particle_class;
7966 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7967 WPOF_array.Insert(WPOF);
7968 }
7969
7970
7972 }
7973 }
7974
7976 {
7977 config_to_search = "CfgWeapons";
7978 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7979
7980 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7981
7983
7984 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7985 {
7986 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7987
7988 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7989 {
7990 string particle_class2 = "";
7992 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7993 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7994 WPOBE_array.Insert(WPOBE);
7995 }
7996
7997
7999 }
8000 }
8001 }
8002
8003
8005 {
8008
8010 {
8011 string config_to_search = "CfgVehicles";
8012
8013 if (IsInherited(Weapon))
8014 config_to_search = "CfgWeapons";
8015
8016 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8017 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8018
8019 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8020 {
8021
8023
8025 {
8027 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8029 return;
8030 }
8031
8034
8035
8036
8038 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8039
8040 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8041 {
8042 string particle_class = "";
8044 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8046
8047 if (entry_type == CT_CLASS)
8048 {
8049 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8050 WPOOH_array.Insert(WPOF);
8051 }
8052 }
8053
8054
8056 }
8057 }
8058 }
8059
8061 {
8063 }
8064
8066 {
8068 {
8070
8073
8076
8077 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8078 }
8079 }
8080
8082 {
8084 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8085
8087 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8088
8090 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8091
8093 {
8095 }
8096 }
8097
8099 {
8101 }
8102
8104 {
8107 else
8109
8111 {
8114 }
8115 else
8116 {
8119
8122 }
8123
8125 }
8126
8128 {
8130 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8131 }
8132
8134 {
8136 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8138 }
8139
8141 {
8143 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8144 }
8145
8147 {
8150
8151 OverheatingParticle OP = new OverheatingParticle();
8156
8158 }
8159
8161 {
8164
8165 return -1;
8166 }
8167
8169 {
8171 {
8174
8175 for (int i = count; i > 0; --i)
8176 {
8177 int id = i - 1;
8180
8183
8184 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8185 {
8186 if (p)
8187 {
8190 }
8191 }
8192 }
8193 }
8194 }
8195
8197 {
8199 {
8201 {
8202 int id = i - 1;
8204
8205 if (OP)
8206 {
8208
8209 if (p)
8210 {
8212 }
8213
8214 delete OP;
8215 }
8216 }
8217
8220 }
8221 }
8222
8225 {
8226 return 0.0;
8227 }
8228
8229
8231 {
8232 return 250;
8233 }
8234
8236 {
8237 return 0;
8238 }
8239
8242 {
8244 return true;
8245
8246 return false;
8247 }
8248
8251 {
8254
8256 {
8258 }
8259 else
8260 {
8261
8263 }
8264
8266 }
8267
8274 {
8275 return -1;
8276 }
8277
8278
8279
8280
8282 {
8284 {
8286 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8287
8288 if (r_index >= 0)
8289 {
8290 InventoryLocation r_il = new InventoryLocation;
8291 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8292
8293 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8296 {
8297 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8298 }
8300 {
8301 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8302 }
8303
8304 }
8305
8306 player.GetHumanInventory().ClearUserReservedLocation(this);
8307 }
8308
8311 }
8312
8313
8314
8315
8317 {
8318 return ItemBase.m_DebugActionsMask;
8319 }
8320
8322 {
8323 return ItemBase.m_DebugActionsMask & mask;
8324 }
8325
8327 {
8328 ItemBase.m_DebugActionsMask = mask;
8329 }
8330
8332 {
8333 ItemBase.m_DebugActionsMask |= mask;
8334 }
8335
8337 {
8338 ItemBase.m_DebugActionsMask &= ~mask;
8339 }
8340
8342 {
8344 {
8346 }
8347 else
8348 {
8350 }
8351 }
8352
8353
8355 {
8356 if (GetEconomyProfile())
8357 {
8358 float q_max = GetEconomyProfile().GetQuantityMax();
8359 if (q_max > 0)
8360 {
8361 float q_min = GetEconomyProfile().GetQuantityMin();
8362 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8363
8365 {
8366 ComponentEnergyManager comp = GetCompEM();
8368 {
8370 }
8371 }
8373 {
8375
8376 }
8377
8378 }
8379 }
8380 }
8381
8384 {
8385 EntityAI parent = GetHierarchyParent();
8386
8387 if (parent)
8388 {
8389 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8390 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8391 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8392 }
8393 }
8394
8397 {
8398 EntityAI parent = GetHierarchyParent();
8399
8400 if (parent)
8401 {
8402 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8403 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8404 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8405 }
8406 }
8407
8409 {
8410
8411
8412
8413
8415
8417 {
8418 if (ScriptInputUserData.CanStoreInputUserData())
8419 {
8420 ScriptInputUserData ctx = new ScriptInputUserData;
8426 ctx.
Write(use_stack_max);
8429
8431 {
8432 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8433 }
8434 }
8435 }
8436 else if (!
GetGame().IsMultiplayer())
8437 {
8439 }
8440 }
8441
8443 {
8445 }
8446
8448 {
8450 }
8451
8453 {
8455 }
8456
8458 {
8459
8460 return false;
8461 }
8462
8464 {
8465 return false;
8466 }
8467
8471 {
8472 return false;
8473 }
8474
8476 {
8477 return "";
8478 }
8479
8481
8483 {
8484 return false;
8485 }
8486
8488 {
8489 return true;
8490 }
8491
8492
8493
8495 {
8496 return true;
8497 }
8498
8500 {
8501 return true;
8502 }
8503
8505 {
8506 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8508 }
8509
8511 {
8513 }
8514
8516 {
8518 if (!is_being_placed)
8520 SetSynchDirty();
8521 }
8522
8523
8525
8527 {
8529 }
8530
8532 {
8534 }
8535
8537 {
8538 return 1;
8539 }
8540
8542 {
8543 return false;
8544 }
8545
8547 {
8549 SetSynchDirty();
8550 }
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8587 {
8588 super.OnMovedInsideCargo(container);
8589
8590 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8591 }
8592
8593 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8594 {
8595 super.EEItemLocationChanged(oldLoc,newLoc);
8596
8597 PlayerBase new_player = null;
8598 PlayerBase old_player = null;
8599
8600 if (newLoc.GetParent())
8601 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8602
8603 if (oldLoc.GetParent())
8604 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8605
8607 {
8608 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8609
8610 if (r_index >= 0)
8611 {
8612 InventoryLocation r_il = new InventoryLocation;
8613 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8614
8615 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8618 {
8619 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8620 }
8622 {
8623 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8624 }
8625
8626 }
8627 }
8628
8630 {
8631 if (new_player)
8632 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8633
8634 if (new_player == old_player)
8635 {
8636
8637 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8638 {
8640 {
8641 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8642 {
8643 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8644 }
8645 }
8646 else
8647 {
8648 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8649 }
8650 }
8651
8652 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8653 {
8654 int type = oldLoc.GetType();
8656 {
8657 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8658 }
8660 {
8661 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8662 }
8663 }
8664 if (!m_OldLocation)
8665 {
8666 m_OldLocation = new InventoryLocation;
8667 }
8668 m_OldLocation.Copy(oldLoc);
8669 }
8670 else
8671 {
8672 if (m_OldLocation)
8673 {
8674 m_OldLocation.Reset();
8675 }
8676 }
8677
8679 }
8680 else
8681 {
8682 if (new_player)
8683 {
8684 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8685 if (res_index >= 0)
8686 {
8687 InventoryLocation il = new InventoryLocation;
8688 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8690 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8693 {
8694 il.
GetParent().GetOnReleaseLock().Invoke(it);
8695 }
8697 {
8699 }
8700
8701 }
8702 }
8704 {
8705
8707 }
8708
8709 if (m_OldLocation)
8710 {
8711 m_OldLocation.Reset();
8712 }
8713 }
8714 }
8715
8716 override void EOnContact(IEntity other, Contact extra)
8717 {
8719 {
8720 int liquidType = -1;
8722 if (impactSpeed > 0.0)
8723 {
8725 #ifndef SERVER
8727 #else
8729 SetSynchDirty();
8730 #endif
8732 }
8733 }
8734
8735 #ifdef SERVER
8736 if (GetCompEM() && GetCompEM().IsPlugged())
8737 {
8738 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8739 GetCompEM().UnplugThis();
8740 }
8741 #endif
8742 }
8743
8745
8747 {
8749 }
8750
8752 {
8753
8754 }
8755
8757 {
8758 super.OnItemLocationChanged(old_owner, new_owner);
8759
8760 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8761 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8762
8763 if (!relatedPlayer && playerNew)
8764 relatedPlayer = playerNew;
8765
8766 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8767 {
8769 if (actionMgr)
8770 {
8771 ActionBase currentAction = actionMgr.GetRunningAction();
8772 if (currentAction)
8774 }
8775 }
8776
8777 Man ownerPlayerOld = null;
8778 Man ownerPlayerNew = null;
8779
8780 if (old_owner)
8781 {
8782 if (old_owner.
IsMan())
8783 {
8784 ownerPlayerOld = Man.Cast(old_owner);
8785 }
8786 else
8787 {
8788 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8789 }
8790 }
8791 else
8792 {
8794 {
8796
8797 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8798 {
8799 GetCompEM().UnplugThis();
8800 }
8801 }
8802 }
8803
8804 if (new_owner)
8805 {
8806 if (new_owner.
IsMan())
8807 {
8808 ownerPlayerNew = Man.Cast(new_owner);
8809 }
8810 else
8811 {
8812 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8813 }
8814 }
8815
8816 if (ownerPlayerOld != ownerPlayerNew)
8817 {
8818 if (ownerPlayerOld)
8819 {
8820 array<EntityAI> subItemsExit = new array<EntityAI>;
8822 for (int i = 0; i < subItemsExit.Count(); i++)
8823 {
8826 }
8827 }
8828
8829 if (ownerPlayerNew)
8830 {
8831 array<EntityAI> subItemsEnter = new array<EntityAI>;
8833 for (int j = 0; j < subItemsEnter.Count(); j++)
8834 {
8837 }
8838 }
8839 }
8840 else if (ownerPlayerNew != null)
8841 {
8842 PlayerBase nplayer;
8843 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8844 {
8845 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8847 for (int k = 0; k < subItemsUpdate.Count(); k++)
8848 {
8850 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8851 }
8852 }
8853 }
8854
8855 if (old_owner)
8856 old_owner.OnChildItemRemoved(this);
8857 if (new_owner)
8858 new_owner.OnChildItemReceived(this);
8859 }
8860
8861
8863 {
8864 super.EEDelete(parent);
8865 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8866 if (player)
8867 {
8869
8870 if (player.IsAlive())
8871 {
8872 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8873 if (r_index >= 0)
8874 {
8875 InventoryLocation r_il = new InventoryLocation;
8876 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8877
8878 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8881 {
8882 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8883 }
8885 {
8886 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8887 }
8888
8889 }
8890
8891 player.RemoveQuickBarEntityShortcut(this);
8892 }
8893 }
8894 }
8895
8897 {
8898 super.EEKilled(killer);
8899
8902 {
8903 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8904 {
8905 if (IsMagazine())
8906 {
8907 if (Magazine.Cast(this).GetAmmoCount() > 0)
8908 {
8910 }
8911 }
8912 else
8913 {
8915 }
8916 }
8917 }
8918 }
8919
8921 {
8922 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8923
8924 super.OnWasAttached(parent, slot_id);
8925
8928
8930 }
8931
8933 {
8934 super.OnWasDetached(parent, slot_id);
8935
8938 }
8939
8941 {
8942 int idx;
8945
8946 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8947 if (inventory_slots.Count() < 1)
8948 {
8949 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8950 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8951 }
8952 else
8953 {
8954 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8955 }
8956
8957 idx = inventory_slots.Find(slot);
8958 if (idx < 0)
8959 return "";
8960
8961 return attach_types.Get(idx);
8962 }
8963
8965 {
8966 int idx = -1;
8967 string slot;
8968
8971
8972 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8973 if (inventory_slots.Count() < 1)
8974 {
8975 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8976 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8977 }
8978 else
8979 {
8980 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8981 if (detach_types.Count() < 1)
8982 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8983 }
8984
8985 for (int i = 0; i < inventory_slots.Count(); i++)
8986 {
8987 slot = inventory_slots.Get(i);
8988 }
8989
8990 if (slot != "")
8991 {
8992 if (detach_types.Count() == 1)
8993 idx = 0;
8994 else
8995 idx = inventory_slots.Find(slot);
8996 }
8997 if (idx < 0)
8998 return "";
8999
9000 return detach_types.Get(idx);
9001 }
9002
9004 {
9005
9007
9008
9009 float min_time = 1;
9010 float max_time = 3;
9011 float delay = Math.RandomFloat(min_time, max_time);
9012
9013 explode_timer.Run(delay, this, "DoAmmoExplosion");
9014 }
9015
9017 {
9018 Magazine magazine = Magazine.Cast(this);
9019 int pop_sounds_count = 6;
9020 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9021
9022
9023 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9024 string sound_name = pop_sounds[ sound_idx ];
9026
9027
9028 magazine.ServerAddAmmoCount(-1);
9029
9030
9031 float min_temp_to_explode = 100;
9032
9033 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9034 {
9036 }
9037 }
9038
9039
9040 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9041 {
9042 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9043
9044 const int CHANCE_DAMAGE_CARGO = 4;
9045 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9046 const int CHANCE_DAMAGE_NOTHING = 2;
9047
9049 {
9050 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9051 int chances;
9052 int rnd;
9053
9054 if (GetInventory().GetCargo())
9055 {
9056 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9057 rnd = Math.RandomInt(0,chances);
9058
9059 if (rnd < CHANCE_DAMAGE_CARGO)
9060 {
9062 }
9063 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9064 {
9066 }
9067 }
9068 else
9069 {
9070 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9071 rnd = Math.RandomInt(0,chances);
9072
9073 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9074 {
9076 }
9077 }
9078 }
9079 }
9080
9082 {
9083 if (GetInventory().GetCargo())
9084 {
9085 int item_count = GetInventory().GetCargo().GetItemCount();
9086 if (item_count > 0)
9087 {
9088 int random_pick = Math.RandomInt(0, item_count);
9090 if (!item.IsExplosive())
9091 {
9092 item.AddHealth("","",damage);
9093 return true;
9094 }
9095 }
9096 }
9097 return false;
9098 }
9099
9101 {
9102 int attachment_count = GetInventory().AttachmentCount();
9103 if (attachment_count > 0)
9104 {
9105 int random_pick = Math.RandomInt(0, attachment_count);
9106 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9107 if (!attachment.IsExplosive())
9108 {
9109 attachment.AddHealth("","",damage);
9110 return true;
9111 }
9112 }
9113 return false;
9114 }
9115
9117 {
9119 }
9120
9122 {
9124 return GetInventory().CanRemoveEntity();
9125
9126 return false;
9127 }
9128
9130 {
9131
9133 return false;
9134
9135
9137 return false;
9138
9139
9140
9142 if (delta == 0)
9143 return false;
9144
9145
9146 return true;
9147 }
9148
9150 {
9152 {
9153 if (ScriptInputUserData.CanStoreInputUserData())
9154 {
9155 ScriptInputUserData ctx = new ScriptInputUserData;
9160 ctx.
Write(destination_entity);
9164 }
9165 }
9166 else if (!
GetGame().IsMultiplayer())
9167 {
9169 }
9170 }
9171
9173 {
9174 float split_quantity_new;
9178 InventoryLocation loc = new InventoryLocation;
9179
9180 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9181 {
9183 split_quantity_new = stack_max;
9184 else
9186
9188 {
9189 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9190 if (new_item)
9191 {
9192 new_item.SetResultOfSplit(true);
9193 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9195 new_item.
SetQuantity(split_quantity_new,
false,
true);
9196 }
9197 }
9198 }
9199 else if (destination_entity && slot_id == -1)
9200 {
9201 if (quantity > stack_max)
9202 split_quantity_new = stack_max;
9203 else
9204 split_quantity_new = quantity;
9205
9207 {
9209 {
9212 }
9213
9214 if (new_item)
9215 {
9216 new_item.SetResultOfSplit(true);
9217 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9219 new_item.
SetQuantity(split_quantity_new,
false,
true);
9220 }
9221 }
9222 }
9223 else
9224 {
9225 if (stack_max != 0)
9226 {
9228 {
9230 }
9231
9232 if (split_quantity_new == 0)
9233 {
9234 if (!
GetGame().IsMultiplayer())
9235 player.PhysicalPredictiveDropItem(this);
9236 else
9237 player.ServerDropEntity(this);
9238 return;
9239 }
9240
9242 {
9244
9245 if (new_item)
9246 {
9247 new_item.SetResultOfSplit(true);
9248 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9251 new_item.PlaceOnSurface();
9252 }
9253 }
9254 }
9255 }
9256 }
9257
9259 {
9260 float split_quantity_new;
9264 InventoryLocation loc = new InventoryLocation;
9265
9266 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9267 {
9269 split_quantity_new = stack_max;
9270 else
9272
9274 {
9275 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9276 if (new_item)
9277 {
9278 new_item.SetResultOfSplit(true);
9279 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9281 new_item.
SetQuantity(split_quantity_new,
false,
true);
9282 }
9283 }
9284 }
9285 else if (destination_entity && slot_id == -1)
9286 {
9287 if (quantity > stack_max)
9288 split_quantity_new = stack_max;
9289 else
9290 split_quantity_new = quantity;
9291
9293 {
9295 {
9298 }
9299
9300 if (new_item)
9301 {
9302 new_item.SetResultOfSplit(true);
9303 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9305 new_item.
SetQuantity(split_quantity_new,
false,
true);
9306 }
9307 }
9308 }
9309 else
9310 {
9311 if (stack_max != 0)
9312 {
9314 {
9316 }
9317
9319 {
9321
9322 if (new_item)
9323 {
9324 new_item.SetResultOfSplit(true);
9325 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9328 new_item.PlaceOnSurface();
9329 }
9330 }
9331 }
9332 }
9333 }
9334
9336 {
9338 {
9339 if (ScriptInputUserData.CanStoreInputUserData())
9340 {
9341 ScriptInputUserData ctx = new ScriptInputUserData;
9346 dst.WriteToContext(ctx);
9348 }
9349 }
9350 else if (!
GetGame().IsMultiplayer())
9351 {
9353 }
9354 }
9355
9357 {
9359 {
9360 if (ScriptInputUserData.CanStoreInputUserData())
9361 {
9362 ScriptInputUserData ctx = new ScriptInputUserData;
9367 ctx.
Write(destination_entity);
9373 }
9374 }
9375 else if (!
GetGame().IsMultiplayer())
9376 {
9378 }
9379 }
9380
9382 {
9384 }
9385
9387 {
9389 float split_quantity_new;
9391 if (dst.IsValid())
9392 {
9393 int slot_id = dst.GetSlot();
9395
9396 if (quantity > stack_max)
9397 split_quantity_new = stack_max;
9398 else
9399 split_quantity_new = quantity;
9400
9402 {
9404
9405 if (new_item)
9406 {
9407 new_item.SetResultOfSplit(true);
9408 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9410 new_item.
SetQuantity(split_quantity_new,
false,
true);
9411 }
9412
9413 return new_item;
9414 }
9415 }
9416
9417 return null;
9418 }
9419
9421 {
9423 float split_quantity_new;
9425 if (destination_entity)
9426 {
9428 if (quantity > stackable)
9429 split_quantity_new = stackable;
9430 else
9431 split_quantity_new = quantity;
9432
9434 {
9435 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9436 if (new_item)
9437 {
9438 new_item.SetResultOfSplit(true);
9439 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9441 new_item.
SetQuantity(split_quantity_new,
false,
true);
9442 }
9443 }
9444 }
9445 }
9446
9448 {
9450 {
9451 if (ScriptInputUserData.CanStoreInputUserData())
9452 {
9453 ScriptInputUserData ctx = new ScriptInputUserData;
9458 ItemBase destination_entity =
this;
9459 ctx.
Write(destination_entity);
9463 }
9464 }
9465 else if (!
GetGame().IsMultiplayer())
9466 {
9468 }
9469 }
9470
9472 {
9474 float split_quantity_new;
9476 if (player)
9477 {
9479 if (quantity > stackable)
9480 split_quantity_new = stackable;
9481 else
9482 split_quantity_new = quantity;
9483
9485 {
9486 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9487 new_item =
ItemBase.Cast(in_hands);
9488 if (new_item)
9489 {
9490 new_item.SetResultOfSplit(true);
9491 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9493 new_item.SetQuantity(split_quantity_new, false, true);
9494 }
9495 }
9496 }
9497 }
9498
9500 {
9502 float split_quantity_new = Math.Floor(quantity * 0.5);
9503
9505 return;
9506
9508
9509 if (new_item)
9510 {
9511 if (new_item.GetQuantityMax() < split_quantity_new)
9512 {
9513 split_quantity_new = new_item.GetQuantityMax();
9514 }
9515
9516 new_item.SetResultOfSplit(true);
9517 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9518
9520 {
9523 }
9524 else
9525 {
9527 new_item.
SetQuantity(split_quantity_new,
false,
true);
9528 }
9529 }
9530 }
9531
9533 {
9535 float split_quantity_new = Math.Floor(quantity / 2);
9536
9538 return;
9539
9540 InventoryLocation invloc = new InventoryLocation;
9542
9544 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9545
9546 if (new_item)
9547 {
9548 if (new_item.GetQuantityMax() < split_quantity_new)
9549 {
9550 split_quantity_new = new_item.GetQuantityMax();
9551 }
9553 {
9556 }
9557 else if (split_quantity_new > 1)
9558 {
9560 new_item.
SetQuantity(split_quantity_new,
false,
true);
9561 }
9562 }
9563 }
9564
9567 {
9568 SetWeightDirty();
9570
9571 if (parent)
9572 parent.OnAttachmentQuantityChangedEx(this, delta);
9573
9575 {
9577 {
9579 }
9581 {
9582 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9584 }
9585 }
9586
9587 }
9588
9591 {
9592
9593 }
9594
9597 {
9599 }
9600
9602 {
9603 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9604
9606 {
9607 if (newLevel == GameConstants.STATE_RUINED)
9608 {
9610 EntityAI parent = GetHierarchyParent();
9611 if (parent && parent.IsFireplace())
9612 {
9613 CargoBase cargo = GetInventory().GetCargo();
9614 if (cargo)
9615 {
9617 {
9619 }
9620 }
9621 }
9622 }
9623
9625 {
9626
9628 return;
9629 }
9630
9631 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9632 {
9634 }
9635 }
9636 }
9637
9638
9640 {
9641 super.OnRightClick();
9642
9644 {
9646 {
9647 if (ScriptInputUserData.CanStoreInputUserData())
9648 {
9649 EntityAI root = GetHierarchyRoot();
9650 Man playerOwner = GetHierarchyRootPlayer();
9651 InventoryLocation dst = new InventoryLocation;
9652
9653
9654 if (!playerOwner && root && root == this)
9655 {
9657 }
9658 else
9659 {
9660
9661 GetInventory().GetCurrentInventoryLocation(dst);
9663 {
9666 {
9668 }
9669 else
9670 {
9672
9673
9674 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9675 {
9677 }
9678 else
9679 {
9680 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9681 }
9682 }
9683 }
9684 }
9685
9686 ScriptInputUserData ctx = new ScriptInputUserData;
9694 }
9695 }
9696 else if (!
GetGame().IsMultiplayer())
9697 {
9699 }
9700 }
9701 }
9702
9704 {
9705 if (root)
9706 {
9707 vector m4[4];
9708 root.GetTransform(m4);
9709 dst.SetGround(this, m4);
9710 }
9711 else
9712 {
9713 GetInventory().GetCurrentInventoryLocation(dst);
9714 }
9715 }
9716
9717 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9718 {
9719
9720 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9721 return false;
9722
9723 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9724 return false;
9725
9726
9728 return false;
9729
9730
9731 Magazine mag = Magazine.Cast(this);
9732 if (mag)
9733 {
9734 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9735 return false;
9736
9737 if (stack_max_limit)
9738 {
9739 Magazine other_mag = Magazine.Cast(other_item);
9740 if (other_item)
9741 {
9742 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9743 return false;
9744 }
9745
9746 }
9747 }
9748 else
9749 {
9750
9752 return false;
9753
9755 return false;
9756 }
9757
9758 PlayerBase player = null;
9759 if (CastTo(player, GetHierarchyRootPlayer()))
9760 {
9761 if (player.GetInventory().HasAttachment(this))
9762 return false;
9763
9764 if (player.IsItemsToDelete())
9765 return false;
9766 }
9767
9768 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9769 return false;
9770
9771 int slotID;
9773 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9774 return false;
9775
9776 return true;
9777 }
9778
9780 {
9782 }
9783
9785 {
9786 return m_IsResultOfSplit;
9787 }
9788
9790 {
9791 m_IsResultOfSplit = value;
9792 }
9793
9795 {
9797 }
9798
9800 {
9801 float other_item_quantity = other_item.GetQuantity();
9802 float this_free_space;
9803
9805
9807
9808 if (other_item_quantity > this_free_space)
9809 {
9810 return this_free_space;
9811 }
9812 else
9813 {
9814 return other_item_quantity;
9815 }
9816 }
9817
9819 {
9821 }
9822
9824 {
9826 return;
9827
9828 if (!IsMagazine() && other_item)
9829 {
9831 if (quantity_used != 0)
9832 {
9833 float hp1 = GetHealth01("","");
9834 float hp2 = other_item.GetHealth01("","");
9835 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9836 hpResult = hpResult / (
GetQuantity() + quantity_used);
9837
9838 hpResult *= GetMaxHealth();
9839 Math.Round(hpResult);
9840 SetHealth("", "Health", hpResult);
9841
9843 other_item.AddQuantity(-quantity_used);
9844 }
9845 }
9847 }
9848
9850 {
9851 #ifdef SERVER
9852 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9853 GetHierarchyParent().IncreaseLifetimeUp();
9854 #endif
9855 };
9856
9858 {
9859 PlayerBase p = PlayerBase.Cast(player);
9860
9861 array<int> recipesIds = p.m_Recipes;
9862 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9863 if (moduleRecipesManager)
9864 {
9865 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9866 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9867 }
9868
9869 for (int i = 0;i < recipesIds.Count(); i++)
9870 {
9871 int key = recipesIds.Get(i);
9872 string recipeName = moduleRecipesManager.GetRecipeName(key);
9874 }
9875 }
9876
9877
9878 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9879 {
9880 super.GetDebugActions(outputList);
9881
9882
9888
9889
9894
9899
9900
9904
9905
9907 {
9911 }
9912
9915
9916
9920
9922
9923 InventoryLocation loc = new InventoryLocation();
9924 GetInventory().GetCurrentInventoryLocation(loc);
9926 {
9927 if (Gizmo_IsSupported())
9930 }
9931
9933 }
9934
9935
9936
9937
9939 {
9940 super.OnAction(action_id, player, ctx);
9941
9943 {
9944 switch (action_id)
9945 {
9948 return true;
9951 return true;
9952 }
9953 }
9954
9956 {
9957 switch (action_id)
9958 {
9960 Delete();
9961 return true;
9962 }
9963 }
9964
9965 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9966 {
9967 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9968 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9969 PlayerBase p = PlayerBase.Cast(player);
9970 if (
EActions.RECIPES_RANGE_START < 1000)
9971 {
9972 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9973 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9974 }
9975 }
9976 #ifndef SERVER
9977 else if (action_id ==
EActions.WATCH_PLAYER)
9978 {
9979 PluginDeveloper.SetDeveloperItemClientEx(player);
9980 }
9981 #endif
9983 {
9984 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9985 {
9986 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9987 OnDebugButtonPressServer(id + 1);
9988 }
9989
9990 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9991 {
9992 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9994 }
9995
9996 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9997 {
9998 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10000 }
10001
10002 else if (action_id ==
EActions.ADD_QUANTITY)
10003 {
10004 if (IsMagazine())
10005 {
10006 Magazine mag = Magazine.Cast(this);
10007 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10008 }
10009 else
10010 {
10012 }
10013
10014 if (m_EM)
10015 {
10016 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10017 }
10018
10019 }
10020
10021 else if (action_id ==
EActions.REMOVE_QUANTITY)
10022 {
10023 if (IsMagazine())
10024 {
10025 Magazine mag2 = Magazine.Cast(this);
10026 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10027 }
10028 else
10029 {
10031 }
10032 if (m_EM)
10033 {
10034 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10035 }
10036
10037 }
10038
10039 else if (action_id ==
EActions.SET_QUANTITY_0)
10040 {
10042
10043 if (m_EM)
10044 {
10045 m_EM.SetEnergy(0);
10046 }
10047 }
10048
10049 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10050 {
10052
10053 if (m_EM)
10054 {
10055 m_EM.SetEnergy(m_EM.GetEnergyMax());
10056 }
10057 }
10058
10059 else if (action_id ==
EActions.ADD_HEALTH)
10060 {
10061 AddHealth("","",GetMaxHealth("","Health")/5);
10062 }
10063 else if (action_id ==
EActions.REMOVE_HEALTH)
10064 {
10065 AddHealth("","",-GetMaxHealth("","Health")/5);
10066 }
10067 else if (action_id ==
EActions.DESTROY_HEALTH)
10068 {
10069 SetHealth01("","",0);
10070 }
10071 else if (action_id ==
EActions.WATCH_ITEM)
10072 {
10074 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10075 #ifdef DEVELOPER
10076 SetDebugDeveloper_item(this);
10077 #endif
10078 }
10079
10080 else if (action_id ==
EActions.ADD_TEMPERATURE)
10081 {
10082 AddTemperature(20);
10083
10084 }
10085
10086 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10087 {
10088 AddTemperature(-20);
10089
10090 }
10091
10092 else if (action_id ==
EActions.FLIP_FROZEN)
10093 {
10094 SetFrozen(!GetIsFrozen());
10095
10096 }
10097
10098 else if (action_id ==
EActions.ADD_WETNESS)
10099 {
10101
10102 }
10103
10104 else if (action_id ==
EActions.REMOVE_WETNESS)
10105 {
10107
10108 }
10109
10110 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10111 {
10114
10115
10116 }
10117
10118 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10119 {
10122 }
10123
10124 else if (action_id ==
EActions.MAKE_SPECIAL)
10125 {
10126 auto debugParams = DebugSpawnParams.WithPlayer(player);
10127 OnDebugSpawnEx(debugParams);
10128 }
10129
10130 }
10131
10132
10133 return false;
10134 }
10135
10136
10137
10138
10142
10145
10146
10147
10149 {
10150 return false;
10151 }
10152
10153
10155 {
10156 return true;
10157 }
10158
10159
10161 {
10162 return true;
10163 }
10164
10165
10166
10168 {
10169 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10171 }
10172
10175 {
10176 return null;
10177 }
10178
10180 {
10181 return false;
10182 }
10183
10185 {
10186 return false;
10187 }
10188
10192
10193
10195 {
10196 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10197 return module_repairing.CanRepair(this, item_repair_kit);
10198 }
10199
10200
10201 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10202 {
10203 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10204 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10205 }
10206
10207
10209 {
10210
10211
10212
10213
10214
10215
10216
10217
10218 return 1;
10219 }
10220
10221
10222
10224 {
10226 }
10227
10228
10229
10231 {
10233 }
10234
10235
10244 {
10245 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10246
10247 if (player)
10248 {
10249 player.MessageStatus(text);
10250 }
10251 }
10252
10253
10262 {
10263 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10264
10265 if (player)
10266 {
10267 player.MessageAction(text);
10268 }
10269 }
10270
10271
10280 {
10281 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10282
10283 if (player)
10284 {
10285 player.MessageFriendly(text);
10286 }
10287 }
10288
10289
10298 {
10299 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10300
10301 if (player)
10302 {
10303 player.MessageImportant(text);
10304 }
10305 }
10306
10308 {
10309 return true;
10310 }
10311
10312
10313 override bool KindOf(
string tag)
10314 {
10315 bool found = false;
10316 string item_name = this.
GetType();
10319
10320 int array_size = item_tag_array.Count();
10321 for (int i = 0; i < array_size; i++)
10322 {
10323 if (item_tag_array.Get(i) == tag)
10324 {
10325 found = true;
10326 break;
10327 }
10328 }
10329 return found;
10330 }
10331
10332
10334 {
10335
10336 super.OnRPC(sender, rpc_type,ctx);
10337
10338
10339 switch (rpc_type)
10340 {
10341 #ifndef SERVER
10342 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10343 Param2<bool, string> p = new Param2<bool, string>(false, "");
10344
10346 return;
10347
10348 bool play = p.param1;
10349 string soundSet = p.param2;
10350
10351 if (play)
10352 {
10354 {
10356 {
10358 }
10359 }
10360 else
10361 {
10363 }
10364 }
10365 else
10366 {
10368 }
10369
10370 break;
10371 #endif
10372
10373 }
10374
10376 {
10378 }
10379 }
10380
10381
10382
10383
10385 {
10386 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10387 return plugin.GetID(
name);
10388 }
10389
10391 {
10392 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10393 return plugin.GetName(id);
10394 }
10395
10398 {
10399
10400
10401 int varFlags;
10402 if (!ctx.
Read(varFlags))
10403 return;
10404
10405 if (varFlags & ItemVariableFlags.FLOAT)
10406 {
10408 }
10409 }
10410
10412 {
10413
10414 super.SerializeNumericalVars(floats_out);
10415
10416
10417
10419 {
10421 }
10422
10424 {
10426 }
10427
10429 {
10431 }
10432
10434 {
10439 }
10440
10442 {
10444 }
10445 }
10446
10448 {
10449
10450 super.DeSerializeNumericalVars(floats);
10451
10452
10453 int index = 0;
10454 int mask = Math.Round(floats.Get(index));
10455
10456 index++;
10457
10459 {
10461 {
10463 }
10464 else
10465 {
10466 float quantity = floats.Get(index);
10467 SetQuantity(quantity,
true,
false,
false,
false);
10468 }
10469 index++;
10470 }
10471
10473 {
10474 float wet = floats.Get(index);
10476 index++;
10477 }
10478
10480 {
10481 int liquidtype = Math.Round(floats.Get(index));
10483 index++;
10484 }
10485
10487 {
10489 index++;
10491 index++;
10493 index++;
10495 index++;
10496 }
10497
10499 {
10500 int cleanness = Math.Round(floats.Get(index));
10502 index++;
10503 }
10504 }
10505
10507 {
10508 super.WriteVarsToCTX(ctx);
10509
10510
10512 {
10514 }
10515
10517 {
10519 }
10520
10522 {
10524 }
10525
10527 {
10528 int r,g,b,a;
10534 }
10535
10537 {
10539 }
10540 }
10541
10543 {
10544 if (!super.ReadVarsFromCTX(ctx,version))
10545 return false;
10546
10547 int intValue;
10548 float value;
10549
10550 if (version < 140)
10551 {
10552 if (!ctx.
Read(intValue))
10553 return false;
10554
10555 m_VariablesMask = intValue;
10556 }
10557
10559 {
10560 if (!ctx.
Read(value))
10561 return false;
10562
10564 {
10566 }
10567 else
10568 {
10570 }
10571 }
10572
10573 if (version < 140)
10574 {
10576 {
10577 if (!ctx.
Read(value))
10578 return false;
10579 SetTemperatureDirect(value);
10580 }
10581 }
10582
10584 {
10585 if (!ctx.
Read(value))
10586 return false;
10588 }
10589
10591 {
10592 if (!ctx.
Read(intValue))
10593 return false;
10595 }
10596
10598 {
10599 int r,g,b,a;
10601 return false;
10603 return false;
10605 return false;
10607 return false;
10608
10610 }
10611
10613 {
10614 if (!ctx.
Read(intValue))
10615 return false;
10617 }
10618
10619 if (version >= 138 && version < 140)
10620 {
10622 {
10623 if (!ctx.
Read(intValue))
10624 return false;
10625 SetFrozen(intValue);
10626 }
10627 }
10628
10629 return true;
10630 }
10631
10632
10634 {
10637 {
10639 }
10640
10641 if (!super.OnStoreLoad(ctx, version))
10642 {
10644 return false;
10645 }
10646
10647 if (version >= 114)
10648 {
10649 bool hasQuickBarIndexSaved;
10650
10651 if (!ctx.
Read(hasQuickBarIndexSaved))
10652 {
10654 return false;
10655 }
10656
10657 if (hasQuickBarIndexSaved)
10658 {
10659 int itmQBIndex;
10660
10661
10662 if (!ctx.
Read(itmQBIndex))
10663 {
10665 return false;
10666 }
10667
10668 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10669 if (itmQBIndex != -1 && parentPlayer)
10670 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10671 }
10672 }
10673 else
10674 {
10675
10676 PlayerBase player;
10677 int itemQBIndex;
10678 if (version ==
int.
MAX)
10679 {
10680 if (!ctx.
Read(itemQBIndex))
10681 {
10683 return false;
10684 }
10685 }
10686 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10687 {
10688
10689 if (!ctx.
Read(itemQBIndex))
10690 {
10692 return false;
10693 }
10694 if (itemQBIndex != -1 && player)
10695 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10696 }
10697 }
10698
10699 if (version < 140)
10700 {
10701
10702 if (!LoadVariables(ctx, version))
10703 {
10705 return false;
10706 }
10707 }
10708
10709
10711 {
10713 return false;
10714 }
10715 if (version >= 132)
10716 {
10718 if (raib)
10719 {
10721 {
10723 return false;
10724 }
10725 }
10726 }
10727
10729 return true;
10730 }
10731
10732
10733
10735 {
10736 super.OnStoreSave(ctx);
10737
10738 PlayerBase player;
10739 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10740 {
10742
10743 int itemQBIndex = -1;
10744 itemQBIndex = player.FindQuickBarEntityIndex(this);
10745 ctx.
Write(itemQBIndex);
10746 }
10747 else
10748 {
10750 }
10751
10753
10755 if (raib)
10756 {
10758 }
10759 }
10760
10761
10763 {
10764 super.AfterStoreLoad();
10765
10767 {
10769 }
10770
10772 {
10775 }
10776 }
10777
10779 {
10780 super.EEOnAfterLoad();
10781
10783 {
10785 }
10786
10789 }
10790
10792 {
10793 return false;
10794 }
10795
10796
10797
10799 {
10801 {
10802 #ifdef PLATFORM_CONSOLE
10803
10805 {
10807 if (menu)
10808 {
10810 }
10811 }
10812 #endif
10813 }
10814
10816 {
10819 }
10820
10822 {
10823 SetWeightDirty();
10825 }
10827 {
10830 }
10831
10833 {
10836 }
10838 {
10841 }
10842
10843 super.OnVariablesSynchronized();
10844 }
10845
10846
10847
10849 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10850 {
10851 if (!IsServerCheck(allow_client))
10852 return false;
10853
10855 return false;
10856
10859
10860 if (value <= (min + 0.001))
10861 value = min;
10862
10863 if (value == min)
10864 {
10865 if (destroy_config)
10866 {
10867 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10868 if (dstr)
10869 {
10871 this.Delete();
10872 return true;
10873 }
10874 }
10875 else if (destroy_forced)
10876 {
10878 this.Delete();
10879 return true;
10880 }
10881
10883 }
10884
10887
10889 {
10891
10892 if (delta)
10894 }
10895
10897
10898 return false;
10899 }
10900
10901
10903 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10904 {
10906 }
10907
10909 {
10912 }
10913
10915 {
10918 }
10919
10921 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10922 {
10923 float value_clamped = Math.Clamp(value, 0, 1);
10925 SetQuantity(result, destroy_config, destroy_forced);
10926 }
10927
10928
10931 {
10933 }
10934
10936 {
10938 }
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10950 {
10951 int slot = -1;
10952 if (GetInventory())
10953 {
10954 InventoryLocation il = new InventoryLocation;
10955 GetInventory().GetCurrentInventoryLocation(il);
10957 }
10958
10960 }
10961
10963 {
10964 float quantity_max = 0;
10965
10967 {
10968 if (attSlotID != -1)
10969 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10970
10971 if (quantity_max <= 0)
10973 }
10974
10975 if (quantity_max <= 0)
10977
10978 return quantity_max;
10979 }
10980
10982 {
10984 }
10985
10987 {
10989 }
10990
10991
10993 {
10995 }
10996
10998 {
11000 }
11001
11003 {
11005 }
11006
11007
11009 {
11010
11011 float weightEx = GetWeightEx();
11012 float special = GetInventoryAndCargoWeight();
11013 return weightEx - special;
11014 }
11015
11016
11018 {
11020 }
11021
11023 {
11025 {
11026 #ifdef DEVELOPER
11027 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11028 {
11029 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11031 }
11032 #endif
11033
11034 return GetQuantity() * GetConfigWeightModified();
11035 }
11036 else if (HasEnergyManager())
11037 {
11038 #ifdef DEVELOPER
11039 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11040 {
11041 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11042 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11043 }
11044 #endif
11045 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11046 }
11047 else
11048 {
11049 #ifdef DEVELOPER
11050 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11051 {
11052 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11053 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11054 }
11055 #endif
11056 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11057 }
11058 }
11059
11062 {
11063 int item_count = 0;
11065
11066 if (GetInventory().GetCargo() != NULL)
11067 {
11068 item_count = GetInventory().GetCargo().GetItemCount();
11069 }
11070
11071 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11072 {
11073 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11074 if (item)
11075 item_count += item.GetNumberOfItems();
11076 }
11077 return item_count;
11078 }
11079
11082 {
11083 float weight = 0;
11084 float wetness = 1;
11085 if (include_wetness)
11088 {
11089 weight = wetness * m_ConfigWeight;
11090 }
11092 {
11093 weight = 1;
11094 }
11095 return weight;
11096 }
11097
11098
11099
11101 {
11102 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11103 {
11104 GameInventory inv = GetInventory();
11105 array<EntityAI> items = new array<EntityAI>;
11107 for (int i = 0; i < items.Count(); i++)
11108 {
11110 if (item)
11111 {
11113 }
11114 }
11115 }
11116 }
11117
11118
11119
11120
11122 {
11123 float energy = 0;
11124 if (HasEnergyManager())
11125 {
11126 energy = GetCompEM().GetEnergy();
11127 }
11128 return energy;
11129 }
11130
11131
11133 {
11134 super.OnEnergyConsumed();
11135
11137 }
11138
11140 {
11141 super.OnEnergyAdded();
11142
11144 }
11145
11146
11148 {
11149 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11150 {
11152 {
11153 float energy_0to1 = GetCompEM().GetEnergy0To1();
11155 }
11156 }
11157 }
11158
11159
11161 {
11162 return ConfigGetFloat("heatIsolation");
11163 }
11164
11166 {
11168 }
11169
11171 {
11172 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11173 if (
GetGame().ConfigIsExisting(paramPath))
11175
11176 return 0.0;
11177 }
11178
11180 {
11181 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11182 if (
GetGame().ConfigIsExisting(paramPath))
11184
11185 return 0.0;
11186 }
11187
11188 override void SetWet(
float value,
bool allow_client =
false)
11189 {
11190 if (!IsServerCheck(allow_client))
11191 return;
11192
11195
11197
11198 m_VarWet = Math.Clamp(value, min, max);
11199
11201 {
11204 }
11205 }
11206
11207 override void AddWet(
float value)
11208 {
11210 }
11211
11213 {
11215 }
11216
11218 {
11220 }
11221
11223 {
11225 }
11226
11228 {
11230 }
11231
11233 {
11235 }
11236
11237 override void OnWetChanged(
float newVal,
float oldVal)
11238 {
11241 if (newLevel != oldLevel)
11242 {
11244 }
11245 }
11246
11248 {
11249 SetWeightDirty();
11250 }
11251
11253 {
11254 return GetWetLevelInternal(
m_VarWet);
11255 }
11256
11257
11258
11260 {
11262 }
11263
11265 {
11267 }
11268
11270 {
11272 }
11273
11275 {
11277 }
11278
11279
11280
11282 {
11283 if (ConfigIsExisting("itemModelLength"))
11284 {
11285 return ConfigGetFloat("itemModelLength");
11286 }
11287 return 0;
11288 }
11289
11291 {
11292 if (ConfigIsExisting("itemAttachOffset"))
11293 {
11294 return ConfigGetFloat("itemAttachOffset");
11295 }
11296 return 0;
11297 }
11298
11299 override void SetCleanness(
int value,
bool allow_client =
false)
11300 {
11301 if (!IsServerCheck(allow_client))
11302 return;
11303
11305
11307
11310 }
11311
11313 {
11315 }
11316
11318 {
11319 return true;
11320 }
11321
11322
11323
11324
11326 {
11328 }
11329
11331 {
11333 }
11334
11335
11336
11337
11338 override void SetColor(
int r,
int g,
int b,
int a)
11339 {
11345 }
11347 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11348 {
11353 }
11354
11356 {
11358 }
11359
11362 {
11363 int r,g,b,a;
11365 r = r/255;
11366 g = g/255;
11367 b = b/255;
11368 a = a/255;
11369 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11370 }
11371
11372
11373
11374 override void SetLiquidType(
int value,
bool allow_client =
false)
11375 {
11376 if (!IsServerCheck(allow_client))
11377 return;
11378
11383 }
11384
11386 {
11387 return ConfigGetInt("varLiquidTypeInit");
11388 }
11389
11391 {
11393 }
11394
11396 {
11398 SetFrozen(false);
11399 }
11400
11403 {
11404 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11405 }
11406
11407
11410 {
11411 PlayerBase nplayer;
11412 if (PlayerBase.CastTo(nplayer, player))
11413 {
11415
11416 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11417 }
11418 }
11419
11420
11423 {
11424 PlayerBase nplayer;
11425 if (PlayerBase.CastTo(nplayer,player))
11426 {
11427
11428 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11429
11430 }
11431
11432
11433 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11434
11435
11436 if (HasEnergyManager())
11437 {
11438 GetCompEM().UpdatePlugState();
11439 }
11440 }
11441
11442
11444 {
11445 super.OnPlacementStarted(player);
11446
11448 }
11449
11450 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11451 {
11453 {
11454 m_AdminLog.OnPlacementComplete(player,
this);
11455 }
11456
11457 super.OnPlacementComplete(player, position, orientation);
11458 }
11459
11460
11461
11462
11463
11465 {
11467 {
11468 return true;
11469 }
11470 else
11471 {
11472 return false;
11473 }
11474 }
11475
11476
11478 {
11480 {
11482 }
11483 }
11484
11485
11487 {
11489 }
11490
11492 {
11494 }
11495
11496 override void InsertAgent(
int agent,
float count = 1)
11497 {
11498 if (count < 1)
11499 return;
11500
11502 }
11503
11506 {
11508 }
11509
11510
11512 {
11514 }
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11558 {
11560 return false;
11561 return true;
11562 }
11563
11565 {
11566
11568 }
11569
11570
11573 {
11574 super.CheckForRoofLimited(timeTresholdMS);
11575
11577 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11578 {
11579 m_PreviousRoofTestTime = time;
11580 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11581 }
11582 }
11583
11584
11586 {
11588 {
11589 return 0;
11590 }
11591
11592 if (GetInventory().GetAttachmentSlotsCount() != 0)
11593 {
11594 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11595 if (filter)
11596 return filter.GetProtectionLevel(type, false, system);
11597 else
11598 return 0;
11599 }
11600
11601 string subclassPath, entryName;
11602
11603 switch (type)
11604 {
11606 entryName = "biological";
11607 break;
11609 entryName = "chemical";
11610 break;
11611 default:
11612 entryName = "biological";
11613 break;
11614 }
11615
11616 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11617
11619 }
11620
11621
11622
11625 {
11626 if (!IsMagazine())
11628
11630 }
11631
11632
11633
11634
11635
11640 {
11641 return true;
11642 }
11643
11645 {
11647 }
11648
11649
11650
11651
11652
11654 {
11655 if (parent)
11656 {
11657 if (parent.IsInherited(DayZInfected))
11658 return true;
11659
11660 if (!parent.IsRuined())
11661 return true;
11662 }
11663
11664 return true;
11665 }
11666
11668 {
11669 if (!super.CanPutAsAttachment(parent))
11670 {
11671 return false;
11672 }
11673
11674 if (!IsRuined() && !parent.IsRuined())
11675 {
11676 return true;
11677 }
11678
11679 return false;
11680 }
11681
11683 {
11684
11685
11686
11687
11688 return super.CanReceiveItemIntoCargo(item);
11689 }
11690
11692 {
11693
11694
11695
11696
11697 GameInventory attachmentInv = attachment.GetInventory();
11699 {
11700 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11701 return false;
11702 }
11703
11704 InventoryLocation loc = new InventoryLocation();
11705 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11706 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11707 return false;
11708
11709 return super.CanReceiveAttachment(attachment, slotId);
11710 }
11711
11713 {
11714 if (!super.CanReleaseAttachment(attachment))
11715 return false;
11716
11717 return GetInventory().AreChildrenAccessible();
11718 }
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11741 {
11742 int id = muzzle_owner.GetMuzzleID();
11743 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11744
11745 if (WPOF_array)
11746 {
11747 for (int i = 0; i < WPOF_array.Count(); i++)
11748 {
11749 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11750
11751 if (WPOF)
11752 {
11753 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11754 }
11755 }
11756 }
11757 }
11758
11759
11761 {
11762 int id = muzzle_owner.GetMuzzleID();
11764
11765 if (WPOBE_array)
11766 {
11767 for (int i = 0; i < WPOBE_array.Count(); i++)
11768 {
11769 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11770
11771 if (WPOBE)
11772 {
11773 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11774 }
11775 }
11776 }
11777 }
11778
11779
11781 {
11782 int id = muzzle_owner.GetMuzzleID();
11783 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11784
11785 if (WPOOH_array)
11786 {
11787 for (int i = 0; i < WPOOH_array.Count(); i++)
11788 {
11789 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11790
11791 if (WPOOH)
11792 {
11793 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11794 }
11795 }
11796 }
11797 }
11798
11799
11801 {
11802 int id = muzzle_owner.GetMuzzleID();
11803 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11804
11805 if (WPOOH_array)
11806 {
11807 for (int i = 0; i < WPOOH_array.Count(); i++)
11808 {
11809 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11810
11811 if (WPOOH)
11812 {
11813 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11814 }
11815 }
11816 }
11817 }
11818
11819
11821 {
11822 int id = muzzle_owner.GetMuzzleID();
11823 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11824
11825 if (WPOOH_array)
11826 {
11827 for (int i = 0; i < WPOOH_array.Count(); i++)
11828 {
11829 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11830
11831 if (WPOOH)
11832 {
11833 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11834 }
11835 }
11836 }
11837 }
11838
11839
11840
11842 {
11844 {
11845 return true;
11846 }
11847
11848 return false;
11849 }
11850
11852 {
11854 {
11855 return true;
11856 }
11857
11858 return false;
11859 }
11860
11862 {
11864 {
11865 return true;
11866 }
11867
11868 return false;
11869 }
11870
11872 {
11873 return false;
11874 }
11875
11878 {
11879 return UATimeSpent.DEFAULT_DEPLOY;
11880 }
11881
11882
11883
11884
11886 {
11888 SetSynchDirty();
11889 }
11890
11892 {
11894 }
11895
11896
11898 {
11899 return false;
11900 }
11901
11904 {
11905 string att_type = "None";
11906
11907 if (ConfigIsExisting("soundAttType"))
11908 {
11909 att_type = ConfigGetString("soundAttType");
11910 }
11911
11913 }
11914
11916 {
11918 }
11919
11920
11921
11922
11923
11929
11931 {
11934
11936 }
11937
11938
11940 {
11942 return;
11943
11945
11948
11951
11952 SoundParameters params = new SoundParameters();
11956 }
11957
11958
11960 {
11962 return;
11963
11965 SetSynchDirty();
11966
11969 }
11970
11971
11973 {
11975 return;
11976
11978 SetSynchDirty();
11979
11982 }
11983
11985 {
11987 }
11988
11990 {
11992 }
11993
11996 {
11997 if (!
GetGame().IsDedicatedServer())
11998 {
11999 if (ConfigIsExisting("attachSoundSet"))
12000 {
12001 string cfg_path = "";
12002 string soundset = "";
12003 string type_name =
GetType();
12004
12007 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12008 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12009
12010 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12011 {
12012 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12013 {
12014 if (cfg_slot_array[i] == slot_type)
12015 {
12016 soundset = cfg_soundset_array[i];
12017 break;
12018 }
12019 }
12020 }
12021
12022 if (soundset != "")
12023 {
12024 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12026 }
12027 }
12028 }
12029 }
12030
12032 {
12033
12034 }
12035
12036 void OnApply(PlayerBase player);
12037
12039 {
12040 return 1.0;
12041 };
12042
12044 {
12046 }
12047
12049 {
12051 }
12052
12054
12056 {
12057 SetDynamicPhysicsLifeTime(0.01);
12059 }
12060
12062 {
12063 array<string> zone_names = new array<string>;
12064 GetDamageZones(zone_names);
12065 for (int i = 0; i < zone_names.Count(); i++)
12066 {
12067 SetHealthMax(zone_names.Get(i),"Health");
12068 }
12069 SetHealthMax("","Health");
12070 }
12071
12074 {
12075 float global_health = GetHealth01("","Health");
12076 array<string> zones = new array<string>;
12077 GetDamageZones(zones);
12078
12079 for (int i = 0; i < zones.Count(); i++)
12080 {
12081 SetHealth01(zones.Get(i),"Health",global_health);
12082 }
12083 }
12084
12087 {
12088 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12089 }
12090
12092 {
12093 if (!hasRootAsPlayer)
12094 {
12095 if (refParentIB)
12096 {
12097
12098 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12099 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12100
12101 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12102 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12103
12106 }
12107 else
12108 {
12109
12112 }
12113 }
12114 }
12115
12117 {
12119 {
12120 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12121 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12122 {
12123 float heatPermCoef = 1.0;
12125 while (ent)
12126 {
12127 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12128 ent = ent.GetHierarchyParent();
12129 }
12130
12131 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12132 }
12133 }
12134 }
12135
12137 {
12138
12139 EntityAI parent = GetHierarchyParent();
12140 if (!parent)
12141 {
12142 hasParent = false;
12143 hasRootAsPlayer = false;
12144 }
12145 else
12146 {
12147 hasParent = true;
12148 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12149 refParentIB =
ItemBase.Cast(parent);
12150 }
12151 }
12152
12153 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12154 {
12155
12156 }
12157
12159 {
12160
12161 return false;
12162 }
12163
12165 {
12166
12167
12168 return false;
12169 }
12170
12172 {
12173
12174 return false;
12175 }
12176
12179 {
12180 return !GetIsFrozen() &&
IsOpen();
12181 }
12182
12184 {
12185 bool hasParent = false, hasRootAsPlayer = false;
12187
12188 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12189 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12190
12191 if (wwtu || foodDecay)
12192 {
12196
12197 if (processWetness || processTemperature || processDecay)
12198 {
12200
12201 if (processWetness)
12202 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12203
12204 if (processTemperature)
12206
12207 if (processDecay)
12208 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12209 }
12210 }
12211 }
12212
12215 {
12217 }
12218
12220 {
12223
12224 return super.GetTemperatureFreezeThreshold();
12225 }
12226
12228 {
12231
12232 return super.GetTemperatureThawThreshold();
12233 }
12234
12236 {
12239
12240 return super.GetItemOverheatThreshold();
12241 }
12242
12244 {
12246 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12247
12248 return super.GetTemperatureFreezeTime();
12249 }
12250
12252 {
12254 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12255
12256 return super.GetTemperatureThawTime();
12257 }
12258
12263
12265 {
12266 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12267 }
12268
12270 {
12271 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12272 }
12273
12276 {
12278 }
12279
12281 {
12283 }
12284
12286 {
12288 }
12289
12292 {
12293 return null;
12294 }
12295
12298 {
12299 return false;
12300 }
12301
12303 {
12305 {
12308 if (!trg)
12309 {
12311 explosive = this;
12312 }
12313
12314 explosive.PairRemote(trg);
12316
12317 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12318 trg.SetPersistentPairID(persistentID);
12319 explosive.SetPersistentPairID(persistentID);
12320
12321 return true;
12322 }
12323 return false;
12324 }
12325
12328 {
12329 float ret = 1.0;
12332 ret *= GetHealth01();
12333
12334 return ret;
12335 }
12336
12337 #ifdef DEVELOPER
12338 override void SetDebugItem()
12339 {
12340 super.SetDebugItem();
12341 _itemBase = this;
12342 }
12343
12345 {
12346 string text = super.GetDebugText();
12347
12349 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12350
12351 return text;
12352 }
12353 #endif
12354
12356 {
12357 return true;
12358 }
12359
12361
12363
12365 {
12368 }
12369
12370
12378
12394}
12395
12397{
12399 if (entity)
12400 {
12401 bool is_item = entity.IsInherited(
ItemBase);
12402 if (is_item && full_quantity)
12403 {
12406 }
12407 }
12408 else
12409 {
12411 return NULL;
12412 }
12413 return entity;
12414}
12415
12417{
12418 if (item)
12419 {
12420 if (health > 0)
12421 item.SetHealth("", "", health);
12422
12423 if (item.CanHaveTemperature())
12424 {
12426 if (item.CanFreeze())
12427 item.SetFrozen(false);
12428 }
12429
12430 if (item.HasEnergyManager())
12431 {
12432 if (quantity >= 0)
12433 {
12434 item.GetCompEM().SetEnergy0To1(quantity);
12435 }
12436 else
12437 {
12439 }
12440 }
12441 else if (item.IsMagazine())
12442 {
12443 Magazine mag = Magazine.Cast(item);
12444 if (quantity >= 0)
12445 {
12446 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12447 }
12448 else
12449 {
12451 }
12452
12453 }
12454 else
12455 {
12456 if (quantity >= 0)
12457 {
12458 item.SetQuantityNormalized(quantity, false);
12459 }
12460 else
12461 {
12463 }
12464
12465 }
12466 }
12467}
12468
12469#ifdef DEVELOPER
12471#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.