7959{
7961 {
7962 return true;
7963 }
7964};
7965
7966
7967
7969{
7973
7975
7978
7979
7980
7981
7982
7991
7997
8002
8007
8028 protected bool m_IsResultOfSplit
8029
8031
8036
8037
8038
8040
8044
8045
8046
8048
8051
8052
8053
8059
8060
8068
8071
8072
8074
8075
8077
8078
8083
8084
8089
8090
8092
8093
8095 {
8100
8101 if (!
GetGame().IsDedicatedServer())
8102 {
8104 {
8106
8108 {
8110 }
8111 }
8112
8115 }
8116
8117 m_OldLocation = null;
8118
8120 {
8122 }
8123
8124 if (ConfigIsExisting("headSelectionsToHide"))
8125 {
8128 }
8129
8131 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8132 {
8134 }
8135
8137
8138 m_IsResultOfSplit = false;
8139
8141 }
8142
8144 {
8145 super.InitItemVariables();
8146
8152 m_Count = ConfigGetInt(
"count");
8153
8156
8161
8164
8169
8181
8185
8186
8189 if (ConfigIsExisting("canBeSplit"))
8190 {
8193 }
8194
8196 if (ConfigIsExisting("itemBehaviour"))
8198
8199
8202 RegisterNetSyncVariableInt("m_VarLiquidType");
8203 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8204
8205 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8206 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8207 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8208
8209 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8210 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8211 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8212 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8213
8214 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8215 RegisterNetSyncVariableBool("m_IsTakeable");
8216 RegisterNetSyncVariableBool("m_IsHologram");
8217
8220 {
8223 }
8224
8226
8228 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8230
8231 }
8232
8234 {
8236 }
8237
8239 {
8242 {
8247 }
8248 }
8249
8250 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8251 {
8253 {
8256 }
8257
8259 }
8260
8262 {
8268 }
8269
8271
8273 {
8275
8276 if (!action)
8277 {
8278 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8279 return;
8280 }
8281
8283 if (!ai)
8284 {
8286 return;
8287 }
8288
8290 if (!action_array)
8291 {
8292 action_array = new array<ActionBase_Basic>;
8294 }
8295 if (LogManager.IsActionLogEnable())
8296 {
8297 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8298 }
8299
8300 if (action_array.Find(action) != -1)
8301 {
8302 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8303 }
8304 else
8305 {
8306 action_array.Insert(action);
8307 }
8308 }
8309
8311 {
8313 ActionBase action = player.GetActionManager().GetAction(actionName);
8316
8317 if (action_array)
8318 {
8319 action_array.RemoveItem(action);
8320 }
8321 }
8322
8323
8324
8326 {
8327 ActionOverrideData overrideData = new ActionOverrideData();
8331
8333 if (!actionMap)
8334 {
8337 }
8338
8339 actionMap.Insert(this.
Type(), overrideData);
8340
8341 }
8342
8344
8346
8347
8349 {
8352
8355
8356 string config_to_search = "CfgVehicles";
8357 string muzzle_owner_config;
8358
8360 {
8361 if (IsInherited(Weapon))
8362 config_to_search = "CfgWeapons";
8363
8364 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8365
8366 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8367
8369
8370 if (config_OnFire_subclass_count > 0)
8371 {
8372 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8373
8374 for (int i = 0; i < config_OnFire_subclass_count; i++)
8375 {
8376 string particle_class = "";
8378 string config_OnFire_entry = config_OnFire_class + particle_class;
8379 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8380 WPOF_array.Insert(WPOF);
8381 }
8382
8383
8385 }
8386 }
8387
8389 {
8390 config_to_search = "CfgWeapons";
8391 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8392
8393 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8394
8396
8397 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8398 {
8399 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8400
8401 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8402 {
8403 string particle_class2 = "";
8405 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8406 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8407 WPOBE_array.Insert(WPOBE);
8408 }
8409
8410
8412 }
8413 }
8414 }
8415
8416
8418 {
8421
8423 {
8424 string config_to_search = "CfgVehicles";
8425
8426 if (IsInherited(Weapon))
8427 config_to_search = "CfgWeapons";
8428
8429 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8430 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8431
8432 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8433 {
8434
8436
8438 {
8440 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8442 return;
8443 }
8444
8447
8448
8449
8451 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8452
8453 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8454 {
8455 string particle_class = "";
8457 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8459
8460 if (entry_type == CT_CLASS)
8461 {
8462 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8463 WPOOH_array.Insert(WPOF);
8464 }
8465 }
8466
8467
8469 }
8470 }
8471 }
8472
8474 {
8476 }
8477
8479 {
8481 {
8483
8486
8489
8490 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8491 }
8492 }
8493
8495 {
8497 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8498
8500 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8501
8503 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8504
8506 {
8508 }
8509 }
8510
8512 {
8514 }
8515
8517 {
8520 else
8522
8524 {
8527 }
8528 else
8529 {
8532
8535 }
8536
8538 }
8539
8541 {
8543 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8544 }
8545
8547 {
8549 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8551 }
8552
8554 {
8556 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8557 }
8558
8560 {
8563
8564 OverheatingParticle OP = new OverheatingParticle();
8569
8571 }
8572
8574 {
8577
8578 return -1;
8579 }
8580
8582 {
8584 {
8587
8588 for (int i = count; i > 0; --i)
8589 {
8590 int id = i - 1;
8593
8596
8597 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8598 {
8599 if (p)
8600 {
8603 }
8604 }
8605 }
8606 }
8607 }
8608
8610 {
8612 {
8614 {
8615 int id = i - 1;
8617
8618 if (OP)
8619 {
8621
8622 if (p)
8623 {
8625 }
8626
8627 delete OP;
8628 }
8629 }
8630
8633 }
8634 }
8635
8638 {
8639 return 0.0;
8640 }
8641
8642
8644 {
8645 return 250;
8646 }
8647
8649 {
8650 return 0;
8651 }
8652
8655 {
8657 return true;
8658
8659 return false;
8660 }
8661
8664 {
8667
8669 {
8671 }
8672 else
8673 {
8674
8676 }
8677
8679 }
8680
8687 {
8688 return -1;
8689 }
8690
8691
8692
8693
8695 {
8697 {
8699 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8700
8701 if (r_index >= 0)
8702 {
8703 InventoryLocation r_il = new InventoryLocation;
8704 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8705
8706 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8709 {
8710 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8711 }
8713 {
8714 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8715 }
8716
8717 }
8718
8719 player.GetHumanInventory().ClearUserReservedLocation(this);
8720 }
8721
8724 }
8725
8726
8727
8728
8730 {
8731 return ItemBase.m_DebugActionsMask;
8732 }
8733
8735 {
8736 return ItemBase.m_DebugActionsMask & mask;
8737 }
8738
8740 {
8741 ItemBase.m_DebugActionsMask = mask;
8742 }
8743
8745 {
8746 ItemBase.m_DebugActionsMask |= mask;
8747 }
8748
8750 {
8751 ItemBase.m_DebugActionsMask &= ~mask;
8752 }
8753
8755 {
8757 {
8759 }
8760 else
8761 {
8763 }
8764 }
8765
8766
8768 {
8769 if (GetEconomyProfile())
8770 {
8771 float q_max = GetEconomyProfile().GetQuantityMax();
8772 if (q_max > 0)
8773 {
8774 float q_min = GetEconomyProfile().GetQuantityMin();
8775 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8776
8778 {
8779 ComponentEnergyManager comp = GetCompEM();
8781 {
8783 }
8784 }
8786 {
8788
8789 }
8790
8791 }
8792 }
8793 }
8794
8797 {
8798 EntityAI parent = GetHierarchyParent();
8799
8800 if (parent)
8801 {
8802 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8803 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8804 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8805 }
8806 }
8807
8810 {
8811 EntityAI parent = GetHierarchyParent();
8812
8813 if (parent)
8814 {
8815 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8816 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8817 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8818 }
8819 }
8820
8822 {
8823
8824
8825
8826
8828
8830 {
8831 if (ScriptInputUserData.CanStoreInputUserData())
8832 {
8833 ScriptInputUserData ctx = new ScriptInputUserData;
8839 ctx.
Write(use_stack_max);
8842
8844 {
8845 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8846 }
8847 }
8848 }
8849 else if (!
GetGame().IsMultiplayer())
8850 {
8852 }
8853 }
8854
8856 {
8858 }
8859
8861 {
8863 }
8864
8866 {
8868 }
8869
8871 {
8872
8873 return false;
8874 }
8875
8877 {
8878 return false;
8879 }
8880
8884 {
8885 return false;
8886 }
8887
8889 {
8890 return "";
8891 }
8892
8894
8896 {
8897 return false;
8898 }
8899
8901 {
8902 return true;
8903 }
8904
8905
8906
8908 {
8909 return true;
8910 }
8911
8913 {
8914 return true;
8915 }
8916
8918 {
8919 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8921 }
8922
8924 {
8926 }
8927
8929 {
8931 if (!is_being_placed)
8933 SetSynchDirty();
8934 }
8935
8936
8938
8940 {
8942 }
8943
8945 {
8947 }
8948
8950 {
8951 return 1;
8952 }
8953
8955 {
8956 return false;
8957 }
8958
8960 {
8962 SetSynchDirty();
8963 }
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
9000 {
9001 super.OnMovedInsideCargo(container);
9002
9003 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9004 }
9005
9006 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9007 {
9008 super.EEItemLocationChanged(oldLoc,newLoc);
9009
9010 PlayerBase new_player = null;
9011 PlayerBase old_player = null;
9012
9013 if (newLoc.GetParent())
9014 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9015
9016 if (oldLoc.GetParent())
9017 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9018
9020 {
9021 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9022
9023 if (r_index >= 0)
9024 {
9025 InventoryLocation r_il = new InventoryLocation;
9026 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9027
9028 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9031 {
9032 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9033 }
9035 {
9036 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9037 }
9038
9039 }
9040 }
9041
9043 {
9044 if (new_player)
9045 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9046
9047 if (new_player == old_player)
9048 {
9049
9050 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9051 {
9053 {
9054 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9055 {
9056 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9057 }
9058 }
9059 else
9060 {
9061 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9062 }
9063 }
9064
9065 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9066 {
9067 int type = oldLoc.GetType();
9069 {
9070 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9071 }
9073 {
9074 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9075 }
9076 }
9077 if (!m_OldLocation)
9078 {
9079 m_OldLocation = new InventoryLocation;
9080 }
9081 m_OldLocation.Copy(oldLoc);
9082 }
9083 else
9084 {
9085 if (m_OldLocation)
9086 {
9087 m_OldLocation.Reset();
9088 }
9089 }
9090
9092 }
9093 else
9094 {
9095 if (new_player)
9096 {
9097 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9098 if (res_index >= 0)
9099 {
9100 InventoryLocation il = new InventoryLocation;
9101 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9103 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9106 {
9107 il.
GetParent().GetOnReleaseLock().Invoke(it);
9108 }
9110 {
9112 }
9113
9114 }
9115 }
9117 {
9118
9120 }
9121
9122 if (m_OldLocation)
9123 {
9124 m_OldLocation.Reset();
9125 }
9126 }
9127 }
9128
9129 override void EOnContact(IEntity other, Contact extra)
9130 {
9132 {
9133 int liquidType = -1;
9135 if (impactSpeed > 0.0)
9136 {
9138 #ifndef SERVER
9140 #else
9142 SetSynchDirty();
9143 #endif
9145 }
9146 }
9147
9148 #ifdef SERVER
9149 if (GetCompEM() && GetCompEM().IsPlugged())
9150 {
9151 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9152 GetCompEM().UnplugThis();
9153 }
9154 #endif
9155 }
9156
9158
9160 {
9162 }
9163
9165 {
9166
9167 }
9168
9170 {
9171 super.OnItemLocationChanged(old_owner, new_owner);
9172
9173 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9174 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9175
9176 if (!relatedPlayer && playerNew)
9177 relatedPlayer = playerNew;
9178
9179 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9180 {
9182 if (actionMgr)
9183 {
9184 ActionBase currentAction = actionMgr.GetRunningAction();
9185 if (currentAction)
9187 }
9188 }
9189
9190 Man ownerPlayerOld = null;
9191 Man ownerPlayerNew = null;
9192
9193 if (old_owner)
9194 {
9195 if (old_owner.
IsMan())
9196 {
9197 ownerPlayerOld = Man.Cast(old_owner);
9198 }
9199 else
9200 {
9201 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9202 }
9203 }
9204 else
9205 {
9207 {
9209
9210 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9211 {
9212 GetCompEM().UnplugThis();
9213 }
9214 }
9215 }
9216
9217 if (new_owner)
9218 {
9219 if (new_owner.
IsMan())
9220 {
9221 ownerPlayerNew = Man.Cast(new_owner);
9222 }
9223 else
9224 {
9225 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9226 }
9227 }
9228
9229 if (ownerPlayerOld != ownerPlayerNew)
9230 {
9231 if (ownerPlayerOld)
9232 {
9233 array<EntityAI> subItemsExit = new array<EntityAI>;
9235 for (int i = 0; i < subItemsExit.Count(); i++)
9236 {
9239 }
9240 }
9241
9242 if (ownerPlayerNew)
9243 {
9244 array<EntityAI> subItemsEnter = new array<EntityAI>;
9246 for (int j = 0; j < subItemsEnter.Count(); j++)
9247 {
9250 }
9251 }
9252 }
9253 else if (ownerPlayerNew != null)
9254 {
9255 PlayerBase nplayer;
9256 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9257 {
9258 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9260 for (int k = 0; k < subItemsUpdate.Count(); k++)
9261 {
9263 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9264 }
9265 }
9266 }
9267
9268 if (old_owner)
9269 old_owner.OnChildItemRemoved(this);
9270 if (new_owner)
9271 new_owner.OnChildItemReceived(this);
9272 }
9273
9274
9276 {
9277 super.EEDelete(parent);
9278 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9279 if (player)
9280 {
9282
9283 if (player.IsAlive())
9284 {
9285 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9286 if (r_index >= 0)
9287 {
9288 InventoryLocation r_il = new InventoryLocation;
9289 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9290
9291 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9294 {
9295 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9296 }
9298 {
9299 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9300 }
9301
9302 }
9303
9304 player.RemoveQuickBarEntityShortcut(this);
9305 }
9306 }
9307 }
9308
9310 {
9311 super.EEKilled(killer);
9312
9315 {
9316 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9317 {
9318 if (IsMagazine())
9319 {
9320 if (Magazine.Cast(this).GetAmmoCount() > 0)
9321 {
9323 }
9324 }
9325 else
9326 {
9328 }
9329 }
9330 }
9331 }
9332
9334 {
9335 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9336
9337 super.OnWasAttached(parent, slot_id);
9338
9341
9343 }
9344
9346 {
9347 super.OnWasDetached(parent, slot_id);
9348
9351 }
9352
9354 {
9355 int idx;
9358
9359 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9360 if (inventory_slots.Count() < 1)
9361 {
9362 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9363 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9364 }
9365 else
9366 {
9367 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9368 }
9369
9370 idx = inventory_slots.Find(slot);
9371 if (idx < 0)
9372 return "";
9373
9374 return attach_types.Get(idx);
9375 }
9376
9378 {
9379 int idx = -1;
9380 string slot;
9381
9384
9385 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9386 if (inventory_slots.Count() < 1)
9387 {
9388 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9389 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9390 }
9391 else
9392 {
9393 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9394 if (detach_types.Count() < 1)
9395 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9396 }
9397
9398 for (int i = 0; i < inventory_slots.Count(); i++)
9399 {
9400 slot = inventory_slots.Get(i);
9401 }
9402
9403 if (slot != "")
9404 {
9405 if (detach_types.Count() == 1)
9406 idx = 0;
9407 else
9408 idx = inventory_slots.Find(slot);
9409 }
9410 if (idx < 0)
9411 return "";
9412
9413 return detach_types.Get(idx);
9414 }
9415
9417 {
9418
9420
9421
9422 float min_time = 1;
9423 float max_time = 3;
9424 float delay = Math.RandomFloat(min_time, max_time);
9425
9426 explode_timer.Run(delay, this, "DoAmmoExplosion");
9427 }
9428
9430 {
9431 Magazine magazine = Magazine.Cast(this);
9432 int pop_sounds_count = 6;
9433 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9434
9435
9436 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9437 string sound_name = pop_sounds[ sound_idx ];
9439
9440
9441 magazine.ServerAddAmmoCount(-1);
9442
9443
9444 float min_temp_to_explode = 100;
9445
9446 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9447 {
9449 }
9450 }
9451
9452
9453 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9454 {
9455 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9456
9457 const int CHANCE_DAMAGE_CARGO = 4;
9458 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9459 const int CHANCE_DAMAGE_NOTHING = 2;
9460
9462 {
9463 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9464 int chances;
9465 int rnd;
9466
9467 if (GetInventory().GetCargo())
9468 {
9469 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9470 rnd = Math.RandomInt(0,chances);
9471
9472 if (rnd < CHANCE_DAMAGE_CARGO)
9473 {
9475 }
9476 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9477 {
9479 }
9480 }
9481 else
9482 {
9483 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9484 rnd = Math.RandomInt(0,chances);
9485
9486 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9487 {
9489 }
9490 }
9491 }
9492 }
9493
9495 {
9496 if (GetInventory().GetCargo())
9497 {
9498 int item_count = GetInventory().GetCargo().GetItemCount();
9499 if (item_count > 0)
9500 {
9501 int random_pick = Math.RandomInt(0, item_count);
9503 if (!item.IsExplosive())
9504 {
9505 item.AddHealth("","",damage);
9506 return true;
9507 }
9508 }
9509 }
9510 return false;
9511 }
9512
9514 {
9515 int attachment_count = GetInventory().AttachmentCount();
9516 if (attachment_count > 0)
9517 {
9518 int random_pick = Math.RandomInt(0, attachment_count);
9519 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9520 if (!attachment.IsExplosive())
9521 {
9522 attachment.AddHealth("","",damage);
9523 return true;
9524 }
9525 }
9526 return false;
9527 }
9528
9530 {
9532 }
9533
9535 {
9537 return GetInventory().CanRemoveEntity();
9538
9539 return false;
9540 }
9541
9543 {
9545 return;
9546
9548 {
9549 if (ScriptInputUserData.CanStoreInputUserData())
9550 {
9551 ScriptInputUserData ctx = new ScriptInputUserData;
9556 ctx.
Write(destination_entity);
9560 }
9561 }
9562 else if (!
GetGame().IsMultiplayer())
9563 {
9565 }
9566 }
9567
9569 {
9571 return;
9572
9573 float split_quantity_new;
9577 InventoryLocation loc = new InventoryLocation;
9578
9579 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9580 {
9582 split_quantity_new = stack_max;
9583 else
9585
9586 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9587 if (new_item)
9588 {
9589 new_item.SetResultOfSplit(true);
9590 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9592 new_item.SetQuantity(split_quantity_new);
9593 }
9594 }
9595 else if (destination_entity && slot_id == -1)
9596 {
9597 if (quantity > stack_max)
9598 split_quantity_new = stack_max;
9599 else
9600 split_quantity_new = quantity;
9601
9603 {
9606 }
9607
9608 if (new_item)
9609 {
9610 new_item.SetResultOfSplit(true);
9611 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9613 new_item.SetQuantity(split_quantity_new);
9614 }
9615 }
9616 else
9617 {
9618 if (stack_max != 0)
9619 {
9621 {
9623 }
9624
9625 if (split_quantity_new == 0)
9626 {
9627 if (!
GetGame().IsMultiplayer())
9628 player.PhysicalPredictiveDropItem(this);
9629 else
9630 player.ServerDropEntity(this);
9631 return;
9632 }
9633
9635
9636 if (new_item)
9637 {
9638 new_item.SetResultOfSplit(true);
9639 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9641 new_item.SetQuantity(stack_max);
9642 new_item.PlaceOnSurface();
9643 }
9644 }
9645 }
9646 }
9647
9649 {
9651 return;
9652
9653 float split_quantity_new;
9657 InventoryLocation loc = new InventoryLocation;
9658
9659 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9660 {
9662 split_quantity_new = stack_max;
9663 else
9665
9666 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9667 if (new_item)
9668 {
9669 new_item.SetResultOfSplit(true);
9670 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9672 new_item.SetQuantity(split_quantity_new);
9673 }
9674 }
9675 else if (destination_entity && slot_id == -1)
9676 {
9677 if (quantity > stack_max)
9678 split_quantity_new = stack_max;
9679 else
9680 split_quantity_new = quantity;
9681
9683 {
9686 }
9687
9688 if (new_item)
9689 {
9690 new_item.SetResultOfSplit(true);
9691 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9693 new_item.SetQuantity(split_quantity_new);
9694 }
9695 }
9696 else
9697 {
9698 if (stack_max != 0)
9699 {
9701 {
9703 }
9704
9706
9707 if (new_item)
9708 {
9709 new_item.SetResultOfSplit(true);
9710 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9712 new_item.SetQuantity(stack_max);
9713 new_item.PlaceOnSurface();
9714 }
9715 }
9716 }
9717 }
9718
9720 {
9722 return;
9723
9725 {
9726 if (ScriptInputUserData.CanStoreInputUserData())
9727 {
9728 ScriptInputUserData ctx = new ScriptInputUserData;
9733 dst.WriteToContext(ctx);
9735 }
9736 }
9737 else if (!
GetGame().IsMultiplayer())
9738 {
9740 }
9741 }
9742
9744 {
9746 return;
9747
9749 {
9750 if (ScriptInputUserData.CanStoreInputUserData())
9751 {
9752 ScriptInputUserData ctx = new ScriptInputUserData;
9757 ctx.
Write(destination_entity);
9763 }
9764 }
9765 else if (!
GetGame().IsMultiplayer())
9766 {
9768 }
9769 }
9770
9772 {
9774 }
9775
9777 {
9779 return this;
9780
9782 float split_quantity_new;
9784 if (dst.IsValid())
9785 {
9786 int slot_id = dst.GetSlot();
9788
9789 if (quantity > stack_max)
9790 split_quantity_new = stack_max;
9791 else
9792 split_quantity_new = quantity;
9793
9795
9796 if (new_item)
9797 {
9798 new_item.SetResultOfSplit(true);
9799 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9802 }
9803
9804 return new_item;
9805 }
9806
9807 return null;
9808 }
9809
9811 {
9813 return;
9814
9816 float split_quantity_new;
9818 if (destination_entity)
9819 {
9821 if (quantity > stackable)
9822 split_quantity_new = stackable;
9823 else
9824 split_quantity_new = quantity;
9825
9826 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9827 if (new_item)
9828 {
9829 new_item.SetResultOfSplit(true);
9830 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9832 new_item.SetQuantity(split_quantity_new);
9833 }
9834 }
9835 }
9836
9838 {
9840 return;
9841
9843 {
9844 if (ScriptInputUserData.CanStoreInputUserData())
9845 {
9846 ScriptInputUserData ctx = new ScriptInputUserData;
9851 ItemBase destination_entity =
this;
9852 ctx.
Write(destination_entity);
9856 }
9857 }
9858 else if (!
GetGame().IsMultiplayer())
9859 {
9861 }
9862 }
9863
9865 {
9867 return;
9868
9870 float split_quantity_new;
9872 if (player)
9873 {
9875 if (quantity > stackable)
9876 split_quantity_new = stackable;
9877 else
9878 split_quantity_new = quantity;
9879
9880 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9881 new_item =
ItemBase.Cast(in_hands);
9882 if (new_item)
9883 {
9884 new_item.SetResultOfSplit(true);
9885 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9887 new_item.SetQuantity(split_quantity_new);
9888 }
9889 }
9890 }
9891
9893 {
9895 return;
9896
9898 float split_quantity_new = Math.Floor(quantity * 0.5);
9899
9901
9902 if (new_item)
9903 {
9904 if (new_item.GetQuantityMax() < split_quantity_new)
9905 {
9906 split_quantity_new = new_item.GetQuantityMax();
9907 }
9908
9909 new_item.SetResultOfSplit(true);
9910 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9911
9913 {
9916 }
9917 else
9918 {
9921 }
9922 }
9923 }
9924
9926 {
9928 return;
9929
9931 float split_quantity_new = Math.Floor(quantity / 2);
9932
9933 InventoryLocation invloc = new InventoryLocation;
9935
9937 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9938
9939 if (new_item)
9940 {
9941 if (new_item.GetQuantityMax() < split_quantity_new)
9942 {
9943 split_quantity_new = new_item.GetQuantityMax();
9944 }
9946 {
9949 }
9950 else
9951 {
9954 }
9955 }
9956 }
9957
9960 {
9961 SetWeightDirty();
9963
9964 if (parent)
9965 parent.OnAttachmentQuantityChangedEx(this, delta);
9966
9968 {
9970 {
9972 }
9974 {
9975 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9977 }
9978 }
9979
9980 }
9981
9984 {
9985
9986 }
9987
9990 {
9992 }
9993
9995 {
9996 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9997
9999 {
10000 if (newLevel == GameConstants.STATE_RUINED)
10001 {
10003 EntityAI parent = GetHierarchyParent();
10004 if (parent && parent.IsFireplace())
10005 {
10006 CargoBase cargo = GetInventory().GetCargo();
10007 if (cargo)
10008 {
10010 {
10012 }
10013 }
10014 }
10015 }
10016
10018 {
10019
10021 return;
10022 }
10023
10024 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10025 {
10027 }
10028 }
10029 }
10030
10031
10033 {
10034 super.OnRightClick();
10035
10037 {
10039 {
10040 if (ScriptInputUserData.CanStoreInputUserData())
10041 {
10042 vector m4[4];
10044
10045 EntityAI root = GetHierarchyRoot();
10046
10047 InventoryLocation dst = new InventoryLocation;
10049 {
10050 if (root)
10051 {
10052 root.GetTransform(m4);
10054 }
10055 else
10056 GetInventory().GetCurrentInventoryLocation(dst);
10057 }
10058 else
10059 {
10061
10062
10063 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10064 {
10065 if (root)
10066 {
10067 root.GetTransform(m4);
10069 }
10070 else
10071 GetInventory().GetCurrentInventoryLocation(dst);
10072 }
10073 else
10074 {
10075 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10076 }
10077 }
10078
10079 ScriptInputUserData ctx = new ScriptInputUserData;
10087 }
10088 }
10089 else if (!
GetGame().IsMultiplayer())
10090 {
10092 }
10093 }
10094 }
10095
10096 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10097 {
10098
10099 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10100 return false;
10101
10102 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10103 return false;
10104
10105
10107 return false;
10108
10109
10110 Magazine mag = Magazine.Cast(this);
10111 if (mag)
10112 {
10113 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10114 return false;
10115
10116 if (stack_max_limit)
10117 {
10118 Magazine other_mag = Magazine.Cast(other_item);
10119 if (other_item)
10120 {
10121 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10122 return false;
10123 }
10124
10125 }
10126 }
10127 else
10128 {
10129
10131 return false;
10132
10134 return false;
10135 }
10136
10137 PlayerBase player = null;
10138 if (CastTo(player, GetHierarchyRootPlayer()))
10139 {
10140 if (player.GetInventory().HasAttachment(this))
10141 return false;
10142
10143 if (player.IsItemsToDelete())
10144 return false;
10145 }
10146
10147 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10148 return false;
10149
10150 int slotID;
10152 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10153 return false;
10154
10155 return true;
10156 }
10157
10159 {
10161 }
10162
10164 {
10165 return m_IsResultOfSplit;
10166 }
10167
10169 {
10170 m_IsResultOfSplit = value;
10171 }
10172
10174 {
10176 }
10177
10179 {
10180 float other_item_quantity = other_item.GetQuantity();
10181 float this_free_space;
10182
10184
10186
10187 if (other_item_quantity > this_free_space)
10188 {
10189 return this_free_space;
10190 }
10191 else
10192 {
10193 return other_item_quantity;
10194 }
10195 }
10196
10198 {
10200 }
10201
10203 {
10205 return;
10206
10207 if (!IsMagazine() && other_item)
10208 {
10210 if (quantity_used != 0)
10211 {
10212 float hp1 = GetHealth01("","");
10213 float hp2 = other_item.GetHealth01("","");
10214 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10215 hpResult = hpResult / (
GetQuantity() + quantity_used);
10216
10217 hpResult *= GetMaxHealth();
10218 Math.Round(hpResult);
10219 SetHealth("", "Health", hpResult);
10220
10222 other_item.AddQuantity(-quantity_used);
10223 }
10224 }
10226 }
10227
10229 {
10230 #ifdef SERVER
10231 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10232 GetHierarchyParent().IncreaseLifetimeUp();
10233 #endif
10234 };
10235
10237 {
10238 PlayerBase p = PlayerBase.Cast(player);
10239
10240 array<int> recipesIds = p.m_Recipes;
10241 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10242 if (moduleRecipesManager)
10243 {
10244 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10245 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10246 }
10247
10248 for (int i = 0;i < recipesIds.Count(); i++)
10249 {
10250 int key = recipesIds.Get(i);
10251 string recipeName = moduleRecipesManager.GetRecipeName(key);
10253 }
10254 }
10255
10256
10257 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10258 {
10259 super.GetDebugActions(outputList);
10260
10261
10266
10267
10271
10275
10276
10279
10280
10282 {
10285 }
10286
10288
10291
10295 }
10296
10297
10298
10299
10301 {
10302 super.OnAction(action_id, player, ctx);
10303 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10304 {
10305 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10306 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10307 PlayerBase p = PlayerBase.Cast(player);
10308 if (
EActions.RECIPES_RANGE_START < 1000)
10309 {
10310 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10311 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10312 }
10313 }
10314 #ifndef SERVER
10315 else if (action_id ==
EActions.WATCH_PLAYER)
10316 {
10317 PluginDeveloper.SetDeveloperItemClientEx(player);
10318 }
10319 #endif
10321 {
10322 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10323 {
10324 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10325 OnDebugButtonPressServer(id + 1);
10326 }
10327
10328 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10329 {
10330 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10332 }
10333
10334 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10335 {
10336 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10338 }
10339
10340 else if (action_id ==
EActions.ADD_QUANTITY)
10341 {
10342 if (IsMagazine())
10343 {
10344 Magazine mag = Magazine.Cast(this);
10345 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10346 }
10347 else
10348 {
10350 }
10351
10352 if (m_EM)
10353 {
10354 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10355 }
10356
10357 }
10358
10359 else if (action_id ==
EActions.REMOVE_QUANTITY)
10360 {
10361 if (IsMagazine())
10362 {
10363 Magazine mag2 = Magazine.Cast(this);
10364 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10365 }
10366 else
10367 {
10369 }
10370 if (m_EM)
10371 {
10372 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10373 }
10374
10375 }
10376
10377 else if (action_id ==
EActions.SET_QUANTITY_0)
10378 {
10380
10381 if (m_EM)
10382 {
10383 m_EM.SetEnergy(0);
10384 }
10385 }
10386
10387 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10388 {
10390
10391 if (m_EM)
10392 {
10393 m_EM.SetEnergy(m_EM.GetEnergyMax());
10394 }
10395 }
10396
10397 else if (action_id ==
EActions.ADD_HEALTH)
10398 {
10399 AddHealth("","",GetMaxHealth("","Health")/5);
10400 }
10401 else if (action_id ==
EActions.REMOVE_HEALTH)
10402 {
10403 AddHealth("","",-GetMaxHealth("","Health")/5);
10404 }
10405 else if (action_id ==
EActions.DESTROY_HEALTH)
10406 {
10407 SetHealth01("","",0);
10408 }
10409 else if (action_id ==
EActions.WATCH_ITEM)
10410 {
10412 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10413 #ifdef DEVELOPER
10414 SetDebugDeveloper_item(this);
10415 #endif
10416 }
10417
10418 else if (action_id ==
EActions.ADD_TEMPERATURE)
10419 {
10420 AddTemperature(20);
10421
10422 }
10423
10424 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10425 {
10426 AddTemperature(-20);
10427
10428 }
10429
10430 else if (action_id ==
EActions.FLIP_FROZEN)
10431 {
10432 SetFrozen(!GetIsFrozen());
10433
10434 }
10435
10436 else if (action_id ==
EActions.ADD_WETNESS)
10437 {
10439
10440 }
10441
10442 else if (action_id ==
EActions.REMOVE_WETNESS)
10443 {
10445
10446 }
10447
10448 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10449 {
10452
10453
10454 }
10455
10456 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10457 {
10460 }
10461
10462 else if (action_id ==
EActions.MAKE_SPECIAL)
10463 {
10464 auto debugParams = DebugSpawnParams.WithPlayer(player);
10465 OnDebugSpawnEx(debugParams);
10466 }
10467
10468 else if (action_id ==
EActions.DELETE)
10469 {
10470 Delete();
10471 }
10472
10473 }
10474
10475
10476 return false;
10477 }
10478
10479
10480
10481
10485
10488
10489
10490
10492 {
10493 return false;
10494 }
10495
10496
10498 {
10499 return true;
10500 }
10501
10502
10504 {
10505 return true;
10506 }
10507
10508
10509
10511 {
10512 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10514 }
10515
10518 {
10519 return null;
10520 }
10521
10523 {
10524 return false;
10525 }
10526
10528 {
10529 return false;
10530 }
10531
10535
10536
10538 {
10539 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10540 return module_repairing.CanRepair(this, item_repair_kit);
10541 }
10542
10543
10544 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10545 {
10546 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10547 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10548 }
10549
10550
10552 {
10553
10554
10555
10556
10557
10558
10559
10560
10561 return 1;
10562 }
10563
10564
10565
10567 {
10569 }
10570
10571
10572
10574 {
10576 }
10577
10578
10587 {
10588 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10589
10590 if (player)
10591 {
10592 player.MessageStatus(text);
10593 }
10594 }
10595
10596
10605 {
10606 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10607
10608 if (player)
10609 {
10610 player.MessageAction(text);
10611 }
10612 }
10613
10614
10623 {
10624 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10625
10626 if (player)
10627 {
10628 player.MessageFriendly(text);
10629 }
10630 }
10631
10632
10641 {
10642 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10643
10644 if (player)
10645 {
10646 player.MessageImportant(text);
10647 }
10648 }
10649
10651 {
10652 return true;
10653 }
10654
10655
10656 override bool KindOf(
string tag)
10657 {
10658 bool found = false;
10659 string item_name = this.
GetType();
10662
10663 int array_size = item_tag_array.Count();
10664 for (int i = 0; i < array_size; i++)
10665 {
10666 if (item_tag_array.Get(i) == tag)
10667 {
10668 found = true;
10669 break;
10670 }
10671 }
10672 return found;
10673 }
10674
10675
10677 {
10678
10679 super.OnRPC(sender, rpc_type,ctx);
10680
10681
10682 switch (rpc_type)
10683 {
10684 #ifndef SERVER
10685 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10686 Param2<bool, string> p = new Param2<bool, string>(false, "");
10687
10689 return;
10690
10691 bool play = p.param1;
10692 string soundSet = p.param2;
10693
10694 if (play)
10695 {
10697 {
10699 {
10701 }
10702 }
10703 else
10704 {
10706 }
10707 }
10708 else
10709 {
10711 }
10712
10713 break;
10714 #endif
10715
10716 }
10717
10719 {
10721 }
10722 }
10723
10724
10725
10726
10728 {
10729 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10730 return plugin.GetID(
name);
10731 }
10732
10734 {
10735 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10736 return plugin.GetName(id);
10737 }
10738
10741 {
10742
10743
10744 int varFlags;
10745 if (!ctx.
Read(varFlags))
10746 return;
10747
10748 if (varFlags & ItemVariableFlags.FLOAT)
10749 {
10751 }
10752 }
10753
10755 {
10756
10757 super.SerializeNumericalVars(floats_out);
10758
10759
10760
10762 {
10764 }
10765
10767 {
10769 }
10770
10772 {
10774 }
10775
10777 {
10782 }
10783
10785 {
10787 }
10788 }
10789
10791 {
10792
10793 super.DeSerializeNumericalVars(floats);
10794
10795
10796 int index = 0;
10797 int mask = Math.Round(floats.Get(index));
10798
10799 index++;
10800
10802 {
10804 {
10806 }
10807 else
10808 {
10809 float quantity = floats.Get(index);
10810 SetQuantity(quantity,
true,
false,
false,
false);
10811 }
10812 index++;
10813 }
10814
10816 {
10817 float wet = floats.Get(index);
10819 index++;
10820 }
10821
10823 {
10824 int liquidtype = Math.Round(floats.Get(index));
10826 index++;
10827 }
10828
10830 {
10832 index++;
10834 index++;
10836 index++;
10838 index++;
10839 }
10840
10842 {
10843 int cleanness = Math.Round(floats.Get(index));
10845 index++;
10846 }
10847 }
10848
10850 {
10851 super.WriteVarsToCTX(ctx);
10852
10853
10855 {
10857 }
10858
10860 {
10862 }
10863
10865 {
10867 }
10868
10870 {
10871 int r,g,b,a;
10877 }
10878
10880 {
10882 }
10883 }
10884
10886 {
10887 if (!super.ReadVarsFromCTX(ctx,version))
10888 return false;
10889
10890 int intValue;
10891 float value;
10892
10893 if (version < 140)
10894 {
10895 if (!ctx.
Read(intValue))
10896 return false;
10897
10898 m_VariablesMask = intValue;
10899 }
10900
10902 {
10903 if (!ctx.
Read(value))
10904 return false;
10905
10907 {
10909 }
10910 else
10911 {
10913 }
10914 }
10915
10916 if (version < 140)
10917 {
10919 {
10920 if (!ctx.
Read(value))
10921 return false;
10922 SetTemperatureDirect(value);
10923 }
10924 }
10925
10927 {
10928 if (!ctx.
Read(value))
10929 return false;
10931 }
10932
10934 {
10935 if (!ctx.
Read(intValue))
10936 return false;
10938 }
10939
10941 {
10942 int r,g,b,a;
10944 return false;
10946 return false;
10948 return false;
10950 return false;
10951
10953 }
10954
10956 {
10957 if (!ctx.
Read(intValue))
10958 return false;
10960 }
10961
10962 if (version >= 138 && version < 140)
10963 {
10965 {
10966 if (!ctx.
Read(intValue))
10967 return false;
10968 SetFrozen(intValue);
10969 }
10970 }
10971
10972 return true;
10973 }
10974
10975
10977 {
10980 {
10982 }
10983
10984 if (!super.OnStoreLoad(ctx, version))
10985 {
10987 return false;
10988 }
10989
10990 if (version >= 114)
10991 {
10992 bool hasQuickBarIndexSaved;
10993
10994 if (!ctx.
Read(hasQuickBarIndexSaved))
10995 {
10997 return false;
10998 }
10999
11000 if (hasQuickBarIndexSaved)
11001 {
11002 int itmQBIndex;
11003
11004
11005 if (!ctx.
Read(itmQBIndex))
11006 {
11008 return false;
11009 }
11010
11011 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11012 if (itmQBIndex != -1 && parentPlayer)
11013 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11014 }
11015 }
11016 else
11017 {
11018
11019 PlayerBase player;
11020 int itemQBIndex;
11021 if (version ==
int.
MAX)
11022 {
11023 if (!ctx.
Read(itemQBIndex))
11024 {
11026 return false;
11027 }
11028 }
11029 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11030 {
11031
11032 if (!ctx.
Read(itemQBIndex))
11033 {
11035 return false;
11036 }
11037 if (itemQBIndex != -1 && player)
11038 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11039 }
11040 }
11041
11042 if (version < 140)
11043 {
11044
11045 if (!LoadVariables(ctx, version))
11046 {
11048 return false;
11049 }
11050 }
11051
11052
11054 {
11056 return false;
11057 }
11058 if (version >= 132)
11059 {
11061 if (raib)
11062 {
11064 {
11066 return false;
11067 }
11068 }
11069 }
11070
11072 return true;
11073 }
11074
11075
11076
11078 {
11079 super.OnStoreSave(ctx);
11080
11081 PlayerBase player;
11082 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11083 {
11085
11086 int itemQBIndex = -1;
11087 itemQBIndex = player.FindQuickBarEntityIndex(this);
11088 ctx.
Write(itemQBIndex);
11089 }
11090 else
11091 {
11093 }
11094
11096
11098 if (raib)
11099 {
11101 }
11102 }
11103
11104
11106 {
11107 super.AfterStoreLoad();
11108
11110 {
11112 }
11113
11115 {
11118 }
11119 }
11120
11122 {
11123 super.EEOnAfterLoad();
11124
11126 {
11128 }
11129
11132 }
11133
11135 {
11136 return false;
11137 }
11138
11139
11140
11142 {
11144 {
11145 #ifdef PLATFORM_CONSOLE
11146
11148 {
11150 if (menu)
11151 {
11153 }
11154 }
11155 #endif
11156 }
11157
11159 {
11162 }
11163
11165 {
11166 SetWeightDirty();
11168 }
11170 {
11173 }
11174
11176 {
11179 }
11181 {
11184 }
11185
11186 super.OnVariablesSynchronized();
11187 }
11188
11189
11190
11192 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11193 {
11194 if (!IsServerCheck(allow_client))
11195 return false;
11196
11198 return false;
11199
11202
11203 if (value <= (min + 0.001))
11204 value = min;
11205
11206 if (value == min)
11207 {
11208 if (destroy_config)
11209 {
11210 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11211 if (dstr)
11212 {
11214 this.Delete();
11215 return true;
11216 }
11217 }
11218 else if (destroy_forced)
11219 {
11221 this.Delete();
11222 return true;
11223 }
11224
11226 }
11227
11230
11232 {
11234
11235 if (delta)
11237 }
11238
11240
11241 return false;
11242 }
11243
11244
11246 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11247 {
11249 }
11250
11252 {
11255 }
11256
11258 {
11261 }
11262
11265 {
11266 float value_clamped = Math.Clamp(value, 0, 1);
11268 SetQuantity(result, destroy_config, destroy_forced);
11269 }
11270
11271
11274 {
11276 }
11277
11279 {
11281 }
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11293 {
11294 int slot = -1;
11295 if (GetInventory())
11296 {
11297 InventoryLocation il = new InventoryLocation;
11298 GetInventory().GetCurrentInventoryLocation(il);
11300 }
11301
11303 }
11304
11306 {
11307 float quantity_max = 0;
11308
11310 {
11311 if (attSlotID != -1)
11312 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11313
11314 if (quantity_max <= 0)
11316 }
11317
11318 if (quantity_max <= 0)
11320
11321 return quantity_max;
11322 }
11323
11325 {
11327 }
11328
11330 {
11332 }
11333
11334
11336 {
11338 }
11339
11341 {
11343 }
11344
11346 {
11348 }
11349
11350
11352 {
11353
11354 float weightEx = GetWeightEx();
11355 float special = GetInventoryAndCargoWeight();
11356 return weightEx - special;
11357 }
11358
11359
11361 {
11363 }
11364
11366 {
11368 {
11369 #ifdef DEVELOPER
11370 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11371 {
11372 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11374 }
11375 #endif
11376
11377 return GetQuantity() * GetConfigWeightModified();
11378 }
11379 else if (HasEnergyManager())
11380 {
11381 #ifdef DEVELOPER
11382 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11383 {
11384 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11385 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11386 }
11387 #endif
11388 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11389 }
11390 else
11391 {
11392 #ifdef DEVELOPER
11393 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11394 {
11395 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11396 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11397 }
11398 #endif
11399 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11400 }
11401 }
11402
11405 {
11406 int item_count = 0;
11408
11409 if (GetInventory().GetCargo() != NULL)
11410 {
11411 item_count = GetInventory().GetCargo().GetItemCount();
11412 }
11413
11414 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11415 {
11416 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11417 if (item)
11418 item_count += item.GetNumberOfItems();
11419 }
11420 return item_count;
11421 }
11422
11425 {
11426 float weight = 0;
11427 float wetness = 1;
11428 if (include_wetness)
11431 {
11432 weight = wetness * m_ConfigWeight;
11433 }
11435 {
11436 weight = 1;
11437 }
11438 return weight;
11439 }
11440
11441
11442
11444 {
11445 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11446 {
11447 GameInventory inv = GetInventory();
11448 array<EntityAI> items = new array<EntityAI>;
11450 for (int i = 0; i < items.Count(); i++)
11451 {
11453 if (item)
11454 {
11456 }
11457 }
11458 }
11459 }
11460
11461
11462
11463
11465 {
11466 float energy = 0;
11467 if (HasEnergyManager())
11468 {
11469 energy = GetCompEM().GetEnergy();
11470 }
11471 return energy;
11472 }
11473
11474
11476 {
11477 super.OnEnergyConsumed();
11478
11480 }
11481
11483 {
11484 super.OnEnergyAdded();
11485
11487 }
11488
11489
11491 {
11492 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11493 {
11495 {
11496 float energy_0to1 = GetCompEM().GetEnergy0To1();
11498 }
11499 }
11500 }
11501
11502
11504 {
11505 return ConfigGetFloat("heatIsolation");
11506 }
11507
11509 {
11511 }
11512
11514 {
11515 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11516 if (
GetGame().ConfigIsExisting(paramPath))
11518
11519 return 0.0;
11520 }
11521
11523 {
11524 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11525 if (
GetGame().ConfigIsExisting(paramPath))
11527
11528 return 0.0;
11529 }
11530
11531 override void SetWet(
float value,
bool allow_client =
false)
11532 {
11533 if (!IsServerCheck(allow_client))
11534 return;
11535
11538
11540
11541 m_VarWet = Math.Clamp(value, min, max);
11542
11544 {
11547 }
11548 }
11549
11550 override void AddWet(
float value)
11551 {
11553 }
11554
11556 {
11558 }
11559
11561 {
11563 }
11564
11566 {
11568 }
11569
11571 {
11573 }
11574
11576 {
11578 }
11579
11580 override void OnWetChanged(
float newVal,
float oldVal)
11581 {
11584 if (newLevel != oldLevel)
11585 {
11587 }
11588 }
11589
11591 {
11592 SetWeightDirty();
11593 }
11594
11596 {
11597 return GetWetLevelInternal(
m_VarWet);
11598 }
11599
11600
11601
11603 {
11605 }
11606
11608 {
11610 }
11611
11613 {
11615 }
11616
11618 {
11620 }
11621
11622
11623
11625 {
11626 if (ConfigIsExisting("itemModelLength"))
11627 {
11628 return ConfigGetFloat("itemModelLength");
11629 }
11630 return 0;
11631 }
11632
11634 {
11635 if (ConfigIsExisting("itemAttachOffset"))
11636 {
11637 return ConfigGetFloat("itemAttachOffset");
11638 }
11639 return 0;
11640 }
11641
11642 override void SetCleanness(
int value,
bool allow_client =
false)
11643 {
11644 if (!IsServerCheck(allow_client))
11645 return;
11646
11648
11650
11653 }
11654
11656 {
11658 }
11659
11661 {
11662 return true;
11663 }
11664
11665
11666
11667
11669 {
11671 }
11672
11674 {
11676 }
11677
11678
11679
11680
11681 override void SetColor(
int r,
int g,
int b,
int a)
11682 {
11688 }
11690 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11691 {
11696 }
11697
11699 {
11701 }
11702
11705 {
11706 int r,g,b,a;
11708 r = r/255;
11709 g = g/255;
11710 b = b/255;
11711 a = a/255;
11712 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11713 }
11714
11715
11716
11717 override void SetLiquidType(
int value,
bool allow_client =
false)
11718 {
11719 if (!IsServerCheck(allow_client))
11720 return;
11721
11726 }
11727
11729 {
11730 return ConfigGetInt("varLiquidTypeInit");
11731 }
11732
11734 {
11736 }
11737
11739 {
11741 SetFrozen(false);
11742 }
11743
11746 {
11747 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11748 }
11749
11750
11753 {
11754 PlayerBase nplayer;
11755 if (PlayerBase.CastTo(nplayer, player))
11756 {
11758
11759 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11760 }
11761 }
11762
11763
11766 {
11767 PlayerBase nplayer;
11768 if (PlayerBase.CastTo(nplayer,player))
11769 {
11770
11771 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11772
11773 }
11774
11775
11776 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11777
11778
11779 if (HasEnergyManager())
11780 {
11781 GetCompEM().UpdatePlugState();
11782 }
11783 }
11784
11785
11787 {
11788 super.OnPlacementStarted(player);
11789
11791 }
11792
11793 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11794 {
11796 {
11797 m_AdminLog.OnPlacementComplete(player,
this);
11798 }
11799
11800 super.OnPlacementComplete(player, position, orientation);
11801 }
11802
11803
11804
11805
11806
11808 {
11810 {
11811 return true;
11812 }
11813 else
11814 {
11815 return false;
11816 }
11817 }
11818
11819
11821 {
11823 {
11825 }
11826 }
11827
11828
11830 {
11832 }
11833
11835 {
11837 }
11838
11839 override void InsertAgent(
int agent,
float count = 1)
11840 {
11841 if (count < 1)
11842 return;
11843
11845 }
11846
11849 {
11851 }
11852
11853
11855 {
11857 }
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11901 {
11903 return false;
11904 return true;
11905 }
11906
11908 {
11909
11911 }
11912
11913
11916 {
11917 super.CheckForRoofLimited(timeTresholdMS);
11918
11920 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11921 {
11922 m_PreviousRoofTestTime = time;
11923 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11924 }
11925 }
11926
11927
11929 {
11931 {
11932 return 0;
11933 }
11934
11935 if (GetInventory().GetAttachmentSlotsCount() != 0)
11936 {
11937 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11938 if (filter)
11939 return filter.GetProtectionLevel(type, false, system);
11940 else
11941 return 0;
11942 }
11943
11944 string subclassPath, entryName;
11945
11946 switch (type)
11947 {
11949 entryName = "biological";
11950 break;
11952 entryName = "chemical";
11953 break;
11954 default:
11955 entryName = "biological";
11956 break;
11957 }
11958
11959 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11960
11962 }
11963
11964
11965
11968 {
11969 if (!IsMagazine())
11971
11973 }
11974
11975
11976
11977
11978
11983 {
11984 return true;
11985 }
11986
11988 {
11990 }
11991
11992
11993
11994
11995
11997 {
11998 if (parent)
11999 {
12000 if (parent.IsInherited(DayZInfected))
12001 return true;
12002
12003 if (!parent.IsRuined())
12004 return true;
12005 }
12006
12007 return true;
12008 }
12009
12011 {
12012 if (!super.CanPutAsAttachment(parent))
12013 {
12014 return false;
12015 }
12016
12017 if (!IsRuined() && !parent.IsRuined())
12018 {
12019 return true;
12020 }
12021
12022 return false;
12023 }
12024
12026 {
12027
12028
12029
12030
12031 return super.CanReceiveItemIntoCargo(item);
12032 }
12033
12035 {
12036
12037
12038
12039
12040 GameInventory attachmentInv = attachment.GetInventory();
12042 {
12043 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12044 return false;
12045 }
12046
12047 InventoryLocation loc = new InventoryLocation();
12048 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12049 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12050 return false;
12051
12052 return super.CanReceiveAttachment(attachment, slotId);
12053 }
12054
12056 {
12057 if (!super.CanReleaseAttachment(attachment))
12058 return false;
12059
12060 return GetInventory().AreChildrenAccessible();
12061 }
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12084 {
12085 int id = muzzle_owner.GetMuzzleID();
12086 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12087
12088 if (WPOF_array)
12089 {
12090 for (int i = 0; i < WPOF_array.Count(); i++)
12091 {
12092 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12093
12094 if (WPOF)
12095 {
12096 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12097 }
12098 }
12099 }
12100 }
12101
12102
12104 {
12105 int id = muzzle_owner.GetMuzzleID();
12107
12108 if (WPOBE_array)
12109 {
12110 for (int i = 0; i < WPOBE_array.Count(); i++)
12111 {
12112 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12113
12114 if (WPOBE)
12115 {
12116 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12117 }
12118 }
12119 }
12120 }
12121
12122
12124 {
12125 int id = muzzle_owner.GetMuzzleID();
12126 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12127
12128 if (WPOOH_array)
12129 {
12130 for (int i = 0; i < WPOOH_array.Count(); i++)
12131 {
12132 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12133
12134 if (WPOOH)
12135 {
12136 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12137 }
12138 }
12139 }
12140 }
12141
12142
12144 {
12145 int id = muzzle_owner.GetMuzzleID();
12146 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12147
12148 if (WPOOH_array)
12149 {
12150 for (int i = 0; i < WPOOH_array.Count(); i++)
12151 {
12152 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12153
12154 if (WPOOH)
12155 {
12156 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12157 }
12158 }
12159 }
12160 }
12161
12162
12164 {
12165 int id = muzzle_owner.GetMuzzleID();
12166 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12167
12168 if (WPOOH_array)
12169 {
12170 for (int i = 0; i < WPOOH_array.Count(); i++)
12171 {
12172 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12173
12174 if (WPOOH)
12175 {
12176 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12177 }
12178 }
12179 }
12180 }
12181
12182
12183
12185 {
12187 {
12188 return true;
12189 }
12190
12191 return false;
12192 }
12193
12195 {
12197 {
12198 return true;
12199 }
12200
12201 return false;
12202 }
12203
12205 {
12207 {
12208 return true;
12209 }
12210
12211 return false;
12212 }
12213
12215 {
12216 return false;
12217 }
12218
12221 {
12222 return UATimeSpent.DEFAULT_DEPLOY;
12223 }
12224
12225
12226
12227
12229 {
12231 SetSynchDirty();
12232 }
12233
12235 {
12237 }
12238
12239
12241 {
12242 return false;
12243 }
12244
12247 {
12248 string att_type = "None";
12249
12250 if (ConfigIsExisting("soundAttType"))
12251 {
12252 att_type = ConfigGetString("soundAttType");
12253 }
12254
12256 }
12257
12259 {
12261 }
12262
12263
12264
12265
12266
12270
12272 {
12275
12277 }
12278
12279
12281 {
12283 return;
12284
12286
12289
12292
12293 SoundParameters params = new SoundParameters();
12297 }
12298
12299
12301 {
12303 return;
12304
12306 SetSynchDirty();
12307
12310 }
12311
12312
12314 {
12316 return;
12317
12319 SetSynchDirty();
12320
12323 }
12324
12326 {
12328 }
12329
12331 {
12333 }
12334
12337 {
12338 if (!
GetGame().IsDedicatedServer())
12339 {
12340 if (ConfigIsExisting("attachSoundSet"))
12341 {
12342 string cfg_path = "";
12343 string soundset = "";
12344 string type_name =
GetType();
12345
12348 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12349 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12350
12351 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12352 {
12353 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12354 {
12355 if (cfg_slot_array[i] == slot_type)
12356 {
12357 soundset = cfg_soundset_array[i];
12358 break;
12359 }
12360 }
12361 }
12362
12363 if (soundset != "")
12364 {
12365 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12367 }
12368 }
12369 }
12370 }
12371
12373 {
12374
12375 }
12376
12377 void OnApply(PlayerBase player);
12378
12380 {
12381 return 1.0;
12382 };
12383
12385 {
12387 }
12388
12390 {
12392 }
12393
12395
12397 {
12398 SetDynamicPhysicsLifeTime(0.01);
12400 }
12401
12403 {
12404 array<string> zone_names = new array<string>;
12405 GetDamageZones(zone_names);
12406 for (int i = 0; i < zone_names.Count(); i++)
12407 {
12408 SetHealthMax(zone_names.Get(i),"Health");
12409 }
12410 SetHealthMax("","Health");
12411 }
12412
12415 {
12416 float global_health = GetHealth01("","Health");
12417 array<string> zones = new array<string>;
12418 GetDamageZones(zones);
12419
12420 for (int i = 0; i < zones.Count(); i++)
12421 {
12422 SetHealth01(zones.Get(i),"Health",global_health);
12423 }
12424 }
12425
12428 {
12429 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12430 }
12431
12433 {
12434 if (!hasRootAsPlayer)
12435 {
12436 if (refParentIB)
12437 {
12438
12439 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12440 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12441
12442 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12443 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12444
12447 }
12448 else
12449 {
12450
12453 }
12454 }
12455 }
12456
12458 {
12460 {
12461 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12462 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12463 {
12464 float heatPermCoef = 1.0;
12466 while (ent)
12467 {
12468 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12469 ent = ent.GetHierarchyParent();
12470 }
12471
12472 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12473 }
12474 }
12475 }
12476
12478 {
12479
12480 EntityAI parent = GetHierarchyParent();
12481 if (!parent)
12482 {
12483 hasParent = false;
12484 hasRootAsPlayer = false;
12485 }
12486 else
12487 {
12488 hasParent = true;
12489 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12490 refParentIB =
ItemBase.Cast(parent);
12491 }
12492 }
12493
12494 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12495 {
12496
12497 }
12498
12500 {
12501
12502 return false;
12503 }
12504
12506 {
12507
12508
12509 return false;
12510 }
12511
12513 {
12514
12515 return false;
12516 }
12517
12520 {
12521 return !GetIsFrozen() &&
IsOpen();
12522 }
12523
12525 {
12526 bool hasParent = false, hasRootAsPlayer = false;
12528
12529 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12530 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12531
12532 if (wwtu || foodDecay)
12533 {
12537
12538 if (processWetness || processTemperature || processDecay)
12539 {
12541
12542 if (processWetness)
12543 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12544
12545 if (processTemperature)
12547
12548 if (processDecay)
12549 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12550 }
12551 }
12552 }
12553
12556 {
12558 }
12559
12561 {
12564
12565 return super.GetTemperatureFreezeThreshold();
12566 }
12567
12569 {
12572
12573 return super.GetTemperatureThawThreshold();
12574 }
12575
12577 {
12580
12581 return super.GetItemOverheatThreshold();
12582 }
12583
12585 {
12587 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12588
12589 return super.GetTemperatureFreezeTime();
12590 }
12591
12593 {
12595 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12596
12597 return super.GetTemperatureThawTime();
12598 }
12599
12604
12606 {
12607 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12608 }
12609
12611 {
12612 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12613 }
12614
12617 {
12619 }
12620
12622 {
12624 }
12625
12627 {
12629 }
12630
12633 {
12634 return null;
12635 }
12636
12639 {
12640 return false;
12641 }
12642
12644 {
12646 {
12649 if (!trg)
12650 {
12652 explosive = this;
12653 }
12654
12655 explosive.PairRemote(trg);
12657
12658 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12659 trg.SetPersistentPairID(persistentID);
12660 explosive.SetPersistentPairID(persistentID);
12661
12662 return true;
12663 }
12664 return false;
12665 }
12666
12669 {
12670 float ret = 1.0;
12673 ret *= GetHealth01();
12674
12675 return ret;
12676 }
12677
12678 #ifdef DEVELOPER
12679 override void SetDebugItem()
12680 {
12681 super.SetDebugItem();
12682 _itemBase = this;
12683 }
12684
12686 {
12687 string text = super.GetDebugText();
12688
12690 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12691
12692 return text;
12693 }
12694 #endif
12695
12697 {
12698 return true;
12699 }
12700
12702
12704
12706 {
12709 }
12710
12711
12719
12735}
12736
12738{
12740 if (entity)
12741 {
12742 bool is_item = entity.IsInherited(
ItemBase);
12743 if (is_item && full_quantity)
12744 {
12747 }
12748 }
12749 else
12750 {
12752 return NULL;
12753 }
12754 return entity;
12755}
12756
12758{
12759 if (item)
12760 {
12761 if (health > 0)
12762 item.SetHealth("", "", health);
12763
12764 if (item.CanHaveTemperature())
12765 {
12767 if (item.CanFreeze())
12768 item.SetFrozen(false);
12769 }
12770
12771 if (item.HasEnergyManager())
12772 {
12773 if (quantity >= 0)
12774 {
12775 item.GetCompEM().SetEnergy0To1(quantity);
12776 }
12777 else
12778 {
12780 }
12781 }
12782 else if (item.IsMagazine())
12783 {
12784 Magazine mag = Magazine.Cast(item);
12785 if (quantity >= 0)
12786 {
12787 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12788 }
12789 else
12790 {
12792 }
12793
12794 }
12795 else
12796 {
12797 if (quantity >= 0)
12798 {
12799 item.SetQuantityNormalized(quantity, false);
12800 }
12801 else
12802 {
12804 }
12805
12806 }
12807 }
12808}
12809
12810#ifdef DEVELOPER
12812#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.