7468{
7470 {
7471 return true;
7472 }
7473};
7474
7475
7476
7478{
7482
7484
7487
7488
7489
7490
7491
7500
7506
7511
7516
7537 protected bool m_IsResultOfSplit
7538
7540
7545
7546
7547
7549
7553
7554
7555
7557
7560
7561
7562
7568
7569
7577
7580
7581
7583
7584
7586
7587
7592
7593
7598
7599
7601
7602
7604 {
7609
7610 if (!
GetGame().IsDedicatedServer())
7611 {
7613 {
7615
7617 {
7619 }
7620 }
7621
7624 }
7625
7626 m_OldLocation = null;
7627
7629 {
7631 }
7632
7633 if (ConfigIsExisting("headSelectionsToHide"))
7634 {
7637 }
7638
7640 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7641 {
7643 }
7644
7646
7647 m_IsResultOfSplit = false;
7648
7650 }
7651
7653 {
7654 super.InitItemVariables();
7655
7661 m_Count = ConfigGetInt(
"count");
7662
7665
7670
7673
7678
7690
7694
7695
7698 if (ConfigIsExisting("canBeSplit"))
7699 {
7702 }
7703
7705 if (ConfigIsExisting("itemBehaviour"))
7707
7708
7711 RegisterNetSyncVariableInt("m_VarLiquidType");
7712 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7713
7714 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7715 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7716 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7717
7718 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7719 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7720 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7721 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7722
7723 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7724 RegisterNetSyncVariableBool("m_IsTakeable");
7725 RegisterNetSyncVariableBool("m_IsHologram");
7726
7729 {
7732 }
7733
7735
7737 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7739
7740 }
7741
7743 {
7745 }
7746
7748 {
7751 {
7756 }
7757 }
7758
7759 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7760 {
7762 {
7765 }
7766
7768 }
7769
7771 {
7777 }
7778
7780
7782 {
7784
7785 if (!action)
7786 {
7787 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7788 return;
7789 }
7790
7792 if (!ai)
7793 {
7795 return;
7796 }
7797
7799 if (!action_array)
7800 {
7801 action_array = new array<ActionBase_Basic>;
7803 }
7804 if (LogManager.IsActionLogEnable())
7805 {
7806 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7807 }
7808
7809 if (action_array.Find(action) != -1)
7810 {
7811 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7812 }
7813 else
7814 {
7815 action_array.Insert(action);
7816 }
7817 }
7818
7820 {
7822 ActionBase action = player.GetActionManager().GetAction(actionName);
7825
7826 if (action_array)
7827 {
7828 action_array.RemoveItem(action);
7829 }
7830 }
7831
7832
7833
7835 {
7836 ActionOverrideData overrideData = new ActionOverrideData();
7840
7842 if (!actionMap)
7843 {
7846 }
7847
7848 actionMap.Insert(this.
Type(), overrideData);
7849
7850 }
7851
7853
7855
7856
7858 {
7861
7864
7865 string config_to_search = "CfgVehicles";
7866 string muzzle_owner_config;
7867
7869 {
7870 if (IsInherited(Weapon))
7871 config_to_search = "CfgWeapons";
7872
7873 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7874
7875 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7876
7878
7879 if (config_OnFire_subclass_count > 0)
7880 {
7881 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7882
7883 for (int i = 0; i < config_OnFire_subclass_count; i++)
7884 {
7885 string particle_class = "";
7887 string config_OnFire_entry = config_OnFire_class + particle_class;
7888 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7889 WPOF_array.Insert(WPOF);
7890 }
7891
7892
7894 }
7895 }
7896
7898 {
7899 config_to_search = "CfgWeapons";
7900 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7901
7902 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7903
7905
7906 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7907 {
7908 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7909
7910 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7911 {
7912 string particle_class2 = "";
7914 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7915 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7916 WPOBE_array.Insert(WPOBE);
7917 }
7918
7919
7921 }
7922 }
7923 }
7924
7925
7927 {
7930
7932 {
7933 string config_to_search = "CfgVehicles";
7934
7935 if (IsInherited(Weapon))
7936 config_to_search = "CfgWeapons";
7937
7938 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7939 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7940
7941 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7942 {
7943
7945
7947 {
7949 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7951 return;
7952 }
7953
7956
7957
7958
7960 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7961
7962 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7963 {
7964 string particle_class = "";
7966 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7968
7969 if (entry_type == CT_CLASS)
7970 {
7971 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7972 WPOOH_array.Insert(WPOF);
7973 }
7974 }
7975
7976
7978 }
7979 }
7980 }
7981
7983 {
7985 }
7986
7988 {
7990 {
7992
7995
7998
7999 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8000 }
8001 }
8002
8004 {
8006 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8007
8009 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8010
8012 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8013
8015 {
8017 }
8018 }
8019
8021 {
8023 }
8024
8026 {
8029 else
8031
8033 {
8036 }
8037 else
8038 {
8041
8044 }
8045
8047 }
8048
8050 {
8052 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8053 }
8054
8056 {
8058 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8060 }
8061
8063 {
8065 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8066 }
8067
8069 {
8072
8073 OverheatingParticle OP = new OverheatingParticle();
8078
8080 }
8081
8083 {
8086
8087 return -1;
8088 }
8089
8091 {
8093 {
8096
8097 for (int i = count; i > 0; --i)
8098 {
8099 int id = i - 1;
8102
8105
8106 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8107 {
8108 if (p)
8109 {
8112 }
8113 }
8114 }
8115 }
8116 }
8117
8119 {
8121 {
8123 {
8124 int id = i - 1;
8126
8127 if (OP)
8128 {
8130
8131 if (p)
8132 {
8134 }
8135
8136 delete OP;
8137 }
8138 }
8139
8142 }
8143 }
8144
8147 {
8148 return 0.0;
8149 }
8150
8151
8153 {
8154 return 250;
8155 }
8156
8158 {
8159 return 0;
8160 }
8161
8164 {
8166 return true;
8167
8168 return false;
8169 }
8170
8173 {
8176
8178 {
8180 }
8181 else
8182 {
8183
8185 }
8186
8188 }
8189
8196 {
8197 return -1;
8198 }
8199
8200
8201
8202
8204 {
8206 {
8208 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8209
8210 if (r_index >= 0)
8211 {
8212 InventoryLocation r_il = new InventoryLocation;
8213 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8214
8215 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8218 {
8219 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8220 }
8222 {
8223 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8224 }
8225
8226 }
8227
8228 player.GetHumanInventory().ClearUserReservedLocation(this);
8229 }
8230
8233 }
8234
8235
8236
8237
8239 {
8240 return ItemBase.m_DebugActionsMask;
8241 }
8242
8244 {
8245 return ItemBase.m_DebugActionsMask & mask;
8246 }
8247
8249 {
8250 ItemBase.m_DebugActionsMask = mask;
8251 }
8252
8254 {
8255 ItemBase.m_DebugActionsMask |= mask;
8256 }
8257
8259 {
8260 ItemBase.m_DebugActionsMask &= ~mask;
8261 }
8262
8264 {
8266 {
8268 }
8269 else
8270 {
8272 }
8273 }
8274
8275
8277 {
8278 if (GetEconomyProfile())
8279 {
8280 float q_max = GetEconomyProfile().GetQuantityMax();
8281 if (q_max > 0)
8282 {
8283 float q_min = GetEconomyProfile().GetQuantityMin();
8284 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8285
8287 {
8288 ComponentEnergyManager comp = GetCompEM();
8290 {
8292 }
8293 }
8295 {
8297
8298 }
8299
8300 }
8301 }
8302 }
8303
8306 {
8307 EntityAI parent = GetHierarchyParent();
8308
8309 if (parent)
8310 {
8311 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8312 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8313 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8314 }
8315 }
8316
8319 {
8320 EntityAI parent = GetHierarchyParent();
8321
8322 if (parent)
8323 {
8324 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8325 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8326 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8327 }
8328 }
8329
8331 {
8332
8333
8334
8335
8337
8339 {
8340 if (ScriptInputUserData.CanStoreInputUserData())
8341 {
8342 ScriptInputUserData ctx = new ScriptInputUserData;
8348 ctx.
Write(use_stack_max);
8351
8353 {
8354 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8355 }
8356 }
8357 }
8358 else if (!
GetGame().IsMultiplayer())
8359 {
8361 }
8362 }
8363
8365 {
8367 }
8368
8370 {
8372 }
8373
8375 {
8377 }
8378
8380 {
8381
8382 return false;
8383 }
8384
8386 {
8387 return false;
8388 }
8389
8393 {
8394 return false;
8395 }
8396
8398 {
8399 return "";
8400 }
8401
8403
8405 {
8406 return false;
8407 }
8408
8410 {
8411 return true;
8412 }
8413
8414
8415
8417 {
8418 return true;
8419 }
8420
8422 {
8423 return true;
8424 }
8425
8427 {
8428 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8430 }
8431
8433 {
8435 }
8436
8438 {
8440 if (!is_being_placed)
8442 SetSynchDirty();
8443 }
8444
8445
8447
8449 {
8451 }
8452
8454 {
8456 }
8457
8459 {
8460 return 1;
8461 }
8462
8464 {
8465 return false;
8466 }
8467
8469 {
8471 SetSynchDirty();
8472 }
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8509 {
8510 super.OnMovedInsideCargo(container);
8511
8512 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8513 }
8514
8515 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8516 {
8517 super.EEItemLocationChanged(oldLoc,newLoc);
8518
8519 PlayerBase new_player = null;
8520 PlayerBase old_player = null;
8521
8522 if (newLoc.GetParent())
8523 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8524
8525 if (oldLoc.GetParent())
8526 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8527
8529 {
8530 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8531
8532 if (r_index >= 0)
8533 {
8534 InventoryLocation r_il = new InventoryLocation;
8535 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8536
8537 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8540 {
8541 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8542 }
8544 {
8545 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8546 }
8547
8548 }
8549 }
8550
8552 {
8553 if (new_player)
8554 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8555
8556 if (new_player == old_player)
8557 {
8558
8559 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8560 {
8562 {
8563 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8564 {
8565 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8566 }
8567 }
8568 else
8569 {
8570 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8571 }
8572 }
8573
8574 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8575 {
8576 int type = oldLoc.GetType();
8578 {
8579 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8580 }
8582 {
8583 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8584 }
8585 }
8586 if (!m_OldLocation)
8587 {
8588 m_OldLocation = new InventoryLocation;
8589 }
8590 m_OldLocation.Copy(oldLoc);
8591 }
8592 else
8593 {
8594 if (m_OldLocation)
8595 {
8596 m_OldLocation.Reset();
8597 }
8598 }
8599
8601 }
8602 else
8603 {
8604 if (new_player)
8605 {
8606 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8607 if (res_index >= 0)
8608 {
8609 InventoryLocation il = new InventoryLocation;
8610 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8612 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8615 {
8616 il.
GetParent().GetOnReleaseLock().Invoke(it);
8617 }
8619 {
8621 }
8622
8623 }
8624 }
8626 {
8627
8629 }
8630
8631 if (m_OldLocation)
8632 {
8633 m_OldLocation.Reset();
8634 }
8635 }
8636 }
8637
8638 override void EOnContact(IEntity other, Contact extra)
8639 {
8641 {
8642 int liquidType = -1;
8644 if (impactSpeed > 0.0)
8645 {
8647 #ifndef SERVER
8649 #else
8651 SetSynchDirty();
8652 #endif
8654 }
8655 }
8656
8657 #ifdef SERVER
8658 if (GetCompEM() && GetCompEM().IsPlugged())
8659 {
8660 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8661 GetCompEM().UnplugThis();
8662 }
8663 #endif
8664 }
8665
8667
8669 {
8671 }
8672
8674 {
8675
8676 }
8677
8679 {
8680 super.OnItemLocationChanged(old_owner, new_owner);
8681
8682 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8683 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8684
8685 if (!relatedPlayer && playerNew)
8686 relatedPlayer = playerNew;
8687
8688 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8689 {
8691 if (actionMgr)
8692 {
8693 ActionBase currentAction = actionMgr.GetRunningAction();
8694 if (currentAction)
8696 }
8697 }
8698
8699 Man ownerPlayerOld = null;
8700 Man ownerPlayerNew = null;
8701
8702 if (old_owner)
8703 {
8704 if (old_owner.
IsMan())
8705 {
8706 ownerPlayerOld = Man.Cast(old_owner);
8707 }
8708 else
8709 {
8710 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8711 }
8712 }
8713 else
8714 {
8716 {
8718
8719 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8720 {
8721 GetCompEM().UnplugThis();
8722 }
8723 }
8724 }
8725
8726 if (new_owner)
8727 {
8728 if (new_owner.
IsMan())
8729 {
8730 ownerPlayerNew = Man.Cast(new_owner);
8731 }
8732 else
8733 {
8734 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8735 }
8736 }
8737
8738 if (ownerPlayerOld != ownerPlayerNew)
8739 {
8740 if (ownerPlayerOld)
8741 {
8742 array<EntityAI> subItemsExit = new array<EntityAI>;
8744 for (int i = 0; i < subItemsExit.Count(); i++)
8745 {
8748 }
8749 }
8750
8751 if (ownerPlayerNew)
8752 {
8753 array<EntityAI> subItemsEnter = new array<EntityAI>;
8755 for (int j = 0; j < subItemsEnter.Count(); j++)
8756 {
8759 }
8760 }
8761 }
8762 else if (ownerPlayerNew != null)
8763 {
8764 PlayerBase nplayer;
8765 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8766 {
8767 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8769 for (int k = 0; k < subItemsUpdate.Count(); k++)
8770 {
8772 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8773 }
8774 }
8775 }
8776
8777 if (old_owner)
8778 old_owner.OnChildItemRemoved(this);
8779 if (new_owner)
8780 new_owner.OnChildItemReceived(this);
8781 }
8782
8783
8785 {
8786 super.EEDelete(parent);
8787 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8788 if (player)
8789 {
8791
8792 if (player.IsAlive())
8793 {
8794 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8795 if (r_index >= 0)
8796 {
8797 InventoryLocation r_il = new InventoryLocation;
8798 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8799
8800 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8803 {
8804 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8805 }
8807 {
8808 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8809 }
8810
8811 }
8812
8813 player.RemoveQuickBarEntityShortcut(this);
8814 }
8815 }
8816 }
8817
8819 {
8820 super.EEKilled(killer);
8821
8824 {
8825 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8826 {
8827 if (IsMagazine())
8828 {
8829 if (Magazine.Cast(this).GetAmmoCount() > 0)
8830 {
8832 }
8833 }
8834 else
8835 {
8837 }
8838 }
8839 }
8840 }
8841
8843 {
8844 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8845
8846 super.OnWasAttached(parent, slot_id);
8847
8850
8852 }
8853
8855 {
8856 super.OnWasDetached(parent, slot_id);
8857
8860 }
8861
8863 {
8864 int idx;
8867
8868 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8869 if (inventory_slots.Count() < 1)
8870 {
8871 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8872 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8873 }
8874 else
8875 {
8876 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8877 }
8878
8879 idx = inventory_slots.Find(slot);
8880 if (idx < 0)
8881 return "";
8882
8883 return attach_types.Get(idx);
8884 }
8885
8887 {
8888 int idx = -1;
8889 string slot;
8890
8893
8894 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8895 if (inventory_slots.Count() < 1)
8896 {
8897 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8898 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8899 }
8900 else
8901 {
8902 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8903 if (detach_types.Count() < 1)
8904 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8905 }
8906
8907 for (int i = 0; i < inventory_slots.Count(); i++)
8908 {
8909 slot = inventory_slots.Get(i);
8910 }
8911
8912 if (slot != "")
8913 {
8914 if (detach_types.Count() == 1)
8915 idx = 0;
8916 else
8917 idx = inventory_slots.Find(slot);
8918 }
8919 if (idx < 0)
8920 return "";
8921
8922 return detach_types.Get(idx);
8923 }
8924
8926 {
8927
8929
8930
8931 float min_time = 1;
8932 float max_time = 3;
8933 float delay = Math.RandomFloat(min_time, max_time);
8934
8935 explode_timer.Run(delay, this, "DoAmmoExplosion");
8936 }
8937
8939 {
8940 Magazine magazine = Magazine.Cast(this);
8941 int pop_sounds_count = 6;
8942 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8943
8944
8945 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8946 string sound_name = pop_sounds[ sound_idx ];
8948
8949
8950 magazine.ServerAddAmmoCount(-1);
8951
8952
8953 float min_temp_to_explode = 100;
8954
8955 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8956 {
8958 }
8959 }
8960
8961
8962 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8963 {
8964 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8965
8966 const int CHANCE_DAMAGE_CARGO = 4;
8967 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8968 const int CHANCE_DAMAGE_NOTHING = 2;
8969
8971 {
8972 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8973 int chances;
8974 int rnd;
8975
8976 if (GetInventory().GetCargo())
8977 {
8978 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8979 rnd = Math.RandomInt(0,chances);
8980
8981 if (rnd < CHANCE_DAMAGE_CARGO)
8982 {
8984 }
8985 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8986 {
8988 }
8989 }
8990 else
8991 {
8992 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8993 rnd = Math.RandomInt(0,chances);
8994
8995 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8996 {
8998 }
8999 }
9000 }
9001 }
9002
9004 {
9005 if (GetInventory().GetCargo())
9006 {
9007 int item_count = GetInventory().GetCargo().GetItemCount();
9008 if (item_count > 0)
9009 {
9010 int random_pick = Math.RandomInt(0, item_count);
9012 if (!item.IsExplosive())
9013 {
9014 item.AddHealth("","",damage);
9015 return true;
9016 }
9017 }
9018 }
9019 return false;
9020 }
9021
9023 {
9024 int attachment_count = GetInventory().AttachmentCount();
9025 if (attachment_count > 0)
9026 {
9027 int random_pick = Math.RandomInt(0, attachment_count);
9028 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9029 if (!attachment.IsExplosive())
9030 {
9031 attachment.AddHealth("","",damage);
9032 return true;
9033 }
9034 }
9035 return false;
9036 }
9037
9039 {
9041 }
9042
9044 {
9046 return GetInventory().CanRemoveEntity();
9047
9048 return false;
9049 }
9050
9052 {
9054 return;
9055
9057 {
9058 if (ScriptInputUserData.CanStoreInputUserData())
9059 {
9060 ScriptInputUserData ctx = new ScriptInputUserData;
9065 ctx.
Write(destination_entity);
9069 }
9070 }
9071 else if (!
GetGame().IsMultiplayer())
9072 {
9074 }
9075 }
9076
9078 {
9080 return;
9081
9082 float split_quantity_new;
9086 InventoryLocation loc = new InventoryLocation;
9087
9088 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9089 {
9091 split_quantity_new = stack_max;
9092 else
9094
9095 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9096 if (new_item)
9097 {
9098 new_item.SetResultOfSplit(true);
9099 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9101 new_item.SetQuantity(split_quantity_new);
9102 }
9103 }
9104 else if (destination_entity && slot_id == -1)
9105 {
9106 if (quantity > stack_max)
9107 split_quantity_new = stack_max;
9108 else
9109 split_quantity_new = quantity;
9110
9112 {
9115 }
9116
9117 if (new_item)
9118 {
9119 new_item.SetResultOfSplit(true);
9120 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9122 new_item.SetQuantity(split_quantity_new);
9123 }
9124 }
9125 else
9126 {
9127 if (stack_max != 0)
9128 {
9130 {
9132 }
9133
9134 if (split_quantity_new == 0)
9135 {
9136 if (!
GetGame().IsMultiplayer())
9137 player.PhysicalPredictiveDropItem(this);
9138 else
9139 player.ServerDropEntity(this);
9140 return;
9141 }
9142
9144
9145 if (new_item)
9146 {
9147 new_item.SetResultOfSplit(true);
9148 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9150 new_item.SetQuantity(stack_max);
9151 new_item.PlaceOnSurface();
9152 }
9153 }
9154 }
9155 }
9156
9158 {
9160 return;
9161
9162 float split_quantity_new;
9166 InventoryLocation loc = new InventoryLocation;
9167
9168 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9169 {
9171 split_quantity_new = stack_max;
9172 else
9174
9175 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9176 if (new_item)
9177 {
9178 new_item.SetResultOfSplit(true);
9179 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9181 new_item.SetQuantity(split_quantity_new);
9182 }
9183 }
9184 else if (destination_entity && slot_id == -1)
9185 {
9186 if (quantity > stack_max)
9187 split_quantity_new = stack_max;
9188 else
9189 split_quantity_new = quantity;
9190
9192 {
9195 }
9196
9197 if (new_item)
9198 {
9199 new_item.SetResultOfSplit(true);
9200 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9202 new_item.SetQuantity(split_quantity_new);
9203 }
9204 }
9205 else
9206 {
9207 if (stack_max != 0)
9208 {
9210 {
9212 }
9213
9215
9216 if (new_item)
9217 {
9218 new_item.SetResultOfSplit(true);
9219 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9221 new_item.SetQuantity(stack_max);
9222 new_item.PlaceOnSurface();
9223 }
9224 }
9225 }
9226 }
9227
9229 {
9231 return;
9232
9234 {
9235 if (ScriptInputUserData.CanStoreInputUserData())
9236 {
9237 ScriptInputUserData ctx = new ScriptInputUserData;
9242 dst.WriteToContext(ctx);
9244 }
9245 }
9246 else if (!
GetGame().IsMultiplayer())
9247 {
9249 }
9250 }
9251
9253 {
9255 return;
9256
9258 {
9259 if (ScriptInputUserData.CanStoreInputUserData())
9260 {
9261 ScriptInputUserData ctx = new ScriptInputUserData;
9266 ctx.
Write(destination_entity);
9272 }
9273 }
9274 else if (!
GetGame().IsMultiplayer())
9275 {
9277 }
9278 }
9279
9281 {
9283 }
9284
9286 {
9288 return this;
9289
9291 float split_quantity_new;
9293 if (dst.IsValid())
9294 {
9295 int slot_id = dst.GetSlot();
9297
9298 if (quantity > stack_max)
9299 split_quantity_new = stack_max;
9300 else
9301 split_quantity_new = quantity;
9302
9304
9305 if (new_item)
9306 {
9307 new_item.SetResultOfSplit(true);
9308 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9311 }
9312
9313 return new_item;
9314 }
9315
9316 return null;
9317 }
9318
9320 {
9322 return;
9323
9325 float split_quantity_new;
9327 if (destination_entity)
9328 {
9330 if (quantity > stackable)
9331 split_quantity_new = stackable;
9332 else
9333 split_quantity_new = quantity;
9334
9335 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9336 if (new_item)
9337 {
9338 new_item.SetResultOfSplit(true);
9339 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9341 new_item.SetQuantity(split_quantity_new);
9342 }
9343 }
9344 }
9345
9347 {
9349 return;
9350
9352 {
9353 if (ScriptInputUserData.CanStoreInputUserData())
9354 {
9355 ScriptInputUserData ctx = new ScriptInputUserData;
9360 ItemBase destination_entity =
this;
9361 ctx.
Write(destination_entity);
9365 }
9366 }
9367 else if (!
GetGame().IsMultiplayer())
9368 {
9370 }
9371 }
9372
9374 {
9376 return;
9377
9379 float split_quantity_new;
9381 if (player)
9382 {
9384 if (quantity > stackable)
9385 split_quantity_new = stackable;
9386 else
9387 split_quantity_new = quantity;
9388
9389 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9390 new_item =
ItemBase.Cast(in_hands);
9391 if (new_item)
9392 {
9393 new_item.SetResultOfSplit(true);
9394 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9396 new_item.SetQuantity(split_quantity_new);
9397 }
9398 }
9399 }
9400
9402 {
9404 return;
9405
9407 float split_quantity_new = Math.Floor(quantity * 0.5);
9408
9410
9411 if (new_item)
9412 {
9413 if (new_item.GetQuantityMax() < split_quantity_new)
9414 {
9415 split_quantity_new = new_item.GetQuantityMax();
9416 }
9417
9418 new_item.SetResultOfSplit(true);
9419 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9420
9422 {
9425 }
9426 else
9427 {
9430 }
9431 }
9432 }
9433
9435 {
9437 return;
9438
9440 float split_quantity_new = Math.Floor(quantity / 2);
9441
9442 InventoryLocation invloc = new InventoryLocation;
9444
9446 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9447
9448 if (new_item)
9449 {
9450 if (new_item.GetQuantityMax() < split_quantity_new)
9451 {
9452 split_quantity_new = new_item.GetQuantityMax();
9453 }
9455 {
9458 }
9459 else
9460 {
9463 }
9464 }
9465 }
9466
9469 {
9470 SetWeightDirty();
9472
9473 if (parent)
9474 parent.OnAttachmentQuantityChangedEx(this, delta);
9475
9477 {
9479 {
9481 }
9483 {
9484 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9486 }
9487 }
9488
9489 }
9490
9493 {
9494
9495 }
9496
9499 {
9501 }
9502
9504 {
9505 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9506
9508 {
9509 if (newLevel == GameConstants.STATE_RUINED)
9510 {
9512 EntityAI parent = GetHierarchyParent();
9513 if (parent && parent.IsFireplace())
9514 {
9515 CargoBase cargo = GetInventory().GetCargo();
9516 if (cargo)
9517 {
9519 {
9521 }
9522 }
9523 }
9524 }
9525
9527 {
9528
9530 return;
9531 }
9532
9533 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9534 {
9536 }
9537 }
9538 }
9539
9540
9542 {
9543 super.OnRightClick();
9544
9546 {
9548 {
9549 if (ScriptInputUserData.CanStoreInputUserData())
9550 {
9551 vector m4[4];
9553
9554 EntityAI root = GetHierarchyRoot();
9555
9556 InventoryLocation dst = new InventoryLocation;
9558 {
9559 if (root)
9560 {
9561 root.GetTransform(m4);
9563 }
9564 else
9565 GetInventory().GetCurrentInventoryLocation(dst);
9566 }
9567 else
9568 {
9570
9571
9572 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9573 {
9574 if (root)
9575 {
9576 root.GetTransform(m4);
9578 }
9579 else
9580 GetInventory().GetCurrentInventoryLocation(dst);
9581 }
9582 else
9583 {
9584 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9585 }
9586 }
9587
9588 ScriptInputUserData ctx = new ScriptInputUserData;
9596 }
9597 }
9598 else if (!
GetGame().IsMultiplayer())
9599 {
9601 }
9602 }
9603 }
9604
9605 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9606 {
9607
9608 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9609 return false;
9610
9611 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9612 return false;
9613
9614
9616 return false;
9617
9618
9619 Magazine mag = Magazine.Cast(this);
9620 if (mag)
9621 {
9622 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9623 return false;
9624
9625 if (stack_max_limit)
9626 {
9627 Magazine other_mag = Magazine.Cast(other_item);
9628 if (other_item)
9629 {
9630 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9631 return false;
9632 }
9633
9634 }
9635 }
9636 else
9637 {
9638
9640 return false;
9641
9643 return false;
9644 }
9645
9646 PlayerBase player = null;
9647 if (CastTo(player, GetHierarchyRootPlayer()))
9648 {
9649 if (player.GetInventory().HasAttachment(this))
9650 return false;
9651
9652 if (player.IsItemsToDelete())
9653 return false;
9654 }
9655
9656 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9657 return false;
9658
9659 int slotID;
9661 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9662 return false;
9663
9664 return true;
9665 }
9666
9668 {
9670 }
9671
9673 {
9674 return m_IsResultOfSplit;
9675 }
9676
9678 {
9679 m_IsResultOfSplit = value;
9680 }
9681
9683 {
9685 }
9686
9688 {
9689 float other_item_quantity = other_item.GetQuantity();
9690 float this_free_space;
9691
9693
9695
9696 if (other_item_quantity > this_free_space)
9697 {
9698 return this_free_space;
9699 }
9700 else
9701 {
9702 return other_item_quantity;
9703 }
9704 }
9705
9707 {
9709 }
9710
9712 {
9714 return;
9715
9716 if (!IsMagazine() && other_item)
9717 {
9719 if (quantity_used != 0)
9720 {
9721 float hp1 = GetHealth01("","");
9722 float hp2 = other_item.GetHealth01("","");
9723 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9724 hpResult = hpResult / (
GetQuantity() + quantity_used);
9725
9726 hpResult *= GetMaxHealth();
9727 Math.Round(hpResult);
9728 SetHealth("", "Health", hpResult);
9729
9731 other_item.AddQuantity(-quantity_used);
9732 }
9733 }
9735 }
9736
9738 {
9739 #ifdef SERVER
9740 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9741 GetHierarchyParent().IncreaseLifetimeUp();
9742 #endif
9743 };
9744
9746 {
9747 PlayerBase p = PlayerBase.Cast(player);
9748
9749 array<int> recipesIds = p.m_Recipes;
9750 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9751 if (moduleRecipesManager)
9752 {
9753 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9754 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9755 }
9756
9757 for (int i = 0;i < recipesIds.Count(); i++)
9758 {
9759 int key = recipesIds.Get(i);
9760 string recipeName = moduleRecipesManager.GetRecipeName(key);
9762 }
9763 }
9764
9765
9766 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9767 {
9768 super.GetDebugActions(outputList);
9769
9770
9775
9776
9780
9784
9785
9788
9789
9791 {
9794 }
9795
9797
9800
9804 }
9805
9806
9807
9808
9810 {
9811 super.OnAction(action_id, player, ctx);
9812 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9813 {
9814 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9815 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9816 PlayerBase p = PlayerBase.Cast(player);
9817 if (
EActions.RECIPES_RANGE_START < 1000)
9818 {
9819 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9820 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9821 }
9822 }
9823 #ifndef SERVER
9824 else if (action_id ==
EActions.WATCH_PLAYER)
9825 {
9826 PluginDeveloper.SetDeveloperItemClientEx(player);
9827 }
9828 #endif
9830 {
9831 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9832 {
9833 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9834 OnDebugButtonPressServer(id + 1);
9835 }
9836
9837 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9838 {
9839 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9841 }
9842
9843 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9844 {
9845 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9847 }
9848
9849 else if (action_id ==
EActions.ADD_QUANTITY)
9850 {
9851 if (IsMagazine())
9852 {
9853 Magazine mag = Magazine.Cast(this);
9854 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9855 }
9856 else
9857 {
9859 }
9860
9861 if (m_EM)
9862 {
9863 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9864 }
9865
9866 }
9867
9868 else if (action_id ==
EActions.REMOVE_QUANTITY)
9869 {
9870 if (IsMagazine())
9871 {
9872 Magazine mag2 = Magazine.Cast(this);
9873 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9874 }
9875 else
9876 {
9878 }
9879 if (m_EM)
9880 {
9881 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9882 }
9883
9884 }
9885
9886 else if (action_id ==
EActions.SET_QUANTITY_0)
9887 {
9889
9890 if (m_EM)
9891 {
9892 m_EM.SetEnergy(0);
9893 }
9894 }
9895
9896 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9897 {
9899
9900 if (m_EM)
9901 {
9902 m_EM.SetEnergy(m_EM.GetEnergyMax());
9903 }
9904 }
9905
9906 else if (action_id ==
EActions.ADD_HEALTH)
9907 {
9908 AddHealth("","",GetMaxHealth("","Health")/5);
9909 }
9910 else if (action_id ==
EActions.REMOVE_HEALTH)
9911 {
9912 AddHealth("","",-GetMaxHealth("","Health")/5);
9913 }
9914 else if (action_id ==
EActions.DESTROY_HEALTH)
9915 {
9916 SetHealth01("","",0);
9917 }
9918 else if (action_id ==
EActions.WATCH_ITEM)
9919 {
9921 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9922 #ifdef DEVELOPER
9923 SetDebugDeveloper_item(this);
9924 #endif
9925 }
9926
9927 else if (action_id ==
EActions.ADD_TEMPERATURE)
9928 {
9929 AddTemperature(20);
9930
9931 }
9932
9933 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9934 {
9935 AddTemperature(-20);
9936
9937 }
9938
9939 else if (action_id ==
EActions.FLIP_FROZEN)
9940 {
9941 SetFrozen(!GetIsFrozen());
9942
9943 }
9944
9945 else if (action_id ==
EActions.ADD_WETNESS)
9946 {
9948
9949 }
9950
9951 else if (action_id ==
EActions.REMOVE_WETNESS)
9952 {
9954
9955 }
9956
9957 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9958 {
9961
9962
9963 }
9964
9965 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9966 {
9969 }
9970
9971 else if (action_id ==
EActions.MAKE_SPECIAL)
9972 {
9973 auto debugParams = DebugSpawnParams.WithPlayer(player);
9974 OnDebugSpawnEx(debugParams);
9975 }
9976
9977 else if (action_id ==
EActions.DELETE)
9978 {
9979 Delete();
9980 }
9981
9982 }
9983
9984
9985 return false;
9986 }
9987
9988
9989
9990
9994
9997
9998
9999
10001 {
10002 return false;
10003 }
10004
10005
10007 {
10008 return true;
10009 }
10010
10011
10013 {
10014 return true;
10015 }
10016
10017
10018
10020 {
10021 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10023 }
10024
10027 {
10028 return null;
10029 }
10030
10032 {
10033 return false;
10034 }
10035
10037 {
10038 return false;
10039 }
10040
10044
10045
10047 {
10048 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10049 return module_repairing.CanRepair(this, item_repair_kit);
10050 }
10051
10052
10053 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10054 {
10055 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10056 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10057 }
10058
10059
10061 {
10062
10063
10064
10065
10066
10067
10068
10069
10070 return 1;
10071 }
10072
10073
10074
10076 {
10078 }
10079
10080
10081
10083 {
10085 }
10086
10087
10096 {
10097 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10098
10099 if (player)
10100 {
10101 player.MessageStatus(text);
10102 }
10103 }
10104
10105
10114 {
10115 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10116
10117 if (player)
10118 {
10119 player.MessageAction(text);
10120 }
10121 }
10122
10123
10132 {
10133 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10134
10135 if (player)
10136 {
10137 player.MessageFriendly(text);
10138 }
10139 }
10140
10141
10150 {
10151 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10152
10153 if (player)
10154 {
10155 player.MessageImportant(text);
10156 }
10157 }
10158
10160 {
10161 return true;
10162 }
10163
10164
10165 override bool KindOf(
string tag)
10166 {
10167 bool found = false;
10168 string item_name = this.
GetType();
10171
10172 int array_size = item_tag_array.Count();
10173 for (int i = 0; i < array_size; i++)
10174 {
10175 if (item_tag_array.Get(i) == tag)
10176 {
10177 found = true;
10178 break;
10179 }
10180 }
10181 return found;
10182 }
10183
10184
10186 {
10187
10188 super.OnRPC(sender, rpc_type,ctx);
10189
10190
10191 switch (rpc_type)
10192 {
10193 #ifndef SERVER
10194 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10195 Param2<bool, string> p = new Param2<bool, string>(false, "");
10196
10198 return;
10199
10200 bool play = p.param1;
10201 string soundSet = p.param2;
10202
10203 if (play)
10204 {
10206 {
10208 {
10210 }
10211 }
10212 else
10213 {
10215 }
10216 }
10217 else
10218 {
10220 }
10221
10222 break;
10223 #endif
10224
10225 }
10226
10228 {
10230 }
10231 }
10232
10233
10234
10235
10237 {
10238 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10239 return plugin.GetID(
name);
10240 }
10241
10243 {
10244 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10245 return plugin.GetName(id);
10246 }
10247
10250 {
10251
10252
10253 int varFlags;
10254 if (!ctx.
Read(varFlags))
10255 return;
10256
10257 if (varFlags & ItemVariableFlags.FLOAT)
10258 {
10260 }
10261 }
10262
10264 {
10265
10266 super.SerializeNumericalVars(floats_out);
10267
10268
10269
10271 {
10273 }
10274
10276 {
10278 }
10279
10281 {
10283 }
10284
10286 {
10291 }
10292
10294 {
10296 }
10297 }
10298
10300 {
10301
10302 super.DeSerializeNumericalVars(floats);
10303
10304
10305 int index = 0;
10306 int mask = Math.Round(floats.Get(index));
10307
10308 index++;
10309
10311 {
10313 {
10315 }
10316 else
10317 {
10318 float quantity = floats.Get(index);
10319 SetQuantity(quantity,
true,
false,
false,
false);
10320 }
10321 index++;
10322 }
10323
10325 {
10326 float wet = floats.Get(index);
10328 index++;
10329 }
10330
10332 {
10333 int liquidtype = Math.Round(floats.Get(index));
10335 index++;
10336 }
10337
10339 {
10341 index++;
10343 index++;
10345 index++;
10347 index++;
10348 }
10349
10351 {
10352 int cleanness = Math.Round(floats.Get(index));
10354 index++;
10355 }
10356 }
10357
10359 {
10360 super.WriteVarsToCTX(ctx);
10361
10362
10364 {
10366 }
10367
10369 {
10371 }
10372
10374 {
10376 }
10377
10379 {
10380 int r,g,b,a;
10386 }
10387
10389 {
10391 }
10392 }
10393
10395 {
10396 if (!super.ReadVarsFromCTX(ctx,version))
10397 return false;
10398
10399 int intValue;
10400 float value;
10401
10402 if (version < 140)
10403 {
10404 if (!ctx.
Read(intValue))
10405 return false;
10406
10407 m_VariablesMask = intValue;
10408 }
10409
10411 {
10412 if (!ctx.
Read(value))
10413 return false;
10414
10416 {
10418 }
10419 else
10420 {
10422 }
10423 }
10424
10425 if (version < 140)
10426 {
10428 {
10429 if (!ctx.
Read(value))
10430 return false;
10431 SetTemperatureDirect(value);
10432 }
10433 }
10434
10436 {
10437 if (!ctx.
Read(value))
10438 return false;
10440 }
10441
10443 {
10444 if (!ctx.
Read(intValue))
10445 return false;
10447 }
10448
10450 {
10451 int r,g,b,a;
10453 return false;
10455 return false;
10457 return false;
10459 return false;
10460
10462 }
10463
10465 {
10466 if (!ctx.
Read(intValue))
10467 return false;
10469 }
10470
10471 if (version >= 138 && version < 140)
10472 {
10474 {
10475 if (!ctx.
Read(intValue))
10476 return false;
10477 SetFrozen(intValue);
10478 }
10479 }
10480
10481 return true;
10482 }
10483
10484
10486 {
10489 {
10491 }
10492
10493 if (!super.OnStoreLoad(ctx, version))
10494 {
10496 return false;
10497 }
10498
10499 if (version >= 114)
10500 {
10501 bool hasQuickBarIndexSaved;
10502
10503 if (!ctx.
Read(hasQuickBarIndexSaved))
10504 {
10506 return false;
10507 }
10508
10509 if (hasQuickBarIndexSaved)
10510 {
10511 int itmQBIndex;
10512
10513
10514 if (!ctx.
Read(itmQBIndex))
10515 {
10517 return false;
10518 }
10519
10520 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10521 if (itmQBIndex != -1 && parentPlayer)
10522 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10523 }
10524 }
10525 else
10526 {
10527
10528 PlayerBase player;
10529 int itemQBIndex;
10530 if (version ==
int.
MAX)
10531 {
10532 if (!ctx.
Read(itemQBIndex))
10533 {
10535 return false;
10536 }
10537 }
10538 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10539 {
10540
10541 if (!ctx.
Read(itemQBIndex))
10542 {
10544 return false;
10545 }
10546 if (itemQBIndex != -1 && player)
10547 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10548 }
10549 }
10550
10551 if (version < 140)
10552 {
10553
10554 if (!LoadVariables(ctx, version))
10555 {
10557 return false;
10558 }
10559 }
10560
10561
10563 {
10565 return false;
10566 }
10567 if (version >= 132)
10568 {
10570 if (raib)
10571 {
10573 {
10575 return false;
10576 }
10577 }
10578 }
10579
10581 return true;
10582 }
10583
10584
10585
10587 {
10588 super.OnStoreSave(ctx);
10589
10590 PlayerBase player;
10591 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10592 {
10594
10595 int itemQBIndex = -1;
10596 itemQBIndex = player.FindQuickBarEntityIndex(this);
10597 ctx.
Write(itemQBIndex);
10598 }
10599 else
10600 {
10602 }
10603
10605
10607 if (raib)
10608 {
10610 }
10611 }
10612
10613
10615 {
10616 super.AfterStoreLoad();
10617
10619 {
10621 }
10622
10624 {
10627 }
10628 }
10629
10631 {
10632 super.EEOnAfterLoad();
10633
10635 {
10637 }
10638
10641 }
10642
10644 {
10645 return false;
10646 }
10647
10648
10649
10651 {
10653 {
10654 #ifdef PLATFORM_CONSOLE
10655
10657 {
10659 if (menu)
10660 {
10662 }
10663 }
10664 #endif
10665 }
10666
10668 {
10671 }
10672
10674 {
10675 SetWeightDirty();
10677 }
10679 {
10682 }
10683
10685 {
10688 }
10690 {
10693 }
10694
10695 super.OnVariablesSynchronized();
10696 }
10697
10698
10699
10701 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10702 {
10703 if (!IsServerCheck(allow_client))
10704 return false;
10705
10707 return false;
10708
10711
10712 if (value <= (min + 0.001))
10713 value = min;
10714
10715 if (value == min)
10716 {
10717 if (destroy_config)
10718 {
10719 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10720 if (dstr)
10721 {
10723 this.Delete();
10724 return true;
10725 }
10726 }
10727 else if (destroy_forced)
10728 {
10730 this.Delete();
10731 return true;
10732 }
10733
10735 }
10736
10739
10741 {
10743
10744 if (delta)
10746 }
10747
10749
10750 return false;
10751 }
10752
10753
10755 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10756 {
10758 }
10759
10761 {
10764 }
10765
10767 {
10770 }
10771
10774 {
10775 float value_clamped = Math.Clamp(value, 0, 1);
10777 SetQuantity(result, destroy_config, destroy_forced);
10778 }
10779
10780
10783 {
10785 }
10786
10788 {
10790 }
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10802 {
10803 int slot = -1;
10804 if (GetInventory())
10805 {
10806 InventoryLocation il = new InventoryLocation;
10807 GetInventory().GetCurrentInventoryLocation(il);
10809 }
10810
10812 }
10813
10815 {
10816 float quantity_max = 0;
10817
10819 {
10820 if (attSlotID != -1)
10821 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10822
10823 if (quantity_max <= 0)
10825 }
10826
10827 if (quantity_max <= 0)
10829
10830 return quantity_max;
10831 }
10832
10834 {
10836 }
10837
10839 {
10841 }
10842
10843
10845 {
10847 }
10848
10850 {
10852 }
10853
10855 {
10857 }
10858
10859
10861 {
10862
10863 float weightEx = GetWeightEx();
10864 float special = GetInventoryAndCargoWeight();
10865 return weightEx - special;
10866 }
10867
10868
10870 {
10872 }
10873
10875 {
10877 {
10878 #ifdef DEVELOPER
10879 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10880 {
10881 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10883 }
10884 #endif
10885
10886 return GetQuantity() * GetConfigWeightModified();
10887 }
10888 else if (HasEnergyManager())
10889 {
10890 #ifdef DEVELOPER
10891 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10892 {
10893 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10894 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10895 }
10896 #endif
10897 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10898 }
10899 else
10900 {
10901 #ifdef DEVELOPER
10902 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10903 {
10904 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10905 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10906 }
10907 #endif
10908 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10909 }
10910 }
10911
10914 {
10915 int item_count = 0;
10917
10918 if (GetInventory().GetCargo() != NULL)
10919 {
10920 item_count = GetInventory().GetCargo().GetItemCount();
10921 }
10922
10923 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10924 {
10925 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10926 if (item)
10927 item_count += item.GetNumberOfItems();
10928 }
10929 return item_count;
10930 }
10931
10934 {
10935 float weight = 0;
10936 float wetness = 1;
10937 if (include_wetness)
10940 {
10941 weight = wetness * m_ConfigWeight;
10942 }
10944 {
10945 weight = 1;
10946 }
10947 return weight;
10948 }
10949
10950
10951
10953 {
10954 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10955 {
10956 GameInventory inv = GetInventory();
10957 array<EntityAI> items = new array<EntityAI>;
10959 for (int i = 0; i < items.Count(); i++)
10960 {
10962 if (item)
10963 {
10965 }
10966 }
10967 }
10968 }
10969
10970
10971
10972
10974 {
10975 float energy = 0;
10976 if (HasEnergyManager())
10977 {
10978 energy = GetCompEM().GetEnergy();
10979 }
10980 return energy;
10981 }
10982
10983
10985 {
10986 super.OnEnergyConsumed();
10987
10989 }
10990
10992 {
10993 super.OnEnergyAdded();
10994
10996 }
10997
10998
11000 {
11001 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11002 {
11004 {
11005 float energy_0to1 = GetCompEM().GetEnergy0To1();
11007 }
11008 }
11009 }
11010
11011
11013 {
11014 return ConfigGetFloat("heatIsolation");
11015 }
11016
11018 {
11020 }
11021
11023 {
11024 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11025 if (
GetGame().ConfigIsExisting(paramPath))
11027
11028 return 0.0;
11029 }
11030
11032 {
11033 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11034 if (
GetGame().ConfigIsExisting(paramPath))
11036
11037 return 0.0;
11038 }
11039
11040 override void SetWet(
float value,
bool allow_client =
false)
11041 {
11042 if (!IsServerCheck(allow_client))
11043 return;
11044
11047
11049
11050 m_VarWet = Math.Clamp(value, min, max);
11051
11053 {
11056 }
11057 }
11058
11059 override void AddWet(
float value)
11060 {
11062 }
11063
11065 {
11067 }
11068
11070 {
11072 }
11073
11075 {
11077 }
11078
11080 {
11082 }
11083
11085 {
11087 }
11088
11089 override void OnWetChanged(
float newVal,
float oldVal)
11090 {
11093 if (newLevel != oldLevel)
11094 {
11096 }
11097 }
11098
11100 {
11101 SetWeightDirty();
11102 }
11103
11105 {
11106 return GetWetLevelInternal(
m_VarWet);
11107 }
11108
11109
11110
11112 {
11114 }
11115
11117 {
11119 }
11120
11122 {
11124 }
11125
11127 {
11129 }
11130
11131
11132
11134 {
11135 if (ConfigIsExisting("itemModelLength"))
11136 {
11137 return ConfigGetFloat("itemModelLength");
11138 }
11139 return 0;
11140 }
11141
11143 {
11144 if (ConfigIsExisting("itemAttachOffset"))
11145 {
11146 return ConfigGetFloat("itemAttachOffset");
11147 }
11148 return 0;
11149 }
11150
11151 override void SetCleanness(
int value,
bool allow_client =
false)
11152 {
11153 if (!IsServerCheck(allow_client))
11154 return;
11155
11157
11159
11162 }
11163
11165 {
11167 }
11168
11170 {
11171 return true;
11172 }
11173
11174
11175
11176
11178 {
11180 }
11181
11183 {
11185 }
11186
11187
11188
11189
11190 override void SetColor(
int r,
int g,
int b,
int a)
11191 {
11197 }
11199 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11200 {
11205 }
11206
11208 {
11210 }
11211
11214 {
11215 int r,g,b,a;
11217 r = r/255;
11218 g = g/255;
11219 b = b/255;
11220 a = a/255;
11221 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11222 }
11223
11224
11225
11226 override void SetLiquidType(
int value,
bool allow_client =
false)
11227 {
11228 if (!IsServerCheck(allow_client))
11229 return;
11230
11235 }
11236
11238 {
11239 return ConfigGetInt("varLiquidTypeInit");
11240 }
11241
11243 {
11245 }
11246
11248 {
11250 SetFrozen(false);
11251 }
11252
11255 {
11256 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11257 }
11258
11259
11262 {
11263 PlayerBase nplayer;
11264 if (PlayerBase.CastTo(nplayer, player))
11265 {
11267
11268 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11269 }
11270 }
11271
11272
11275 {
11276 PlayerBase nplayer;
11277 if (PlayerBase.CastTo(nplayer,player))
11278 {
11279
11280 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11281
11282 }
11283
11284
11285 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11286
11287
11288 if (HasEnergyManager())
11289 {
11290 GetCompEM().UpdatePlugState();
11291 }
11292 }
11293
11294
11296 {
11297 super.OnPlacementStarted(player);
11298
11300 }
11301
11302 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11303 {
11305 {
11306 m_AdminLog.OnPlacementComplete(player,
this);
11307 }
11308
11309 super.OnPlacementComplete(player, position, orientation);
11310 }
11311
11312
11313
11314
11315
11317 {
11319 {
11320 return true;
11321 }
11322 else
11323 {
11324 return false;
11325 }
11326 }
11327
11328
11330 {
11332 {
11334 }
11335 }
11336
11337
11339 {
11341 }
11342
11344 {
11346 }
11347
11348 override void InsertAgent(
int agent,
float count = 1)
11349 {
11350 if (count < 1)
11351 return;
11352
11354 }
11355
11358 {
11360 }
11361
11362
11364 {
11366 }
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11410 {
11412 return false;
11413 return true;
11414 }
11415
11417 {
11418
11420 }
11421
11422
11425 {
11426 super.CheckForRoofLimited(timeTresholdMS);
11427
11429 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11430 {
11431 m_PreviousRoofTestTime = time;
11432 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11433 }
11434 }
11435
11436
11438 {
11440 {
11441 return 0;
11442 }
11443
11444 if (GetInventory().GetAttachmentSlotsCount() != 0)
11445 {
11446 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11447 if (filter)
11448 return filter.GetProtectionLevel(type, false, system);
11449 else
11450 return 0;
11451 }
11452
11453 string subclassPath, entryName;
11454
11455 switch (type)
11456 {
11458 entryName = "biological";
11459 break;
11461 entryName = "chemical";
11462 break;
11463 default:
11464 entryName = "biological";
11465 break;
11466 }
11467
11468 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11469
11471 }
11472
11473
11474
11477 {
11478 if (!IsMagazine())
11480
11482 }
11483
11484
11485
11486
11487
11492 {
11493 return true;
11494 }
11495
11497 {
11499 }
11500
11501
11502
11503
11504
11506 {
11507 if (parent)
11508 {
11509 if (parent.IsInherited(DayZInfected))
11510 return true;
11511
11512 if (!parent.IsRuined())
11513 return true;
11514 }
11515
11516 return true;
11517 }
11518
11520 {
11521 if (!super.CanPutAsAttachment(parent))
11522 {
11523 return false;
11524 }
11525
11526 if (!IsRuined() && !parent.IsRuined())
11527 {
11528 return true;
11529 }
11530
11531 return false;
11532 }
11533
11535 {
11536
11537
11538
11539
11540 return super.CanReceiveItemIntoCargo(item);
11541 }
11542
11544 {
11545
11546
11547
11548
11549 GameInventory attachmentInv = attachment.GetInventory();
11551 {
11552 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11553 return false;
11554 }
11555
11556 InventoryLocation loc = new InventoryLocation();
11557 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11558 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11559 return false;
11560
11561 return super.CanReceiveAttachment(attachment, slotId);
11562 }
11563
11565 {
11566 if (!super.CanReleaseAttachment(attachment))
11567 return false;
11568
11569 return GetInventory().AreChildrenAccessible();
11570 }
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11593 {
11594 int id = muzzle_owner.GetMuzzleID();
11595 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11596
11597 if (WPOF_array)
11598 {
11599 for (int i = 0; i < WPOF_array.Count(); i++)
11600 {
11601 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11602
11603 if (WPOF)
11604 {
11605 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11606 }
11607 }
11608 }
11609 }
11610
11611
11613 {
11614 int id = muzzle_owner.GetMuzzleID();
11616
11617 if (WPOBE_array)
11618 {
11619 for (int i = 0; i < WPOBE_array.Count(); i++)
11620 {
11621 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11622
11623 if (WPOBE)
11624 {
11625 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11626 }
11627 }
11628 }
11629 }
11630
11631
11633 {
11634 int id = muzzle_owner.GetMuzzleID();
11635 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11636
11637 if (WPOOH_array)
11638 {
11639 for (int i = 0; i < WPOOH_array.Count(); i++)
11640 {
11641 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11642
11643 if (WPOOH)
11644 {
11645 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11646 }
11647 }
11648 }
11649 }
11650
11651
11653 {
11654 int id = muzzle_owner.GetMuzzleID();
11655 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11656
11657 if (WPOOH_array)
11658 {
11659 for (int i = 0; i < WPOOH_array.Count(); i++)
11660 {
11661 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11662
11663 if (WPOOH)
11664 {
11665 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11666 }
11667 }
11668 }
11669 }
11670
11671
11673 {
11674 int id = muzzle_owner.GetMuzzleID();
11675 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11676
11677 if (WPOOH_array)
11678 {
11679 for (int i = 0; i < WPOOH_array.Count(); i++)
11680 {
11681 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11682
11683 if (WPOOH)
11684 {
11685 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11686 }
11687 }
11688 }
11689 }
11690
11691
11692
11694 {
11696 {
11697 return true;
11698 }
11699
11700 return false;
11701 }
11702
11704 {
11706 {
11707 return true;
11708 }
11709
11710 return false;
11711 }
11712
11714 {
11716 {
11717 return true;
11718 }
11719
11720 return false;
11721 }
11722
11724 {
11725 return false;
11726 }
11727
11730 {
11731 return UATimeSpent.DEFAULT_DEPLOY;
11732 }
11733
11734
11735
11736
11738 {
11740 SetSynchDirty();
11741 }
11742
11744 {
11746 }
11747
11748
11750 {
11751 return false;
11752 }
11753
11756 {
11757 string att_type = "None";
11758
11759 if (ConfigIsExisting("soundAttType"))
11760 {
11761 att_type = ConfigGetString("soundAttType");
11762 }
11763
11765 }
11766
11768 {
11770 }
11771
11772
11773
11774
11775
11779
11781 {
11784
11786 }
11787
11788
11790 {
11792 return;
11793
11795
11798
11801
11802 SoundParameters params = new SoundParameters();
11806 }
11807
11808
11810 {
11812 return;
11813
11815 SetSynchDirty();
11816
11819 }
11820
11821
11823 {
11825 return;
11826
11828 SetSynchDirty();
11829
11832 }
11833
11835 {
11837 }
11838
11840 {
11842 }
11843
11846 {
11847 if (!
GetGame().IsDedicatedServer())
11848 {
11849 if (ConfigIsExisting("attachSoundSet"))
11850 {
11851 string cfg_path = "";
11852 string soundset = "";
11853 string type_name =
GetType();
11854
11857 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11858 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11859
11860 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11861 {
11862 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11863 {
11864 if (cfg_slot_array[i] == slot_type)
11865 {
11866 soundset = cfg_soundset_array[i];
11867 break;
11868 }
11869 }
11870 }
11871
11872 if (soundset != "")
11873 {
11874 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11876 }
11877 }
11878 }
11879 }
11880
11882 {
11883
11884 }
11885
11886 void OnApply(PlayerBase player);
11887
11889 {
11890 return 1.0;
11891 };
11892
11894 {
11896 }
11897
11899 {
11901 }
11902
11904
11906 {
11907 SetDynamicPhysicsLifeTime(0.01);
11909 }
11910
11912 {
11913 array<string> zone_names = new array<string>;
11914 GetDamageZones(zone_names);
11915 for (int i = 0; i < zone_names.Count(); i++)
11916 {
11917 SetHealthMax(zone_names.Get(i),"Health");
11918 }
11919 SetHealthMax("","Health");
11920 }
11921
11924 {
11925 float global_health = GetHealth01("","Health");
11926 array<string> zones = new array<string>;
11927 GetDamageZones(zones);
11928
11929 for (int i = 0; i < zones.Count(); i++)
11930 {
11931 SetHealth01(zones.Get(i),"Health",global_health);
11932 }
11933 }
11934
11937 {
11938 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11939 }
11940
11942 {
11943 if (!hasRootAsPlayer)
11944 {
11945 if (refParentIB)
11946 {
11947
11948 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11949 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11950
11951 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11952 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11953
11956 }
11957 else
11958 {
11959
11962 }
11963 }
11964 }
11965
11967 {
11969 {
11970 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11971 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11972 {
11973 float heatPermCoef = 1.0;
11975 while (ent)
11976 {
11977 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11978 ent = ent.GetHierarchyParent();
11979 }
11980
11981 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11982 }
11983 }
11984 }
11985
11987 {
11988
11989 EntityAI parent = GetHierarchyParent();
11990 if (!parent)
11991 {
11992 hasParent = false;
11993 hasRootAsPlayer = false;
11994 }
11995 else
11996 {
11997 hasParent = true;
11998 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11999 refParentIB =
ItemBase.Cast(parent);
12000 }
12001 }
12002
12003 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12004 {
12005
12006 }
12007
12009 {
12010
12011 return false;
12012 }
12013
12015 {
12016
12017
12018 return false;
12019 }
12020
12022 {
12023
12024 return false;
12025 }
12026
12029 {
12030 return !GetIsFrozen() &&
IsOpen();
12031 }
12032
12034 {
12035 bool hasParent = false, hasRootAsPlayer = false;
12037
12038 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12039 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12040
12041 if (wwtu || foodDecay)
12042 {
12046
12047 if (processWetness || processTemperature || processDecay)
12048 {
12050
12051 if (processWetness)
12052 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12053
12054 if (processTemperature)
12056
12057 if (processDecay)
12058 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12059 }
12060 }
12061 }
12062
12065 {
12067 }
12068
12070 {
12073
12074 return super.GetTemperatureFreezeThreshold();
12075 }
12076
12078 {
12081
12082 return super.GetTemperatureThawThreshold();
12083 }
12084
12086 {
12089
12090 return super.GetItemOverheatThreshold();
12091 }
12092
12094 {
12096 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12097
12098 return super.GetTemperatureFreezeTime();
12099 }
12100
12102 {
12104 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12105
12106 return super.GetTemperatureThawTime();
12107 }
12108
12113
12115 {
12116 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12117 }
12118
12120 {
12121 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12122 }
12123
12126 {
12128 }
12129
12131 {
12133 }
12134
12136 {
12138 }
12139
12142 {
12143 return null;
12144 }
12145
12148 {
12149 return false;
12150 }
12151
12153 {
12155 {
12158 if (!trg)
12159 {
12161 explosive = this;
12162 }
12163
12164 explosive.PairRemote(trg);
12166
12167 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12168 trg.SetPersistentPairID(persistentID);
12169 explosive.SetPersistentPairID(persistentID);
12170
12171 return true;
12172 }
12173 return false;
12174 }
12175
12178 {
12179 float ret = 1.0;
12182 ret *= GetHealth01();
12183
12184 return ret;
12185 }
12186
12187 #ifdef DEVELOPER
12188 override void SetDebugItem()
12189 {
12190 super.SetDebugItem();
12191 _itemBase = this;
12192 }
12193
12195 {
12196 string text = super.GetDebugText();
12197
12199 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12200
12201 return text;
12202 }
12203 #endif
12204
12206 {
12207 return true;
12208 }
12209
12211
12213
12215 {
12218 }
12219
12220
12228
12244}
12245
12247{
12249 if (entity)
12250 {
12251 bool is_item = entity.IsInherited(
ItemBase);
12252 if (is_item && full_quantity)
12253 {
12256 }
12257 }
12258 else
12259 {
12261 return NULL;
12262 }
12263 return entity;
12264}
12265
12267{
12268 if (item)
12269 {
12270 if (health > 0)
12271 item.SetHealth("", "", health);
12272
12273 if (item.CanHaveTemperature())
12274 {
12276 if (item.CanFreeze())
12277 item.SetFrozen(false);
12278 }
12279
12280 if (item.HasEnergyManager())
12281 {
12282 if (quantity >= 0)
12283 {
12284 item.GetCompEM().SetEnergy0To1(quantity);
12285 }
12286 else
12287 {
12289 }
12290 }
12291 else if (item.IsMagazine())
12292 {
12293 Magazine mag = Magazine.Cast(item);
12294 if (quantity >= 0)
12295 {
12296 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12297 }
12298 else
12299 {
12301 }
12302
12303 }
12304 else
12305 {
12306 if (quantity >= 0)
12307 {
12308 item.SetQuantityNormalized(quantity, false);
12309 }
12310 else
12311 {
12313 }
12314
12315 }
12316 }
12317}
12318
12319#ifdef DEVELOPER
12321#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.