8638{
8640 {
8641 return true;
8642 }
8643};
8644
8645
8646
8648{
8652
8654
8657
8658
8659
8660
8661
8670
8676
8681
8686
8707 protected bool m_IsResultOfSplit
8708
8710
8715
8716
8717
8719
8723
8724
8725
8727
8730
8731
8732
8738
8739
8747
8750
8751
8753
8754
8756
8757
8762
8763
8768
8769
8771
8772
8774 {
8779
8780 if (!
GetGame().IsDedicatedServer())
8781 {
8783 {
8785
8787 {
8789 }
8790 }
8791
8794 }
8795
8796 m_OldLocation = null;
8797
8799 {
8801 }
8802
8803 if (ConfigIsExisting("headSelectionsToHide"))
8804 {
8807 }
8808
8810 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8811 {
8813 }
8814
8816
8817 m_IsResultOfSplit = false;
8818
8820 }
8821
8823 {
8824 super.InitItemVariables();
8825
8831 m_Count = ConfigGetInt(
"count");
8832
8835
8840
8843
8848
8860
8864
8865
8868 if (ConfigIsExisting("canBeSplit"))
8869 {
8872 }
8873
8875 if (ConfigIsExisting("itemBehaviour"))
8877
8878
8881 RegisterNetSyncVariableInt("m_VarLiquidType");
8882 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8883
8884 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8885 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8886 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8887
8888 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8889 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8890 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8891 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8892
8893 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8894 RegisterNetSyncVariableBool("m_IsTakeable");
8895 RegisterNetSyncVariableBool("m_IsHologram");
8896
8899 {
8902 }
8903
8905
8907 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8909
8910 }
8911
8913 {
8915 }
8916
8918 {
8921 {
8926 }
8927 }
8928
8929 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8930 {
8932 {
8935 }
8936
8938 }
8939
8941 {
8947 }
8948
8950
8952 {
8954
8955 if (!action)
8956 {
8957 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8958 return;
8959 }
8960
8962 if (!ai)
8963 {
8965 return;
8966 }
8967
8969 if (!action_array)
8970 {
8971 action_array = new array<ActionBase_Basic>;
8973 }
8974 if (LogManager.IsActionLogEnable())
8975 {
8976 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8977 }
8978
8979 if (action_array.Find(action) != -1)
8980 {
8981 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8982 }
8983 else
8984 {
8985 action_array.Insert(action);
8986 }
8987 }
8988
8990 {
8992 ActionBase action = player.GetActionManager().GetAction(actionName);
8995
8996 if (action_array)
8997 {
8998 action_array.RemoveItem(action);
8999 }
9000 }
9001
9002
9003
9005 {
9006 ActionOverrideData overrideData = new ActionOverrideData();
9010
9012 if (!actionMap)
9013 {
9016 }
9017
9018 actionMap.Insert(this.
Type(), overrideData);
9019
9020 }
9021
9023
9025
9026
9028 {
9031
9034
9035 string config_to_search = "CfgVehicles";
9036 string muzzle_owner_config;
9037
9039 {
9040 if (IsInherited(Weapon))
9041 config_to_search = "CfgWeapons";
9042
9043 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9044
9045 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9046
9048
9049 if (config_OnFire_subclass_count > 0)
9050 {
9051 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9052
9053 for (int i = 0; i < config_OnFire_subclass_count; i++)
9054 {
9055 string particle_class = "";
9057 string config_OnFire_entry = config_OnFire_class + particle_class;
9058 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9059 WPOF_array.Insert(WPOF);
9060 }
9061
9062
9064 }
9065 }
9066
9068 {
9069 config_to_search = "CfgWeapons";
9070 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9071
9072 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9073
9075
9076 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9077 {
9078 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9079
9080 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9081 {
9082 string particle_class2 = "";
9084 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9085 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9086 WPOBE_array.Insert(WPOBE);
9087 }
9088
9089
9091 }
9092 }
9093 }
9094
9095
9097 {
9100
9102 {
9103 string config_to_search = "CfgVehicles";
9104
9105 if (IsInherited(Weapon))
9106 config_to_search = "CfgWeapons";
9107
9108 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9109 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9110
9111 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9112 {
9113
9115
9117 {
9119 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9121 return;
9122 }
9123
9126
9127
9128
9130 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9131
9132 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9133 {
9134 string particle_class = "";
9136 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9138
9139 if (entry_type == CT_CLASS)
9140 {
9141 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9142 WPOOH_array.Insert(WPOF);
9143 }
9144 }
9145
9146
9148 }
9149 }
9150 }
9151
9153 {
9155 }
9156
9158 {
9160 {
9162
9165
9168
9169 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9170 }
9171 }
9172
9174 {
9176 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9177
9179 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9180
9182 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9183
9185 {
9187 }
9188 }
9189
9191 {
9193 }
9194
9196 {
9199 else
9201
9203 {
9206 }
9207 else
9208 {
9211
9214 }
9215
9217 }
9218
9220 {
9222 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9223 }
9224
9226 {
9228 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9230 }
9231
9233 {
9235 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9236 }
9237
9239 {
9242
9243 OverheatingParticle OP = new OverheatingParticle();
9248
9250 }
9251
9253 {
9256
9257 return -1;
9258 }
9259
9261 {
9263 {
9266
9267 for (int i = count; i > 0; --i)
9268 {
9269 int id = i - 1;
9272
9275
9276 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9277 {
9278 if (p)
9279 {
9282 }
9283 }
9284 }
9285 }
9286 }
9287
9289 {
9291 {
9293 {
9294 int id = i - 1;
9296
9297 if (OP)
9298 {
9300
9301 if (p)
9302 {
9304 }
9305
9306 delete OP;
9307 }
9308 }
9309
9312 }
9313 }
9314
9317 {
9318 return 0.0;
9319 }
9320
9321
9323 {
9324 return 250;
9325 }
9326
9328 {
9329 return 0;
9330 }
9331
9334 {
9336 return true;
9337
9338 return false;
9339 }
9340
9343 {
9346
9348 {
9350 }
9351 else
9352 {
9353
9355 }
9356
9358 }
9359
9366 {
9367 return -1;
9368 }
9369
9370
9371
9372
9374 {
9376 {
9378 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9379
9380 if (r_index >= 0)
9381 {
9382 InventoryLocation r_il = new InventoryLocation;
9383 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9384
9385 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9388 {
9389 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9390 }
9392 {
9393 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9394 }
9395
9396 }
9397
9398 player.GetHumanInventory().ClearUserReservedLocation(this);
9399 }
9400
9403 }
9404
9405
9406
9407
9409 {
9410 return ItemBase.m_DebugActionsMask;
9411 }
9412
9414 {
9415 return ItemBase.m_DebugActionsMask & mask;
9416 }
9417
9419 {
9420 ItemBase.m_DebugActionsMask = mask;
9421 }
9422
9424 {
9425 ItemBase.m_DebugActionsMask |= mask;
9426 }
9427
9429 {
9430 ItemBase.m_DebugActionsMask &= ~mask;
9431 }
9432
9434 {
9436 {
9438 }
9439 else
9440 {
9442 }
9443 }
9444
9445
9447 {
9448 if (GetEconomyProfile())
9449 {
9450 float q_max = GetEconomyProfile().GetQuantityMax();
9451 if (q_max > 0)
9452 {
9453 float q_min = GetEconomyProfile().GetQuantityMin();
9454 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9455
9457 {
9458 ComponentEnergyManager comp = GetCompEM();
9460 {
9462 }
9463 }
9465 {
9467
9468 }
9469
9470 }
9471 }
9472 }
9473
9476 {
9477 EntityAI parent = GetHierarchyParent();
9478
9479 if (parent)
9480 {
9481 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9482 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9483 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9484 }
9485 }
9486
9489 {
9490 EntityAI parent = GetHierarchyParent();
9491
9492 if (parent)
9493 {
9494 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9495 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9496 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9497 }
9498 }
9499
9501 {
9502
9503
9504
9505
9507
9509 {
9510 if (ScriptInputUserData.CanStoreInputUserData())
9511 {
9512 ScriptInputUserData ctx = new ScriptInputUserData;
9518 ctx.
Write(use_stack_max);
9521
9523 {
9524 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9525 }
9526 }
9527 }
9528 else if (!
GetGame().IsMultiplayer())
9529 {
9531 }
9532 }
9533
9535 {
9537 }
9538
9540 {
9542 }
9543
9545 {
9547 }
9548
9550 {
9551
9552 return false;
9553 }
9554
9556 {
9557 return false;
9558 }
9559
9563 {
9564 return false;
9565 }
9566
9568 {
9569 return "";
9570 }
9571
9573
9575 {
9576 return false;
9577 }
9578
9580 {
9581 return true;
9582 }
9583
9584
9585
9587 {
9588 return true;
9589 }
9590
9592 {
9593 return true;
9594 }
9595
9597 {
9598 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9600 }
9601
9603 {
9605 }
9606
9608 {
9610 if (!is_being_placed)
9612 SetSynchDirty();
9613 }
9614
9615
9617
9619 {
9621 }
9622
9624 {
9626 }
9627
9629 {
9630 return 1;
9631 }
9632
9634 {
9635 return false;
9636 }
9637
9639 {
9641 SetSynchDirty();
9642 }
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9679 {
9680 super.OnMovedInsideCargo(container);
9681
9682 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9683 }
9684
9685 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9686 {
9687 super.EEItemLocationChanged(oldLoc,newLoc);
9688
9689 PlayerBase new_player = null;
9690 PlayerBase old_player = null;
9691
9692 if (newLoc.GetParent())
9693 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9694
9695 if (oldLoc.GetParent())
9696 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9697
9699 {
9700 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9701
9702 if (r_index >= 0)
9703 {
9704 InventoryLocation r_il = new InventoryLocation;
9705 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9706
9707 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9710 {
9711 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9712 }
9714 {
9715 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9716 }
9717
9718 }
9719 }
9720
9722 {
9723 if (new_player)
9724 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9725
9726 if (new_player == old_player)
9727 {
9728
9729 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9730 {
9732 {
9733 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9734 {
9735 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9736 }
9737 }
9738 else
9739 {
9740 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9741 }
9742 }
9743
9744 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9745 {
9746 int type = oldLoc.GetType();
9748 {
9749 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9750 }
9752 {
9753 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9754 }
9755 }
9756 if (!m_OldLocation)
9757 {
9758 m_OldLocation = new InventoryLocation;
9759 }
9760 m_OldLocation.Copy(oldLoc);
9761 }
9762 else
9763 {
9764 if (m_OldLocation)
9765 {
9766 m_OldLocation.Reset();
9767 }
9768 }
9769
9771 }
9772 else
9773 {
9774 if (new_player)
9775 {
9776 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9777 if (res_index >= 0)
9778 {
9779 InventoryLocation il = new InventoryLocation;
9780 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9782 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9785 {
9786 il.
GetParent().GetOnReleaseLock().Invoke(it);
9787 }
9789 {
9791 }
9792
9793 }
9794 }
9796 {
9797
9799 }
9800
9801 if (m_OldLocation)
9802 {
9803 m_OldLocation.Reset();
9804 }
9805 }
9806 }
9807
9808 override void EOnContact(IEntity other, Contact extra)
9809 {
9811 {
9812 int liquidType = -1;
9814 if (impactSpeed > 0.0)
9815 {
9817 #ifndef SERVER
9819 #else
9821 SetSynchDirty();
9822 #endif
9824 }
9825 }
9826
9827 #ifdef SERVER
9828 if (GetCompEM() && GetCompEM().IsPlugged())
9829 {
9830 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9831 GetCompEM().UnplugThis();
9832 }
9833 #endif
9834 }
9835
9837
9839 {
9841 }
9842
9844 {
9845
9846 }
9847
9849 {
9850 super.OnItemLocationChanged(old_owner, new_owner);
9851
9852 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9853 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9854
9855 if (!relatedPlayer && playerNew)
9856 relatedPlayer = playerNew;
9857
9858 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9859 {
9861 if (actionMgr)
9862 {
9863 ActionBase currentAction = actionMgr.GetRunningAction();
9864 if (currentAction)
9866 }
9867 }
9868
9869 Man ownerPlayerOld = null;
9870 Man ownerPlayerNew = null;
9871
9872 if (old_owner)
9873 {
9874 if (old_owner.
IsMan())
9875 {
9876 ownerPlayerOld = Man.Cast(old_owner);
9877 }
9878 else
9879 {
9880 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9881 }
9882 }
9883 else
9884 {
9886 {
9888
9889 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9890 {
9891 GetCompEM().UnplugThis();
9892 }
9893 }
9894 }
9895
9896 if (new_owner)
9897 {
9898 if (new_owner.
IsMan())
9899 {
9900 ownerPlayerNew = Man.Cast(new_owner);
9901 }
9902 else
9903 {
9904 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9905 }
9906 }
9907
9908 if (ownerPlayerOld != ownerPlayerNew)
9909 {
9910 if (ownerPlayerOld)
9911 {
9912 array<EntityAI> subItemsExit = new array<EntityAI>;
9914 for (int i = 0; i < subItemsExit.Count(); i++)
9915 {
9918 }
9919 }
9920
9921 if (ownerPlayerNew)
9922 {
9923 array<EntityAI> subItemsEnter = new array<EntityAI>;
9925 for (int j = 0; j < subItemsEnter.Count(); j++)
9926 {
9929 }
9930 }
9931 }
9932 else if (ownerPlayerNew != null)
9933 {
9934 PlayerBase nplayer;
9935 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9936 {
9937 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9939 for (int k = 0; k < subItemsUpdate.Count(); k++)
9940 {
9942 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9943 }
9944 }
9945 }
9946
9947 if (old_owner)
9948 old_owner.OnChildItemRemoved(this);
9949 if (new_owner)
9950 new_owner.OnChildItemReceived(this);
9951 }
9952
9953
9955 {
9956 super.EEDelete(parent);
9957 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9958 if (player)
9959 {
9961
9962 if (player.IsAlive())
9963 {
9964 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9965 if (r_index >= 0)
9966 {
9967 InventoryLocation r_il = new InventoryLocation;
9968 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9969
9970 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9973 {
9974 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9975 }
9977 {
9978 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9979 }
9980
9981 }
9982
9983 player.RemoveQuickBarEntityShortcut(this);
9984 }
9985 }
9986 }
9987
9989 {
9990 super.EEKilled(killer);
9991
9994 {
9995 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9996 {
9997 if (IsMagazine())
9998 {
9999 if (Magazine.Cast(this).GetAmmoCount() > 0)
10000 {
10002 }
10003 }
10004 else
10005 {
10007 }
10008 }
10009 }
10010 }
10011
10013 {
10014 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10015
10016 super.OnWasAttached(parent, slot_id);
10017
10020
10022 }
10023
10025 {
10026 super.OnWasDetached(parent, slot_id);
10027
10030 }
10031
10033 {
10034 int idx;
10037
10038 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10039 if (inventory_slots.Count() < 1)
10040 {
10041 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10042 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10043 }
10044 else
10045 {
10046 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10047 }
10048
10049 idx = inventory_slots.Find(slot);
10050 if (idx < 0)
10051 return "";
10052
10053 return attach_types.Get(idx);
10054 }
10055
10057 {
10058 int idx = -1;
10059 string slot;
10060
10063
10064 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10065 if (inventory_slots.Count() < 1)
10066 {
10067 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10068 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10069 }
10070 else
10071 {
10072 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10073 if (detach_types.Count() < 1)
10074 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10075 }
10076
10077 for (int i = 0; i < inventory_slots.Count(); i++)
10078 {
10079 slot = inventory_slots.Get(i);
10080 }
10081
10082 if (slot != "")
10083 {
10084 if (detach_types.Count() == 1)
10085 idx = 0;
10086 else
10087 idx = inventory_slots.Find(slot);
10088 }
10089 if (idx < 0)
10090 return "";
10091
10092 return detach_types.Get(idx);
10093 }
10094
10096 {
10097
10099
10100
10101 float min_time = 1;
10102 float max_time = 3;
10103 float delay = Math.RandomFloat(min_time, max_time);
10104
10105 explode_timer.Run(delay, this, "DoAmmoExplosion");
10106 }
10107
10109 {
10110 Magazine magazine = Magazine.Cast(this);
10111 int pop_sounds_count = 6;
10112 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10113
10114
10115 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10116 string sound_name = pop_sounds[ sound_idx ];
10118
10119
10120 magazine.ServerAddAmmoCount(-1);
10121
10122
10123 float min_temp_to_explode = 100;
10124
10125 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10126 {
10128 }
10129 }
10130
10131
10132 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10133 {
10134 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10135
10136 const int CHANCE_DAMAGE_CARGO = 4;
10137 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10138 const int CHANCE_DAMAGE_NOTHING = 2;
10139
10141 {
10142 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10143 int chances;
10144 int rnd;
10145
10146 if (GetInventory().GetCargo())
10147 {
10148 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10149 rnd = Math.RandomInt(0,chances);
10150
10151 if (rnd < CHANCE_DAMAGE_CARGO)
10152 {
10154 }
10155 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10156 {
10158 }
10159 }
10160 else
10161 {
10162 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10163 rnd = Math.RandomInt(0,chances);
10164
10165 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10166 {
10168 }
10169 }
10170 }
10171 }
10172
10174 {
10175 if (GetInventory().GetCargo())
10176 {
10177 int item_count = GetInventory().GetCargo().GetItemCount();
10178 if (item_count > 0)
10179 {
10180 int random_pick = Math.RandomInt(0, item_count);
10182 if (!item.IsExplosive())
10183 {
10184 item.AddHealth("","",damage);
10185 return true;
10186 }
10187 }
10188 }
10189 return false;
10190 }
10191
10193 {
10194 int attachment_count = GetInventory().AttachmentCount();
10195 if (attachment_count > 0)
10196 {
10197 int random_pick = Math.RandomInt(0, attachment_count);
10198 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10199 if (!attachment.IsExplosive())
10200 {
10201 attachment.AddHealth("","",damage);
10202 return true;
10203 }
10204 }
10205 return false;
10206 }
10207
10209 {
10211 }
10212
10214 {
10216 return GetInventory().CanRemoveEntity();
10217
10218 return false;
10219 }
10220
10222 {
10224 return;
10225
10227 {
10228 if (ScriptInputUserData.CanStoreInputUserData())
10229 {
10230 ScriptInputUserData ctx = new ScriptInputUserData;
10235 ctx.
Write(destination_entity);
10237 ctx.
Write(slot_id);
10239 }
10240 }
10241 else if (!
GetGame().IsMultiplayer())
10242 {
10244 }
10245 }
10246
10248 {
10250 return;
10251
10252 float split_quantity_new;
10256 InventoryLocation loc = new InventoryLocation;
10257
10258 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10259 {
10261 split_quantity_new = stack_max;
10262 else
10264
10265 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10266 if (new_item)
10267 {
10268 new_item.SetResultOfSplit(true);
10269 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10271 new_item.SetQuantity(split_quantity_new);
10272 }
10273 }
10274 else if (destination_entity && slot_id == -1)
10275 {
10276 if (quantity > stack_max)
10277 split_quantity_new = stack_max;
10278 else
10279 split_quantity_new = quantity;
10280
10282 {
10285 }
10286
10287 if (new_item)
10288 {
10289 new_item.SetResultOfSplit(true);
10290 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10292 new_item.SetQuantity(split_quantity_new);
10293 }
10294 }
10295 else
10296 {
10297 if (stack_max != 0)
10298 {
10300 {
10302 }
10303
10304 if (split_quantity_new == 0)
10305 {
10306 if (!
GetGame().IsMultiplayer())
10307 player.PhysicalPredictiveDropItem(this);
10308 else
10309 player.ServerDropEntity(this);
10310 return;
10311 }
10312
10314
10315 if (new_item)
10316 {
10317 new_item.SetResultOfSplit(true);
10318 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10320 new_item.SetQuantity(stack_max);
10321 new_item.PlaceOnSurface();
10322 }
10323 }
10324 }
10325 }
10326
10328 {
10330 return;
10331
10332 float split_quantity_new;
10336 InventoryLocation loc = new InventoryLocation;
10337
10338 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10339 {
10341 split_quantity_new = stack_max;
10342 else
10344
10345 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10346 if (new_item)
10347 {
10348 new_item.SetResultOfSplit(true);
10349 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10351 new_item.SetQuantity(split_quantity_new);
10352 }
10353 }
10354 else if (destination_entity && slot_id == -1)
10355 {
10356 if (quantity > stack_max)
10357 split_quantity_new = stack_max;
10358 else
10359 split_quantity_new = quantity;
10360
10362 {
10365 }
10366
10367 if (new_item)
10368 {
10369 new_item.SetResultOfSplit(true);
10370 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10372 new_item.SetQuantity(split_quantity_new);
10373 }
10374 }
10375 else
10376 {
10377 if (stack_max != 0)
10378 {
10380 {
10382 }
10383
10385
10386 if (new_item)
10387 {
10388 new_item.SetResultOfSplit(true);
10389 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10391 new_item.SetQuantity(stack_max);
10392 new_item.PlaceOnSurface();
10393 }
10394 }
10395 }
10396 }
10397
10399 {
10401 return;
10402
10404 {
10405 if (ScriptInputUserData.CanStoreInputUserData())
10406 {
10407 ScriptInputUserData ctx = new ScriptInputUserData;
10412 dst.WriteToContext(ctx);
10414 }
10415 }
10416 else if (!
GetGame().IsMultiplayer())
10417 {
10419 }
10420 }
10421
10423 {
10425 return;
10426
10428 {
10429 if (ScriptInputUserData.CanStoreInputUserData())
10430 {
10431 ScriptInputUserData ctx = new ScriptInputUserData;
10436 ctx.
Write(destination_entity);
10442 }
10443 }
10444 else if (!
GetGame().IsMultiplayer())
10445 {
10447 }
10448 }
10449
10451 {
10453 }
10454
10456 {
10458 return this;
10459
10461 float split_quantity_new;
10463 if (dst.IsValid())
10464 {
10465 int slot_id = dst.GetSlot();
10467
10468 if (quantity > stack_max)
10469 split_quantity_new = stack_max;
10470 else
10471 split_quantity_new = quantity;
10472
10474
10475 if (new_item)
10476 {
10477 new_item.SetResultOfSplit(true);
10478 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10481 }
10482
10483 return new_item;
10484 }
10485
10486 return null;
10487 }
10488
10490 {
10492 return;
10493
10495 float split_quantity_new;
10497 if (destination_entity)
10498 {
10500 if (quantity > stackable)
10501 split_quantity_new = stackable;
10502 else
10503 split_quantity_new = quantity;
10504
10505 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
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 {
10523 if (ScriptInputUserData.CanStoreInputUserData())
10524 {
10525 ScriptInputUserData ctx = new ScriptInputUserData;
10530 ItemBase destination_entity =
this;
10531 ctx.
Write(destination_entity);
10535 }
10536 }
10537 else if (!
GetGame().IsMultiplayer())
10538 {
10540 }
10541 }
10542
10544 {
10546 return;
10547
10549 float split_quantity_new;
10551 if (player)
10552 {
10554 if (quantity > stackable)
10555 split_quantity_new = stackable;
10556 else
10557 split_quantity_new = quantity;
10558
10559 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10560 new_item =
ItemBase.Cast(in_hands);
10561 if (new_item)
10562 {
10563 new_item.SetResultOfSplit(true);
10564 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10566 new_item.SetQuantity(split_quantity_new);
10567 }
10568 }
10569 }
10570
10572 {
10574 return;
10575
10577 float split_quantity_new = Math.Floor(quantity * 0.5);
10578
10580
10581 if (new_item)
10582 {
10583 if (new_item.GetQuantityMax() < split_quantity_new)
10584 {
10585 split_quantity_new = new_item.GetQuantityMax();
10586 }
10587
10588 new_item.SetResultOfSplit(true);
10589 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10590
10592 {
10595 }
10596 else
10597 {
10600 }
10601 }
10602 }
10603
10605 {
10607 return;
10608
10610 float split_quantity_new = Math.Floor(quantity / 2);
10611
10612 InventoryLocation invloc = new InventoryLocation;
10614
10616 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10617
10618 if (new_item)
10619 {
10620 if (new_item.GetQuantityMax() < split_quantity_new)
10621 {
10622 split_quantity_new = new_item.GetQuantityMax();
10623 }
10625 {
10628 }
10629 else
10630 {
10633 }
10634 }
10635 }
10636
10639 {
10640 SetWeightDirty();
10642
10643 if (parent)
10644 parent.OnAttachmentQuantityChangedEx(this, delta);
10645
10647 {
10649 {
10651 }
10653 {
10654 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10656 }
10657 }
10658
10659 }
10660
10663 {
10664
10665 }
10666
10669 {
10671 }
10672
10674 {
10675 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10676
10678 {
10679 if (newLevel == GameConstants.STATE_RUINED)
10680 {
10682 EntityAI parent = GetHierarchyParent();
10683 if (parent && parent.IsFireplace())
10684 {
10685 CargoBase cargo = GetInventory().GetCargo();
10686 if (cargo)
10687 {
10689 {
10691 }
10692 }
10693 }
10694 }
10695
10697 {
10698
10700 return;
10701 }
10702
10703 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10704 {
10706 }
10707 }
10708 }
10709
10710
10712 {
10713 super.OnRightClick();
10714
10716 {
10718 {
10719 if (ScriptInputUserData.CanStoreInputUserData())
10720 {
10721 vector m4[4];
10723
10724 EntityAI root = GetHierarchyRoot();
10725
10726 InventoryLocation dst = new InventoryLocation;
10728 {
10729 if (root)
10730 {
10731 root.GetTransform(m4);
10733 }
10734 else
10735 GetInventory().GetCurrentInventoryLocation(dst);
10736 }
10737 else
10738 {
10740
10741
10742 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10743 {
10744 if (root)
10745 {
10746 root.GetTransform(m4);
10748 }
10749 else
10750 GetInventory().GetCurrentInventoryLocation(dst);
10751 }
10752 else
10753 {
10754 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10755 }
10756 }
10757
10758 ScriptInputUserData ctx = new ScriptInputUserData;
10766 }
10767 }
10768 else if (!
GetGame().IsMultiplayer())
10769 {
10771 }
10772 }
10773 }
10774
10775 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10776 {
10777
10778 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10779 return false;
10780
10781 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10782 return false;
10783
10784
10786 return false;
10787
10788
10789 Magazine mag = Magazine.Cast(this);
10790 if (mag)
10791 {
10792 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10793 return false;
10794
10795 if (stack_max_limit)
10796 {
10797 Magazine other_mag = Magazine.Cast(other_item);
10798 if (other_item)
10799 {
10800 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10801 return false;
10802 }
10803
10804 }
10805 }
10806 else
10807 {
10808
10810 return false;
10811
10813 return false;
10814 }
10815
10816 PlayerBase player = null;
10817 if (CastTo(player, GetHierarchyRootPlayer()))
10818 {
10819 if (player.GetInventory().HasAttachment(this))
10820 return false;
10821
10822 if (player.IsItemsToDelete())
10823 return false;
10824 }
10825
10826 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10827 return false;
10828
10829 int slotID;
10831 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10832 return false;
10833
10834 return true;
10835 }
10836
10838 {
10840 }
10841
10843 {
10844 return m_IsResultOfSplit;
10845 }
10846
10848 {
10849 m_IsResultOfSplit = value;
10850 }
10851
10853 {
10855 }
10856
10858 {
10859 float other_item_quantity = other_item.GetQuantity();
10860 float this_free_space;
10861
10863
10865
10866 if (other_item_quantity > this_free_space)
10867 {
10868 return this_free_space;
10869 }
10870 else
10871 {
10872 return other_item_quantity;
10873 }
10874 }
10875
10877 {
10879 }
10880
10882 {
10884 return;
10885
10886 if (!IsMagazine() && other_item)
10887 {
10889 if (quantity_used != 0)
10890 {
10891 float hp1 = GetHealth01("","");
10892 float hp2 = other_item.GetHealth01("","");
10893 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10894 hpResult = hpResult / (
GetQuantity() + quantity_used);
10895
10896 hpResult *= GetMaxHealth();
10897 Math.Round(hpResult);
10898 SetHealth("", "Health", hpResult);
10899
10901 other_item.AddQuantity(-quantity_used);
10902 }
10903 }
10905 }
10906
10908 {
10909 #ifdef SERVER
10910 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10911 GetHierarchyParent().IncreaseLifetimeUp();
10912 #endif
10913 };
10914
10916 {
10917 PlayerBase p = PlayerBase.Cast(player);
10918
10919 array<int> recipesIds = p.m_Recipes;
10920 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10921 if (moduleRecipesManager)
10922 {
10923 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10924 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10925 }
10926
10927 for (int i = 0;i < recipesIds.Count(); i++)
10928 {
10929 int key = recipesIds.Get(i);
10930 string recipeName = moduleRecipesManager.GetRecipeName(key);
10932 }
10933 }
10934
10935
10936 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10937 {
10938 super.GetDebugActions(outputList);
10939
10940
10945
10946
10950
10954
10955
10958
10959
10961 {
10964 }
10965
10967
10970
10974 }
10975
10976
10977
10978
10980 {
10981 super.OnAction(action_id, player, ctx);
10982 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10983 {
10984 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10985 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10986 PlayerBase p = PlayerBase.Cast(player);
10987 if (
EActions.RECIPES_RANGE_START < 1000)
10988 {
10989 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10990 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10991 }
10992 }
10993 #ifndef SERVER
10994 else if (action_id ==
EActions.WATCH_PLAYER)
10995 {
10996 PluginDeveloper.SetDeveloperItemClientEx(player);
10997 }
10998 #endif
11000 {
11001 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11002 {
11003 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11004 OnDebugButtonPressServer(id + 1);
11005 }
11006
11007 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11008 {
11009 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11011 }
11012
11013 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11014 {
11015 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11017 }
11018
11019 else if (action_id ==
EActions.ADD_QUANTITY)
11020 {
11021 if (IsMagazine())
11022 {
11023 Magazine mag = Magazine.Cast(this);
11024 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11025 }
11026 else
11027 {
11029 }
11030
11031 if (m_EM)
11032 {
11033 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11034 }
11035
11036 }
11037
11038 else if (action_id ==
EActions.REMOVE_QUANTITY)
11039 {
11040 if (IsMagazine())
11041 {
11042 Magazine mag2 = Magazine.Cast(this);
11043 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11044 }
11045 else
11046 {
11048 }
11049 if (m_EM)
11050 {
11051 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11052 }
11053
11054 }
11055
11056 else if (action_id ==
EActions.SET_QUANTITY_0)
11057 {
11059
11060 if (m_EM)
11061 {
11062 m_EM.SetEnergy(0);
11063 }
11064 }
11065
11066 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11067 {
11069
11070 if (m_EM)
11071 {
11072 m_EM.SetEnergy(m_EM.GetEnergyMax());
11073 }
11074 }
11075
11076 else if (action_id ==
EActions.ADD_HEALTH)
11077 {
11078 AddHealth("","",GetMaxHealth("","Health")/5);
11079 }
11080 else if (action_id ==
EActions.REMOVE_HEALTH)
11081 {
11082 AddHealth("","",-GetMaxHealth("","Health")/5);
11083 }
11084 else if (action_id ==
EActions.DESTROY_HEALTH)
11085 {
11086 SetHealth01("","",0);
11087 }
11088 else if (action_id ==
EActions.WATCH_ITEM)
11089 {
11091 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11092 #ifdef DEVELOPER
11093 SetDebugDeveloper_item(this);
11094 #endif
11095 }
11096
11097 else if (action_id ==
EActions.ADD_TEMPERATURE)
11098 {
11099 AddTemperature(20);
11100
11101 }
11102
11103 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11104 {
11105 AddTemperature(-20);
11106
11107 }
11108
11109 else if (action_id ==
EActions.FLIP_FROZEN)
11110 {
11111 SetFrozen(!GetIsFrozen());
11112
11113 }
11114
11115 else if (action_id ==
EActions.ADD_WETNESS)
11116 {
11118
11119 }
11120
11121 else if (action_id ==
EActions.REMOVE_WETNESS)
11122 {
11124
11125 }
11126
11127 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11128 {
11131
11132
11133 }
11134
11135 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11136 {
11139 }
11140
11141 else if (action_id ==
EActions.MAKE_SPECIAL)
11142 {
11143 auto debugParams = DebugSpawnParams.WithPlayer(player);
11144 OnDebugSpawnEx(debugParams);
11145 }
11146
11147 else if (action_id ==
EActions.DELETE)
11148 {
11149 Delete();
11150 }
11151
11152 }
11153
11154
11155 return false;
11156 }
11157
11158
11159
11160
11164
11167
11168
11169
11171 {
11172 return false;
11173 }
11174
11175
11177 {
11178 return true;
11179 }
11180
11181
11183 {
11184 return true;
11185 }
11186
11187
11188
11190 {
11191 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11193 }
11194
11197 {
11198 return null;
11199 }
11200
11202 {
11203 return false;
11204 }
11205
11207 {
11208 return false;
11209 }
11210
11214
11215
11217 {
11218 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11219 return module_repairing.CanRepair(this, item_repair_kit);
11220 }
11221
11222
11223 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11224 {
11225 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11226 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11227 }
11228
11229
11231 {
11232
11233
11234
11235
11236
11237
11238
11239
11240 return 1;
11241 }
11242
11243
11244
11246 {
11248 }
11249
11250
11251
11253 {
11255 }
11256
11257
11266 {
11267 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11268
11269 if (player)
11270 {
11271 player.MessageStatus(text);
11272 }
11273 }
11274
11275
11284 {
11285 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11286
11287 if (player)
11288 {
11289 player.MessageAction(text);
11290 }
11291 }
11292
11293
11302 {
11303 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11304
11305 if (player)
11306 {
11307 player.MessageFriendly(text);
11308 }
11309 }
11310
11311
11320 {
11321 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11322
11323 if (player)
11324 {
11325 player.MessageImportant(text);
11326 }
11327 }
11328
11330 {
11331 return true;
11332 }
11333
11334
11335 override bool KindOf(
string tag)
11336 {
11337 bool found = false;
11338 string item_name = this.
GetType();
11341
11342 int array_size = item_tag_array.Count();
11343 for (int i = 0; i < array_size; i++)
11344 {
11345 if (item_tag_array.Get(i) == tag)
11346 {
11347 found = true;
11348 break;
11349 }
11350 }
11351 return found;
11352 }
11353
11354
11356 {
11357
11358 super.OnRPC(sender, rpc_type,ctx);
11359
11360
11361 switch (rpc_type)
11362 {
11363 #ifndef SERVER
11364 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11365 Param2<bool, string> p = new Param2<bool, string>(false, "");
11366
11368 return;
11369
11370 bool play = p.param1;
11371 string soundSet = p.param2;
11372
11373 if (play)
11374 {
11376 {
11378 {
11380 }
11381 }
11382 else
11383 {
11385 }
11386 }
11387 else
11388 {
11390 }
11391
11392 break;
11393 #endif
11394
11395 }
11396
11398 {
11400 }
11401 }
11402
11403
11404
11405
11407 {
11408 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11409 return plugin.GetID(
name);
11410 }
11411
11413 {
11414 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11415 return plugin.GetName(id);
11416 }
11417
11420 {
11421
11422
11423 int varFlags;
11424 if (!ctx.
Read(varFlags))
11425 return;
11426
11427 if (varFlags & ItemVariableFlags.FLOAT)
11428 {
11430 }
11431 }
11432
11434 {
11435
11436 super.SerializeNumericalVars(floats_out);
11437
11438
11439
11441 {
11443 }
11444
11446 {
11448 }
11449
11451 {
11453 }
11454
11456 {
11461 }
11462
11464 {
11466 }
11467 }
11468
11470 {
11471
11472 super.DeSerializeNumericalVars(floats);
11473
11474
11475 int index = 0;
11476 int mask = Math.Round(floats.Get(index));
11477
11478 index++;
11479
11481 {
11483 {
11485 }
11486 else
11487 {
11488 float quantity = floats.Get(index);
11489 SetQuantity(quantity,
true,
false,
false,
false);
11490 }
11491 index++;
11492 }
11493
11495 {
11496 float wet = floats.Get(index);
11498 index++;
11499 }
11500
11502 {
11503 int liquidtype = Math.Round(floats.Get(index));
11505 index++;
11506 }
11507
11509 {
11511 index++;
11513 index++;
11515 index++;
11517 index++;
11518 }
11519
11521 {
11522 int cleanness = Math.Round(floats.Get(index));
11524 index++;
11525 }
11526 }
11527
11529 {
11530 super.WriteVarsToCTX(ctx);
11531
11532
11534 {
11536 }
11537
11539 {
11541 }
11542
11544 {
11546 }
11547
11549 {
11550 int r,g,b,a;
11556 }
11557
11559 {
11561 }
11562 }
11563
11565 {
11566 if (!super.ReadVarsFromCTX(ctx,version))
11567 return false;
11568
11569 int intValue;
11570 float value;
11571
11572 if (version < 140)
11573 {
11574 if (!ctx.
Read(intValue))
11575 return false;
11576
11577 m_VariablesMask = intValue;
11578 }
11579
11581 {
11582 if (!ctx.
Read(value))
11583 return false;
11584
11586 {
11588 }
11589 else
11590 {
11592 }
11593 }
11594
11595 if (version < 140)
11596 {
11598 {
11599 if (!ctx.
Read(value))
11600 return false;
11601 SetTemperatureDirect(value);
11602 }
11603 }
11604
11606 {
11607 if (!ctx.
Read(value))
11608 return false;
11610 }
11611
11613 {
11614 if (!ctx.
Read(intValue))
11615 return false;
11617 }
11618
11620 {
11621 int r,g,b,a;
11623 return false;
11625 return false;
11627 return false;
11629 return false;
11630
11632 }
11633
11635 {
11636 if (!ctx.
Read(intValue))
11637 return false;
11639 }
11640
11641 if (version >= 138 && version < 140)
11642 {
11644 {
11645 if (!ctx.
Read(intValue))
11646 return false;
11647 SetFrozen(intValue);
11648 }
11649 }
11650
11651 return true;
11652 }
11653
11654
11656 {
11659 {
11661 }
11662
11663 if (!super.OnStoreLoad(ctx, version))
11664 {
11666 return false;
11667 }
11668
11669 if (version >= 114)
11670 {
11671 bool hasQuickBarIndexSaved;
11672
11673 if (!ctx.
Read(hasQuickBarIndexSaved))
11674 {
11676 return false;
11677 }
11678
11679 if (hasQuickBarIndexSaved)
11680 {
11681 int itmQBIndex;
11682
11683
11684 if (!ctx.
Read(itmQBIndex))
11685 {
11687 return false;
11688 }
11689
11690 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11691 if (itmQBIndex != -1 && parentPlayer)
11692 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11693 }
11694 }
11695 else
11696 {
11697
11698 PlayerBase player;
11699 int itemQBIndex;
11700 if (version ==
int.
MAX)
11701 {
11702 if (!ctx.
Read(itemQBIndex))
11703 {
11705 return false;
11706 }
11707 }
11708 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11709 {
11710
11711 if (!ctx.
Read(itemQBIndex))
11712 {
11714 return false;
11715 }
11716 if (itemQBIndex != -1 && player)
11717 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11718 }
11719 }
11720
11721 if (version < 140)
11722 {
11723
11724 if (!LoadVariables(ctx, version))
11725 {
11727 return false;
11728 }
11729 }
11730
11731
11733 {
11735 return false;
11736 }
11737 if (version >= 132)
11738 {
11740 if (raib)
11741 {
11743 {
11745 return false;
11746 }
11747 }
11748 }
11749
11751 return true;
11752 }
11753
11754
11755
11757 {
11758 super.OnStoreSave(ctx);
11759
11760 PlayerBase player;
11761 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11762 {
11764
11765 int itemQBIndex = -1;
11766 itemQBIndex = player.FindQuickBarEntityIndex(this);
11767 ctx.
Write(itemQBIndex);
11768 }
11769 else
11770 {
11772 }
11773
11775
11777 if (raib)
11778 {
11780 }
11781 }
11782
11783
11785 {
11786 super.AfterStoreLoad();
11787
11789 {
11791 }
11792
11794 {
11797 }
11798 }
11799
11801 {
11802 super.EEOnAfterLoad();
11803
11805 {
11807 }
11808
11811 }
11812
11814 {
11815 return false;
11816 }
11817
11818
11819
11821 {
11823 {
11824 #ifdef PLATFORM_CONSOLE
11825
11827 {
11829 if (menu)
11830 {
11832 }
11833 }
11834 #endif
11835 }
11836
11838 {
11841 }
11842
11844 {
11845 SetWeightDirty();
11847 }
11849 {
11852 }
11853
11855 {
11858 }
11860 {
11863 }
11864
11865 super.OnVariablesSynchronized();
11866 }
11867
11868
11869
11871 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11872 {
11873 if (!IsServerCheck(allow_client))
11874 return false;
11875
11877 return false;
11878
11881
11882 if (value <= (min + 0.001))
11883 value = min;
11884
11885 if (value == min)
11886 {
11887 if (destroy_config)
11888 {
11889 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11890 if (dstr)
11891 {
11893 this.Delete();
11894 return true;
11895 }
11896 }
11897 else if (destroy_forced)
11898 {
11900 this.Delete();
11901 return true;
11902 }
11903
11905 }
11906
11909
11911 {
11913
11914 if (delta)
11916 }
11917
11919
11920 return false;
11921 }
11922
11923
11925 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11926 {
11928 }
11929
11931 {
11934 }
11935
11937 {
11940 }
11941
11944 {
11945 float value_clamped = Math.Clamp(value, 0, 1);
11947 SetQuantity(result, destroy_config, destroy_forced);
11948 }
11949
11950
11953 {
11955 }
11956
11958 {
11960 }
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11972 {
11973 int slot = -1;
11974 if (GetInventory())
11975 {
11976 InventoryLocation il = new InventoryLocation;
11977 GetInventory().GetCurrentInventoryLocation(il);
11979 }
11980
11982 }
11983
11985 {
11986 float quantity_max = 0;
11987
11989 {
11990 if (attSlotID != -1)
11991 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11992
11993 if (quantity_max <= 0)
11995 }
11996
11997 if (quantity_max <= 0)
11999
12000 return quantity_max;
12001 }
12002
12004 {
12006 }
12007
12009 {
12011 }
12012
12013
12015 {
12017 }
12018
12020 {
12022 }
12023
12025 {
12027 }
12028
12029
12031 {
12032
12033 float weightEx = GetWeightEx();
12034 float special = GetInventoryAndCargoWeight();
12035 return weightEx - special;
12036 }
12037
12038
12040 {
12042 }
12043
12045 {
12047 {
12048 #ifdef DEVELOPER
12049 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12050 {
12051 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12053 }
12054 #endif
12055
12056 return GetQuantity() * GetConfigWeightModified();
12057 }
12058 else if (HasEnergyManager())
12059 {
12060 #ifdef DEVELOPER
12061 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12062 {
12063 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12064 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12065 }
12066 #endif
12067 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12068 }
12069 else
12070 {
12071 #ifdef DEVELOPER
12072 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12073 {
12074 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12075 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12076 }
12077 #endif
12078 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12079 }
12080 }
12081
12084 {
12085 int item_count = 0;
12087
12088 if (GetInventory().GetCargo() != NULL)
12089 {
12090 item_count = GetInventory().GetCargo().GetItemCount();
12091 }
12092
12093 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12094 {
12095 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12096 if (item)
12097 item_count += item.GetNumberOfItems();
12098 }
12099 return item_count;
12100 }
12101
12104 {
12105 float weight = 0;
12106 float wetness = 1;
12107 if (include_wetness)
12110 {
12111 weight = wetness * m_ConfigWeight;
12112 }
12114 {
12115 weight = 1;
12116 }
12117 return weight;
12118 }
12119
12120
12121
12123 {
12124 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12125 {
12126 GameInventory inv = GetInventory();
12127 array<EntityAI> items = new array<EntityAI>;
12129 for (int i = 0; i < items.Count(); i++)
12130 {
12132 if (item)
12133 {
12135 }
12136 }
12137 }
12138 }
12139
12140
12141
12142
12144 {
12145 float energy = 0;
12146 if (HasEnergyManager())
12147 {
12148 energy = GetCompEM().GetEnergy();
12149 }
12150 return energy;
12151 }
12152
12153
12155 {
12156 super.OnEnergyConsumed();
12157
12159 }
12160
12162 {
12163 super.OnEnergyAdded();
12164
12166 }
12167
12168
12170 {
12171 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12172 {
12174 {
12175 float energy_0to1 = GetCompEM().GetEnergy0To1();
12177 }
12178 }
12179 }
12180
12181
12183 {
12184 return ConfigGetFloat("heatIsolation");
12185 }
12186
12188 {
12190 }
12191
12193 {
12194 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12195 if (
GetGame().ConfigIsExisting(paramPath))
12197
12198 return 0.0;
12199 }
12200
12202 {
12203 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12204 if (
GetGame().ConfigIsExisting(paramPath))
12206
12207 return 0.0;
12208 }
12209
12210 override void SetWet(
float value,
bool allow_client =
false)
12211 {
12212 if (!IsServerCheck(allow_client))
12213 return;
12214
12217
12219
12220 m_VarWet = Math.Clamp(value, min, max);
12221
12223 {
12226 }
12227 }
12228
12229 override void AddWet(
float value)
12230 {
12232 }
12233
12235 {
12237 }
12238
12240 {
12242 }
12243
12245 {
12247 }
12248
12250 {
12252 }
12253
12255 {
12257 }
12258
12259 override void OnWetChanged(
float newVal,
float oldVal)
12260 {
12263 if (newLevel != oldLevel)
12264 {
12266 }
12267 }
12268
12270 {
12271 SetWeightDirty();
12272 }
12273
12275 {
12276 return GetWetLevelInternal(
m_VarWet);
12277 }
12278
12279
12280
12282 {
12284 }
12285
12287 {
12289 }
12290
12292 {
12294 }
12295
12297 {
12299 }
12300
12301
12302
12304 {
12305 if (ConfigIsExisting("itemModelLength"))
12306 {
12307 return ConfigGetFloat("itemModelLength");
12308 }
12309 return 0;
12310 }
12311
12313 {
12314 if (ConfigIsExisting("itemAttachOffset"))
12315 {
12316 return ConfigGetFloat("itemAttachOffset");
12317 }
12318 return 0;
12319 }
12320
12321 override void SetCleanness(
int value,
bool allow_client =
false)
12322 {
12323 if (!IsServerCheck(allow_client))
12324 return;
12325
12327
12329
12332 }
12333
12335 {
12337 }
12338
12340 {
12341 return true;
12342 }
12343
12344
12345
12346
12348 {
12350 }
12351
12353 {
12355 }
12356
12357
12358
12359
12360 override void SetColor(
int r,
int g,
int b,
int a)
12361 {
12367 }
12369 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12370 {
12375 }
12376
12378 {
12380 }
12381
12384 {
12385 int r,g,b,a;
12387 r = r/255;
12388 g = g/255;
12389 b = b/255;
12390 a = a/255;
12391 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12392 }
12393
12394
12395
12396 override void SetLiquidType(
int value,
bool allow_client =
false)
12397 {
12398 if (!IsServerCheck(allow_client))
12399 return;
12400
12405 }
12406
12408 {
12409 return ConfigGetInt("varLiquidTypeInit");
12410 }
12411
12413 {
12415 }
12416
12418 {
12420 SetFrozen(false);
12421 }
12422
12425 {
12426 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12427 }
12428
12429
12432 {
12433 PlayerBase nplayer;
12434 if (PlayerBase.CastTo(nplayer, player))
12435 {
12437
12438 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12439 }
12440 }
12441
12442
12445 {
12446 PlayerBase nplayer;
12447 if (PlayerBase.CastTo(nplayer,player))
12448 {
12449
12450 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12451
12452 }
12453
12454
12455 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12456
12457
12458 if (HasEnergyManager())
12459 {
12460 GetCompEM().UpdatePlugState();
12461 }
12462 }
12463
12464
12466 {
12467 super.OnPlacementStarted(player);
12468
12470 }
12471
12472 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12473 {
12475 {
12476 m_AdminLog.OnPlacementComplete(player,
this);
12477 }
12478
12479 super.OnPlacementComplete(player, position, orientation);
12480 }
12481
12482
12483
12484
12485
12487 {
12489 {
12490 return true;
12491 }
12492 else
12493 {
12494 return false;
12495 }
12496 }
12497
12498
12500 {
12502 {
12504 }
12505 }
12506
12507
12509 {
12511 }
12512
12514 {
12516 }
12517
12518 override void InsertAgent(
int agent,
float count = 1)
12519 {
12520 if (count < 1)
12521 return;
12522
12524 }
12525
12528 {
12530 }
12531
12532
12534 {
12536 }
12537
12538
12539
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
12580 {
12582 return false;
12583 return true;
12584 }
12585
12587 {
12588
12590 }
12591
12592
12595 {
12596 super.CheckForRoofLimited(timeTresholdMS);
12597
12599 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12600 {
12601 m_PreviousRoofTestTime = time;
12602 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12603 }
12604 }
12605
12606
12608 {
12610 {
12611 return 0;
12612 }
12613
12614 if (GetInventory().GetAttachmentSlotsCount() != 0)
12615 {
12616 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12617 if (filter)
12618 return filter.GetProtectionLevel(type, false, system);
12619 else
12620 return 0;
12621 }
12622
12623 string subclassPath, entryName;
12624
12625 switch (type)
12626 {
12628 entryName = "biological";
12629 break;
12631 entryName = "chemical";
12632 break;
12633 default:
12634 entryName = "biological";
12635 break;
12636 }
12637
12638 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12639
12641 }
12642
12643
12644
12647 {
12648 if (!IsMagazine())
12650
12652 }
12653
12654
12655
12656
12657
12662 {
12663 return true;
12664 }
12665
12667 {
12669 }
12670
12671
12672
12673
12674
12676 {
12677 if (parent)
12678 {
12679 if (parent.IsInherited(DayZInfected))
12680 return true;
12681
12682 if (!parent.IsRuined())
12683 return true;
12684 }
12685
12686 return true;
12687 }
12688
12690 {
12691 if (!super.CanPutAsAttachment(parent))
12692 {
12693 return false;
12694 }
12695
12696 if (!IsRuined() && !parent.IsRuined())
12697 {
12698 return true;
12699 }
12700
12701 return false;
12702 }
12703
12705 {
12706
12707
12708
12709
12710 return super.CanReceiveItemIntoCargo(item);
12711 }
12712
12714 {
12715
12716
12717
12718
12719 GameInventory attachmentInv = attachment.GetInventory();
12721 {
12722 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12723 return false;
12724 }
12725
12726 InventoryLocation loc = new InventoryLocation();
12727 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12728 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12729 return false;
12730
12731 return super.CanReceiveAttachment(attachment, slotId);
12732 }
12733
12735 {
12736 if (!super.CanReleaseAttachment(attachment))
12737 return false;
12738
12739 return GetInventory().AreChildrenAccessible();
12740 }
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12763 {
12764 int id = muzzle_owner.GetMuzzleID();
12765 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12766
12767 if (WPOF_array)
12768 {
12769 for (int i = 0; i < WPOF_array.Count(); i++)
12770 {
12771 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12772
12773 if (WPOF)
12774 {
12775 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12776 }
12777 }
12778 }
12779 }
12780
12781
12783 {
12784 int id = muzzle_owner.GetMuzzleID();
12786
12787 if (WPOBE_array)
12788 {
12789 for (int i = 0; i < WPOBE_array.Count(); i++)
12790 {
12791 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12792
12793 if (WPOBE)
12794 {
12795 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12796 }
12797 }
12798 }
12799 }
12800
12801
12803 {
12804 int id = muzzle_owner.GetMuzzleID();
12805 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12806
12807 if (WPOOH_array)
12808 {
12809 for (int i = 0; i < WPOOH_array.Count(); i++)
12810 {
12811 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12812
12813 if (WPOOH)
12814 {
12815 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12816 }
12817 }
12818 }
12819 }
12820
12821
12823 {
12824 int id = muzzle_owner.GetMuzzleID();
12825 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12826
12827 if (WPOOH_array)
12828 {
12829 for (int i = 0; i < WPOOH_array.Count(); i++)
12830 {
12831 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12832
12833 if (WPOOH)
12834 {
12835 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12836 }
12837 }
12838 }
12839 }
12840
12841
12843 {
12844 int id = muzzle_owner.GetMuzzleID();
12845 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12846
12847 if (WPOOH_array)
12848 {
12849 for (int i = 0; i < WPOOH_array.Count(); i++)
12850 {
12851 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12852
12853 if (WPOOH)
12854 {
12855 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12856 }
12857 }
12858 }
12859 }
12860
12861
12862
12864 {
12866 {
12867 return true;
12868 }
12869
12870 return false;
12871 }
12872
12874 {
12876 {
12877 return true;
12878 }
12879
12880 return false;
12881 }
12882
12884 {
12886 {
12887 return true;
12888 }
12889
12890 return false;
12891 }
12892
12894 {
12895 return false;
12896 }
12897
12900 {
12901 return UATimeSpent.DEFAULT_DEPLOY;
12902 }
12903
12904
12905
12906
12908 {
12910 SetSynchDirty();
12911 }
12912
12914 {
12916 }
12917
12918
12920 {
12921 return false;
12922 }
12923
12926 {
12927 string att_type = "None";
12928
12929 if (ConfigIsExisting("soundAttType"))
12930 {
12931 att_type = ConfigGetString("soundAttType");
12932 }
12933
12935 }
12936
12938 {
12940 }
12941
12942
12943
12944
12945
12949
12951 {
12954
12956 }
12957
12958
12960 {
12962 return;
12963
12965
12968
12971
12972 SoundParameters params = new SoundParameters();
12976 }
12977
12978
12980 {
12982 return;
12983
12985 SetSynchDirty();
12986
12989 }
12990
12991
12993 {
12995 return;
12996
12998 SetSynchDirty();
12999
13002 }
13003
13005 {
13007 }
13008
13010 {
13012 }
13013
13016 {
13017 if (!
GetGame().IsDedicatedServer())
13018 {
13019 if (ConfigIsExisting("attachSoundSet"))
13020 {
13021 string cfg_path = "";
13022 string soundset = "";
13023 string type_name =
GetType();
13024
13027 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13028 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13029
13030 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13031 {
13032 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13033 {
13034 if (cfg_slot_array[i] == slot_type)
13035 {
13036 soundset = cfg_soundset_array[i];
13037 break;
13038 }
13039 }
13040 }
13041
13042 if (soundset != "")
13043 {
13044 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13046 }
13047 }
13048 }
13049 }
13050
13052 {
13053
13054 }
13055
13056 void OnApply(PlayerBase player);
13057
13059 {
13060 return 1.0;
13061 };
13062
13064 {
13066 }
13067
13069 {
13071 }
13072
13074
13076 {
13077 SetDynamicPhysicsLifeTime(0.01);
13079 }
13080
13082 {
13083 array<string> zone_names = new array<string>;
13084 GetDamageZones(zone_names);
13085 for (int i = 0; i < zone_names.Count(); i++)
13086 {
13087 SetHealthMax(zone_names.Get(i),"Health");
13088 }
13089 SetHealthMax("","Health");
13090 }
13091
13094 {
13095 float global_health = GetHealth01("","Health");
13096 array<string> zones = new array<string>;
13097 GetDamageZones(zones);
13098
13099 for (int i = 0; i < zones.Count(); i++)
13100 {
13101 SetHealth01(zones.Get(i),"Health",global_health);
13102 }
13103 }
13104
13107 {
13108 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13109 }
13110
13112 {
13113 if (!hasRootAsPlayer)
13114 {
13115 if (refParentIB)
13116 {
13117
13118 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13119 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13120
13121 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13122 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13123
13126 }
13127 else
13128 {
13129
13132 }
13133 }
13134 }
13135
13137 {
13139 {
13140 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13141 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13142 {
13143 float heatPermCoef = 1.0;
13145 while (ent)
13146 {
13147 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13148 ent = ent.GetHierarchyParent();
13149 }
13150
13151 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13152 }
13153 }
13154 }
13155
13157 {
13158
13159 EntityAI parent = GetHierarchyParent();
13160 if (!parent)
13161 {
13162 hasParent = false;
13163 hasRootAsPlayer = false;
13164 }
13165 else
13166 {
13167 hasParent = true;
13168 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13169 refParentIB =
ItemBase.Cast(parent);
13170 }
13171 }
13172
13173 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13174 {
13175
13176 }
13177
13179 {
13180
13181 return false;
13182 }
13183
13185 {
13186
13187
13188 return false;
13189 }
13190
13192 {
13193
13194 return false;
13195 }
13196
13199 {
13200 return !GetIsFrozen() &&
IsOpen();
13201 }
13202
13204 {
13205 bool hasParent = false, hasRootAsPlayer = false;
13207
13208 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13209 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13210
13211 if (wwtu || foodDecay)
13212 {
13216
13217 if (processWetness || processTemperature || processDecay)
13218 {
13220
13221 if (processWetness)
13222 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13223
13224 if (processTemperature)
13226
13227 if (processDecay)
13228 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13229 }
13230 }
13231 }
13232
13235 {
13237 }
13238
13240 {
13243
13244 return super.GetTemperatureFreezeThreshold();
13245 }
13246
13248 {
13251
13252 return super.GetTemperatureThawThreshold();
13253 }
13254
13256 {
13259
13260 return super.GetItemOverheatThreshold();
13261 }
13262
13264 {
13266 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13267
13268 return super.GetTemperatureFreezeTime();
13269 }
13270
13272 {
13274 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13275
13276 return super.GetTemperatureThawTime();
13277 }
13278
13283
13285 {
13286 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13287 }
13288
13290 {
13291 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13292 }
13293
13296 {
13298 }
13299
13301 {
13303 }
13304
13306 {
13308 }
13309
13312 {
13313 return null;
13314 }
13315
13318 {
13319 return false;
13320 }
13321
13323 {
13325 {
13328 if (!trg)
13329 {
13331 explosive = this;
13332 }
13333
13334 explosive.PairRemote(trg);
13336
13337 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13338 trg.SetPersistentPairID(persistentID);
13339 explosive.SetPersistentPairID(persistentID);
13340
13341 return true;
13342 }
13343 return false;
13344 }
13345
13348 {
13349 float ret = 1.0;
13352 ret *= GetHealth01();
13353
13354 return ret;
13355 }
13356
13357 #ifdef DEVELOPER
13358 override void SetDebugItem()
13359 {
13360 super.SetDebugItem();
13361 _itemBase = this;
13362 }
13363
13365 {
13366 string text = super.GetDebugText();
13367
13369 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13370
13371 return text;
13372 }
13373 #endif
13374
13376 {
13377 return true;
13378 }
13379
13381
13383
13385 {
13388 }
13389
13390
13398
13414}
13415
13417{
13419 if (entity)
13420 {
13421 bool is_item = entity.IsInherited(
ItemBase);
13422 if (is_item && full_quantity)
13423 {
13426 }
13427 }
13428 else
13429 {
13431 return NULL;
13432 }
13433 return entity;
13434}
13435
13437{
13438 if (item)
13439 {
13440 if (health > 0)
13441 item.SetHealth("", "", health);
13442
13443 if (item.CanHaveTemperature())
13444 {
13446 if (item.CanFreeze())
13447 item.SetFrozen(false);
13448 }
13449
13450 if (item.HasEnergyManager())
13451 {
13452 if (quantity >= 0)
13453 {
13454 item.GetCompEM().SetEnergy0To1(quantity);
13455 }
13456 else
13457 {
13459 }
13460 }
13461 else if (item.IsMagazine())
13462 {
13463 Magazine mag = Magazine.Cast(item);
13464 if (quantity >= 0)
13465 {
13466 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13467 }
13468 else
13469 {
13471 }
13472
13473 }
13474 else
13475 {
13476 if (quantity >= 0)
13477 {
13478 item.SetQuantityNormalized(quantity, false);
13479 }
13480 else
13481 {
13483 }
13484
13485 }
13486 }
13487}
13488
13489#ifdef DEVELOPER
13491#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.