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 {
10120
10122 return false;
10123
10124
10126 return false;
10127
10128
10129
10131 if (delta == 0)
10132 return false;
10133
10134
10135 return true;
10136 }
10137
10139 {
10141 {
10142 if (ScriptInputUserData.CanStoreInputUserData())
10143 {
10144 ScriptInputUserData ctx = new ScriptInputUserData;
10149 ctx.
Write(destination_entity);
10151 ctx.
Write(slot_id);
10153 }
10154 }
10155 else if (!
GetGame().IsMultiplayer())
10156 {
10158 }
10159 }
10160
10162 {
10163 float split_quantity_new;
10167 InventoryLocation loc = new InventoryLocation;
10168
10169 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10170 {
10172 split_quantity_new = stack_max;
10173 else
10175
10177 {
10178 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10179 if (new_item)
10180 {
10181 new_item.SetResultOfSplit(true);
10182 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10184 new_item.
SetQuantity(split_quantity_new,
false,
true);
10185 }
10186 }
10187 }
10188 else if (destination_entity && slot_id == -1)
10189 {
10190 if (quantity > stack_max)
10191 split_quantity_new = stack_max;
10192 else
10193 split_quantity_new = quantity;
10194
10196 {
10198 {
10201 }
10202
10203 if (new_item)
10204 {
10205 new_item.SetResultOfSplit(true);
10206 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10208 new_item.
SetQuantity(split_quantity_new,
false,
true);
10209 }
10210 }
10211 }
10212 else
10213 {
10214 if (stack_max != 0)
10215 {
10217 {
10219 }
10220
10221 if (split_quantity_new == 0)
10222 {
10223 if (!
GetGame().IsMultiplayer())
10224 player.PhysicalPredictiveDropItem(this);
10225 else
10226 player.ServerDropEntity(this);
10227 return;
10228 }
10229
10231 {
10233
10234 if (new_item)
10235 {
10236 new_item.SetResultOfSplit(true);
10237 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10240 new_item.PlaceOnSurface();
10241 }
10242 }
10243 }
10244 }
10245 }
10246
10248 {
10249 float split_quantity_new;
10253 InventoryLocation loc = new InventoryLocation;
10254
10255 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10256 {
10258 split_quantity_new = stack_max;
10259 else
10261
10263 {
10264 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10265 if (new_item)
10266 {
10267 new_item.SetResultOfSplit(true);
10268 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10270 new_item.
SetQuantity(split_quantity_new,
false,
true);
10271 }
10272 }
10273 }
10274 else if (destination_entity && slot_id == -1)
10275 {
10276 if (quantity > stack_max)
10277 split_quantity_new = stack_max;
10278 else
10279 split_quantity_new = quantity;
10280
10282 {
10284 {
10287 }
10288
10289 if (new_item)
10290 {
10291 new_item.SetResultOfSplit(true);
10292 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10294 new_item.
SetQuantity(split_quantity_new,
false,
true);
10295 }
10296 }
10297 }
10298 else
10299 {
10300 if (stack_max != 0)
10301 {
10303 {
10305 }
10306
10308 {
10310
10311 if (new_item)
10312 {
10313 new_item.SetResultOfSplit(true);
10314 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10317 new_item.PlaceOnSurface();
10318 }
10319 }
10320 }
10321 }
10322 }
10323
10325 {
10327 {
10328 if (ScriptInputUserData.CanStoreInputUserData())
10329 {
10330 ScriptInputUserData ctx = new ScriptInputUserData;
10335 dst.WriteToContext(ctx);
10337 }
10338 }
10339 else if (!
GetGame().IsMultiplayer())
10340 {
10342 }
10343 }
10344
10346 {
10348 {
10349 if (ScriptInputUserData.CanStoreInputUserData())
10350 {
10351 ScriptInputUserData ctx = new ScriptInputUserData;
10356 ctx.
Write(destination_entity);
10362 }
10363 }
10364 else if (!
GetGame().IsMultiplayer())
10365 {
10367 }
10368 }
10369
10371 {
10373 }
10374
10376 {
10378 float split_quantity_new;
10380 if (dst.IsValid())
10381 {
10382 int slot_id = dst.GetSlot();
10384
10385 if (quantity > stack_max)
10386 split_quantity_new = stack_max;
10387 else
10388 split_quantity_new = quantity;
10389
10391 {
10393
10394 if (new_item)
10395 {
10396 new_item.SetResultOfSplit(true);
10397 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10399 new_item.
SetQuantity(split_quantity_new,
false,
true);
10400 }
10401
10402 return new_item;
10403 }
10404 }
10405
10406 return null;
10407 }
10408
10410 {
10412 float split_quantity_new;
10414 if (destination_entity)
10415 {
10417 if (quantity > stackable)
10418 split_quantity_new = stackable;
10419 else
10420 split_quantity_new = quantity;
10421
10423 {
10424 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10425 if (new_item)
10426 {
10427 new_item.SetResultOfSplit(true);
10428 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10430 new_item.
SetQuantity(split_quantity_new,
false,
true);
10431 }
10432 }
10433 }
10434 }
10435
10437 {
10439 {
10440 if (ScriptInputUserData.CanStoreInputUserData())
10441 {
10442 ScriptInputUserData ctx = new ScriptInputUserData;
10447 ItemBase destination_entity =
this;
10448 ctx.
Write(destination_entity);
10452 }
10453 }
10454 else if (!
GetGame().IsMultiplayer())
10455 {
10457 }
10458 }
10459
10461 {
10463 float split_quantity_new;
10465 if (player)
10466 {
10468 if (quantity > stackable)
10469 split_quantity_new = stackable;
10470 else
10471 split_quantity_new = quantity;
10472
10474 {
10475 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10476 new_item =
ItemBase.Cast(in_hands);
10477 if (new_item)
10478 {
10479 new_item.SetResultOfSplit(true);
10480 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10482 new_item.SetQuantity(split_quantity_new, false, true);
10483 }
10484 }
10485 }
10486 }
10487
10489 {
10491 float split_quantity_new = Math.Floor(quantity * 0.5);
10492
10494 return;
10495
10497
10498 if (new_item)
10499 {
10500 if (new_item.GetQuantityMax() < split_quantity_new)
10501 {
10502 split_quantity_new = new_item.GetQuantityMax();
10503 }
10504
10505 new_item.SetResultOfSplit(true);
10506 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10507
10509 {
10512 }
10513 else
10514 {
10516 new_item.
SetQuantity(split_quantity_new,
false,
true);
10517 }
10518 }
10519 }
10520
10522 {
10524 float split_quantity_new = Math.Floor(quantity / 2);
10525
10527 return;
10528
10529 InventoryLocation invloc = new InventoryLocation;
10531
10533 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10534
10535 if (new_item)
10536 {
10537 if (new_item.GetQuantityMax() < split_quantity_new)
10538 {
10539 split_quantity_new = new_item.GetQuantityMax();
10540 }
10542 {
10545 }
10546 else if (split_quantity_new > 1)
10547 {
10549 new_item.
SetQuantity(split_quantity_new,
false,
true);
10550 }
10551 }
10552 }
10553
10556 {
10557 SetWeightDirty();
10559
10560 if (parent)
10561 parent.OnAttachmentQuantityChangedEx(this, delta);
10562
10564 {
10566 {
10568 }
10570 {
10571 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10573 }
10574 }
10575
10576 }
10577
10580 {
10581
10582 }
10583
10586 {
10588 }
10589
10591 {
10592 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10593
10595 {
10596 if (newLevel == GameConstants.STATE_RUINED)
10597 {
10599 EntityAI parent = GetHierarchyParent();
10600 if (parent && parent.IsFireplace())
10601 {
10602 CargoBase cargo = GetInventory().GetCargo();
10603 if (cargo)
10604 {
10606 {
10608 }
10609 }
10610 }
10611 }
10612
10614 {
10615
10617 return;
10618 }
10619
10620 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10621 {
10623 }
10624 }
10625 }
10626
10627
10629 {
10630 super.OnRightClick();
10631
10633 {
10635 {
10636 if (ScriptInputUserData.CanStoreInputUserData())
10637 {
10638 EntityAI root = GetHierarchyRoot();
10639 Man playerOwner = GetHierarchyRootPlayer();
10640 InventoryLocation dst = new InventoryLocation;
10641
10642
10643 if (!playerOwner && root && root == this)
10644 {
10646 }
10647 else
10648 {
10649
10650 GetInventory().GetCurrentInventoryLocation(dst);
10652 {
10655 {
10657 }
10658 else
10659 {
10661
10662
10663 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10664 {
10666 }
10667 else
10668 {
10669 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10670 }
10671 }
10672 }
10673 }
10674
10675 ScriptInputUserData ctx = new ScriptInputUserData;
10683 }
10684 }
10685 else if (!
GetGame().IsMultiplayer())
10686 {
10688 }
10689 }
10690 }
10691
10693 {
10694 if (root)
10695 {
10696 vector m4[4];
10697 root.GetTransform(m4);
10698 dst.SetGround(this, m4);
10699 }
10700 else
10701 {
10702 GetInventory().GetCurrentInventoryLocation(dst);
10703 }
10704 }
10705
10706 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10707 {
10708
10709 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10710 return false;
10711
10712 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10713 return false;
10714
10715
10717 return false;
10718
10719
10720 Magazine mag = Magazine.Cast(this);
10721 if (mag)
10722 {
10723 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10724 return false;
10725
10726 if (stack_max_limit)
10727 {
10728 Magazine other_mag = Magazine.Cast(other_item);
10729 if (other_item)
10730 {
10731 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10732 return false;
10733 }
10734
10735 }
10736 }
10737 else
10738 {
10739
10741 return false;
10742
10744 return false;
10745 }
10746
10747 PlayerBase player = null;
10748 if (CastTo(player, GetHierarchyRootPlayer()))
10749 {
10750 if (player.GetInventory().HasAttachment(this))
10751 return false;
10752
10753 if (player.IsItemsToDelete())
10754 return false;
10755 }
10756
10757 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10758 return false;
10759
10760 int slotID;
10762 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10763 return false;
10764
10765 return true;
10766 }
10767
10769 {
10771 }
10772
10774 {
10775 return m_IsResultOfSplit;
10776 }
10777
10779 {
10780 m_IsResultOfSplit = value;
10781 }
10782
10784 {
10786 }
10787
10789 {
10790 float other_item_quantity = other_item.GetQuantity();
10791 float this_free_space;
10792
10794
10796
10797 if (other_item_quantity > this_free_space)
10798 {
10799 return this_free_space;
10800 }
10801 else
10802 {
10803 return other_item_quantity;
10804 }
10805 }
10806
10808 {
10810 }
10811
10813 {
10815 return;
10816
10817 if (!IsMagazine() && other_item)
10818 {
10820 if (quantity_used != 0)
10821 {
10822 float hp1 = GetHealth01("","");
10823 float hp2 = other_item.GetHealth01("","");
10824 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10825 hpResult = hpResult / (
GetQuantity() + quantity_used);
10826
10827 hpResult *= GetMaxHealth();
10828 Math.Round(hpResult);
10829 SetHealth("", "Health", hpResult);
10830
10832 other_item.AddQuantity(-quantity_used);
10833 }
10834 }
10836 }
10837
10839 {
10840 #ifdef SERVER
10841 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10842 GetHierarchyParent().IncreaseLifetimeUp();
10843 #endif
10844 };
10845
10847 {
10848 PlayerBase p = PlayerBase.Cast(player);
10849
10850 array<int> recipesIds = p.m_Recipes;
10851 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10852 if (moduleRecipesManager)
10853 {
10854 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10855 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10856 }
10857
10858 for (int i = 0;i < recipesIds.Count(); i++)
10859 {
10860 int key = recipesIds.Get(i);
10861 string recipeName = moduleRecipesManager.GetRecipeName(key);
10863 }
10864 }
10865
10866
10867 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10868 {
10869 super.GetDebugActions(outputList);
10870
10871
10877
10878
10883
10888
10889
10893
10894
10896 {
10900 }
10901
10904
10905
10909
10911
10912 InventoryLocation loc = new InventoryLocation();
10913 GetInventory().GetCurrentInventoryLocation(loc);
10915 {
10916 if (Gizmo_IsSupported())
10919 }
10920
10922 }
10923
10924
10925
10926
10928 {
10929 super.OnAction(action_id, player, ctx);
10930
10932 {
10933 switch (action_id)
10934 {
10937 return true;
10940 return true;
10941 }
10942 }
10943
10945 {
10946 switch (action_id)
10947 {
10949 Delete();
10950 return true;
10951 }
10952 }
10953
10954 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10955 {
10956 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10957 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10958 PlayerBase p = PlayerBase.Cast(player);
10959 if (
EActions.RECIPES_RANGE_START < 1000)
10960 {
10961 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10962 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10963 }
10964 }
10965 #ifndef SERVER
10966 else if (action_id ==
EActions.WATCH_PLAYER)
10967 {
10968 PluginDeveloper.SetDeveloperItemClientEx(player);
10969 }
10970 #endif
10972 {
10973 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10974 {
10975 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10976 OnDebugButtonPressServer(id + 1);
10977 }
10978
10979 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10980 {
10981 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10983 }
10984
10985 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10986 {
10987 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10989 }
10990
10991 else if (action_id ==
EActions.ADD_QUANTITY)
10992 {
10993 if (IsMagazine())
10994 {
10995 Magazine mag = Magazine.Cast(this);
10996 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10997 }
10998 else
10999 {
11001 }
11002
11003 if (m_EM)
11004 {
11005 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11006 }
11007
11008 }
11009
11010 else if (action_id ==
EActions.REMOVE_QUANTITY)
11011 {
11012 if (IsMagazine())
11013 {
11014 Magazine mag2 = Magazine.Cast(this);
11015 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11016 }
11017 else
11018 {
11020 }
11021 if (m_EM)
11022 {
11023 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11024 }
11025
11026 }
11027
11028 else if (action_id ==
EActions.SET_QUANTITY_0)
11029 {
11031
11032 if (m_EM)
11033 {
11034 m_EM.SetEnergy(0);
11035 }
11036 }
11037
11038 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11039 {
11041
11042 if (m_EM)
11043 {
11044 m_EM.SetEnergy(m_EM.GetEnergyMax());
11045 }
11046 }
11047
11048 else if (action_id ==
EActions.ADD_HEALTH)
11049 {
11050 AddHealth("","",GetMaxHealth("","Health")/5);
11051 }
11052 else if (action_id ==
EActions.REMOVE_HEALTH)
11053 {
11054 AddHealth("","",-GetMaxHealth("","Health")/5);
11055 }
11056 else if (action_id ==
EActions.DESTROY_HEALTH)
11057 {
11058 SetHealth01("","",0);
11059 }
11060 else if (action_id ==
EActions.WATCH_ITEM)
11061 {
11063 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11064 #ifdef DEVELOPER
11065 SetDebugDeveloper_item(this);
11066 #endif
11067 }
11068
11069 else if (action_id ==
EActions.ADD_TEMPERATURE)
11070 {
11071 AddTemperature(20);
11072
11073 }
11074
11075 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11076 {
11077 AddTemperature(-20);
11078
11079 }
11080
11081 else if (action_id ==
EActions.FLIP_FROZEN)
11082 {
11083 SetFrozen(!GetIsFrozen());
11084
11085 }
11086
11087 else if (action_id ==
EActions.ADD_WETNESS)
11088 {
11090
11091 }
11092
11093 else if (action_id ==
EActions.REMOVE_WETNESS)
11094 {
11096
11097 }
11098
11099 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11100 {
11103
11104
11105 }
11106
11107 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11108 {
11111 }
11112
11113 else if (action_id ==
EActions.MAKE_SPECIAL)
11114 {
11115 auto debugParams = DebugSpawnParams.WithPlayer(player);
11116 OnDebugSpawnEx(debugParams);
11117 }
11118
11119 }
11120
11121
11122 return false;
11123 }
11124
11125
11126
11127
11131
11134
11135
11136
11138 {
11139 return false;
11140 }
11141
11142
11144 {
11145 return true;
11146 }
11147
11148
11150 {
11151 return true;
11152 }
11153
11154
11155
11157 {
11158 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11160 }
11161
11164 {
11165 return null;
11166 }
11167
11169 {
11170 return false;
11171 }
11172
11174 {
11175 return false;
11176 }
11177
11181
11182
11184 {
11185 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11186 return module_repairing.CanRepair(this, item_repair_kit);
11187 }
11188
11189
11190 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11191 {
11192 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11193 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11194 }
11195
11196
11198 {
11199
11200
11201
11202
11203
11204
11205
11206
11207 return 1;
11208 }
11209
11210
11211
11213 {
11215 }
11216
11217
11218
11220 {
11222 }
11223
11224
11233 {
11234 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11235
11236 if (player)
11237 {
11238 player.MessageStatus(text);
11239 }
11240 }
11241
11242
11251 {
11252 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11253
11254 if (player)
11255 {
11256 player.MessageAction(text);
11257 }
11258 }
11259
11260
11269 {
11270 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11271
11272 if (player)
11273 {
11274 player.MessageFriendly(text);
11275 }
11276 }
11277
11278
11287 {
11288 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11289
11290 if (player)
11291 {
11292 player.MessageImportant(text);
11293 }
11294 }
11295
11297 {
11298 return true;
11299 }
11300
11301
11302 override bool KindOf(
string tag)
11303 {
11304 bool found = false;
11305 string item_name = this.
GetType();
11308
11309 int array_size = item_tag_array.Count();
11310 for (int i = 0; i < array_size; i++)
11311 {
11312 if (item_tag_array.Get(i) == tag)
11313 {
11314 found = true;
11315 break;
11316 }
11317 }
11318 return found;
11319 }
11320
11321
11323 {
11324
11325 super.OnRPC(sender, rpc_type,ctx);
11326
11327
11328 switch (rpc_type)
11329 {
11330 #ifndef SERVER
11331 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11332 Param2<bool, string> p = new Param2<bool, string>(false, "");
11333
11335 return;
11336
11337 bool play = p.param1;
11338 string soundSet = p.param2;
11339
11340 if (play)
11341 {
11343 {
11345 {
11347 }
11348 }
11349 else
11350 {
11352 }
11353 }
11354 else
11355 {
11357 }
11358
11359 break;
11360 #endif
11361
11362 }
11363
11365 {
11367 }
11368 }
11369
11370
11371
11372
11374 {
11375 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11376 return plugin.GetID(
name);
11377 }
11378
11380 {
11381 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11382 return plugin.GetName(id);
11383 }
11384
11387 {
11388
11389
11390 int varFlags;
11391 if (!ctx.
Read(varFlags))
11392 return;
11393
11394 if (varFlags & ItemVariableFlags.FLOAT)
11395 {
11397 }
11398 }
11399
11401 {
11402
11403 super.SerializeNumericalVars(floats_out);
11404
11405
11406
11408 {
11410 }
11411
11413 {
11415 }
11416
11418 {
11420 }
11421
11423 {
11428 }
11429
11431 {
11433 }
11434 }
11435
11437 {
11438
11439 super.DeSerializeNumericalVars(floats);
11440
11441
11442 int index = 0;
11443 int mask = Math.Round(floats.Get(index));
11444
11445 index++;
11446
11448 {
11450 {
11452 }
11453 else
11454 {
11455 float quantity = floats.Get(index);
11456 SetQuantity(quantity,
true,
false,
false,
false);
11457 }
11458 index++;
11459 }
11460
11462 {
11463 float wet = floats.Get(index);
11465 index++;
11466 }
11467
11469 {
11470 int liquidtype = Math.Round(floats.Get(index));
11472 index++;
11473 }
11474
11476 {
11478 index++;
11480 index++;
11482 index++;
11484 index++;
11485 }
11486
11488 {
11489 int cleanness = Math.Round(floats.Get(index));
11491 index++;
11492 }
11493 }
11494
11496 {
11497 super.WriteVarsToCTX(ctx);
11498
11499
11501 {
11503 }
11504
11506 {
11508 }
11509
11511 {
11513 }
11514
11516 {
11517 int r,g,b,a;
11523 }
11524
11526 {
11528 }
11529 }
11530
11532 {
11533 if (!super.ReadVarsFromCTX(ctx,version))
11534 return false;
11535
11536 int intValue;
11537 float value;
11538
11539 if (version < 140)
11540 {
11541 if (!ctx.
Read(intValue))
11542 return false;
11543
11544 m_VariablesMask = intValue;
11545 }
11546
11548 {
11549 if (!ctx.
Read(value))
11550 return false;
11551
11553 {
11555 }
11556 else
11557 {
11559 }
11560 }
11561
11562 if (version < 140)
11563 {
11565 {
11566 if (!ctx.
Read(value))
11567 return false;
11568 SetTemperatureDirect(value);
11569 }
11570 }
11571
11573 {
11574 if (!ctx.
Read(value))
11575 return false;
11577 }
11578
11580 {
11581 if (!ctx.
Read(intValue))
11582 return false;
11584 }
11585
11587 {
11588 int r,g,b,a;
11590 return false;
11592 return false;
11594 return false;
11596 return false;
11597
11599 }
11600
11602 {
11603 if (!ctx.
Read(intValue))
11604 return false;
11606 }
11607
11608 if (version >= 138 && version < 140)
11609 {
11611 {
11612 if (!ctx.
Read(intValue))
11613 return false;
11614 SetFrozen(intValue);
11615 }
11616 }
11617
11618 return true;
11619 }
11620
11621
11623 {
11626 {
11628 }
11629
11630 if (!super.OnStoreLoad(ctx, version))
11631 {
11633 return false;
11634 }
11635
11636 if (version >= 114)
11637 {
11638 bool hasQuickBarIndexSaved;
11639
11640 if (!ctx.
Read(hasQuickBarIndexSaved))
11641 {
11643 return false;
11644 }
11645
11646 if (hasQuickBarIndexSaved)
11647 {
11648 int itmQBIndex;
11649
11650
11651 if (!ctx.
Read(itmQBIndex))
11652 {
11654 return false;
11655 }
11656
11657 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11658 if (itmQBIndex != -1 && parentPlayer)
11659 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11660 }
11661 }
11662 else
11663 {
11664
11665 PlayerBase player;
11666 int itemQBIndex;
11667 if (version ==
int.
MAX)
11668 {
11669 if (!ctx.
Read(itemQBIndex))
11670 {
11672 return false;
11673 }
11674 }
11675 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11676 {
11677
11678 if (!ctx.
Read(itemQBIndex))
11679 {
11681 return false;
11682 }
11683 if (itemQBIndex != -1 && player)
11684 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11685 }
11686 }
11687
11688 if (version < 140)
11689 {
11690
11691 if (!LoadVariables(ctx, version))
11692 {
11694 return false;
11695 }
11696 }
11697
11698
11700 {
11702 return false;
11703 }
11704 if (version >= 132)
11705 {
11707 if (raib)
11708 {
11710 {
11712 return false;
11713 }
11714 }
11715 }
11716
11718 return true;
11719 }
11720
11721
11722
11724 {
11725 super.OnStoreSave(ctx);
11726
11727 PlayerBase player;
11728 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11729 {
11731
11732 int itemQBIndex = -1;
11733 itemQBIndex = player.FindQuickBarEntityIndex(this);
11734 ctx.
Write(itemQBIndex);
11735 }
11736 else
11737 {
11739 }
11740
11742
11744 if (raib)
11745 {
11747 }
11748 }
11749
11750
11752 {
11753 super.AfterStoreLoad();
11754
11756 {
11758 }
11759
11761 {
11764 }
11765 }
11766
11768 {
11769 super.EEOnAfterLoad();
11770
11772 {
11774 }
11775
11778 }
11779
11781 {
11782 return false;
11783 }
11784
11785
11786
11788 {
11790 {
11791 #ifdef PLATFORM_CONSOLE
11792
11794 {
11796 if (menu)
11797 {
11799 }
11800 }
11801 #endif
11802 }
11803
11805 {
11808 }
11809
11811 {
11812 SetWeightDirty();
11814 }
11816 {
11819 }
11820
11822 {
11825 }
11827 {
11830 }
11831
11832 super.OnVariablesSynchronized();
11833 }
11834
11835
11836
11838 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11839 {
11840 if (!IsServerCheck(allow_client))
11841 return false;
11842
11844 return false;
11845
11848
11849 if (value <= (min + 0.001))
11850 value = min;
11851
11852 if (value == min)
11853 {
11854 if (destroy_config)
11855 {
11856 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11857 if (dstr)
11858 {
11860 this.Delete();
11861 return true;
11862 }
11863 }
11864 else if (destroy_forced)
11865 {
11867 this.Delete();
11868 return true;
11869 }
11870
11872 }
11873
11876
11878 {
11880
11881 if (delta)
11883 }
11884
11886
11887 return false;
11888 }
11889
11890
11892 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11893 {
11895 }
11896
11898 {
11901 }
11902
11904 {
11907 }
11908
11910 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11911 {
11912 float value_clamped = Math.Clamp(value, 0, 1);
11914 SetQuantity(result, destroy_config, destroy_forced);
11915 }
11916
11917
11920 {
11922 }
11923
11925 {
11927 }
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11939 {
11940 int slot = -1;
11941 if (GetInventory())
11942 {
11943 InventoryLocation il = new InventoryLocation;
11944 GetInventory().GetCurrentInventoryLocation(il);
11946 }
11947
11949 }
11950
11952 {
11953 float quantity_max = 0;
11954
11956 {
11957 if (attSlotID != -1)
11958 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11959
11960 if (quantity_max <= 0)
11962 }
11963
11964 if (quantity_max <= 0)
11966
11967 return quantity_max;
11968 }
11969
11971 {
11973 }
11974
11976 {
11978 }
11979
11980
11982 {
11984 }
11985
11987 {
11989 }
11990
11992 {
11994 }
11995
11996
11998 {
11999
12000 float weightEx = GetWeightEx();
12001 float special = GetInventoryAndCargoWeight();
12002 return weightEx - special;
12003 }
12004
12005
12007 {
12009 }
12010
12012 {
12014 {
12015 #ifdef DEVELOPER
12016 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12017 {
12018 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12020 }
12021 #endif
12022
12023 return GetQuantity() * GetConfigWeightModified();
12024 }
12025 else if (HasEnergyManager())
12026 {
12027 #ifdef DEVELOPER
12028 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12029 {
12030 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12031 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12032 }
12033 #endif
12034 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12035 }
12036 else
12037 {
12038 #ifdef DEVELOPER
12039 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12040 {
12041 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12042 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12043 }
12044 #endif
12045 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12046 }
12047 }
12048
12051 {
12052 int item_count = 0;
12054
12055 if (GetInventory().GetCargo() != NULL)
12056 {
12057 item_count = GetInventory().GetCargo().GetItemCount();
12058 }
12059
12060 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12061 {
12062 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12063 if (item)
12064 item_count += item.GetNumberOfItems();
12065 }
12066 return item_count;
12067 }
12068
12071 {
12072 float weight = 0;
12073 float wetness = 1;
12074 if (include_wetness)
12077 {
12078 weight = wetness * m_ConfigWeight;
12079 }
12081 {
12082 weight = 1;
12083 }
12084 return weight;
12085 }
12086
12087
12088
12090 {
12091 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12092 {
12093 GameInventory inv = GetInventory();
12094 array<EntityAI> items = new array<EntityAI>;
12096 for (int i = 0; i < items.Count(); i++)
12097 {
12099 if (item)
12100 {
12102 }
12103 }
12104 }
12105 }
12106
12107
12108
12109
12111 {
12112 float energy = 0;
12113 if (HasEnergyManager())
12114 {
12115 energy = GetCompEM().GetEnergy();
12116 }
12117 return energy;
12118 }
12119
12120
12122 {
12123 super.OnEnergyConsumed();
12124
12126 }
12127
12129 {
12130 super.OnEnergyAdded();
12131
12133 }
12134
12135
12137 {
12138 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12139 {
12141 {
12142 float energy_0to1 = GetCompEM().GetEnergy0To1();
12144 }
12145 }
12146 }
12147
12148
12150 {
12151 return ConfigGetFloat("heatIsolation");
12152 }
12153
12155 {
12157 }
12158
12160 {
12161 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12162 if (
GetGame().ConfigIsExisting(paramPath))
12164
12165 return 0.0;
12166 }
12167
12169 {
12170 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12171 if (
GetGame().ConfigIsExisting(paramPath))
12173
12174 return 0.0;
12175 }
12176
12177 override void SetWet(
float value,
bool allow_client =
false)
12178 {
12179 if (!IsServerCheck(allow_client))
12180 return;
12181
12184
12186
12187 m_VarWet = Math.Clamp(value, min, max);
12188
12190 {
12193 }
12194 }
12195
12196 override void AddWet(
float value)
12197 {
12199 }
12200
12202 {
12204 }
12205
12207 {
12209 }
12210
12212 {
12214 }
12215
12217 {
12219 }
12220
12222 {
12224 }
12225
12226 override void OnWetChanged(
float newVal,
float oldVal)
12227 {
12230 if (newLevel != oldLevel)
12231 {
12233 }
12234 }
12235
12237 {
12238 SetWeightDirty();
12239 }
12240
12242 {
12243 return GetWetLevelInternal(
m_VarWet);
12244 }
12245
12246
12247
12249 {
12251 }
12252
12254 {
12256 }
12257
12259 {
12261 }
12262
12264 {
12266 }
12267
12268
12269
12271 {
12272 if (ConfigIsExisting("itemModelLength"))
12273 {
12274 return ConfigGetFloat("itemModelLength");
12275 }
12276 return 0;
12277 }
12278
12280 {
12281 if (ConfigIsExisting("itemAttachOffset"))
12282 {
12283 return ConfigGetFloat("itemAttachOffset");
12284 }
12285 return 0;
12286 }
12287
12288 override void SetCleanness(
int value,
bool allow_client =
false)
12289 {
12290 if (!IsServerCheck(allow_client))
12291 return;
12292
12294
12296
12299 }
12300
12302 {
12304 }
12305
12307 {
12308 return true;
12309 }
12310
12311
12312
12313
12315 {
12317 }
12318
12320 {
12322 }
12323
12324
12325
12326
12327 override void SetColor(
int r,
int g,
int b,
int a)
12328 {
12334 }
12336 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12337 {
12342 }
12343
12345 {
12347 }
12348
12351 {
12352 int r,g,b,a;
12354 r = r/255;
12355 g = g/255;
12356 b = b/255;
12357 a = a/255;
12358 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12359 }
12360
12361
12362
12363 override void SetLiquidType(
int value,
bool allow_client =
false)
12364 {
12365 if (!IsServerCheck(allow_client))
12366 return;
12367
12372 }
12373
12375 {
12376 return ConfigGetInt("varLiquidTypeInit");
12377 }
12378
12380 {
12382 }
12383
12385 {
12387 SetFrozen(false);
12388 }
12389
12392 {
12393 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12394 }
12395
12396
12399 {
12400 PlayerBase nplayer;
12401 if (PlayerBase.CastTo(nplayer, player))
12402 {
12404
12405 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12406 }
12407 }
12408
12409
12412 {
12413 PlayerBase nplayer;
12414 if (PlayerBase.CastTo(nplayer,player))
12415 {
12416
12417 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12418
12419 }
12420
12421
12422 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12423
12424
12425 if (HasEnergyManager())
12426 {
12427 GetCompEM().UpdatePlugState();
12428 }
12429 }
12430
12431
12433 {
12434 super.OnPlacementStarted(player);
12435
12437 }
12438
12439 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12440 {
12442 {
12443 m_AdminLog.OnPlacementComplete(player,
this);
12444 }
12445
12446 super.OnPlacementComplete(player, position, orientation);
12447 }
12448
12449
12450
12451
12452
12454 {
12456 {
12457 return true;
12458 }
12459 else
12460 {
12461 return false;
12462 }
12463 }
12464
12465
12467 {
12469 {
12471 }
12472 }
12473
12474
12476 {
12478 }
12479
12481 {
12483 }
12484
12485 override void InsertAgent(
int agent,
float count = 1)
12486 {
12487 if (count < 1)
12488 return;
12489
12491 }
12492
12495 {
12497 }
12498
12499
12501 {
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
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12547 {
12549 return false;
12550 return true;
12551 }
12552
12554 {
12555
12557 }
12558
12559
12562 {
12563 super.CheckForRoofLimited(timeTresholdMS);
12564
12566 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12567 {
12568 m_PreviousRoofTestTime = time;
12569 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12570 }
12571 }
12572
12573
12575 {
12577 {
12578 return 0;
12579 }
12580
12581 if (GetInventory().GetAttachmentSlotsCount() != 0)
12582 {
12583 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12584 if (filter)
12585 return filter.GetProtectionLevel(type, false, system);
12586 else
12587 return 0;
12588 }
12589
12590 string subclassPath, entryName;
12591
12592 switch (type)
12593 {
12595 entryName = "biological";
12596 break;
12598 entryName = "chemical";
12599 break;
12600 default:
12601 entryName = "biological";
12602 break;
12603 }
12604
12605 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12606
12608 }
12609
12610
12611
12614 {
12615 if (!IsMagazine())
12617
12619 }
12620
12621
12622
12623
12624
12629 {
12630 return true;
12631 }
12632
12634 {
12636 }
12637
12638
12639
12640
12641
12643 {
12644 if (parent)
12645 {
12646 if (parent.IsInherited(DayZInfected))
12647 return true;
12648
12649 if (!parent.IsRuined())
12650 return true;
12651 }
12652
12653 return true;
12654 }
12655
12657 {
12658 if (!super.CanPutAsAttachment(parent))
12659 {
12660 return false;
12661 }
12662
12663 if (!IsRuined() && !parent.IsRuined())
12664 {
12665 return true;
12666 }
12667
12668 return false;
12669 }
12670
12672 {
12673
12674
12675
12676
12677 return super.CanReceiveItemIntoCargo(item);
12678 }
12679
12681 {
12682
12683
12684
12685
12686 GameInventory attachmentInv = attachment.GetInventory();
12688 {
12689 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12690 return false;
12691 }
12692
12693 InventoryLocation loc = new InventoryLocation();
12694 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12695 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12696 return false;
12697
12698 return super.CanReceiveAttachment(attachment, slotId);
12699 }
12700
12702 {
12703 if (!super.CanReleaseAttachment(attachment))
12704 return false;
12705
12706 return GetInventory().AreChildrenAccessible();
12707 }
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12730 {
12731 int id = muzzle_owner.GetMuzzleID();
12732 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12733
12734 if (WPOF_array)
12735 {
12736 for (int i = 0; i < WPOF_array.Count(); i++)
12737 {
12738 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12739
12740 if (WPOF)
12741 {
12742 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12743 }
12744 }
12745 }
12746 }
12747
12748
12750 {
12751 int id = muzzle_owner.GetMuzzleID();
12753
12754 if (WPOBE_array)
12755 {
12756 for (int i = 0; i < WPOBE_array.Count(); i++)
12757 {
12758 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12759
12760 if (WPOBE)
12761 {
12762 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12763 }
12764 }
12765 }
12766 }
12767
12768
12770 {
12771 int id = muzzle_owner.GetMuzzleID();
12772 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12773
12774 if (WPOOH_array)
12775 {
12776 for (int i = 0; i < WPOOH_array.Count(); i++)
12777 {
12778 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12779
12780 if (WPOOH)
12781 {
12782 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12783 }
12784 }
12785 }
12786 }
12787
12788
12790 {
12791 int id = muzzle_owner.GetMuzzleID();
12792 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12793
12794 if (WPOOH_array)
12795 {
12796 for (int i = 0; i < WPOOH_array.Count(); i++)
12797 {
12798 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12799
12800 if (WPOOH)
12801 {
12802 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12803 }
12804 }
12805 }
12806 }
12807
12808
12810 {
12811 int id = muzzle_owner.GetMuzzleID();
12812 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12813
12814 if (WPOOH_array)
12815 {
12816 for (int i = 0; i < WPOOH_array.Count(); i++)
12817 {
12818 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12819
12820 if (WPOOH)
12821 {
12822 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12823 }
12824 }
12825 }
12826 }
12827
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 {
12853 {
12854 return true;
12855 }
12856
12857 return false;
12858 }
12859
12861 {
12862 return false;
12863 }
12864
12867 {
12868 return UATimeSpent.DEFAULT_DEPLOY;
12869 }
12870
12871
12872
12873
12875 {
12877 SetSynchDirty();
12878 }
12879
12881 {
12883 }
12884
12885
12887 {
12888 return false;
12889 }
12890
12893 {
12894 string att_type = "None";
12895
12896 if (ConfigIsExisting("soundAttType"))
12897 {
12898 att_type = ConfigGetString("soundAttType");
12899 }
12900
12902 }
12903
12905 {
12907 }
12908
12909
12910
12911
12912
12918
12920 {
12923
12925 }
12926
12927
12929 {
12931 return;
12932
12934
12937
12940
12941 SoundParameters params = new SoundParameters();
12945 }
12946
12947
12949 {
12951 return;
12952
12954 SetSynchDirty();
12955
12958 }
12959
12960
12962 {
12964 return;
12965
12967 SetSynchDirty();
12968
12971 }
12972
12974 {
12976 }
12977
12979 {
12981 }
12982
12985 {
12986 if (!
GetGame().IsDedicatedServer())
12987 {
12988 if (ConfigIsExisting("attachSoundSet"))
12989 {
12990 string cfg_path = "";
12991 string soundset = "";
12992 string type_name =
GetType();
12993
12996 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12997 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12998
12999 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13000 {
13001 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13002 {
13003 if (cfg_slot_array[i] == slot_type)
13004 {
13005 soundset = cfg_soundset_array[i];
13006 break;
13007 }
13008 }
13009 }
13010
13011 if (soundset != "")
13012 {
13013 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13015 }
13016 }
13017 }
13018 }
13019
13021 {
13022
13023 }
13024
13025 void OnApply(PlayerBase player);
13026
13028 {
13029 return 1.0;
13030 };
13031
13033 {
13035 }
13036
13038 {
13040 }
13041
13043
13045 {
13046 SetDynamicPhysicsLifeTime(0.01);
13048 }
13049
13051 {
13052 array<string> zone_names = new array<string>;
13053 GetDamageZones(zone_names);
13054 for (int i = 0; i < zone_names.Count(); i++)
13055 {
13056 SetHealthMax(zone_names.Get(i),"Health");
13057 }
13058 SetHealthMax("","Health");
13059 }
13060
13063 {
13064 float global_health = GetHealth01("","Health");
13065 array<string> zones = new array<string>;
13066 GetDamageZones(zones);
13067
13068 for (int i = 0; i < zones.Count(); i++)
13069 {
13070 SetHealth01(zones.Get(i),"Health",global_health);
13071 }
13072 }
13073
13076 {
13077 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13078 }
13079
13081 {
13082 if (!hasRootAsPlayer)
13083 {
13084 if (refParentIB)
13085 {
13086
13087 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13088 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13089
13090 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13091 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13092
13095 }
13096 else
13097 {
13098
13101 }
13102 }
13103 }
13104
13106 {
13108 {
13109 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13110 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13111 {
13112 float heatPermCoef = 1.0;
13114 while (ent)
13115 {
13116 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13117 ent = ent.GetHierarchyParent();
13118 }
13119
13120 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13121 }
13122 }
13123 }
13124
13126 {
13127
13128 EntityAI parent = GetHierarchyParent();
13129 if (!parent)
13130 {
13131 hasParent = false;
13132 hasRootAsPlayer = false;
13133 }
13134 else
13135 {
13136 hasParent = true;
13137 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13138 refParentIB =
ItemBase.Cast(parent);
13139 }
13140 }
13141
13142 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13143 {
13144
13145 }
13146
13148 {
13149
13150 return false;
13151 }
13152
13154 {
13155
13156
13157 return false;
13158 }
13159
13161 {
13162
13163 return false;
13164 }
13165
13168 {
13169 return !GetIsFrozen() &&
IsOpen();
13170 }
13171
13173 {
13174 bool hasParent = false, hasRootAsPlayer = false;
13176
13177 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13178 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13179
13180 if (wwtu || foodDecay)
13181 {
13185
13186 if (processWetness || processTemperature || processDecay)
13187 {
13189
13190 if (processWetness)
13191 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13192
13193 if (processTemperature)
13195
13196 if (processDecay)
13197 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13198 }
13199 }
13200 }
13201
13204 {
13206 }
13207
13209 {
13212
13213 return super.GetTemperatureFreezeThreshold();
13214 }
13215
13217 {
13220
13221 return super.GetTemperatureThawThreshold();
13222 }
13223
13225 {
13228
13229 return super.GetItemOverheatThreshold();
13230 }
13231
13233 {
13235 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13236
13237 return super.GetTemperatureFreezeTime();
13238 }
13239
13241 {
13243 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13244
13245 return super.GetTemperatureThawTime();
13246 }
13247
13252
13254 {
13255 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13256 }
13257
13259 {
13260 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13261 }
13262
13265 {
13267 }
13268
13270 {
13272 }
13273
13275 {
13277 }
13278
13281 {
13282 return null;
13283 }
13284
13287 {
13288 return false;
13289 }
13290
13292 {
13294 {
13297 if (!trg)
13298 {
13300 explosive = this;
13301 }
13302
13303 explosive.PairRemote(trg);
13305
13306 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13307 trg.SetPersistentPairID(persistentID);
13308 explosive.SetPersistentPairID(persistentID);
13309
13310 return true;
13311 }
13312 return false;
13313 }
13314
13317 {
13318 float ret = 1.0;
13321 ret *= GetHealth01();
13322
13323 return ret;
13324 }
13325
13326 #ifdef DEVELOPER
13327 override void SetDebugItem()
13328 {
13329 super.SetDebugItem();
13330 _itemBase = this;
13331 }
13332
13334 {
13335 string text = super.GetDebugText();
13336
13338 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13339
13340 return text;
13341 }
13342 #endif
13343
13345 {
13346 return true;
13347 }
13348
13350
13352
13354 {
13357 }
13358
13359
13367
13383}
13384
13386{
13388 if (entity)
13389 {
13390 bool is_item = entity.IsInherited(
ItemBase);
13391 if (is_item && full_quantity)
13392 {
13395 }
13396 }
13397 else
13398 {
13400 return NULL;
13401 }
13402 return entity;
13403}
13404
13406{
13407 if (item)
13408 {
13409 if (health > 0)
13410 item.SetHealth("", "", health);
13411
13412 if (item.CanHaveTemperature())
13413 {
13415 if (item.CanFreeze())
13416 item.SetFrozen(false);
13417 }
13418
13419 if (item.HasEnergyManager())
13420 {
13421 if (quantity >= 0)
13422 {
13423 item.GetCompEM().SetEnergy0To1(quantity);
13424 }
13425 else
13426 {
13428 }
13429 }
13430 else if (item.IsMagazine())
13431 {
13432 Magazine mag = Magazine.Cast(item);
13433 if (quantity >= 0)
13434 {
13435 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13436 }
13437 else
13438 {
13440 }
13441
13442 }
13443 else
13444 {
13445 if (quantity >= 0)
13446 {
13447 item.SetQuantityNormalized(quantity, false);
13448 }
13449 else
13450 {
13452 }
13453
13454 }
13455 }
13456}
13457
13458#ifdef DEVELOPER
13460#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.