7497{
7499 {
7500 return true;
7501 }
7502};
7503
7504
7505
7507{
7511
7513
7516
7517
7518
7519
7520
7529
7535
7540
7545
7566 protected bool m_IsResultOfSplit
7567
7569
7574
7575
7576
7578
7582
7583
7584
7586
7589
7590
7591
7597
7598
7606
7609
7610
7612
7613
7615
7616
7621
7622
7627
7628
7630
7631
7633 {
7638
7639 if (!
GetGame().IsDedicatedServer())
7640 {
7642 {
7644
7646 {
7648 }
7649 }
7650
7653 }
7654
7655 m_OldLocation = null;
7656
7658 {
7660 }
7661
7662 if (ConfigIsExisting("headSelectionsToHide"))
7663 {
7666 }
7667
7669 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7670 {
7672 }
7673
7675
7676 m_IsResultOfSplit = false;
7677
7679 }
7680
7682 {
7683 super.InitItemVariables();
7684
7690 m_Count = ConfigGetInt(
"count");
7691
7694
7699
7702
7707
7719
7723
7724
7727 if (ConfigIsExisting("canBeSplit"))
7728 {
7731 }
7732
7734 if (ConfigIsExisting("itemBehaviour"))
7736
7737
7740 RegisterNetSyncVariableInt("m_VarLiquidType");
7741 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7742
7743 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7744 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7745 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7746
7747 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7748 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7749 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7750 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7751
7752 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7753 RegisterNetSyncVariableBool("m_IsTakeable");
7754 RegisterNetSyncVariableBool("m_IsHologram");
7755
7758 {
7761 }
7762
7764
7766 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7768
7769 }
7770
7772 {
7774 }
7775
7777 {
7780 {
7785 }
7786 }
7787
7788 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7789 {
7791 {
7794 }
7795
7797 }
7798
7800 {
7806 }
7807
7809
7811 {
7813
7814 if (!action)
7815 {
7816 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7817 return;
7818 }
7819
7821 if (!ai)
7822 {
7824 return;
7825 }
7826
7828 if (!action_array)
7829 {
7830 action_array = new array<ActionBase_Basic>;
7832 }
7833 if (LogManager.IsActionLogEnable())
7834 {
7835 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7836 }
7837
7838 if (action_array.Find(action) != -1)
7839 {
7840 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7841 }
7842 else
7843 {
7844 action_array.Insert(action);
7845 }
7846 }
7847
7849 {
7851 ActionBase action = player.GetActionManager().GetAction(actionName);
7854
7855 if (action_array)
7856 {
7857 action_array.RemoveItem(action);
7858 }
7859 }
7860
7861
7862
7864 {
7865 ActionOverrideData overrideData = new ActionOverrideData();
7869
7871 if (!actionMap)
7872 {
7875 }
7876
7877 actionMap.Insert(this.
Type(), overrideData);
7878
7879 }
7880
7882
7884
7885
7887 {
7890
7893
7894 string config_to_search = "CfgVehicles";
7895 string muzzle_owner_config;
7896
7898 {
7899 if (IsInherited(Weapon))
7900 config_to_search = "CfgWeapons";
7901
7902 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7903
7904 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7905
7907
7908 if (config_OnFire_subclass_count > 0)
7909 {
7910 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7911
7912 for (int i = 0; i < config_OnFire_subclass_count; i++)
7913 {
7914 string particle_class = "";
7916 string config_OnFire_entry = config_OnFire_class + particle_class;
7917 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7918 WPOF_array.Insert(WPOF);
7919 }
7920
7921
7923 }
7924 }
7925
7927 {
7928 config_to_search = "CfgWeapons";
7929 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7930
7931 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7932
7934
7935 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7936 {
7937 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7938
7939 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7940 {
7941 string particle_class2 = "";
7943 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7944 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7945 WPOBE_array.Insert(WPOBE);
7946 }
7947
7948
7950 }
7951 }
7952 }
7953
7954
7956 {
7959
7961 {
7962 string config_to_search = "CfgVehicles";
7963
7964 if (IsInherited(Weapon))
7965 config_to_search = "CfgWeapons";
7966
7967 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7968 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7969
7970 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7971 {
7972
7974
7976 {
7978 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7980 return;
7981 }
7982
7985
7986
7987
7989 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7990
7991 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7992 {
7993 string particle_class = "";
7995 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7997
7998 if (entry_type == CT_CLASS)
7999 {
8000 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8001 WPOOH_array.Insert(WPOF);
8002 }
8003 }
8004
8005
8007 }
8008 }
8009 }
8010
8012 {
8014 }
8015
8017 {
8019 {
8021
8024
8027
8028 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8029 }
8030 }
8031
8033 {
8035 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8036
8038 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8039
8041 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8042
8044 {
8046 }
8047 }
8048
8050 {
8052 }
8053
8055 {
8058 else
8060
8062 {
8065 }
8066 else
8067 {
8070
8073 }
8074
8076 }
8077
8079 {
8081 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8082 }
8083
8085 {
8087 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8089 }
8090
8092 {
8094 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8095 }
8096
8098 {
8101
8102 OverheatingParticle OP = new OverheatingParticle();
8107
8109 }
8110
8112 {
8115
8116 return -1;
8117 }
8118
8120 {
8122 {
8125
8126 for (int i = count; i > 0; --i)
8127 {
8128 int id = i - 1;
8131
8134
8135 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8136 {
8137 if (p)
8138 {
8141 }
8142 }
8143 }
8144 }
8145 }
8146
8148 {
8150 {
8152 {
8153 int id = i - 1;
8155
8156 if (OP)
8157 {
8159
8160 if (p)
8161 {
8163 }
8164
8165 delete OP;
8166 }
8167 }
8168
8171 }
8172 }
8173
8176 {
8177 return 0.0;
8178 }
8179
8180
8182 {
8183 return 250;
8184 }
8185
8187 {
8188 return 0;
8189 }
8190
8193 {
8195 return true;
8196
8197 return false;
8198 }
8199
8202 {
8205
8207 {
8209 }
8210 else
8211 {
8212
8214 }
8215
8217 }
8218
8225 {
8226 return -1;
8227 }
8228
8229
8230
8231
8233 {
8235 {
8237 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8238
8239 if (r_index >= 0)
8240 {
8241 InventoryLocation r_il = new InventoryLocation;
8242 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8243
8244 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8247 {
8248 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8249 }
8251 {
8252 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8253 }
8254
8255 }
8256
8257 player.GetHumanInventory().ClearUserReservedLocation(this);
8258 }
8259
8262 }
8263
8264
8265
8266
8268 {
8269 return ItemBase.m_DebugActionsMask;
8270 }
8271
8273 {
8274 return ItemBase.m_DebugActionsMask & mask;
8275 }
8276
8278 {
8279 ItemBase.m_DebugActionsMask = mask;
8280 }
8281
8283 {
8284 ItemBase.m_DebugActionsMask |= mask;
8285 }
8286
8288 {
8289 ItemBase.m_DebugActionsMask &= ~mask;
8290 }
8291
8293 {
8295 {
8297 }
8298 else
8299 {
8301 }
8302 }
8303
8304
8306 {
8307 if (GetEconomyProfile())
8308 {
8309 float q_max = GetEconomyProfile().GetQuantityMax();
8310 if (q_max > 0)
8311 {
8312 float q_min = GetEconomyProfile().GetQuantityMin();
8313 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8314
8316 {
8317 ComponentEnergyManager comp = GetCompEM();
8319 {
8321 }
8322 }
8324 {
8326
8327 }
8328
8329 }
8330 }
8331 }
8332
8335 {
8336 EntityAI parent = GetHierarchyParent();
8337
8338 if (parent)
8339 {
8340 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8341 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8342 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8343 }
8344 }
8345
8348 {
8349 EntityAI parent = GetHierarchyParent();
8350
8351 if (parent)
8352 {
8353 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8354 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8355 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8356 }
8357 }
8358
8360 {
8361
8362
8363
8364
8366
8368 {
8369 if (ScriptInputUserData.CanStoreInputUserData())
8370 {
8371 ScriptInputUserData ctx = new ScriptInputUserData;
8377 ctx.
Write(use_stack_max);
8380
8382 {
8383 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8384 }
8385 }
8386 }
8387 else if (!
GetGame().IsMultiplayer())
8388 {
8390 }
8391 }
8392
8394 {
8396 }
8397
8399 {
8401 }
8402
8404 {
8406 }
8407
8409 {
8410
8411 return false;
8412 }
8413
8415 {
8416 return false;
8417 }
8418
8422 {
8423 return false;
8424 }
8425
8427 {
8428 return "";
8429 }
8430
8432
8434 {
8435 return false;
8436 }
8437
8439 {
8440 return true;
8441 }
8442
8443
8444
8446 {
8447 return true;
8448 }
8449
8451 {
8452 return true;
8453 }
8454
8456 {
8457 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8459 }
8460
8462 {
8464 }
8465
8467 {
8469 if (!is_being_placed)
8471 SetSynchDirty();
8472 }
8473
8474
8476
8478 {
8480 }
8481
8483 {
8485 }
8486
8488 {
8489 return 1;
8490 }
8491
8493 {
8494 return false;
8495 }
8496
8498 {
8500 SetSynchDirty();
8501 }
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8538 {
8539 super.OnMovedInsideCargo(container);
8540
8541 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8542 }
8543
8544 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8545 {
8546 super.EEItemLocationChanged(oldLoc,newLoc);
8547
8548 PlayerBase new_player = null;
8549 PlayerBase old_player = null;
8550
8551 if (newLoc.GetParent())
8552 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8553
8554 if (oldLoc.GetParent())
8555 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8556
8558 {
8559 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8560
8561 if (r_index >= 0)
8562 {
8563 InventoryLocation r_il = new InventoryLocation;
8564 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8565
8566 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8569 {
8570 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8571 }
8573 {
8574 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8575 }
8576
8577 }
8578 }
8579
8581 {
8582 if (new_player)
8583 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8584
8585 if (new_player == old_player)
8586 {
8587
8588 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8589 {
8591 {
8592 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8593 {
8594 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8595 }
8596 }
8597 else
8598 {
8599 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8600 }
8601 }
8602
8603 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8604 {
8605 int type = oldLoc.GetType();
8607 {
8608 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8609 }
8611 {
8612 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8613 }
8614 }
8615 if (!m_OldLocation)
8616 {
8617 m_OldLocation = new InventoryLocation;
8618 }
8619 m_OldLocation.Copy(oldLoc);
8620 }
8621 else
8622 {
8623 if (m_OldLocation)
8624 {
8625 m_OldLocation.Reset();
8626 }
8627 }
8628
8630 }
8631 else
8632 {
8633 if (new_player)
8634 {
8635 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8636 if (res_index >= 0)
8637 {
8638 InventoryLocation il = new InventoryLocation;
8639 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8641 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8644 {
8645 il.
GetParent().GetOnReleaseLock().Invoke(it);
8646 }
8648 {
8650 }
8651
8652 }
8653 }
8655 {
8656
8658 }
8659
8660 if (m_OldLocation)
8661 {
8662 m_OldLocation.Reset();
8663 }
8664 }
8665 }
8666
8667 override void EOnContact(IEntity other, Contact extra)
8668 {
8670 {
8671 int liquidType = -1;
8673 if (impactSpeed > 0.0)
8674 {
8676 #ifndef SERVER
8678 #else
8680 SetSynchDirty();
8681 #endif
8683 }
8684 }
8685
8686 #ifdef SERVER
8687 if (GetCompEM() && GetCompEM().IsPlugged())
8688 {
8689 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8690 GetCompEM().UnplugThis();
8691 }
8692 #endif
8693 }
8694
8696
8698 {
8700 }
8701
8703 {
8704
8705 }
8706
8708 {
8709 super.OnItemLocationChanged(old_owner, new_owner);
8710
8711 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8712 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8713
8714 if (!relatedPlayer && playerNew)
8715 relatedPlayer = playerNew;
8716
8717 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8718 {
8720 if (actionMgr)
8721 {
8722 ActionBase currentAction = actionMgr.GetRunningAction();
8723 if (currentAction)
8725 }
8726 }
8727
8728 Man ownerPlayerOld = null;
8729 Man ownerPlayerNew = null;
8730
8731 if (old_owner)
8732 {
8733 if (old_owner.
IsMan())
8734 {
8735 ownerPlayerOld = Man.Cast(old_owner);
8736 }
8737 else
8738 {
8739 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8740 }
8741 }
8742 else
8743 {
8745 {
8747
8748 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8749 {
8750 GetCompEM().UnplugThis();
8751 }
8752 }
8753 }
8754
8755 if (new_owner)
8756 {
8757 if (new_owner.
IsMan())
8758 {
8759 ownerPlayerNew = Man.Cast(new_owner);
8760 }
8761 else
8762 {
8763 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8764 }
8765 }
8766
8767 if (ownerPlayerOld != ownerPlayerNew)
8768 {
8769 if (ownerPlayerOld)
8770 {
8771 array<EntityAI> subItemsExit = new array<EntityAI>;
8773 for (int i = 0; i < subItemsExit.Count(); i++)
8774 {
8777 }
8778 }
8779
8780 if (ownerPlayerNew)
8781 {
8782 array<EntityAI> subItemsEnter = new array<EntityAI>;
8784 for (int j = 0; j < subItemsEnter.Count(); j++)
8785 {
8788 }
8789 }
8790 }
8791 else if (ownerPlayerNew != null)
8792 {
8793 PlayerBase nplayer;
8794 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8795 {
8796 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8798 for (int k = 0; k < subItemsUpdate.Count(); k++)
8799 {
8801 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8802 }
8803 }
8804 }
8805
8806 if (old_owner)
8807 old_owner.OnChildItemRemoved(this);
8808 if (new_owner)
8809 new_owner.OnChildItemReceived(this);
8810 }
8811
8812
8814 {
8815 super.EEDelete(parent);
8816 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8817 if (player)
8818 {
8820
8821 if (player.IsAlive())
8822 {
8823 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8824 if (r_index >= 0)
8825 {
8826 InventoryLocation r_il = new InventoryLocation;
8827 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8828
8829 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8832 {
8833 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8834 }
8836 {
8837 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8838 }
8839
8840 }
8841
8842 player.RemoveQuickBarEntityShortcut(this);
8843 }
8844 }
8845 }
8846
8848 {
8849 super.EEKilled(killer);
8850
8853 {
8854 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8855 {
8856 if (IsMagazine())
8857 {
8858 if (Magazine.Cast(this).GetAmmoCount() > 0)
8859 {
8861 }
8862 }
8863 else
8864 {
8866 }
8867 }
8868 }
8869 }
8870
8872 {
8873 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8874
8875 super.OnWasAttached(parent, slot_id);
8876
8879
8881 }
8882
8884 {
8885 super.OnWasDetached(parent, slot_id);
8886
8889 }
8890
8892 {
8893 int idx;
8896
8897 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8898 if (inventory_slots.Count() < 1)
8899 {
8900 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8901 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8902 }
8903 else
8904 {
8905 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8906 }
8907
8908 idx = inventory_slots.Find(slot);
8909 if (idx < 0)
8910 return "";
8911
8912 return attach_types.Get(idx);
8913 }
8914
8916 {
8917 int idx = -1;
8918 string slot;
8919
8922
8923 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8924 if (inventory_slots.Count() < 1)
8925 {
8926 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8927 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8928 }
8929 else
8930 {
8931 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8932 if (detach_types.Count() < 1)
8933 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8934 }
8935
8936 for (int i = 0; i < inventory_slots.Count(); i++)
8937 {
8938 slot = inventory_slots.Get(i);
8939 }
8940
8941 if (slot != "")
8942 {
8943 if (detach_types.Count() == 1)
8944 idx = 0;
8945 else
8946 idx = inventory_slots.Find(slot);
8947 }
8948 if (idx < 0)
8949 return "";
8950
8951 return detach_types.Get(idx);
8952 }
8953
8955 {
8956
8958
8959
8960 float min_time = 1;
8961 float max_time = 3;
8962 float delay = Math.RandomFloat(min_time, max_time);
8963
8964 explode_timer.Run(delay, this, "DoAmmoExplosion");
8965 }
8966
8968 {
8969 Magazine magazine = Magazine.Cast(this);
8970 int pop_sounds_count = 6;
8971 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8972
8973
8974 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8975 string sound_name = pop_sounds[ sound_idx ];
8977
8978
8979 magazine.ServerAddAmmoCount(-1);
8980
8981
8982 float min_temp_to_explode = 100;
8983
8984 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8985 {
8987 }
8988 }
8989
8990
8991 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8992 {
8993 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8994
8995 const int CHANCE_DAMAGE_CARGO = 4;
8996 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8997 const int CHANCE_DAMAGE_NOTHING = 2;
8998
9000 {
9001 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9002 int chances;
9003 int rnd;
9004
9005 if (GetInventory().GetCargo())
9006 {
9007 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9008 rnd = Math.RandomInt(0,chances);
9009
9010 if (rnd < CHANCE_DAMAGE_CARGO)
9011 {
9013 }
9014 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9015 {
9017 }
9018 }
9019 else
9020 {
9021 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9022 rnd = Math.RandomInt(0,chances);
9023
9024 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9025 {
9027 }
9028 }
9029 }
9030 }
9031
9033 {
9034 if (GetInventory().GetCargo())
9035 {
9036 int item_count = GetInventory().GetCargo().GetItemCount();
9037 if (item_count > 0)
9038 {
9039 int random_pick = Math.RandomInt(0, item_count);
9041 if (!item.IsExplosive())
9042 {
9043 item.AddHealth("","",damage);
9044 return true;
9045 }
9046 }
9047 }
9048 return false;
9049 }
9050
9052 {
9053 int attachment_count = GetInventory().AttachmentCount();
9054 if (attachment_count > 0)
9055 {
9056 int random_pick = Math.RandomInt(0, attachment_count);
9057 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9058 if (!attachment.IsExplosive())
9059 {
9060 attachment.AddHealth("","",damage);
9061 return true;
9062 }
9063 }
9064 return false;
9065 }
9066
9068 {
9070 }
9071
9073 {
9075 return GetInventory().CanRemoveEntity();
9076
9077 return false;
9078 }
9079
9081 {
9082
9084 return false;
9085
9086
9088 return false;
9089
9090
9091
9093 if (delta == 0)
9094 return false;
9095
9096
9097 return true;
9098 }
9099
9101 {
9103 {
9104 if (ScriptInputUserData.CanStoreInputUserData())
9105 {
9106 ScriptInputUserData ctx = new ScriptInputUserData;
9111 ctx.
Write(destination_entity);
9115 }
9116 }
9117 else if (!
GetGame().IsMultiplayer())
9118 {
9120 }
9121 }
9122
9124 {
9125 float split_quantity_new;
9129 InventoryLocation loc = new InventoryLocation;
9130
9131 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9132 {
9134 split_quantity_new = stack_max;
9135 else
9137
9139 {
9140 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9141 if (new_item)
9142 {
9143 new_item.SetResultOfSplit(true);
9144 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9146 new_item.
SetQuantity(split_quantity_new,
false,
true);
9147 }
9148 }
9149 }
9150 else if (destination_entity && slot_id == -1)
9151 {
9152 if (quantity > stack_max)
9153 split_quantity_new = stack_max;
9154 else
9155 split_quantity_new = quantity;
9156
9158 {
9160 {
9163 }
9164
9165 if (new_item)
9166 {
9167 new_item.SetResultOfSplit(true);
9168 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9170 new_item.
SetQuantity(split_quantity_new,
false,
true);
9171 }
9172 }
9173 }
9174 else
9175 {
9176 if (stack_max != 0)
9177 {
9179 {
9181 }
9182
9183 if (split_quantity_new == 0)
9184 {
9185 if (!
GetGame().IsMultiplayer())
9186 player.PhysicalPredictiveDropItem(this);
9187 else
9188 player.ServerDropEntity(this);
9189 return;
9190 }
9191
9193 {
9195
9196 if (new_item)
9197 {
9198 new_item.SetResultOfSplit(true);
9199 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9202 new_item.PlaceOnSurface();
9203 }
9204 }
9205 }
9206 }
9207 }
9208
9210 {
9211 float split_quantity_new;
9215 InventoryLocation loc = new InventoryLocation;
9216
9217 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9218 {
9220 split_quantity_new = stack_max;
9221 else
9223
9225 {
9226 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9227 if (new_item)
9228 {
9229 new_item.SetResultOfSplit(true);
9230 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9232 new_item.
SetQuantity(split_quantity_new,
false,
true);
9233 }
9234 }
9235 }
9236 else if (destination_entity && slot_id == -1)
9237 {
9238 if (quantity > stack_max)
9239 split_quantity_new = stack_max;
9240 else
9241 split_quantity_new = quantity;
9242
9244 {
9246 {
9249 }
9250
9251 if (new_item)
9252 {
9253 new_item.SetResultOfSplit(true);
9254 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9256 new_item.
SetQuantity(split_quantity_new,
false,
true);
9257 }
9258 }
9259 }
9260 else
9261 {
9262 if (stack_max != 0)
9263 {
9265 {
9267 }
9268
9270 {
9272
9273 if (new_item)
9274 {
9275 new_item.SetResultOfSplit(true);
9276 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9279 new_item.PlaceOnSurface();
9280 }
9281 }
9282 }
9283 }
9284 }
9285
9287 {
9289 {
9290 if (ScriptInputUserData.CanStoreInputUserData())
9291 {
9292 ScriptInputUserData ctx = new ScriptInputUserData;
9297 dst.WriteToContext(ctx);
9299 }
9300 }
9301 else if (!
GetGame().IsMultiplayer())
9302 {
9304 }
9305 }
9306
9308 {
9310 {
9311 if (ScriptInputUserData.CanStoreInputUserData())
9312 {
9313 ScriptInputUserData ctx = new ScriptInputUserData;
9318 ctx.
Write(destination_entity);
9324 }
9325 }
9326 else if (!
GetGame().IsMultiplayer())
9327 {
9329 }
9330 }
9331
9333 {
9335 }
9336
9338 {
9340 float split_quantity_new;
9342 if (dst.IsValid())
9343 {
9344 int slot_id = dst.GetSlot();
9346
9347 if (quantity > stack_max)
9348 split_quantity_new = stack_max;
9349 else
9350 split_quantity_new = quantity;
9351
9353 {
9355
9356 if (new_item)
9357 {
9358 new_item.SetResultOfSplit(true);
9359 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9361 new_item.
SetQuantity(split_quantity_new,
false,
true);
9362 }
9363
9364 return new_item;
9365 }
9366 }
9367
9368 return null;
9369 }
9370
9372 {
9374 float split_quantity_new;
9376 if (destination_entity)
9377 {
9379 if (quantity > stackable)
9380 split_quantity_new = stackable;
9381 else
9382 split_quantity_new = quantity;
9383
9385 {
9386 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9387 if (new_item)
9388 {
9389 new_item.SetResultOfSplit(true);
9390 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9392 new_item.
SetQuantity(split_quantity_new,
false,
true);
9393 }
9394 }
9395 }
9396 }
9397
9399 {
9401 {
9402 if (ScriptInputUserData.CanStoreInputUserData())
9403 {
9404 ScriptInputUserData ctx = new ScriptInputUserData;
9409 ItemBase destination_entity =
this;
9410 ctx.
Write(destination_entity);
9414 }
9415 }
9416 else if (!
GetGame().IsMultiplayer())
9417 {
9419 }
9420 }
9421
9423 {
9425 float split_quantity_new;
9427 if (player)
9428 {
9430 if (quantity > stackable)
9431 split_quantity_new = stackable;
9432 else
9433 split_quantity_new = quantity;
9434
9436 {
9437 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9438 new_item =
ItemBase.Cast(in_hands);
9439 if (new_item)
9440 {
9441 new_item.SetResultOfSplit(true);
9442 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9444 new_item.SetQuantity(split_quantity_new, false, true);
9445 }
9446 }
9447 }
9448 }
9449
9451 {
9453 float split_quantity_new = Math.Floor(quantity * 0.5);
9454
9456 return;
9457
9459
9460 if (new_item)
9461 {
9462 if (new_item.GetQuantityMax() < split_quantity_new)
9463 {
9464 split_quantity_new = new_item.GetQuantityMax();
9465 }
9466
9467 new_item.SetResultOfSplit(true);
9468 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9469
9471 {
9474 }
9475 else
9476 {
9478 new_item.
SetQuantity(split_quantity_new,
false,
true);
9479 }
9480 }
9481 }
9482
9484 {
9486 float split_quantity_new = Math.Floor(quantity / 2);
9487
9489 return;
9490
9491 InventoryLocation invloc = new InventoryLocation;
9493
9495 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9496
9497 if (new_item)
9498 {
9499 if (new_item.GetQuantityMax() < split_quantity_new)
9500 {
9501 split_quantity_new = new_item.GetQuantityMax();
9502 }
9504 {
9507 }
9508 else if (split_quantity_new > 1)
9509 {
9511 new_item.
SetQuantity(split_quantity_new,
false,
true);
9512 }
9513 }
9514 }
9515
9518 {
9519 SetWeightDirty();
9521
9522 if (parent)
9523 parent.OnAttachmentQuantityChangedEx(this, delta);
9524
9526 {
9528 {
9530 }
9532 {
9533 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9535 }
9536 }
9537
9538 }
9539
9542 {
9543
9544 }
9545
9548 {
9550 }
9551
9553 {
9554 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9555
9557 {
9558 if (newLevel == GameConstants.STATE_RUINED)
9559 {
9561 EntityAI parent = GetHierarchyParent();
9562 if (parent && parent.IsFireplace())
9563 {
9564 CargoBase cargo = GetInventory().GetCargo();
9565 if (cargo)
9566 {
9568 {
9570 }
9571 }
9572 }
9573 }
9574
9576 {
9577
9579 return;
9580 }
9581
9582 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9583 {
9585 }
9586 }
9587 }
9588
9589
9591 {
9592 super.OnRightClick();
9593
9595 {
9597 {
9598 if (ScriptInputUserData.CanStoreInputUserData())
9599 {
9600 EntityAI root = GetHierarchyRoot();
9601 Man playerOwner = GetHierarchyRootPlayer();
9602 InventoryLocation dst = new InventoryLocation;
9603
9604
9605 if (!playerOwner && root && root == this)
9606 {
9608 }
9609 else
9610 {
9611
9612 GetInventory().GetCurrentInventoryLocation(dst);
9614 {
9617 {
9619 }
9620 else
9621 {
9623
9624
9625 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9626 {
9628 }
9629 else
9630 {
9631 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9632 }
9633 }
9634 }
9635 }
9636
9637 ScriptInputUserData ctx = new ScriptInputUserData;
9645 }
9646 }
9647 else if (!
GetGame().IsMultiplayer())
9648 {
9650 }
9651 }
9652 }
9653
9655 {
9656 if (root)
9657 {
9658 vector m4[4];
9659 root.GetTransform(m4);
9660 dst.SetGround(this, m4);
9661 }
9662 else
9663 {
9664 GetInventory().GetCurrentInventoryLocation(dst);
9665 }
9666 }
9667
9668 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9669 {
9670
9671 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9672 return false;
9673
9674 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9675 return false;
9676
9677
9679 return false;
9680
9681
9682 Magazine mag = Magazine.Cast(this);
9683 if (mag)
9684 {
9685 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9686 return false;
9687
9688 if (stack_max_limit)
9689 {
9690 Magazine other_mag = Magazine.Cast(other_item);
9691 if (other_item)
9692 {
9693 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9694 return false;
9695 }
9696
9697 }
9698 }
9699 else
9700 {
9701
9703 return false;
9704
9706 return false;
9707 }
9708
9709 PlayerBase player = null;
9710 if (CastTo(player, GetHierarchyRootPlayer()))
9711 {
9712 if (player.GetInventory().HasAttachment(this))
9713 return false;
9714
9715 if (player.IsItemsToDelete())
9716 return false;
9717 }
9718
9719 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9720 return false;
9721
9722 int slotID;
9724 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9725 return false;
9726
9727 return true;
9728 }
9729
9731 {
9733 }
9734
9736 {
9737 return m_IsResultOfSplit;
9738 }
9739
9741 {
9742 m_IsResultOfSplit = value;
9743 }
9744
9746 {
9748 }
9749
9751 {
9752 float other_item_quantity = other_item.GetQuantity();
9753 float this_free_space;
9754
9756
9758
9759 if (other_item_quantity > this_free_space)
9760 {
9761 return this_free_space;
9762 }
9763 else
9764 {
9765 return other_item_quantity;
9766 }
9767 }
9768
9770 {
9772 }
9773
9775 {
9777 return;
9778
9779 if (!IsMagazine() && other_item)
9780 {
9782 if (quantity_used != 0)
9783 {
9784 float hp1 = GetHealth01("","");
9785 float hp2 = other_item.GetHealth01("","");
9786 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9787 hpResult = hpResult / (
GetQuantity() + quantity_used);
9788
9789 hpResult *= GetMaxHealth();
9790 Math.Round(hpResult);
9791 SetHealth("", "Health", hpResult);
9792
9794 other_item.AddQuantity(-quantity_used);
9795 }
9796 }
9798 }
9799
9801 {
9802 #ifdef SERVER
9803 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9804 GetHierarchyParent().IncreaseLifetimeUp();
9805 #endif
9806 };
9807
9809 {
9810 PlayerBase p = PlayerBase.Cast(player);
9811
9812 array<int> recipesIds = p.m_Recipes;
9813 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9814 if (moduleRecipesManager)
9815 {
9816 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9817 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9818 }
9819
9820 for (int i = 0;i < recipesIds.Count(); i++)
9821 {
9822 int key = recipesIds.Get(i);
9823 string recipeName = moduleRecipesManager.GetRecipeName(key);
9825 }
9826 }
9827
9828
9829 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9830 {
9831 super.GetDebugActions(outputList);
9832
9833
9839
9840
9845
9850
9851
9855
9856
9858 {
9862 }
9863
9866
9867
9871
9873
9874 InventoryLocation loc = new InventoryLocation();
9875 GetInventory().GetCurrentInventoryLocation(loc);
9877 {
9878 if (Gizmo_IsSupported())
9881 }
9882
9884 }
9885
9886
9887
9888
9890 {
9891 super.OnAction(action_id, player, ctx);
9892
9894 {
9895 switch (action_id)
9896 {
9899 return true;
9902 return true;
9903 }
9904 }
9905
9907 {
9908 switch (action_id)
9909 {
9911 Delete();
9912 return true;
9913 }
9914 }
9915
9916 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9917 {
9918 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9919 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9920 PlayerBase p = PlayerBase.Cast(player);
9921 if (
EActions.RECIPES_RANGE_START < 1000)
9922 {
9923 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9924 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9925 }
9926 }
9927 #ifndef SERVER
9928 else if (action_id ==
EActions.WATCH_PLAYER)
9929 {
9930 PluginDeveloper.SetDeveloperItemClientEx(player);
9931 }
9932 #endif
9934 {
9935 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9936 {
9937 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9938 OnDebugButtonPressServer(id + 1);
9939 }
9940
9941 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9942 {
9943 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9945 }
9946
9947 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9948 {
9949 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9951 }
9952
9953 else if (action_id ==
EActions.ADD_QUANTITY)
9954 {
9955 if (IsMagazine())
9956 {
9957 Magazine mag = Magazine.Cast(this);
9958 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9959 }
9960 else
9961 {
9963 }
9964
9965 if (m_EM)
9966 {
9967 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9968 }
9969
9970 }
9971
9972 else if (action_id ==
EActions.REMOVE_QUANTITY)
9973 {
9974 if (IsMagazine())
9975 {
9976 Magazine mag2 = Magazine.Cast(this);
9977 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9978 }
9979 else
9980 {
9982 }
9983 if (m_EM)
9984 {
9985 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9986 }
9987
9988 }
9989
9990 else if (action_id ==
EActions.SET_QUANTITY_0)
9991 {
9993
9994 if (m_EM)
9995 {
9996 m_EM.SetEnergy(0);
9997 }
9998 }
9999
10000 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10001 {
10003
10004 if (m_EM)
10005 {
10006 m_EM.SetEnergy(m_EM.GetEnergyMax());
10007 }
10008 }
10009
10010 else if (action_id ==
EActions.ADD_HEALTH)
10011 {
10012 AddHealth("","",GetMaxHealth("","Health")/5);
10013 }
10014 else if (action_id ==
EActions.REMOVE_HEALTH)
10015 {
10016 AddHealth("","",-GetMaxHealth("","Health")/5);
10017 }
10018 else if (action_id ==
EActions.DESTROY_HEALTH)
10019 {
10020 SetHealth01("","",0);
10021 }
10022 else if (action_id ==
EActions.WATCH_ITEM)
10023 {
10025 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10026 #ifdef DEVELOPER
10027 SetDebugDeveloper_item(this);
10028 #endif
10029 }
10030
10031 else if (action_id ==
EActions.ADD_TEMPERATURE)
10032 {
10033 AddTemperature(20);
10034
10035 }
10036
10037 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10038 {
10039 AddTemperature(-20);
10040
10041 }
10042
10043 else if (action_id ==
EActions.FLIP_FROZEN)
10044 {
10045 SetFrozen(!GetIsFrozen());
10046
10047 }
10048
10049 else if (action_id ==
EActions.ADD_WETNESS)
10050 {
10052
10053 }
10054
10055 else if (action_id ==
EActions.REMOVE_WETNESS)
10056 {
10058
10059 }
10060
10061 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10062 {
10065
10066
10067 }
10068
10069 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10070 {
10073 }
10074
10075 else if (action_id ==
EActions.MAKE_SPECIAL)
10076 {
10077 auto debugParams = DebugSpawnParams.WithPlayer(player);
10078 OnDebugSpawnEx(debugParams);
10079 }
10080
10081 }
10082
10083
10084 return false;
10085 }
10086
10087
10088
10089
10093
10096
10097
10098
10100 {
10101 return false;
10102 }
10103
10104
10106 {
10107 return true;
10108 }
10109
10110
10112 {
10113 return true;
10114 }
10115
10116
10117
10119 {
10120 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10122 }
10123
10126 {
10127 return null;
10128 }
10129
10131 {
10132 return false;
10133 }
10134
10136 {
10137 return false;
10138 }
10139
10143
10144
10146 {
10147 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10148 return module_repairing.CanRepair(this, item_repair_kit);
10149 }
10150
10151
10152 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10153 {
10154 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10155 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10156 }
10157
10158
10160 {
10161
10162
10163
10164
10165
10166
10167
10168
10169 return 1;
10170 }
10171
10172
10173
10175 {
10177 }
10178
10179
10180
10182 {
10184 }
10185
10186
10195 {
10196 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10197
10198 if (player)
10199 {
10200 player.MessageStatus(text);
10201 }
10202 }
10203
10204
10213 {
10214 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10215
10216 if (player)
10217 {
10218 player.MessageAction(text);
10219 }
10220 }
10221
10222
10231 {
10232 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10233
10234 if (player)
10235 {
10236 player.MessageFriendly(text);
10237 }
10238 }
10239
10240
10249 {
10250 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10251
10252 if (player)
10253 {
10254 player.MessageImportant(text);
10255 }
10256 }
10257
10259 {
10260 return true;
10261 }
10262
10263
10264 override bool KindOf(
string tag)
10265 {
10266 bool found = false;
10267 string item_name = this.
GetType();
10270
10271 int array_size = item_tag_array.Count();
10272 for (int i = 0; i < array_size; i++)
10273 {
10274 if (item_tag_array.Get(i) == tag)
10275 {
10276 found = true;
10277 break;
10278 }
10279 }
10280 return found;
10281 }
10282
10283
10285 {
10286
10287 super.OnRPC(sender, rpc_type,ctx);
10288
10289
10290 switch (rpc_type)
10291 {
10292 #ifndef SERVER
10293 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10294 Param2<bool, string> p = new Param2<bool, string>(false, "");
10295
10297 return;
10298
10299 bool play = p.param1;
10300 string soundSet = p.param2;
10301
10302 if (play)
10303 {
10305 {
10307 {
10309 }
10310 }
10311 else
10312 {
10314 }
10315 }
10316 else
10317 {
10319 }
10320
10321 break;
10322 #endif
10323
10324 }
10325
10327 {
10329 }
10330 }
10331
10332
10333
10334
10336 {
10337 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10338 return plugin.GetID(
name);
10339 }
10340
10342 {
10343 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10344 return plugin.GetName(id);
10345 }
10346
10349 {
10350
10351
10352 int varFlags;
10353 if (!ctx.
Read(varFlags))
10354 return;
10355
10356 if (varFlags & ItemVariableFlags.FLOAT)
10357 {
10359 }
10360 }
10361
10363 {
10364
10365 super.SerializeNumericalVars(floats_out);
10366
10367
10368
10370 {
10372 }
10373
10375 {
10377 }
10378
10380 {
10382 }
10383
10385 {
10390 }
10391
10393 {
10395 }
10396 }
10397
10399 {
10400
10401 super.DeSerializeNumericalVars(floats);
10402
10403
10404 int index = 0;
10405 int mask = Math.Round(floats.Get(index));
10406
10407 index++;
10408
10410 {
10412 {
10414 }
10415 else
10416 {
10417 float quantity = floats.Get(index);
10418 SetQuantity(quantity,
true,
false,
false,
false);
10419 }
10420 index++;
10421 }
10422
10424 {
10425 float wet = floats.Get(index);
10427 index++;
10428 }
10429
10431 {
10432 int liquidtype = Math.Round(floats.Get(index));
10434 index++;
10435 }
10436
10438 {
10440 index++;
10442 index++;
10444 index++;
10446 index++;
10447 }
10448
10450 {
10451 int cleanness = Math.Round(floats.Get(index));
10453 index++;
10454 }
10455 }
10456
10458 {
10459 super.WriteVarsToCTX(ctx);
10460
10461
10463 {
10465 }
10466
10468 {
10470 }
10471
10473 {
10475 }
10476
10478 {
10479 int r,g,b,a;
10485 }
10486
10488 {
10490 }
10491 }
10492
10494 {
10495 if (!super.ReadVarsFromCTX(ctx,version))
10496 return false;
10497
10498 int intValue;
10499 float value;
10500
10501 if (version < 140)
10502 {
10503 if (!ctx.
Read(intValue))
10504 return false;
10505
10506 m_VariablesMask = intValue;
10507 }
10508
10510 {
10511 if (!ctx.
Read(value))
10512 return false;
10513
10515 {
10517 }
10518 else
10519 {
10521 }
10522 }
10523
10524 if (version < 140)
10525 {
10527 {
10528 if (!ctx.
Read(value))
10529 return false;
10530 SetTemperatureDirect(value);
10531 }
10532 }
10533
10535 {
10536 if (!ctx.
Read(value))
10537 return false;
10539 }
10540
10542 {
10543 if (!ctx.
Read(intValue))
10544 return false;
10546 }
10547
10549 {
10550 int r,g,b,a;
10552 return false;
10554 return false;
10556 return false;
10558 return false;
10559
10561 }
10562
10564 {
10565 if (!ctx.
Read(intValue))
10566 return false;
10568 }
10569
10570 if (version >= 138 && version < 140)
10571 {
10573 {
10574 if (!ctx.
Read(intValue))
10575 return false;
10576 SetFrozen(intValue);
10577 }
10578 }
10579
10580 return true;
10581 }
10582
10583
10585 {
10588 {
10590 }
10591
10592 if (!super.OnStoreLoad(ctx, version))
10593 {
10595 return false;
10596 }
10597
10598 if (version >= 114)
10599 {
10600 bool hasQuickBarIndexSaved;
10601
10602 if (!ctx.
Read(hasQuickBarIndexSaved))
10603 {
10605 return false;
10606 }
10607
10608 if (hasQuickBarIndexSaved)
10609 {
10610 int itmQBIndex;
10611
10612
10613 if (!ctx.
Read(itmQBIndex))
10614 {
10616 return false;
10617 }
10618
10619 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10620 if (itmQBIndex != -1 && parentPlayer)
10621 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10622 }
10623 }
10624 else
10625 {
10626
10627 PlayerBase player;
10628 int itemQBIndex;
10629 if (version ==
int.
MAX)
10630 {
10631 if (!ctx.
Read(itemQBIndex))
10632 {
10634 return false;
10635 }
10636 }
10637 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10638 {
10639
10640 if (!ctx.
Read(itemQBIndex))
10641 {
10643 return false;
10644 }
10645 if (itemQBIndex != -1 && player)
10646 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10647 }
10648 }
10649
10650 if (version < 140)
10651 {
10652
10653 if (!LoadVariables(ctx, version))
10654 {
10656 return false;
10657 }
10658 }
10659
10660
10662 {
10664 return false;
10665 }
10666 if (version >= 132)
10667 {
10669 if (raib)
10670 {
10672 {
10674 return false;
10675 }
10676 }
10677 }
10678
10680 return true;
10681 }
10682
10683
10684
10686 {
10687 super.OnStoreSave(ctx);
10688
10689 PlayerBase player;
10690 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10691 {
10693
10694 int itemQBIndex = -1;
10695 itemQBIndex = player.FindQuickBarEntityIndex(this);
10696 ctx.
Write(itemQBIndex);
10697 }
10698 else
10699 {
10701 }
10702
10704
10706 if (raib)
10707 {
10709 }
10710 }
10711
10712
10714 {
10715 super.AfterStoreLoad();
10716
10718 {
10720 }
10721
10723 {
10726 }
10727 }
10728
10730 {
10731 super.EEOnAfterLoad();
10732
10734 {
10736 }
10737
10740 }
10741
10743 {
10744 return false;
10745 }
10746
10747
10748
10750 {
10752 {
10753 #ifdef PLATFORM_CONSOLE
10754
10756 {
10758 if (menu)
10759 {
10761 }
10762 }
10763 #endif
10764 }
10765
10767 {
10770 }
10771
10773 {
10774 SetWeightDirty();
10776 }
10778 {
10781 }
10782
10784 {
10787 }
10789 {
10792 }
10793
10794 super.OnVariablesSynchronized();
10795 }
10796
10797
10798
10800 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10801 {
10802 if (!IsServerCheck(allow_client))
10803 return false;
10804
10806 return false;
10807
10810
10811 if (value <= (min + 0.001))
10812 value = min;
10813
10814 if (value == min)
10815 {
10816 if (destroy_config)
10817 {
10818 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10819 if (dstr)
10820 {
10822 this.Delete();
10823 return true;
10824 }
10825 }
10826 else if (destroy_forced)
10827 {
10829 this.Delete();
10830 return true;
10831 }
10832
10834 }
10835
10838
10840 {
10842
10843 if (delta)
10845 }
10846
10848
10849 return false;
10850 }
10851
10852
10854 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10855 {
10857 }
10858
10860 {
10863 }
10864
10866 {
10869 }
10870
10872 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10873 {
10874 float value_clamped = Math.Clamp(value, 0, 1);
10876 SetQuantity(result, destroy_config, destroy_forced);
10877 }
10878
10879
10882 {
10884 }
10885
10887 {
10889 }
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10901 {
10902 int slot = -1;
10903 if (GetInventory())
10904 {
10905 InventoryLocation il = new InventoryLocation;
10906 GetInventory().GetCurrentInventoryLocation(il);
10908 }
10909
10911 }
10912
10914 {
10915 float quantity_max = 0;
10916
10918 {
10919 if (attSlotID != -1)
10920 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10921
10922 if (quantity_max <= 0)
10924 }
10925
10926 if (quantity_max <= 0)
10928
10929 return quantity_max;
10930 }
10931
10933 {
10935 }
10936
10938 {
10940 }
10941
10942
10944 {
10946 }
10947
10949 {
10951 }
10952
10954 {
10956 }
10957
10958
10960 {
10961
10962 float weightEx = GetWeightEx();
10963 float special = GetInventoryAndCargoWeight();
10964 return weightEx - special;
10965 }
10966
10967
10969 {
10971 }
10972
10974 {
10976 {
10977 #ifdef DEVELOPER
10978 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10979 {
10980 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10982 }
10983 #endif
10984
10985 return GetQuantity() * GetConfigWeightModified();
10986 }
10987 else if (HasEnergyManager())
10988 {
10989 #ifdef DEVELOPER
10990 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10991 {
10992 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10993 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10994 }
10995 #endif
10996 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10997 }
10998 else
10999 {
11000 #ifdef DEVELOPER
11001 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11002 {
11003 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11004 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11005 }
11006 #endif
11007 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11008 }
11009 }
11010
11013 {
11014 int item_count = 0;
11016
11017 if (GetInventory().GetCargo() != NULL)
11018 {
11019 item_count = GetInventory().GetCargo().GetItemCount();
11020 }
11021
11022 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11023 {
11024 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11025 if (item)
11026 item_count += item.GetNumberOfItems();
11027 }
11028 return item_count;
11029 }
11030
11033 {
11034 float weight = 0;
11035 float wetness = 1;
11036 if (include_wetness)
11039 {
11040 weight = wetness * m_ConfigWeight;
11041 }
11043 {
11044 weight = 1;
11045 }
11046 return weight;
11047 }
11048
11049
11050
11052 {
11053 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11054 {
11055 GameInventory inv = GetInventory();
11056 array<EntityAI> items = new array<EntityAI>;
11058 for (int i = 0; i < items.Count(); i++)
11059 {
11061 if (item)
11062 {
11064 }
11065 }
11066 }
11067 }
11068
11069
11070
11071
11073 {
11074 float energy = 0;
11075 if (HasEnergyManager())
11076 {
11077 energy = GetCompEM().GetEnergy();
11078 }
11079 return energy;
11080 }
11081
11082
11084 {
11085 super.OnEnergyConsumed();
11086
11088 }
11089
11091 {
11092 super.OnEnergyAdded();
11093
11095 }
11096
11097
11099 {
11100 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11101 {
11103 {
11104 float energy_0to1 = GetCompEM().GetEnergy0To1();
11106 }
11107 }
11108 }
11109
11110
11112 {
11113 return ConfigGetFloat("heatIsolation");
11114 }
11115
11117 {
11119 }
11120
11122 {
11123 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11124 if (
GetGame().ConfigIsExisting(paramPath))
11126
11127 return 0.0;
11128 }
11129
11131 {
11132 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11133 if (
GetGame().ConfigIsExisting(paramPath))
11135
11136 return 0.0;
11137 }
11138
11139 override void SetWet(
float value,
bool allow_client =
false)
11140 {
11141 if (!IsServerCheck(allow_client))
11142 return;
11143
11146
11148
11149 m_VarWet = Math.Clamp(value, min, max);
11150
11152 {
11155 }
11156 }
11157
11158 override void AddWet(
float value)
11159 {
11161 }
11162
11164 {
11166 }
11167
11169 {
11171 }
11172
11174 {
11176 }
11177
11179 {
11181 }
11182
11184 {
11186 }
11187
11188 override void OnWetChanged(
float newVal,
float oldVal)
11189 {
11192 if (newLevel != oldLevel)
11193 {
11195 }
11196 }
11197
11199 {
11200 SetWeightDirty();
11201 }
11202
11204 {
11205 return GetWetLevelInternal(
m_VarWet);
11206 }
11207
11208
11209
11211 {
11213 }
11214
11216 {
11218 }
11219
11221 {
11223 }
11224
11226 {
11228 }
11229
11230
11231
11233 {
11234 if (ConfigIsExisting("itemModelLength"))
11235 {
11236 return ConfigGetFloat("itemModelLength");
11237 }
11238 return 0;
11239 }
11240
11242 {
11243 if (ConfigIsExisting("itemAttachOffset"))
11244 {
11245 return ConfigGetFloat("itemAttachOffset");
11246 }
11247 return 0;
11248 }
11249
11250 override void SetCleanness(
int value,
bool allow_client =
false)
11251 {
11252 if (!IsServerCheck(allow_client))
11253 return;
11254
11256
11258
11261 }
11262
11264 {
11266 }
11267
11269 {
11270 return true;
11271 }
11272
11273
11274
11275
11277 {
11279 }
11280
11282 {
11284 }
11285
11286
11287
11288
11289 override void SetColor(
int r,
int g,
int b,
int a)
11290 {
11296 }
11298 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11299 {
11304 }
11305
11307 {
11309 }
11310
11313 {
11314 int r,g,b,a;
11316 r = r/255;
11317 g = g/255;
11318 b = b/255;
11319 a = a/255;
11320 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11321 }
11322
11323
11324
11325 override void SetLiquidType(
int value,
bool allow_client =
false)
11326 {
11327 if (!IsServerCheck(allow_client))
11328 return;
11329
11334 }
11335
11337 {
11338 return ConfigGetInt("varLiquidTypeInit");
11339 }
11340
11342 {
11344 }
11345
11347 {
11349 SetFrozen(false);
11350 }
11351
11354 {
11355 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11356 }
11357
11358
11361 {
11362 PlayerBase nplayer;
11363 if (PlayerBase.CastTo(nplayer, player))
11364 {
11366
11367 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11368 }
11369 }
11370
11371
11374 {
11375 PlayerBase nplayer;
11376 if (PlayerBase.CastTo(nplayer,player))
11377 {
11378
11379 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11380
11381 }
11382
11383
11384 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11385
11386
11387 if (HasEnergyManager())
11388 {
11389 GetCompEM().UpdatePlugState();
11390 }
11391 }
11392
11393
11395 {
11396 super.OnPlacementStarted(player);
11397
11399 }
11400
11401 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11402 {
11404 {
11405 m_AdminLog.OnPlacementComplete(player,
this);
11406 }
11407
11408 super.OnPlacementComplete(player, position, orientation);
11409 }
11410
11411
11412
11413
11414
11416 {
11418 {
11419 return true;
11420 }
11421 else
11422 {
11423 return false;
11424 }
11425 }
11426
11427
11429 {
11431 {
11433 }
11434 }
11435
11436
11438 {
11440 }
11441
11443 {
11445 }
11446
11447 override void InsertAgent(
int agent,
float count = 1)
11448 {
11449 if (count < 1)
11450 return;
11451
11453 }
11454
11457 {
11459 }
11460
11461
11463 {
11465 }
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11509 {
11511 return false;
11512 return true;
11513 }
11514
11516 {
11517
11519 }
11520
11521
11524 {
11525 super.CheckForRoofLimited(timeTresholdMS);
11526
11528 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11529 {
11530 m_PreviousRoofTestTime = time;
11531 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11532 }
11533 }
11534
11535
11537 {
11539 {
11540 return 0;
11541 }
11542
11543 if (GetInventory().GetAttachmentSlotsCount() != 0)
11544 {
11545 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11546 if (filter)
11547 return filter.GetProtectionLevel(type, false, system);
11548 else
11549 return 0;
11550 }
11551
11552 string subclassPath, entryName;
11553
11554 switch (type)
11555 {
11557 entryName = "biological";
11558 break;
11560 entryName = "chemical";
11561 break;
11562 default:
11563 entryName = "biological";
11564 break;
11565 }
11566
11567 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11568
11570 }
11571
11572
11573
11576 {
11577 if (!IsMagazine())
11579
11581 }
11582
11583
11584
11585
11586
11591 {
11592 return true;
11593 }
11594
11596 {
11598 }
11599
11600
11601
11602
11603
11605 {
11606 if (parent)
11607 {
11608 if (parent.IsInherited(DayZInfected))
11609 return true;
11610
11611 if (!parent.IsRuined())
11612 return true;
11613 }
11614
11615 return true;
11616 }
11617
11619 {
11620 if (!super.CanPutAsAttachment(parent))
11621 {
11622 return false;
11623 }
11624
11625 if (!IsRuined() && !parent.IsRuined())
11626 {
11627 return true;
11628 }
11629
11630 return false;
11631 }
11632
11634 {
11635
11636
11637
11638
11639 return super.CanReceiveItemIntoCargo(item);
11640 }
11641
11643 {
11644
11645
11646
11647
11648 GameInventory attachmentInv = attachment.GetInventory();
11650 {
11651 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11652 return false;
11653 }
11654
11655 InventoryLocation loc = new InventoryLocation();
11656 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11657 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11658 return false;
11659
11660 return super.CanReceiveAttachment(attachment, slotId);
11661 }
11662
11664 {
11665 if (!super.CanReleaseAttachment(attachment))
11666 return false;
11667
11668 return GetInventory().AreChildrenAccessible();
11669 }
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11692 {
11693 int id = muzzle_owner.GetMuzzleID();
11694 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11695
11696 if (WPOF_array)
11697 {
11698 for (int i = 0; i < WPOF_array.Count(); i++)
11699 {
11700 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11701
11702 if (WPOF)
11703 {
11704 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11705 }
11706 }
11707 }
11708 }
11709
11710
11712 {
11713 int id = muzzle_owner.GetMuzzleID();
11715
11716 if (WPOBE_array)
11717 {
11718 for (int i = 0; i < WPOBE_array.Count(); i++)
11719 {
11720 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11721
11722 if (WPOBE)
11723 {
11724 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11725 }
11726 }
11727 }
11728 }
11729
11730
11732 {
11733 int id = muzzle_owner.GetMuzzleID();
11734 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11735
11736 if (WPOOH_array)
11737 {
11738 for (int i = 0; i < WPOOH_array.Count(); i++)
11739 {
11740 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11741
11742 if (WPOOH)
11743 {
11744 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11745 }
11746 }
11747 }
11748 }
11749
11750
11752 {
11753 int id = muzzle_owner.GetMuzzleID();
11754 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11755
11756 if (WPOOH_array)
11757 {
11758 for (int i = 0; i < WPOOH_array.Count(); i++)
11759 {
11760 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11761
11762 if (WPOOH)
11763 {
11764 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11765 }
11766 }
11767 }
11768 }
11769
11770
11772 {
11773 int id = muzzle_owner.GetMuzzleID();
11774 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11775
11776 if (WPOOH_array)
11777 {
11778 for (int i = 0; i < WPOOH_array.Count(); i++)
11779 {
11780 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11781
11782 if (WPOOH)
11783 {
11784 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11785 }
11786 }
11787 }
11788 }
11789
11790
11791
11793 {
11795 {
11796 return true;
11797 }
11798
11799 return false;
11800 }
11801
11803 {
11805 {
11806 return true;
11807 }
11808
11809 return false;
11810 }
11811
11813 {
11815 {
11816 return true;
11817 }
11818
11819 return false;
11820 }
11821
11823 {
11824 return false;
11825 }
11826
11829 {
11830 return UATimeSpent.DEFAULT_DEPLOY;
11831 }
11832
11833
11834
11835
11837 {
11839 SetSynchDirty();
11840 }
11841
11843 {
11845 }
11846
11847
11849 {
11850 return false;
11851 }
11852
11855 {
11856 string att_type = "None";
11857
11858 if (ConfigIsExisting("soundAttType"))
11859 {
11860 att_type = ConfigGetString("soundAttType");
11861 }
11862
11864 }
11865
11867 {
11869 }
11870
11871
11872
11873
11874
11880
11882 {
11885
11887 }
11888
11889
11891 {
11893 return;
11894
11896
11899
11902
11903 SoundParameters params = new SoundParameters();
11907 }
11908
11909
11911 {
11913 return;
11914
11916 SetSynchDirty();
11917
11920 }
11921
11922
11924 {
11926 return;
11927
11929 SetSynchDirty();
11930
11933 }
11934
11936 {
11938 }
11939
11941 {
11943 }
11944
11947 {
11948 if (!
GetGame().IsDedicatedServer())
11949 {
11950 if (ConfigIsExisting("attachSoundSet"))
11951 {
11952 string cfg_path = "";
11953 string soundset = "";
11954 string type_name =
GetType();
11955
11958 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11959 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11960
11961 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11962 {
11963 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11964 {
11965 if (cfg_slot_array[i] == slot_type)
11966 {
11967 soundset = cfg_soundset_array[i];
11968 break;
11969 }
11970 }
11971 }
11972
11973 if (soundset != "")
11974 {
11975 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11977 }
11978 }
11979 }
11980 }
11981
11983 {
11984
11985 }
11986
11987 void OnApply(PlayerBase player);
11988
11990 {
11991 return 1.0;
11992 };
11993
11995 {
11997 }
11998
12000 {
12002 }
12003
12005
12007 {
12008 SetDynamicPhysicsLifeTime(0.01);
12010 }
12011
12013 {
12014 array<string> zone_names = new array<string>;
12015 GetDamageZones(zone_names);
12016 for (int i = 0; i < zone_names.Count(); i++)
12017 {
12018 SetHealthMax(zone_names.Get(i),"Health");
12019 }
12020 SetHealthMax("","Health");
12021 }
12022
12025 {
12026 float global_health = GetHealth01("","Health");
12027 array<string> zones = new array<string>;
12028 GetDamageZones(zones);
12029
12030 for (int i = 0; i < zones.Count(); i++)
12031 {
12032 SetHealth01(zones.Get(i),"Health",global_health);
12033 }
12034 }
12035
12038 {
12039 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12040 }
12041
12043 {
12044 if (!hasRootAsPlayer)
12045 {
12046 if (refParentIB)
12047 {
12048
12049 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12050 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12051
12052 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12053 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12054
12057 }
12058 else
12059 {
12060
12063 }
12064 }
12065 }
12066
12068 {
12070 {
12071 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12072 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12073 {
12074 float heatPermCoef = 1.0;
12076 while (ent)
12077 {
12078 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12079 ent = ent.GetHierarchyParent();
12080 }
12081
12082 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12083 }
12084 }
12085 }
12086
12088 {
12089
12090 EntityAI parent = GetHierarchyParent();
12091 if (!parent)
12092 {
12093 hasParent = false;
12094 hasRootAsPlayer = false;
12095 }
12096 else
12097 {
12098 hasParent = true;
12099 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12100 refParentIB =
ItemBase.Cast(parent);
12101 }
12102 }
12103
12104 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12105 {
12106
12107 }
12108
12110 {
12111
12112 return false;
12113 }
12114
12116 {
12117
12118
12119 return false;
12120 }
12121
12123 {
12124
12125 return false;
12126 }
12127
12130 {
12131 return !GetIsFrozen() &&
IsOpen();
12132 }
12133
12135 {
12136 bool hasParent = false, hasRootAsPlayer = false;
12138
12139 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12140 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12141
12142 if (wwtu || foodDecay)
12143 {
12147
12148 if (processWetness || processTemperature || processDecay)
12149 {
12151
12152 if (processWetness)
12153 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12154
12155 if (processTemperature)
12157
12158 if (processDecay)
12159 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12160 }
12161 }
12162 }
12163
12166 {
12168 }
12169
12171 {
12174
12175 return super.GetTemperatureFreezeThreshold();
12176 }
12177
12179 {
12182
12183 return super.GetTemperatureThawThreshold();
12184 }
12185
12187 {
12190
12191 return super.GetItemOverheatThreshold();
12192 }
12193
12195 {
12197 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12198
12199 return super.GetTemperatureFreezeTime();
12200 }
12201
12203 {
12205 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12206
12207 return super.GetTemperatureThawTime();
12208 }
12209
12214
12216 {
12217 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12218 }
12219
12221 {
12222 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12223 }
12224
12227 {
12229 }
12230
12232 {
12234 }
12235
12237 {
12239 }
12240
12243 {
12244 return null;
12245 }
12246
12249 {
12250 return false;
12251 }
12252
12254 {
12256 {
12259 if (!trg)
12260 {
12262 explosive = this;
12263 }
12264
12265 explosive.PairRemote(trg);
12267
12268 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12269 trg.SetPersistentPairID(persistentID);
12270 explosive.SetPersistentPairID(persistentID);
12271
12272 return true;
12273 }
12274 return false;
12275 }
12276
12279 {
12280 float ret = 1.0;
12283 ret *= GetHealth01();
12284
12285 return ret;
12286 }
12287
12288 #ifdef DEVELOPER
12289 override void SetDebugItem()
12290 {
12291 super.SetDebugItem();
12292 _itemBase = this;
12293 }
12294
12296 {
12297 string text = super.GetDebugText();
12298
12300 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12301
12302 return text;
12303 }
12304 #endif
12305
12307 {
12308 return true;
12309 }
12310
12312
12314
12316 {
12319 }
12320
12321
12329
12345}
12346
12348{
12350 if (entity)
12351 {
12352 bool is_item = entity.IsInherited(
ItemBase);
12353 if (is_item && full_quantity)
12354 {
12357 }
12358 }
12359 else
12360 {
12362 return NULL;
12363 }
12364 return entity;
12365}
12366
12368{
12369 if (item)
12370 {
12371 if (health > 0)
12372 item.SetHealth("", "", health);
12373
12374 if (item.CanHaveTemperature())
12375 {
12377 if (item.CanFreeze())
12378 item.SetFrozen(false);
12379 }
12380
12381 if (item.HasEnergyManager())
12382 {
12383 if (quantity >= 0)
12384 {
12385 item.GetCompEM().SetEnergy0To1(quantity);
12386 }
12387 else
12388 {
12390 }
12391 }
12392 else if (item.IsMagazine())
12393 {
12394 Magazine mag = Magazine.Cast(item);
12395 if (quantity >= 0)
12396 {
12397 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12398 }
12399 else
12400 {
12402 }
12403
12404 }
12405 else
12406 {
12407 if (quantity >= 0)
12408 {
12409 item.SetQuantityNormalized(quantity, false);
12410 }
12411 else
12412 {
12414 }
12415
12416 }
12417 }
12418}
12419
12420#ifdef DEVELOPER
12422#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.