7750{
7752 {
7753 return true;
7754 }
7755};
7756
7757
7758
7760{
7764
7766
7769
7770
7771
7772
7773
7782
7788
7793
7798
7819 protected bool m_IsResultOfSplit
7820
7822
7827
7828
7829
7831
7835
7836
7837
7839
7842
7843
7844
7850
7851
7859
7862
7863
7865
7866
7868
7869
7874
7875
7880
7881
7883
7884
7886 {
7891
7892 if (!
GetGame().IsDedicatedServer())
7893 {
7895 {
7897
7899 {
7901 }
7902 }
7903
7906 }
7907
7908 m_OldLocation = null;
7909
7911 {
7913 }
7914
7915 if (ConfigIsExisting("headSelectionsToHide"))
7916 {
7919 }
7920
7922 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7923 {
7925 }
7926
7928
7929 m_IsResultOfSplit = false;
7930
7932 }
7933
7935 {
7936 super.InitItemVariables();
7937
7943 m_Count = ConfigGetInt(
"count");
7944
7947
7952
7955
7960
7972
7976
7977
7980 if (ConfigIsExisting("canBeSplit"))
7981 {
7984 }
7985
7987 if (ConfigIsExisting("itemBehaviour"))
7989
7990
7993 RegisterNetSyncVariableInt("m_VarLiquidType");
7994 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7995
7996 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7997 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7998 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7999
8000 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8001 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8002 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8003 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8004
8005 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8006 RegisterNetSyncVariableBool("m_IsTakeable");
8007 RegisterNetSyncVariableBool("m_IsHologram");
8008
8011 {
8014 }
8015
8017
8019 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8021
8022 }
8023
8025 {
8027 }
8028
8030 {
8033 {
8038 }
8039 }
8040
8041 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8042 {
8044 {
8047 }
8048
8050 }
8051
8053 {
8059 }
8060
8062
8064 {
8066
8067 if (!action)
8068 {
8069 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8070 return;
8071 }
8072
8074 if (!ai)
8075 {
8077 return;
8078 }
8079
8081 if (!action_array)
8082 {
8083 action_array = new array<ActionBase_Basic>;
8085 }
8086 if (LogManager.IsActionLogEnable())
8087 {
8088 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8089 }
8090
8091 if (action_array.Find(action) != -1)
8092 {
8093 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8094 }
8095 else
8096 {
8097 action_array.Insert(action);
8098 }
8099 }
8100
8102 {
8104 ActionBase action = player.GetActionManager().GetAction(actionName);
8107
8108 if (action_array)
8109 {
8110 action_array.RemoveItem(action);
8111 }
8112 }
8113
8114
8115
8117 {
8118 ActionOverrideData overrideData = new ActionOverrideData();
8122
8124 if (!actionMap)
8125 {
8128 }
8129
8130 actionMap.Insert(this.
Type(), overrideData);
8131
8132 }
8133
8135
8137
8138
8140 {
8143
8146
8147 string config_to_search = "CfgVehicles";
8148 string muzzle_owner_config;
8149
8151 {
8152 if (IsInherited(Weapon))
8153 config_to_search = "CfgWeapons";
8154
8155 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8156
8157 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8158
8160
8161 if (config_OnFire_subclass_count > 0)
8162 {
8163 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8164
8165 for (int i = 0; i < config_OnFire_subclass_count; i++)
8166 {
8167 string particle_class = "";
8169 string config_OnFire_entry = config_OnFire_class + particle_class;
8170 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8171 WPOF_array.Insert(WPOF);
8172 }
8173
8174
8176 }
8177 }
8178
8180 {
8181 config_to_search = "CfgWeapons";
8182 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8183
8184 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8185
8187
8188 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8189 {
8190 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8191
8192 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8193 {
8194 string particle_class2 = "";
8196 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8197 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8198 WPOBE_array.Insert(WPOBE);
8199 }
8200
8201
8203 }
8204 }
8205 }
8206
8207
8209 {
8212
8214 {
8215 string config_to_search = "CfgVehicles";
8216
8217 if (IsInherited(Weapon))
8218 config_to_search = "CfgWeapons";
8219
8220 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8221 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8222
8223 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8224 {
8225
8227
8229 {
8231 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8233 return;
8234 }
8235
8238
8239
8240
8242 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8243
8244 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8245 {
8246 string particle_class = "";
8248 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8250
8251 if (entry_type == CT_CLASS)
8252 {
8253 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8254 WPOOH_array.Insert(WPOF);
8255 }
8256 }
8257
8258
8260 }
8261 }
8262 }
8263
8265 {
8267 }
8268
8270 {
8272 {
8274
8277
8280
8281 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8282 }
8283 }
8284
8286 {
8288 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8289
8291 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8292
8294 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8295
8297 {
8299 }
8300 }
8301
8303 {
8305 }
8306
8308 {
8311 else
8313
8315 {
8318 }
8319 else
8320 {
8323
8326 }
8327
8329 }
8330
8332 {
8334 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8335 }
8336
8338 {
8340 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8342 }
8343
8345 {
8347 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8348 }
8349
8351 {
8354
8355 OverheatingParticle OP = new OverheatingParticle();
8360
8362 }
8363
8365 {
8368
8369 return -1;
8370 }
8371
8373 {
8375 {
8378
8379 for (int i = count; i > 0; --i)
8380 {
8381 int id = i - 1;
8384
8387
8388 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8389 {
8390 if (p)
8391 {
8394 }
8395 }
8396 }
8397 }
8398 }
8399
8401 {
8403 {
8405 {
8406 int id = i - 1;
8408
8409 if (OP)
8410 {
8412
8413 if (p)
8414 {
8416 }
8417
8418 delete OP;
8419 }
8420 }
8421
8424 }
8425 }
8426
8429 {
8430 return 0.0;
8431 }
8432
8433
8435 {
8436 return 250;
8437 }
8438
8440 {
8441 return 0;
8442 }
8443
8446 {
8448 return true;
8449
8450 return false;
8451 }
8452
8455 {
8458
8460 {
8462 }
8463 else
8464 {
8465
8467 }
8468
8470 }
8471
8478 {
8479 return -1;
8480 }
8481
8482
8483
8484
8486 {
8488 {
8490 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8491
8492 if (r_index >= 0)
8493 {
8494 InventoryLocation r_il = new InventoryLocation;
8495 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8496
8497 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8500 {
8501 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8502 }
8504 {
8505 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8506 }
8507
8508 }
8509
8510 player.GetHumanInventory().ClearUserReservedLocation(this);
8511 }
8512
8515 }
8516
8517
8518
8519
8521 {
8522 return ItemBase.m_DebugActionsMask;
8523 }
8524
8526 {
8527 return ItemBase.m_DebugActionsMask & mask;
8528 }
8529
8531 {
8532 ItemBase.m_DebugActionsMask = mask;
8533 }
8534
8536 {
8537 ItemBase.m_DebugActionsMask |= mask;
8538 }
8539
8541 {
8542 ItemBase.m_DebugActionsMask &= ~mask;
8543 }
8544
8546 {
8548 {
8550 }
8551 else
8552 {
8554 }
8555 }
8556
8557
8559 {
8560 if (GetEconomyProfile())
8561 {
8562 float q_max = GetEconomyProfile().GetQuantityMax();
8563 if (q_max > 0)
8564 {
8565 float q_min = GetEconomyProfile().GetQuantityMin();
8566 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8567
8569 {
8570 ComponentEnergyManager comp = GetCompEM();
8572 {
8574 }
8575 }
8577 {
8579
8580 }
8581
8582 }
8583 }
8584 }
8585
8588 {
8589 EntityAI parent = GetHierarchyParent();
8590
8591 if (parent)
8592 {
8593 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8594 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8595 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8596 }
8597 }
8598
8601 {
8602 EntityAI parent = GetHierarchyParent();
8603
8604 if (parent)
8605 {
8606 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8607 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8608 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8609 }
8610 }
8611
8613 {
8614
8615
8616
8617
8619
8621 {
8622 if (ScriptInputUserData.CanStoreInputUserData())
8623 {
8624 ScriptInputUserData ctx = new ScriptInputUserData;
8630 ctx.
Write(use_stack_max);
8633
8635 {
8636 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8637 }
8638 }
8639 }
8640 else if (!
GetGame().IsMultiplayer())
8641 {
8643 }
8644 }
8645
8647 {
8649 }
8650
8652 {
8654 }
8655
8657 {
8659 }
8660
8662 {
8663
8664 return false;
8665 }
8666
8668 {
8669 return false;
8670 }
8671
8675 {
8676 return false;
8677 }
8678
8680 {
8681 return "";
8682 }
8683
8685
8687 {
8688 return false;
8689 }
8690
8692 {
8693 return true;
8694 }
8695
8696
8697
8699 {
8700 return true;
8701 }
8702
8704 {
8705 return true;
8706 }
8707
8709 {
8710 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8712 }
8713
8715 {
8717 }
8718
8720 {
8722 if (!is_being_placed)
8724 SetSynchDirty();
8725 }
8726
8727
8729
8731 {
8733 }
8734
8736 {
8738 }
8739
8741 {
8742 return 1;
8743 }
8744
8746 {
8747 return false;
8748 }
8749
8751 {
8753 SetSynchDirty();
8754 }
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8791 {
8792 super.OnMovedInsideCargo(container);
8793
8794 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8795 }
8796
8797 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8798 {
8799 super.EEItemLocationChanged(oldLoc,newLoc);
8800
8801 PlayerBase new_player = null;
8802 PlayerBase old_player = null;
8803
8804 if (newLoc.GetParent())
8805 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8806
8807 if (oldLoc.GetParent())
8808 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8809
8811 {
8812 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8813
8814 if (r_index >= 0)
8815 {
8816 InventoryLocation r_il = new InventoryLocation;
8817 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8818
8819 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8822 {
8823 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8824 }
8826 {
8827 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8828 }
8829
8830 }
8831 }
8832
8834 {
8835 if (new_player)
8836 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8837
8838 if (new_player == old_player)
8839 {
8840
8841 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8842 {
8844 {
8845 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8846 {
8847 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8848 }
8849 }
8850 else
8851 {
8852 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8853 }
8854 }
8855
8856 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8857 {
8858 int type = oldLoc.GetType();
8860 {
8861 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8862 }
8864 {
8865 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8866 }
8867 }
8868 if (!m_OldLocation)
8869 {
8870 m_OldLocation = new InventoryLocation;
8871 }
8872 m_OldLocation.Copy(oldLoc);
8873 }
8874 else
8875 {
8876 if (m_OldLocation)
8877 {
8878 m_OldLocation.Reset();
8879 }
8880 }
8881
8883 }
8884 else
8885 {
8886 if (new_player)
8887 {
8888 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8889 if (res_index >= 0)
8890 {
8891 InventoryLocation il = new InventoryLocation;
8892 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8894 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8897 {
8898 il.
GetParent().GetOnReleaseLock().Invoke(it);
8899 }
8901 {
8903 }
8904
8905 }
8906 }
8908 {
8909
8911 }
8912
8913 if (m_OldLocation)
8914 {
8915 m_OldLocation.Reset();
8916 }
8917 }
8918 }
8919
8920 override void EOnContact(IEntity other, Contact extra)
8921 {
8923 {
8924 int liquidType = -1;
8926 if (impactSpeed > 0.0)
8927 {
8929 #ifndef SERVER
8931 #else
8933 SetSynchDirty();
8934 #endif
8936 }
8937 }
8938
8939 #ifdef SERVER
8940 if (GetCompEM() && GetCompEM().IsPlugged())
8941 {
8942 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8943 GetCompEM().UnplugThis();
8944 }
8945 #endif
8946 }
8947
8949
8951 {
8953 }
8954
8956 {
8957
8958 }
8959
8961 {
8962 super.OnItemLocationChanged(old_owner, new_owner);
8963
8964 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8965 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8966
8967 if (!relatedPlayer && playerNew)
8968 relatedPlayer = playerNew;
8969
8970 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8971 {
8973 if (actionMgr)
8974 {
8975 ActionBase currentAction = actionMgr.GetRunningAction();
8976 if (currentAction)
8978 }
8979 }
8980
8981 Man ownerPlayerOld = null;
8982 Man ownerPlayerNew = null;
8983
8984 if (old_owner)
8985 {
8986 if (old_owner.
IsMan())
8987 {
8988 ownerPlayerOld = Man.Cast(old_owner);
8989 }
8990 else
8991 {
8992 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8993 }
8994 }
8995 else
8996 {
8998 {
9000
9001 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9002 {
9003 GetCompEM().UnplugThis();
9004 }
9005 }
9006 }
9007
9008 if (new_owner)
9009 {
9010 if (new_owner.
IsMan())
9011 {
9012 ownerPlayerNew = Man.Cast(new_owner);
9013 }
9014 else
9015 {
9016 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9017 }
9018 }
9019
9020 if (ownerPlayerOld != ownerPlayerNew)
9021 {
9022 if (ownerPlayerOld)
9023 {
9024 array<EntityAI> subItemsExit = new array<EntityAI>;
9026 for (int i = 0; i < subItemsExit.Count(); i++)
9027 {
9030 }
9031 }
9032
9033 if (ownerPlayerNew)
9034 {
9035 array<EntityAI> subItemsEnter = new array<EntityAI>;
9037 for (int j = 0; j < subItemsEnter.Count(); j++)
9038 {
9041 }
9042 }
9043 }
9044 else if (ownerPlayerNew != null)
9045 {
9046 PlayerBase nplayer;
9047 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9048 {
9049 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9051 for (int k = 0; k < subItemsUpdate.Count(); k++)
9052 {
9054 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9055 }
9056 }
9057 }
9058
9059 if (old_owner)
9060 old_owner.OnChildItemRemoved(this);
9061 if (new_owner)
9062 new_owner.OnChildItemReceived(this);
9063 }
9064
9065
9067 {
9068 super.EEDelete(parent);
9069 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9070 if (player)
9071 {
9073
9074 if (player.IsAlive())
9075 {
9076 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9077 if (r_index >= 0)
9078 {
9079 InventoryLocation r_il = new InventoryLocation;
9080 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9081
9082 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9085 {
9086 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9087 }
9089 {
9090 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9091 }
9092
9093 }
9094
9095 player.RemoveQuickBarEntityShortcut(this);
9096 }
9097 }
9098 }
9099
9101 {
9102 super.EEKilled(killer);
9103
9106 {
9107 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9108 {
9109 if (IsMagazine())
9110 {
9111 if (Magazine.Cast(this).GetAmmoCount() > 0)
9112 {
9114 }
9115 }
9116 else
9117 {
9119 }
9120 }
9121 }
9122 }
9123
9125 {
9126 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9127
9128 super.OnWasAttached(parent, slot_id);
9129
9132
9134 }
9135
9137 {
9138 super.OnWasDetached(parent, slot_id);
9139
9142 }
9143
9145 {
9146 int idx;
9149
9150 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9151 if (inventory_slots.Count() < 1)
9152 {
9153 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9154 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9155 }
9156 else
9157 {
9158 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9159 }
9160
9161 idx = inventory_slots.Find(slot);
9162 if (idx < 0)
9163 return "";
9164
9165 return attach_types.Get(idx);
9166 }
9167
9169 {
9170 int idx = -1;
9171 string slot;
9172
9175
9176 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9177 if (inventory_slots.Count() < 1)
9178 {
9179 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9180 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9181 }
9182 else
9183 {
9184 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9185 if (detach_types.Count() < 1)
9186 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9187 }
9188
9189 for (int i = 0; i < inventory_slots.Count(); i++)
9190 {
9191 slot = inventory_slots.Get(i);
9192 }
9193
9194 if (slot != "")
9195 {
9196 if (detach_types.Count() == 1)
9197 idx = 0;
9198 else
9199 idx = inventory_slots.Find(slot);
9200 }
9201 if (idx < 0)
9202 return "";
9203
9204 return detach_types.Get(idx);
9205 }
9206
9208 {
9209
9211
9212
9213 float min_time = 1;
9214 float max_time = 3;
9215 float delay = Math.RandomFloat(min_time, max_time);
9216
9217 explode_timer.Run(delay, this, "DoAmmoExplosion");
9218 }
9219
9221 {
9222 Magazine magazine = Magazine.Cast(this);
9223 int pop_sounds_count = 6;
9224 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9225
9226
9227 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9228 string sound_name = pop_sounds[ sound_idx ];
9230
9231
9232 magazine.ServerAddAmmoCount(-1);
9233
9234
9235 float min_temp_to_explode = 100;
9236
9237 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9238 {
9240 }
9241 }
9242
9243
9244 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9245 {
9246 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9247
9248 const int CHANCE_DAMAGE_CARGO = 4;
9249 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9250 const int CHANCE_DAMAGE_NOTHING = 2;
9251
9253 {
9254 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9255 int chances;
9256 int rnd;
9257
9258 if (GetInventory().GetCargo())
9259 {
9260 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9261 rnd = Math.RandomInt(0,chances);
9262
9263 if (rnd < CHANCE_DAMAGE_CARGO)
9264 {
9266 }
9267 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9268 {
9270 }
9271 }
9272 else
9273 {
9274 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9275 rnd = Math.RandomInt(0,chances);
9276
9277 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9278 {
9280 }
9281 }
9282 }
9283 }
9284
9286 {
9287 if (GetInventory().GetCargo())
9288 {
9289 int item_count = GetInventory().GetCargo().GetItemCount();
9290 if (item_count > 0)
9291 {
9292 int random_pick = Math.RandomInt(0, item_count);
9294 if (!item.IsExplosive())
9295 {
9296 item.AddHealth("","",damage);
9297 return true;
9298 }
9299 }
9300 }
9301 return false;
9302 }
9303
9305 {
9306 int attachment_count = GetInventory().AttachmentCount();
9307 if (attachment_count > 0)
9308 {
9309 int random_pick = Math.RandomInt(0, attachment_count);
9310 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9311 if (!attachment.IsExplosive())
9312 {
9313 attachment.AddHealth("","",damage);
9314 return true;
9315 }
9316 }
9317 return false;
9318 }
9319
9321 {
9323 }
9324
9326 {
9328 return GetInventory().CanRemoveEntity();
9329
9330 return false;
9331 }
9332
9334 {
9335
9337 return false;
9338
9339
9341 return false;
9342
9343
9344
9346 if (delta == 0)
9347 return false;
9348
9349
9350 return true;
9351 }
9352
9354 {
9356 {
9357 if (ScriptInputUserData.CanStoreInputUserData())
9358 {
9359 ScriptInputUserData ctx = new ScriptInputUserData;
9364 ctx.
Write(destination_entity);
9368 }
9369 }
9370 else if (!
GetGame().IsMultiplayer())
9371 {
9373 }
9374 }
9375
9377 {
9378 float split_quantity_new;
9382 InventoryLocation loc = new InventoryLocation;
9383
9384 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9385 {
9387 split_quantity_new = stack_max;
9388 else
9390
9392 {
9393 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
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 else if (destination_entity && slot_id == -1)
9404 {
9405 if (quantity > stack_max)
9406 split_quantity_new = stack_max;
9407 else
9408 split_quantity_new = quantity;
9409
9411 {
9413 {
9416 }
9417
9418 if (new_item)
9419 {
9420 new_item.SetResultOfSplit(true);
9421 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9423 new_item.
SetQuantity(split_quantity_new,
false,
true);
9424 }
9425 }
9426 }
9427 else
9428 {
9429 if (stack_max != 0)
9430 {
9432 {
9434 }
9435
9436 if (split_quantity_new == 0)
9437 {
9438 if (!
GetGame().IsMultiplayer())
9439 player.PhysicalPredictiveDropItem(this);
9440 else
9441 player.ServerDropEntity(this);
9442 return;
9443 }
9444
9446 {
9448
9449 if (new_item)
9450 {
9451 new_item.SetResultOfSplit(true);
9452 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9455 new_item.PlaceOnSurface();
9456 }
9457 }
9458 }
9459 }
9460 }
9461
9463 {
9464 float split_quantity_new;
9468 InventoryLocation loc = new InventoryLocation;
9469
9470 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9471 {
9473 split_quantity_new = stack_max;
9474 else
9476
9478 {
9479 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9480 if (new_item)
9481 {
9482 new_item.SetResultOfSplit(true);
9483 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9485 new_item.
SetQuantity(split_quantity_new,
false,
true);
9486 }
9487 }
9488 }
9489 else if (destination_entity && slot_id == -1)
9490 {
9491 if (quantity > stack_max)
9492 split_quantity_new = stack_max;
9493 else
9494 split_quantity_new = quantity;
9495
9497 {
9499 {
9502 }
9503
9504 if (new_item)
9505 {
9506 new_item.SetResultOfSplit(true);
9507 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9509 new_item.
SetQuantity(split_quantity_new,
false,
true);
9510 }
9511 }
9512 }
9513 else
9514 {
9515 if (stack_max != 0)
9516 {
9518 {
9520 }
9521
9523 {
9525
9526 if (new_item)
9527 {
9528 new_item.SetResultOfSplit(true);
9529 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9532 new_item.PlaceOnSurface();
9533 }
9534 }
9535 }
9536 }
9537 }
9538
9540 {
9542 {
9543 if (ScriptInputUserData.CanStoreInputUserData())
9544 {
9545 ScriptInputUserData ctx = new ScriptInputUserData;
9550 dst.WriteToContext(ctx);
9552 }
9553 }
9554 else if (!
GetGame().IsMultiplayer())
9555 {
9557 }
9558 }
9559
9561 {
9563 {
9564 if (ScriptInputUserData.CanStoreInputUserData())
9565 {
9566 ScriptInputUserData ctx = new ScriptInputUserData;
9571 ctx.
Write(destination_entity);
9577 }
9578 }
9579 else if (!
GetGame().IsMultiplayer())
9580 {
9582 }
9583 }
9584
9586 {
9588 }
9589
9591 {
9593 float split_quantity_new;
9595 if (dst.IsValid())
9596 {
9597 int slot_id = dst.GetSlot();
9599
9600 if (quantity > stack_max)
9601 split_quantity_new = stack_max;
9602 else
9603 split_quantity_new = quantity;
9604
9606 {
9608
9609 if (new_item)
9610 {
9611 new_item.SetResultOfSplit(true);
9612 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9614 new_item.
SetQuantity(split_quantity_new,
false,
true);
9615 }
9616
9617 return new_item;
9618 }
9619 }
9620
9621 return null;
9622 }
9623
9625 {
9627 float split_quantity_new;
9629 if (destination_entity)
9630 {
9632 if (quantity > stackable)
9633 split_quantity_new = stackable;
9634 else
9635 split_quantity_new = quantity;
9636
9638 {
9639 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9640 if (new_item)
9641 {
9642 new_item.SetResultOfSplit(true);
9643 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9645 new_item.
SetQuantity(split_quantity_new,
false,
true);
9646 }
9647 }
9648 }
9649 }
9650
9652 {
9654 {
9655 if (ScriptInputUserData.CanStoreInputUserData())
9656 {
9657 ScriptInputUserData ctx = new ScriptInputUserData;
9662 ItemBase destination_entity =
this;
9663 ctx.
Write(destination_entity);
9667 }
9668 }
9669 else if (!
GetGame().IsMultiplayer())
9670 {
9672 }
9673 }
9674
9676 {
9678 float split_quantity_new;
9680 if (player)
9681 {
9683 if (quantity > stackable)
9684 split_quantity_new = stackable;
9685 else
9686 split_quantity_new = quantity;
9687
9689 {
9690 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9691 new_item =
ItemBase.Cast(in_hands);
9692 if (new_item)
9693 {
9694 new_item.SetResultOfSplit(true);
9695 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9697 new_item.SetQuantity(split_quantity_new, false, true);
9698 }
9699 }
9700 }
9701 }
9702
9704 {
9706 float split_quantity_new = Math.Floor(quantity * 0.5);
9707
9709 return;
9710
9712
9713 if (new_item)
9714 {
9715 if (new_item.GetQuantityMax() < split_quantity_new)
9716 {
9717 split_quantity_new = new_item.GetQuantityMax();
9718 }
9719
9720 new_item.SetResultOfSplit(true);
9721 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9722
9724 {
9727 }
9728 else
9729 {
9731 new_item.
SetQuantity(split_quantity_new,
false,
true);
9732 }
9733 }
9734 }
9735
9737 {
9739 float split_quantity_new = Math.Floor(quantity / 2);
9740
9742 return;
9743
9744 InventoryLocation invloc = new InventoryLocation;
9746
9748 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9749
9750 if (new_item)
9751 {
9752 if (new_item.GetQuantityMax() < split_quantity_new)
9753 {
9754 split_quantity_new = new_item.GetQuantityMax();
9755 }
9757 {
9760 }
9761 else if (split_quantity_new > 1)
9762 {
9764 new_item.
SetQuantity(split_quantity_new,
false,
true);
9765 }
9766 }
9767 }
9768
9771 {
9772 SetWeightDirty();
9774
9775 if (parent)
9776 parent.OnAttachmentQuantityChangedEx(this, delta);
9777
9779 {
9781 {
9783 }
9785 {
9786 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9788 }
9789 }
9790
9791 }
9792
9795 {
9796
9797 }
9798
9801 {
9803 }
9804
9806 {
9807 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9808
9810 {
9811 if (newLevel == GameConstants.STATE_RUINED)
9812 {
9814 EntityAI parent = GetHierarchyParent();
9815 if (parent && parent.IsFireplace())
9816 {
9817 CargoBase cargo = GetInventory().GetCargo();
9818 if (cargo)
9819 {
9821 {
9823 }
9824 }
9825 }
9826 }
9827
9829 {
9830
9832 return;
9833 }
9834
9835 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9836 {
9838 }
9839 }
9840 }
9841
9842
9844 {
9845 super.OnRightClick();
9846
9848 {
9850 {
9851 if (ScriptInputUserData.CanStoreInputUserData())
9852 {
9853 EntityAI root = GetHierarchyRoot();
9854 Man playerOwner = GetHierarchyRootPlayer();
9855 InventoryLocation dst = new InventoryLocation;
9856
9857
9858 if (!playerOwner && root && root == this)
9859 {
9861 }
9862 else
9863 {
9864
9865 GetInventory().GetCurrentInventoryLocation(dst);
9867 {
9870 {
9872 }
9873 else
9874 {
9876
9877
9878 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9879 {
9881 }
9882 else
9883 {
9884 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9885 }
9886 }
9887 }
9888 }
9889
9890 ScriptInputUserData ctx = new ScriptInputUserData;
9898 }
9899 }
9900 else if (!
GetGame().IsMultiplayer())
9901 {
9903 }
9904 }
9905 }
9906
9908 {
9909 if (root)
9910 {
9911 vector m4[4];
9912 root.GetTransform(m4);
9913 dst.SetGround(this, m4);
9914 }
9915 else
9916 {
9917 GetInventory().GetCurrentInventoryLocation(dst);
9918 }
9919 }
9920
9921 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9922 {
9923
9924 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9925 return false;
9926
9927 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9928 return false;
9929
9930
9932 return false;
9933
9934
9935 Magazine mag = Magazine.Cast(this);
9936 if (mag)
9937 {
9938 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9939 return false;
9940
9941 if (stack_max_limit)
9942 {
9943 Magazine other_mag = Magazine.Cast(other_item);
9944 if (other_item)
9945 {
9946 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9947 return false;
9948 }
9949
9950 }
9951 }
9952 else
9953 {
9954
9956 return false;
9957
9959 return false;
9960 }
9961
9962 PlayerBase player = null;
9963 if (CastTo(player, GetHierarchyRootPlayer()))
9964 {
9965 if (player.GetInventory().HasAttachment(this))
9966 return false;
9967
9968 if (player.IsItemsToDelete())
9969 return false;
9970 }
9971
9972 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9973 return false;
9974
9975 int slotID;
9977 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9978 return false;
9979
9980 return true;
9981 }
9982
9984 {
9986 }
9987
9989 {
9990 return m_IsResultOfSplit;
9991 }
9992
9994 {
9995 m_IsResultOfSplit = value;
9996 }
9997
9999 {
10001 }
10002
10004 {
10005 float other_item_quantity = other_item.GetQuantity();
10006 float this_free_space;
10007
10009
10011
10012 if (other_item_quantity > this_free_space)
10013 {
10014 return this_free_space;
10015 }
10016 else
10017 {
10018 return other_item_quantity;
10019 }
10020 }
10021
10023 {
10025 }
10026
10028 {
10030 return;
10031
10032 if (!IsMagazine() && other_item)
10033 {
10035 if (quantity_used != 0)
10036 {
10037 float hp1 = GetHealth01("","");
10038 float hp2 = other_item.GetHealth01("","");
10039 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10040 hpResult = hpResult / (
GetQuantity() + quantity_used);
10041
10042 hpResult *= GetMaxHealth();
10043 Math.Round(hpResult);
10044 SetHealth("", "Health", hpResult);
10045
10047 other_item.AddQuantity(-quantity_used);
10048 }
10049 }
10051 }
10052
10054 {
10055 #ifdef SERVER
10056 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10057 GetHierarchyParent().IncreaseLifetimeUp();
10058 #endif
10059 };
10060
10062 {
10063 PlayerBase p = PlayerBase.Cast(player);
10064
10065 array<int> recipesIds = p.m_Recipes;
10066 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10067 if (moduleRecipesManager)
10068 {
10069 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10070 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10071 }
10072
10073 for (int i = 0;i < recipesIds.Count(); i++)
10074 {
10075 int key = recipesIds.Get(i);
10076 string recipeName = moduleRecipesManager.GetRecipeName(key);
10078 }
10079 }
10080
10081
10082 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10083 {
10084 super.GetDebugActions(outputList);
10085
10086
10092
10093
10098
10103
10104
10108
10109
10111 {
10115 }
10116
10119
10120
10124
10126
10127 InventoryLocation loc = new InventoryLocation();
10128 GetInventory().GetCurrentInventoryLocation(loc);
10130 {
10131 if (Gizmo_IsSupported())
10134 }
10135
10137 }
10138
10139
10140
10141
10143 {
10144 super.OnAction(action_id, player, ctx);
10145
10147 {
10148 switch (action_id)
10149 {
10152 return true;
10155 return true;
10156 }
10157 }
10158
10160 {
10161 switch (action_id)
10162 {
10164 Delete();
10165 return true;
10166 }
10167 }
10168
10169 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10170 {
10171 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10172 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10173 PlayerBase p = PlayerBase.Cast(player);
10174 if (
EActions.RECIPES_RANGE_START < 1000)
10175 {
10176 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10177 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10178 }
10179 }
10180 #ifndef SERVER
10181 else if (action_id ==
EActions.WATCH_PLAYER)
10182 {
10183 PluginDeveloper.SetDeveloperItemClientEx(player);
10184 }
10185 #endif
10187 {
10188 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10189 {
10190 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10191 OnDebugButtonPressServer(id + 1);
10192 }
10193
10194 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10195 {
10196 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10198 }
10199
10200 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10201 {
10202 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10204 }
10205
10206 else if (action_id ==
EActions.ADD_QUANTITY)
10207 {
10208 if (IsMagazine())
10209 {
10210 Magazine mag = Magazine.Cast(this);
10211 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10212 }
10213 else
10214 {
10216 }
10217
10218 if (m_EM)
10219 {
10220 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10221 }
10222
10223 }
10224
10225 else if (action_id ==
EActions.REMOVE_QUANTITY)
10226 {
10227 if (IsMagazine())
10228 {
10229 Magazine mag2 = Magazine.Cast(this);
10230 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10231 }
10232 else
10233 {
10235 }
10236 if (m_EM)
10237 {
10238 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10239 }
10240
10241 }
10242
10243 else if (action_id ==
EActions.SET_QUANTITY_0)
10244 {
10246
10247 if (m_EM)
10248 {
10249 m_EM.SetEnergy(0);
10250 }
10251 }
10252
10253 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10254 {
10256
10257 if (m_EM)
10258 {
10259 m_EM.SetEnergy(m_EM.GetEnergyMax());
10260 }
10261 }
10262
10263 else if (action_id ==
EActions.ADD_HEALTH)
10264 {
10265 AddHealth("","",GetMaxHealth("","Health")/5);
10266 }
10267 else if (action_id ==
EActions.REMOVE_HEALTH)
10268 {
10269 AddHealth("","",-GetMaxHealth("","Health")/5);
10270 }
10271 else if (action_id ==
EActions.DESTROY_HEALTH)
10272 {
10273 SetHealth01("","",0);
10274 }
10275 else if (action_id ==
EActions.WATCH_ITEM)
10276 {
10278 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10279 #ifdef DEVELOPER
10280 SetDebugDeveloper_item(this);
10281 #endif
10282 }
10283
10284 else if (action_id ==
EActions.ADD_TEMPERATURE)
10285 {
10286 AddTemperature(20);
10287
10288 }
10289
10290 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10291 {
10292 AddTemperature(-20);
10293
10294 }
10295
10296 else if (action_id ==
EActions.FLIP_FROZEN)
10297 {
10298 SetFrozen(!GetIsFrozen());
10299
10300 }
10301
10302 else if (action_id ==
EActions.ADD_WETNESS)
10303 {
10305
10306 }
10307
10308 else if (action_id ==
EActions.REMOVE_WETNESS)
10309 {
10311
10312 }
10313
10314 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10315 {
10318
10319
10320 }
10321
10322 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10323 {
10326 }
10327
10328 else if (action_id ==
EActions.MAKE_SPECIAL)
10329 {
10330 auto debugParams = DebugSpawnParams.WithPlayer(player);
10331 OnDebugSpawnEx(debugParams);
10332 }
10333
10334 }
10335
10336
10337 return false;
10338 }
10339
10340
10341
10342
10346
10349
10350
10351
10353 {
10354 return false;
10355 }
10356
10357
10359 {
10360 return true;
10361 }
10362
10363
10365 {
10366 return true;
10367 }
10368
10369
10370
10372 {
10373 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10375 }
10376
10379 {
10380 return null;
10381 }
10382
10384 {
10385 return false;
10386 }
10387
10389 {
10390 return false;
10391 }
10392
10396
10397
10399 {
10400 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10401 return module_repairing.CanRepair(this, item_repair_kit);
10402 }
10403
10404
10405 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10406 {
10407 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10408 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10409 }
10410
10411
10413 {
10414
10415
10416
10417
10418
10419
10420
10421
10422 return 1;
10423 }
10424
10425
10426
10428 {
10430 }
10431
10432
10433
10435 {
10437 }
10438
10439
10448 {
10449 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10450
10451 if (player)
10452 {
10453 player.MessageStatus(text);
10454 }
10455 }
10456
10457
10466 {
10467 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10468
10469 if (player)
10470 {
10471 player.MessageAction(text);
10472 }
10473 }
10474
10475
10484 {
10485 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10486
10487 if (player)
10488 {
10489 player.MessageFriendly(text);
10490 }
10491 }
10492
10493
10502 {
10503 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10504
10505 if (player)
10506 {
10507 player.MessageImportant(text);
10508 }
10509 }
10510
10512 {
10513 return true;
10514 }
10515
10516
10517 override bool KindOf(
string tag)
10518 {
10519 bool found = false;
10520 string item_name = this.
GetType();
10523
10524 int array_size = item_tag_array.Count();
10525 for (int i = 0; i < array_size; i++)
10526 {
10527 if (item_tag_array.Get(i) == tag)
10528 {
10529 found = true;
10530 break;
10531 }
10532 }
10533 return found;
10534 }
10535
10536
10538 {
10539
10540 super.OnRPC(sender, rpc_type,ctx);
10541
10542
10543 switch (rpc_type)
10544 {
10545 #ifndef SERVER
10546 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10547 Param2<bool, string> p = new Param2<bool, string>(false, "");
10548
10550 return;
10551
10552 bool play = p.param1;
10553 string soundSet = p.param2;
10554
10555 if (play)
10556 {
10558 {
10560 {
10562 }
10563 }
10564 else
10565 {
10567 }
10568 }
10569 else
10570 {
10572 }
10573
10574 break;
10575 #endif
10576
10577 }
10578
10580 {
10582 }
10583 }
10584
10585
10586
10587
10589 {
10590 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10591 return plugin.GetID(
name);
10592 }
10593
10595 {
10596 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10597 return plugin.GetName(id);
10598 }
10599
10602 {
10603
10604
10605 int varFlags;
10606 if (!ctx.
Read(varFlags))
10607 return;
10608
10609 if (varFlags & ItemVariableFlags.FLOAT)
10610 {
10612 }
10613 }
10614
10616 {
10617
10618 super.SerializeNumericalVars(floats_out);
10619
10620
10621
10623 {
10625 }
10626
10628 {
10630 }
10631
10633 {
10635 }
10636
10638 {
10643 }
10644
10646 {
10648 }
10649 }
10650
10652 {
10653
10654 super.DeSerializeNumericalVars(floats);
10655
10656
10657 int index = 0;
10658 int mask = Math.Round(floats.Get(index));
10659
10660 index++;
10661
10663 {
10665 {
10667 }
10668 else
10669 {
10670 float quantity = floats.Get(index);
10671 SetQuantity(quantity,
true,
false,
false,
false);
10672 }
10673 index++;
10674 }
10675
10677 {
10678 float wet = floats.Get(index);
10680 index++;
10681 }
10682
10684 {
10685 int liquidtype = Math.Round(floats.Get(index));
10687 index++;
10688 }
10689
10691 {
10693 index++;
10695 index++;
10697 index++;
10699 index++;
10700 }
10701
10703 {
10704 int cleanness = Math.Round(floats.Get(index));
10706 index++;
10707 }
10708 }
10709
10711 {
10712 super.WriteVarsToCTX(ctx);
10713
10714
10716 {
10718 }
10719
10721 {
10723 }
10724
10726 {
10728 }
10729
10731 {
10732 int r,g,b,a;
10738 }
10739
10741 {
10743 }
10744 }
10745
10747 {
10748 if (!super.ReadVarsFromCTX(ctx,version))
10749 return false;
10750
10751 int intValue;
10752 float value;
10753
10754 if (version < 140)
10755 {
10756 if (!ctx.
Read(intValue))
10757 return false;
10758
10759 m_VariablesMask = intValue;
10760 }
10761
10763 {
10764 if (!ctx.
Read(value))
10765 return false;
10766
10768 {
10770 }
10771 else
10772 {
10774 }
10775 }
10776
10777 if (version < 140)
10778 {
10780 {
10781 if (!ctx.
Read(value))
10782 return false;
10783 SetTemperatureDirect(value);
10784 }
10785 }
10786
10788 {
10789 if (!ctx.
Read(value))
10790 return false;
10792 }
10793
10795 {
10796 if (!ctx.
Read(intValue))
10797 return false;
10799 }
10800
10802 {
10803 int r,g,b,a;
10805 return false;
10807 return false;
10809 return false;
10811 return false;
10812
10814 }
10815
10817 {
10818 if (!ctx.
Read(intValue))
10819 return false;
10821 }
10822
10823 if (version >= 138 && version < 140)
10824 {
10826 {
10827 if (!ctx.
Read(intValue))
10828 return false;
10829 SetFrozen(intValue);
10830 }
10831 }
10832
10833 return true;
10834 }
10835
10836
10838 {
10841 {
10843 }
10844
10845 if (!super.OnStoreLoad(ctx, version))
10846 {
10848 return false;
10849 }
10850
10851 if (version >= 114)
10852 {
10853 bool hasQuickBarIndexSaved;
10854
10855 if (!ctx.
Read(hasQuickBarIndexSaved))
10856 {
10858 return false;
10859 }
10860
10861 if (hasQuickBarIndexSaved)
10862 {
10863 int itmQBIndex;
10864
10865
10866 if (!ctx.
Read(itmQBIndex))
10867 {
10869 return false;
10870 }
10871
10872 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10873 if (itmQBIndex != -1 && parentPlayer)
10874 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10875 }
10876 }
10877 else
10878 {
10879
10880 PlayerBase player;
10881 int itemQBIndex;
10882 if (version ==
int.
MAX)
10883 {
10884 if (!ctx.
Read(itemQBIndex))
10885 {
10887 return false;
10888 }
10889 }
10890 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10891 {
10892
10893 if (!ctx.
Read(itemQBIndex))
10894 {
10896 return false;
10897 }
10898 if (itemQBIndex != -1 && player)
10899 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10900 }
10901 }
10902
10903 if (version < 140)
10904 {
10905
10906 if (!LoadVariables(ctx, version))
10907 {
10909 return false;
10910 }
10911 }
10912
10913
10915 {
10917 return false;
10918 }
10919 if (version >= 132)
10920 {
10922 if (raib)
10923 {
10925 {
10927 return false;
10928 }
10929 }
10930 }
10931
10933 return true;
10934 }
10935
10936
10937
10939 {
10940 super.OnStoreSave(ctx);
10941
10942 PlayerBase player;
10943 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10944 {
10946
10947 int itemQBIndex = -1;
10948 itemQBIndex = player.FindQuickBarEntityIndex(this);
10949 ctx.
Write(itemQBIndex);
10950 }
10951 else
10952 {
10954 }
10955
10957
10959 if (raib)
10960 {
10962 }
10963 }
10964
10965
10967 {
10968 super.AfterStoreLoad();
10969
10971 {
10973 }
10974
10976 {
10979 }
10980 }
10981
10983 {
10984 super.EEOnAfterLoad();
10985
10987 {
10989 }
10990
10993 }
10994
10996 {
10997 return false;
10998 }
10999
11000
11001
11003 {
11005 {
11006 #ifdef PLATFORM_CONSOLE
11007
11009 {
11011 if (menu)
11012 {
11014 }
11015 }
11016 #endif
11017 }
11018
11020 {
11023 }
11024
11026 {
11027 SetWeightDirty();
11029 }
11031 {
11034 }
11035
11037 {
11040 }
11042 {
11045 }
11046
11047 super.OnVariablesSynchronized();
11048 }
11049
11050
11051
11053 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11054 {
11055 if (!IsServerCheck(allow_client))
11056 return false;
11057
11059 return false;
11060
11063
11064 if (value <= (min + 0.001))
11065 value = min;
11066
11067 if (value == min)
11068 {
11069 if (destroy_config)
11070 {
11071 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11072 if (dstr)
11073 {
11075 this.Delete();
11076 return true;
11077 }
11078 }
11079 else if (destroy_forced)
11080 {
11082 this.Delete();
11083 return true;
11084 }
11085
11087 }
11088
11091
11093 {
11095
11096 if (delta)
11098 }
11099
11101
11102 return false;
11103 }
11104
11105
11107 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11108 {
11110 }
11111
11113 {
11116 }
11117
11119 {
11122 }
11123
11125 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11126 {
11127 float value_clamped = Math.Clamp(value, 0, 1);
11129 SetQuantity(result, destroy_config, destroy_forced);
11130 }
11131
11132
11135 {
11137 }
11138
11140 {
11142 }
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11154 {
11155 int slot = -1;
11156 if (GetInventory())
11157 {
11158 InventoryLocation il = new InventoryLocation;
11159 GetInventory().GetCurrentInventoryLocation(il);
11161 }
11162
11164 }
11165
11167 {
11168 float quantity_max = 0;
11169
11171 {
11172 if (attSlotID != -1)
11173 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11174
11175 if (quantity_max <= 0)
11177 }
11178
11179 if (quantity_max <= 0)
11181
11182 return quantity_max;
11183 }
11184
11186 {
11188 }
11189
11191 {
11193 }
11194
11195
11197 {
11199 }
11200
11202 {
11204 }
11205
11207 {
11209 }
11210
11211
11213 {
11214
11215 float weightEx = GetWeightEx();
11216 float special = GetInventoryAndCargoWeight();
11217 return weightEx - special;
11218 }
11219
11220
11222 {
11224 }
11225
11227 {
11229 {
11230 #ifdef DEVELOPER
11231 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11232 {
11233 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11235 }
11236 #endif
11237
11238 return GetQuantity() * GetConfigWeightModified();
11239 }
11240 else if (HasEnergyManager())
11241 {
11242 #ifdef DEVELOPER
11243 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11244 {
11245 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11246 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11247 }
11248 #endif
11249 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11250 }
11251 else
11252 {
11253 #ifdef DEVELOPER
11254 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11255 {
11256 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11257 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11258 }
11259 #endif
11260 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11261 }
11262 }
11263
11266 {
11267 int item_count = 0;
11269
11270 if (GetInventory().GetCargo() != NULL)
11271 {
11272 item_count = GetInventory().GetCargo().GetItemCount();
11273 }
11274
11275 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11276 {
11277 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11278 if (item)
11279 item_count += item.GetNumberOfItems();
11280 }
11281 return item_count;
11282 }
11283
11286 {
11287 float weight = 0;
11288 float wetness = 1;
11289 if (include_wetness)
11292 {
11293 weight = wetness * m_ConfigWeight;
11294 }
11296 {
11297 weight = 1;
11298 }
11299 return weight;
11300 }
11301
11302
11303
11305 {
11306 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11307 {
11308 GameInventory inv = GetInventory();
11309 array<EntityAI> items = new array<EntityAI>;
11311 for (int i = 0; i < items.Count(); i++)
11312 {
11314 if (item)
11315 {
11317 }
11318 }
11319 }
11320 }
11321
11322
11323
11324
11326 {
11327 float energy = 0;
11328 if (HasEnergyManager())
11329 {
11330 energy = GetCompEM().GetEnergy();
11331 }
11332 return energy;
11333 }
11334
11335
11337 {
11338 super.OnEnergyConsumed();
11339
11341 }
11342
11344 {
11345 super.OnEnergyAdded();
11346
11348 }
11349
11350
11352 {
11353 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11354 {
11356 {
11357 float energy_0to1 = GetCompEM().GetEnergy0To1();
11359 }
11360 }
11361 }
11362
11363
11365 {
11366 return ConfigGetFloat("heatIsolation");
11367 }
11368
11370 {
11372 }
11373
11375 {
11376 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11377 if (
GetGame().ConfigIsExisting(paramPath))
11379
11380 return 0.0;
11381 }
11382
11384 {
11385 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11386 if (
GetGame().ConfigIsExisting(paramPath))
11388
11389 return 0.0;
11390 }
11391
11392 override void SetWet(
float value,
bool allow_client =
false)
11393 {
11394 if (!IsServerCheck(allow_client))
11395 return;
11396
11399
11401
11402 m_VarWet = Math.Clamp(value, min, max);
11403
11405 {
11408 }
11409 }
11410
11411 override void AddWet(
float value)
11412 {
11414 }
11415
11417 {
11419 }
11420
11422 {
11424 }
11425
11427 {
11429 }
11430
11432 {
11434 }
11435
11437 {
11439 }
11440
11441 override void OnWetChanged(
float newVal,
float oldVal)
11442 {
11445 if (newLevel != oldLevel)
11446 {
11448 }
11449 }
11450
11452 {
11453 SetWeightDirty();
11454 }
11455
11457 {
11458 return GetWetLevelInternal(
m_VarWet);
11459 }
11460
11461
11462
11464 {
11466 }
11467
11469 {
11471 }
11472
11474 {
11476 }
11477
11479 {
11481 }
11482
11483
11484
11486 {
11487 if (ConfigIsExisting("itemModelLength"))
11488 {
11489 return ConfigGetFloat("itemModelLength");
11490 }
11491 return 0;
11492 }
11493
11495 {
11496 if (ConfigIsExisting("itemAttachOffset"))
11497 {
11498 return ConfigGetFloat("itemAttachOffset");
11499 }
11500 return 0;
11501 }
11502
11503 override void SetCleanness(
int value,
bool allow_client =
false)
11504 {
11505 if (!IsServerCheck(allow_client))
11506 return;
11507
11509
11511
11514 }
11515
11517 {
11519 }
11520
11522 {
11523 return true;
11524 }
11525
11526
11527
11528
11530 {
11532 }
11533
11535 {
11537 }
11538
11539
11540
11541
11542 override void SetColor(
int r,
int g,
int b,
int a)
11543 {
11549 }
11551 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11552 {
11557 }
11558
11560 {
11562 }
11563
11566 {
11567 int r,g,b,a;
11569 r = r/255;
11570 g = g/255;
11571 b = b/255;
11572 a = a/255;
11573 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11574 }
11575
11576
11577
11578 override void SetLiquidType(
int value,
bool allow_client =
false)
11579 {
11580 if (!IsServerCheck(allow_client))
11581 return;
11582
11587 }
11588
11590 {
11591 return ConfigGetInt("varLiquidTypeInit");
11592 }
11593
11595 {
11597 }
11598
11600 {
11602 SetFrozen(false);
11603 }
11604
11607 {
11608 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11609 }
11610
11611
11614 {
11615 PlayerBase nplayer;
11616 if (PlayerBase.CastTo(nplayer, player))
11617 {
11619
11620 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11621 }
11622 }
11623
11624
11627 {
11628 PlayerBase nplayer;
11629 if (PlayerBase.CastTo(nplayer,player))
11630 {
11631
11632 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11633
11634 }
11635
11636
11637 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11638
11639
11640 if (HasEnergyManager())
11641 {
11642 GetCompEM().UpdatePlugState();
11643 }
11644 }
11645
11646
11648 {
11649 super.OnPlacementStarted(player);
11650
11652 }
11653
11654 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11655 {
11657 {
11658 m_AdminLog.OnPlacementComplete(player,
this);
11659 }
11660
11661 super.OnPlacementComplete(player, position, orientation);
11662 }
11663
11664
11665
11666
11667
11669 {
11671 {
11672 return true;
11673 }
11674 else
11675 {
11676 return false;
11677 }
11678 }
11679
11680
11682 {
11684 {
11686 }
11687 }
11688
11689
11691 {
11693 }
11694
11696 {
11698 }
11699
11700 override void InsertAgent(
int agent,
float count = 1)
11701 {
11702 if (count < 1)
11703 return;
11704
11706 }
11707
11710 {
11712 }
11713
11714
11716 {
11718 }
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11762 {
11764 return false;
11765 return true;
11766 }
11767
11769 {
11770
11772 }
11773
11774
11777 {
11778 super.CheckForRoofLimited(timeTresholdMS);
11779
11781 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11782 {
11783 m_PreviousRoofTestTime = time;
11784 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11785 }
11786 }
11787
11788
11790 {
11792 {
11793 return 0;
11794 }
11795
11796 if (GetInventory().GetAttachmentSlotsCount() != 0)
11797 {
11798 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11799 if (filter)
11800 return filter.GetProtectionLevel(type, false, system);
11801 else
11802 return 0;
11803 }
11804
11805 string subclassPath, entryName;
11806
11807 switch (type)
11808 {
11810 entryName = "biological";
11811 break;
11813 entryName = "chemical";
11814 break;
11815 default:
11816 entryName = "biological";
11817 break;
11818 }
11819
11820 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11821
11823 }
11824
11825
11826
11829 {
11830 if (!IsMagazine())
11832
11834 }
11835
11836
11837
11838
11839
11844 {
11845 return true;
11846 }
11847
11849 {
11851 }
11852
11853
11854
11855
11856
11858 {
11859 if (parent)
11860 {
11861 if (parent.IsInherited(DayZInfected))
11862 return true;
11863
11864 if (!parent.IsRuined())
11865 return true;
11866 }
11867
11868 return true;
11869 }
11870
11872 {
11873 if (!super.CanPutAsAttachment(parent))
11874 {
11875 return false;
11876 }
11877
11878 if (!IsRuined() && !parent.IsRuined())
11879 {
11880 return true;
11881 }
11882
11883 return false;
11884 }
11885
11887 {
11888
11889
11890
11891
11892 return super.CanReceiveItemIntoCargo(item);
11893 }
11894
11896 {
11897
11898
11899
11900
11901 GameInventory attachmentInv = attachment.GetInventory();
11903 {
11904 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11905 return false;
11906 }
11907
11908 InventoryLocation loc = new InventoryLocation();
11909 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11910 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11911 return false;
11912
11913 return super.CanReceiveAttachment(attachment, slotId);
11914 }
11915
11917 {
11918 if (!super.CanReleaseAttachment(attachment))
11919 return false;
11920
11921 return GetInventory().AreChildrenAccessible();
11922 }
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11945 {
11946 int id = muzzle_owner.GetMuzzleID();
11947 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11948
11949 if (WPOF_array)
11950 {
11951 for (int i = 0; i < WPOF_array.Count(); i++)
11952 {
11953 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11954
11955 if (WPOF)
11956 {
11957 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11958 }
11959 }
11960 }
11961 }
11962
11963
11965 {
11966 int id = muzzle_owner.GetMuzzleID();
11968
11969 if (WPOBE_array)
11970 {
11971 for (int i = 0; i < WPOBE_array.Count(); i++)
11972 {
11973 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11974
11975 if (WPOBE)
11976 {
11977 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11978 }
11979 }
11980 }
11981 }
11982
11983
11985 {
11986 int id = muzzle_owner.GetMuzzleID();
11987 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11988
11989 if (WPOOH_array)
11990 {
11991 for (int i = 0; i < WPOOH_array.Count(); i++)
11992 {
11993 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11994
11995 if (WPOOH)
11996 {
11997 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11998 }
11999 }
12000 }
12001 }
12002
12003
12005 {
12006 int id = muzzle_owner.GetMuzzleID();
12007 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12008
12009 if (WPOOH_array)
12010 {
12011 for (int i = 0; i < WPOOH_array.Count(); i++)
12012 {
12013 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12014
12015 if (WPOOH)
12016 {
12017 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12018 }
12019 }
12020 }
12021 }
12022
12023
12025 {
12026 int id = muzzle_owner.GetMuzzleID();
12027 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12028
12029 if (WPOOH_array)
12030 {
12031 for (int i = 0; i < WPOOH_array.Count(); i++)
12032 {
12033 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12034
12035 if (WPOOH)
12036 {
12037 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12038 }
12039 }
12040 }
12041 }
12042
12043
12044
12046 {
12048 {
12049 return true;
12050 }
12051
12052 return false;
12053 }
12054
12056 {
12058 {
12059 return true;
12060 }
12061
12062 return false;
12063 }
12064
12066 {
12068 {
12069 return true;
12070 }
12071
12072 return false;
12073 }
12074
12076 {
12077 return false;
12078 }
12079
12082 {
12083 return UATimeSpent.DEFAULT_DEPLOY;
12084 }
12085
12086
12087
12088
12090 {
12092 SetSynchDirty();
12093 }
12094
12096 {
12098 }
12099
12100
12102 {
12103 return false;
12104 }
12105
12108 {
12109 string att_type = "None";
12110
12111 if (ConfigIsExisting("soundAttType"))
12112 {
12113 att_type = ConfigGetString("soundAttType");
12114 }
12115
12117 }
12118
12120 {
12122 }
12123
12124
12125
12126
12127
12133
12135 {
12138
12140 }
12141
12142
12144 {
12146 return;
12147
12149
12152
12155
12156 SoundParameters params = new SoundParameters();
12160 }
12161
12162
12164 {
12166 return;
12167
12169 SetSynchDirty();
12170
12173 }
12174
12175
12177 {
12179 return;
12180
12182 SetSynchDirty();
12183
12186 }
12187
12189 {
12191 }
12192
12194 {
12196 }
12197
12200 {
12201 if (!
GetGame().IsDedicatedServer())
12202 {
12203 if (ConfigIsExisting("attachSoundSet"))
12204 {
12205 string cfg_path = "";
12206 string soundset = "";
12207 string type_name =
GetType();
12208
12211 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12212 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12213
12214 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12215 {
12216 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12217 {
12218 if (cfg_slot_array[i] == slot_type)
12219 {
12220 soundset = cfg_soundset_array[i];
12221 break;
12222 }
12223 }
12224 }
12225
12226 if (soundset != "")
12227 {
12228 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12230 }
12231 }
12232 }
12233 }
12234
12236 {
12237
12238 }
12239
12240 void OnApply(PlayerBase player);
12241
12243 {
12244 return 1.0;
12245 };
12246
12248 {
12250 }
12251
12253 {
12255 }
12256
12258
12260 {
12261 SetDynamicPhysicsLifeTime(0.01);
12263 }
12264
12266 {
12267 array<string> zone_names = new array<string>;
12268 GetDamageZones(zone_names);
12269 for (int i = 0; i < zone_names.Count(); i++)
12270 {
12271 SetHealthMax(zone_names.Get(i),"Health");
12272 }
12273 SetHealthMax("","Health");
12274 }
12275
12278 {
12279 float global_health = GetHealth01("","Health");
12280 array<string> zones = new array<string>;
12281 GetDamageZones(zones);
12282
12283 for (int i = 0; i < zones.Count(); i++)
12284 {
12285 SetHealth01(zones.Get(i),"Health",global_health);
12286 }
12287 }
12288
12291 {
12292 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12293 }
12294
12296 {
12297 if (!hasRootAsPlayer)
12298 {
12299 if (refParentIB)
12300 {
12301
12302 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12303 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12304
12305 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12306 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12307
12310 }
12311 else
12312 {
12313
12316 }
12317 }
12318 }
12319
12321 {
12323 {
12324 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12325 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12326 {
12327 float heatPermCoef = 1.0;
12329 while (ent)
12330 {
12331 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12332 ent = ent.GetHierarchyParent();
12333 }
12334
12335 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12336 }
12337 }
12338 }
12339
12341 {
12342
12343 EntityAI parent = GetHierarchyParent();
12344 if (!parent)
12345 {
12346 hasParent = false;
12347 hasRootAsPlayer = false;
12348 }
12349 else
12350 {
12351 hasParent = true;
12352 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12353 refParentIB =
ItemBase.Cast(parent);
12354 }
12355 }
12356
12357 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12358 {
12359
12360 }
12361
12363 {
12364
12365 return false;
12366 }
12367
12369 {
12370
12371
12372 return false;
12373 }
12374
12376 {
12377
12378 return false;
12379 }
12380
12383 {
12384 return !GetIsFrozen() &&
IsOpen();
12385 }
12386
12388 {
12389 bool hasParent = false, hasRootAsPlayer = false;
12391
12392 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12393 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12394
12395 if (wwtu || foodDecay)
12396 {
12400
12401 if (processWetness || processTemperature || processDecay)
12402 {
12404
12405 if (processWetness)
12406 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12407
12408 if (processTemperature)
12410
12411 if (processDecay)
12412 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12413 }
12414 }
12415 }
12416
12419 {
12421 }
12422
12424 {
12427
12428 return super.GetTemperatureFreezeThreshold();
12429 }
12430
12432 {
12435
12436 return super.GetTemperatureThawThreshold();
12437 }
12438
12440 {
12443
12444 return super.GetItemOverheatThreshold();
12445 }
12446
12448 {
12450 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12451
12452 return super.GetTemperatureFreezeTime();
12453 }
12454
12456 {
12458 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12459
12460 return super.GetTemperatureThawTime();
12461 }
12462
12467
12469 {
12470 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12471 }
12472
12474 {
12475 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12476 }
12477
12480 {
12482 }
12483
12485 {
12487 }
12488
12490 {
12492 }
12493
12496 {
12497 return null;
12498 }
12499
12502 {
12503 return false;
12504 }
12505
12507 {
12509 {
12512 if (!trg)
12513 {
12515 explosive = this;
12516 }
12517
12518 explosive.PairRemote(trg);
12520
12521 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12522 trg.SetPersistentPairID(persistentID);
12523 explosive.SetPersistentPairID(persistentID);
12524
12525 return true;
12526 }
12527 return false;
12528 }
12529
12532 {
12533 float ret = 1.0;
12536 ret *= GetHealth01();
12537
12538 return ret;
12539 }
12540
12541 #ifdef DEVELOPER
12542 override void SetDebugItem()
12543 {
12544 super.SetDebugItem();
12545 _itemBase = this;
12546 }
12547
12549 {
12550 string text = super.GetDebugText();
12551
12553 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12554
12555 return text;
12556 }
12557 #endif
12558
12560 {
12561 return true;
12562 }
12563
12565
12567
12569 {
12572 }
12573
12574
12582
12598}
12599
12601{
12603 if (entity)
12604 {
12605 bool is_item = entity.IsInherited(
ItemBase);
12606 if (is_item && full_quantity)
12607 {
12610 }
12611 }
12612 else
12613 {
12615 return NULL;
12616 }
12617 return entity;
12618}
12619
12621{
12622 if (item)
12623 {
12624 if (health > 0)
12625 item.SetHealth("", "", health);
12626
12627 if (item.CanHaveTemperature())
12628 {
12630 if (item.CanFreeze())
12631 item.SetFrozen(false);
12632 }
12633
12634 if (item.HasEnergyManager())
12635 {
12636 if (quantity >= 0)
12637 {
12638 item.GetCompEM().SetEnergy0To1(quantity);
12639 }
12640 else
12641 {
12643 }
12644 }
12645 else if (item.IsMagazine())
12646 {
12647 Magazine mag = Magazine.Cast(item);
12648 if (quantity >= 0)
12649 {
12650 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12651 }
12652 else
12653 {
12655 }
12656
12657 }
12658 else
12659 {
12660 if (quantity >= 0)
12661 {
12662 item.SetQuantityNormalized(quantity, false);
12663 }
12664 else
12665 {
12667 }
12668
12669 }
12670 }
12671}
12672
12673#ifdef DEVELOPER
12675#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.