8584{
8586 {
8587 return true;
8588 }
8589};
8590
8591
8592
8594{
8598
8600
8603
8604
8605
8606
8607
8616
8622
8627
8632
8653 protected bool m_IsResultOfSplit
8654
8656
8661
8662
8663
8665
8669
8670
8671
8673
8676
8677
8678
8684
8685
8693
8696
8697
8699
8700
8702
8703
8708
8709
8714
8715
8717
8718
8720 {
8725
8726 if (!
GetGame().IsDedicatedServer())
8727 {
8729 {
8731
8733 {
8735 }
8736 }
8737
8740 }
8741
8742 m_OldLocation = null;
8743
8745 {
8747 }
8748
8749 if (ConfigIsExisting("headSelectionsToHide"))
8750 {
8753 }
8754
8756 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8757 {
8759 }
8760
8762
8763 m_IsResultOfSplit = false;
8764
8766 }
8767
8769 {
8770 super.InitItemVariables();
8771
8777 m_Count = ConfigGetInt(
"count");
8778
8781
8786
8789
8794
8806
8810
8811
8814 if (ConfigIsExisting("canBeSplit"))
8815 {
8818 }
8819
8821 if (ConfigIsExisting("itemBehaviour"))
8823
8824
8827 RegisterNetSyncVariableInt("m_VarLiquidType");
8828 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8829
8830 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8831 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8832 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8833
8834 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8835 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8836 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8837 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8838
8839 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8840 RegisterNetSyncVariableBool("m_IsTakeable");
8841 RegisterNetSyncVariableBool("m_IsHologram");
8842
8845 {
8848 }
8849
8851
8853 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8855
8856 }
8857
8859 {
8861 }
8862
8864 {
8867 {
8872 }
8873 }
8874
8875 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8876 {
8878 {
8881 }
8882
8884 }
8885
8887 {
8893 }
8894
8896
8898 {
8900
8901 if (!action)
8902 {
8903 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8904 return;
8905 }
8906
8908 if (!ai)
8909 {
8911 return;
8912 }
8913
8915 if (!action_array)
8916 {
8917 action_array = new array<ActionBase_Basic>;
8919 }
8920 if (LogManager.IsActionLogEnable())
8921 {
8922 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8923 }
8924
8925 if (action_array.Find(action) != -1)
8926 {
8927 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8928 }
8929 else
8930 {
8931 action_array.Insert(action);
8932 }
8933 }
8934
8936 {
8938 ActionBase action = player.GetActionManager().GetAction(actionName);
8941
8942 if (action_array)
8943 {
8944 action_array.RemoveItem(action);
8945 }
8946 }
8947
8948
8949
8951 {
8952 ActionOverrideData overrideData = new ActionOverrideData();
8956
8958 if (!actionMap)
8959 {
8962 }
8963
8964 actionMap.Insert(this.
Type(), overrideData);
8965
8966 }
8967
8969
8971
8972
8974 {
8977
8980
8981 string config_to_search = "CfgVehicles";
8982 string muzzle_owner_config;
8983
8985 {
8986 if (IsInherited(Weapon))
8987 config_to_search = "CfgWeapons";
8988
8989 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8990
8991 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8992
8994
8995 if (config_OnFire_subclass_count > 0)
8996 {
8997 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8998
8999 for (int i = 0; i < config_OnFire_subclass_count; i++)
9000 {
9001 string particle_class = "";
9003 string config_OnFire_entry = config_OnFire_class + particle_class;
9004 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9005 WPOF_array.Insert(WPOF);
9006 }
9007
9008
9010 }
9011 }
9012
9014 {
9015 config_to_search = "CfgWeapons";
9016 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9017
9018 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9019
9021
9022 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9023 {
9024 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9025
9026 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9027 {
9028 string particle_class2 = "";
9030 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9031 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9032 WPOBE_array.Insert(WPOBE);
9033 }
9034
9035
9037 }
9038 }
9039 }
9040
9041
9043 {
9046
9048 {
9049 string config_to_search = "CfgVehicles";
9050
9051 if (IsInherited(Weapon))
9052 config_to_search = "CfgWeapons";
9053
9054 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9055 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9056
9057 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9058 {
9059
9061
9063 {
9065 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9067 return;
9068 }
9069
9072
9073
9074
9076 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9077
9078 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9079 {
9080 string particle_class = "";
9082 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9084
9085 if (entry_type == CT_CLASS)
9086 {
9087 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9088 WPOOH_array.Insert(WPOF);
9089 }
9090 }
9091
9092
9094 }
9095 }
9096 }
9097
9099 {
9101 }
9102
9104 {
9106 {
9108
9111
9114
9115 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9116 }
9117 }
9118
9120 {
9122 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9123
9125 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9126
9128 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9129
9131 {
9133 }
9134 }
9135
9137 {
9139 }
9140
9142 {
9145 else
9147
9149 {
9152 }
9153 else
9154 {
9157
9160 }
9161
9163 }
9164
9166 {
9168 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9169 }
9170
9172 {
9174 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9176 }
9177
9179 {
9181 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9182 }
9183
9185 {
9188
9189 OverheatingParticle OP = new OverheatingParticle();
9194
9196 }
9197
9199 {
9202
9203 return -1;
9204 }
9205
9207 {
9209 {
9212
9213 for (int i = count; i > 0; --i)
9214 {
9215 int id = i - 1;
9218
9221
9222 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9223 {
9224 if (p)
9225 {
9228 }
9229 }
9230 }
9231 }
9232 }
9233
9235 {
9237 {
9239 {
9240 int id = i - 1;
9242
9243 if (OP)
9244 {
9246
9247 if (p)
9248 {
9250 }
9251
9252 delete OP;
9253 }
9254 }
9255
9258 }
9259 }
9260
9263 {
9264 return 0.0;
9265 }
9266
9267
9269 {
9270 return 250;
9271 }
9272
9274 {
9275 return 0;
9276 }
9277
9280 {
9282 return true;
9283
9284 return false;
9285 }
9286
9289 {
9292
9294 {
9296 }
9297 else
9298 {
9299
9301 }
9302
9304 }
9305
9312 {
9313 return -1;
9314 }
9315
9316
9317
9318
9320 {
9322 {
9324 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9325
9326 if (r_index >= 0)
9327 {
9328 InventoryLocation r_il = new InventoryLocation;
9329 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9330
9331 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9334 {
9335 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9336 }
9338 {
9339 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9340 }
9341
9342 }
9343
9344 player.GetHumanInventory().ClearUserReservedLocation(this);
9345 }
9346
9349 }
9350
9351
9352
9353
9355 {
9356 return ItemBase.m_DebugActionsMask;
9357 }
9358
9360 {
9361 return ItemBase.m_DebugActionsMask & mask;
9362 }
9363
9365 {
9366 ItemBase.m_DebugActionsMask = mask;
9367 }
9368
9370 {
9371 ItemBase.m_DebugActionsMask |= mask;
9372 }
9373
9375 {
9376 ItemBase.m_DebugActionsMask &= ~mask;
9377 }
9378
9380 {
9382 {
9384 }
9385 else
9386 {
9388 }
9389 }
9390
9391
9393 {
9394 if (GetEconomyProfile())
9395 {
9396 float q_max = GetEconomyProfile().GetQuantityMax();
9397 if (q_max > 0)
9398 {
9399 float q_min = GetEconomyProfile().GetQuantityMin();
9400 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9401
9403 {
9404 ComponentEnergyManager comp = GetCompEM();
9406 {
9408 }
9409 }
9411 {
9413
9414 }
9415
9416 }
9417 }
9418 }
9419
9422 {
9423 EntityAI parent = GetHierarchyParent();
9424
9425 if (parent)
9426 {
9427 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9428 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9429 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9430 }
9431 }
9432
9435 {
9436 EntityAI parent = GetHierarchyParent();
9437
9438 if (parent)
9439 {
9440 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9441 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9442 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9443 }
9444 }
9445
9447 {
9448
9449
9450
9451
9453
9455 {
9456 if (ScriptInputUserData.CanStoreInputUserData())
9457 {
9458 ScriptInputUserData ctx = new ScriptInputUserData;
9464 ctx.
Write(use_stack_max);
9467
9469 {
9470 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9471 }
9472 }
9473 }
9474 else if (!
GetGame().IsMultiplayer())
9475 {
9477 }
9478 }
9479
9481 {
9483 }
9484
9486 {
9488 }
9489
9491 {
9493 }
9494
9496 {
9497
9498 return false;
9499 }
9500
9502 {
9503 return false;
9504 }
9505
9509 {
9510 return false;
9511 }
9512
9514 {
9515 return "";
9516 }
9517
9519
9521 {
9522 return false;
9523 }
9524
9526 {
9527 return true;
9528 }
9529
9530
9531
9533 {
9534 return true;
9535 }
9536
9538 {
9539 return true;
9540 }
9541
9543 {
9544 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9546 }
9547
9549 {
9551 }
9552
9554 {
9556 if (!is_being_placed)
9558 SetSynchDirty();
9559 }
9560
9561
9563
9565 {
9567 }
9568
9570 {
9572 }
9573
9575 {
9576 return 1;
9577 }
9578
9580 {
9581 return false;
9582 }
9583
9585 {
9587 SetSynchDirty();
9588 }
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9625 {
9626 super.OnMovedInsideCargo(container);
9627
9628 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9629 }
9630
9631 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9632 {
9633 super.EEItemLocationChanged(oldLoc,newLoc);
9634
9635 PlayerBase new_player = null;
9636 PlayerBase old_player = null;
9637
9638 if (newLoc.GetParent())
9639 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9640
9641 if (oldLoc.GetParent())
9642 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9643
9645 {
9646 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9647
9648 if (r_index >= 0)
9649 {
9650 InventoryLocation r_il = new InventoryLocation;
9651 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9652
9653 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9656 {
9657 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9658 }
9660 {
9661 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9662 }
9663
9664 }
9665 }
9666
9668 {
9669 if (new_player)
9670 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9671
9672 if (new_player == old_player)
9673 {
9674
9675 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9676 {
9678 {
9679 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9680 {
9681 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9682 }
9683 }
9684 else
9685 {
9686 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9687 }
9688 }
9689
9690 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9691 {
9692 int type = oldLoc.GetType();
9694 {
9695 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9696 }
9698 {
9699 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9700 }
9701 }
9702 if (!m_OldLocation)
9703 {
9704 m_OldLocation = new InventoryLocation;
9705 }
9706 m_OldLocation.Copy(oldLoc);
9707 }
9708 else
9709 {
9710 if (m_OldLocation)
9711 {
9712 m_OldLocation.Reset();
9713 }
9714 }
9715
9717 }
9718 else
9719 {
9720 if (new_player)
9721 {
9722 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9723 if (res_index >= 0)
9724 {
9725 InventoryLocation il = new InventoryLocation;
9726 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9728 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9731 {
9732 il.
GetParent().GetOnReleaseLock().Invoke(it);
9733 }
9735 {
9737 }
9738
9739 }
9740 }
9742 {
9743
9745 }
9746
9747 if (m_OldLocation)
9748 {
9749 m_OldLocation.Reset();
9750 }
9751 }
9752 }
9753
9754 override void EOnContact(IEntity other, Contact extra)
9755 {
9757 {
9758 int liquidType = -1;
9760 if (impactSpeed > 0.0)
9761 {
9763 #ifndef SERVER
9765 #else
9767 SetSynchDirty();
9768 #endif
9770 }
9771 }
9772
9773 #ifdef SERVER
9774 if (GetCompEM() && GetCompEM().IsPlugged())
9775 {
9776 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9777 GetCompEM().UnplugThis();
9778 }
9779 #endif
9780 }
9781
9783
9785 {
9787 }
9788
9790 {
9791
9792 }
9793
9795 {
9796 super.OnItemLocationChanged(old_owner, new_owner);
9797
9798 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9799 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9800
9801 if (!relatedPlayer && playerNew)
9802 relatedPlayer = playerNew;
9803
9804 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9805 {
9807 if (actionMgr)
9808 {
9809 ActionBase currentAction = actionMgr.GetRunningAction();
9810 if (currentAction)
9812 }
9813 }
9814
9815 Man ownerPlayerOld = null;
9816 Man ownerPlayerNew = null;
9817
9818 if (old_owner)
9819 {
9820 if (old_owner.
IsMan())
9821 {
9822 ownerPlayerOld = Man.Cast(old_owner);
9823 }
9824 else
9825 {
9826 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9827 }
9828 }
9829 else
9830 {
9832 {
9834
9835 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9836 {
9837 GetCompEM().UnplugThis();
9838 }
9839 }
9840 }
9841
9842 if (new_owner)
9843 {
9844 if (new_owner.
IsMan())
9845 {
9846 ownerPlayerNew = Man.Cast(new_owner);
9847 }
9848 else
9849 {
9850 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9851 }
9852 }
9853
9854 if (ownerPlayerOld != ownerPlayerNew)
9855 {
9856 if (ownerPlayerOld)
9857 {
9858 array<EntityAI> subItemsExit = new array<EntityAI>;
9860 for (int i = 0; i < subItemsExit.Count(); i++)
9861 {
9864 }
9865 }
9866
9867 if (ownerPlayerNew)
9868 {
9869 array<EntityAI> subItemsEnter = new array<EntityAI>;
9871 for (int j = 0; j < subItemsEnter.Count(); j++)
9872 {
9875 }
9876 }
9877 }
9878 else if (ownerPlayerNew != null)
9879 {
9880 PlayerBase nplayer;
9881 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9882 {
9883 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9885 for (int k = 0; k < subItemsUpdate.Count(); k++)
9886 {
9888 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9889 }
9890 }
9891 }
9892
9893 if (old_owner)
9894 old_owner.OnChildItemRemoved(this);
9895 if (new_owner)
9896 new_owner.OnChildItemReceived(this);
9897 }
9898
9899
9901 {
9902 super.EEDelete(parent);
9903 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9904 if (player)
9905 {
9907
9908 if (player.IsAlive())
9909 {
9910 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9911 if (r_index >= 0)
9912 {
9913 InventoryLocation r_il = new InventoryLocation;
9914 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9915
9916 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9919 {
9920 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9921 }
9923 {
9924 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9925 }
9926
9927 }
9928
9929 player.RemoveQuickBarEntityShortcut(this);
9930 }
9931 }
9932 }
9933
9935 {
9936 super.EEKilled(killer);
9937
9940 {
9941 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9942 {
9943 if (IsMagazine())
9944 {
9945 if (Magazine.Cast(this).GetAmmoCount() > 0)
9946 {
9948 }
9949 }
9950 else
9951 {
9953 }
9954 }
9955 }
9956 }
9957
9959 {
9960 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9961
9962 super.OnWasAttached(parent, slot_id);
9963
9966
9968 }
9969
9971 {
9972 super.OnWasDetached(parent, slot_id);
9973
9976 }
9977
9979 {
9980 int idx;
9983
9984 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9985 if (inventory_slots.Count() < 1)
9986 {
9987 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9988 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9989 }
9990 else
9991 {
9992 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9993 }
9994
9995 idx = inventory_slots.Find(slot);
9996 if (idx < 0)
9997 return "";
9998
9999 return attach_types.Get(idx);
10000 }
10001
10003 {
10004 int idx = -1;
10005 string slot;
10006
10009
10010 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10011 if (inventory_slots.Count() < 1)
10012 {
10013 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10014 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10015 }
10016 else
10017 {
10018 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10019 if (detach_types.Count() < 1)
10020 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10021 }
10022
10023 for (int i = 0; i < inventory_slots.Count(); i++)
10024 {
10025 slot = inventory_slots.Get(i);
10026 }
10027
10028 if (slot != "")
10029 {
10030 if (detach_types.Count() == 1)
10031 idx = 0;
10032 else
10033 idx = inventory_slots.Find(slot);
10034 }
10035 if (idx < 0)
10036 return "";
10037
10038 return detach_types.Get(idx);
10039 }
10040
10042 {
10043
10045
10046
10047 float min_time = 1;
10048 float max_time = 3;
10049 float delay = Math.RandomFloat(min_time, max_time);
10050
10051 explode_timer.Run(delay, this, "DoAmmoExplosion");
10052 }
10053
10055 {
10056 Magazine magazine = Magazine.Cast(this);
10057 int pop_sounds_count = 6;
10058 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10059
10060
10061 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10062 string sound_name = pop_sounds[ sound_idx ];
10064
10065
10066 magazine.ServerAddAmmoCount(-1);
10067
10068
10069 float min_temp_to_explode = 100;
10070
10071 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10072 {
10074 }
10075 }
10076
10077
10078 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10079 {
10080 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10081
10082 const int CHANCE_DAMAGE_CARGO = 4;
10083 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10084 const int CHANCE_DAMAGE_NOTHING = 2;
10085
10087 {
10088 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10089 int chances;
10090 int rnd;
10091
10092 if (GetInventory().GetCargo())
10093 {
10094 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10095 rnd = Math.RandomInt(0,chances);
10096
10097 if (rnd < CHANCE_DAMAGE_CARGO)
10098 {
10100 }
10101 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10102 {
10104 }
10105 }
10106 else
10107 {
10108 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10109 rnd = Math.RandomInt(0,chances);
10110
10111 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10112 {
10114 }
10115 }
10116 }
10117 }
10118
10120 {
10121 if (GetInventory().GetCargo())
10122 {
10123 int item_count = GetInventory().GetCargo().GetItemCount();
10124 if (item_count > 0)
10125 {
10126 int random_pick = Math.RandomInt(0, item_count);
10128 if (!item.IsExplosive())
10129 {
10130 item.AddHealth("","",damage);
10131 return true;
10132 }
10133 }
10134 }
10135 return false;
10136 }
10137
10139 {
10140 int attachment_count = GetInventory().AttachmentCount();
10141 if (attachment_count > 0)
10142 {
10143 int random_pick = Math.RandomInt(0, attachment_count);
10144 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10145 if (!attachment.IsExplosive())
10146 {
10147 attachment.AddHealth("","",damage);
10148 return true;
10149 }
10150 }
10151 return false;
10152 }
10153
10155 {
10157 }
10158
10160 {
10162 return GetInventory().CanRemoveEntity();
10163
10164 return false;
10165 }
10166
10168 {
10169
10171 return false;
10172
10173
10175 return false;
10176
10177
10178
10180 if (delta == 0)
10181 return false;
10182
10183
10184 return true;
10185 }
10186
10188 {
10190 {
10191 if (ScriptInputUserData.CanStoreInputUserData())
10192 {
10193 ScriptInputUserData ctx = new ScriptInputUserData;
10198 ctx.
Write(destination_entity);
10200 ctx.
Write(slot_id);
10202 }
10203 }
10204 else if (!
GetGame().IsMultiplayer())
10205 {
10207 }
10208 }
10209
10211 {
10212 float split_quantity_new;
10216 InventoryLocation loc = new InventoryLocation;
10217
10218 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10219 {
10221 split_quantity_new = stack_max;
10222 else
10224
10226 {
10227 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10228 if (new_item)
10229 {
10230 new_item.SetResultOfSplit(true);
10231 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10233 new_item.
SetQuantity(split_quantity_new,
false,
true);
10234 }
10235 }
10236 }
10237 else if (destination_entity && slot_id == -1)
10238 {
10239 if (quantity > stack_max)
10240 split_quantity_new = stack_max;
10241 else
10242 split_quantity_new = quantity;
10243
10245 {
10247 {
10250 }
10251
10252 if (new_item)
10253 {
10254 new_item.SetResultOfSplit(true);
10255 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10257 new_item.
SetQuantity(split_quantity_new,
false,
true);
10258 }
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 {
10282
10283 if (new_item)
10284 {
10285 new_item.SetResultOfSplit(true);
10286 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10289 new_item.PlaceOnSurface();
10290 }
10291 }
10292 }
10293 }
10294 }
10295
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
10312 {
10313 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10314 if (new_item)
10315 {
10316 new_item.SetResultOfSplit(true);
10317 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10319 new_item.
SetQuantity(split_quantity_new,
false,
true);
10320 }
10321 }
10322 }
10323 else if (destination_entity && slot_id == -1)
10324 {
10325 if (quantity > stack_max)
10326 split_quantity_new = stack_max;
10327 else
10328 split_quantity_new = quantity;
10329
10331 {
10333 {
10336 }
10337
10338 if (new_item)
10339 {
10340 new_item.SetResultOfSplit(true);
10341 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10343 new_item.
SetQuantity(split_quantity_new,
false,
true);
10344 }
10345 }
10346 }
10347 else
10348 {
10349 if (stack_max != 0)
10350 {
10352 {
10354 }
10355
10357 {
10359
10360 if (new_item)
10361 {
10362 new_item.SetResultOfSplit(true);
10363 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10366 new_item.PlaceOnSurface();
10367 }
10368 }
10369 }
10370 }
10371 }
10372
10374 {
10376 {
10377 if (ScriptInputUserData.CanStoreInputUserData())
10378 {
10379 ScriptInputUserData ctx = new ScriptInputUserData;
10384 dst.WriteToContext(ctx);
10386 }
10387 }
10388 else if (!
GetGame().IsMultiplayer())
10389 {
10391 }
10392 }
10393
10395 {
10397 {
10398 if (ScriptInputUserData.CanStoreInputUserData())
10399 {
10400 ScriptInputUserData ctx = new ScriptInputUserData;
10405 ctx.
Write(destination_entity);
10411 }
10412 }
10413 else if (!
GetGame().IsMultiplayer())
10414 {
10416 }
10417 }
10418
10420 {
10422 }
10423
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 {
10442
10443 if (new_item)
10444 {
10445 new_item.SetResultOfSplit(true);
10446 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10448 new_item.
SetQuantity(split_quantity_new,
false,
true);
10449 }
10450
10451 return new_item;
10452 }
10453 }
10454
10455 return null;
10456 }
10457
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
10472 {
10473 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10474 if (new_item)
10475 {
10476 new_item.SetResultOfSplit(true);
10477 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10479 new_item.
SetQuantity(split_quantity_new,
false,
true);
10480 }
10481 }
10482 }
10483 }
10484
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 float split_quantity_new;
10514 if (player)
10515 {
10517 if (quantity > stackable)
10518 split_quantity_new = stackable;
10519 else
10520 split_quantity_new = quantity;
10521
10523 {
10524 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10525 new_item =
ItemBase.Cast(in_hands);
10526 if (new_item)
10527 {
10528 new_item.SetResultOfSplit(true);
10529 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10531 new_item.SetQuantity(split_quantity_new, false, true);
10532 }
10533 }
10534 }
10535 }
10536
10538 {
10540 float split_quantity_new = Math.Floor(quantity * 0.5);
10541
10543 return;
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 {
10565 new_item.
SetQuantity(split_quantity_new,
false,
true);
10566 }
10567 }
10568 }
10569
10571 {
10573 float split_quantity_new = Math.Floor(quantity / 2);
10574
10576 return;
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 if (split_quantity_new > 1)
10596 {
10598 new_item.
SetQuantity(split_quantity_new,
false,
true);
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 EntityAI root = GetHierarchyRoot();
10688 Man playerOwner = GetHierarchyRootPlayer();
10689 InventoryLocation dst = new InventoryLocation;
10690
10691
10692 if (!playerOwner && root && root == this)
10693 {
10695 }
10696 else
10697 {
10698
10699 GetInventory().GetCurrentInventoryLocation(dst);
10701 {
10704 {
10706 }
10707 else
10708 {
10710
10711
10712 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10713 {
10715 }
10716 else
10717 {
10718 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10719 }
10720 }
10721 }
10722 }
10723
10724 ScriptInputUserData ctx = new ScriptInputUserData;
10732 }
10733 }
10734 else if (!
GetGame().IsMultiplayer())
10735 {
10737 }
10738 }
10739 }
10740
10742 {
10743 if (root)
10744 {
10745 vector m4[4];
10746 root.GetTransform(m4);
10747 dst.SetGround(this, m4);
10748 }
10749 else
10750 {
10751 GetInventory().GetCurrentInventoryLocation(dst);
10752 }
10753 }
10754
10755 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10756 {
10757
10758 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10759 return false;
10760
10761 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10762 return false;
10763
10764
10766 return false;
10767
10768
10769 Magazine mag = Magazine.Cast(this);
10770 if (mag)
10771 {
10772 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10773 return false;
10774
10775 if (stack_max_limit)
10776 {
10777 Magazine other_mag = Magazine.Cast(other_item);
10778 if (other_item)
10779 {
10780 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10781 return false;
10782 }
10783
10784 }
10785 }
10786 else
10787 {
10788
10790 return false;
10791
10793 return false;
10794 }
10795
10796 PlayerBase player = null;
10797 if (CastTo(player, GetHierarchyRootPlayer()))
10798 {
10799 if (player.GetInventory().HasAttachment(this))
10800 return false;
10801
10802 if (player.IsItemsToDelete())
10803 return false;
10804 }
10805
10806 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10807 return false;
10808
10809 int slotID;
10811 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10812 return false;
10813
10814 return true;
10815 }
10816
10818 {
10820 }
10821
10823 {
10824 return m_IsResultOfSplit;
10825 }
10826
10828 {
10829 m_IsResultOfSplit = value;
10830 }
10831
10833 {
10835 }
10836
10838 {
10839 float other_item_quantity = other_item.GetQuantity();
10840 float this_free_space;
10841
10843
10845
10846 if (other_item_quantity > this_free_space)
10847 {
10848 return this_free_space;
10849 }
10850 else
10851 {
10852 return other_item_quantity;
10853 }
10854 }
10855
10857 {
10859 }
10860
10862 {
10864 return;
10865
10866 if (!IsMagazine() && other_item)
10867 {
10869 if (quantity_used != 0)
10870 {
10871 float hp1 = GetHealth01("","");
10872 float hp2 = other_item.GetHealth01("","");
10873 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10874 hpResult = hpResult / (
GetQuantity() + quantity_used);
10875
10876 hpResult *= GetMaxHealth();
10877 Math.Round(hpResult);
10878 SetHealth("", "Health", hpResult);
10879
10881 other_item.AddQuantity(-quantity_used);
10882 }
10883 }
10885 }
10886
10888 {
10889 #ifdef SERVER
10890 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10891 GetHierarchyParent().IncreaseLifetimeUp();
10892 #endif
10893 };
10894
10896 {
10897 PlayerBase p = PlayerBase.Cast(player);
10898
10899 array<int> recipesIds = p.m_Recipes;
10900 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10901 if (moduleRecipesManager)
10902 {
10903 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10904 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10905 }
10906
10907 for (int i = 0;i < recipesIds.Count(); i++)
10908 {
10909 int key = recipesIds.Get(i);
10910 string recipeName = moduleRecipesManager.GetRecipeName(key);
10912 }
10913 }
10914
10915
10916 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10917 {
10918 super.GetDebugActions(outputList);
10919
10920
10926
10927
10932
10937
10938
10942
10943
10945 {
10949 }
10950
10953
10954
10958
10960
10961 InventoryLocation loc = new InventoryLocation();
10962 GetInventory().GetCurrentInventoryLocation(loc);
10964 {
10965 if (Gizmo_IsSupported())
10968 }
10969
10971 }
10972
10973
10974
10975
10977 {
10978 super.OnAction(action_id, player, ctx);
10979
10981 {
10982 switch (action_id)
10983 {
10986 return true;
10989 return true;
10990 }
10991 }
10992
10994 {
10995 switch (action_id)
10996 {
10998 Delete();
10999 return true;
11000 }
11001 }
11002
11003 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11004 {
11005 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11006 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11007 PlayerBase p = PlayerBase.Cast(player);
11008 if (
EActions.RECIPES_RANGE_START < 1000)
11009 {
11010 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11011 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11012 }
11013 }
11014 #ifndef SERVER
11015 else if (action_id ==
EActions.WATCH_PLAYER)
11016 {
11017 PluginDeveloper.SetDeveloperItemClientEx(player);
11018 }
11019 #endif
11021 {
11022 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11023 {
11024 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11025 OnDebugButtonPressServer(id + 1);
11026 }
11027
11028 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11029 {
11030 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11032 }
11033
11034 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11035 {
11036 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11038 }
11039
11040 else if (action_id ==
EActions.ADD_QUANTITY)
11041 {
11042 if (IsMagazine())
11043 {
11044 Magazine mag = Magazine.Cast(this);
11045 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11046 }
11047 else
11048 {
11050 }
11051
11052 if (m_EM)
11053 {
11054 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11055 }
11056
11057 }
11058
11059 else if (action_id ==
EActions.REMOVE_QUANTITY)
11060 {
11061 if (IsMagazine())
11062 {
11063 Magazine mag2 = Magazine.Cast(this);
11064 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11065 }
11066 else
11067 {
11069 }
11070 if (m_EM)
11071 {
11072 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11073 }
11074
11075 }
11076
11077 else if (action_id ==
EActions.SET_QUANTITY_0)
11078 {
11080
11081 if (m_EM)
11082 {
11083 m_EM.SetEnergy(0);
11084 }
11085 }
11086
11087 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11088 {
11090
11091 if (m_EM)
11092 {
11093 m_EM.SetEnergy(m_EM.GetEnergyMax());
11094 }
11095 }
11096
11097 else if (action_id ==
EActions.ADD_HEALTH)
11098 {
11099 AddHealth("","",GetMaxHealth("","Health")/5);
11100 }
11101 else if (action_id ==
EActions.REMOVE_HEALTH)
11102 {
11103 AddHealth("","",-GetMaxHealth("","Health")/5);
11104 }
11105 else if (action_id ==
EActions.DESTROY_HEALTH)
11106 {
11107 SetHealth01("","",0);
11108 }
11109 else if (action_id ==
EActions.WATCH_ITEM)
11110 {
11112 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11113 #ifdef DEVELOPER
11114 SetDebugDeveloper_item(this);
11115 #endif
11116 }
11117
11118 else if (action_id ==
EActions.ADD_TEMPERATURE)
11119 {
11120 AddTemperature(20);
11121
11122 }
11123
11124 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11125 {
11126 AddTemperature(-20);
11127
11128 }
11129
11130 else if (action_id ==
EActions.FLIP_FROZEN)
11131 {
11132 SetFrozen(!GetIsFrozen());
11133
11134 }
11135
11136 else if (action_id ==
EActions.ADD_WETNESS)
11137 {
11139
11140 }
11141
11142 else if (action_id ==
EActions.REMOVE_WETNESS)
11143 {
11145
11146 }
11147
11148 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11149 {
11152
11153
11154 }
11155
11156 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11157 {
11160 }
11161
11162 else if (action_id ==
EActions.MAKE_SPECIAL)
11163 {
11164 auto debugParams = DebugSpawnParams.WithPlayer(player);
11165 OnDebugSpawnEx(debugParams);
11166 }
11167
11168 }
11169
11170
11171 return false;
11172 }
11173
11174
11175
11176
11180
11183
11184
11185
11187 {
11188 return false;
11189 }
11190
11191
11193 {
11194 return true;
11195 }
11196
11197
11199 {
11200 return true;
11201 }
11202
11203
11204
11206 {
11207 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11209 }
11210
11213 {
11214 return null;
11215 }
11216
11218 {
11219 return false;
11220 }
11221
11223 {
11224 return false;
11225 }
11226
11230
11231
11233 {
11234 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11235 return module_repairing.CanRepair(this, item_repair_kit);
11236 }
11237
11238
11239 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11240 {
11241 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11242 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11243 }
11244
11245
11247 {
11248
11249
11250
11251
11252
11253
11254
11255
11256 return 1;
11257 }
11258
11259
11260
11262 {
11264 }
11265
11266
11267
11269 {
11271 }
11272
11273
11282 {
11283 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11284
11285 if (player)
11286 {
11287 player.MessageStatus(text);
11288 }
11289 }
11290
11291
11300 {
11301 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11302
11303 if (player)
11304 {
11305 player.MessageAction(text);
11306 }
11307 }
11308
11309
11318 {
11319 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11320
11321 if (player)
11322 {
11323 player.MessageFriendly(text);
11324 }
11325 }
11326
11327
11336 {
11337 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11338
11339 if (player)
11340 {
11341 player.MessageImportant(text);
11342 }
11343 }
11344
11346 {
11347 return true;
11348 }
11349
11350
11351 override bool KindOf(
string tag)
11352 {
11353 bool found = false;
11354 string item_name = this.
GetType();
11357
11358 int array_size = item_tag_array.Count();
11359 for (int i = 0; i < array_size; i++)
11360 {
11361 if (item_tag_array.Get(i) == tag)
11362 {
11363 found = true;
11364 break;
11365 }
11366 }
11367 return found;
11368 }
11369
11370
11372 {
11373
11374 super.OnRPC(sender, rpc_type,ctx);
11375
11376
11377 switch (rpc_type)
11378 {
11379 #ifndef SERVER
11380 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11381 Param2<bool, string> p = new Param2<bool, string>(false, "");
11382
11384 return;
11385
11386 bool play = p.param1;
11387 string soundSet = p.param2;
11388
11389 if (play)
11390 {
11392 {
11394 {
11396 }
11397 }
11398 else
11399 {
11401 }
11402 }
11403 else
11404 {
11406 }
11407
11408 break;
11409 #endif
11410
11411 }
11412
11414 {
11416 }
11417 }
11418
11419
11420
11421
11423 {
11424 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11425 return plugin.GetID(
name);
11426 }
11427
11429 {
11430 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11431 return plugin.GetName(id);
11432 }
11433
11436 {
11437
11438
11439 int varFlags;
11440 if (!ctx.
Read(varFlags))
11441 return;
11442
11443 if (varFlags & ItemVariableFlags.FLOAT)
11444 {
11446 }
11447 }
11448
11450 {
11451
11452 super.SerializeNumericalVars(floats_out);
11453
11454
11455
11457 {
11459 }
11460
11462 {
11464 }
11465
11467 {
11469 }
11470
11472 {
11477 }
11478
11480 {
11482 }
11483 }
11484
11486 {
11487
11488 super.DeSerializeNumericalVars(floats);
11489
11490
11491 int index = 0;
11492 int mask = Math.Round(floats.Get(index));
11493
11494 index++;
11495
11497 {
11499 {
11501 }
11502 else
11503 {
11504 float quantity = floats.Get(index);
11505 SetQuantity(quantity,
true,
false,
false,
false);
11506 }
11507 index++;
11508 }
11509
11511 {
11512 float wet = floats.Get(index);
11514 index++;
11515 }
11516
11518 {
11519 int liquidtype = Math.Round(floats.Get(index));
11521 index++;
11522 }
11523
11525 {
11527 index++;
11529 index++;
11531 index++;
11533 index++;
11534 }
11535
11537 {
11538 int cleanness = Math.Round(floats.Get(index));
11540 index++;
11541 }
11542 }
11543
11545 {
11546 super.WriteVarsToCTX(ctx);
11547
11548
11550 {
11552 }
11553
11555 {
11557 }
11558
11560 {
11562 }
11563
11565 {
11566 int r,g,b,a;
11572 }
11573
11575 {
11577 }
11578 }
11579
11581 {
11582 if (!super.ReadVarsFromCTX(ctx,version))
11583 return false;
11584
11585 int intValue;
11586 float value;
11587
11588 if (version < 140)
11589 {
11590 if (!ctx.
Read(intValue))
11591 return false;
11592
11593 m_VariablesMask = intValue;
11594 }
11595
11597 {
11598 if (!ctx.
Read(value))
11599 return false;
11600
11602 {
11604 }
11605 else
11606 {
11608 }
11609 }
11610
11611 if (version < 140)
11612 {
11614 {
11615 if (!ctx.
Read(value))
11616 return false;
11617 SetTemperatureDirect(value);
11618 }
11619 }
11620
11622 {
11623 if (!ctx.
Read(value))
11624 return false;
11626 }
11627
11629 {
11630 if (!ctx.
Read(intValue))
11631 return false;
11633 }
11634
11636 {
11637 int r,g,b,a;
11639 return false;
11641 return false;
11643 return false;
11645 return false;
11646
11648 }
11649
11651 {
11652 if (!ctx.
Read(intValue))
11653 return false;
11655 }
11656
11657 if (version >= 138 && version < 140)
11658 {
11660 {
11661 if (!ctx.
Read(intValue))
11662 return false;
11663 SetFrozen(intValue);
11664 }
11665 }
11666
11667 return true;
11668 }
11669
11670
11672 {
11675 {
11677 }
11678
11679 if (!super.OnStoreLoad(ctx, version))
11680 {
11682 return false;
11683 }
11684
11685 if (version >= 114)
11686 {
11687 bool hasQuickBarIndexSaved;
11688
11689 if (!ctx.
Read(hasQuickBarIndexSaved))
11690 {
11692 return false;
11693 }
11694
11695 if (hasQuickBarIndexSaved)
11696 {
11697 int itmQBIndex;
11698
11699
11700 if (!ctx.
Read(itmQBIndex))
11701 {
11703 return false;
11704 }
11705
11706 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11707 if (itmQBIndex != -1 && parentPlayer)
11708 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11709 }
11710 }
11711 else
11712 {
11713
11714 PlayerBase player;
11715 int itemQBIndex;
11716 if (version ==
int.
MAX)
11717 {
11718 if (!ctx.
Read(itemQBIndex))
11719 {
11721 return false;
11722 }
11723 }
11724 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11725 {
11726
11727 if (!ctx.
Read(itemQBIndex))
11728 {
11730 return false;
11731 }
11732 if (itemQBIndex != -1 && player)
11733 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11734 }
11735 }
11736
11737 if (version < 140)
11738 {
11739
11740 if (!LoadVariables(ctx, version))
11741 {
11743 return false;
11744 }
11745 }
11746
11747
11749 {
11751 return false;
11752 }
11753 if (version >= 132)
11754 {
11756 if (raib)
11757 {
11759 {
11761 return false;
11762 }
11763 }
11764 }
11765
11767 return true;
11768 }
11769
11770
11771
11773 {
11774 super.OnStoreSave(ctx);
11775
11776 PlayerBase player;
11777 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11778 {
11780
11781 int itemQBIndex = -1;
11782 itemQBIndex = player.FindQuickBarEntityIndex(this);
11783 ctx.
Write(itemQBIndex);
11784 }
11785 else
11786 {
11788 }
11789
11791
11793 if (raib)
11794 {
11796 }
11797 }
11798
11799
11801 {
11802 super.AfterStoreLoad();
11803
11805 {
11807 }
11808
11810 {
11813 }
11814 }
11815
11817 {
11818 super.EEOnAfterLoad();
11819
11821 {
11823 }
11824
11827 }
11828
11830 {
11831 return false;
11832 }
11833
11834
11835
11837 {
11839 {
11840 #ifdef PLATFORM_CONSOLE
11841
11843 {
11845 if (menu)
11846 {
11848 }
11849 }
11850 #endif
11851 }
11852
11854 {
11857 }
11858
11860 {
11861 SetWeightDirty();
11863 }
11865 {
11868 }
11869
11871 {
11874 }
11876 {
11879 }
11880
11881 super.OnVariablesSynchronized();
11882 }
11883
11884
11885
11887 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11888 {
11889 if (!IsServerCheck(allow_client))
11890 return false;
11891
11893 return false;
11894
11897
11898 if (value <= (min + 0.001))
11899 value = min;
11900
11901 if (value == min)
11902 {
11903 if (destroy_config)
11904 {
11905 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11906 if (dstr)
11907 {
11909 this.Delete();
11910 return true;
11911 }
11912 }
11913 else if (destroy_forced)
11914 {
11916 this.Delete();
11917 return true;
11918 }
11919
11921 }
11922
11925
11927 {
11929
11930 if (delta)
11932 }
11933
11935
11936 return false;
11937 }
11938
11939
11941 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11942 {
11944 }
11945
11947 {
11950 }
11951
11953 {
11956 }
11957
11959 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11960 {
11961 float value_clamped = Math.Clamp(value, 0, 1);
11963 SetQuantity(result, destroy_config, destroy_forced);
11964 }
11965
11966
11969 {
11971 }
11972
11974 {
11976 }
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11988 {
11989 int slot = -1;
11990 if (GetInventory())
11991 {
11992 InventoryLocation il = new InventoryLocation;
11993 GetInventory().GetCurrentInventoryLocation(il);
11995 }
11996
11998 }
11999
12001 {
12002 float quantity_max = 0;
12003
12005 {
12006 if (attSlotID != -1)
12007 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12008
12009 if (quantity_max <= 0)
12011 }
12012
12013 if (quantity_max <= 0)
12015
12016 return quantity_max;
12017 }
12018
12020 {
12022 }
12023
12025 {
12027 }
12028
12029
12031 {
12033 }
12034
12036 {
12038 }
12039
12041 {
12043 }
12044
12045
12047 {
12048
12049 float weightEx = GetWeightEx();
12050 float special = GetInventoryAndCargoWeight();
12051 return weightEx - special;
12052 }
12053
12054
12056 {
12058 }
12059
12061 {
12063 {
12064 #ifdef DEVELOPER
12065 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12066 {
12067 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12069 }
12070 #endif
12071
12072 return GetQuantity() * GetConfigWeightModified();
12073 }
12074 else if (HasEnergyManager())
12075 {
12076 #ifdef DEVELOPER
12077 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12078 {
12079 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12080 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12081 }
12082 #endif
12083 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12084 }
12085 else
12086 {
12087 #ifdef DEVELOPER
12088 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12089 {
12090 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12091 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12092 }
12093 #endif
12094 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12095 }
12096 }
12097
12100 {
12101 int item_count = 0;
12103
12104 if (GetInventory().GetCargo() != NULL)
12105 {
12106 item_count = GetInventory().GetCargo().GetItemCount();
12107 }
12108
12109 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12110 {
12111 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12112 if (item)
12113 item_count += item.GetNumberOfItems();
12114 }
12115 return item_count;
12116 }
12117
12120 {
12121 float weight = 0;
12122 float wetness = 1;
12123 if (include_wetness)
12126 {
12127 weight = wetness * m_ConfigWeight;
12128 }
12130 {
12131 weight = 1;
12132 }
12133 return weight;
12134 }
12135
12136
12137
12139 {
12140 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12141 {
12142 GameInventory inv = GetInventory();
12143 array<EntityAI> items = new array<EntityAI>;
12145 for (int i = 0; i < items.Count(); i++)
12146 {
12148 if (item)
12149 {
12151 }
12152 }
12153 }
12154 }
12155
12156
12157
12158
12160 {
12161 float energy = 0;
12162 if (HasEnergyManager())
12163 {
12164 energy = GetCompEM().GetEnergy();
12165 }
12166 return energy;
12167 }
12168
12169
12171 {
12172 super.OnEnergyConsumed();
12173
12175 }
12176
12178 {
12179 super.OnEnergyAdded();
12180
12182 }
12183
12184
12186 {
12187 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12188 {
12190 {
12191 float energy_0to1 = GetCompEM().GetEnergy0To1();
12193 }
12194 }
12195 }
12196
12197
12199 {
12200 return ConfigGetFloat("heatIsolation");
12201 }
12202
12204 {
12206 }
12207
12209 {
12210 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12211 if (
GetGame().ConfigIsExisting(paramPath))
12213
12214 return 0.0;
12215 }
12216
12218 {
12219 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12220 if (
GetGame().ConfigIsExisting(paramPath))
12222
12223 return 0.0;
12224 }
12225
12226 override void SetWet(
float value,
bool allow_client =
false)
12227 {
12228 if (!IsServerCheck(allow_client))
12229 return;
12230
12233
12235
12236 m_VarWet = Math.Clamp(value, min, max);
12237
12239 {
12242 }
12243 }
12244
12245 override void AddWet(
float value)
12246 {
12248 }
12249
12251 {
12253 }
12254
12256 {
12258 }
12259
12261 {
12263 }
12264
12266 {
12268 }
12269
12271 {
12273 }
12274
12275 override void OnWetChanged(
float newVal,
float oldVal)
12276 {
12279 if (newLevel != oldLevel)
12280 {
12282 }
12283 }
12284
12286 {
12287 SetWeightDirty();
12288 }
12289
12291 {
12292 return GetWetLevelInternal(
m_VarWet);
12293 }
12294
12295
12296
12298 {
12300 }
12301
12303 {
12305 }
12306
12308 {
12310 }
12311
12313 {
12315 }
12316
12317
12318
12320 {
12321 if (ConfigIsExisting("itemModelLength"))
12322 {
12323 return ConfigGetFloat("itemModelLength");
12324 }
12325 return 0;
12326 }
12327
12329 {
12330 if (ConfigIsExisting("itemAttachOffset"))
12331 {
12332 return ConfigGetFloat("itemAttachOffset");
12333 }
12334 return 0;
12335 }
12336
12337 override void SetCleanness(
int value,
bool allow_client =
false)
12338 {
12339 if (!IsServerCheck(allow_client))
12340 return;
12341
12343
12345
12348 }
12349
12351 {
12353 }
12354
12356 {
12357 return true;
12358 }
12359
12360
12361
12362
12364 {
12366 }
12367
12369 {
12371 }
12372
12373
12374
12375
12376 override void SetColor(
int r,
int g,
int b,
int a)
12377 {
12383 }
12385 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12386 {
12391 }
12392
12394 {
12396 }
12397
12400 {
12401 int r,g,b,a;
12403 r = r/255;
12404 g = g/255;
12405 b = b/255;
12406 a = a/255;
12407 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12408 }
12409
12410
12411
12412 override void SetLiquidType(
int value,
bool allow_client =
false)
12413 {
12414 if (!IsServerCheck(allow_client))
12415 return;
12416
12421 }
12422
12424 {
12425 return ConfigGetInt("varLiquidTypeInit");
12426 }
12427
12429 {
12431 }
12432
12434 {
12436 SetFrozen(false);
12437 }
12438
12441 {
12442 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12443 }
12444
12445
12448 {
12449 PlayerBase nplayer;
12450 if (PlayerBase.CastTo(nplayer, player))
12451 {
12453
12454 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12455 }
12456 }
12457
12458
12461 {
12462 PlayerBase nplayer;
12463 if (PlayerBase.CastTo(nplayer,player))
12464 {
12465
12466 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12467
12468 }
12469
12470
12471 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12472
12473
12474 if (HasEnergyManager())
12475 {
12476 GetCompEM().UpdatePlugState();
12477 }
12478 }
12479
12480
12482 {
12483 super.OnPlacementStarted(player);
12484
12486 }
12487
12488 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12489 {
12491 {
12492 m_AdminLog.OnPlacementComplete(player,
this);
12493 }
12494
12495 super.OnPlacementComplete(player, position, orientation);
12496 }
12497
12498
12499
12500
12501
12503 {
12505 {
12506 return true;
12507 }
12508 else
12509 {
12510 return false;
12511 }
12512 }
12513
12514
12516 {
12518 {
12520 }
12521 }
12522
12523
12525 {
12527 }
12528
12530 {
12532 }
12533
12534 override void InsertAgent(
int agent,
float count = 1)
12535 {
12536 if (count < 1)
12537 return;
12538
12540 }
12541
12544 {
12546 }
12547
12548
12550 {
12552 }
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12596 {
12598 return false;
12599 return true;
12600 }
12601
12603 {
12604
12606 }
12607
12608
12611 {
12612 super.CheckForRoofLimited(timeTresholdMS);
12613
12615 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12616 {
12617 m_PreviousRoofTestTime = time;
12618 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12619 }
12620 }
12621
12622
12624 {
12626 {
12627 return 0;
12628 }
12629
12630 if (GetInventory().GetAttachmentSlotsCount() != 0)
12631 {
12632 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12633 if (filter)
12634 return filter.GetProtectionLevel(type, false, system);
12635 else
12636 return 0;
12637 }
12638
12639 string subclassPath, entryName;
12640
12641 switch (type)
12642 {
12644 entryName = "biological";
12645 break;
12647 entryName = "chemical";
12648 break;
12649 default:
12650 entryName = "biological";
12651 break;
12652 }
12653
12654 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12655
12657 }
12658
12659
12660
12663 {
12664 if (!IsMagazine())
12666
12668 }
12669
12670
12671
12672
12673
12678 {
12679 return true;
12680 }
12681
12683 {
12685 }
12686
12687
12688
12689
12690
12692 {
12693 if (parent)
12694 {
12695 if (parent.IsInherited(DayZInfected))
12696 return true;
12697
12698 if (!parent.IsRuined())
12699 return true;
12700 }
12701
12702 return true;
12703 }
12704
12706 {
12707 if (!super.CanPutAsAttachment(parent))
12708 {
12709 return false;
12710 }
12711
12712 if (!IsRuined() && !parent.IsRuined())
12713 {
12714 return true;
12715 }
12716
12717 return false;
12718 }
12719
12721 {
12722
12723
12724
12725
12726 return super.CanReceiveItemIntoCargo(item);
12727 }
12728
12730 {
12731
12732
12733
12734
12735 GameInventory attachmentInv = attachment.GetInventory();
12737 {
12738 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12739 return false;
12740 }
12741
12742 InventoryLocation loc = new InventoryLocation();
12743 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12744 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12745 return false;
12746
12747 return super.CanReceiveAttachment(attachment, slotId);
12748 }
12749
12751 {
12752 if (!super.CanReleaseAttachment(attachment))
12753 return false;
12754
12755 return GetInventory().AreChildrenAccessible();
12756 }
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12779 {
12780 int id = muzzle_owner.GetMuzzleID();
12781 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12782
12783 if (WPOF_array)
12784 {
12785 for (int i = 0; i < WPOF_array.Count(); i++)
12786 {
12787 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12788
12789 if (WPOF)
12790 {
12791 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12792 }
12793 }
12794 }
12795 }
12796
12797
12799 {
12800 int id = muzzle_owner.GetMuzzleID();
12802
12803 if (WPOBE_array)
12804 {
12805 for (int i = 0; i < WPOBE_array.Count(); i++)
12806 {
12807 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12808
12809 if (WPOBE)
12810 {
12811 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12812 }
12813 }
12814 }
12815 }
12816
12817
12819 {
12820 int id = muzzle_owner.GetMuzzleID();
12821 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12822
12823 if (WPOOH_array)
12824 {
12825 for (int i = 0; i < WPOOH_array.Count(); i++)
12826 {
12827 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12828
12829 if (WPOOH)
12830 {
12831 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12832 }
12833 }
12834 }
12835 }
12836
12837
12839 {
12840 int id = muzzle_owner.GetMuzzleID();
12841 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12842
12843 if (WPOOH_array)
12844 {
12845 for (int i = 0; i < WPOOH_array.Count(); i++)
12846 {
12847 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12848
12849 if (WPOOH)
12850 {
12851 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12852 }
12853 }
12854 }
12855 }
12856
12857
12859 {
12860 int id = muzzle_owner.GetMuzzleID();
12861 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12862
12863 if (WPOOH_array)
12864 {
12865 for (int i = 0; i < WPOOH_array.Count(); i++)
12866 {
12867 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12868
12869 if (WPOOH)
12870 {
12871 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12872 }
12873 }
12874 }
12875 }
12876
12877
12878
12880 {
12882 {
12883 return true;
12884 }
12885
12886 return false;
12887 }
12888
12890 {
12892 {
12893 return true;
12894 }
12895
12896 return false;
12897 }
12898
12900 {
12902 {
12903 return true;
12904 }
12905
12906 return false;
12907 }
12908
12910 {
12911 return false;
12912 }
12913
12916 {
12917 return UATimeSpent.DEFAULT_DEPLOY;
12918 }
12919
12920
12921
12922
12924 {
12926 SetSynchDirty();
12927 }
12928
12930 {
12932 }
12933
12934
12936 {
12937 return false;
12938 }
12939
12942 {
12943 string att_type = "None";
12944
12945 if (ConfigIsExisting("soundAttType"))
12946 {
12947 att_type = ConfigGetString("soundAttType");
12948 }
12949
12951 }
12952
12954 {
12956 }
12957
12958
12959
12960
12961
12967
12969 {
12972
12974 }
12975
12976
12978 {
12980 return;
12981
12983
12986
12989
12990 SoundParameters params = new SoundParameters();
12994 }
12995
12996
12998 {
13000 return;
13001
13003 SetSynchDirty();
13004
13007 }
13008
13009
13011 {
13013 return;
13014
13016 SetSynchDirty();
13017
13020 }
13021
13023 {
13025 }
13026
13028 {
13030 }
13031
13034 {
13035 if (!
GetGame().IsDedicatedServer())
13036 {
13037 if (ConfigIsExisting("attachSoundSet"))
13038 {
13039 string cfg_path = "";
13040 string soundset = "";
13041 string type_name =
GetType();
13042
13045 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13046 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13047
13048 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13049 {
13050 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13051 {
13052 if (cfg_slot_array[i] == slot_type)
13053 {
13054 soundset = cfg_soundset_array[i];
13055 break;
13056 }
13057 }
13058 }
13059
13060 if (soundset != "")
13061 {
13062 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13064 }
13065 }
13066 }
13067 }
13068
13070 {
13071
13072 }
13073
13074 void OnApply(PlayerBase player);
13075
13077 {
13078 return 1.0;
13079 };
13080
13082 {
13084 }
13085
13087 {
13089 }
13090
13092
13094 {
13095 SetDynamicPhysicsLifeTime(0.01);
13097 }
13098
13100 {
13101 array<string> zone_names = new array<string>;
13102 GetDamageZones(zone_names);
13103 for (int i = 0; i < zone_names.Count(); i++)
13104 {
13105 SetHealthMax(zone_names.Get(i),"Health");
13106 }
13107 SetHealthMax("","Health");
13108 }
13109
13112 {
13113 float global_health = GetHealth01("","Health");
13114 array<string> zones = new array<string>;
13115 GetDamageZones(zones);
13116
13117 for (int i = 0; i < zones.Count(); i++)
13118 {
13119 SetHealth01(zones.Get(i),"Health",global_health);
13120 }
13121 }
13122
13125 {
13126 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13127 }
13128
13130 {
13131 if (!hasRootAsPlayer)
13132 {
13133 if (refParentIB)
13134 {
13135
13136 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13137 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13138
13139 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13140 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13141
13144 }
13145 else
13146 {
13147
13150 }
13151 }
13152 }
13153
13155 {
13157 {
13158 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13159 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13160 {
13161 float heatPermCoef = 1.0;
13163 while (ent)
13164 {
13165 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13166 ent = ent.GetHierarchyParent();
13167 }
13168
13169 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13170 }
13171 }
13172 }
13173
13175 {
13176
13177 EntityAI parent = GetHierarchyParent();
13178 if (!parent)
13179 {
13180 hasParent = false;
13181 hasRootAsPlayer = false;
13182 }
13183 else
13184 {
13185 hasParent = true;
13186 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13187 refParentIB =
ItemBase.Cast(parent);
13188 }
13189 }
13190
13191 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13192 {
13193
13194 }
13195
13197 {
13198
13199 return false;
13200 }
13201
13203 {
13204
13205
13206 return false;
13207 }
13208
13210 {
13211
13212 return false;
13213 }
13214
13217 {
13218 return !GetIsFrozen() &&
IsOpen();
13219 }
13220
13222 {
13223 bool hasParent = false, hasRootAsPlayer = false;
13225
13226 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13227 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13228
13229 if (wwtu || foodDecay)
13230 {
13234
13235 if (processWetness || processTemperature || processDecay)
13236 {
13238
13239 if (processWetness)
13240 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13241
13242 if (processTemperature)
13244
13245 if (processDecay)
13246 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13247 }
13248 }
13249 }
13250
13253 {
13255 }
13256
13258 {
13261
13262 return super.GetTemperatureFreezeThreshold();
13263 }
13264
13266 {
13269
13270 return super.GetTemperatureThawThreshold();
13271 }
13272
13274 {
13277
13278 return super.GetItemOverheatThreshold();
13279 }
13280
13282 {
13284 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13285
13286 return super.GetTemperatureFreezeTime();
13287 }
13288
13290 {
13292 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13293
13294 return super.GetTemperatureThawTime();
13295 }
13296
13301
13303 {
13304 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13305 }
13306
13308 {
13309 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13310 }
13311
13314 {
13316 }
13317
13319 {
13321 }
13322
13324 {
13326 }
13327
13330 {
13331 return null;
13332 }
13333
13336 {
13337 return false;
13338 }
13339
13341 {
13343 {
13346 if (!trg)
13347 {
13349 explosive = this;
13350 }
13351
13352 explosive.PairRemote(trg);
13354
13355 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13356 trg.SetPersistentPairID(persistentID);
13357 explosive.SetPersistentPairID(persistentID);
13358
13359 return true;
13360 }
13361 return false;
13362 }
13363
13366 {
13367 float ret = 1.0;
13370 ret *= GetHealth01();
13371
13372 return ret;
13373 }
13374
13375 #ifdef DEVELOPER
13376 override void SetDebugItem()
13377 {
13378 super.SetDebugItem();
13379 _itemBase = this;
13380 }
13381
13383 {
13384 string text = super.GetDebugText();
13385
13387 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13388
13389 return text;
13390 }
13391 #endif
13392
13394 {
13395 return true;
13396 }
13397
13399
13401
13403 {
13406 }
13407
13408
13416
13432}
13433
13435{
13437 if (entity)
13438 {
13439 bool is_item = entity.IsInherited(
ItemBase);
13440 if (is_item && full_quantity)
13441 {
13444 }
13445 }
13446 else
13447 {
13449 return NULL;
13450 }
13451 return entity;
13452}
13453
13455{
13456 if (item)
13457 {
13458 if (health > 0)
13459 item.SetHealth("", "", health);
13460
13461 if (item.CanHaveTemperature())
13462 {
13464 if (item.CanFreeze())
13465 item.SetFrozen(false);
13466 }
13467
13468 if (item.HasEnergyManager())
13469 {
13470 if (quantity >= 0)
13471 {
13472 item.GetCompEM().SetEnergy0To1(quantity);
13473 }
13474 else
13475 {
13477 }
13478 }
13479 else if (item.IsMagazine())
13480 {
13481 Magazine mag = Magazine.Cast(item);
13482 if (quantity >= 0)
13483 {
13484 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13485 }
13486 else
13487 {
13489 }
13490
13491 }
13492 else
13493 {
13494 if (quantity >= 0)
13495 {
13496 item.SetQuantityNormalized(quantity, false);
13497 }
13498 else
13499 {
13501 }
13502
13503 }
13504 }
13505}
13506
13507#ifdef DEVELOPER
13509#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.