7504{
7506 {
7507 return true;
7508 }
7509};
7510
7511
7512
7514{
7518
7520
7523
7524
7525
7526
7527
7536
7542
7547
7552
7573 protected bool m_IsResultOfSplit
7574
7576
7581
7582
7583
7585
7589
7590
7591
7593
7596
7597
7598
7604
7605
7613
7616
7617
7619
7620
7622
7623
7628
7629
7634
7635
7637
7638
7640 {
7645
7646 if (!
GetGame().IsDedicatedServer())
7647 {
7649 {
7651
7653 {
7655 }
7656 }
7657
7660 }
7661
7662 m_OldLocation = null;
7663
7665 {
7667 }
7668
7669 if (ConfigIsExisting("headSelectionsToHide"))
7670 {
7673 }
7674
7676 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7677 {
7679 }
7680
7682
7683 m_IsResultOfSplit = false;
7684
7686 }
7687
7689 {
7690 super.InitItemVariables();
7691
7697 m_Count = ConfigGetInt(
"count");
7698
7701
7706
7709
7714
7726
7730
7731
7734 if (ConfigIsExisting("canBeSplit"))
7735 {
7738 }
7739
7741 if (ConfigIsExisting("itemBehaviour"))
7743
7744
7747 RegisterNetSyncVariableInt("m_VarLiquidType");
7748 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7749
7750 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7751 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7752 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7753
7754 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7755 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7756 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7757 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7758
7759 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7760 RegisterNetSyncVariableBool("m_IsTakeable");
7761 RegisterNetSyncVariableBool("m_IsHologram");
7762
7765 {
7768 }
7769
7771
7773 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7775
7776 }
7777
7779 {
7781 }
7782
7784 {
7787 {
7792 }
7793 }
7794
7795 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7796 {
7798 {
7801 }
7802
7804 }
7805
7807 {
7813 }
7814
7816
7818 {
7820
7821 if (!action)
7822 {
7823 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7824 return;
7825 }
7826
7828 if (!ai)
7829 {
7831 return;
7832 }
7833
7835 if (!action_array)
7836 {
7837 action_array = new array<ActionBase_Basic>;
7839 }
7840 if (LogManager.IsActionLogEnable())
7841 {
7842 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7843 }
7844
7845 if (action_array.Find(action) != -1)
7846 {
7847 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7848 }
7849 else
7850 {
7851 action_array.Insert(action);
7852 }
7853 }
7854
7856 {
7858 ActionBase action = player.GetActionManager().GetAction(actionName);
7861
7862 if (action_array)
7863 {
7864 action_array.RemoveItem(action);
7865 }
7866 }
7867
7868
7869
7871 {
7872 ActionOverrideData overrideData = new ActionOverrideData();
7876
7878 if (!actionMap)
7879 {
7882 }
7883
7884 actionMap.Insert(this.
Type(), overrideData);
7885
7886 }
7887
7889
7891
7892
7894 {
7897
7900
7901 string config_to_search = "CfgVehicles";
7902 string muzzle_owner_config;
7903
7905 {
7906 if (IsInherited(Weapon))
7907 config_to_search = "CfgWeapons";
7908
7909 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7910
7911 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7912
7914
7915 if (config_OnFire_subclass_count > 0)
7916 {
7917 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7918
7919 for (int i = 0; i < config_OnFire_subclass_count; i++)
7920 {
7921 string particle_class = "";
7923 string config_OnFire_entry = config_OnFire_class + particle_class;
7924 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7925 WPOF_array.Insert(WPOF);
7926 }
7927
7928
7930 }
7931 }
7932
7934 {
7935 config_to_search = "CfgWeapons";
7936 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7937
7938 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7939
7941
7942 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7943 {
7944 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7945
7946 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7947 {
7948 string particle_class2 = "";
7950 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7951 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7952 WPOBE_array.Insert(WPOBE);
7953 }
7954
7955
7957 }
7958 }
7959 }
7960
7961
7963 {
7966
7968 {
7969 string config_to_search = "CfgVehicles";
7970
7971 if (IsInherited(Weapon))
7972 config_to_search = "CfgWeapons";
7973
7974 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7975 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7976
7977 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7978 {
7979
7981
7983 {
7985 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7987 return;
7988 }
7989
7992
7993
7994
7996 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7997
7998 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7999 {
8000 string particle_class = "";
8002 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8004
8005 if (entry_type == CT_CLASS)
8006 {
8007 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8008 WPOOH_array.Insert(WPOF);
8009 }
8010 }
8011
8012
8014 }
8015 }
8016 }
8017
8019 {
8021 }
8022
8024 {
8026 {
8028
8031
8034
8035 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8036 }
8037 }
8038
8040 {
8042 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8043
8045 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8046
8048 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8049
8051 {
8053 }
8054 }
8055
8057 {
8059 }
8060
8062 {
8065 else
8067
8069 {
8072 }
8073 else
8074 {
8077
8080 }
8081
8083 }
8084
8086 {
8088 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8089 }
8090
8092 {
8094 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8096 }
8097
8099 {
8101 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8102 }
8103
8105 {
8108
8109 OverheatingParticle OP = new OverheatingParticle();
8114
8116 }
8117
8119 {
8122
8123 return -1;
8124 }
8125
8127 {
8129 {
8132
8133 for (int i = count; i > 0; --i)
8134 {
8135 int id = i - 1;
8138
8141
8142 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8143 {
8144 if (p)
8145 {
8148 }
8149 }
8150 }
8151 }
8152 }
8153
8155 {
8157 {
8159 {
8160 int id = i - 1;
8162
8163 if (OP)
8164 {
8166
8167 if (p)
8168 {
8170 }
8171
8172 delete OP;
8173 }
8174 }
8175
8178 }
8179 }
8180
8183 {
8184 return 0.0;
8185 }
8186
8187
8189 {
8190 return 250;
8191 }
8192
8194 {
8195 return 0;
8196 }
8197
8200 {
8202 return true;
8203
8204 return false;
8205 }
8206
8209 {
8212
8214 {
8216 }
8217 else
8218 {
8219
8221 }
8222
8224 }
8225
8232 {
8233 return -1;
8234 }
8235
8236
8237
8238
8240 {
8242 {
8244 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8245
8246 if (r_index >= 0)
8247 {
8248 InventoryLocation r_il = new InventoryLocation;
8249 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8250
8251 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8254 {
8255 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8256 }
8258 {
8259 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8260 }
8261
8262 }
8263
8264 player.GetHumanInventory().ClearUserReservedLocation(this);
8265 }
8266
8269 }
8270
8271
8272
8273
8275 {
8276 return ItemBase.m_DebugActionsMask;
8277 }
8278
8280 {
8281 return ItemBase.m_DebugActionsMask & mask;
8282 }
8283
8285 {
8286 ItemBase.m_DebugActionsMask = mask;
8287 }
8288
8290 {
8291 ItemBase.m_DebugActionsMask |= mask;
8292 }
8293
8295 {
8296 ItemBase.m_DebugActionsMask &= ~mask;
8297 }
8298
8300 {
8302 {
8304 }
8305 else
8306 {
8308 }
8309 }
8310
8311
8313 {
8314 if (GetEconomyProfile())
8315 {
8316 float q_max = GetEconomyProfile().GetQuantityMax();
8317 if (q_max > 0)
8318 {
8319 float q_min = GetEconomyProfile().GetQuantityMin();
8320 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8321
8323 {
8324 ComponentEnergyManager comp = GetCompEM();
8326 {
8328 }
8329 }
8331 {
8333
8334 }
8335
8336 }
8337 }
8338 }
8339
8342 {
8343 EntityAI parent = GetHierarchyParent();
8344
8345 if (parent)
8346 {
8347 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8348 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8349 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8350 }
8351 }
8352
8355 {
8356 EntityAI parent = GetHierarchyParent();
8357
8358 if (parent)
8359 {
8360 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8361 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8362 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8363 }
8364 }
8365
8367 {
8368
8369
8370
8371
8373
8375 {
8376 if (ScriptInputUserData.CanStoreInputUserData())
8377 {
8378 ScriptInputUserData ctx = new ScriptInputUserData;
8384 ctx.
Write(use_stack_max);
8387
8389 {
8390 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8391 }
8392 }
8393 }
8394 else if (!
GetGame().IsMultiplayer())
8395 {
8397 }
8398 }
8399
8401 {
8403 }
8404
8406 {
8408 }
8409
8411 {
8413 }
8414
8416 {
8417
8418 return false;
8419 }
8420
8422 {
8423 return false;
8424 }
8425
8429 {
8430 return false;
8431 }
8432
8434 {
8435 return "";
8436 }
8437
8439
8441 {
8442 return false;
8443 }
8444
8446 {
8447 return true;
8448 }
8449
8450
8451
8453 {
8454 return true;
8455 }
8456
8458 {
8459 return true;
8460 }
8461
8463 {
8464 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8466 }
8467
8469 {
8471 }
8472
8474 {
8476 if (!is_being_placed)
8478 SetSynchDirty();
8479 }
8480
8481
8483
8485 {
8487 }
8488
8490 {
8492 }
8493
8495 {
8496 return 1;
8497 }
8498
8500 {
8501 return false;
8502 }
8503
8505 {
8507 SetSynchDirty();
8508 }
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8545 {
8546 super.OnMovedInsideCargo(container);
8547
8548 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8549 }
8550
8551 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8552 {
8553 super.EEItemLocationChanged(oldLoc,newLoc);
8554
8555 PlayerBase new_player = null;
8556 PlayerBase old_player = null;
8557
8558 if (newLoc.GetParent())
8559 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8560
8561 if (oldLoc.GetParent())
8562 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8563
8565 {
8566 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8567
8568 if (r_index >= 0)
8569 {
8570 InventoryLocation r_il = new InventoryLocation;
8571 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8572
8573 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8576 {
8577 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8578 }
8580 {
8581 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8582 }
8583
8584 }
8585 }
8586
8588 {
8589 if (new_player)
8590 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8591
8592 if (new_player == old_player)
8593 {
8594
8595 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8596 {
8598 {
8599 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8600 {
8601 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8602 }
8603 }
8604 else
8605 {
8606 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8607 }
8608 }
8609
8610 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8611 {
8612 int type = oldLoc.GetType();
8614 {
8615 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8616 }
8618 {
8619 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8620 }
8621 }
8622 if (!m_OldLocation)
8623 {
8624 m_OldLocation = new InventoryLocation;
8625 }
8626 m_OldLocation.Copy(oldLoc);
8627 }
8628 else
8629 {
8630 if (m_OldLocation)
8631 {
8632 m_OldLocation.Reset();
8633 }
8634 }
8635
8637 }
8638 else
8639 {
8640 if (new_player)
8641 {
8642 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8643 if (res_index >= 0)
8644 {
8645 InventoryLocation il = new InventoryLocation;
8646 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8648 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8651 {
8652 il.
GetParent().GetOnReleaseLock().Invoke(it);
8653 }
8655 {
8657 }
8658
8659 }
8660 }
8662 {
8663
8665 }
8666
8667 if (m_OldLocation)
8668 {
8669 m_OldLocation.Reset();
8670 }
8671 }
8672 }
8673
8674 override void EOnContact(IEntity other, Contact extra)
8675 {
8677 {
8678 int liquidType = -1;
8680 if (impactSpeed > 0.0)
8681 {
8683 #ifndef SERVER
8685 #else
8687 SetSynchDirty();
8688 #endif
8690 }
8691 }
8692
8693 #ifdef SERVER
8694 if (GetCompEM() && GetCompEM().IsPlugged())
8695 {
8696 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8697 GetCompEM().UnplugThis();
8698 }
8699 #endif
8700 }
8701
8703
8705 {
8707 }
8708
8710 {
8711
8712 }
8713
8715 {
8716 super.OnItemLocationChanged(old_owner, new_owner);
8717
8718 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8719 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8720
8721 if (!relatedPlayer && playerNew)
8722 relatedPlayer = playerNew;
8723
8724 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8725 {
8727 if (actionMgr)
8728 {
8729 ActionBase currentAction = actionMgr.GetRunningAction();
8730 if (currentAction)
8732 }
8733 }
8734
8735 Man ownerPlayerOld = null;
8736 Man ownerPlayerNew = null;
8737
8738 if (old_owner)
8739 {
8740 if (old_owner.
IsMan())
8741 {
8742 ownerPlayerOld = Man.Cast(old_owner);
8743 }
8744 else
8745 {
8746 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8747 }
8748 }
8749 else
8750 {
8752 {
8754
8755 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8756 {
8757 GetCompEM().UnplugThis();
8758 }
8759 }
8760 }
8761
8762 if (new_owner)
8763 {
8764 if (new_owner.
IsMan())
8765 {
8766 ownerPlayerNew = Man.Cast(new_owner);
8767 }
8768 else
8769 {
8770 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8771 }
8772 }
8773
8774 if (ownerPlayerOld != ownerPlayerNew)
8775 {
8776 if (ownerPlayerOld)
8777 {
8778 array<EntityAI> subItemsExit = new array<EntityAI>;
8780 for (int i = 0; i < subItemsExit.Count(); i++)
8781 {
8784 }
8785 }
8786
8787 if (ownerPlayerNew)
8788 {
8789 array<EntityAI> subItemsEnter = new array<EntityAI>;
8791 for (int j = 0; j < subItemsEnter.Count(); j++)
8792 {
8795 }
8796 }
8797 }
8798 else if (ownerPlayerNew != null)
8799 {
8800 PlayerBase nplayer;
8801 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8802 {
8803 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8805 for (int k = 0; k < subItemsUpdate.Count(); k++)
8806 {
8808 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8809 }
8810 }
8811 }
8812
8813 if (old_owner)
8814 old_owner.OnChildItemRemoved(this);
8815 if (new_owner)
8816 new_owner.OnChildItemReceived(this);
8817 }
8818
8819
8821 {
8822 super.EEDelete(parent);
8823 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8824 if (player)
8825 {
8827
8828 if (player.IsAlive())
8829 {
8830 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8831 if (r_index >= 0)
8832 {
8833 InventoryLocation r_il = new InventoryLocation;
8834 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8835
8836 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8839 {
8840 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8841 }
8843 {
8844 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8845 }
8846
8847 }
8848
8849 player.RemoveQuickBarEntityShortcut(this);
8850 }
8851 }
8852 }
8853
8855 {
8856 super.EEKilled(killer);
8857
8860 {
8861 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8862 {
8863 if (IsMagazine())
8864 {
8865 if (Magazine.Cast(this).GetAmmoCount() > 0)
8866 {
8868 }
8869 }
8870 else
8871 {
8873 }
8874 }
8875 }
8876 }
8877
8879 {
8880 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8881
8882 super.OnWasAttached(parent, slot_id);
8883
8886
8888 }
8889
8891 {
8892 super.OnWasDetached(parent, slot_id);
8893
8896 }
8897
8899 {
8900 int idx;
8903
8904 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8905 if (inventory_slots.Count() < 1)
8906 {
8907 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8908 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8909 }
8910 else
8911 {
8912 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8913 }
8914
8915 idx = inventory_slots.Find(slot);
8916 if (idx < 0)
8917 return "";
8918
8919 return attach_types.Get(idx);
8920 }
8921
8923 {
8924 int idx = -1;
8925 string slot;
8926
8929
8930 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8931 if (inventory_slots.Count() < 1)
8932 {
8933 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8934 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8935 }
8936 else
8937 {
8938 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8939 if (detach_types.Count() < 1)
8940 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8941 }
8942
8943 for (int i = 0; i < inventory_slots.Count(); i++)
8944 {
8945 slot = inventory_slots.Get(i);
8946 }
8947
8948 if (slot != "")
8949 {
8950 if (detach_types.Count() == 1)
8951 idx = 0;
8952 else
8953 idx = inventory_slots.Find(slot);
8954 }
8955 if (idx < 0)
8956 return "";
8957
8958 return detach_types.Get(idx);
8959 }
8960
8962 {
8963
8965
8966
8967 float min_time = 1;
8968 float max_time = 3;
8969 float delay = Math.RandomFloat(min_time, max_time);
8970
8971 explode_timer.Run(delay, this, "DoAmmoExplosion");
8972 }
8973
8975 {
8976 Magazine magazine = Magazine.Cast(this);
8977 int pop_sounds_count = 6;
8978 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8979
8980
8981 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8982 string sound_name = pop_sounds[ sound_idx ];
8984
8985
8986 magazine.ServerAddAmmoCount(-1);
8987
8988
8989 float min_temp_to_explode = 100;
8990
8991 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8992 {
8994 }
8995 }
8996
8997
8998 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8999 {
9000 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9001
9002 const int CHANCE_DAMAGE_CARGO = 4;
9003 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9004 const int CHANCE_DAMAGE_NOTHING = 2;
9005
9007 {
9008 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9009 int chances;
9010 int rnd;
9011
9012 if (GetInventory().GetCargo())
9013 {
9014 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9015 rnd = Math.RandomInt(0,chances);
9016
9017 if (rnd < CHANCE_DAMAGE_CARGO)
9018 {
9020 }
9021 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9022 {
9024 }
9025 }
9026 else
9027 {
9028 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9029 rnd = Math.RandomInt(0,chances);
9030
9031 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9032 {
9034 }
9035 }
9036 }
9037 }
9038
9040 {
9041 if (GetInventory().GetCargo())
9042 {
9043 int item_count = GetInventory().GetCargo().GetItemCount();
9044 if (item_count > 0)
9045 {
9046 int random_pick = Math.RandomInt(0, item_count);
9048 if (!item.IsExplosive())
9049 {
9050 item.AddHealth("","",damage);
9051 return true;
9052 }
9053 }
9054 }
9055 return false;
9056 }
9057
9059 {
9060 int attachment_count = GetInventory().AttachmentCount();
9061 if (attachment_count > 0)
9062 {
9063 int random_pick = Math.RandomInt(0, attachment_count);
9064 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9065 if (!attachment.IsExplosive())
9066 {
9067 attachment.AddHealth("","",damage);
9068 return true;
9069 }
9070 }
9071 return false;
9072 }
9073
9075 {
9077 }
9078
9080 {
9082 return GetInventory().CanRemoveEntity();
9083
9084 return false;
9085 }
9086
9088 {
9089
9091 return false;
9092
9093
9095 return false;
9096
9097
9098
9100 if (delta == 0)
9101 return false;
9102
9103
9104 return true;
9105 }
9106
9108 {
9110 {
9111 if (ScriptInputUserData.CanStoreInputUserData())
9112 {
9113 ScriptInputUserData ctx = new ScriptInputUserData;
9118 ctx.
Write(destination_entity);
9122 }
9123 }
9124 else if (!
GetGame().IsMultiplayer())
9125 {
9127 }
9128 }
9129
9131 {
9132 float split_quantity_new;
9136 InventoryLocation loc = new InventoryLocation;
9137
9138 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9139 {
9141 split_quantity_new = stack_max;
9142 else
9144
9146 {
9147 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9148 if (new_item)
9149 {
9150 new_item.SetResultOfSplit(true);
9151 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9153 new_item.
SetQuantity(split_quantity_new,
false,
true);
9154 }
9155 }
9156 }
9157 else if (destination_entity && slot_id == -1)
9158 {
9159 if (quantity > stack_max)
9160 split_quantity_new = stack_max;
9161 else
9162 split_quantity_new = quantity;
9163
9165 {
9167 {
9170 }
9171
9172 if (new_item)
9173 {
9174 new_item.SetResultOfSplit(true);
9175 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9177 new_item.
SetQuantity(split_quantity_new,
false,
true);
9178 }
9179 }
9180 }
9181 else
9182 {
9183 if (stack_max != 0)
9184 {
9186 {
9188 }
9189
9190 if (split_quantity_new == 0)
9191 {
9192 if (!
GetGame().IsMultiplayer())
9193 player.PhysicalPredictiveDropItem(this);
9194 else
9195 player.ServerDropEntity(this);
9196 return;
9197 }
9198
9200 {
9202
9203 if (new_item)
9204 {
9205 new_item.SetResultOfSplit(true);
9206 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9209 new_item.PlaceOnSurface();
9210 }
9211 }
9212 }
9213 }
9214 }
9215
9217 {
9218 float split_quantity_new;
9222 InventoryLocation loc = new InventoryLocation;
9223
9224 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9225 {
9227 split_quantity_new = stack_max;
9228 else
9230
9232 {
9233 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9234 if (new_item)
9235 {
9236 new_item.SetResultOfSplit(true);
9237 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9239 new_item.
SetQuantity(split_quantity_new,
false,
true);
9240 }
9241 }
9242 }
9243 else if (destination_entity && slot_id == -1)
9244 {
9245 if (quantity > stack_max)
9246 split_quantity_new = stack_max;
9247 else
9248 split_quantity_new = quantity;
9249
9251 {
9253 {
9256 }
9257
9258 if (new_item)
9259 {
9260 new_item.SetResultOfSplit(true);
9261 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9263 new_item.
SetQuantity(split_quantity_new,
false,
true);
9264 }
9265 }
9266 }
9267 else
9268 {
9269 if (stack_max != 0)
9270 {
9272 {
9274 }
9275
9277 {
9279
9280 if (new_item)
9281 {
9282 new_item.SetResultOfSplit(true);
9283 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9286 new_item.PlaceOnSurface();
9287 }
9288 }
9289 }
9290 }
9291 }
9292
9294 {
9296 {
9297 if (ScriptInputUserData.CanStoreInputUserData())
9298 {
9299 ScriptInputUserData ctx = new ScriptInputUserData;
9304 dst.WriteToContext(ctx);
9306 }
9307 }
9308 else if (!
GetGame().IsMultiplayer())
9309 {
9311 }
9312 }
9313
9315 {
9317 {
9318 if (ScriptInputUserData.CanStoreInputUserData())
9319 {
9320 ScriptInputUserData ctx = new ScriptInputUserData;
9325 ctx.
Write(destination_entity);
9331 }
9332 }
9333 else if (!
GetGame().IsMultiplayer())
9334 {
9336 }
9337 }
9338
9340 {
9342 }
9343
9345 {
9347 float split_quantity_new;
9349 if (dst.IsValid())
9350 {
9351 int slot_id = dst.GetSlot();
9353
9354 if (quantity > stack_max)
9355 split_quantity_new = stack_max;
9356 else
9357 split_quantity_new = quantity;
9358
9360 {
9362
9363 if (new_item)
9364 {
9365 new_item.SetResultOfSplit(true);
9366 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9368 new_item.
SetQuantity(split_quantity_new,
false,
true);
9369 }
9370
9371 return new_item;
9372 }
9373 }
9374
9375 return null;
9376 }
9377
9379 {
9381 float split_quantity_new;
9383 if (destination_entity)
9384 {
9386 if (quantity > stackable)
9387 split_quantity_new = stackable;
9388 else
9389 split_quantity_new = quantity;
9390
9392 {
9393 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9394 if (new_item)
9395 {
9396 new_item.SetResultOfSplit(true);
9397 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9399 new_item.
SetQuantity(split_quantity_new,
false,
true);
9400 }
9401 }
9402 }
9403 }
9404
9406 {
9408 {
9409 if (ScriptInputUserData.CanStoreInputUserData())
9410 {
9411 ScriptInputUserData ctx = new ScriptInputUserData;
9416 ItemBase destination_entity =
this;
9417 ctx.
Write(destination_entity);
9421 }
9422 }
9423 else if (!
GetGame().IsMultiplayer())
9424 {
9426 }
9427 }
9428
9430 {
9432 float split_quantity_new;
9434 if (player)
9435 {
9437 if (quantity > stackable)
9438 split_quantity_new = stackable;
9439 else
9440 split_quantity_new = quantity;
9441
9443 {
9444 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9445 new_item =
ItemBase.Cast(in_hands);
9446 if (new_item)
9447 {
9448 new_item.SetResultOfSplit(true);
9449 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9451 new_item.SetQuantity(split_quantity_new, false, true);
9452 }
9453 }
9454 }
9455 }
9456
9458 {
9460 float split_quantity_new = Math.Floor(quantity * 0.5);
9461
9463 return;
9464
9466
9467 if (new_item)
9468 {
9469 if (new_item.GetQuantityMax() < split_quantity_new)
9470 {
9471 split_quantity_new = new_item.GetQuantityMax();
9472 }
9473
9474 new_item.SetResultOfSplit(true);
9475 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9476
9478 {
9481 }
9482 else
9483 {
9485 new_item.
SetQuantity(split_quantity_new,
false,
true);
9486 }
9487 }
9488 }
9489
9491 {
9493 float split_quantity_new = Math.Floor(quantity / 2);
9494
9496 return;
9497
9498 InventoryLocation invloc = new InventoryLocation;
9500
9502 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9503
9504 if (new_item)
9505 {
9506 if (new_item.GetQuantityMax() < split_quantity_new)
9507 {
9508 split_quantity_new = new_item.GetQuantityMax();
9509 }
9511 {
9514 }
9515 else if (split_quantity_new > 1)
9516 {
9518 new_item.
SetQuantity(split_quantity_new,
false,
true);
9519 }
9520 }
9521 }
9522
9525 {
9526 SetWeightDirty();
9528
9529 if (parent)
9530 parent.OnAttachmentQuantityChangedEx(this, delta);
9531
9533 {
9535 {
9537 }
9539 {
9540 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9542 }
9543 }
9544
9545 }
9546
9549 {
9550
9551 }
9552
9555 {
9557 }
9558
9560 {
9561 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9562
9564 {
9565 if (newLevel == GameConstants.STATE_RUINED)
9566 {
9568 EntityAI parent = GetHierarchyParent();
9569 if (parent && parent.IsFireplace())
9570 {
9571 CargoBase cargo = GetInventory().GetCargo();
9572 if (cargo)
9573 {
9575 {
9577 }
9578 }
9579 }
9580 }
9581
9583 {
9584
9586 return;
9587 }
9588
9589 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9590 {
9592 }
9593 }
9594 }
9595
9596
9598 {
9599 super.OnRightClick();
9600
9602 {
9604 {
9605 if (ScriptInputUserData.CanStoreInputUserData())
9606 {
9607 EntityAI root = GetHierarchyRoot();
9608 Man playerOwner = GetHierarchyRootPlayer();
9609 InventoryLocation dst = new InventoryLocation;
9610
9611
9612 if (!playerOwner && root && root == this)
9613 {
9615 }
9616 else
9617 {
9618
9619 GetInventory().GetCurrentInventoryLocation(dst);
9621 {
9624 {
9626 }
9627 else
9628 {
9630
9631
9632 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9633 {
9635 }
9636 else
9637 {
9638 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9639 }
9640 }
9641 }
9642 }
9643
9644 ScriptInputUserData ctx = new ScriptInputUserData;
9652 }
9653 }
9654 else if (!
GetGame().IsMultiplayer())
9655 {
9657 }
9658 }
9659 }
9660
9662 {
9663 if (root)
9664 {
9665 vector m4[4];
9666 root.GetTransform(m4);
9667 dst.SetGround(this, m4);
9668 }
9669 else
9670 {
9671 GetInventory().GetCurrentInventoryLocation(dst);
9672 }
9673 }
9674
9675 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9676 {
9677
9678 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9679 return false;
9680
9681 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9682 return false;
9683
9684
9686 return false;
9687
9688
9689 Magazine mag = Magazine.Cast(this);
9690 if (mag)
9691 {
9692 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9693 return false;
9694
9695 if (stack_max_limit)
9696 {
9697 Magazine other_mag = Magazine.Cast(other_item);
9698 if (other_item)
9699 {
9700 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9701 return false;
9702 }
9703
9704 }
9705 }
9706 else
9707 {
9708
9710 return false;
9711
9713 return false;
9714 }
9715
9716 PlayerBase player = null;
9717 if (CastTo(player, GetHierarchyRootPlayer()))
9718 {
9719 if (player.GetInventory().HasAttachment(this))
9720 return false;
9721
9722 if (player.IsItemsToDelete())
9723 return false;
9724 }
9725
9726 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9727 return false;
9728
9729 int slotID;
9731 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9732 return false;
9733
9734 return true;
9735 }
9736
9738 {
9740 }
9741
9743 {
9744 return m_IsResultOfSplit;
9745 }
9746
9748 {
9749 m_IsResultOfSplit = value;
9750 }
9751
9753 {
9755 }
9756
9758 {
9759 float other_item_quantity = other_item.GetQuantity();
9760 float this_free_space;
9761
9763
9765
9766 if (other_item_quantity > this_free_space)
9767 {
9768 return this_free_space;
9769 }
9770 else
9771 {
9772 return other_item_quantity;
9773 }
9774 }
9775
9777 {
9779 }
9780
9782 {
9784 return;
9785
9786 if (!IsMagazine() && other_item)
9787 {
9789 if (quantity_used != 0)
9790 {
9791 float hp1 = GetHealth01("","");
9792 float hp2 = other_item.GetHealth01("","");
9793 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9794 hpResult = hpResult / (
GetQuantity() + quantity_used);
9795
9796 hpResult *= GetMaxHealth();
9797 Math.Round(hpResult);
9798 SetHealth("", "Health", hpResult);
9799
9801 other_item.AddQuantity(-quantity_used);
9802 }
9803 }
9805 }
9806
9808 {
9809 #ifdef SERVER
9810 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9811 GetHierarchyParent().IncreaseLifetimeUp();
9812 #endif
9813 };
9814
9816 {
9817 PlayerBase p = PlayerBase.Cast(player);
9818
9819 array<int> recipesIds = p.m_Recipes;
9820 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9821 if (moduleRecipesManager)
9822 {
9823 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9824 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9825 }
9826
9827 for (int i = 0;i < recipesIds.Count(); i++)
9828 {
9829 int key = recipesIds.Get(i);
9830 string recipeName = moduleRecipesManager.GetRecipeName(key);
9832 }
9833 }
9834
9835
9836 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9837 {
9838 super.GetDebugActions(outputList);
9839
9840
9846
9847
9852
9857
9858
9862
9863
9865 {
9869 }
9870
9873
9874
9878
9880
9881 InventoryLocation loc = new InventoryLocation();
9882 GetInventory().GetCurrentInventoryLocation(loc);
9884 {
9885 if (Gizmo_IsSupported())
9888 }
9889
9891 }
9892
9893
9894
9895
9897 {
9898 super.OnAction(action_id, player, ctx);
9899
9901 {
9902 switch (action_id)
9903 {
9906 return true;
9909 return true;
9910 }
9911 }
9912
9914 {
9915 switch (action_id)
9916 {
9918 Delete();
9919 return true;
9920 }
9921 }
9922
9923 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9924 {
9925 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9926 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9927 PlayerBase p = PlayerBase.Cast(player);
9928 if (
EActions.RECIPES_RANGE_START < 1000)
9929 {
9930 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9931 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9932 }
9933 }
9934 #ifndef SERVER
9935 else if (action_id ==
EActions.WATCH_PLAYER)
9936 {
9937 PluginDeveloper.SetDeveloperItemClientEx(player);
9938 }
9939 #endif
9941 {
9942 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9943 {
9944 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9945 OnDebugButtonPressServer(id + 1);
9946 }
9947
9948 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9949 {
9950 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9952 }
9953
9954 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9955 {
9956 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9958 }
9959
9960 else if (action_id ==
EActions.ADD_QUANTITY)
9961 {
9962 if (IsMagazine())
9963 {
9964 Magazine mag = Magazine.Cast(this);
9965 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9966 }
9967 else
9968 {
9970 }
9971
9972 if (m_EM)
9973 {
9974 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9975 }
9976
9977 }
9978
9979 else if (action_id ==
EActions.REMOVE_QUANTITY)
9980 {
9981 if (IsMagazine())
9982 {
9983 Magazine mag2 = Magazine.Cast(this);
9984 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9985 }
9986 else
9987 {
9989 }
9990 if (m_EM)
9991 {
9992 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9993 }
9994
9995 }
9996
9997 else if (action_id ==
EActions.SET_QUANTITY_0)
9998 {
10000
10001 if (m_EM)
10002 {
10003 m_EM.SetEnergy(0);
10004 }
10005 }
10006
10007 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10008 {
10010
10011 if (m_EM)
10012 {
10013 m_EM.SetEnergy(m_EM.GetEnergyMax());
10014 }
10015 }
10016
10017 else if (action_id ==
EActions.ADD_HEALTH)
10018 {
10019 AddHealth("","",GetMaxHealth("","Health")/5);
10020 }
10021 else if (action_id ==
EActions.REMOVE_HEALTH)
10022 {
10023 AddHealth("","",-GetMaxHealth("","Health")/5);
10024 }
10025 else if (action_id ==
EActions.DESTROY_HEALTH)
10026 {
10027 SetHealth01("","",0);
10028 }
10029 else if (action_id ==
EActions.WATCH_ITEM)
10030 {
10032 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10033 #ifdef DEVELOPER
10034 SetDebugDeveloper_item(this);
10035 #endif
10036 }
10037
10038 else if (action_id ==
EActions.ADD_TEMPERATURE)
10039 {
10040 AddTemperature(20);
10041
10042 }
10043
10044 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10045 {
10046 AddTemperature(-20);
10047
10048 }
10049
10050 else if (action_id ==
EActions.FLIP_FROZEN)
10051 {
10052 SetFrozen(!GetIsFrozen());
10053
10054 }
10055
10056 else if (action_id ==
EActions.ADD_WETNESS)
10057 {
10059
10060 }
10061
10062 else if (action_id ==
EActions.REMOVE_WETNESS)
10063 {
10065
10066 }
10067
10068 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10069 {
10072
10073
10074 }
10075
10076 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10077 {
10080 }
10081
10082 else if (action_id ==
EActions.MAKE_SPECIAL)
10083 {
10084 auto debugParams = DebugSpawnParams.WithPlayer(player);
10085 OnDebugSpawnEx(debugParams);
10086 }
10087
10088 }
10089
10090
10091 return false;
10092 }
10093
10094
10095
10096
10100
10103
10104
10105
10107 {
10108 return false;
10109 }
10110
10111
10113 {
10114 return true;
10115 }
10116
10117
10119 {
10120 return true;
10121 }
10122
10123
10124
10126 {
10127 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10129 }
10130
10133 {
10134 return null;
10135 }
10136
10138 {
10139 return false;
10140 }
10141
10143 {
10144 return false;
10145 }
10146
10150
10151
10153 {
10154 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10155 return module_repairing.CanRepair(this, item_repair_kit);
10156 }
10157
10158
10159 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10160 {
10161 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10162 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10163 }
10164
10165
10167 {
10168
10169
10170
10171
10172
10173
10174
10175
10176 return 1;
10177 }
10178
10179
10180
10182 {
10184 }
10185
10186
10187
10189 {
10191 }
10192
10193
10202 {
10203 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10204
10205 if (player)
10206 {
10207 player.MessageStatus(text);
10208 }
10209 }
10210
10211
10220 {
10221 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10222
10223 if (player)
10224 {
10225 player.MessageAction(text);
10226 }
10227 }
10228
10229
10238 {
10239 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10240
10241 if (player)
10242 {
10243 player.MessageFriendly(text);
10244 }
10245 }
10246
10247
10256 {
10257 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10258
10259 if (player)
10260 {
10261 player.MessageImportant(text);
10262 }
10263 }
10264
10266 {
10267 return true;
10268 }
10269
10270
10271 override bool KindOf(
string tag)
10272 {
10273 bool found = false;
10274 string item_name = this.
GetType();
10277
10278 int array_size = item_tag_array.Count();
10279 for (int i = 0; i < array_size; i++)
10280 {
10281 if (item_tag_array.Get(i) == tag)
10282 {
10283 found = true;
10284 break;
10285 }
10286 }
10287 return found;
10288 }
10289
10290
10292 {
10293
10294 super.OnRPC(sender, rpc_type,ctx);
10295
10296
10297 switch (rpc_type)
10298 {
10299 #ifndef SERVER
10300 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10301 Param2<bool, string> p = new Param2<bool, string>(false, "");
10302
10304 return;
10305
10306 bool play = p.param1;
10307 string soundSet = p.param2;
10308
10309 if (play)
10310 {
10312 {
10314 {
10316 }
10317 }
10318 else
10319 {
10321 }
10322 }
10323 else
10324 {
10326 }
10327
10328 break;
10329 #endif
10330
10331 }
10332
10334 {
10336 }
10337 }
10338
10339
10340
10341
10343 {
10344 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10345 return plugin.GetID(
name);
10346 }
10347
10349 {
10350 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10351 return plugin.GetName(id);
10352 }
10353
10356 {
10357
10358
10359 int varFlags;
10360 if (!ctx.
Read(varFlags))
10361 return;
10362
10363 if (varFlags & ItemVariableFlags.FLOAT)
10364 {
10366 }
10367 }
10368
10370 {
10371
10372 super.SerializeNumericalVars(floats_out);
10373
10374
10375
10377 {
10379 }
10380
10382 {
10384 }
10385
10387 {
10389 }
10390
10392 {
10397 }
10398
10400 {
10402 }
10403 }
10404
10406 {
10407
10408 super.DeSerializeNumericalVars(floats);
10409
10410
10411 int index = 0;
10412 int mask = Math.Round(floats.Get(index));
10413
10414 index++;
10415
10417 {
10419 {
10421 }
10422 else
10423 {
10424 float quantity = floats.Get(index);
10425 SetQuantity(quantity,
true,
false,
false,
false);
10426 }
10427 index++;
10428 }
10429
10431 {
10432 float wet = floats.Get(index);
10434 index++;
10435 }
10436
10438 {
10439 int liquidtype = Math.Round(floats.Get(index));
10441 index++;
10442 }
10443
10445 {
10447 index++;
10449 index++;
10451 index++;
10453 index++;
10454 }
10455
10457 {
10458 int cleanness = Math.Round(floats.Get(index));
10460 index++;
10461 }
10462 }
10463
10465 {
10466 super.WriteVarsToCTX(ctx);
10467
10468
10470 {
10472 }
10473
10475 {
10477 }
10478
10480 {
10482 }
10483
10485 {
10486 int r,g,b,a;
10492 }
10493
10495 {
10497 }
10498 }
10499
10501 {
10502 if (!super.ReadVarsFromCTX(ctx,version))
10503 return false;
10504
10505 int intValue;
10506 float value;
10507
10508 if (version < 140)
10509 {
10510 if (!ctx.
Read(intValue))
10511 return false;
10512
10513 m_VariablesMask = intValue;
10514 }
10515
10517 {
10518 if (!ctx.
Read(value))
10519 return false;
10520
10522 {
10524 }
10525 else
10526 {
10528 }
10529 }
10530
10531 if (version < 140)
10532 {
10534 {
10535 if (!ctx.
Read(value))
10536 return false;
10537 SetTemperatureDirect(value);
10538 }
10539 }
10540
10542 {
10543 if (!ctx.
Read(value))
10544 return false;
10546 }
10547
10549 {
10550 if (!ctx.
Read(intValue))
10551 return false;
10553 }
10554
10556 {
10557 int r,g,b,a;
10559 return false;
10561 return false;
10563 return false;
10565 return false;
10566
10568 }
10569
10571 {
10572 if (!ctx.
Read(intValue))
10573 return false;
10575 }
10576
10577 if (version >= 138 && version < 140)
10578 {
10580 {
10581 if (!ctx.
Read(intValue))
10582 return false;
10583 SetFrozen(intValue);
10584 }
10585 }
10586
10587 return true;
10588 }
10589
10590
10592 {
10595 {
10597 }
10598
10599 if (!super.OnStoreLoad(ctx, version))
10600 {
10602 return false;
10603 }
10604
10605 if (version >= 114)
10606 {
10607 bool hasQuickBarIndexSaved;
10608
10609 if (!ctx.
Read(hasQuickBarIndexSaved))
10610 {
10612 return false;
10613 }
10614
10615 if (hasQuickBarIndexSaved)
10616 {
10617 int itmQBIndex;
10618
10619
10620 if (!ctx.
Read(itmQBIndex))
10621 {
10623 return false;
10624 }
10625
10626 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10627 if (itmQBIndex != -1 && parentPlayer)
10628 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10629 }
10630 }
10631 else
10632 {
10633
10634 PlayerBase player;
10635 int itemQBIndex;
10636 if (version ==
int.
MAX)
10637 {
10638 if (!ctx.
Read(itemQBIndex))
10639 {
10641 return false;
10642 }
10643 }
10644 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10645 {
10646
10647 if (!ctx.
Read(itemQBIndex))
10648 {
10650 return false;
10651 }
10652 if (itemQBIndex != -1 && player)
10653 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10654 }
10655 }
10656
10657 if (version < 140)
10658 {
10659
10660 if (!LoadVariables(ctx, version))
10661 {
10663 return false;
10664 }
10665 }
10666
10667
10669 {
10671 return false;
10672 }
10673 if (version >= 132)
10674 {
10676 if (raib)
10677 {
10679 {
10681 return false;
10682 }
10683 }
10684 }
10685
10687 return true;
10688 }
10689
10690
10691
10693 {
10694 super.OnStoreSave(ctx);
10695
10696 PlayerBase player;
10697 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10698 {
10700
10701 int itemQBIndex = -1;
10702 itemQBIndex = player.FindQuickBarEntityIndex(this);
10703 ctx.
Write(itemQBIndex);
10704 }
10705 else
10706 {
10708 }
10709
10711
10713 if (raib)
10714 {
10716 }
10717 }
10718
10719
10721 {
10722 super.AfterStoreLoad();
10723
10725 {
10727 }
10728
10730 {
10733 }
10734 }
10735
10737 {
10738 super.EEOnAfterLoad();
10739
10741 {
10743 }
10744
10747 }
10748
10750 {
10751 return false;
10752 }
10753
10754
10755
10757 {
10759 {
10760 #ifdef PLATFORM_CONSOLE
10761
10763 {
10765 if (menu)
10766 {
10768 }
10769 }
10770 #endif
10771 }
10772
10774 {
10777 }
10778
10780 {
10781 SetWeightDirty();
10783 }
10785 {
10788 }
10789
10791 {
10794 }
10796 {
10799 }
10800
10801 super.OnVariablesSynchronized();
10802 }
10803
10804
10805
10807 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10808 {
10809 if (!IsServerCheck(allow_client))
10810 return false;
10811
10813 return false;
10814
10817
10818 if (value <= (min + 0.001))
10819 value = min;
10820
10821 if (value == min)
10822 {
10823 if (destroy_config)
10824 {
10825 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10826 if (dstr)
10827 {
10829 this.Delete();
10830 return true;
10831 }
10832 }
10833 else if (destroy_forced)
10834 {
10836 this.Delete();
10837 return true;
10838 }
10839
10841 }
10842
10845
10847 {
10849
10850 if (delta)
10852 }
10853
10855
10856 return false;
10857 }
10858
10859
10861 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10862 {
10864 }
10865
10867 {
10870 }
10871
10873 {
10876 }
10877
10879 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10880 {
10881 float value_clamped = Math.Clamp(value, 0, 1);
10883 SetQuantity(result, destroy_config, destroy_forced);
10884 }
10885
10886
10889 {
10891 }
10892
10894 {
10896 }
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10908 {
10909 int slot = -1;
10910 if (GetInventory())
10911 {
10912 InventoryLocation il = new InventoryLocation;
10913 GetInventory().GetCurrentInventoryLocation(il);
10915 }
10916
10918 }
10919
10921 {
10922 float quantity_max = 0;
10923
10925 {
10926 if (attSlotID != -1)
10927 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10928
10929 if (quantity_max <= 0)
10931 }
10932
10933 if (quantity_max <= 0)
10935
10936 return quantity_max;
10937 }
10938
10940 {
10942 }
10943
10945 {
10947 }
10948
10949
10951 {
10953 }
10954
10956 {
10958 }
10959
10961 {
10963 }
10964
10965
10967 {
10968
10969 float weightEx = GetWeightEx();
10970 float special = GetInventoryAndCargoWeight();
10971 return weightEx - special;
10972 }
10973
10974
10976 {
10978 }
10979
10981 {
10983 {
10984 #ifdef DEVELOPER
10985 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10986 {
10987 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10989 }
10990 #endif
10991
10992 return GetQuantity() * GetConfigWeightModified();
10993 }
10994 else if (HasEnergyManager())
10995 {
10996 #ifdef DEVELOPER
10997 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10998 {
10999 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11000 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11001 }
11002 #endif
11003 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11004 }
11005 else
11006 {
11007 #ifdef DEVELOPER
11008 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11009 {
11010 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11011 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11012 }
11013 #endif
11014 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11015 }
11016 }
11017
11020 {
11021 int item_count = 0;
11023
11024 if (GetInventory().GetCargo() != NULL)
11025 {
11026 item_count = GetInventory().GetCargo().GetItemCount();
11027 }
11028
11029 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11030 {
11031 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11032 if (item)
11033 item_count += item.GetNumberOfItems();
11034 }
11035 return item_count;
11036 }
11037
11040 {
11041 float weight = 0;
11042 float wetness = 1;
11043 if (include_wetness)
11046 {
11047 weight = wetness * m_ConfigWeight;
11048 }
11050 {
11051 weight = 1;
11052 }
11053 return weight;
11054 }
11055
11056
11057
11059 {
11060 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11061 {
11062 GameInventory inv = GetInventory();
11063 array<EntityAI> items = new array<EntityAI>;
11065 for (int i = 0; i < items.Count(); i++)
11066 {
11068 if (item)
11069 {
11071 }
11072 }
11073 }
11074 }
11075
11076
11077
11078
11080 {
11081 float energy = 0;
11082 if (HasEnergyManager())
11083 {
11084 energy = GetCompEM().GetEnergy();
11085 }
11086 return energy;
11087 }
11088
11089
11091 {
11092 super.OnEnergyConsumed();
11093
11095 }
11096
11098 {
11099 super.OnEnergyAdded();
11100
11102 }
11103
11104
11106 {
11107 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11108 {
11110 {
11111 float energy_0to1 = GetCompEM().GetEnergy0To1();
11113 }
11114 }
11115 }
11116
11117
11119 {
11120 return ConfigGetFloat("heatIsolation");
11121 }
11122
11124 {
11126 }
11127
11129 {
11130 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11131 if (
GetGame().ConfigIsExisting(paramPath))
11133
11134 return 0.0;
11135 }
11136
11138 {
11139 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11140 if (
GetGame().ConfigIsExisting(paramPath))
11142
11143 return 0.0;
11144 }
11145
11146 override void SetWet(
float value,
bool allow_client =
false)
11147 {
11148 if (!IsServerCheck(allow_client))
11149 return;
11150
11153
11155
11156 m_VarWet = Math.Clamp(value, min, max);
11157
11159 {
11162 }
11163 }
11164
11165 override void AddWet(
float value)
11166 {
11168 }
11169
11171 {
11173 }
11174
11176 {
11178 }
11179
11181 {
11183 }
11184
11186 {
11188 }
11189
11191 {
11193 }
11194
11195 override void OnWetChanged(
float newVal,
float oldVal)
11196 {
11199 if (newLevel != oldLevel)
11200 {
11202 }
11203 }
11204
11206 {
11207 SetWeightDirty();
11208 }
11209
11211 {
11212 return GetWetLevelInternal(
m_VarWet);
11213 }
11214
11215
11216
11218 {
11220 }
11221
11223 {
11225 }
11226
11228 {
11230 }
11231
11233 {
11235 }
11236
11237
11238
11240 {
11241 if (ConfigIsExisting("itemModelLength"))
11242 {
11243 return ConfigGetFloat("itemModelLength");
11244 }
11245 return 0;
11246 }
11247
11249 {
11250 if (ConfigIsExisting("itemAttachOffset"))
11251 {
11252 return ConfigGetFloat("itemAttachOffset");
11253 }
11254 return 0;
11255 }
11256
11257 override void SetCleanness(
int value,
bool allow_client =
false)
11258 {
11259 if (!IsServerCheck(allow_client))
11260 return;
11261
11263
11265
11268 }
11269
11271 {
11273 }
11274
11276 {
11277 return true;
11278 }
11279
11280
11281
11282
11284 {
11286 }
11287
11289 {
11291 }
11292
11293
11294
11295
11296 override void SetColor(
int r,
int g,
int b,
int a)
11297 {
11303 }
11305 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11306 {
11311 }
11312
11314 {
11316 }
11317
11320 {
11321 int r,g,b,a;
11323 r = r/255;
11324 g = g/255;
11325 b = b/255;
11326 a = a/255;
11327 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11328 }
11329
11330
11331
11332 override void SetLiquidType(
int value,
bool allow_client =
false)
11333 {
11334 if (!IsServerCheck(allow_client))
11335 return;
11336
11341 }
11342
11344 {
11345 return ConfigGetInt("varLiquidTypeInit");
11346 }
11347
11349 {
11351 }
11352
11354 {
11356 SetFrozen(false);
11357 }
11358
11361 {
11362 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11363 }
11364
11365
11368 {
11369 PlayerBase nplayer;
11370 if (PlayerBase.CastTo(nplayer, player))
11371 {
11373
11374 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11375 }
11376 }
11377
11378
11381 {
11382 PlayerBase nplayer;
11383 if (PlayerBase.CastTo(nplayer,player))
11384 {
11385
11386 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11387
11388 }
11389
11390
11391 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11392
11393
11394 if (HasEnergyManager())
11395 {
11396 GetCompEM().UpdatePlugState();
11397 }
11398 }
11399
11400
11402 {
11403 super.OnPlacementStarted(player);
11404
11406 }
11407
11408 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11409 {
11411 {
11412 m_AdminLog.OnPlacementComplete(player,
this);
11413 }
11414
11415 super.OnPlacementComplete(player, position, orientation);
11416 }
11417
11418
11419
11420
11421
11423 {
11425 {
11426 return true;
11427 }
11428 else
11429 {
11430 return false;
11431 }
11432 }
11433
11434
11436 {
11438 {
11440 }
11441 }
11442
11443
11445 {
11447 }
11448
11450 {
11452 }
11453
11454 override void InsertAgent(
int agent,
float count = 1)
11455 {
11456 if (count < 1)
11457 return;
11458
11460 }
11461
11464 {
11466 }
11467
11468
11470 {
11472 }
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11516 {
11518 return false;
11519 return true;
11520 }
11521
11523 {
11524
11526 }
11527
11528
11531 {
11532 super.CheckForRoofLimited(timeTresholdMS);
11533
11535 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11536 {
11537 m_PreviousRoofTestTime = time;
11538 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11539 }
11540 }
11541
11542
11544 {
11546 {
11547 return 0;
11548 }
11549
11550 if (GetInventory().GetAttachmentSlotsCount() != 0)
11551 {
11552 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11553 if (filter)
11554 return filter.GetProtectionLevel(type, false, system);
11555 else
11556 return 0;
11557 }
11558
11559 string subclassPath, entryName;
11560
11561 switch (type)
11562 {
11564 entryName = "biological";
11565 break;
11567 entryName = "chemical";
11568 break;
11569 default:
11570 entryName = "biological";
11571 break;
11572 }
11573
11574 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11575
11577 }
11578
11579
11580
11583 {
11584 if (!IsMagazine())
11586
11588 }
11589
11590
11591
11592
11593
11598 {
11599 return true;
11600 }
11601
11603 {
11605 }
11606
11607
11608
11609
11610
11612 {
11613 if (parent)
11614 {
11615 if (parent.IsInherited(DayZInfected))
11616 return true;
11617
11618 if (!parent.IsRuined())
11619 return true;
11620 }
11621
11622 return true;
11623 }
11624
11626 {
11627 if (!super.CanPutAsAttachment(parent))
11628 {
11629 return false;
11630 }
11631
11632 if (!IsRuined() && !parent.IsRuined())
11633 {
11634 return true;
11635 }
11636
11637 return false;
11638 }
11639
11641 {
11642
11643
11644
11645
11646 return super.CanReceiveItemIntoCargo(item);
11647 }
11648
11650 {
11651
11652
11653
11654
11655 GameInventory attachmentInv = attachment.GetInventory();
11657 {
11658 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11659 return false;
11660 }
11661
11662 InventoryLocation loc = new InventoryLocation();
11663 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11664 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11665 return false;
11666
11667 return super.CanReceiveAttachment(attachment, slotId);
11668 }
11669
11671 {
11672 if (!super.CanReleaseAttachment(attachment))
11673 return false;
11674
11675 return GetInventory().AreChildrenAccessible();
11676 }
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11699 {
11700 int id = muzzle_owner.GetMuzzleID();
11701 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11702
11703 if (WPOF_array)
11704 {
11705 for (int i = 0; i < WPOF_array.Count(); i++)
11706 {
11707 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11708
11709 if (WPOF)
11710 {
11711 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11712 }
11713 }
11714 }
11715 }
11716
11717
11719 {
11720 int id = muzzle_owner.GetMuzzleID();
11722
11723 if (WPOBE_array)
11724 {
11725 for (int i = 0; i < WPOBE_array.Count(); i++)
11726 {
11727 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11728
11729 if (WPOBE)
11730 {
11731 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11732 }
11733 }
11734 }
11735 }
11736
11737
11739 {
11740 int id = muzzle_owner.GetMuzzleID();
11741 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11742
11743 if (WPOOH_array)
11744 {
11745 for (int i = 0; i < WPOOH_array.Count(); i++)
11746 {
11747 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11748
11749 if (WPOOH)
11750 {
11751 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11752 }
11753 }
11754 }
11755 }
11756
11757
11759 {
11760 int id = muzzle_owner.GetMuzzleID();
11761 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11762
11763 if (WPOOH_array)
11764 {
11765 for (int i = 0; i < WPOOH_array.Count(); i++)
11766 {
11767 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11768
11769 if (WPOOH)
11770 {
11771 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11772 }
11773 }
11774 }
11775 }
11776
11777
11779 {
11780 int id = muzzle_owner.GetMuzzleID();
11781 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11782
11783 if (WPOOH_array)
11784 {
11785 for (int i = 0; i < WPOOH_array.Count(); i++)
11786 {
11787 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11788
11789 if (WPOOH)
11790 {
11791 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11792 }
11793 }
11794 }
11795 }
11796
11797
11798
11800 {
11802 {
11803 return true;
11804 }
11805
11806 return false;
11807 }
11808
11810 {
11812 {
11813 return true;
11814 }
11815
11816 return false;
11817 }
11818
11820 {
11822 {
11823 return true;
11824 }
11825
11826 return false;
11827 }
11828
11830 {
11831 return false;
11832 }
11833
11836 {
11837 return UATimeSpent.DEFAULT_DEPLOY;
11838 }
11839
11840
11841
11842
11844 {
11846 SetSynchDirty();
11847 }
11848
11850 {
11852 }
11853
11854
11856 {
11857 return false;
11858 }
11859
11862 {
11863 string att_type = "None";
11864
11865 if (ConfigIsExisting("soundAttType"))
11866 {
11867 att_type = ConfigGetString("soundAttType");
11868 }
11869
11871 }
11872
11874 {
11876 }
11877
11878
11879
11880
11881
11887
11889 {
11892
11894 }
11895
11896
11898 {
11900 return;
11901
11903
11906
11909
11910 SoundParameters params = new SoundParameters();
11914 }
11915
11916
11918 {
11920 return;
11921
11923 SetSynchDirty();
11924
11927 }
11928
11929
11931 {
11933 return;
11934
11936 SetSynchDirty();
11937
11940 }
11941
11943 {
11945 }
11946
11948 {
11950 }
11951
11954 {
11955 if (!
GetGame().IsDedicatedServer())
11956 {
11957 if (ConfigIsExisting("attachSoundSet"))
11958 {
11959 string cfg_path = "";
11960 string soundset = "";
11961 string type_name =
GetType();
11962
11965 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11966 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11967
11968 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11969 {
11970 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11971 {
11972 if (cfg_slot_array[i] == slot_type)
11973 {
11974 soundset = cfg_soundset_array[i];
11975 break;
11976 }
11977 }
11978 }
11979
11980 if (soundset != "")
11981 {
11982 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11984 }
11985 }
11986 }
11987 }
11988
11990 {
11991
11992 }
11993
11994 void OnApply(PlayerBase player);
11995
11997 {
11998 return 1.0;
11999 };
12000
12002 {
12004 }
12005
12007 {
12009 }
12010
12012
12014 {
12015 SetDynamicPhysicsLifeTime(0.01);
12017 }
12018
12020 {
12021 array<string> zone_names = new array<string>;
12022 GetDamageZones(zone_names);
12023 for (int i = 0; i < zone_names.Count(); i++)
12024 {
12025 SetHealthMax(zone_names.Get(i),"Health");
12026 }
12027 SetHealthMax("","Health");
12028 }
12029
12032 {
12033 float global_health = GetHealth01("","Health");
12034 array<string> zones = new array<string>;
12035 GetDamageZones(zones);
12036
12037 for (int i = 0; i < zones.Count(); i++)
12038 {
12039 SetHealth01(zones.Get(i),"Health",global_health);
12040 }
12041 }
12042
12045 {
12046 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12047 }
12048
12050 {
12051 if (!hasRootAsPlayer)
12052 {
12053 if (refParentIB)
12054 {
12055
12056 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12057 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12058
12059 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12060 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12061
12064 }
12065 else
12066 {
12067
12070 }
12071 }
12072 }
12073
12075 {
12077 {
12078 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12079 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12080 {
12081 float heatPermCoef = 1.0;
12083 while (ent)
12084 {
12085 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12086 ent = ent.GetHierarchyParent();
12087 }
12088
12089 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12090 }
12091 }
12092 }
12093
12095 {
12096
12097 EntityAI parent = GetHierarchyParent();
12098 if (!parent)
12099 {
12100 hasParent = false;
12101 hasRootAsPlayer = false;
12102 }
12103 else
12104 {
12105 hasParent = true;
12106 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12107 refParentIB =
ItemBase.Cast(parent);
12108 }
12109 }
12110
12111 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12112 {
12113
12114 }
12115
12117 {
12118
12119 return false;
12120 }
12121
12123 {
12124
12125
12126 return false;
12127 }
12128
12130 {
12131
12132 return false;
12133 }
12134
12137 {
12138 return !GetIsFrozen() &&
IsOpen();
12139 }
12140
12142 {
12143 bool hasParent = false, hasRootAsPlayer = false;
12145
12146 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12147 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12148
12149 if (wwtu || foodDecay)
12150 {
12154
12155 if (processWetness || processTemperature || processDecay)
12156 {
12158
12159 if (processWetness)
12160 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12161
12162 if (processTemperature)
12164
12165 if (processDecay)
12166 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12167 }
12168 }
12169 }
12170
12173 {
12175 }
12176
12178 {
12181
12182 return super.GetTemperatureFreezeThreshold();
12183 }
12184
12186 {
12189
12190 return super.GetTemperatureThawThreshold();
12191 }
12192
12194 {
12197
12198 return super.GetItemOverheatThreshold();
12199 }
12200
12202 {
12204 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12205
12206 return super.GetTemperatureFreezeTime();
12207 }
12208
12210 {
12212 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12213
12214 return super.GetTemperatureThawTime();
12215 }
12216
12221
12223 {
12224 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12225 }
12226
12228 {
12229 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12230 }
12231
12234 {
12236 }
12237
12239 {
12241 }
12242
12244 {
12246 }
12247
12250 {
12251 return null;
12252 }
12253
12256 {
12257 return false;
12258 }
12259
12261 {
12263 {
12266 if (!trg)
12267 {
12269 explosive = this;
12270 }
12271
12272 explosive.PairRemote(trg);
12274
12275 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12276 trg.SetPersistentPairID(persistentID);
12277 explosive.SetPersistentPairID(persistentID);
12278
12279 return true;
12280 }
12281 return false;
12282 }
12283
12286 {
12287 float ret = 1.0;
12290 ret *= GetHealth01();
12291
12292 return ret;
12293 }
12294
12295 #ifdef DEVELOPER
12296 override void SetDebugItem()
12297 {
12298 super.SetDebugItem();
12299 _itemBase = this;
12300 }
12301
12303 {
12304 string text = super.GetDebugText();
12305
12307 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12308
12309 return text;
12310 }
12311 #endif
12312
12314 {
12315 return true;
12316 }
12317
12319
12321
12323 {
12326 }
12327
12328
12336
12352}
12353
12355{
12357 if (entity)
12358 {
12359 bool is_item = entity.IsInherited(
ItemBase);
12360 if (is_item && full_quantity)
12361 {
12364 }
12365 }
12366 else
12367 {
12369 return NULL;
12370 }
12371 return entity;
12372}
12373
12375{
12376 if (item)
12377 {
12378 if (health > 0)
12379 item.SetHealth("", "", health);
12380
12381 if (item.CanHaveTemperature())
12382 {
12384 if (item.CanFreeze())
12385 item.SetFrozen(false);
12386 }
12387
12388 if (item.HasEnergyManager())
12389 {
12390 if (quantity >= 0)
12391 {
12392 item.GetCompEM().SetEnergy0To1(quantity);
12393 }
12394 else
12395 {
12397 }
12398 }
12399 else if (item.IsMagazine())
12400 {
12401 Magazine mag = Magazine.Cast(item);
12402 if (quantity >= 0)
12403 {
12404 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12405 }
12406 else
12407 {
12409 }
12410
12411 }
12412 else
12413 {
12414 if (quantity >= 0)
12415 {
12416 item.SetQuantityNormalized(quantity, false);
12417 }
12418 else
12419 {
12421 }
12422
12423 }
12424 }
12425}
12426
12427#ifdef DEVELOPER
12429#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.