7487{
7489 {
7490 return true;
7491 }
7492};
7493
7494
7495
7497{
7501
7503
7506
7507
7508
7509
7510
7519
7525
7530
7535
7556 protected bool m_IsResultOfSplit
7557
7559
7564
7565
7566
7568
7572
7573
7574
7576
7579
7580
7581
7587
7588
7596
7599
7600
7602
7603
7605
7606
7611
7612
7617
7618
7620
7621
7623 {
7628
7629 if (!
GetGame().IsDedicatedServer())
7630 {
7632 {
7634
7636 {
7638 }
7639 }
7640
7643 }
7644
7645 m_OldLocation = null;
7646
7648 {
7650 }
7651
7652 if (ConfigIsExisting("headSelectionsToHide"))
7653 {
7656 }
7657
7659 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7660 {
7662 }
7663
7665
7666 m_IsResultOfSplit = false;
7667
7669 }
7670
7672 {
7673 super.InitItemVariables();
7674
7680 m_Count = ConfigGetInt(
"count");
7681
7684
7689
7692
7697
7709
7713
7714
7717 if (ConfigIsExisting("canBeSplit"))
7718 {
7721 }
7722
7724 if (ConfigIsExisting("itemBehaviour"))
7726
7727
7730 RegisterNetSyncVariableInt("m_VarLiquidType");
7731 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7732
7733 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7734 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7735 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7736
7737 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7738 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7739 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7740 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7741
7742 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7743 RegisterNetSyncVariableBool("m_IsTakeable");
7744 RegisterNetSyncVariableBool("m_IsHologram");
7745
7748 {
7751 }
7752
7754
7756 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7758
7759 }
7760
7762 {
7764 }
7765
7767 {
7770 {
7775 }
7776 }
7777
7778 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7779 {
7781 {
7784 }
7785
7787 }
7788
7790 {
7796 }
7797
7799
7801 {
7803
7804 if (!action)
7805 {
7806 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7807 return;
7808 }
7809
7811 if (!ai)
7812 {
7814 return;
7815 }
7816
7818 if (!action_array)
7819 {
7820 action_array = new array<ActionBase_Basic>;
7822 }
7823 if (LogManager.IsActionLogEnable())
7824 {
7825 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7826 }
7827
7828 if (action_array.Find(action) != -1)
7829 {
7830 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7831 }
7832 else
7833 {
7834 action_array.Insert(action);
7835 }
7836 }
7837
7839 {
7841 ActionBase action = player.GetActionManager().GetAction(actionName);
7844
7845 if (action_array)
7846 {
7847 action_array.RemoveItem(action);
7848 }
7849 }
7850
7851
7852
7854 {
7855 ActionOverrideData overrideData = new ActionOverrideData();
7859
7861 if (!actionMap)
7862 {
7865 }
7866
7867 actionMap.Insert(this.
Type(), overrideData);
7868
7869 }
7870
7872
7874
7875
7877 {
7880
7883
7884 string config_to_search = "CfgVehicles";
7885 string muzzle_owner_config;
7886
7888 {
7889 if (IsInherited(Weapon))
7890 config_to_search = "CfgWeapons";
7891
7892 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7893
7894 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7895
7897
7898 if (config_OnFire_subclass_count > 0)
7899 {
7900 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7901
7902 for (int i = 0; i < config_OnFire_subclass_count; i++)
7903 {
7904 string particle_class = "";
7906 string config_OnFire_entry = config_OnFire_class + particle_class;
7907 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7908 WPOF_array.Insert(WPOF);
7909 }
7910
7911
7913 }
7914 }
7915
7917 {
7918 config_to_search = "CfgWeapons";
7919 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7920
7921 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7922
7924
7925 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7926 {
7927 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7928
7929 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7930 {
7931 string particle_class2 = "";
7933 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7934 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7935 WPOBE_array.Insert(WPOBE);
7936 }
7937
7938
7940 }
7941 }
7942 }
7943
7944
7946 {
7949
7951 {
7952 string config_to_search = "CfgVehicles";
7953
7954 if (IsInherited(Weapon))
7955 config_to_search = "CfgWeapons";
7956
7957 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7958 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7959
7960 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7961 {
7962
7964
7966 {
7968 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7970 return;
7971 }
7972
7975
7976
7977
7979 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7980
7981 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7982 {
7983 string particle_class = "";
7985 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7987
7988 if (entry_type == CT_CLASS)
7989 {
7990 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7991 WPOOH_array.Insert(WPOF);
7992 }
7993 }
7994
7995
7997 }
7998 }
7999 }
8000
8002 {
8004 }
8005
8007 {
8009 {
8011
8014
8017
8018 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8019 }
8020 }
8021
8023 {
8025 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8026
8028 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8029
8031 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8032
8034 {
8036 }
8037 }
8038
8040 {
8042 }
8043
8045 {
8048 else
8050
8052 {
8055 }
8056 else
8057 {
8060
8063 }
8064
8066 }
8067
8069 {
8071 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8072 }
8073
8075 {
8077 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8079 }
8080
8082 {
8084 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8085 }
8086
8088 {
8091
8092 OverheatingParticle OP = new OverheatingParticle();
8097
8099 }
8100
8102 {
8105
8106 return -1;
8107 }
8108
8110 {
8112 {
8115
8116 for (int i = count; i > 0; --i)
8117 {
8118 int id = i - 1;
8121
8124
8125 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8126 {
8127 if (p)
8128 {
8131 }
8132 }
8133 }
8134 }
8135 }
8136
8138 {
8140 {
8142 {
8143 int id = i - 1;
8145
8146 if (OP)
8147 {
8149
8150 if (p)
8151 {
8153 }
8154
8155 delete OP;
8156 }
8157 }
8158
8161 }
8162 }
8163
8166 {
8167 return 0.0;
8168 }
8169
8170
8172 {
8173 return 250;
8174 }
8175
8177 {
8178 return 0;
8179 }
8180
8183 {
8185 return true;
8186
8187 return false;
8188 }
8189
8192 {
8195
8197 {
8199 }
8200 else
8201 {
8202
8204 }
8205
8207 }
8208
8215 {
8216 return -1;
8217 }
8218
8219
8220
8221
8223 {
8225 {
8227 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8228
8229 if (r_index >= 0)
8230 {
8231 InventoryLocation r_il = new InventoryLocation;
8232 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8233
8234 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8237 {
8238 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8239 }
8241 {
8242 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8243 }
8244
8245 }
8246
8247 player.GetHumanInventory().ClearUserReservedLocation(this);
8248 }
8249
8252 }
8253
8254
8255
8256
8258 {
8259 return ItemBase.m_DebugActionsMask;
8260 }
8261
8263 {
8264 return ItemBase.m_DebugActionsMask & mask;
8265 }
8266
8268 {
8269 ItemBase.m_DebugActionsMask = mask;
8270 }
8271
8273 {
8274 ItemBase.m_DebugActionsMask |= mask;
8275 }
8276
8278 {
8279 ItemBase.m_DebugActionsMask &= ~mask;
8280 }
8281
8283 {
8285 {
8287 }
8288 else
8289 {
8291 }
8292 }
8293
8294
8296 {
8297 if (GetEconomyProfile())
8298 {
8299 float q_max = GetEconomyProfile().GetQuantityMax();
8300 if (q_max > 0)
8301 {
8302 float q_min = GetEconomyProfile().GetQuantityMin();
8303 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8304
8306 {
8307 ComponentEnergyManager comp = GetCompEM();
8309 {
8311 }
8312 }
8314 {
8316
8317 }
8318
8319 }
8320 }
8321 }
8322
8325 {
8326 EntityAI parent = GetHierarchyParent();
8327
8328 if (parent)
8329 {
8330 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8331 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8332 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8333 }
8334 }
8335
8338 {
8339 EntityAI parent = GetHierarchyParent();
8340
8341 if (parent)
8342 {
8343 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8344 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8345 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8346 }
8347 }
8348
8350 {
8351
8352
8353
8354
8356
8358 {
8359 if (ScriptInputUserData.CanStoreInputUserData())
8360 {
8361 ScriptInputUserData ctx = new ScriptInputUserData;
8367 ctx.
Write(use_stack_max);
8370
8372 {
8373 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8374 }
8375 }
8376 }
8377 else if (!
GetGame().IsMultiplayer())
8378 {
8380 }
8381 }
8382
8384 {
8386 }
8387
8389 {
8391 }
8392
8394 {
8396 }
8397
8399 {
8400
8401 return false;
8402 }
8403
8405 {
8406 return false;
8407 }
8408
8412 {
8413 return false;
8414 }
8415
8417 {
8418 return "";
8419 }
8420
8422
8424 {
8425 return false;
8426 }
8427
8429 {
8430 return true;
8431 }
8432
8433
8434
8436 {
8437 return true;
8438 }
8439
8441 {
8442 return true;
8443 }
8444
8446 {
8447 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8449 }
8450
8452 {
8454 }
8455
8457 {
8459 if (!is_being_placed)
8461 SetSynchDirty();
8462 }
8463
8464
8466
8468 {
8470 }
8471
8473 {
8475 }
8476
8478 {
8479 return 1;
8480 }
8481
8483 {
8484 return false;
8485 }
8486
8488 {
8490 SetSynchDirty();
8491 }
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8528 {
8529 super.OnMovedInsideCargo(container);
8530
8531 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8532 }
8533
8534 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8535 {
8536 super.EEItemLocationChanged(oldLoc,newLoc);
8537
8538 PlayerBase new_player = null;
8539 PlayerBase old_player = null;
8540
8541 if (newLoc.GetParent())
8542 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8543
8544 if (oldLoc.GetParent())
8545 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8546
8548 {
8549 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8550
8551 if (r_index >= 0)
8552 {
8553 InventoryLocation r_il = new InventoryLocation;
8554 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8555
8556 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8559 {
8560 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8561 }
8563 {
8564 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8565 }
8566
8567 }
8568 }
8569
8571 {
8572 if (new_player)
8573 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8574
8575 if (new_player == old_player)
8576 {
8577
8578 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8579 {
8581 {
8582 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8583 {
8584 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8585 }
8586 }
8587 else
8588 {
8589 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8590 }
8591 }
8592
8593 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8594 {
8595 int type = oldLoc.GetType();
8597 {
8598 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8599 }
8601 {
8602 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8603 }
8604 }
8605 if (!m_OldLocation)
8606 {
8607 m_OldLocation = new InventoryLocation;
8608 }
8609 m_OldLocation.Copy(oldLoc);
8610 }
8611 else
8612 {
8613 if (m_OldLocation)
8614 {
8615 m_OldLocation.Reset();
8616 }
8617 }
8618
8620 }
8621 else
8622 {
8623 if (new_player)
8624 {
8625 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8626 if (res_index >= 0)
8627 {
8628 InventoryLocation il = new InventoryLocation;
8629 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8631 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8634 {
8635 il.
GetParent().GetOnReleaseLock().Invoke(it);
8636 }
8638 {
8640 }
8641
8642 }
8643 }
8645 {
8646
8648 }
8649
8650 if (m_OldLocation)
8651 {
8652 m_OldLocation.Reset();
8653 }
8654 }
8655 }
8656
8657 override void EOnContact(IEntity other, Contact extra)
8658 {
8660 {
8661 int liquidType = -1;
8663 if (impactSpeed > 0.0)
8664 {
8666 #ifndef SERVER
8668 #else
8670 SetSynchDirty();
8671 #endif
8673 }
8674 }
8675
8676 #ifdef SERVER
8677 if (GetCompEM() && GetCompEM().IsPlugged())
8678 {
8679 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8680 GetCompEM().UnplugThis();
8681 }
8682 #endif
8683 }
8684
8686
8688 {
8690 }
8691
8693 {
8694
8695 }
8696
8698 {
8699 super.OnItemLocationChanged(old_owner, new_owner);
8700
8701 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8702 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8703
8704 if (!relatedPlayer && playerNew)
8705 relatedPlayer = playerNew;
8706
8707 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8708 {
8710 if (actionMgr)
8711 {
8712 ActionBase currentAction = actionMgr.GetRunningAction();
8713 if (currentAction)
8715 }
8716 }
8717
8718 Man ownerPlayerOld = null;
8719 Man ownerPlayerNew = null;
8720
8721 if (old_owner)
8722 {
8723 if (old_owner.
IsMan())
8724 {
8725 ownerPlayerOld = Man.Cast(old_owner);
8726 }
8727 else
8728 {
8729 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8730 }
8731 }
8732 else
8733 {
8735 {
8737
8738 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8739 {
8740 GetCompEM().UnplugThis();
8741 }
8742 }
8743 }
8744
8745 if (new_owner)
8746 {
8747 if (new_owner.
IsMan())
8748 {
8749 ownerPlayerNew = Man.Cast(new_owner);
8750 }
8751 else
8752 {
8753 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8754 }
8755 }
8756
8757 if (ownerPlayerOld != ownerPlayerNew)
8758 {
8759 if (ownerPlayerOld)
8760 {
8761 array<EntityAI> subItemsExit = new array<EntityAI>;
8763 for (int i = 0; i < subItemsExit.Count(); i++)
8764 {
8767 }
8768 }
8769
8770 if (ownerPlayerNew)
8771 {
8772 array<EntityAI> subItemsEnter = new array<EntityAI>;
8774 for (int j = 0; j < subItemsEnter.Count(); j++)
8775 {
8778 }
8779 }
8780 }
8781 else if (ownerPlayerNew != null)
8782 {
8783 PlayerBase nplayer;
8784 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8785 {
8786 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8788 for (int k = 0; k < subItemsUpdate.Count(); k++)
8789 {
8791 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8792 }
8793 }
8794 }
8795
8796 if (old_owner)
8797 old_owner.OnChildItemRemoved(this);
8798 if (new_owner)
8799 new_owner.OnChildItemReceived(this);
8800 }
8801
8802
8804 {
8805 super.EEDelete(parent);
8806 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8807 if (player)
8808 {
8810
8811 if (player.IsAlive())
8812 {
8813 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8814 if (r_index >= 0)
8815 {
8816 InventoryLocation r_il = new InventoryLocation;
8817 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8818
8819 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8822 {
8823 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8824 }
8826 {
8827 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8828 }
8829
8830 }
8831
8832 player.RemoveQuickBarEntityShortcut(this);
8833 }
8834 }
8835 }
8836
8838 {
8839 super.EEKilled(killer);
8840
8843 {
8844 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8845 {
8846 if (IsMagazine())
8847 {
8848 if (Magazine.Cast(this).GetAmmoCount() > 0)
8849 {
8851 }
8852 }
8853 else
8854 {
8856 }
8857 }
8858 }
8859 }
8860
8862 {
8863 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8864
8865 super.OnWasAttached(parent, slot_id);
8866
8869
8871 }
8872
8874 {
8875 super.OnWasDetached(parent, slot_id);
8876
8879 }
8880
8882 {
8883 int idx;
8886
8887 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8888 if (inventory_slots.Count() < 1)
8889 {
8890 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8891 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8892 }
8893 else
8894 {
8895 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8896 }
8897
8898 idx = inventory_slots.Find(slot);
8899 if (idx < 0)
8900 return "";
8901
8902 return attach_types.Get(idx);
8903 }
8904
8906 {
8907 int idx = -1;
8908 string slot;
8909
8912
8913 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8914 if (inventory_slots.Count() < 1)
8915 {
8916 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8917 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8918 }
8919 else
8920 {
8921 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8922 if (detach_types.Count() < 1)
8923 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8924 }
8925
8926 for (int i = 0; i < inventory_slots.Count(); i++)
8927 {
8928 slot = inventory_slots.Get(i);
8929 }
8930
8931 if (slot != "")
8932 {
8933 if (detach_types.Count() == 1)
8934 idx = 0;
8935 else
8936 idx = inventory_slots.Find(slot);
8937 }
8938 if (idx < 0)
8939 return "";
8940
8941 return detach_types.Get(idx);
8942 }
8943
8945 {
8946
8948
8949
8950 float min_time = 1;
8951 float max_time = 3;
8952 float delay = Math.RandomFloat(min_time, max_time);
8953
8954 explode_timer.Run(delay, this, "DoAmmoExplosion");
8955 }
8956
8958 {
8959 Magazine magazine = Magazine.Cast(this);
8960 int pop_sounds_count = 6;
8961 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8962
8963
8964 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8965 string sound_name = pop_sounds[ sound_idx ];
8967
8968
8969 magazine.ServerAddAmmoCount(-1);
8970
8971
8972 float min_temp_to_explode = 100;
8973
8974 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8975 {
8977 }
8978 }
8979
8980
8981 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8982 {
8983 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8984
8985 const int CHANCE_DAMAGE_CARGO = 4;
8986 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8987 const int CHANCE_DAMAGE_NOTHING = 2;
8988
8990 {
8991 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8992 int chances;
8993 int rnd;
8994
8995 if (GetInventory().GetCargo())
8996 {
8997 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8998 rnd = Math.RandomInt(0,chances);
8999
9000 if (rnd < CHANCE_DAMAGE_CARGO)
9001 {
9003 }
9004 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9005 {
9007 }
9008 }
9009 else
9010 {
9011 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9012 rnd = Math.RandomInt(0,chances);
9013
9014 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9015 {
9017 }
9018 }
9019 }
9020 }
9021
9023 {
9024 if (GetInventory().GetCargo())
9025 {
9026 int item_count = GetInventory().GetCargo().GetItemCount();
9027 if (item_count > 0)
9028 {
9029 int random_pick = Math.RandomInt(0, item_count);
9031 if (!item.IsExplosive())
9032 {
9033 item.AddHealth("","",damage);
9034 return true;
9035 }
9036 }
9037 }
9038 return false;
9039 }
9040
9042 {
9043 int attachment_count = GetInventory().AttachmentCount();
9044 if (attachment_count > 0)
9045 {
9046 int random_pick = Math.RandomInt(0, attachment_count);
9047 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9048 if (!attachment.IsExplosive())
9049 {
9050 attachment.AddHealth("","",damage);
9051 return true;
9052 }
9053 }
9054 return false;
9055 }
9056
9058 {
9060 }
9061
9063 {
9065 return GetInventory().CanRemoveEntity();
9066
9067 return false;
9068 }
9069
9071 {
9072
9074 return false;
9075
9076
9078 return false;
9079
9080
9081
9083 if (delta == 0)
9084 return false;
9085
9086
9087 return true;
9088 }
9089
9091 {
9093 {
9094 if (ScriptInputUserData.CanStoreInputUserData())
9095 {
9096 ScriptInputUserData ctx = new ScriptInputUserData;
9101 ctx.
Write(destination_entity);
9105 }
9106 }
9107 else if (!
GetGame().IsMultiplayer())
9108 {
9110 }
9111 }
9112
9114 {
9115 float split_quantity_new;
9119 InventoryLocation loc = new InventoryLocation;
9120
9121 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9122 {
9124 split_quantity_new = stack_max;
9125 else
9127
9129 {
9130 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9131 if (new_item)
9132 {
9133 new_item.SetResultOfSplit(true);
9134 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9136 new_item.
SetQuantity(split_quantity_new,
false,
true);
9137 }
9138 }
9139 }
9140 else if (destination_entity && slot_id == -1)
9141 {
9142 if (quantity > stack_max)
9143 split_quantity_new = stack_max;
9144 else
9145 split_quantity_new = quantity;
9146
9148 {
9150 {
9153 }
9154
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
9165 {
9166 if (stack_max != 0)
9167 {
9169 {
9171 }
9172
9173 if (split_quantity_new == 0)
9174 {
9175 if (!
GetGame().IsMultiplayer())
9176 player.PhysicalPredictiveDropItem(this);
9177 else
9178 player.ServerDropEntity(this);
9179 return;
9180 }
9181
9183 {
9185
9186 if (new_item)
9187 {
9188 new_item.SetResultOfSplit(true);
9189 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9192 new_item.PlaceOnSurface();
9193 }
9194 }
9195 }
9196 }
9197 }
9198
9200 {
9201 float split_quantity_new;
9205 InventoryLocation loc = new InventoryLocation;
9206
9207 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9208 {
9210 split_quantity_new = stack_max;
9211 else
9213
9215 {
9216 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9217 if (new_item)
9218 {
9219 new_item.SetResultOfSplit(true);
9220 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9222 new_item.
SetQuantity(split_quantity_new,
false,
true);
9223 }
9224 }
9225 }
9226 else if (destination_entity && slot_id == -1)
9227 {
9228 if (quantity > stack_max)
9229 split_quantity_new = stack_max;
9230 else
9231 split_quantity_new = quantity;
9232
9234 {
9236 {
9239 }
9240
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
9251 {
9252 if (stack_max != 0)
9253 {
9255 {
9257 }
9258
9260 {
9262
9263 if (new_item)
9264 {
9265 new_item.SetResultOfSplit(true);
9266 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9269 new_item.PlaceOnSurface();
9270 }
9271 }
9272 }
9273 }
9274 }
9275
9277 {
9279 {
9280 if (ScriptInputUserData.CanStoreInputUserData())
9281 {
9282 ScriptInputUserData ctx = new ScriptInputUserData;
9287 dst.WriteToContext(ctx);
9289 }
9290 }
9291 else if (!
GetGame().IsMultiplayer())
9292 {
9294 }
9295 }
9296
9298 {
9300 {
9301 if (ScriptInputUserData.CanStoreInputUserData())
9302 {
9303 ScriptInputUserData ctx = new ScriptInputUserData;
9308 ctx.
Write(destination_entity);
9314 }
9315 }
9316 else if (!
GetGame().IsMultiplayer())
9317 {
9319 }
9320 }
9321
9323 {
9325 }
9326
9328 {
9330 float split_quantity_new;
9332 if (dst.IsValid())
9333 {
9334 int slot_id = dst.GetSlot();
9336
9337 if (quantity > stack_max)
9338 split_quantity_new = stack_max;
9339 else
9340 split_quantity_new = quantity;
9341
9343 {
9345
9346 if (new_item)
9347 {
9348 new_item.SetResultOfSplit(true);
9349 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9351 new_item.
SetQuantity(split_quantity_new,
false,
true);
9352 }
9353
9354 return new_item;
9355 }
9356 }
9357
9358 return null;
9359 }
9360
9362 {
9364 float split_quantity_new;
9366 if (destination_entity)
9367 {
9369 if (quantity > stackable)
9370 split_quantity_new = stackable;
9371 else
9372 split_quantity_new = quantity;
9373
9375 {
9376 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9377 if (new_item)
9378 {
9379 new_item.SetResultOfSplit(true);
9380 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9382 new_item.
SetQuantity(split_quantity_new,
false,
true);
9383 }
9384 }
9385 }
9386 }
9387
9389 {
9391 {
9392 if (ScriptInputUserData.CanStoreInputUserData())
9393 {
9394 ScriptInputUserData ctx = new ScriptInputUserData;
9399 ItemBase destination_entity =
this;
9400 ctx.
Write(destination_entity);
9404 }
9405 }
9406 else if (!
GetGame().IsMultiplayer())
9407 {
9409 }
9410 }
9411
9413 {
9415 float split_quantity_new;
9417 if (player)
9418 {
9420 if (quantity > stackable)
9421 split_quantity_new = stackable;
9422 else
9423 split_quantity_new = quantity;
9424
9426 {
9427 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9428 new_item =
ItemBase.Cast(in_hands);
9429 if (new_item)
9430 {
9431 new_item.SetResultOfSplit(true);
9432 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9434 new_item.SetQuantity(split_quantity_new, false, true);
9435 }
9436 }
9437 }
9438 }
9439
9441 {
9443 float split_quantity_new = Math.Floor(quantity * 0.5);
9444
9446 return;
9447
9449
9450 if (new_item)
9451 {
9452 if (new_item.GetQuantityMax() < split_quantity_new)
9453 {
9454 split_quantity_new = new_item.GetQuantityMax();
9455 }
9456
9457 new_item.SetResultOfSplit(true);
9458 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9459
9461 {
9464 }
9465 else
9466 {
9468 new_item.
SetQuantity(split_quantity_new,
false,
true);
9469 }
9470 }
9471 }
9472
9474 {
9476 float split_quantity_new = Math.Floor(quantity / 2);
9477
9479 return;
9480
9481 InventoryLocation invloc = new InventoryLocation;
9483
9485 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9486
9487 if (new_item)
9488 {
9489 if (new_item.GetQuantityMax() < split_quantity_new)
9490 {
9491 split_quantity_new = new_item.GetQuantityMax();
9492 }
9494 {
9497 }
9498 else if (split_quantity_new > 1)
9499 {
9501 new_item.
SetQuantity(split_quantity_new,
false,
true);
9502 }
9503 }
9504 }
9505
9508 {
9509 SetWeightDirty();
9511
9512 if (parent)
9513 parent.OnAttachmentQuantityChangedEx(this, delta);
9514
9516 {
9518 {
9520 }
9522 {
9523 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9525 }
9526 }
9527
9528 }
9529
9532 {
9533
9534 }
9535
9538 {
9540 }
9541
9543 {
9544 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9545
9547 {
9548 if (newLevel == GameConstants.STATE_RUINED)
9549 {
9551 EntityAI parent = GetHierarchyParent();
9552 if (parent && parent.IsFireplace())
9553 {
9554 CargoBase cargo = GetInventory().GetCargo();
9555 if (cargo)
9556 {
9558 {
9560 }
9561 }
9562 }
9563 }
9564
9566 {
9567
9569 return;
9570 }
9571
9572 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9573 {
9575 }
9576 }
9577 }
9578
9579
9581 {
9582 super.OnRightClick();
9583
9585 {
9587 {
9588 if (ScriptInputUserData.CanStoreInputUserData())
9589 {
9590 EntityAI root = GetHierarchyRoot();
9591 Man playerOwner = GetHierarchyRootPlayer();
9592 InventoryLocation dst = new InventoryLocation;
9593
9594
9595 if (!playerOwner && root && root == this)
9596 {
9598 }
9599 else
9600 {
9601
9602 GetInventory().GetCurrentInventoryLocation(dst);
9604 {
9607 {
9609 }
9610 else
9611 {
9613
9614
9615 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9616 {
9618 }
9619 else
9620 {
9621 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9622 }
9623 }
9624 }
9625 }
9626
9627 ScriptInputUserData ctx = new ScriptInputUserData;
9635 }
9636 }
9637 else if (!
GetGame().IsMultiplayer())
9638 {
9640 }
9641 }
9642 }
9643
9645 {
9646 if (root)
9647 {
9648 vector m4[4];
9649 root.GetTransform(m4);
9650 dst.SetGround(this, m4);
9651 }
9652 else
9653 {
9654 GetInventory().GetCurrentInventoryLocation(dst);
9655 }
9656 }
9657
9658 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9659 {
9660
9661 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9662 return false;
9663
9664 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9665 return false;
9666
9667
9669 return false;
9670
9671
9672 Magazine mag = Magazine.Cast(this);
9673 if (mag)
9674 {
9675 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9676 return false;
9677
9678 if (stack_max_limit)
9679 {
9680 Magazine other_mag = Magazine.Cast(other_item);
9681 if (other_item)
9682 {
9683 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9684 return false;
9685 }
9686
9687 }
9688 }
9689 else
9690 {
9691
9693 return false;
9694
9696 return false;
9697 }
9698
9699 PlayerBase player = null;
9700 if (CastTo(player, GetHierarchyRootPlayer()))
9701 {
9702 if (player.GetInventory().HasAttachment(this))
9703 return false;
9704
9705 if (player.IsItemsToDelete())
9706 return false;
9707 }
9708
9709 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9710 return false;
9711
9712 int slotID;
9714 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9715 return false;
9716
9717 return true;
9718 }
9719
9721 {
9723 }
9724
9726 {
9727 return m_IsResultOfSplit;
9728 }
9729
9731 {
9732 m_IsResultOfSplit = value;
9733 }
9734
9736 {
9738 }
9739
9741 {
9742 float other_item_quantity = other_item.GetQuantity();
9743 float this_free_space;
9744
9746
9748
9749 if (other_item_quantity > this_free_space)
9750 {
9751 return this_free_space;
9752 }
9753 else
9754 {
9755 return other_item_quantity;
9756 }
9757 }
9758
9760 {
9762 }
9763
9765 {
9767 return;
9768
9769 if (!IsMagazine() && other_item)
9770 {
9772 if (quantity_used != 0)
9773 {
9774 float hp1 = GetHealth01("","");
9775 float hp2 = other_item.GetHealth01("","");
9776 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9777 hpResult = hpResult / (
GetQuantity() + quantity_used);
9778
9779 hpResult *= GetMaxHealth();
9780 Math.Round(hpResult);
9781 SetHealth("", "Health", hpResult);
9782
9784 other_item.AddQuantity(-quantity_used);
9785 }
9786 }
9788 }
9789
9791 {
9792 #ifdef SERVER
9793 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9794 GetHierarchyParent().IncreaseLifetimeUp();
9795 #endif
9796 };
9797
9799 {
9800 PlayerBase p = PlayerBase.Cast(player);
9801
9802 array<int> recipesIds = p.m_Recipes;
9803 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9804 if (moduleRecipesManager)
9805 {
9806 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9807 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9808 }
9809
9810 for (int i = 0;i < recipesIds.Count(); i++)
9811 {
9812 int key = recipesIds.Get(i);
9813 string recipeName = moduleRecipesManager.GetRecipeName(key);
9815 }
9816 }
9817
9818
9819 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9820 {
9821 super.GetDebugActions(outputList);
9822
9823
9829
9830
9835
9840
9841
9845
9846
9848 {
9852 }
9853
9856
9857
9861
9863
9864 InventoryLocation loc = new InventoryLocation();
9865 GetInventory().GetCurrentInventoryLocation(loc);
9867 {
9868 if (Gizmo_IsSupported())
9871 }
9872
9874 }
9875
9876
9877
9878
9880 {
9881 super.OnAction(action_id, player, ctx);
9882
9884 {
9885 switch (action_id)
9886 {
9889 return true;
9892 return true;
9893 }
9894 }
9895
9897 {
9898 switch (action_id)
9899 {
9901 Delete();
9902 return true;
9903 }
9904 }
9905
9906 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9907 {
9908 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9909 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9910 PlayerBase p = PlayerBase.Cast(player);
9911 if (
EActions.RECIPES_RANGE_START < 1000)
9912 {
9913 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9914 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9915 }
9916 }
9917 #ifndef SERVER
9918 else if (action_id ==
EActions.WATCH_PLAYER)
9919 {
9920 PluginDeveloper.SetDeveloperItemClientEx(player);
9921 }
9922 #endif
9924 {
9925 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9926 {
9927 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9928 OnDebugButtonPressServer(id + 1);
9929 }
9930
9931 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9932 {
9933 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9935 }
9936
9937 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9938 {
9939 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9941 }
9942
9943 else if (action_id ==
EActions.ADD_QUANTITY)
9944 {
9945 if (IsMagazine())
9946 {
9947 Magazine mag = Magazine.Cast(this);
9948 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9949 }
9950 else
9951 {
9953 }
9954
9955 if (m_EM)
9956 {
9957 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9958 }
9959
9960 }
9961
9962 else if (action_id ==
EActions.REMOVE_QUANTITY)
9963 {
9964 if (IsMagazine())
9965 {
9966 Magazine mag2 = Magazine.Cast(this);
9967 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9968 }
9969 else
9970 {
9972 }
9973 if (m_EM)
9974 {
9975 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9976 }
9977
9978 }
9979
9980 else if (action_id ==
EActions.SET_QUANTITY_0)
9981 {
9983
9984 if (m_EM)
9985 {
9986 m_EM.SetEnergy(0);
9987 }
9988 }
9989
9990 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9991 {
9993
9994 if (m_EM)
9995 {
9996 m_EM.SetEnergy(m_EM.GetEnergyMax());
9997 }
9998 }
9999
10000 else if (action_id ==
EActions.ADD_HEALTH)
10001 {
10002 AddHealth("","",GetMaxHealth("","Health")/5);
10003 }
10004 else if (action_id ==
EActions.REMOVE_HEALTH)
10005 {
10006 AddHealth("","",-GetMaxHealth("","Health")/5);
10007 }
10008 else if (action_id ==
EActions.DESTROY_HEALTH)
10009 {
10010 SetHealth01("","",0);
10011 }
10012 else if (action_id ==
EActions.WATCH_ITEM)
10013 {
10015 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10016 #ifdef DEVELOPER
10017 SetDebugDeveloper_item(this);
10018 #endif
10019 }
10020
10021 else if (action_id ==
EActions.ADD_TEMPERATURE)
10022 {
10023 AddTemperature(20);
10024
10025 }
10026
10027 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10028 {
10029 AddTemperature(-20);
10030
10031 }
10032
10033 else if (action_id ==
EActions.FLIP_FROZEN)
10034 {
10035 SetFrozen(!GetIsFrozen());
10036
10037 }
10038
10039 else if (action_id ==
EActions.ADD_WETNESS)
10040 {
10042
10043 }
10044
10045 else if (action_id ==
EActions.REMOVE_WETNESS)
10046 {
10048
10049 }
10050
10051 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10052 {
10055
10056
10057 }
10058
10059 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10060 {
10063 }
10064
10065 else if (action_id ==
EActions.MAKE_SPECIAL)
10066 {
10067 auto debugParams = DebugSpawnParams.WithPlayer(player);
10068 OnDebugSpawnEx(debugParams);
10069 }
10070
10071 }
10072
10073
10074 return false;
10075 }
10076
10077
10078
10079
10083
10086
10087
10088
10090 {
10091 return false;
10092 }
10093
10094
10096 {
10097 return true;
10098 }
10099
10100
10102 {
10103 return true;
10104 }
10105
10106
10107
10109 {
10110 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10112 }
10113
10116 {
10117 return null;
10118 }
10119
10121 {
10122 return false;
10123 }
10124
10126 {
10127 return false;
10128 }
10129
10133
10134
10136 {
10137 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10138 return module_repairing.CanRepair(this, item_repair_kit);
10139 }
10140
10141
10142 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10143 {
10144 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10145 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10146 }
10147
10148
10150 {
10151
10152
10153
10154
10155
10156
10157
10158
10159 return 1;
10160 }
10161
10162
10163
10165 {
10167 }
10168
10169
10170
10172 {
10174 }
10175
10176
10185 {
10186 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10187
10188 if (player)
10189 {
10190 player.MessageStatus(text);
10191 }
10192 }
10193
10194
10203 {
10204 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10205
10206 if (player)
10207 {
10208 player.MessageAction(text);
10209 }
10210 }
10211
10212
10221 {
10222 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10223
10224 if (player)
10225 {
10226 player.MessageFriendly(text);
10227 }
10228 }
10229
10230
10239 {
10240 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10241
10242 if (player)
10243 {
10244 player.MessageImportant(text);
10245 }
10246 }
10247
10249 {
10250 return true;
10251 }
10252
10253
10254 override bool KindOf(
string tag)
10255 {
10256 bool found = false;
10257 string item_name = this.
GetType();
10260
10261 int array_size = item_tag_array.Count();
10262 for (int i = 0; i < array_size; i++)
10263 {
10264 if (item_tag_array.Get(i) == tag)
10265 {
10266 found = true;
10267 break;
10268 }
10269 }
10270 return found;
10271 }
10272
10273
10275 {
10276
10277 super.OnRPC(sender, rpc_type,ctx);
10278
10279
10280 switch (rpc_type)
10281 {
10282 #ifndef SERVER
10283 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10284 Param2<bool, string> p = new Param2<bool, string>(false, "");
10285
10287 return;
10288
10289 bool play = p.param1;
10290 string soundSet = p.param2;
10291
10292 if (play)
10293 {
10295 {
10297 {
10299 }
10300 }
10301 else
10302 {
10304 }
10305 }
10306 else
10307 {
10309 }
10310
10311 break;
10312 #endif
10313
10314 }
10315
10317 {
10319 }
10320 }
10321
10322
10323
10324
10326 {
10327 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10328 return plugin.GetID(
name);
10329 }
10330
10332 {
10333 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10334 return plugin.GetName(id);
10335 }
10336
10339 {
10340
10341
10342 int varFlags;
10343 if (!ctx.
Read(varFlags))
10344 return;
10345
10346 if (varFlags & ItemVariableFlags.FLOAT)
10347 {
10349 }
10350 }
10351
10353 {
10354
10355 super.SerializeNumericalVars(floats_out);
10356
10357
10358
10360 {
10362 }
10363
10365 {
10367 }
10368
10370 {
10372 }
10373
10375 {
10380 }
10381
10383 {
10385 }
10386 }
10387
10389 {
10390
10391 super.DeSerializeNumericalVars(floats);
10392
10393
10394 int index = 0;
10395 int mask = Math.Round(floats.Get(index));
10396
10397 index++;
10398
10400 {
10402 {
10404 }
10405 else
10406 {
10407 float quantity = floats.Get(index);
10408 SetQuantity(quantity,
true,
false,
false,
false);
10409 }
10410 index++;
10411 }
10412
10414 {
10415 float wet = floats.Get(index);
10417 index++;
10418 }
10419
10421 {
10422 int liquidtype = Math.Round(floats.Get(index));
10424 index++;
10425 }
10426
10428 {
10430 index++;
10432 index++;
10434 index++;
10436 index++;
10437 }
10438
10440 {
10441 int cleanness = Math.Round(floats.Get(index));
10443 index++;
10444 }
10445 }
10446
10448 {
10449 super.WriteVarsToCTX(ctx);
10450
10451
10453 {
10455 }
10456
10458 {
10460 }
10461
10463 {
10465 }
10466
10468 {
10469 int r,g,b,a;
10475 }
10476
10478 {
10480 }
10481 }
10482
10484 {
10485 if (!super.ReadVarsFromCTX(ctx,version))
10486 return false;
10487
10488 int intValue;
10489 float value;
10490
10491 if (version < 140)
10492 {
10493 if (!ctx.
Read(intValue))
10494 return false;
10495
10496 m_VariablesMask = intValue;
10497 }
10498
10500 {
10501 if (!ctx.
Read(value))
10502 return false;
10503
10505 {
10507 }
10508 else
10509 {
10511 }
10512 }
10513
10514 if (version < 140)
10515 {
10517 {
10518 if (!ctx.
Read(value))
10519 return false;
10520 SetTemperatureDirect(value);
10521 }
10522 }
10523
10525 {
10526 if (!ctx.
Read(value))
10527 return false;
10529 }
10530
10532 {
10533 if (!ctx.
Read(intValue))
10534 return false;
10536 }
10537
10539 {
10540 int r,g,b,a;
10542 return false;
10544 return false;
10546 return false;
10548 return false;
10549
10551 }
10552
10554 {
10555 if (!ctx.
Read(intValue))
10556 return false;
10558 }
10559
10560 if (version >= 138 && version < 140)
10561 {
10563 {
10564 if (!ctx.
Read(intValue))
10565 return false;
10566 SetFrozen(intValue);
10567 }
10568 }
10569
10570 return true;
10571 }
10572
10573
10575 {
10578 {
10580 }
10581
10582 if (!super.OnStoreLoad(ctx, version))
10583 {
10585 return false;
10586 }
10587
10588 if (version >= 114)
10589 {
10590 bool hasQuickBarIndexSaved;
10591
10592 if (!ctx.
Read(hasQuickBarIndexSaved))
10593 {
10595 return false;
10596 }
10597
10598 if (hasQuickBarIndexSaved)
10599 {
10600 int itmQBIndex;
10601
10602
10603 if (!ctx.
Read(itmQBIndex))
10604 {
10606 return false;
10607 }
10608
10609 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10610 if (itmQBIndex != -1 && parentPlayer)
10611 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10612 }
10613 }
10614 else
10615 {
10616
10617 PlayerBase player;
10618 int itemQBIndex;
10619 if (version ==
int.
MAX)
10620 {
10621 if (!ctx.
Read(itemQBIndex))
10622 {
10624 return false;
10625 }
10626 }
10627 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10628 {
10629
10630 if (!ctx.
Read(itemQBIndex))
10631 {
10633 return false;
10634 }
10635 if (itemQBIndex != -1 && player)
10636 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10637 }
10638 }
10639
10640 if (version < 140)
10641 {
10642
10643 if (!LoadVariables(ctx, version))
10644 {
10646 return false;
10647 }
10648 }
10649
10650
10652 {
10654 return false;
10655 }
10656 if (version >= 132)
10657 {
10659 if (raib)
10660 {
10662 {
10664 return false;
10665 }
10666 }
10667 }
10668
10670 return true;
10671 }
10672
10673
10674
10676 {
10677 super.OnStoreSave(ctx);
10678
10679 PlayerBase player;
10680 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10681 {
10683
10684 int itemQBIndex = -1;
10685 itemQBIndex = player.FindQuickBarEntityIndex(this);
10686 ctx.
Write(itemQBIndex);
10687 }
10688 else
10689 {
10691 }
10692
10694
10696 if (raib)
10697 {
10699 }
10700 }
10701
10702
10704 {
10705 super.AfterStoreLoad();
10706
10708 {
10710 }
10711
10713 {
10716 }
10717 }
10718
10720 {
10721 super.EEOnAfterLoad();
10722
10724 {
10726 }
10727
10730 }
10731
10733 {
10734 return false;
10735 }
10736
10737
10738
10740 {
10742 {
10743 #ifdef PLATFORM_CONSOLE
10744
10746 {
10748 if (menu)
10749 {
10751 }
10752 }
10753 #endif
10754 }
10755
10757 {
10760 }
10761
10763 {
10764 SetWeightDirty();
10766 }
10768 {
10771 }
10772
10774 {
10777 }
10779 {
10782 }
10783
10784 super.OnVariablesSynchronized();
10785 }
10786
10787
10788
10790 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10791 {
10792 if (!IsServerCheck(allow_client))
10793 return false;
10794
10796 return false;
10797
10800
10801 if (value <= (min + 0.001))
10802 value = min;
10803
10804 if (value == min)
10805 {
10806 if (destroy_config)
10807 {
10808 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10809 if (dstr)
10810 {
10812 this.Delete();
10813 return true;
10814 }
10815 }
10816 else if (destroy_forced)
10817 {
10819 this.Delete();
10820 return true;
10821 }
10822
10824 }
10825
10828
10830 {
10832
10833 if (delta)
10835 }
10836
10838
10839 return false;
10840 }
10841
10842
10844 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10845 {
10847 }
10848
10850 {
10853 }
10854
10856 {
10859 }
10860
10862 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10863 {
10864 float value_clamped = Math.Clamp(value, 0, 1);
10866 SetQuantity(result, destroy_config, destroy_forced);
10867 }
10868
10869
10872 {
10874 }
10875
10877 {
10879 }
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10891 {
10892 int slot = -1;
10893 if (GetInventory())
10894 {
10895 InventoryLocation il = new InventoryLocation;
10896 GetInventory().GetCurrentInventoryLocation(il);
10898 }
10899
10901 }
10902
10904 {
10905 float quantity_max = 0;
10906
10908 {
10909 if (attSlotID != -1)
10910 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10911
10912 if (quantity_max <= 0)
10914 }
10915
10916 if (quantity_max <= 0)
10918
10919 return quantity_max;
10920 }
10921
10923 {
10925 }
10926
10928 {
10930 }
10931
10932
10934 {
10936 }
10937
10939 {
10941 }
10942
10944 {
10946 }
10947
10948
10950 {
10951
10952 float weightEx = GetWeightEx();
10953 float special = GetInventoryAndCargoWeight();
10954 return weightEx - special;
10955 }
10956
10957
10959 {
10961 }
10962
10964 {
10966 {
10967 #ifdef DEVELOPER
10968 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10969 {
10970 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10972 }
10973 #endif
10974
10975 return GetQuantity() * GetConfigWeightModified();
10976 }
10977 else if (HasEnergyManager())
10978 {
10979 #ifdef DEVELOPER
10980 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10981 {
10982 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10983 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10984 }
10985 #endif
10986 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10987 }
10988 else
10989 {
10990 #ifdef DEVELOPER
10991 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10992 {
10993 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10994 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10995 }
10996 #endif
10997 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10998 }
10999 }
11000
11003 {
11004 int item_count = 0;
11006
11007 if (GetInventory().GetCargo() != NULL)
11008 {
11009 item_count = GetInventory().GetCargo().GetItemCount();
11010 }
11011
11012 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11013 {
11014 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11015 if (item)
11016 item_count += item.GetNumberOfItems();
11017 }
11018 return item_count;
11019 }
11020
11023 {
11024 float weight = 0;
11025 float wetness = 1;
11026 if (include_wetness)
11029 {
11030 weight = wetness * m_ConfigWeight;
11031 }
11033 {
11034 weight = 1;
11035 }
11036 return weight;
11037 }
11038
11039
11040
11042 {
11043 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11044 {
11045 GameInventory inv = GetInventory();
11046 array<EntityAI> items = new array<EntityAI>;
11048 for (int i = 0; i < items.Count(); i++)
11049 {
11051 if (item)
11052 {
11054 }
11055 }
11056 }
11057 }
11058
11059
11060
11061
11063 {
11064 float energy = 0;
11065 if (HasEnergyManager())
11066 {
11067 energy = GetCompEM().GetEnergy();
11068 }
11069 return energy;
11070 }
11071
11072
11074 {
11075 super.OnEnergyConsumed();
11076
11078 }
11079
11081 {
11082 super.OnEnergyAdded();
11083
11085 }
11086
11087
11089 {
11090 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11091 {
11093 {
11094 float energy_0to1 = GetCompEM().GetEnergy0To1();
11096 }
11097 }
11098 }
11099
11100
11102 {
11103 return ConfigGetFloat("heatIsolation");
11104 }
11105
11107 {
11109 }
11110
11112 {
11113 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11114 if (
GetGame().ConfigIsExisting(paramPath))
11116
11117 return 0.0;
11118 }
11119
11121 {
11122 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11123 if (
GetGame().ConfigIsExisting(paramPath))
11125
11126 return 0.0;
11127 }
11128
11129 override void SetWet(
float value,
bool allow_client =
false)
11130 {
11131 if (!IsServerCheck(allow_client))
11132 return;
11133
11136
11138
11139 m_VarWet = Math.Clamp(value, min, max);
11140
11142 {
11145 }
11146 }
11147
11148 override void AddWet(
float value)
11149 {
11151 }
11152
11154 {
11156 }
11157
11159 {
11161 }
11162
11164 {
11166 }
11167
11169 {
11171 }
11172
11174 {
11176 }
11177
11178 override void OnWetChanged(
float newVal,
float oldVal)
11179 {
11182 if (newLevel != oldLevel)
11183 {
11185 }
11186 }
11187
11189 {
11190 SetWeightDirty();
11191 }
11192
11194 {
11195 return GetWetLevelInternal(
m_VarWet);
11196 }
11197
11198
11199
11201 {
11203 }
11204
11206 {
11208 }
11209
11211 {
11213 }
11214
11216 {
11218 }
11219
11220
11221
11223 {
11224 if (ConfigIsExisting("itemModelLength"))
11225 {
11226 return ConfigGetFloat("itemModelLength");
11227 }
11228 return 0;
11229 }
11230
11232 {
11233 if (ConfigIsExisting("itemAttachOffset"))
11234 {
11235 return ConfigGetFloat("itemAttachOffset");
11236 }
11237 return 0;
11238 }
11239
11240 override void SetCleanness(
int value,
bool allow_client =
false)
11241 {
11242 if (!IsServerCheck(allow_client))
11243 return;
11244
11246
11248
11251 }
11252
11254 {
11256 }
11257
11259 {
11260 return true;
11261 }
11262
11263
11264
11265
11267 {
11269 }
11270
11272 {
11274 }
11275
11276
11277
11278
11279 override void SetColor(
int r,
int g,
int b,
int a)
11280 {
11286 }
11288 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11289 {
11294 }
11295
11297 {
11299 }
11300
11303 {
11304 int r,g,b,a;
11306 r = r/255;
11307 g = g/255;
11308 b = b/255;
11309 a = a/255;
11310 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11311 }
11312
11313
11314
11315 override void SetLiquidType(
int value,
bool allow_client =
false)
11316 {
11317 if (!IsServerCheck(allow_client))
11318 return;
11319
11324 }
11325
11327 {
11328 return ConfigGetInt("varLiquidTypeInit");
11329 }
11330
11332 {
11334 }
11335
11337 {
11339 SetFrozen(false);
11340 }
11341
11344 {
11345 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11346 }
11347
11348
11351 {
11352 PlayerBase nplayer;
11353 if (PlayerBase.CastTo(nplayer, player))
11354 {
11356
11357 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11358 }
11359 }
11360
11361
11364 {
11365 PlayerBase nplayer;
11366 if (PlayerBase.CastTo(nplayer,player))
11367 {
11368
11369 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11370
11371 }
11372
11373
11374 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11375
11376
11377 if (HasEnergyManager())
11378 {
11379 GetCompEM().UpdatePlugState();
11380 }
11381 }
11382
11383
11385 {
11386 super.OnPlacementStarted(player);
11387
11389 }
11390
11391 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11392 {
11394 {
11395 m_AdminLog.OnPlacementComplete(player,
this);
11396 }
11397
11398 super.OnPlacementComplete(player, position, orientation);
11399 }
11400
11401
11402
11403
11404
11406 {
11408 {
11409 return true;
11410 }
11411 else
11412 {
11413 return false;
11414 }
11415 }
11416
11417
11419 {
11421 {
11423 }
11424 }
11425
11426
11428 {
11430 }
11431
11433 {
11435 }
11436
11437 override void InsertAgent(
int agent,
float count = 1)
11438 {
11439 if (count < 1)
11440 return;
11441
11443 }
11444
11447 {
11449 }
11450
11451
11453 {
11455 }
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11499 {
11501 return false;
11502 return true;
11503 }
11504
11506 {
11507
11509 }
11510
11511
11514 {
11515 super.CheckForRoofLimited(timeTresholdMS);
11516
11518 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11519 {
11520 m_PreviousRoofTestTime = time;
11521 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11522 }
11523 }
11524
11525
11527 {
11529 {
11530 return 0;
11531 }
11532
11533 if (GetInventory().GetAttachmentSlotsCount() != 0)
11534 {
11535 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11536 if (filter)
11537 return filter.GetProtectionLevel(type, false, system);
11538 else
11539 return 0;
11540 }
11541
11542 string subclassPath, entryName;
11543
11544 switch (type)
11545 {
11547 entryName = "biological";
11548 break;
11550 entryName = "chemical";
11551 break;
11552 default:
11553 entryName = "biological";
11554 break;
11555 }
11556
11557 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11558
11560 }
11561
11562
11563
11566 {
11567 if (!IsMagazine())
11569
11571 }
11572
11573
11574
11575
11576
11581 {
11582 return true;
11583 }
11584
11586 {
11588 }
11589
11590
11591
11592
11593
11595 {
11596 if (parent)
11597 {
11598 if (parent.IsInherited(DayZInfected))
11599 return true;
11600
11601 if (!parent.IsRuined())
11602 return true;
11603 }
11604
11605 return true;
11606 }
11607
11609 {
11610 if (!super.CanPutAsAttachment(parent))
11611 {
11612 return false;
11613 }
11614
11615 if (!IsRuined() && !parent.IsRuined())
11616 {
11617 return true;
11618 }
11619
11620 return false;
11621 }
11622
11624 {
11625
11626
11627
11628
11629 return super.CanReceiveItemIntoCargo(item);
11630 }
11631
11633 {
11634
11635
11636
11637
11638 GameInventory attachmentInv = attachment.GetInventory();
11640 {
11641 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11642 return false;
11643 }
11644
11645 InventoryLocation loc = new InventoryLocation();
11646 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11647 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11648 return false;
11649
11650 return super.CanReceiveAttachment(attachment, slotId);
11651 }
11652
11654 {
11655 if (!super.CanReleaseAttachment(attachment))
11656 return false;
11657
11658 return GetInventory().AreChildrenAccessible();
11659 }
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11682 {
11683 int id = muzzle_owner.GetMuzzleID();
11684 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11685
11686 if (WPOF_array)
11687 {
11688 for (int i = 0; i < WPOF_array.Count(); i++)
11689 {
11690 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11691
11692 if (WPOF)
11693 {
11694 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11695 }
11696 }
11697 }
11698 }
11699
11700
11702 {
11703 int id = muzzle_owner.GetMuzzleID();
11705
11706 if (WPOBE_array)
11707 {
11708 for (int i = 0; i < WPOBE_array.Count(); i++)
11709 {
11710 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11711
11712 if (WPOBE)
11713 {
11714 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11715 }
11716 }
11717 }
11718 }
11719
11720
11722 {
11723 int id = muzzle_owner.GetMuzzleID();
11724 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11725
11726 if (WPOOH_array)
11727 {
11728 for (int i = 0; i < WPOOH_array.Count(); i++)
11729 {
11730 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11731
11732 if (WPOOH)
11733 {
11734 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11735 }
11736 }
11737 }
11738 }
11739
11740
11742 {
11743 int id = muzzle_owner.GetMuzzleID();
11744 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11745
11746 if (WPOOH_array)
11747 {
11748 for (int i = 0; i < WPOOH_array.Count(); i++)
11749 {
11750 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11751
11752 if (WPOOH)
11753 {
11754 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11755 }
11756 }
11757 }
11758 }
11759
11760
11762 {
11763 int id = muzzle_owner.GetMuzzleID();
11764 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11765
11766 if (WPOOH_array)
11767 {
11768 for (int i = 0; i < WPOOH_array.Count(); i++)
11769 {
11770 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11771
11772 if (WPOOH)
11773 {
11774 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11775 }
11776 }
11777 }
11778 }
11779
11780
11781
11783 {
11785 {
11786 return true;
11787 }
11788
11789 return false;
11790 }
11791
11793 {
11795 {
11796 return true;
11797 }
11798
11799 return false;
11800 }
11801
11803 {
11805 {
11806 return true;
11807 }
11808
11809 return false;
11810 }
11811
11813 {
11814 return false;
11815 }
11816
11819 {
11820 return UATimeSpent.DEFAULT_DEPLOY;
11821 }
11822
11823
11824
11825
11827 {
11829 SetSynchDirty();
11830 }
11831
11833 {
11835 }
11836
11837
11839 {
11840 return false;
11841 }
11842
11845 {
11846 string att_type = "None";
11847
11848 if (ConfigIsExisting("soundAttType"))
11849 {
11850 att_type = ConfigGetString("soundAttType");
11851 }
11852
11854 }
11855
11857 {
11859 }
11860
11861
11862
11863
11864
11870
11872 {
11875
11877 }
11878
11879
11881 {
11883 return;
11884
11886
11889
11892
11893 SoundParameters params = new SoundParameters();
11897 }
11898
11899
11901 {
11903 return;
11904
11906 SetSynchDirty();
11907
11910 }
11911
11912
11914 {
11916 return;
11917
11919 SetSynchDirty();
11920
11923 }
11924
11926 {
11928 }
11929
11931 {
11933 }
11934
11937 {
11938 if (!
GetGame().IsDedicatedServer())
11939 {
11940 if (ConfigIsExisting("attachSoundSet"))
11941 {
11942 string cfg_path = "";
11943 string soundset = "";
11944 string type_name =
GetType();
11945
11948 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11949 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11950
11951 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11952 {
11953 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11954 {
11955 if (cfg_slot_array[i] == slot_type)
11956 {
11957 soundset = cfg_soundset_array[i];
11958 break;
11959 }
11960 }
11961 }
11962
11963 if (soundset != "")
11964 {
11965 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11967 }
11968 }
11969 }
11970 }
11971
11973 {
11974
11975 }
11976
11977 void OnApply(PlayerBase player);
11978
11980 {
11981 return 1.0;
11982 };
11983
11985 {
11987 }
11988
11990 {
11992 }
11993
11995
11997 {
11998 SetDynamicPhysicsLifeTime(0.01);
12000 }
12001
12003 {
12004 array<string> zone_names = new array<string>;
12005 GetDamageZones(zone_names);
12006 for (int i = 0; i < zone_names.Count(); i++)
12007 {
12008 SetHealthMax(zone_names.Get(i),"Health");
12009 }
12010 SetHealthMax("","Health");
12011 }
12012
12015 {
12016 float global_health = GetHealth01("","Health");
12017 array<string> zones = new array<string>;
12018 GetDamageZones(zones);
12019
12020 for (int i = 0; i < zones.Count(); i++)
12021 {
12022 SetHealth01(zones.Get(i),"Health",global_health);
12023 }
12024 }
12025
12028 {
12029 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12030 }
12031
12033 {
12034 if (!hasRootAsPlayer)
12035 {
12036 if (refParentIB)
12037 {
12038
12039 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12040 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12041
12042 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12043 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12044
12047 }
12048 else
12049 {
12050
12053 }
12054 }
12055 }
12056
12058 {
12060 {
12061 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12062 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12063 {
12064 float heatPermCoef = 1.0;
12066 while (ent)
12067 {
12068 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12069 ent = ent.GetHierarchyParent();
12070 }
12071
12072 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12073 }
12074 }
12075 }
12076
12078 {
12079
12080 EntityAI parent = GetHierarchyParent();
12081 if (!parent)
12082 {
12083 hasParent = false;
12084 hasRootAsPlayer = false;
12085 }
12086 else
12087 {
12088 hasParent = true;
12089 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12090 refParentIB =
ItemBase.Cast(parent);
12091 }
12092 }
12093
12094 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12095 {
12096
12097 }
12098
12100 {
12101
12102 return false;
12103 }
12104
12106 {
12107
12108
12109 return false;
12110 }
12111
12113 {
12114
12115 return false;
12116 }
12117
12120 {
12121 return !GetIsFrozen() &&
IsOpen();
12122 }
12123
12125 {
12126 bool hasParent = false, hasRootAsPlayer = false;
12128
12129 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12130 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12131
12132 if (wwtu || foodDecay)
12133 {
12137
12138 if (processWetness || processTemperature || processDecay)
12139 {
12141
12142 if (processWetness)
12143 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12144
12145 if (processTemperature)
12147
12148 if (processDecay)
12149 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12150 }
12151 }
12152 }
12153
12156 {
12158 }
12159
12161 {
12164
12165 return super.GetTemperatureFreezeThreshold();
12166 }
12167
12169 {
12172
12173 return super.GetTemperatureThawThreshold();
12174 }
12175
12177 {
12180
12181 return super.GetItemOverheatThreshold();
12182 }
12183
12185 {
12187 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12188
12189 return super.GetTemperatureFreezeTime();
12190 }
12191
12193 {
12195 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12196
12197 return super.GetTemperatureThawTime();
12198 }
12199
12204
12206 {
12207 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12208 }
12209
12211 {
12212 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12213 }
12214
12217 {
12219 }
12220
12222 {
12224 }
12225
12227 {
12229 }
12230
12233 {
12234 return null;
12235 }
12236
12239 {
12240 return false;
12241 }
12242
12244 {
12246 {
12249 if (!trg)
12250 {
12252 explosive = this;
12253 }
12254
12255 explosive.PairRemote(trg);
12257
12258 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12259 trg.SetPersistentPairID(persistentID);
12260 explosive.SetPersistentPairID(persistentID);
12261
12262 return true;
12263 }
12264 return false;
12265 }
12266
12269 {
12270 float ret = 1.0;
12273 ret *= GetHealth01();
12274
12275 return ret;
12276 }
12277
12278 #ifdef DEVELOPER
12279 override void SetDebugItem()
12280 {
12281 super.SetDebugItem();
12282 _itemBase = this;
12283 }
12284
12286 {
12287 string text = super.GetDebugText();
12288
12290 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12291
12292 return text;
12293 }
12294 #endif
12295
12297 {
12298 return true;
12299 }
12300
12302
12304
12306 {
12309 }
12310
12311
12319
12335}
12336
12338{
12340 if (entity)
12341 {
12342 bool is_item = entity.IsInherited(
ItemBase);
12343 if (is_item && full_quantity)
12344 {
12347 }
12348 }
12349 else
12350 {
12352 return NULL;
12353 }
12354 return entity;
12355}
12356
12358{
12359 if (item)
12360 {
12361 if (health > 0)
12362 item.SetHealth("", "", health);
12363
12364 if (item.CanHaveTemperature())
12365 {
12367 if (item.CanFreeze())
12368 item.SetFrozen(false);
12369 }
12370
12371 if (item.HasEnergyManager())
12372 {
12373 if (quantity >= 0)
12374 {
12375 item.GetCompEM().SetEnergy0To1(quantity);
12376 }
12377 else
12378 {
12380 }
12381 }
12382 else if (item.IsMagazine())
12383 {
12384 Magazine mag = Magazine.Cast(item);
12385 if (quantity >= 0)
12386 {
12387 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12388 }
12389 else
12390 {
12392 }
12393
12394 }
12395 else
12396 {
12397 if (quantity >= 0)
12398 {
12399 item.SetQuantityNormalized(quantity, false);
12400 }
12401 else
12402 {
12404 }
12405
12406 }
12407 }
12408}
12409
12410#ifdef DEVELOPER
12412#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.