8672{
8674 {
8675 return true;
8676 }
8677};
8678
8679
8680
8682{
8686
8688
8691
8692
8693
8694
8695
8704
8710
8715
8720
8741 protected bool m_IsResultOfSplit
8742
8744
8749
8750
8751
8753
8757
8758
8759
8761
8764
8765
8766
8772
8773
8781
8784
8785
8787
8788
8790
8791
8796
8797
8802
8803
8805
8806
8808 {
8813
8814 if (!
GetGame().IsDedicatedServer())
8815 {
8817 {
8819
8821 {
8823 }
8824 }
8825
8828 }
8829
8830 m_OldLocation = null;
8831
8833 {
8835 }
8836
8837 if (ConfigIsExisting("headSelectionsToHide"))
8838 {
8841 }
8842
8844 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8845 {
8847 }
8848
8850
8851 m_IsResultOfSplit = false;
8852
8854 }
8855
8857 {
8858 super.InitItemVariables();
8859
8865 m_Count = ConfigGetInt(
"count");
8866
8869
8874
8877
8882
8894
8898
8899
8902 if (ConfigIsExisting("canBeSplit"))
8903 {
8906 }
8907
8909 if (ConfigIsExisting("itemBehaviour"))
8911
8912
8915 RegisterNetSyncVariableInt("m_VarLiquidType");
8916 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8917
8918 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8919 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8920 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8921
8922 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8923 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8924 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8925 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8926
8927 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8928 RegisterNetSyncVariableBool("m_IsTakeable");
8929 RegisterNetSyncVariableBool("m_IsHologram");
8930
8933 {
8936 }
8937
8939
8941 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8943
8944 }
8945
8947 {
8949 }
8950
8952 {
8955 {
8960 }
8961 }
8962
8963 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8964 {
8966 {
8969 }
8970
8972 }
8973
8975 {
8981 }
8982
8984
8986 {
8988
8989 if (!action)
8990 {
8991 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8992 return;
8993 }
8994
8996 if (!ai)
8997 {
8999 return;
9000 }
9001
9003 if (!action_array)
9004 {
9005 action_array = new array<ActionBase_Basic>;
9007 }
9008 if (LogManager.IsActionLogEnable())
9009 {
9010 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9011 }
9012
9013 if (action_array.Find(action) != -1)
9014 {
9015 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9016 }
9017 else
9018 {
9019 action_array.Insert(action);
9020 }
9021 }
9022
9024 {
9026 ActionBase action = player.GetActionManager().GetAction(actionName);
9029
9030 if (action_array)
9031 {
9032 action_array.RemoveItem(action);
9033 }
9034 }
9035
9036
9037
9039 {
9040 ActionOverrideData overrideData = new ActionOverrideData();
9044
9046 if (!actionMap)
9047 {
9050 }
9051
9052 actionMap.Insert(this.
Type(), overrideData);
9053
9054 }
9055
9057
9059
9060
9062 {
9065
9068
9069 string config_to_search = "CfgVehicles";
9070 string muzzle_owner_config;
9071
9073 {
9074 if (IsInherited(Weapon))
9075 config_to_search = "CfgWeapons";
9076
9077 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9078
9079 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9080
9082
9083 if (config_OnFire_subclass_count > 0)
9084 {
9085 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9086
9087 for (int i = 0; i < config_OnFire_subclass_count; i++)
9088 {
9089 string particle_class = "";
9091 string config_OnFire_entry = config_OnFire_class + particle_class;
9092 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9093 WPOF_array.Insert(WPOF);
9094 }
9095
9096
9098 }
9099 }
9100
9102 {
9103 config_to_search = "CfgWeapons";
9104 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9105
9106 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9107
9109
9110 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9111 {
9112 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9113
9114 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9115 {
9116 string particle_class2 = "";
9118 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9119 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9120 WPOBE_array.Insert(WPOBE);
9121 }
9122
9123
9125 }
9126 }
9127 }
9128
9129
9131 {
9134
9136 {
9137 string config_to_search = "CfgVehicles";
9138
9139 if (IsInherited(Weapon))
9140 config_to_search = "CfgWeapons";
9141
9142 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9143 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9144
9145 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9146 {
9147
9149
9151 {
9153 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9155 return;
9156 }
9157
9160
9161
9162
9164 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9165
9166 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9167 {
9168 string particle_class = "";
9170 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9172
9173 if (entry_type == CT_CLASS)
9174 {
9175 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9176 WPOOH_array.Insert(WPOF);
9177 }
9178 }
9179
9180
9182 }
9183 }
9184 }
9185
9187 {
9189 }
9190
9192 {
9194 {
9196
9199
9202
9203 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9204 }
9205 }
9206
9208 {
9210 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9211
9213 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9214
9216 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9217
9219 {
9221 }
9222 }
9223
9225 {
9227 }
9228
9230 {
9233 else
9235
9237 {
9240 }
9241 else
9242 {
9245
9248 }
9249
9251 }
9252
9254 {
9256 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9257 }
9258
9260 {
9262 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9264 }
9265
9267 {
9269 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9270 }
9271
9273 {
9276
9277 OverheatingParticle OP = new OverheatingParticle();
9282
9284 }
9285
9287 {
9290
9291 return -1;
9292 }
9293
9295 {
9297 {
9300
9301 for (int i = count; i > 0; --i)
9302 {
9303 int id = i - 1;
9306
9309
9310 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9311 {
9312 if (p)
9313 {
9316 }
9317 }
9318 }
9319 }
9320 }
9321
9323 {
9325 {
9327 {
9328 int id = i - 1;
9330
9331 if (OP)
9332 {
9334
9335 if (p)
9336 {
9338 }
9339
9340 delete OP;
9341 }
9342 }
9343
9346 }
9347 }
9348
9351 {
9352 return 0.0;
9353 }
9354
9355
9357 {
9358 return 250;
9359 }
9360
9362 {
9363 return 0;
9364 }
9365
9368 {
9370 return true;
9371
9372 return false;
9373 }
9374
9377 {
9380
9382 {
9384 }
9385 else
9386 {
9387
9389 }
9390
9392 }
9393
9400 {
9401 return -1;
9402 }
9403
9404
9405
9406
9408 {
9410 {
9412 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9413
9414 if (r_index >= 0)
9415 {
9416 InventoryLocation r_il = new InventoryLocation;
9417 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9418
9419 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9422 {
9423 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9424 }
9426 {
9427 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9428 }
9429
9430 }
9431
9432 player.GetHumanInventory().ClearUserReservedLocation(this);
9433 }
9434
9437 }
9438
9439
9440
9441
9443 {
9444 return ItemBase.m_DebugActionsMask;
9445 }
9446
9448 {
9449 return ItemBase.m_DebugActionsMask & mask;
9450 }
9451
9453 {
9454 ItemBase.m_DebugActionsMask = mask;
9455 }
9456
9458 {
9459 ItemBase.m_DebugActionsMask |= mask;
9460 }
9461
9463 {
9464 ItemBase.m_DebugActionsMask &= ~mask;
9465 }
9466
9468 {
9470 {
9472 }
9473 else
9474 {
9476 }
9477 }
9478
9479
9481 {
9482 if (GetEconomyProfile())
9483 {
9484 float q_max = GetEconomyProfile().GetQuantityMax();
9485 if (q_max > 0)
9486 {
9487 float q_min = GetEconomyProfile().GetQuantityMin();
9488 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9489
9491 {
9492 ComponentEnergyManager comp = GetCompEM();
9494 {
9496 }
9497 }
9499 {
9501
9502 }
9503
9504 }
9505 }
9506 }
9507
9510 {
9511 EntityAI parent = GetHierarchyParent();
9512
9513 if (parent)
9514 {
9515 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9516 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9517 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9518 }
9519 }
9520
9523 {
9524 EntityAI parent = GetHierarchyParent();
9525
9526 if (parent)
9527 {
9528 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9529 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9530 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9531 }
9532 }
9533
9535 {
9536
9537
9538
9539
9541
9543 {
9544 if (ScriptInputUserData.CanStoreInputUserData())
9545 {
9546 ScriptInputUserData ctx = new ScriptInputUserData;
9552 ctx.
Write(use_stack_max);
9555
9557 {
9558 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9559 }
9560 }
9561 }
9562 else if (!
GetGame().IsMultiplayer())
9563 {
9565 }
9566 }
9567
9569 {
9571 }
9572
9574 {
9576 }
9577
9579 {
9581 }
9582
9584 {
9585
9586 return false;
9587 }
9588
9590 {
9591 return false;
9592 }
9593
9597 {
9598 return false;
9599 }
9600
9602 {
9603 return "";
9604 }
9605
9607
9609 {
9610 return false;
9611 }
9612
9614 {
9615 return true;
9616 }
9617
9618
9619
9621 {
9622 return true;
9623 }
9624
9626 {
9627 return true;
9628 }
9629
9631 {
9632 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9634 }
9635
9637 {
9639 }
9640
9642 {
9644 if (!is_being_placed)
9646 SetSynchDirty();
9647 }
9648
9649
9651
9653 {
9655 }
9656
9658 {
9660 }
9661
9663 {
9664 return 1;
9665 }
9666
9668 {
9669 return false;
9670 }
9671
9673 {
9675 SetSynchDirty();
9676 }
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9713 {
9714 super.OnMovedInsideCargo(container);
9715
9716 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9717 }
9718
9719 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9720 {
9721 super.EEItemLocationChanged(oldLoc,newLoc);
9722
9723 PlayerBase new_player = null;
9724 PlayerBase old_player = null;
9725
9726 if (newLoc.GetParent())
9727 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9728
9729 if (oldLoc.GetParent())
9730 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9731
9733 {
9734 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9735
9736 if (r_index >= 0)
9737 {
9738 InventoryLocation r_il = new InventoryLocation;
9739 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9740
9741 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9744 {
9745 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9746 }
9748 {
9749 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9750 }
9751
9752 }
9753 }
9754
9756 {
9757 if (new_player)
9758 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9759
9760 if (new_player == old_player)
9761 {
9762
9763 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9764 {
9766 {
9767 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9768 {
9769 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9770 }
9771 }
9772 else
9773 {
9774 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9775 }
9776 }
9777
9778 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9779 {
9780 int type = oldLoc.GetType();
9782 {
9783 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9784 }
9786 {
9787 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9788 }
9789 }
9790 if (!m_OldLocation)
9791 {
9792 m_OldLocation = new InventoryLocation;
9793 }
9794 m_OldLocation.Copy(oldLoc);
9795 }
9796 else
9797 {
9798 if (m_OldLocation)
9799 {
9800 m_OldLocation.Reset();
9801 }
9802 }
9803
9805 }
9806 else
9807 {
9808 if (new_player)
9809 {
9810 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9811 if (res_index >= 0)
9812 {
9813 InventoryLocation il = new InventoryLocation;
9814 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9816 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9819 {
9820 il.
GetParent().GetOnReleaseLock().Invoke(it);
9821 }
9823 {
9825 }
9826
9827 }
9828 }
9830 {
9831
9833 }
9834
9835 if (m_OldLocation)
9836 {
9837 m_OldLocation.Reset();
9838 }
9839 }
9840 }
9841
9842 override void EOnContact(IEntity other, Contact extra)
9843 {
9845 {
9846 int liquidType = -1;
9848 if (impactSpeed > 0.0)
9849 {
9851 #ifndef SERVER
9853 #else
9855 SetSynchDirty();
9856 #endif
9858 }
9859 }
9860
9861 #ifdef SERVER
9862 if (GetCompEM() && GetCompEM().IsPlugged())
9863 {
9864 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9865 GetCompEM().UnplugThis();
9866 }
9867 #endif
9868 }
9869
9871
9873 {
9875 }
9876
9878 {
9879
9880 }
9881
9883 {
9884 super.OnItemLocationChanged(old_owner, new_owner);
9885
9886 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9887 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9888
9889 if (!relatedPlayer && playerNew)
9890 relatedPlayer = playerNew;
9891
9892 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9893 {
9895 if (actionMgr)
9896 {
9897 ActionBase currentAction = actionMgr.GetRunningAction();
9898 if (currentAction)
9900 }
9901 }
9902
9903 Man ownerPlayerOld = null;
9904 Man ownerPlayerNew = null;
9905
9906 if (old_owner)
9907 {
9908 if (old_owner.
IsMan())
9909 {
9910 ownerPlayerOld = Man.Cast(old_owner);
9911 }
9912 else
9913 {
9914 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9915 }
9916 }
9917 else
9918 {
9920 {
9922
9923 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9924 {
9925 GetCompEM().UnplugThis();
9926 }
9927 }
9928 }
9929
9930 if (new_owner)
9931 {
9932 if (new_owner.
IsMan())
9933 {
9934 ownerPlayerNew = Man.Cast(new_owner);
9935 }
9936 else
9937 {
9938 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9939 }
9940 }
9941
9942 if (ownerPlayerOld != ownerPlayerNew)
9943 {
9944 if (ownerPlayerOld)
9945 {
9946 array<EntityAI> subItemsExit = new array<EntityAI>;
9948 for (int i = 0; i < subItemsExit.Count(); i++)
9949 {
9952 }
9953 }
9954
9955 if (ownerPlayerNew)
9956 {
9957 array<EntityAI> subItemsEnter = new array<EntityAI>;
9959 for (int j = 0; j < subItemsEnter.Count(); j++)
9960 {
9963 }
9964 }
9965 }
9966 else if (ownerPlayerNew != null)
9967 {
9968 PlayerBase nplayer;
9969 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9970 {
9971 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9973 for (int k = 0; k < subItemsUpdate.Count(); k++)
9974 {
9976 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9977 }
9978 }
9979 }
9980
9981 if (old_owner)
9982 old_owner.OnChildItemRemoved(this);
9983 if (new_owner)
9984 new_owner.OnChildItemReceived(this);
9985 }
9986
9987
9989 {
9990 super.EEDelete(parent);
9991 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9992 if (player)
9993 {
9995
9996 if (player.IsAlive())
9997 {
9998 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9999 if (r_index >= 0)
10000 {
10001 InventoryLocation r_il = new InventoryLocation;
10002 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10003
10004 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10007 {
10008 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10009 }
10011 {
10012 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10013 }
10014
10015 }
10016
10017 player.RemoveQuickBarEntityShortcut(this);
10018 }
10019 }
10020 }
10021
10023 {
10024 super.EEKilled(killer);
10025
10028 {
10029 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10030 {
10031 if (IsMagazine())
10032 {
10033 if (Magazine.Cast(this).GetAmmoCount() > 0)
10034 {
10036 }
10037 }
10038 else
10039 {
10041 }
10042 }
10043 }
10044 }
10045
10047 {
10048 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10049
10050 super.OnWasAttached(parent, slot_id);
10051
10054
10056 }
10057
10059 {
10060 super.OnWasDetached(parent, slot_id);
10061
10064 }
10065
10067 {
10068 int idx;
10071
10072 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10073 if (inventory_slots.Count() < 1)
10074 {
10075 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10076 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10077 }
10078 else
10079 {
10080 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10081 }
10082
10083 idx = inventory_slots.Find(slot);
10084 if (idx < 0)
10085 return "";
10086
10087 return attach_types.Get(idx);
10088 }
10089
10091 {
10092 int idx = -1;
10093 string slot;
10094
10097
10098 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10099 if (inventory_slots.Count() < 1)
10100 {
10101 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10102 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10103 }
10104 else
10105 {
10106 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10107 if (detach_types.Count() < 1)
10108 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10109 }
10110
10111 for (int i = 0; i < inventory_slots.Count(); i++)
10112 {
10113 slot = inventory_slots.Get(i);
10114 }
10115
10116 if (slot != "")
10117 {
10118 if (detach_types.Count() == 1)
10119 idx = 0;
10120 else
10121 idx = inventory_slots.Find(slot);
10122 }
10123 if (idx < 0)
10124 return "";
10125
10126 return detach_types.Get(idx);
10127 }
10128
10130 {
10131
10133
10134
10135 float min_time = 1;
10136 float max_time = 3;
10137 float delay = Math.RandomFloat(min_time, max_time);
10138
10139 explode_timer.Run(delay, this, "DoAmmoExplosion");
10140 }
10141
10143 {
10144 Magazine magazine = Magazine.Cast(this);
10145 int pop_sounds_count = 6;
10146 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10147
10148
10149 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10150 string sound_name = pop_sounds[ sound_idx ];
10152
10153
10154 magazine.ServerAddAmmoCount(-1);
10155
10156
10157 float min_temp_to_explode = 100;
10158
10159 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10160 {
10162 }
10163 }
10164
10165
10166 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10167 {
10168 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10169
10170 const int CHANCE_DAMAGE_CARGO = 4;
10171 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10172 const int CHANCE_DAMAGE_NOTHING = 2;
10173
10175 {
10176 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10177 int chances;
10178 int rnd;
10179
10180 if (GetInventory().GetCargo())
10181 {
10182 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10183 rnd = Math.RandomInt(0,chances);
10184
10185 if (rnd < CHANCE_DAMAGE_CARGO)
10186 {
10188 }
10189 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10190 {
10192 }
10193 }
10194 else
10195 {
10196 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10197 rnd = Math.RandomInt(0,chances);
10198
10199 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10200 {
10202 }
10203 }
10204 }
10205 }
10206
10208 {
10209 if (GetInventory().GetCargo())
10210 {
10211 int item_count = GetInventory().GetCargo().GetItemCount();
10212 if (item_count > 0)
10213 {
10214 int random_pick = Math.RandomInt(0, item_count);
10216 if (!item.IsExplosive())
10217 {
10218 item.AddHealth("","",damage);
10219 return true;
10220 }
10221 }
10222 }
10223 return false;
10224 }
10225
10227 {
10228 int attachment_count = GetInventory().AttachmentCount();
10229 if (attachment_count > 0)
10230 {
10231 int random_pick = Math.RandomInt(0, attachment_count);
10232 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10233 if (!attachment.IsExplosive())
10234 {
10235 attachment.AddHealth("","",damage);
10236 return true;
10237 }
10238 }
10239 return false;
10240 }
10241
10243 {
10245 }
10246
10248 {
10250 return GetInventory().CanRemoveEntity();
10251
10252 return false;
10253 }
10254
10256 {
10258 return;
10259
10261 {
10262 if (ScriptInputUserData.CanStoreInputUserData())
10263 {
10264 ScriptInputUserData ctx = new ScriptInputUserData;
10269 ctx.
Write(destination_entity);
10271 ctx.
Write(slot_id);
10273 }
10274 }
10275 else if (!
GetGame().IsMultiplayer())
10276 {
10278 }
10279 }
10280
10282 {
10284 return;
10285
10286 float split_quantity_new;
10290 InventoryLocation loc = new InventoryLocation;
10291
10292 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10293 {
10295 split_quantity_new = stack_max;
10296 else
10298
10299 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10300 if (new_item)
10301 {
10302 new_item.SetResultOfSplit(true);
10303 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10305 new_item.SetQuantity(split_quantity_new);
10306 }
10307 }
10308 else if (destination_entity && slot_id == -1)
10309 {
10310 if (quantity > stack_max)
10311 split_quantity_new = stack_max;
10312 else
10313 split_quantity_new = quantity;
10314
10316 {
10319 }
10320
10321 if (new_item)
10322 {
10323 new_item.SetResultOfSplit(true);
10324 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10326 new_item.SetQuantity(split_quantity_new);
10327 }
10328 }
10329 else
10330 {
10331 if (stack_max != 0)
10332 {
10334 {
10336 }
10337
10338 if (split_quantity_new == 0)
10339 {
10340 if (!
GetGame().IsMultiplayer())
10341 player.PhysicalPredictiveDropItem(this);
10342 else
10343 player.ServerDropEntity(this);
10344 return;
10345 }
10346
10348
10349 if (new_item)
10350 {
10351 new_item.SetResultOfSplit(true);
10352 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10354 new_item.SetQuantity(stack_max);
10355 new_item.PlaceOnSurface();
10356 }
10357 }
10358 }
10359 }
10360
10362 {
10364 return;
10365
10366 float split_quantity_new;
10370 InventoryLocation loc = new InventoryLocation;
10371
10372 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10373 {
10375 split_quantity_new = stack_max;
10376 else
10378
10379 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10380 if (new_item)
10381 {
10382 new_item.SetResultOfSplit(true);
10383 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10385 new_item.SetQuantity(split_quantity_new);
10386 }
10387 }
10388 else if (destination_entity && slot_id == -1)
10389 {
10390 if (quantity > stack_max)
10391 split_quantity_new = stack_max;
10392 else
10393 split_quantity_new = quantity;
10394
10396 {
10399 }
10400
10401 if (new_item)
10402 {
10403 new_item.SetResultOfSplit(true);
10404 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10406 new_item.SetQuantity(split_quantity_new);
10407 }
10408 }
10409 else
10410 {
10411 if (stack_max != 0)
10412 {
10414 {
10416 }
10417
10419
10420 if (new_item)
10421 {
10422 new_item.SetResultOfSplit(true);
10423 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10425 new_item.SetQuantity(stack_max);
10426 new_item.PlaceOnSurface();
10427 }
10428 }
10429 }
10430 }
10431
10433 {
10435 return;
10436
10438 {
10439 if (ScriptInputUserData.CanStoreInputUserData())
10440 {
10441 ScriptInputUserData ctx = new ScriptInputUserData;
10446 dst.WriteToContext(ctx);
10448 }
10449 }
10450 else if (!
GetGame().IsMultiplayer())
10451 {
10453 }
10454 }
10455
10457 {
10459 return;
10460
10462 {
10463 if (ScriptInputUserData.CanStoreInputUserData())
10464 {
10465 ScriptInputUserData ctx = new ScriptInputUserData;
10470 ctx.
Write(destination_entity);
10476 }
10477 }
10478 else if (!
GetGame().IsMultiplayer())
10479 {
10481 }
10482 }
10483
10485 {
10487 }
10488
10490 {
10492 return this;
10493
10495 float split_quantity_new;
10497 if (dst.IsValid())
10498 {
10499 int slot_id = dst.GetSlot();
10501
10502 if (quantity > stack_max)
10503 split_quantity_new = stack_max;
10504 else
10505 split_quantity_new = quantity;
10506
10508
10509 if (new_item)
10510 {
10511 new_item.SetResultOfSplit(true);
10512 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10515 }
10516
10517 return new_item;
10518 }
10519
10520 return null;
10521 }
10522
10524 {
10526 return;
10527
10529 float split_quantity_new;
10531 if (destination_entity)
10532 {
10534 if (quantity > stackable)
10535 split_quantity_new = stackable;
10536 else
10537 split_quantity_new = quantity;
10538
10539 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10540 if (new_item)
10541 {
10542 new_item.SetResultOfSplit(true);
10543 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10545 new_item.SetQuantity(split_quantity_new);
10546 }
10547 }
10548 }
10549
10551 {
10553 return;
10554
10556 {
10557 if (ScriptInputUserData.CanStoreInputUserData())
10558 {
10559 ScriptInputUserData ctx = new ScriptInputUserData;
10564 ItemBase destination_entity =
this;
10565 ctx.
Write(destination_entity);
10569 }
10570 }
10571 else if (!
GetGame().IsMultiplayer())
10572 {
10574 }
10575 }
10576
10578 {
10580 return;
10581
10583 float split_quantity_new;
10585 if (player)
10586 {
10588 if (quantity > stackable)
10589 split_quantity_new = stackable;
10590 else
10591 split_quantity_new = quantity;
10592
10593 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10594 new_item =
ItemBase.Cast(in_hands);
10595 if (new_item)
10596 {
10597 new_item.SetResultOfSplit(true);
10598 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10600 new_item.SetQuantity(split_quantity_new);
10601 }
10602 }
10603 }
10604
10606 {
10608 return;
10609
10611 float split_quantity_new = Math.Floor(quantity * 0.5);
10612
10614
10615 if (new_item)
10616 {
10617 if (new_item.GetQuantityMax() < split_quantity_new)
10618 {
10619 split_quantity_new = new_item.GetQuantityMax();
10620 }
10621
10622 new_item.SetResultOfSplit(true);
10623 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10624
10626 {
10629 }
10630 else
10631 {
10634 }
10635 }
10636 }
10637
10639 {
10641 return;
10642
10644 float split_quantity_new = Math.Floor(quantity / 2);
10645
10646 InventoryLocation invloc = new InventoryLocation;
10648
10650 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10651
10652 if (new_item)
10653 {
10654 if (new_item.GetQuantityMax() < split_quantity_new)
10655 {
10656 split_quantity_new = new_item.GetQuantityMax();
10657 }
10659 {
10662 }
10663 else
10664 {
10667 }
10668 }
10669 }
10670
10673 {
10674 SetWeightDirty();
10676
10677 if (parent)
10678 parent.OnAttachmentQuantityChangedEx(this, delta);
10679
10681 {
10683 {
10685 }
10687 {
10688 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10690 }
10691 }
10692
10693 }
10694
10697 {
10698
10699 }
10700
10703 {
10705 }
10706
10708 {
10709 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10710
10712 {
10713 if (newLevel == GameConstants.STATE_RUINED)
10714 {
10716 EntityAI parent = GetHierarchyParent();
10717 if (parent && parent.IsFireplace())
10718 {
10719 CargoBase cargo = GetInventory().GetCargo();
10720 if (cargo)
10721 {
10723 {
10725 }
10726 }
10727 }
10728 }
10729
10731 {
10732
10734 return;
10735 }
10736
10737 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10738 {
10740 }
10741 }
10742 }
10743
10744
10746 {
10747 super.OnRightClick();
10748
10750 {
10752 {
10753 if (ScriptInputUserData.CanStoreInputUserData())
10754 {
10755 vector m4[4];
10757
10758 EntityAI root = GetHierarchyRoot();
10759
10760 InventoryLocation dst = new InventoryLocation;
10762 {
10763 if (root)
10764 {
10765 root.GetTransform(m4);
10767 }
10768 else
10769 GetInventory().GetCurrentInventoryLocation(dst);
10770 }
10771 else
10772 {
10774
10775
10776 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10777 {
10778 if (root)
10779 {
10780 root.GetTransform(m4);
10782 }
10783 else
10784 GetInventory().GetCurrentInventoryLocation(dst);
10785 }
10786 else
10787 {
10788 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10789 }
10790 }
10791
10792 ScriptInputUserData ctx = new ScriptInputUserData;
10800 }
10801 }
10802 else if (!
GetGame().IsMultiplayer())
10803 {
10805 }
10806 }
10807 }
10808
10809 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10810 {
10811
10812 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10813 return false;
10814
10815 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10816 return false;
10817
10818
10820 return false;
10821
10822
10823 Magazine mag = Magazine.Cast(this);
10824 if (mag)
10825 {
10826 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10827 return false;
10828
10829 if (stack_max_limit)
10830 {
10831 Magazine other_mag = Magazine.Cast(other_item);
10832 if (other_item)
10833 {
10834 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10835 return false;
10836 }
10837
10838 }
10839 }
10840 else
10841 {
10842
10844 return false;
10845
10847 return false;
10848 }
10849
10850 PlayerBase player = null;
10851 if (CastTo(player, GetHierarchyRootPlayer()))
10852 {
10853 if (player.GetInventory().HasAttachment(this))
10854 return false;
10855
10856 if (player.IsItemsToDelete())
10857 return false;
10858 }
10859
10860 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10861 return false;
10862
10863 int slotID;
10865 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10866 return false;
10867
10868 return true;
10869 }
10870
10872 {
10874 }
10875
10877 {
10878 return m_IsResultOfSplit;
10879 }
10880
10882 {
10883 m_IsResultOfSplit = value;
10884 }
10885
10887 {
10889 }
10890
10892 {
10893 float other_item_quantity = other_item.GetQuantity();
10894 float this_free_space;
10895
10897
10899
10900 if (other_item_quantity > this_free_space)
10901 {
10902 return this_free_space;
10903 }
10904 else
10905 {
10906 return other_item_quantity;
10907 }
10908 }
10909
10911 {
10913 }
10914
10916 {
10918 return;
10919
10920 if (!IsMagazine() && other_item)
10921 {
10923 if (quantity_used != 0)
10924 {
10925 float hp1 = GetHealth01("","");
10926 float hp2 = other_item.GetHealth01("","");
10927 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10928 hpResult = hpResult / (
GetQuantity() + quantity_used);
10929
10930 hpResult *= GetMaxHealth();
10931 Math.Round(hpResult);
10932 SetHealth("", "Health", hpResult);
10933
10935 other_item.AddQuantity(-quantity_used);
10936 }
10937 }
10939 }
10940
10942 {
10943 #ifdef SERVER
10944 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10945 GetHierarchyParent().IncreaseLifetimeUp();
10946 #endif
10947 };
10948
10950 {
10951 PlayerBase p = PlayerBase.Cast(player);
10952
10953 array<int> recipesIds = p.m_Recipes;
10954 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10955 if (moduleRecipesManager)
10956 {
10957 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10958 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10959 }
10960
10961 for (int i = 0;i < recipesIds.Count(); i++)
10962 {
10963 int key = recipesIds.Get(i);
10964 string recipeName = moduleRecipesManager.GetRecipeName(key);
10966 }
10967 }
10968
10969
10970 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10971 {
10972 super.GetDebugActions(outputList);
10973
10974
10979
10980
10984
10988
10989
10992
10993
10995 {
10998 }
10999
11001
11004
11008 }
11009
11010
11011
11012
11014 {
11015 super.OnAction(action_id, player, ctx);
11016 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11017 {
11018 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11019 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11020 PlayerBase p = PlayerBase.Cast(player);
11021 if (
EActions.RECIPES_RANGE_START < 1000)
11022 {
11023 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11024 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11025 }
11026 }
11027 #ifndef SERVER
11028 else if (action_id ==
EActions.WATCH_PLAYER)
11029 {
11030 PluginDeveloper.SetDeveloperItemClientEx(player);
11031 }
11032 #endif
11034 {
11035 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11036 {
11037 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11038 OnDebugButtonPressServer(id + 1);
11039 }
11040
11041 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11042 {
11043 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11045 }
11046
11047 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11048 {
11049 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11051 }
11052
11053 else if (action_id ==
EActions.ADD_QUANTITY)
11054 {
11055 if (IsMagazine())
11056 {
11057 Magazine mag = Magazine.Cast(this);
11058 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11059 }
11060 else
11061 {
11063 }
11064
11065 if (m_EM)
11066 {
11067 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11068 }
11069
11070 }
11071
11072 else if (action_id ==
EActions.REMOVE_QUANTITY)
11073 {
11074 if (IsMagazine())
11075 {
11076 Magazine mag2 = Magazine.Cast(this);
11077 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11078 }
11079 else
11080 {
11082 }
11083 if (m_EM)
11084 {
11085 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11086 }
11087
11088 }
11089
11090 else if (action_id ==
EActions.SET_QUANTITY_0)
11091 {
11093
11094 if (m_EM)
11095 {
11096 m_EM.SetEnergy(0);
11097 }
11098 }
11099
11100 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11101 {
11103
11104 if (m_EM)
11105 {
11106 m_EM.SetEnergy(m_EM.GetEnergyMax());
11107 }
11108 }
11109
11110 else if (action_id ==
EActions.ADD_HEALTH)
11111 {
11112 AddHealth("","",GetMaxHealth("","Health")/5);
11113 }
11114 else if (action_id ==
EActions.REMOVE_HEALTH)
11115 {
11116 AddHealth("","",-GetMaxHealth("","Health")/5);
11117 }
11118 else if (action_id ==
EActions.DESTROY_HEALTH)
11119 {
11120 SetHealth01("","",0);
11121 }
11122 else if (action_id ==
EActions.WATCH_ITEM)
11123 {
11125 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11126 #ifdef DEVELOPER
11127 SetDebugDeveloper_item(this);
11128 #endif
11129 }
11130
11131 else if (action_id ==
EActions.ADD_TEMPERATURE)
11132 {
11133 AddTemperature(20);
11134
11135 }
11136
11137 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11138 {
11139 AddTemperature(-20);
11140
11141 }
11142
11143 else if (action_id ==
EActions.FLIP_FROZEN)
11144 {
11145 SetFrozen(!GetIsFrozen());
11146
11147 }
11148
11149 else if (action_id ==
EActions.ADD_WETNESS)
11150 {
11152
11153 }
11154
11155 else if (action_id ==
EActions.REMOVE_WETNESS)
11156 {
11158
11159 }
11160
11161 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11162 {
11165
11166
11167 }
11168
11169 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11170 {
11173 }
11174
11175 else if (action_id ==
EActions.MAKE_SPECIAL)
11176 {
11177 auto debugParams = DebugSpawnParams.WithPlayer(player);
11178 OnDebugSpawnEx(debugParams);
11179 }
11180
11181 else if (action_id ==
EActions.DELETE)
11182 {
11183 Delete();
11184 }
11185
11186 }
11187
11188
11189 return false;
11190 }
11191
11192
11193
11194
11198
11201
11202
11203
11205 {
11206 return false;
11207 }
11208
11209
11211 {
11212 return true;
11213 }
11214
11215
11217 {
11218 return true;
11219 }
11220
11221
11222
11224 {
11225 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11227 }
11228
11231 {
11232 return null;
11233 }
11234
11236 {
11237 return false;
11238 }
11239
11241 {
11242 return false;
11243 }
11244
11248
11249
11251 {
11252 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11253 return module_repairing.CanRepair(this, item_repair_kit);
11254 }
11255
11256
11257 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11258 {
11259 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11260 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11261 }
11262
11263
11265 {
11266
11267
11268
11269
11270
11271
11272
11273
11274 return 1;
11275 }
11276
11277
11278
11280 {
11282 }
11283
11284
11285
11287 {
11289 }
11290
11291
11300 {
11301 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11302
11303 if (player)
11304 {
11305 player.MessageStatus(text);
11306 }
11307 }
11308
11309
11318 {
11319 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11320
11321 if (player)
11322 {
11323 player.MessageAction(text);
11324 }
11325 }
11326
11327
11336 {
11337 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11338
11339 if (player)
11340 {
11341 player.MessageFriendly(text);
11342 }
11343 }
11344
11345
11354 {
11355 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11356
11357 if (player)
11358 {
11359 player.MessageImportant(text);
11360 }
11361 }
11362
11364 {
11365 return true;
11366 }
11367
11368
11369 override bool KindOf(
string tag)
11370 {
11371 bool found = false;
11372 string item_name = this.
GetType();
11375
11376 int array_size = item_tag_array.Count();
11377 for (int i = 0; i < array_size; i++)
11378 {
11379 if (item_tag_array.Get(i) == tag)
11380 {
11381 found = true;
11382 break;
11383 }
11384 }
11385 return found;
11386 }
11387
11388
11390 {
11391
11392 super.OnRPC(sender, rpc_type,ctx);
11393
11394
11395 switch (rpc_type)
11396 {
11397 #ifndef SERVER
11398 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11399 Param2<bool, string> p = new Param2<bool, string>(false, "");
11400
11402 return;
11403
11404 bool play = p.param1;
11405 string soundSet = p.param2;
11406
11407 if (play)
11408 {
11410 {
11412 {
11414 }
11415 }
11416 else
11417 {
11419 }
11420 }
11421 else
11422 {
11424 }
11425
11426 break;
11427 #endif
11428
11429 }
11430
11432 {
11434 }
11435 }
11436
11437
11438
11439
11441 {
11442 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11443 return plugin.GetID(
name);
11444 }
11445
11447 {
11448 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11449 return plugin.GetName(id);
11450 }
11451
11454 {
11455
11456
11457 int varFlags;
11458 if (!ctx.
Read(varFlags))
11459 return;
11460
11461 if (varFlags & ItemVariableFlags.FLOAT)
11462 {
11464 }
11465 }
11466
11468 {
11469
11470 super.SerializeNumericalVars(floats_out);
11471
11472
11473
11475 {
11477 }
11478
11480 {
11482 }
11483
11485 {
11487 }
11488
11490 {
11495 }
11496
11498 {
11500 }
11501 }
11502
11504 {
11505
11506 super.DeSerializeNumericalVars(floats);
11507
11508
11509 int index = 0;
11510 int mask = Math.Round(floats.Get(index));
11511
11512 index++;
11513
11515 {
11517 {
11519 }
11520 else
11521 {
11522 float quantity = floats.Get(index);
11523 SetQuantity(quantity,
true,
false,
false,
false);
11524 }
11525 index++;
11526 }
11527
11529 {
11530 float wet = floats.Get(index);
11532 index++;
11533 }
11534
11536 {
11537 int liquidtype = Math.Round(floats.Get(index));
11539 index++;
11540 }
11541
11543 {
11545 index++;
11547 index++;
11549 index++;
11551 index++;
11552 }
11553
11555 {
11556 int cleanness = Math.Round(floats.Get(index));
11558 index++;
11559 }
11560 }
11561
11563 {
11564 super.WriteVarsToCTX(ctx);
11565
11566
11568 {
11570 }
11571
11573 {
11575 }
11576
11578 {
11580 }
11581
11583 {
11584 int r,g,b,a;
11590 }
11591
11593 {
11595 }
11596 }
11597
11599 {
11600 if (!super.ReadVarsFromCTX(ctx,version))
11601 return false;
11602
11603 int intValue;
11604 float value;
11605
11606 if (version < 140)
11607 {
11608 if (!ctx.
Read(intValue))
11609 return false;
11610
11611 m_VariablesMask = intValue;
11612 }
11613
11615 {
11616 if (!ctx.
Read(value))
11617 return false;
11618
11620 {
11622 }
11623 else
11624 {
11626 }
11627 }
11628
11629 if (version < 140)
11630 {
11632 {
11633 if (!ctx.
Read(value))
11634 return false;
11635 SetTemperatureDirect(value);
11636 }
11637 }
11638
11640 {
11641 if (!ctx.
Read(value))
11642 return false;
11644 }
11645
11647 {
11648 if (!ctx.
Read(intValue))
11649 return false;
11651 }
11652
11654 {
11655 int r,g,b,a;
11657 return false;
11659 return false;
11661 return false;
11663 return false;
11664
11666 }
11667
11669 {
11670 if (!ctx.
Read(intValue))
11671 return false;
11673 }
11674
11675 if (version >= 138 && version < 140)
11676 {
11678 {
11679 if (!ctx.
Read(intValue))
11680 return false;
11681 SetFrozen(intValue);
11682 }
11683 }
11684
11685 return true;
11686 }
11687
11688
11690 {
11693 {
11695 }
11696
11697 if (!super.OnStoreLoad(ctx, version))
11698 {
11700 return false;
11701 }
11702
11703 if (version >= 114)
11704 {
11705 bool hasQuickBarIndexSaved;
11706
11707 if (!ctx.
Read(hasQuickBarIndexSaved))
11708 {
11710 return false;
11711 }
11712
11713 if (hasQuickBarIndexSaved)
11714 {
11715 int itmQBIndex;
11716
11717
11718 if (!ctx.
Read(itmQBIndex))
11719 {
11721 return false;
11722 }
11723
11724 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11725 if (itmQBIndex != -1 && parentPlayer)
11726 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11727 }
11728 }
11729 else
11730 {
11731
11732 PlayerBase player;
11733 int itemQBIndex;
11734 if (version ==
int.
MAX)
11735 {
11736 if (!ctx.
Read(itemQBIndex))
11737 {
11739 return false;
11740 }
11741 }
11742 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11743 {
11744
11745 if (!ctx.
Read(itemQBIndex))
11746 {
11748 return false;
11749 }
11750 if (itemQBIndex != -1 && player)
11751 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11752 }
11753 }
11754
11755 if (version < 140)
11756 {
11757
11758 if (!LoadVariables(ctx, version))
11759 {
11761 return false;
11762 }
11763 }
11764
11765
11767 {
11769 return false;
11770 }
11771 if (version >= 132)
11772 {
11774 if (raib)
11775 {
11777 {
11779 return false;
11780 }
11781 }
11782 }
11783
11785 return true;
11786 }
11787
11788
11789
11791 {
11792 super.OnStoreSave(ctx);
11793
11794 PlayerBase player;
11795 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11796 {
11798
11799 int itemQBIndex = -1;
11800 itemQBIndex = player.FindQuickBarEntityIndex(this);
11801 ctx.
Write(itemQBIndex);
11802 }
11803 else
11804 {
11806 }
11807
11809
11811 if (raib)
11812 {
11814 }
11815 }
11816
11817
11819 {
11820 super.AfterStoreLoad();
11821
11823 {
11825 }
11826
11828 {
11831 }
11832 }
11833
11835 {
11836 super.EEOnAfterLoad();
11837
11839 {
11841 }
11842
11845 }
11846
11848 {
11849 return false;
11850 }
11851
11852
11853
11855 {
11857 {
11858 #ifdef PLATFORM_CONSOLE
11859
11861 {
11863 if (menu)
11864 {
11866 }
11867 }
11868 #endif
11869 }
11870
11872 {
11875 }
11876
11878 {
11879 SetWeightDirty();
11881 }
11883 {
11886 }
11887
11889 {
11892 }
11894 {
11897 }
11898
11899 super.OnVariablesSynchronized();
11900 }
11901
11902
11903
11905 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11906 {
11907 if (!IsServerCheck(allow_client))
11908 return false;
11909
11911 return false;
11912
11915
11916 if (value <= (min + 0.001))
11917 value = min;
11918
11919 if (value == min)
11920 {
11921 if (destroy_config)
11922 {
11923 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11924 if (dstr)
11925 {
11927 this.Delete();
11928 return true;
11929 }
11930 }
11931 else if (destroy_forced)
11932 {
11934 this.Delete();
11935 return true;
11936 }
11937
11939 }
11940
11943
11945 {
11947
11948 if (delta)
11950 }
11951
11953
11954 return false;
11955 }
11956
11957
11959 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11960 {
11962 }
11963
11965 {
11968 }
11969
11971 {
11974 }
11975
11978 {
11979 float value_clamped = Math.Clamp(value, 0, 1);
11981 SetQuantity(result, destroy_config, destroy_forced);
11982 }
11983
11984
11987 {
11989 }
11990
11992 {
11994 }
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12006 {
12007 int slot = -1;
12008 if (GetInventory())
12009 {
12010 InventoryLocation il = new InventoryLocation;
12011 GetInventory().GetCurrentInventoryLocation(il);
12013 }
12014
12016 }
12017
12019 {
12020 float quantity_max = 0;
12021
12023 {
12024 if (attSlotID != -1)
12025 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12026
12027 if (quantity_max <= 0)
12029 }
12030
12031 if (quantity_max <= 0)
12033
12034 return quantity_max;
12035 }
12036
12038 {
12040 }
12041
12043 {
12045 }
12046
12047
12049 {
12051 }
12052
12054 {
12056 }
12057
12059 {
12061 }
12062
12063
12065 {
12066
12067 float weightEx = GetWeightEx();
12068 float special = GetInventoryAndCargoWeight();
12069 return weightEx - special;
12070 }
12071
12072
12074 {
12076 }
12077
12079 {
12081 {
12082 #ifdef DEVELOPER
12083 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12084 {
12085 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12087 }
12088 #endif
12089
12090 return GetQuantity() * GetConfigWeightModified();
12091 }
12092 else if (HasEnergyManager())
12093 {
12094 #ifdef DEVELOPER
12095 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12096 {
12097 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12098 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12099 }
12100 #endif
12101 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12102 }
12103 else
12104 {
12105 #ifdef DEVELOPER
12106 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12107 {
12108 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12109 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12110 }
12111 #endif
12112 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12113 }
12114 }
12115
12118 {
12119 int item_count = 0;
12121
12122 if (GetInventory().GetCargo() != NULL)
12123 {
12124 item_count = GetInventory().GetCargo().GetItemCount();
12125 }
12126
12127 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12128 {
12129 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12130 if (item)
12131 item_count += item.GetNumberOfItems();
12132 }
12133 return item_count;
12134 }
12135
12138 {
12139 float weight = 0;
12140 float wetness = 1;
12141 if (include_wetness)
12144 {
12145 weight = wetness * m_ConfigWeight;
12146 }
12148 {
12149 weight = 1;
12150 }
12151 return weight;
12152 }
12153
12154
12155
12157 {
12158 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12159 {
12160 GameInventory inv = GetInventory();
12161 array<EntityAI> items = new array<EntityAI>;
12163 for (int i = 0; i < items.Count(); i++)
12164 {
12166 if (item)
12167 {
12169 }
12170 }
12171 }
12172 }
12173
12174
12175
12176
12178 {
12179 float energy = 0;
12180 if (HasEnergyManager())
12181 {
12182 energy = GetCompEM().GetEnergy();
12183 }
12184 return energy;
12185 }
12186
12187
12189 {
12190 super.OnEnergyConsumed();
12191
12193 }
12194
12196 {
12197 super.OnEnergyAdded();
12198
12200 }
12201
12202
12204 {
12205 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12206 {
12208 {
12209 float energy_0to1 = GetCompEM().GetEnergy0To1();
12211 }
12212 }
12213 }
12214
12215
12217 {
12218 return ConfigGetFloat("heatIsolation");
12219 }
12220
12222 {
12224 }
12225
12227 {
12228 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12229 if (
GetGame().ConfigIsExisting(paramPath))
12231
12232 return 0.0;
12233 }
12234
12236 {
12237 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12238 if (
GetGame().ConfigIsExisting(paramPath))
12240
12241 return 0.0;
12242 }
12243
12244 override void SetWet(
float value,
bool allow_client =
false)
12245 {
12246 if (!IsServerCheck(allow_client))
12247 return;
12248
12251
12253
12254 m_VarWet = Math.Clamp(value, min, max);
12255
12257 {
12260 }
12261 }
12262
12263 override void AddWet(
float value)
12264 {
12266 }
12267
12269 {
12271 }
12272
12274 {
12276 }
12277
12279 {
12281 }
12282
12284 {
12286 }
12287
12289 {
12291 }
12292
12293 override void OnWetChanged(
float newVal,
float oldVal)
12294 {
12297 if (newLevel != oldLevel)
12298 {
12300 }
12301 }
12302
12304 {
12305 SetWeightDirty();
12306 }
12307
12309 {
12310 return GetWetLevelInternal(
m_VarWet);
12311 }
12312
12313
12314
12316 {
12318 }
12319
12321 {
12323 }
12324
12326 {
12328 }
12329
12331 {
12333 }
12334
12335
12336
12338 {
12339 if (ConfigIsExisting("itemModelLength"))
12340 {
12341 return ConfigGetFloat("itemModelLength");
12342 }
12343 return 0;
12344 }
12345
12347 {
12348 if (ConfigIsExisting("itemAttachOffset"))
12349 {
12350 return ConfigGetFloat("itemAttachOffset");
12351 }
12352 return 0;
12353 }
12354
12355 override void SetCleanness(
int value,
bool allow_client =
false)
12356 {
12357 if (!IsServerCheck(allow_client))
12358 return;
12359
12361
12363
12366 }
12367
12369 {
12371 }
12372
12374 {
12375 return true;
12376 }
12377
12378
12379
12380
12382 {
12384 }
12385
12387 {
12389 }
12390
12391
12392
12393
12394 override void SetColor(
int r,
int g,
int b,
int a)
12395 {
12401 }
12403 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12404 {
12409 }
12410
12412 {
12414 }
12415
12418 {
12419 int r,g,b,a;
12421 r = r/255;
12422 g = g/255;
12423 b = b/255;
12424 a = a/255;
12425 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12426 }
12427
12428
12429
12430 override void SetLiquidType(
int value,
bool allow_client =
false)
12431 {
12432 if (!IsServerCheck(allow_client))
12433 return;
12434
12439 }
12440
12442 {
12443 return ConfigGetInt("varLiquidTypeInit");
12444 }
12445
12447 {
12449 }
12450
12452 {
12454 SetFrozen(false);
12455 }
12456
12459 {
12460 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12461 }
12462
12463
12466 {
12467 PlayerBase nplayer;
12468 if (PlayerBase.CastTo(nplayer, player))
12469 {
12471
12472 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12473 }
12474 }
12475
12476
12479 {
12480 PlayerBase nplayer;
12481 if (PlayerBase.CastTo(nplayer,player))
12482 {
12483
12484 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12485
12486 }
12487
12488
12489 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12490
12491
12492 if (HasEnergyManager())
12493 {
12494 GetCompEM().UpdatePlugState();
12495 }
12496 }
12497
12498
12500 {
12501 super.OnPlacementStarted(player);
12502
12504 }
12505
12506 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12507 {
12509 {
12510 m_AdminLog.OnPlacementComplete(player,
this);
12511 }
12512
12513 super.OnPlacementComplete(player, position, orientation);
12514 }
12515
12516
12517
12518
12519
12521 {
12523 {
12524 return true;
12525 }
12526 else
12527 {
12528 return false;
12529 }
12530 }
12531
12532
12534 {
12536 {
12538 }
12539 }
12540
12541
12543 {
12545 }
12546
12548 {
12550 }
12551
12552 override void InsertAgent(
int agent,
float count = 1)
12553 {
12554 if (count < 1)
12555 return;
12556
12558 }
12559
12562 {
12564 }
12565
12566
12568 {
12570 }
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12614 {
12616 return false;
12617 return true;
12618 }
12619
12621 {
12622
12624 }
12625
12626
12629 {
12630 super.CheckForRoofLimited(timeTresholdMS);
12631
12633 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12634 {
12635 m_PreviousRoofTestTime = time;
12636 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12637 }
12638 }
12639
12640
12642 {
12644 {
12645 return 0;
12646 }
12647
12648 if (GetInventory().GetAttachmentSlotsCount() != 0)
12649 {
12650 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12651 if (filter)
12652 return filter.GetProtectionLevel(type, false, system);
12653 else
12654 return 0;
12655 }
12656
12657 string subclassPath, entryName;
12658
12659 switch (type)
12660 {
12662 entryName = "biological";
12663 break;
12665 entryName = "chemical";
12666 break;
12667 default:
12668 entryName = "biological";
12669 break;
12670 }
12671
12672 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12673
12675 }
12676
12677
12678
12681 {
12682 if (!IsMagazine())
12684
12686 }
12687
12688
12689
12690
12691
12696 {
12697 return true;
12698 }
12699
12701 {
12703 }
12704
12705
12706
12707
12708
12710 {
12711 if (parent)
12712 {
12713 if (parent.IsInherited(DayZInfected))
12714 return true;
12715
12716 if (!parent.IsRuined())
12717 return true;
12718 }
12719
12720 return true;
12721 }
12722
12724 {
12725 if (!super.CanPutAsAttachment(parent))
12726 {
12727 return false;
12728 }
12729
12730 if (!IsRuined() && !parent.IsRuined())
12731 {
12732 return true;
12733 }
12734
12735 return false;
12736 }
12737
12739 {
12740
12741
12742
12743
12744 return super.CanReceiveItemIntoCargo(item);
12745 }
12746
12748 {
12749
12750
12751
12752
12753 GameInventory attachmentInv = attachment.GetInventory();
12755 {
12756 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12757 return false;
12758 }
12759
12760 InventoryLocation loc = new InventoryLocation();
12761 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12762 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12763 return false;
12764
12765 return super.CanReceiveAttachment(attachment, slotId);
12766 }
12767
12769 {
12770 if (!super.CanReleaseAttachment(attachment))
12771 return false;
12772
12773 return GetInventory().AreChildrenAccessible();
12774 }
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12797 {
12798 int id = muzzle_owner.GetMuzzleID();
12799 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12800
12801 if (WPOF_array)
12802 {
12803 for (int i = 0; i < WPOF_array.Count(); i++)
12804 {
12805 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12806
12807 if (WPOF)
12808 {
12809 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12810 }
12811 }
12812 }
12813 }
12814
12815
12817 {
12818 int id = muzzle_owner.GetMuzzleID();
12820
12821 if (WPOBE_array)
12822 {
12823 for (int i = 0; i < WPOBE_array.Count(); i++)
12824 {
12825 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12826
12827 if (WPOBE)
12828 {
12829 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12830 }
12831 }
12832 }
12833 }
12834
12835
12837 {
12838 int id = muzzle_owner.GetMuzzleID();
12839 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12840
12841 if (WPOOH_array)
12842 {
12843 for (int i = 0; i < WPOOH_array.Count(); i++)
12844 {
12845 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12846
12847 if (WPOOH)
12848 {
12849 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12850 }
12851 }
12852 }
12853 }
12854
12855
12857 {
12858 int id = muzzle_owner.GetMuzzleID();
12859 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12860
12861 if (WPOOH_array)
12862 {
12863 for (int i = 0; i < WPOOH_array.Count(); i++)
12864 {
12865 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12866
12867 if (WPOOH)
12868 {
12869 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12870 }
12871 }
12872 }
12873 }
12874
12875
12877 {
12878 int id = muzzle_owner.GetMuzzleID();
12879 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12880
12881 if (WPOOH_array)
12882 {
12883 for (int i = 0; i < WPOOH_array.Count(); i++)
12884 {
12885 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12886
12887 if (WPOOH)
12888 {
12889 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12890 }
12891 }
12892 }
12893 }
12894
12895
12896
12898 {
12900 {
12901 return true;
12902 }
12903
12904 return false;
12905 }
12906
12908 {
12910 {
12911 return true;
12912 }
12913
12914 return false;
12915 }
12916
12918 {
12920 {
12921 return true;
12922 }
12923
12924 return false;
12925 }
12926
12928 {
12929 return false;
12930 }
12931
12934 {
12935 return UATimeSpent.DEFAULT_DEPLOY;
12936 }
12937
12938
12939
12940
12942 {
12944 SetSynchDirty();
12945 }
12946
12948 {
12950 }
12951
12952
12954 {
12955 return false;
12956 }
12957
12960 {
12961 string att_type = "None";
12962
12963 if (ConfigIsExisting("soundAttType"))
12964 {
12965 att_type = ConfigGetString("soundAttType");
12966 }
12967
12969 }
12970
12972 {
12974 }
12975
12976
12977
12978
12979
12983
12985 {
12988
12990 }
12991
12992
12994 {
12996 return;
12997
12999
13002
13005
13006 SoundParameters params = new SoundParameters();
13010 }
13011
13012
13014 {
13016 return;
13017
13019 SetSynchDirty();
13020
13023 }
13024
13025
13027 {
13029 return;
13030
13032 SetSynchDirty();
13033
13036 }
13037
13039 {
13041 }
13042
13044 {
13046 }
13047
13050 {
13051 if (!
GetGame().IsDedicatedServer())
13052 {
13053 if (ConfigIsExisting("attachSoundSet"))
13054 {
13055 string cfg_path = "";
13056 string soundset = "";
13057 string type_name =
GetType();
13058
13061 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13062 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13063
13064 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13065 {
13066 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13067 {
13068 if (cfg_slot_array[i] == slot_type)
13069 {
13070 soundset = cfg_soundset_array[i];
13071 break;
13072 }
13073 }
13074 }
13075
13076 if (soundset != "")
13077 {
13078 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13080 }
13081 }
13082 }
13083 }
13084
13086 {
13087
13088 }
13089
13090 void OnApply(PlayerBase player);
13091
13093 {
13094 return 1.0;
13095 };
13096
13098 {
13100 }
13101
13103 {
13105 }
13106
13108
13110 {
13111 SetDynamicPhysicsLifeTime(0.01);
13113 }
13114
13116 {
13117 array<string> zone_names = new array<string>;
13118 GetDamageZones(zone_names);
13119 for (int i = 0; i < zone_names.Count(); i++)
13120 {
13121 SetHealthMax(zone_names.Get(i),"Health");
13122 }
13123 SetHealthMax("","Health");
13124 }
13125
13128 {
13129 float global_health = GetHealth01("","Health");
13130 array<string> zones = new array<string>;
13131 GetDamageZones(zones);
13132
13133 for (int i = 0; i < zones.Count(); i++)
13134 {
13135 SetHealth01(zones.Get(i),"Health",global_health);
13136 }
13137 }
13138
13141 {
13142 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13143 }
13144
13146 {
13147 if (!hasRootAsPlayer)
13148 {
13149 if (refParentIB)
13150 {
13151
13152 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13153 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13154
13155 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13156 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13157
13160 }
13161 else
13162 {
13163
13166 }
13167 }
13168 }
13169
13171 {
13173 {
13174 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13175 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13176 {
13177 float heatPermCoef = 1.0;
13179 while (ent)
13180 {
13181 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13182 ent = ent.GetHierarchyParent();
13183 }
13184
13185 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13186 }
13187 }
13188 }
13189
13191 {
13192
13193 EntityAI parent = GetHierarchyParent();
13194 if (!parent)
13195 {
13196 hasParent = false;
13197 hasRootAsPlayer = false;
13198 }
13199 else
13200 {
13201 hasParent = true;
13202 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13203 refParentIB =
ItemBase.Cast(parent);
13204 }
13205 }
13206
13207 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13208 {
13209
13210 }
13211
13213 {
13214
13215 return false;
13216 }
13217
13219 {
13220
13221
13222 return false;
13223 }
13224
13226 {
13227
13228 return false;
13229 }
13230
13233 {
13234 return !GetIsFrozen() &&
IsOpen();
13235 }
13236
13238 {
13239 bool hasParent = false, hasRootAsPlayer = false;
13241
13242 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13243 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13244
13245 if (wwtu || foodDecay)
13246 {
13250
13251 if (processWetness || processTemperature || processDecay)
13252 {
13254
13255 if (processWetness)
13256 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13257
13258 if (processTemperature)
13260
13261 if (processDecay)
13262 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13263 }
13264 }
13265 }
13266
13269 {
13271 }
13272
13274 {
13277
13278 return super.GetTemperatureFreezeThreshold();
13279 }
13280
13282 {
13285
13286 return super.GetTemperatureThawThreshold();
13287 }
13288
13290 {
13293
13294 return super.GetItemOverheatThreshold();
13295 }
13296
13298 {
13300 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13301
13302 return super.GetTemperatureFreezeTime();
13303 }
13304
13306 {
13308 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13309
13310 return super.GetTemperatureThawTime();
13311 }
13312
13317
13319 {
13320 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13321 }
13322
13324 {
13325 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13326 }
13327
13330 {
13332 }
13333
13335 {
13337 }
13338
13340 {
13342 }
13343
13346 {
13347 return null;
13348 }
13349
13352 {
13353 return false;
13354 }
13355
13357 {
13359 {
13362 if (!trg)
13363 {
13365 explosive = this;
13366 }
13367
13368 explosive.PairRemote(trg);
13370
13371 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13372 trg.SetPersistentPairID(persistentID);
13373 explosive.SetPersistentPairID(persistentID);
13374
13375 return true;
13376 }
13377 return false;
13378 }
13379
13382 {
13383 float ret = 1.0;
13386 ret *= GetHealth01();
13387
13388 return ret;
13389 }
13390
13391 #ifdef DEVELOPER
13392 override void SetDebugItem()
13393 {
13394 super.SetDebugItem();
13395 _itemBase = this;
13396 }
13397
13399 {
13400 string text = super.GetDebugText();
13401
13403 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13404
13405 return text;
13406 }
13407 #endif
13408
13410 {
13411 return true;
13412 }
13413
13415
13417
13419 {
13422 }
13423
13424
13432
13448}
13449
13451{
13453 if (entity)
13454 {
13455 bool is_item = entity.IsInherited(
ItemBase);
13456 if (is_item && full_quantity)
13457 {
13460 }
13461 }
13462 else
13463 {
13465 return NULL;
13466 }
13467 return entity;
13468}
13469
13471{
13472 if (item)
13473 {
13474 if (health > 0)
13475 item.SetHealth("", "", health);
13476
13477 if (item.CanHaveTemperature())
13478 {
13480 if (item.CanFreeze())
13481 item.SetFrozen(false);
13482 }
13483
13484 if (item.HasEnergyManager())
13485 {
13486 if (quantity >= 0)
13487 {
13488 item.GetCompEM().SetEnergy0To1(quantity);
13489 }
13490 else
13491 {
13493 }
13494 }
13495 else if (item.IsMagazine())
13496 {
13497 Magazine mag = Magazine.Cast(item);
13498 if (quantity >= 0)
13499 {
13500 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13501 }
13502 else
13503 {
13505 }
13506
13507 }
13508 else
13509 {
13510 if (quantity >= 0)
13511 {
13512 item.SetQuantityNormalized(quantity, false);
13513 }
13514 else
13515 {
13517 }
13518
13519 }
13520 }
13521}
13522
13523#ifdef DEVELOPER
13525#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.