7526{
7528 {
7529 return true;
7530 }
7531};
7532
7533
7534
7536{
7540
7542
7545
7546
7547
7548
7549
7558
7564
7569
7574
7595 protected bool m_IsResultOfSplit
7596
7598
7603
7604
7605
7607
7611
7612
7613
7615
7618
7619
7620
7626
7627
7635
7638
7639
7641
7642
7644
7645
7650
7651
7656
7657
7659
7660
7662 {
7667
7668 if (!
GetGame().IsDedicatedServer())
7669 {
7671 {
7673
7675 {
7677 }
7678 }
7679
7682 }
7683
7684 m_OldLocation = null;
7685
7687 {
7689 }
7690
7691 if (ConfigIsExisting("headSelectionsToHide"))
7692 {
7695 }
7696
7698 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7699 {
7701 }
7702
7704
7705 m_IsResultOfSplit = false;
7706
7708 }
7709
7711 {
7712 super.InitItemVariables();
7713
7719 m_Count = ConfigGetInt(
"count");
7720
7723
7728
7731
7736
7748
7752
7753
7756 if (ConfigIsExisting("canBeSplit"))
7757 {
7760 }
7761
7763 if (ConfigIsExisting("itemBehaviour"))
7765
7766
7769 RegisterNetSyncVariableInt("m_VarLiquidType");
7770 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7771
7772 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7773 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7774 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7775
7776 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7777 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7778 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7779 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7780
7781 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7782 RegisterNetSyncVariableBool("m_IsTakeable");
7783 RegisterNetSyncVariableBool("m_IsHologram");
7784
7787 {
7790 }
7791
7793
7795 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7797
7798 }
7799
7801 {
7803 }
7804
7806 {
7809 {
7814 }
7815 }
7816
7817 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7818 {
7820 {
7823 }
7824
7826 }
7827
7829 {
7835 }
7836
7838
7840 {
7842
7843 if (!action)
7844 {
7845 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7846 return;
7847 }
7848
7850 if (!ai)
7851 {
7853 return;
7854 }
7855
7857 if (!action_array)
7858 {
7859 action_array = new array<ActionBase_Basic>;
7861 }
7862 if (LogManager.IsActionLogEnable())
7863 {
7864 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7865 }
7866
7867 if (action_array.Find(action) != -1)
7868 {
7869 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7870 }
7871 else
7872 {
7873 action_array.Insert(action);
7874 }
7875 }
7876
7878 {
7880 ActionBase action = player.GetActionManager().GetAction(actionName);
7883
7884 if (action_array)
7885 {
7886 action_array.RemoveItem(action);
7887 }
7888 }
7889
7890
7891
7893 {
7894 ActionOverrideData overrideData = new ActionOverrideData();
7898
7900 if (!actionMap)
7901 {
7904 }
7905
7906 actionMap.Insert(this.
Type(), overrideData);
7907
7908 }
7909
7911
7913
7914
7916 {
7919
7922
7923 string config_to_search = "CfgVehicles";
7924 string muzzle_owner_config;
7925
7927 {
7928 if (IsInherited(Weapon))
7929 config_to_search = "CfgWeapons";
7930
7931 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7932
7933 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7934
7936
7937 if (config_OnFire_subclass_count > 0)
7938 {
7939 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7940
7941 for (int i = 0; i < config_OnFire_subclass_count; i++)
7942 {
7943 string particle_class = "";
7945 string config_OnFire_entry = config_OnFire_class + particle_class;
7946 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7947 WPOF_array.Insert(WPOF);
7948 }
7949
7950
7952 }
7953 }
7954
7956 {
7957 config_to_search = "CfgWeapons";
7958 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7959
7960 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7961
7963
7964 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7965 {
7966 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7967
7968 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7969 {
7970 string particle_class2 = "";
7972 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7973 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7974 WPOBE_array.Insert(WPOBE);
7975 }
7976
7977
7979 }
7980 }
7981 }
7982
7983
7985 {
7988
7990 {
7991 string config_to_search = "CfgVehicles";
7992
7993 if (IsInherited(Weapon))
7994 config_to_search = "CfgWeapons";
7995
7996 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7997 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7998
7999 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8000 {
8001
8003
8005 {
8007 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8009 return;
8010 }
8011
8014
8015
8016
8018 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8019
8020 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8021 {
8022 string particle_class = "";
8024 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8026
8027 if (entry_type == CT_CLASS)
8028 {
8029 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8030 WPOOH_array.Insert(WPOF);
8031 }
8032 }
8033
8034
8036 }
8037 }
8038 }
8039
8041 {
8043 }
8044
8046 {
8048 {
8050
8053
8056
8057 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8058 }
8059 }
8060
8062 {
8064 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8065
8067 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8068
8070 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8071
8073 {
8075 }
8076 }
8077
8079 {
8081 }
8082
8084 {
8087 else
8089
8091 {
8094 }
8095 else
8096 {
8099
8102 }
8103
8105 }
8106
8108 {
8110 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8111 }
8112
8114 {
8116 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8118 }
8119
8121 {
8123 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8124 }
8125
8127 {
8130
8131 OverheatingParticle OP = new OverheatingParticle();
8136
8138 }
8139
8141 {
8144
8145 return -1;
8146 }
8147
8149 {
8151 {
8154
8155 for (int i = count; i > 0; --i)
8156 {
8157 int id = i - 1;
8160
8163
8164 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8165 {
8166 if (p)
8167 {
8170 }
8171 }
8172 }
8173 }
8174 }
8175
8177 {
8179 {
8181 {
8182 int id = i - 1;
8184
8185 if (OP)
8186 {
8188
8189 if (p)
8190 {
8192 }
8193
8194 delete OP;
8195 }
8196 }
8197
8200 }
8201 }
8202
8205 {
8206 return 0.0;
8207 }
8208
8209
8211 {
8212 return 250;
8213 }
8214
8216 {
8217 return 0;
8218 }
8219
8222 {
8224 return true;
8225
8226 return false;
8227 }
8228
8231 {
8234
8236 {
8238 }
8239 else
8240 {
8241
8243 }
8244
8246 }
8247
8254 {
8255 return -1;
8256 }
8257
8258
8259
8260
8262 {
8264 {
8266 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8267
8268 if (r_index >= 0)
8269 {
8270 InventoryLocation r_il = new InventoryLocation;
8271 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8272
8273 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8276 {
8277 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8278 }
8280 {
8281 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8282 }
8283
8284 }
8285
8286 player.GetHumanInventory().ClearUserReservedLocation(this);
8287 }
8288
8291 }
8292
8293
8294
8295
8297 {
8298 return ItemBase.m_DebugActionsMask;
8299 }
8300
8302 {
8303 return ItemBase.m_DebugActionsMask & mask;
8304 }
8305
8307 {
8308 ItemBase.m_DebugActionsMask = mask;
8309 }
8310
8312 {
8313 ItemBase.m_DebugActionsMask |= mask;
8314 }
8315
8317 {
8318 ItemBase.m_DebugActionsMask &= ~mask;
8319 }
8320
8322 {
8324 {
8326 }
8327 else
8328 {
8330 }
8331 }
8332
8333
8335 {
8336 if (GetEconomyProfile())
8337 {
8338 float q_max = GetEconomyProfile().GetQuantityMax();
8339 if (q_max > 0)
8340 {
8341 float q_min = GetEconomyProfile().GetQuantityMin();
8342 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8343
8345 {
8346 ComponentEnergyManager comp = GetCompEM();
8348 {
8350 }
8351 }
8353 {
8355
8356 }
8357
8358 }
8359 }
8360 }
8361
8364 {
8365 EntityAI parent = GetHierarchyParent();
8366
8367 if (parent)
8368 {
8369 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8370 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8371 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8372 }
8373 }
8374
8377 {
8378 EntityAI parent = GetHierarchyParent();
8379
8380 if (parent)
8381 {
8382 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8383 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8384 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8385 }
8386 }
8387
8389 {
8390
8391
8392
8393
8395
8397 {
8398 if (ScriptInputUserData.CanStoreInputUserData())
8399 {
8400 ScriptInputUserData ctx = new ScriptInputUserData;
8406 ctx.
Write(use_stack_max);
8409
8411 {
8412 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8413 }
8414 }
8415 }
8416 else if (!
GetGame().IsMultiplayer())
8417 {
8419 }
8420 }
8421
8423 {
8425 }
8426
8428 {
8430 }
8431
8433 {
8435 }
8436
8438 {
8439
8440 return false;
8441 }
8442
8444 {
8445 return false;
8446 }
8447
8451 {
8452 return false;
8453 }
8454
8456 {
8457 return "";
8458 }
8459
8461
8463 {
8464 return false;
8465 }
8466
8468 {
8469 return true;
8470 }
8471
8472
8473
8475 {
8476 return true;
8477 }
8478
8480 {
8481 return true;
8482 }
8483
8485 {
8486 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8488 }
8489
8491 {
8493 }
8494
8496 {
8498 if (!is_being_placed)
8500 SetSynchDirty();
8501 }
8502
8503
8505
8507 {
8509 }
8510
8512 {
8514 }
8515
8517 {
8518 return 1;
8519 }
8520
8522 {
8523 return false;
8524 }
8525
8527 {
8529 SetSynchDirty();
8530 }
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8567 {
8568 super.OnMovedInsideCargo(container);
8569
8570 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8571 }
8572
8573 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8574 {
8575 super.EEItemLocationChanged(oldLoc,newLoc);
8576
8577 PlayerBase new_player = null;
8578 PlayerBase old_player = null;
8579
8580 if (newLoc.GetParent())
8581 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8582
8583 if (oldLoc.GetParent())
8584 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8585
8587 {
8588 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8589
8590 if (r_index >= 0)
8591 {
8592 InventoryLocation r_il = new InventoryLocation;
8593 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8594
8595 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8598 {
8599 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8600 }
8602 {
8603 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8604 }
8605
8606 }
8607 }
8608
8610 {
8611 if (new_player)
8612 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8613
8614 if (new_player == old_player)
8615 {
8616
8617 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8618 {
8620 {
8621 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8622 {
8623 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8624 }
8625 }
8626 else
8627 {
8628 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8629 }
8630 }
8631
8632 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8633 {
8634 int type = oldLoc.GetType();
8636 {
8637 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8638 }
8640 {
8641 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8642 }
8643 }
8644 if (!m_OldLocation)
8645 {
8646 m_OldLocation = new InventoryLocation;
8647 }
8648 m_OldLocation.Copy(oldLoc);
8649 }
8650 else
8651 {
8652 if (m_OldLocation)
8653 {
8654 m_OldLocation.Reset();
8655 }
8656 }
8657
8659 }
8660 else
8661 {
8662 if (new_player)
8663 {
8664 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8665 if (res_index >= 0)
8666 {
8667 InventoryLocation il = new InventoryLocation;
8668 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8670 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8673 {
8674 il.
GetParent().GetOnReleaseLock().Invoke(it);
8675 }
8677 {
8679 }
8680
8681 }
8682 }
8684 {
8685
8687 }
8688
8689 if (m_OldLocation)
8690 {
8691 m_OldLocation.Reset();
8692 }
8693 }
8694 }
8695
8696 override void EOnContact(IEntity other, Contact extra)
8697 {
8699 {
8700 int liquidType = -1;
8702 if (impactSpeed > 0.0)
8703 {
8705 #ifndef SERVER
8707 #else
8709 SetSynchDirty();
8710 #endif
8712 }
8713 }
8714
8715 #ifdef SERVER
8716 if (GetCompEM() && GetCompEM().IsPlugged())
8717 {
8718 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8719 GetCompEM().UnplugThis();
8720 }
8721 #endif
8722 }
8723
8725
8727 {
8729 }
8730
8732 {
8733
8734 }
8735
8737 {
8738 super.OnItemLocationChanged(old_owner, new_owner);
8739
8740 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8741 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8742
8743 if (!relatedPlayer && playerNew)
8744 relatedPlayer = playerNew;
8745
8746 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8747 {
8749 if (actionMgr)
8750 {
8751 ActionBase currentAction = actionMgr.GetRunningAction();
8752 if (currentAction)
8754 }
8755 }
8756
8757 Man ownerPlayerOld = null;
8758 Man ownerPlayerNew = null;
8759
8760 if (old_owner)
8761 {
8762 if (old_owner.
IsMan())
8763 {
8764 ownerPlayerOld = Man.Cast(old_owner);
8765 }
8766 else
8767 {
8768 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8769 }
8770 }
8771 else
8772 {
8774 {
8776
8777 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8778 {
8779 GetCompEM().UnplugThis();
8780 }
8781 }
8782 }
8783
8784 if (new_owner)
8785 {
8786 if (new_owner.
IsMan())
8787 {
8788 ownerPlayerNew = Man.Cast(new_owner);
8789 }
8790 else
8791 {
8792 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8793 }
8794 }
8795
8796 if (ownerPlayerOld != ownerPlayerNew)
8797 {
8798 if (ownerPlayerOld)
8799 {
8800 array<EntityAI> subItemsExit = new array<EntityAI>;
8802 for (int i = 0; i < subItemsExit.Count(); i++)
8803 {
8806 }
8807 }
8808
8809 if (ownerPlayerNew)
8810 {
8811 array<EntityAI> subItemsEnter = new array<EntityAI>;
8813 for (int j = 0; j < subItemsEnter.Count(); j++)
8814 {
8817 }
8818 }
8819 }
8820 else if (ownerPlayerNew != null)
8821 {
8822 PlayerBase nplayer;
8823 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8824 {
8825 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8827 for (int k = 0; k < subItemsUpdate.Count(); k++)
8828 {
8830 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8831 }
8832 }
8833 }
8834
8835 if (old_owner)
8836 old_owner.OnChildItemRemoved(this);
8837 if (new_owner)
8838 new_owner.OnChildItemReceived(this);
8839 }
8840
8841
8843 {
8844 super.EEDelete(parent);
8845 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8846 if (player)
8847 {
8849
8850 if (player.IsAlive())
8851 {
8852 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8853 if (r_index >= 0)
8854 {
8855 InventoryLocation r_il = new InventoryLocation;
8856 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8857
8858 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8861 {
8862 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8863 }
8865 {
8866 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8867 }
8868
8869 }
8870
8871 player.RemoveQuickBarEntityShortcut(this);
8872 }
8873 }
8874 }
8875
8877 {
8878 super.EEKilled(killer);
8879
8882 {
8883 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8884 {
8885 if (IsMagazine())
8886 {
8887 if (Magazine.Cast(this).GetAmmoCount() > 0)
8888 {
8890 }
8891 }
8892 else
8893 {
8895 }
8896 }
8897 }
8898 }
8899
8901 {
8902 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8903
8904 super.OnWasAttached(parent, slot_id);
8905
8908
8910 }
8911
8913 {
8914 super.OnWasDetached(parent, slot_id);
8915
8918 }
8919
8921 {
8922 int idx;
8925
8926 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8927 if (inventory_slots.Count() < 1)
8928 {
8929 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8930 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8931 }
8932 else
8933 {
8934 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8935 }
8936
8937 idx = inventory_slots.Find(slot);
8938 if (idx < 0)
8939 return "";
8940
8941 return attach_types.Get(idx);
8942 }
8943
8945 {
8946 int idx = -1;
8947 string slot;
8948
8951
8952 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8953 if (inventory_slots.Count() < 1)
8954 {
8955 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8956 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8957 }
8958 else
8959 {
8960 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8961 if (detach_types.Count() < 1)
8962 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8963 }
8964
8965 for (int i = 0; i < inventory_slots.Count(); i++)
8966 {
8967 slot = inventory_slots.Get(i);
8968 }
8969
8970 if (slot != "")
8971 {
8972 if (detach_types.Count() == 1)
8973 idx = 0;
8974 else
8975 idx = inventory_slots.Find(slot);
8976 }
8977 if (idx < 0)
8978 return "";
8979
8980 return detach_types.Get(idx);
8981 }
8982
8984 {
8985
8987
8988
8989 float min_time = 1;
8990 float max_time = 3;
8991 float delay = Math.RandomFloat(min_time, max_time);
8992
8993 explode_timer.Run(delay, this, "DoAmmoExplosion");
8994 }
8995
8997 {
8998 Magazine magazine = Magazine.Cast(this);
8999 int pop_sounds_count = 6;
9000 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9001
9002
9003 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9004 string sound_name = pop_sounds[ sound_idx ];
9006
9007
9008 magazine.ServerAddAmmoCount(-1);
9009
9010
9011 float min_temp_to_explode = 100;
9012
9013 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9014 {
9016 }
9017 }
9018
9019
9020 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9021 {
9022 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9023
9024 const int CHANCE_DAMAGE_CARGO = 4;
9025 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9026 const int CHANCE_DAMAGE_NOTHING = 2;
9027
9029 {
9030 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9031 int chances;
9032 int rnd;
9033
9034 if (GetInventory().GetCargo())
9035 {
9036 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9037 rnd = Math.RandomInt(0,chances);
9038
9039 if (rnd < CHANCE_DAMAGE_CARGO)
9040 {
9042 }
9043 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9044 {
9046 }
9047 }
9048 else
9049 {
9050 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9051 rnd = Math.RandomInt(0,chances);
9052
9053 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9054 {
9056 }
9057 }
9058 }
9059 }
9060
9062 {
9063 if (GetInventory().GetCargo())
9064 {
9065 int item_count = GetInventory().GetCargo().GetItemCount();
9066 if (item_count > 0)
9067 {
9068 int random_pick = Math.RandomInt(0, item_count);
9070 if (!item.IsExplosive())
9071 {
9072 item.AddHealth("","",damage);
9073 return true;
9074 }
9075 }
9076 }
9077 return false;
9078 }
9079
9081 {
9082 int attachment_count = GetInventory().AttachmentCount();
9083 if (attachment_count > 0)
9084 {
9085 int random_pick = Math.RandomInt(0, attachment_count);
9086 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9087 if (!attachment.IsExplosive())
9088 {
9089 attachment.AddHealth("","",damage);
9090 return true;
9091 }
9092 }
9093 return false;
9094 }
9095
9097 {
9099 }
9100
9102 {
9104 return GetInventory().CanRemoveEntity();
9105
9106 return false;
9107 }
9108
9110 {
9111
9113 return false;
9114
9115
9117 return false;
9118
9119
9120
9122 if (delta == 0)
9123 return false;
9124
9125
9126 return true;
9127 }
9128
9130 {
9132 {
9133 if (ScriptInputUserData.CanStoreInputUserData())
9134 {
9135 ScriptInputUserData ctx = new ScriptInputUserData;
9140 ctx.
Write(destination_entity);
9144 }
9145 }
9146 else if (!
GetGame().IsMultiplayer())
9147 {
9149 }
9150 }
9151
9153 {
9154 float split_quantity_new;
9158 InventoryLocation loc = new InventoryLocation;
9159
9160 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9161 {
9163 split_quantity_new = stack_max;
9164 else
9166
9168 {
9169 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9170 if (new_item)
9171 {
9172 new_item.SetResultOfSplit(true);
9173 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9175 new_item.
SetQuantity(split_quantity_new,
false,
true);
9176 }
9177 }
9178 }
9179 else if (destination_entity && slot_id == -1)
9180 {
9181 if (quantity > stack_max)
9182 split_quantity_new = stack_max;
9183 else
9184 split_quantity_new = quantity;
9185
9187 {
9189 {
9192 }
9193
9194 if (new_item)
9195 {
9196 new_item.SetResultOfSplit(true);
9197 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9199 new_item.
SetQuantity(split_quantity_new,
false,
true);
9200 }
9201 }
9202 }
9203 else
9204 {
9205 if (stack_max != 0)
9206 {
9208 {
9210 }
9211
9212 if (split_quantity_new == 0)
9213 {
9214 if (!
GetGame().IsMultiplayer())
9215 player.PhysicalPredictiveDropItem(this);
9216 else
9217 player.ServerDropEntity(this);
9218 return;
9219 }
9220
9222 {
9224
9225 if (new_item)
9226 {
9227 new_item.SetResultOfSplit(true);
9228 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9231 new_item.PlaceOnSurface();
9232 }
9233 }
9234 }
9235 }
9236 }
9237
9239 {
9240 float split_quantity_new;
9244 InventoryLocation loc = new InventoryLocation;
9245
9246 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9247 {
9249 split_quantity_new = stack_max;
9250 else
9252
9254 {
9255 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9256 if (new_item)
9257 {
9258 new_item.SetResultOfSplit(true);
9259 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9261 new_item.
SetQuantity(split_quantity_new,
false,
true);
9262 }
9263 }
9264 }
9265 else if (destination_entity && slot_id == -1)
9266 {
9267 if (quantity > stack_max)
9268 split_quantity_new = stack_max;
9269 else
9270 split_quantity_new = quantity;
9271
9273 {
9275 {
9278 }
9279
9280 if (new_item)
9281 {
9282 new_item.SetResultOfSplit(true);
9283 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9285 new_item.
SetQuantity(split_quantity_new,
false,
true);
9286 }
9287 }
9288 }
9289 else
9290 {
9291 if (stack_max != 0)
9292 {
9294 {
9296 }
9297
9299 {
9301
9302 if (new_item)
9303 {
9304 new_item.SetResultOfSplit(true);
9305 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9308 new_item.PlaceOnSurface();
9309 }
9310 }
9311 }
9312 }
9313 }
9314
9316 {
9318 {
9319 if (ScriptInputUserData.CanStoreInputUserData())
9320 {
9321 ScriptInputUserData ctx = new ScriptInputUserData;
9326 dst.WriteToContext(ctx);
9328 }
9329 }
9330 else if (!
GetGame().IsMultiplayer())
9331 {
9333 }
9334 }
9335
9337 {
9339 {
9340 if (ScriptInputUserData.CanStoreInputUserData())
9341 {
9342 ScriptInputUserData ctx = new ScriptInputUserData;
9347 ctx.
Write(destination_entity);
9353 }
9354 }
9355 else if (!
GetGame().IsMultiplayer())
9356 {
9358 }
9359 }
9360
9362 {
9364 }
9365
9367 {
9369 float split_quantity_new;
9371 if (dst.IsValid())
9372 {
9373 int slot_id = dst.GetSlot();
9375
9376 if (quantity > stack_max)
9377 split_quantity_new = stack_max;
9378 else
9379 split_quantity_new = quantity;
9380
9382 {
9384
9385 if (new_item)
9386 {
9387 new_item.SetResultOfSplit(true);
9388 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9390 new_item.
SetQuantity(split_quantity_new,
false,
true);
9391 }
9392
9393 return new_item;
9394 }
9395 }
9396
9397 return null;
9398 }
9399
9401 {
9403 float split_quantity_new;
9405 if (destination_entity)
9406 {
9408 if (quantity > stackable)
9409 split_quantity_new = stackable;
9410 else
9411 split_quantity_new = quantity;
9412
9414 {
9415 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9416 if (new_item)
9417 {
9418 new_item.SetResultOfSplit(true);
9419 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9421 new_item.
SetQuantity(split_quantity_new,
false,
true);
9422 }
9423 }
9424 }
9425 }
9426
9428 {
9430 {
9431 if (ScriptInputUserData.CanStoreInputUserData())
9432 {
9433 ScriptInputUserData ctx = new ScriptInputUserData;
9438 ItemBase destination_entity =
this;
9439 ctx.
Write(destination_entity);
9443 }
9444 }
9445 else if (!
GetGame().IsMultiplayer())
9446 {
9448 }
9449 }
9450
9452 {
9454 float split_quantity_new;
9456 if (player)
9457 {
9459 if (quantity > stackable)
9460 split_quantity_new = stackable;
9461 else
9462 split_quantity_new = quantity;
9463
9465 {
9466 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9467 new_item =
ItemBase.Cast(in_hands);
9468 if (new_item)
9469 {
9470 new_item.SetResultOfSplit(true);
9471 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9473 new_item.SetQuantity(split_quantity_new, false, true);
9474 }
9475 }
9476 }
9477 }
9478
9480 {
9482 float split_quantity_new = Math.Floor(quantity * 0.5);
9483
9485 return;
9486
9488
9489 if (new_item)
9490 {
9491 if (new_item.GetQuantityMax() < split_quantity_new)
9492 {
9493 split_quantity_new = new_item.GetQuantityMax();
9494 }
9495
9496 new_item.SetResultOfSplit(true);
9497 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9498
9500 {
9503 }
9504 else
9505 {
9507 new_item.
SetQuantity(split_quantity_new,
false,
true);
9508 }
9509 }
9510 }
9511
9513 {
9515 float split_quantity_new = Math.Floor(quantity / 2);
9516
9518 return;
9519
9520 InventoryLocation invloc = new InventoryLocation;
9522
9524 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9525
9526 if (new_item)
9527 {
9528 if (new_item.GetQuantityMax() < split_quantity_new)
9529 {
9530 split_quantity_new = new_item.GetQuantityMax();
9531 }
9533 {
9536 }
9537 else if (split_quantity_new > 1)
9538 {
9540 new_item.
SetQuantity(split_quantity_new,
false,
true);
9541 }
9542 }
9543 }
9544
9547 {
9548 SetWeightDirty();
9550
9551 if (parent)
9552 parent.OnAttachmentQuantityChangedEx(this, delta);
9553
9555 {
9557 {
9559 }
9561 {
9562 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9564 }
9565 }
9566
9567 }
9568
9571 {
9572
9573 }
9574
9577 {
9579 }
9580
9582 {
9583 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9584
9586 {
9587 if (newLevel == GameConstants.STATE_RUINED)
9588 {
9590 EntityAI parent = GetHierarchyParent();
9591 if (parent && parent.IsFireplace())
9592 {
9593 CargoBase cargo = GetInventory().GetCargo();
9594 if (cargo)
9595 {
9597 {
9599 }
9600 }
9601 }
9602 }
9603
9605 {
9606
9608 return;
9609 }
9610
9611 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9612 {
9614 }
9615 }
9616 }
9617
9618
9620 {
9621 super.OnRightClick();
9622
9624 {
9626 {
9627 if (ScriptInputUserData.CanStoreInputUserData())
9628 {
9629 EntityAI root = GetHierarchyRoot();
9630 Man playerOwner = GetHierarchyRootPlayer();
9631 InventoryLocation dst = new InventoryLocation;
9632
9633
9634 if (!playerOwner && root && root == this)
9635 {
9637 }
9638 else
9639 {
9640
9641 GetInventory().GetCurrentInventoryLocation(dst);
9643 {
9646 {
9648 }
9649 else
9650 {
9652
9653
9654 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9655 {
9657 }
9658 else
9659 {
9660 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9661 }
9662 }
9663 }
9664 }
9665
9666 ScriptInputUserData ctx = new ScriptInputUserData;
9674 }
9675 }
9676 else if (!
GetGame().IsMultiplayer())
9677 {
9679 }
9680 }
9681 }
9682
9684 {
9685 if (root)
9686 {
9687 vector m4[4];
9688 root.GetTransform(m4);
9689 dst.SetGround(this, m4);
9690 }
9691 else
9692 {
9693 GetInventory().GetCurrentInventoryLocation(dst);
9694 }
9695 }
9696
9697 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9698 {
9699
9700 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9701 return false;
9702
9703 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9704 return false;
9705
9706
9708 return false;
9709
9710
9711 Magazine mag = Magazine.Cast(this);
9712 if (mag)
9713 {
9714 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9715 return false;
9716
9717 if (stack_max_limit)
9718 {
9719 Magazine other_mag = Magazine.Cast(other_item);
9720 if (other_item)
9721 {
9722 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9723 return false;
9724 }
9725
9726 }
9727 }
9728 else
9729 {
9730
9732 return false;
9733
9735 return false;
9736 }
9737
9738 PlayerBase player = null;
9739 if (CastTo(player, GetHierarchyRootPlayer()))
9740 {
9741 if (player.GetInventory().HasAttachment(this))
9742 return false;
9743
9744 if (player.IsItemsToDelete())
9745 return false;
9746 }
9747
9748 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9749 return false;
9750
9751 int slotID;
9753 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9754 return false;
9755
9756 return true;
9757 }
9758
9760 {
9762 }
9763
9765 {
9766 return m_IsResultOfSplit;
9767 }
9768
9770 {
9771 m_IsResultOfSplit = value;
9772 }
9773
9775 {
9777 }
9778
9780 {
9781 float other_item_quantity = other_item.GetQuantity();
9782 float this_free_space;
9783
9785
9787
9788 if (other_item_quantity > this_free_space)
9789 {
9790 return this_free_space;
9791 }
9792 else
9793 {
9794 return other_item_quantity;
9795 }
9796 }
9797
9799 {
9801 }
9802
9804 {
9806 return;
9807
9808 if (!IsMagazine() && other_item)
9809 {
9811 if (quantity_used != 0)
9812 {
9813 float hp1 = GetHealth01("","");
9814 float hp2 = other_item.GetHealth01("","");
9815 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9816 hpResult = hpResult / (
GetQuantity() + quantity_used);
9817
9818 hpResult *= GetMaxHealth();
9819 Math.Round(hpResult);
9820 SetHealth("", "Health", hpResult);
9821
9823 other_item.AddQuantity(-quantity_used);
9824 }
9825 }
9827 }
9828
9830 {
9831 #ifdef SERVER
9832 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9833 GetHierarchyParent().IncreaseLifetimeUp();
9834 #endif
9835 };
9836
9838 {
9839 PlayerBase p = PlayerBase.Cast(player);
9840
9841 array<int> recipesIds = p.m_Recipes;
9842 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9843 if (moduleRecipesManager)
9844 {
9845 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9846 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9847 }
9848
9849 for (int i = 0;i < recipesIds.Count(); i++)
9850 {
9851 int key = recipesIds.Get(i);
9852 string recipeName = moduleRecipesManager.GetRecipeName(key);
9854 }
9855 }
9856
9857
9858 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9859 {
9860 super.GetDebugActions(outputList);
9861
9862
9868
9869
9874
9879
9880
9884
9885
9887 {
9891 }
9892
9895
9896
9900
9902
9903 InventoryLocation loc = new InventoryLocation();
9904 GetInventory().GetCurrentInventoryLocation(loc);
9906 {
9907 if (Gizmo_IsSupported())
9910 }
9911
9913 }
9914
9915
9916
9917
9919 {
9920 super.OnAction(action_id, player, ctx);
9921
9923 {
9924 switch (action_id)
9925 {
9928 return true;
9931 return true;
9932 }
9933 }
9934
9936 {
9937 switch (action_id)
9938 {
9940 Delete();
9941 return true;
9942 }
9943 }
9944
9945 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9946 {
9947 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9948 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9949 PlayerBase p = PlayerBase.Cast(player);
9950 if (
EActions.RECIPES_RANGE_START < 1000)
9951 {
9952 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9953 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9954 }
9955 }
9956 #ifndef SERVER
9957 else if (action_id ==
EActions.WATCH_PLAYER)
9958 {
9959 PluginDeveloper.SetDeveloperItemClientEx(player);
9960 }
9961 #endif
9963 {
9964 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9965 {
9966 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9967 OnDebugButtonPressServer(id + 1);
9968 }
9969
9970 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9971 {
9972 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9974 }
9975
9976 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9977 {
9978 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9980 }
9981
9982 else if (action_id ==
EActions.ADD_QUANTITY)
9983 {
9984 if (IsMagazine())
9985 {
9986 Magazine mag = Magazine.Cast(this);
9987 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9988 }
9989 else
9990 {
9992 }
9993
9994 if (m_EM)
9995 {
9996 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9997 }
9998
9999 }
10000
10001 else if (action_id ==
EActions.REMOVE_QUANTITY)
10002 {
10003 if (IsMagazine())
10004 {
10005 Magazine mag2 = Magazine.Cast(this);
10006 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10007 }
10008 else
10009 {
10011 }
10012 if (m_EM)
10013 {
10014 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10015 }
10016
10017 }
10018
10019 else if (action_id ==
EActions.SET_QUANTITY_0)
10020 {
10022
10023 if (m_EM)
10024 {
10025 m_EM.SetEnergy(0);
10026 }
10027 }
10028
10029 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10030 {
10032
10033 if (m_EM)
10034 {
10035 m_EM.SetEnergy(m_EM.GetEnergyMax());
10036 }
10037 }
10038
10039 else if (action_id ==
EActions.ADD_HEALTH)
10040 {
10041 AddHealth("","",GetMaxHealth("","Health")/5);
10042 }
10043 else if (action_id ==
EActions.REMOVE_HEALTH)
10044 {
10045 AddHealth("","",-GetMaxHealth("","Health")/5);
10046 }
10047 else if (action_id ==
EActions.DESTROY_HEALTH)
10048 {
10049 SetHealth01("","",0);
10050 }
10051 else if (action_id ==
EActions.WATCH_ITEM)
10052 {
10054 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10055 #ifdef DEVELOPER
10056 SetDebugDeveloper_item(this);
10057 #endif
10058 }
10059
10060 else if (action_id ==
EActions.ADD_TEMPERATURE)
10061 {
10062 AddTemperature(20);
10063
10064 }
10065
10066 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10067 {
10068 AddTemperature(-20);
10069
10070 }
10071
10072 else if (action_id ==
EActions.FLIP_FROZEN)
10073 {
10074 SetFrozen(!GetIsFrozen());
10075
10076 }
10077
10078 else if (action_id ==
EActions.ADD_WETNESS)
10079 {
10081
10082 }
10083
10084 else if (action_id ==
EActions.REMOVE_WETNESS)
10085 {
10087
10088 }
10089
10090 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10091 {
10094
10095
10096 }
10097
10098 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10099 {
10102 }
10103
10104 else if (action_id ==
EActions.MAKE_SPECIAL)
10105 {
10106 auto debugParams = DebugSpawnParams.WithPlayer(player);
10107 OnDebugSpawnEx(debugParams);
10108 }
10109
10110 }
10111
10112
10113 return false;
10114 }
10115
10116
10117
10118
10122
10125
10126
10127
10129 {
10130 return false;
10131 }
10132
10133
10135 {
10136 return true;
10137 }
10138
10139
10141 {
10142 return true;
10143 }
10144
10145
10146
10148 {
10149 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10151 }
10152
10155 {
10156 return null;
10157 }
10158
10160 {
10161 return false;
10162 }
10163
10165 {
10166 return false;
10167 }
10168
10172
10173
10175 {
10176 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10177 return module_repairing.CanRepair(this, item_repair_kit);
10178 }
10179
10180
10181 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10182 {
10183 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10184 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10185 }
10186
10187
10189 {
10190
10191
10192
10193
10194
10195
10196
10197
10198 return 1;
10199 }
10200
10201
10202
10204 {
10206 }
10207
10208
10209
10211 {
10213 }
10214
10215
10224 {
10225 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10226
10227 if (player)
10228 {
10229 player.MessageStatus(text);
10230 }
10231 }
10232
10233
10242 {
10243 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10244
10245 if (player)
10246 {
10247 player.MessageAction(text);
10248 }
10249 }
10250
10251
10260 {
10261 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10262
10263 if (player)
10264 {
10265 player.MessageFriendly(text);
10266 }
10267 }
10268
10269
10278 {
10279 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10280
10281 if (player)
10282 {
10283 player.MessageImportant(text);
10284 }
10285 }
10286
10288 {
10289 return true;
10290 }
10291
10292
10293 override bool KindOf(
string tag)
10294 {
10295 bool found = false;
10296 string item_name = this.
GetType();
10299
10300 int array_size = item_tag_array.Count();
10301 for (int i = 0; i < array_size; i++)
10302 {
10303 if (item_tag_array.Get(i) == tag)
10304 {
10305 found = true;
10306 break;
10307 }
10308 }
10309 return found;
10310 }
10311
10312
10314 {
10315
10316 super.OnRPC(sender, rpc_type,ctx);
10317
10318
10319 switch (rpc_type)
10320 {
10321 #ifndef SERVER
10322 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10323 Param2<bool, string> p = new Param2<bool, string>(false, "");
10324
10326 return;
10327
10328 bool play = p.param1;
10329 string soundSet = p.param2;
10330
10331 if (play)
10332 {
10334 {
10336 {
10338 }
10339 }
10340 else
10341 {
10343 }
10344 }
10345 else
10346 {
10348 }
10349
10350 break;
10351 #endif
10352
10353 }
10354
10356 {
10358 }
10359 }
10360
10361
10362
10363
10365 {
10366 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10367 return plugin.GetID(
name);
10368 }
10369
10371 {
10372 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10373 return plugin.GetName(id);
10374 }
10375
10378 {
10379
10380
10381 int varFlags;
10382 if (!ctx.
Read(varFlags))
10383 return;
10384
10385 if (varFlags & ItemVariableFlags.FLOAT)
10386 {
10388 }
10389 }
10390
10392 {
10393
10394 super.SerializeNumericalVars(floats_out);
10395
10396
10397
10399 {
10401 }
10402
10404 {
10406 }
10407
10409 {
10411 }
10412
10414 {
10419 }
10420
10422 {
10424 }
10425 }
10426
10428 {
10429
10430 super.DeSerializeNumericalVars(floats);
10431
10432
10433 int index = 0;
10434 int mask = Math.Round(floats.Get(index));
10435
10436 index++;
10437
10439 {
10441 {
10443 }
10444 else
10445 {
10446 float quantity = floats.Get(index);
10447 SetQuantity(quantity,
true,
false,
false,
false);
10448 }
10449 index++;
10450 }
10451
10453 {
10454 float wet = floats.Get(index);
10456 index++;
10457 }
10458
10460 {
10461 int liquidtype = Math.Round(floats.Get(index));
10463 index++;
10464 }
10465
10467 {
10469 index++;
10471 index++;
10473 index++;
10475 index++;
10476 }
10477
10479 {
10480 int cleanness = Math.Round(floats.Get(index));
10482 index++;
10483 }
10484 }
10485
10487 {
10488 super.WriteVarsToCTX(ctx);
10489
10490
10492 {
10494 }
10495
10497 {
10499 }
10500
10502 {
10504 }
10505
10507 {
10508 int r,g,b,a;
10514 }
10515
10517 {
10519 }
10520 }
10521
10523 {
10524 if (!super.ReadVarsFromCTX(ctx,version))
10525 return false;
10526
10527 int intValue;
10528 float value;
10529
10530 if (version < 140)
10531 {
10532 if (!ctx.
Read(intValue))
10533 return false;
10534
10535 m_VariablesMask = intValue;
10536 }
10537
10539 {
10540 if (!ctx.
Read(value))
10541 return false;
10542
10544 {
10546 }
10547 else
10548 {
10550 }
10551 }
10552
10553 if (version < 140)
10554 {
10556 {
10557 if (!ctx.
Read(value))
10558 return false;
10559 SetTemperatureDirect(value);
10560 }
10561 }
10562
10564 {
10565 if (!ctx.
Read(value))
10566 return false;
10568 }
10569
10571 {
10572 if (!ctx.
Read(intValue))
10573 return false;
10575 }
10576
10578 {
10579 int r,g,b,a;
10581 return false;
10583 return false;
10585 return false;
10587 return false;
10588
10590 }
10591
10593 {
10594 if (!ctx.
Read(intValue))
10595 return false;
10597 }
10598
10599 if (version >= 138 && version < 140)
10600 {
10602 {
10603 if (!ctx.
Read(intValue))
10604 return false;
10605 SetFrozen(intValue);
10606 }
10607 }
10608
10609 return true;
10610 }
10611
10612
10614 {
10617 {
10619 }
10620
10621 if (!super.OnStoreLoad(ctx, version))
10622 {
10624 return false;
10625 }
10626
10627 if (version >= 114)
10628 {
10629 bool hasQuickBarIndexSaved;
10630
10631 if (!ctx.
Read(hasQuickBarIndexSaved))
10632 {
10634 return false;
10635 }
10636
10637 if (hasQuickBarIndexSaved)
10638 {
10639 int itmQBIndex;
10640
10641
10642 if (!ctx.
Read(itmQBIndex))
10643 {
10645 return false;
10646 }
10647
10648 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10649 if (itmQBIndex != -1 && parentPlayer)
10650 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10651 }
10652 }
10653 else
10654 {
10655
10656 PlayerBase player;
10657 int itemQBIndex;
10658 if (version ==
int.
MAX)
10659 {
10660 if (!ctx.
Read(itemQBIndex))
10661 {
10663 return false;
10664 }
10665 }
10666 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10667 {
10668
10669 if (!ctx.
Read(itemQBIndex))
10670 {
10672 return false;
10673 }
10674 if (itemQBIndex != -1 && player)
10675 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10676 }
10677 }
10678
10679 if (version < 140)
10680 {
10681
10682 if (!LoadVariables(ctx, version))
10683 {
10685 return false;
10686 }
10687 }
10688
10689
10691 {
10693 return false;
10694 }
10695 if (version >= 132)
10696 {
10698 if (raib)
10699 {
10701 {
10703 return false;
10704 }
10705 }
10706 }
10707
10709 return true;
10710 }
10711
10712
10713
10715 {
10716 super.OnStoreSave(ctx);
10717
10718 PlayerBase player;
10719 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10720 {
10722
10723 int itemQBIndex = -1;
10724 itemQBIndex = player.FindQuickBarEntityIndex(this);
10725 ctx.
Write(itemQBIndex);
10726 }
10727 else
10728 {
10730 }
10731
10733
10735 if (raib)
10736 {
10738 }
10739 }
10740
10741
10743 {
10744 super.AfterStoreLoad();
10745
10747 {
10749 }
10750
10752 {
10755 }
10756 }
10757
10759 {
10760 super.EEOnAfterLoad();
10761
10763 {
10765 }
10766
10769 }
10770
10772 {
10773 return false;
10774 }
10775
10776
10777
10779 {
10781 {
10782 #ifdef PLATFORM_CONSOLE
10783
10785 {
10787 if (menu)
10788 {
10790 }
10791 }
10792 #endif
10793 }
10794
10796 {
10799 }
10800
10802 {
10803 SetWeightDirty();
10805 }
10807 {
10810 }
10811
10813 {
10816 }
10818 {
10821 }
10822
10823 super.OnVariablesSynchronized();
10824 }
10825
10826
10827
10829 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10830 {
10831 if (!IsServerCheck(allow_client))
10832 return false;
10833
10835 return false;
10836
10839
10840 if (value <= (min + 0.001))
10841 value = min;
10842
10843 if (value == min)
10844 {
10845 if (destroy_config)
10846 {
10847 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10848 if (dstr)
10849 {
10851 this.Delete();
10852 return true;
10853 }
10854 }
10855 else if (destroy_forced)
10856 {
10858 this.Delete();
10859 return true;
10860 }
10861
10863 }
10864
10867
10869 {
10871
10872 if (delta)
10874 }
10875
10877
10878 return false;
10879 }
10880
10881
10883 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10884 {
10886 }
10887
10889 {
10892 }
10893
10895 {
10898 }
10899
10901 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10902 {
10903 float value_clamped = Math.Clamp(value, 0, 1);
10905 SetQuantity(result, destroy_config, destroy_forced);
10906 }
10907
10908
10911 {
10913 }
10914
10916 {
10918 }
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10930 {
10931 int slot = -1;
10932 if (GetInventory())
10933 {
10934 InventoryLocation il = new InventoryLocation;
10935 GetInventory().GetCurrentInventoryLocation(il);
10937 }
10938
10940 }
10941
10943 {
10944 float quantity_max = 0;
10945
10947 {
10948 if (attSlotID != -1)
10949 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10950
10951 if (quantity_max <= 0)
10953 }
10954
10955 if (quantity_max <= 0)
10957
10958 return quantity_max;
10959 }
10960
10962 {
10964 }
10965
10967 {
10969 }
10970
10971
10973 {
10975 }
10976
10978 {
10980 }
10981
10983 {
10985 }
10986
10987
10989 {
10990
10991 float weightEx = GetWeightEx();
10992 float special = GetInventoryAndCargoWeight();
10993 return weightEx - special;
10994 }
10995
10996
10998 {
11000 }
11001
11003 {
11005 {
11006 #ifdef DEVELOPER
11007 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11008 {
11009 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11011 }
11012 #endif
11013
11014 return GetQuantity() * GetConfigWeightModified();
11015 }
11016 else if (HasEnergyManager())
11017 {
11018 #ifdef DEVELOPER
11019 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11020 {
11021 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11022 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11023 }
11024 #endif
11025 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11026 }
11027 else
11028 {
11029 #ifdef DEVELOPER
11030 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11031 {
11032 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11033 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11034 }
11035 #endif
11036 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11037 }
11038 }
11039
11042 {
11043 int item_count = 0;
11045
11046 if (GetInventory().GetCargo() != NULL)
11047 {
11048 item_count = GetInventory().GetCargo().GetItemCount();
11049 }
11050
11051 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11052 {
11053 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11054 if (item)
11055 item_count += item.GetNumberOfItems();
11056 }
11057 return item_count;
11058 }
11059
11062 {
11063 float weight = 0;
11064 float wetness = 1;
11065 if (include_wetness)
11068 {
11069 weight = wetness * m_ConfigWeight;
11070 }
11072 {
11073 weight = 1;
11074 }
11075 return weight;
11076 }
11077
11078
11079
11081 {
11082 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11083 {
11084 GameInventory inv = GetInventory();
11085 array<EntityAI> items = new array<EntityAI>;
11087 for (int i = 0; i < items.Count(); i++)
11088 {
11090 if (item)
11091 {
11093 }
11094 }
11095 }
11096 }
11097
11098
11099
11100
11102 {
11103 float energy = 0;
11104 if (HasEnergyManager())
11105 {
11106 energy = GetCompEM().GetEnergy();
11107 }
11108 return energy;
11109 }
11110
11111
11113 {
11114 super.OnEnergyConsumed();
11115
11117 }
11118
11120 {
11121 super.OnEnergyAdded();
11122
11124 }
11125
11126
11128 {
11129 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11130 {
11132 {
11133 float energy_0to1 = GetCompEM().GetEnergy0To1();
11135 }
11136 }
11137 }
11138
11139
11141 {
11142 return ConfigGetFloat("heatIsolation");
11143 }
11144
11146 {
11148 }
11149
11151 {
11152 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11153 if (
GetGame().ConfigIsExisting(paramPath))
11155
11156 return 0.0;
11157 }
11158
11160 {
11161 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11162 if (
GetGame().ConfigIsExisting(paramPath))
11164
11165 return 0.0;
11166 }
11167
11168 override void SetWet(
float value,
bool allow_client =
false)
11169 {
11170 if (!IsServerCheck(allow_client))
11171 return;
11172
11175
11177
11178 m_VarWet = Math.Clamp(value, min, max);
11179
11181 {
11184 }
11185 }
11186
11187 override void AddWet(
float value)
11188 {
11190 }
11191
11193 {
11195 }
11196
11198 {
11200 }
11201
11203 {
11205 }
11206
11208 {
11210 }
11211
11213 {
11215 }
11216
11217 override void OnWetChanged(
float newVal,
float oldVal)
11218 {
11221 if (newLevel != oldLevel)
11222 {
11224 }
11225 }
11226
11228 {
11229 SetWeightDirty();
11230 }
11231
11233 {
11234 return GetWetLevelInternal(
m_VarWet);
11235 }
11236
11237
11238
11240 {
11242 }
11243
11245 {
11247 }
11248
11250 {
11252 }
11253
11255 {
11257 }
11258
11259
11260
11262 {
11263 if (ConfigIsExisting("itemModelLength"))
11264 {
11265 return ConfigGetFloat("itemModelLength");
11266 }
11267 return 0;
11268 }
11269
11271 {
11272 if (ConfigIsExisting("itemAttachOffset"))
11273 {
11274 return ConfigGetFloat("itemAttachOffset");
11275 }
11276 return 0;
11277 }
11278
11279 override void SetCleanness(
int value,
bool allow_client =
false)
11280 {
11281 if (!IsServerCheck(allow_client))
11282 return;
11283
11285
11287
11290 }
11291
11293 {
11295 }
11296
11298 {
11299 return true;
11300 }
11301
11302
11303
11304
11306 {
11308 }
11309
11311 {
11313 }
11314
11315
11316
11317
11318 override void SetColor(
int r,
int g,
int b,
int a)
11319 {
11325 }
11327 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11328 {
11333 }
11334
11336 {
11338 }
11339
11342 {
11343 int r,g,b,a;
11345 r = r/255;
11346 g = g/255;
11347 b = b/255;
11348 a = a/255;
11349 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11350 }
11351
11352
11353
11354 override void SetLiquidType(
int value,
bool allow_client =
false)
11355 {
11356 if (!IsServerCheck(allow_client))
11357 return;
11358
11363 }
11364
11366 {
11367 return ConfigGetInt("varLiquidTypeInit");
11368 }
11369
11371 {
11373 }
11374
11376 {
11378 SetFrozen(false);
11379 }
11380
11383 {
11384 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11385 }
11386
11387
11390 {
11391 PlayerBase nplayer;
11392 if (PlayerBase.CastTo(nplayer, player))
11393 {
11395
11396 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11397 }
11398 }
11399
11400
11403 {
11404 PlayerBase nplayer;
11405 if (PlayerBase.CastTo(nplayer,player))
11406 {
11407
11408 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11409
11410 }
11411
11412
11413 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11414
11415
11416 if (HasEnergyManager())
11417 {
11418 GetCompEM().UpdatePlugState();
11419 }
11420 }
11421
11422
11424 {
11425 super.OnPlacementStarted(player);
11426
11428 }
11429
11430 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11431 {
11433 {
11434 m_AdminLog.OnPlacementComplete(player,
this);
11435 }
11436
11437 super.OnPlacementComplete(player, position, orientation);
11438 }
11439
11440
11441
11442
11443
11445 {
11447 {
11448 return true;
11449 }
11450 else
11451 {
11452 return false;
11453 }
11454 }
11455
11456
11458 {
11460 {
11462 }
11463 }
11464
11465
11467 {
11469 }
11470
11472 {
11474 }
11475
11476 override void InsertAgent(
int agent,
float count = 1)
11477 {
11478 if (count < 1)
11479 return;
11480
11482 }
11483
11486 {
11488 }
11489
11490
11492 {
11494 }
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11538 {
11540 return false;
11541 return true;
11542 }
11543
11545 {
11546
11548 }
11549
11550
11553 {
11554 super.CheckForRoofLimited(timeTresholdMS);
11555
11557 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11558 {
11559 m_PreviousRoofTestTime = time;
11560 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11561 }
11562 }
11563
11564
11566 {
11568 {
11569 return 0;
11570 }
11571
11572 if (GetInventory().GetAttachmentSlotsCount() != 0)
11573 {
11574 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11575 if (filter)
11576 return filter.GetProtectionLevel(type, false, system);
11577 else
11578 return 0;
11579 }
11580
11581 string subclassPath, entryName;
11582
11583 switch (type)
11584 {
11586 entryName = "biological";
11587 break;
11589 entryName = "chemical";
11590 break;
11591 default:
11592 entryName = "biological";
11593 break;
11594 }
11595
11596 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11597
11599 }
11600
11601
11602
11605 {
11606 if (!IsMagazine())
11608
11610 }
11611
11612
11613
11614
11615
11620 {
11621 return true;
11622 }
11623
11625 {
11627 }
11628
11629
11630
11631
11632
11634 {
11635 if (parent)
11636 {
11637 if (parent.IsInherited(DayZInfected))
11638 return true;
11639
11640 if (!parent.IsRuined())
11641 return true;
11642 }
11643
11644 return true;
11645 }
11646
11648 {
11649 if (!super.CanPutAsAttachment(parent))
11650 {
11651 return false;
11652 }
11653
11654 if (!IsRuined() && !parent.IsRuined())
11655 {
11656 return true;
11657 }
11658
11659 return false;
11660 }
11661
11663 {
11664
11665
11666
11667
11668 return super.CanReceiveItemIntoCargo(item);
11669 }
11670
11672 {
11673
11674
11675
11676
11677 GameInventory attachmentInv = attachment.GetInventory();
11679 {
11680 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11681 return false;
11682 }
11683
11684 InventoryLocation loc = new InventoryLocation();
11685 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11686 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11687 return false;
11688
11689 return super.CanReceiveAttachment(attachment, slotId);
11690 }
11691
11693 {
11694 if (!super.CanReleaseAttachment(attachment))
11695 return false;
11696
11697 return GetInventory().AreChildrenAccessible();
11698 }
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11721 {
11722 int id = muzzle_owner.GetMuzzleID();
11723 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11724
11725 if (WPOF_array)
11726 {
11727 for (int i = 0; i < WPOF_array.Count(); i++)
11728 {
11729 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11730
11731 if (WPOF)
11732 {
11733 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11734 }
11735 }
11736 }
11737 }
11738
11739
11741 {
11742 int id = muzzle_owner.GetMuzzleID();
11744
11745 if (WPOBE_array)
11746 {
11747 for (int i = 0; i < WPOBE_array.Count(); i++)
11748 {
11749 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11750
11751 if (WPOBE)
11752 {
11753 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11754 }
11755 }
11756 }
11757 }
11758
11759
11761 {
11762 int id = muzzle_owner.GetMuzzleID();
11763 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11764
11765 if (WPOOH_array)
11766 {
11767 for (int i = 0; i < WPOOH_array.Count(); i++)
11768 {
11769 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11770
11771 if (WPOOH)
11772 {
11773 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11774 }
11775 }
11776 }
11777 }
11778
11779
11781 {
11782 int id = muzzle_owner.GetMuzzleID();
11783 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11784
11785 if (WPOOH_array)
11786 {
11787 for (int i = 0; i < WPOOH_array.Count(); i++)
11788 {
11789 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11790
11791 if (WPOOH)
11792 {
11793 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11794 }
11795 }
11796 }
11797 }
11798
11799
11801 {
11802 int id = muzzle_owner.GetMuzzleID();
11803 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11804
11805 if (WPOOH_array)
11806 {
11807 for (int i = 0; i < WPOOH_array.Count(); i++)
11808 {
11809 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11810
11811 if (WPOOH)
11812 {
11813 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11814 }
11815 }
11816 }
11817 }
11818
11819
11820
11822 {
11824 {
11825 return true;
11826 }
11827
11828 return false;
11829 }
11830
11832 {
11834 {
11835 return true;
11836 }
11837
11838 return false;
11839 }
11840
11842 {
11844 {
11845 return true;
11846 }
11847
11848 return false;
11849 }
11850
11852 {
11853 return false;
11854 }
11855
11858 {
11859 return UATimeSpent.DEFAULT_DEPLOY;
11860 }
11861
11862
11863
11864
11866 {
11868 SetSynchDirty();
11869 }
11870
11872 {
11874 }
11875
11876
11878 {
11879 return false;
11880 }
11881
11884 {
11885 string att_type = "None";
11886
11887 if (ConfigIsExisting("soundAttType"))
11888 {
11889 att_type = ConfigGetString("soundAttType");
11890 }
11891
11893 }
11894
11896 {
11898 }
11899
11900
11901
11902
11903
11909
11911 {
11914
11916 }
11917
11918
11920 {
11922 return;
11923
11925
11928
11931
11932 SoundParameters params = new SoundParameters();
11936 }
11937
11938
11940 {
11942 return;
11943
11945 SetSynchDirty();
11946
11949 }
11950
11951
11953 {
11955 return;
11956
11958 SetSynchDirty();
11959
11962 }
11963
11965 {
11967 }
11968
11970 {
11972 }
11973
11976 {
11977 if (!
GetGame().IsDedicatedServer())
11978 {
11979 if (ConfigIsExisting("attachSoundSet"))
11980 {
11981 string cfg_path = "";
11982 string soundset = "";
11983 string type_name =
GetType();
11984
11987 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11988 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11989
11990 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11991 {
11992 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11993 {
11994 if (cfg_slot_array[i] == slot_type)
11995 {
11996 soundset = cfg_soundset_array[i];
11997 break;
11998 }
11999 }
12000 }
12001
12002 if (soundset != "")
12003 {
12004 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12006 }
12007 }
12008 }
12009 }
12010
12012 {
12013
12014 }
12015
12016 void OnApply(PlayerBase player);
12017
12019 {
12020 return 1.0;
12021 };
12022
12024 {
12026 }
12027
12029 {
12031 }
12032
12034
12036 {
12037 SetDynamicPhysicsLifeTime(0.01);
12039 }
12040
12042 {
12043 array<string> zone_names = new array<string>;
12044 GetDamageZones(zone_names);
12045 for (int i = 0; i < zone_names.Count(); i++)
12046 {
12047 SetHealthMax(zone_names.Get(i),"Health");
12048 }
12049 SetHealthMax("","Health");
12050 }
12051
12054 {
12055 float global_health = GetHealth01("","Health");
12056 array<string> zones = new array<string>;
12057 GetDamageZones(zones);
12058
12059 for (int i = 0; i < zones.Count(); i++)
12060 {
12061 SetHealth01(zones.Get(i),"Health",global_health);
12062 }
12063 }
12064
12067 {
12068 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12069 }
12070
12072 {
12073 if (!hasRootAsPlayer)
12074 {
12075 if (refParentIB)
12076 {
12077
12078 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12079 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12080
12081 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12082 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12083
12086 }
12087 else
12088 {
12089
12092 }
12093 }
12094 }
12095
12097 {
12099 {
12100 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12101 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12102 {
12103 float heatPermCoef = 1.0;
12105 while (ent)
12106 {
12107 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12108 ent = ent.GetHierarchyParent();
12109 }
12110
12111 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12112 }
12113 }
12114 }
12115
12117 {
12118
12119 EntityAI parent = GetHierarchyParent();
12120 if (!parent)
12121 {
12122 hasParent = false;
12123 hasRootAsPlayer = false;
12124 }
12125 else
12126 {
12127 hasParent = true;
12128 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12129 refParentIB =
ItemBase.Cast(parent);
12130 }
12131 }
12132
12133 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12134 {
12135
12136 }
12137
12139 {
12140
12141 return false;
12142 }
12143
12145 {
12146
12147
12148 return false;
12149 }
12150
12152 {
12153
12154 return false;
12155 }
12156
12159 {
12160 return !GetIsFrozen() &&
IsOpen();
12161 }
12162
12164 {
12165 bool hasParent = false, hasRootAsPlayer = false;
12167
12168 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12169 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12170
12171 if (wwtu || foodDecay)
12172 {
12176
12177 if (processWetness || processTemperature || processDecay)
12178 {
12180
12181 if (processWetness)
12182 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12183
12184 if (processTemperature)
12186
12187 if (processDecay)
12188 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12189 }
12190 }
12191 }
12192
12195 {
12197 }
12198
12200 {
12203
12204 return super.GetTemperatureFreezeThreshold();
12205 }
12206
12208 {
12211
12212 return super.GetTemperatureThawThreshold();
12213 }
12214
12216 {
12219
12220 return super.GetItemOverheatThreshold();
12221 }
12222
12224 {
12226 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12227
12228 return super.GetTemperatureFreezeTime();
12229 }
12230
12232 {
12234 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12235
12236 return super.GetTemperatureThawTime();
12237 }
12238
12243
12245 {
12246 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12247 }
12248
12250 {
12251 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12252 }
12253
12256 {
12258 }
12259
12261 {
12263 }
12264
12266 {
12268 }
12269
12272 {
12273 return null;
12274 }
12275
12278 {
12279 return false;
12280 }
12281
12283 {
12285 {
12288 if (!trg)
12289 {
12291 explosive = this;
12292 }
12293
12294 explosive.PairRemote(trg);
12296
12297 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12298 trg.SetPersistentPairID(persistentID);
12299 explosive.SetPersistentPairID(persistentID);
12300
12301 return true;
12302 }
12303 return false;
12304 }
12305
12308 {
12309 float ret = 1.0;
12312 ret *= GetHealth01();
12313
12314 return ret;
12315 }
12316
12317 #ifdef DEVELOPER
12318 override void SetDebugItem()
12319 {
12320 super.SetDebugItem();
12321 _itemBase = this;
12322 }
12323
12325 {
12326 string text = super.GetDebugText();
12327
12329 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12330
12331 return text;
12332 }
12333 #endif
12334
12336 {
12337 return true;
12338 }
12339
12341
12343
12345 {
12348 }
12349
12350
12358
12374}
12375
12377{
12379 if (entity)
12380 {
12381 bool is_item = entity.IsInherited(
ItemBase);
12382 if (is_item && full_quantity)
12383 {
12386 }
12387 }
12388 else
12389 {
12391 return NULL;
12392 }
12393 return entity;
12394}
12395
12397{
12398 if (item)
12399 {
12400 if (health > 0)
12401 item.SetHealth("", "", health);
12402
12403 if (item.CanHaveTemperature())
12404 {
12406 if (item.CanFreeze())
12407 item.SetFrozen(false);
12408 }
12409
12410 if (item.HasEnergyManager())
12411 {
12412 if (quantity >= 0)
12413 {
12414 item.GetCompEM().SetEnergy0To1(quantity);
12415 }
12416 else
12417 {
12419 }
12420 }
12421 else if (item.IsMagazine())
12422 {
12423 Magazine mag = Magazine.Cast(item);
12424 if (quantity >= 0)
12425 {
12426 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12427 }
12428 else
12429 {
12431 }
12432
12433 }
12434 else
12435 {
12436 if (quantity >= 0)
12437 {
12438 item.SetQuantityNormalized(quantity, false);
12439 }
12440 else
12441 {
12443 }
12444
12445 }
12446 }
12447}
12448
12449#ifdef DEVELOPER
12451#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.