8525{
8527 {
8528 return true;
8529 }
8530};
8531
8532
8533
8535{
8539
8541
8544
8545
8546
8547
8548
8557
8563
8568
8573
8594 protected bool m_IsResultOfSplit
8595
8597
8602
8603
8604
8606
8610
8611
8612
8614
8617
8618
8619
8625
8626
8634
8637
8638
8640
8641
8643
8644
8649
8650
8655
8656
8658
8659
8661 {
8666
8667 if (!
GetGame().IsDedicatedServer())
8668 {
8670 {
8672
8674 {
8676 }
8677 }
8678
8681 }
8682
8683 m_OldLocation = null;
8684
8686 {
8688 }
8689
8690 if (ConfigIsExisting("headSelectionsToHide"))
8691 {
8694 }
8695
8697 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8698 {
8700 }
8701
8703
8704 m_IsResultOfSplit = false;
8705
8707 }
8708
8710 {
8711 super.InitItemVariables();
8712
8718 m_Count = ConfigGetInt(
"count");
8719
8722
8727
8730
8735
8747
8751
8752
8755 if (ConfigIsExisting("canBeSplit"))
8756 {
8759 }
8760
8762 if (ConfigIsExisting("itemBehaviour"))
8764
8765
8768 RegisterNetSyncVariableInt("m_VarLiquidType");
8769 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8770
8771 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8772 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8773 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8774
8775 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8776 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8777 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8778 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8779
8780 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8781 RegisterNetSyncVariableBool("m_IsTakeable");
8782 RegisterNetSyncVariableBool("m_IsHologram");
8783
8786 {
8789 }
8790
8792
8794 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8796
8797 }
8798
8800 {
8802 }
8803
8805 {
8808 {
8813 }
8814 }
8815
8816 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8817 {
8819 {
8822 }
8823
8825 }
8826
8828 {
8834 }
8835
8837
8839 {
8841
8842 if (!action)
8843 {
8844 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8845 return;
8846 }
8847
8849 if (!ai)
8850 {
8852 return;
8853 }
8854
8856 if (!action_array)
8857 {
8858 action_array = new array<ActionBase_Basic>;
8860 }
8861 if (LogManager.IsActionLogEnable())
8862 {
8863 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8864 }
8865
8866 if (action_array.Find(action) != -1)
8867 {
8868 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8869 }
8870 else
8871 {
8872 action_array.Insert(action);
8873 }
8874 }
8875
8877 {
8879 ActionBase action = player.GetActionManager().GetAction(actionName);
8882
8883 if (action_array)
8884 {
8885 action_array.RemoveItem(action);
8886 }
8887 }
8888
8889
8890
8892 {
8893 ActionOverrideData overrideData = new ActionOverrideData();
8897
8899 if (!actionMap)
8900 {
8903 }
8904
8905 actionMap.Insert(this.
Type(), overrideData);
8906
8907 }
8908
8910
8912
8913
8915 {
8918
8921
8922 string config_to_search = "CfgVehicles";
8923 string muzzle_owner_config;
8924
8926 {
8927 if (IsInherited(Weapon))
8928 config_to_search = "CfgWeapons";
8929
8930 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8931
8932 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8933
8935
8936 if (config_OnFire_subclass_count > 0)
8937 {
8938 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8939
8940 for (int i = 0; i < config_OnFire_subclass_count; i++)
8941 {
8942 string particle_class = "";
8944 string config_OnFire_entry = config_OnFire_class + particle_class;
8945 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8946 WPOF_array.Insert(WPOF);
8947 }
8948
8949
8951 }
8952 }
8953
8955 {
8956 config_to_search = "CfgWeapons";
8957 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8958
8959 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8960
8962
8963 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8964 {
8965 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8966
8967 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8968 {
8969 string particle_class2 = "";
8971 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8972 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8973 WPOBE_array.Insert(WPOBE);
8974 }
8975
8976
8978 }
8979 }
8980 }
8981
8982
8984 {
8987
8989 {
8990 string config_to_search = "CfgVehicles";
8991
8992 if (IsInherited(Weapon))
8993 config_to_search = "CfgWeapons";
8994
8995 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8996 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8997
8998 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8999 {
9000
9002
9004 {
9006 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9008 return;
9009 }
9010
9013
9014
9015
9017 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9018
9019 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9020 {
9021 string particle_class = "";
9023 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9025
9026 if (entry_type == CT_CLASS)
9027 {
9028 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9029 WPOOH_array.Insert(WPOF);
9030 }
9031 }
9032
9033
9035 }
9036 }
9037 }
9038
9040 {
9042 }
9043
9045 {
9047 {
9049
9052
9055
9056 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9057 }
9058 }
9059
9061 {
9063 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9064
9066 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9067
9069 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9070
9072 {
9074 }
9075 }
9076
9078 {
9080 }
9081
9083 {
9086 else
9088
9090 {
9093 }
9094 else
9095 {
9098
9101 }
9102
9104 }
9105
9107 {
9109 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9110 }
9111
9113 {
9115 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9117 }
9118
9120 {
9122 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9123 }
9124
9126 {
9129
9130 OverheatingParticle OP = new OverheatingParticle();
9135
9137 }
9138
9140 {
9143
9144 return -1;
9145 }
9146
9148 {
9150 {
9153
9154 for (int i = count; i > 0; --i)
9155 {
9156 int id = i - 1;
9159
9162
9163 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9164 {
9165 if (p)
9166 {
9169 }
9170 }
9171 }
9172 }
9173 }
9174
9176 {
9178 {
9180 {
9181 int id = i - 1;
9183
9184 if (OP)
9185 {
9187
9188 if (p)
9189 {
9191 }
9192
9193 delete OP;
9194 }
9195 }
9196
9199 }
9200 }
9201
9204 {
9205 return 0.0;
9206 }
9207
9208
9210 {
9211 return 250;
9212 }
9213
9215 {
9216 return 0;
9217 }
9218
9221 {
9223 return true;
9224
9225 return false;
9226 }
9227
9230 {
9233
9235 {
9237 }
9238 else
9239 {
9240
9242 }
9243
9245 }
9246
9253 {
9254 return -1;
9255 }
9256
9257
9258
9259
9261 {
9263 {
9265 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9266
9267 if (r_index >= 0)
9268 {
9269 InventoryLocation r_il = new InventoryLocation;
9270 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9271
9272 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9275 {
9276 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9277 }
9279 {
9280 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9281 }
9282
9283 }
9284
9285 player.GetHumanInventory().ClearUserReservedLocation(this);
9286 }
9287
9290 }
9291
9292
9293
9294
9296 {
9297 return ItemBase.m_DebugActionsMask;
9298 }
9299
9301 {
9302 return ItemBase.m_DebugActionsMask & mask;
9303 }
9304
9306 {
9307 ItemBase.m_DebugActionsMask = mask;
9308 }
9309
9311 {
9312 ItemBase.m_DebugActionsMask |= mask;
9313 }
9314
9316 {
9317 ItemBase.m_DebugActionsMask &= ~mask;
9318 }
9319
9321 {
9323 {
9325 }
9326 else
9327 {
9329 }
9330 }
9331
9332
9334 {
9335 if (GetEconomyProfile())
9336 {
9337 float q_max = GetEconomyProfile().GetQuantityMax();
9338 if (q_max > 0)
9339 {
9340 float q_min = GetEconomyProfile().GetQuantityMin();
9341 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9342
9344 {
9345 ComponentEnergyManager comp = GetCompEM();
9347 {
9349 }
9350 }
9352 {
9354
9355 }
9356
9357 }
9358 }
9359 }
9360
9363 {
9364 EntityAI parent = GetHierarchyParent();
9365
9366 if (parent)
9367 {
9368 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9369 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9370 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9371 }
9372 }
9373
9376 {
9377 EntityAI parent = GetHierarchyParent();
9378
9379 if (parent)
9380 {
9381 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9382 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9383 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9384 }
9385 }
9386
9388 {
9389
9390
9391
9392
9394
9396 {
9397 if (ScriptInputUserData.CanStoreInputUserData())
9398 {
9399 ScriptInputUserData ctx = new ScriptInputUserData;
9405 ctx.
Write(use_stack_max);
9408
9410 {
9411 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9412 }
9413 }
9414 }
9415 else if (!
GetGame().IsMultiplayer())
9416 {
9418 }
9419 }
9420
9422 {
9424 }
9425
9427 {
9429 }
9430
9432 {
9434 }
9435
9437 {
9438
9439 return false;
9440 }
9441
9443 {
9444 return false;
9445 }
9446
9450 {
9451 return false;
9452 }
9453
9455 {
9456 return "";
9457 }
9458
9460
9462 {
9463 return false;
9464 }
9465
9467 {
9468 return true;
9469 }
9470
9471
9472
9474 {
9475 return true;
9476 }
9477
9479 {
9480 return true;
9481 }
9482
9484 {
9485 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9487 }
9488
9490 {
9492 }
9493
9495 {
9497 if (!is_being_placed)
9499 SetSynchDirty();
9500 }
9501
9502
9504
9506 {
9508 }
9509
9511 {
9513 }
9514
9516 {
9517 return 1;
9518 }
9519
9521 {
9522 return false;
9523 }
9524
9526 {
9528 SetSynchDirty();
9529 }
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9566 {
9567 super.OnMovedInsideCargo(container);
9568
9569 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9570 }
9571
9572 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9573 {
9574 super.EEItemLocationChanged(oldLoc,newLoc);
9575
9576 PlayerBase new_player = null;
9577 PlayerBase old_player = null;
9578
9579 if (newLoc.GetParent())
9580 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9581
9582 if (oldLoc.GetParent())
9583 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9584
9586 {
9587 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9588
9589 if (r_index >= 0)
9590 {
9591 InventoryLocation r_il = new InventoryLocation;
9592 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9593
9594 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9597 {
9598 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9599 }
9601 {
9602 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9603 }
9604
9605 }
9606 }
9607
9609 {
9610 if (new_player)
9611 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9612
9613 if (new_player == old_player)
9614 {
9615
9616 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9617 {
9619 {
9620 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9621 {
9622 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9623 }
9624 }
9625 else
9626 {
9627 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9628 }
9629 }
9630
9631 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9632 {
9633 int type = oldLoc.GetType();
9635 {
9636 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9637 }
9639 {
9640 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9641 }
9642 }
9643 if (!m_OldLocation)
9644 {
9645 m_OldLocation = new InventoryLocation;
9646 }
9647 m_OldLocation.Copy(oldLoc);
9648 }
9649 else
9650 {
9651 if (m_OldLocation)
9652 {
9653 m_OldLocation.Reset();
9654 }
9655 }
9656
9658 }
9659 else
9660 {
9661 if (new_player)
9662 {
9663 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9664 if (res_index >= 0)
9665 {
9666 InventoryLocation il = new InventoryLocation;
9667 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9669 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9672 {
9673 il.
GetParent().GetOnReleaseLock().Invoke(it);
9674 }
9676 {
9678 }
9679
9680 }
9681 }
9683 {
9684
9686 }
9687
9688 if (m_OldLocation)
9689 {
9690 m_OldLocation.Reset();
9691 }
9692 }
9693 }
9694
9695 override void EOnContact(IEntity other, Contact extra)
9696 {
9698 {
9699 int liquidType = -1;
9701 if (impactSpeed > 0.0)
9702 {
9704 #ifndef SERVER
9706 #else
9708 SetSynchDirty();
9709 #endif
9711 }
9712 }
9713
9714 #ifdef SERVER
9715 if (GetCompEM() && GetCompEM().IsPlugged())
9716 {
9717 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9718 GetCompEM().UnplugThis();
9719 }
9720 #endif
9721 }
9722
9724
9726 {
9728 }
9729
9731 {
9732
9733 }
9734
9736 {
9737 super.OnItemLocationChanged(old_owner, new_owner);
9738
9739 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9740 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9741
9742 if (!relatedPlayer && playerNew)
9743 relatedPlayer = playerNew;
9744
9745 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9746 {
9748 if (actionMgr)
9749 {
9750 ActionBase currentAction = actionMgr.GetRunningAction();
9751 if (currentAction)
9753 }
9754 }
9755
9756 Man ownerPlayerOld = null;
9757 Man ownerPlayerNew = null;
9758
9759 if (old_owner)
9760 {
9761 if (old_owner.
IsMan())
9762 {
9763 ownerPlayerOld = Man.Cast(old_owner);
9764 }
9765 else
9766 {
9767 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9768 }
9769 }
9770 else
9771 {
9773 {
9775
9776 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9777 {
9778 GetCompEM().UnplugThis();
9779 }
9780 }
9781 }
9782
9783 if (new_owner)
9784 {
9785 if (new_owner.
IsMan())
9786 {
9787 ownerPlayerNew = Man.Cast(new_owner);
9788 }
9789 else
9790 {
9791 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9792 }
9793 }
9794
9795 if (ownerPlayerOld != ownerPlayerNew)
9796 {
9797 if (ownerPlayerOld)
9798 {
9799 array<EntityAI> subItemsExit = new array<EntityAI>;
9801 for (int i = 0; i < subItemsExit.Count(); i++)
9802 {
9805 }
9806 }
9807
9808 if (ownerPlayerNew)
9809 {
9810 array<EntityAI> subItemsEnter = new array<EntityAI>;
9812 for (int j = 0; j < subItemsEnter.Count(); j++)
9813 {
9816 }
9817 }
9818 }
9819 else if (ownerPlayerNew != null)
9820 {
9821 PlayerBase nplayer;
9822 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9823 {
9824 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9826 for (int k = 0; k < subItemsUpdate.Count(); k++)
9827 {
9829 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9830 }
9831 }
9832 }
9833
9834 if (old_owner)
9835 old_owner.OnChildItemRemoved(this);
9836 if (new_owner)
9837 new_owner.OnChildItemReceived(this);
9838 }
9839
9840
9842 {
9843 super.EEDelete(parent);
9844 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9845 if (player)
9846 {
9848
9849 if (player.IsAlive())
9850 {
9851 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9852 if (r_index >= 0)
9853 {
9854 InventoryLocation r_il = new InventoryLocation;
9855 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9856
9857 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9860 {
9861 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9862 }
9864 {
9865 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9866 }
9867
9868 }
9869
9870 player.RemoveQuickBarEntityShortcut(this);
9871 }
9872 }
9873 }
9874
9876 {
9877 super.EEKilled(killer);
9878
9881 {
9882 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9883 {
9884 if (IsMagazine())
9885 {
9886 if (Magazine.Cast(this).GetAmmoCount() > 0)
9887 {
9889 }
9890 }
9891 else
9892 {
9894 }
9895 }
9896 }
9897 }
9898
9900 {
9901 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9902
9903 super.OnWasAttached(parent, slot_id);
9904
9907
9909 }
9910
9912 {
9913 super.OnWasDetached(parent, slot_id);
9914
9917 }
9918
9920 {
9921 int idx;
9924
9925 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9926 if (inventory_slots.Count() < 1)
9927 {
9928 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9929 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9930 }
9931 else
9932 {
9933 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9934 }
9935
9936 idx = inventory_slots.Find(slot);
9937 if (idx < 0)
9938 return "";
9939
9940 return attach_types.Get(idx);
9941 }
9942
9944 {
9945 int idx = -1;
9946 string slot;
9947
9950
9951 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9952 if (inventory_slots.Count() < 1)
9953 {
9954 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9955 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9956 }
9957 else
9958 {
9959 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9960 if (detach_types.Count() < 1)
9961 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9962 }
9963
9964 for (int i = 0; i < inventory_slots.Count(); i++)
9965 {
9966 slot = inventory_slots.Get(i);
9967 }
9968
9969 if (slot != "")
9970 {
9971 if (detach_types.Count() == 1)
9972 idx = 0;
9973 else
9974 idx = inventory_slots.Find(slot);
9975 }
9976 if (idx < 0)
9977 return "";
9978
9979 return detach_types.Get(idx);
9980 }
9981
9983 {
9984
9986
9987
9988 float min_time = 1;
9989 float max_time = 3;
9990 float delay = Math.RandomFloat(min_time, max_time);
9991
9992 explode_timer.Run(delay, this, "DoAmmoExplosion");
9993 }
9994
9996 {
9997 Magazine magazine = Magazine.Cast(this);
9998 int pop_sounds_count = 6;
9999 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10000
10001
10002 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10003 string sound_name = pop_sounds[ sound_idx ];
10005
10006
10007 magazine.ServerAddAmmoCount(-1);
10008
10009
10010 float min_temp_to_explode = 100;
10011
10012 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10013 {
10015 }
10016 }
10017
10018
10019 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10020 {
10021 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10022
10023 const int CHANCE_DAMAGE_CARGO = 4;
10024 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10025 const int CHANCE_DAMAGE_NOTHING = 2;
10026
10028 {
10029 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10030 int chances;
10031 int rnd;
10032
10033 if (GetInventory().GetCargo())
10034 {
10035 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10036 rnd = Math.RandomInt(0,chances);
10037
10038 if (rnd < CHANCE_DAMAGE_CARGO)
10039 {
10041 }
10042 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10043 {
10045 }
10046 }
10047 else
10048 {
10049 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10050 rnd = Math.RandomInt(0,chances);
10051
10052 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10053 {
10055 }
10056 }
10057 }
10058 }
10059
10061 {
10062 if (GetInventory().GetCargo())
10063 {
10064 int item_count = GetInventory().GetCargo().GetItemCount();
10065 if (item_count > 0)
10066 {
10067 int random_pick = Math.RandomInt(0, item_count);
10069 if (!item.IsExplosive())
10070 {
10071 item.AddHealth("","",damage);
10072 return true;
10073 }
10074 }
10075 }
10076 return false;
10077 }
10078
10080 {
10081 int attachment_count = GetInventory().AttachmentCount();
10082 if (attachment_count > 0)
10083 {
10084 int random_pick = Math.RandomInt(0, attachment_count);
10085 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10086 if (!attachment.IsExplosive())
10087 {
10088 attachment.AddHealth("","",damage);
10089 return true;
10090 }
10091 }
10092 return false;
10093 }
10094
10096 {
10098 }
10099
10101 {
10103 return GetInventory().CanRemoveEntity();
10104
10105 return false;
10106 }
10107
10109 {
10110
10112 return false;
10113
10114
10116 return false;
10117
10118
10119
10121 if (delta == 0)
10122 return false;
10123
10124
10125 return true;
10126 }
10127
10129 {
10131 {
10132 if (ScriptInputUserData.CanStoreInputUserData())
10133 {
10134 ScriptInputUserData ctx = new ScriptInputUserData;
10139 ctx.
Write(destination_entity);
10141 ctx.
Write(slot_id);
10143 }
10144 }
10145 else if (!
GetGame().IsMultiplayer())
10146 {
10148 }
10149 }
10150
10152 {
10153 float split_quantity_new;
10157 InventoryLocation loc = new InventoryLocation;
10158
10159 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10160 {
10162 split_quantity_new = stack_max;
10163 else
10165
10167 {
10168 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10169 if (new_item)
10170 {
10171 new_item.SetResultOfSplit(true);
10172 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10174 new_item.
SetQuantity(split_quantity_new,
false,
true);
10175 }
10176 }
10177 }
10178 else if (destination_entity && slot_id == -1)
10179 {
10180 if (quantity > stack_max)
10181 split_quantity_new = stack_max;
10182 else
10183 split_quantity_new = quantity;
10184
10186 {
10188 {
10191 }
10192
10193 if (new_item)
10194 {
10195 new_item.SetResultOfSplit(true);
10196 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10198 new_item.
SetQuantity(split_quantity_new,
false,
true);
10199 }
10200 }
10201 }
10202 else
10203 {
10204 if (stack_max != 0)
10205 {
10207 {
10209 }
10210
10211 if (split_quantity_new == 0)
10212 {
10213 if (!
GetGame().IsMultiplayer())
10214 player.PhysicalPredictiveDropItem(this);
10215 else
10216 player.ServerDropEntity(this);
10217 return;
10218 }
10219
10221 {
10223
10224 if (new_item)
10225 {
10226 new_item.SetResultOfSplit(true);
10227 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10230 new_item.PlaceOnSurface();
10231 }
10232 }
10233 }
10234 }
10235 }
10236
10238 {
10239 float split_quantity_new;
10243 InventoryLocation loc = new InventoryLocation;
10244
10245 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10246 {
10248 split_quantity_new = stack_max;
10249 else
10251
10253 {
10254 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10255 if (new_item)
10256 {
10257 new_item.SetResultOfSplit(true);
10258 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10260 new_item.
SetQuantity(split_quantity_new,
false,
true);
10261 }
10262 }
10263 }
10264 else if (destination_entity && slot_id == -1)
10265 {
10266 if (quantity > stack_max)
10267 split_quantity_new = stack_max;
10268 else
10269 split_quantity_new = quantity;
10270
10272 {
10274 {
10277 }
10278
10279 if (new_item)
10280 {
10281 new_item.SetResultOfSplit(true);
10282 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10284 new_item.
SetQuantity(split_quantity_new,
false,
true);
10285 }
10286 }
10287 }
10288 else
10289 {
10290 if (stack_max != 0)
10291 {
10293 {
10295 }
10296
10298 {
10300
10301 if (new_item)
10302 {
10303 new_item.SetResultOfSplit(true);
10304 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10307 new_item.PlaceOnSurface();
10308 }
10309 }
10310 }
10311 }
10312 }
10313
10315 {
10317 {
10318 if (ScriptInputUserData.CanStoreInputUserData())
10319 {
10320 ScriptInputUserData ctx = new ScriptInputUserData;
10325 dst.WriteToContext(ctx);
10327 }
10328 }
10329 else if (!
GetGame().IsMultiplayer())
10330 {
10332 }
10333 }
10334
10336 {
10338 {
10339 if (ScriptInputUserData.CanStoreInputUserData())
10340 {
10341 ScriptInputUserData ctx = new ScriptInputUserData;
10346 ctx.
Write(destination_entity);
10352 }
10353 }
10354 else if (!
GetGame().IsMultiplayer())
10355 {
10357 }
10358 }
10359
10361 {
10363 }
10364
10366 {
10368 float split_quantity_new;
10370 if (dst.IsValid())
10371 {
10372 int slot_id = dst.GetSlot();
10374
10375 if (quantity > stack_max)
10376 split_quantity_new = stack_max;
10377 else
10378 split_quantity_new = quantity;
10379
10381 {
10383
10384 if (new_item)
10385 {
10386 new_item.SetResultOfSplit(true);
10387 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10389 new_item.
SetQuantity(split_quantity_new,
false,
true);
10390 }
10391
10392 return new_item;
10393 }
10394 }
10395
10396 return null;
10397 }
10398
10400 {
10402 float split_quantity_new;
10404 if (destination_entity)
10405 {
10407 if (quantity > stackable)
10408 split_quantity_new = stackable;
10409 else
10410 split_quantity_new = quantity;
10411
10413 {
10414 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10415 if (new_item)
10416 {
10417 new_item.SetResultOfSplit(true);
10418 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10420 new_item.
SetQuantity(split_quantity_new,
false,
true);
10421 }
10422 }
10423 }
10424 }
10425
10427 {
10429 {
10430 if (ScriptInputUserData.CanStoreInputUserData())
10431 {
10432 ScriptInputUserData ctx = new ScriptInputUserData;
10437 ItemBase destination_entity =
this;
10438 ctx.
Write(destination_entity);
10442 }
10443 }
10444 else if (!
GetGame().IsMultiplayer())
10445 {
10447 }
10448 }
10449
10451 {
10453 float split_quantity_new;
10455 if (player)
10456 {
10458 if (quantity > stackable)
10459 split_quantity_new = stackable;
10460 else
10461 split_quantity_new = quantity;
10462
10464 {
10465 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10466 new_item =
ItemBase.Cast(in_hands);
10467 if (new_item)
10468 {
10469 new_item.SetResultOfSplit(true);
10470 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10472 new_item.SetQuantity(split_quantity_new, false, true);
10473 }
10474 }
10475 }
10476 }
10477
10479 {
10481 float split_quantity_new = Math.Floor(quantity * 0.5);
10482
10484 return;
10485
10487
10488 if (new_item)
10489 {
10490 if (new_item.GetQuantityMax() < split_quantity_new)
10491 {
10492 split_quantity_new = new_item.GetQuantityMax();
10493 }
10494
10495 new_item.SetResultOfSplit(true);
10496 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10497
10499 {
10502 }
10503 else
10504 {
10506 new_item.
SetQuantity(split_quantity_new,
false,
true);
10507 }
10508 }
10509 }
10510
10512 {
10514 float split_quantity_new = Math.Floor(quantity / 2);
10515
10517 return;
10518
10519 InventoryLocation invloc = new InventoryLocation;
10521
10523 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10524
10525 if (new_item)
10526 {
10527 if (new_item.GetQuantityMax() < split_quantity_new)
10528 {
10529 split_quantity_new = new_item.GetQuantityMax();
10530 }
10532 {
10535 }
10536 else if (split_quantity_new > 1)
10537 {
10539 new_item.
SetQuantity(split_quantity_new,
false,
true);
10540 }
10541 }
10542 }
10543
10546 {
10547 SetWeightDirty();
10549
10550 if (parent)
10551 parent.OnAttachmentQuantityChangedEx(this, delta);
10552
10554 {
10556 {
10558 }
10560 {
10561 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10563 }
10564 }
10565
10566 }
10567
10570 {
10571
10572 }
10573
10576 {
10578 }
10579
10581 {
10582 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10583
10585 {
10586 if (newLevel == GameConstants.STATE_RUINED)
10587 {
10589 EntityAI parent = GetHierarchyParent();
10590 if (parent && parent.IsFireplace())
10591 {
10592 CargoBase cargo = GetInventory().GetCargo();
10593 if (cargo)
10594 {
10596 {
10598 }
10599 }
10600 }
10601 }
10602
10604 {
10605
10607 return;
10608 }
10609
10610 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10611 {
10613 }
10614 }
10615 }
10616
10617
10619 {
10620 super.OnRightClick();
10621
10623 {
10625 {
10626 if (ScriptInputUserData.CanStoreInputUserData())
10627 {
10628 EntityAI root = GetHierarchyRoot();
10629 Man playerOwner = GetHierarchyRootPlayer();
10630 InventoryLocation dst = new InventoryLocation;
10631
10632
10633 if (!playerOwner && root && root == this)
10634 {
10636 }
10637 else
10638 {
10639
10640 GetInventory().GetCurrentInventoryLocation(dst);
10642 {
10645 {
10647 }
10648 else
10649 {
10651
10652
10653 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10654 {
10656 }
10657 else
10658 {
10659 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10660 }
10661 }
10662 }
10663 }
10664
10665 ScriptInputUserData ctx = new ScriptInputUserData;
10673 }
10674 }
10675 else if (!
GetGame().IsMultiplayer())
10676 {
10678 }
10679 }
10680 }
10681
10683 {
10684 if (root)
10685 {
10686 vector m4[4];
10687 root.GetTransform(m4);
10688 dst.SetGround(this, m4);
10689 }
10690 else
10691 {
10692 GetInventory().GetCurrentInventoryLocation(dst);
10693 }
10694 }
10695
10696 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10697 {
10698
10699 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10700 return false;
10701
10702 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10703 return false;
10704
10705
10707 return false;
10708
10709
10710 Magazine mag = Magazine.Cast(this);
10711 if (mag)
10712 {
10713 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10714 return false;
10715
10716 if (stack_max_limit)
10717 {
10718 Magazine other_mag = Magazine.Cast(other_item);
10719 if (other_item)
10720 {
10721 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10722 return false;
10723 }
10724
10725 }
10726 }
10727 else
10728 {
10729
10731 return false;
10732
10734 return false;
10735 }
10736
10737 PlayerBase player = null;
10738 if (CastTo(player, GetHierarchyRootPlayer()))
10739 {
10740 if (player.GetInventory().HasAttachment(this))
10741 return false;
10742
10743 if (player.IsItemsToDelete())
10744 return false;
10745 }
10746
10747 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10748 return false;
10749
10750 int slotID;
10752 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10753 return false;
10754
10755 return true;
10756 }
10757
10759 {
10761 }
10762
10764 {
10765 return m_IsResultOfSplit;
10766 }
10767
10769 {
10770 m_IsResultOfSplit = value;
10771 }
10772
10774 {
10776 }
10777
10779 {
10780 float other_item_quantity = other_item.GetQuantity();
10781 float this_free_space;
10782
10784
10786
10787 if (other_item_quantity > this_free_space)
10788 {
10789 return this_free_space;
10790 }
10791 else
10792 {
10793 return other_item_quantity;
10794 }
10795 }
10796
10798 {
10800 }
10801
10803 {
10805 return;
10806
10807 if (!IsMagazine() && other_item)
10808 {
10810 if (quantity_used != 0)
10811 {
10812 float hp1 = GetHealth01("","");
10813 float hp2 = other_item.GetHealth01("","");
10814 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10815 hpResult = hpResult / (
GetQuantity() + quantity_used);
10816
10817 hpResult *= GetMaxHealth();
10818 Math.Round(hpResult);
10819 SetHealth("", "Health", hpResult);
10820
10822 other_item.AddQuantity(-quantity_used);
10823 }
10824 }
10826 }
10827
10829 {
10830 #ifdef SERVER
10831 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10832 GetHierarchyParent().IncreaseLifetimeUp();
10833 #endif
10834 };
10835
10837 {
10838 PlayerBase p = PlayerBase.Cast(player);
10839
10840 array<int> recipesIds = p.m_Recipes;
10841 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10842 if (moduleRecipesManager)
10843 {
10844 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10845 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10846 }
10847
10848 for (int i = 0;i < recipesIds.Count(); i++)
10849 {
10850 int key = recipesIds.Get(i);
10851 string recipeName = moduleRecipesManager.GetRecipeName(key);
10853 }
10854 }
10855
10856
10857 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10858 {
10859 super.GetDebugActions(outputList);
10860
10861
10867
10868
10873
10878
10879
10883
10884
10886 {
10890 }
10891
10894
10895
10899
10901
10902 InventoryLocation loc = new InventoryLocation();
10903 GetInventory().GetCurrentInventoryLocation(loc);
10905 {
10906 if (Gizmo_IsSupported())
10909 }
10910
10912 }
10913
10914
10915
10916
10918 {
10919 super.OnAction(action_id, player, ctx);
10920
10922 {
10923 switch (action_id)
10924 {
10927 return true;
10930 return true;
10931 }
10932 }
10933
10935 {
10936 switch (action_id)
10937 {
10939 Delete();
10940 return true;
10941 }
10942 }
10943
10944 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10945 {
10946 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10947 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10948 PlayerBase p = PlayerBase.Cast(player);
10949 if (
EActions.RECIPES_RANGE_START < 1000)
10950 {
10951 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10952 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10953 }
10954 }
10955 #ifndef SERVER
10956 else if (action_id ==
EActions.WATCH_PLAYER)
10957 {
10958 PluginDeveloper.SetDeveloperItemClientEx(player);
10959 }
10960 #endif
10962 {
10963 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10964 {
10965 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10966 OnDebugButtonPressServer(id + 1);
10967 }
10968
10969 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10970 {
10971 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10973 }
10974
10975 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10976 {
10977 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10979 }
10980
10981 else if (action_id ==
EActions.ADD_QUANTITY)
10982 {
10983 if (IsMagazine())
10984 {
10985 Magazine mag = Magazine.Cast(this);
10986 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10987 }
10988 else
10989 {
10991 }
10992
10993 if (m_EM)
10994 {
10995 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10996 }
10997
10998 }
10999
11000 else if (action_id ==
EActions.REMOVE_QUANTITY)
11001 {
11002 if (IsMagazine())
11003 {
11004 Magazine mag2 = Magazine.Cast(this);
11005 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11006 }
11007 else
11008 {
11010 }
11011 if (m_EM)
11012 {
11013 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11014 }
11015
11016 }
11017
11018 else if (action_id ==
EActions.SET_QUANTITY_0)
11019 {
11021
11022 if (m_EM)
11023 {
11024 m_EM.SetEnergy(0);
11025 }
11026 }
11027
11028 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11029 {
11031
11032 if (m_EM)
11033 {
11034 m_EM.SetEnergy(m_EM.GetEnergyMax());
11035 }
11036 }
11037
11038 else if (action_id ==
EActions.ADD_HEALTH)
11039 {
11040 AddHealth("","",GetMaxHealth("","Health")/5);
11041 }
11042 else if (action_id ==
EActions.REMOVE_HEALTH)
11043 {
11044 AddHealth("","",-GetMaxHealth("","Health")/5);
11045 }
11046 else if (action_id ==
EActions.DESTROY_HEALTH)
11047 {
11048 SetHealth01("","",0);
11049 }
11050 else if (action_id ==
EActions.WATCH_ITEM)
11051 {
11053 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11054 #ifdef DEVELOPER
11055 SetDebugDeveloper_item(this);
11056 #endif
11057 }
11058
11059 else if (action_id ==
EActions.ADD_TEMPERATURE)
11060 {
11061 AddTemperature(20);
11062
11063 }
11064
11065 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11066 {
11067 AddTemperature(-20);
11068
11069 }
11070
11071 else if (action_id ==
EActions.FLIP_FROZEN)
11072 {
11073 SetFrozen(!GetIsFrozen());
11074
11075 }
11076
11077 else if (action_id ==
EActions.ADD_WETNESS)
11078 {
11080
11081 }
11082
11083 else if (action_id ==
EActions.REMOVE_WETNESS)
11084 {
11086
11087 }
11088
11089 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11090 {
11093
11094
11095 }
11096
11097 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11098 {
11101 }
11102
11103 else if (action_id ==
EActions.MAKE_SPECIAL)
11104 {
11105 auto debugParams = DebugSpawnParams.WithPlayer(player);
11106 OnDebugSpawnEx(debugParams);
11107 }
11108
11109 }
11110
11111
11112 return false;
11113 }
11114
11115
11116
11117
11121
11124
11125
11126
11128 {
11129 return false;
11130 }
11131
11132
11134 {
11135 return true;
11136 }
11137
11138
11140 {
11141 return true;
11142 }
11143
11144
11145
11147 {
11148 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11150 }
11151
11154 {
11155 return null;
11156 }
11157
11159 {
11160 return false;
11161 }
11162
11164 {
11165 return false;
11166 }
11167
11171
11172
11174 {
11175 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11176 return module_repairing.CanRepair(this, item_repair_kit);
11177 }
11178
11179
11180 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11181 {
11182 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11183 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11184 }
11185
11186
11188 {
11189
11190
11191
11192
11193
11194
11195
11196
11197 return 1;
11198 }
11199
11200
11201
11203 {
11205 }
11206
11207
11208
11210 {
11212 }
11213
11214
11223 {
11224 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11225
11226 if (player)
11227 {
11228 player.MessageStatus(text);
11229 }
11230 }
11231
11232
11241 {
11242 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11243
11244 if (player)
11245 {
11246 player.MessageAction(text);
11247 }
11248 }
11249
11250
11259 {
11260 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11261
11262 if (player)
11263 {
11264 player.MessageFriendly(text);
11265 }
11266 }
11267
11268
11277 {
11278 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11279
11280 if (player)
11281 {
11282 player.MessageImportant(text);
11283 }
11284 }
11285
11287 {
11288 return true;
11289 }
11290
11291
11292 override bool KindOf(
string tag)
11293 {
11294 bool found = false;
11295 string item_name = this.
GetType();
11298
11299 int array_size = item_tag_array.Count();
11300 for (int i = 0; i < array_size; i++)
11301 {
11302 if (item_tag_array.Get(i) == tag)
11303 {
11304 found = true;
11305 break;
11306 }
11307 }
11308 return found;
11309 }
11310
11311
11313 {
11314
11315 super.OnRPC(sender, rpc_type,ctx);
11316
11317
11318 switch (rpc_type)
11319 {
11320 #ifndef SERVER
11321 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11322 Param2<bool, string> p = new Param2<bool, string>(false, "");
11323
11325 return;
11326
11327 bool play = p.param1;
11328 string soundSet = p.param2;
11329
11330 if (play)
11331 {
11333 {
11335 {
11337 }
11338 }
11339 else
11340 {
11342 }
11343 }
11344 else
11345 {
11347 }
11348
11349 break;
11350 #endif
11351
11352 }
11353
11355 {
11357 }
11358 }
11359
11360
11361
11362
11364 {
11365 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11366 return plugin.GetID(
name);
11367 }
11368
11370 {
11371 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11372 return plugin.GetName(id);
11373 }
11374
11377 {
11378
11379
11380 int varFlags;
11381 if (!ctx.
Read(varFlags))
11382 return;
11383
11384 if (varFlags & ItemVariableFlags.FLOAT)
11385 {
11387 }
11388 }
11389
11391 {
11392
11393 super.SerializeNumericalVars(floats_out);
11394
11395
11396
11398 {
11400 }
11401
11403 {
11405 }
11406
11408 {
11410 }
11411
11413 {
11418 }
11419
11421 {
11423 }
11424 }
11425
11427 {
11428
11429 super.DeSerializeNumericalVars(floats);
11430
11431
11432 int index = 0;
11433 int mask = Math.Round(floats.Get(index));
11434
11435 index++;
11436
11438 {
11440 {
11442 }
11443 else
11444 {
11445 float quantity = floats.Get(index);
11446 SetQuantity(quantity,
true,
false,
false,
false);
11447 }
11448 index++;
11449 }
11450
11452 {
11453 float wet = floats.Get(index);
11455 index++;
11456 }
11457
11459 {
11460 int liquidtype = Math.Round(floats.Get(index));
11462 index++;
11463 }
11464
11466 {
11468 index++;
11470 index++;
11472 index++;
11474 index++;
11475 }
11476
11478 {
11479 int cleanness = Math.Round(floats.Get(index));
11481 index++;
11482 }
11483 }
11484
11486 {
11487 super.WriteVarsToCTX(ctx);
11488
11489
11491 {
11493 }
11494
11496 {
11498 }
11499
11501 {
11503 }
11504
11506 {
11507 int r,g,b,a;
11513 }
11514
11516 {
11518 }
11519 }
11520
11522 {
11523 if (!super.ReadVarsFromCTX(ctx,version))
11524 return false;
11525
11526 int intValue;
11527 float value;
11528
11529 if (version < 140)
11530 {
11531 if (!ctx.
Read(intValue))
11532 return false;
11533
11534 m_VariablesMask = intValue;
11535 }
11536
11538 {
11539 if (!ctx.
Read(value))
11540 return false;
11541
11543 {
11545 }
11546 else
11547 {
11549 }
11550 }
11551
11552 if (version < 140)
11553 {
11555 {
11556 if (!ctx.
Read(value))
11557 return false;
11558 SetTemperatureDirect(value);
11559 }
11560 }
11561
11563 {
11564 if (!ctx.
Read(value))
11565 return false;
11567 }
11568
11570 {
11571 if (!ctx.
Read(intValue))
11572 return false;
11574 }
11575
11577 {
11578 int r,g,b,a;
11580 return false;
11582 return false;
11584 return false;
11586 return false;
11587
11589 }
11590
11592 {
11593 if (!ctx.
Read(intValue))
11594 return false;
11596 }
11597
11598 if (version >= 138 && version < 140)
11599 {
11601 {
11602 if (!ctx.
Read(intValue))
11603 return false;
11604 SetFrozen(intValue);
11605 }
11606 }
11607
11608 return true;
11609 }
11610
11611
11613 {
11616 {
11618 }
11619
11620 if (!super.OnStoreLoad(ctx, version))
11621 {
11623 return false;
11624 }
11625
11626 if (version >= 114)
11627 {
11628 bool hasQuickBarIndexSaved;
11629
11630 if (!ctx.
Read(hasQuickBarIndexSaved))
11631 {
11633 return false;
11634 }
11635
11636 if (hasQuickBarIndexSaved)
11637 {
11638 int itmQBIndex;
11639
11640
11641 if (!ctx.
Read(itmQBIndex))
11642 {
11644 return false;
11645 }
11646
11647 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11648 if (itmQBIndex != -1 && parentPlayer)
11649 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11650 }
11651 }
11652 else
11653 {
11654
11655 PlayerBase player;
11656 int itemQBIndex;
11657 if (version ==
int.
MAX)
11658 {
11659 if (!ctx.
Read(itemQBIndex))
11660 {
11662 return false;
11663 }
11664 }
11665 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11666 {
11667
11668 if (!ctx.
Read(itemQBIndex))
11669 {
11671 return false;
11672 }
11673 if (itemQBIndex != -1 && player)
11674 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11675 }
11676 }
11677
11678 if (version < 140)
11679 {
11680
11681 if (!LoadVariables(ctx, version))
11682 {
11684 return false;
11685 }
11686 }
11687
11688
11690 {
11692 return false;
11693 }
11694 if (version >= 132)
11695 {
11697 if (raib)
11698 {
11700 {
11702 return false;
11703 }
11704 }
11705 }
11706
11708 return true;
11709 }
11710
11711
11712
11714 {
11715 super.OnStoreSave(ctx);
11716
11717 PlayerBase player;
11718 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11719 {
11721
11722 int itemQBIndex = -1;
11723 itemQBIndex = player.FindQuickBarEntityIndex(this);
11724 ctx.
Write(itemQBIndex);
11725 }
11726 else
11727 {
11729 }
11730
11732
11734 if (raib)
11735 {
11737 }
11738 }
11739
11740
11742 {
11743 super.AfterStoreLoad();
11744
11746 {
11748 }
11749
11751 {
11754 }
11755 }
11756
11758 {
11759 super.EEOnAfterLoad();
11760
11762 {
11764 }
11765
11768 }
11769
11771 {
11772 return false;
11773 }
11774
11775
11776
11778 {
11780 {
11781 #ifdef PLATFORM_CONSOLE
11782
11784 {
11786 if (menu)
11787 {
11789 }
11790 }
11791 #endif
11792 }
11793
11795 {
11798 }
11799
11801 {
11802 SetWeightDirty();
11804 }
11806 {
11809 }
11810
11812 {
11815 }
11817 {
11820 }
11821
11822 super.OnVariablesSynchronized();
11823 }
11824
11825
11826
11828 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11829 {
11830 if (!IsServerCheck(allow_client))
11831 return false;
11832
11834 return false;
11835
11838
11839 if (value <= (min + 0.001))
11840 value = min;
11841
11842 if (value == min)
11843 {
11844 if (destroy_config)
11845 {
11846 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11847 if (dstr)
11848 {
11850 this.Delete();
11851 return true;
11852 }
11853 }
11854 else if (destroy_forced)
11855 {
11857 this.Delete();
11858 return true;
11859 }
11860
11862 }
11863
11866
11868 {
11870
11871 if (delta)
11873 }
11874
11876
11877 return false;
11878 }
11879
11880
11882 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11883 {
11885 }
11886
11888 {
11891 }
11892
11894 {
11897 }
11898
11900 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11901 {
11902 float value_clamped = Math.Clamp(value, 0, 1);
11904 SetQuantity(result, destroy_config, destroy_forced);
11905 }
11906
11907
11910 {
11912 }
11913
11915 {
11917 }
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11929 {
11930 int slot = -1;
11931 if (GetInventory())
11932 {
11933 InventoryLocation il = new InventoryLocation;
11934 GetInventory().GetCurrentInventoryLocation(il);
11936 }
11937
11939 }
11940
11942 {
11943 float quantity_max = 0;
11944
11946 {
11947 if (attSlotID != -1)
11948 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11949
11950 if (quantity_max <= 0)
11952 }
11953
11954 if (quantity_max <= 0)
11956
11957 return quantity_max;
11958 }
11959
11961 {
11963 }
11964
11966 {
11968 }
11969
11970
11972 {
11974 }
11975
11977 {
11979 }
11980
11982 {
11984 }
11985
11986
11988 {
11989
11990 float weightEx = GetWeightEx();
11991 float special = GetInventoryAndCargoWeight();
11992 return weightEx - special;
11993 }
11994
11995
11997 {
11999 }
12000
12002 {
12004 {
12005 #ifdef DEVELOPER
12006 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12007 {
12008 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12010 }
12011 #endif
12012
12013 return GetQuantity() * GetConfigWeightModified();
12014 }
12015 else if (HasEnergyManager())
12016 {
12017 #ifdef DEVELOPER
12018 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12019 {
12020 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12021 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12022 }
12023 #endif
12024 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12025 }
12026 else
12027 {
12028 #ifdef DEVELOPER
12029 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12030 {
12031 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12032 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12033 }
12034 #endif
12035 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12036 }
12037 }
12038
12041 {
12042 int item_count = 0;
12044
12045 if (GetInventory().GetCargo() != NULL)
12046 {
12047 item_count = GetInventory().GetCargo().GetItemCount();
12048 }
12049
12050 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12051 {
12052 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12053 if (item)
12054 item_count += item.GetNumberOfItems();
12055 }
12056 return item_count;
12057 }
12058
12061 {
12062 float weight = 0;
12063 float wetness = 1;
12064 if (include_wetness)
12067 {
12068 weight = wetness * m_ConfigWeight;
12069 }
12071 {
12072 weight = 1;
12073 }
12074 return weight;
12075 }
12076
12077
12078
12080 {
12081 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12082 {
12083 GameInventory inv = GetInventory();
12084 array<EntityAI> items = new array<EntityAI>;
12086 for (int i = 0; i < items.Count(); i++)
12087 {
12089 if (item)
12090 {
12092 }
12093 }
12094 }
12095 }
12096
12097
12098
12099
12101 {
12102 float energy = 0;
12103 if (HasEnergyManager())
12104 {
12105 energy = GetCompEM().GetEnergy();
12106 }
12107 return energy;
12108 }
12109
12110
12112 {
12113 super.OnEnergyConsumed();
12114
12116 }
12117
12119 {
12120 super.OnEnergyAdded();
12121
12123 }
12124
12125
12127 {
12128 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12129 {
12131 {
12132 float energy_0to1 = GetCompEM().GetEnergy0To1();
12134 }
12135 }
12136 }
12137
12138
12140 {
12141 return ConfigGetFloat("heatIsolation");
12142 }
12143
12145 {
12147 }
12148
12150 {
12151 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12152 if (
GetGame().ConfigIsExisting(paramPath))
12154
12155 return 0.0;
12156 }
12157
12159 {
12160 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12161 if (
GetGame().ConfigIsExisting(paramPath))
12163
12164 return 0.0;
12165 }
12166
12167 override void SetWet(
float value,
bool allow_client =
false)
12168 {
12169 if (!IsServerCheck(allow_client))
12170 return;
12171
12174
12176
12177 m_VarWet = Math.Clamp(value, min, max);
12178
12180 {
12183 }
12184 }
12185
12186 override void AddWet(
float value)
12187 {
12189 }
12190
12192 {
12194 }
12195
12197 {
12199 }
12200
12202 {
12204 }
12205
12207 {
12209 }
12210
12212 {
12214 }
12215
12216 override void OnWetChanged(
float newVal,
float oldVal)
12217 {
12220 if (newLevel != oldLevel)
12221 {
12223 }
12224 }
12225
12227 {
12228 SetWeightDirty();
12229 }
12230
12232 {
12233 return GetWetLevelInternal(
m_VarWet);
12234 }
12235
12236
12237
12239 {
12241 }
12242
12244 {
12246 }
12247
12249 {
12251 }
12252
12254 {
12256 }
12257
12258
12259
12261 {
12262 if (ConfigIsExisting("itemModelLength"))
12263 {
12264 return ConfigGetFloat("itemModelLength");
12265 }
12266 return 0;
12267 }
12268
12270 {
12271 if (ConfigIsExisting("itemAttachOffset"))
12272 {
12273 return ConfigGetFloat("itemAttachOffset");
12274 }
12275 return 0;
12276 }
12277
12278 override void SetCleanness(
int value,
bool allow_client =
false)
12279 {
12280 if (!IsServerCheck(allow_client))
12281 return;
12282
12284
12286
12289 }
12290
12292 {
12294 }
12295
12297 {
12298 return true;
12299 }
12300
12301
12302
12303
12305 {
12307 }
12308
12310 {
12312 }
12313
12314
12315
12316
12317 override void SetColor(
int r,
int g,
int b,
int a)
12318 {
12324 }
12326 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12327 {
12332 }
12333
12335 {
12337 }
12338
12341 {
12342 int r,g,b,a;
12344 r = r/255;
12345 g = g/255;
12346 b = b/255;
12347 a = a/255;
12348 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12349 }
12350
12351
12352
12353 override void SetLiquidType(
int value,
bool allow_client =
false)
12354 {
12355 if (!IsServerCheck(allow_client))
12356 return;
12357
12362 }
12363
12365 {
12366 return ConfigGetInt("varLiquidTypeInit");
12367 }
12368
12370 {
12372 }
12373
12375 {
12377 SetFrozen(false);
12378 }
12379
12382 {
12383 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12384 }
12385
12386
12389 {
12390 PlayerBase nplayer;
12391 if (PlayerBase.CastTo(nplayer, player))
12392 {
12394
12395 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12396 }
12397 }
12398
12399
12402 {
12403 PlayerBase nplayer;
12404 if (PlayerBase.CastTo(nplayer,player))
12405 {
12406
12407 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12408
12409 }
12410
12411
12412 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12413
12414
12415 if (HasEnergyManager())
12416 {
12417 GetCompEM().UpdatePlugState();
12418 }
12419 }
12420
12421
12423 {
12424 super.OnPlacementStarted(player);
12425
12427 }
12428
12429 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12430 {
12432 {
12433 m_AdminLog.OnPlacementComplete(player,
this);
12434 }
12435
12436 super.OnPlacementComplete(player, position, orientation);
12437 }
12438
12439
12440
12441
12442
12444 {
12446 {
12447 return true;
12448 }
12449 else
12450 {
12451 return false;
12452 }
12453 }
12454
12455
12457 {
12459 {
12461 }
12462 }
12463
12464
12466 {
12468 }
12469
12471 {
12473 }
12474
12475 override void InsertAgent(
int agent,
float count = 1)
12476 {
12477 if (count < 1)
12478 return;
12479
12481 }
12482
12485 {
12487 }
12488
12489
12491 {
12493 }
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12537 {
12539 return false;
12540 return true;
12541 }
12542
12544 {
12545
12547 }
12548
12549
12552 {
12553 super.CheckForRoofLimited(timeTresholdMS);
12554
12556 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12557 {
12558 m_PreviousRoofTestTime = time;
12559 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12560 }
12561 }
12562
12563
12565 {
12567 {
12568 return 0;
12569 }
12570
12571 if (GetInventory().GetAttachmentSlotsCount() != 0)
12572 {
12573 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12574 if (filter)
12575 return filter.GetProtectionLevel(type, false, system);
12576 else
12577 return 0;
12578 }
12579
12580 string subclassPath, entryName;
12581
12582 switch (type)
12583 {
12585 entryName = "biological";
12586 break;
12588 entryName = "chemical";
12589 break;
12590 default:
12591 entryName = "biological";
12592 break;
12593 }
12594
12595 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12596
12598 }
12599
12600
12601
12604 {
12605 if (!IsMagazine())
12607
12609 }
12610
12611
12612
12613
12614
12619 {
12620 return true;
12621 }
12622
12624 {
12626 }
12627
12628
12629
12630
12631
12633 {
12634 if (parent)
12635 {
12636 if (parent.IsInherited(DayZInfected))
12637 return true;
12638
12639 if (!parent.IsRuined())
12640 return true;
12641 }
12642
12643 return true;
12644 }
12645
12647 {
12648 if (!super.CanPutAsAttachment(parent))
12649 {
12650 return false;
12651 }
12652
12653 if (!IsRuined() && !parent.IsRuined())
12654 {
12655 return true;
12656 }
12657
12658 return false;
12659 }
12660
12662 {
12663
12664
12665
12666
12667 return super.CanReceiveItemIntoCargo(item);
12668 }
12669
12671 {
12672
12673
12674
12675
12676 GameInventory attachmentInv = attachment.GetInventory();
12678 {
12679 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12680 return false;
12681 }
12682
12683 InventoryLocation loc = new InventoryLocation();
12684 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12685 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12686 return false;
12687
12688 return super.CanReceiveAttachment(attachment, slotId);
12689 }
12690
12692 {
12693 if (!super.CanReleaseAttachment(attachment))
12694 return false;
12695
12696 return GetInventory().AreChildrenAccessible();
12697 }
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12720 {
12721 int id = muzzle_owner.GetMuzzleID();
12722 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12723
12724 if (WPOF_array)
12725 {
12726 for (int i = 0; i < WPOF_array.Count(); i++)
12727 {
12728 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12729
12730 if (WPOF)
12731 {
12732 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12733 }
12734 }
12735 }
12736 }
12737
12738
12740 {
12741 int id = muzzle_owner.GetMuzzleID();
12743
12744 if (WPOBE_array)
12745 {
12746 for (int i = 0; i < WPOBE_array.Count(); i++)
12747 {
12748 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12749
12750 if (WPOBE)
12751 {
12752 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12753 }
12754 }
12755 }
12756 }
12757
12758
12760 {
12761 int id = muzzle_owner.GetMuzzleID();
12762 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12763
12764 if (WPOOH_array)
12765 {
12766 for (int i = 0; i < WPOOH_array.Count(); i++)
12767 {
12768 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12769
12770 if (WPOOH)
12771 {
12772 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12773 }
12774 }
12775 }
12776 }
12777
12778
12780 {
12781 int id = muzzle_owner.GetMuzzleID();
12782 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12783
12784 if (WPOOH_array)
12785 {
12786 for (int i = 0; i < WPOOH_array.Count(); i++)
12787 {
12788 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12789
12790 if (WPOOH)
12791 {
12792 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12793 }
12794 }
12795 }
12796 }
12797
12798
12800 {
12801 int id = muzzle_owner.GetMuzzleID();
12802 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12803
12804 if (WPOOH_array)
12805 {
12806 for (int i = 0; i < WPOOH_array.Count(); i++)
12807 {
12808 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12809
12810 if (WPOOH)
12811 {
12812 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12813 }
12814 }
12815 }
12816 }
12817
12818
12819
12821 {
12823 {
12824 return true;
12825 }
12826
12827 return false;
12828 }
12829
12831 {
12833 {
12834 return true;
12835 }
12836
12837 return false;
12838 }
12839
12841 {
12843 {
12844 return true;
12845 }
12846
12847 return false;
12848 }
12849
12851 {
12852 return false;
12853 }
12854
12857 {
12858 return UATimeSpent.DEFAULT_DEPLOY;
12859 }
12860
12861
12862
12863
12865 {
12867 SetSynchDirty();
12868 }
12869
12871 {
12873 }
12874
12875
12877 {
12878 return false;
12879 }
12880
12883 {
12884 string att_type = "None";
12885
12886 if (ConfigIsExisting("soundAttType"))
12887 {
12888 att_type = ConfigGetString("soundAttType");
12889 }
12890
12892 }
12893
12895 {
12897 }
12898
12899
12900
12901
12902
12908
12910 {
12913
12915 }
12916
12917
12919 {
12921 return;
12922
12924
12927
12930
12931 SoundParameters params = new SoundParameters();
12935 }
12936
12937
12939 {
12941 return;
12942
12944 SetSynchDirty();
12945
12948 }
12949
12950
12952 {
12954 return;
12955
12957 SetSynchDirty();
12958
12961 }
12962
12964 {
12966 }
12967
12969 {
12971 }
12972
12975 {
12976 if (!
GetGame().IsDedicatedServer())
12977 {
12978 if (ConfigIsExisting("attachSoundSet"))
12979 {
12980 string cfg_path = "";
12981 string soundset = "";
12982 string type_name =
GetType();
12983
12986 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12987 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12988
12989 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12990 {
12991 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12992 {
12993 if (cfg_slot_array[i] == slot_type)
12994 {
12995 soundset = cfg_soundset_array[i];
12996 break;
12997 }
12998 }
12999 }
13000
13001 if (soundset != "")
13002 {
13003 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13005 }
13006 }
13007 }
13008 }
13009
13011 {
13012
13013 }
13014
13015 void OnApply(PlayerBase player);
13016
13018 {
13019 return 1.0;
13020 };
13021
13023 {
13025 }
13026
13028 {
13030 }
13031
13033
13035 {
13036 SetDynamicPhysicsLifeTime(0.01);
13038 }
13039
13041 {
13042 array<string> zone_names = new array<string>;
13043 GetDamageZones(zone_names);
13044 for (int i = 0; i < zone_names.Count(); i++)
13045 {
13046 SetHealthMax(zone_names.Get(i),"Health");
13047 }
13048 SetHealthMax("","Health");
13049 }
13050
13053 {
13054 float global_health = GetHealth01("","Health");
13055 array<string> zones = new array<string>;
13056 GetDamageZones(zones);
13057
13058 for (int i = 0; i < zones.Count(); i++)
13059 {
13060 SetHealth01(zones.Get(i),"Health",global_health);
13061 }
13062 }
13063
13066 {
13067 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13068 }
13069
13071 {
13072 if (!hasRootAsPlayer)
13073 {
13074 if (refParentIB)
13075 {
13076
13077 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13078 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13079
13080 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13081 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13082
13085 }
13086 else
13087 {
13088
13091 }
13092 }
13093 }
13094
13096 {
13098 {
13099 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13100 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13101 {
13102 float heatPermCoef = 1.0;
13104 while (ent)
13105 {
13106 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13107 ent = ent.GetHierarchyParent();
13108 }
13109
13110 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13111 }
13112 }
13113 }
13114
13116 {
13117
13118 EntityAI parent = GetHierarchyParent();
13119 if (!parent)
13120 {
13121 hasParent = false;
13122 hasRootAsPlayer = false;
13123 }
13124 else
13125 {
13126 hasParent = true;
13127 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13128 refParentIB =
ItemBase.Cast(parent);
13129 }
13130 }
13131
13132 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13133 {
13134
13135 }
13136
13138 {
13139
13140 return false;
13141 }
13142
13144 {
13145
13146
13147 return false;
13148 }
13149
13151 {
13152
13153 return false;
13154 }
13155
13158 {
13159 return !GetIsFrozen() &&
IsOpen();
13160 }
13161
13163 {
13164 bool hasParent = false, hasRootAsPlayer = false;
13166
13167 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13168 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13169
13170 if (wwtu || foodDecay)
13171 {
13175
13176 if (processWetness || processTemperature || processDecay)
13177 {
13179
13180 if (processWetness)
13181 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13182
13183 if (processTemperature)
13185
13186 if (processDecay)
13187 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13188 }
13189 }
13190 }
13191
13194 {
13196 }
13197
13199 {
13202
13203 return super.GetTemperatureFreezeThreshold();
13204 }
13205
13207 {
13210
13211 return super.GetTemperatureThawThreshold();
13212 }
13213
13215 {
13218
13219 return super.GetItemOverheatThreshold();
13220 }
13221
13223 {
13225 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13226
13227 return super.GetTemperatureFreezeTime();
13228 }
13229
13231 {
13233 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13234
13235 return super.GetTemperatureThawTime();
13236 }
13237
13242
13244 {
13245 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13246 }
13247
13249 {
13250 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13251 }
13252
13255 {
13257 }
13258
13260 {
13262 }
13263
13265 {
13267 }
13268
13271 {
13272 return null;
13273 }
13274
13277 {
13278 return false;
13279 }
13280
13282 {
13284 {
13287 if (!trg)
13288 {
13290 explosive = this;
13291 }
13292
13293 explosive.PairRemote(trg);
13295
13296 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13297 trg.SetPersistentPairID(persistentID);
13298 explosive.SetPersistentPairID(persistentID);
13299
13300 return true;
13301 }
13302 return false;
13303 }
13304
13307 {
13308 float ret = 1.0;
13311 ret *= GetHealth01();
13312
13313 return ret;
13314 }
13315
13316 #ifdef DEVELOPER
13317 override void SetDebugItem()
13318 {
13319 super.SetDebugItem();
13320 _itemBase = this;
13321 }
13322
13324 {
13325 string text = super.GetDebugText();
13326
13328 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13329
13330 return text;
13331 }
13332 #endif
13333
13335 {
13336 return true;
13337 }
13338
13340
13342
13344 {
13347 }
13348
13349
13357
13373}
13374
13376{
13378 if (entity)
13379 {
13380 bool is_item = entity.IsInherited(
ItemBase);
13381 if (is_item && full_quantity)
13382 {
13385 }
13386 }
13387 else
13388 {
13390 return NULL;
13391 }
13392 return entity;
13393}
13394
13396{
13397 if (item)
13398 {
13399 if (health > 0)
13400 item.SetHealth("", "", health);
13401
13402 if (item.CanHaveTemperature())
13403 {
13405 if (item.CanFreeze())
13406 item.SetFrozen(false);
13407 }
13408
13409 if (item.HasEnergyManager())
13410 {
13411 if (quantity >= 0)
13412 {
13413 item.GetCompEM().SetEnergy0To1(quantity);
13414 }
13415 else
13416 {
13418 }
13419 }
13420 else if (item.IsMagazine())
13421 {
13422 Magazine mag = Magazine.Cast(item);
13423 if (quantity >= 0)
13424 {
13425 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13426 }
13427 else
13428 {
13430 }
13431
13432 }
13433 else
13434 {
13435 if (quantity >= 0)
13436 {
13437 item.SetQuantityNormalized(quantity, false);
13438 }
13439 else
13440 {
13442 }
13443
13444 }
13445 }
13446}
13447
13448#ifdef DEVELOPER
13450#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.