7511{
7513 {
7514 return true;
7515 }
7516};
7517
7518
7519
7521{
7525
7527
7530
7531
7532
7533
7534
7543
7549
7554
7559
7580 protected bool m_IsResultOfSplit
7581
7583
7588
7589
7590
7592
7596
7597
7598
7600
7603
7604
7605
7611
7612
7620
7623
7624
7626
7627
7629
7630
7635
7636
7641
7642
7644
7645
7647 {
7652
7653 if (!
GetGame().IsDedicatedServer())
7654 {
7656 {
7658
7660 {
7662 }
7663 }
7664
7667 }
7668
7669 m_OldLocation = null;
7670
7672 {
7674 }
7675
7676 if (ConfigIsExisting("headSelectionsToHide"))
7677 {
7680 }
7681
7683 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7684 {
7686 }
7687
7689
7690 m_IsResultOfSplit = false;
7691
7693 }
7694
7696 {
7697 super.InitItemVariables();
7698
7704 m_Count = ConfigGetInt(
"count");
7705
7708
7713
7716
7721
7733
7737
7738
7741 if (ConfigIsExisting("canBeSplit"))
7742 {
7745 }
7746
7748 if (ConfigIsExisting("itemBehaviour"))
7750
7751
7754 RegisterNetSyncVariableInt("m_VarLiquidType");
7755 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7756
7757 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7758 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7759 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7760
7761 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7762 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7763 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7764 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7765
7766 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7767 RegisterNetSyncVariableBool("m_IsTakeable");
7768 RegisterNetSyncVariableBool("m_IsHologram");
7769
7772 {
7775 }
7776
7778
7780 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7782
7783 }
7784
7786 {
7788 }
7789
7791 {
7794 {
7799 }
7800 }
7801
7802 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7803 {
7805 {
7808 }
7809
7811 }
7812
7814 {
7820 }
7821
7823
7825 {
7827
7828 if (!action)
7829 {
7830 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7831 return;
7832 }
7833
7835 if (!ai)
7836 {
7838 return;
7839 }
7840
7842 if (!action_array)
7843 {
7844 action_array = new array<ActionBase_Basic>;
7846 }
7847 if (LogManager.IsActionLogEnable())
7848 {
7849 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7850 }
7851
7852 if (action_array.Find(action) != -1)
7853 {
7854 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7855 }
7856 else
7857 {
7858 action_array.Insert(action);
7859 }
7860 }
7861
7863 {
7865 ActionBase action = player.GetActionManager().GetAction(actionName);
7868
7869 if (action_array)
7870 {
7871 action_array.RemoveItem(action);
7872 }
7873 }
7874
7875
7876
7878 {
7879 ActionOverrideData overrideData = new ActionOverrideData();
7883
7885 if (!actionMap)
7886 {
7889 }
7890
7891 actionMap.Insert(this.
Type(), overrideData);
7892
7893 }
7894
7896
7898
7899
7901 {
7904
7907
7908 string config_to_search = "CfgVehicles";
7909 string muzzle_owner_config;
7910
7912 {
7913 if (IsInherited(Weapon))
7914 config_to_search = "CfgWeapons";
7915
7916 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7917
7918 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7919
7921
7922 if (config_OnFire_subclass_count > 0)
7923 {
7924 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7925
7926 for (int i = 0; i < config_OnFire_subclass_count; i++)
7927 {
7928 string particle_class = "";
7930 string config_OnFire_entry = config_OnFire_class + particle_class;
7931 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7932 WPOF_array.Insert(WPOF);
7933 }
7934
7935
7937 }
7938 }
7939
7941 {
7942 config_to_search = "CfgWeapons";
7943 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7944
7945 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7946
7948
7949 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7950 {
7951 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7952
7953 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7954 {
7955 string particle_class2 = "";
7957 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7958 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7959 WPOBE_array.Insert(WPOBE);
7960 }
7961
7962
7964 }
7965 }
7966 }
7967
7968
7970 {
7973
7975 {
7976 string config_to_search = "CfgVehicles";
7977
7978 if (IsInherited(Weapon))
7979 config_to_search = "CfgWeapons";
7980
7981 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7982 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7983
7984 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7985 {
7986
7988
7990 {
7992 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7994 return;
7995 }
7996
7999
8000
8001
8003 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8004
8005 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8006 {
8007 string particle_class = "";
8009 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8011
8012 if (entry_type == CT_CLASS)
8013 {
8014 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8015 WPOOH_array.Insert(WPOF);
8016 }
8017 }
8018
8019
8021 }
8022 }
8023 }
8024
8026 {
8028 }
8029
8031 {
8033 {
8035
8038
8041
8042 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8043 }
8044 }
8045
8047 {
8049 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8050
8052 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8053
8055 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8056
8058 {
8060 }
8061 }
8062
8064 {
8066 }
8067
8069 {
8072 else
8074
8076 {
8079 }
8080 else
8081 {
8084
8087 }
8088
8090 }
8091
8093 {
8095 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8096 }
8097
8099 {
8101 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8103 }
8104
8106 {
8108 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8109 }
8110
8112 {
8115
8116 OverheatingParticle OP = new OverheatingParticle();
8121
8123 }
8124
8126 {
8129
8130 return -1;
8131 }
8132
8134 {
8136 {
8139
8140 for (int i = count; i > 0; --i)
8141 {
8142 int id = i - 1;
8145
8148
8149 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8150 {
8151 if (p)
8152 {
8155 }
8156 }
8157 }
8158 }
8159 }
8160
8162 {
8164 {
8166 {
8167 int id = i - 1;
8169
8170 if (OP)
8171 {
8173
8174 if (p)
8175 {
8177 }
8178
8179 delete OP;
8180 }
8181 }
8182
8185 }
8186 }
8187
8190 {
8191 return 0.0;
8192 }
8193
8194
8196 {
8197 return 250;
8198 }
8199
8201 {
8202 return 0;
8203 }
8204
8207 {
8209 return true;
8210
8211 return false;
8212 }
8213
8216 {
8219
8221 {
8223 }
8224 else
8225 {
8226
8228 }
8229
8231 }
8232
8239 {
8240 return -1;
8241 }
8242
8243
8244
8245
8247 {
8249 {
8251 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8252
8253 if (r_index >= 0)
8254 {
8255 InventoryLocation r_il = new InventoryLocation;
8256 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8257
8258 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8261 {
8262 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8263 }
8265 {
8266 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8267 }
8268
8269 }
8270
8271 player.GetHumanInventory().ClearUserReservedLocation(this);
8272 }
8273
8276 }
8277
8278
8279
8280
8282 {
8283 return ItemBase.m_DebugActionsMask;
8284 }
8285
8287 {
8288 return ItemBase.m_DebugActionsMask & mask;
8289 }
8290
8292 {
8293 ItemBase.m_DebugActionsMask = mask;
8294 }
8295
8297 {
8298 ItemBase.m_DebugActionsMask |= mask;
8299 }
8300
8302 {
8303 ItemBase.m_DebugActionsMask &= ~mask;
8304 }
8305
8307 {
8309 {
8311 }
8312 else
8313 {
8315 }
8316 }
8317
8318
8320 {
8321 if (GetEconomyProfile())
8322 {
8323 float q_max = GetEconomyProfile().GetQuantityMax();
8324 if (q_max > 0)
8325 {
8326 float q_min = GetEconomyProfile().GetQuantityMin();
8327 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8328
8330 {
8331 ComponentEnergyManager comp = GetCompEM();
8333 {
8335 }
8336 }
8338 {
8340
8341 }
8342
8343 }
8344 }
8345 }
8346
8349 {
8350 EntityAI parent = GetHierarchyParent();
8351
8352 if (parent)
8353 {
8354 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8355 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8356 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8357 }
8358 }
8359
8362 {
8363 EntityAI parent = GetHierarchyParent();
8364
8365 if (parent)
8366 {
8367 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8368 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8369 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8370 }
8371 }
8372
8374 {
8375
8376
8377
8378
8380
8382 {
8383 if (ScriptInputUserData.CanStoreInputUserData())
8384 {
8385 ScriptInputUserData ctx = new ScriptInputUserData;
8391 ctx.
Write(use_stack_max);
8394
8396 {
8397 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8398 }
8399 }
8400 }
8401 else if (!
GetGame().IsMultiplayer())
8402 {
8404 }
8405 }
8406
8408 {
8410 }
8411
8413 {
8415 }
8416
8418 {
8420 }
8421
8423 {
8424
8425 return false;
8426 }
8427
8429 {
8430 return false;
8431 }
8432
8436 {
8437 return false;
8438 }
8439
8441 {
8442 return "";
8443 }
8444
8446
8448 {
8449 return false;
8450 }
8451
8453 {
8454 return true;
8455 }
8456
8457
8458
8460 {
8461 return true;
8462 }
8463
8465 {
8466 return true;
8467 }
8468
8470 {
8471 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8473 }
8474
8476 {
8478 }
8479
8481 {
8483 if (!is_being_placed)
8485 SetSynchDirty();
8486 }
8487
8488
8490
8492 {
8494 }
8495
8497 {
8499 }
8500
8502 {
8503 return 1;
8504 }
8505
8507 {
8508 return false;
8509 }
8510
8512 {
8514 SetSynchDirty();
8515 }
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8552 {
8553 super.OnMovedInsideCargo(container);
8554
8555 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8556 }
8557
8558 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8559 {
8560 super.EEItemLocationChanged(oldLoc,newLoc);
8561
8562 PlayerBase new_player = null;
8563 PlayerBase old_player = null;
8564
8565 if (newLoc.GetParent())
8566 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8567
8568 if (oldLoc.GetParent())
8569 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8570
8572 {
8573 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8574
8575 if (r_index >= 0)
8576 {
8577 InventoryLocation r_il = new InventoryLocation;
8578 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8579
8580 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8583 {
8584 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8585 }
8587 {
8588 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8589 }
8590
8591 }
8592 }
8593
8595 {
8596 if (new_player)
8597 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8598
8599 if (new_player == old_player)
8600 {
8601
8602 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8603 {
8605 {
8606 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8607 {
8608 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8609 }
8610 }
8611 else
8612 {
8613 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8614 }
8615 }
8616
8617 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8618 {
8619 int type = oldLoc.GetType();
8621 {
8622 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8623 }
8625 {
8626 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8627 }
8628 }
8629 if (!m_OldLocation)
8630 {
8631 m_OldLocation = new InventoryLocation;
8632 }
8633 m_OldLocation.Copy(oldLoc);
8634 }
8635 else
8636 {
8637 if (m_OldLocation)
8638 {
8639 m_OldLocation.Reset();
8640 }
8641 }
8642
8644 }
8645 else
8646 {
8647 if (new_player)
8648 {
8649 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8650 if (res_index >= 0)
8651 {
8652 InventoryLocation il = new InventoryLocation;
8653 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8655 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8658 {
8659 il.
GetParent().GetOnReleaseLock().Invoke(it);
8660 }
8662 {
8664 }
8665
8666 }
8667 }
8669 {
8670
8672 }
8673
8674 if (m_OldLocation)
8675 {
8676 m_OldLocation.Reset();
8677 }
8678 }
8679 }
8680
8681 override void EOnContact(IEntity other, Contact extra)
8682 {
8684 {
8685 int liquidType = -1;
8687 if (impactSpeed > 0.0)
8688 {
8690 #ifndef SERVER
8692 #else
8694 SetSynchDirty();
8695 #endif
8697 }
8698 }
8699
8700 #ifdef SERVER
8701 if (GetCompEM() && GetCompEM().IsPlugged())
8702 {
8703 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8704 GetCompEM().UnplugThis();
8705 }
8706 #endif
8707 }
8708
8710
8712 {
8714 }
8715
8717 {
8718
8719 }
8720
8722 {
8723 super.OnItemLocationChanged(old_owner, new_owner);
8724
8725 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8726 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8727
8728 if (!relatedPlayer && playerNew)
8729 relatedPlayer = playerNew;
8730
8731 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8732 {
8734 if (actionMgr)
8735 {
8736 ActionBase currentAction = actionMgr.GetRunningAction();
8737 if (currentAction)
8739 }
8740 }
8741
8742 Man ownerPlayerOld = null;
8743 Man ownerPlayerNew = null;
8744
8745 if (old_owner)
8746 {
8747 if (old_owner.
IsMan())
8748 {
8749 ownerPlayerOld = Man.Cast(old_owner);
8750 }
8751 else
8752 {
8753 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8754 }
8755 }
8756 else
8757 {
8759 {
8761
8762 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8763 {
8764 GetCompEM().UnplugThis();
8765 }
8766 }
8767 }
8768
8769 if (new_owner)
8770 {
8771 if (new_owner.
IsMan())
8772 {
8773 ownerPlayerNew = Man.Cast(new_owner);
8774 }
8775 else
8776 {
8777 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8778 }
8779 }
8780
8781 if (ownerPlayerOld != ownerPlayerNew)
8782 {
8783 if (ownerPlayerOld)
8784 {
8785 array<EntityAI> subItemsExit = new array<EntityAI>;
8787 for (int i = 0; i < subItemsExit.Count(); i++)
8788 {
8791 }
8792 }
8793
8794 if (ownerPlayerNew)
8795 {
8796 array<EntityAI> subItemsEnter = new array<EntityAI>;
8798 for (int j = 0; j < subItemsEnter.Count(); j++)
8799 {
8802 }
8803 }
8804 }
8805 else if (ownerPlayerNew != null)
8806 {
8807 PlayerBase nplayer;
8808 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8809 {
8810 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8812 for (int k = 0; k < subItemsUpdate.Count(); k++)
8813 {
8815 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8816 }
8817 }
8818 }
8819
8820 if (old_owner)
8821 old_owner.OnChildItemRemoved(this);
8822 if (new_owner)
8823 new_owner.OnChildItemReceived(this);
8824 }
8825
8826
8828 {
8829 super.EEDelete(parent);
8830 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8831 if (player)
8832 {
8834
8835 if (player.IsAlive())
8836 {
8837 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8838 if (r_index >= 0)
8839 {
8840 InventoryLocation r_il = new InventoryLocation;
8841 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8842
8843 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8846 {
8847 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8848 }
8850 {
8851 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8852 }
8853
8854 }
8855
8856 player.RemoveQuickBarEntityShortcut(this);
8857 }
8858 }
8859 }
8860
8862 {
8863 super.EEKilled(killer);
8864
8867 {
8868 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8869 {
8870 if (IsMagazine())
8871 {
8872 if (Magazine.Cast(this).GetAmmoCount() > 0)
8873 {
8875 }
8876 }
8877 else
8878 {
8880 }
8881 }
8882 }
8883 }
8884
8886 {
8887 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8888
8889 super.OnWasAttached(parent, slot_id);
8890
8893
8895 }
8896
8898 {
8899 super.OnWasDetached(parent, slot_id);
8900
8903 }
8904
8906 {
8907 int idx;
8910
8911 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8912 if (inventory_slots.Count() < 1)
8913 {
8914 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8915 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8916 }
8917 else
8918 {
8919 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8920 }
8921
8922 idx = inventory_slots.Find(slot);
8923 if (idx < 0)
8924 return "";
8925
8926 return attach_types.Get(idx);
8927 }
8928
8930 {
8931 int idx = -1;
8932 string slot;
8933
8936
8937 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8938 if (inventory_slots.Count() < 1)
8939 {
8940 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8941 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8942 }
8943 else
8944 {
8945 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8946 if (detach_types.Count() < 1)
8947 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8948 }
8949
8950 for (int i = 0; i < inventory_slots.Count(); i++)
8951 {
8952 slot = inventory_slots.Get(i);
8953 }
8954
8955 if (slot != "")
8956 {
8957 if (detach_types.Count() == 1)
8958 idx = 0;
8959 else
8960 idx = inventory_slots.Find(slot);
8961 }
8962 if (idx < 0)
8963 return "";
8964
8965 return detach_types.Get(idx);
8966 }
8967
8969 {
8970
8972
8973
8974 float min_time = 1;
8975 float max_time = 3;
8976 float delay = Math.RandomFloat(min_time, max_time);
8977
8978 explode_timer.Run(delay, this, "DoAmmoExplosion");
8979 }
8980
8982 {
8983 Magazine magazine = Magazine.Cast(this);
8984 int pop_sounds_count = 6;
8985 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8986
8987
8988 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8989 string sound_name = pop_sounds[ sound_idx ];
8991
8992
8993 magazine.ServerAddAmmoCount(-1);
8994
8995
8996 float min_temp_to_explode = 100;
8997
8998 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8999 {
9001 }
9002 }
9003
9004
9005 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9006 {
9007 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9008
9009 const int CHANCE_DAMAGE_CARGO = 4;
9010 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9011 const int CHANCE_DAMAGE_NOTHING = 2;
9012
9014 {
9015 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9016 int chances;
9017 int rnd;
9018
9019 if (GetInventory().GetCargo())
9020 {
9021 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9022 rnd = Math.RandomInt(0,chances);
9023
9024 if (rnd < CHANCE_DAMAGE_CARGO)
9025 {
9027 }
9028 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9029 {
9031 }
9032 }
9033 else
9034 {
9035 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9036 rnd = Math.RandomInt(0,chances);
9037
9038 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9039 {
9041 }
9042 }
9043 }
9044 }
9045
9047 {
9048 if (GetInventory().GetCargo())
9049 {
9050 int item_count = GetInventory().GetCargo().GetItemCount();
9051 if (item_count > 0)
9052 {
9053 int random_pick = Math.RandomInt(0, item_count);
9055 if (!item.IsExplosive())
9056 {
9057 item.AddHealth("","",damage);
9058 return true;
9059 }
9060 }
9061 }
9062 return false;
9063 }
9064
9066 {
9067 int attachment_count = GetInventory().AttachmentCount();
9068 if (attachment_count > 0)
9069 {
9070 int random_pick = Math.RandomInt(0, attachment_count);
9071 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9072 if (!attachment.IsExplosive())
9073 {
9074 attachment.AddHealth("","",damage);
9075 return true;
9076 }
9077 }
9078 return false;
9079 }
9080
9082 {
9084 }
9085
9087 {
9089 return GetInventory().CanRemoveEntity();
9090
9091 return false;
9092 }
9093
9095 {
9096
9098 return false;
9099
9100
9102 return false;
9103
9104
9105
9107 if (delta == 0)
9108 return false;
9109
9110
9111 return true;
9112 }
9113
9115 {
9117 {
9118 if (ScriptInputUserData.CanStoreInputUserData())
9119 {
9120 ScriptInputUserData ctx = new ScriptInputUserData;
9125 ctx.
Write(destination_entity);
9129 }
9130 }
9131 else if (!
GetGame().IsMultiplayer())
9132 {
9134 }
9135 }
9136
9138 {
9139 float split_quantity_new;
9143 InventoryLocation loc = new InventoryLocation;
9144
9145 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9146 {
9148 split_quantity_new = stack_max;
9149 else
9151
9153 {
9154 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9155 if (new_item)
9156 {
9157 new_item.SetResultOfSplit(true);
9158 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9160 new_item.
SetQuantity(split_quantity_new,
false,
true);
9161 }
9162 }
9163 }
9164 else if (destination_entity && slot_id == -1)
9165 {
9166 if (quantity > stack_max)
9167 split_quantity_new = stack_max;
9168 else
9169 split_quantity_new = quantity;
9170
9172 {
9174 {
9177 }
9178
9179 if (new_item)
9180 {
9181 new_item.SetResultOfSplit(true);
9182 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9184 new_item.
SetQuantity(split_quantity_new,
false,
true);
9185 }
9186 }
9187 }
9188 else
9189 {
9190 if (stack_max != 0)
9191 {
9193 {
9195 }
9196
9197 if (split_quantity_new == 0)
9198 {
9199 if (!
GetGame().IsMultiplayer())
9200 player.PhysicalPredictiveDropItem(this);
9201 else
9202 player.ServerDropEntity(this);
9203 return;
9204 }
9205
9207 {
9209
9210 if (new_item)
9211 {
9212 new_item.SetResultOfSplit(true);
9213 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9216 new_item.PlaceOnSurface();
9217 }
9218 }
9219 }
9220 }
9221 }
9222
9224 {
9225 float split_quantity_new;
9229 InventoryLocation loc = new InventoryLocation;
9230
9231 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9232 {
9234 split_quantity_new = stack_max;
9235 else
9237
9239 {
9240 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9241 if (new_item)
9242 {
9243 new_item.SetResultOfSplit(true);
9244 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9246 new_item.
SetQuantity(split_quantity_new,
false,
true);
9247 }
9248 }
9249 }
9250 else if (destination_entity && slot_id == -1)
9251 {
9252 if (quantity > stack_max)
9253 split_quantity_new = stack_max;
9254 else
9255 split_quantity_new = quantity;
9256
9258 {
9260 {
9263 }
9264
9265 if (new_item)
9266 {
9267 new_item.SetResultOfSplit(true);
9268 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9270 new_item.
SetQuantity(split_quantity_new,
false,
true);
9271 }
9272 }
9273 }
9274 else
9275 {
9276 if (stack_max != 0)
9277 {
9279 {
9281 }
9282
9284 {
9286
9287 if (new_item)
9288 {
9289 new_item.SetResultOfSplit(true);
9290 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9293 new_item.PlaceOnSurface();
9294 }
9295 }
9296 }
9297 }
9298 }
9299
9301 {
9303 {
9304 if (ScriptInputUserData.CanStoreInputUserData())
9305 {
9306 ScriptInputUserData ctx = new ScriptInputUserData;
9311 dst.WriteToContext(ctx);
9313 }
9314 }
9315 else if (!
GetGame().IsMultiplayer())
9316 {
9318 }
9319 }
9320
9322 {
9324 {
9325 if (ScriptInputUserData.CanStoreInputUserData())
9326 {
9327 ScriptInputUserData ctx = new ScriptInputUserData;
9332 ctx.
Write(destination_entity);
9338 }
9339 }
9340 else if (!
GetGame().IsMultiplayer())
9341 {
9343 }
9344 }
9345
9347 {
9349 }
9350
9352 {
9354 float split_quantity_new;
9356 if (dst.IsValid())
9357 {
9358 int slot_id = dst.GetSlot();
9360
9361 if (quantity > stack_max)
9362 split_quantity_new = stack_max;
9363 else
9364 split_quantity_new = quantity;
9365
9367 {
9369
9370 if (new_item)
9371 {
9372 new_item.SetResultOfSplit(true);
9373 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9375 new_item.
SetQuantity(split_quantity_new,
false,
true);
9376 }
9377
9378 return new_item;
9379 }
9380 }
9381
9382 return null;
9383 }
9384
9386 {
9388 float split_quantity_new;
9390 if (destination_entity)
9391 {
9393 if (quantity > stackable)
9394 split_quantity_new = stackable;
9395 else
9396 split_quantity_new = quantity;
9397
9399 {
9400 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9401 if (new_item)
9402 {
9403 new_item.SetResultOfSplit(true);
9404 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9406 new_item.
SetQuantity(split_quantity_new,
false,
true);
9407 }
9408 }
9409 }
9410 }
9411
9413 {
9415 {
9416 if (ScriptInputUserData.CanStoreInputUserData())
9417 {
9418 ScriptInputUserData ctx = new ScriptInputUserData;
9423 ItemBase destination_entity =
this;
9424 ctx.
Write(destination_entity);
9428 }
9429 }
9430 else if (!
GetGame().IsMultiplayer())
9431 {
9433 }
9434 }
9435
9437 {
9439 float split_quantity_new;
9441 if (player)
9442 {
9444 if (quantity > stackable)
9445 split_quantity_new = stackable;
9446 else
9447 split_quantity_new = quantity;
9448
9450 {
9451 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9452 new_item =
ItemBase.Cast(in_hands);
9453 if (new_item)
9454 {
9455 new_item.SetResultOfSplit(true);
9456 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9458 new_item.SetQuantity(split_quantity_new, false, true);
9459 }
9460 }
9461 }
9462 }
9463
9465 {
9467 float split_quantity_new = Math.Floor(quantity * 0.5);
9468
9470 return;
9471
9473
9474 if (new_item)
9475 {
9476 if (new_item.GetQuantityMax() < split_quantity_new)
9477 {
9478 split_quantity_new = new_item.GetQuantityMax();
9479 }
9480
9481 new_item.SetResultOfSplit(true);
9482 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9483
9485 {
9488 }
9489 else
9490 {
9492 new_item.
SetQuantity(split_quantity_new,
false,
true);
9493 }
9494 }
9495 }
9496
9498 {
9500 float split_quantity_new = Math.Floor(quantity / 2);
9501
9503 return;
9504
9505 InventoryLocation invloc = new InventoryLocation;
9507
9509 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9510
9511 if (new_item)
9512 {
9513 if (new_item.GetQuantityMax() < split_quantity_new)
9514 {
9515 split_quantity_new = new_item.GetQuantityMax();
9516 }
9518 {
9521 }
9522 else if (split_quantity_new > 1)
9523 {
9525 new_item.
SetQuantity(split_quantity_new,
false,
true);
9526 }
9527 }
9528 }
9529
9532 {
9533 SetWeightDirty();
9535
9536 if (parent)
9537 parent.OnAttachmentQuantityChangedEx(this, delta);
9538
9540 {
9542 {
9544 }
9546 {
9547 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9549 }
9550 }
9551
9552 }
9553
9556 {
9557
9558 }
9559
9562 {
9564 }
9565
9567 {
9568 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9569
9571 {
9572 if (newLevel == GameConstants.STATE_RUINED)
9573 {
9575 EntityAI parent = GetHierarchyParent();
9576 if (parent && parent.IsFireplace())
9577 {
9578 CargoBase cargo = GetInventory().GetCargo();
9579 if (cargo)
9580 {
9582 {
9584 }
9585 }
9586 }
9587 }
9588
9590 {
9591
9593 return;
9594 }
9595
9596 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9597 {
9599 }
9600 }
9601 }
9602
9603
9605 {
9606 super.OnRightClick();
9607
9609 {
9611 {
9612 if (ScriptInputUserData.CanStoreInputUserData())
9613 {
9614 EntityAI root = GetHierarchyRoot();
9615 Man playerOwner = GetHierarchyRootPlayer();
9616 InventoryLocation dst = new InventoryLocation;
9617
9618
9619 if (!playerOwner && root && root == this)
9620 {
9622 }
9623 else
9624 {
9625
9626 GetInventory().GetCurrentInventoryLocation(dst);
9628 {
9631 {
9633 }
9634 else
9635 {
9637
9638
9639 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9640 {
9642 }
9643 else
9644 {
9645 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9646 }
9647 }
9648 }
9649 }
9650
9651 ScriptInputUserData ctx = new ScriptInputUserData;
9659 }
9660 }
9661 else if (!
GetGame().IsMultiplayer())
9662 {
9664 }
9665 }
9666 }
9667
9669 {
9670 if (root)
9671 {
9672 vector m4[4];
9673 root.GetTransform(m4);
9674 dst.SetGround(this, m4);
9675 }
9676 else
9677 {
9678 GetInventory().GetCurrentInventoryLocation(dst);
9679 }
9680 }
9681
9682 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9683 {
9684
9685 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9686 return false;
9687
9688 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9689 return false;
9690
9691
9693 return false;
9694
9695
9696 Magazine mag = Magazine.Cast(this);
9697 if (mag)
9698 {
9699 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9700 return false;
9701
9702 if (stack_max_limit)
9703 {
9704 Magazine other_mag = Magazine.Cast(other_item);
9705 if (other_item)
9706 {
9707 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9708 return false;
9709 }
9710
9711 }
9712 }
9713 else
9714 {
9715
9717 return false;
9718
9720 return false;
9721 }
9722
9723 PlayerBase player = null;
9724 if (CastTo(player, GetHierarchyRootPlayer()))
9725 {
9726 if (player.GetInventory().HasAttachment(this))
9727 return false;
9728
9729 if (player.IsItemsToDelete())
9730 return false;
9731 }
9732
9733 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9734 return false;
9735
9736 int slotID;
9738 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9739 return false;
9740
9741 return true;
9742 }
9743
9745 {
9747 }
9748
9750 {
9751 return m_IsResultOfSplit;
9752 }
9753
9755 {
9756 m_IsResultOfSplit = value;
9757 }
9758
9760 {
9762 }
9763
9765 {
9766 float other_item_quantity = other_item.GetQuantity();
9767 float this_free_space;
9768
9770
9772
9773 if (other_item_quantity > this_free_space)
9774 {
9775 return this_free_space;
9776 }
9777 else
9778 {
9779 return other_item_quantity;
9780 }
9781 }
9782
9784 {
9786 }
9787
9789 {
9791 return;
9792
9793 if (!IsMagazine() && other_item)
9794 {
9796 if (quantity_used != 0)
9797 {
9798 float hp1 = GetHealth01("","");
9799 float hp2 = other_item.GetHealth01("","");
9800 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9801 hpResult = hpResult / (
GetQuantity() + quantity_used);
9802
9803 hpResult *= GetMaxHealth();
9804 Math.Round(hpResult);
9805 SetHealth("", "Health", hpResult);
9806
9808 other_item.AddQuantity(-quantity_used);
9809 }
9810 }
9812 }
9813
9815 {
9816 #ifdef SERVER
9817 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9818 GetHierarchyParent().IncreaseLifetimeUp();
9819 #endif
9820 };
9821
9823 {
9824 PlayerBase p = PlayerBase.Cast(player);
9825
9826 array<int> recipesIds = p.m_Recipes;
9827 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9828 if (moduleRecipesManager)
9829 {
9830 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9831 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9832 }
9833
9834 for (int i = 0;i < recipesIds.Count(); i++)
9835 {
9836 int key = recipesIds.Get(i);
9837 string recipeName = moduleRecipesManager.GetRecipeName(key);
9839 }
9840 }
9841
9842
9843 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9844 {
9845 super.GetDebugActions(outputList);
9846
9847
9853
9854
9859
9864
9865
9869
9870
9872 {
9876 }
9877
9880
9881
9885
9887
9888 InventoryLocation loc = new InventoryLocation();
9889 GetInventory().GetCurrentInventoryLocation(loc);
9891 {
9892 if (Gizmo_IsSupported())
9895 }
9896
9898 }
9899
9900
9901
9902
9904 {
9905 super.OnAction(action_id, player, ctx);
9906
9908 {
9909 switch (action_id)
9910 {
9913 return true;
9916 return true;
9917 }
9918 }
9919
9921 {
9922 switch (action_id)
9923 {
9925 Delete();
9926 return true;
9927 }
9928 }
9929
9930 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9931 {
9932 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9933 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9934 PlayerBase p = PlayerBase.Cast(player);
9935 if (
EActions.RECIPES_RANGE_START < 1000)
9936 {
9937 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9938 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9939 }
9940 }
9941 #ifndef SERVER
9942 else if (action_id ==
EActions.WATCH_PLAYER)
9943 {
9944 PluginDeveloper.SetDeveloperItemClientEx(player);
9945 }
9946 #endif
9948 {
9949 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9950 {
9951 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9952 OnDebugButtonPressServer(id + 1);
9953 }
9954
9955 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9956 {
9957 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9959 }
9960
9961 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9962 {
9963 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9965 }
9966
9967 else if (action_id ==
EActions.ADD_QUANTITY)
9968 {
9969 if (IsMagazine())
9970 {
9971 Magazine mag = Magazine.Cast(this);
9972 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9973 }
9974 else
9975 {
9977 }
9978
9979 if (m_EM)
9980 {
9981 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9982 }
9983
9984 }
9985
9986 else if (action_id ==
EActions.REMOVE_QUANTITY)
9987 {
9988 if (IsMagazine())
9989 {
9990 Magazine mag2 = Magazine.Cast(this);
9991 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9992 }
9993 else
9994 {
9996 }
9997 if (m_EM)
9998 {
9999 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10000 }
10001
10002 }
10003
10004 else if (action_id ==
EActions.SET_QUANTITY_0)
10005 {
10007
10008 if (m_EM)
10009 {
10010 m_EM.SetEnergy(0);
10011 }
10012 }
10013
10014 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10015 {
10017
10018 if (m_EM)
10019 {
10020 m_EM.SetEnergy(m_EM.GetEnergyMax());
10021 }
10022 }
10023
10024 else if (action_id ==
EActions.ADD_HEALTH)
10025 {
10026 AddHealth("","",GetMaxHealth("","Health")/5);
10027 }
10028 else if (action_id ==
EActions.REMOVE_HEALTH)
10029 {
10030 AddHealth("","",-GetMaxHealth("","Health")/5);
10031 }
10032 else if (action_id ==
EActions.DESTROY_HEALTH)
10033 {
10034 SetHealth01("","",0);
10035 }
10036 else if (action_id ==
EActions.WATCH_ITEM)
10037 {
10039 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10040 #ifdef DEVELOPER
10041 SetDebugDeveloper_item(this);
10042 #endif
10043 }
10044
10045 else if (action_id ==
EActions.ADD_TEMPERATURE)
10046 {
10047 AddTemperature(20);
10048
10049 }
10050
10051 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10052 {
10053 AddTemperature(-20);
10054
10055 }
10056
10057 else if (action_id ==
EActions.FLIP_FROZEN)
10058 {
10059 SetFrozen(!GetIsFrozen());
10060
10061 }
10062
10063 else if (action_id ==
EActions.ADD_WETNESS)
10064 {
10066
10067 }
10068
10069 else if (action_id ==
EActions.REMOVE_WETNESS)
10070 {
10072
10073 }
10074
10075 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10076 {
10079
10080
10081 }
10082
10083 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10084 {
10087 }
10088
10089 else if (action_id ==
EActions.MAKE_SPECIAL)
10090 {
10091 auto debugParams = DebugSpawnParams.WithPlayer(player);
10092 OnDebugSpawnEx(debugParams);
10093 }
10094
10095 }
10096
10097
10098 return false;
10099 }
10100
10101
10102
10103
10107
10110
10111
10112
10114 {
10115 return false;
10116 }
10117
10118
10120 {
10121 return true;
10122 }
10123
10124
10126 {
10127 return true;
10128 }
10129
10130
10131
10133 {
10134 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10136 }
10137
10140 {
10141 return null;
10142 }
10143
10145 {
10146 return false;
10147 }
10148
10150 {
10151 return false;
10152 }
10153
10157
10158
10160 {
10161 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10162 return module_repairing.CanRepair(this, item_repair_kit);
10163 }
10164
10165
10166 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10167 {
10168 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10169 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10170 }
10171
10172
10174 {
10175
10176
10177
10178
10179
10180
10181
10182
10183 return 1;
10184 }
10185
10186
10187
10189 {
10191 }
10192
10193
10194
10196 {
10198 }
10199
10200
10209 {
10210 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10211
10212 if (player)
10213 {
10214 player.MessageStatus(text);
10215 }
10216 }
10217
10218
10227 {
10228 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10229
10230 if (player)
10231 {
10232 player.MessageAction(text);
10233 }
10234 }
10235
10236
10245 {
10246 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10247
10248 if (player)
10249 {
10250 player.MessageFriendly(text);
10251 }
10252 }
10253
10254
10263 {
10264 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10265
10266 if (player)
10267 {
10268 player.MessageImportant(text);
10269 }
10270 }
10271
10273 {
10274 return true;
10275 }
10276
10277
10278 override bool KindOf(
string tag)
10279 {
10280 bool found = false;
10281 string item_name = this.
GetType();
10284
10285 int array_size = item_tag_array.Count();
10286 for (int i = 0; i < array_size; i++)
10287 {
10288 if (item_tag_array.Get(i) == tag)
10289 {
10290 found = true;
10291 break;
10292 }
10293 }
10294 return found;
10295 }
10296
10297
10299 {
10300
10301 super.OnRPC(sender, rpc_type,ctx);
10302
10303
10304 switch (rpc_type)
10305 {
10306 #ifndef SERVER
10307 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10308 Param2<bool, string> p = new Param2<bool, string>(false, "");
10309
10311 return;
10312
10313 bool play = p.param1;
10314 string soundSet = p.param2;
10315
10316 if (play)
10317 {
10319 {
10321 {
10323 }
10324 }
10325 else
10326 {
10328 }
10329 }
10330 else
10331 {
10333 }
10334
10335 break;
10336 #endif
10337
10338 }
10339
10341 {
10343 }
10344 }
10345
10346
10347
10348
10350 {
10351 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10352 return plugin.GetID(
name);
10353 }
10354
10356 {
10357 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10358 return plugin.GetName(id);
10359 }
10360
10363 {
10364
10365
10366 int varFlags;
10367 if (!ctx.
Read(varFlags))
10368 return;
10369
10370 if (varFlags & ItemVariableFlags.FLOAT)
10371 {
10373 }
10374 }
10375
10377 {
10378
10379 super.SerializeNumericalVars(floats_out);
10380
10381
10382
10384 {
10386 }
10387
10389 {
10391 }
10392
10394 {
10396 }
10397
10399 {
10404 }
10405
10407 {
10409 }
10410 }
10411
10413 {
10414
10415 super.DeSerializeNumericalVars(floats);
10416
10417
10418 int index = 0;
10419 int mask = Math.Round(floats.Get(index));
10420
10421 index++;
10422
10424 {
10426 {
10428 }
10429 else
10430 {
10431 float quantity = floats.Get(index);
10432 SetQuantity(quantity,
true,
false,
false,
false);
10433 }
10434 index++;
10435 }
10436
10438 {
10439 float wet = floats.Get(index);
10441 index++;
10442 }
10443
10445 {
10446 int liquidtype = Math.Round(floats.Get(index));
10448 index++;
10449 }
10450
10452 {
10454 index++;
10456 index++;
10458 index++;
10460 index++;
10461 }
10462
10464 {
10465 int cleanness = Math.Round(floats.Get(index));
10467 index++;
10468 }
10469 }
10470
10472 {
10473 super.WriteVarsToCTX(ctx);
10474
10475
10477 {
10479 }
10480
10482 {
10484 }
10485
10487 {
10489 }
10490
10492 {
10493 int r,g,b,a;
10499 }
10500
10502 {
10504 }
10505 }
10506
10508 {
10509 if (!super.ReadVarsFromCTX(ctx,version))
10510 return false;
10511
10512 int intValue;
10513 float value;
10514
10515 if (version < 140)
10516 {
10517 if (!ctx.
Read(intValue))
10518 return false;
10519
10520 m_VariablesMask = intValue;
10521 }
10522
10524 {
10525 if (!ctx.
Read(value))
10526 return false;
10527
10529 {
10531 }
10532 else
10533 {
10535 }
10536 }
10537
10538 if (version < 140)
10539 {
10541 {
10542 if (!ctx.
Read(value))
10543 return false;
10544 SetTemperatureDirect(value);
10545 }
10546 }
10547
10549 {
10550 if (!ctx.
Read(value))
10551 return false;
10553 }
10554
10556 {
10557 if (!ctx.
Read(intValue))
10558 return false;
10560 }
10561
10563 {
10564 int r,g,b,a;
10566 return false;
10568 return false;
10570 return false;
10572 return false;
10573
10575 }
10576
10578 {
10579 if (!ctx.
Read(intValue))
10580 return false;
10582 }
10583
10584 if (version >= 138 && version < 140)
10585 {
10587 {
10588 if (!ctx.
Read(intValue))
10589 return false;
10590 SetFrozen(intValue);
10591 }
10592 }
10593
10594 return true;
10595 }
10596
10597
10599 {
10602 {
10604 }
10605
10606 if (!super.OnStoreLoad(ctx, version))
10607 {
10609 return false;
10610 }
10611
10612 if (version >= 114)
10613 {
10614 bool hasQuickBarIndexSaved;
10615
10616 if (!ctx.
Read(hasQuickBarIndexSaved))
10617 {
10619 return false;
10620 }
10621
10622 if (hasQuickBarIndexSaved)
10623 {
10624 int itmQBIndex;
10625
10626
10627 if (!ctx.
Read(itmQBIndex))
10628 {
10630 return false;
10631 }
10632
10633 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10634 if (itmQBIndex != -1 && parentPlayer)
10635 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10636 }
10637 }
10638 else
10639 {
10640
10641 PlayerBase player;
10642 int itemQBIndex;
10643 if (version ==
int.
MAX)
10644 {
10645 if (!ctx.
Read(itemQBIndex))
10646 {
10648 return false;
10649 }
10650 }
10651 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10652 {
10653
10654 if (!ctx.
Read(itemQBIndex))
10655 {
10657 return false;
10658 }
10659 if (itemQBIndex != -1 && player)
10660 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10661 }
10662 }
10663
10664 if (version < 140)
10665 {
10666
10667 if (!LoadVariables(ctx, version))
10668 {
10670 return false;
10671 }
10672 }
10673
10674
10676 {
10678 return false;
10679 }
10680 if (version >= 132)
10681 {
10683 if (raib)
10684 {
10686 {
10688 return false;
10689 }
10690 }
10691 }
10692
10694 return true;
10695 }
10696
10697
10698
10700 {
10701 super.OnStoreSave(ctx);
10702
10703 PlayerBase player;
10704 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10705 {
10707
10708 int itemQBIndex = -1;
10709 itemQBIndex = player.FindQuickBarEntityIndex(this);
10710 ctx.
Write(itemQBIndex);
10711 }
10712 else
10713 {
10715 }
10716
10718
10720 if (raib)
10721 {
10723 }
10724 }
10725
10726
10728 {
10729 super.AfterStoreLoad();
10730
10732 {
10734 }
10735
10737 {
10740 }
10741 }
10742
10744 {
10745 super.EEOnAfterLoad();
10746
10748 {
10750 }
10751
10754 }
10755
10757 {
10758 return false;
10759 }
10760
10761
10762
10764 {
10766 {
10767 #ifdef PLATFORM_CONSOLE
10768
10770 {
10772 if (menu)
10773 {
10775 }
10776 }
10777 #endif
10778 }
10779
10781 {
10784 }
10785
10787 {
10788 SetWeightDirty();
10790 }
10792 {
10795 }
10796
10798 {
10801 }
10803 {
10806 }
10807
10808 super.OnVariablesSynchronized();
10809 }
10810
10811
10812
10814 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10815 {
10816 if (!IsServerCheck(allow_client))
10817 return false;
10818
10820 return false;
10821
10824
10825 if (value <= (min + 0.001))
10826 value = min;
10827
10828 if (value == min)
10829 {
10830 if (destroy_config)
10831 {
10832 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10833 if (dstr)
10834 {
10836 this.Delete();
10837 return true;
10838 }
10839 }
10840 else if (destroy_forced)
10841 {
10843 this.Delete();
10844 return true;
10845 }
10846
10848 }
10849
10852
10854 {
10856
10857 if (delta)
10859 }
10860
10862
10863 return false;
10864 }
10865
10866
10868 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10869 {
10871 }
10872
10874 {
10877 }
10878
10880 {
10883 }
10884
10886 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10887 {
10888 float value_clamped = Math.Clamp(value, 0, 1);
10890 SetQuantity(result, destroy_config, destroy_forced);
10891 }
10892
10893
10896 {
10898 }
10899
10901 {
10903 }
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10915 {
10916 int slot = -1;
10917 if (GetInventory())
10918 {
10919 InventoryLocation il = new InventoryLocation;
10920 GetInventory().GetCurrentInventoryLocation(il);
10922 }
10923
10925 }
10926
10928 {
10929 float quantity_max = 0;
10930
10932 {
10933 if (attSlotID != -1)
10934 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10935
10936 if (quantity_max <= 0)
10938 }
10939
10940 if (quantity_max <= 0)
10942
10943 return quantity_max;
10944 }
10945
10947 {
10949 }
10950
10952 {
10954 }
10955
10956
10958 {
10960 }
10961
10963 {
10965 }
10966
10968 {
10970 }
10971
10972
10974 {
10975
10976 float weightEx = GetWeightEx();
10977 float special = GetInventoryAndCargoWeight();
10978 return weightEx - special;
10979 }
10980
10981
10983 {
10985 }
10986
10988 {
10990 {
10991 #ifdef DEVELOPER
10992 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10993 {
10994 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10996 }
10997 #endif
10998
10999 return GetQuantity() * GetConfigWeightModified();
11000 }
11001 else if (HasEnergyManager())
11002 {
11003 #ifdef DEVELOPER
11004 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11005 {
11006 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11007 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11008 }
11009 #endif
11010 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11011 }
11012 else
11013 {
11014 #ifdef DEVELOPER
11015 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11016 {
11017 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11018 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11019 }
11020 #endif
11021 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11022 }
11023 }
11024
11027 {
11028 int item_count = 0;
11030
11031 if (GetInventory().GetCargo() != NULL)
11032 {
11033 item_count = GetInventory().GetCargo().GetItemCount();
11034 }
11035
11036 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11037 {
11038 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11039 if (item)
11040 item_count += item.GetNumberOfItems();
11041 }
11042 return item_count;
11043 }
11044
11047 {
11048 float weight = 0;
11049 float wetness = 1;
11050 if (include_wetness)
11053 {
11054 weight = wetness * m_ConfigWeight;
11055 }
11057 {
11058 weight = 1;
11059 }
11060 return weight;
11061 }
11062
11063
11064
11066 {
11067 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11068 {
11069 GameInventory inv = GetInventory();
11070 array<EntityAI> items = new array<EntityAI>;
11072 for (int i = 0; i < items.Count(); i++)
11073 {
11075 if (item)
11076 {
11078 }
11079 }
11080 }
11081 }
11082
11083
11084
11085
11087 {
11088 float energy = 0;
11089 if (HasEnergyManager())
11090 {
11091 energy = GetCompEM().GetEnergy();
11092 }
11093 return energy;
11094 }
11095
11096
11098 {
11099 super.OnEnergyConsumed();
11100
11102 }
11103
11105 {
11106 super.OnEnergyAdded();
11107
11109 }
11110
11111
11113 {
11114 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11115 {
11117 {
11118 float energy_0to1 = GetCompEM().GetEnergy0To1();
11120 }
11121 }
11122 }
11123
11124
11126 {
11127 return ConfigGetFloat("heatIsolation");
11128 }
11129
11131 {
11133 }
11134
11136 {
11137 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11138 if (
GetGame().ConfigIsExisting(paramPath))
11140
11141 return 0.0;
11142 }
11143
11145 {
11146 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11147 if (
GetGame().ConfigIsExisting(paramPath))
11149
11150 return 0.0;
11151 }
11152
11153 override void SetWet(
float value,
bool allow_client =
false)
11154 {
11155 if (!IsServerCheck(allow_client))
11156 return;
11157
11160
11162
11163 m_VarWet = Math.Clamp(value, min, max);
11164
11166 {
11169 }
11170 }
11171
11172 override void AddWet(
float value)
11173 {
11175 }
11176
11178 {
11180 }
11181
11183 {
11185 }
11186
11188 {
11190 }
11191
11193 {
11195 }
11196
11198 {
11200 }
11201
11202 override void OnWetChanged(
float newVal,
float oldVal)
11203 {
11206 if (newLevel != oldLevel)
11207 {
11209 }
11210 }
11211
11213 {
11214 SetWeightDirty();
11215 }
11216
11218 {
11219 return GetWetLevelInternal(
m_VarWet);
11220 }
11221
11222
11223
11225 {
11227 }
11228
11230 {
11232 }
11233
11235 {
11237 }
11238
11240 {
11242 }
11243
11244
11245
11247 {
11248 if (ConfigIsExisting("itemModelLength"))
11249 {
11250 return ConfigGetFloat("itemModelLength");
11251 }
11252 return 0;
11253 }
11254
11256 {
11257 if (ConfigIsExisting("itemAttachOffset"))
11258 {
11259 return ConfigGetFloat("itemAttachOffset");
11260 }
11261 return 0;
11262 }
11263
11264 override void SetCleanness(
int value,
bool allow_client =
false)
11265 {
11266 if (!IsServerCheck(allow_client))
11267 return;
11268
11270
11272
11275 }
11276
11278 {
11280 }
11281
11283 {
11284 return true;
11285 }
11286
11287
11288
11289
11291 {
11293 }
11294
11296 {
11298 }
11299
11300
11301
11302
11303 override void SetColor(
int r,
int g,
int b,
int a)
11304 {
11310 }
11312 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11313 {
11318 }
11319
11321 {
11323 }
11324
11327 {
11328 int r,g,b,a;
11330 r = r/255;
11331 g = g/255;
11332 b = b/255;
11333 a = a/255;
11334 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11335 }
11336
11337
11338
11339 override void SetLiquidType(
int value,
bool allow_client =
false)
11340 {
11341 if (!IsServerCheck(allow_client))
11342 return;
11343
11348 }
11349
11351 {
11352 return ConfigGetInt("varLiquidTypeInit");
11353 }
11354
11356 {
11358 }
11359
11361 {
11363 SetFrozen(false);
11364 }
11365
11368 {
11369 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11370 }
11371
11372
11375 {
11376 PlayerBase nplayer;
11377 if (PlayerBase.CastTo(nplayer, player))
11378 {
11380
11381 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11382 }
11383 }
11384
11385
11388 {
11389 PlayerBase nplayer;
11390 if (PlayerBase.CastTo(nplayer,player))
11391 {
11392
11393 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11394
11395 }
11396
11397
11398 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11399
11400
11401 if (HasEnergyManager())
11402 {
11403 GetCompEM().UpdatePlugState();
11404 }
11405 }
11406
11407
11409 {
11410 super.OnPlacementStarted(player);
11411
11413 }
11414
11415 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11416 {
11418 {
11419 m_AdminLog.OnPlacementComplete(player,
this);
11420 }
11421
11422 super.OnPlacementComplete(player, position, orientation);
11423 }
11424
11425
11426
11427
11428
11430 {
11432 {
11433 return true;
11434 }
11435 else
11436 {
11437 return false;
11438 }
11439 }
11440
11441
11443 {
11445 {
11447 }
11448 }
11449
11450
11452 {
11454 }
11455
11457 {
11459 }
11460
11461 override void InsertAgent(
int agent,
float count = 1)
11462 {
11463 if (count < 1)
11464 return;
11465
11467 }
11468
11471 {
11473 }
11474
11475
11477 {
11479 }
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11523 {
11525 return false;
11526 return true;
11527 }
11528
11530 {
11531
11533 }
11534
11535
11538 {
11539 super.CheckForRoofLimited(timeTresholdMS);
11540
11542 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11543 {
11544 m_PreviousRoofTestTime = time;
11545 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11546 }
11547 }
11548
11549
11551 {
11553 {
11554 return 0;
11555 }
11556
11557 if (GetInventory().GetAttachmentSlotsCount() != 0)
11558 {
11559 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11560 if (filter)
11561 return filter.GetProtectionLevel(type, false, system);
11562 else
11563 return 0;
11564 }
11565
11566 string subclassPath, entryName;
11567
11568 switch (type)
11569 {
11571 entryName = "biological";
11572 break;
11574 entryName = "chemical";
11575 break;
11576 default:
11577 entryName = "biological";
11578 break;
11579 }
11580
11581 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11582
11584 }
11585
11586
11587
11590 {
11591 if (!IsMagazine())
11593
11595 }
11596
11597
11598
11599
11600
11605 {
11606 return true;
11607 }
11608
11610 {
11612 }
11613
11614
11615
11616
11617
11619 {
11620 if (parent)
11621 {
11622 if (parent.IsInherited(DayZInfected))
11623 return true;
11624
11625 if (!parent.IsRuined())
11626 return true;
11627 }
11628
11629 return true;
11630 }
11631
11633 {
11634 if (!super.CanPutAsAttachment(parent))
11635 {
11636 return false;
11637 }
11638
11639 if (!IsRuined() && !parent.IsRuined())
11640 {
11641 return true;
11642 }
11643
11644 return false;
11645 }
11646
11648 {
11649
11650
11651
11652
11653 return super.CanReceiveItemIntoCargo(item);
11654 }
11655
11657 {
11658
11659
11660
11661
11662 GameInventory attachmentInv = attachment.GetInventory();
11664 {
11665 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11666 return false;
11667 }
11668
11669 InventoryLocation loc = new InventoryLocation();
11670 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11671 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11672 return false;
11673
11674 return super.CanReceiveAttachment(attachment, slotId);
11675 }
11676
11678 {
11679 if (!super.CanReleaseAttachment(attachment))
11680 return false;
11681
11682 return GetInventory().AreChildrenAccessible();
11683 }
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11706 {
11707 int id = muzzle_owner.GetMuzzleID();
11708 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11709
11710 if (WPOF_array)
11711 {
11712 for (int i = 0; i < WPOF_array.Count(); i++)
11713 {
11714 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11715
11716 if (WPOF)
11717 {
11718 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11719 }
11720 }
11721 }
11722 }
11723
11724
11726 {
11727 int id = muzzle_owner.GetMuzzleID();
11729
11730 if (WPOBE_array)
11731 {
11732 for (int i = 0; i < WPOBE_array.Count(); i++)
11733 {
11734 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11735
11736 if (WPOBE)
11737 {
11738 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11739 }
11740 }
11741 }
11742 }
11743
11744
11746 {
11747 int id = muzzle_owner.GetMuzzleID();
11748 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11749
11750 if (WPOOH_array)
11751 {
11752 for (int i = 0; i < WPOOH_array.Count(); i++)
11753 {
11754 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11755
11756 if (WPOOH)
11757 {
11758 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11759 }
11760 }
11761 }
11762 }
11763
11764
11766 {
11767 int id = muzzle_owner.GetMuzzleID();
11768 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11769
11770 if (WPOOH_array)
11771 {
11772 for (int i = 0; i < WPOOH_array.Count(); i++)
11773 {
11774 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11775
11776 if (WPOOH)
11777 {
11778 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11779 }
11780 }
11781 }
11782 }
11783
11784
11786 {
11787 int id = muzzle_owner.GetMuzzleID();
11788 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11789
11790 if (WPOOH_array)
11791 {
11792 for (int i = 0; i < WPOOH_array.Count(); i++)
11793 {
11794 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11795
11796 if (WPOOH)
11797 {
11798 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11799 }
11800 }
11801 }
11802 }
11803
11804
11805
11807 {
11809 {
11810 return true;
11811 }
11812
11813 return false;
11814 }
11815
11817 {
11819 {
11820 return true;
11821 }
11822
11823 return false;
11824 }
11825
11827 {
11829 {
11830 return true;
11831 }
11832
11833 return false;
11834 }
11835
11837 {
11838 return false;
11839 }
11840
11843 {
11844 return UATimeSpent.DEFAULT_DEPLOY;
11845 }
11846
11847
11848
11849
11851 {
11853 SetSynchDirty();
11854 }
11855
11857 {
11859 }
11860
11861
11863 {
11864 return false;
11865 }
11866
11869 {
11870 string att_type = "None";
11871
11872 if (ConfigIsExisting("soundAttType"))
11873 {
11874 att_type = ConfigGetString("soundAttType");
11875 }
11876
11878 }
11879
11881 {
11883 }
11884
11885
11886
11887
11888
11894
11896 {
11899
11901 }
11902
11903
11905 {
11907 return;
11908
11910
11913
11916
11917 SoundParameters params = new SoundParameters();
11921 }
11922
11923
11925 {
11927 return;
11928
11930 SetSynchDirty();
11931
11934 }
11935
11936
11938 {
11940 return;
11941
11943 SetSynchDirty();
11944
11947 }
11948
11950 {
11952 }
11953
11955 {
11957 }
11958
11961 {
11962 if (!
GetGame().IsDedicatedServer())
11963 {
11964 if (ConfigIsExisting("attachSoundSet"))
11965 {
11966 string cfg_path = "";
11967 string soundset = "";
11968 string type_name =
GetType();
11969
11972 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11973 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11974
11975 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11976 {
11977 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11978 {
11979 if (cfg_slot_array[i] == slot_type)
11980 {
11981 soundset = cfg_soundset_array[i];
11982 break;
11983 }
11984 }
11985 }
11986
11987 if (soundset != "")
11988 {
11989 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11991 }
11992 }
11993 }
11994 }
11995
11997 {
11998
11999 }
12000
12001 void OnApply(PlayerBase player);
12002
12004 {
12005 return 1.0;
12006 };
12007
12009 {
12011 }
12012
12014 {
12016 }
12017
12019
12021 {
12022 SetDynamicPhysicsLifeTime(0.01);
12024 }
12025
12027 {
12028 array<string> zone_names = new array<string>;
12029 GetDamageZones(zone_names);
12030 for (int i = 0; i < zone_names.Count(); i++)
12031 {
12032 SetHealthMax(zone_names.Get(i),"Health");
12033 }
12034 SetHealthMax("","Health");
12035 }
12036
12039 {
12040 float global_health = GetHealth01("","Health");
12041 array<string> zones = new array<string>;
12042 GetDamageZones(zones);
12043
12044 for (int i = 0; i < zones.Count(); i++)
12045 {
12046 SetHealth01(zones.Get(i),"Health",global_health);
12047 }
12048 }
12049
12052 {
12053 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12054 }
12055
12057 {
12058 if (!hasRootAsPlayer)
12059 {
12060 if (refParentIB)
12061 {
12062
12063 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12064 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12065
12066 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12067 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12068
12071 }
12072 else
12073 {
12074
12077 }
12078 }
12079 }
12080
12082 {
12084 {
12085 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12086 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12087 {
12088 float heatPermCoef = 1.0;
12090 while (ent)
12091 {
12092 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12093 ent = ent.GetHierarchyParent();
12094 }
12095
12096 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12097 }
12098 }
12099 }
12100
12102 {
12103
12104 EntityAI parent = GetHierarchyParent();
12105 if (!parent)
12106 {
12107 hasParent = false;
12108 hasRootAsPlayer = false;
12109 }
12110 else
12111 {
12112 hasParent = true;
12113 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12114 refParentIB =
ItemBase.Cast(parent);
12115 }
12116 }
12117
12118 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12119 {
12120
12121 }
12122
12124 {
12125
12126 return false;
12127 }
12128
12130 {
12131
12132
12133 return false;
12134 }
12135
12137 {
12138
12139 return false;
12140 }
12141
12144 {
12145 return !GetIsFrozen() &&
IsOpen();
12146 }
12147
12149 {
12150 bool hasParent = false, hasRootAsPlayer = false;
12152
12153 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12154 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12155
12156 if (wwtu || foodDecay)
12157 {
12161
12162 if (processWetness || processTemperature || processDecay)
12163 {
12165
12166 if (processWetness)
12167 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12168
12169 if (processTemperature)
12171
12172 if (processDecay)
12173 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12174 }
12175 }
12176 }
12177
12180 {
12182 }
12183
12185 {
12188
12189 return super.GetTemperatureFreezeThreshold();
12190 }
12191
12193 {
12196
12197 return super.GetTemperatureThawThreshold();
12198 }
12199
12201 {
12204
12205 return super.GetItemOverheatThreshold();
12206 }
12207
12209 {
12211 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12212
12213 return super.GetTemperatureFreezeTime();
12214 }
12215
12217 {
12219 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12220
12221 return super.GetTemperatureThawTime();
12222 }
12223
12228
12230 {
12231 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12232 }
12233
12235 {
12236 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12237 }
12238
12241 {
12243 }
12244
12246 {
12248 }
12249
12251 {
12253 }
12254
12257 {
12258 return null;
12259 }
12260
12263 {
12264 return false;
12265 }
12266
12268 {
12270 {
12273 if (!trg)
12274 {
12276 explosive = this;
12277 }
12278
12279 explosive.PairRemote(trg);
12281
12282 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12283 trg.SetPersistentPairID(persistentID);
12284 explosive.SetPersistentPairID(persistentID);
12285
12286 return true;
12287 }
12288 return false;
12289 }
12290
12293 {
12294 float ret = 1.0;
12297 ret *= GetHealth01();
12298
12299 return ret;
12300 }
12301
12302 #ifdef DEVELOPER
12303 override void SetDebugItem()
12304 {
12305 super.SetDebugItem();
12306 _itemBase = this;
12307 }
12308
12310 {
12311 string text = super.GetDebugText();
12312
12314 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12315
12316 return text;
12317 }
12318 #endif
12319
12321 {
12322 return true;
12323 }
12324
12326
12328
12330 {
12333 }
12334
12335
12343
12359}
12360
12362{
12364 if (entity)
12365 {
12366 bool is_item = entity.IsInherited(
ItemBase);
12367 if (is_item && full_quantity)
12368 {
12371 }
12372 }
12373 else
12374 {
12376 return NULL;
12377 }
12378 return entity;
12379}
12380
12382{
12383 if (item)
12384 {
12385 if (health > 0)
12386 item.SetHealth("", "", health);
12387
12388 if (item.CanHaveTemperature())
12389 {
12391 if (item.CanFreeze())
12392 item.SetFrozen(false);
12393 }
12394
12395 if (item.HasEnergyManager())
12396 {
12397 if (quantity >= 0)
12398 {
12399 item.GetCompEM().SetEnergy0To1(quantity);
12400 }
12401 else
12402 {
12404 }
12405 }
12406 else if (item.IsMagazine())
12407 {
12408 Magazine mag = Magazine.Cast(item);
12409 if (quantity >= 0)
12410 {
12411 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12412 }
12413 else
12414 {
12416 }
12417
12418 }
12419 else
12420 {
12421 if (quantity >= 0)
12422 {
12423 item.SetQuantityNormalized(quantity, false);
12424 }
12425 else
12426 {
12428 }
12429
12430 }
12431 }
12432}
12433
12434#ifdef DEVELOPER
12436#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.