7470{
7472 {
7473 return true;
7474 }
7475};
7476
7477
7478
7480{
7484
7486
7489
7490
7491
7492
7493
7502
7508
7513
7518
7539 protected bool m_IsResultOfSplit
7540
7542
7547
7548
7549
7551
7555
7556
7557
7559
7562
7563
7564
7570
7571
7579
7582
7583
7585
7586
7588
7589
7594
7595
7600
7601
7603
7604
7606 {
7611
7612 if (!
GetGame().IsDedicatedServer())
7613 {
7615 {
7617
7619 {
7621 }
7622 }
7623
7626 }
7627
7628 m_OldLocation = null;
7629
7631 {
7633 }
7634
7635 if (ConfigIsExisting("headSelectionsToHide"))
7636 {
7639 }
7640
7642 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7643 {
7645 }
7646
7648
7649 m_IsResultOfSplit = false;
7650
7652 }
7653
7655 {
7656 super.InitItemVariables();
7657
7663 m_Count = ConfigGetInt(
"count");
7664
7667
7672
7675
7680
7692
7696
7697
7700 if (ConfigIsExisting("canBeSplit"))
7701 {
7704 }
7705
7707 if (ConfigIsExisting("itemBehaviour"))
7709
7710
7713 RegisterNetSyncVariableInt("m_VarLiquidType");
7714 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7715
7716 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7717 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7718 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7719
7720 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7721 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7722 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7723 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7724
7725 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7726 RegisterNetSyncVariableBool("m_IsTakeable");
7727 RegisterNetSyncVariableBool("m_IsHologram");
7728
7731 {
7734 }
7735
7737
7739 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7741
7742 }
7743
7745 {
7747 }
7748
7750 {
7753 {
7758 }
7759 }
7760
7761 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7762 {
7764 {
7767 }
7768
7770 }
7771
7773 {
7779 }
7780
7782
7784 {
7786
7787 if (!action)
7788 {
7789 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7790 return;
7791 }
7792
7794 if (!ai)
7795 {
7797 return;
7798 }
7799
7801 if (!action_array)
7802 {
7803 action_array = new array<ActionBase_Basic>;
7805 }
7806 if (LogManager.IsActionLogEnable())
7807 {
7808 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7809 }
7810
7811 if (action_array.Find(action) != -1)
7812 {
7813 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7814 }
7815 else
7816 {
7817 action_array.Insert(action);
7818 }
7819 }
7820
7822 {
7824 ActionBase action = player.GetActionManager().GetAction(actionName);
7827
7828 if (action_array)
7829 {
7830 action_array.RemoveItem(action);
7831 }
7832 }
7833
7834
7835
7837 {
7838 ActionOverrideData overrideData = new ActionOverrideData();
7842
7844 if (!actionMap)
7845 {
7848 }
7849
7850 actionMap.Insert(this.
Type(), overrideData);
7851
7852 }
7853
7855
7857
7858
7860 {
7863
7866
7867 string config_to_search = "CfgVehicles";
7868 string muzzle_owner_config;
7869
7871 {
7872 if (IsInherited(Weapon))
7873 config_to_search = "CfgWeapons";
7874
7875 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7876
7877 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7878
7880
7881 if (config_OnFire_subclass_count > 0)
7882 {
7883 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7884
7885 for (int i = 0; i < config_OnFire_subclass_count; i++)
7886 {
7887 string particle_class = "";
7889 string config_OnFire_entry = config_OnFire_class + particle_class;
7890 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7891 WPOF_array.Insert(WPOF);
7892 }
7893
7894
7896 }
7897 }
7898
7900 {
7901 config_to_search = "CfgWeapons";
7902 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7903
7904 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7905
7907
7908 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7909 {
7910 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7911
7912 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7913 {
7914 string particle_class2 = "";
7916 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7917 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7918 WPOBE_array.Insert(WPOBE);
7919 }
7920
7921
7923 }
7924 }
7925 }
7926
7927
7929 {
7932
7934 {
7935 string config_to_search = "CfgVehicles";
7936
7937 if (IsInherited(Weapon))
7938 config_to_search = "CfgWeapons";
7939
7940 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7941 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7942
7943 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7944 {
7945
7947
7949 {
7951 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7953 return;
7954 }
7955
7958
7959
7960
7962 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7963
7964 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7965 {
7966 string particle_class = "";
7968 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7970
7971 if (entry_type == CT_CLASS)
7972 {
7973 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7974 WPOOH_array.Insert(WPOF);
7975 }
7976 }
7977
7978
7980 }
7981 }
7982 }
7983
7985 {
7987 }
7988
7990 {
7992 {
7994
7997
8000
8001 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8002 }
8003 }
8004
8006 {
8008 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8009
8011 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8012
8014 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8015
8017 {
8019 }
8020 }
8021
8023 {
8025 }
8026
8028 {
8031 else
8033
8035 {
8038 }
8039 else
8040 {
8043
8046 }
8047
8049 }
8050
8052 {
8054 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8055 }
8056
8058 {
8060 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8062 }
8063
8065 {
8067 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8068 }
8069
8071 {
8074
8075 OverheatingParticle OP = new OverheatingParticle();
8080
8082 }
8083
8085 {
8088
8089 return -1;
8090 }
8091
8093 {
8095 {
8098
8099 for (int i = count; i > 0; --i)
8100 {
8101 int id = i - 1;
8104
8107
8108 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8109 {
8110 if (p)
8111 {
8114 }
8115 }
8116 }
8117 }
8118 }
8119
8121 {
8123 {
8125 {
8126 int id = i - 1;
8128
8129 if (OP)
8130 {
8132
8133 if (p)
8134 {
8136 }
8137
8138 delete OP;
8139 }
8140 }
8141
8144 }
8145 }
8146
8149 {
8150 return 0.0;
8151 }
8152
8153
8155 {
8156 return 250;
8157 }
8158
8160 {
8161 return 0;
8162 }
8163
8166 {
8168 return true;
8169
8170 return false;
8171 }
8172
8175 {
8178
8180 {
8182 }
8183 else
8184 {
8185
8187 }
8188
8190 }
8191
8198 {
8199 return -1;
8200 }
8201
8202
8203
8204
8206 {
8208 {
8210 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8211
8212 if (r_index >= 0)
8213 {
8214 InventoryLocation r_il = new InventoryLocation;
8215 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8216
8217 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8220 {
8221 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8222 }
8224 {
8225 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8226 }
8227
8228 }
8229
8230 player.GetHumanInventory().ClearUserReservedLocation(this);
8231 }
8232
8235 }
8236
8237
8238
8239
8241 {
8242 return ItemBase.m_DebugActionsMask;
8243 }
8244
8246 {
8247 return ItemBase.m_DebugActionsMask & mask;
8248 }
8249
8251 {
8252 ItemBase.m_DebugActionsMask = mask;
8253 }
8254
8256 {
8257 ItemBase.m_DebugActionsMask |= mask;
8258 }
8259
8261 {
8262 ItemBase.m_DebugActionsMask &= ~mask;
8263 }
8264
8266 {
8268 {
8270 }
8271 else
8272 {
8274 }
8275 }
8276
8277
8279 {
8280 if (GetEconomyProfile())
8281 {
8282 float q_max = GetEconomyProfile().GetQuantityMax();
8283 if (q_max > 0)
8284 {
8285 float q_min = GetEconomyProfile().GetQuantityMin();
8286 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8287
8289 {
8290 ComponentEnergyManager comp = GetCompEM();
8292 {
8294 }
8295 }
8297 {
8299
8300 }
8301
8302 }
8303 }
8304 }
8305
8308 {
8309 EntityAI parent = GetHierarchyParent();
8310
8311 if (parent)
8312 {
8313 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8314 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8315 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8316 }
8317 }
8318
8321 {
8322 EntityAI parent = GetHierarchyParent();
8323
8324 if (parent)
8325 {
8326 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8327 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8328 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8329 }
8330 }
8331
8333 {
8334
8335
8336
8337
8339
8341 {
8342 if (ScriptInputUserData.CanStoreInputUserData())
8343 {
8344 ScriptInputUserData ctx = new ScriptInputUserData;
8350 ctx.
Write(use_stack_max);
8353
8355 {
8356 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8357 }
8358 }
8359 }
8360 else if (!
GetGame().IsMultiplayer())
8361 {
8363 }
8364 }
8365
8367 {
8369 }
8370
8372 {
8374 }
8375
8377 {
8379 }
8380
8382 {
8383
8384 return false;
8385 }
8386
8388 {
8389 return false;
8390 }
8391
8395 {
8396 return false;
8397 }
8398
8400 {
8401 return "";
8402 }
8403
8405
8407 {
8408 return false;
8409 }
8410
8412 {
8413 return true;
8414 }
8415
8416
8417
8419 {
8420 return true;
8421 }
8422
8424 {
8425 return true;
8426 }
8427
8429 {
8430 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8432 }
8433
8435 {
8437 }
8438
8440 {
8442 if (!is_being_placed)
8444 SetSynchDirty();
8445 }
8446
8447
8449
8451 {
8453 }
8454
8456 {
8458 }
8459
8461 {
8462 return 1;
8463 }
8464
8466 {
8467 return false;
8468 }
8469
8471 {
8473 SetSynchDirty();
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
8508
8509
8511 {
8512 super.OnMovedInsideCargo(container);
8513
8514 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8515 }
8516
8517 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8518 {
8519 super.EEItemLocationChanged(oldLoc,newLoc);
8520
8521 PlayerBase new_player = null;
8522 PlayerBase old_player = null;
8523
8524 if (newLoc.GetParent())
8525 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8526
8527 if (oldLoc.GetParent())
8528 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8529
8531 {
8532 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8533
8534 if (r_index >= 0)
8535 {
8536 InventoryLocation r_il = new InventoryLocation;
8537 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8538
8539 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8542 {
8543 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8544 }
8546 {
8547 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8548 }
8549
8550 }
8551 }
8552
8554 {
8555 if (new_player)
8556 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8557
8558 if (new_player == old_player)
8559 {
8560
8561 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8562 {
8564 {
8565 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8566 {
8567 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8568 }
8569 }
8570 else
8571 {
8572 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8573 }
8574 }
8575
8576 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8577 {
8578 int type = oldLoc.GetType();
8580 {
8581 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8582 }
8584 {
8585 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8586 }
8587 }
8588 if (!m_OldLocation)
8589 {
8590 m_OldLocation = new InventoryLocation;
8591 }
8592 m_OldLocation.Copy(oldLoc);
8593 }
8594 else
8595 {
8596 if (m_OldLocation)
8597 {
8598 m_OldLocation.Reset();
8599 }
8600 }
8601
8603 }
8604 else
8605 {
8606 if (new_player)
8607 {
8608 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8609 if (res_index >= 0)
8610 {
8611 InventoryLocation il = new InventoryLocation;
8612 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8614 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8617 {
8618 il.
GetParent().GetOnReleaseLock().Invoke(it);
8619 }
8621 {
8623 }
8624
8625 }
8626 }
8628 {
8629
8631 }
8632
8633 if (m_OldLocation)
8634 {
8635 m_OldLocation.Reset();
8636 }
8637 }
8638 }
8639
8640 override void EOnContact(IEntity other, Contact extra)
8641 {
8643 {
8644 int liquidType = -1;
8646 if (impactSpeed > 0.0)
8647 {
8649 #ifndef SERVER
8651 #else
8653 SetSynchDirty();
8654 #endif
8656 }
8657 }
8658
8659 #ifdef SERVER
8660 if (GetCompEM() && GetCompEM().IsPlugged())
8661 {
8662 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8663 GetCompEM().UnplugThis();
8664 }
8665 #endif
8666 }
8667
8669
8671 {
8673 }
8674
8676 {
8677
8678 }
8679
8681 {
8682 super.OnItemLocationChanged(old_owner, new_owner);
8683
8684 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8685 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8686
8687 if (!relatedPlayer && playerNew)
8688 relatedPlayer = playerNew;
8689
8690 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8691 {
8693 if (actionMgr)
8694 {
8695 ActionBase currentAction = actionMgr.GetRunningAction();
8696 if (currentAction)
8698 }
8699 }
8700
8701 Man ownerPlayerOld = null;
8702 Man ownerPlayerNew = null;
8703
8704 if (old_owner)
8705 {
8706 if (old_owner.
IsMan())
8707 {
8708 ownerPlayerOld = Man.Cast(old_owner);
8709 }
8710 else
8711 {
8712 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8713 }
8714 }
8715 else
8716 {
8718 {
8720
8721 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8722 {
8723 GetCompEM().UnplugThis();
8724 }
8725 }
8726 }
8727
8728 if (new_owner)
8729 {
8730 if (new_owner.
IsMan())
8731 {
8732 ownerPlayerNew = Man.Cast(new_owner);
8733 }
8734 else
8735 {
8736 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8737 }
8738 }
8739
8740 if (ownerPlayerOld != ownerPlayerNew)
8741 {
8742 if (ownerPlayerOld)
8743 {
8744 array<EntityAI> subItemsExit = new array<EntityAI>;
8746 for (int i = 0; i < subItemsExit.Count(); i++)
8747 {
8750 }
8751 }
8752
8753 if (ownerPlayerNew)
8754 {
8755 array<EntityAI> subItemsEnter = new array<EntityAI>;
8757 for (int j = 0; j < subItemsEnter.Count(); j++)
8758 {
8761 }
8762 }
8763 }
8764 else if (ownerPlayerNew != null)
8765 {
8766 PlayerBase nplayer;
8767 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8768 {
8769 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8771 for (int k = 0; k < subItemsUpdate.Count(); k++)
8772 {
8774 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8775 }
8776 }
8777 }
8778
8779 if (old_owner)
8780 old_owner.OnChildItemRemoved(this);
8781 if (new_owner)
8782 new_owner.OnChildItemReceived(this);
8783 }
8784
8785
8787 {
8788 super.EEDelete(parent);
8789 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8790 if (player)
8791 {
8793
8794 if (player.IsAlive())
8795 {
8796 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8797 if (r_index >= 0)
8798 {
8799 InventoryLocation r_il = new InventoryLocation;
8800 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8801
8802 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8805 {
8806 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8807 }
8809 {
8810 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8811 }
8812
8813 }
8814
8815 player.RemoveQuickBarEntityShortcut(this);
8816 }
8817 }
8818 }
8819
8821 {
8822 super.EEKilled(killer);
8823
8826 {
8827 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8828 {
8829 if (IsMagazine())
8830 {
8831 if (Magazine.Cast(this).GetAmmoCount() > 0)
8832 {
8834 }
8835 }
8836 else
8837 {
8839 }
8840 }
8841 }
8842 }
8843
8845 {
8846 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8847
8848 super.OnWasAttached(parent, slot_id);
8849
8852
8854 }
8855
8857 {
8858 super.OnWasDetached(parent, slot_id);
8859
8862 }
8863
8865 {
8866 int idx;
8869
8870 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8871 if (inventory_slots.Count() < 1)
8872 {
8873 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8874 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8875 }
8876 else
8877 {
8878 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8879 }
8880
8881 idx = inventory_slots.Find(slot);
8882 if (idx < 0)
8883 return "";
8884
8885 return attach_types.Get(idx);
8886 }
8887
8889 {
8890 int idx = -1;
8891 string slot;
8892
8895
8896 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8897 if (inventory_slots.Count() < 1)
8898 {
8899 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8900 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8901 }
8902 else
8903 {
8904 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8905 if (detach_types.Count() < 1)
8906 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8907 }
8908
8909 for (int i = 0; i < inventory_slots.Count(); i++)
8910 {
8911 slot = inventory_slots.Get(i);
8912 }
8913
8914 if (slot != "")
8915 {
8916 if (detach_types.Count() == 1)
8917 idx = 0;
8918 else
8919 idx = inventory_slots.Find(slot);
8920 }
8921 if (idx < 0)
8922 return "";
8923
8924 return detach_types.Get(idx);
8925 }
8926
8928 {
8929
8931
8932
8933 float min_time = 1;
8934 float max_time = 3;
8935 float delay = Math.RandomFloat(min_time, max_time);
8936
8937 explode_timer.Run(delay, this, "DoAmmoExplosion");
8938 }
8939
8941 {
8942 Magazine magazine = Magazine.Cast(this);
8943 int pop_sounds_count = 6;
8944 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8945
8946
8947 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8948 string sound_name = pop_sounds[ sound_idx ];
8950
8951
8952 magazine.ServerAddAmmoCount(-1);
8953
8954
8955 float min_temp_to_explode = 100;
8956
8957 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8958 {
8960 }
8961 }
8962
8963
8964 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8965 {
8966 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8967
8968 const int CHANCE_DAMAGE_CARGO = 4;
8969 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8970 const int CHANCE_DAMAGE_NOTHING = 2;
8971
8973 {
8974 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8975 int chances;
8976 int rnd;
8977
8978 if (GetInventory().GetCargo())
8979 {
8980 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8981 rnd = Math.RandomInt(0,chances);
8982
8983 if (rnd < CHANCE_DAMAGE_CARGO)
8984 {
8986 }
8987 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8988 {
8990 }
8991 }
8992 else
8993 {
8994 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8995 rnd = Math.RandomInt(0,chances);
8996
8997 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8998 {
9000 }
9001 }
9002 }
9003 }
9004
9006 {
9007 if (GetInventory().GetCargo())
9008 {
9009 int item_count = GetInventory().GetCargo().GetItemCount();
9010 if (item_count > 0)
9011 {
9012 int random_pick = Math.RandomInt(0, item_count);
9014 if (!item.IsExplosive())
9015 {
9016 item.AddHealth("","",damage);
9017 return true;
9018 }
9019 }
9020 }
9021 return false;
9022 }
9023
9025 {
9026 int attachment_count = GetInventory().AttachmentCount();
9027 if (attachment_count > 0)
9028 {
9029 int random_pick = Math.RandomInt(0, attachment_count);
9030 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9031 if (!attachment.IsExplosive())
9032 {
9033 attachment.AddHealth("","",damage);
9034 return true;
9035 }
9036 }
9037 return false;
9038 }
9039
9041 {
9043 }
9044
9046 {
9048 return GetInventory().CanRemoveEntity();
9049
9050 return false;
9051 }
9052
9054 {
9055
9057 return false;
9058
9059
9061 return false;
9062
9063
9064
9066 if (delta == 0)
9067 return false;
9068
9069
9070 return true;
9071 }
9072
9074 {
9076 {
9077 if (ScriptInputUserData.CanStoreInputUserData())
9078 {
9079 ScriptInputUserData ctx = new ScriptInputUserData;
9084 ctx.
Write(destination_entity);
9088 }
9089 }
9090 else if (!
GetGame().IsMultiplayer())
9091 {
9093 }
9094 }
9095
9097 {
9098 float split_quantity_new;
9102 InventoryLocation loc = new InventoryLocation;
9103
9104 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9105 {
9107 split_quantity_new = stack_max;
9108 else
9110
9112 {
9113 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9114 if (new_item)
9115 {
9116 new_item.SetResultOfSplit(true);
9117 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9119 new_item.
SetQuantity(split_quantity_new,
false,
true);
9120 }
9121 }
9122 }
9123 else if (destination_entity && slot_id == -1)
9124 {
9125 if (quantity > stack_max)
9126 split_quantity_new = stack_max;
9127 else
9128 split_quantity_new = quantity;
9129
9131 {
9133 {
9136 }
9137
9138 if (new_item)
9139 {
9140 new_item.SetResultOfSplit(true);
9141 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9143 new_item.
SetQuantity(split_quantity_new,
false,
true);
9144 }
9145 }
9146 }
9147 else
9148 {
9149 if (stack_max != 0)
9150 {
9152 {
9154 }
9155
9156 if (split_quantity_new == 0)
9157 {
9158 if (!
GetGame().IsMultiplayer())
9159 player.PhysicalPredictiveDropItem(this);
9160 else
9161 player.ServerDropEntity(this);
9162 return;
9163 }
9164
9166 {
9168
9169 if (new_item)
9170 {
9171 new_item.SetResultOfSplit(true);
9172 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9175 new_item.PlaceOnSurface();
9176 }
9177 }
9178 }
9179 }
9180 }
9181
9183 {
9184 float split_quantity_new;
9188 InventoryLocation loc = new InventoryLocation;
9189
9190 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9191 {
9193 split_quantity_new = stack_max;
9194 else
9196
9198 {
9199 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9200 if (new_item)
9201 {
9202 new_item.SetResultOfSplit(true);
9203 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9205 new_item.
SetQuantity(split_quantity_new,
false,
true);
9206 }
9207 }
9208 }
9209 else if (destination_entity && slot_id == -1)
9210 {
9211 if (quantity > stack_max)
9212 split_quantity_new = stack_max;
9213 else
9214 split_quantity_new = quantity;
9215
9217 {
9219 {
9222 }
9223
9224 if (new_item)
9225 {
9226 new_item.SetResultOfSplit(true);
9227 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9229 new_item.
SetQuantity(split_quantity_new,
false,
true);
9230 }
9231 }
9232 }
9233 else
9234 {
9235 if (stack_max != 0)
9236 {
9238 {
9240 }
9241
9243 {
9245
9246 if (new_item)
9247 {
9248 new_item.SetResultOfSplit(true);
9249 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9252 new_item.PlaceOnSurface();
9253 }
9254 }
9255 }
9256 }
9257 }
9258
9260 {
9262 {
9263 if (ScriptInputUserData.CanStoreInputUserData())
9264 {
9265 ScriptInputUserData ctx = new ScriptInputUserData;
9270 dst.WriteToContext(ctx);
9272 }
9273 }
9274 else if (!
GetGame().IsMultiplayer())
9275 {
9277 }
9278 }
9279
9281 {
9283 {
9284 if (ScriptInputUserData.CanStoreInputUserData())
9285 {
9286 ScriptInputUserData ctx = new ScriptInputUserData;
9291 ctx.
Write(destination_entity);
9297 }
9298 }
9299 else if (!
GetGame().IsMultiplayer())
9300 {
9302 }
9303 }
9304
9306 {
9308 }
9309
9311 {
9313 float split_quantity_new;
9315 if (dst.IsValid())
9316 {
9317 int slot_id = dst.GetSlot();
9319
9320 if (quantity > stack_max)
9321 split_quantity_new = stack_max;
9322 else
9323 split_quantity_new = quantity;
9324
9326 {
9328
9329 if (new_item)
9330 {
9331 new_item.SetResultOfSplit(true);
9332 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9334 new_item.
SetQuantity(split_quantity_new,
false,
true);
9335 }
9336
9337 return new_item;
9338 }
9339 }
9340
9341 return null;
9342 }
9343
9345 {
9347 float split_quantity_new;
9349 if (destination_entity)
9350 {
9352 if (quantity > stackable)
9353 split_quantity_new = stackable;
9354 else
9355 split_quantity_new = quantity;
9356
9358 {
9359 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9360 if (new_item)
9361 {
9362 new_item.SetResultOfSplit(true);
9363 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9365 new_item.
SetQuantity(split_quantity_new,
false,
true);
9366 }
9367 }
9368 }
9369 }
9370
9372 {
9374 {
9375 if (ScriptInputUserData.CanStoreInputUserData())
9376 {
9377 ScriptInputUserData ctx = new ScriptInputUserData;
9382 ItemBase destination_entity =
this;
9383 ctx.
Write(destination_entity);
9387 }
9388 }
9389 else if (!
GetGame().IsMultiplayer())
9390 {
9392 }
9393 }
9394
9396 {
9398 float split_quantity_new;
9400 if (player)
9401 {
9403 if (quantity > stackable)
9404 split_quantity_new = stackable;
9405 else
9406 split_quantity_new = quantity;
9407
9409 {
9410 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9411 new_item =
ItemBase.Cast(in_hands);
9412 if (new_item)
9413 {
9414 new_item.SetResultOfSplit(true);
9415 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9417 new_item.SetQuantity(split_quantity_new, false, true);
9418 }
9419 }
9420 }
9421 }
9422
9424 {
9426 float split_quantity_new = Math.Floor(quantity * 0.5);
9427
9429 return;
9430
9432
9433 if (new_item)
9434 {
9435 if (new_item.GetQuantityMax() < split_quantity_new)
9436 {
9437 split_quantity_new = new_item.GetQuantityMax();
9438 }
9439
9440 new_item.SetResultOfSplit(true);
9441 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9442
9444 {
9447 }
9448 else
9449 {
9451 new_item.
SetQuantity(split_quantity_new,
false,
true);
9452 }
9453 }
9454 }
9455
9457 {
9459 float split_quantity_new = Math.Floor(quantity / 2);
9460
9462 return;
9463
9464 InventoryLocation invloc = new InventoryLocation;
9466
9468 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9469
9470 if (new_item)
9471 {
9472 if (new_item.GetQuantityMax() < split_quantity_new)
9473 {
9474 split_quantity_new = new_item.GetQuantityMax();
9475 }
9477 {
9480 }
9481 else if (split_quantity_new > 1)
9482 {
9484 new_item.
SetQuantity(split_quantity_new,
false,
true);
9485 }
9486 }
9487 }
9488
9491 {
9492 SetWeightDirty();
9494
9495 if (parent)
9496 parent.OnAttachmentQuantityChangedEx(this, delta);
9497
9499 {
9501 {
9503 }
9505 {
9506 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9508 }
9509 }
9510
9511 }
9512
9515 {
9516
9517 }
9518
9521 {
9523 }
9524
9526 {
9527 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9528
9530 {
9531 if (newLevel == GameConstants.STATE_RUINED)
9532 {
9534 EntityAI parent = GetHierarchyParent();
9535 if (parent && parent.IsFireplace())
9536 {
9537 CargoBase cargo = GetInventory().GetCargo();
9538 if (cargo)
9539 {
9541 {
9543 }
9544 }
9545 }
9546 }
9547
9549 {
9550
9552 return;
9553 }
9554
9555 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9556 {
9558 }
9559 }
9560 }
9561
9562
9564 {
9565 super.OnRightClick();
9566
9568 {
9570 {
9571 if (ScriptInputUserData.CanStoreInputUserData())
9572 {
9573 EntityAI root = GetHierarchyRoot();
9574 Man playerOwner = GetHierarchyRootPlayer();
9575 InventoryLocation dst = new InventoryLocation;
9576
9577
9578 if (!playerOwner && root && root == this)
9579 {
9581 }
9582 else
9583 {
9584
9585 GetInventory().GetCurrentInventoryLocation(dst);
9587 {
9590 {
9592 }
9593 else
9594 {
9596
9597
9598 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9599 {
9601 }
9602 else
9603 {
9604 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9605 }
9606 }
9607 }
9608 }
9609
9610 ScriptInputUserData ctx = new ScriptInputUserData;
9618 }
9619 }
9620 else if (!
GetGame().IsMultiplayer())
9621 {
9623 }
9624 }
9625 }
9626
9628 {
9629 if (root)
9630 {
9631 vector m4[4];
9632 root.GetTransform(m4);
9633 dst.SetGround(this, m4);
9634 }
9635 else
9636 {
9637 GetInventory().GetCurrentInventoryLocation(dst);
9638 }
9639 }
9640
9641 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9642 {
9643
9644 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9645 return false;
9646
9647 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9648 return false;
9649
9650
9652 return false;
9653
9654
9655 Magazine mag = Magazine.Cast(this);
9656 if (mag)
9657 {
9658 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9659 return false;
9660
9661 if (stack_max_limit)
9662 {
9663 Magazine other_mag = Magazine.Cast(other_item);
9664 if (other_item)
9665 {
9666 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9667 return false;
9668 }
9669
9670 }
9671 }
9672 else
9673 {
9674
9676 return false;
9677
9679 return false;
9680 }
9681
9682 PlayerBase player = null;
9683 if (CastTo(player, GetHierarchyRootPlayer()))
9684 {
9685 if (player.GetInventory().HasAttachment(this))
9686 return false;
9687
9688 if (player.IsItemsToDelete())
9689 return false;
9690 }
9691
9692 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9693 return false;
9694
9695 int slotID;
9697 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9698 return false;
9699
9700 return true;
9701 }
9702
9704 {
9706 }
9707
9709 {
9710 return m_IsResultOfSplit;
9711 }
9712
9714 {
9715 m_IsResultOfSplit = value;
9716 }
9717
9719 {
9721 }
9722
9724 {
9725 float other_item_quantity = other_item.GetQuantity();
9726 float this_free_space;
9727
9729
9731
9732 if (other_item_quantity > this_free_space)
9733 {
9734 return this_free_space;
9735 }
9736 else
9737 {
9738 return other_item_quantity;
9739 }
9740 }
9741
9743 {
9745 }
9746
9748 {
9750 return;
9751
9752 if (!IsMagazine() && other_item)
9753 {
9755 if (quantity_used != 0)
9756 {
9757 float hp1 = GetHealth01("","");
9758 float hp2 = other_item.GetHealth01("","");
9759 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9760 hpResult = hpResult / (
GetQuantity() + quantity_used);
9761
9762 hpResult *= GetMaxHealth();
9763 Math.Round(hpResult);
9764 SetHealth("", "Health", hpResult);
9765
9767 other_item.AddQuantity(-quantity_used);
9768 }
9769 }
9771 }
9772
9774 {
9775 #ifdef SERVER
9776 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9777 GetHierarchyParent().IncreaseLifetimeUp();
9778 #endif
9779 };
9780
9782 {
9783 PlayerBase p = PlayerBase.Cast(player);
9784
9785 array<int> recipesIds = p.m_Recipes;
9786 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9787 if (moduleRecipesManager)
9788 {
9789 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9790 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9791 }
9792
9793 for (int i = 0;i < recipesIds.Count(); i++)
9794 {
9795 int key = recipesIds.Get(i);
9796 string recipeName = moduleRecipesManager.GetRecipeName(key);
9798 }
9799 }
9800
9801
9802 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9803 {
9804 super.GetDebugActions(outputList);
9805
9806
9812
9813
9818
9823
9824
9828
9829
9831 {
9835 }
9836
9839
9840
9844
9846
9847 InventoryLocation loc = new InventoryLocation();
9848 GetInventory().GetCurrentInventoryLocation(loc);
9850 {
9851 if (Gizmo_IsSupported())
9854 }
9855
9857 }
9858
9859
9860
9861
9863 {
9864 super.OnAction(action_id, player, ctx);
9865
9867 {
9868 switch (action_id)
9869 {
9872 return true;
9875 return true;
9876 }
9877 }
9878
9880 {
9881 switch (action_id)
9882 {
9884 Delete();
9885 return true;
9886 }
9887 }
9888
9889 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9890 {
9891 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9892 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9893 PlayerBase p = PlayerBase.Cast(player);
9894 if (
EActions.RECIPES_RANGE_START < 1000)
9895 {
9896 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9897 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9898 }
9899 }
9900 #ifndef SERVER
9901 else if (action_id ==
EActions.WATCH_PLAYER)
9902 {
9903 PluginDeveloper.SetDeveloperItemClientEx(player);
9904 }
9905 #endif
9907 {
9908 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9909 {
9910 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9911 OnDebugButtonPressServer(id + 1);
9912 }
9913
9914 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9915 {
9916 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9918 }
9919
9920 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9921 {
9922 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9924 }
9925
9926 else if (action_id ==
EActions.ADD_QUANTITY)
9927 {
9928 if (IsMagazine())
9929 {
9930 Magazine mag = Magazine.Cast(this);
9931 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9932 }
9933 else
9934 {
9936 }
9937
9938 if (m_EM)
9939 {
9940 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9941 }
9942
9943 }
9944
9945 else if (action_id ==
EActions.REMOVE_QUANTITY)
9946 {
9947 if (IsMagazine())
9948 {
9949 Magazine mag2 = Magazine.Cast(this);
9950 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9951 }
9952 else
9953 {
9955 }
9956 if (m_EM)
9957 {
9958 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9959 }
9960
9961 }
9962
9963 else if (action_id ==
EActions.SET_QUANTITY_0)
9964 {
9966
9967 if (m_EM)
9968 {
9969 m_EM.SetEnergy(0);
9970 }
9971 }
9972
9973 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9974 {
9976
9977 if (m_EM)
9978 {
9979 m_EM.SetEnergy(m_EM.GetEnergyMax());
9980 }
9981 }
9982
9983 else if (action_id ==
EActions.ADD_HEALTH)
9984 {
9985 AddHealth("","",GetMaxHealth("","Health")/5);
9986 }
9987 else if (action_id ==
EActions.REMOVE_HEALTH)
9988 {
9989 AddHealth("","",-GetMaxHealth("","Health")/5);
9990 }
9991 else if (action_id ==
EActions.DESTROY_HEALTH)
9992 {
9993 SetHealth01("","",0);
9994 }
9995 else if (action_id ==
EActions.WATCH_ITEM)
9996 {
9998 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9999 #ifdef DEVELOPER
10000 SetDebugDeveloper_item(this);
10001 #endif
10002 }
10003
10004 else if (action_id ==
EActions.ADD_TEMPERATURE)
10005 {
10006 AddTemperature(20);
10007
10008 }
10009
10010 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10011 {
10012 AddTemperature(-20);
10013
10014 }
10015
10016 else if (action_id ==
EActions.FLIP_FROZEN)
10017 {
10018 SetFrozen(!GetIsFrozen());
10019
10020 }
10021
10022 else if (action_id ==
EActions.ADD_WETNESS)
10023 {
10025
10026 }
10027
10028 else if (action_id ==
EActions.REMOVE_WETNESS)
10029 {
10031
10032 }
10033
10034 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10035 {
10038
10039
10040 }
10041
10042 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10043 {
10046 }
10047
10048 else if (action_id ==
EActions.MAKE_SPECIAL)
10049 {
10050 auto debugParams = DebugSpawnParams.WithPlayer(player);
10051 OnDebugSpawnEx(debugParams);
10052 }
10053
10054 }
10055
10056
10057 return false;
10058 }
10059
10060
10061
10062
10066
10069
10070
10071
10073 {
10074 return false;
10075 }
10076
10077
10079 {
10080 return true;
10081 }
10082
10083
10085 {
10086 return true;
10087 }
10088
10089
10090
10092 {
10093 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10095 }
10096
10099 {
10100 return null;
10101 }
10102
10104 {
10105 return false;
10106 }
10107
10109 {
10110 return false;
10111 }
10112
10116
10117
10119 {
10120 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10121 return module_repairing.CanRepair(this, item_repair_kit);
10122 }
10123
10124
10125 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10126 {
10127 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10128 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10129 }
10130
10131
10133 {
10134
10135
10136
10137
10138
10139
10140
10141
10142 return 1;
10143 }
10144
10145
10146
10148 {
10150 }
10151
10152
10153
10155 {
10157 }
10158
10159
10168 {
10169 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10170
10171 if (player)
10172 {
10173 player.MessageStatus(text);
10174 }
10175 }
10176
10177
10186 {
10187 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10188
10189 if (player)
10190 {
10191 player.MessageAction(text);
10192 }
10193 }
10194
10195
10204 {
10205 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10206
10207 if (player)
10208 {
10209 player.MessageFriendly(text);
10210 }
10211 }
10212
10213
10222 {
10223 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10224
10225 if (player)
10226 {
10227 player.MessageImportant(text);
10228 }
10229 }
10230
10232 {
10233 return true;
10234 }
10235
10236
10237 override bool KindOf(
string tag)
10238 {
10239 bool found = false;
10240 string item_name = this.
GetType();
10243
10244 int array_size = item_tag_array.Count();
10245 for (int i = 0; i < array_size; i++)
10246 {
10247 if (item_tag_array.Get(i) == tag)
10248 {
10249 found = true;
10250 break;
10251 }
10252 }
10253 return found;
10254 }
10255
10256
10258 {
10259
10260 super.OnRPC(sender, rpc_type,ctx);
10261
10262
10263 switch (rpc_type)
10264 {
10265 #ifndef SERVER
10266 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10267 Param2<bool, string> p = new Param2<bool, string>(false, "");
10268
10270 return;
10271
10272 bool play = p.param1;
10273 string soundSet = p.param2;
10274
10275 if (play)
10276 {
10278 {
10280 {
10282 }
10283 }
10284 else
10285 {
10287 }
10288 }
10289 else
10290 {
10292 }
10293
10294 break;
10295 #endif
10296
10297 }
10298
10300 {
10302 }
10303 }
10304
10305
10306
10307
10309 {
10310 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10311 return plugin.GetID(
name);
10312 }
10313
10315 {
10316 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10317 return plugin.GetName(id);
10318 }
10319
10322 {
10323
10324
10325 int varFlags;
10326 if (!ctx.
Read(varFlags))
10327 return;
10328
10329 if (varFlags & ItemVariableFlags.FLOAT)
10330 {
10332 }
10333 }
10334
10336 {
10337
10338 super.SerializeNumericalVars(floats_out);
10339
10340
10341
10343 {
10345 }
10346
10348 {
10350 }
10351
10353 {
10355 }
10356
10358 {
10363 }
10364
10366 {
10368 }
10369 }
10370
10372 {
10373
10374 super.DeSerializeNumericalVars(floats);
10375
10376
10377 int index = 0;
10378 int mask = Math.Round(floats.Get(index));
10379
10380 index++;
10381
10383 {
10385 {
10387 }
10388 else
10389 {
10390 float quantity = floats.Get(index);
10391 SetQuantity(quantity,
true,
false,
false,
false);
10392 }
10393 index++;
10394 }
10395
10397 {
10398 float wet = floats.Get(index);
10400 index++;
10401 }
10402
10404 {
10405 int liquidtype = Math.Round(floats.Get(index));
10407 index++;
10408 }
10409
10411 {
10413 index++;
10415 index++;
10417 index++;
10419 index++;
10420 }
10421
10423 {
10424 int cleanness = Math.Round(floats.Get(index));
10426 index++;
10427 }
10428 }
10429
10431 {
10432 super.WriteVarsToCTX(ctx);
10433
10434
10436 {
10438 }
10439
10441 {
10443 }
10444
10446 {
10448 }
10449
10451 {
10452 int r,g,b,a;
10458 }
10459
10461 {
10463 }
10464 }
10465
10467 {
10468 if (!super.ReadVarsFromCTX(ctx,version))
10469 return false;
10470
10471 int intValue;
10472 float value;
10473
10474 if (version < 140)
10475 {
10476 if (!ctx.
Read(intValue))
10477 return false;
10478
10479 m_VariablesMask = intValue;
10480 }
10481
10483 {
10484 if (!ctx.
Read(value))
10485 return false;
10486
10488 {
10490 }
10491 else
10492 {
10494 }
10495 }
10496
10497 if (version < 140)
10498 {
10500 {
10501 if (!ctx.
Read(value))
10502 return false;
10503 SetTemperatureDirect(value);
10504 }
10505 }
10506
10508 {
10509 if (!ctx.
Read(value))
10510 return false;
10512 }
10513
10515 {
10516 if (!ctx.
Read(intValue))
10517 return false;
10519 }
10520
10522 {
10523 int r,g,b,a;
10525 return false;
10527 return false;
10529 return false;
10531 return false;
10532
10534 }
10535
10537 {
10538 if (!ctx.
Read(intValue))
10539 return false;
10541 }
10542
10543 if (version >= 138 && version < 140)
10544 {
10546 {
10547 if (!ctx.
Read(intValue))
10548 return false;
10549 SetFrozen(intValue);
10550 }
10551 }
10552
10553 return true;
10554 }
10555
10556
10558 {
10561 {
10563 }
10564
10565 if (!super.OnStoreLoad(ctx, version))
10566 {
10568 return false;
10569 }
10570
10571 if (version >= 114)
10572 {
10573 bool hasQuickBarIndexSaved;
10574
10575 if (!ctx.
Read(hasQuickBarIndexSaved))
10576 {
10578 return false;
10579 }
10580
10581 if (hasQuickBarIndexSaved)
10582 {
10583 int itmQBIndex;
10584
10585
10586 if (!ctx.
Read(itmQBIndex))
10587 {
10589 return false;
10590 }
10591
10592 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10593 if (itmQBIndex != -1 && parentPlayer)
10594 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10595 }
10596 }
10597 else
10598 {
10599
10600 PlayerBase player;
10601 int itemQBIndex;
10602 if (version ==
int.
MAX)
10603 {
10604 if (!ctx.
Read(itemQBIndex))
10605 {
10607 return false;
10608 }
10609 }
10610 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10611 {
10612
10613 if (!ctx.
Read(itemQBIndex))
10614 {
10616 return false;
10617 }
10618 if (itemQBIndex != -1 && player)
10619 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10620 }
10621 }
10622
10623 if (version < 140)
10624 {
10625
10626 if (!LoadVariables(ctx, version))
10627 {
10629 return false;
10630 }
10631 }
10632
10633
10635 {
10637 return false;
10638 }
10639 if (version >= 132)
10640 {
10642 if (raib)
10643 {
10645 {
10647 return false;
10648 }
10649 }
10650 }
10651
10653 return true;
10654 }
10655
10656
10657
10659 {
10660 super.OnStoreSave(ctx);
10661
10662 PlayerBase player;
10663 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10664 {
10666
10667 int itemQBIndex = -1;
10668 itemQBIndex = player.FindQuickBarEntityIndex(this);
10669 ctx.
Write(itemQBIndex);
10670 }
10671 else
10672 {
10674 }
10675
10677
10679 if (raib)
10680 {
10682 }
10683 }
10684
10685
10687 {
10688 super.AfterStoreLoad();
10689
10691 {
10693 }
10694
10696 {
10699 }
10700 }
10701
10703 {
10704 super.EEOnAfterLoad();
10705
10707 {
10709 }
10710
10713 }
10714
10716 {
10717 return false;
10718 }
10719
10720
10721
10723 {
10725 {
10726 #ifdef PLATFORM_CONSOLE
10727
10729 {
10731 if (menu)
10732 {
10734 }
10735 }
10736 #endif
10737 }
10738
10740 {
10743 }
10744
10746 {
10747 SetWeightDirty();
10749 }
10751 {
10754 }
10755
10757 {
10760 }
10762 {
10765 }
10766
10767 super.OnVariablesSynchronized();
10768 }
10769
10770
10771
10773 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10774 {
10775 if (!IsServerCheck(allow_client))
10776 return false;
10777
10779 return false;
10780
10783
10784 if (value <= (min + 0.001))
10785 value = min;
10786
10787 if (value == min)
10788 {
10789 if (destroy_config)
10790 {
10791 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10792 if (dstr)
10793 {
10795 this.Delete();
10796 return true;
10797 }
10798 }
10799 else if (destroy_forced)
10800 {
10802 this.Delete();
10803 return true;
10804 }
10805
10807 }
10808
10811
10813 {
10815
10816 if (delta)
10818 }
10819
10821
10822 return false;
10823 }
10824
10825
10827 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10828 {
10830 }
10831
10833 {
10836 }
10837
10839 {
10842 }
10843
10845 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10846 {
10847 float value_clamped = Math.Clamp(value, 0, 1);
10849 SetQuantity(result, destroy_config, destroy_forced);
10850 }
10851
10852
10855 {
10857 }
10858
10860 {
10862 }
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10874 {
10875 int slot = -1;
10876 if (GetInventory())
10877 {
10878 InventoryLocation il = new InventoryLocation;
10879 GetInventory().GetCurrentInventoryLocation(il);
10881 }
10882
10884 }
10885
10887 {
10888 float quantity_max = 0;
10889
10891 {
10892 if (attSlotID != -1)
10893 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10894
10895 if (quantity_max <= 0)
10897 }
10898
10899 if (quantity_max <= 0)
10901
10902 return quantity_max;
10903 }
10904
10906 {
10908 }
10909
10911 {
10913 }
10914
10915
10917 {
10919 }
10920
10922 {
10924 }
10925
10927 {
10929 }
10930
10931
10933 {
10934
10935 float weightEx = GetWeightEx();
10936 float special = GetInventoryAndCargoWeight();
10937 return weightEx - special;
10938 }
10939
10940
10942 {
10944 }
10945
10947 {
10949 {
10950 #ifdef DEVELOPER
10951 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10952 {
10953 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10955 }
10956 #endif
10957
10958 return GetQuantity() * GetConfigWeightModified();
10959 }
10960 else if (HasEnergyManager())
10961 {
10962 #ifdef DEVELOPER
10963 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10964 {
10965 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10966 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10967 }
10968 #endif
10969 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10970 }
10971 else
10972 {
10973 #ifdef DEVELOPER
10974 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10975 {
10976 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10977 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10978 }
10979 #endif
10980 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10981 }
10982 }
10983
10986 {
10987 int item_count = 0;
10989
10990 if (GetInventory().GetCargo() != NULL)
10991 {
10992 item_count = GetInventory().GetCargo().GetItemCount();
10993 }
10994
10995 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10996 {
10997 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10998 if (item)
10999 item_count += item.GetNumberOfItems();
11000 }
11001 return item_count;
11002 }
11003
11006 {
11007 float weight = 0;
11008 float wetness = 1;
11009 if (include_wetness)
11012 {
11013 weight = wetness * m_ConfigWeight;
11014 }
11016 {
11017 weight = 1;
11018 }
11019 return weight;
11020 }
11021
11022
11023
11025 {
11026 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11027 {
11028 GameInventory inv = GetInventory();
11029 array<EntityAI> items = new array<EntityAI>;
11031 for (int i = 0; i < items.Count(); i++)
11032 {
11034 if (item)
11035 {
11037 }
11038 }
11039 }
11040 }
11041
11042
11043
11044
11046 {
11047 float energy = 0;
11048 if (HasEnergyManager())
11049 {
11050 energy = GetCompEM().GetEnergy();
11051 }
11052 return energy;
11053 }
11054
11055
11057 {
11058 super.OnEnergyConsumed();
11059
11061 }
11062
11064 {
11065 super.OnEnergyAdded();
11066
11068 }
11069
11070
11072 {
11073 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11074 {
11076 {
11077 float energy_0to1 = GetCompEM().GetEnergy0To1();
11079 }
11080 }
11081 }
11082
11083
11085 {
11086 return ConfigGetFloat("heatIsolation");
11087 }
11088
11090 {
11092 }
11093
11095 {
11096 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11097 if (
GetGame().ConfigIsExisting(paramPath))
11099
11100 return 0.0;
11101 }
11102
11104 {
11105 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11106 if (
GetGame().ConfigIsExisting(paramPath))
11108
11109 return 0.0;
11110 }
11111
11112 override void SetWet(
float value,
bool allow_client =
false)
11113 {
11114 if (!IsServerCheck(allow_client))
11115 return;
11116
11119
11121
11122 m_VarWet = Math.Clamp(value, min, max);
11123
11125 {
11128 }
11129 }
11130
11131 override void AddWet(
float value)
11132 {
11134 }
11135
11137 {
11139 }
11140
11142 {
11144 }
11145
11147 {
11149 }
11150
11152 {
11154 }
11155
11157 {
11159 }
11160
11161 override void OnWetChanged(
float newVal,
float oldVal)
11162 {
11165 if (newLevel != oldLevel)
11166 {
11168 }
11169 }
11170
11172 {
11173 SetWeightDirty();
11174 }
11175
11177 {
11178 return GetWetLevelInternal(
m_VarWet);
11179 }
11180
11181
11182
11184 {
11186 }
11187
11189 {
11191 }
11192
11194 {
11196 }
11197
11199 {
11201 }
11202
11203
11204
11206 {
11207 if (ConfigIsExisting("itemModelLength"))
11208 {
11209 return ConfigGetFloat("itemModelLength");
11210 }
11211 return 0;
11212 }
11213
11215 {
11216 if (ConfigIsExisting("itemAttachOffset"))
11217 {
11218 return ConfigGetFloat("itemAttachOffset");
11219 }
11220 return 0;
11221 }
11222
11223 override void SetCleanness(
int value,
bool allow_client =
false)
11224 {
11225 if (!IsServerCheck(allow_client))
11226 return;
11227
11229
11231
11234 }
11235
11237 {
11239 }
11240
11242 {
11243 return true;
11244 }
11245
11246
11247
11248
11250 {
11252 }
11253
11255 {
11257 }
11258
11259
11260
11261
11262 override void SetColor(
int r,
int g,
int b,
int a)
11263 {
11269 }
11271 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11272 {
11277 }
11278
11280 {
11282 }
11283
11286 {
11287 int r,g,b,a;
11289 r = r/255;
11290 g = g/255;
11291 b = b/255;
11292 a = a/255;
11293 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11294 }
11295
11296
11297
11298 override void SetLiquidType(
int value,
bool allow_client =
false)
11299 {
11300 if (!IsServerCheck(allow_client))
11301 return;
11302
11307 }
11308
11310 {
11311 return ConfigGetInt("varLiquidTypeInit");
11312 }
11313
11315 {
11317 }
11318
11320 {
11322 SetFrozen(false);
11323 }
11324
11327 {
11328 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11329 }
11330
11331
11334 {
11335 PlayerBase nplayer;
11336 if (PlayerBase.CastTo(nplayer, player))
11337 {
11339
11340 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11341 }
11342 }
11343
11344
11347 {
11348 PlayerBase nplayer;
11349 if (PlayerBase.CastTo(nplayer,player))
11350 {
11351
11352 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11353
11354 }
11355
11356
11357 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11358
11359
11360 if (HasEnergyManager())
11361 {
11362 GetCompEM().UpdatePlugState();
11363 }
11364 }
11365
11366
11368 {
11369 super.OnPlacementStarted(player);
11370
11372 }
11373
11374 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11375 {
11377 {
11378 m_AdminLog.OnPlacementComplete(player,
this);
11379 }
11380
11381 super.OnPlacementComplete(player, position, orientation);
11382 }
11383
11384
11385
11386
11387
11389 {
11391 {
11392 return true;
11393 }
11394 else
11395 {
11396 return false;
11397 }
11398 }
11399
11400
11402 {
11404 {
11406 }
11407 }
11408
11409
11411 {
11413 }
11414
11416 {
11418 }
11419
11420 override void InsertAgent(
int agent,
float count = 1)
11421 {
11422 if (count < 1)
11423 return;
11424
11426 }
11427
11430 {
11432 }
11433
11434
11436 {
11438 }
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11482 {
11484 return false;
11485 return true;
11486 }
11487
11489 {
11490
11492 }
11493
11494
11497 {
11498 super.CheckForRoofLimited(timeTresholdMS);
11499
11501 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11502 {
11503 m_PreviousRoofTestTime = time;
11504 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11505 }
11506 }
11507
11508
11510 {
11512 {
11513 return 0;
11514 }
11515
11516 if (GetInventory().GetAttachmentSlotsCount() != 0)
11517 {
11518 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11519 if (filter)
11520 return filter.GetProtectionLevel(type, false, system);
11521 else
11522 return 0;
11523 }
11524
11525 string subclassPath, entryName;
11526
11527 switch (type)
11528 {
11530 entryName = "biological";
11531 break;
11533 entryName = "chemical";
11534 break;
11535 default:
11536 entryName = "biological";
11537 break;
11538 }
11539
11540 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11541
11543 }
11544
11545
11546
11549 {
11550 if (!IsMagazine())
11552
11554 }
11555
11556
11557
11558
11559
11564 {
11565 return true;
11566 }
11567
11569 {
11571 }
11572
11573
11574
11575
11576
11578 {
11579 if (parent)
11580 {
11581 if (parent.IsInherited(DayZInfected))
11582 return true;
11583
11584 if (!parent.IsRuined())
11585 return true;
11586 }
11587
11588 return true;
11589 }
11590
11592 {
11593 if (!super.CanPutAsAttachment(parent))
11594 {
11595 return false;
11596 }
11597
11598 if (!IsRuined() && !parent.IsRuined())
11599 {
11600 return true;
11601 }
11602
11603 return false;
11604 }
11605
11607 {
11608
11609
11610
11611
11612 return super.CanReceiveItemIntoCargo(item);
11613 }
11614
11616 {
11617
11618
11619
11620
11621 GameInventory attachmentInv = attachment.GetInventory();
11623 {
11624 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11625 return false;
11626 }
11627
11628 InventoryLocation loc = new InventoryLocation();
11629 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11630 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11631 return false;
11632
11633 return super.CanReceiveAttachment(attachment, slotId);
11634 }
11635
11637 {
11638 if (!super.CanReleaseAttachment(attachment))
11639 return false;
11640
11641 return GetInventory().AreChildrenAccessible();
11642 }
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11665 {
11666 int id = muzzle_owner.GetMuzzleID();
11667 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11668
11669 if (WPOF_array)
11670 {
11671 for (int i = 0; i < WPOF_array.Count(); i++)
11672 {
11673 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11674
11675 if (WPOF)
11676 {
11677 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11678 }
11679 }
11680 }
11681 }
11682
11683
11685 {
11686 int id = muzzle_owner.GetMuzzleID();
11688
11689 if (WPOBE_array)
11690 {
11691 for (int i = 0; i < WPOBE_array.Count(); i++)
11692 {
11693 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11694
11695 if (WPOBE)
11696 {
11697 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11698 }
11699 }
11700 }
11701 }
11702
11703
11705 {
11706 int id = muzzle_owner.GetMuzzleID();
11707 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11708
11709 if (WPOOH_array)
11710 {
11711 for (int i = 0; i < WPOOH_array.Count(); i++)
11712 {
11713 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11714
11715 if (WPOOH)
11716 {
11717 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11718 }
11719 }
11720 }
11721 }
11722
11723
11725 {
11726 int id = muzzle_owner.GetMuzzleID();
11727 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11728
11729 if (WPOOH_array)
11730 {
11731 for (int i = 0; i < WPOOH_array.Count(); i++)
11732 {
11733 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11734
11735 if (WPOOH)
11736 {
11737 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11738 }
11739 }
11740 }
11741 }
11742
11743
11745 {
11746 int id = muzzle_owner.GetMuzzleID();
11747 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11748
11749 if (WPOOH_array)
11750 {
11751 for (int i = 0; i < WPOOH_array.Count(); i++)
11752 {
11753 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11754
11755 if (WPOOH)
11756 {
11757 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11758 }
11759 }
11760 }
11761 }
11762
11763
11764
11766 {
11768 {
11769 return true;
11770 }
11771
11772 return false;
11773 }
11774
11776 {
11778 {
11779 return true;
11780 }
11781
11782 return false;
11783 }
11784
11786 {
11788 {
11789 return true;
11790 }
11791
11792 return false;
11793 }
11794
11796 {
11797 return false;
11798 }
11799
11802 {
11803 return UATimeSpent.DEFAULT_DEPLOY;
11804 }
11805
11806
11807
11808
11810 {
11812 SetSynchDirty();
11813 }
11814
11816 {
11818 }
11819
11820
11822 {
11823 return false;
11824 }
11825
11828 {
11829 string att_type = "None";
11830
11831 if (ConfigIsExisting("soundAttType"))
11832 {
11833 att_type = ConfigGetString("soundAttType");
11834 }
11835
11837 }
11838
11840 {
11842 }
11843
11844
11845
11846
11847
11853
11855 {
11858
11860 }
11861
11862
11864 {
11866 return;
11867
11869
11872
11875
11876 SoundParameters params = new SoundParameters();
11880 }
11881
11882
11884 {
11886 return;
11887
11889 SetSynchDirty();
11890
11893 }
11894
11895
11897 {
11899 return;
11900
11902 SetSynchDirty();
11903
11906 }
11907
11909 {
11911 }
11912
11914 {
11916 }
11917
11920 {
11921 if (!
GetGame().IsDedicatedServer())
11922 {
11923 if (ConfigIsExisting("attachSoundSet"))
11924 {
11925 string cfg_path = "";
11926 string soundset = "";
11927 string type_name =
GetType();
11928
11931 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11932 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11933
11934 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11935 {
11936 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11937 {
11938 if (cfg_slot_array[i] == slot_type)
11939 {
11940 soundset = cfg_soundset_array[i];
11941 break;
11942 }
11943 }
11944 }
11945
11946 if (soundset != "")
11947 {
11948 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11950 }
11951 }
11952 }
11953 }
11954
11956 {
11957
11958 }
11959
11960 void OnApply(PlayerBase player);
11961
11963 {
11964 return 1.0;
11965 };
11966
11968 {
11970 }
11971
11973 {
11975 }
11976
11978
11980 {
11981 SetDynamicPhysicsLifeTime(0.01);
11983 }
11984
11986 {
11987 array<string> zone_names = new array<string>;
11988 GetDamageZones(zone_names);
11989 for (int i = 0; i < zone_names.Count(); i++)
11990 {
11991 SetHealthMax(zone_names.Get(i),"Health");
11992 }
11993 SetHealthMax("","Health");
11994 }
11995
11998 {
11999 float global_health = GetHealth01("","Health");
12000 array<string> zones = new array<string>;
12001 GetDamageZones(zones);
12002
12003 for (int i = 0; i < zones.Count(); i++)
12004 {
12005 SetHealth01(zones.Get(i),"Health",global_health);
12006 }
12007 }
12008
12011 {
12012 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12013 }
12014
12016 {
12017 if (!hasRootAsPlayer)
12018 {
12019 if (refParentIB)
12020 {
12021
12022 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12023 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12024
12025 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12026 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12027
12030 }
12031 else
12032 {
12033
12036 }
12037 }
12038 }
12039
12041 {
12043 {
12044 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12045 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12046 {
12047 float heatPermCoef = 1.0;
12049 while (ent)
12050 {
12051 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12052 ent = ent.GetHierarchyParent();
12053 }
12054
12055 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12056 }
12057 }
12058 }
12059
12061 {
12062
12063 EntityAI parent = GetHierarchyParent();
12064 if (!parent)
12065 {
12066 hasParent = false;
12067 hasRootAsPlayer = false;
12068 }
12069 else
12070 {
12071 hasParent = true;
12072 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12073 refParentIB =
ItemBase.Cast(parent);
12074 }
12075 }
12076
12077 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12078 {
12079
12080 }
12081
12083 {
12084
12085 return false;
12086 }
12087
12089 {
12090
12091
12092 return false;
12093 }
12094
12096 {
12097
12098 return false;
12099 }
12100
12103 {
12104 return !GetIsFrozen() &&
IsOpen();
12105 }
12106
12108 {
12109 bool hasParent = false, hasRootAsPlayer = false;
12111
12112 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12113 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12114
12115 if (wwtu || foodDecay)
12116 {
12120
12121 if (processWetness || processTemperature || processDecay)
12122 {
12124
12125 if (processWetness)
12126 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12127
12128 if (processTemperature)
12130
12131 if (processDecay)
12132 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12133 }
12134 }
12135 }
12136
12139 {
12141 }
12142
12144 {
12147
12148 return super.GetTemperatureFreezeThreshold();
12149 }
12150
12152 {
12155
12156 return super.GetTemperatureThawThreshold();
12157 }
12158
12160 {
12163
12164 return super.GetItemOverheatThreshold();
12165 }
12166
12168 {
12170 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12171
12172 return super.GetTemperatureFreezeTime();
12173 }
12174
12176 {
12178 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12179
12180 return super.GetTemperatureThawTime();
12181 }
12182
12187
12189 {
12190 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12191 }
12192
12194 {
12195 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12196 }
12197
12200 {
12202 }
12203
12205 {
12207 }
12208
12210 {
12212 }
12213
12216 {
12217 return null;
12218 }
12219
12222 {
12223 return false;
12224 }
12225
12227 {
12229 {
12232 if (!trg)
12233 {
12235 explosive = this;
12236 }
12237
12238 explosive.PairRemote(trg);
12240
12241 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12242 trg.SetPersistentPairID(persistentID);
12243 explosive.SetPersistentPairID(persistentID);
12244
12245 return true;
12246 }
12247 return false;
12248 }
12249
12252 {
12253 float ret = 1.0;
12256 ret *= GetHealth01();
12257
12258 return ret;
12259 }
12260
12261 #ifdef DEVELOPER
12262 override void SetDebugItem()
12263 {
12264 super.SetDebugItem();
12265 _itemBase = this;
12266 }
12267
12269 {
12270 string text = super.GetDebugText();
12271
12273 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12274
12275 return text;
12276 }
12277 #endif
12278
12280 {
12281 return true;
12282 }
12283
12285
12287
12289 {
12292 }
12293
12294
12302
12318}
12319
12321{
12323 if (entity)
12324 {
12325 bool is_item = entity.IsInherited(
ItemBase);
12326 if (is_item && full_quantity)
12327 {
12330 }
12331 }
12332 else
12333 {
12335 return NULL;
12336 }
12337 return entity;
12338}
12339
12341{
12342 if (item)
12343 {
12344 if (health > 0)
12345 item.SetHealth("", "", health);
12346
12347 if (item.CanHaveTemperature())
12348 {
12350 if (item.CanFreeze())
12351 item.SetFrozen(false);
12352 }
12353
12354 if (item.HasEnergyManager())
12355 {
12356 if (quantity >= 0)
12357 {
12358 item.GetCompEM().SetEnergy0To1(quantity);
12359 }
12360 else
12361 {
12363 }
12364 }
12365 else if (item.IsMagazine())
12366 {
12367 Magazine mag = Magazine.Cast(item);
12368 if (quantity >= 0)
12369 {
12370 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12371 }
12372 else
12373 {
12375 }
12376
12377 }
12378 else
12379 {
12380 if (quantity >= 0)
12381 {
12382 item.SetQuantityNormalized(quantity, false);
12383 }
12384 else
12385 {
12387 }
12388
12389 }
12390 }
12391}
12392
12393#ifdef DEVELOPER
12395#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.