7794{
7796 {
7797 return true;
7798 }
7799};
7800
7801
7802
7804{
7808
7810
7813
7814
7815
7816
7817
7826
7832
7837
7842
7863 protected bool m_IsResultOfSplit
7864
7866
7871
7872
7873
7875
7879
7880
7881
7883
7886
7887
7888
7894
7895
7903
7906
7907
7909
7910
7912
7913
7918
7919
7924
7925
7927
7928
7930 {
7935
7936 if (!
GetGame().IsDedicatedServer())
7937 {
7939 {
7941
7943 {
7945 }
7946 }
7947
7950 }
7951
7952 m_OldLocation = null;
7953
7955 {
7957 }
7958
7959 if (ConfigIsExisting("headSelectionsToHide"))
7960 {
7963 }
7964
7966 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7967 {
7969 }
7970
7972
7973 m_IsResultOfSplit = false;
7974
7976 }
7977
7979 {
7980 super.InitItemVariables();
7981
7987 m_Count = ConfigGetInt(
"count");
7988
7991
7996
7999
8004
8016
8020
8021
8024 if (ConfigIsExisting("canBeSplit"))
8025 {
8028 }
8029
8031 if (ConfigIsExisting("itemBehaviour"))
8033
8034
8037 RegisterNetSyncVariableInt("m_VarLiquidType");
8038 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8039
8040 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8041 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8042 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8043
8044 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8045 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8046 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8047 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8048
8049 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8050 RegisterNetSyncVariableBool("m_IsTakeable");
8051 RegisterNetSyncVariableBool("m_IsHologram");
8052
8055 {
8058 }
8059
8061
8063 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8065
8066 }
8067
8069 {
8071 }
8072
8074 {
8077 {
8082 }
8083 }
8084
8085 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8086 {
8088 {
8091 }
8092
8094 }
8095
8097 {
8103 }
8104
8106
8108 {
8110
8111 if (!action)
8112 {
8113 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8114 return;
8115 }
8116
8118 if (!ai)
8119 {
8121 return;
8122 }
8123
8125 if (!action_array)
8126 {
8127 action_array = new array<ActionBase_Basic>;
8129 }
8130 if (LogManager.IsActionLogEnable())
8131 {
8132 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8133 }
8134
8135 if (action_array.Find(action) != -1)
8136 {
8137 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8138 }
8139 else
8140 {
8141 action_array.Insert(action);
8142 }
8143 }
8144
8146 {
8148 ActionBase action = player.GetActionManager().GetAction(actionName);
8151
8152 if (action_array)
8153 {
8154 action_array.RemoveItem(action);
8155 }
8156 }
8157
8158
8159
8161 {
8162 ActionOverrideData overrideData = new ActionOverrideData();
8166
8168 if (!actionMap)
8169 {
8172 }
8173
8174 actionMap.Insert(this.
Type(), overrideData);
8175
8176 }
8177
8179
8181
8182
8184 {
8187
8190
8191 string config_to_search = "CfgVehicles";
8192 string muzzle_owner_config;
8193
8195 {
8196 if (IsInherited(Weapon))
8197 config_to_search = "CfgWeapons";
8198
8199 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8200
8201 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8202
8204
8205 if (config_OnFire_subclass_count > 0)
8206 {
8207 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8208
8209 for (int i = 0; i < config_OnFire_subclass_count; i++)
8210 {
8211 string particle_class = "";
8213 string config_OnFire_entry = config_OnFire_class + particle_class;
8214 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8215 WPOF_array.Insert(WPOF);
8216 }
8217
8218
8220 }
8221 }
8222
8224 {
8225 config_to_search = "CfgWeapons";
8226 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8227
8228 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8229
8231
8232 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8233 {
8234 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8235
8236 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8237 {
8238 string particle_class2 = "";
8240 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8241 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8242 WPOBE_array.Insert(WPOBE);
8243 }
8244
8245
8247 }
8248 }
8249 }
8250
8251
8253 {
8256
8258 {
8259 string config_to_search = "CfgVehicles";
8260
8261 if (IsInherited(Weapon))
8262 config_to_search = "CfgWeapons";
8263
8264 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8265 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8266
8267 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8268 {
8269
8271
8273 {
8275 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8277 return;
8278 }
8279
8282
8283
8284
8286 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8287
8288 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8289 {
8290 string particle_class = "";
8292 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8294
8295 if (entry_type == CT_CLASS)
8296 {
8297 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8298 WPOOH_array.Insert(WPOF);
8299 }
8300 }
8301
8302
8304 }
8305 }
8306 }
8307
8309 {
8311 }
8312
8314 {
8316 {
8318
8321
8324
8325 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8326 }
8327 }
8328
8330 {
8332 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8333
8335 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8336
8338 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8339
8341 {
8343 }
8344 }
8345
8347 {
8349 }
8350
8352 {
8355 else
8357
8359 {
8362 }
8363 else
8364 {
8367
8370 }
8371
8373 }
8374
8376 {
8378 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8379 }
8380
8382 {
8384 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8386 }
8387
8389 {
8391 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8392 }
8393
8395 {
8398
8399 OverheatingParticle OP = new OverheatingParticle();
8404
8406 }
8407
8409 {
8412
8413 return -1;
8414 }
8415
8417 {
8419 {
8422
8423 for (int i = count; i > 0; --i)
8424 {
8425 int id = i - 1;
8428
8431
8432 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8433 {
8434 if (p)
8435 {
8438 }
8439 }
8440 }
8441 }
8442 }
8443
8445 {
8447 {
8449 {
8450 int id = i - 1;
8452
8453 if (OP)
8454 {
8456
8457 if (p)
8458 {
8460 }
8461
8462 delete OP;
8463 }
8464 }
8465
8468 }
8469 }
8470
8473 {
8474 return 0.0;
8475 }
8476
8477
8479 {
8480 return 250;
8481 }
8482
8484 {
8485 return 0;
8486 }
8487
8490 {
8492 return true;
8493
8494 return false;
8495 }
8496
8499 {
8502
8504 {
8506 }
8507 else
8508 {
8509
8511 }
8512
8514 }
8515
8522 {
8523 return -1;
8524 }
8525
8526
8527
8528
8530 {
8532 {
8534 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8535
8536 if (r_index >= 0)
8537 {
8538 InventoryLocation r_il = new InventoryLocation;
8539 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8540
8541 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8544 {
8545 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8546 }
8548 {
8549 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8550 }
8551
8552 }
8553
8554 player.GetHumanInventory().ClearUserReservedLocation(this);
8555 }
8556
8559 }
8560
8561
8562
8563
8565 {
8566 return ItemBase.m_DebugActionsMask;
8567 }
8568
8570 {
8571 return ItemBase.m_DebugActionsMask & mask;
8572 }
8573
8575 {
8576 ItemBase.m_DebugActionsMask = mask;
8577 }
8578
8580 {
8581 ItemBase.m_DebugActionsMask |= mask;
8582 }
8583
8585 {
8586 ItemBase.m_DebugActionsMask &= ~mask;
8587 }
8588
8590 {
8592 {
8594 }
8595 else
8596 {
8598 }
8599 }
8600
8601
8603 {
8604 if (GetEconomyProfile())
8605 {
8606 float q_max = GetEconomyProfile().GetQuantityMax();
8607 if (q_max > 0)
8608 {
8609 float q_min = GetEconomyProfile().GetQuantityMin();
8610 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8611
8613 {
8614 ComponentEnergyManager comp = GetCompEM();
8616 {
8618 }
8619 }
8621 {
8623
8624 }
8625
8626 }
8627 }
8628 }
8629
8632 {
8633 EntityAI parent = GetHierarchyParent();
8634
8635 if (parent)
8636 {
8637 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8638 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8639 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8640 }
8641 }
8642
8645 {
8646 EntityAI parent = GetHierarchyParent();
8647
8648 if (parent)
8649 {
8650 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8651 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8652 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8653 }
8654 }
8655
8657 {
8658
8659
8660
8661
8663
8665 {
8666 if (ScriptInputUserData.CanStoreInputUserData())
8667 {
8668 ScriptInputUserData ctx = new ScriptInputUserData;
8674 ctx.
Write(use_stack_max);
8677
8679 {
8680 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8681 }
8682 }
8683 }
8684 else if (!
GetGame().IsMultiplayer())
8685 {
8687 }
8688 }
8689
8691 {
8693 }
8694
8696 {
8698 }
8699
8701 {
8703 }
8704
8706 {
8707
8708 return false;
8709 }
8710
8712 {
8713 return false;
8714 }
8715
8719 {
8720 return false;
8721 }
8722
8724 {
8725 return "";
8726 }
8727
8729
8731 {
8732 return false;
8733 }
8734
8736 {
8737 return true;
8738 }
8739
8740
8741
8743 {
8744 return true;
8745 }
8746
8748 {
8749 return true;
8750 }
8751
8753 {
8754 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8756 }
8757
8759 {
8761 }
8762
8764 {
8766 if (!is_being_placed)
8768 SetSynchDirty();
8769 }
8770
8771
8773
8775 {
8777 }
8778
8780 {
8782 }
8783
8785 {
8786 return 1;
8787 }
8788
8790 {
8791 return false;
8792 }
8793
8795 {
8797 SetSynchDirty();
8798 }
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8835 {
8836 super.OnMovedInsideCargo(container);
8837
8838 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8839 }
8840
8841 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8842 {
8843 super.EEItemLocationChanged(oldLoc,newLoc);
8844
8845 PlayerBase new_player = null;
8846 PlayerBase old_player = null;
8847
8848 if (newLoc.GetParent())
8849 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8850
8851 if (oldLoc.GetParent())
8852 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8853
8855 {
8856 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8857
8858 if (r_index >= 0)
8859 {
8860 InventoryLocation r_il = new InventoryLocation;
8861 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8862
8863 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8866 {
8867 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8868 }
8870 {
8871 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8872 }
8873
8874 }
8875 }
8876
8878 {
8879 if (new_player)
8880 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8881
8882 if (new_player == old_player)
8883 {
8884
8885 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8886 {
8888 {
8889 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8890 {
8891 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8892 }
8893 }
8894 else
8895 {
8896 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8897 }
8898 }
8899
8900 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8901 {
8902 int type = oldLoc.GetType();
8904 {
8905 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8906 }
8908 {
8909 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8910 }
8911 }
8912 if (!m_OldLocation)
8913 {
8914 m_OldLocation = new InventoryLocation;
8915 }
8916 m_OldLocation.Copy(oldLoc);
8917 }
8918 else
8919 {
8920 if (m_OldLocation)
8921 {
8922 m_OldLocation.Reset();
8923 }
8924 }
8925
8927 }
8928 else
8929 {
8930 if (new_player)
8931 {
8932 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8933 if (res_index >= 0)
8934 {
8935 InventoryLocation il = new InventoryLocation;
8936 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8938 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8941 {
8942 il.
GetParent().GetOnReleaseLock().Invoke(it);
8943 }
8945 {
8947 }
8948
8949 }
8950 }
8952 {
8953
8955 }
8956
8957 if (m_OldLocation)
8958 {
8959 m_OldLocation.Reset();
8960 }
8961 }
8962 }
8963
8964 override void EOnContact(IEntity other, Contact extra)
8965 {
8967 {
8968 int liquidType = -1;
8970 if (impactSpeed > 0.0)
8971 {
8973 #ifndef SERVER
8975 #else
8977 SetSynchDirty();
8978 #endif
8980 }
8981 }
8982
8983 #ifdef SERVER
8984 if (GetCompEM() && GetCompEM().IsPlugged())
8985 {
8986 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8987 GetCompEM().UnplugThis();
8988 }
8989 #endif
8990 }
8991
8993
8995 {
8997 }
8998
9000 {
9001
9002 }
9003
9005 {
9006 super.OnItemLocationChanged(old_owner, new_owner);
9007
9008 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9009 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9010
9011 if (!relatedPlayer && playerNew)
9012 relatedPlayer = playerNew;
9013
9014 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9015 {
9017 if (actionMgr)
9018 {
9019 ActionBase currentAction = actionMgr.GetRunningAction();
9020 if (currentAction)
9022 }
9023 }
9024
9025 Man ownerPlayerOld = null;
9026 Man ownerPlayerNew = null;
9027
9028 if (old_owner)
9029 {
9030 if (old_owner.
IsMan())
9031 {
9032 ownerPlayerOld = Man.Cast(old_owner);
9033 }
9034 else
9035 {
9036 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9037 }
9038 }
9039 else
9040 {
9042 {
9044
9045 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9046 {
9047 GetCompEM().UnplugThis();
9048 }
9049 }
9050 }
9051
9052 if (new_owner)
9053 {
9054 if (new_owner.
IsMan())
9055 {
9056 ownerPlayerNew = Man.Cast(new_owner);
9057 }
9058 else
9059 {
9060 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9061 }
9062 }
9063
9064 if (ownerPlayerOld != ownerPlayerNew)
9065 {
9066 if (ownerPlayerOld)
9067 {
9068 array<EntityAI> subItemsExit = new array<EntityAI>;
9070 for (int i = 0; i < subItemsExit.Count(); i++)
9071 {
9074 }
9075 }
9076
9077 if (ownerPlayerNew)
9078 {
9079 array<EntityAI> subItemsEnter = new array<EntityAI>;
9081 for (int j = 0; j < subItemsEnter.Count(); j++)
9082 {
9085 }
9086 }
9087 }
9088 else if (ownerPlayerNew != null)
9089 {
9090 PlayerBase nplayer;
9091 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9092 {
9093 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9095 for (int k = 0; k < subItemsUpdate.Count(); k++)
9096 {
9098 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9099 }
9100 }
9101 }
9102
9103 if (old_owner)
9104 old_owner.OnChildItemRemoved(this);
9105 if (new_owner)
9106 new_owner.OnChildItemReceived(this);
9107 }
9108
9109
9111 {
9112 super.EEDelete(parent);
9113 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9114 if (player)
9115 {
9117
9118 if (player.IsAlive())
9119 {
9120 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9121 if (r_index >= 0)
9122 {
9123 InventoryLocation r_il = new InventoryLocation;
9124 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9125
9126 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9129 {
9130 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9131 }
9133 {
9134 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9135 }
9136
9137 }
9138
9139 player.RemoveQuickBarEntityShortcut(this);
9140 }
9141 }
9142 }
9143
9145 {
9146 super.EEKilled(killer);
9147
9150 {
9151 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9152 {
9153 if (IsMagazine())
9154 {
9155 if (Magazine.Cast(this).GetAmmoCount() > 0)
9156 {
9158 }
9159 }
9160 else
9161 {
9163 }
9164 }
9165 }
9166 }
9167
9169 {
9170 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9171
9172 super.OnWasAttached(parent, slot_id);
9173
9176
9178 }
9179
9181 {
9182 super.OnWasDetached(parent, slot_id);
9183
9186 }
9187
9189 {
9190 int idx;
9193
9194 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9195 if (inventory_slots.Count() < 1)
9196 {
9197 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9198 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9199 }
9200 else
9201 {
9202 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9203 }
9204
9205 idx = inventory_slots.Find(slot);
9206 if (idx < 0)
9207 return "";
9208
9209 return attach_types.Get(idx);
9210 }
9211
9213 {
9214 int idx = -1;
9215 string slot;
9216
9219
9220 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9221 if (inventory_slots.Count() < 1)
9222 {
9223 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9224 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9225 }
9226 else
9227 {
9228 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9229 if (detach_types.Count() < 1)
9230 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9231 }
9232
9233 for (int i = 0; i < inventory_slots.Count(); i++)
9234 {
9235 slot = inventory_slots.Get(i);
9236 }
9237
9238 if (slot != "")
9239 {
9240 if (detach_types.Count() == 1)
9241 idx = 0;
9242 else
9243 idx = inventory_slots.Find(slot);
9244 }
9245 if (idx < 0)
9246 return "";
9247
9248 return detach_types.Get(idx);
9249 }
9250
9252 {
9253
9255
9256
9257 float min_time = 1;
9258 float max_time = 3;
9259 float delay = Math.RandomFloat(min_time, max_time);
9260
9261 explode_timer.Run(delay, this, "DoAmmoExplosion");
9262 }
9263
9265 {
9266 Magazine magazine = Magazine.Cast(this);
9267 int pop_sounds_count = 6;
9268 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9269
9270
9271 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9272 string sound_name = pop_sounds[ sound_idx ];
9274
9275
9276 magazine.ServerAddAmmoCount(-1);
9277
9278
9279 float min_temp_to_explode = 100;
9280
9281 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9282 {
9284 }
9285 }
9286
9287
9288 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9289 {
9290 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9291
9292 const int CHANCE_DAMAGE_CARGO = 4;
9293 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9294 const int CHANCE_DAMAGE_NOTHING = 2;
9295
9297 {
9298 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9299 int chances;
9300 int rnd;
9301
9302 if (GetInventory().GetCargo())
9303 {
9304 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9305 rnd = Math.RandomInt(0,chances);
9306
9307 if (rnd < CHANCE_DAMAGE_CARGO)
9308 {
9310 }
9311 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9312 {
9314 }
9315 }
9316 else
9317 {
9318 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9319 rnd = Math.RandomInt(0,chances);
9320
9321 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9322 {
9324 }
9325 }
9326 }
9327 }
9328
9330 {
9331 if (GetInventory().GetCargo())
9332 {
9333 int item_count = GetInventory().GetCargo().GetItemCount();
9334 if (item_count > 0)
9335 {
9336 int random_pick = Math.RandomInt(0, item_count);
9338 if (!item.IsExplosive())
9339 {
9340 item.AddHealth("","",damage);
9341 return true;
9342 }
9343 }
9344 }
9345 return false;
9346 }
9347
9349 {
9350 int attachment_count = GetInventory().AttachmentCount();
9351 if (attachment_count > 0)
9352 {
9353 int random_pick = Math.RandomInt(0, attachment_count);
9354 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9355 if (!attachment.IsExplosive())
9356 {
9357 attachment.AddHealth("","",damage);
9358 return true;
9359 }
9360 }
9361 return false;
9362 }
9363
9365 {
9367 }
9368
9370 {
9372 return GetInventory().CanRemoveEntity();
9373
9374 return false;
9375 }
9376
9378 {
9380 return;
9381
9383 {
9384 if (ScriptInputUserData.CanStoreInputUserData())
9385 {
9386 ScriptInputUserData ctx = new ScriptInputUserData;
9391 ctx.
Write(destination_entity);
9395 }
9396 }
9397 else if (!
GetGame().IsMultiplayer())
9398 {
9400 }
9401 }
9402
9404 {
9406 return;
9407
9408 float split_quantity_new;
9412 InventoryLocation loc = new InventoryLocation;
9413
9414 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9415 {
9417 split_quantity_new = stack_max;
9418 else
9420
9421 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9422 if (new_item)
9423 {
9424 new_item.SetResultOfSplit(true);
9425 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9427 new_item.SetQuantity(split_quantity_new);
9428 }
9429 }
9430 else if (destination_entity && slot_id == -1)
9431 {
9432 if (quantity > stack_max)
9433 split_quantity_new = stack_max;
9434 else
9435 split_quantity_new = quantity;
9436
9438 {
9441 }
9442
9443 if (new_item)
9444 {
9445 new_item.SetResultOfSplit(true);
9446 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9448 new_item.SetQuantity(split_quantity_new);
9449 }
9450 }
9451 else
9452 {
9453 if (stack_max != 0)
9454 {
9456 {
9458 }
9459
9460 if (split_quantity_new == 0)
9461 {
9462 if (!
GetGame().IsMultiplayer())
9463 player.PhysicalPredictiveDropItem(this);
9464 else
9465 player.ServerDropEntity(this);
9466 return;
9467 }
9468
9470
9471 if (new_item)
9472 {
9473 new_item.SetResultOfSplit(true);
9474 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9476 new_item.SetQuantity(stack_max);
9477 new_item.PlaceOnSurface();
9478 }
9479 }
9480 }
9481 }
9482
9484 {
9486 return;
9487
9488 float split_quantity_new;
9492 InventoryLocation loc = new InventoryLocation;
9493
9494 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9495 {
9497 split_quantity_new = stack_max;
9498 else
9500
9501 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9502 if (new_item)
9503 {
9504 new_item.SetResultOfSplit(true);
9505 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9507 new_item.SetQuantity(split_quantity_new);
9508 }
9509 }
9510 else if (destination_entity && slot_id == -1)
9511 {
9512 if (quantity > stack_max)
9513 split_quantity_new = stack_max;
9514 else
9515 split_quantity_new = quantity;
9516
9518 {
9521 }
9522
9523 if (new_item)
9524 {
9525 new_item.SetResultOfSplit(true);
9526 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9528 new_item.SetQuantity(split_quantity_new);
9529 }
9530 }
9531 else
9532 {
9533 if (stack_max != 0)
9534 {
9536 {
9538 }
9539
9541
9542 if (new_item)
9543 {
9544 new_item.SetResultOfSplit(true);
9545 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9547 new_item.SetQuantity(stack_max);
9548 new_item.PlaceOnSurface();
9549 }
9550 }
9551 }
9552 }
9553
9555 {
9557 return;
9558
9560 {
9561 if (ScriptInputUserData.CanStoreInputUserData())
9562 {
9563 ScriptInputUserData ctx = new ScriptInputUserData;
9568 dst.WriteToContext(ctx);
9570 }
9571 }
9572 else if (!
GetGame().IsMultiplayer())
9573 {
9575 }
9576 }
9577
9579 {
9581 return;
9582
9584 {
9585 if (ScriptInputUserData.CanStoreInputUserData())
9586 {
9587 ScriptInputUserData ctx = new ScriptInputUserData;
9592 ctx.
Write(destination_entity);
9598 }
9599 }
9600 else if (!
GetGame().IsMultiplayer())
9601 {
9603 }
9604 }
9605
9607 {
9609 }
9610
9612 {
9614 return this;
9615
9617 float split_quantity_new;
9619 if (dst.IsValid())
9620 {
9621 int slot_id = dst.GetSlot();
9623
9624 if (quantity > stack_max)
9625 split_quantity_new = stack_max;
9626 else
9627 split_quantity_new = quantity;
9628
9630
9631 if (new_item)
9632 {
9633 new_item.SetResultOfSplit(true);
9634 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9637 }
9638
9639 return new_item;
9640 }
9641
9642 return null;
9643 }
9644
9646 {
9648 return;
9649
9651 float split_quantity_new;
9653 if (destination_entity)
9654 {
9656 if (quantity > stackable)
9657 split_quantity_new = stackable;
9658 else
9659 split_quantity_new = quantity;
9660
9661 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9662 if (new_item)
9663 {
9664 new_item.SetResultOfSplit(true);
9665 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9667 new_item.SetQuantity(split_quantity_new);
9668 }
9669 }
9670 }
9671
9673 {
9675 return;
9676
9678 {
9679 if (ScriptInputUserData.CanStoreInputUserData())
9680 {
9681 ScriptInputUserData ctx = new ScriptInputUserData;
9686 ItemBase destination_entity =
this;
9687 ctx.
Write(destination_entity);
9691 }
9692 }
9693 else if (!
GetGame().IsMultiplayer())
9694 {
9696 }
9697 }
9698
9700 {
9702 return;
9703
9705 float split_quantity_new;
9707 if (player)
9708 {
9710 if (quantity > stackable)
9711 split_quantity_new = stackable;
9712 else
9713 split_quantity_new = quantity;
9714
9715 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9716 new_item =
ItemBase.Cast(in_hands);
9717 if (new_item)
9718 {
9719 new_item.SetResultOfSplit(true);
9720 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9722 new_item.SetQuantity(split_quantity_new);
9723 }
9724 }
9725 }
9726
9728 {
9730 return;
9731
9733 float split_quantity_new = Math.Floor(quantity * 0.5);
9734
9736
9737 if (new_item)
9738 {
9739 if (new_item.GetQuantityMax() < split_quantity_new)
9740 {
9741 split_quantity_new = new_item.GetQuantityMax();
9742 }
9743
9744 new_item.SetResultOfSplit(true);
9745 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9746
9748 {
9751 }
9752 else
9753 {
9756 }
9757 }
9758 }
9759
9761 {
9763 return;
9764
9766 float split_quantity_new = Math.Floor(quantity / 2);
9767
9768 InventoryLocation invloc = new InventoryLocation;
9770
9772 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9773
9774 if (new_item)
9775 {
9776 if (new_item.GetQuantityMax() < split_quantity_new)
9777 {
9778 split_quantity_new = new_item.GetQuantityMax();
9779 }
9781 {
9784 }
9785 else
9786 {
9789 }
9790 }
9791 }
9792
9795 {
9796 SetWeightDirty();
9798
9799 if (parent)
9800 parent.OnAttachmentQuantityChangedEx(this, delta);
9801
9803 {
9805 {
9807 }
9809 {
9810 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9812 }
9813 }
9814
9815 }
9816
9819 {
9820
9821 }
9822
9825 {
9827 }
9828
9830 {
9831 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9832
9834 {
9835 if (newLevel == GameConstants.STATE_RUINED)
9836 {
9838 EntityAI parent = GetHierarchyParent();
9839 if (parent && parent.IsFireplace())
9840 {
9841 CargoBase cargo = GetInventory().GetCargo();
9842 if (cargo)
9843 {
9845 {
9847 }
9848 }
9849 }
9850 }
9851
9853 {
9854
9856 return;
9857 }
9858
9859 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9860 {
9862 }
9863 }
9864 }
9865
9866
9868 {
9869 super.OnRightClick();
9870
9872 {
9874 {
9875 if (ScriptInputUserData.CanStoreInputUserData())
9876 {
9877 vector m4[4];
9879
9880 EntityAI root = GetHierarchyRoot();
9881
9882 InventoryLocation dst = new InventoryLocation;
9884 {
9885 if (root)
9886 {
9887 root.GetTransform(m4);
9889 }
9890 else
9891 GetInventory().GetCurrentInventoryLocation(dst);
9892 }
9893 else
9894 {
9896
9897
9898 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9899 {
9900 if (root)
9901 {
9902 root.GetTransform(m4);
9904 }
9905 else
9906 GetInventory().GetCurrentInventoryLocation(dst);
9907 }
9908 else
9909 {
9910 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9911 }
9912 }
9913
9914 ScriptInputUserData ctx = new ScriptInputUserData;
9922 }
9923 }
9924 else if (!
GetGame().IsMultiplayer())
9925 {
9927 }
9928 }
9929 }
9930
9931 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9932 {
9933
9934 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9935 return false;
9936
9937 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9938 return false;
9939
9940
9942 return false;
9943
9944
9945 Magazine mag = Magazine.Cast(this);
9946 if (mag)
9947 {
9948 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9949 return false;
9950
9951 if (stack_max_limit)
9952 {
9953 Magazine other_mag = Magazine.Cast(other_item);
9954 if (other_item)
9955 {
9956 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9957 return false;
9958 }
9959
9960 }
9961 }
9962 else
9963 {
9964
9966 return false;
9967
9969 return false;
9970 }
9971
9972 PlayerBase player = null;
9973 if (CastTo(player, GetHierarchyRootPlayer()))
9974 {
9975 if (player.GetInventory().HasAttachment(this))
9976 return false;
9977
9978 if (player.IsItemsToDelete())
9979 return false;
9980 }
9981
9982 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9983 return false;
9984
9985 int slotID;
9987 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9988 return false;
9989
9990 return true;
9991 }
9992
9994 {
9996 }
9997
9999 {
10000 return m_IsResultOfSplit;
10001 }
10002
10004 {
10005 m_IsResultOfSplit = value;
10006 }
10007
10009 {
10011 }
10012
10014 {
10015 float other_item_quantity = other_item.GetQuantity();
10016 float this_free_space;
10017
10019
10021
10022 if (other_item_quantity > this_free_space)
10023 {
10024 return this_free_space;
10025 }
10026 else
10027 {
10028 return other_item_quantity;
10029 }
10030 }
10031
10033 {
10035 }
10036
10038 {
10040 return;
10041
10042 if (!IsMagazine() && other_item)
10043 {
10045 if (quantity_used != 0)
10046 {
10047 float hp1 = GetHealth01("","");
10048 float hp2 = other_item.GetHealth01("","");
10049 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10050 hpResult = hpResult / (
GetQuantity() + quantity_used);
10051
10052 hpResult *= GetMaxHealth();
10053 Math.Round(hpResult);
10054 SetHealth("", "Health", hpResult);
10055
10057 other_item.AddQuantity(-quantity_used);
10058 }
10059 }
10061 }
10062
10064 {
10065 #ifdef SERVER
10066 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10067 GetHierarchyParent().IncreaseLifetimeUp();
10068 #endif
10069 };
10070
10072 {
10073 PlayerBase p = PlayerBase.Cast(player);
10074
10075 array<int> recipesIds = p.m_Recipes;
10076 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10077 if (moduleRecipesManager)
10078 {
10079 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10080 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10081 }
10082
10083 for (int i = 0;i < recipesIds.Count(); i++)
10084 {
10085 int key = recipesIds.Get(i);
10086 string recipeName = moduleRecipesManager.GetRecipeName(key);
10088 }
10089 }
10090
10091
10092 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10093 {
10094 super.GetDebugActions(outputList);
10095
10096
10101
10102
10106
10110
10111
10114
10115
10117 {
10120 }
10121
10123
10126
10130 }
10131
10132
10133
10134
10136 {
10137 super.OnAction(action_id, player, ctx);
10138 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10139 {
10140 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10141 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10142 PlayerBase p = PlayerBase.Cast(player);
10143 if (
EActions.RECIPES_RANGE_START < 1000)
10144 {
10145 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10146 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10147 }
10148 }
10149 #ifndef SERVER
10150 else if (action_id ==
EActions.WATCH_PLAYER)
10151 {
10152 PluginDeveloper.SetDeveloperItemClientEx(player);
10153 }
10154 #endif
10156 {
10157 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10158 {
10159 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10160 OnDebugButtonPressServer(id + 1);
10161 }
10162
10163 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10164 {
10165 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10167 }
10168
10169 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10170 {
10171 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10173 }
10174
10175 else if (action_id ==
EActions.ADD_QUANTITY)
10176 {
10177 if (IsMagazine())
10178 {
10179 Magazine mag = Magazine.Cast(this);
10180 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10181 }
10182 else
10183 {
10185 }
10186
10187 if (m_EM)
10188 {
10189 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10190 }
10191
10192 }
10193
10194 else if (action_id ==
EActions.REMOVE_QUANTITY)
10195 {
10196 if (IsMagazine())
10197 {
10198 Magazine mag2 = Magazine.Cast(this);
10199 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10200 }
10201 else
10202 {
10204 }
10205 if (m_EM)
10206 {
10207 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10208 }
10209
10210 }
10211
10212 else if (action_id ==
EActions.SET_QUANTITY_0)
10213 {
10215
10216 if (m_EM)
10217 {
10218 m_EM.SetEnergy(0);
10219 }
10220 }
10221
10222 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10223 {
10225
10226 if (m_EM)
10227 {
10228 m_EM.SetEnergy(m_EM.GetEnergyMax());
10229 }
10230 }
10231
10232 else if (action_id ==
EActions.ADD_HEALTH)
10233 {
10234 AddHealth("","",GetMaxHealth("","Health")/5);
10235 }
10236 else if (action_id ==
EActions.REMOVE_HEALTH)
10237 {
10238 AddHealth("","",-GetMaxHealth("","Health")/5);
10239 }
10240 else if (action_id ==
EActions.DESTROY_HEALTH)
10241 {
10242 SetHealth01("","",0);
10243 }
10244 else if (action_id ==
EActions.WATCH_ITEM)
10245 {
10247 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10248 #ifdef DEVELOPER
10249 SetDebugDeveloper_item(this);
10250 #endif
10251 }
10252
10253 else if (action_id ==
EActions.ADD_TEMPERATURE)
10254 {
10255 AddTemperature(20);
10256
10257 }
10258
10259 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10260 {
10261 AddTemperature(-20);
10262
10263 }
10264
10265 else if (action_id ==
EActions.FLIP_FROZEN)
10266 {
10267 SetFrozen(!GetIsFrozen());
10268
10269 }
10270
10271 else if (action_id ==
EActions.ADD_WETNESS)
10272 {
10274
10275 }
10276
10277 else if (action_id ==
EActions.REMOVE_WETNESS)
10278 {
10280
10281 }
10282
10283 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10284 {
10287
10288
10289 }
10290
10291 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10292 {
10295 }
10296
10297 else if (action_id ==
EActions.MAKE_SPECIAL)
10298 {
10299 auto debugParams = DebugSpawnParams.WithPlayer(player);
10300 OnDebugSpawnEx(debugParams);
10301 }
10302
10303 else if (action_id ==
EActions.DELETE)
10304 {
10305 Delete();
10306 }
10307
10308 }
10309
10310
10311 return false;
10312 }
10313
10314
10315
10316
10320
10323
10324
10325
10327 {
10328 return false;
10329 }
10330
10331
10333 {
10334 return true;
10335 }
10336
10337
10339 {
10340 return true;
10341 }
10342
10343
10344
10346 {
10347 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10349 }
10350
10353 {
10354 return null;
10355 }
10356
10358 {
10359 return false;
10360 }
10361
10363 {
10364 return false;
10365 }
10366
10370
10371
10373 {
10374 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10375 return module_repairing.CanRepair(this, item_repair_kit);
10376 }
10377
10378
10379 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10380 {
10381 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10382 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10383 }
10384
10385
10387 {
10388
10389
10390
10391
10392
10393
10394
10395
10396 return 1;
10397 }
10398
10399
10400
10402 {
10404 }
10405
10406
10407
10409 {
10411 }
10412
10413
10422 {
10423 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10424
10425 if (player)
10426 {
10427 player.MessageStatus(text);
10428 }
10429 }
10430
10431
10440 {
10441 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10442
10443 if (player)
10444 {
10445 player.MessageAction(text);
10446 }
10447 }
10448
10449
10458 {
10459 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10460
10461 if (player)
10462 {
10463 player.MessageFriendly(text);
10464 }
10465 }
10466
10467
10476 {
10477 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10478
10479 if (player)
10480 {
10481 player.MessageImportant(text);
10482 }
10483 }
10484
10486 {
10487 return true;
10488 }
10489
10490
10491 override bool KindOf(
string tag)
10492 {
10493 bool found = false;
10494 string item_name = this.
GetType();
10497
10498 int array_size = item_tag_array.Count();
10499 for (int i = 0; i < array_size; i++)
10500 {
10501 if (item_tag_array.Get(i) == tag)
10502 {
10503 found = true;
10504 break;
10505 }
10506 }
10507 return found;
10508 }
10509
10510
10512 {
10513
10514 super.OnRPC(sender, rpc_type,ctx);
10515
10516
10517 switch (rpc_type)
10518 {
10519 #ifndef SERVER
10520 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10521 Param2<bool, string> p = new Param2<bool, string>(false, "");
10522
10524 return;
10525
10526 bool play = p.param1;
10527 string soundSet = p.param2;
10528
10529 if (play)
10530 {
10532 {
10534 {
10536 }
10537 }
10538 else
10539 {
10541 }
10542 }
10543 else
10544 {
10546 }
10547
10548 break;
10549 #endif
10550
10551 }
10552
10554 {
10556 }
10557 }
10558
10559
10560
10561
10563 {
10564 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10565 return plugin.GetID(
name);
10566 }
10567
10569 {
10570 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10571 return plugin.GetName(id);
10572 }
10573
10576 {
10577
10578
10579 int varFlags;
10580 if (!ctx.
Read(varFlags))
10581 return;
10582
10583 if (varFlags & ItemVariableFlags.FLOAT)
10584 {
10586 }
10587 }
10588
10590 {
10591
10592 super.SerializeNumericalVars(floats_out);
10593
10594
10595
10597 {
10599 }
10600
10602 {
10604 }
10605
10607 {
10609 }
10610
10612 {
10617 }
10618
10620 {
10622 }
10623 }
10624
10626 {
10627
10628 super.DeSerializeNumericalVars(floats);
10629
10630
10631 int index = 0;
10632 int mask = Math.Round(floats.Get(index));
10633
10634 index++;
10635
10637 {
10639 {
10641 }
10642 else
10643 {
10644 float quantity = floats.Get(index);
10645 SetQuantity(quantity,
true,
false,
false,
false);
10646 }
10647 index++;
10648 }
10649
10651 {
10652 float wet = floats.Get(index);
10654 index++;
10655 }
10656
10658 {
10659 int liquidtype = Math.Round(floats.Get(index));
10661 index++;
10662 }
10663
10665 {
10667 index++;
10669 index++;
10671 index++;
10673 index++;
10674 }
10675
10677 {
10678 int cleanness = Math.Round(floats.Get(index));
10680 index++;
10681 }
10682 }
10683
10685 {
10686 super.WriteVarsToCTX(ctx);
10687
10688
10690 {
10692 }
10693
10695 {
10697 }
10698
10700 {
10702 }
10703
10705 {
10706 int r,g,b,a;
10712 }
10713
10715 {
10717 }
10718 }
10719
10721 {
10722 if (!super.ReadVarsFromCTX(ctx,version))
10723 return false;
10724
10725 int intValue;
10726 float value;
10727
10728 if (version < 140)
10729 {
10730 if (!ctx.
Read(intValue))
10731 return false;
10732
10733 m_VariablesMask = intValue;
10734 }
10735
10737 {
10738 if (!ctx.
Read(value))
10739 return false;
10740
10742 {
10744 }
10745 else
10746 {
10748 }
10749 }
10750
10751 if (version < 140)
10752 {
10754 {
10755 if (!ctx.
Read(value))
10756 return false;
10757 SetTemperatureDirect(value);
10758 }
10759 }
10760
10762 {
10763 if (!ctx.
Read(value))
10764 return false;
10766 }
10767
10769 {
10770 if (!ctx.
Read(intValue))
10771 return false;
10773 }
10774
10776 {
10777 int r,g,b,a;
10779 return false;
10781 return false;
10783 return false;
10785 return false;
10786
10788 }
10789
10791 {
10792 if (!ctx.
Read(intValue))
10793 return false;
10795 }
10796
10797 if (version >= 138 && version < 140)
10798 {
10800 {
10801 if (!ctx.
Read(intValue))
10802 return false;
10803 SetFrozen(intValue);
10804 }
10805 }
10806
10807 return true;
10808 }
10809
10810
10812 {
10815 {
10817 }
10818
10819 if (!super.OnStoreLoad(ctx, version))
10820 {
10822 return false;
10823 }
10824
10825 if (version >= 114)
10826 {
10827 bool hasQuickBarIndexSaved;
10828
10829 if (!ctx.
Read(hasQuickBarIndexSaved))
10830 {
10832 return false;
10833 }
10834
10835 if (hasQuickBarIndexSaved)
10836 {
10837 int itmQBIndex;
10838
10839
10840 if (!ctx.
Read(itmQBIndex))
10841 {
10843 return false;
10844 }
10845
10846 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10847 if (itmQBIndex != -1 && parentPlayer)
10848 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10849 }
10850 }
10851 else
10852 {
10853
10854 PlayerBase player;
10855 int itemQBIndex;
10856 if (version ==
int.
MAX)
10857 {
10858 if (!ctx.
Read(itemQBIndex))
10859 {
10861 return false;
10862 }
10863 }
10864 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10865 {
10866
10867 if (!ctx.
Read(itemQBIndex))
10868 {
10870 return false;
10871 }
10872 if (itemQBIndex != -1 && player)
10873 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10874 }
10875 }
10876
10877 if (version < 140)
10878 {
10879
10880 if (!LoadVariables(ctx, version))
10881 {
10883 return false;
10884 }
10885 }
10886
10887
10889 {
10891 return false;
10892 }
10893 if (version >= 132)
10894 {
10896 if (raib)
10897 {
10899 {
10901 return false;
10902 }
10903 }
10904 }
10905
10907 return true;
10908 }
10909
10910
10911
10913 {
10914 super.OnStoreSave(ctx);
10915
10916 PlayerBase player;
10917 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10918 {
10920
10921 int itemQBIndex = -1;
10922 itemQBIndex = player.FindQuickBarEntityIndex(this);
10923 ctx.
Write(itemQBIndex);
10924 }
10925 else
10926 {
10928 }
10929
10931
10933 if (raib)
10934 {
10936 }
10937 }
10938
10939
10941 {
10942 super.AfterStoreLoad();
10943
10945 {
10947 }
10948
10950 {
10953 }
10954 }
10955
10957 {
10958 super.EEOnAfterLoad();
10959
10961 {
10963 }
10964
10967 }
10968
10970 {
10971 return false;
10972 }
10973
10974
10975
10977 {
10979 {
10980 #ifdef PLATFORM_CONSOLE
10981
10983 {
10985 if (menu)
10986 {
10988 }
10989 }
10990 #endif
10991 }
10992
10994 {
10997 }
10998
11000 {
11001 SetWeightDirty();
11003 }
11005 {
11008 }
11009
11011 {
11014 }
11016 {
11019 }
11020
11021 super.OnVariablesSynchronized();
11022 }
11023
11024
11025
11027 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11028 {
11029 if (!IsServerCheck(allow_client))
11030 return false;
11031
11033 return false;
11034
11037
11038 if (value <= (min + 0.001))
11039 value = min;
11040
11041 if (value == min)
11042 {
11043 if (destroy_config)
11044 {
11045 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11046 if (dstr)
11047 {
11049 this.Delete();
11050 return true;
11051 }
11052 }
11053 else if (destroy_forced)
11054 {
11056 this.Delete();
11057 return true;
11058 }
11059
11061 }
11062
11065
11067 {
11069
11070 if (delta)
11072 }
11073
11075
11076 return false;
11077 }
11078
11079
11081 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11082 {
11084 }
11085
11087 {
11090 }
11091
11093 {
11096 }
11097
11100 {
11101 float value_clamped = Math.Clamp(value, 0, 1);
11103 SetQuantity(result, destroy_config, destroy_forced);
11104 }
11105
11106
11109 {
11111 }
11112
11114 {
11116 }
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11128 {
11129 int slot = -1;
11130 if (GetInventory())
11131 {
11132 InventoryLocation il = new InventoryLocation;
11133 GetInventory().GetCurrentInventoryLocation(il);
11135 }
11136
11138 }
11139
11141 {
11142 float quantity_max = 0;
11143
11145 {
11146 if (attSlotID != -1)
11147 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11148
11149 if (quantity_max <= 0)
11151 }
11152
11153 if (quantity_max <= 0)
11155
11156 return quantity_max;
11157 }
11158
11160 {
11162 }
11163
11165 {
11167 }
11168
11169
11171 {
11173 }
11174
11176 {
11178 }
11179
11181 {
11183 }
11184
11185
11187 {
11188
11189 float weightEx = GetWeightEx();
11190 float special = GetInventoryAndCargoWeight();
11191 return weightEx - special;
11192 }
11193
11194
11196 {
11198 }
11199
11201 {
11203 {
11204 #ifdef DEVELOPER
11205 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11206 {
11207 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11209 }
11210 #endif
11211
11212 return GetQuantity() * GetConfigWeightModified();
11213 }
11214 else if (HasEnergyManager())
11215 {
11216 #ifdef DEVELOPER
11217 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11218 {
11219 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11220 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11221 }
11222 #endif
11223 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11224 }
11225 else
11226 {
11227 #ifdef DEVELOPER
11228 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11229 {
11230 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11231 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11232 }
11233 #endif
11234 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11235 }
11236 }
11237
11240 {
11241 int item_count = 0;
11243
11244 if (GetInventory().GetCargo() != NULL)
11245 {
11246 item_count = GetInventory().GetCargo().GetItemCount();
11247 }
11248
11249 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11250 {
11251 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11252 if (item)
11253 item_count += item.GetNumberOfItems();
11254 }
11255 return item_count;
11256 }
11257
11260 {
11261 float weight = 0;
11262 float wetness = 1;
11263 if (include_wetness)
11266 {
11267 weight = wetness * m_ConfigWeight;
11268 }
11270 {
11271 weight = 1;
11272 }
11273 return weight;
11274 }
11275
11276
11277
11279 {
11280 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11281 {
11282 GameInventory inv = GetInventory();
11283 array<EntityAI> items = new array<EntityAI>;
11285 for (int i = 0; i < items.Count(); i++)
11286 {
11288 if (item)
11289 {
11291 }
11292 }
11293 }
11294 }
11295
11296
11297
11298
11300 {
11301 float energy = 0;
11302 if (HasEnergyManager())
11303 {
11304 energy = GetCompEM().GetEnergy();
11305 }
11306 return energy;
11307 }
11308
11309
11311 {
11312 super.OnEnergyConsumed();
11313
11315 }
11316
11318 {
11319 super.OnEnergyAdded();
11320
11322 }
11323
11324
11326 {
11327 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11328 {
11330 {
11331 float energy_0to1 = GetCompEM().GetEnergy0To1();
11333 }
11334 }
11335 }
11336
11337
11339 {
11340 return ConfigGetFloat("heatIsolation");
11341 }
11342
11344 {
11346 }
11347
11349 {
11350 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11351 if (
GetGame().ConfigIsExisting(paramPath))
11353
11354 return 0.0;
11355 }
11356
11358 {
11359 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11360 if (
GetGame().ConfigIsExisting(paramPath))
11362
11363 return 0.0;
11364 }
11365
11366 override void SetWet(
float value,
bool allow_client =
false)
11367 {
11368 if (!IsServerCheck(allow_client))
11369 return;
11370
11373
11375
11376 m_VarWet = Math.Clamp(value, min, max);
11377
11379 {
11382 }
11383 }
11384
11385 override void AddWet(
float value)
11386 {
11388 }
11389
11391 {
11393 }
11394
11396 {
11398 }
11399
11401 {
11403 }
11404
11406 {
11408 }
11409
11411 {
11413 }
11414
11415 override void OnWetChanged(
float newVal,
float oldVal)
11416 {
11419 if (newLevel != oldLevel)
11420 {
11422 }
11423 }
11424
11426 {
11427 SetWeightDirty();
11428 }
11429
11431 {
11432 return GetWetLevelInternal(
m_VarWet);
11433 }
11434
11435
11436
11438 {
11440 }
11441
11443 {
11445 }
11446
11448 {
11450 }
11451
11453 {
11455 }
11456
11457
11458
11460 {
11461 if (ConfigIsExisting("itemModelLength"))
11462 {
11463 return ConfigGetFloat("itemModelLength");
11464 }
11465 return 0;
11466 }
11467
11469 {
11470 if (ConfigIsExisting("itemAttachOffset"))
11471 {
11472 return ConfigGetFloat("itemAttachOffset");
11473 }
11474 return 0;
11475 }
11476
11477 override void SetCleanness(
int value,
bool allow_client =
false)
11478 {
11479 if (!IsServerCheck(allow_client))
11480 return;
11481
11483
11485
11488 }
11489
11491 {
11493 }
11494
11496 {
11497 return true;
11498 }
11499
11500
11501
11502
11504 {
11506 }
11507
11509 {
11511 }
11512
11513
11514
11515
11516 override void SetColor(
int r,
int g,
int b,
int a)
11517 {
11523 }
11525 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11526 {
11531 }
11532
11534 {
11536 }
11537
11540 {
11541 int r,g,b,a;
11543 r = r/255;
11544 g = g/255;
11545 b = b/255;
11546 a = a/255;
11547 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11548 }
11549
11550
11551
11552 override void SetLiquidType(
int value,
bool allow_client =
false)
11553 {
11554 if (!IsServerCheck(allow_client))
11555 return;
11556
11561 }
11562
11564 {
11565 return ConfigGetInt("varLiquidTypeInit");
11566 }
11567
11569 {
11571 }
11572
11574 {
11576 SetFrozen(false);
11577 }
11578
11581 {
11582 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11583 }
11584
11585
11588 {
11589 PlayerBase nplayer;
11590 if (PlayerBase.CastTo(nplayer, player))
11591 {
11593
11594 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11595 }
11596 }
11597
11598
11601 {
11602 PlayerBase nplayer;
11603 if (PlayerBase.CastTo(nplayer,player))
11604 {
11605
11606 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11607
11608 }
11609
11610
11611 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11612
11613
11614 if (HasEnergyManager())
11615 {
11616 GetCompEM().UpdatePlugState();
11617 }
11618 }
11619
11620
11622 {
11623 super.OnPlacementStarted(player);
11624
11626 }
11627
11628 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11629 {
11631 {
11632 m_AdminLog.OnPlacementComplete(player,
this);
11633 }
11634
11635 super.OnPlacementComplete(player, position, orientation);
11636 }
11637
11638
11639
11640
11641
11643 {
11645 {
11646 return true;
11647 }
11648 else
11649 {
11650 return false;
11651 }
11652 }
11653
11654
11656 {
11658 {
11660 }
11661 }
11662
11663
11665 {
11667 }
11668
11670 {
11672 }
11673
11674 override void InsertAgent(
int agent,
float count = 1)
11675 {
11676 if (count < 1)
11677 return;
11678
11680 }
11681
11684 {
11686 }
11687
11688
11690 {
11692 }
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11736 {
11738 return false;
11739 return true;
11740 }
11741
11743 {
11744
11746 }
11747
11748
11751 {
11752 super.CheckForRoofLimited(timeTresholdMS);
11753
11755 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11756 {
11757 m_PreviousRoofTestTime = time;
11758 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11759 }
11760 }
11761
11762
11764 {
11766 {
11767 return 0;
11768 }
11769
11770 if (GetInventory().GetAttachmentSlotsCount() != 0)
11771 {
11772 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11773 if (filter)
11774 return filter.GetProtectionLevel(type, false, system);
11775 else
11776 return 0;
11777 }
11778
11779 string subclassPath, entryName;
11780
11781 switch (type)
11782 {
11784 entryName = "biological";
11785 break;
11787 entryName = "chemical";
11788 break;
11789 default:
11790 entryName = "biological";
11791 break;
11792 }
11793
11794 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11795
11797 }
11798
11799
11800
11803 {
11804 if (!IsMagazine())
11806
11808 }
11809
11810
11811
11812
11813
11818 {
11819 return true;
11820 }
11821
11823 {
11825 }
11826
11827
11828
11829
11830
11832 {
11833 if (parent)
11834 {
11835 if (parent.IsInherited(DayZInfected))
11836 return true;
11837
11838 if (!parent.IsRuined())
11839 return true;
11840 }
11841
11842 return true;
11843 }
11844
11846 {
11847 if (!super.CanPutAsAttachment(parent))
11848 {
11849 return false;
11850 }
11851
11852 if (!IsRuined() && !parent.IsRuined())
11853 {
11854 return true;
11855 }
11856
11857 return false;
11858 }
11859
11861 {
11862
11863
11864
11865
11866 return super.CanReceiveItemIntoCargo(item);
11867 }
11868
11870 {
11871
11872
11873
11874
11875 GameInventory attachmentInv = attachment.GetInventory();
11877 {
11878 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11879 return false;
11880 }
11881
11882 InventoryLocation loc = new InventoryLocation();
11883 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11884 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11885 return false;
11886
11887 return super.CanReceiveAttachment(attachment, slotId);
11888 }
11889
11891 {
11892 if (!super.CanReleaseAttachment(attachment))
11893 return false;
11894
11895 return GetInventory().AreChildrenAccessible();
11896 }
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11919 {
11920 int id = muzzle_owner.GetMuzzleID();
11921 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11922
11923 if (WPOF_array)
11924 {
11925 for (int i = 0; i < WPOF_array.Count(); i++)
11926 {
11927 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11928
11929 if (WPOF)
11930 {
11931 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11932 }
11933 }
11934 }
11935 }
11936
11937
11939 {
11940 int id = muzzle_owner.GetMuzzleID();
11942
11943 if (WPOBE_array)
11944 {
11945 for (int i = 0; i < WPOBE_array.Count(); i++)
11946 {
11947 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11948
11949 if (WPOBE)
11950 {
11951 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11952 }
11953 }
11954 }
11955 }
11956
11957
11959 {
11960 int id = muzzle_owner.GetMuzzleID();
11961 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11962
11963 if (WPOOH_array)
11964 {
11965 for (int i = 0; i < WPOOH_array.Count(); i++)
11966 {
11967 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11968
11969 if (WPOOH)
11970 {
11971 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11972 }
11973 }
11974 }
11975 }
11976
11977
11979 {
11980 int id = muzzle_owner.GetMuzzleID();
11981 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11982
11983 if (WPOOH_array)
11984 {
11985 for (int i = 0; i < WPOOH_array.Count(); i++)
11986 {
11987 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11988
11989 if (WPOOH)
11990 {
11991 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11992 }
11993 }
11994 }
11995 }
11996
11997
11999 {
12000 int id = muzzle_owner.GetMuzzleID();
12001 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12002
12003 if (WPOOH_array)
12004 {
12005 for (int i = 0; i < WPOOH_array.Count(); i++)
12006 {
12007 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12008
12009 if (WPOOH)
12010 {
12011 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12012 }
12013 }
12014 }
12015 }
12016
12017
12018
12020 {
12022 {
12023 return true;
12024 }
12025
12026 return false;
12027 }
12028
12030 {
12032 {
12033 return true;
12034 }
12035
12036 return false;
12037 }
12038
12040 {
12042 {
12043 return true;
12044 }
12045
12046 return false;
12047 }
12048
12050 {
12051 return false;
12052 }
12053
12056 {
12057 return UATimeSpent.DEFAULT_DEPLOY;
12058 }
12059
12060
12061
12062
12064 {
12066 SetSynchDirty();
12067 }
12068
12070 {
12072 }
12073
12074
12076 {
12077 return false;
12078 }
12079
12082 {
12083 string att_type = "None";
12084
12085 if (ConfigIsExisting("soundAttType"))
12086 {
12087 att_type = ConfigGetString("soundAttType");
12088 }
12089
12091 }
12092
12094 {
12096 }
12097
12098
12099
12100
12101
12105
12107 {
12110
12112 }
12113
12114
12116 {
12118 return;
12119
12121
12124
12127
12128 SoundParameters params = new SoundParameters();
12132 }
12133
12134
12136 {
12138 return;
12139
12141 SetSynchDirty();
12142
12145 }
12146
12147
12149 {
12151 return;
12152
12154 SetSynchDirty();
12155
12158 }
12159
12161 {
12163 }
12164
12166 {
12168 }
12169
12172 {
12173 if (!
GetGame().IsDedicatedServer())
12174 {
12175 if (ConfigIsExisting("attachSoundSet"))
12176 {
12177 string cfg_path = "";
12178 string soundset = "";
12179 string type_name =
GetType();
12180
12183 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12184 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12185
12186 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12187 {
12188 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12189 {
12190 if (cfg_slot_array[i] == slot_type)
12191 {
12192 soundset = cfg_soundset_array[i];
12193 break;
12194 }
12195 }
12196 }
12197
12198 if (soundset != "")
12199 {
12200 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12202 }
12203 }
12204 }
12205 }
12206
12208 {
12209
12210 }
12211
12212 void OnApply(PlayerBase player);
12213
12215 {
12216 return 1.0;
12217 };
12218
12220 {
12222 }
12223
12225 {
12227 }
12228
12230
12232 {
12233 SetDynamicPhysicsLifeTime(0.01);
12235 }
12236
12238 {
12239 array<string> zone_names = new array<string>;
12240 GetDamageZones(zone_names);
12241 for (int i = 0; i < zone_names.Count(); i++)
12242 {
12243 SetHealthMax(zone_names.Get(i),"Health");
12244 }
12245 SetHealthMax("","Health");
12246 }
12247
12250 {
12251 float global_health = GetHealth01("","Health");
12252 array<string> zones = new array<string>;
12253 GetDamageZones(zones);
12254
12255 for (int i = 0; i < zones.Count(); i++)
12256 {
12257 SetHealth01(zones.Get(i),"Health",global_health);
12258 }
12259 }
12260
12263 {
12264 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12265 }
12266
12268 {
12269 if (!hasRootAsPlayer)
12270 {
12271 if (refParentIB)
12272 {
12273
12274 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12275 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12276
12277 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12278 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12279
12282 }
12283 else
12284 {
12285
12288 }
12289 }
12290 }
12291
12293 {
12295 {
12296 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12297 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12298 {
12299 float heatPermCoef = 1.0;
12301 while (ent)
12302 {
12303 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12304 ent = ent.GetHierarchyParent();
12305 }
12306
12307 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12308 }
12309 }
12310 }
12311
12313 {
12314
12315 EntityAI parent = GetHierarchyParent();
12316 if (!parent)
12317 {
12318 hasParent = false;
12319 hasRootAsPlayer = false;
12320 }
12321 else
12322 {
12323 hasParent = true;
12324 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12325 refParentIB =
ItemBase.Cast(parent);
12326 }
12327 }
12328
12329 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12330 {
12331
12332 }
12333
12335 {
12336
12337 return false;
12338 }
12339
12341 {
12342
12343
12344 return false;
12345 }
12346
12348 {
12349
12350 return false;
12351 }
12352
12355 {
12356 return !GetIsFrozen() &&
IsOpen();
12357 }
12358
12360 {
12361 bool hasParent = false, hasRootAsPlayer = false;
12363
12364 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12365 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12366
12367 if (wwtu || foodDecay)
12368 {
12372
12373 if (processWetness || processTemperature || processDecay)
12374 {
12376
12377 if (processWetness)
12378 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12379
12380 if (processTemperature)
12382
12383 if (processDecay)
12384 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12385 }
12386 }
12387 }
12388
12391 {
12393 }
12394
12396 {
12399
12400 return super.GetTemperatureFreezeThreshold();
12401 }
12402
12404 {
12407
12408 return super.GetTemperatureThawThreshold();
12409 }
12410
12412 {
12415
12416 return super.GetItemOverheatThreshold();
12417 }
12418
12420 {
12422 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12423
12424 return super.GetTemperatureFreezeTime();
12425 }
12426
12428 {
12430 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12431
12432 return super.GetTemperatureThawTime();
12433 }
12434
12439
12441 {
12442 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12443 }
12444
12446 {
12447 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12448 }
12449
12452 {
12454 }
12455
12457 {
12459 }
12460
12462 {
12464 }
12465
12468 {
12469 return null;
12470 }
12471
12474 {
12475 return false;
12476 }
12477
12479 {
12481 {
12484 if (!trg)
12485 {
12487 explosive = this;
12488 }
12489
12490 explosive.PairRemote(trg);
12492
12493 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12494 trg.SetPersistentPairID(persistentID);
12495 explosive.SetPersistentPairID(persistentID);
12496
12497 return true;
12498 }
12499 return false;
12500 }
12501
12504 {
12505 float ret = 1.0;
12508 ret *= GetHealth01();
12509
12510 return ret;
12511 }
12512
12513 #ifdef DEVELOPER
12514 override void SetDebugItem()
12515 {
12516 super.SetDebugItem();
12517 _itemBase = this;
12518 }
12519
12521 {
12522 string text = super.GetDebugText();
12523
12525 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12526
12527 return text;
12528 }
12529 #endif
12530
12532 {
12533 return true;
12534 }
12535
12537
12539
12541 {
12544 }
12545
12546
12554
12570}
12571
12573{
12575 if (entity)
12576 {
12577 bool is_item = entity.IsInherited(
ItemBase);
12578 if (is_item && full_quantity)
12579 {
12582 }
12583 }
12584 else
12585 {
12587 return NULL;
12588 }
12589 return entity;
12590}
12591
12593{
12594 if (item)
12595 {
12596 if (health > 0)
12597 item.SetHealth("", "", health);
12598
12599 if (item.CanHaveTemperature())
12600 {
12602 if (item.CanFreeze())
12603 item.SetFrozen(false);
12604 }
12605
12606 if (item.HasEnergyManager())
12607 {
12608 if (quantity >= 0)
12609 {
12610 item.GetCompEM().SetEnergy0To1(quantity);
12611 }
12612 else
12613 {
12615 }
12616 }
12617 else if (item.IsMagazine())
12618 {
12619 Magazine mag = Magazine.Cast(item);
12620 if (quantity >= 0)
12621 {
12622 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12623 }
12624 else
12625 {
12627 }
12628
12629 }
12630 else
12631 {
12632 if (quantity >= 0)
12633 {
12634 item.SetQuantityNormalized(quantity, false);
12635 }
12636 else
12637 {
12639 }
12640
12641 }
12642 }
12643}
12644
12645#ifdef DEVELOPER
12647#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.