8535{
8537 {
8538 return true;
8539 }
8540};
8541
8542
8543
8545{
8549
8551
8554
8555
8556
8557
8558
8567
8573
8578
8583
8604 protected bool m_IsResultOfSplit
8605
8607
8612
8613
8614
8616
8620
8621
8622
8624
8627
8628
8629
8635
8636
8644
8647
8648
8650
8651
8653
8654
8659
8660
8665
8666
8668
8669
8671 {
8676
8677 if (!
GetGame().IsDedicatedServer())
8678 {
8680 {
8682
8684 {
8686 }
8687 }
8688
8691 }
8692
8693 m_OldLocation = null;
8694
8696 {
8698 }
8699
8700 if (ConfigIsExisting("headSelectionsToHide"))
8701 {
8704 }
8705
8707 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8708 {
8710 }
8711
8713
8714 m_IsResultOfSplit = false;
8715
8717 }
8718
8720 {
8721 super.InitItemVariables();
8722
8728 m_Count = ConfigGetInt(
"count");
8729
8732
8737
8740
8745
8757
8761
8762
8765 if (ConfigIsExisting("canBeSplit"))
8766 {
8769 }
8770
8772 if (ConfigIsExisting("itemBehaviour"))
8774
8775
8778 RegisterNetSyncVariableInt("m_VarLiquidType");
8779 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8780
8781 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8782 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8783 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8784
8785 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8786 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8787 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8788 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8789
8790 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8791 RegisterNetSyncVariableBool("m_IsTakeable");
8792 RegisterNetSyncVariableBool("m_IsHologram");
8793
8796 {
8799 }
8800
8802
8804 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8806
8807 }
8808
8810 {
8812 }
8813
8815 {
8818 {
8823 }
8824 }
8825
8826 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8827 {
8829 {
8832 }
8833
8835 }
8836
8838 {
8844 }
8845
8847
8849 {
8851
8852 if (!action)
8853 {
8854 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8855 return;
8856 }
8857
8859 if (!ai)
8860 {
8862 return;
8863 }
8864
8866 if (!action_array)
8867 {
8868 action_array = new array<ActionBase_Basic>;
8870 }
8871 if (LogManager.IsActionLogEnable())
8872 {
8873 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8874 }
8875
8876 if (action_array.Find(action) != -1)
8877 {
8878 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8879 }
8880 else
8881 {
8882 action_array.Insert(action);
8883 }
8884 }
8885
8887 {
8889 ActionBase action = player.GetActionManager().GetAction(actionName);
8892
8893 if (action_array)
8894 {
8895 action_array.RemoveItem(action);
8896 }
8897 }
8898
8899
8900
8902 {
8903 ActionOverrideData overrideData = new ActionOverrideData();
8907
8909 if (!actionMap)
8910 {
8913 }
8914
8915 actionMap.Insert(this.
Type(), overrideData);
8916
8917 }
8918
8920
8922
8923
8925 {
8928
8931
8932 string config_to_search = "CfgVehicles";
8933 string muzzle_owner_config;
8934
8936 {
8937 if (IsInherited(Weapon))
8938 config_to_search = "CfgWeapons";
8939
8940 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8941
8942 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8943
8945
8946 if (config_OnFire_subclass_count > 0)
8947 {
8948 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8949
8950 for (int i = 0; i < config_OnFire_subclass_count; i++)
8951 {
8952 string particle_class = "";
8954 string config_OnFire_entry = config_OnFire_class + particle_class;
8955 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8956 WPOF_array.Insert(WPOF);
8957 }
8958
8959
8961 }
8962 }
8963
8965 {
8966 config_to_search = "CfgWeapons";
8967 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8968
8969 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8970
8972
8973 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8974 {
8975 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8976
8977 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8978 {
8979 string particle_class2 = "";
8981 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8982 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8983 WPOBE_array.Insert(WPOBE);
8984 }
8985
8986
8988 }
8989 }
8990 }
8991
8992
8994 {
8997
8999 {
9000 string config_to_search = "CfgVehicles";
9001
9002 if (IsInherited(Weapon))
9003 config_to_search = "CfgWeapons";
9004
9005 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9006 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9007
9008 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9009 {
9010
9012
9014 {
9016 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9018 return;
9019 }
9020
9023
9024
9025
9027 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9028
9029 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9030 {
9031 string particle_class = "";
9033 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9035
9036 if (entry_type == CT_CLASS)
9037 {
9038 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9039 WPOOH_array.Insert(WPOF);
9040 }
9041 }
9042
9043
9045 }
9046 }
9047 }
9048
9050 {
9052 }
9053
9055 {
9057 {
9059
9062
9065
9066 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9067 }
9068 }
9069
9071 {
9073 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9074
9076 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9077
9079 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9080
9082 {
9084 }
9085 }
9086
9088 {
9090 }
9091
9093 {
9096 else
9098
9100 {
9103 }
9104 else
9105 {
9108
9111 }
9112
9114 }
9115
9117 {
9119 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9120 }
9121
9123 {
9125 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9127 }
9128
9130 {
9132 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9133 }
9134
9136 {
9139
9140 OverheatingParticle OP = new OverheatingParticle();
9145
9147 }
9148
9150 {
9153
9154 return -1;
9155 }
9156
9158 {
9160 {
9163
9164 for (int i = count; i > 0; --i)
9165 {
9166 int id = i - 1;
9169
9172
9173 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9174 {
9175 if (p)
9176 {
9179 }
9180 }
9181 }
9182 }
9183 }
9184
9186 {
9188 {
9190 {
9191 int id = i - 1;
9193
9194 if (OP)
9195 {
9197
9198 if (p)
9199 {
9201 }
9202
9203 delete OP;
9204 }
9205 }
9206
9209 }
9210 }
9211
9214 {
9215 return 0.0;
9216 }
9217
9218
9220 {
9221 return 250;
9222 }
9223
9225 {
9226 return 0;
9227 }
9228
9231 {
9233 return true;
9234
9235 return false;
9236 }
9237
9240 {
9243
9245 {
9247 }
9248 else
9249 {
9250
9252 }
9253
9255 }
9256
9263 {
9264 return -1;
9265 }
9266
9267
9268
9269
9271 {
9273 {
9275 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9276
9277 if (r_index >= 0)
9278 {
9279 InventoryLocation r_il = new InventoryLocation;
9280 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9281
9282 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9285 {
9286 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9287 }
9289 {
9290 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9291 }
9292
9293 }
9294
9295 player.GetHumanInventory().ClearUserReservedLocation(this);
9296 }
9297
9300 }
9301
9302
9303
9304
9306 {
9307 return ItemBase.m_DebugActionsMask;
9308 }
9309
9311 {
9312 return ItemBase.m_DebugActionsMask & mask;
9313 }
9314
9316 {
9317 ItemBase.m_DebugActionsMask = mask;
9318 }
9319
9321 {
9322 ItemBase.m_DebugActionsMask |= mask;
9323 }
9324
9326 {
9327 ItemBase.m_DebugActionsMask &= ~mask;
9328 }
9329
9331 {
9333 {
9335 }
9336 else
9337 {
9339 }
9340 }
9341
9342
9344 {
9345 if (GetEconomyProfile())
9346 {
9347 float q_max = GetEconomyProfile().GetQuantityMax();
9348 if (q_max > 0)
9349 {
9350 float q_min = GetEconomyProfile().GetQuantityMin();
9351 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9352
9354 {
9355 ComponentEnergyManager comp = GetCompEM();
9357 {
9359 }
9360 }
9362 {
9364
9365 }
9366
9367 }
9368 }
9369 }
9370
9373 {
9374 EntityAI parent = GetHierarchyParent();
9375
9376 if (parent)
9377 {
9378 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9379 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9380 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9381 }
9382 }
9383
9386 {
9387 EntityAI parent = GetHierarchyParent();
9388
9389 if (parent)
9390 {
9391 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9392 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9393 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9394 }
9395 }
9396
9398 {
9399
9400
9401
9402
9404
9406 {
9407 if (ScriptInputUserData.CanStoreInputUserData())
9408 {
9409 ScriptInputUserData ctx = new ScriptInputUserData;
9415 ctx.
Write(use_stack_max);
9418
9420 {
9421 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9422 }
9423 }
9424 }
9425 else if (!
GetGame().IsMultiplayer())
9426 {
9428 }
9429 }
9430
9432 {
9434 }
9435
9437 {
9439 }
9440
9442 {
9444 }
9445
9447 {
9448
9449 return false;
9450 }
9451
9453 {
9454 return false;
9455 }
9456
9460 {
9461 return false;
9462 }
9463
9465 {
9466 return "";
9467 }
9468
9470
9472 {
9473 return false;
9474 }
9475
9477 {
9478 return true;
9479 }
9480
9481
9482
9484 {
9485 return true;
9486 }
9487
9489 {
9490 return true;
9491 }
9492
9494 {
9495 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9497 }
9498
9500 {
9502 }
9503
9505 {
9507 if (!is_being_placed)
9509 SetSynchDirty();
9510 }
9511
9512
9514
9516 {
9518 }
9519
9521 {
9523 }
9524
9526 {
9527 return 1;
9528 }
9529
9531 {
9532 return false;
9533 }
9534
9536 {
9538 SetSynchDirty();
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
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9576 {
9577 super.OnMovedInsideCargo(container);
9578
9579 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9580 }
9581
9582 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9583 {
9584 super.EEItemLocationChanged(oldLoc,newLoc);
9585
9586 PlayerBase new_player = null;
9587 PlayerBase old_player = null;
9588
9589 if (newLoc.GetParent())
9590 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9591
9592 if (oldLoc.GetParent())
9593 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9594
9596 {
9597 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9598
9599 if (r_index >= 0)
9600 {
9601 InventoryLocation r_il = new InventoryLocation;
9602 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9603
9604 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9607 {
9608 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9609 }
9611 {
9612 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9613 }
9614
9615 }
9616 }
9617
9619 {
9620 if (new_player)
9621 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9622
9623 if (new_player == old_player)
9624 {
9625
9626 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9627 {
9629 {
9630 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9631 {
9632 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9633 }
9634 }
9635 else
9636 {
9637 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9638 }
9639 }
9640
9641 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9642 {
9643 int type = oldLoc.GetType();
9645 {
9646 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9647 }
9649 {
9650 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9651 }
9652 }
9653 if (!m_OldLocation)
9654 {
9655 m_OldLocation = new InventoryLocation;
9656 }
9657 m_OldLocation.Copy(oldLoc);
9658 }
9659 else
9660 {
9661 if (m_OldLocation)
9662 {
9663 m_OldLocation.Reset();
9664 }
9665 }
9666
9668 }
9669 else
9670 {
9671 if (new_player)
9672 {
9673 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9674 if (res_index >= 0)
9675 {
9676 InventoryLocation il = new InventoryLocation;
9677 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9679 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9682 {
9683 il.
GetParent().GetOnReleaseLock().Invoke(it);
9684 }
9686 {
9688 }
9689
9690 }
9691 }
9693 {
9694
9696 }
9697
9698 if (m_OldLocation)
9699 {
9700 m_OldLocation.Reset();
9701 }
9702 }
9703 }
9704
9705 override void EOnContact(IEntity other, Contact extra)
9706 {
9708 {
9709 int liquidType = -1;
9711 if (impactSpeed > 0.0)
9712 {
9714 #ifndef SERVER
9716 #else
9718 SetSynchDirty();
9719 #endif
9721 }
9722 }
9723
9724 #ifdef SERVER
9725 if (GetCompEM() && GetCompEM().IsPlugged())
9726 {
9727 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9728 GetCompEM().UnplugThis();
9729 }
9730 #endif
9731 }
9732
9734
9736 {
9738 }
9739
9741 {
9742
9743 }
9744
9746 {
9747 super.OnItemLocationChanged(old_owner, new_owner);
9748
9749 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9750 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9751
9752 if (!relatedPlayer && playerNew)
9753 relatedPlayer = playerNew;
9754
9755 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9756 {
9758 if (actionMgr)
9759 {
9760 ActionBase currentAction = actionMgr.GetRunningAction();
9761 if (currentAction)
9763 }
9764 }
9765
9766 Man ownerPlayerOld = null;
9767 Man ownerPlayerNew = null;
9768
9769 if (old_owner)
9770 {
9771 if (old_owner.
IsMan())
9772 {
9773 ownerPlayerOld = Man.Cast(old_owner);
9774 }
9775 else
9776 {
9777 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9778 }
9779 }
9780 else
9781 {
9783 {
9785
9786 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9787 {
9788 GetCompEM().UnplugThis();
9789 }
9790 }
9791 }
9792
9793 if (new_owner)
9794 {
9795 if (new_owner.
IsMan())
9796 {
9797 ownerPlayerNew = Man.Cast(new_owner);
9798 }
9799 else
9800 {
9801 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9802 }
9803 }
9804
9805 if (ownerPlayerOld != ownerPlayerNew)
9806 {
9807 if (ownerPlayerOld)
9808 {
9809 array<EntityAI> subItemsExit = new array<EntityAI>;
9811 for (int i = 0; i < subItemsExit.Count(); i++)
9812 {
9815 }
9816 }
9817
9818 if (ownerPlayerNew)
9819 {
9820 array<EntityAI> subItemsEnter = new array<EntityAI>;
9822 for (int j = 0; j < subItemsEnter.Count(); j++)
9823 {
9826 }
9827 }
9828 }
9829 else if (ownerPlayerNew != null)
9830 {
9831 PlayerBase nplayer;
9832 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9833 {
9834 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9836 for (int k = 0; k < subItemsUpdate.Count(); k++)
9837 {
9839 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9840 }
9841 }
9842 }
9843
9844 if (old_owner)
9845 old_owner.OnChildItemRemoved(this);
9846 if (new_owner)
9847 new_owner.OnChildItemReceived(this);
9848 }
9849
9850
9852 {
9853 super.EEDelete(parent);
9854 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9855 if (player)
9856 {
9858
9859 if (player.IsAlive())
9860 {
9861 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9862 if (r_index >= 0)
9863 {
9864 InventoryLocation r_il = new InventoryLocation;
9865 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9866
9867 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9870 {
9871 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9872 }
9874 {
9875 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9876 }
9877
9878 }
9879
9880 player.RemoveQuickBarEntityShortcut(this);
9881 }
9882 }
9883 }
9884
9886 {
9887 super.EEKilled(killer);
9888
9891 {
9892 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9893 {
9894 if (IsMagazine())
9895 {
9896 if (Magazine.Cast(this).GetAmmoCount() > 0)
9897 {
9899 }
9900 }
9901 else
9902 {
9904 }
9905 }
9906 }
9907 }
9908
9910 {
9911 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9912
9913 super.OnWasAttached(parent, slot_id);
9914
9917
9919 }
9920
9922 {
9923 super.OnWasDetached(parent, slot_id);
9924
9927 }
9928
9930 {
9931 int idx;
9934
9935 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9936 if (inventory_slots.Count() < 1)
9937 {
9938 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9939 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9940 }
9941 else
9942 {
9943 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9944 }
9945
9946 idx = inventory_slots.Find(slot);
9947 if (idx < 0)
9948 return "";
9949
9950 return attach_types.Get(idx);
9951 }
9952
9954 {
9955 int idx = -1;
9956 string slot;
9957
9960
9961 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9962 if (inventory_slots.Count() < 1)
9963 {
9964 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9965 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9966 }
9967 else
9968 {
9969 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9970 if (detach_types.Count() < 1)
9971 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9972 }
9973
9974 for (int i = 0; i < inventory_slots.Count(); i++)
9975 {
9976 slot = inventory_slots.Get(i);
9977 }
9978
9979 if (slot != "")
9980 {
9981 if (detach_types.Count() == 1)
9982 idx = 0;
9983 else
9984 idx = inventory_slots.Find(slot);
9985 }
9986 if (idx < 0)
9987 return "";
9988
9989 return detach_types.Get(idx);
9990 }
9991
9993 {
9994
9996
9997
9998 float min_time = 1;
9999 float max_time = 3;
10000 float delay = Math.RandomFloat(min_time, max_time);
10001
10002 explode_timer.Run(delay, this, "DoAmmoExplosion");
10003 }
10004
10006 {
10007 Magazine magazine = Magazine.Cast(this);
10008 int pop_sounds_count = 6;
10009 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10010
10011
10012 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10013 string sound_name = pop_sounds[ sound_idx ];
10015
10016
10017 magazine.ServerAddAmmoCount(-1);
10018
10019
10020 float min_temp_to_explode = 100;
10021
10022 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10023 {
10025 }
10026 }
10027
10028
10029 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10030 {
10031 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10032
10033 const int CHANCE_DAMAGE_CARGO = 4;
10034 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10035 const int CHANCE_DAMAGE_NOTHING = 2;
10036
10038 {
10039 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10040 int chances;
10041 int rnd;
10042
10043 if (GetInventory().GetCargo())
10044 {
10045 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10046 rnd = Math.RandomInt(0,chances);
10047
10048 if (rnd < CHANCE_DAMAGE_CARGO)
10049 {
10051 }
10052 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10053 {
10055 }
10056 }
10057 else
10058 {
10059 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10060 rnd = Math.RandomInt(0,chances);
10061
10062 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10063 {
10065 }
10066 }
10067 }
10068 }
10069
10071 {
10072 if (GetInventory().GetCargo())
10073 {
10074 int item_count = GetInventory().GetCargo().GetItemCount();
10075 if (item_count > 0)
10076 {
10077 int random_pick = Math.RandomInt(0, item_count);
10079 if (!item.IsExplosive())
10080 {
10081 item.AddHealth("","",damage);
10082 return true;
10083 }
10084 }
10085 }
10086 return false;
10087 }
10088
10090 {
10091 int attachment_count = GetInventory().AttachmentCount();
10092 if (attachment_count > 0)
10093 {
10094 int random_pick = Math.RandomInt(0, attachment_count);
10095 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10096 if (!attachment.IsExplosive())
10097 {
10098 attachment.AddHealth("","",damage);
10099 return true;
10100 }
10101 }
10102 return false;
10103 }
10104
10106 {
10108 }
10109
10111 {
10113 return GetInventory().CanRemoveEntity();
10114
10115 return false;
10116 }
10117
10119 {
10121 return;
10122
10124 {
10125 if (ScriptInputUserData.CanStoreInputUserData())
10126 {
10127 ScriptInputUserData ctx = new ScriptInputUserData;
10132 ctx.
Write(destination_entity);
10134 ctx.
Write(slot_id);
10136 }
10137 }
10138 else if (!
GetGame().IsMultiplayer())
10139 {
10141 }
10142 }
10143
10145 {
10147 return;
10148
10149 float split_quantity_new;
10153 InventoryLocation loc = new InventoryLocation;
10154
10155 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10156 {
10158 split_quantity_new = stack_max;
10159 else
10161
10162 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10163 if (new_item)
10164 {
10165 new_item.SetResultOfSplit(true);
10166 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10168 new_item.SetQuantity(split_quantity_new);
10169 }
10170 }
10171 else if (destination_entity && slot_id == -1)
10172 {
10173 if (quantity > stack_max)
10174 split_quantity_new = stack_max;
10175 else
10176 split_quantity_new = quantity;
10177
10179 {
10182 }
10183
10184 if (new_item)
10185 {
10186 new_item.SetResultOfSplit(true);
10187 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10189 new_item.SetQuantity(split_quantity_new);
10190 }
10191 }
10192 else
10193 {
10194 if (stack_max != 0)
10195 {
10197 {
10199 }
10200
10201 if (split_quantity_new == 0)
10202 {
10203 if (!
GetGame().IsMultiplayer())
10204 player.PhysicalPredictiveDropItem(this);
10205 else
10206 player.ServerDropEntity(this);
10207 return;
10208 }
10209
10211
10212 if (new_item)
10213 {
10214 new_item.SetResultOfSplit(true);
10215 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10217 new_item.SetQuantity(stack_max);
10218 new_item.PlaceOnSurface();
10219 }
10220 }
10221 }
10222 }
10223
10225 {
10227 return;
10228
10229 float split_quantity_new;
10233 InventoryLocation loc = new InventoryLocation;
10234
10235 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10236 {
10238 split_quantity_new = stack_max;
10239 else
10241
10242 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10243 if (new_item)
10244 {
10245 new_item.SetResultOfSplit(true);
10246 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10248 new_item.SetQuantity(split_quantity_new);
10249 }
10250 }
10251 else if (destination_entity && slot_id == -1)
10252 {
10253 if (quantity > stack_max)
10254 split_quantity_new = stack_max;
10255 else
10256 split_quantity_new = quantity;
10257
10259 {
10262 }
10263
10264 if (new_item)
10265 {
10266 new_item.SetResultOfSplit(true);
10267 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10269 new_item.SetQuantity(split_quantity_new);
10270 }
10271 }
10272 else
10273 {
10274 if (stack_max != 0)
10275 {
10277 {
10279 }
10280
10282
10283 if (new_item)
10284 {
10285 new_item.SetResultOfSplit(true);
10286 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10288 new_item.SetQuantity(stack_max);
10289 new_item.PlaceOnSurface();
10290 }
10291 }
10292 }
10293 }
10294
10296 {
10298 return;
10299
10301 {
10302 if (ScriptInputUserData.CanStoreInputUserData())
10303 {
10304 ScriptInputUserData ctx = new ScriptInputUserData;
10309 dst.WriteToContext(ctx);
10311 }
10312 }
10313 else if (!
GetGame().IsMultiplayer())
10314 {
10316 }
10317 }
10318
10320 {
10322 return;
10323
10325 {
10326 if (ScriptInputUserData.CanStoreInputUserData())
10327 {
10328 ScriptInputUserData ctx = new ScriptInputUserData;
10333 ctx.
Write(destination_entity);
10339 }
10340 }
10341 else if (!
GetGame().IsMultiplayer())
10342 {
10344 }
10345 }
10346
10348 {
10350 }
10351
10353 {
10355 return this;
10356
10358 float split_quantity_new;
10360 if (dst.IsValid())
10361 {
10362 int slot_id = dst.GetSlot();
10364
10365 if (quantity > stack_max)
10366 split_quantity_new = stack_max;
10367 else
10368 split_quantity_new = quantity;
10369
10371
10372 if (new_item)
10373 {
10374 new_item.SetResultOfSplit(true);
10375 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10378 }
10379
10380 return new_item;
10381 }
10382
10383 return null;
10384 }
10385
10387 {
10389 return;
10390
10392 float split_quantity_new;
10394 if (destination_entity)
10395 {
10397 if (quantity > stackable)
10398 split_quantity_new = stackable;
10399 else
10400 split_quantity_new = quantity;
10401
10402 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10403 if (new_item)
10404 {
10405 new_item.SetResultOfSplit(true);
10406 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10408 new_item.SetQuantity(split_quantity_new);
10409 }
10410 }
10411 }
10412
10414 {
10416 return;
10417
10419 {
10420 if (ScriptInputUserData.CanStoreInputUserData())
10421 {
10422 ScriptInputUserData ctx = new ScriptInputUserData;
10427 ItemBase destination_entity =
this;
10428 ctx.
Write(destination_entity);
10432 }
10433 }
10434 else if (!
GetGame().IsMultiplayer())
10435 {
10437 }
10438 }
10439
10441 {
10443 return;
10444
10446 float split_quantity_new;
10448 if (player)
10449 {
10451 if (quantity > stackable)
10452 split_quantity_new = stackable;
10453 else
10454 split_quantity_new = quantity;
10455
10456 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10457 new_item =
ItemBase.Cast(in_hands);
10458 if (new_item)
10459 {
10460 new_item.SetResultOfSplit(true);
10461 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10463 new_item.SetQuantity(split_quantity_new);
10464 }
10465 }
10466 }
10467
10469 {
10471 return;
10472
10474 float split_quantity_new = Math.Floor(quantity * 0.5);
10475
10477
10478 if (new_item)
10479 {
10480 if (new_item.GetQuantityMax() < split_quantity_new)
10481 {
10482 split_quantity_new = new_item.GetQuantityMax();
10483 }
10484
10485 new_item.SetResultOfSplit(true);
10486 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10487
10489 {
10492 }
10493 else
10494 {
10497 }
10498 }
10499 }
10500
10502 {
10504 return;
10505
10507 float split_quantity_new = Math.Floor(quantity / 2);
10508
10509 InventoryLocation invloc = new InventoryLocation;
10511
10513 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10514
10515 if (new_item)
10516 {
10517 if (new_item.GetQuantityMax() < split_quantity_new)
10518 {
10519 split_quantity_new = new_item.GetQuantityMax();
10520 }
10522 {
10525 }
10526 else
10527 {
10530 }
10531 }
10532 }
10533
10536 {
10537 SetWeightDirty();
10539
10540 if (parent)
10541 parent.OnAttachmentQuantityChangedEx(this, delta);
10542
10544 {
10546 {
10548 }
10550 {
10551 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10553 }
10554 }
10555
10556 }
10557
10560 {
10561
10562 }
10563
10566 {
10568 }
10569
10571 {
10572 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10573
10575 {
10576 if (newLevel == GameConstants.STATE_RUINED)
10577 {
10579 EntityAI parent = GetHierarchyParent();
10580 if (parent && parent.IsFireplace())
10581 {
10582 CargoBase cargo = GetInventory().GetCargo();
10583 if (cargo)
10584 {
10586 {
10588 }
10589 }
10590 }
10591 }
10592
10594 {
10595
10597 return;
10598 }
10599
10600 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10601 {
10603 }
10604 }
10605 }
10606
10607
10609 {
10610 super.OnRightClick();
10611
10613 {
10615 {
10616 if (ScriptInputUserData.CanStoreInputUserData())
10617 {
10618 vector m4[4];
10620
10621 EntityAI root = GetHierarchyRoot();
10622
10623 InventoryLocation dst = new InventoryLocation;
10625 {
10626 if (root)
10627 {
10628 root.GetTransform(m4);
10630 }
10631 else
10632 GetInventory().GetCurrentInventoryLocation(dst);
10633 }
10634 else
10635 {
10637
10638
10639 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10640 {
10641 if (root)
10642 {
10643 root.GetTransform(m4);
10645 }
10646 else
10647 GetInventory().GetCurrentInventoryLocation(dst);
10648 }
10649 else
10650 {
10651 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10652 }
10653 }
10654
10655 ScriptInputUserData ctx = new ScriptInputUserData;
10663 }
10664 }
10665 else if (!
GetGame().IsMultiplayer())
10666 {
10668 }
10669 }
10670 }
10671
10672 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10673 {
10674
10675 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10676 return false;
10677
10678 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10679 return false;
10680
10681
10683 return false;
10684
10685
10686 Magazine mag = Magazine.Cast(this);
10687 if (mag)
10688 {
10689 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10690 return false;
10691
10692 if (stack_max_limit)
10693 {
10694 Magazine other_mag = Magazine.Cast(other_item);
10695 if (other_item)
10696 {
10697 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10698 return false;
10699 }
10700
10701 }
10702 }
10703 else
10704 {
10705
10707 return false;
10708
10710 return false;
10711 }
10712
10713 PlayerBase player = null;
10714 if (CastTo(player, GetHierarchyRootPlayer()))
10715 {
10716 if (player.GetInventory().HasAttachment(this))
10717 return false;
10718
10719 if (player.IsItemsToDelete())
10720 return false;
10721 }
10722
10723 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10724 return false;
10725
10726 int slotID;
10728 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10729 return false;
10730
10731 return true;
10732 }
10733
10735 {
10737 }
10738
10740 {
10741 return m_IsResultOfSplit;
10742 }
10743
10745 {
10746 m_IsResultOfSplit = value;
10747 }
10748
10750 {
10752 }
10753
10755 {
10756 float other_item_quantity = other_item.GetQuantity();
10757 float this_free_space;
10758
10760
10762
10763 if (other_item_quantity > this_free_space)
10764 {
10765 return this_free_space;
10766 }
10767 else
10768 {
10769 return other_item_quantity;
10770 }
10771 }
10772
10774 {
10776 }
10777
10779 {
10781 return;
10782
10783 if (!IsMagazine() && other_item)
10784 {
10786 if (quantity_used != 0)
10787 {
10788 float hp1 = GetHealth01("","");
10789 float hp2 = other_item.GetHealth01("","");
10790 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10791 hpResult = hpResult / (
GetQuantity() + quantity_used);
10792
10793 hpResult *= GetMaxHealth();
10794 Math.Round(hpResult);
10795 SetHealth("", "Health", hpResult);
10796
10798 other_item.AddQuantity(-quantity_used);
10799 }
10800 }
10802 }
10803
10805 {
10806 #ifdef SERVER
10807 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10808 GetHierarchyParent().IncreaseLifetimeUp();
10809 #endif
10810 };
10811
10813 {
10814 PlayerBase p = PlayerBase.Cast(player);
10815
10816 array<int> recipesIds = p.m_Recipes;
10817 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10818 if (moduleRecipesManager)
10819 {
10820 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10821 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10822 }
10823
10824 for (int i = 0;i < recipesIds.Count(); i++)
10825 {
10826 int key = recipesIds.Get(i);
10827 string recipeName = moduleRecipesManager.GetRecipeName(key);
10829 }
10830 }
10831
10832
10833 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10834 {
10835 super.GetDebugActions(outputList);
10836
10837
10842
10843
10847
10851
10852
10855
10856
10858 {
10861 }
10862
10864
10867
10871 }
10872
10873
10874
10875
10877 {
10878 super.OnAction(action_id, player, ctx);
10879 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10880 {
10881 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10882 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10883 PlayerBase p = PlayerBase.Cast(player);
10884 if (
EActions.RECIPES_RANGE_START < 1000)
10885 {
10886 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10887 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10888 }
10889 }
10890 #ifndef SERVER
10891 else if (action_id ==
EActions.WATCH_PLAYER)
10892 {
10893 PluginDeveloper.SetDeveloperItemClientEx(player);
10894 }
10895 #endif
10897 {
10898 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10899 {
10900 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10901 OnDebugButtonPressServer(id + 1);
10902 }
10903
10904 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10905 {
10906 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10908 }
10909
10910 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10911 {
10912 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10914 }
10915
10916 else if (action_id ==
EActions.ADD_QUANTITY)
10917 {
10918 if (IsMagazine())
10919 {
10920 Magazine mag = Magazine.Cast(this);
10921 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10922 }
10923 else
10924 {
10926 }
10927
10928 if (m_EM)
10929 {
10930 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10931 }
10932
10933 }
10934
10935 else if (action_id ==
EActions.REMOVE_QUANTITY)
10936 {
10937 if (IsMagazine())
10938 {
10939 Magazine mag2 = Magazine.Cast(this);
10940 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10941 }
10942 else
10943 {
10945 }
10946 if (m_EM)
10947 {
10948 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10949 }
10950
10951 }
10952
10953 else if (action_id ==
EActions.SET_QUANTITY_0)
10954 {
10956
10957 if (m_EM)
10958 {
10959 m_EM.SetEnergy(0);
10960 }
10961 }
10962
10963 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10964 {
10966
10967 if (m_EM)
10968 {
10969 m_EM.SetEnergy(m_EM.GetEnergyMax());
10970 }
10971 }
10972
10973 else if (action_id ==
EActions.ADD_HEALTH)
10974 {
10975 AddHealth("","",GetMaxHealth("","Health")/5);
10976 }
10977 else if (action_id ==
EActions.REMOVE_HEALTH)
10978 {
10979 AddHealth("","",-GetMaxHealth("","Health")/5);
10980 }
10981 else if (action_id ==
EActions.DESTROY_HEALTH)
10982 {
10983 SetHealth01("","",0);
10984 }
10985 else if (action_id ==
EActions.WATCH_ITEM)
10986 {
10988 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10989 #ifdef DEVELOPER
10990 SetDebugDeveloper_item(this);
10991 #endif
10992 }
10993
10994 else if (action_id ==
EActions.ADD_TEMPERATURE)
10995 {
10996 AddTemperature(20);
10997
10998 }
10999
11000 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11001 {
11002 AddTemperature(-20);
11003
11004 }
11005
11006 else if (action_id ==
EActions.FLIP_FROZEN)
11007 {
11008 SetFrozen(!GetIsFrozen());
11009
11010 }
11011
11012 else if (action_id ==
EActions.ADD_WETNESS)
11013 {
11015
11016 }
11017
11018 else if (action_id ==
EActions.REMOVE_WETNESS)
11019 {
11021
11022 }
11023
11024 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11025 {
11028
11029
11030 }
11031
11032 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11033 {
11036 }
11037
11038 else if (action_id ==
EActions.MAKE_SPECIAL)
11039 {
11040 auto debugParams = DebugSpawnParams.WithPlayer(player);
11041 OnDebugSpawnEx(debugParams);
11042 }
11043
11044 else if (action_id ==
EActions.DELETE)
11045 {
11046 Delete();
11047 }
11048
11049 }
11050
11051
11052 return false;
11053 }
11054
11055
11056
11057
11061
11064
11065
11066
11068 {
11069 return false;
11070 }
11071
11072
11074 {
11075 return true;
11076 }
11077
11078
11080 {
11081 return true;
11082 }
11083
11084
11085
11087 {
11088 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11090 }
11091
11094 {
11095 return null;
11096 }
11097
11099 {
11100 return false;
11101 }
11102
11104 {
11105 return false;
11106 }
11107
11111
11112
11114 {
11115 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11116 return module_repairing.CanRepair(this, item_repair_kit);
11117 }
11118
11119
11120 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11121 {
11122 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11123 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11124 }
11125
11126
11128 {
11129
11130
11131
11132
11133
11134
11135
11136
11137 return 1;
11138 }
11139
11140
11141
11143 {
11145 }
11146
11147
11148
11150 {
11152 }
11153
11154
11163 {
11164 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11165
11166 if (player)
11167 {
11168 player.MessageStatus(text);
11169 }
11170 }
11171
11172
11181 {
11182 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11183
11184 if (player)
11185 {
11186 player.MessageAction(text);
11187 }
11188 }
11189
11190
11199 {
11200 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11201
11202 if (player)
11203 {
11204 player.MessageFriendly(text);
11205 }
11206 }
11207
11208
11217 {
11218 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11219
11220 if (player)
11221 {
11222 player.MessageImportant(text);
11223 }
11224 }
11225
11227 {
11228 return true;
11229 }
11230
11231
11232 override bool KindOf(
string tag)
11233 {
11234 bool found = false;
11235 string item_name = this.
GetType();
11238
11239 int array_size = item_tag_array.Count();
11240 for (int i = 0; i < array_size; i++)
11241 {
11242 if (item_tag_array.Get(i) == tag)
11243 {
11244 found = true;
11245 break;
11246 }
11247 }
11248 return found;
11249 }
11250
11251
11253 {
11254
11255 super.OnRPC(sender, rpc_type,ctx);
11256
11257
11258 switch (rpc_type)
11259 {
11260 #ifndef SERVER
11261 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11262 Param2<bool, string> p = new Param2<bool, string>(false, "");
11263
11265 return;
11266
11267 bool play = p.param1;
11268 string soundSet = p.param2;
11269
11270 if (play)
11271 {
11273 {
11275 {
11277 }
11278 }
11279 else
11280 {
11282 }
11283 }
11284 else
11285 {
11287 }
11288
11289 break;
11290 #endif
11291
11292 }
11293
11295 {
11297 }
11298 }
11299
11300
11301
11302
11304 {
11305 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11306 return plugin.GetID(
name);
11307 }
11308
11310 {
11311 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11312 return plugin.GetName(id);
11313 }
11314
11317 {
11318
11319
11320 int varFlags;
11321 if (!ctx.
Read(varFlags))
11322 return;
11323
11324 if (varFlags & ItemVariableFlags.FLOAT)
11325 {
11327 }
11328 }
11329
11331 {
11332
11333 super.SerializeNumericalVars(floats_out);
11334
11335
11336
11338 {
11340 }
11341
11343 {
11345 }
11346
11348 {
11350 }
11351
11353 {
11358 }
11359
11361 {
11363 }
11364 }
11365
11367 {
11368
11369 super.DeSerializeNumericalVars(floats);
11370
11371
11372 int index = 0;
11373 int mask = Math.Round(floats.Get(index));
11374
11375 index++;
11376
11378 {
11380 {
11382 }
11383 else
11384 {
11385 float quantity = floats.Get(index);
11386 SetQuantity(quantity,
true,
false,
false,
false);
11387 }
11388 index++;
11389 }
11390
11392 {
11393 float wet = floats.Get(index);
11395 index++;
11396 }
11397
11399 {
11400 int liquidtype = Math.Round(floats.Get(index));
11402 index++;
11403 }
11404
11406 {
11408 index++;
11410 index++;
11412 index++;
11414 index++;
11415 }
11416
11418 {
11419 int cleanness = Math.Round(floats.Get(index));
11421 index++;
11422 }
11423 }
11424
11426 {
11427 super.WriteVarsToCTX(ctx);
11428
11429
11431 {
11433 }
11434
11436 {
11438 }
11439
11441 {
11443 }
11444
11446 {
11447 int r,g,b,a;
11453 }
11454
11456 {
11458 }
11459 }
11460
11462 {
11463 if (!super.ReadVarsFromCTX(ctx,version))
11464 return false;
11465
11466 int intValue;
11467 float value;
11468
11469 if (version < 140)
11470 {
11471 if (!ctx.
Read(intValue))
11472 return false;
11473
11474 m_VariablesMask = intValue;
11475 }
11476
11478 {
11479 if (!ctx.
Read(value))
11480 return false;
11481
11483 {
11485 }
11486 else
11487 {
11489 }
11490 }
11491
11492 if (version < 140)
11493 {
11495 {
11496 if (!ctx.
Read(value))
11497 return false;
11498 SetTemperatureDirect(value);
11499 }
11500 }
11501
11503 {
11504 if (!ctx.
Read(value))
11505 return false;
11507 }
11508
11510 {
11511 if (!ctx.
Read(intValue))
11512 return false;
11514 }
11515
11517 {
11518 int r,g,b,a;
11520 return false;
11522 return false;
11524 return false;
11526 return false;
11527
11529 }
11530
11532 {
11533 if (!ctx.
Read(intValue))
11534 return false;
11536 }
11537
11538 if (version >= 138 && version < 140)
11539 {
11541 {
11542 if (!ctx.
Read(intValue))
11543 return false;
11544 SetFrozen(intValue);
11545 }
11546 }
11547
11548 return true;
11549 }
11550
11551
11553 {
11556 {
11558 }
11559
11560 if (!super.OnStoreLoad(ctx, version))
11561 {
11563 return false;
11564 }
11565
11566 if (version >= 114)
11567 {
11568 bool hasQuickBarIndexSaved;
11569
11570 if (!ctx.
Read(hasQuickBarIndexSaved))
11571 {
11573 return false;
11574 }
11575
11576 if (hasQuickBarIndexSaved)
11577 {
11578 int itmQBIndex;
11579
11580
11581 if (!ctx.
Read(itmQBIndex))
11582 {
11584 return false;
11585 }
11586
11587 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11588 if (itmQBIndex != -1 && parentPlayer)
11589 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11590 }
11591 }
11592 else
11593 {
11594
11595 PlayerBase player;
11596 int itemQBIndex;
11597 if (version ==
int.
MAX)
11598 {
11599 if (!ctx.
Read(itemQBIndex))
11600 {
11602 return false;
11603 }
11604 }
11605 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11606 {
11607
11608 if (!ctx.
Read(itemQBIndex))
11609 {
11611 return false;
11612 }
11613 if (itemQBIndex != -1 && player)
11614 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11615 }
11616 }
11617
11618 if (version < 140)
11619 {
11620
11621 if (!LoadVariables(ctx, version))
11622 {
11624 return false;
11625 }
11626 }
11627
11628
11630 {
11632 return false;
11633 }
11634 if (version >= 132)
11635 {
11637 if (raib)
11638 {
11640 {
11642 return false;
11643 }
11644 }
11645 }
11646
11648 return true;
11649 }
11650
11651
11652
11654 {
11655 super.OnStoreSave(ctx);
11656
11657 PlayerBase player;
11658 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11659 {
11661
11662 int itemQBIndex = -1;
11663 itemQBIndex = player.FindQuickBarEntityIndex(this);
11664 ctx.
Write(itemQBIndex);
11665 }
11666 else
11667 {
11669 }
11670
11672
11674 if (raib)
11675 {
11677 }
11678 }
11679
11680
11682 {
11683 super.AfterStoreLoad();
11684
11686 {
11688 }
11689
11691 {
11694 }
11695 }
11696
11698 {
11699 super.EEOnAfterLoad();
11700
11702 {
11704 }
11705
11708 }
11709
11711 {
11712 return false;
11713 }
11714
11715
11716
11718 {
11720 {
11721 #ifdef PLATFORM_CONSOLE
11722
11724 {
11726 if (menu)
11727 {
11729 }
11730 }
11731 #endif
11732 }
11733
11735 {
11738 }
11739
11741 {
11742 SetWeightDirty();
11744 }
11746 {
11749 }
11750
11752 {
11755 }
11757 {
11760 }
11761
11762 super.OnVariablesSynchronized();
11763 }
11764
11765
11766
11768 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11769 {
11770 if (!IsServerCheck(allow_client))
11771 return false;
11772
11774 return false;
11775
11778
11779 if (value <= (min + 0.001))
11780 value = min;
11781
11782 if (value == min)
11783 {
11784 if (destroy_config)
11785 {
11786 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11787 if (dstr)
11788 {
11790 this.Delete();
11791 return true;
11792 }
11793 }
11794 else if (destroy_forced)
11795 {
11797 this.Delete();
11798 return true;
11799 }
11800
11802 }
11803
11806
11808 {
11810
11811 if (delta)
11813 }
11814
11816
11817 return false;
11818 }
11819
11820
11822 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11823 {
11825 }
11826
11828 {
11831 }
11832
11834 {
11837 }
11838
11841 {
11842 float value_clamped = Math.Clamp(value, 0, 1);
11844 SetQuantity(result, destroy_config, destroy_forced);
11845 }
11846
11847
11850 {
11852 }
11853
11855 {
11857 }
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11869 {
11870 int slot = -1;
11871 if (GetInventory())
11872 {
11873 InventoryLocation il = new InventoryLocation;
11874 GetInventory().GetCurrentInventoryLocation(il);
11876 }
11877
11879 }
11880
11882 {
11883 float quantity_max = 0;
11884
11886 {
11887 if (attSlotID != -1)
11888 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11889
11890 if (quantity_max <= 0)
11892 }
11893
11894 if (quantity_max <= 0)
11896
11897 return quantity_max;
11898 }
11899
11901 {
11903 }
11904
11906 {
11908 }
11909
11910
11912 {
11914 }
11915
11917 {
11919 }
11920
11922 {
11924 }
11925
11926
11928 {
11929
11930 float weightEx = GetWeightEx();
11931 float special = GetInventoryAndCargoWeight();
11932 return weightEx - special;
11933 }
11934
11935
11937 {
11939 }
11940
11942 {
11944 {
11945 #ifdef DEVELOPER
11946 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11947 {
11948 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11950 }
11951 #endif
11952
11953 return GetQuantity() * GetConfigWeightModified();
11954 }
11955 else if (HasEnergyManager())
11956 {
11957 #ifdef DEVELOPER
11958 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11959 {
11960 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11961 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11962 }
11963 #endif
11964 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11965 }
11966 else
11967 {
11968 #ifdef DEVELOPER
11969 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11970 {
11971 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11972 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11973 }
11974 #endif
11975 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11976 }
11977 }
11978
11981 {
11982 int item_count = 0;
11984
11985 if (GetInventory().GetCargo() != NULL)
11986 {
11987 item_count = GetInventory().GetCargo().GetItemCount();
11988 }
11989
11990 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11991 {
11992 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11993 if (item)
11994 item_count += item.GetNumberOfItems();
11995 }
11996 return item_count;
11997 }
11998
12001 {
12002 float weight = 0;
12003 float wetness = 1;
12004 if (include_wetness)
12007 {
12008 weight = wetness * m_ConfigWeight;
12009 }
12011 {
12012 weight = 1;
12013 }
12014 return weight;
12015 }
12016
12017
12018
12020 {
12021 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12022 {
12023 GameInventory inv = GetInventory();
12024 array<EntityAI> items = new array<EntityAI>;
12026 for (int i = 0; i < items.Count(); i++)
12027 {
12029 if (item)
12030 {
12032 }
12033 }
12034 }
12035 }
12036
12037
12038
12039
12041 {
12042 float energy = 0;
12043 if (HasEnergyManager())
12044 {
12045 energy = GetCompEM().GetEnergy();
12046 }
12047 return energy;
12048 }
12049
12050
12052 {
12053 super.OnEnergyConsumed();
12054
12056 }
12057
12059 {
12060 super.OnEnergyAdded();
12061
12063 }
12064
12065
12067 {
12068 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12069 {
12071 {
12072 float energy_0to1 = GetCompEM().GetEnergy0To1();
12074 }
12075 }
12076 }
12077
12078
12080 {
12081 return ConfigGetFloat("heatIsolation");
12082 }
12083
12085 {
12087 }
12088
12090 {
12091 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12092 if (
GetGame().ConfigIsExisting(paramPath))
12094
12095 return 0.0;
12096 }
12097
12099 {
12100 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12101 if (
GetGame().ConfigIsExisting(paramPath))
12103
12104 return 0.0;
12105 }
12106
12107 override void SetWet(
float value,
bool allow_client =
false)
12108 {
12109 if (!IsServerCheck(allow_client))
12110 return;
12111
12114
12116
12117 m_VarWet = Math.Clamp(value, min, max);
12118
12120 {
12123 }
12124 }
12125
12126 override void AddWet(
float value)
12127 {
12129 }
12130
12132 {
12134 }
12135
12137 {
12139 }
12140
12142 {
12144 }
12145
12147 {
12149 }
12150
12152 {
12154 }
12155
12156 override void OnWetChanged(
float newVal,
float oldVal)
12157 {
12160 if (newLevel != oldLevel)
12161 {
12163 }
12164 }
12165
12167 {
12168 SetWeightDirty();
12169 }
12170
12172 {
12173 return GetWetLevelInternal(
m_VarWet);
12174 }
12175
12176
12177
12179 {
12181 }
12182
12184 {
12186 }
12187
12189 {
12191 }
12192
12194 {
12196 }
12197
12198
12199
12201 {
12202 if (ConfigIsExisting("itemModelLength"))
12203 {
12204 return ConfigGetFloat("itemModelLength");
12205 }
12206 return 0;
12207 }
12208
12210 {
12211 if (ConfigIsExisting("itemAttachOffset"))
12212 {
12213 return ConfigGetFloat("itemAttachOffset");
12214 }
12215 return 0;
12216 }
12217
12218 override void SetCleanness(
int value,
bool allow_client =
false)
12219 {
12220 if (!IsServerCheck(allow_client))
12221 return;
12222
12224
12226
12229 }
12230
12232 {
12234 }
12235
12237 {
12238 return true;
12239 }
12240
12241
12242
12243
12245 {
12247 }
12248
12250 {
12252 }
12253
12254
12255
12256
12257 override void SetColor(
int r,
int g,
int b,
int a)
12258 {
12264 }
12266 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12267 {
12272 }
12273
12275 {
12277 }
12278
12281 {
12282 int r,g,b,a;
12284 r = r/255;
12285 g = g/255;
12286 b = b/255;
12287 a = a/255;
12288 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12289 }
12290
12291
12292
12293 override void SetLiquidType(
int value,
bool allow_client =
false)
12294 {
12295 if (!IsServerCheck(allow_client))
12296 return;
12297
12302 }
12303
12305 {
12306 return ConfigGetInt("varLiquidTypeInit");
12307 }
12308
12310 {
12312 }
12313
12315 {
12317 SetFrozen(false);
12318 }
12319
12322 {
12323 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12324 }
12325
12326
12329 {
12330 PlayerBase nplayer;
12331 if (PlayerBase.CastTo(nplayer, player))
12332 {
12334
12335 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12336 }
12337 }
12338
12339
12342 {
12343 PlayerBase nplayer;
12344 if (PlayerBase.CastTo(nplayer,player))
12345 {
12346
12347 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12348
12349 }
12350
12351
12352 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12353
12354
12355 if (HasEnergyManager())
12356 {
12357 GetCompEM().UpdatePlugState();
12358 }
12359 }
12360
12361
12363 {
12364 super.OnPlacementStarted(player);
12365
12367 }
12368
12369 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12370 {
12372 {
12373 m_AdminLog.OnPlacementComplete(player,
this);
12374 }
12375
12376 super.OnPlacementComplete(player, position, orientation);
12377 }
12378
12379
12380
12381
12382
12384 {
12386 {
12387 return true;
12388 }
12389 else
12390 {
12391 return false;
12392 }
12393 }
12394
12395
12397 {
12399 {
12401 }
12402 }
12403
12404
12406 {
12408 }
12409
12411 {
12413 }
12414
12415 override void InsertAgent(
int agent,
float count = 1)
12416 {
12417 if (count < 1)
12418 return;
12419
12421 }
12422
12425 {
12427 }
12428
12429
12431 {
12433 }
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12477 {
12479 return false;
12480 return true;
12481 }
12482
12484 {
12485
12487 }
12488
12489
12492 {
12493 super.CheckForRoofLimited(timeTresholdMS);
12494
12496 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12497 {
12498 m_PreviousRoofTestTime = time;
12499 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12500 }
12501 }
12502
12503
12505 {
12507 {
12508 return 0;
12509 }
12510
12511 if (GetInventory().GetAttachmentSlotsCount() != 0)
12512 {
12513 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12514 if (filter)
12515 return filter.GetProtectionLevel(type, false, system);
12516 else
12517 return 0;
12518 }
12519
12520 string subclassPath, entryName;
12521
12522 switch (type)
12523 {
12525 entryName = "biological";
12526 break;
12528 entryName = "chemical";
12529 break;
12530 default:
12531 entryName = "biological";
12532 break;
12533 }
12534
12535 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12536
12538 }
12539
12540
12541
12544 {
12545 if (!IsMagazine())
12547
12549 }
12550
12551
12552
12553
12554
12559 {
12560 return true;
12561 }
12562
12564 {
12566 }
12567
12568
12569
12570
12571
12573 {
12574 if (parent)
12575 {
12576 if (parent.IsInherited(DayZInfected))
12577 return true;
12578
12579 if (!parent.IsRuined())
12580 return true;
12581 }
12582
12583 return true;
12584 }
12585
12587 {
12588 if (!super.CanPutAsAttachment(parent))
12589 {
12590 return false;
12591 }
12592
12593 if (!IsRuined() && !parent.IsRuined())
12594 {
12595 return true;
12596 }
12597
12598 return false;
12599 }
12600
12602 {
12603
12604
12605
12606
12607 return super.CanReceiveItemIntoCargo(item);
12608 }
12609
12611 {
12612
12613
12614
12615
12616 GameInventory attachmentInv = attachment.GetInventory();
12618 {
12619 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12620 return false;
12621 }
12622
12623 InventoryLocation loc = new InventoryLocation();
12624 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12625 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12626 return false;
12627
12628 return super.CanReceiveAttachment(attachment, slotId);
12629 }
12630
12632 {
12633 if (!super.CanReleaseAttachment(attachment))
12634 return false;
12635
12636 return GetInventory().AreChildrenAccessible();
12637 }
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12660 {
12661 int id = muzzle_owner.GetMuzzleID();
12662 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12663
12664 if (WPOF_array)
12665 {
12666 for (int i = 0; i < WPOF_array.Count(); i++)
12667 {
12668 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12669
12670 if (WPOF)
12671 {
12672 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12673 }
12674 }
12675 }
12676 }
12677
12678
12680 {
12681 int id = muzzle_owner.GetMuzzleID();
12683
12684 if (WPOBE_array)
12685 {
12686 for (int i = 0; i < WPOBE_array.Count(); i++)
12687 {
12688 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12689
12690 if (WPOBE)
12691 {
12692 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12693 }
12694 }
12695 }
12696 }
12697
12698
12700 {
12701 int id = muzzle_owner.GetMuzzleID();
12702 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12703
12704 if (WPOOH_array)
12705 {
12706 for (int i = 0; i < WPOOH_array.Count(); i++)
12707 {
12708 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12709
12710 if (WPOOH)
12711 {
12712 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12713 }
12714 }
12715 }
12716 }
12717
12718
12720 {
12721 int id = muzzle_owner.GetMuzzleID();
12722 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12723
12724 if (WPOOH_array)
12725 {
12726 for (int i = 0; i < WPOOH_array.Count(); i++)
12727 {
12728 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12729
12730 if (WPOOH)
12731 {
12732 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12733 }
12734 }
12735 }
12736 }
12737
12738
12740 {
12741 int id = muzzle_owner.GetMuzzleID();
12742 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12743
12744 if (WPOOH_array)
12745 {
12746 for (int i = 0; i < WPOOH_array.Count(); i++)
12747 {
12748 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12749
12750 if (WPOOH)
12751 {
12752 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12753 }
12754 }
12755 }
12756 }
12757
12758
12759
12761 {
12763 {
12764 return true;
12765 }
12766
12767 return false;
12768 }
12769
12771 {
12773 {
12774 return true;
12775 }
12776
12777 return false;
12778 }
12779
12781 {
12783 {
12784 return true;
12785 }
12786
12787 return false;
12788 }
12789
12791 {
12792 return false;
12793 }
12794
12797 {
12798 return UATimeSpent.DEFAULT_DEPLOY;
12799 }
12800
12801
12802
12803
12805 {
12807 SetSynchDirty();
12808 }
12809
12811 {
12813 }
12814
12815
12817 {
12818 return false;
12819 }
12820
12823 {
12824 string att_type = "None";
12825
12826 if (ConfigIsExisting("soundAttType"))
12827 {
12828 att_type = ConfigGetString("soundAttType");
12829 }
12830
12832 }
12833
12835 {
12837 }
12838
12839
12840
12841
12842
12846
12848 {
12851
12853 }
12854
12855
12857 {
12859 return;
12860
12862
12865
12868
12869 SoundParameters params = new SoundParameters();
12873 }
12874
12875
12877 {
12879 return;
12880
12882 SetSynchDirty();
12883
12886 }
12887
12888
12890 {
12892 return;
12893
12895 SetSynchDirty();
12896
12899 }
12900
12902 {
12904 }
12905
12907 {
12909 }
12910
12913 {
12914 if (!
GetGame().IsDedicatedServer())
12915 {
12916 if (ConfigIsExisting("attachSoundSet"))
12917 {
12918 string cfg_path = "";
12919 string soundset = "";
12920 string type_name =
GetType();
12921
12924 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12925 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12926
12927 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12928 {
12929 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12930 {
12931 if (cfg_slot_array[i] == slot_type)
12932 {
12933 soundset = cfg_soundset_array[i];
12934 break;
12935 }
12936 }
12937 }
12938
12939 if (soundset != "")
12940 {
12941 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12943 }
12944 }
12945 }
12946 }
12947
12949 {
12950
12951 }
12952
12953 void OnApply(PlayerBase player);
12954
12956 {
12957 return 1.0;
12958 };
12959
12961 {
12963 }
12964
12966 {
12968 }
12969
12971
12973 {
12974 SetDynamicPhysicsLifeTime(0.01);
12976 }
12977
12979 {
12980 array<string> zone_names = new array<string>;
12981 GetDamageZones(zone_names);
12982 for (int i = 0; i < zone_names.Count(); i++)
12983 {
12984 SetHealthMax(zone_names.Get(i),"Health");
12985 }
12986 SetHealthMax("","Health");
12987 }
12988
12991 {
12992 float global_health = GetHealth01("","Health");
12993 array<string> zones = new array<string>;
12994 GetDamageZones(zones);
12995
12996 for (int i = 0; i < zones.Count(); i++)
12997 {
12998 SetHealth01(zones.Get(i),"Health",global_health);
12999 }
13000 }
13001
13004 {
13005 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13006 }
13007
13009 {
13010 if (!hasRootAsPlayer)
13011 {
13012 if (refParentIB)
13013 {
13014
13015 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13016 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13017
13018 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13019 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13020
13023 }
13024 else
13025 {
13026
13029 }
13030 }
13031 }
13032
13034 {
13036 {
13037 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13038 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13039 {
13040 float heatPermCoef = 1.0;
13042 while (ent)
13043 {
13044 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13045 ent = ent.GetHierarchyParent();
13046 }
13047
13048 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13049 }
13050 }
13051 }
13052
13054 {
13055
13056 EntityAI parent = GetHierarchyParent();
13057 if (!parent)
13058 {
13059 hasParent = false;
13060 hasRootAsPlayer = false;
13061 }
13062 else
13063 {
13064 hasParent = true;
13065 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13066 refParentIB =
ItemBase.Cast(parent);
13067 }
13068 }
13069
13070 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13071 {
13072
13073 }
13074
13076 {
13077
13078 return false;
13079 }
13080
13082 {
13083
13084
13085 return false;
13086 }
13087
13089 {
13090
13091 return false;
13092 }
13093
13096 {
13097 return !GetIsFrozen() &&
IsOpen();
13098 }
13099
13101 {
13102 bool hasParent = false, hasRootAsPlayer = false;
13104
13105 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13106 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13107
13108 if (wwtu || foodDecay)
13109 {
13113
13114 if (processWetness || processTemperature || processDecay)
13115 {
13117
13118 if (processWetness)
13119 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13120
13121 if (processTemperature)
13123
13124 if (processDecay)
13125 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13126 }
13127 }
13128 }
13129
13132 {
13134 }
13135
13137 {
13140
13141 return super.GetTemperatureFreezeThreshold();
13142 }
13143
13145 {
13148
13149 return super.GetTemperatureThawThreshold();
13150 }
13151
13153 {
13156
13157 return super.GetItemOverheatThreshold();
13158 }
13159
13161 {
13163 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13164
13165 return super.GetTemperatureFreezeTime();
13166 }
13167
13169 {
13171 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13172
13173 return super.GetTemperatureThawTime();
13174 }
13175
13180
13182 {
13183 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13184 }
13185
13187 {
13188 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13189 }
13190
13193 {
13195 }
13196
13198 {
13200 }
13201
13203 {
13205 }
13206
13209 {
13210 return null;
13211 }
13212
13215 {
13216 return false;
13217 }
13218
13220 {
13222 {
13225 if (!trg)
13226 {
13228 explosive = this;
13229 }
13230
13231 explosive.PairRemote(trg);
13233
13234 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13235 trg.SetPersistentPairID(persistentID);
13236 explosive.SetPersistentPairID(persistentID);
13237
13238 return true;
13239 }
13240 return false;
13241 }
13242
13245 {
13246 float ret = 1.0;
13249 ret *= GetHealth01();
13250
13251 return ret;
13252 }
13253
13254 #ifdef DEVELOPER
13255 override void SetDebugItem()
13256 {
13257 super.SetDebugItem();
13258 _itemBase = this;
13259 }
13260
13262 {
13263 string text = super.GetDebugText();
13264
13266 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13267
13268 return text;
13269 }
13270 #endif
13271
13273 {
13274 return true;
13275 }
13276
13278
13280
13282 {
13285 }
13286
13287
13295
13311}
13312
13314{
13316 if (entity)
13317 {
13318 bool is_item = entity.IsInherited(
ItemBase);
13319 if (is_item && full_quantity)
13320 {
13323 }
13324 }
13325 else
13326 {
13328 return NULL;
13329 }
13330 return entity;
13331}
13332
13334{
13335 if (item)
13336 {
13337 if (health > 0)
13338 item.SetHealth("", "", health);
13339
13340 if (item.CanHaveTemperature())
13341 {
13343 if (item.CanFreeze())
13344 item.SetFrozen(false);
13345 }
13346
13347 if (item.HasEnergyManager())
13348 {
13349 if (quantity >= 0)
13350 {
13351 item.GetCompEM().SetEnergy0To1(quantity);
13352 }
13353 else
13354 {
13356 }
13357 }
13358 else if (item.IsMagazine())
13359 {
13360 Magazine mag = Magazine.Cast(item);
13361 if (quantity >= 0)
13362 {
13363 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13364 }
13365 else
13366 {
13368 }
13369
13370 }
13371 else
13372 {
13373 if (quantity >= 0)
13374 {
13375 item.SetQuantityNormalized(quantity, false);
13376 }
13377 else
13378 {
13380 }
13381
13382 }
13383 }
13384}
13385
13386#ifdef DEVELOPER
13388#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.