8604{
8606 {
8607 return true;
8608 }
8609};
8610
8611
8612
8614{
8618
8620
8623
8624
8625
8626
8627
8636
8642
8647
8652
8673 protected bool m_IsResultOfSplit
8674
8676
8681
8682
8683
8685
8689
8690
8691
8693
8696
8697
8698
8704
8705
8713
8716
8717
8719
8720
8722
8723
8728
8729
8734
8735
8737
8738
8740 {
8745
8746 if (!
GetGame().IsDedicatedServer())
8747 {
8749 {
8751
8753 {
8755 }
8756 }
8757
8760 }
8761
8762 m_OldLocation = null;
8763
8765 {
8767 }
8768
8769 if (ConfigIsExisting("headSelectionsToHide"))
8770 {
8773 }
8774
8776 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8777 {
8779 }
8780
8782
8783 m_IsResultOfSplit = false;
8784
8786 }
8787
8789 {
8790 super.InitItemVariables();
8791
8797 m_Count = ConfigGetInt(
"count");
8798
8801
8806
8809
8814
8826
8830
8831
8834 if (ConfigIsExisting("canBeSplit"))
8835 {
8838 }
8839
8841 if (ConfigIsExisting("itemBehaviour"))
8843
8844
8847 RegisterNetSyncVariableInt("m_VarLiquidType");
8848 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8849
8850 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8851 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8852 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8853
8854 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8855 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8856 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8857 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8858
8859 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8860 RegisterNetSyncVariableBool("m_IsTakeable");
8861 RegisterNetSyncVariableBool("m_IsHologram");
8862
8865 {
8868 }
8869
8871
8873 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8875
8876 }
8877
8879 {
8881 }
8882
8884 {
8887 {
8892 }
8893 }
8894
8895 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8896 {
8898 {
8901 }
8902
8904 }
8905
8907 {
8913 }
8914
8916
8918 {
8920
8921 if (!action)
8922 {
8923 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8924 return;
8925 }
8926
8928 if (!ai)
8929 {
8931 return;
8932 }
8933
8935 if (!action_array)
8936 {
8937 action_array = new array<ActionBase_Basic>;
8939 }
8940 if (LogManager.IsActionLogEnable())
8941 {
8942 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8943 }
8944
8945 if (action_array.Find(action) != -1)
8946 {
8947 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8948 }
8949 else
8950 {
8951 action_array.Insert(action);
8952 }
8953 }
8954
8956 {
8958 ActionBase action = player.GetActionManager().GetAction(actionName);
8961
8962 if (action_array)
8963 {
8964 action_array.RemoveItem(action);
8965 }
8966 }
8967
8968
8969
8971 {
8972 ActionOverrideData overrideData = new ActionOverrideData();
8976
8978 if (!actionMap)
8979 {
8982 }
8983
8984 actionMap.Insert(this.
Type(), overrideData);
8985
8986 }
8987
8989
8991
8992
8994 {
8997
9000
9001 string config_to_search = "CfgVehicles";
9002 string muzzle_owner_config;
9003
9005 {
9006 if (IsInherited(Weapon))
9007 config_to_search = "CfgWeapons";
9008
9009 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9010
9011 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9012
9014
9015 if (config_OnFire_subclass_count > 0)
9016 {
9017 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9018
9019 for (int i = 0; i < config_OnFire_subclass_count; i++)
9020 {
9021 string particle_class = "";
9023 string config_OnFire_entry = config_OnFire_class + particle_class;
9024 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9025 WPOF_array.Insert(WPOF);
9026 }
9027
9028
9030 }
9031 }
9032
9034 {
9035 config_to_search = "CfgWeapons";
9036 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9037
9038 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9039
9041
9042 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9043 {
9044 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9045
9046 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9047 {
9048 string particle_class2 = "";
9050 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9051 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9052 WPOBE_array.Insert(WPOBE);
9053 }
9054
9055
9057 }
9058 }
9059 }
9060
9061
9063 {
9066
9068 {
9069 string config_to_search = "CfgVehicles";
9070
9071 if (IsInherited(Weapon))
9072 config_to_search = "CfgWeapons";
9073
9074 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9075 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9076
9077 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9078 {
9079
9081
9083 {
9085 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9087 return;
9088 }
9089
9092
9093
9094
9096 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9097
9098 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9099 {
9100 string particle_class = "";
9102 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9104
9105 if (entry_type == CT_CLASS)
9106 {
9107 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9108 WPOOH_array.Insert(WPOF);
9109 }
9110 }
9111
9112
9114 }
9115 }
9116 }
9117
9119 {
9121 }
9122
9124 {
9126 {
9128
9131
9134
9135 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9136 }
9137 }
9138
9140 {
9142 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9143
9145 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9146
9148 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9149
9151 {
9153 }
9154 }
9155
9157 {
9159 }
9160
9162 {
9165 else
9167
9169 {
9172 }
9173 else
9174 {
9177
9180 }
9181
9183 }
9184
9186 {
9188 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9189 }
9190
9192 {
9194 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9196 }
9197
9199 {
9201 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9202 }
9203
9205 {
9208
9209 OverheatingParticle OP = new OverheatingParticle();
9214
9216 }
9217
9219 {
9222
9223 return -1;
9224 }
9225
9227 {
9229 {
9232
9233 for (int i = count; i > 0; --i)
9234 {
9235 int id = i - 1;
9238
9241
9242 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9243 {
9244 if (p)
9245 {
9248 }
9249 }
9250 }
9251 }
9252 }
9253
9255 {
9257 {
9259 {
9260 int id = i - 1;
9262
9263 if (OP)
9264 {
9266
9267 if (p)
9268 {
9270 }
9271
9272 delete OP;
9273 }
9274 }
9275
9278 }
9279 }
9280
9283 {
9284 return 0.0;
9285 }
9286
9287
9289 {
9290 return 250;
9291 }
9292
9294 {
9295 return 0;
9296 }
9297
9300 {
9302 return true;
9303
9304 return false;
9305 }
9306
9309 {
9312
9314 {
9316 }
9317 else
9318 {
9319
9321 }
9322
9324 }
9325
9332 {
9333 return -1;
9334 }
9335
9336
9337
9338
9340 {
9342 {
9344 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9345
9346 if (r_index >= 0)
9347 {
9348 InventoryLocation r_il = new InventoryLocation;
9349 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9350
9351 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9354 {
9355 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9356 }
9358 {
9359 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9360 }
9361
9362 }
9363
9364 player.GetHumanInventory().ClearUserReservedLocation(this);
9365 }
9366
9369 }
9370
9371
9372
9373
9375 {
9376 return ItemBase.m_DebugActionsMask;
9377 }
9378
9380 {
9381 return ItemBase.m_DebugActionsMask & mask;
9382 }
9383
9385 {
9386 ItemBase.m_DebugActionsMask = mask;
9387 }
9388
9390 {
9391 ItemBase.m_DebugActionsMask |= mask;
9392 }
9393
9395 {
9396 ItemBase.m_DebugActionsMask &= ~mask;
9397 }
9398
9400 {
9402 {
9404 }
9405 else
9406 {
9408 }
9409 }
9410
9411
9413 {
9414 if (GetEconomyProfile())
9415 {
9416 float q_max = GetEconomyProfile().GetQuantityMax();
9417 if (q_max > 0)
9418 {
9419 float q_min = GetEconomyProfile().GetQuantityMin();
9420 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9421
9423 {
9424 ComponentEnergyManager comp = GetCompEM();
9426 {
9428 }
9429 }
9431 {
9433
9434 }
9435
9436 }
9437 }
9438 }
9439
9442 {
9443 EntityAI parent = GetHierarchyParent();
9444
9445 if (parent)
9446 {
9447 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9448 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9449 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9450 }
9451 }
9452
9455 {
9456 EntityAI parent = GetHierarchyParent();
9457
9458 if (parent)
9459 {
9460 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9461 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9462 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9463 }
9464 }
9465
9467 {
9468
9469
9470
9471
9473
9475 {
9476 if (ScriptInputUserData.CanStoreInputUserData())
9477 {
9478 ScriptInputUserData ctx = new ScriptInputUserData;
9484 ctx.
Write(use_stack_max);
9487
9489 {
9490 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9491 }
9492 }
9493 }
9494 else if (!
GetGame().IsMultiplayer())
9495 {
9497 }
9498 }
9499
9501 {
9503 }
9504
9506 {
9508 }
9509
9511 {
9513 }
9514
9516 {
9517
9518 return false;
9519 }
9520
9522 {
9523 return false;
9524 }
9525
9529 {
9530 return false;
9531 }
9532
9534 {
9535 return "";
9536 }
9537
9539
9541 {
9542 return false;
9543 }
9544
9546 {
9547 return true;
9548 }
9549
9550
9551
9553 {
9554 return true;
9555 }
9556
9558 {
9559 return true;
9560 }
9561
9563 {
9564 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9566 }
9567
9569 {
9571 }
9572
9574 {
9576 if (!is_being_placed)
9578 SetSynchDirty();
9579 }
9580
9581
9583
9585 {
9587 }
9588
9590 {
9592 }
9593
9595 {
9596 return 1;
9597 }
9598
9600 {
9601 return false;
9602 }
9603
9605 {
9607 SetSynchDirty();
9608 }
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9645 {
9646 super.OnMovedInsideCargo(container);
9647
9648 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9649 }
9650
9651 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9652 {
9653 super.EEItemLocationChanged(oldLoc,newLoc);
9654
9655 PlayerBase new_player = null;
9656 PlayerBase old_player = null;
9657
9658 if (newLoc.GetParent())
9659 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9660
9661 if (oldLoc.GetParent())
9662 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9663
9665 {
9666 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9667
9668 if (r_index >= 0)
9669 {
9670 InventoryLocation r_il = new InventoryLocation;
9671 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9672
9673 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9676 {
9677 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9678 }
9680 {
9681 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9682 }
9683
9684 }
9685 }
9686
9688 {
9689 if (new_player)
9690 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9691
9692 if (new_player == old_player)
9693 {
9694
9695 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9696 {
9698 {
9699 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9700 {
9701 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9702 }
9703 }
9704 else
9705 {
9706 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9707 }
9708 }
9709
9710 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9711 {
9712 int type = oldLoc.GetType();
9714 {
9715 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9716 }
9718 {
9719 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9720 }
9721 }
9722 if (!m_OldLocation)
9723 {
9724 m_OldLocation = new InventoryLocation;
9725 }
9726 m_OldLocation.Copy(oldLoc);
9727 }
9728 else
9729 {
9730 if (m_OldLocation)
9731 {
9732 m_OldLocation.Reset();
9733 }
9734 }
9735
9737 }
9738 else
9739 {
9740 if (new_player)
9741 {
9742 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9743 if (res_index >= 0)
9744 {
9745 InventoryLocation il = new InventoryLocation;
9746 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9748 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9751 {
9752 il.
GetParent().GetOnReleaseLock().Invoke(it);
9753 }
9755 {
9757 }
9758
9759 }
9760 }
9762 {
9763
9765 }
9766
9767 if (m_OldLocation)
9768 {
9769 m_OldLocation.Reset();
9770 }
9771 }
9772 }
9773
9774 override void EOnContact(IEntity other, Contact extra)
9775 {
9777 {
9778 int liquidType = -1;
9780 if (impactSpeed > 0.0)
9781 {
9783 #ifndef SERVER
9785 #else
9787 SetSynchDirty();
9788 #endif
9790 }
9791 }
9792
9793 #ifdef SERVER
9794 if (GetCompEM() && GetCompEM().IsPlugged())
9795 {
9796 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9797 GetCompEM().UnplugThis();
9798 }
9799 #endif
9800 }
9801
9803
9805 {
9807 }
9808
9810 {
9811
9812 }
9813
9815 {
9816 super.OnItemLocationChanged(old_owner, new_owner);
9817
9818 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9819 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9820
9821 if (!relatedPlayer && playerNew)
9822 relatedPlayer = playerNew;
9823
9824 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9825 {
9827 if (actionMgr)
9828 {
9829 ActionBase currentAction = actionMgr.GetRunningAction();
9830 if (currentAction)
9832 }
9833 }
9834
9835 Man ownerPlayerOld = null;
9836 Man ownerPlayerNew = null;
9837
9838 if (old_owner)
9839 {
9840 if (old_owner.
IsMan())
9841 {
9842 ownerPlayerOld = Man.Cast(old_owner);
9843 }
9844 else
9845 {
9846 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9847 }
9848 }
9849 else
9850 {
9852 {
9854
9855 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9856 {
9857 GetCompEM().UnplugThis();
9858 }
9859 }
9860 }
9861
9862 if (new_owner)
9863 {
9864 if (new_owner.
IsMan())
9865 {
9866 ownerPlayerNew = Man.Cast(new_owner);
9867 }
9868 else
9869 {
9870 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9871 }
9872 }
9873
9874 if (ownerPlayerOld != ownerPlayerNew)
9875 {
9876 if (ownerPlayerOld)
9877 {
9878 array<EntityAI> subItemsExit = new array<EntityAI>;
9880 for (int i = 0; i < subItemsExit.Count(); i++)
9881 {
9884 }
9885 }
9886
9887 if (ownerPlayerNew)
9888 {
9889 array<EntityAI> subItemsEnter = new array<EntityAI>;
9891 for (int j = 0; j < subItemsEnter.Count(); j++)
9892 {
9895 }
9896 }
9897 }
9898 else if (ownerPlayerNew != null)
9899 {
9900 PlayerBase nplayer;
9901 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9902 {
9903 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9905 for (int k = 0; k < subItemsUpdate.Count(); k++)
9906 {
9908 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9909 }
9910 }
9911 }
9912
9913 if (old_owner)
9914 old_owner.OnChildItemRemoved(this);
9915 if (new_owner)
9916 new_owner.OnChildItemReceived(this);
9917 }
9918
9919
9921 {
9922 super.EEDelete(parent);
9923 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9924 if (player)
9925 {
9927
9928 if (player.IsAlive())
9929 {
9930 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9931 if (r_index >= 0)
9932 {
9933 InventoryLocation r_il = new InventoryLocation;
9934 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9935
9936 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9939 {
9940 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9941 }
9943 {
9944 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9945 }
9946
9947 }
9948
9949 player.RemoveQuickBarEntityShortcut(this);
9950 }
9951 }
9952 }
9953
9955 {
9956 super.EEKilled(killer);
9957
9960 {
9961 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9962 {
9963 if (IsMagazine())
9964 {
9965 if (Magazine.Cast(this).GetAmmoCount() > 0)
9966 {
9968 }
9969 }
9970 else
9971 {
9973 }
9974 }
9975 }
9976 }
9977
9979 {
9980 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9981
9982 super.OnWasAttached(parent, slot_id);
9983
9986
9988 }
9989
9991 {
9992 super.OnWasDetached(parent, slot_id);
9993
9996 }
9997
9999 {
10000 int idx;
10003
10004 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10005 if (inventory_slots.Count() < 1)
10006 {
10007 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10008 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10009 }
10010 else
10011 {
10012 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10013 }
10014
10015 idx = inventory_slots.Find(slot);
10016 if (idx < 0)
10017 return "";
10018
10019 return attach_types.Get(idx);
10020 }
10021
10023 {
10024 int idx = -1;
10025 string slot;
10026
10029
10030 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10031 if (inventory_slots.Count() < 1)
10032 {
10033 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10034 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10035 }
10036 else
10037 {
10038 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10039 if (detach_types.Count() < 1)
10040 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10041 }
10042
10043 for (int i = 0; i < inventory_slots.Count(); i++)
10044 {
10045 slot = inventory_slots.Get(i);
10046 }
10047
10048 if (slot != "")
10049 {
10050 if (detach_types.Count() == 1)
10051 idx = 0;
10052 else
10053 idx = inventory_slots.Find(slot);
10054 }
10055 if (idx < 0)
10056 return "";
10057
10058 return detach_types.Get(idx);
10059 }
10060
10062 {
10063
10065
10066
10067 float min_time = 1;
10068 float max_time = 3;
10069 float delay = Math.RandomFloat(min_time, max_time);
10070
10071 explode_timer.Run(delay, this, "DoAmmoExplosion");
10072 }
10073
10075 {
10076 Magazine magazine = Magazine.Cast(this);
10077 int pop_sounds_count = 6;
10078 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10079
10080
10081 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10082 string sound_name = pop_sounds[ sound_idx ];
10084
10085
10086 magazine.ServerAddAmmoCount(-1);
10087
10088
10089 float min_temp_to_explode = 100;
10090
10091 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10092 {
10094 }
10095 }
10096
10097
10098 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10099 {
10100 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10101
10102 const int CHANCE_DAMAGE_CARGO = 4;
10103 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10104 const int CHANCE_DAMAGE_NOTHING = 2;
10105
10107 {
10108 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10109 int chances;
10110 int rnd;
10111
10112 if (GetInventory().GetCargo())
10113 {
10114 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10115 rnd = Math.RandomInt(0,chances);
10116
10117 if (rnd < CHANCE_DAMAGE_CARGO)
10118 {
10120 }
10121 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10122 {
10124 }
10125 }
10126 else
10127 {
10128 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10129 rnd = Math.RandomInt(0,chances);
10130
10131 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10132 {
10134 }
10135 }
10136 }
10137 }
10138
10140 {
10141 if (GetInventory().GetCargo())
10142 {
10143 int item_count = GetInventory().GetCargo().GetItemCount();
10144 if (item_count > 0)
10145 {
10146 int random_pick = Math.RandomInt(0, item_count);
10148 if (!item.IsExplosive())
10149 {
10150 item.AddHealth("","",damage);
10151 return true;
10152 }
10153 }
10154 }
10155 return false;
10156 }
10157
10159 {
10160 int attachment_count = GetInventory().AttachmentCount();
10161 if (attachment_count > 0)
10162 {
10163 int random_pick = Math.RandomInt(0, attachment_count);
10164 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10165 if (!attachment.IsExplosive())
10166 {
10167 attachment.AddHealth("","",damage);
10168 return true;
10169 }
10170 }
10171 return false;
10172 }
10173
10175 {
10177 }
10178
10180 {
10182 return GetInventory().CanRemoveEntity();
10183
10184 return false;
10185 }
10186
10188 {
10190 return;
10191
10193 {
10194 if (ScriptInputUserData.CanStoreInputUserData())
10195 {
10196 ScriptInputUserData ctx = new ScriptInputUserData;
10201 ctx.
Write(destination_entity);
10203 ctx.
Write(slot_id);
10205 }
10206 }
10207 else if (!
GetGame().IsMultiplayer())
10208 {
10210 }
10211 }
10212
10214 {
10216 return;
10217
10218 float split_quantity_new;
10222 InventoryLocation loc = new InventoryLocation;
10223
10224 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10225 {
10227 split_quantity_new = stack_max;
10228 else
10230
10231 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10232 if (new_item)
10233 {
10234 new_item.SetResultOfSplit(true);
10235 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10237 new_item.SetQuantity(split_quantity_new);
10238 }
10239 }
10240 else if (destination_entity && slot_id == -1)
10241 {
10242 if (quantity > stack_max)
10243 split_quantity_new = stack_max;
10244 else
10245 split_quantity_new = quantity;
10246
10248 {
10251 }
10252
10253 if (new_item)
10254 {
10255 new_item.SetResultOfSplit(true);
10256 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10258 new_item.SetQuantity(split_quantity_new);
10259 }
10260 }
10261 else
10262 {
10263 if (stack_max != 0)
10264 {
10266 {
10268 }
10269
10270 if (split_quantity_new == 0)
10271 {
10272 if (!
GetGame().IsMultiplayer())
10273 player.PhysicalPredictiveDropItem(this);
10274 else
10275 player.ServerDropEntity(this);
10276 return;
10277 }
10278
10280
10281 if (new_item)
10282 {
10283 new_item.SetResultOfSplit(true);
10284 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10286 new_item.SetQuantity(stack_max);
10287 new_item.PlaceOnSurface();
10288 }
10289 }
10290 }
10291 }
10292
10294 {
10296 return;
10297
10298 float split_quantity_new;
10302 InventoryLocation loc = new InventoryLocation;
10303
10304 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10305 {
10307 split_quantity_new = stack_max;
10308 else
10310
10311 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10312 if (new_item)
10313 {
10314 new_item.SetResultOfSplit(true);
10315 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10317 new_item.SetQuantity(split_quantity_new);
10318 }
10319 }
10320 else if (destination_entity && slot_id == -1)
10321 {
10322 if (quantity > stack_max)
10323 split_quantity_new = stack_max;
10324 else
10325 split_quantity_new = quantity;
10326
10328 {
10331 }
10332
10333 if (new_item)
10334 {
10335 new_item.SetResultOfSplit(true);
10336 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10338 new_item.SetQuantity(split_quantity_new);
10339 }
10340 }
10341 else
10342 {
10343 if (stack_max != 0)
10344 {
10346 {
10348 }
10349
10351
10352 if (new_item)
10353 {
10354 new_item.SetResultOfSplit(true);
10355 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10357 new_item.SetQuantity(stack_max);
10358 new_item.PlaceOnSurface();
10359 }
10360 }
10361 }
10362 }
10363
10365 {
10367 return;
10368
10370 {
10371 if (ScriptInputUserData.CanStoreInputUserData())
10372 {
10373 ScriptInputUserData ctx = new ScriptInputUserData;
10378 dst.WriteToContext(ctx);
10380 }
10381 }
10382 else if (!
GetGame().IsMultiplayer())
10383 {
10385 }
10386 }
10387
10389 {
10391 return;
10392
10394 {
10395 if (ScriptInputUserData.CanStoreInputUserData())
10396 {
10397 ScriptInputUserData ctx = new ScriptInputUserData;
10402 ctx.
Write(destination_entity);
10408 }
10409 }
10410 else if (!
GetGame().IsMultiplayer())
10411 {
10413 }
10414 }
10415
10417 {
10419 }
10420
10422 {
10424 return this;
10425
10427 float split_quantity_new;
10429 if (dst.IsValid())
10430 {
10431 int slot_id = dst.GetSlot();
10433
10434 if (quantity > stack_max)
10435 split_quantity_new = stack_max;
10436 else
10437 split_quantity_new = quantity;
10438
10440
10441 if (new_item)
10442 {
10443 new_item.SetResultOfSplit(true);
10444 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10447 }
10448
10449 return new_item;
10450 }
10451
10452 return null;
10453 }
10454
10456 {
10458 return;
10459
10461 float split_quantity_new;
10463 if (destination_entity)
10464 {
10466 if (quantity > stackable)
10467 split_quantity_new = stackable;
10468 else
10469 split_quantity_new = quantity;
10470
10471 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10472 if (new_item)
10473 {
10474 new_item.SetResultOfSplit(true);
10475 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10477 new_item.SetQuantity(split_quantity_new);
10478 }
10479 }
10480 }
10481
10483 {
10485 return;
10486
10488 {
10489 if (ScriptInputUserData.CanStoreInputUserData())
10490 {
10491 ScriptInputUserData ctx = new ScriptInputUserData;
10496 ItemBase destination_entity =
this;
10497 ctx.
Write(destination_entity);
10501 }
10502 }
10503 else if (!
GetGame().IsMultiplayer())
10504 {
10506 }
10507 }
10508
10510 {
10512 return;
10513
10515 float split_quantity_new;
10517 if (player)
10518 {
10520 if (quantity > stackable)
10521 split_quantity_new = stackable;
10522 else
10523 split_quantity_new = quantity;
10524
10525 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10526 new_item =
ItemBase.Cast(in_hands);
10527 if (new_item)
10528 {
10529 new_item.SetResultOfSplit(true);
10530 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10532 new_item.SetQuantity(split_quantity_new);
10533 }
10534 }
10535 }
10536
10538 {
10540 return;
10541
10543 float split_quantity_new = Math.Floor(quantity * 0.5);
10544
10546
10547 if (new_item)
10548 {
10549 if (new_item.GetQuantityMax() < split_quantity_new)
10550 {
10551 split_quantity_new = new_item.GetQuantityMax();
10552 }
10553
10554 new_item.SetResultOfSplit(true);
10555 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10556
10558 {
10561 }
10562 else
10563 {
10566 }
10567 }
10568 }
10569
10571 {
10573 return;
10574
10576 float split_quantity_new = Math.Floor(quantity / 2);
10577
10578 InventoryLocation invloc = new InventoryLocation;
10580
10582 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10583
10584 if (new_item)
10585 {
10586 if (new_item.GetQuantityMax() < split_quantity_new)
10587 {
10588 split_quantity_new = new_item.GetQuantityMax();
10589 }
10591 {
10594 }
10595 else
10596 {
10599 }
10600 }
10601 }
10602
10605 {
10606 SetWeightDirty();
10608
10609 if (parent)
10610 parent.OnAttachmentQuantityChangedEx(this, delta);
10611
10613 {
10615 {
10617 }
10619 {
10620 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10622 }
10623 }
10624
10625 }
10626
10629 {
10630
10631 }
10632
10635 {
10637 }
10638
10640 {
10641 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10642
10644 {
10645 if (newLevel == GameConstants.STATE_RUINED)
10646 {
10648 EntityAI parent = GetHierarchyParent();
10649 if (parent && parent.IsFireplace())
10650 {
10651 CargoBase cargo = GetInventory().GetCargo();
10652 if (cargo)
10653 {
10655 {
10657 }
10658 }
10659 }
10660 }
10661
10663 {
10664
10666 return;
10667 }
10668
10669 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10670 {
10672 }
10673 }
10674 }
10675
10676
10678 {
10679 super.OnRightClick();
10680
10682 {
10684 {
10685 if (ScriptInputUserData.CanStoreInputUserData())
10686 {
10687 vector m4[4];
10689
10690 EntityAI root = GetHierarchyRoot();
10691
10692 InventoryLocation dst = new InventoryLocation;
10694 {
10695 if (root)
10696 {
10697 root.GetTransform(m4);
10699 }
10700 else
10701 GetInventory().GetCurrentInventoryLocation(dst);
10702 }
10703 else
10704 {
10706
10707
10708 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10709 {
10710 if (root)
10711 {
10712 root.GetTransform(m4);
10714 }
10715 else
10716 GetInventory().GetCurrentInventoryLocation(dst);
10717 }
10718 else
10719 {
10720 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10721 }
10722 }
10723
10724 ScriptInputUserData ctx = new ScriptInputUserData;
10732 }
10733 }
10734 else if (!
GetGame().IsMultiplayer())
10735 {
10737 }
10738 }
10739 }
10740
10741 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10742 {
10743
10744 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10745 return false;
10746
10747 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10748 return false;
10749
10750
10752 return false;
10753
10754
10755 Magazine mag = Magazine.Cast(this);
10756 if (mag)
10757 {
10758 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10759 return false;
10760
10761 if (stack_max_limit)
10762 {
10763 Magazine other_mag = Magazine.Cast(other_item);
10764 if (other_item)
10765 {
10766 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10767 return false;
10768 }
10769
10770 }
10771 }
10772 else
10773 {
10774
10776 return false;
10777
10779 return false;
10780 }
10781
10782 PlayerBase player = null;
10783 if (CastTo(player, GetHierarchyRootPlayer()))
10784 {
10785 if (player.GetInventory().HasAttachment(this))
10786 return false;
10787
10788 if (player.IsItemsToDelete())
10789 return false;
10790 }
10791
10792 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10793 return false;
10794
10795 int slotID;
10797 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10798 return false;
10799
10800 return true;
10801 }
10802
10804 {
10806 }
10807
10809 {
10810 return m_IsResultOfSplit;
10811 }
10812
10814 {
10815 m_IsResultOfSplit = value;
10816 }
10817
10819 {
10821 }
10822
10824 {
10825 float other_item_quantity = other_item.GetQuantity();
10826 float this_free_space;
10827
10829
10831
10832 if (other_item_quantity > this_free_space)
10833 {
10834 return this_free_space;
10835 }
10836 else
10837 {
10838 return other_item_quantity;
10839 }
10840 }
10841
10843 {
10845 }
10846
10848 {
10850 return;
10851
10852 if (!IsMagazine() && other_item)
10853 {
10855 if (quantity_used != 0)
10856 {
10857 float hp1 = GetHealth01("","");
10858 float hp2 = other_item.GetHealth01("","");
10859 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10860 hpResult = hpResult / (
GetQuantity() + quantity_used);
10861
10862 hpResult *= GetMaxHealth();
10863 Math.Round(hpResult);
10864 SetHealth("", "Health", hpResult);
10865
10867 other_item.AddQuantity(-quantity_used);
10868 }
10869 }
10871 }
10872
10874 {
10875 #ifdef SERVER
10876 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10877 GetHierarchyParent().IncreaseLifetimeUp();
10878 #endif
10879 };
10880
10882 {
10883 PlayerBase p = PlayerBase.Cast(player);
10884
10885 array<int> recipesIds = p.m_Recipes;
10886 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10887 if (moduleRecipesManager)
10888 {
10889 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10890 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10891 }
10892
10893 for (int i = 0;i < recipesIds.Count(); i++)
10894 {
10895 int key = recipesIds.Get(i);
10896 string recipeName = moduleRecipesManager.GetRecipeName(key);
10898 }
10899 }
10900
10901
10902 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10903 {
10904 super.GetDebugActions(outputList);
10905
10906
10911
10912
10916
10920
10921
10924
10925
10927 {
10930 }
10931
10933
10936
10940 }
10941
10942
10943
10944
10946 {
10947 super.OnAction(action_id, player, ctx);
10948 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10949 {
10950 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10951 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10952 PlayerBase p = PlayerBase.Cast(player);
10953 if (
EActions.RECIPES_RANGE_START < 1000)
10954 {
10955 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10956 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10957 }
10958 }
10959 #ifndef SERVER
10960 else if (action_id ==
EActions.WATCH_PLAYER)
10961 {
10962 PluginDeveloper.SetDeveloperItemClientEx(player);
10963 }
10964 #endif
10966 {
10967 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10968 {
10969 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10970 OnDebugButtonPressServer(id + 1);
10971 }
10972
10973 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10974 {
10975 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10977 }
10978
10979 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10980 {
10981 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10983 }
10984
10985 else if (action_id ==
EActions.ADD_QUANTITY)
10986 {
10987 if (IsMagazine())
10988 {
10989 Magazine mag = Magazine.Cast(this);
10990 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10991 }
10992 else
10993 {
10995 }
10996
10997 if (m_EM)
10998 {
10999 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11000 }
11001
11002 }
11003
11004 else if (action_id ==
EActions.REMOVE_QUANTITY)
11005 {
11006 if (IsMagazine())
11007 {
11008 Magazine mag2 = Magazine.Cast(this);
11009 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11010 }
11011 else
11012 {
11014 }
11015 if (m_EM)
11016 {
11017 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11018 }
11019
11020 }
11021
11022 else if (action_id ==
EActions.SET_QUANTITY_0)
11023 {
11025
11026 if (m_EM)
11027 {
11028 m_EM.SetEnergy(0);
11029 }
11030 }
11031
11032 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11033 {
11035
11036 if (m_EM)
11037 {
11038 m_EM.SetEnergy(m_EM.GetEnergyMax());
11039 }
11040 }
11041
11042 else if (action_id ==
EActions.ADD_HEALTH)
11043 {
11044 AddHealth("","",GetMaxHealth("","Health")/5);
11045 }
11046 else if (action_id ==
EActions.REMOVE_HEALTH)
11047 {
11048 AddHealth("","",-GetMaxHealth("","Health")/5);
11049 }
11050 else if (action_id ==
EActions.DESTROY_HEALTH)
11051 {
11052 SetHealth01("","",0);
11053 }
11054 else if (action_id ==
EActions.WATCH_ITEM)
11055 {
11057 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11058 #ifdef DEVELOPER
11059 SetDebugDeveloper_item(this);
11060 #endif
11061 }
11062
11063 else if (action_id ==
EActions.ADD_TEMPERATURE)
11064 {
11065 AddTemperature(20);
11066
11067 }
11068
11069 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11070 {
11071 AddTemperature(-20);
11072
11073 }
11074
11075 else if (action_id ==
EActions.FLIP_FROZEN)
11076 {
11077 SetFrozen(!GetIsFrozen());
11078
11079 }
11080
11081 else if (action_id ==
EActions.ADD_WETNESS)
11082 {
11084
11085 }
11086
11087 else if (action_id ==
EActions.REMOVE_WETNESS)
11088 {
11090
11091 }
11092
11093 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11094 {
11097
11098
11099 }
11100
11101 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11102 {
11105 }
11106
11107 else if (action_id ==
EActions.MAKE_SPECIAL)
11108 {
11109 auto debugParams = DebugSpawnParams.WithPlayer(player);
11110 OnDebugSpawnEx(debugParams);
11111 }
11112
11113 else if (action_id ==
EActions.DELETE)
11114 {
11115 Delete();
11116 }
11117
11118 }
11119
11120
11121 return false;
11122 }
11123
11124
11125
11126
11130
11133
11134
11135
11137 {
11138 return false;
11139 }
11140
11141
11143 {
11144 return true;
11145 }
11146
11147
11149 {
11150 return true;
11151 }
11152
11153
11154
11156 {
11157 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11159 }
11160
11163 {
11164 return null;
11165 }
11166
11168 {
11169 return false;
11170 }
11171
11173 {
11174 return false;
11175 }
11176
11180
11181
11183 {
11184 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11185 return module_repairing.CanRepair(this, item_repair_kit);
11186 }
11187
11188
11189 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11190 {
11191 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11192 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11193 }
11194
11195
11197 {
11198
11199
11200
11201
11202
11203
11204
11205
11206 return 1;
11207 }
11208
11209
11210
11212 {
11214 }
11215
11216
11217
11219 {
11221 }
11222
11223
11232 {
11233 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11234
11235 if (player)
11236 {
11237 player.MessageStatus(text);
11238 }
11239 }
11240
11241
11250 {
11251 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11252
11253 if (player)
11254 {
11255 player.MessageAction(text);
11256 }
11257 }
11258
11259
11268 {
11269 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11270
11271 if (player)
11272 {
11273 player.MessageFriendly(text);
11274 }
11275 }
11276
11277
11286 {
11287 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11288
11289 if (player)
11290 {
11291 player.MessageImportant(text);
11292 }
11293 }
11294
11296 {
11297 return true;
11298 }
11299
11300
11301 override bool KindOf(
string tag)
11302 {
11303 bool found = false;
11304 string item_name = this.
GetType();
11307
11308 int array_size = item_tag_array.Count();
11309 for (int i = 0; i < array_size; i++)
11310 {
11311 if (item_tag_array.Get(i) == tag)
11312 {
11313 found = true;
11314 break;
11315 }
11316 }
11317 return found;
11318 }
11319
11320
11322 {
11323
11324 super.OnRPC(sender, rpc_type,ctx);
11325
11326
11327 switch (rpc_type)
11328 {
11329 #ifndef SERVER
11330 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11331 Param2<bool, string> p = new Param2<bool, string>(false, "");
11332
11334 return;
11335
11336 bool play = p.param1;
11337 string soundSet = p.param2;
11338
11339 if (play)
11340 {
11342 {
11344 {
11346 }
11347 }
11348 else
11349 {
11351 }
11352 }
11353 else
11354 {
11356 }
11357
11358 break;
11359 #endif
11360
11361 }
11362
11364 {
11366 }
11367 }
11368
11369
11370
11371
11373 {
11374 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11375 return plugin.GetID(
name);
11376 }
11377
11379 {
11380 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11381 return plugin.GetName(id);
11382 }
11383
11386 {
11387
11388
11389 int varFlags;
11390 if (!ctx.
Read(varFlags))
11391 return;
11392
11393 if (varFlags & ItemVariableFlags.FLOAT)
11394 {
11396 }
11397 }
11398
11400 {
11401
11402 super.SerializeNumericalVars(floats_out);
11403
11404
11405
11407 {
11409 }
11410
11412 {
11414 }
11415
11417 {
11419 }
11420
11422 {
11427 }
11428
11430 {
11432 }
11433 }
11434
11436 {
11437
11438 super.DeSerializeNumericalVars(floats);
11439
11440
11441 int index = 0;
11442 int mask = Math.Round(floats.Get(index));
11443
11444 index++;
11445
11447 {
11449 {
11451 }
11452 else
11453 {
11454 float quantity = floats.Get(index);
11455 SetQuantity(quantity,
true,
false,
false,
false);
11456 }
11457 index++;
11458 }
11459
11461 {
11462 float wet = floats.Get(index);
11464 index++;
11465 }
11466
11468 {
11469 int liquidtype = Math.Round(floats.Get(index));
11471 index++;
11472 }
11473
11475 {
11477 index++;
11479 index++;
11481 index++;
11483 index++;
11484 }
11485
11487 {
11488 int cleanness = Math.Round(floats.Get(index));
11490 index++;
11491 }
11492 }
11493
11495 {
11496 super.WriteVarsToCTX(ctx);
11497
11498
11500 {
11502 }
11503
11505 {
11507 }
11508
11510 {
11512 }
11513
11515 {
11516 int r,g,b,a;
11522 }
11523
11525 {
11527 }
11528 }
11529
11531 {
11532 if (!super.ReadVarsFromCTX(ctx,version))
11533 return false;
11534
11535 int intValue;
11536 float value;
11537
11538 if (version < 140)
11539 {
11540 if (!ctx.
Read(intValue))
11541 return false;
11542
11543 m_VariablesMask = intValue;
11544 }
11545
11547 {
11548 if (!ctx.
Read(value))
11549 return false;
11550
11552 {
11554 }
11555 else
11556 {
11558 }
11559 }
11560
11561 if (version < 140)
11562 {
11564 {
11565 if (!ctx.
Read(value))
11566 return false;
11567 SetTemperatureDirect(value);
11568 }
11569 }
11570
11572 {
11573 if (!ctx.
Read(value))
11574 return false;
11576 }
11577
11579 {
11580 if (!ctx.
Read(intValue))
11581 return false;
11583 }
11584
11586 {
11587 int r,g,b,a;
11589 return false;
11591 return false;
11593 return false;
11595 return false;
11596
11598 }
11599
11601 {
11602 if (!ctx.
Read(intValue))
11603 return false;
11605 }
11606
11607 if (version >= 138 && version < 140)
11608 {
11610 {
11611 if (!ctx.
Read(intValue))
11612 return false;
11613 SetFrozen(intValue);
11614 }
11615 }
11616
11617 return true;
11618 }
11619
11620
11622 {
11625 {
11627 }
11628
11629 if (!super.OnStoreLoad(ctx, version))
11630 {
11632 return false;
11633 }
11634
11635 if (version >= 114)
11636 {
11637 bool hasQuickBarIndexSaved;
11638
11639 if (!ctx.
Read(hasQuickBarIndexSaved))
11640 {
11642 return false;
11643 }
11644
11645 if (hasQuickBarIndexSaved)
11646 {
11647 int itmQBIndex;
11648
11649
11650 if (!ctx.
Read(itmQBIndex))
11651 {
11653 return false;
11654 }
11655
11656 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11657 if (itmQBIndex != -1 && parentPlayer)
11658 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11659 }
11660 }
11661 else
11662 {
11663
11664 PlayerBase player;
11665 int itemQBIndex;
11666 if (version ==
int.
MAX)
11667 {
11668 if (!ctx.
Read(itemQBIndex))
11669 {
11671 return false;
11672 }
11673 }
11674 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11675 {
11676
11677 if (!ctx.
Read(itemQBIndex))
11678 {
11680 return false;
11681 }
11682 if (itemQBIndex != -1 && player)
11683 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11684 }
11685 }
11686
11687 if (version < 140)
11688 {
11689
11690 if (!LoadVariables(ctx, version))
11691 {
11693 return false;
11694 }
11695 }
11696
11697
11699 {
11701 return false;
11702 }
11703 if (version >= 132)
11704 {
11706 if (raib)
11707 {
11709 {
11711 return false;
11712 }
11713 }
11714 }
11715
11717 return true;
11718 }
11719
11720
11721
11723 {
11724 super.OnStoreSave(ctx);
11725
11726 PlayerBase player;
11727 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11728 {
11730
11731 int itemQBIndex = -1;
11732 itemQBIndex = player.FindQuickBarEntityIndex(this);
11733 ctx.
Write(itemQBIndex);
11734 }
11735 else
11736 {
11738 }
11739
11741
11743 if (raib)
11744 {
11746 }
11747 }
11748
11749
11751 {
11752 super.AfterStoreLoad();
11753
11755 {
11757 }
11758
11760 {
11763 }
11764 }
11765
11767 {
11768 super.EEOnAfterLoad();
11769
11771 {
11773 }
11774
11777 }
11778
11780 {
11781 return false;
11782 }
11783
11784
11785
11787 {
11789 {
11790 #ifdef PLATFORM_CONSOLE
11791
11793 {
11795 if (menu)
11796 {
11798 }
11799 }
11800 #endif
11801 }
11802
11804 {
11807 }
11808
11810 {
11811 SetWeightDirty();
11813 }
11815 {
11818 }
11819
11821 {
11824 }
11826 {
11829 }
11830
11831 super.OnVariablesSynchronized();
11832 }
11833
11834
11835
11837 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11838 {
11839 if (!IsServerCheck(allow_client))
11840 return false;
11841
11843 return false;
11844
11847
11848 if (value <= (min + 0.001))
11849 value = min;
11850
11851 if (value == min)
11852 {
11853 if (destroy_config)
11854 {
11855 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11856 if (dstr)
11857 {
11859 this.Delete();
11860 return true;
11861 }
11862 }
11863 else if (destroy_forced)
11864 {
11866 this.Delete();
11867 return true;
11868 }
11869
11871 }
11872
11875
11877 {
11879
11880 if (delta)
11882 }
11883
11885
11886 return false;
11887 }
11888
11889
11891 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11892 {
11894 }
11895
11897 {
11900 }
11901
11903 {
11906 }
11907
11910 {
11911 float value_clamped = Math.Clamp(value, 0, 1);
11913 SetQuantity(result, destroy_config, destroy_forced);
11914 }
11915
11916
11919 {
11921 }
11922
11924 {
11926 }
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11938 {
11939 int slot = -1;
11940 if (GetInventory())
11941 {
11942 InventoryLocation il = new InventoryLocation;
11943 GetInventory().GetCurrentInventoryLocation(il);
11945 }
11946
11948 }
11949
11951 {
11952 float quantity_max = 0;
11953
11955 {
11956 if (attSlotID != -1)
11957 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11958
11959 if (quantity_max <= 0)
11961 }
11962
11963 if (quantity_max <= 0)
11965
11966 return quantity_max;
11967 }
11968
11970 {
11972 }
11973
11975 {
11977 }
11978
11979
11981 {
11983 }
11984
11986 {
11988 }
11989
11991 {
11993 }
11994
11995
11997 {
11998
11999 float weightEx = GetWeightEx();
12000 float special = GetInventoryAndCargoWeight();
12001 return weightEx - special;
12002 }
12003
12004
12006 {
12008 }
12009
12011 {
12013 {
12014 #ifdef DEVELOPER
12015 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12016 {
12017 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12019 }
12020 #endif
12021
12022 return GetQuantity() * GetConfigWeightModified();
12023 }
12024 else if (HasEnergyManager())
12025 {
12026 #ifdef DEVELOPER
12027 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12028 {
12029 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12030 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12031 }
12032 #endif
12033 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12034 }
12035 else
12036 {
12037 #ifdef DEVELOPER
12038 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12039 {
12040 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12041 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12042 }
12043 #endif
12044 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12045 }
12046 }
12047
12050 {
12051 int item_count = 0;
12053
12054 if (GetInventory().GetCargo() != NULL)
12055 {
12056 item_count = GetInventory().GetCargo().GetItemCount();
12057 }
12058
12059 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12060 {
12061 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12062 if (item)
12063 item_count += item.GetNumberOfItems();
12064 }
12065 return item_count;
12066 }
12067
12070 {
12071 float weight = 0;
12072 float wetness = 1;
12073 if (include_wetness)
12076 {
12077 weight = wetness * m_ConfigWeight;
12078 }
12080 {
12081 weight = 1;
12082 }
12083 return weight;
12084 }
12085
12086
12087
12089 {
12090 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12091 {
12092 GameInventory inv = GetInventory();
12093 array<EntityAI> items = new array<EntityAI>;
12095 for (int i = 0; i < items.Count(); i++)
12096 {
12098 if (item)
12099 {
12101 }
12102 }
12103 }
12104 }
12105
12106
12107
12108
12110 {
12111 float energy = 0;
12112 if (HasEnergyManager())
12113 {
12114 energy = GetCompEM().GetEnergy();
12115 }
12116 return energy;
12117 }
12118
12119
12121 {
12122 super.OnEnergyConsumed();
12123
12125 }
12126
12128 {
12129 super.OnEnergyAdded();
12130
12132 }
12133
12134
12136 {
12137 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12138 {
12140 {
12141 float energy_0to1 = GetCompEM().GetEnergy0To1();
12143 }
12144 }
12145 }
12146
12147
12149 {
12150 return ConfigGetFloat("heatIsolation");
12151 }
12152
12154 {
12156 }
12157
12159 {
12160 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12161 if (
GetGame().ConfigIsExisting(paramPath))
12163
12164 return 0.0;
12165 }
12166
12168 {
12169 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12170 if (
GetGame().ConfigIsExisting(paramPath))
12172
12173 return 0.0;
12174 }
12175
12176 override void SetWet(
float value,
bool allow_client =
false)
12177 {
12178 if (!IsServerCheck(allow_client))
12179 return;
12180
12183
12185
12186 m_VarWet = Math.Clamp(value, min, max);
12187
12189 {
12192 }
12193 }
12194
12195 override void AddWet(
float value)
12196 {
12198 }
12199
12201 {
12203 }
12204
12206 {
12208 }
12209
12211 {
12213 }
12214
12216 {
12218 }
12219
12221 {
12223 }
12224
12225 override void OnWetChanged(
float newVal,
float oldVal)
12226 {
12229 if (newLevel != oldLevel)
12230 {
12232 }
12233 }
12234
12236 {
12237 SetWeightDirty();
12238 }
12239
12241 {
12242 return GetWetLevelInternal(
m_VarWet);
12243 }
12244
12245
12246
12248 {
12250 }
12251
12253 {
12255 }
12256
12258 {
12260 }
12261
12263 {
12265 }
12266
12267
12268
12270 {
12271 if (ConfigIsExisting("itemModelLength"))
12272 {
12273 return ConfigGetFloat("itemModelLength");
12274 }
12275 return 0;
12276 }
12277
12279 {
12280 if (ConfigIsExisting("itemAttachOffset"))
12281 {
12282 return ConfigGetFloat("itemAttachOffset");
12283 }
12284 return 0;
12285 }
12286
12287 override void SetCleanness(
int value,
bool allow_client =
false)
12288 {
12289 if (!IsServerCheck(allow_client))
12290 return;
12291
12293
12295
12298 }
12299
12301 {
12303 }
12304
12306 {
12307 return true;
12308 }
12309
12310
12311
12312
12314 {
12316 }
12317
12319 {
12321 }
12322
12323
12324
12325
12326 override void SetColor(
int r,
int g,
int b,
int a)
12327 {
12333 }
12335 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12336 {
12341 }
12342
12344 {
12346 }
12347
12350 {
12351 int r,g,b,a;
12353 r = r/255;
12354 g = g/255;
12355 b = b/255;
12356 a = a/255;
12357 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12358 }
12359
12360
12361
12362 override void SetLiquidType(
int value,
bool allow_client =
false)
12363 {
12364 if (!IsServerCheck(allow_client))
12365 return;
12366
12371 }
12372
12374 {
12375 return ConfigGetInt("varLiquidTypeInit");
12376 }
12377
12379 {
12381 }
12382
12384 {
12386 SetFrozen(false);
12387 }
12388
12391 {
12392 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12393 }
12394
12395
12398 {
12399 PlayerBase nplayer;
12400 if (PlayerBase.CastTo(nplayer, player))
12401 {
12403
12404 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12405 }
12406 }
12407
12408
12411 {
12412 PlayerBase nplayer;
12413 if (PlayerBase.CastTo(nplayer,player))
12414 {
12415
12416 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12417
12418 }
12419
12420
12421 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12422
12423
12424 if (HasEnergyManager())
12425 {
12426 GetCompEM().UpdatePlugState();
12427 }
12428 }
12429
12430
12432 {
12433 super.OnPlacementStarted(player);
12434
12436 }
12437
12438 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12439 {
12441 {
12442 m_AdminLog.OnPlacementComplete(player,
this);
12443 }
12444
12445 super.OnPlacementComplete(player, position, orientation);
12446 }
12447
12448
12449
12450
12451
12453 {
12455 {
12456 return true;
12457 }
12458 else
12459 {
12460 return false;
12461 }
12462 }
12463
12464
12466 {
12468 {
12470 }
12471 }
12472
12473
12475 {
12477 }
12478
12480 {
12482 }
12483
12484 override void InsertAgent(
int agent,
float count = 1)
12485 {
12486 if (count < 1)
12487 return;
12488
12490 }
12491
12494 {
12496 }
12497
12498
12500 {
12502 }
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12546 {
12548 return false;
12549 return true;
12550 }
12551
12553 {
12554
12556 }
12557
12558
12561 {
12562 super.CheckForRoofLimited(timeTresholdMS);
12563
12565 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12566 {
12567 m_PreviousRoofTestTime = time;
12568 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12569 }
12570 }
12571
12572
12574 {
12576 {
12577 return 0;
12578 }
12579
12580 if (GetInventory().GetAttachmentSlotsCount() != 0)
12581 {
12582 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12583 if (filter)
12584 return filter.GetProtectionLevel(type, false, system);
12585 else
12586 return 0;
12587 }
12588
12589 string subclassPath, entryName;
12590
12591 switch (type)
12592 {
12594 entryName = "biological";
12595 break;
12597 entryName = "chemical";
12598 break;
12599 default:
12600 entryName = "biological";
12601 break;
12602 }
12603
12604 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12605
12607 }
12608
12609
12610
12613 {
12614 if (!IsMagazine())
12616
12618 }
12619
12620
12621
12622
12623
12628 {
12629 return true;
12630 }
12631
12633 {
12635 }
12636
12637
12638
12639
12640
12642 {
12643 if (parent)
12644 {
12645 if (parent.IsInherited(DayZInfected))
12646 return true;
12647
12648 if (!parent.IsRuined())
12649 return true;
12650 }
12651
12652 return true;
12653 }
12654
12656 {
12657 if (!super.CanPutAsAttachment(parent))
12658 {
12659 return false;
12660 }
12661
12662 if (!IsRuined() && !parent.IsRuined())
12663 {
12664 return true;
12665 }
12666
12667 return false;
12668 }
12669
12671 {
12672
12673
12674
12675
12676 return super.CanReceiveItemIntoCargo(item);
12677 }
12678
12680 {
12681
12682
12683
12684
12685 GameInventory attachmentInv = attachment.GetInventory();
12687 {
12688 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12689 return false;
12690 }
12691
12692 InventoryLocation loc = new InventoryLocation();
12693 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12694 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12695 return false;
12696
12697 return super.CanReceiveAttachment(attachment, slotId);
12698 }
12699
12701 {
12702 if (!super.CanReleaseAttachment(attachment))
12703 return false;
12704
12705 return GetInventory().AreChildrenAccessible();
12706 }
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12729 {
12730 int id = muzzle_owner.GetMuzzleID();
12731 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12732
12733 if (WPOF_array)
12734 {
12735 for (int i = 0; i < WPOF_array.Count(); i++)
12736 {
12737 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12738
12739 if (WPOF)
12740 {
12741 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12742 }
12743 }
12744 }
12745 }
12746
12747
12749 {
12750 int id = muzzle_owner.GetMuzzleID();
12752
12753 if (WPOBE_array)
12754 {
12755 for (int i = 0; i < WPOBE_array.Count(); i++)
12756 {
12757 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12758
12759 if (WPOBE)
12760 {
12761 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12762 }
12763 }
12764 }
12765 }
12766
12767
12769 {
12770 int id = muzzle_owner.GetMuzzleID();
12771 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12772
12773 if (WPOOH_array)
12774 {
12775 for (int i = 0; i < WPOOH_array.Count(); i++)
12776 {
12777 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12778
12779 if (WPOOH)
12780 {
12781 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12782 }
12783 }
12784 }
12785 }
12786
12787
12789 {
12790 int id = muzzle_owner.GetMuzzleID();
12791 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12792
12793 if (WPOOH_array)
12794 {
12795 for (int i = 0; i < WPOOH_array.Count(); i++)
12796 {
12797 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12798
12799 if (WPOOH)
12800 {
12801 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12802 }
12803 }
12804 }
12805 }
12806
12807
12809 {
12810 int id = muzzle_owner.GetMuzzleID();
12811 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12812
12813 if (WPOOH_array)
12814 {
12815 for (int i = 0; i < WPOOH_array.Count(); i++)
12816 {
12817 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12818
12819 if (WPOOH)
12820 {
12821 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12822 }
12823 }
12824 }
12825 }
12826
12827
12828
12830 {
12832 {
12833 return true;
12834 }
12835
12836 return false;
12837 }
12838
12840 {
12842 {
12843 return true;
12844 }
12845
12846 return false;
12847 }
12848
12850 {
12852 {
12853 return true;
12854 }
12855
12856 return false;
12857 }
12858
12860 {
12861 return false;
12862 }
12863
12866 {
12867 return UATimeSpent.DEFAULT_DEPLOY;
12868 }
12869
12870
12871
12872
12874 {
12876 SetSynchDirty();
12877 }
12878
12880 {
12882 }
12883
12884
12886 {
12887 return false;
12888 }
12889
12892 {
12893 string att_type = "None";
12894
12895 if (ConfigIsExisting("soundAttType"))
12896 {
12897 att_type = ConfigGetString("soundAttType");
12898 }
12899
12901 }
12902
12904 {
12906 }
12907
12908
12909
12910
12911
12915
12917 {
12920
12922 }
12923
12924
12926 {
12928 return;
12929
12931
12934
12937
12938 SoundParameters params = new SoundParameters();
12942 }
12943
12944
12946 {
12948 return;
12949
12951 SetSynchDirty();
12952
12955 }
12956
12957
12959 {
12961 return;
12962
12964 SetSynchDirty();
12965
12968 }
12969
12971 {
12973 }
12974
12976 {
12978 }
12979
12982 {
12983 if (!
GetGame().IsDedicatedServer())
12984 {
12985 if (ConfigIsExisting("attachSoundSet"))
12986 {
12987 string cfg_path = "";
12988 string soundset = "";
12989 string type_name =
GetType();
12990
12993 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12994 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12995
12996 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12997 {
12998 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12999 {
13000 if (cfg_slot_array[i] == slot_type)
13001 {
13002 soundset = cfg_soundset_array[i];
13003 break;
13004 }
13005 }
13006 }
13007
13008 if (soundset != "")
13009 {
13010 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13012 }
13013 }
13014 }
13015 }
13016
13018 {
13019
13020 }
13021
13022 void OnApply(PlayerBase player);
13023
13025 {
13026 return 1.0;
13027 };
13028
13030 {
13032 }
13033
13035 {
13037 }
13038
13040
13042 {
13043 SetDynamicPhysicsLifeTime(0.01);
13045 }
13046
13048 {
13049 array<string> zone_names = new array<string>;
13050 GetDamageZones(zone_names);
13051 for (int i = 0; i < zone_names.Count(); i++)
13052 {
13053 SetHealthMax(zone_names.Get(i),"Health");
13054 }
13055 SetHealthMax("","Health");
13056 }
13057
13060 {
13061 float global_health = GetHealth01("","Health");
13062 array<string> zones = new array<string>;
13063 GetDamageZones(zones);
13064
13065 for (int i = 0; i < zones.Count(); i++)
13066 {
13067 SetHealth01(zones.Get(i),"Health",global_health);
13068 }
13069 }
13070
13073 {
13074 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13075 }
13076
13078 {
13079 if (!hasRootAsPlayer)
13080 {
13081 if (refParentIB)
13082 {
13083
13084 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13085 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13086
13087 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13088 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13089
13092 }
13093 else
13094 {
13095
13098 }
13099 }
13100 }
13101
13103 {
13105 {
13106 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13107 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13108 {
13109 float heatPermCoef = 1.0;
13111 while (ent)
13112 {
13113 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13114 ent = ent.GetHierarchyParent();
13115 }
13116
13117 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13118 }
13119 }
13120 }
13121
13123 {
13124
13125 EntityAI parent = GetHierarchyParent();
13126 if (!parent)
13127 {
13128 hasParent = false;
13129 hasRootAsPlayer = false;
13130 }
13131 else
13132 {
13133 hasParent = true;
13134 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13135 refParentIB =
ItemBase.Cast(parent);
13136 }
13137 }
13138
13139 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13140 {
13141
13142 }
13143
13145 {
13146
13147 return false;
13148 }
13149
13151 {
13152
13153
13154 return false;
13155 }
13156
13158 {
13159
13160 return false;
13161 }
13162
13165 {
13166 return !GetIsFrozen() &&
IsOpen();
13167 }
13168
13170 {
13171 bool hasParent = false, hasRootAsPlayer = false;
13173
13174 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13175 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13176
13177 if (wwtu || foodDecay)
13178 {
13182
13183 if (processWetness || processTemperature || processDecay)
13184 {
13186
13187 if (processWetness)
13188 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13189
13190 if (processTemperature)
13192
13193 if (processDecay)
13194 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13195 }
13196 }
13197 }
13198
13201 {
13203 }
13204
13206 {
13209
13210 return super.GetTemperatureFreezeThreshold();
13211 }
13212
13214 {
13217
13218 return super.GetTemperatureThawThreshold();
13219 }
13220
13222 {
13225
13226 return super.GetItemOverheatThreshold();
13227 }
13228
13230 {
13232 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13233
13234 return super.GetTemperatureFreezeTime();
13235 }
13236
13238 {
13240 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13241
13242 return super.GetTemperatureThawTime();
13243 }
13244
13249
13251 {
13252 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13253 }
13254
13256 {
13257 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13258 }
13259
13262 {
13264 }
13265
13267 {
13269 }
13270
13272 {
13274 }
13275
13278 {
13279 return null;
13280 }
13281
13284 {
13285 return false;
13286 }
13287
13289 {
13291 {
13294 if (!trg)
13295 {
13297 explosive = this;
13298 }
13299
13300 explosive.PairRemote(trg);
13302
13303 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13304 trg.SetPersistentPairID(persistentID);
13305 explosive.SetPersistentPairID(persistentID);
13306
13307 return true;
13308 }
13309 return false;
13310 }
13311
13314 {
13315 float ret = 1.0;
13318 ret *= GetHealth01();
13319
13320 return ret;
13321 }
13322
13323 #ifdef DEVELOPER
13324 override void SetDebugItem()
13325 {
13326 super.SetDebugItem();
13327 _itemBase = this;
13328 }
13329
13331 {
13332 string text = super.GetDebugText();
13333
13335 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13336
13337 return text;
13338 }
13339 #endif
13340
13342 {
13343 return true;
13344 }
13345
13347
13349
13351 {
13354 }
13355
13356
13364
13380}
13381
13383{
13385 if (entity)
13386 {
13387 bool is_item = entity.IsInherited(
ItemBase);
13388 if (is_item && full_quantity)
13389 {
13392 }
13393 }
13394 else
13395 {
13397 return NULL;
13398 }
13399 return entity;
13400}
13401
13403{
13404 if (item)
13405 {
13406 if (health > 0)
13407 item.SetHealth("", "", health);
13408
13409 if (item.CanHaveTemperature())
13410 {
13412 if (item.CanFreeze())
13413 item.SetFrozen(false);
13414 }
13415
13416 if (item.HasEnergyManager())
13417 {
13418 if (quantity >= 0)
13419 {
13420 item.GetCompEM().SetEnergy0To1(quantity);
13421 }
13422 else
13423 {
13425 }
13426 }
13427 else if (item.IsMagazine())
13428 {
13429 Magazine mag = Magazine.Cast(item);
13430 if (quantity >= 0)
13431 {
13432 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13433 }
13434 else
13435 {
13437 }
13438
13439 }
13440 else
13441 {
13442 if (quantity >= 0)
13443 {
13444 item.SetQuantityNormalized(quantity, false);
13445 }
13446 else
13447 {
13449 }
13450
13451 }
13452 }
13453}
13454
13455#ifdef DEVELOPER
13457#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.