8572{
8574 {
8575 return true;
8576 }
8577};
8578
8579
8580
8582{
8586
8588
8591
8592
8593
8594
8595
8604
8610
8615
8620
8641 protected bool m_IsResultOfSplit
8642
8644
8649
8650
8651
8653
8657
8658
8659
8661
8664
8665
8666
8672
8673
8681
8684
8685
8687
8688
8690
8691
8696
8697
8702
8703
8705
8706
8708 {
8713
8714 if (!
GetGame().IsDedicatedServer())
8715 {
8717 {
8719
8721 {
8723 }
8724 }
8725
8728 }
8729
8730 m_OldLocation = null;
8731
8733 {
8735 }
8736
8737 if (ConfigIsExisting("headSelectionsToHide"))
8738 {
8741 }
8742
8744 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8745 {
8747 }
8748
8750
8751 m_IsResultOfSplit = false;
8752
8754 }
8755
8757 {
8758 super.InitItemVariables();
8759
8765 m_Count = ConfigGetInt(
"count");
8766
8769
8774
8777
8782
8794
8798
8799
8802 if (ConfigIsExisting("canBeSplit"))
8803 {
8806 }
8807
8809 if (ConfigIsExisting("itemBehaviour"))
8811
8812
8815 RegisterNetSyncVariableInt("m_VarLiquidType");
8816 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8817
8818 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8819 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8820 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8821
8822 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8823 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8824 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8825 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8826
8827 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8828 RegisterNetSyncVariableBool("m_IsTakeable");
8829 RegisterNetSyncVariableBool("m_IsHologram");
8830
8833 {
8836 }
8837
8839
8841 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8843
8844 }
8845
8847 {
8849 }
8850
8852 {
8855 {
8860 }
8861 }
8862
8863 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8864 {
8866 {
8869 }
8870
8872 }
8873
8875 {
8881 }
8882
8884
8886 {
8888
8889 if (!action)
8890 {
8891 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8892 return;
8893 }
8894
8896 if (!ai)
8897 {
8899 return;
8900 }
8901
8903 if (!action_array)
8904 {
8905 action_array = new array<ActionBase_Basic>;
8907 }
8908 if (LogManager.IsActionLogEnable())
8909 {
8910 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8911 }
8912
8913 if (action_array.Find(action) != -1)
8914 {
8915 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8916 }
8917 else
8918 {
8919 action_array.Insert(action);
8920 }
8921 }
8922
8924 {
8926 ActionBase action = player.GetActionManager().GetAction(actionName);
8929
8930 if (action_array)
8931 {
8932 action_array.RemoveItem(action);
8933 }
8934 }
8935
8936
8937
8939 {
8940 ActionOverrideData overrideData = new ActionOverrideData();
8944
8946 if (!actionMap)
8947 {
8950 }
8951
8952 actionMap.Insert(this.
Type(), overrideData);
8953
8954 }
8955
8957
8959
8960
8962 {
8965
8968
8969 string config_to_search = "CfgVehicles";
8970 string muzzle_owner_config;
8971
8973 {
8974 if (IsInherited(Weapon))
8975 config_to_search = "CfgWeapons";
8976
8977 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8978
8979 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8980
8982
8983 if (config_OnFire_subclass_count > 0)
8984 {
8985 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8986
8987 for (int i = 0; i < config_OnFire_subclass_count; i++)
8988 {
8989 string particle_class = "";
8991 string config_OnFire_entry = config_OnFire_class + particle_class;
8992 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8993 WPOF_array.Insert(WPOF);
8994 }
8995
8996
8998 }
8999 }
9000
9002 {
9003 config_to_search = "CfgWeapons";
9004 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9005
9006 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9007
9009
9010 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9011 {
9012 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9013
9014 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9015 {
9016 string particle_class2 = "";
9018 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9019 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9020 WPOBE_array.Insert(WPOBE);
9021 }
9022
9023
9025 }
9026 }
9027 }
9028
9029
9031 {
9034
9036 {
9037 string config_to_search = "CfgVehicles";
9038
9039 if (IsInherited(Weapon))
9040 config_to_search = "CfgWeapons";
9041
9042 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9043 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9044
9045 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9046 {
9047
9049
9051 {
9053 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9055 return;
9056 }
9057
9060
9061
9062
9064 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9065
9066 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9067 {
9068 string particle_class = "";
9070 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9072
9073 if (entry_type == CT_CLASS)
9074 {
9075 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9076 WPOOH_array.Insert(WPOF);
9077 }
9078 }
9079
9080
9082 }
9083 }
9084 }
9085
9087 {
9089 }
9090
9092 {
9094 {
9096
9099
9102
9103 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9104 }
9105 }
9106
9108 {
9110 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9111
9113 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9114
9116 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9117
9119 {
9121 }
9122 }
9123
9125 {
9127 }
9128
9130 {
9133 else
9135
9137 {
9140 }
9141 else
9142 {
9145
9148 }
9149
9151 }
9152
9154 {
9156 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9157 }
9158
9160 {
9162 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9164 }
9165
9167 {
9169 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9170 }
9171
9173 {
9176
9177 OverheatingParticle OP = new OverheatingParticle();
9182
9184 }
9185
9187 {
9190
9191 return -1;
9192 }
9193
9195 {
9197 {
9200
9201 for (int i = count; i > 0; --i)
9202 {
9203 int id = i - 1;
9206
9209
9210 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9211 {
9212 if (p)
9213 {
9216 }
9217 }
9218 }
9219 }
9220 }
9221
9223 {
9225 {
9227 {
9228 int id = i - 1;
9230
9231 if (OP)
9232 {
9234
9235 if (p)
9236 {
9238 }
9239
9240 delete OP;
9241 }
9242 }
9243
9246 }
9247 }
9248
9251 {
9252 return 0.0;
9253 }
9254
9255
9257 {
9258 return 250;
9259 }
9260
9262 {
9263 return 0;
9264 }
9265
9268 {
9270 return true;
9271
9272 return false;
9273 }
9274
9277 {
9280
9282 {
9284 }
9285 else
9286 {
9287
9289 }
9290
9292 }
9293
9300 {
9301 return -1;
9302 }
9303
9304
9305
9306
9308 {
9310 {
9312 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9313
9314 if (r_index >= 0)
9315 {
9316 InventoryLocation r_il = new InventoryLocation;
9317 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9318
9319 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9322 {
9323 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9324 }
9326 {
9327 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9328 }
9329
9330 }
9331
9332 player.GetHumanInventory().ClearUserReservedLocation(this);
9333 }
9334
9337 }
9338
9339
9340
9341
9343 {
9344 return ItemBase.m_DebugActionsMask;
9345 }
9346
9348 {
9349 return ItemBase.m_DebugActionsMask & mask;
9350 }
9351
9353 {
9354 ItemBase.m_DebugActionsMask = mask;
9355 }
9356
9358 {
9359 ItemBase.m_DebugActionsMask |= mask;
9360 }
9361
9363 {
9364 ItemBase.m_DebugActionsMask &= ~mask;
9365 }
9366
9368 {
9370 {
9372 }
9373 else
9374 {
9376 }
9377 }
9378
9379
9381 {
9382 if (GetEconomyProfile())
9383 {
9384 float q_max = GetEconomyProfile().GetQuantityMax();
9385 if (q_max > 0)
9386 {
9387 float q_min = GetEconomyProfile().GetQuantityMin();
9388 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9389
9391 {
9392 ComponentEnergyManager comp = GetCompEM();
9394 {
9396 }
9397 }
9399 {
9401
9402 }
9403
9404 }
9405 }
9406 }
9407
9410 {
9411 EntityAI parent = GetHierarchyParent();
9412
9413 if (parent)
9414 {
9415 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9416 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9417 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9418 }
9419 }
9420
9423 {
9424 EntityAI parent = GetHierarchyParent();
9425
9426 if (parent)
9427 {
9428 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9429 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9430 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9431 }
9432 }
9433
9435 {
9436
9437
9438
9439
9441
9443 {
9444 if (ScriptInputUserData.CanStoreInputUserData())
9445 {
9446 ScriptInputUserData ctx = new ScriptInputUserData;
9452 ctx.
Write(use_stack_max);
9455
9457 {
9458 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9459 }
9460 }
9461 }
9462 else if (!
GetGame().IsMultiplayer())
9463 {
9465 }
9466 }
9467
9469 {
9471 }
9472
9474 {
9476 }
9477
9479 {
9481 }
9482
9484 {
9485
9486 return false;
9487 }
9488
9490 {
9491 return false;
9492 }
9493
9497 {
9498 return false;
9499 }
9500
9502 {
9503 return "";
9504 }
9505
9507
9509 {
9510 return false;
9511 }
9512
9514 {
9515 return true;
9516 }
9517
9518
9519
9521 {
9522 return true;
9523 }
9524
9526 {
9527 return true;
9528 }
9529
9531 {
9532 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9534 }
9535
9537 {
9539 }
9540
9542 {
9544 if (!is_being_placed)
9546 SetSynchDirty();
9547 }
9548
9549
9551
9553 {
9555 }
9556
9558 {
9560 }
9561
9563 {
9564 return 1;
9565 }
9566
9568 {
9569 return false;
9570 }
9571
9573 {
9575 SetSynchDirty();
9576 }
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9613 {
9614 super.OnMovedInsideCargo(container);
9615
9616 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9617 }
9618
9619 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9620 {
9621 super.EEItemLocationChanged(oldLoc,newLoc);
9622
9623 PlayerBase new_player = null;
9624 PlayerBase old_player = null;
9625
9626 if (newLoc.GetParent())
9627 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9628
9629 if (oldLoc.GetParent())
9630 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9631
9633 {
9634 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9635
9636 if (r_index >= 0)
9637 {
9638 InventoryLocation r_il = new InventoryLocation;
9639 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9640
9641 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9644 {
9645 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9646 }
9648 {
9649 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9650 }
9651
9652 }
9653 }
9654
9656 {
9657 if (new_player)
9658 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9659
9660 if (new_player == old_player)
9661 {
9662
9663 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9664 {
9666 {
9667 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9668 {
9669 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9670 }
9671 }
9672 else
9673 {
9674 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9675 }
9676 }
9677
9678 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9679 {
9680 int type = oldLoc.GetType();
9682 {
9683 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9684 }
9686 {
9687 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9688 }
9689 }
9690 if (!m_OldLocation)
9691 {
9692 m_OldLocation = new InventoryLocation;
9693 }
9694 m_OldLocation.Copy(oldLoc);
9695 }
9696 else
9697 {
9698 if (m_OldLocation)
9699 {
9700 m_OldLocation.Reset();
9701 }
9702 }
9703
9705 }
9706 else
9707 {
9708 if (new_player)
9709 {
9710 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9711 if (res_index >= 0)
9712 {
9713 InventoryLocation il = new InventoryLocation;
9714 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9716 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9719 {
9720 il.
GetParent().GetOnReleaseLock().Invoke(it);
9721 }
9723 {
9725 }
9726
9727 }
9728 }
9730 {
9731
9733 }
9734
9735 if (m_OldLocation)
9736 {
9737 m_OldLocation.Reset();
9738 }
9739 }
9740 }
9741
9742 override void EOnContact(IEntity other, Contact extra)
9743 {
9745 {
9746 int liquidType = -1;
9748 if (impactSpeed > 0.0)
9749 {
9751 #ifndef SERVER
9753 #else
9755 SetSynchDirty();
9756 #endif
9758 }
9759 }
9760
9761 #ifdef SERVER
9762 if (GetCompEM() && GetCompEM().IsPlugged())
9763 {
9764 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9765 GetCompEM().UnplugThis();
9766 }
9767 #endif
9768 }
9769
9771
9773 {
9775 }
9776
9778 {
9779
9780 }
9781
9783 {
9784 super.OnItemLocationChanged(old_owner, new_owner);
9785
9786 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9787 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9788
9789 if (!relatedPlayer && playerNew)
9790 relatedPlayer = playerNew;
9791
9792 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9793 {
9795 if (actionMgr)
9796 {
9797 ActionBase currentAction = actionMgr.GetRunningAction();
9798 if (currentAction)
9800 }
9801 }
9802
9803 Man ownerPlayerOld = null;
9804 Man ownerPlayerNew = null;
9805
9806 if (old_owner)
9807 {
9808 if (old_owner.
IsMan())
9809 {
9810 ownerPlayerOld = Man.Cast(old_owner);
9811 }
9812 else
9813 {
9814 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9815 }
9816 }
9817 else
9818 {
9820 {
9822
9823 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9824 {
9825 GetCompEM().UnplugThis();
9826 }
9827 }
9828 }
9829
9830 if (new_owner)
9831 {
9832 if (new_owner.
IsMan())
9833 {
9834 ownerPlayerNew = Man.Cast(new_owner);
9835 }
9836 else
9837 {
9838 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9839 }
9840 }
9841
9842 if (ownerPlayerOld != ownerPlayerNew)
9843 {
9844 if (ownerPlayerOld)
9845 {
9846 array<EntityAI> subItemsExit = new array<EntityAI>;
9848 for (int i = 0; i < subItemsExit.Count(); i++)
9849 {
9852 }
9853 }
9854
9855 if (ownerPlayerNew)
9856 {
9857 array<EntityAI> subItemsEnter = new array<EntityAI>;
9859 for (int j = 0; j < subItemsEnter.Count(); j++)
9860 {
9863 }
9864 }
9865 }
9866 else if (ownerPlayerNew != null)
9867 {
9868 PlayerBase nplayer;
9869 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9870 {
9871 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9873 for (int k = 0; k < subItemsUpdate.Count(); k++)
9874 {
9876 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9877 }
9878 }
9879 }
9880
9881 if (old_owner)
9882 old_owner.OnChildItemRemoved(this);
9883 if (new_owner)
9884 new_owner.OnChildItemReceived(this);
9885 }
9886
9887
9889 {
9890 super.EEDelete(parent);
9891 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9892 if (player)
9893 {
9895
9896 if (player.IsAlive())
9897 {
9898 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9899 if (r_index >= 0)
9900 {
9901 InventoryLocation r_il = new InventoryLocation;
9902 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9903
9904 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9907 {
9908 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9909 }
9911 {
9912 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9913 }
9914
9915 }
9916
9917 player.RemoveQuickBarEntityShortcut(this);
9918 }
9919 }
9920 }
9921
9923 {
9924 super.EEKilled(killer);
9925
9928 {
9929 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9930 {
9931 if (IsMagazine())
9932 {
9933 if (Magazine.Cast(this).GetAmmoCount() > 0)
9934 {
9936 }
9937 }
9938 else
9939 {
9941 }
9942 }
9943 }
9944 }
9945
9947 {
9948 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9949
9950 super.OnWasAttached(parent, slot_id);
9951
9954
9956 }
9957
9959 {
9960 super.OnWasDetached(parent, slot_id);
9961
9964 }
9965
9967 {
9968 int idx;
9971
9972 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9973 if (inventory_slots.Count() < 1)
9974 {
9975 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9976 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9977 }
9978 else
9979 {
9980 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9981 }
9982
9983 idx = inventory_slots.Find(slot);
9984 if (idx < 0)
9985 return "";
9986
9987 return attach_types.Get(idx);
9988 }
9989
9991 {
9992 int idx = -1;
9993 string slot;
9994
9997
9998 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9999 if (inventory_slots.Count() < 1)
10000 {
10001 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10002 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10003 }
10004 else
10005 {
10006 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10007 if (detach_types.Count() < 1)
10008 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10009 }
10010
10011 for (int i = 0; i < inventory_slots.Count(); i++)
10012 {
10013 slot = inventory_slots.Get(i);
10014 }
10015
10016 if (slot != "")
10017 {
10018 if (detach_types.Count() == 1)
10019 idx = 0;
10020 else
10021 idx = inventory_slots.Find(slot);
10022 }
10023 if (idx < 0)
10024 return "";
10025
10026 return detach_types.Get(idx);
10027 }
10028
10030 {
10031
10033
10034
10035 float min_time = 1;
10036 float max_time = 3;
10037 float delay = Math.RandomFloat(min_time, max_time);
10038
10039 explode_timer.Run(delay, this, "DoAmmoExplosion");
10040 }
10041
10043 {
10044 Magazine magazine = Magazine.Cast(this);
10045 int pop_sounds_count = 6;
10046 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10047
10048
10049 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10050 string sound_name = pop_sounds[ sound_idx ];
10052
10053
10054 magazine.ServerAddAmmoCount(-1);
10055
10056
10057 float min_temp_to_explode = 100;
10058
10059 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10060 {
10062 }
10063 }
10064
10065
10066 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10067 {
10068 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10069
10070 const int CHANCE_DAMAGE_CARGO = 4;
10071 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10072 const int CHANCE_DAMAGE_NOTHING = 2;
10073
10075 {
10076 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10077 int chances;
10078 int rnd;
10079
10080 if (GetInventory().GetCargo())
10081 {
10082 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10083 rnd = Math.RandomInt(0,chances);
10084
10085 if (rnd < CHANCE_DAMAGE_CARGO)
10086 {
10088 }
10089 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10090 {
10092 }
10093 }
10094 else
10095 {
10096 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10097 rnd = Math.RandomInt(0,chances);
10098
10099 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10100 {
10102 }
10103 }
10104 }
10105 }
10106
10108 {
10109 if (GetInventory().GetCargo())
10110 {
10111 int item_count = GetInventory().GetCargo().GetItemCount();
10112 if (item_count > 0)
10113 {
10114 int random_pick = Math.RandomInt(0, item_count);
10116 if (!item.IsExplosive())
10117 {
10118 item.AddHealth("","",damage);
10119 return true;
10120 }
10121 }
10122 }
10123 return false;
10124 }
10125
10127 {
10128 int attachment_count = GetInventory().AttachmentCount();
10129 if (attachment_count > 0)
10130 {
10131 int random_pick = Math.RandomInt(0, attachment_count);
10132 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10133 if (!attachment.IsExplosive())
10134 {
10135 attachment.AddHealth("","",damage);
10136 return true;
10137 }
10138 }
10139 return false;
10140 }
10141
10143 {
10145 }
10146
10148 {
10150 return GetInventory().CanRemoveEntity();
10151
10152 return false;
10153 }
10154
10156 {
10157
10159 return false;
10160
10161
10163 return false;
10164
10165
10166
10168 if (delta == 0)
10169 return false;
10170
10171
10172 return true;
10173 }
10174
10176 {
10178 {
10179 if (ScriptInputUserData.CanStoreInputUserData())
10180 {
10181 ScriptInputUserData ctx = new ScriptInputUserData;
10186 ctx.
Write(destination_entity);
10188 ctx.
Write(slot_id);
10190 }
10191 }
10192 else if (!
GetGame().IsMultiplayer())
10193 {
10195 }
10196 }
10197
10199 {
10200 float split_quantity_new;
10204 InventoryLocation loc = new InventoryLocation;
10205
10206 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10207 {
10209 split_quantity_new = stack_max;
10210 else
10212
10214 {
10215 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10216 if (new_item)
10217 {
10218 new_item.SetResultOfSplit(true);
10219 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10221 new_item.
SetQuantity(split_quantity_new,
false,
true);
10222 }
10223 }
10224 }
10225 else if (destination_entity && slot_id == -1)
10226 {
10227 if (quantity > stack_max)
10228 split_quantity_new = stack_max;
10229 else
10230 split_quantity_new = quantity;
10231
10233 {
10235 {
10238 }
10239
10240 if (new_item)
10241 {
10242 new_item.SetResultOfSplit(true);
10243 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10245 new_item.
SetQuantity(split_quantity_new,
false,
true);
10246 }
10247 }
10248 }
10249 else
10250 {
10251 if (stack_max != 0)
10252 {
10254 {
10256 }
10257
10258 if (split_quantity_new == 0)
10259 {
10260 if (!
GetGame().IsMultiplayer())
10261 player.PhysicalPredictiveDropItem(this);
10262 else
10263 player.ServerDropEntity(this);
10264 return;
10265 }
10266
10268 {
10270
10271 if (new_item)
10272 {
10273 new_item.SetResultOfSplit(true);
10274 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10277 new_item.PlaceOnSurface();
10278 }
10279 }
10280 }
10281 }
10282 }
10283
10285 {
10286 float split_quantity_new;
10290 InventoryLocation loc = new InventoryLocation;
10291
10292 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10293 {
10295 split_quantity_new = stack_max;
10296 else
10298
10300 {
10301 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10302 if (new_item)
10303 {
10304 new_item.SetResultOfSplit(true);
10305 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10307 new_item.
SetQuantity(split_quantity_new,
false,
true);
10308 }
10309 }
10310 }
10311 else if (destination_entity && slot_id == -1)
10312 {
10313 if (quantity > stack_max)
10314 split_quantity_new = stack_max;
10315 else
10316 split_quantity_new = quantity;
10317
10319 {
10321 {
10324 }
10325
10326 if (new_item)
10327 {
10328 new_item.SetResultOfSplit(true);
10329 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10331 new_item.
SetQuantity(split_quantity_new,
false,
true);
10332 }
10333 }
10334 }
10335 else
10336 {
10337 if (stack_max != 0)
10338 {
10340 {
10342 }
10343
10345 {
10347
10348 if (new_item)
10349 {
10350 new_item.SetResultOfSplit(true);
10351 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10354 new_item.PlaceOnSurface();
10355 }
10356 }
10357 }
10358 }
10359 }
10360
10362 {
10364 {
10365 if (ScriptInputUserData.CanStoreInputUserData())
10366 {
10367 ScriptInputUserData ctx = new ScriptInputUserData;
10372 dst.WriteToContext(ctx);
10374 }
10375 }
10376 else if (!
GetGame().IsMultiplayer())
10377 {
10379 }
10380 }
10381
10383 {
10385 {
10386 if (ScriptInputUserData.CanStoreInputUserData())
10387 {
10388 ScriptInputUserData ctx = new ScriptInputUserData;
10393 ctx.
Write(destination_entity);
10399 }
10400 }
10401 else if (!
GetGame().IsMultiplayer())
10402 {
10404 }
10405 }
10406
10408 {
10410 }
10411
10413 {
10415 float split_quantity_new;
10417 if (dst.IsValid())
10418 {
10419 int slot_id = dst.GetSlot();
10421
10422 if (quantity > stack_max)
10423 split_quantity_new = stack_max;
10424 else
10425 split_quantity_new = quantity;
10426
10428 {
10430
10431 if (new_item)
10432 {
10433 new_item.SetResultOfSplit(true);
10434 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10436 new_item.
SetQuantity(split_quantity_new,
false,
true);
10437 }
10438
10439 return new_item;
10440 }
10441 }
10442
10443 return null;
10444 }
10445
10447 {
10449 float split_quantity_new;
10451 if (destination_entity)
10452 {
10454 if (quantity > stackable)
10455 split_quantity_new = stackable;
10456 else
10457 split_quantity_new = quantity;
10458
10460 {
10461 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10462 if (new_item)
10463 {
10464 new_item.SetResultOfSplit(true);
10465 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10467 new_item.
SetQuantity(split_quantity_new,
false,
true);
10468 }
10469 }
10470 }
10471 }
10472
10474 {
10476 {
10477 if (ScriptInputUserData.CanStoreInputUserData())
10478 {
10479 ScriptInputUserData ctx = new ScriptInputUserData;
10484 ItemBase destination_entity =
this;
10485 ctx.
Write(destination_entity);
10489 }
10490 }
10491 else if (!
GetGame().IsMultiplayer())
10492 {
10494 }
10495 }
10496
10498 {
10500 float split_quantity_new;
10502 if (player)
10503 {
10505 if (quantity > stackable)
10506 split_quantity_new = stackable;
10507 else
10508 split_quantity_new = quantity;
10509
10511 {
10512 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10513 new_item =
ItemBase.Cast(in_hands);
10514 if (new_item)
10515 {
10516 new_item.SetResultOfSplit(true);
10517 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10519 new_item.SetQuantity(split_quantity_new, false, true);
10520 }
10521 }
10522 }
10523 }
10524
10526 {
10528 float split_quantity_new = Math.Floor(quantity * 0.5);
10529
10531 return;
10532
10534
10535 if (new_item)
10536 {
10537 if (new_item.GetQuantityMax() < split_quantity_new)
10538 {
10539 split_quantity_new = new_item.GetQuantityMax();
10540 }
10541
10542 new_item.SetResultOfSplit(true);
10543 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10544
10546 {
10549 }
10550 else
10551 {
10553 new_item.
SetQuantity(split_quantity_new,
false,
true);
10554 }
10555 }
10556 }
10557
10559 {
10561 float split_quantity_new = Math.Floor(quantity / 2);
10562
10564 return;
10565
10566 InventoryLocation invloc = new InventoryLocation;
10568
10570 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10571
10572 if (new_item)
10573 {
10574 if (new_item.GetQuantityMax() < split_quantity_new)
10575 {
10576 split_quantity_new = new_item.GetQuantityMax();
10577 }
10579 {
10582 }
10583 else if (split_quantity_new > 1)
10584 {
10586 new_item.
SetQuantity(split_quantity_new,
false,
true);
10587 }
10588 }
10589 }
10590
10593 {
10594 SetWeightDirty();
10596
10597 if (parent)
10598 parent.OnAttachmentQuantityChangedEx(this, delta);
10599
10601 {
10603 {
10605 }
10607 {
10608 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10610 }
10611 }
10612
10613 }
10614
10617 {
10618
10619 }
10620
10623 {
10625 }
10626
10628 {
10629 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10630
10632 {
10633 if (newLevel == GameConstants.STATE_RUINED)
10634 {
10636 EntityAI parent = GetHierarchyParent();
10637 if (parent && parent.IsFireplace())
10638 {
10639 CargoBase cargo = GetInventory().GetCargo();
10640 if (cargo)
10641 {
10643 {
10645 }
10646 }
10647 }
10648 }
10649
10651 {
10652
10654 return;
10655 }
10656
10657 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10658 {
10660 }
10661 }
10662 }
10663
10664
10666 {
10667 super.OnRightClick();
10668
10670 {
10672 {
10673 if (ScriptInputUserData.CanStoreInputUserData())
10674 {
10675 EntityAI root = GetHierarchyRoot();
10676 Man playerOwner = GetHierarchyRootPlayer();
10677 InventoryLocation dst = new InventoryLocation;
10678
10679
10680 if (!playerOwner && root && root == this)
10681 {
10683 }
10684 else
10685 {
10686
10687 GetInventory().GetCurrentInventoryLocation(dst);
10689 {
10692 {
10694 }
10695 else
10696 {
10698
10699
10700 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10701 {
10703 }
10704 else
10705 {
10706 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10707 }
10708 }
10709 }
10710 }
10711
10712 ScriptInputUserData ctx = new ScriptInputUserData;
10720 }
10721 }
10722 else if (!
GetGame().IsMultiplayer())
10723 {
10725 }
10726 }
10727 }
10728
10730 {
10731 if (root)
10732 {
10733 vector m4[4];
10734 root.GetTransform(m4);
10735 dst.SetGround(this, m4);
10736 }
10737 else
10738 {
10739 GetInventory().GetCurrentInventoryLocation(dst);
10740 }
10741 }
10742
10743 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10744 {
10745
10746 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10747 return false;
10748
10749 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10750 return false;
10751
10752
10754 return false;
10755
10756
10757 Magazine mag = Magazine.Cast(this);
10758 if (mag)
10759 {
10760 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10761 return false;
10762
10763 if (stack_max_limit)
10764 {
10765 Magazine other_mag = Magazine.Cast(other_item);
10766 if (other_item)
10767 {
10768 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10769 return false;
10770 }
10771
10772 }
10773 }
10774 else
10775 {
10776
10778 return false;
10779
10781 return false;
10782 }
10783
10784 PlayerBase player = null;
10785 if (CastTo(player, GetHierarchyRootPlayer()))
10786 {
10787 if (player.GetInventory().HasAttachment(this))
10788 return false;
10789
10790 if (player.IsItemsToDelete())
10791 return false;
10792 }
10793
10794 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10795 return false;
10796
10797 int slotID;
10799 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10800 return false;
10801
10802 return true;
10803 }
10804
10806 {
10808 }
10809
10811 {
10812 return m_IsResultOfSplit;
10813 }
10814
10816 {
10817 m_IsResultOfSplit = value;
10818 }
10819
10821 {
10823 }
10824
10826 {
10827 float other_item_quantity = other_item.GetQuantity();
10828 float this_free_space;
10829
10831
10833
10834 if (other_item_quantity > this_free_space)
10835 {
10836 return this_free_space;
10837 }
10838 else
10839 {
10840 return other_item_quantity;
10841 }
10842 }
10843
10845 {
10847 }
10848
10850 {
10852 return;
10853
10854 if (!IsMagazine() && other_item)
10855 {
10857 if (quantity_used != 0)
10858 {
10859 float hp1 = GetHealth01("","");
10860 float hp2 = other_item.GetHealth01("","");
10861 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10862 hpResult = hpResult / (
GetQuantity() + quantity_used);
10863
10864 hpResult *= GetMaxHealth();
10865 Math.Round(hpResult);
10866 SetHealth("", "Health", hpResult);
10867
10869 other_item.AddQuantity(-quantity_used);
10870 }
10871 }
10873 }
10874
10876 {
10877 #ifdef SERVER
10878 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10879 GetHierarchyParent().IncreaseLifetimeUp();
10880 #endif
10881 };
10882
10884 {
10885 PlayerBase p = PlayerBase.Cast(player);
10886
10887 array<int> recipesIds = p.m_Recipes;
10888 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10889 if (moduleRecipesManager)
10890 {
10891 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10892 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10893 }
10894
10895 for (int i = 0;i < recipesIds.Count(); i++)
10896 {
10897 int key = recipesIds.Get(i);
10898 string recipeName = moduleRecipesManager.GetRecipeName(key);
10900 }
10901 }
10902
10903
10904 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10905 {
10906 super.GetDebugActions(outputList);
10907
10908
10914
10915
10920
10925
10926
10930
10931
10933 {
10937 }
10938
10941
10942
10946
10948
10949 InventoryLocation loc = new InventoryLocation();
10950 GetInventory().GetCurrentInventoryLocation(loc);
10952 {
10953 if (Gizmo_IsSupported())
10956 }
10957
10959 }
10960
10961
10962
10963
10965 {
10966 super.OnAction(action_id, player, ctx);
10967
10969 {
10970 switch (action_id)
10971 {
10974 return true;
10977 return true;
10978 }
10979 }
10980
10982 {
10983 switch (action_id)
10984 {
10986 Delete();
10987 return true;
10988 }
10989 }
10990
10991 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10992 {
10993 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10994 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10995 PlayerBase p = PlayerBase.Cast(player);
10996 if (
EActions.RECIPES_RANGE_START < 1000)
10997 {
10998 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10999 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11000 }
11001 }
11002 #ifndef SERVER
11003 else if (action_id ==
EActions.WATCH_PLAYER)
11004 {
11005 PluginDeveloper.SetDeveloperItemClientEx(player);
11006 }
11007 #endif
11009 {
11010 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11011 {
11012 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11013 OnDebugButtonPressServer(id + 1);
11014 }
11015
11016 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11017 {
11018 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11020 }
11021
11022 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11023 {
11024 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11026 }
11027
11028 else if (action_id ==
EActions.ADD_QUANTITY)
11029 {
11030 if (IsMagazine())
11031 {
11032 Magazine mag = Magazine.Cast(this);
11033 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11034 }
11035 else
11036 {
11038 }
11039
11040 if (m_EM)
11041 {
11042 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11043 }
11044
11045 }
11046
11047 else if (action_id ==
EActions.REMOVE_QUANTITY)
11048 {
11049 if (IsMagazine())
11050 {
11051 Magazine mag2 = Magazine.Cast(this);
11052 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11053 }
11054 else
11055 {
11057 }
11058 if (m_EM)
11059 {
11060 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11061 }
11062
11063 }
11064
11065 else if (action_id ==
EActions.SET_QUANTITY_0)
11066 {
11068
11069 if (m_EM)
11070 {
11071 m_EM.SetEnergy(0);
11072 }
11073 }
11074
11075 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11076 {
11078
11079 if (m_EM)
11080 {
11081 m_EM.SetEnergy(m_EM.GetEnergyMax());
11082 }
11083 }
11084
11085 else if (action_id ==
EActions.ADD_HEALTH)
11086 {
11087 AddHealth("","",GetMaxHealth("","Health")/5);
11088 }
11089 else if (action_id ==
EActions.REMOVE_HEALTH)
11090 {
11091 AddHealth("","",-GetMaxHealth("","Health")/5);
11092 }
11093 else if (action_id ==
EActions.DESTROY_HEALTH)
11094 {
11095 SetHealth01("","",0);
11096 }
11097 else if (action_id ==
EActions.WATCH_ITEM)
11098 {
11100 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11101 #ifdef DEVELOPER
11102 SetDebugDeveloper_item(this);
11103 #endif
11104 }
11105
11106 else if (action_id ==
EActions.ADD_TEMPERATURE)
11107 {
11108 AddTemperature(20);
11109
11110 }
11111
11112 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11113 {
11114 AddTemperature(-20);
11115
11116 }
11117
11118 else if (action_id ==
EActions.FLIP_FROZEN)
11119 {
11120 SetFrozen(!GetIsFrozen());
11121
11122 }
11123
11124 else if (action_id ==
EActions.ADD_WETNESS)
11125 {
11127
11128 }
11129
11130 else if (action_id ==
EActions.REMOVE_WETNESS)
11131 {
11133
11134 }
11135
11136 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11137 {
11140
11141
11142 }
11143
11144 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11145 {
11148 }
11149
11150 else if (action_id ==
EActions.MAKE_SPECIAL)
11151 {
11152 auto debugParams = DebugSpawnParams.WithPlayer(player);
11153 OnDebugSpawnEx(debugParams);
11154 }
11155
11156 }
11157
11158
11159 return false;
11160 }
11161
11162
11163
11164
11168
11171
11172
11173
11175 {
11176 return false;
11177 }
11178
11179
11181 {
11182 return true;
11183 }
11184
11185
11187 {
11188 return true;
11189 }
11190
11191
11192
11194 {
11195 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11197 }
11198
11201 {
11202 return null;
11203 }
11204
11206 {
11207 return false;
11208 }
11209
11211 {
11212 return false;
11213 }
11214
11218
11219
11221 {
11222 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11223 return module_repairing.CanRepair(this, item_repair_kit);
11224 }
11225
11226
11227 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11228 {
11229 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11230 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11231 }
11232
11233
11235 {
11236
11237
11238
11239
11240
11241
11242
11243
11244 return 1;
11245 }
11246
11247
11248
11250 {
11252 }
11253
11254
11255
11257 {
11259 }
11260
11261
11270 {
11271 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11272
11273 if (player)
11274 {
11275 player.MessageStatus(text);
11276 }
11277 }
11278
11279
11288 {
11289 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11290
11291 if (player)
11292 {
11293 player.MessageAction(text);
11294 }
11295 }
11296
11297
11306 {
11307 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11308
11309 if (player)
11310 {
11311 player.MessageFriendly(text);
11312 }
11313 }
11314
11315
11324 {
11325 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11326
11327 if (player)
11328 {
11329 player.MessageImportant(text);
11330 }
11331 }
11332
11334 {
11335 return true;
11336 }
11337
11338
11339 override bool KindOf(
string tag)
11340 {
11341 bool found = false;
11342 string item_name = this.
GetType();
11345
11346 int array_size = item_tag_array.Count();
11347 for (int i = 0; i < array_size; i++)
11348 {
11349 if (item_tag_array.Get(i) == tag)
11350 {
11351 found = true;
11352 break;
11353 }
11354 }
11355 return found;
11356 }
11357
11358
11360 {
11361
11362 super.OnRPC(sender, rpc_type,ctx);
11363
11364
11365 switch (rpc_type)
11366 {
11367 #ifndef SERVER
11368 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11369 Param2<bool, string> p = new Param2<bool, string>(false, "");
11370
11372 return;
11373
11374 bool play = p.param1;
11375 string soundSet = p.param2;
11376
11377 if (play)
11378 {
11380 {
11382 {
11384 }
11385 }
11386 else
11387 {
11389 }
11390 }
11391 else
11392 {
11394 }
11395
11396 break;
11397 #endif
11398
11399 }
11400
11402 {
11404 }
11405 }
11406
11407
11408
11409
11411 {
11412 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11413 return plugin.GetID(
name);
11414 }
11415
11417 {
11418 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11419 return plugin.GetName(id);
11420 }
11421
11424 {
11425
11426
11427 int varFlags;
11428 if (!ctx.
Read(varFlags))
11429 return;
11430
11431 if (varFlags & ItemVariableFlags.FLOAT)
11432 {
11434 }
11435 }
11436
11438 {
11439
11440 super.SerializeNumericalVars(floats_out);
11441
11442
11443
11445 {
11447 }
11448
11450 {
11452 }
11453
11455 {
11457 }
11458
11460 {
11465 }
11466
11468 {
11470 }
11471 }
11472
11474 {
11475
11476 super.DeSerializeNumericalVars(floats);
11477
11478
11479 int index = 0;
11480 int mask = Math.Round(floats.Get(index));
11481
11482 index++;
11483
11485 {
11487 {
11489 }
11490 else
11491 {
11492 float quantity = floats.Get(index);
11493 SetQuantity(quantity,
true,
false,
false,
false);
11494 }
11495 index++;
11496 }
11497
11499 {
11500 float wet = floats.Get(index);
11502 index++;
11503 }
11504
11506 {
11507 int liquidtype = Math.Round(floats.Get(index));
11509 index++;
11510 }
11511
11513 {
11515 index++;
11517 index++;
11519 index++;
11521 index++;
11522 }
11523
11525 {
11526 int cleanness = Math.Round(floats.Get(index));
11528 index++;
11529 }
11530 }
11531
11533 {
11534 super.WriteVarsToCTX(ctx);
11535
11536
11538 {
11540 }
11541
11543 {
11545 }
11546
11548 {
11550 }
11551
11553 {
11554 int r,g,b,a;
11560 }
11561
11563 {
11565 }
11566 }
11567
11569 {
11570 if (!super.ReadVarsFromCTX(ctx,version))
11571 return false;
11572
11573 int intValue;
11574 float value;
11575
11576 if (version < 140)
11577 {
11578 if (!ctx.
Read(intValue))
11579 return false;
11580
11581 m_VariablesMask = intValue;
11582 }
11583
11585 {
11586 if (!ctx.
Read(value))
11587 return false;
11588
11590 {
11592 }
11593 else
11594 {
11596 }
11597 }
11598
11599 if (version < 140)
11600 {
11602 {
11603 if (!ctx.
Read(value))
11604 return false;
11605 SetTemperatureDirect(value);
11606 }
11607 }
11608
11610 {
11611 if (!ctx.
Read(value))
11612 return false;
11614 }
11615
11617 {
11618 if (!ctx.
Read(intValue))
11619 return false;
11621 }
11622
11624 {
11625 int r,g,b,a;
11627 return false;
11629 return false;
11631 return false;
11633 return false;
11634
11636 }
11637
11639 {
11640 if (!ctx.
Read(intValue))
11641 return false;
11643 }
11644
11645 if (version >= 138 && version < 140)
11646 {
11648 {
11649 if (!ctx.
Read(intValue))
11650 return false;
11651 SetFrozen(intValue);
11652 }
11653 }
11654
11655 return true;
11656 }
11657
11658
11660 {
11663 {
11665 }
11666
11667 if (!super.OnStoreLoad(ctx, version))
11668 {
11670 return false;
11671 }
11672
11673 if (version >= 114)
11674 {
11675 bool hasQuickBarIndexSaved;
11676
11677 if (!ctx.
Read(hasQuickBarIndexSaved))
11678 {
11680 return false;
11681 }
11682
11683 if (hasQuickBarIndexSaved)
11684 {
11685 int itmQBIndex;
11686
11687
11688 if (!ctx.
Read(itmQBIndex))
11689 {
11691 return false;
11692 }
11693
11694 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11695 if (itmQBIndex != -1 && parentPlayer)
11696 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11697 }
11698 }
11699 else
11700 {
11701
11702 PlayerBase player;
11703 int itemQBIndex;
11704 if (version ==
int.
MAX)
11705 {
11706 if (!ctx.
Read(itemQBIndex))
11707 {
11709 return false;
11710 }
11711 }
11712 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11713 {
11714
11715 if (!ctx.
Read(itemQBIndex))
11716 {
11718 return false;
11719 }
11720 if (itemQBIndex != -1 && player)
11721 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11722 }
11723 }
11724
11725 if (version < 140)
11726 {
11727
11728 if (!LoadVariables(ctx, version))
11729 {
11731 return false;
11732 }
11733 }
11734
11735
11737 {
11739 return false;
11740 }
11741 if (version >= 132)
11742 {
11744 if (raib)
11745 {
11747 {
11749 return false;
11750 }
11751 }
11752 }
11753
11755 return true;
11756 }
11757
11758
11759
11761 {
11762 super.OnStoreSave(ctx);
11763
11764 PlayerBase player;
11765 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11766 {
11768
11769 int itemQBIndex = -1;
11770 itemQBIndex = player.FindQuickBarEntityIndex(this);
11771 ctx.
Write(itemQBIndex);
11772 }
11773 else
11774 {
11776 }
11777
11779
11781 if (raib)
11782 {
11784 }
11785 }
11786
11787
11789 {
11790 super.AfterStoreLoad();
11791
11793 {
11795 }
11796
11798 {
11801 }
11802 }
11803
11805 {
11806 super.EEOnAfterLoad();
11807
11809 {
11811 }
11812
11815 }
11816
11818 {
11819 return false;
11820 }
11821
11822
11823
11825 {
11827 {
11828 #ifdef PLATFORM_CONSOLE
11829
11831 {
11833 if (menu)
11834 {
11836 }
11837 }
11838 #endif
11839 }
11840
11842 {
11845 }
11846
11848 {
11849 SetWeightDirty();
11851 }
11853 {
11856 }
11857
11859 {
11862 }
11864 {
11867 }
11868
11869 super.OnVariablesSynchronized();
11870 }
11871
11872
11873
11875 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11876 {
11877 if (!IsServerCheck(allow_client))
11878 return false;
11879
11881 return false;
11882
11885
11886 if (value <= (min + 0.001))
11887 value = min;
11888
11889 if (value == min)
11890 {
11891 if (destroy_config)
11892 {
11893 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11894 if (dstr)
11895 {
11897 this.Delete();
11898 return true;
11899 }
11900 }
11901 else if (destroy_forced)
11902 {
11904 this.Delete();
11905 return true;
11906 }
11907
11909 }
11910
11913
11915 {
11917
11918 if (delta)
11920 }
11921
11923
11924 return false;
11925 }
11926
11927
11929 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11930 {
11932 }
11933
11935 {
11938 }
11939
11941 {
11944 }
11945
11947 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11948 {
11949 float value_clamped = Math.Clamp(value, 0, 1);
11951 SetQuantity(result, destroy_config, destroy_forced);
11952 }
11953
11954
11957 {
11959 }
11960
11962 {
11964 }
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11976 {
11977 int slot = -1;
11978 if (GetInventory())
11979 {
11980 InventoryLocation il = new InventoryLocation;
11981 GetInventory().GetCurrentInventoryLocation(il);
11983 }
11984
11986 }
11987
11989 {
11990 float quantity_max = 0;
11991
11993 {
11994 if (attSlotID != -1)
11995 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11996
11997 if (quantity_max <= 0)
11999 }
12000
12001 if (quantity_max <= 0)
12003
12004 return quantity_max;
12005 }
12006
12008 {
12010 }
12011
12013 {
12015 }
12016
12017
12019 {
12021 }
12022
12024 {
12026 }
12027
12029 {
12031 }
12032
12033
12035 {
12036
12037 float weightEx = GetWeightEx();
12038 float special = GetInventoryAndCargoWeight();
12039 return weightEx - special;
12040 }
12041
12042
12044 {
12046 }
12047
12049 {
12051 {
12052 #ifdef DEVELOPER
12053 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12054 {
12055 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12057 }
12058 #endif
12059
12060 return GetQuantity() * GetConfigWeightModified();
12061 }
12062 else if (HasEnergyManager())
12063 {
12064 #ifdef DEVELOPER
12065 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12066 {
12067 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12068 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12069 }
12070 #endif
12071 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12072 }
12073 else
12074 {
12075 #ifdef DEVELOPER
12076 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12077 {
12078 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12079 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12080 }
12081 #endif
12082 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12083 }
12084 }
12085
12088 {
12089 int item_count = 0;
12091
12092 if (GetInventory().GetCargo() != NULL)
12093 {
12094 item_count = GetInventory().GetCargo().GetItemCount();
12095 }
12096
12097 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12098 {
12099 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12100 if (item)
12101 item_count += item.GetNumberOfItems();
12102 }
12103 return item_count;
12104 }
12105
12108 {
12109 float weight = 0;
12110 float wetness = 1;
12111 if (include_wetness)
12114 {
12115 weight = wetness * m_ConfigWeight;
12116 }
12118 {
12119 weight = 1;
12120 }
12121 return weight;
12122 }
12123
12124
12125
12127 {
12128 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12129 {
12130 GameInventory inv = GetInventory();
12131 array<EntityAI> items = new array<EntityAI>;
12133 for (int i = 0; i < items.Count(); i++)
12134 {
12136 if (item)
12137 {
12139 }
12140 }
12141 }
12142 }
12143
12144
12145
12146
12148 {
12149 float energy = 0;
12150 if (HasEnergyManager())
12151 {
12152 energy = GetCompEM().GetEnergy();
12153 }
12154 return energy;
12155 }
12156
12157
12159 {
12160 super.OnEnergyConsumed();
12161
12163 }
12164
12166 {
12167 super.OnEnergyAdded();
12168
12170 }
12171
12172
12174 {
12175 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12176 {
12178 {
12179 float energy_0to1 = GetCompEM().GetEnergy0To1();
12181 }
12182 }
12183 }
12184
12185
12187 {
12188 return ConfigGetFloat("heatIsolation");
12189 }
12190
12192 {
12194 }
12195
12197 {
12198 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12199 if (
GetGame().ConfigIsExisting(paramPath))
12201
12202 return 0.0;
12203 }
12204
12206 {
12207 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12208 if (
GetGame().ConfigIsExisting(paramPath))
12210
12211 return 0.0;
12212 }
12213
12214 override void SetWet(
float value,
bool allow_client =
false)
12215 {
12216 if (!IsServerCheck(allow_client))
12217 return;
12218
12221
12223
12224 m_VarWet = Math.Clamp(value, min, max);
12225
12227 {
12230 }
12231 }
12232
12233 override void AddWet(
float value)
12234 {
12236 }
12237
12239 {
12241 }
12242
12244 {
12246 }
12247
12249 {
12251 }
12252
12254 {
12256 }
12257
12259 {
12261 }
12262
12263 override void OnWetChanged(
float newVal,
float oldVal)
12264 {
12267 if (newLevel != oldLevel)
12268 {
12270 }
12271 }
12272
12274 {
12275 SetWeightDirty();
12276 }
12277
12279 {
12280 return GetWetLevelInternal(
m_VarWet);
12281 }
12282
12283
12284
12286 {
12288 }
12289
12291 {
12293 }
12294
12296 {
12298 }
12299
12301 {
12303 }
12304
12305
12306
12308 {
12309 if (ConfigIsExisting("itemModelLength"))
12310 {
12311 return ConfigGetFloat("itemModelLength");
12312 }
12313 return 0;
12314 }
12315
12317 {
12318 if (ConfigIsExisting("itemAttachOffset"))
12319 {
12320 return ConfigGetFloat("itemAttachOffset");
12321 }
12322 return 0;
12323 }
12324
12325 override void SetCleanness(
int value,
bool allow_client =
false)
12326 {
12327 if (!IsServerCheck(allow_client))
12328 return;
12329
12331
12333
12336 }
12337
12339 {
12341 }
12342
12344 {
12345 return true;
12346 }
12347
12348
12349
12350
12352 {
12354 }
12355
12357 {
12359 }
12360
12361
12362
12363
12364 override void SetColor(
int r,
int g,
int b,
int a)
12365 {
12371 }
12373 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12374 {
12379 }
12380
12382 {
12384 }
12385
12388 {
12389 int r,g,b,a;
12391 r = r/255;
12392 g = g/255;
12393 b = b/255;
12394 a = a/255;
12395 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12396 }
12397
12398
12399
12400 override void SetLiquidType(
int value,
bool allow_client =
false)
12401 {
12402 if (!IsServerCheck(allow_client))
12403 return;
12404
12409 }
12410
12412 {
12413 return ConfigGetInt("varLiquidTypeInit");
12414 }
12415
12417 {
12419 }
12420
12422 {
12424 SetFrozen(false);
12425 }
12426
12429 {
12430 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12431 }
12432
12433
12436 {
12437 PlayerBase nplayer;
12438 if (PlayerBase.CastTo(nplayer, player))
12439 {
12441
12442 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12443 }
12444 }
12445
12446
12449 {
12450 PlayerBase nplayer;
12451 if (PlayerBase.CastTo(nplayer,player))
12452 {
12453
12454 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12455
12456 }
12457
12458
12459 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12460
12461
12462 if (HasEnergyManager())
12463 {
12464 GetCompEM().UpdatePlugState();
12465 }
12466 }
12467
12468
12470 {
12471 super.OnPlacementStarted(player);
12472
12474 }
12475
12476 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12477 {
12479 {
12480 m_AdminLog.OnPlacementComplete(player,
this);
12481 }
12482
12483 super.OnPlacementComplete(player, position, orientation);
12484 }
12485
12486
12487
12488
12489
12491 {
12493 {
12494 return true;
12495 }
12496 else
12497 {
12498 return false;
12499 }
12500 }
12501
12502
12504 {
12506 {
12508 }
12509 }
12510
12511
12513 {
12515 }
12516
12518 {
12520 }
12521
12522 override void InsertAgent(
int agent,
float count = 1)
12523 {
12524 if (count < 1)
12525 return;
12526
12528 }
12529
12532 {
12534 }
12535
12536
12538 {
12540 }
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12584 {
12586 return false;
12587 return true;
12588 }
12589
12591 {
12592
12594 }
12595
12596
12599 {
12600 super.CheckForRoofLimited(timeTresholdMS);
12601
12603 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12604 {
12605 m_PreviousRoofTestTime = time;
12606 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12607 }
12608 }
12609
12610
12612 {
12614 {
12615 return 0;
12616 }
12617
12618 if (GetInventory().GetAttachmentSlotsCount() != 0)
12619 {
12620 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12621 if (filter)
12622 return filter.GetProtectionLevel(type, false, system);
12623 else
12624 return 0;
12625 }
12626
12627 string subclassPath, entryName;
12628
12629 switch (type)
12630 {
12632 entryName = "biological";
12633 break;
12635 entryName = "chemical";
12636 break;
12637 default:
12638 entryName = "biological";
12639 break;
12640 }
12641
12642 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12643
12645 }
12646
12647
12648
12651 {
12652 if (!IsMagazine())
12654
12656 }
12657
12658
12659
12660
12661
12666 {
12667 return true;
12668 }
12669
12671 {
12673 }
12674
12675
12676
12677
12678
12680 {
12681 if (parent)
12682 {
12683 if (parent.IsInherited(DayZInfected))
12684 return true;
12685
12686 if (!parent.IsRuined())
12687 return true;
12688 }
12689
12690 return true;
12691 }
12692
12694 {
12695 if (!super.CanPutAsAttachment(parent))
12696 {
12697 return false;
12698 }
12699
12700 if (!IsRuined() && !parent.IsRuined())
12701 {
12702 return true;
12703 }
12704
12705 return false;
12706 }
12707
12709 {
12710
12711
12712
12713
12714 return super.CanReceiveItemIntoCargo(item);
12715 }
12716
12718 {
12719
12720
12721
12722
12723 GameInventory attachmentInv = attachment.GetInventory();
12725 {
12726 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12727 return false;
12728 }
12729
12730 InventoryLocation loc = new InventoryLocation();
12731 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12732 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12733 return false;
12734
12735 return super.CanReceiveAttachment(attachment, slotId);
12736 }
12737
12739 {
12740 if (!super.CanReleaseAttachment(attachment))
12741 return false;
12742
12743 return GetInventory().AreChildrenAccessible();
12744 }
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12767 {
12768 int id = muzzle_owner.GetMuzzleID();
12769 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12770
12771 if (WPOF_array)
12772 {
12773 for (int i = 0; i < WPOF_array.Count(); i++)
12774 {
12775 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12776
12777 if (WPOF)
12778 {
12779 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12780 }
12781 }
12782 }
12783 }
12784
12785
12787 {
12788 int id = muzzle_owner.GetMuzzleID();
12790
12791 if (WPOBE_array)
12792 {
12793 for (int i = 0; i < WPOBE_array.Count(); i++)
12794 {
12795 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12796
12797 if (WPOBE)
12798 {
12799 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12800 }
12801 }
12802 }
12803 }
12804
12805
12807 {
12808 int id = muzzle_owner.GetMuzzleID();
12809 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12810
12811 if (WPOOH_array)
12812 {
12813 for (int i = 0; i < WPOOH_array.Count(); i++)
12814 {
12815 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12816
12817 if (WPOOH)
12818 {
12819 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12820 }
12821 }
12822 }
12823 }
12824
12825
12827 {
12828 int id = muzzle_owner.GetMuzzleID();
12829 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12830
12831 if (WPOOH_array)
12832 {
12833 for (int i = 0; i < WPOOH_array.Count(); i++)
12834 {
12835 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12836
12837 if (WPOOH)
12838 {
12839 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12840 }
12841 }
12842 }
12843 }
12844
12845
12847 {
12848 int id = muzzle_owner.GetMuzzleID();
12849 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12850
12851 if (WPOOH_array)
12852 {
12853 for (int i = 0; i < WPOOH_array.Count(); i++)
12854 {
12855 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12856
12857 if (WPOOH)
12858 {
12859 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12860 }
12861 }
12862 }
12863 }
12864
12865
12866
12868 {
12870 {
12871 return true;
12872 }
12873
12874 return false;
12875 }
12876
12878 {
12880 {
12881 return true;
12882 }
12883
12884 return false;
12885 }
12886
12888 {
12890 {
12891 return true;
12892 }
12893
12894 return false;
12895 }
12896
12898 {
12899 return false;
12900 }
12901
12904 {
12905 return UATimeSpent.DEFAULT_DEPLOY;
12906 }
12907
12908
12909
12910
12912 {
12914 SetSynchDirty();
12915 }
12916
12918 {
12920 }
12921
12922
12924 {
12925 return false;
12926 }
12927
12930 {
12931 string att_type = "None";
12932
12933 if (ConfigIsExisting("soundAttType"))
12934 {
12935 att_type = ConfigGetString("soundAttType");
12936 }
12937
12939 }
12940
12942 {
12944 }
12945
12946
12947
12948
12949
12955
12957 {
12960
12962 }
12963
12964
12966 {
12968 return;
12969
12971
12974
12977
12978 SoundParameters params = new SoundParameters();
12982 }
12983
12984
12986 {
12988 return;
12989
12991 SetSynchDirty();
12992
12995 }
12996
12997
12999 {
13001 return;
13002
13004 SetSynchDirty();
13005
13008 }
13009
13011 {
13013 }
13014
13016 {
13018 }
13019
13022 {
13023 if (!
GetGame().IsDedicatedServer())
13024 {
13025 if (ConfigIsExisting("attachSoundSet"))
13026 {
13027 string cfg_path = "";
13028 string soundset = "";
13029 string type_name =
GetType();
13030
13033 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13034 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13035
13036 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13037 {
13038 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13039 {
13040 if (cfg_slot_array[i] == slot_type)
13041 {
13042 soundset = cfg_soundset_array[i];
13043 break;
13044 }
13045 }
13046 }
13047
13048 if (soundset != "")
13049 {
13050 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13052 }
13053 }
13054 }
13055 }
13056
13058 {
13059
13060 }
13061
13062 void OnApply(PlayerBase player);
13063
13065 {
13066 return 1.0;
13067 };
13068
13070 {
13072 }
13073
13075 {
13077 }
13078
13080
13082 {
13083 SetDynamicPhysicsLifeTime(0.01);
13085 }
13086
13088 {
13089 array<string> zone_names = new array<string>;
13090 GetDamageZones(zone_names);
13091 for (int i = 0; i < zone_names.Count(); i++)
13092 {
13093 SetHealthMax(zone_names.Get(i),"Health");
13094 }
13095 SetHealthMax("","Health");
13096 }
13097
13100 {
13101 float global_health = GetHealth01("","Health");
13102 array<string> zones = new array<string>;
13103 GetDamageZones(zones);
13104
13105 for (int i = 0; i < zones.Count(); i++)
13106 {
13107 SetHealth01(zones.Get(i),"Health",global_health);
13108 }
13109 }
13110
13113 {
13114 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13115 }
13116
13118 {
13119 if (!hasRootAsPlayer)
13120 {
13121 if (refParentIB)
13122 {
13123
13124 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13125 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13126
13127 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13128 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13129
13132 }
13133 else
13134 {
13135
13138 }
13139 }
13140 }
13141
13143 {
13145 {
13146 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13147 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13148 {
13149 float heatPermCoef = 1.0;
13151 while (ent)
13152 {
13153 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13154 ent = ent.GetHierarchyParent();
13155 }
13156
13157 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13158 }
13159 }
13160 }
13161
13163 {
13164
13165 EntityAI parent = GetHierarchyParent();
13166 if (!parent)
13167 {
13168 hasParent = false;
13169 hasRootAsPlayer = false;
13170 }
13171 else
13172 {
13173 hasParent = true;
13174 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13175 refParentIB =
ItemBase.Cast(parent);
13176 }
13177 }
13178
13179 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13180 {
13181
13182 }
13183
13185 {
13186
13187 return false;
13188 }
13189
13191 {
13192
13193
13194 return false;
13195 }
13196
13198 {
13199
13200 return false;
13201 }
13202
13205 {
13206 return !GetIsFrozen() &&
IsOpen();
13207 }
13208
13210 {
13211 bool hasParent = false, hasRootAsPlayer = false;
13213
13214 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13215 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13216
13217 if (wwtu || foodDecay)
13218 {
13222
13223 if (processWetness || processTemperature || processDecay)
13224 {
13226
13227 if (processWetness)
13228 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13229
13230 if (processTemperature)
13232
13233 if (processDecay)
13234 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13235 }
13236 }
13237 }
13238
13241 {
13243 }
13244
13246 {
13249
13250 return super.GetTemperatureFreezeThreshold();
13251 }
13252
13254 {
13257
13258 return super.GetTemperatureThawThreshold();
13259 }
13260
13262 {
13265
13266 return super.GetItemOverheatThreshold();
13267 }
13268
13270 {
13272 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13273
13274 return super.GetTemperatureFreezeTime();
13275 }
13276
13278 {
13280 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13281
13282 return super.GetTemperatureThawTime();
13283 }
13284
13289
13291 {
13292 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13293 }
13294
13296 {
13297 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13298 }
13299
13302 {
13304 }
13305
13307 {
13309 }
13310
13312 {
13314 }
13315
13318 {
13319 return null;
13320 }
13321
13324 {
13325 return false;
13326 }
13327
13329 {
13331 {
13334 if (!trg)
13335 {
13337 explosive = this;
13338 }
13339
13340 explosive.PairRemote(trg);
13342
13343 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13344 trg.SetPersistentPairID(persistentID);
13345 explosive.SetPersistentPairID(persistentID);
13346
13347 return true;
13348 }
13349 return false;
13350 }
13351
13354 {
13355 float ret = 1.0;
13358 ret *= GetHealth01();
13359
13360 return ret;
13361 }
13362
13363 #ifdef DEVELOPER
13364 override void SetDebugItem()
13365 {
13366 super.SetDebugItem();
13367 _itemBase = this;
13368 }
13369
13371 {
13372 string text = super.GetDebugText();
13373
13375 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13376
13377 return text;
13378 }
13379 #endif
13380
13382 {
13383 return true;
13384 }
13385
13387
13389
13391 {
13394 }
13395
13396
13404
13420}
13421
13423{
13425 if (entity)
13426 {
13427 bool is_item = entity.IsInherited(
ItemBase);
13428 if (is_item && full_quantity)
13429 {
13432 }
13433 }
13434 else
13435 {
13437 return NULL;
13438 }
13439 return entity;
13440}
13441
13443{
13444 if (item)
13445 {
13446 if (health > 0)
13447 item.SetHealth("", "", health);
13448
13449 if (item.CanHaveTemperature())
13450 {
13452 if (item.CanFreeze())
13453 item.SetFrozen(false);
13454 }
13455
13456 if (item.HasEnergyManager())
13457 {
13458 if (quantity >= 0)
13459 {
13460 item.GetCompEM().SetEnergy0To1(quantity);
13461 }
13462 else
13463 {
13465 }
13466 }
13467 else if (item.IsMagazine())
13468 {
13469 Magazine mag = Magazine.Cast(item);
13470 if (quantity >= 0)
13471 {
13472 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13473 }
13474 else
13475 {
13477 }
13478
13479 }
13480 else
13481 {
13482 if (quantity >= 0)
13483 {
13484 item.SetQuantityNormalized(quantity, false);
13485 }
13486 else
13487 {
13489 }
13490
13491 }
13492 }
13493}
13494
13495#ifdef DEVELOPER
13497#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.