7482{
7484 {
7485 return true;
7486 }
7487};
7488
7489
7490
7492{
7496
7498
7501
7502
7503
7504
7505
7514
7520
7525
7530
7551 protected bool m_IsResultOfSplit
7552
7554
7559
7560
7561
7563
7567
7568
7569
7571
7574
7575
7576
7582
7583
7591
7594
7595
7597
7598
7600
7601
7606
7607
7612
7613
7615
7616
7618 {
7623
7624 if (!
GetGame().IsDedicatedServer())
7625 {
7627 {
7629
7631 {
7633 }
7634 }
7635
7638 }
7639
7640 m_OldLocation = null;
7641
7643 {
7645 }
7646
7647 if (ConfigIsExisting("headSelectionsToHide"))
7648 {
7651 }
7652
7654 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7655 {
7657 }
7658
7660
7661 m_IsResultOfSplit = false;
7662
7664 }
7665
7667 {
7668 super.InitItemVariables();
7669
7675 m_Count = ConfigGetInt(
"count");
7676
7679
7684
7687
7692
7704
7708
7709
7712 if (ConfigIsExisting("canBeSplit"))
7713 {
7716 }
7717
7719 if (ConfigIsExisting("itemBehaviour"))
7721
7722
7725 RegisterNetSyncVariableInt("m_VarLiquidType");
7726 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7727
7728 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7729 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7730 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7731
7732 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7733 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7734 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7735 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7736
7737 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7738 RegisterNetSyncVariableBool("m_IsTakeable");
7739 RegisterNetSyncVariableBool("m_IsHologram");
7740
7743 {
7746 }
7747
7749
7751 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7753
7754 }
7755
7757 {
7759 }
7760
7762 {
7765 {
7770 }
7771 }
7772
7773 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7774 {
7776 {
7779 }
7780
7782 }
7783
7785 {
7791 }
7792
7794
7796 {
7798
7799 if (!action)
7800 {
7801 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7802 return;
7803 }
7804
7806 if (!ai)
7807 {
7809 return;
7810 }
7811
7813 if (!action_array)
7814 {
7815 action_array = new array<ActionBase_Basic>;
7817 }
7818 if (LogManager.IsActionLogEnable())
7819 {
7820 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7821 }
7822
7823 if (action_array.Find(action) != -1)
7824 {
7825 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7826 }
7827 else
7828 {
7829 action_array.Insert(action);
7830 }
7831 }
7832
7834 {
7836 ActionBase action = player.GetActionManager().GetAction(actionName);
7839
7840 if (action_array)
7841 {
7842 action_array.RemoveItem(action);
7843 }
7844 }
7845
7846
7847
7849 {
7850 ActionOverrideData overrideData = new ActionOverrideData();
7854
7856 if (!actionMap)
7857 {
7860 }
7861
7862 actionMap.Insert(this.
Type(), overrideData);
7863
7864 }
7865
7867
7869
7870
7872 {
7875
7878
7879 string config_to_search = "CfgVehicles";
7880 string muzzle_owner_config;
7881
7883 {
7884 if (IsInherited(Weapon))
7885 config_to_search = "CfgWeapons";
7886
7887 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7888
7889 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7890
7892
7893 if (config_OnFire_subclass_count > 0)
7894 {
7895 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7896
7897 for (int i = 0; i < config_OnFire_subclass_count; i++)
7898 {
7899 string particle_class = "";
7901 string config_OnFire_entry = config_OnFire_class + particle_class;
7902 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7903 WPOF_array.Insert(WPOF);
7904 }
7905
7906
7908 }
7909 }
7910
7912 {
7913 config_to_search = "CfgWeapons";
7914 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7915
7916 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7917
7919
7920 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7921 {
7922 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7923
7924 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7925 {
7926 string particle_class2 = "";
7928 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7929 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7930 WPOBE_array.Insert(WPOBE);
7931 }
7932
7933
7935 }
7936 }
7937 }
7938
7939
7941 {
7944
7946 {
7947 string config_to_search = "CfgVehicles";
7948
7949 if (IsInherited(Weapon))
7950 config_to_search = "CfgWeapons";
7951
7952 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7953 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7954
7955 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7956 {
7957
7959
7961 {
7963 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7965 return;
7966 }
7967
7970
7971
7972
7974 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7975
7976 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7977 {
7978 string particle_class = "";
7980 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7982
7983 if (entry_type == CT_CLASS)
7984 {
7985 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7986 WPOOH_array.Insert(WPOF);
7987 }
7988 }
7989
7990
7992 }
7993 }
7994 }
7995
7997 {
7999 }
8000
8002 {
8004 {
8006
8009
8012
8013 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8014 }
8015 }
8016
8018 {
8020 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8021
8023 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8024
8026 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8027
8029 {
8031 }
8032 }
8033
8035 {
8037 }
8038
8040 {
8043 else
8045
8047 {
8050 }
8051 else
8052 {
8055
8058 }
8059
8061 }
8062
8064 {
8066 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8067 }
8068
8070 {
8072 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8074 }
8075
8077 {
8079 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8080 }
8081
8083 {
8086
8087 OverheatingParticle OP = new OverheatingParticle();
8092
8094 }
8095
8097 {
8100
8101 return -1;
8102 }
8103
8105 {
8107 {
8110
8111 for (int i = count; i > 0; --i)
8112 {
8113 int id = i - 1;
8116
8119
8120 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8121 {
8122 if (p)
8123 {
8126 }
8127 }
8128 }
8129 }
8130 }
8131
8133 {
8135 {
8137 {
8138 int id = i - 1;
8140
8141 if (OP)
8142 {
8144
8145 if (p)
8146 {
8148 }
8149
8150 delete OP;
8151 }
8152 }
8153
8156 }
8157 }
8158
8161 {
8162 return 0.0;
8163 }
8164
8165
8167 {
8168 return 250;
8169 }
8170
8172 {
8173 return 0;
8174 }
8175
8178 {
8180 return true;
8181
8182 return false;
8183 }
8184
8187 {
8190
8192 {
8194 }
8195 else
8196 {
8197
8199 }
8200
8202 }
8203
8210 {
8211 return -1;
8212 }
8213
8214
8215
8216
8218 {
8220 {
8222 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8223
8224 if (r_index >= 0)
8225 {
8226 InventoryLocation r_il = new InventoryLocation;
8227 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8228
8229 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8232 {
8233 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8234 }
8236 {
8237 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8238 }
8239
8240 }
8241
8242 player.GetHumanInventory().ClearUserReservedLocation(this);
8243 }
8244
8247 }
8248
8249
8250
8251
8253 {
8254 return ItemBase.m_DebugActionsMask;
8255 }
8256
8258 {
8259 return ItemBase.m_DebugActionsMask & mask;
8260 }
8261
8263 {
8264 ItemBase.m_DebugActionsMask = mask;
8265 }
8266
8268 {
8269 ItemBase.m_DebugActionsMask |= mask;
8270 }
8271
8273 {
8274 ItemBase.m_DebugActionsMask &= ~mask;
8275 }
8276
8278 {
8280 {
8282 }
8283 else
8284 {
8286 }
8287 }
8288
8289
8291 {
8292 if (GetEconomyProfile())
8293 {
8294 float q_max = GetEconomyProfile().GetQuantityMax();
8295 if (q_max > 0)
8296 {
8297 float q_min = GetEconomyProfile().GetQuantityMin();
8298 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8299
8301 {
8302 ComponentEnergyManager comp = GetCompEM();
8304 {
8306 }
8307 }
8309 {
8311
8312 }
8313
8314 }
8315 }
8316 }
8317
8320 {
8321 EntityAI parent = GetHierarchyParent();
8322
8323 if (parent)
8324 {
8325 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8326 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8327 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8328 }
8329 }
8330
8333 {
8334 EntityAI parent = GetHierarchyParent();
8335
8336 if (parent)
8337 {
8338 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8339 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8340 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8341 }
8342 }
8343
8345 {
8346
8347
8348
8349
8351
8353 {
8354 if (ScriptInputUserData.CanStoreInputUserData())
8355 {
8356 ScriptInputUserData ctx = new ScriptInputUserData;
8362 ctx.
Write(use_stack_max);
8365
8367 {
8368 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8369 }
8370 }
8371 }
8372 else if (!
GetGame().IsMultiplayer())
8373 {
8375 }
8376 }
8377
8379 {
8381 }
8382
8384 {
8386 }
8387
8389 {
8391 }
8392
8394 {
8395
8396 return false;
8397 }
8398
8400 {
8401 return false;
8402 }
8403
8407 {
8408 return false;
8409 }
8410
8412 {
8413 return "";
8414 }
8415
8417
8419 {
8420 return false;
8421 }
8422
8424 {
8425 return true;
8426 }
8427
8428
8429
8431 {
8432 return true;
8433 }
8434
8436 {
8437 return true;
8438 }
8439
8441 {
8442 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8444 }
8445
8447 {
8449 }
8450
8452 {
8454 if (!is_being_placed)
8456 SetSynchDirty();
8457 }
8458
8459
8461
8463 {
8465 }
8466
8468 {
8470 }
8471
8473 {
8474 return 1;
8475 }
8476
8478 {
8479 return false;
8480 }
8481
8483 {
8485 SetSynchDirty();
8486 }
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8523 {
8524 super.OnMovedInsideCargo(container);
8525
8526 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8527 }
8528
8529 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8530 {
8531 super.EEItemLocationChanged(oldLoc,newLoc);
8532
8533 PlayerBase new_player = null;
8534 PlayerBase old_player = null;
8535
8536 if (newLoc.GetParent())
8537 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8538
8539 if (oldLoc.GetParent())
8540 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8541
8543 {
8544 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8545
8546 if (r_index >= 0)
8547 {
8548 InventoryLocation r_il = new InventoryLocation;
8549 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8550
8551 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8554 {
8555 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8556 }
8558 {
8559 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8560 }
8561
8562 }
8563 }
8564
8566 {
8567 if (new_player)
8568 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8569
8570 if (new_player == old_player)
8571 {
8572
8573 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8574 {
8576 {
8577 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8578 {
8579 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8580 }
8581 }
8582 else
8583 {
8584 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8585 }
8586 }
8587
8588 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8589 {
8590 int type = oldLoc.GetType();
8592 {
8593 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8594 }
8596 {
8597 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8598 }
8599 }
8600 if (!m_OldLocation)
8601 {
8602 m_OldLocation = new InventoryLocation;
8603 }
8604 m_OldLocation.Copy(oldLoc);
8605 }
8606 else
8607 {
8608 if (m_OldLocation)
8609 {
8610 m_OldLocation.Reset();
8611 }
8612 }
8613
8615 }
8616 else
8617 {
8618 if (new_player)
8619 {
8620 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8621 if (res_index >= 0)
8622 {
8623 InventoryLocation il = new InventoryLocation;
8624 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8626 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8629 {
8630 il.
GetParent().GetOnReleaseLock().Invoke(it);
8631 }
8633 {
8635 }
8636
8637 }
8638 }
8640 {
8641
8643 }
8644
8645 if (m_OldLocation)
8646 {
8647 m_OldLocation.Reset();
8648 }
8649 }
8650 }
8651
8652 override void EOnContact(IEntity other, Contact extra)
8653 {
8655 {
8656 int liquidType = -1;
8658 if (impactSpeed > 0.0)
8659 {
8661 #ifndef SERVER
8663 #else
8665 SetSynchDirty();
8666 #endif
8668 }
8669 }
8670
8671 #ifdef SERVER
8672 if (GetCompEM() && GetCompEM().IsPlugged())
8673 {
8674 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8675 GetCompEM().UnplugThis();
8676 }
8677 #endif
8678 }
8679
8681
8683 {
8685 }
8686
8688 {
8689
8690 }
8691
8693 {
8694 super.OnItemLocationChanged(old_owner, new_owner);
8695
8696 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8697 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8698
8699 if (!relatedPlayer && playerNew)
8700 relatedPlayer = playerNew;
8701
8702 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8703 {
8705 if (actionMgr)
8706 {
8707 ActionBase currentAction = actionMgr.GetRunningAction();
8708 if (currentAction)
8710 }
8711 }
8712
8713 Man ownerPlayerOld = null;
8714 Man ownerPlayerNew = null;
8715
8716 if (old_owner)
8717 {
8718 if (old_owner.
IsMan())
8719 {
8720 ownerPlayerOld = Man.Cast(old_owner);
8721 }
8722 else
8723 {
8724 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8725 }
8726 }
8727 else
8728 {
8730 {
8732
8733 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8734 {
8735 GetCompEM().UnplugThis();
8736 }
8737 }
8738 }
8739
8740 if (new_owner)
8741 {
8742 if (new_owner.
IsMan())
8743 {
8744 ownerPlayerNew = Man.Cast(new_owner);
8745 }
8746 else
8747 {
8748 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8749 }
8750 }
8751
8752 if (ownerPlayerOld != ownerPlayerNew)
8753 {
8754 if (ownerPlayerOld)
8755 {
8756 array<EntityAI> subItemsExit = new array<EntityAI>;
8758 for (int i = 0; i < subItemsExit.Count(); i++)
8759 {
8762 }
8763 }
8764
8765 if (ownerPlayerNew)
8766 {
8767 array<EntityAI> subItemsEnter = new array<EntityAI>;
8769 for (int j = 0; j < subItemsEnter.Count(); j++)
8770 {
8773 }
8774 }
8775 }
8776 else if (ownerPlayerNew != null)
8777 {
8778 PlayerBase nplayer;
8779 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8780 {
8781 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8783 for (int k = 0; k < subItemsUpdate.Count(); k++)
8784 {
8786 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8787 }
8788 }
8789 }
8790
8791 if (old_owner)
8792 old_owner.OnChildItemRemoved(this);
8793 if (new_owner)
8794 new_owner.OnChildItemReceived(this);
8795 }
8796
8797
8799 {
8800 super.EEDelete(parent);
8801 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8802 if (player)
8803 {
8805
8806 if (player.IsAlive())
8807 {
8808 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8809 if (r_index >= 0)
8810 {
8811 InventoryLocation r_il = new InventoryLocation;
8812 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8813
8814 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8817 {
8818 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8819 }
8821 {
8822 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8823 }
8824
8825 }
8826
8827 player.RemoveQuickBarEntityShortcut(this);
8828 }
8829 }
8830 }
8831
8833 {
8834 super.EEKilled(killer);
8835
8838 {
8839 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8840 {
8841 if (IsMagazine())
8842 {
8843 if (Magazine.Cast(this).GetAmmoCount() > 0)
8844 {
8846 }
8847 }
8848 else
8849 {
8851 }
8852 }
8853 }
8854 }
8855
8857 {
8858 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8859
8860 super.OnWasAttached(parent, slot_id);
8861
8864
8866 }
8867
8869 {
8870 super.OnWasDetached(parent, slot_id);
8871
8874 }
8875
8877 {
8878 int idx;
8881
8882 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8883 if (inventory_slots.Count() < 1)
8884 {
8885 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8886 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8887 }
8888 else
8889 {
8890 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8891 }
8892
8893 idx = inventory_slots.Find(slot);
8894 if (idx < 0)
8895 return "";
8896
8897 return attach_types.Get(idx);
8898 }
8899
8901 {
8902 int idx = -1;
8903 string slot;
8904
8907
8908 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8909 if (inventory_slots.Count() < 1)
8910 {
8911 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8912 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8913 }
8914 else
8915 {
8916 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8917 if (detach_types.Count() < 1)
8918 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8919 }
8920
8921 for (int i = 0; i < inventory_slots.Count(); i++)
8922 {
8923 slot = inventory_slots.Get(i);
8924 }
8925
8926 if (slot != "")
8927 {
8928 if (detach_types.Count() == 1)
8929 idx = 0;
8930 else
8931 idx = inventory_slots.Find(slot);
8932 }
8933 if (idx < 0)
8934 return "";
8935
8936 return detach_types.Get(idx);
8937 }
8938
8940 {
8941
8943
8944
8945 float min_time = 1;
8946 float max_time = 3;
8947 float delay = Math.RandomFloat(min_time, max_time);
8948
8949 explode_timer.Run(delay, this, "DoAmmoExplosion");
8950 }
8951
8953 {
8954 Magazine magazine = Magazine.Cast(this);
8955 int pop_sounds_count = 6;
8956 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8957
8958
8959 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8960 string sound_name = pop_sounds[ sound_idx ];
8962
8963
8964 magazine.ServerAddAmmoCount(-1);
8965
8966
8967 float min_temp_to_explode = 100;
8968
8969 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8970 {
8972 }
8973 }
8974
8975
8976 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8977 {
8978 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8979
8980 const int CHANCE_DAMAGE_CARGO = 4;
8981 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8982 const int CHANCE_DAMAGE_NOTHING = 2;
8983
8985 {
8986 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8987 int chances;
8988 int rnd;
8989
8990 if (GetInventory().GetCargo())
8991 {
8992 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8993 rnd = Math.RandomInt(0,chances);
8994
8995 if (rnd < CHANCE_DAMAGE_CARGO)
8996 {
8998 }
8999 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9000 {
9002 }
9003 }
9004 else
9005 {
9006 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9007 rnd = Math.RandomInt(0,chances);
9008
9009 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9010 {
9012 }
9013 }
9014 }
9015 }
9016
9018 {
9019 if (GetInventory().GetCargo())
9020 {
9021 int item_count = GetInventory().GetCargo().GetItemCount();
9022 if (item_count > 0)
9023 {
9024 int random_pick = Math.RandomInt(0, item_count);
9026 if (!item.IsExplosive())
9027 {
9028 item.AddHealth("","",damage);
9029 return true;
9030 }
9031 }
9032 }
9033 return false;
9034 }
9035
9037 {
9038 int attachment_count = GetInventory().AttachmentCount();
9039 if (attachment_count > 0)
9040 {
9041 int random_pick = Math.RandomInt(0, attachment_count);
9042 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9043 if (!attachment.IsExplosive())
9044 {
9045 attachment.AddHealth("","",damage);
9046 return true;
9047 }
9048 }
9049 return false;
9050 }
9051
9053 {
9055 }
9056
9058 {
9060 return GetInventory().CanRemoveEntity();
9061
9062 return false;
9063 }
9064
9066 {
9067
9069 return false;
9070
9071
9073 return false;
9074
9075
9076
9078 if (delta == 0)
9079 return false;
9080
9081
9082 return true;
9083 }
9084
9086 {
9088 {
9089 if (ScriptInputUserData.CanStoreInputUserData())
9090 {
9091 ScriptInputUserData ctx = new ScriptInputUserData;
9096 ctx.
Write(destination_entity);
9100 }
9101 }
9102 else if (!
GetGame().IsMultiplayer())
9103 {
9105 }
9106 }
9107
9109 {
9110 float split_quantity_new;
9114 InventoryLocation loc = new InventoryLocation;
9115
9116 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9117 {
9119 split_quantity_new = stack_max;
9120 else
9122
9124 {
9125 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9126 if (new_item)
9127 {
9128 new_item.SetResultOfSplit(true);
9129 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9131 new_item.
SetQuantity(split_quantity_new,
false,
true);
9132 }
9133 }
9134 }
9135 else if (destination_entity && slot_id == -1)
9136 {
9137 if (quantity > stack_max)
9138 split_quantity_new = stack_max;
9139 else
9140 split_quantity_new = quantity;
9141
9143 {
9145 {
9148 }
9149
9150 if (new_item)
9151 {
9152 new_item.SetResultOfSplit(true);
9153 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9155 new_item.
SetQuantity(split_quantity_new,
false,
true);
9156 }
9157 }
9158 }
9159 else
9160 {
9161 if (stack_max != 0)
9162 {
9164 {
9166 }
9167
9168 if (split_quantity_new == 0)
9169 {
9170 if (!
GetGame().IsMultiplayer())
9171 player.PhysicalPredictiveDropItem(this);
9172 else
9173 player.ServerDropEntity(this);
9174 return;
9175 }
9176
9178 {
9180
9181 if (new_item)
9182 {
9183 new_item.SetResultOfSplit(true);
9184 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9187 new_item.PlaceOnSurface();
9188 }
9189 }
9190 }
9191 }
9192 }
9193
9195 {
9196 float split_quantity_new;
9200 InventoryLocation loc = new InventoryLocation;
9201
9202 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9203 {
9205 split_quantity_new = stack_max;
9206 else
9208
9210 {
9211 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9212 if (new_item)
9213 {
9214 new_item.SetResultOfSplit(true);
9215 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9217 new_item.
SetQuantity(split_quantity_new,
false,
true);
9218 }
9219 }
9220 }
9221 else if (destination_entity && slot_id == -1)
9222 {
9223 if (quantity > stack_max)
9224 split_quantity_new = stack_max;
9225 else
9226 split_quantity_new = quantity;
9227
9229 {
9231 {
9234 }
9235
9236 if (new_item)
9237 {
9238 new_item.SetResultOfSplit(true);
9239 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9241 new_item.
SetQuantity(split_quantity_new,
false,
true);
9242 }
9243 }
9244 }
9245 else
9246 {
9247 if (stack_max != 0)
9248 {
9250 {
9252 }
9253
9255 {
9257
9258 if (new_item)
9259 {
9260 new_item.SetResultOfSplit(true);
9261 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9264 new_item.PlaceOnSurface();
9265 }
9266 }
9267 }
9268 }
9269 }
9270
9272 {
9274 {
9275 if (ScriptInputUserData.CanStoreInputUserData())
9276 {
9277 ScriptInputUserData ctx = new ScriptInputUserData;
9282 dst.WriteToContext(ctx);
9284 }
9285 }
9286 else if (!
GetGame().IsMultiplayer())
9287 {
9289 }
9290 }
9291
9293 {
9295 {
9296 if (ScriptInputUserData.CanStoreInputUserData())
9297 {
9298 ScriptInputUserData ctx = new ScriptInputUserData;
9303 ctx.
Write(destination_entity);
9309 }
9310 }
9311 else if (!
GetGame().IsMultiplayer())
9312 {
9314 }
9315 }
9316
9318 {
9320 }
9321
9323 {
9325 float split_quantity_new;
9327 if (dst.IsValid())
9328 {
9329 int slot_id = dst.GetSlot();
9331
9332 if (quantity > stack_max)
9333 split_quantity_new = stack_max;
9334 else
9335 split_quantity_new = quantity;
9336
9338 {
9340
9341 if (new_item)
9342 {
9343 new_item.SetResultOfSplit(true);
9344 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9346 new_item.
SetQuantity(split_quantity_new,
false,
true);
9347 }
9348
9349 return new_item;
9350 }
9351 }
9352
9353 return null;
9354 }
9355
9357 {
9359 float split_quantity_new;
9361 if (destination_entity)
9362 {
9364 if (quantity > stackable)
9365 split_quantity_new = stackable;
9366 else
9367 split_quantity_new = quantity;
9368
9370 {
9371 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9372 if (new_item)
9373 {
9374 new_item.SetResultOfSplit(true);
9375 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9377 new_item.
SetQuantity(split_quantity_new,
false,
true);
9378 }
9379 }
9380 }
9381 }
9382
9384 {
9386 {
9387 if (ScriptInputUserData.CanStoreInputUserData())
9388 {
9389 ScriptInputUserData ctx = new ScriptInputUserData;
9394 ItemBase destination_entity =
this;
9395 ctx.
Write(destination_entity);
9399 }
9400 }
9401 else if (!
GetGame().IsMultiplayer())
9402 {
9404 }
9405 }
9406
9408 {
9410 float split_quantity_new;
9412 if (player)
9413 {
9415 if (quantity > stackable)
9416 split_quantity_new = stackable;
9417 else
9418 split_quantity_new = quantity;
9419
9421 {
9422 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9423 new_item =
ItemBase.Cast(in_hands);
9424 if (new_item)
9425 {
9426 new_item.SetResultOfSplit(true);
9427 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9429 new_item.SetQuantity(split_quantity_new, false, true);
9430 }
9431 }
9432 }
9433 }
9434
9436 {
9438 float split_quantity_new = Math.Floor(quantity * 0.5);
9439
9441 return;
9442
9444
9445 if (new_item)
9446 {
9447 if (new_item.GetQuantityMax() < split_quantity_new)
9448 {
9449 split_quantity_new = new_item.GetQuantityMax();
9450 }
9451
9452 new_item.SetResultOfSplit(true);
9453 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9454
9456 {
9459 }
9460 else
9461 {
9463 new_item.
SetQuantity(split_quantity_new,
false,
true);
9464 }
9465 }
9466 }
9467
9469 {
9471 float split_quantity_new = Math.Floor(quantity / 2);
9472
9474 return;
9475
9476 InventoryLocation invloc = new InventoryLocation;
9478
9480 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9481
9482 if (new_item)
9483 {
9484 if (new_item.GetQuantityMax() < split_quantity_new)
9485 {
9486 split_quantity_new = new_item.GetQuantityMax();
9487 }
9489 {
9492 }
9493 else if (split_quantity_new > 1)
9494 {
9496 new_item.
SetQuantity(split_quantity_new,
false,
true);
9497 }
9498 }
9499 }
9500
9503 {
9504 SetWeightDirty();
9506
9507 if (parent)
9508 parent.OnAttachmentQuantityChangedEx(this, delta);
9509
9511 {
9513 {
9515 }
9517 {
9518 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9520 }
9521 }
9522
9523 }
9524
9527 {
9528
9529 }
9530
9533 {
9535 }
9536
9538 {
9539 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9540
9542 {
9543 if (newLevel == GameConstants.STATE_RUINED)
9544 {
9546 EntityAI parent = GetHierarchyParent();
9547 if (parent && parent.IsFireplace())
9548 {
9549 CargoBase cargo = GetInventory().GetCargo();
9550 if (cargo)
9551 {
9553 {
9555 }
9556 }
9557 }
9558 }
9559
9561 {
9562
9564 return;
9565 }
9566
9567 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9568 {
9570 }
9571 }
9572 }
9573
9574
9576 {
9577 super.OnRightClick();
9578
9580 {
9582 {
9583 if (ScriptInputUserData.CanStoreInputUserData())
9584 {
9585 EntityAI root = GetHierarchyRoot();
9586 Man playerOwner = GetHierarchyRootPlayer();
9587 InventoryLocation dst = new InventoryLocation;
9588
9589
9590 if (!playerOwner && root && root == this)
9591 {
9593 }
9594 else
9595 {
9596
9597 GetInventory().GetCurrentInventoryLocation(dst);
9599 {
9602 {
9604 }
9605 else
9606 {
9608
9609
9610 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9611 {
9613 }
9614 else
9615 {
9616 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9617 }
9618 }
9619 }
9620 }
9621
9622 ScriptInputUserData ctx = new ScriptInputUserData;
9630 }
9631 }
9632 else if (!
GetGame().IsMultiplayer())
9633 {
9635 }
9636 }
9637 }
9638
9640 {
9641 if (root)
9642 {
9643 vector m4[4];
9644 root.GetTransform(m4);
9645 dst.SetGround(this, m4);
9646 }
9647 else
9648 {
9649 GetInventory().GetCurrentInventoryLocation(dst);
9650 }
9651 }
9652
9653 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9654 {
9655
9656 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9657 return false;
9658
9659 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9660 return false;
9661
9662
9664 return false;
9665
9666
9667 Magazine mag = Magazine.Cast(this);
9668 if (mag)
9669 {
9670 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9671 return false;
9672
9673 if (stack_max_limit)
9674 {
9675 Magazine other_mag = Magazine.Cast(other_item);
9676 if (other_item)
9677 {
9678 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9679 return false;
9680 }
9681
9682 }
9683 }
9684 else
9685 {
9686
9688 return false;
9689
9691 return false;
9692 }
9693
9694 PlayerBase player = null;
9695 if (CastTo(player, GetHierarchyRootPlayer()))
9696 {
9697 if (player.GetInventory().HasAttachment(this))
9698 return false;
9699
9700 if (player.IsItemsToDelete())
9701 return false;
9702 }
9703
9704 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9705 return false;
9706
9707 int slotID;
9709 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9710 return false;
9711
9712 return true;
9713 }
9714
9716 {
9718 }
9719
9721 {
9722 return m_IsResultOfSplit;
9723 }
9724
9726 {
9727 m_IsResultOfSplit = value;
9728 }
9729
9731 {
9733 }
9734
9736 {
9737 float other_item_quantity = other_item.GetQuantity();
9738 float this_free_space;
9739
9741
9743
9744 if (other_item_quantity > this_free_space)
9745 {
9746 return this_free_space;
9747 }
9748 else
9749 {
9750 return other_item_quantity;
9751 }
9752 }
9753
9755 {
9757 }
9758
9760 {
9762 return;
9763
9764 if (!IsMagazine() && other_item)
9765 {
9767 if (quantity_used != 0)
9768 {
9769 float hp1 = GetHealth01("","");
9770 float hp2 = other_item.GetHealth01("","");
9771 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9772 hpResult = hpResult / (
GetQuantity() + quantity_used);
9773
9774 hpResult *= GetMaxHealth();
9775 Math.Round(hpResult);
9776 SetHealth("", "Health", hpResult);
9777
9779 other_item.AddQuantity(-quantity_used);
9780 }
9781 }
9783 }
9784
9786 {
9787 #ifdef SERVER
9788 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9789 GetHierarchyParent().IncreaseLifetimeUp();
9790 #endif
9791 };
9792
9794 {
9795 PlayerBase p = PlayerBase.Cast(player);
9796
9797 array<int> recipesIds = p.m_Recipes;
9798 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9799 if (moduleRecipesManager)
9800 {
9801 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9802 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9803 }
9804
9805 for (int i = 0;i < recipesIds.Count(); i++)
9806 {
9807 int key = recipesIds.Get(i);
9808 string recipeName = moduleRecipesManager.GetRecipeName(key);
9810 }
9811 }
9812
9813
9814 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9815 {
9816 super.GetDebugActions(outputList);
9817
9818
9824
9825
9830
9835
9836
9840
9841
9843 {
9847 }
9848
9851
9852
9856
9858
9859 InventoryLocation loc = new InventoryLocation();
9860 GetInventory().GetCurrentInventoryLocation(loc);
9862 {
9863 if (Gizmo_IsSupported())
9866 }
9867
9869 }
9870
9871
9872
9873
9875 {
9876 super.OnAction(action_id, player, ctx);
9877
9879 {
9880 switch (action_id)
9881 {
9884 return true;
9887 return true;
9888 }
9889 }
9890
9892 {
9893 switch (action_id)
9894 {
9896 Delete();
9897 return true;
9898 }
9899 }
9900
9901 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9902 {
9903 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9904 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9905 PlayerBase p = PlayerBase.Cast(player);
9906 if (
EActions.RECIPES_RANGE_START < 1000)
9907 {
9908 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9909 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9910 }
9911 }
9912 #ifndef SERVER
9913 else if (action_id ==
EActions.WATCH_PLAYER)
9914 {
9915 PluginDeveloper.SetDeveloperItemClientEx(player);
9916 }
9917 #endif
9919 {
9920 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9921 {
9922 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9923 OnDebugButtonPressServer(id + 1);
9924 }
9925
9926 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9927 {
9928 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9930 }
9931
9932 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9933 {
9934 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9936 }
9937
9938 else if (action_id ==
EActions.ADD_QUANTITY)
9939 {
9940 if (IsMagazine())
9941 {
9942 Magazine mag = Magazine.Cast(this);
9943 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9944 }
9945 else
9946 {
9948 }
9949
9950 if (m_EM)
9951 {
9952 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9953 }
9954
9955 }
9956
9957 else if (action_id ==
EActions.REMOVE_QUANTITY)
9958 {
9959 if (IsMagazine())
9960 {
9961 Magazine mag2 = Magazine.Cast(this);
9962 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9963 }
9964 else
9965 {
9967 }
9968 if (m_EM)
9969 {
9970 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9971 }
9972
9973 }
9974
9975 else if (action_id ==
EActions.SET_QUANTITY_0)
9976 {
9978
9979 if (m_EM)
9980 {
9981 m_EM.SetEnergy(0);
9982 }
9983 }
9984
9985 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9986 {
9988
9989 if (m_EM)
9990 {
9991 m_EM.SetEnergy(m_EM.GetEnergyMax());
9992 }
9993 }
9994
9995 else if (action_id ==
EActions.ADD_HEALTH)
9996 {
9997 AddHealth("","",GetMaxHealth("","Health")/5);
9998 }
9999 else if (action_id ==
EActions.REMOVE_HEALTH)
10000 {
10001 AddHealth("","",-GetMaxHealth("","Health")/5);
10002 }
10003 else if (action_id ==
EActions.DESTROY_HEALTH)
10004 {
10005 SetHealth01("","",0);
10006 }
10007 else if (action_id ==
EActions.WATCH_ITEM)
10008 {
10010 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10011 #ifdef DEVELOPER
10012 SetDebugDeveloper_item(this);
10013 #endif
10014 }
10015
10016 else if (action_id ==
EActions.ADD_TEMPERATURE)
10017 {
10018 AddTemperature(20);
10019
10020 }
10021
10022 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10023 {
10024 AddTemperature(-20);
10025
10026 }
10027
10028 else if (action_id ==
EActions.FLIP_FROZEN)
10029 {
10030 SetFrozen(!GetIsFrozen());
10031
10032 }
10033
10034 else if (action_id ==
EActions.ADD_WETNESS)
10035 {
10037
10038 }
10039
10040 else if (action_id ==
EActions.REMOVE_WETNESS)
10041 {
10043
10044 }
10045
10046 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10047 {
10050
10051
10052 }
10053
10054 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10055 {
10058 }
10059
10060 else if (action_id ==
EActions.MAKE_SPECIAL)
10061 {
10062 auto debugParams = DebugSpawnParams.WithPlayer(player);
10063 OnDebugSpawnEx(debugParams);
10064 }
10065
10066 }
10067
10068
10069 return false;
10070 }
10071
10072
10073
10074
10078
10081
10082
10083
10085 {
10086 return false;
10087 }
10088
10089
10091 {
10092 return true;
10093 }
10094
10095
10097 {
10098 return true;
10099 }
10100
10101
10102
10104 {
10105 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10107 }
10108
10111 {
10112 return null;
10113 }
10114
10116 {
10117 return false;
10118 }
10119
10121 {
10122 return false;
10123 }
10124
10128
10129
10131 {
10132 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10133 return module_repairing.CanRepair(this, item_repair_kit);
10134 }
10135
10136
10137 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10138 {
10139 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10140 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10141 }
10142
10143
10145 {
10146
10147
10148
10149
10150
10151
10152
10153
10154 return 1;
10155 }
10156
10157
10158
10160 {
10162 }
10163
10164
10165
10167 {
10169 }
10170
10171
10180 {
10181 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10182
10183 if (player)
10184 {
10185 player.MessageStatus(text);
10186 }
10187 }
10188
10189
10198 {
10199 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10200
10201 if (player)
10202 {
10203 player.MessageAction(text);
10204 }
10205 }
10206
10207
10216 {
10217 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10218
10219 if (player)
10220 {
10221 player.MessageFriendly(text);
10222 }
10223 }
10224
10225
10234 {
10235 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10236
10237 if (player)
10238 {
10239 player.MessageImportant(text);
10240 }
10241 }
10242
10244 {
10245 return true;
10246 }
10247
10248
10249 override bool KindOf(
string tag)
10250 {
10251 bool found = false;
10252 string item_name = this.
GetType();
10255
10256 int array_size = item_tag_array.Count();
10257 for (int i = 0; i < array_size; i++)
10258 {
10259 if (item_tag_array.Get(i) == tag)
10260 {
10261 found = true;
10262 break;
10263 }
10264 }
10265 return found;
10266 }
10267
10268
10270 {
10271
10272 super.OnRPC(sender, rpc_type,ctx);
10273
10274
10275 switch (rpc_type)
10276 {
10277 #ifndef SERVER
10278 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10279 Param2<bool, string> p = new Param2<bool, string>(false, "");
10280
10282 return;
10283
10284 bool play = p.param1;
10285 string soundSet = p.param2;
10286
10287 if (play)
10288 {
10290 {
10292 {
10294 }
10295 }
10296 else
10297 {
10299 }
10300 }
10301 else
10302 {
10304 }
10305
10306 break;
10307 #endif
10308
10309 }
10310
10312 {
10314 }
10315 }
10316
10317
10318
10319
10321 {
10322 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10323 return plugin.GetID(
name);
10324 }
10325
10327 {
10328 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10329 return plugin.GetName(id);
10330 }
10331
10334 {
10335
10336
10337 int varFlags;
10338 if (!ctx.
Read(varFlags))
10339 return;
10340
10341 if (varFlags & ItemVariableFlags.FLOAT)
10342 {
10344 }
10345 }
10346
10348 {
10349
10350 super.SerializeNumericalVars(floats_out);
10351
10352
10353
10355 {
10357 }
10358
10360 {
10362 }
10363
10365 {
10367 }
10368
10370 {
10375 }
10376
10378 {
10380 }
10381 }
10382
10384 {
10385
10386 super.DeSerializeNumericalVars(floats);
10387
10388
10389 int index = 0;
10390 int mask = Math.Round(floats.Get(index));
10391
10392 index++;
10393
10395 {
10397 {
10399 }
10400 else
10401 {
10402 float quantity = floats.Get(index);
10403 SetQuantity(quantity,
true,
false,
false,
false);
10404 }
10405 index++;
10406 }
10407
10409 {
10410 float wet = floats.Get(index);
10412 index++;
10413 }
10414
10416 {
10417 int liquidtype = Math.Round(floats.Get(index));
10419 index++;
10420 }
10421
10423 {
10425 index++;
10427 index++;
10429 index++;
10431 index++;
10432 }
10433
10435 {
10436 int cleanness = Math.Round(floats.Get(index));
10438 index++;
10439 }
10440 }
10441
10443 {
10444 super.WriteVarsToCTX(ctx);
10445
10446
10448 {
10450 }
10451
10453 {
10455 }
10456
10458 {
10460 }
10461
10463 {
10464 int r,g,b,a;
10470 }
10471
10473 {
10475 }
10476 }
10477
10479 {
10480 if (!super.ReadVarsFromCTX(ctx,version))
10481 return false;
10482
10483 int intValue;
10484 float value;
10485
10486 if (version < 140)
10487 {
10488 if (!ctx.
Read(intValue))
10489 return false;
10490
10491 m_VariablesMask = intValue;
10492 }
10493
10495 {
10496 if (!ctx.
Read(value))
10497 return false;
10498
10500 {
10502 }
10503 else
10504 {
10506 }
10507 }
10508
10509 if (version < 140)
10510 {
10512 {
10513 if (!ctx.
Read(value))
10514 return false;
10515 SetTemperatureDirect(value);
10516 }
10517 }
10518
10520 {
10521 if (!ctx.
Read(value))
10522 return false;
10524 }
10525
10527 {
10528 if (!ctx.
Read(intValue))
10529 return false;
10531 }
10532
10534 {
10535 int r,g,b,a;
10537 return false;
10539 return false;
10541 return false;
10543 return false;
10544
10546 }
10547
10549 {
10550 if (!ctx.
Read(intValue))
10551 return false;
10553 }
10554
10555 if (version >= 138 && version < 140)
10556 {
10558 {
10559 if (!ctx.
Read(intValue))
10560 return false;
10561 SetFrozen(intValue);
10562 }
10563 }
10564
10565 return true;
10566 }
10567
10568
10570 {
10573 {
10575 }
10576
10577 if (!super.OnStoreLoad(ctx, version))
10578 {
10580 return false;
10581 }
10582
10583 if (version >= 114)
10584 {
10585 bool hasQuickBarIndexSaved;
10586
10587 if (!ctx.
Read(hasQuickBarIndexSaved))
10588 {
10590 return false;
10591 }
10592
10593 if (hasQuickBarIndexSaved)
10594 {
10595 int itmQBIndex;
10596
10597
10598 if (!ctx.
Read(itmQBIndex))
10599 {
10601 return false;
10602 }
10603
10604 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10605 if (itmQBIndex != -1 && parentPlayer)
10606 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10607 }
10608 }
10609 else
10610 {
10611
10612 PlayerBase player;
10613 int itemQBIndex;
10614 if (version ==
int.
MAX)
10615 {
10616 if (!ctx.
Read(itemQBIndex))
10617 {
10619 return false;
10620 }
10621 }
10622 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10623 {
10624
10625 if (!ctx.
Read(itemQBIndex))
10626 {
10628 return false;
10629 }
10630 if (itemQBIndex != -1 && player)
10631 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10632 }
10633 }
10634
10635 if (version < 140)
10636 {
10637
10638 if (!LoadVariables(ctx, version))
10639 {
10641 return false;
10642 }
10643 }
10644
10645
10647 {
10649 return false;
10650 }
10651 if (version >= 132)
10652 {
10654 if (raib)
10655 {
10657 {
10659 return false;
10660 }
10661 }
10662 }
10663
10665 return true;
10666 }
10667
10668
10669
10671 {
10672 super.OnStoreSave(ctx);
10673
10674 PlayerBase player;
10675 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10676 {
10678
10679 int itemQBIndex = -1;
10680 itemQBIndex = player.FindQuickBarEntityIndex(this);
10681 ctx.
Write(itemQBIndex);
10682 }
10683 else
10684 {
10686 }
10687
10689
10691 if (raib)
10692 {
10694 }
10695 }
10696
10697
10699 {
10700 super.AfterStoreLoad();
10701
10703 {
10705 }
10706
10708 {
10711 }
10712 }
10713
10715 {
10716 super.EEOnAfterLoad();
10717
10719 {
10721 }
10722
10725 }
10726
10728 {
10729 return false;
10730 }
10731
10732
10733
10735 {
10737 {
10738 #ifdef PLATFORM_CONSOLE
10739
10741 {
10743 if (menu)
10744 {
10746 }
10747 }
10748 #endif
10749 }
10750
10752 {
10755 }
10756
10758 {
10759 SetWeightDirty();
10761 }
10763 {
10766 }
10767
10769 {
10772 }
10774 {
10777 }
10778
10779 super.OnVariablesSynchronized();
10780 }
10781
10782
10783
10785 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10786 {
10787 if (!IsServerCheck(allow_client))
10788 return false;
10789
10791 return false;
10792
10795
10796 if (value <= (min + 0.001))
10797 value = min;
10798
10799 if (value == min)
10800 {
10801 if (destroy_config)
10802 {
10803 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10804 if (dstr)
10805 {
10807 this.Delete();
10808 return true;
10809 }
10810 }
10811 else if (destroy_forced)
10812 {
10814 this.Delete();
10815 return true;
10816 }
10817
10819 }
10820
10823
10825 {
10827
10828 if (delta)
10830 }
10831
10833
10834 return false;
10835 }
10836
10837
10839 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10840 {
10842 }
10843
10845 {
10848 }
10849
10851 {
10854 }
10855
10857 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10858 {
10859 float value_clamped = Math.Clamp(value, 0, 1);
10861 SetQuantity(result, destroy_config, destroy_forced);
10862 }
10863
10864
10867 {
10869 }
10870
10872 {
10874 }
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10886 {
10887 int slot = -1;
10888 if (GetInventory())
10889 {
10890 InventoryLocation il = new InventoryLocation;
10891 GetInventory().GetCurrentInventoryLocation(il);
10893 }
10894
10896 }
10897
10899 {
10900 float quantity_max = 0;
10901
10903 {
10904 if (attSlotID != -1)
10905 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10906
10907 if (quantity_max <= 0)
10909 }
10910
10911 if (quantity_max <= 0)
10913
10914 return quantity_max;
10915 }
10916
10918 {
10920 }
10921
10923 {
10925 }
10926
10927
10929 {
10931 }
10932
10934 {
10936 }
10937
10939 {
10941 }
10942
10943
10945 {
10946
10947 float weightEx = GetWeightEx();
10948 float special = GetInventoryAndCargoWeight();
10949 return weightEx - special;
10950 }
10951
10952
10954 {
10956 }
10957
10959 {
10961 {
10962 #ifdef DEVELOPER
10963 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10964 {
10965 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10967 }
10968 #endif
10969
10970 return GetQuantity() * GetConfigWeightModified();
10971 }
10972 else if (HasEnergyManager())
10973 {
10974 #ifdef DEVELOPER
10975 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10976 {
10977 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10978 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10979 }
10980 #endif
10981 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10982 }
10983 else
10984 {
10985 #ifdef DEVELOPER
10986 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10987 {
10988 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10989 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10990 }
10991 #endif
10992 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10993 }
10994 }
10995
10998 {
10999 int item_count = 0;
11001
11002 if (GetInventory().GetCargo() != NULL)
11003 {
11004 item_count = GetInventory().GetCargo().GetItemCount();
11005 }
11006
11007 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11008 {
11009 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11010 if (item)
11011 item_count += item.GetNumberOfItems();
11012 }
11013 return item_count;
11014 }
11015
11018 {
11019 float weight = 0;
11020 float wetness = 1;
11021 if (include_wetness)
11024 {
11025 weight = wetness * m_ConfigWeight;
11026 }
11028 {
11029 weight = 1;
11030 }
11031 return weight;
11032 }
11033
11034
11035
11037 {
11038 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11039 {
11040 GameInventory inv = GetInventory();
11041 array<EntityAI> items = new array<EntityAI>;
11043 for (int i = 0; i < items.Count(); i++)
11044 {
11046 if (item)
11047 {
11049 }
11050 }
11051 }
11052 }
11053
11054
11055
11056
11058 {
11059 float energy = 0;
11060 if (HasEnergyManager())
11061 {
11062 energy = GetCompEM().GetEnergy();
11063 }
11064 return energy;
11065 }
11066
11067
11069 {
11070 super.OnEnergyConsumed();
11071
11073 }
11074
11076 {
11077 super.OnEnergyAdded();
11078
11080 }
11081
11082
11084 {
11085 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11086 {
11088 {
11089 float energy_0to1 = GetCompEM().GetEnergy0To1();
11091 }
11092 }
11093 }
11094
11095
11097 {
11098 return ConfigGetFloat("heatIsolation");
11099 }
11100
11102 {
11104 }
11105
11107 {
11108 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11109 if (
GetGame().ConfigIsExisting(paramPath))
11111
11112 return 0.0;
11113 }
11114
11116 {
11117 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11118 if (
GetGame().ConfigIsExisting(paramPath))
11120
11121 return 0.0;
11122 }
11123
11124 override void SetWet(
float value,
bool allow_client =
false)
11125 {
11126 if (!IsServerCheck(allow_client))
11127 return;
11128
11131
11133
11134 m_VarWet = Math.Clamp(value, min, max);
11135
11137 {
11140 }
11141 }
11142
11143 override void AddWet(
float value)
11144 {
11146 }
11147
11149 {
11151 }
11152
11154 {
11156 }
11157
11159 {
11161 }
11162
11164 {
11166 }
11167
11169 {
11171 }
11172
11173 override void OnWetChanged(
float newVal,
float oldVal)
11174 {
11177 if (newLevel != oldLevel)
11178 {
11180 }
11181 }
11182
11184 {
11185 SetWeightDirty();
11186 }
11187
11189 {
11190 return GetWetLevelInternal(
m_VarWet);
11191 }
11192
11193
11194
11196 {
11198 }
11199
11201 {
11203 }
11204
11206 {
11208 }
11209
11211 {
11213 }
11214
11215
11216
11218 {
11219 if (ConfigIsExisting("itemModelLength"))
11220 {
11221 return ConfigGetFloat("itemModelLength");
11222 }
11223 return 0;
11224 }
11225
11227 {
11228 if (ConfigIsExisting("itemAttachOffset"))
11229 {
11230 return ConfigGetFloat("itemAttachOffset");
11231 }
11232 return 0;
11233 }
11234
11235 override void SetCleanness(
int value,
bool allow_client =
false)
11236 {
11237 if (!IsServerCheck(allow_client))
11238 return;
11239
11241
11243
11246 }
11247
11249 {
11251 }
11252
11254 {
11255 return true;
11256 }
11257
11258
11259
11260
11262 {
11264 }
11265
11267 {
11269 }
11270
11271
11272
11273
11274 override void SetColor(
int r,
int g,
int b,
int a)
11275 {
11281 }
11283 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11284 {
11289 }
11290
11292 {
11294 }
11295
11298 {
11299 int r,g,b,a;
11301 r = r/255;
11302 g = g/255;
11303 b = b/255;
11304 a = a/255;
11305 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11306 }
11307
11308
11309
11310 override void SetLiquidType(
int value,
bool allow_client =
false)
11311 {
11312 if (!IsServerCheck(allow_client))
11313 return;
11314
11319 }
11320
11322 {
11323 return ConfigGetInt("varLiquidTypeInit");
11324 }
11325
11327 {
11329 }
11330
11332 {
11334 SetFrozen(false);
11335 }
11336
11339 {
11340 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11341 }
11342
11343
11346 {
11347 PlayerBase nplayer;
11348 if (PlayerBase.CastTo(nplayer, player))
11349 {
11351
11352 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11353 }
11354 }
11355
11356
11359 {
11360 PlayerBase nplayer;
11361 if (PlayerBase.CastTo(nplayer,player))
11362 {
11363
11364 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11365
11366 }
11367
11368
11369 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11370
11371
11372 if (HasEnergyManager())
11373 {
11374 GetCompEM().UpdatePlugState();
11375 }
11376 }
11377
11378
11380 {
11381 super.OnPlacementStarted(player);
11382
11384 }
11385
11386 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11387 {
11389 {
11390 m_AdminLog.OnPlacementComplete(player,
this);
11391 }
11392
11393 super.OnPlacementComplete(player, position, orientation);
11394 }
11395
11396
11397
11398
11399
11401 {
11403 {
11404 return true;
11405 }
11406 else
11407 {
11408 return false;
11409 }
11410 }
11411
11412
11414 {
11416 {
11418 }
11419 }
11420
11421
11423 {
11425 }
11426
11428 {
11430 }
11431
11432 override void InsertAgent(
int agent,
float count = 1)
11433 {
11434 if (count < 1)
11435 return;
11436
11438 }
11439
11442 {
11444 }
11445
11446
11448 {
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
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11494 {
11496 return false;
11497 return true;
11498 }
11499
11501 {
11502
11504 }
11505
11506
11509 {
11510 super.CheckForRoofLimited(timeTresholdMS);
11511
11513 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11514 {
11515 m_PreviousRoofTestTime = time;
11516 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11517 }
11518 }
11519
11520
11522 {
11524 {
11525 return 0;
11526 }
11527
11528 if (GetInventory().GetAttachmentSlotsCount() != 0)
11529 {
11530 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11531 if (filter)
11532 return filter.GetProtectionLevel(type, false, system);
11533 else
11534 return 0;
11535 }
11536
11537 string subclassPath, entryName;
11538
11539 switch (type)
11540 {
11542 entryName = "biological";
11543 break;
11545 entryName = "chemical";
11546 break;
11547 default:
11548 entryName = "biological";
11549 break;
11550 }
11551
11552 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11553
11555 }
11556
11557
11558
11561 {
11562 if (!IsMagazine())
11564
11566 }
11567
11568
11569
11570
11571
11576 {
11577 return true;
11578 }
11579
11581 {
11583 }
11584
11585
11586
11587
11588
11590 {
11591 if (parent)
11592 {
11593 if (parent.IsInherited(DayZInfected))
11594 return true;
11595
11596 if (!parent.IsRuined())
11597 return true;
11598 }
11599
11600 return true;
11601 }
11602
11604 {
11605 if (!super.CanPutAsAttachment(parent))
11606 {
11607 return false;
11608 }
11609
11610 if (!IsRuined() && !parent.IsRuined())
11611 {
11612 return true;
11613 }
11614
11615 return false;
11616 }
11617
11619 {
11620
11621
11622
11623
11624 return super.CanReceiveItemIntoCargo(item);
11625 }
11626
11628 {
11629
11630
11631
11632
11633 GameInventory attachmentInv = attachment.GetInventory();
11635 {
11636 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11637 return false;
11638 }
11639
11640 InventoryLocation loc = new InventoryLocation();
11641 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11642 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11643 return false;
11644
11645 return super.CanReceiveAttachment(attachment, slotId);
11646 }
11647
11649 {
11650 if (!super.CanReleaseAttachment(attachment))
11651 return false;
11652
11653 return GetInventory().AreChildrenAccessible();
11654 }
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11677 {
11678 int id = muzzle_owner.GetMuzzleID();
11679 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11680
11681 if (WPOF_array)
11682 {
11683 for (int i = 0; i < WPOF_array.Count(); i++)
11684 {
11685 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11686
11687 if (WPOF)
11688 {
11689 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11690 }
11691 }
11692 }
11693 }
11694
11695
11697 {
11698 int id = muzzle_owner.GetMuzzleID();
11700
11701 if (WPOBE_array)
11702 {
11703 for (int i = 0; i < WPOBE_array.Count(); i++)
11704 {
11705 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11706
11707 if (WPOBE)
11708 {
11709 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11710 }
11711 }
11712 }
11713 }
11714
11715
11717 {
11718 int id = muzzle_owner.GetMuzzleID();
11719 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11720
11721 if (WPOOH_array)
11722 {
11723 for (int i = 0; i < WPOOH_array.Count(); i++)
11724 {
11725 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11726
11727 if (WPOOH)
11728 {
11729 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11730 }
11731 }
11732 }
11733 }
11734
11735
11737 {
11738 int id = muzzle_owner.GetMuzzleID();
11739 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11740
11741 if (WPOOH_array)
11742 {
11743 for (int i = 0; i < WPOOH_array.Count(); i++)
11744 {
11745 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11746
11747 if (WPOOH)
11748 {
11749 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11750 }
11751 }
11752 }
11753 }
11754
11755
11757 {
11758 int id = muzzle_owner.GetMuzzleID();
11759 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11760
11761 if (WPOOH_array)
11762 {
11763 for (int i = 0; i < WPOOH_array.Count(); i++)
11764 {
11765 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11766
11767 if (WPOOH)
11768 {
11769 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11770 }
11771 }
11772 }
11773 }
11774
11775
11776
11778 {
11780 {
11781 return true;
11782 }
11783
11784 return false;
11785 }
11786
11788 {
11790 {
11791 return true;
11792 }
11793
11794 return false;
11795 }
11796
11798 {
11800 {
11801 return true;
11802 }
11803
11804 return false;
11805 }
11806
11808 {
11809 return false;
11810 }
11811
11814 {
11815 return UATimeSpent.DEFAULT_DEPLOY;
11816 }
11817
11818
11819
11820
11822 {
11824 SetSynchDirty();
11825 }
11826
11828 {
11830 }
11831
11832
11834 {
11835 return false;
11836 }
11837
11840 {
11841 string att_type = "None";
11842
11843 if (ConfigIsExisting("soundAttType"))
11844 {
11845 att_type = ConfigGetString("soundAttType");
11846 }
11847
11849 }
11850
11852 {
11854 }
11855
11856
11857
11858
11859
11865
11867 {
11870
11872 }
11873
11874
11876 {
11878 return;
11879
11881
11884
11887
11888 SoundParameters params = new SoundParameters();
11892 }
11893
11894
11896 {
11898 return;
11899
11901 SetSynchDirty();
11902
11905 }
11906
11907
11909 {
11911 return;
11912
11914 SetSynchDirty();
11915
11918 }
11919
11921 {
11923 }
11924
11926 {
11928 }
11929
11932 {
11933 if (!
GetGame().IsDedicatedServer())
11934 {
11935 if (ConfigIsExisting("attachSoundSet"))
11936 {
11937 string cfg_path = "";
11938 string soundset = "";
11939 string type_name =
GetType();
11940
11943 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11944 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11945
11946 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11947 {
11948 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11949 {
11950 if (cfg_slot_array[i] == slot_type)
11951 {
11952 soundset = cfg_soundset_array[i];
11953 break;
11954 }
11955 }
11956 }
11957
11958 if (soundset != "")
11959 {
11960 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11962 }
11963 }
11964 }
11965 }
11966
11968 {
11969
11970 }
11971
11972 void OnApply(PlayerBase player);
11973
11975 {
11976 return 1.0;
11977 };
11978
11980 {
11982 }
11983
11985 {
11987 }
11988
11990
11992 {
11993 SetDynamicPhysicsLifeTime(0.01);
11995 }
11996
11998 {
11999 array<string> zone_names = new array<string>;
12000 GetDamageZones(zone_names);
12001 for (int i = 0; i < zone_names.Count(); i++)
12002 {
12003 SetHealthMax(zone_names.Get(i),"Health");
12004 }
12005 SetHealthMax("","Health");
12006 }
12007
12010 {
12011 float global_health = GetHealth01("","Health");
12012 array<string> zones = new array<string>;
12013 GetDamageZones(zones);
12014
12015 for (int i = 0; i < zones.Count(); i++)
12016 {
12017 SetHealth01(zones.Get(i),"Health",global_health);
12018 }
12019 }
12020
12023 {
12024 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12025 }
12026
12028 {
12029 if (!hasRootAsPlayer)
12030 {
12031 if (refParentIB)
12032 {
12033
12034 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12035 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12036
12037 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12038 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12039
12042 }
12043 else
12044 {
12045
12048 }
12049 }
12050 }
12051
12053 {
12055 {
12056 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12057 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12058 {
12059 float heatPermCoef = 1.0;
12061 while (ent)
12062 {
12063 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12064 ent = ent.GetHierarchyParent();
12065 }
12066
12067 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12068 }
12069 }
12070 }
12071
12073 {
12074
12075 EntityAI parent = GetHierarchyParent();
12076 if (!parent)
12077 {
12078 hasParent = false;
12079 hasRootAsPlayer = false;
12080 }
12081 else
12082 {
12083 hasParent = true;
12084 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12085 refParentIB =
ItemBase.Cast(parent);
12086 }
12087 }
12088
12089 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12090 {
12091
12092 }
12093
12095 {
12096
12097 return false;
12098 }
12099
12101 {
12102
12103
12104 return false;
12105 }
12106
12108 {
12109
12110 return false;
12111 }
12112
12115 {
12116 return !GetIsFrozen() &&
IsOpen();
12117 }
12118
12120 {
12121 bool hasParent = false, hasRootAsPlayer = false;
12123
12124 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12125 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12126
12127 if (wwtu || foodDecay)
12128 {
12132
12133 if (processWetness || processTemperature || processDecay)
12134 {
12136
12137 if (processWetness)
12138 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12139
12140 if (processTemperature)
12142
12143 if (processDecay)
12144 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12145 }
12146 }
12147 }
12148
12151 {
12153 }
12154
12156 {
12159
12160 return super.GetTemperatureFreezeThreshold();
12161 }
12162
12164 {
12167
12168 return super.GetTemperatureThawThreshold();
12169 }
12170
12172 {
12175
12176 return super.GetItemOverheatThreshold();
12177 }
12178
12180 {
12182 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12183
12184 return super.GetTemperatureFreezeTime();
12185 }
12186
12188 {
12190 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12191
12192 return super.GetTemperatureThawTime();
12193 }
12194
12199
12201 {
12202 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12203 }
12204
12206 {
12207 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12208 }
12209
12212 {
12214 }
12215
12217 {
12219 }
12220
12222 {
12224 }
12225
12228 {
12229 return null;
12230 }
12231
12234 {
12235 return false;
12236 }
12237
12239 {
12241 {
12244 if (!trg)
12245 {
12247 explosive = this;
12248 }
12249
12250 explosive.PairRemote(trg);
12252
12253 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12254 trg.SetPersistentPairID(persistentID);
12255 explosive.SetPersistentPairID(persistentID);
12256
12257 return true;
12258 }
12259 return false;
12260 }
12261
12264 {
12265 float ret = 1.0;
12268 ret *= GetHealth01();
12269
12270 return ret;
12271 }
12272
12273 #ifdef DEVELOPER
12274 override void SetDebugItem()
12275 {
12276 super.SetDebugItem();
12277 _itemBase = this;
12278 }
12279
12281 {
12282 string text = super.GetDebugText();
12283
12285 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12286
12287 return text;
12288 }
12289 #endif
12290
12292 {
12293 return true;
12294 }
12295
12297
12299
12301 {
12304 }
12305
12306
12314
12330}
12331
12333{
12335 if (entity)
12336 {
12337 bool is_item = entity.IsInherited(
ItemBase);
12338 if (is_item && full_quantity)
12339 {
12342 }
12343 }
12344 else
12345 {
12347 return NULL;
12348 }
12349 return entity;
12350}
12351
12353{
12354 if (item)
12355 {
12356 if (health > 0)
12357 item.SetHealth("", "", health);
12358
12359 if (item.CanHaveTemperature())
12360 {
12362 if (item.CanFreeze())
12363 item.SetFrozen(false);
12364 }
12365
12366 if (item.HasEnergyManager())
12367 {
12368 if (quantity >= 0)
12369 {
12370 item.GetCompEM().SetEnergy0To1(quantity);
12371 }
12372 else
12373 {
12375 }
12376 }
12377 else if (item.IsMagazine())
12378 {
12379 Magazine mag = Magazine.Cast(item);
12380 if (quantity >= 0)
12381 {
12382 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12383 }
12384 else
12385 {
12387 }
12388
12389 }
12390 else
12391 {
12392 if (quantity >= 0)
12393 {
12394 item.SetQuantityNormalized(quantity, false);
12395 }
12396 else
12397 {
12399 }
12400
12401 }
12402 }
12403}
12404
12405#ifdef DEVELOPER
12407#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.