8698{
8700 {
8701 return true;
8702 }
8703};
8704
8705
8706
8708{
8712
8714
8717
8718
8719
8720
8721
8730
8736
8741
8746
8767 protected bool m_IsResultOfSplit
8768
8770
8775
8776
8777
8779
8783
8784
8785
8787
8790
8791
8792
8798
8799
8807
8810
8811
8813
8814
8816
8817
8822
8823
8828
8829
8831
8832
8834 {
8839
8840 if (!
GetGame().IsDedicatedServer())
8841 {
8843 {
8845
8847 {
8849 }
8850 }
8851
8854 }
8855
8856 m_OldLocation = null;
8857
8859 {
8861 }
8862
8863 if (ConfigIsExisting("headSelectionsToHide"))
8864 {
8867 }
8868
8870 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8871 {
8873 }
8874
8876
8877 m_IsResultOfSplit = false;
8878
8880 }
8881
8883 {
8884 super.InitItemVariables();
8885
8891 m_Count = ConfigGetInt(
"count");
8892
8895
8900
8903
8908
8920
8924
8925
8928 if (ConfigIsExisting("canBeSplit"))
8929 {
8932 }
8933
8935 if (ConfigIsExisting("itemBehaviour"))
8937
8938
8941 RegisterNetSyncVariableInt("m_VarLiquidType");
8942 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8943
8944 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8945 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8946 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8947
8948 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8949 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8950 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8951 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8952
8953 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8954 RegisterNetSyncVariableBool("m_IsTakeable");
8955 RegisterNetSyncVariableBool("m_IsHologram");
8956
8959 {
8962 }
8963
8965
8967 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8969
8970 }
8971
8973 {
8975 }
8976
8978 {
8981 {
8986 }
8987 }
8988
8989 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8990 {
8992 {
8995 }
8996
8998 }
8999
9001 {
9007 }
9008
9010
9012 {
9014
9015 if (!action)
9016 {
9017 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9018 return;
9019 }
9020
9022 if (!ai)
9023 {
9025 return;
9026 }
9027
9029 if (!action_array)
9030 {
9031 action_array = new array<ActionBase_Basic>;
9033 }
9034 if (LogManager.IsActionLogEnable())
9035 {
9036 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9037 }
9038
9039 if (action_array.Find(action) != -1)
9040 {
9041 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9042 }
9043 else
9044 {
9045 action_array.Insert(action);
9046 }
9047 }
9048
9050 {
9052 ActionBase action = player.GetActionManager().GetAction(actionName);
9055
9056 if (action_array)
9057 {
9058 action_array.RemoveItem(action);
9059 }
9060 }
9061
9062
9063
9065 {
9066 ActionOverrideData overrideData = new ActionOverrideData();
9070
9072 if (!actionMap)
9073 {
9076 }
9077
9078 actionMap.Insert(this.
Type(), overrideData);
9079
9080 }
9081
9083
9085
9086
9088 {
9091
9094
9095 string config_to_search = "CfgVehicles";
9096 string muzzle_owner_config;
9097
9099 {
9100 if (IsInherited(Weapon))
9101 config_to_search = "CfgWeapons";
9102
9103 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9104
9105 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9106
9108
9109 if (config_OnFire_subclass_count > 0)
9110 {
9111 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9112
9113 for (int i = 0; i < config_OnFire_subclass_count; i++)
9114 {
9115 string particle_class = "";
9117 string config_OnFire_entry = config_OnFire_class + particle_class;
9118 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9119 WPOF_array.Insert(WPOF);
9120 }
9121
9122
9124 }
9125 }
9126
9128 {
9129 config_to_search = "CfgWeapons";
9130 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9131
9132 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9133
9135
9136 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9137 {
9138 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9139
9140 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9141 {
9142 string particle_class2 = "";
9144 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9145 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9146 WPOBE_array.Insert(WPOBE);
9147 }
9148
9149
9151 }
9152 }
9153 }
9154
9155
9157 {
9160
9162 {
9163 string config_to_search = "CfgVehicles";
9164
9165 if (IsInherited(Weapon))
9166 config_to_search = "CfgWeapons";
9167
9168 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9169 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9170
9171 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9172 {
9173
9175
9177 {
9179 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9181 return;
9182 }
9183
9186
9187
9188
9190 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9191
9192 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9193 {
9194 string particle_class = "";
9196 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9198
9199 if (entry_type == CT_CLASS)
9200 {
9201 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9202 WPOOH_array.Insert(WPOF);
9203 }
9204 }
9205
9206
9208 }
9209 }
9210 }
9211
9213 {
9215 }
9216
9218 {
9220 {
9222
9225
9228
9229 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9230 }
9231 }
9232
9234 {
9236 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9237
9239 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9240
9242 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9243
9245 {
9247 }
9248 }
9249
9251 {
9253 }
9254
9256 {
9259 else
9261
9263 {
9266 }
9267 else
9268 {
9271
9274 }
9275
9277 }
9278
9280 {
9282 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9283 }
9284
9286 {
9288 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9290 }
9291
9293 {
9295 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9296 }
9297
9299 {
9302
9303 OverheatingParticle OP = new OverheatingParticle();
9308
9310 }
9311
9313 {
9316
9317 return -1;
9318 }
9319
9321 {
9323 {
9326
9327 for (int i = count; i > 0; --i)
9328 {
9329 int id = i - 1;
9332
9335
9336 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9337 {
9338 if (p)
9339 {
9342 }
9343 }
9344 }
9345 }
9346 }
9347
9349 {
9351 {
9353 {
9354 int id = i - 1;
9356
9357 if (OP)
9358 {
9360
9361 if (p)
9362 {
9364 }
9365
9366 delete OP;
9367 }
9368 }
9369
9372 }
9373 }
9374
9377 {
9378 return 0.0;
9379 }
9380
9381
9383 {
9384 return 250;
9385 }
9386
9388 {
9389 return 0;
9390 }
9391
9394 {
9396 return true;
9397
9398 return false;
9399 }
9400
9403 {
9406
9408 {
9410 }
9411 else
9412 {
9413
9415 }
9416
9418 }
9419
9426 {
9427 return -1;
9428 }
9429
9430
9431
9432
9434 {
9436 {
9438 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9439
9440 if (r_index >= 0)
9441 {
9442 InventoryLocation r_il = new InventoryLocation;
9443 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9444
9445 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9448 {
9449 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9450 }
9452 {
9453 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9454 }
9455
9456 }
9457
9458 player.GetHumanInventory().ClearUserReservedLocation(this);
9459 }
9460
9463 }
9464
9465
9466
9467
9469 {
9470 return ItemBase.m_DebugActionsMask;
9471 }
9472
9474 {
9475 return ItemBase.m_DebugActionsMask & mask;
9476 }
9477
9479 {
9480 ItemBase.m_DebugActionsMask = mask;
9481 }
9482
9484 {
9485 ItemBase.m_DebugActionsMask |= mask;
9486 }
9487
9489 {
9490 ItemBase.m_DebugActionsMask &= ~mask;
9491 }
9492
9494 {
9496 {
9498 }
9499 else
9500 {
9502 }
9503 }
9504
9505
9507 {
9508 if (GetEconomyProfile())
9509 {
9510 float q_max = GetEconomyProfile().GetQuantityMax();
9511 if (q_max > 0)
9512 {
9513 float q_min = GetEconomyProfile().GetQuantityMin();
9514 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9515
9517 {
9518 ComponentEnergyManager comp = GetCompEM();
9520 {
9522 }
9523 }
9525 {
9527
9528 }
9529
9530 }
9531 }
9532 }
9533
9536 {
9537 EntityAI parent = GetHierarchyParent();
9538
9539 if (parent)
9540 {
9541 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9542 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9543 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9544 }
9545 }
9546
9549 {
9550 EntityAI parent = GetHierarchyParent();
9551
9552 if (parent)
9553 {
9554 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9555 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9556 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9557 }
9558 }
9559
9561 {
9562
9563
9564
9565
9567
9569 {
9570 if (ScriptInputUserData.CanStoreInputUserData())
9571 {
9572 ScriptInputUserData ctx = new ScriptInputUserData;
9578 ctx.
Write(use_stack_max);
9581
9583 {
9584 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9585 }
9586 }
9587 }
9588 else if (!
GetGame().IsMultiplayer())
9589 {
9591 }
9592 }
9593
9595 {
9597 }
9598
9600 {
9602 }
9603
9605 {
9607 }
9608
9610 {
9611
9612 return false;
9613 }
9614
9616 {
9617 return false;
9618 }
9619
9623 {
9624 return false;
9625 }
9626
9628 {
9629 return "";
9630 }
9631
9633
9635 {
9636 return false;
9637 }
9638
9640 {
9641 return true;
9642 }
9643
9644
9645
9647 {
9648 return true;
9649 }
9650
9652 {
9653 return true;
9654 }
9655
9657 {
9658 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9660 }
9661
9663 {
9665 }
9666
9668 {
9670 if (!is_being_placed)
9672 SetSynchDirty();
9673 }
9674
9675
9677
9679 {
9681 }
9682
9684 {
9686 }
9687
9689 {
9690 return 1;
9691 }
9692
9694 {
9695 return false;
9696 }
9697
9699 {
9701 SetSynchDirty();
9702 }
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9739 {
9740 super.OnMovedInsideCargo(container);
9741
9742 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9743 }
9744
9745 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9746 {
9747 super.EEItemLocationChanged(oldLoc,newLoc);
9748
9749 PlayerBase new_player = null;
9750 PlayerBase old_player = null;
9751
9752 if (newLoc.GetParent())
9753 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9754
9755 if (oldLoc.GetParent())
9756 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9757
9759 {
9760 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9761
9762 if (r_index >= 0)
9763 {
9764 InventoryLocation r_il = new InventoryLocation;
9765 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9766
9767 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9770 {
9771 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9772 }
9774 {
9775 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9776 }
9777
9778 }
9779 }
9780
9782 {
9783 if (new_player)
9784 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9785
9786 if (new_player == old_player)
9787 {
9788
9789 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9790 {
9792 {
9793 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9794 {
9795 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9796 }
9797 }
9798 else
9799 {
9800 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9801 }
9802 }
9803
9804 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9805 {
9806 int type = oldLoc.GetType();
9808 {
9809 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9810 }
9812 {
9813 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9814 }
9815 }
9816 if (!m_OldLocation)
9817 {
9818 m_OldLocation = new InventoryLocation;
9819 }
9820 m_OldLocation.Copy(oldLoc);
9821 }
9822 else
9823 {
9824 if (m_OldLocation)
9825 {
9826 m_OldLocation.Reset();
9827 }
9828 }
9829
9831 }
9832 else
9833 {
9834 if (new_player)
9835 {
9836 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9837 if (res_index >= 0)
9838 {
9839 InventoryLocation il = new InventoryLocation;
9840 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9842 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9845 {
9846 il.
GetParent().GetOnReleaseLock().Invoke(it);
9847 }
9849 {
9851 }
9852
9853 }
9854 }
9856 {
9857
9859 }
9860
9861 if (m_OldLocation)
9862 {
9863 m_OldLocation.Reset();
9864 }
9865 }
9866 }
9867
9868 override void EOnContact(IEntity other, Contact extra)
9869 {
9871 {
9872 int liquidType = -1;
9874 if (impactSpeed > 0.0)
9875 {
9877 #ifndef SERVER
9879 #else
9881 SetSynchDirty();
9882 #endif
9884 }
9885 }
9886
9887 #ifdef SERVER
9888 if (GetCompEM() && GetCompEM().IsPlugged())
9889 {
9890 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9891 GetCompEM().UnplugThis();
9892 }
9893 #endif
9894 }
9895
9897
9899 {
9901 }
9902
9904 {
9905
9906 }
9907
9909 {
9910 super.OnItemLocationChanged(old_owner, new_owner);
9911
9912 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9913 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9914
9915 if (!relatedPlayer && playerNew)
9916 relatedPlayer = playerNew;
9917
9918 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9919 {
9921 if (actionMgr)
9922 {
9923 ActionBase currentAction = actionMgr.GetRunningAction();
9924 if (currentAction)
9926 }
9927 }
9928
9929 Man ownerPlayerOld = null;
9930 Man ownerPlayerNew = null;
9931
9932 if (old_owner)
9933 {
9934 if (old_owner.
IsMan())
9935 {
9936 ownerPlayerOld = Man.Cast(old_owner);
9937 }
9938 else
9939 {
9940 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9941 }
9942 }
9943 else
9944 {
9946 {
9948
9949 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9950 {
9951 GetCompEM().UnplugThis();
9952 }
9953 }
9954 }
9955
9956 if (new_owner)
9957 {
9958 if (new_owner.
IsMan())
9959 {
9960 ownerPlayerNew = Man.Cast(new_owner);
9961 }
9962 else
9963 {
9964 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9965 }
9966 }
9967
9968 if (ownerPlayerOld != ownerPlayerNew)
9969 {
9970 if (ownerPlayerOld)
9971 {
9972 array<EntityAI> subItemsExit = new array<EntityAI>;
9974 for (int i = 0; i < subItemsExit.Count(); i++)
9975 {
9978 }
9979 }
9980
9981 if (ownerPlayerNew)
9982 {
9983 array<EntityAI> subItemsEnter = new array<EntityAI>;
9985 for (int j = 0; j < subItemsEnter.Count(); j++)
9986 {
9989 }
9990 }
9991 }
9992 else if (ownerPlayerNew != null)
9993 {
9994 PlayerBase nplayer;
9995 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9996 {
9997 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9999 for (int k = 0; k < subItemsUpdate.Count(); k++)
10000 {
10002 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10003 }
10004 }
10005 }
10006
10007 if (old_owner)
10008 old_owner.OnChildItemRemoved(this);
10009 if (new_owner)
10010 new_owner.OnChildItemReceived(this);
10011 }
10012
10013
10015 {
10016 super.EEDelete(parent);
10017 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10018 if (player)
10019 {
10021
10022 if (player.IsAlive())
10023 {
10024 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10025 if (r_index >= 0)
10026 {
10027 InventoryLocation r_il = new InventoryLocation;
10028 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10029
10030 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10033 {
10034 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10035 }
10037 {
10038 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10039 }
10040
10041 }
10042
10043 player.RemoveQuickBarEntityShortcut(this);
10044 }
10045 }
10046 }
10047
10049 {
10050 super.EEKilled(killer);
10051
10054 {
10055 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10056 {
10057 if (IsMagazine())
10058 {
10059 if (Magazine.Cast(this).GetAmmoCount() > 0)
10060 {
10062 }
10063 }
10064 else
10065 {
10067 }
10068 }
10069 }
10070 }
10071
10073 {
10074 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10075
10076 super.OnWasAttached(parent, slot_id);
10077
10080
10082 }
10083
10085 {
10086 super.OnWasDetached(parent, slot_id);
10087
10090 }
10091
10093 {
10094 int idx;
10097
10098 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10099 if (inventory_slots.Count() < 1)
10100 {
10101 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10102 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10103 }
10104 else
10105 {
10106 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10107 }
10108
10109 idx = inventory_slots.Find(slot);
10110 if (idx < 0)
10111 return "";
10112
10113 return attach_types.Get(idx);
10114 }
10115
10117 {
10118 int idx = -1;
10119 string slot;
10120
10123
10124 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10125 if (inventory_slots.Count() < 1)
10126 {
10127 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10128 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10129 }
10130 else
10131 {
10132 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10133 if (detach_types.Count() < 1)
10134 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10135 }
10136
10137 for (int i = 0; i < inventory_slots.Count(); i++)
10138 {
10139 slot = inventory_slots.Get(i);
10140 }
10141
10142 if (slot != "")
10143 {
10144 if (detach_types.Count() == 1)
10145 idx = 0;
10146 else
10147 idx = inventory_slots.Find(slot);
10148 }
10149 if (idx < 0)
10150 return "";
10151
10152 return detach_types.Get(idx);
10153 }
10154
10156 {
10157
10159
10160
10161 float min_time = 1;
10162 float max_time = 3;
10163 float delay = Math.RandomFloat(min_time, max_time);
10164
10165 explode_timer.Run(delay, this, "DoAmmoExplosion");
10166 }
10167
10169 {
10170 Magazine magazine = Magazine.Cast(this);
10171 int pop_sounds_count = 6;
10172 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10173
10174
10175 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10176 string sound_name = pop_sounds[ sound_idx ];
10178
10179
10180 magazine.ServerAddAmmoCount(-1);
10181
10182
10183 float min_temp_to_explode = 100;
10184
10185 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10186 {
10188 }
10189 }
10190
10191
10192 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10193 {
10194 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10195
10196 const int CHANCE_DAMAGE_CARGO = 4;
10197 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10198 const int CHANCE_DAMAGE_NOTHING = 2;
10199
10201 {
10202 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10203 int chances;
10204 int rnd;
10205
10206 if (GetInventory().GetCargo())
10207 {
10208 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10209 rnd = Math.RandomInt(0,chances);
10210
10211 if (rnd < CHANCE_DAMAGE_CARGO)
10212 {
10214 }
10215 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10216 {
10218 }
10219 }
10220 else
10221 {
10222 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10223 rnd = Math.RandomInt(0,chances);
10224
10225 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10226 {
10228 }
10229 }
10230 }
10231 }
10232
10234 {
10235 if (GetInventory().GetCargo())
10236 {
10237 int item_count = GetInventory().GetCargo().GetItemCount();
10238 if (item_count > 0)
10239 {
10240 int random_pick = Math.RandomInt(0, item_count);
10242 if (!item.IsExplosive())
10243 {
10244 item.AddHealth("","",damage);
10245 return true;
10246 }
10247 }
10248 }
10249 return false;
10250 }
10251
10253 {
10254 int attachment_count = GetInventory().AttachmentCount();
10255 if (attachment_count > 0)
10256 {
10257 int random_pick = Math.RandomInt(0, attachment_count);
10258 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10259 if (!attachment.IsExplosive())
10260 {
10261 attachment.AddHealth("","",damage);
10262 return true;
10263 }
10264 }
10265 return false;
10266 }
10267
10269 {
10271 }
10272
10274 {
10276 return GetInventory().CanRemoveEntity();
10277
10278 return false;
10279 }
10280
10282 {
10283
10285 return false;
10286
10287
10289 return false;
10290
10291
10292
10294 if (delta == 0)
10295 return false;
10296
10297
10298 return true;
10299 }
10300
10302 {
10304 {
10305 if (ScriptInputUserData.CanStoreInputUserData())
10306 {
10307 ScriptInputUserData ctx = new ScriptInputUserData;
10312 ctx.
Write(destination_entity);
10314 ctx.
Write(slot_id);
10316 }
10317 }
10318 else if (!
GetGame().IsMultiplayer())
10319 {
10321 }
10322 }
10323
10325 {
10326 float split_quantity_new;
10330 InventoryLocation loc = new InventoryLocation;
10331
10332 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10333 {
10335 split_quantity_new = stack_max;
10336 else
10338
10340 {
10341 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10342 if (new_item)
10343 {
10344 new_item.SetResultOfSplit(true);
10345 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10347 new_item.
SetQuantity(split_quantity_new,
false,
true);
10348 }
10349 }
10350 }
10351 else if (destination_entity && slot_id == -1)
10352 {
10353 if (quantity > stack_max)
10354 split_quantity_new = stack_max;
10355 else
10356 split_quantity_new = quantity;
10357
10359 {
10361 {
10364 }
10365
10366 if (new_item)
10367 {
10368 new_item.SetResultOfSplit(true);
10369 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10371 new_item.
SetQuantity(split_quantity_new,
false,
true);
10372 }
10373 }
10374 }
10375 else
10376 {
10377 if (stack_max != 0)
10378 {
10380 {
10382 }
10383
10384 if (split_quantity_new == 0)
10385 {
10386 if (!
GetGame().IsMultiplayer())
10387 player.PhysicalPredictiveDropItem(this);
10388 else
10389 player.ServerDropEntity(this);
10390 return;
10391 }
10392
10394 {
10396
10397 if (new_item)
10398 {
10399 new_item.SetResultOfSplit(true);
10400 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10403 new_item.PlaceOnSurface();
10404 }
10405 }
10406 }
10407 }
10408 }
10409
10411 {
10412 float split_quantity_new;
10416 InventoryLocation loc = new InventoryLocation;
10417
10418 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10419 {
10421 split_quantity_new = stack_max;
10422 else
10424
10426 {
10427 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10428 if (new_item)
10429 {
10430 new_item.SetResultOfSplit(true);
10431 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10433 new_item.
SetQuantity(split_quantity_new,
false,
true);
10434 }
10435 }
10436 }
10437 else if (destination_entity && slot_id == -1)
10438 {
10439 if (quantity > stack_max)
10440 split_quantity_new = stack_max;
10441 else
10442 split_quantity_new = quantity;
10443
10445 {
10447 {
10450 }
10451
10452 if (new_item)
10453 {
10454 new_item.SetResultOfSplit(true);
10455 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10457 new_item.
SetQuantity(split_quantity_new,
false,
true);
10458 }
10459 }
10460 }
10461 else
10462 {
10463 if (stack_max != 0)
10464 {
10466 {
10468 }
10469
10471 {
10473
10474 if (new_item)
10475 {
10476 new_item.SetResultOfSplit(true);
10477 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10480 new_item.PlaceOnSurface();
10481 }
10482 }
10483 }
10484 }
10485 }
10486
10488 {
10490 {
10491 if (ScriptInputUserData.CanStoreInputUserData())
10492 {
10493 ScriptInputUserData ctx = new ScriptInputUserData;
10498 dst.WriteToContext(ctx);
10500 }
10501 }
10502 else if (!
GetGame().IsMultiplayer())
10503 {
10505 }
10506 }
10507
10509 {
10511 {
10512 if (ScriptInputUserData.CanStoreInputUserData())
10513 {
10514 ScriptInputUserData ctx = new ScriptInputUserData;
10519 ctx.
Write(destination_entity);
10525 }
10526 }
10527 else if (!
GetGame().IsMultiplayer())
10528 {
10530 }
10531 }
10532
10534 {
10536 }
10537
10539 {
10541 float split_quantity_new;
10543 if (dst.IsValid())
10544 {
10545 int slot_id = dst.GetSlot();
10547
10548 if (quantity > stack_max)
10549 split_quantity_new = stack_max;
10550 else
10551 split_quantity_new = quantity;
10552
10554 {
10556
10557 if (new_item)
10558 {
10559 new_item.SetResultOfSplit(true);
10560 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10562 new_item.
SetQuantity(split_quantity_new,
false,
true);
10563 }
10564
10565 return new_item;
10566 }
10567 }
10568
10569 return null;
10570 }
10571
10573 {
10575 float split_quantity_new;
10577 if (destination_entity)
10578 {
10580 if (quantity > stackable)
10581 split_quantity_new = stackable;
10582 else
10583 split_quantity_new = quantity;
10584
10586 {
10587 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10588 if (new_item)
10589 {
10590 new_item.SetResultOfSplit(true);
10591 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10593 new_item.
SetQuantity(split_quantity_new,
false,
true);
10594 }
10595 }
10596 }
10597 }
10598
10600 {
10602 {
10603 if (ScriptInputUserData.CanStoreInputUserData())
10604 {
10605 ScriptInputUserData ctx = new ScriptInputUserData;
10610 ItemBase destination_entity =
this;
10611 ctx.
Write(destination_entity);
10615 }
10616 }
10617 else if (!
GetGame().IsMultiplayer())
10618 {
10620 }
10621 }
10622
10624 {
10626 float split_quantity_new;
10628 if (player)
10629 {
10631 if (quantity > stackable)
10632 split_quantity_new = stackable;
10633 else
10634 split_quantity_new = quantity;
10635
10637 {
10638 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10639 new_item =
ItemBase.Cast(in_hands);
10640 if (new_item)
10641 {
10642 new_item.SetResultOfSplit(true);
10643 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10645 new_item.SetQuantity(split_quantity_new, false, true);
10646 }
10647 }
10648 }
10649 }
10650
10652 {
10654 float split_quantity_new = Math.Floor(quantity * 0.5);
10655
10657 return;
10658
10660
10661 if (new_item)
10662 {
10663 if (new_item.GetQuantityMax() < split_quantity_new)
10664 {
10665 split_quantity_new = new_item.GetQuantityMax();
10666 }
10667
10668 new_item.SetResultOfSplit(true);
10669 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10670
10672 {
10675 }
10676 else
10677 {
10679 new_item.
SetQuantity(split_quantity_new,
false,
true);
10680 }
10681 }
10682 }
10683
10685 {
10687 float split_quantity_new = Math.Floor(quantity / 2);
10688
10690 return;
10691
10692 InventoryLocation invloc = new InventoryLocation;
10694
10696 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10697
10698 if (new_item)
10699 {
10700 if (new_item.GetQuantityMax() < split_quantity_new)
10701 {
10702 split_quantity_new = new_item.GetQuantityMax();
10703 }
10705 {
10708 }
10709 else if (split_quantity_new > 1)
10710 {
10712 new_item.
SetQuantity(split_quantity_new,
false,
true);
10713 }
10714 }
10715 }
10716
10719 {
10720 SetWeightDirty();
10722
10723 if (parent)
10724 parent.OnAttachmentQuantityChangedEx(this, delta);
10725
10727 {
10729 {
10731 }
10733 {
10734 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10736 }
10737 }
10738
10739 }
10740
10743 {
10744
10745 }
10746
10749 {
10751 }
10752
10754 {
10755 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10756
10758 {
10759 if (newLevel == GameConstants.STATE_RUINED)
10760 {
10762 EntityAI parent = GetHierarchyParent();
10763 if (parent && parent.IsFireplace())
10764 {
10765 CargoBase cargo = GetInventory().GetCargo();
10766 if (cargo)
10767 {
10769 {
10771 }
10772 }
10773 }
10774 }
10775
10777 {
10778
10780 return;
10781 }
10782
10783 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10784 {
10786 }
10787 }
10788 }
10789
10790
10792 {
10793 super.OnRightClick();
10794
10796 {
10798 {
10799 if (ScriptInputUserData.CanStoreInputUserData())
10800 {
10801 EntityAI root = GetHierarchyRoot();
10802 Man playerOwner = GetHierarchyRootPlayer();
10803 InventoryLocation dst = new InventoryLocation;
10804
10805
10806 if (!playerOwner && root && root == this)
10807 {
10809 }
10810 else
10811 {
10812
10813 GetInventory().GetCurrentInventoryLocation(dst);
10815 {
10818 {
10820 }
10821 else
10822 {
10824
10825
10826 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10827 {
10829 }
10830 else
10831 {
10832 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10833 }
10834 }
10835 }
10836 }
10837
10838 ScriptInputUserData ctx = new ScriptInputUserData;
10846 }
10847 }
10848 else if (!
GetGame().IsMultiplayer())
10849 {
10851 }
10852 }
10853 }
10854
10856 {
10857 if (root)
10858 {
10859 vector m4[4];
10860 root.GetTransform(m4);
10861 dst.SetGround(this, m4);
10862 }
10863 else
10864 {
10865 GetInventory().GetCurrentInventoryLocation(dst);
10866 }
10867 }
10868
10869 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10870 {
10871
10872 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10873 return false;
10874
10875 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10876 return false;
10877
10878
10880 return false;
10881
10882
10883 Magazine mag = Magazine.Cast(this);
10884 if (mag)
10885 {
10886 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10887 return false;
10888
10889 if (stack_max_limit)
10890 {
10891 Magazine other_mag = Magazine.Cast(other_item);
10892 if (other_item)
10893 {
10894 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10895 return false;
10896 }
10897
10898 }
10899 }
10900 else
10901 {
10902
10904 return false;
10905
10907 return false;
10908 }
10909
10910 PlayerBase player = null;
10911 if (CastTo(player, GetHierarchyRootPlayer()))
10912 {
10913 if (player.GetInventory().HasAttachment(this))
10914 return false;
10915
10916 if (player.IsItemsToDelete())
10917 return false;
10918 }
10919
10920 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10921 return false;
10922
10923 int slotID;
10925 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10926 return false;
10927
10928 return true;
10929 }
10930
10932 {
10934 }
10935
10937 {
10938 return m_IsResultOfSplit;
10939 }
10940
10942 {
10943 m_IsResultOfSplit = value;
10944 }
10945
10947 {
10949 }
10950
10952 {
10953 float other_item_quantity = other_item.GetQuantity();
10954 float this_free_space;
10955
10957
10959
10960 if (other_item_quantity > this_free_space)
10961 {
10962 return this_free_space;
10963 }
10964 else
10965 {
10966 return other_item_quantity;
10967 }
10968 }
10969
10971 {
10973 }
10974
10976 {
10978 return;
10979
10980 if (!IsMagazine() && other_item)
10981 {
10983 if (quantity_used != 0)
10984 {
10985 float hp1 = GetHealth01("","");
10986 float hp2 = other_item.GetHealth01("","");
10987 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10988 hpResult = hpResult / (
GetQuantity() + quantity_used);
10989
10990 hpResult *= GetMaxHealth();
10991 Math.Round(hpResult);
10992 SetHealth("", "Health", hpResult);
10993
10995 other_item.AddQuantity(-quantity_used);
10996 }
10997 }
10999 }
11000
11002 {
11003 #ifdef SERVER
11004 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11005 GetHierarchyParent().IncreaseLifetimeUp();
11006 #endif
11007 };
11008
11010 {
11011 PlayerBase p = PlayerBase.Cast(player);
11012
11013 array<int> recipesIds = p.m_Recipes;
11014 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11015 if (moduleRecipesManager)
11016 {
11017 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11018 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11019 }
11020
11021 for (int i = 0;i < recipesIds.Count(); i++)
11022 {
11023 int key = recipesIds.Get(i);
11024 string recipeName = moduleRecipesManager.GetRecipeName(key);
11026 }
11027 }
11028
11029
11030 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11031 {
11032 super.GetDebugActions(outputList);
11033
11034
11040
11041
11046
11051
11052
11056
11057
11059 {
11063 }
11064
11067
11068
11072
11074
11075 InventoryLocation loc = new InventoryLocation();
11076 GetInventory().GetCurrentInventoryLocation(loc);
11078 {
11079 if (Gizmo_IsSupported())
11082 }
11083
11085 }
11086
11087
11088
11089
11091 {
11092 super.OnAction(action_id, player, ctx);
11093
11095 {
11096 switch (action_id)
11097 {
11100 return true;
11103 return true;
11104 }
11105 }
11106
11108 {
11109 switch (action_id)
11110 {
11112 Delete();
11113 return true;
11114 }
11115 }
11116
11117 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11118 {
11119 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11120 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11121 PlayerBase p = PlayerBase.Cast(player);
11122 if (
EActions.RECIPES_RANGE_START < 1000)
11123 {
11124 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11125 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11126 }
11127 }
11128 #ifndef SERVER
11129 else if (action_id ==
EActions.WATCH_PLAYER)
11130 {
11131 PluginDeveloper.SetDeveloperItemClientEx(player);
11132 }
11133 #endif
11135 {
11136 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11137 {
11138 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11139 OnDebugButtonPressServer(id + 1);
11140 }
11141
11142 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11143 {
11144 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11146 }
11147
11148 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11149 {
11150 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11152 }
11153
11154 else if (action_id ==
EActions.ADD_QUANTITY)
11155 {
11156 if (IsMagazine())
11157 {
11158 Magazine mag = Magazine.Cast(this);
11159 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11160 }
11161 else
11162 {
11164 }
11165
11166 if (m_EM)
11167 {
11168 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11169 }
11170
11171 }
11172
11173 else if (action_id ==
EActions.REMOVE_QUANTITY)
11174 {
11175 if (IsMagazine())
11176 {
11177 Magazine mag2 = Magazine.Cast(this);
11178 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11179 }
11180 else
11181 {
11183 }
11184 if (m_EM)
11185 {
11186 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11187 }
11188
11189 }
11190
11191 else if (action_id ==
EActions.SET_QUANTITY_0)
11192 {
11194
11195 if (m_EM)
11196 {
11197 m_EM.SetEnergy(0);
11198 }
11199 }
11200
11201 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11202 {
11204
11205 if (m_EM)
11206 {
11207 m_EM.SetEnergy(m_EM.GetEnergyMax());
11208 }
11209 }
11210
11211 else if (action_id ==
EActions.ADD_HEALTH)
11212 {
11213 AddHealth("","",GetMaxHealth("","Health")/5);
11214 }
11215 else if (action_id ==
EActions.REMOVE_HEALTH)
11216 {
11217 AddHealth("","",-GetMaxHealth("","Health")/5);
11218 }
11219 else if (action_id ==
EActions.DESTROY_HEALTH)
11220 {
11221 SetHealth01("","",0);
11222 }
11223 else if (action_id ==
EActions.WATCH_ITEM)
11224 {
11226 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11227 #ifdef DEVELOPER
11228 SetDebugDeveloper_item(this);
11229 #endif
11230 }
11231
11232 else if (action_id ==
EActions.ADD_TEMPERATURE)
11233 {
11234 AddTemperature(20);
11235
11236 }
11237
11238 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11239 {
11240 AddTemperature(-20);
11241
11242 }
11243
11244 else if (action_id ==
EActions.FLIP_FROZEN)
11245 {
11246 SetFrozen(!GetIsFrozen());
11247
11248 }
11249
11250 else if (action_id ==
EActions.ADD_WETNESS)
11251 {
11253
11254 }
11255
11256 else if (action_id ==
EActions.REMOVE_WETNESS)
11257 {
11259
11260 }
11261
11262 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11263 {
11266
11267
11268 }
11269
11270 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11271 {
11274 }
11275
11276 else if (action_id ==
EActions.MAKE_SPECIAL)
11277 {
11278 auto debugParams = DebugSpawnParams.WithPlayer(player);
11279 OnDebugSpawnEx(debugParams);
11280 }
11281
11282 }
11283
11284
11285 return false;
11286 }
11287
11288
11289
11290
11294
11297
11298
11299
11301 {
11302 return false;
11303 }
11304
11305
11307 {
11308 return true;
11309 }
11310
11311
11313 {
11314 return true;
11315 }
11316
11317
11318
11320 {
11321 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11323 }
11324
11327 {
11328 return null;
11329 }
11330
11332 {
11333 return false;
11334 }
11335
11337 {
11338 return false;
11339 }
11340
11344
11345
11347 {
11348 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11349 return module_repairing.CanRepair(this, item_repair_kit);
11350 }
11351
11352
11353 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11354 {
11355 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11356 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11357 }
11358
11359
11361 {
11362
11363
11364
11365
11366
11367
11368
11369
11370 return 1;
11371 }
11372
11373
11374
11376 {
11378 }
11379
11380
11381
11383 {
11385 }
11386
11387
11396 {
11397 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11398
11399 if (player)
11400 {
11401 player.MessageStatus(text);
11402 }
11403 }
11404
11405
11414 {
11415 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11416
11417 if (player)
11418 {
11419 player.MessageAction(text);
11420 }
11421 }
11422
11423
11432 {
11433 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11434
11435 if (player)
11436 {
11437 player.MessageFriendly(text);
11438 }
11439 }
11440
11441
11450 {
11451 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11452
11453 if (player)
11454 {
11455 player.MessageImportant(text);
11456 }
11457 }
11458
11460 {
11461 return true;
11462 }
11463
11464
11465 override bool KindOf(
string tag)
11466 {
11467 bool found = false;
11468 string item_name = this.
GetType();
11471
11472 int array_size = item_tag_array.Count();
11473 for (int i = 0; i < array_size; i++)
11474 {
11475 if (item_tag_array.Get(i) == tag)
11476 {
11477 found = true;
11478 break;
11479 }
11480 }
11481 return found;
11482 }
11483
11484
11486 {
11487
11488 super.OnRPC(sender, rpc_type,ctx);
11489
11490
11491 switch (rpc_type)
11492 {
11493 #ifndef SERVER
11494 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11495 Param2<bool, string> p = new Param2<bool, string>(false, "");
11496
11498 return;
11499
11500 bool play = p.param1;
11501 string soundSet = p.param2;
11502
11503 if (play)
11504 {
11506 {
11508 {
11510 }
11511 }
11512 else
11513 {
11515 }
11516 }
11517 else
11518 {
11520 }
11521
11522 break;
11523 #endif
11524
11525 }
11526
11528 {
11530 }
11531 }
11532
11533
11534
11535
11537 {
11538 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11539 return plugin.GetID(
name);
11540 }
11541
11543 {
11544 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11545 return plugin.GetName(id);
11546 }
11547
11550 {
11551
11552
11553 int varFlags;
11554 if (!ctx.
Read(varFlags))
11555 return;
11556
11557 if (varFlags & ItemVariableFlags.FLOAT)
11558 {
11560 }
11561 }
11562
11564 {
11565
11566 super.SerializeNumericalVars(floats_out);
11567
11568
11569
11571 {
11573 }
11574
11576 {
11578 }
11579
11581 {
11583 }
11584
11586 {
11591 }
11592
11594 {
11596 }
11597 }
11598
11600 {
11601
11602 super.DeSerializeNumericalVars(floats);
11603
11604
11605 int index = 0;
11606 int mask = Math.Round(floats.Get(index));
11607
11608 index++;
11609
11611 {
11613 {
11615 }
11616 else
11617 {
11618 float quantity = floats.Get(index);
11619 SetQuantity(quantity,
true,
false,
false,
false);
11620 }
11621 index++;
11622 }
11623
11625 {
11626 float wet = floats.Get(index);
11628 index++;
11629 }
11630
11632 {
11633 int liquidtype = Math.Round(floats.Get(index));
11635 index++;
11636 }
11637
11639 {
11641 index++;
11643 index++;
11645 index++;
11647 index++;
11648 }
11649
11651 {
11652 int cleanness = Math.Round(floats.Get(index));
11654 index++;
11655 }
11656 }
11657
11659 {
11660 super.WriteVarsToCTX(ctx);
11661
11662
11664 {
11666 }
11667
11669 {
11671 }
11672
11674 {
11676 }
11677
11679 {
11680 int r,g,b,a;
11686 }
11687
11689 {
11691 }
11692 }
11693
11695 {
11696 if (!super.ReadVarsFromCTX(ctx,version))
11697 return false;
11698
11699 int intValue;
11700 float value;
11701
11702 if (version < 140)
11703 {
11704 if (!ctx.
Read(intValue))
11705 return false;
11706
11707 m_VariablesMask = intValue;
11708 }
11709
11711 {
11712 if (!ctx.
Read(value))
11713 return false;
11714
11716 {
11718 }
11719 else
11720 {
11722 }
11723 }
11724
11725 if (version < 140)
11726 {
11728 {
11729 if (!ctx.
Read(value))
11730 return false;
11731 SetTemperatureDirect(value);
11732 }
11733 }
11734
11736 {
11737 if (!ctx.
Read(value))
11738 return false;
11740 }
11741
11743 {
11744 if (!ctx.
Read(intValue))
11745 return false;
11747 }
11748
11750 {
11751 int r,g,b,a;
11753 return false;
11755 return false;
11757 return false;
11759 return false;
11760
11762 }
11763
11765 {
11766 if (!ctx.
Read(intValue))
11767 return false;
11769 }
11770
11771 if (version >= 138 && version < 140)
11772 {
11774 {
11775 if (!ctx.
Read(intValue))
11776 return false;
11777 SetFrozen(intValue);
11778 }
11779 }
11780
11781 return true;
11782 }
11783
11784
11786 {
11789 {
11791 }
11792
11793 if (!super.OnStoreLoad(ctx, version))
11794 {
11796 return false;
11797 }
11798
11799 if (version >= 114)
11800 {
11801 bool hasQuickBarIndexSaved;
11802
11803 if (!ctx.
Read(hasQuickBarIndexSaved))
11804 {
11806 return false;
11807 }
11808
11809 if (hasQuickBarIndexSaved)
11810 {
11811 int itmQBIndex;
11812
11813
11814 if (!ctx.
Read(itmQBIndex))
11815 {
11817 return false;
11818 }
11819
11820 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11821 if (itmQBIndex != -1 && parentPlayer)
11822 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11823 }
11824 }
11825 else
11826 {
11827
11828 PlayerBase player;
11829 int itemQBIndex;
11830 if (version ==
int.
MAX)
11831 {
11832 if (!ctx.
Read(itemQBIndex))
11833 {
11835 return false;
11836 }
11837 }
11838 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11839 {
11840
11841 if (!ctx.
Read(itemQBIndex))
11842 {
11844 return false;
11845 }
11846 if (itemQBIndex != -1 && player)
11847 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11848 }
11849 }
11850
11851 if (version < 140)
11852 {
11853
11854 if (!LoadVariables(ctx, version))
11855 {
11857 return false;
11858 }
11859 }
11860
11861
11863 {
11865 return false;
11866 }
11867 if (version >= 132)
11868 {
11870 if (raib)
11871 {
11873 {
11875 return false;
11876 }
11877 }
11878 }
11879
11881 return true;
11882 }
11883
11884
11885
11887 {
11888 super.OnStoreSave(ctx);
11889
11890 PlayerBase player;
11891 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11892 {
11894
11895 int itemQBIndex = -1;
11896 itemQBIndex = player.FindQuickBarEntityIndex(this);
11897 ctx.
Write(itemQBIndex);
11898 }
11899 else
11900 {
11902 }
11903
11905
11907 if (raib)
11908 {
11910 }
11911 }
11912
11913
11915 {
11916 super.AfterStoreLoad();
11917
11919 {
11921 }
11922
11924 {
11927 }
11928 }
11929
11931 {
11932 super.EEOnAfterLoad();
11933
11935 {
11937 }
11938
11941 }
11942
11944 {
11945 return false;
11946 }
11947
11948
11949
11951 {
11953 {
11954 #ifdef PLATFORM_CONSOLE
11955
11957 {
11959 if (menu)
11960 {
11962 }
11963 }
11964 #endif
11965 }
11966
11968 {
11971 }
11972
11974 {
11975 SetWeightDirty();
11977 }
11979 {
11982 }
11983
11985 {
11988 }
11990 {
11993 }
11994
11995 super.OnVariablesSynchronized();
11996 }
11997
11998
11999
12001 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12002 {
12003 if (!IsServerCheck(allow_client))
12004 return false;
12005
12007 return false;
12008
12011
12012 if (value <= (min + 0.001))
12013 value = min;
12014
12015 if (value == min)
12016 {
12017 if (destroy_config)
12018 {
12019 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12020 if (dstr)
12021 {
12023 this.Delete();
12024 return true;
12025 }
12026 }
12027 else if (destroy_forced)
12028 {
12030 this.Delete();
12031 return true;
12032 }
12033
12035 }
12036
12039
12041 {
12043
12044 if (delta)
12046 }
12047
12049
12050 return false;
12051 }
12052
12053
12055 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12056 {
12058 }
12059
12061 {
12064 }
12065
12067 {
12070 }
12071
12073 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12074 {
12075 float value_clamped = Math.Clamp(value, 0, 1);
12077 SetQuantity(result, destroy_config, destroy_forced);
12078 }
12079
12080
12083 {
12085 }
12086
12088 {
12090 }
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12102 {
12103 int slot = -1;
12104 if (GetInventory())
12105 {
12106 InventoryLocation il = new InventoryLocation;
12107 GetInventory().GetCurrentInventoryLocation(il);
12109 }
12110
12112 }
12113
12115 {
12116 float quantity_max = 0;
12117
12119 {
12120 if (attSlotID != -1)
12121 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12122
12123 if (quantity_max <= 0)
12125 }
12126
12127 if (quantity_max <= 0)
12129
12130 return quantity_max;
12131 }
12132
12134 {
12136 }
12137
12139 {
12141 }
12142
12143
12145 {
12147 }
12148
12150 {
12152 }
12153
12155 {
12157 }
12158
12159
12161 {
12162
12163 float weightEx = GetWeightEx();
12164 float special = GetInventoryAndCargoWeight();
12165 return weightEx - special;
12166 }
12167
12168
12170 {
12172 }
12173
12175 {
12177 {
12178 #ifdef DEVELOPER
12179 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12180 {
12181 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12183 }
12184 #endif
12185
12186 return GetQuantity() * GetConfigWeightModified();
12187 }
12188 else if (HasEnergyManager())
12189 {
12190 #ifdef DEVELOPER
12191 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12192 {
12193 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12194 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12195 }
12196 #endif
12197 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12198 }
12199 else
12200 {
12201 #ifdef DEVELOPER
12202 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12203 {
12204 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12205 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12206 }
12207 #endif
12208 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12209 }
12210 }
12211
12214 {
12215 int item_count = 0;
12217
12218 if (GetInventory().GetCargo() != NULL)
12219 {
12220 item_count = GetInventory().GetCargo().GetItemCount();
12221 }
12222
12223 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12224 {
12225 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12226 if (item)
12227 item_count += item.GetNumberOfItems();
12228 }
12229 return item_count;
12230 }
12231
12234 {
12235 float weight = 0;
12236 float wetness = 1;
12237 if (include_wetness)
12240 {
12241 weight = wetness * m_ConfigWeight;
12242 }
12244 {
12245 weight = 1;
12246 }
12247 return weight;
12248 }
12249
12250
12251
12253 {
12254 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12255 {
12256 GameInventory inv = GetInventory();
12257 array<EntityAI> items = new array<EntityAI>;
12259 for (int i = 0; i < items.Count(); i++)
12260 {
12262 if (item)
12263 {
12265 }
12266 }
12267 }
12268 }
12269
12270
12271
12272
12274 {
12275 float energy = 0;
12276 if (HasEnergyManager())
12277 {
12278 energy = GetCompEM().GetEnergy();
12279 }
12280 return energy;
12281 }
12282
12283
12285 {
12286 super.OnEnergyConsumed();
12287
12289 }
12290
12292 {
12293 super.OnEnergyAdded();
12294
12296 }
12297
12298
12300 {
12301 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12302 {
12304 {
12305 float energy_0to1 = GetCompEM().GetEnergy0To1();
12307 }
12308 }
12309 }
12310
12311
12313 {
12314 return ConfigGetFloat("heatIsolation");
12315 }
12316
12318 {
12320 }
12321
12323 {
12324 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12325 if (
GetGame().ConfigIsExisting(paramPath))
12327
12328 return 0.0;
12329 }
12330
12332 {
12333 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12334 if (
GetGame().ConfigIsExisting(paramPath))
12336
12337 return 0.0;
12338 }
12339
12340 override void SetWet(
float value,
bool allow_client =
false)
12341 {
12342 if (!IsServerCheck(allow_client))
12343 return;
12344
12347
12349
12350 m_VarWet = Math.Clamp(value, min, max);
12351
12353 {
12356 }
12357 }
12358
12359 override void AddWet(
float value)
12360 {
12362 }
12363
12365 {
12367 }
12368
12370 {
12372 }
12373
12375 {
12377 }
12378
12380 {
12382 }
12383
12385 {
12387 }
12388
12389 override void OnWetChanged(
float newVal,
float oldVal)
12390 {
12393 if (newLevel != oldLevel)
12394 {
12396 }
12397 }
12398
12400 {
12401 SetWeightDirty();
12402 }
12403
12405 {
12406 return GetWetLevelInternal(
m_VarWet);
12407 }
12408
12409
12410
12412 {
12414 }
12415
12417 {
12419 }
12420
12422 {
12424 }
12425
12427 {
12429 }
12430
12431
12432
12434 {
12435 if (ConfigIsExisting("itemModelLength"))
12436 {
12437 return ConfigGetFloat("itemModelLength");
12438 }
12439 return 0;
12440 }
12441
12443 {
12444 if (ConfigIsExisting("itemAttachOffset"))
12445 {
12446 return ConfigGetFloat("itemAttachOffset");
12447 }
12448 return 0;
12449 }
12450
12451 override void SetCleanness(
int value,
bool allow_client =
false)
12452 {
12453 if (!IsServerCheck(allow_client))
12454 return;
12455
12457
12459
12462 }
12463
12465 {
12467 }
12468
12470 {
12471 return true;
12472 }
12473
12474
12475
12476
12478 {
12480 }
12481
12483 {
12485 }
12486
12487
12488
12489
12490 override void SetColor(
int r,
int g,
int b,
int a)
12491 {
12497 }
12499 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12500 {
12505 }
12506
12508 {
12510 }
12511
12514 {
12515 int r,g,b,a;
12517 r = r/255;
12518 g = g/255;
12519 b = b/255;
12520 a = a/255;
12521 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12522 }
12523
12524
12525
12526 override void SetLiquidType(
int value,
bool allow_client =
false)
12527 {
12528 if (!IsServerCheck(allow_client))
12529 return;
12530
12535 }
12536
12538 {
12539 return ConfigGetInt("varLiquidTypeInit");
12540 }
12541
12543 {
12545 }
12546
12548 {
12550 SetFrozen(false);
12551 }
12552
12555 {
12556 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12557 }
12558
12559
12562 {
12563 PlayerBase nplayer;
12564 if (PlayerBase.CastTo(nplayer, player))
12565 {
12567
12568 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12569 }
12570 }
12571
12572
12575 {
12576 PlayerBase nplayer;
12577 if (PlayerBase.CastTo(nplayer,player))
12578 {
12579
12580 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12581
12582 }
12583
12584
12585 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12586
12587
12588 if (HasEnergyManager())
12589 {
12590 GetCompEM().UpdatePlugState();
12591 }
12592 }
12593
12594
12596 {
12597 super.OnPlacementStarted(player);
12598
12600 }
12601
12602 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12603 {
12605 {
12606 m_AdminLog.OnPlacementComplete(player,
this);
12607 }
12608
12609 super.OnPlacementComplete(player, position, orientation);
12610 }
12611
12612
12613
12614
12615
12617 {
12619 {
12620 return true;
12621 }
12622 else
12623 {
12624 return false;
12625 }
12626 }
12627
12628
12630 {
12632 {
12634 }
12635 }
12636
12637
12639 {
12641 }
12642
12644 {
12646 }
12647
12648 override void InsertAgent(
int agent,
float count = 1)
12649 {
12650 if (count < 1)
12651 return;
12652
12654 }
12655
12658 {
12660 }
12661
12662
12664 {
12666 }
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12710 {
12712 return false;
12713 return true;
12714 }
12715
12717 {
12718
12720 }
12721
12722
12725 {
12726 super.CheckForRoofLimited(timeTresholdMS);
12727
12729 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12730 {
12731 m_PreviousRoofTestTime = time;
12732 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12733 }
12734 }
12735
12736
12738 {
12740 {
12741 return 0;
12742 }
12743
12744 if (GetInventory().GetAttachmentSlotsCount() != 0)
12745 {
12746 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12747 if (filter)
12748 return filter.GetProtectionLevel(type, false, system);
12749 else
12750 return 0;
12751 }
12752
12753 string subclassPath, entryName;
12754
12755 switch (type)
12756 {
12758 entryName = "biological";
12759 break;
12761 entryName = "chemical";
12762 break;
12763 default:
12764 entryName = "biological";
12765 break;
12766 }
12767
12768 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12769
12771 }
12772
12773
12774
12777 {
12778 if (!IsMagazine())
12780
12782 }
12783
12784
12785
12786
12787
12792 {
12793 return true;
12794 }
12795
12797 {
12799 }
12800
12801
12802
12803
12804
12806 {
12807 if (parent)
12808 {
12809 if (parent.IsInherited(DayZInfected))
12810 return true;
12811
12812 if (!parent.IsRuined())
12813 return true;
12814 }
12815
12816 return true;
12817 }
12818
12820 {
12821 if (!super.CanPutAsAttachment(parent))
12822 {
12823 return false;
12824 }
12825
12826 if (!IsRuined() && !parent.IsRuined())
12827 {
12828 return true;
12829 }
12830
12831 return false;
12832 }
12833
12835 {
12836
12837
12838
12839
12840 return super.CanReceiveItemIntoCargo(item);
12841 }
12842
12844 {
12845
12846
12847
12848
12849 GameInventory attachmentInv = attachment.GetInventory();
12851 {
12852 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12853 return false;
12854 }
12855
12856 InventoryLocation loc = new InventoryLocation();
12857 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12858 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12859 return false;
12860
12861 return super.CanReceiveAttachment(attachment, slotId);
12862 }
12863
12865 {
12866 if (!super.CanReleaseAttachment(attachment))
12867 return false;
12868
12869 return GetInventory().AreChildrenAccessible();
12870 }
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12893 {
12894 int id = muzzle_owner.GetMuzzleID();
12895 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12896
12897 if (WPOF_array)
12898 {
12899 for (int i = 0; i < WPOF_array.Count(); i++)
12900 {
12901 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12902
12903 if (WPOF)
12904 {
12905 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12906 }
12907 }
12908 }
12909 }
12910
12911
12913 {
12914 int id = muzzle_owner.GetMuzzleID();
12916
12917 if (WPOBE_array)
12918 {
12919 for (int i = 0; i < WPOBE_array.Count(); i++)
12920 {
12921 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12922
12923 if (WPOBE)
12924 {
12925 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12926 }
12927 }
12928 }
12929 }
12930
12931
12933 {
12934 int id = muzzle_owner.GetMuzzleID();
12935 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12936
12937 if (WPOOH_array)
12938 {
12939 for (int i = 0; i < WPOOH_array.Count(); i++)
12940 {
12941 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12942
12943 if (WPOOH)
12944 {
12945 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12946 }
12947 }
12948 }
12949 }
12950
12951
12953 {
12954 int id = muzzle_owner.GetMuzzleID();
12955 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12956
12957 if (WPOOH_array)
12958 {
12959 for (int i = 0; i < WPOOH_array.Count(); i++)
12960 {
12961 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12962
12963 if (WPOOH)
12964 {
12965 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12966 }
12967 }
12968 }
12969 }
12970
12971
12973 {
12974 int id = muzzle_owner.GetMuzzleID();
12975 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12976
12977 if (WPOOH_array)
12978 {
12979 for (int i = 0; i < WPOOH_array.Count(); i++)
12980 {
12981 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12982
12983 if (WPOOH)
12984 {
12985 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12986 }
12987 }
12988 }
12989 }
12990
12991
12992
12994 {
12996 {
12997 return true;
12998 }
12999
13000 return false;
13001 }
13002
13004 {
13006 {
13007 return true;
13008 }
13009
13010 return false;
13011 }
13012
13014 {
13016 {
13017 return true;
13018 }
13019
13020 return false;
13021 }
13022
13024 {
13025 return false;
13026 }
13027
13030 {
13031 return UATimeSpent.DEFAULT_DEPLOY;
13032 }
13033
13034
13035
13036
13038 {
13040 SetSynchDirty();
13041 }
13042
13044 {
13046 }
13047
13048
13050 {
13051 return false;
13052 }
13053
13056 {
13057 string att_type = "None";
13058
13059 if (ConfigIsExisting("soundAttType"))
13060 {
13061 att_type = ConfigGetString("soundAttType");
13062 }
13063
13065 }
13066
13068 {
13070 }
13071
13072
13073
13074
13075
13081
13083 {
13086
13088 }
13089
13090
13092 {
13094 return;
13095
13097
13100
13103
13104 SoundParameters params = new SoundParameters();
13108 }
13109
13110
13112 {
13114 return;
13115
13117 SetSynchDirty();
13118
13121 }
13122
13123
13125 {
13127 return;
13128
13130 SetSynchDirty();
13131
13134 }
13135
13137 {
13139 }
13140
13142 {
13144 }
13145
13148 {
13149 if (!
GetGame().IsDedicatedServer())
13150 {
13151 if (ConfigIsExisting("attachSoundSet"))
13152 {
13153 string cfg_path = "";
13154 string soundset = "";
13155 string type_name =
GetType();
13156
13159 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13160 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13161
13162 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13163 {
13164 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13165 {
13166 if (cfg_slot_array[i] == slot_type)
13167 {
13168 soundset = cfg_soundset_array[i];
13169 break;
13170 }
13171 }
13172 }
13173
13174 if (soundset != "")
13175 {
13176 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13178 }
13179 }
13180 }
13181 }
13182
13184 {
13185
13186 }
13187
13188 void OnApply(PlayerBase player);
13189
13191 {
13192 return 1.0;
13193 };
13194
13196 {
13198 }
13199
13201 {
13203 }
13204
13206
13208 {
13209 SetDynamicPhysicsLifeTime(0.01);
13211 }
13212
13214 {
13215 array<string> zone_names = new array<string>;
13216 GetDamageZones(zone_names);
13217 for (int i = 0; i < zone_names.Count(); i++)
13218 {
13219 SetHealthMax(zone_names.Get(i),"Health");
13220 }
13221 SetHealthMax("","Health");
13222 }
13223
13226 {
13227 float global_health = GetHealth01("","Health");
13228 array<string> zones = new array<string>;
13229 GetDamageZones(zones);
13230
13231 for (int i = 0; i < zones.Count(); i++)
13232 {
13233 SetHealth01(zones.Get(i),"Health",global_health);
13234 }
13235 }
13236
13239 {
13240 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13241 }
13242
13244 {
13245 if (!hasRootAsPlayer)
13246 {
13247 if (refParentIB)
13248 {
13249
13250 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13251 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13252
13253 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13254 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13255
13258 }
13259 else
13260 {
13261
13264 }
13265 }
13266 }
13267
13269 {
13271 {
13272 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13273 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13274 {
13275 float heatPermCoef = 1.0;
13277 while (ent)
13278 {
13279 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13280 ent = ent.GetHierarchyParent();
13281 }
13282
13283 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13284 }
13285 }
13286 }
13287
13289 {
13290
13291 EntityAI parent = GetHierarchyParent();
13292 if (!parent)
13293 {
13294 hasParent = false;
13295 hasRootAsPlayer = false;
13296 }
13297 else
13298 {
13299 hasParent = true;
13300 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13301 refParentIB =
ItemBase.Cast(parent);
13302 }
13303 }
13304
13305 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13306 {
13307
13308 }
13309
13311 {
13312
13313 return false;
13314 }
13315
13317 {
13318
13319
13320 return false;
13321 }
13322
13324 {
13325
13326 return false;
13327 }
13328
13331 {
13332 return !GetIsFrozen() &&
IsOpen();
13333 }
13334
13336 {
13337 bool hasParent = false, hasRootAsPlayer = false;
13339
13340 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13341 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13342
13343 if (wwtu || foodDecay)
13344 {
13348
13349 if (processWetness || processTemperature || processDecay)
13350 {
13352
13353 if (processWetness)
13354 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13355
13356 if (processTemperature)
13358
13359 if (processDecay)
13360 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13361 }
13362 }
13363 }
13364
13367 {
13369 }
13370
13372 {
13375
13376 return super.GetTemperatureFreezeThreshold();
13377 }
13378
13380 {
13383
13384 return super.GetTemperatureThawThreshold();
13385 }
13386
13388 {
13391
13392 return super.GetItemOverheatThreshold();
13393 }
13394
13396 {
13398 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13399
13400 return super.GetTemperatureFreezeTime();
13401 }
13402
13404 {
13406 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13407
13408 return super.GetTemperatureThawTime();
13409 }
13410
13415
13417 {
13418 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13419 }
13420
13422 {
13423 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13424 }
13425
13428 {
13430 }
13431
13433 {
13435 }
13436
13438 {
13440 }
13441
13444 {
13445 return null;
13446 }
13447
13450 {
13451 return false;
13452 }
13453
13455 {
13457 {
13460 if (!trg)
13461 {
13463 explosive = this;
13464 }
13465
13466 explosive.PairRemote(trg);
13468
13469 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13470 trg.SetPersistentPairID(persistentID);
13471 explosive.SetPersistentPairID(persistentID);
13472
13473 return true;
13474 }
13475 return false;
13476 }
13477
13480 {
13481 float ret = 1.0;
13484 ret *= GetHealth01();
13485
13486 return ret;
13487 }
13488
13489 #ifdef DEVELOPER
13490 override void SetDebugItem()
13491 {
13492 super.SetDebugItem();
13493 _itemBase = this;
13494 }
13495
13497 {
13498 string text = super.GetDebugText();
13499
13501 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13502
13503 return text;
13504 }
13505 #endif
13506
13508 {
13509 return true;
13510 }
13511
13513
13515
13517 {
13520 }
13521
13522
13530
13546}
13547
13549{
13551 if (entity)
13552 {
13553 bool is_item = entity.IsInherited(
ItemBase);
13554 if (is_item && full_quantity)
13555 {
13558 }
13559 }
13560 else
13561 {
13563 return NULL;
13564 }
13565 return entity;
13566}
13567
13569{
13570 if (item)
13571 {
13572 if (health > 0)
13573 item.SetHealth("", "", health);
13574
13575 if (item.CanHaveTemperature())
13576 {
13578 if (item.CanFreeze())
13579 item.SetFrozen(false);
13580 }
13581
13582 if (item.HasEnergyManager())
13583 {
13584 if (quantity >= 0)
13585 {
13586 item.GetCompEM().SetEnergy0To1(quantity);
13587 }
13588 else
13589 {
13591 }
13592 }
13593 else if (item.IsMagazine())
13594 {
13595 Magazine mag = Magazine.Cast(item);
13596 if (quantity >= 0)
13597 {
13598 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13599 }
13600 else
13601 {
13603 }
13604
13605 }
13606 else
13607 {
13608 if (quantity >= 0)
13609 {
13610 item.SetQuantityNormalized(quantity, false);
13611 }
13612 else
13613 {
13615 }
13616
13617 }
13618 }
13619}
13620
13621#ifdef DEVELOPER
13623#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.