Event called on item when it is removed from the player(Man) inventory, passes the old owner as a parameter.
8583{
8585 {
8586 return true;
8587 }
8588};
8589
8590
8591
8593{
8597
8599
8602
8603
8604
8605
8606
8615
8621
8626
8631
8652 protected bool m_IsResultOfSplit
8653
8655
8660
8661
8662
8664
8668
8669
8670
8672
8675
8676
8677
8683
8684
8692
8695
8696
8698
8699
8701
8702
8707
8708
8713
8714
8716
8717
8719 {
8724
8725 if (!
GetGame().IsDedicatedServer())
8726 {
8728 {
8730
8732 {
8734 }
8735 }
8736
8739 }
8740
8741 m_OldLocation = null;
8742
8744 {
8746 }
8747
8748 if (ConfigIsExisting("headSelectionsToHide"))
8749 {
8752 }
8753
8755 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8756 {
8758 }
8759
8761
8762 m_IsResultOfSplit = false;
8763
8765 }
8766
8768 {
8769 super.InitItemVariables();
8770
8776 m_Count = ConfigGetInt(
"count");
8777
8780
8785
8788
8793
8805
8809
8810
8813 if (ConfigIsExisting("canBeSplit"))
8814 {
8817 }
8818
8820 if (ConfigIsExisting("itemBehaviour"))
8822
8823
8826 RegisterNetSyncVariableInt("m_VarLiquidType");
8827 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8828
8829 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8830 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8831 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8832
8833 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8834 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8835 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8836 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8837
8838 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8839 RegisterNetSyncVariableBool("m_IsTakeable");
8840 RegisterNetSyncVariableBool("m_IsHologram");
8841
8844 {
8847 }
8848
8850
8852 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8854
8855 }
8856
8858 {
8860 }
8861
8863 {
8866 {
8871 }
8872 }
8873
8874 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8875 {
8877 {
8880 }
8881
8883 }
8884
8886 {
8892 }
8893
8895
8897 {
8899
8900 if (!action)
8901 {
8902 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8903 return;
8904 }
8905
8907 if (!ai)
8908 {
8910 return;
8911 }
8912
8914 if (!action_array)
8915 {
8916 action_array = new array<ActionBase_Basic>;
8918 }
8919 if (LogManager.IsActionLogEnable())
8920 {
8921 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8922 }
8923
8924 if (action_array.Find(action) != -1)
8925 {
8926 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8927 }
8928 else
8929 {
8930 action_array.Insert(action);
8931 }
8932 }
8933
8935 {
8937 ActionBase action = player.GetActionManager().GetAction(actionName);
8940
8941 if (action_array)
8942 {
8943 action_array.RemoveItem(action);
8944 }
8945 }
8946
8947
8948
8950 {
8951 ActionOverrideData overrideData = new ActionOverrideData();
8955
8957 if (!actionMap)
8958 {
8961 }
8962
8963 actionMap.Insert(this.
Type(), overrideData);
8964
8965 }
8966
8968
8970
8971
8973 {
8976
8979
8980 string config_to_search = "CfgVehicles";
8981 string muzzle_owner_config;
8982
8984 {
8985 if (IsInherited(Weapon))
8986 config_to_search = "CfgWeapons";
8987
8988 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8989
8990 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8991
8993
8994 if (config_OnFire_subclass_count > 0)
8995 {
8996 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8997
8998 for (int i = 0; i < config_OnFire_subclass_count; i++)
8999 {
9000 string particle_class = "";
9002 string config_OnFire_entry = config_OnFire_class + particle_class;
9003 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9004 WPOF_array.Insert(WPOF);
9005 }
9006
9007
9009 }
9010 }
9011
9013 {
9014 config_to_search = "CfgWeapons";
9015 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9016
9017 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9018
9020
9021 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9022 {
9023 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9024
9025 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9026 {
9027 string particle_class2 = "";
9029 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9030 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9031 WPOBE_array.Insert(WPOBE);
9032 }
9033
9034
9036 }
9037 }
9038 }
9039
9040
9042 {
9045
9047 {
9048 string config_to_search = "CfgVehicles";
9049
9050 if (IsInherited(Weapon))
9051 config_to_search = "CfgWeapons";
9052
9053 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9054 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9055
9056 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9057 {
9058
9060
9062 {
9064 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9066 return;
9067 }
9068
9071
9072
9073
9075 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9076
9077 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9078 {
9079 string particle_class = "";
9081 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9083
9084 if (entry_type == CT_CLASS)
9085 {
9086 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9087 WPOOH_array.Insert(WPOF);
9088 }
9089 }
9090
9091
9093 }
9094 }
9095 }
9096
9098 {
9100 }
9101
9103 {
9105 {
9107
9110
9113
9114 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9115 }
9116 }
9117
9119 {
9121 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9122
9124 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9125
9127 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9128
9130 {
9132 }
9133 }
9134
9136 {
9138 }
9139
9141 {
9144 else
9146
9148 {
9151 }
9152 else
9153 {
9156
9159 }
9160
9162 }
9163
9165 {
9167 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9168 }
9169
9171 {
9173 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9175 }
9176
9178 {
9180 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9181 }
9182
9184 {
9187
9188 OverheatingParticle OP = new OverheatingParticle();
9193
9195 }
9196
9198 {
9201
9202 return -1;
9203 }
9204
9206 {
9208 {
9211
9212 for (int i = count; i > 0; --i)
9213 {
9214 int id = i - 1;
9217
9220
9221 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9222 {
9223 if (p)
9224 {
9227 }
9228 }
9229 }
9230 }
9231 }
9232
9234 {
9236 {
9238 {
9239 int id = i - 1;
9241
9242 if (OP)
9243 {
9245
9246 if (p)
9247 {
9249 }
9250
9251 delete OP;
9252 }
9253 }
9254
9257 }
9258 }
9259
9262 {
9263 return 0.0;
9264 }
9265
9266
9268 {
9269 return 250;
9270 }
9271
9273 {
9274 return 0;
9275 }
9276
9279 {
9281 return true;
9282
9283 return false;
9284 }
9285
9288 {
9291
9293 {
9295 }
9296 else
9297 {
9298
9300 }
9301
9303 }
9304
9311 {
9312 return -1;
9313 }
9314
9315
9316
9317
9319 {
9321 {
9323 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9324
9325 if (r_index >= 0)
9326 {
9327 InventoryLocation r_il = new InventoryLocation;
9328 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9329
9330 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9333 {
9334 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9335 }
9337 {
9338 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9339 }
9340
9341 }
9342
9343 player.GetHumanInventory().ClearUserReservedLocation(this);
9344 }
9345
9348 }
9349
9350
9351
9352
9354 {
9355 return ItemBase.m_DebugActionsMask;
9356 }
9357
9359 {
9360 return ItemBase.m_DebugActionsMask & mask;
9361 }
9362
9364 {
9365 ItemBase.m_DebugActionsMask = mask;
9366 }
9367
9369 {
9370 ItemBase.m_DebugActionsMask |= mask;
9371 }
9372
9374 {
9375 ItemBase.m_DebugActionsMask &= ~mask;
9376 }
9377
9379 {
9381 {
9383 }
9384 else
9385 {
9387 }
9388 }
9389
9390
9392 {
9393 if (GetEconomyProfile())
9394 {
9395 float q_max = GetEconomyProfile().GetQuantityMax();
9396 if (q_max > 0)
9397 {
9398 float q_min = GetEconomyProfile().GetQuantityMin();
9399 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9400
9402 {
9403 ComponentEnergyManager comp = GetCompEM();
9405 {
9407 }
9408 }
9410 {
9412
9413 }
9414
9415 }
9416 }
9417 }
9418
9421 {
9422 EntityAI parent = GetHierarchyParent();
9423
9424 if (parent)
9425 {
9426 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9427 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9428 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9429 }
9430 }
9431
9434 {
9435 EntityAI parent = GetHierarchyParent();
9436
9437 if (parent)
9438 {
9439 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9440 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9441 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9442 }
9443 }
9444
9446 {
9447
9448
9449
9450
9452
9454 {
9455 if (ScriptInputUserData.CanStoreInputUserData())
9456 {
9457 ScriptInputUserData ctx = new ScriptInputUserData;
9463 ctx.
Write(use_stack_max);
9466
9468 {
9469 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9470 }
9471 }
9472 }
9473 else if (!
GetGame().IsMultiplayer())
9474 {
9476 }
9477 }
9478
9480 {
9482 }
9483
9485 {
9487 }
9488
9490 {
9492 }
9493
9495 {
9496
9497 return false;
9498 }
9499
9501 {
9502 return false;
9503 }
9504
9508 {
9509 return false;
9510 }
9511
9513 {
9514 return "";
9515 }
9516
9518
9520 {
9521 return false;
9522 }
9523
9525 {
9526 return true;
9527 }
9528
9529
9530
9532 {
9533 return true;
9534 }
9535
9537 {
9538 return true;
9539 }
9540
9542 {
9543 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9545 }
9546
9548 {
9550 }
9551
9553 {
9555 if (!is_being_placed)
9557 SetSynchDirty();
9558 }
9559
9560
9562
9564 {
9566 }
9567
9569 {
9571 }
9572
9574 {
9575 return 1;
9576 }
9577
9579 {
9580 return false;
9581 }
9582
9584 {
9586 SetSynchDirty();
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
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9624 {
9625 super.OnMovedInsideCargo(container);
9626
9627 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9628 }
9629
9630 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9631 {
9632 super.EEItemLocationChanged(oldLoc,newLoc);
9633
9634 PlayerBase new_player = null;
9635 PlayerBase old_player = null;
9636
9637 if (newLoc.GetParent())
9638 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9639
9640 if (oldLoc.GetParent())
9641 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9642
9644 {
9645 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9646
9647 if (r_index >= 0)
9648 {
9649 InventoryLocation r_il = new InventoryLocation;
9650 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9651
9652 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9655 {
9656 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9657 }
9659 {
9660 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9661 }
9662
9663 }
9664 }
9665
9667 {
9668 if (new_player)
9669 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9670
9671 if (new_player == old_player)
9672 {
9673
9674 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9675 {
9677 {
9678 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9679 {
9680 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9681 }
9682 }
9683 else
9684 {
9685 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9686 }
9687 }
9688
9689 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9690 {
9691 int type = oldLoc.GetType();
9693 {
9694 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9695 }
9697 {
9698 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9699 }
9700 }
9701 if (!m_OldLocation)
9702 {
9703 m_OldLocation = new InventoryLocation;
9704 }
9705 m_OldLocation.Copy(oldLoc);
9706 }
9707 else
9708 {
9709 if (m_OldLocation)
9710 {
9711 m_OldLocation.Reset();
9712 }
9713 }
9714
9716 }
9717 else
9718 {
9719 if (new_player)
9720 {
9721 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9722 if (res_index >= 0)
9723 {
9724 InventoryLocation il = new InventoryLocation;
9725 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9727 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9730 {
9731 il.
GetParent().GetOnReleaseLock().Invoke(it);
9732 }
9734 {
9736 }
9737
9738 }
9739 }
9741 {
9742
9744 }
9745
9746 if (m_OldLocation)
9747 {
9748 m_OldLocation.Reset();
9749 }
9750 }
9751 }
9752
9753 override void EOnContact(IEntity other, Contact extra)
9754 {
9756 {
9757 int liquidType = -1;
9759 if (impactSpeed > 0.0)
9760 {
9762 #ifndef SERVER
9764 #else
9766 SetSynchDirty();
9767 #endif
9769 }
9770 }
9771
9772 #ifdef SERVER
9773 if (GetCompEM() && GetCompEM().IsPlugged())
9774 {
9775 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9776 GetCompEM().UnplugThis();
9777 }
9778 #endif
9779 }
9780
9782
9784 {
9786 }
9787
9789 {
9790
9791 }
9792
9794 {
9795 super.OnItemLocationChanged(old_owner, new_owner);
9796
9797 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9798 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9799
9800 if (!relatedPlayer && playerNew)
9801 relatedPlayer = playerNew;
9802
9803 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9804 {
9806 if (actionMgr)
9807 {
9808 ActionBase currentAction = actionMgr.GetRunningAction();
9809 if (currentAction)
9811 }
9812 }
9813
9814 Man ownerPlayerOld = null;
9815 Man ownerPlayerNew = null;
9816
9817 if (old_owner)
9818 {
9819 if (old_owner.
IsMan())
9820 {
9821 ownerPlayerOld = Man.Cast(old_owner);
9822 }
9823 else
9824 {
9825 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9826 }
9827 }
9828 else
9829 {
9831 {
9833
9834 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9835 {
9836 GetCompEM().UnplugThis();
9837 }
9838 }
9839 }
9840
9841 if (new_owner)
9842 {
9843 if (new_owner.
IsMan())
9844 {
9845 ownerPlayerNew = Man.Cast(new_owner);
9846 }
9847 else
9848 {
9849 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9850 }
9851 }
9852
9853 if (ownerPlayerOld != ownerPlayerNew)
9854 {
9855 if (ownerPlayerOld)
9856 {
9857 array<EntityAI> subItemsExit = new array<EntityAI>;
9859 for (int i = 0; i < subItemsExit.Count(); i++)
9860 {
9863 }
9864 }
9865
9866 if (ownerPlayerNew)
9867 {
9868 array<EntityAI> subItemsEnter = new array<EntityAI>;
9870 for (int j = 0; j < subItemsEnter.Count(); j++)
9871 {
9874 }
9875 }
9876 }
9877 else if (ownerPlayerNew != null)
9878 {
9879 PlayerBase nplayer;
9880 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9881 {
9882 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9884 for (int k = 0; k < subItemsUpdate.Count(); k++)
9885 {
9887 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9888 }
9889 }
9890 }
9891
9892 if (old_owner)
9893 old_owner.OnChildItemRemoved(this);
9894 if (new_owner)
9895 new_owner.OnChildItemReceived(this);
9896 }
9897
9898
9900 {
9901 super.EEDelete(parent);
9902 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9903 if (player)
9904 {
9906
9907 if (player.IsAlive())
9908 {
9909 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9910 if (r_index >= 0)
9911 {
9912 InventoryLocation r_il = new InventoryLocation;
9913 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9914
9915 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9918 {
9919 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9920 }
9922 {
9923 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9924 }
9925
9926 }
9927
9928 player.RemoveQuickBarEntityShortcut(this);
9929 }
9930 }
9931 }
9932
9934 {
9935 super.EEKilled(killer);
9936
9939 {
9940 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9941 {
9942 if (IsMagazine())
9943 {
9944 if (Magazine.Cast(this).GetAmmoCount() > 0)
9945 {
9947 }
9948 }
9949 else
9950 {
9952 }
9953 }
9954 }
9955 }
9956
9958 {
9959 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9960
9961 super.OnWasAttached(parent, slot_id);
9962
9965
9967 }
9968
9970 {
9971 super.OnWasDetached(parent, slot_id);
9972
9975 }
9976
9978 {
9979 int idx;
9982
9983 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9984 if (inventory_slots.Count() < 1)
9985 {
9986 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9987 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9988 }
9989 else
9990 {
9991 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9992 }
9993
9994 idx = inventory_slots.Find(slot);
9995 if (idx < 0)
9996 return "";
9997
9998 return attach_types.Get(idx);
9999 }
10000
10002 {
10003 int idx = -1;
10004 string slot;
10005
10008
10009 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10010 if (inventory_slots.Count() < 1)
10011 {
10012 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10013 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10014 }
10015 else
10016 {
10017 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10018 if (detach_types.Count() < 1)
10019 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10020 }
10021
10022 for (int i = 0; i < inventory_slots.Count(); i++)
10023 {
10024 slot = inventory_slots.Get(i);
10025 }
10026
10027 if (slot != "")
10028 {
10029 if (detach_types.Count() == 1)
10030 idx = 0;
10031 else
10032 idx = inventory_slots.Find(slot);
10033 }
10034 if (idx < 0)
10035 return "";
10036
10037 return detach_types.Get(idx);
10038 }
10039
10041 {
10042
10044
10045
10046 float min_time = 1;
10047 float max_time = 3;
10048 float delay = Math.RandomFloat(min_time, max_time);
10049
10050 explode_timer.Run(delay, this, "DoAmmoExplosion");
10051 }
10052
10054 {
10055 Magazine magazine = Magazine.Cast(this);
10056 int pop_sounds_count = 6;
10057 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10058
10059
10060 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10061 string sound_name = pop_sounds[ sound_idx ];
10063
10064
10065 magazine.ServerAddAmmoCount(-1);
10066
10067
10068 float min_temp_to_explode = 100;
10069
10070 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10071 {
10073 }
10074 }
10075
10076
10077 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10078 {
10079 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10080
10081 const int CHANCE_DAMAGE_CARGO = 4;
10082 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10083 const int CHANCE_DAMAGE_NOTHING = 2;
10084
10086 {
10087 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10088 int chances;
10089 int rnd;
10090
10091 if (GetInventory().GetCargo())
10092 {
10093 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10094 rnd = Math.RandomInt(0,chances);
10095
10096 if (rnd < CHANCE_DAMAGE_CARGO)
10097 {
10099 }
10100 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10101 {
10103 }
10104 }
10105 else
10106 {
10107 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10108 rnd = Math.RandomInt(0,chances);
10109
10110 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10111 {
10113 }
10114 }
10115 }
10116 }
10117
10119 {
10120 if (GetInventory().GetCargo())
10121 {
10122 int item_count = GetInventory().GetCargo().GetItemCount();
10123 if (item_count > 0)
10124 {
10125 int random_pick = Math.RandomInt(0, item_count);
10127 if (!item.IsExplosive())
10128 {
10129 item.AddHealth("","",damage);
10130 return true;
10131 }
10132 }
10133 }
10134 return false;
10135 }
10136
10138 {
10139 int attachment_count = GetInventory().AttachmentCount();
10140 if (attachment_count > 0)
10141 {
10142 int random_pick = Math.RandomInt(0, attachment_count);
10143 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10144 if (!attachment.IsExplosive())
10145 {
10146 attachment.AddHealth("","",damage);
10147 return true;
10148 }
10149 }
10150 return false;
10151 }
10152
10154 {
10156 }
10157
10159 {
10161 return GetInventory().CanRemoveEntity();
10162
10163 return false;
10164 }
10165
10167 {
10169 return;
10170
10172 {
10173 if (ScriptInputUserData.CanStoreInputUserData())
10174 {
10175 ScriptInputUserData ctx = new ScriptInputUserData;
10180 ctx.
Write(destination_entity);
10182 ctx.
Write(slot_id);
10184 }
10185 }
10186 else if (!
GetGame().IsMultiplayer())
10187 {
10189 }
10190 }
10191
10193 {
10195 return;
10196
10197 float split_quantity_new;
10201 InventoryLocation loc = new InventoryLocation;
10202
10203 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10204 {
10206 split_quantity_new = stack_max;
10207 else
10209
10210 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10211 if (new_item)
10212 {
10213 new_item.SetResultOfSplit(true);
10214 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10216 new_item.SetQuantity(split_quantity_new);
10217 }
10218 }
10219 else if (destination_entity && slot_id == -1)
10220 {
10221 if (quantity > stack_max)
10222 split_quantity_new = stack_max;
10223 else
10224 split_quantity_new = quantity;
10225
10227 {
10230 }
10231
10232 if (new_item)
10233 {
10234 new_item.SetResultOfSplit(true);
10235 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10237 new_item.SetQuantity(split_quantity_new);
10238 }
10239 }
10240 else
10241 {
10242 if (stack_max != 0)
10243 {
10245 {
10247 }
10248
10249 if (split_quantity_new == 0)
10250 {
10251 if (!
GetGame().IsMultiplayer())
10252 player.PhysicalPredictiveDropItem(this);
10253 else
10254 player.ServerDropEntity(this);
10255 return;
10256 }
10257
10259
10260 if (new_item)
10261 {
10262 new_item.SetResultOfSplit(true);
10263 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10265 new_item.SetQuantity(stack_max);
10266 new_item.PlaceOnSurface();
10267 }
10268 }
10269 }
10270 }
10271
10273 {
10275 return;
10276
10277 float split_quantity_new;
10281 InventoryLocation loc = new InventoryLocation;
10282
10283 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10284 {
10286 split_quantity_new = stack_max;
10287 else
10289
10290 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10291 if (new_item)
10292 {
10293 new_item.SetResultOfSplit(true);
10294 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10296 new_item.SetQuantity(split_quantity_new);
10297 }
10298 }
10299 else if (destination_entity && slot_id == -1)
10300 {
10301 if (quantity > stack_max)
10302 split_quantity_new = stack_max;
10303 else
10304 split_quantity_new = quantity;
10305
10307 {
10310 }
10311
10312 if (new_item)
10313 {
10314 new_item.SetResultOfSplit(true);
10315 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10317 new_item.SetQuantity(split_quantity_new);
10318 }
10319 }
10320 else
10321 {
10322 if (stack_max != 0)
10323 {
10325 {
10327 }
10328
10330
10331 if (new_item)
10332 {
10333 new_item.SetResultOfSplit(true);
10334 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10336 new_item.SetQuantity(stack_max);
10337 new_item.PlaceOnSurface();
10338 }
10339 }
10340 }
10341 }
10342
10344 {
10346 return;
10347
10349 {
10350 if (ScriptInputUserData.CanStoreInputUserData())
10351 {
10352 ScriptInputUserData ctx = new ScriptInputUserData;
10357 dst.WriteToContext(ctx);
10359 }
10360 }
10361 else if (!
GetGame().IsMultiplayer())
10362 {
10364 }
10365 }
10366
10368 {
10370 return;
10371
10373 {
10374 if (ScriptInputUserData.CanStoreInputUserData())
10375 {
10376 ScriptInputUserData ctx = new ScriptInputUserData;
10381 ctx.
Write(destination_entity);
10387 }
10388 }
10389 else if (!
GetGame().IsMultiplayer())
10390 {
10392 }
10393 }
10394
10396 {
10398 }
10399
10401 {
10403 return this;
10404
10406 float split_quantity_new;
10408 if (dst.IsValid())
10409 {
10410 int slot_id = dst.GetSlot();
10412
10413 if (quantity > stack_max)
10414 split_quantity_new = stack_max;
10415 else
10416 split_quantity_new = quantity;
10417
10419
10420 if (new_item)
10421 {
10422 new_item.SetResultOfSplit(true);
10423 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10426 }
10427
10428 return new_item;
10429 }
10430
10431 return null;
10432 }
10433
10435 {
10437 return;
10438
10440 float split_quantity_new;
10442 if (destination_entity)
10443 {
10445 if (quantity > stackable)
10446 split_quantity_new = stackable;
10447 else
10448 split_quantity_new = quantity;
10449
10450 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10451 if (new_item)
10452 {
10453 new_item.SetResultOfSplit(true);
10454 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10456 new_item.SetQuantity(split_quantity_new);
10457 }
10458 }
10459 }
10460
10462 {
10464 return;
10465
10467 {
10468 if (ScriptInputUserData.CanStoreInputUserData())
10469 {
10470 ScriptInputUserData ctx = new ScriptInputUserData;
10475 ItemBase destination_entity =
this;
10476 ctx.
Write(destination_entity);
10480 }
10481 }
10482 else if (!
GetGame().IsMultiplayer())
10483 {
10485 }
10486 }
10487
10489 {
10491 return;
10492
10494 float split_quantity_new;
10496 if (player)
10497 {
10499 if (quantity > stackable)
10500 split_quantity_new = stackable;
10501 else
10502 split_quantity_new = quantity;
10503
10504 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10505 new_item =
ItemBase.Cast(in_hands);
10506 if (new_item)
10507 {
10508 new_item.SetResultOfSplit(true);
10509 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10511 new_item.SetQuantity(split_quantity_new);
10512 }
10513 }
10514 }
10515
10517 {
10519 return;
10520
10522 float split_quantity_new = Math.Floor(quantity * 0.5);
10523
10525
10526 if (new_item)
10527 {
10528 if (new_item.GetQuantityMax() < split_quantity_new)
10529 {
10530 split_quantity_new = new_item.GetQuantityMax();
10531 }
10532
10533 new_item.SetResultOfSplit(true);
10534 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10535
10537 {
10540 }
10541 else
10542 {
10545 }
10546 }
10547 }
10548
10550 {
10552 return;
10553
10555 float split_quantity_new = Math.Floor(quantity / 2);
10556
10557 InventoryLocation invloc = new InventoryLocation;
10559
10561 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10562
10563 if (new_item)
10564 {
10565 if (new_item.GetQuantityMax() < split_quantity_new)
10566 {
10567 split_quantity_new = new_item.GetQuantityMax();
10568 }
10570 {
10573 }
10574 else
10575 {
10578 }
10579 }
10580 }
10581
10584 {
10585 SetWeightDirty();
10587
10588 if (parent)
10589 parent.OnAttachmentQuantityChangedEx(this, delta);
10590
10592 {
10594 {
10596 }
10598 {
10599 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10601 }
10602 }
10603
10604 }
10605
10608 {
10609
10610 }
10611
10614 {
10616 }
10617
10619 {
10620 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10621
10623 {
10624 if (newLevel == GameConstants.STATE_RUINED)
10625 {
10627 EntityAI parent = GetHierarchyParent();
10628 if (parent && parent.IsFireplace())
10629 {
10630 CargoBase cargo = GetInventory().GetCargo();
10631 if (cargo)
10632 {
10634 {
10636 }
10637 }
10638 }
10639 }
10640
10642 {
10643
10645 return;
10646 }
10647
10648 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10649 {
10651 }
10652 }
10653 }
10654
10655
10657 {
10658 super.OnRightClick();
10659
10661 {
10663 {
10664 if (ScriptInputUserData.CanStoreInputUserData())
10665 {
10666 vector m4[4];
10668
10669 EntityAI root = GetHierarchyRoot();
10670
10671 InventoryLocation dst = new InventoryLocation;
10673 {
10674 if (root)
10675 {
10676 root.GetTransform(m4);
10678 }
10679 else
10680 GetInventory().GetCurrentInventoryLocation(dst);
10681 }
10682 else
10683 {
10685
10686
10687 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10688 {
10689 if (root)
10690 {
10691 root.GetTransform(m4);
10693 }
10694 else
10695 GetInventory().GetCurrentInventoryLocation(dst);
10696 }
10697 else
10698 {
10699 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10700 }
10701 }
10702
10703 ScriptInputUserData ctx = new ScriptInputUserData;
10711 }
10712 }
10713 else if (!
GetGame().IsMultiplayer())
10714 {
10716 }
10717 }
10718 }
10719
10720 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10721 {
10722
10723 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10724 return false;
10725
10726 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10727 return false;
10728
10729
10731 return false;
10732
10733
10734 Magazine mag = Magazine.Cast(this);
10735 if (mag)
10736 {
10737 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10738 return false;
10739
10740 if (stack_max_limit)
10741 {
10742 Magazine other_mag = Magazine.Cast(other_item);
10743 if (other_item)
10744 {
10745 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10746 return false;
10747 }
10748
10749 }
10750 }
10751 else
10752 {
10753
10755 return false;
10756
10758 return false;
10759 }
10760
10761 PlayerBase player = null;
10762 if (CastTo(player, GetHierarchyRootPlayer()))
10763 {
10764 if (player.GetInventory().HasAttachment(this))
10765 return false;
10766
10767 if (player.IsItemsToDelete())
10768 return false;
10769 }
10770
10771 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10772 return false;
10773
10774 int slotID;
10776 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10777 return false;
10778
10779 return true;
10780 }
10781
10783 {
10785 }
10786
10788 {
10789 return m_IsResultOfSplit;
10790 }
10791
10793 {
10794 m_IsResultOfSplit = value;
10795 }
10796
10798 {
10800 }
10801
10803 {
10804 float other_item_quantity = other_item.GetQuantity();
10805 float this_free_space;
10806
10808
10810
10811 if (other_item_quantity > this_free_space)
10812 {
10813 return this_free_space;
10814 }
10815 else
10816 {
10817 return other_item_quantity;
10818 }
10819 }
10820
10822 {
10824 }
10825
10827 {
10829 return;
10830
10831 if (!IsMagazine() && other_item)
10832 {
10834 if (quantity_used != 0)
10835 {
10836 float hp1 = GetHealth01("","");
10837 float hp2 = other_item.GetHealth01("","");
10838 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10839 hpResult = hpResult / (
GetQuantity() + quantity_used);
10840
10841 hpResult *= GetMaxHealth();
10842 Math.Round(hpResult);
10843 SetHealth("", "Health", hpResult);
10844
10846 other_item.AddQuantity(-quantity_used);
10847 }
10848 }
10850 }
10851
10853 {
10854 #ifdef SERVER
10855 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10856 GetHierarchyParent().IncreaseLifetimeUp();
10857 #endif
10858 };
10859
10861 {
10862 PlayerBase p = PlayerBase.Cast(player);
10863
10864 array<int> recipesIds = p.m_Recipes;
10865 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10866 if (moduleRecipesManager)
10867 {
10868 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10869 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10870 }
10871
10872 for (int i = 0;i < recipesIds.Count(); i++)
10873 {
10874 int key = recipesIds.Get(i);
10875 string recipeName = moduleRecipesManager.GetRecipeName(key);
10877 }
10878 }
10879
10880
10881 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10882 {
10883 super.GetDebugActions(outputList);
10884
10885
10890
10891
10895
10899
10900
10903
10904
10906 {
10909 }
10910
10912
10915
10919 }
10920
10921
10922
10923
10925 {
10926 super.OnAction(action_id, player, ctx);
10927 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10928 {
10929 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10930 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10931 PlayerBase p = PlayerBase.Cast(player);
10932 if (
EActions.RECIPES_RANGE_START < 1000)
10933 {
10934 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10935 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10936 }
10937 }
10938 #ifndef SERVER
10939 else if (action_id ==
EActions.WATCH_PLAYER)
10940 {
10941 PluginDeveloper.SetDeveloperItemClientEx(player);
10942 }
10943 #endif
10945 {
10946 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10947 {
10948 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10949 OnDebugButtonPressServer(id + 1);
10950 }
10951
10952 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10953 {
10954 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10956 }
10957
10958 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10959 {
10960 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10962 }
10963
10964 else if (action_id ==
EActions.ADD_QUANTITY)
10965 {
10966 if (IsMagazine())
10967 {
10968 Magazine mag = Magazine.Cast(this);
10969 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10970 }
10971 else
10972 {
10974 }
10975
10976 if (m_EM)
10977 {
10978 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10979 }
10980
10981 }
10982
10983 else if (action_id ==
EActions.REMOVE_QUANTITY)
10984 {
10985 if (IsMagazine())
10986 {
10987 Magazine mag2 = Magazine.Cast(this);
10988 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10989 }
10990 else
10991 {
10993 }
10994 if (m_EM)
10995 {
10996 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10997 }
10998
10999 }
11000
11001 else if (action_id ==
EActions.SET_QUANTITY_0)
11002 {
11004
11005 if (m_EM)
11006 {
11007 m_EM.SetEnergy(0);
11008 }
11009 }
11010
11011 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11012 {
11014
11015 if (m_EM)
11016 {
11017 m_EM.SetEnergy(m_EM.GetEnergyMax());
11018 }
11019 }
11020
11021 else if (action_id ==
EActions.ADD_HEALTH)
11022 {
11023 AddHealth("","",GetMaxHealth("","Health")/5);
11024 }
11025 else if (action_id ==
EActions.REMOVE_HEALTH)
11026 {
11027 AddHealth("","",-GetMaxHealth("","Health")/5);
11028 }
11029 else if (action_id ==
EActions.DESTROY_HEALTH)
11030 {
11031 SetHealth01("","",0);
11032 }
11033 else if (action_id ==
EActions.WATCH_ITEM)
11034 {
11036 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11037 #ifdef DEVELOPER
11038 SetDebugDeveloper_item(this);
11039 #endif
11040 }
11041
11042 else if (action_id ==
EActions.ADD_TEMPERATURE)
11043 {
11044 AddTemperature(20);
11045
11046 }
11047
11048 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11049 {
11050 AddTemperature(-20);
11051
11052 }
11053
11054 else if (action_id ==
EActions.FLIP_FROZEN)
11055 {
11056 SetFrozen(!GetIsFrozen());
11057
11058 }
11059
11060 else if (action_id ==
EActions.ADD_WETNESS)
11061 {
11063
11064 }
11065
11066 else if (action_id ==
EActions.REMOVE_WETNESS)
11067 {
11069
11070 }
11071
11072 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11073 {
11076
11077
11078 }
11079
11080 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11081 {
11084 }
11085
11086 else if (action_id ==
EActions.MAKE_SPECIAL)
11087 {
11088 auto debugParams = DebugSpawnParams.WithPlayer(player);
11089 OnDebugSpawnEx(debugParams);
11090 }
11091
11092 else if (action_id ==
EActions.DELETE)
11093 {
11094 Delete();
11095 }
11096
11097 }
11098
11099
11100 return false;
11101 }
11102
11103
11104
11105
11109
11112
11113
11114
11116 {
11117 return false;
11118 }
11119
11120
11122 {
11123 return true;
11124 }
11125
11126
11128 {
11129 return true;
11130 }
11131
11132
11133
11135 {
11136 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11138 }
11139
11142 {
11143 return null;
11144 }
11145
11147 {
11148 return false;
11149 }
11150
11152 {
11153 return false;
11154 }
11155
11159
11160
11162 {
11163 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11164 return module_repairing.CanRepair(this, item_repair_kit);
11165 }
11166
11167
11168 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11169 {
11170 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11171 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11172 }
11173
11174
11176 {
11177
11178
11179
11180
11181
11182
11183
11184
11185 return 1;
11186 }
11187
11188
11189
11191 {
11193 }
11194
11195
11196
11198 {
11200 }
11201
11202
11211 {
11212 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11213
11214 if (player)
11215 {
11216 player.MessageStatus(text);
11217 }
11218 }
11219
11220
11229 {
11230 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11231
11232 if (player)
11233 {
11234 player.MessageAction(text);
11235 }
11236 }
11237
11238
11247 {
11248 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11249
11250 if (player)
11251 {
11252 player.MessageFriendly(text);
11253 }
11254 }
11255
11256
11265 {
11266 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11267
11268 if (player)
11269 {
11270 player.MessageImportant(text);
11271 }
11272 }
11273
11275 {
11276 return true;
11277 }
11278
11279
11280 override bool KindOf(
string tag)
11281 {
11282 bool found = false;
11283 string item_name = this.
GetType();
11286
11287 int array_size = item_tag_array.Count();
11288 for (int i = 0; i < array_size; i++)
11289 {
11290 if (item_tag_array.Get(i) == tag)
11291 {
11292 found = true;
11293 break;
11294 }
11295 }
11296 return found;
11297 }
11298
11299
11301 {
11302
11303 super.OnRPC(sender, rpc_type,ctx);
11304
11305
11306 switch (rpc_type)
11307 {
11308 #ifndef SERVER
11309 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11310 Param2<bool, string> p = new Param2<bool, string>(false, "");
11311
11313 return;
11314
11315 bool play = p.param1;
11316 string soundSet = p.param2;
11317
11318 if (play)
11319 {
11321 {
11323 {
11325 }
11326 }
11327 else
11328 {
11330 }
11331 }
11332 else
11333 {
11335 }
11336
11337 break;
11338 #endif
11339
11340 }
11341
11343 {
11345 }
11346 }
11347
11348
11349
11350
11352 {
11353 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11354 return plugin.GetID(
name);
11355 }
11356
11358 {
11359 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11360 return plugin.GetName(id);
11361 }
11362
11365 {
11366
11367
11368 int varFlags;
11369 if (!ctx.
Read(varFlags))
11370 return;
11371
11372 if (varFlags & ItemVariableFlags.FLOAT)
11373 {
11375 }
11376 }
11377
11379 {
11380
11381 super.SerializeNumericalVars(floats_out);
11382
11383
11384
11386 {
11388 }
11389
11391 {
11393 }
11394
11396 {
11398 }
11399
11401 {
11406 }
11407
11409 {
11411 }
11412 }
11413
11415 {
11416
11417 super.DeSerializeNumericalVars(floats);
11418
11419
11420 int index = 0;
11421 int mask = Math.Round(floats.Get(index));
11422
11423 index++;
11424
11426 {
11428 {
11430 }
11431 else
11432 {
11433 float quantity = floats.Get(index);
11434 SetQuantity(quantity,
true,
false,
false,
false);
11435 }
11436 index++;
11437 }
11438
11440 {
11441 float wet = floats.Get(index);
11443 index++;
11444 }
11445
11447 {
11448 int liquidtype = Math.Round(floats.Get(index));
11450 index++;
11451 }
11452
11454 {
11456 index++;
11458 index++;
11460 index++;
11462 index++;
11463 }
11464
11466 {
11467 int cleanness = Math.Round(floats.Get(index));
11469 index++;
11470 }
11471 }
11472
11474 {
11475 super.WriteVarsToCTX(ctx);
11476
11477
11479 {
11481 }
11482
11484 {
11486 }
11487
11489 {
11491 }
11492
11494 {
11495 int r,g,b,a;
11501 }
11502
11504 {
11506 }
11507 }
11508
11510 {
11511 if (!super.ReadVarsFromCTX(ctx,version))
11512 return false;
11513
11514 int intValue;
11515 float value;
11516
11517 if (version < 140)
11518 {
11519 if (!ctx.
Read(intValue))
11520 return false;
11521
11522 m_VariablesMask = intValue;
11523 }
11524
11526 {
11527 if (!ctx.
Read(value))
11528 return false;
11529
11531 {
11533 }
11534 else
11535 {
11537 }
11538 }
11539
11540 if (version < 140)
11541 {
11543 {
11544 if (!ctx.
Read(value))
11545 return false;
11546 SetTemperatureDirect(value);
11547 }
11548 }
11549
11551 {
11552 if (!ctx.
Read(value))
11553 return false;
11555 }
11556
11558 {
11559 if (!ctx.
Read(intValue))
11560 return false;
11562 }
11563
11565 {
11566 int r,g,b,a;
11568 return false;
11570 return false;
11572 return false;
11574 return false;
11575
11577 }
11578
11580 {
11581 if (!ctx.
Read(intValue))
11582 return false;
11584 }
11585
11586 if (version >= 138 && version < 140)
11587 {
11589 {
11590 if (!ctx.
Read(intValue))
11591 return false;
11592 SetFrozen(intValue);
11593 }
11594 }
11595
11596 return true;
11597 }
11598
11599
11601 {
11604 {
11606 }
11607
11608 if (!super.OnStoreLoad(ctx, version))
11609 {
11611 return false;
11612 }
11613
11614 if (version >= 114)
11615 {
11616 bool hasQuickBarIndexSaved;
11617
11618 if (!ctx.
Read(hasQuickBarIndexSaved))
11619 {
11621 return false;
11622 }
11623
11624 if (hasQuickBarIndexSaved)
11625 {
11626 int itmQBIndex;
11627
11628
11629 if (!ctx.
Read(itmQBIndex))
11630 {
11632 return false;
11633 }
11634
11635 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11636 if (itmQBIndex != -1 && parentPlayer)
11637 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11638 }
11639 }
11640 else
11641 {
11642
11643 PlayerBase player;
11644 int itemQBIndex;
11645 if (version ==
int.
MAX)
11646 {
11647 if (!ctx.
Read(itemQBIndex))
11648 {
11650 return false;
11651 }
11652 }
11653 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11654 {
11655
11656 if (!ctx.
Read(itemQBIndex))
11657 {
11659 return false;
11660 }
11661 if (itemQBIndex != -1 && player)
11662 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11663 }
11664 }
11665
11666 if (version < 140)
11667 {
11668
11669 if (!LoadVariables(ctx, version))
11670 {
11672 return false;
11673 }
11674 }
11675
11676
11678 {
11680 return false;
11681 }
11682 if (version >= 132)
11683 {
11685 if (raib)
11686 {
11688 {
11690 return false;
11691 }
11692 }
11693 }
11694
11696 return true;
11697 }
11698
11699
11700
11702 {
11703 super.OnStoreSave(ctx);
11704
11705 PlayerBase player;
11706 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11707 {
11709
11710 int itemQBIndex = -1;
11711 itemQBIndex = player.FindQuickBarEntityIndex(this);
11712 ctx.
Write(itemQBIndex);
11713 }
11714 else
11715 {
11717 }
11718
11720
11722 if (raib)
11723 {
11725 }
11726 }
11727
11728
11730 {
11731 super.AfterStoreLoad();
11732
11734 {
11736 }
11737
11739 {
11742 }
11743 }
11744
11746 {
11747 super.EEOnAfterLoad();
11748
11750 {
11752 }
11753
11756 }
11757
11759 {
11760 return false;
11761 }
11762
11763
11764
11766 {
11768 {
11769 #ifdef PLATFORM_CONSOLE
11770
11772 {
11774 if (menu)
11775 {
11777 }
11778 }
11779 #endif
11780 }
11781
11783 {
11786 }
11787
11789 {
11790 SetWeightDirty();
11792 }
11794 {
11797 }
11798
11800 {
11803 }
11805 {
11808 }
11809
11810 super.OnVariablesSynchronized();
11811 }
11812
11813
11814
11816 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11817 {
11818 if (!IsServerCheck(allow_client))
11819 return false;
11820
11822 return false;
11823
11826
11827 if (value <= (min + 0.001))
11828 value = min;
11829
11830 if (value == min)
11831 {
11832 if (destroy_config)
11833 {
11834 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11835 if (dstr)
11836 {
11838 this.Delete();
11839 return true;
11840 }
11841 }
11842 else if (destroy_forced)
11843 {
11845 this.Delete();
11846 return true;
11847 }
11848
11850 }
11851
11854
11856 {
11858
11859 if (delta)
11861 }
11862
11864
11865 return false;
11866 }
11867
11868
11870 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11871 {
11873 }
11874
11876 {
11879 }
11880
11882 {
11885 }
11886
11889 {
11890 float value_clamped = Math.Clamp(value, 0, 1);
11892 SetQuantity(result, destroy_config, destroy_forced);
11893 }
11894
11895
11898 {
11900 }
11901
11903 {
11905 }
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11917 {
11918 int slot = -1;
11919 if (GetInventory())
11920 {
11921 InventoryLocation il = new InventoryLocation;
11922 GetInventory().GetCurrentInventoryLocation(il);
11924 }
11925
11927 }
11928
11930 {
11931 float quantity_max = 0;
11932
11934 {
11935 if (attSlotID != -1)
11936 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11937
11938 if (quantity_max <= 0)
11940 }
11941
11942 if (quantity_max <= 0)
11944
11945 return quantity_max;
11946 }
11947
11949 {
11951 }
11952
11954 {
11956 }
11957
11958
11960 {
11962 }
11963
11965 {
11967 }
11968
11970 {
11972 }
11973
11974
11976 {
11977
11978 float weightEx = GetWeightEx();
11979 float special = GetInventoryAndCargoWeight();
11980 return weightEx - special;
11981 }
11982
11983
11985 {
11987 }
11988
11990 {
11992 {
11993 #ifdef DEVELOPER
11994 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11995 {
11996 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11998 }
11999 #endif
12000
12001 return GetQuantity() * GetConfigWeightModified();
12002 }
12003 else if (HasEnergyManager())
12004 {
12005 #ifdef DEVELOPER
12006 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12007 {
12008 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12009 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12010 }
12011 #endif
12012 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12013 }
12014 else
12015 {
12016 #ifdef DEVELOPER
12017 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12018 {
12019 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12020 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12021 }
12022 #endif
12023 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12024 }
12025 }
12026
12029 {
12030 int item_count = 0;
12032
12033 if (GetInventory().GetCargo() != NULL)
12034 {
12035 item_count = GetInventory().GetCargo().GetItemCount();
12036 }
12037
12038 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12039 {
12040 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12041 if (item)
12042 item_count += item.GetNumberOfItems();
12043 }
12044 return item_count;
12045 }
12046
12049 {
12050 float weight = 0;
12051 float wetness = 1;
12052 if (include_wetness)
12055 {
12056 weight = wetness * m_ConfigWeight;
12057 }
12059 {
12060 weight = 1;
12061 }
12062 return weight;
12063 }
12064
12065
12066
12068 {
12069 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12070 {
12071 GameInventory inv = GetInventory();
12072 array<EntityAI> items = new array<EntityAI>;
12074 for (int i = 0; i < items.Count(); i++)
12075 {
12077 if (item)
12078 {
12080 }
12081 }
12082 }
12083 }
12084
12085
12086
12087
12089 {
12090 float energy = 0;
12091 if (HasEnergyManager())
12092 {
12093 energy = GetCompEM().GetEnergy();
12094 }
12095 return energy;
12096 }
12097
12098
12100 {
12101 super.OnEnergyConsumed();
12102
12104 }
12105
12107 {
12108 super.OnEnergyAdded();
12109
12111 }
12112
12113
12115 {
12116 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12117 {
12119 {
12120 float energy_0to1 = GetCompEM().GetEnergy0To1();
12122 }
12123 }
12124 }
12125
12126
12128 {
12129 return ConfigGetFloat("heatIsolation");
12130 }
12131
12133 {
12135 }
12136
12138 {
12139 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12140 if (
GetGame().ConfigIsExisting(paramPath))
12142
12143 return 0.0;
12144 }
12145
12147 {
12148 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12149 if (
GetGame().ConfigIsExisting(paramPath))
12151
12152 return 0.0;
12153 }
12154
12155 override void SetWet(
float value,
bool allow_client =
false)
12156 {
12157 if (!IsServerCheck(allow_client))
12158 return;
12159
12162
12164
12165 m_VarWet = Math.Clamp(value, min, max);
12166
12168 {
12171 }
12172 }
12173
12174 override void AddWet(
float value)
12175 {
12177 }
12178
12180 {
12182 }
12183
12185 {
12187 }
12188
12190 {
12192 }
12193
12195 {
12197 }
12198
12200 {
12202 }
12203
12204 override void OnWetChanged(
float newVal,
float oldVal)
12205 {
12208 if (newLevel != oldLevel)
12209 {
12211 }
12212 }
12213
12215 {
12216 SetWeightDirty();
12217 }
12218
12220 {
12221 return GetWetLevelInternal(
m_VarWet);
12222 }
12223
12224
12225
12227 {
12229 }
12230
12232 {
12234 }
12235
12237 {
12239 }
12240
12242 {
12244 }
12245
12246
12247
12249 {
12250 if (ConfigIsExisting("itemModelLength"))
12251 {
12252 return ConfigGetFloat("itemModelLength");
12253 }
12254 return 0;
12255 }
12256
12258 {
12259 if (ConfigIsExisting("itemAttachOffset"))
12260 {
12261 return ConfigGetFloat("itemAttachOffset");
12262 }
12263 return 0;
12264 }
12265
12266 override void SetCleanness(
int value,
bool allow_client =
false)
12267 {
12268 if (!IsServerCheck(allow_client))
12269 return;
12270
12272
12274
12277 }
12278
12280 {
12282 }
12283
12285 {
12286 return true;
12287 }
12288
12289
12290
12291
12293 {
12295 }
12296
12298 {
12300 }
12301
12302
12303
12304
12305 override void SetColor(
int r,
int g,
int b,
int a)
12306 {
12312 }
12314 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12315 {
12320 }
12321
12323 {
12325 }
12326
12329 {
12330 int r,g,b,a;
12332 r = r/255;
12333 g = g/255;
12334 b = b/255;
12335 a = a/255;
12336 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12337 }
12338
12339
12340
12341 override void SetLiquidType(
int value,
bool allow_client =
false)
12342 {
12343 if (!IsServerCheck(allow_client))
12344 return;
12345
12350 }
12351
12353 {
12354 return ConfigGetInt("varLiquidTypeInit");
12355 }
12356
12358 {
12360 }
12361
12363 {
12365 SetFrozen(false);
12366 }
12367
12370 {
12371 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12372 }
12373
12374
12377 {
12378 PlayerBase nplayer;
12379 if (PlayerBase.CastTo(nplayer, player))
12380 {
12382
12383 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12384 }
12385 }
12386
12387
12390 {
12391 PlayerBase nplayer;
12392 if (PlayerBase.CastTo(nplayer,player))
12393 {
12394
12395 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12396
12397 }
12398
12399
12400 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12401
12402
12403 if (HasEnergyManager())
12404 {
12405 GetCompEM().UpdatePlugState();
12406 }
12407 }
12408
12409
12411 {
12412 super.OnPlacementStarted(player);
12413
12415 }
12416
12417 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12418 {
12420 {
12421 m_AdminLog.OnPlacementComplete(player,
this);
12422 }
12423
12424 super.OnPlacementComplete(player, position, orientation);
12425 }
12426
12427
12428
12429
12430
12432 {
12434 {
12435 return true;
12436 }
12437 else
12438 {
12439 return false;
12440 }
12441 }
12442
12443
12445 {
12447 {
12449 }
12450 }
12451
12452
12454 {
12456 }
12457
12459 {
12461 }
12462
12463 override void InsertAgent(
int agent,
float count = 1)
12464 {
12465 if (count < 1)
12466 return;
12467
12469 }
12470
12473 {
12475 }
12476
12477
12479 {
12481 }
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12525 {
12527 return false;
12528 return true;
12529 }
12530
12532 {
12533
12535 }
12536
12537
12540 {
12541 super.CheckForRoofLimited(timeTresholdMS);
12542
12544 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12545 {
12546 m_PreviousRoofTestTime = time;
12547 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12548 }
12549 }
12550
12551
12553 {
12555 {
12556 return 0;
12557 }
12558
12559 if (GetInventory().GetAttachmentSlotsCount() != 0)
12560 {
12561 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12562 if (filter)
12563 return filter.GetProtectionLevel(type, false, system);
12564 else
12565 return 0;
12566 }
12567
12568 string subclassPath, entryName;
12569
12570 switch (type)
12571 {
12573 entryName = "biological";
12574 break;
12576 entryName = "chemical";
12577 break;
12578 default:
12579 entryName = "biological";
12580 break;
12581 }
12582
12583 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12584
12586 }
12587
12588
12589
12592 {
12593 if (!IsMagazine())
12595
12597 }
12598
12599
12600
12601
12602
12607 {
12608 return true;
12609 }
12610
12612 {
12614 }
12615
12616
12617
12618
12619
12621 {
12622 if (parent)
12623 {
12624 if (parent.IsInherited(DayZInfected))
12625 return true;
12626
12627 if (!parent.IsRuined())
12628 return true;
12629 }
12630
12631 return true;
12632 }
12633
12635 {
12636 if (!super.CanPutAsAttachment(parent))
12637 {
12638 return false;
12639 }
12640
12641 if (!IsRuined() && !parent.IsRuined())
12642 {
12643 return true;
12644 }
12645
12646 return false;
12647 }
12648
12650 {
12651
12652
12653
12654
12655 return super.CanReceiveItemIntoCargo(item);
12656 }
12657
12659 {
12660
12661
12662
12663
12664 GameInventory attachmentInv = attachment.GetInventory();
12666 {
12667 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12668 return false;
12669 }
12670
12671 InventoryLocation loc = new InventoryLocation();
12672 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12673 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12674 return false;
12675
12676 return super.CanReceiveAttachment(attachment, slotId);
12677 }
12678
12680 {
12681 if (!super.CanReleaseAttachment(attachment))
12682 return false;
12683
12684 return GetInventory().AreChildrenAccessible();
12685 }
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12708 {
12709 int id = muzzle_owner.GetMuzzleID();
12710 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12711
12712 if (WPOF_array)
12713 {
12714 for (int i = 0; i < WPOF_array.Count(); i++)
12715 {
12716 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12717
12718 if (WPOF)
12719 {
12720 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12721 }
12722 }
12723 }
12724 }
12725
12726
12728 {
12729 int id = muzzle_owner.GetMuzzleID();
12731
12732 if (WPOBE_array)
12733 {
12734 for (int i = 0; i < WPOBE_array.Count(); i++)
12735 {
12736 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12737
12738 if (WPOBE)
12739 {
12740 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12741 }
12742 }
12743 }
12744 }
12745
12746
12748 {
12749 int id = muzzle_owner.GetMuzzleID();
12750 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12751
12752 if (WPOOH_array)
12753 {
12754 for (int i = 0; i < WPOOH_array.Count(); i++)
12755 {
12756 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12757
12758 if (WPOOH)
12759 {
12760 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12761 }
12762 }
12763 }
12764 }
12765
12766
12768 {
12769 int id = muzzle_owner.GetMuzzleID();
12770 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12771
12772 if (WPOOH_array)
12773 {
12774 for (int i = 0; i < WPOOH_array.Count(); i++)
12775 {
12776 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12777
12778 if (WPOOH)
12779 {
12780 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12781 }
12782 }
12783 }
12784 }
12785
12786
12788 {
12789 int id = muzzle_owner.GetMuzzleID();
12790 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12791
12792 if (WPOOH_array)
12793 {
12794 for (int i = 0; i < WPOOH_array.Count(); i++)
12795 {
12796 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12797
12798 if (WPOOH)
12799 {
12800 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12801 }
12802 }
12803 }
12804 }
12805
12806
12807
12809 {
12811 {
12812 return true;
12813 }
12814
12815 return false;
12816 }
12817
12819 {
12821 {
12822 return true;
12823 }
12824
12825 return false;
12826 }
12827
12829 {
12831 {
12832 return true;
12833 }
12834
12835 return false;
12836 }
12837
12839 {
12840 return false;
12841 }
12842
12845 {
12846 return UATimeSpent.DEFAULT_DEPLOY;
12847 }
12848
12849
12850
12851
12853 {
12855 SetSynchDirty();
12856 }
12857
12859 {
12861 }
12862
12863
12865 {
12866 return false;
12867 }
12868
12871 {
12872 string att_type = "None";
12873
12874 if (ConfigIsExisting("soundAttType"))
12875 {
12876 att_type = ConfigGetString("soundAttType");
12877 }
12878
12880 }
12881
12883 {
12885 }
12886
12887
12888
12889
12890
12894
12896 {
12899
12901 }
12902
12903
12905 {
12907 return;
12908
12910
12913
12916
12917 SoundParameters params = new SoundParameters();
12921 }
12922
12923
12925 {
12927 return;
12928
12930 SetSynchDirty();
12931
12934 }
12935
12936
12938 {
12940 return;
12941
12943 SetSynchDirty();
12944
12947 }
12948
12950 {
12952 }
12953
12955 {
12957 }
12958
12961 {
12962 if (!
GetGame().IsDedicatedServer())
12963 {
12964 if (ConfigIsExisting("attachSoundSet"))
12965 {
12966 string cfg_path = "";
12967 string soundset = "";
12968 string type_name =
GetType();
12969
12972 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12973 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12974
12975 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12976 {
12977 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12978 {
12979 if (cfg_slot_array[i] == slot_type)
12980 {
12981 soundset = cfg_soundset_array[i];
12982 break;
12983 }
12984 }
12985 }
12986
12987 if (soundset != "")
12988 {
12989 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12991 }
12992 }
12993 }
12994 }
12995
12997 {
12998
12999 }
13000
13001 void OnApply(PlayerBase player);
13002
13004 {
13005 return 1.0;
13006 };
13007
13009 {
13011 }
13012
13014 {
13016 }
13017
13019
13021 {
13022 SetDynamicPhysicsLifeTime(0.01);
13024 }
13025
13027 {
13028 array<string> zone_names = new array<string>;
13029 GetDamageZones(zone_names);
13030 for (int i = 0; i < zone_names.Count(); i++)
13031 {
13032 SetHealthMax(zone_names.Get(i),"Health");
13033 }
13034 SetHealthMax("","Health");
13035 }
13036
13039 {
13040 float global_health = GetHealth01("","Health");
13041 array<string> zones = new array<string>;
13042 GetDamageZones(zones);
13043
13044 for (int i = 0; i < zones.Count(); i++)
13045 {
13046 SetHealth01(zones.Get(i),"Health",global_health);
13047 }
13048 }
13049
13052 {
13053 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13054 }
13055
13057 {
13058 if (!hasRootAsPlayer)
13059 {
13060 if (refParentIB)
13061 {
13062
13063 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13064 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13065
13066 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13067 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13068
13071 }
13072 else
13073 {
13074
13077 }
13078 }
13079 }
13080
13082 {
13084 {
13085 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13086 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13087 {
13088 float heatPermCoef = 1.0;
13090 while (ent)
13091 {
13092 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13093 ent = ent.GetHierarchyParent();
13094 }
13095
13096 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13097 }
13098 }
13099 }
13100
13102 {
13103
13104 EntityAI parent = GetHierarchyParent();
13105 if (!parent)
13106 {
13107 hasParent = false;
13108 hasRootAsPlayer = false;
13109 }
13110 else
13111 {
13112 hasParent = true;
13113 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13114 refParentIB =
ItemBase.Cast(parent);
13115 }
13116 }
13117
13118 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13119 {
13120
13121 }
13122
13124 {
13125
13126 return false;
13127 }
13128
13130 {
13131
13132
13133 return false;
13134 }
13135
13137 {
13138
13139 return false;
13140 }
13141
13144 {
13145 return !GetIsFrozen() &&
IsOpen();
13146 }
13147
13149 {
13150 bool hasParent = false, hasRootAsPlayer = false;
13152
13153 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13154 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13155
13156 if (wwtu || foodDecay)
13157 {
13161
13162 if (processWetness || processTemperature || processDecay)
13163 {
13165
13166 if (processWetness)
13167 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13168
13169 if (processTemperature)
13171
13172 if (processDecay)
13173 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13174 }
13175 }
13176 }
13177
13180 {
13182 }
13183
13185 {
13188
13189 return super.GetTemperatureFreezeThreshold();
13190 }
13191
13193 {
13196
13197 return super.GetTemperatureThawThreshold();
13198 }
13199
13201 {
13204
13205 return super.GetItemOverheatThreshold();
13206 }
13207
13209 {
13211 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13212
13213 return super.GetTemperatureFreezeTime();
13214 }
13215
13217 {
13219 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13220
13221 return super.GetTemperatureThawTime();
13222 }
13223
13228
13230 {
13231 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13232 }
13233
13235 {
13236 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13237 }
13238
13241 {
13243 }
13244
13246 {
13248 }
13249
13251 {
13253 }
13254
13257 {
13258 return null;
13259 }
13260
13263 {
13264 return false;
13265 }
13266
13268 {
13270 {
13273 if (!trg)
13274 {
13276 explosive = this;
13277 }
13278
13279 explosive.PairRemote(trg);
13281
13282 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13283 trg.SetPersistentPairID(persistentID);
13284 explosive.SetPersistentPairID(persistentID);
13285
13286 return true;
13287 }
13288 return false;
13289 }
13290
13293 {
13294 float ret = 1.0;
13297 ret *= GetHealth01();
13298
13299 return ret;
13300 }
13301
13302 #ifdef DEVELOPER
13303 override void SetDebugItem()
13304 {
13305 super.SetDebugItem();
13306 _itemBase = this;
13307 }
13308
13310 {
13311 string text = super.GetDebugText();
13312
13314 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13315
13316 return text;
13317 }
13318 #endif
13319
13321 {
13322 return true;
13323 }
13324
13326
13328
13330 {
13333 }
13334
13335
13343
13359}
13360
13362{
13364 if (entity)
13365 {
13366 bool is_item = entity.IsInherited(
ItemBase);
13367 if (is_item && full_quantity)
13368 {
13371 }
13372 }
13373 else
13374 {
13376 return NULL;
13377 }
13378 return entity;
13379}
13380
13382{
13383 if (item)
13384 {
13385 if (health > 0)
13386 item.SetHealth("", "", health);
13387
13388 if (item.CanHaveTemperature())
13389 {
13391 if (item.CanFreeze())
13392 item.SetFrozen(false);
13393 }
13394
13395 if (item.HasEnergyManager())
13396 {
13397 if (quantity >= 0)
13398 {
13399 item.GetCompEM().SetEnergy0To1(quantity);
13400 }
13401 else
13402 {
13404 }
13405 }
13406 else if (item.IsMagazine())
13407 {
13408 Magazine mag = Magazine.Cast(item);
13409 if (quantity >= 0)
13410 {
13411 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13412 }
13413 else
13414 {
13416 }
13417
13418 }
13419 else
13420 {
13421 if (quantity >= 0)
13422 {
13423 item.SetQuantityNormalized(quantity, false);
13424 }
13425 else
13426 {
13428 }
13429
13430 }
13431 }
13432}
13433
13434#ifdef DEVELOPER
13436#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.