7608{
7610 {
7611 return true;
7612 }
7613};
7614
7615
7616
7618{
7622
7624
7627
7628
7629
7630
7631
7640
7646
7651
7656
7677 protected bool m_IsResultOfSplit
7678
7680
7685
7686
7687
7689
7693
7694
7695
7697
7700
7701
7702
7708
7709
7717
7720
7721
7723
7724
7726
7727
7732
7733
7738
7739
7741
7742
7744 {
7749
7750 if (!
GetGame().IsDedicatedServer())
7751 {
7753 {
7755
7757 {
7759 }
7760 }
7761
7764 }
7765
7766 m_OldLocation = null;
7767
7769 {
7771 }
7772
7773 if (ConfigIsExisting("headSelectionsToHide"))
7774 {
7777 }
7778
7780 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7781 {
7783 }
7784
7786
7787 m_IsResultOfSplit = false;
7788
7790 }
7791
7793 {
7794 super.InitItemVariables();
7795
7801 m_Count = ConfigGetInt(
"count");
7802
7805
7810
7813
7818
7830
7834
7835
7838 if (ConfigIsExisting("canBeSplit"))
7839 {
7842 }
7843
7845 if (ConfigIsExisting("itemBehaviour"))
7847
7848
7851 RegisterNetSyncVariableInt("m_VarLiquidType");
7852 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7853
7854 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7855 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7856 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7857
7858 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7859 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7860 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7861 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7862
7863 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7864 RegisterNetSyncVariableBool("m_IsTakeable");
7865 RegisterNetSyncVariableBool("m_IsHologram");
7866
7869 {
7872 }
7873
7875
7877 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7879
7880 }
7881
7883 {
7885 }
7886
7888 {
7891 {
7896 }
7897 }
7898
7899 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7900 {
7902 {
7905 }
7906
7908 }
7909
7911 {
7917 }
7918
7920
7922 {
7924
7925 if (!action)
7926 {
7927 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7928 return;
7929 }
7930
7932 if (!ai)
7933 {
7935 return;
7936 }
7937
7939 if (!action_array)
7940 {
7941 action_array = new array<ActionBase_Basic>;
7943 }
7944 if (LogManager.IsActionLogEnable())
7945 {
7946 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7947 }
7948
7949 if (action_array.Find(action) != -1)
7950 {
7951 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7952 }
7953 else
7954 {
7955 action_array.Insert(action);
7956 }
7957 }
7958
7960 {
7962 ActionBase action = player.GetActionManager().GetAction(actionName);
7965
7966 if (action_array)
7967 {
7968 action_array.RemoveItem(action);
7969 }
7970 }
7971
7972
7973
7975 {
7976 ActionOverrideData overrideData = new ActionOverrideData();
7980
7982 if (!actionMap)
7983 {
7986 }
7987
7988 actionMap.Insert(this.
Type(), overrideData);
7989
7990 }
7991
7993
7995
7996
7998 {
8001
8004
8005 string config_to_search = "CfgVehicles";
8006 string muzzle_owner_config;
8007
8009 {
8010 if (IsInherited(Weapon))
8011 config_to_search = "CfgWeapons";
8012
8013 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8014
8015 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8016
8018
8019 if (config_OnFire_subclass_count > 0)
8020 {
8021 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8022
8023 for (int i = 0; i < config_OnFire_subclass_count; i++)
8024 {
8025 string particle_class = "";
8027 string config_OnFire_entry = config_OnFire_class + particle_class;
8028 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8029 WPOF_array.Insert(WPOF);
8030 }
8031
8032
8034 }
8035 }
8036
8038 {
8039 config_to_search = "CfgWeapons";
8040 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8041
8042 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8043
8045
8046 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8047 {
8048 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8049
8050 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8051 {
8052 string particle_class2 = "";
8054 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8055 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8056 WPOBE_array.Insert(WPOBE);
8057 }
8058
8059
8061 }
8062 }
8063 }
8064
8065
8067 {
8070
8072 {
8073 string config_to_search = "CfgVehicles";
8074
8075 if (IsInherited(Weapon))
8076 config_to_search = "CfgWeapons";
8077
8078 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8079 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8080
8081 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8082 {
8083
8085
8087 {
8089 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8091 return;
8092 }
8093
8096
8097
8098
8100 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8101
8102 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8103 {
8104 string particle_class = "";
8106 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8108
8109 if (entry_type == CT_CLASS)
8110 {
8111 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8112 WPOOH_array.Insert(WPOF);
8113 }
8114 }
8115
8116
8118 }
8119 }
8120 }
8121
8123 {
8125 }
8126
8128 {
8130 {
8132
8135
8138
8139 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8140 }
8141 }
8142
8144 {
8146 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8147
8149 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8150
8152 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8153
8155 {
8157 }
8158 }
8159
8161 {
8163 }
8164
8166 {
8169 else
8171
8173 {
8176 }
8177 else
8178 {
8181
8184 }
8185
8187 }
8188
8190 {
8192 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8193 }
8194
8196 {
8198 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8200 }
8201
8203 {
8205 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8206 }
8207
8209 {
8212
8213 OverheatingParticle OP = new OverheatingParticle();
8218
8220 }
8221
8223 {
8226
8227 return -1;
8228 }
8229
8231 {
8233 {
8236
8237 for (int i = count; i > 0; --i)
8238 {
8239 int id = i - 1;
8242
8245
8246 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8247 {
8248 if (p)
8249 {
8252 }
8253 }
8254 }
8255 }
8256 }
8257
8259 {
8261 {
8263 {
8264 int id = i - 1;
8266
8267 if (OP)
8268 {
8270
8271 if (p)
8272 {
8274 }
8275
8276 delete OP;
8277 }
8278 }
8279
8282 }
8283 }
8284
8287 {
8288 return 0.0;
8289 }
8290
8291
8293 {
8294 return 250;
8295 }
8296
8298 {
8299 return 0;
8300 }
8301
8304 {
8306 return true;
8307
8308 return false;
8309 }
8310
8313 {
8316
8318 {
8320 }
8321 else
8322 {
8323
8325 }
8326
8328 }
8329
8336 {
8337 return -1;
8338 }
8339
8340
8341
8342
8344 {
8346 {
8348 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8349
8350 if (r_index >= 0)
8351 {
8352 InventoryLocation r_il = new InventoryLocation;
8353 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8354
8355 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8358 {
8359 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8360 }
8362 {
8363 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8364 }
8365
8366 }
8367
8368 player.GetHumanInventory().ClearUserReservedLocation(this);
8369 }
8370
8373 }
8374
8375
8376
8377
8379 {
8380 return ItemBase.m_DebugActionsMask;
8381 }
8382
8384 {
8385 return ItemBase.m_DebugActionsMask & mask;
8386 }
8387
8389 {
8390 ItemBase.m_DebugActionsMask = mask;
8391 }
8392
8394 {
8395 ItemBase.m_DebugActionsMask |= mask;
8396 }
8397
8399 {
8400 ItemBase.m_DebugActionsMask &= ~mask;
8401 }
8402
8404 {
8406 {
8408 }
8409 else
8410 {
8412 }
8413 }
8414
8415
8417 {
8418 if (GetEconomyProfile())
8419 {
8420 float q_max = GetEconomyProfile().GetQuantityMax();
8421 if (q_max > 0)
8422 {
8423 float q_min = GetEconomyProfile().GetQuantityMin();
8424 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8425
8427 {
8428 ComponentEnergyManager comp = GetCompEM();
8430 {
8432 }
8433 }
8435 {
8437
8438 }
8439
8440 }
8441 }
8442 }
8443
8446 {
8447 EntityAI parent = GetHierarchyParent();
8448
8449 if (parent)
8450 {
8451 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8452 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8453 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8454 }
8455 }
8456
8459 {
8460 EntityAI parent = GetHierarchyParent();
8461
8462 if (parent)
8463 {
8464 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8465 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8466 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8467 }
8468 }
8469
8471 {
8472
8473
8474
8475
8477
8479 {
8480 if (ScriptInputUserData.CanStoreInputUserData())
8481 {
8482 ScriptInputUserData ctx = new ScriptInputUserData;
8488 ctx.
Write(use_stack_max);
8491
8493 {
8494 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8495 }
8496 }
8497 }
8498 else if (!
GetGame().IsMultiplayer())
8499 {
8501 }
8502 }
8503
8505 {
8507 }
8508
8510 {
8512 }
8513
8515 {
8517 }
8518
8520 {
8521
8522 return false;
8523 }
8524
8526 {
8527 return false;
8528 }
8529
8533 {
8534 return false;
8535 }
8536
8538 {
8539 return "";
8540 }
8541
8543
8545 {
8546 return false;
8547 }
8548
8550 {
8551 return true;
8552 }
8553
8554
8555
8557 {
8558 return true;
8559 }
8560
8562 {
8563 return true;
8564 }
8565
8567 {
8568 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8570 }
8571
8573 {
8575 }
8576
8578 {
8580 if (!is_being_placed)
8582 SetSynchDirty();
8583 }
8584
8585
8587
8589 {
8591 }
8592
8594 {
8596 }
8597
8599 {
8600 return 1;
8601 }
8602
8604 {
8605 return false;
8606 }
8607
8609 {
8611 SetSynchDirty();
8612 }
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8649 {
8650 super.OnMovedInsideCargo(container);
8651
8652 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8653 }
8654
8655 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8656 {
8657 super.EEItemLocationChanged(oldLoc,newLoc);
8658
8659 PlayerBase new_player = null;
8660 PlayerBase old_player = null;
8661
8662 if (newLoc.GetParent())
8663 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8664
8665 if (oldLoc.GetParent())
8666 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8667
8669 {
8670 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8671
8672 if (r_index >= 0)
8673 {
8674 InventoryLocation r_il = new InventoryLocation;
8675 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8676
8677 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8680 {
8681 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8682 }
8684 {
8685 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8686 }
8687
8688 }
8689 }
8690
8692 {
8693 if (new_player)
8694 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8695
8696 if (new_player == old_player)
8697 {
8698
8699 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8700 {
8702 {
8703 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8704 {
8705 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8706 }
8707 }
8708 else
8709 {
8710 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8711 }
8712 }
8713
8714 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8715 {
8716 int type = oldLoc.GetType();
8718 {
8719 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8720 }
8722 {
8723 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8724 }
8725 }
8726 if (!m_OldLocation)
8727 {
8728 m_OldLocation = new InventoryLocation;
8729 }
8730 m_OldLocation.Copy(oldLoc);
8731 }
8732 else
8733 {
8734 if (m_OldLocation)
8735 {
8736 m_OldLocation.Reset();
8737 }
8738 }
8739
8741 }
8742 else
8743 {
8744 if (new_player)
8745 {
8746 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8747 if (res_index >= 0)
8748 {
8749 InventoryLocation il = new InventoryLocation;
8750 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8752 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8755 {
8756 il.
GetParent().GetOnReleaseLock().Invoke(it);
8757 }
8759 {
8761 }
8762
8763 }
8764 }
8766 {
8767
8769 }
8770
8771 if (m_OldLocation)
8772 {
8773 m_OldLocation.Reset();
8774 }
8775 }
8776 }
8777
8778 override void EOnContact(IEntity other, Contact extra)
8779 {
8781 {
8782 int liquidType = -1;
8784 if (impactSpeed > 0.0)
8785 {
8787 #ifndef SERVER
8789 #else
8791 SetSynchDirty();
8792 #endif
8794 }
8795 }
8796
8797 #ifdef SERVER
8798 if (GetCompEM() && GetCompEM().IsPlugged())
8799 {
8800 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8801 GetCompEM().UnplugThis();
8802 }
8803 #endif
8804 }
8805
8807
8809 {
8811 }
8812
8814 {
8815
8816 }
8817
8819 {
8820 super.OnItemLocationChanged(old_owner, new_owner);
8821
8822 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8823 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8824
8825 if (!relatedPlayer && playerNew)
8826 relatedPlayer = playerNew;
8827
8828 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8829 {
8831 if (actionMgr)
8832 {
8833 ActionBase currentAction = actionMgr.GetRunningAction();
8834 if (currentAction)
8836 }
8837 }
8838
8839 Man ownerPlayerOld = null;
8840 Man ownerPlayerNew = null;
8841
8842 if (old_owner)
8843 {
8844 if (old_owner.
IsMan())
8845 {
8846 ownerPlayerOld = Man.Cast(old_owner);
8847 }
8848 else
8849 {
8850 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8851 }
8852 }
8853 else
8854 {
8856 {
8858
8859 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8860 {
8861 GetCompEM().UnplugThis();
8862 }
8863 }
8864 }
8865
8866 if (new_owner)
8867 {
8868 if (new_owner.
IsMan())
8869 {
8870 ownerPlayerNew = Man.Cast(new_owner);
8871 }
8872 else
8873 {
8874 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8875 }
8876 }
8877
8878 if (ownerPlayerOld != ownerPlayerNew)
8879 {
8880 if (ownerPlayerOld)
8881 {
8882 array<EntityAI> subItemsExit = new array<EntityAI>;
8884 for (int i = 0; i < subItemsExit.Count(); i++)
8885 {
8888 }
8889 }
8890
8891 if (ownerPlayerNew)
8892 {
8893 array<EntityAI> subItemsEnter = new array<EntityAI>;
8895 for (int j = 0; j < subItemsEnter.Count(); j++)
8896 {
8899 }
8900 }
8901 }
8902 else if (ownerPlayerNew != null)
8903 {
8904 PlayerBase nplayer;
8905 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8906 {
8907 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8909 for (int k = 0; k < subItemsUpdate.Count(); k++)
8910 {
8912 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8913 }
8914 }
8915 }
8916
8917 if (old_owner)
8918 old_owner.OnChildItemRemoved(this);
8919 if (new_owner)
8920 new_owner.OnChildItemReceived(this);
8921 }
8922
8923
8925 {
8926 super.EEDelete(parent);
8927 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8928 if (player)
8929 {
8931
8932 if (player.IsAlive())
8933 {
8934 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8935 if (r_index >= 0)
8936 {
8937 InventoryLocation r_il = new InventoryLocation;
8938 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8939
8940 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8943 {
8944 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8945 }
8947 {
8948 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8949 }
8950
8951 }
8952
8953 player.RemoveQuickBarEntityShortcut(this);
8954 }
8955 }
8956 }
8957
8959 {
8960 super.EEKilled(killer);
8961
8964 {
8965 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8966 {
8967 if (IsMagazine())
8968 {
8969 if (Magazine.Cast(this).GetAmmoCount() > 0)
8970 {
8972 }
8973 }
8974 else
8975 {
8977 }
8978 }
8979 }
8980 }
8981
8983 {
8984 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8985
8986 super.OnWasAttached(parent, slot_id);
8987
8990
8992 }
8993
8995 {
8996 super.OnWasDetached(parent, slot_id);
8997
9000 }
9001
9003 {
9004 int idx;
9007
9008 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9009 if (inventory_slots.Count() < 1)
9010 {
9011 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9012 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9013 }
9014 else
9015 {
9016 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9017 }
9018
9019 idx = inventory_slots.Find(slot);
9020 if (idx < 0)
9021 return "";
9022
9023 return attach_types.Get(idx);
9024 }
9025
9027 {
9028 int idx = -1;
9029 string slot;
9030
9033
9034 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9035 if (inventory_slots.Count() < 1)
9036 {
9037 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9038 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9039 }
9040 else
9041 {
9042 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9043 if (detach_types.Count() < 1)
9044 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9045 }
9046
9047 for (int i = 0; i < inventory_slots.Count(); i++)
9048 {
9049 slot = inventory_slots.Get(i);
9050 }
9051
9052 if (slot != "")
9053 {
9054 if (detach_types.Count() == 1)
9055 idx = 0;
9056 else
9057 idx = inventory_slots.Find(slot);
9058 }
9059 if (idx < 0)
9060 return "";
9061
9062 return detach_types.Get(idx);
9063 }
9064
9066 {
9067
9069
9070
9071 float min_time = 1;
9072 float max_time = 3;
9073 float delay = Math.RandomFloat(min_time, max_time);
9074
9075 explode_timer.Run(delay, this, "DoAmmoExplosion");
9076 }
9077
9079 {
9080 Magazine magazine = Magazine.Cast(this);
9081 int pop_sounds_count = 6;
9082 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9083
9084
9085 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9086 string sound_name = pop_sounds[ sound_idx ];
9088
9089
9090 magazine.ServerAddAmmoCount(-1);
9091
9092
9093 float min_temp_to_explode = 100;
9094
9095 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9096 {
9098 }
9099 }
9100
9101
9102 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9103 {
9104 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9105
9106 const int CHANCE_DAMAGE_CARGO = 4;
9107 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9108 const int CHANCE_DAMAGE_NOTHING = 2;
9109
9111 {
9112 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9113 int chances;
9114 int rnd;
9115
9116 if (GetInventory().GetCargo())
9117 {
9118 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9119 rnd = Math.RandomInt(0,chances);
9120
9121 if (rnd < CHANCE_DAMAGE_CARGO)
9122 {
9124 }
9125 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9126 {
9128 }
9129 }
9130 else
9131 {
9132 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9133 rnd = Math.RandomInt(0,chances);
9134
9135 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9136 {
9138 }
9139 }
9140 }
9141 }
9142
9144 {
9145 if (GetInventory().GetCargo())
9146 {
9147 int item_count = GetInventory().GetCargo().GetItemCount();
9148 if (item_count > 0)
9149 {
9150 int random_pick = Math.RandomInt(0, item_count);
9152 if (!item.IsExplosive())
9153 {
9154 item.AddHealth("","",damage);
9155 return true;
9156 }
9157 }
9158 }
9159 return false;
9160 }
9161
9163 {
9164 int attachment_count = GetInventory().AttachmentCount();
9165 if (attachment_count > 0)
9166 {
9167 int random_pick = Math.RandomInt(0, attachment_count);
9168 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9169 if (!attachment.IsExplosive())
9170 {
9171 attachment.AddHealth("","",damage);
9172 return true;
9173 }
9174 }
9175 return false;
9176 }
9177
9179 {
9181 }
9182
9184 {
9186 return GetInventory().CanRemoveEntity();
9187
9188 return false;
9189 }
9190
9192 {
9194 return;
9195
9197 {
9198 if (ScriptInputUserData.CanStoreInputUserData())
9199 {
9200 ScriptInputUserData ctx = new ScriptInputUserData;
9205 ctx.
Write(destination_entity);
9209 }
9210 }
9211 else if (!
GetGame().IsMultiplayer())
9212 {
9214 }
9215 }
9216
9218 {
9220 return;
9221
9222 float split_quantity_new;
9226 InventoryLocation loc = new InventoryLocation;
9227
9228 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9229 {
9231 split_quantity_new = stack_max;
9232 else
9234
9235 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9236 if (new_item)
9237 {
9238 new_item.SetResultOfSplit(true);
9239 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9241 new_item.SetQuantity(split_quantity_new);
9242 }
9243 }
9244 else if (destination_entity && slot_id == -1)
9245 {
9246 if (quantity > stack_max)
9247 split_quantity_new = stack_max;
9248 else
9249 split_quantity_new = quantity;
9250
9252 {
9255 }
9256
9257 if (new_item)
9258 {
9259 new_item.SetResultOfSplit(true);
9260 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9262 new_item.SetQuantity(split_quantity_new);
9263 }
9264 }
9265 else
9266 {
9267 if (stack_max != 0)
9268 {
9270 {
9272 }
9273
9274 if (split_quantity_new == 0)
9275 {
9276 if (!
GetGame().IsMultiplayer())
9277 player.PhysicalPredictiveDropItem(this);
9278 else
9279 player.ServerDropEntity(this);
9280 return;
9281 }
9282
9284
9285 if (new_item)
9286 {
9287 new_item.SetResultOfSplit(true);
9288 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9290 new_item.SetQuantity(stack_max);
9291 new_item.PlaceOnSurface();
9292 }
9293 }
9294 }
9295 }
9296
9298 {
9300 return;
9301
9302 float split_quantity_new;
9306 InventoryLocation loc = new InventoryLocation;
9307
9308 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9309 {
9311 split_quantity_new = stack_max;
9312 else
9314
9315 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9316 if (new_item)
9317 {
9318 new_item.SetResultOfSplit(true);
9319 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9321 new_item.SetQuantity(split_quantity_new);
9322 }
9323 }
9324 else if (destination_entity && slot_id == -1)
9325 {
9326 if (quantity > stack_max)
9327 split_quantity_new = stack_max;
9328 else
9329 split_quantity_new = quantity;
9330
9332 {
9335 }
9336
9337 if (new_item)
9338 {
9339 new_item.SetResultOfSplit(true);
9340 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9342 new_item.SetQuantity(split_quantity_new);
9343 }
9344 }
9345 else
9346 {
9347 if (stack_max != 0)
9348 {
9350 {
9352 }
9353
9355
9356 if (new_item)
9357 {
9358 new_item.SetResultOfSplit(true);
9359 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9361 new_item.SetQuantity(stack_max);
9362 new_item.PlaceOnSurface();
9363 }
9364 }
9365 }
9366 }
9367
9369 {
9371 return;
9372
9374 {
9375 if (ScriptInputUserData.CanStoreInputUserData())
9376 {
9377 ScriptInputUserData ctx = new ScriptInputUserData;
9382 dst.WriteToContext(ctx);
9384 }
9385 }
9386 else if (!
GetGame().IsMultiplayer())
9387 {
9389 }
9390 }
9391
9393 {
9395 return;
9396
9398 {
9399 if (ScriptInputUserData.CanStoreInputUserData())
9400 {
9401 ScriptInputUserData ctx = new ScriptInputUserData;
9406 ctx.
Write(destination_entity);
9412 }
9413 }
9414 else if (!
GetGame().IsMultiplayer())
9415 {
9417 }
9418 }
9419
9421 {
9423 }
9424
9426 {
9428 return this;
9429
9431 float split_quantity_new;
9433 if (dst.IsValid())
9434 {
9435 int slot_id = dst.GetSlot();
9437
9438 if (quantity > stack_max)
9439 split_quantity_new = stack_max;
9440 else
9441 split_quantity_new = quantity;
9442
9444
9445 if (new_item)
9446 {
9447 new_item.SetResultOfSplit(true);
9448 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9451 }
9452
9453 return new_item;
9454 }
9455
9456 return null;
9457 }
9458
9460 {
9462 return;
9463
9465 float split_quantity_new;
9467 if (destination_entity)
9468 {
9470 if (quantity > stackable)
9471 split_quantity_new = stackable;
9472 else
9473 split_quantity_new = quantity;
9474
9475 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9476 if (new_item)
9477 {
9478 new_item.SetResultOfSplit(true);
9479 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9481 new_item.SetQuantity(split_quantity_new);
9482 }
9483 }
9484 }
9485
9487 {
9489 return;
9490
9492 {
9493 if (ScriptInputUserData.CanStoreInputUserData())
9494 {
9495 ScriptInputUserData ctx = new ScriptInputUserData;
9500 ItemBase destination_entity =
this;
9501 ctx.
Write(destination_entity);
9505 }
9506 }
9507 else if (!
GetGame().IsMultiplayer())
9508 {
9510 }
9511 }
9512
9514 {
9516 return;
9517
9519 float split_quantity_new;
9521 if (player)
9522 {
9524 if (quantity > stackable)
9525 split_quantity_new = stackable;
9526 else
9527 split_quantity_new = quantity;
9528
9529 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9530 new_item =
ItemBase.Cast(in_hands);
9531 if (new_item)
9532 {
9533 new_item.SetResultOfSplit(true);
9534 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9536 new_item.SetQuantity(split_quantity_new);
9537 }
9538 }
9539 }
9540
9542 {
9544 return;
9545
9547 float split_quantity_new = Math.Floor(quantity * 0.5);
9548
9550
9551 if (new_item)
9552 {
9553 if (new_item.GetQuantityMax() < split_quantity_new)
9554 {
9555 split_quantity_new = new_item.GetQuantityMax();
9556 }
9557
9558 new_item.SetResultOfSplit(true);
9559 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9560
9562 {
9565 }
9566 else
9567 {
9570 }
9571 }
9572 }
9573
9575 {
9577 return;
9578
9580 float split_quantity_new = Math.Floor(quantity / 2);
9581
9582 InventoryLocation invloc = new InventoryLocation;
9584
9586 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9587
9588 if (new_item)
9589 {
9590 if (new_item.GetQuantityMax() < split_quantity_new)
9591 {
9592 split_quantity_new = new_item.GetQuantityMax();
9593 }
9595 {
9598 }
9599 else
9600 {
9603 }
9604 }
9605 }
9606
9609 {
9610 SetWeightDirty();
9612
9613 if (parent)
9614 parent.OnAttachmentQuantityChangedEx(this, delta);
9615
9617 {
9619 {
9621 }
9623 {
9624 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9626 }
9627 }
9628
9629 }
9630
9633 {
9634
9635 }
9636
9639 {
9641 }
9642
9644 {
9645 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9646
9648 {
9649 if (newLevel == GameConstants.STATE_RUINED)
9650 {
9652 EntityAI parent = GetHierarchyParent();
9653 if (parent && parent.IsFireplace())
9654 {
9655 CargoBase cargo = GetInventory().GetCargo();
9656 if (cargo)
9657 {
9659 {
9661 }
9662 }
9663 }
9664 }
9665
9667 {
9668
9670 return;
9671 }
9672
9673 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9674 {
9676 }
9677 }
9678 }
9679
9680
9682 {
9683 super.OnRightClick();
9684
9686 {
9688 {
9689 if (ScriptInputUserData.CanStoreInputUserData())
9690 {
9691 vector m4[4];
9693
9694 EntityAI root = GetHierarchyRoot();
9695
9696 InventoryLocation dst = new InventoryLocation;
9698 {
9699 if (root)
9700 {
9701 root.GetTransform(m4);
9703 }
9704 else
9705 GetInventory().GetCurrentInventoryLocation(dst);
9706 }
9707 else
9708 {
9710
9711
9712 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9713 {
9714 if (root)
9715 {
9716 root.GetTransform(m4);
9718 }
9719 else
9720 GetInventory().GetCurrentInventoryLocation(dst);
9721 }
9722 else
9723 {
9724 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9725 }
9726 }
9727
9728 ScriptInputUserData ctx = new ScriptInputUserData;
9736 }
9737 }
9738 else if (!
GetGame().IsMultiplayer())
9739 {
9741 }
9742 }
9743 }
9744
9745 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9746 {
9747
9748 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9749 return false;
9750
9751 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9752 return false;
9753
9754
9756 return false;
9757
9758
9759 Magazine mag = Magazine.Cast(this);
9760 if (mag)
9761 {
9762 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9763 return false;
9764
9765 if (stack_max_limit)
9766 {
9767 Magazine other_mag = Magazine.Cast(other_item);
9768 if (other_item)
9769 {
9770 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9771 return false;
9772 }
9773
9774 }
9775 }
9776 else
9777 {
9778
9780 return false;
9781
9783 return false;
9784 }
9785
9786 PlayerBase player = null;
9787 if (CastTo(player, GetHierarchyRootPlayer()))
9788 {
9789 if (player.GetInventory().HasAttachment(this))
9790 return false;
9791
9792 if (player.IsItemsToDelete())
9793 return false;
9794 }
9795
9796 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9797 return false;
9798
9799 int slotID;
9801 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9802 return false;
9803
9804 return true;
9805 }
9806
9808 {
9810 }
9811
9813 {
9814 return m_IsResultOfSplit;
9815 }
9816
9818 {
9819 m_IsResultOfSplit = value;
9820 }
9821
9823 {
9825 }
9826
9828 {
9829 float other_item_quantity = other_item.GetQuantity();
9830 float this_free_space;
9831
9833
9835
9836 if (other_item_quantity > this_free_space)
9837 {
9838 return this_free_space;
9839 }
9840 else
9841 {
9842 return other_item_quantity;
9843 }
9844 }
9845
9847 {
9849 }
9850
9852 {
9854 return;
9855
9856 if (!IsMagazine() && other_item)
9857 {
9859 if (quantity_used != 0)
9860 {
9861 float hp1 = GetHealth01("","");
9862 float hp2 = other_item.GetHealth01("","");
9863 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9864 hpResult = hpResult / (
GetQuantity() + quantity_used);
9865
9866 hpResult *= GetMaxHealth();
9867 Math.Round(hpResult);
9868 SetHealth("", "Health", hpResult);
9869
9871 other_item.AddQuantity(-quantity_used);
9872 }
9873 }
9875 }
9876
9878 {
9879 #ifdef SERVER
9880 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9881 GetHierarchyParent().IncreaseLifetimeUp();
9882 #endif
9883 };
9884
9886 {
9887 PlayerBase p = PlayerBase.Cast(player);
9888
9889 array<int> recipesIds = p.m_Recipes;
9890 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9891 if (moduleRecipesManager)
9892 {
9893 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9894 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9895 }
9896
9897 for (int i = 0;i < recipesIds.Count(); i++)
9898 {
9899 int key = recipesIds.Get(i);
9900 string recipeName = moduleRecipesManager.GetRecipeName(key);
9902 }
9903 }
9904
9905
9906 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9907 {
9908 super.GetDebugActions(outputList);
9909
9910
9915
9916
9920
9924
9925
9928
9929
9931 {
9934 }
9935
9937
9940
9944 }
9945
9946
9947
9948
9950 {
9951 super.OnAction(action_id, player, ctx);
9952 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9953 {
9954 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9955 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9956 PlayerBase p = PlayerBase.Cast(player);
9957 if (
EActions.RECIPES_RANGE_START < 1000)
9958 {
9959 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9960 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9961 }
9962 }
9963 #ifndef SERVER
9964 else if (action_id ==
EActions.WATCH_PLAYER)
9965 {
9966 PluginDeveloper.SetDeveloperItemClientEx(player);
9967 }
9968 #endif
9970 {
9971 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9972 {
9973 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9974 OnDebugButtonPressServer(id + 1);
9975 }
9976
9977 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9978 {
9979 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9981 }
9982
9983 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9984 {
9985 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9987 }
9988
9989 else if (action_id ==
EActions.ADD_QUANTITY)
9990 {
9991 if (IsMagazine())
9992 {
9993 Magazine mag = Magazine.Cast(this);
9994 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9995 }
9996 else
9997 {
9999 }
10000
10001 if (m_EM)
10002 {
10003 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10004 }
10005
10006 }
10007
10008 else if (action_id ==
EActions.REMOVE_QUANTITY)
10009 {
10010 if (IsMagazine())
10011 {
10012 Magazine mag2 = Magazine.Cast(this);
10013 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10014 }
10015 else
10016 {
10018 }
10019 if (m_EM)
10020 {
10021 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10022 }
10023
10024 }
10025
10026 else if (action_id ==
EActions.SET_QUANTITY_0)
10027 {
10029
10030 if (m_EM)
10031 {
10032 m_EM.SetEnergy(0);
10033 }
10034 }
10035
10036 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10037 {
10039
10040 if (m_EM)
10041 {
10042 m_EM.SetEnergy(m_EM.GetEnergyMax());
10043 }
10044 }
10045
10046 else if (action_id ==
EActions.ADD_HEALTH)
10047 {
10048 AddHealth("","",GetMaxHealth("","Health")/5);
10049 }
10050 else if (action_id ==
EActions.REMOVE_HEALTH)
10051 {
10052 AddHealth("","",-GetMaxHealth("","Health")/5);
10053 }
10054 else if (action_id ==
EActions.DESTROY_HEALTH)
10055 {
10056 SetHealth01("","",0);
10057 }
10058 else if (action_id ==
EActions.WATCH_ITEM)
10059 {
10061 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10062 #ifdef DEVELOPER
10063 SetDebugDeveloper_item(this);
10064 #endif
10065 }
10066
10067 else if (action_id ==
EActions.ADD_TEMPERATURE)
10068 {
10069 AddTemperature(20);
10070
10071 }
10072
10073 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10074 {
10075 AddTemperature(-20);
10076
10077 }
10078
10079 else if (action_id ==
EActions.FLIP_FROZEN)
10080 {
10081 SetFrozen(!GetIsFrozen());
10082
10083 }
10084
10085 else if (action_id ==
EActions.ADD_WETNESS)
10086 {
10088
10089 }
10090
10091 else if (action_id ==
EActions.REMOVE_WETNESS)
10092 {
10094
10095 }
10096
10097 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10098 {
10101
10102
10103 }
10104
10105 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10106 {
10109 }
10110
10111 else if (action_id ==
EActions.MAKE_SPECIAL)
10112 {
10113 auto debugParams = DebugSpawnParams.WithPlayer(player);
10114 OnDebugSpawnEx(debugParams);
10115 }
10116
10117 else if (action_id ==
EActions.DELETE)
10118 {
10119 Delete();
10120 }
10121
10122 }
10123
10124
10125 return false;
10126 }
10127
10128
10129
10130
10134
10137
10138
10139
10141 {
10142 return false;
10143 }
10144
10145
10147 {
10148 return true;
10149 }
10150
10151
10153 {
10154 return true;
10155 }
10156
10157
10158
10160 {
10161 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10163 }
10164
10167 {
10168 return null;
10169 }
10170
10172 {
10173 return false;
10174 }
10175
10177 {
10178 return false;
10179 }
10180
10184
10185
10187 {
10188 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10189 return module_repairing.CanRepair(this, item_repair_kit);
10190 }
10191
10192
10193 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10194 {
10195 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10196 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10197 }
10198
10199
10201 {
10202
10203
10204
10205
10206
10207
10208
10209
10210 return 1;
10211 }
10212
10213
10214
10216 {
10218 }
10219
10220
10221
10223 {
10225 }
10226
10227
10236 {
10237 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10238
10239 if (player)
10240 {
10241 player.MessageStatus(text);
10242 }
10243 }
10244
10245
10254 {
10255 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10256
10257 if (player)
10258 {
10259 player.MessageAction(text);
10260 }
10261 }
10262
10263
10272 {
10273 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10274
10275 if (player)
10276 {
10277 player.MessageFriendly(text);
10278 }
10279 }
10280
10281
10290 {
10291 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10292
10293 if (player)
10294 {
10295 player.MessageImportant(text);
10296 }
10297 }
10298
10300 {
10301 return true;
10302 }
10303
10304
10305 override bool KindOf(
string tag)
10306 {
10307 bool found = false;
10308 string item_name = this.
GetType();
10311
10312 int array_size = item_tag_array.Count();
10313 for (int i = 0; i < array_size; i++)
10314 {
10315 if (item_tag_array.Get(i) == tag)
10316 {
10317 found = true;
10318 break;
10319 }
10320 }
10321 return found;
10322 }
10323
10324
10326 {
10327
10328 super.OnRPC(sender, rpc_type,ctx);
10329
10330
10331 switch (rpc_type)
10332 {
10333 #ifndef SERVER
10334 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10335 Param2<bool, string> p = new Param2<bool, string>(false, "");
10336
10338 return;
10339
10340 bool play = p.param1;
10341 string soundSet = p.param2;
10342
10343 if (play)
10344 {
10346 {
10348 {
10350 }
10351 }
10352 else
10353 {
10355 }
10356 }
10357 else
10358 {
10360 }
10361
10362 break;
10363 #endif
10364
10365 }
10366
10368 {
10370 }
10371 }
10372
10373
10374
10375
10377 {
10378 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10379 return plugin.GetID(
name);
10380 }
10381
10383 {
10384 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10385 return plugin.GetName(id);
10386 }
10387
10390 {
10391
10392
10393 int varFlags;
10394 if (!ctx.
Read(varFlags))
10395 return;
10396
10397 if (varFlags & ItemVariableFlags.FLOAT)
10398 {
10400 }
10401 }
10402
10404 {
10405
10406 super.SerializeNumericalVars(floats_out);
10407
10408
10409
10411 {
10413 }
10414
10416 {
10418 }
10419
10421 {
10423 }
10424
10426 {
10431 }
10432
10434 {
10436 }
10437 }
10438
10440 {
10441
10442 super.DeSerializeNumericalVars(floats);
10443
10444
10445 int index = 0;
10446 int mask = Math.Round(floats.Get(index));
10447
10448 index++;
10449
10451 {
10453 {
10455 }
10456 else
10457 {
10458 float quantity = floats.Get(index);
10459 SetQuantity(quantity,
true,
false,
false,
false);
10460 }
10461 index++;
10462 }
10463
10465 {
10466 float wet = floats.Get(index);
10468 index++;
10469 }
10470
10472 {
10473 int liquidtype = Math.Round(floats.Get(index));
10475 index++;
10476 }
10477
10479 {
10481 index++;
10483 index++;
10485 index++;
10487 index++;
10488 }
10489
10491 {
10492 int cleanness = Math.Round(floats.Get(index));
10494 index++;
10495 }
10496 }
10497
10499 {
10500 super.WriteVarsToCTX(ctx);
10501
10502
10504 {
10506 }
10507
10509 {
10511 }
10512
10514 {
10516 }
10517
10519 {
10520 int r,g,b,a;
10526 }
10527
10529 {
10531 }
10532 }
10533
10535 {
10536 if (!super.ReadVarsFromCTX(ctx,version))
10537 return false;
10538
10539 int intValue;
10540 float value;
10541
10542 if (version < 140)
10543 {
10544 if (!ctx.
Read(intValue))
10545 return false;
10546
10547 m_VariablesMask = intValue;
10548 }
10549
10551 {
10552 if (!ctx.
Read(value))
10553 return false;
10554
10556 {
10558 }
10559 else
10560 {
10562 }
10563 }
10564
10565 if (version < 140)
10566 {
10568 {
10569 if (!ctx.
Read(value))
10570 return false;
10571 SetTemperatureDirect(value);
10572 }
10573 }
10574
10576 {
10577 if (!ctx.
Read(value))
10578 return false;
10580 }
10581
10583 {
10584 if (!ctx.
Read(intValue))
10585 return false;
10587 }
10588
10590 {
10591 int r,g,b,a;
10593 return false;
10595 return false;
10597 return false;
10599 return false;
10600
10602 }
10603
10605 {
10606 if (!ctx.
Read(intValue))
10607 return false;
10609 }
10610
10611 if (version >= 138 && version < 140)
10612 {
10614 {
10615 if (!ctx.
Read(intValue))
10616 return false;
10617 SetFrozen(intValue);
10618 }
10619 }
10620
10621 return true;
10622 }
10623
10624
10626 {
10629 {
10631 }
10632
10633 if (!super.OnStoreLoad(ctx, version))
10634 {
10636 return false;
10637 }
10638
10639 if (version >= 114)
10640 {
10641 bool hasQuickBarIndexSaved;
10642
10643 if (!ctx.
Read(hasQuickBarIndexSaved))
10644 {
10646 return false;
10647 }
10648
10649 if (hasQuickBarIndexSaved)
10650 {
10651 int itmQBIndex;
10652
10653
10654 if (!ctx.
Read(itmQBIndex))
10655 {
10657 return false;
10658 }
10659
10660 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10661 if (itmQBIndex != -1 && parentPlayer)
10662 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10663 }
10664 }
10665 else
10666 {
10667
10668 PlayerBase player;
10669 int itemQBIndex;
10670 if (version ==
int.
MAX)
10671 {
10672 if (!ctx.
Read(itemQBIndex))
10673 {
10675 return false;
10676 }
10677 }
10678 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10679 {
10680
10681 if (!ctx.
Read(itemQBIndex))
10682 {
10684 return false;
10685 }
10686 if (itemQBIndex != -1 && player)
10687 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10688 }
10689 }
10690
10691 if (version < 140)
10692 {
10693
10694 if (!LoadVariables(ctx, version))
10695 {
10697 return false;
10698 }
10699 }
10700
10701
10703 {
10705 return false;
10706 }
10707 if (version >= 132)
10708 {
10710 if (raib)
10711 {
10713 {
10715 return false;
10716 }
10717 }
10718 }
10719
10721 return true;
10722 }
10723
10724
10725
10727 {
10728 super.OnStoreSave(ctx);
10729
10730 PlayerBase player;
10731 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10732 {
10734
10735 int itemQBIndex = -1;
10736 itemQBIndex = player.FindQuickBarEntityIndex(this);
10737 ctx.
Write(itemQBIndex);
10738 }
10739 else
10740 {
10742 }
10743
10745
10747 if (raib)
10748 {
10750 }
10751 }
10752
10753
10755 {
10756 super.AfterStoreLoad();
10757
10759 {
10761 }
10762
10764 {
10767 }
10768 }
10769
10771 {
10772 super.EEOnAfterLoad();
10773
10775 {
10777 }
10778
10781 }
10782
10784 {
10785 return false;
10786 }
10787
10788
10789
10791 {
10793 {
10794 #ifdef PLATFORM_CONSOLE
10795
10797 {
10799 if (menu)
10800 {
10802 }
10803 }
10804 #endif
10805 }
10806
10808 {
10811 }
10812
10814 {
10815 SetWeightDirty();
10817 }
10819 {
10822 }
10823
10825 {
10828 }
10830 {
10833 }
10834
10835 super.OnVariablesSynchronized();
10836 }
10837
10838
10839
10841 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10842 {
10843 if (!IsServerCheck(allow_client))
10844 return false;
10845
10847 return false;
10848
10851
10852 if (value <= (min + 0.001))
10853 value = min;
10854
10855 if (value == min)
10856 {
10857 if (destroy_config)
10858 {
10859 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10860 if (dstr)
10861 {
10863 this.Delete();
10864 return true;
10865 }
10866 }
10867 else if (destroy_forced)
10868 {
10870 this.Delete();
10871 return true;
10872 }
10873
10875 }
10876
10879
10881 {
10883
10884 if (delta)
10886 }
10887
10889
10890 return false;
10891 }
10892
10893
10895 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10896 {
10898 }
10899
10901 {
10904 }
10905
10907 {
10910 }
10911
10914 {
10915 float value_clamped = Math.Clamp(value, 0, 1);
10917 SetQuantity(result, destroy_config, destroy_forced);
10918 }
10919
10920
10923 {
10925 }
10926
10928 {
10930 }
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10942 {
10943 int slot = -1;
10944 if (GetInventory())
10945 {
10946 InventoryLocation il = new InventoryLocation;
10947 GetInventory().GetCurrentInventoryLocation(il);
10949 }
10950
10952 }
10953
10955 {
10956 float quantity_max = 0;
10957
10959 {
10960 if (attSlotID != -1)
10961 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10962
10963 if (quantity_max <= 0)
10965 }
10966
10967 if (quantity_max <= 0)
10969
10970 return quantity_max;
10971 }
10972
10974 {
10976 }
10977
10979 {
10981 }
10982
10983
10985 {
10987 }
10988
10990 {
10992 }
10993
10995 {
10997 }
10998
10999
11001 {
11002
11003 float weightEx = GetWeightEx();
11004 float special = GetInventoryAndCargoWeight();
11005 return weightEx - special;
11006 }
11007
11008
11010 {
11012 }
11013
11015 {
11017 {
11018 #ifdef DEVELOPER
11019 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11020 {
11021 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11023 }
11024 #endif
11025
11026 return GetQuantity() * GetConfigWeightModified();
11027 }
11028 else if (HasEnergyManager())
11029 {
11030 #ifdef DEVELOPER
11031 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11032 {
11033 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11034 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11035 }
11036 #endif
11037 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11038 }
11039 else
11040 {
11041 #ifdef DEVELOPER
11042 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11043 {
11044 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11045 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11046 }
11047 #endif
11048 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11049 }
11050 }
11051
11054 {
11055 int item_count = 0;
11057
11058 if (GetInventory().GetCargo() != NULL)
11059 {
11060 item_count = GetInventory().GetCargo().GetItemCount();
11061 }
11062
11063 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11064 {
11065 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11066 if (item)
11067 item_count += item.GetNumberOfItems();
11068 }
11069 return item_count;
11070 }
11071
11074 {
11075 float weight = 0;
11076 float wetness = 1;
11077 if (include_wetness)
11080 {
11081 weight = wetness * m_ConfigWeight;
11082 }
11084 {
11085 weight = 1;
11086 }
11087 return weight;
11088 }
11089
11090
11091
11093 {
11094 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11095 {
11096 GameInventory inv = GetInventory();
11097 array<EntityAI> items = new array<EntityAI>;
11099 for (int i = 0; i < items.Count(); i++)
11100 {
11102 if (item)
11103 {
11105 }
11106 }
11107 }
11108 }
11109
11110
11111
11112
11114 {
11115 float energy = 0;
11116 if (HasEnergyManager())
11117 {
11118 energy = GetCompEM().GetEnergy();
11119 }
11120 return energy;
11121 }
11122
11123
11125 {
11126 super.OnEnergyConsumed();
11127
11129 }
11130
11132 {
11133 super.OnEnergyAdded();
11134
11136 }
11137
11138
11140 {
11141 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11142 {
11144 {
11145 float energy_0to1 = GetCompEM().GetEnergy0To1();
11147 }
11148 }
11149 }
11150
11151
11153 {
11154 return ConfigGetFloat("heatIsolation");
11155 }
11156
11158 {
11160 }
11161
11163 {
11164 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11165 if (
GetGame().ConfigIsExisting(paramPath))
11167
11168 return 0.0;
11169 }
11170
11172 {
11173 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11174 if (
GetGame().ConfigIsExisting(paramPath))
11176
11177 return 0.0;
11178 }
11179
11180 override void SetWet(
float value,
bool allow_client =
false)
11181 {
11182 if (!IsServerCheck(allow_client))
11183 return;
11184
11187
11189
11190 m_VarWet = Math.Clamp(value, min, max);
11191
11193 {
11196 }
11197 }
11198
11199 override void AddWet(
float value)
11200 {
11202 }
11203
11205 {
11207 }
11208
11210 {
11212 }
11213
11215 {
11217 }
11218
11220 {
11222 }
11223
11225 {
11227 }
11228
11229 override void OnWetChanged(
float newVal,
float oldVal)
11230 {
11233 if (newLevel != oldLevel)
11234 {
11236 }
11237 }
11238
11240 {
11241 SetWeightDirty();
11242 }
11243
11245 {
11246 return GetWetLevelInternal(
m_VarWet);
11247 }
11248
11249
11250
11252 {
11254 }
11255
11257 {
11259 }
11260
11262 {
11264 }
11265
11267 {
11269 }
11270
11271
11272
11274 {
11275 if (ConfigIsExisting("itemModelLength"))
11276 {
11277 return ConfigGetFloat("itemModelLength");
11278 }
11279 return 0;
11280 }
11281
11283 {
11284 if (ConfigIsExisting("itemAttachOffset"))
11285 {
11286 return ConfigGetFloat("itemAttachOffset");
11287 }
11288 return 0;
11289 }
11290
11291 override void SetCleanness(
int value,
bool allow_client =
false)
11292 {
11293 if (!IsServerCheck(allow_client))
11294 return;
11295
11297
11299
11302 }
11303
11305 {
11307 }
11308
11310 {
11311 return true;
11312 }
11313
11314
11315
11316
11318 {
11320 }
11321
11323 {
11325 }
11326
11327
11328
11329
11330 override void SetColor(
int r,
int g,
int b,
int a)
11331 {
11337 }
11339 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11340 {
11345 }
11346
11348 {
11350 }
11351
11354 {
11355 int r,g,b,a;
11357 r = r/255;
11358 g = g/255;
11359 b = b/255;
11360 a = a/255;
11361 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11362 }
11363
11364
11365
11366 override void SetLiquidType(
int value,
bool allow_client =
false)
11367 {
11368 if (!IsServerCheck(allow_client))
11369 return;
11370
11375 }
11376
11378 {
11379 return ConfigGetInt("varLiquidTypeInit");
11380 }
11381
11383 {
11385 }
11386
11388 {
11390 SetFrozen(false);
11391 }
11392
11395 {
11396 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11397 }
11398
11399
11402 {
11403 PlayerBase nplayer;
11404 if (PlayerBase.CastTo(nplayer, player))
11405 {
11407
11408 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11409 }
11410 }
11411
11412
11415 {
11416 PlayerBase nplayer;
11417 if (PlayerBase.CastTo(nplayer,player))
11418 {
11419
11420 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11421
11422 }
11423
11424
11425 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11426
11427
11428 if (HasEnergyManager())
11429 {
11430 GetCompEM().UpdatePlugState();
11431 }
11432 }
11433
11434
11436 {
11437 super.OnPlacementStarted(player);
11438
11440 }
11441
11442 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11443 {
11445 {
11446 m_AdminLog.OnPlacementComplete(player,
this);
11447 }
11448
11449 super.OnPlacementComplete(player, position, orientation);
11450 }
11451
11452
11453
11454
11455
11457 {
11459 {
11460 return true;
11461 }
11462 else
11463 {
11464 return false;
11465 }
11466 }
11467
11468
11470 {
11472 {
11474 }
11475 }
11476
11477
11479 {
11481 }
11482
11484 {
11486 }
11487
11488 override void InsertAgent(
int agent,
float count = 1)
11489 {
11490 if (count < 1)
11491 return;
11492
11494 }
11495
11498 {
11500 }
11501
11502
11504 {
11506 }
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11550 {
11552 return false;
11553 return true;
11554 }
11555
11557 {
11558
11560 }
11561
11562
11565 {
11566 super.CheckForRoofLimited(timeTresholdMS);
11567
11569 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11570 {
11571 m_PreviousRoofTestTime = time;
11572 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11573 }
11574 }
11575
11576
11578 {
11580 {
11581 return 0;
11582 }
11583
11584 if (GetInventory().GetAttachmentSlotsCount() != 0)
11585 {
11586 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11587 if (filter)
11588 return filter.GetProtectionLevel(type, false, system);
11589 else
11590 return 0;
11591 }
11592
11593 string subclassPath, entryName;
11594
11595 switch (type)
11596 {
11598 entryName = "biological";
11599 break;
11601 entryName = "chemical";
11602 break;
11603 default:
11604 entryName = "biological";
11605 break;
11606 }
11607
11608 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11609
11611 }
11612
11613
11614
11617 {
11618 if (!IsMagazine())
11620
11622 }
11623
11624
11625
11626
11627
11632 {
11633 return true;
11634 }
11635
11637 {
11639 }
11640
11641
11642
11643
11644
11646 {
11647 if (parent)
11648 {
11649 if (parent.IsInherited(DayZInfected))
11650 return true;
11651
11652 if (!parent.IsRuined())
11653 return true;
11654 }
11655
11656 return true;
11657 }
11658
11660 {
11661 if (!super.CanPutAsAttachment(parent))
11662 {
11663 return false;
11664 }
11665
11666 if (!IsRuined() && !parent.IsRuined())
11667 {
11668 return true;
11669 }
11670
11671 return false;
11672 }
11673
11675 {
11676
11677
11678
11679
11680 return super.CanReceiveItemIntoCargo(item);
11681 }
11682
11684 {
11685
11686
11687
11688
11689 GameInventory attachmentInv = attachment.GetInventory();
11691 {
11692 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11693 return false;
11694 }
11695
11696 InventoryLocation loc = new InventoryLocation();
11697 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11698 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11699 return false;
11700
11701 return super.CanReceiveAttachment(attachment, slotId);
11702 }
11703
11705 {
11706 if (!super.CanReleaseAttachment(attachment))
11707 return false;
11708
11709 return GetInventory().AreChildrenAccessible();
11710 }
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11733 {
11734 int id = muzzle_owner.GetMuzzleID();
11735 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11736
11737 if (WPOF_array)
11738 {
11739 for (int i = 0; i < WPOF_array.Count(); i++)
11740 {
11741 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11742
11743 if (WPOF)
11744 {
11745 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11746 }
11747 }
11748 }
11749 }
11750
11751
11753 {
11754 int id = muzzle_owner.GetMuzzleID();
11756
11757 if (WPOBE_array)
11758 {
11759 for (int i = 0; i < WPOBE_array.Count(); i++)
11760 {
11761 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11762
11763 if (WPOBE)
11764 {
11765 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11766 }
11767 }
11768 }
11769 }
11770
11771
11773 {
11774 int id = muzzle_owner.GetMuzzleID();
11775 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11776
11777 if (WPOOH_array)
11778 {
11779 for (int i = 0; i < WPOOH_array.Count(); i++)
11780 {
11781 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11782
11783 if (WPOOH)
11784 {
11785 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11786 }
11787 }
11788 }
11789 }
11790
11791
11793 {
11794 int id = muzzle_owner.GetMuzzleID();
11795 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11796
11797 if (WPOOH_array)
11798 {
11799 for (int i = 0; i < WPOOH_array.Count(); i++)
11800 {
11801 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11802
11803 if (WPOOH)
11804 {
11805 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11806 }
11807 }
11808 }
11809 }
11810
11811
11813 {
11814 int id = muzzle_owner.GetMuzzleID();
11815 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11816
11817 if (WPOOH_array)
11818 {
11819 for (int i = 0; i < WPOOH_array.Count(); i++)
11820 {
11821 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11822
11823 if (WPOOH)
11824 {
11825 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11826 }
11827 }
11828 }
11829 }
11830
11831
11832
11834 {
11836 {
11837 return true;
11838 }
11839
11840 return false;
11841 }
11842
11844 {
11846 {
11847 return true;
11848 }
11849
11850 return false;
11851 }
11852
11854 {
11856 {
11857 return true;
11858 }
11859
11860 return false;
11861 }
11862
11864 {
11865 return false;
11866 }
11867
11870 {
11871 return UATimeSpent.DEFAULT_DEPLOY;
11872 }
11873
11874
11875
11876
11878 {
11880 SetSynchDirty();
11881 }
11882
11884 {
11886 }
11887
11888
11890 {
11891 return false;
11892 }
11893
11896 {
11897 string att_type = "None";
11898
11899 if (ConfigIsExisting("soundAttType"))
11900 {
11901 att_type = ConfigGetString("soundAttType");
11902 }
11903
11905 }
11906
11908 {
11910 }
11911
11912
11913
11914
11915
11919
11921 {
11924
11926 }
11927
11928
11930 {
11932 return;
11933
11935
11938
11941
11942 SoundParameters params = new SoundParameters();
11946 }
11947
11948
11950 {
11952 return;
11953
11955 SetSynchDirty();
11956
11959 }
11960
11961
11963 {
11965 return;
11966
11968 SetSynchDirty();
11969
11972 }
11973
11975 {
11977 }
11978
11980 {
11982 }
11983
11986 {
11987 if (!
GetGame().IsDedicatedServer())
11988 {
11989 if (ConfigIsExisting("attachSoundSet"))
11990 {
11991 string cfg_path = "";
11992 string soundset = "";
11993 string type_name =
GetType();
11994
11997 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11998 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11999
12000 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12001 {
12002 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12003 {
12004 if (cfg_slot_array[i] == slot_type)
12005 {
12006 soundset = cfg_soundset_array[i];
12007 break;
12008 }
12009 }
12010 }
12011
12012 if (soundset != "")
12013 {
12014 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12016 }
12017 }
12018 }
12019 }
12020
12022 {
12023
12024 }
12025
12026 void OnApply(PlayerBase player);
12027
12029 {
12030 return 1.0;
12031 };
12032
12034 {
12036 }
12037
12039 {
12041 }
12042
12044
12046 {
12047 SetDynamicPhysicsLifeTime(0.01);
12049 }
12050
12052 {
12053 array<string> zone_names = new array<string>;
12054 GetDamageZones(zone_names);
12055 for (int i = 0; i < zone_names.Count(); i++)
12056 {
12057 SetHealthMax(zone_names.Get(i),"Health");
12058 }
12059 SetHealthMax("","Health");
12060 }
12061
12064 {
12065 float global_health = GetHealth01("","Health");
12066 array<string> zones = new array<string>;
12067 GetDamageZones(zones);
12068
12069 for (int i = 0; i < zones.Count(); i++)
12070 {
12071 SetHealth01(zones.Get(i),"Health",global_health);
12072 }
12073 }
12074
12077 {
12078 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12079 }
12080
12082 {
12083 if (!hasRootAsPlayer)
12084 {
12085 if (refParentIB)
12086 {
12087
12088 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12089 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12090
12091 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12092 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12093
12096 }
12097 else
12098 {
12099
12102 }
12103 }
12104 }
12105
12107 {
12109 {
12110 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12111 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12112 {
12113 float heatPermCoef = 1.0;
12115 while (ent)
12116 {
12117 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12118 ent = ent.GetHierarchyParent();
12119 }
12120
12121 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12122 }
12123 }
12124 }
12125
12127 {
12128
12129 EntityAI parent = GetHierarchyParent();
12130 if (!parent)
12131 {
12132 hasParent = false;
12133 hasRootAsPlayer = false;
12134 }
12135 else
12136 {
12137 hasParent = true;
12138 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12139 refParentIB =
ItemBase.Cast(parent);
12140 }
12141 }
12142
12143 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12144 {
12145
12146 }
12147
12149 {
12150
12151 return false;
12152 }
12153
12155 {
12156
12157
12158 return false;
12159 }
12160
12162 {
12163
12164 return false;
12165 }
12166
12169 {
12170 return !GetIsFrozen() &&
IsOpen();
12171 }
12172
12174 {
12175 bool hasParent = false, hasRootAsPlayer = false;
12177
12178 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12179 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12180
12181 if (wwtu || foodDecay)
12182 {
12186
12187 if (processWetness || processTemperature || processDecay)
12188 {
12190
12191 if (processWetness)
12192 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12193
12194 if (processTemperature)
12196
12197 if (processDecay)
12198 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12199 }
12200 }
12201 }
12202
12205 {
12207 }
12208
12210 {
12213
12214 return super.GetTemperatureFreezeThreshold();
12215 }
12216
12218 {
12221
12222 return super.GetTemperatureThawThreshold();
12223 }
12224
12226 {
12229
12230 return super.GetItemOverheatThreshold();
12231 }
12232
12234 {
12236 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12237
12238 return super.GetTemperatureFreezeTime();
12239 }
12240
12242 {
12244 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12245
12246 return super.GetTemperatureThawTime();
12247 }
12248
12253
12255 {
12256 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12257 }
12258
12260 {
12261 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12262 }
12263
12266 {
12268 }
12269
12271 {
12273 }
12274
12276 {
12278 }
12279
12282 {
12283 return null;
12284 }
12285
12288 {
12289 return false;
12290 }
12291
12293 {
12295 {
12298 if (!trg)
12299 {
12301 explosive = this;
12302 }
12303
12304 explosive.PairRemote(trg);
12306
12307 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12308 trg.SetPersistentPairID(persistentID);
12309 explosive.SetPersistentPairID(persistentID);
12310
12311 return true;
12312 }
12313 return false;
12314 }
12315
12318 {
12319 float ret = 1.0;
12322 ret *= GetHealth01();
12323
12324 return ret;
12325 }
12326
12327 #ifdef DEVELOPER
12328 override void SetDebugItem()
12329 {
12330 super.SetDebugItem();
12331 _itemBase = this;
12332 }
12333
12335 {
12336 string text = super.GetDebugText();
12337
12339 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12340
12341 return text;
12342 }
12343 #endif
12344
12346 {
12347 return true;
12348 }
12349
12351
12353
12355 {
12358 }
12359
12360
12368
12384}
12385
12387{
12389 if (entity)
12390 {
12391 bool is_item = entity.IsInherited(
ItemBase);
12392 if (is_item && full_quantity)
12393 {
12396 }
12397 }
12398 else
12399 {
12401 return NULL;
12402 }
12403 return entity;
12404}
12405
12407{
12408 if (item)
12409 {
12410 if (health > 0)
12411 item.SetHealth("", "", health);
12412
12413 if (item.CanHaveTemperature())
12414 {
12416 if (item.CanFreeze())
12417 item.SetFrozen(false);
12418 }
12419
12420 if (item.HasEnergyManager())
12421 {
12422 if (quantity >= 0)
12423 {
12424 item.GetCompEM().SetEnergy0To1(quantity);
12425 }
12426 else
12427 {
12429 }
12430 }
12431 else if (item.IsMagazine())
12432 {
12433 Magazine mag = Magazine.Cast(item);
12434 if (quantity >= 0)
12435 {
12436 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12437 }
12438 else
12439 {
12441 }
12442
12443 }
12444 else
12445 {
12446 if (quantity >= 0)
12447 {
12448 item.SetQuantityNormalized(quantity, false);
12449 }
12450 else
12451 {
12453 }
12454
12455 }
12456 }
12457}
12458
12459#ifdef DEVELOPER
12461#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.