8677{
8679 {
8680 return true;
8681 }
8682};
8683
8684
8685
8687{
8691
8693
8696
8697
8698
8699
8700
8709
8715
8720
8725
8746 protected bool m_IsResultOfSplit
8747
8749
8754
8755
8756
8758
8762
8763
8764
8766
8769
8770
8771
8777
8778
8786
8789
8790
8792
8793
8795
8796
8801
8802
8807
8808
8810
8811
8813 {
8818
8819 if (!
GetGame().IsDedicatedServer())
8820 {
8822 {
8824
8826 {
8828 }
8829 }
8830
8833 }
8834
8835 m_OldLocation = null;
8836
8838 {
8840 }
8841
8842 if (ConfigIsExisting("headSelectionsToHide"))
8843 {
8846 }
8847
8849 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8850 {
8852 }
8853
8855
8856 m_IsResultOfSplit = false;
8857
8859 }
8860
8862 {
8863 super.InitItemVariables();
8864
8870 m_Count = ConfigGetInt(
"count");
8871
8874
8879
8882
8887
8899
8903
8904
8907 if (ConfigIsExisting("canBeSplit"))
8908 {
8911 }
8912
8914 if (ConfigIsExisting("itemBehaviour"))
8916
8917
8920 RegisterNetSyncVariableInt("m_VarLiquidType");
8921 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8922
8923 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8924 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8925 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8926
8927 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8928 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8929 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8930 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8931
8932 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8933 RegisterNetSyncVariableBool("m_IsTakeable");
8934 RegisterNetSyncVariableBool("m_IsHologram");
8935
8938 {
8941 }
8942
8944
8946 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8948
8949 }
8950
8952 {
8954 }
8955
8957 {
8960 {
8965 }
8966 }
8967
8968 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8969 {
8971 {
8974 }
8975
8977 }
8978
8980 {
8986 }
8987
8989
8991 {
8993
8994 if (!action)
8995 {
8996 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8997 return;
8998 }
8999
9001 if (!ai)
9002 {
9004 return;
9005 }
9006
9008 if (!action_array)
9009 {
9010 action_array = new array<ActionBase_Basic>;
9012 }
9013 if (LogManager.IsActionLogEnable())
9014 {
9015 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9016 }
9017
9018 if (action_array.Find(action) != -1)
9019 {
9020 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9021 }
9022 else
9023 {
9024 action_array.Insert(action);
9025 }
9026 }
9027
9029 {
9031 ActionBase action = player.GetActionManager().GetAction(actionName);
9034
9035 if (action_array)
9036 {
9037 action_array.RemoveItem(action);
9038 }
9039 }
9040
9041
9042
9044 {
9045 ActionOverrideData overrideData = new ActionOverrideData();
9049
9051 if (!actionMap)
9052 {
9055 }
9056
9057 actionMap.Insert(this.
Type(), overrideData);
9058
9059 }
9060
9062
9064
9065
9067 {
9070
9073
9074 string config_to_search = "CfgVehicles";
9075 string muzzle_owner_config;
9076
9078 {
9079 if (IsInherited(Weapon))
9080 config_to_search = "CfgWeapons";
9081
9082 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9083
9084 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9085
9087
9088 if (config_OnFire_subclass_count > 0)
9089 {
9090 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9091
9092 for (int i = 0; i < config_OnFire_subclass_count; i++)
9093 {
9094 string particle_class = "";
9096 string config_OnFire_entry = config_OnFire_class + particle_class;
9097 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9098 WPOF_array.Insert(WPOF);
9099 }
9100
9101
9103 }
9104 }
9105
9107 {
9108 config_to_search = "CfgWeapons";
9109 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9110
9111 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9112
9114
9115 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9116 {
9117 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9118
9119 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9120 {
9121 string particle_class2 = "";
9123 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9124 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9125 WPOBE_array.Insert(WPOBE);
9126 }
9127
9128
9130 }
9131 }
9132 }
9133
9134
9136 {
9139
9141 {
9142 string config_to_search = "CfgVehicles";
9143
9144 if (IsInherited(Weapon))
9145 config_to_search = "CfgWeapons";
9146
9147 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9148 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9149
9150 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9151 {
9152
9154
9156 {
9158 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9160 return;
9161 }
9162
9165
9166
9167
9169 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9170
9171 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9172 {
9173 string particle_class = "";
9175 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9177
9178 if (entry_type == CT_CLASS)
9179 {
9180 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9181 WPOOH_array.Insert(WPOF);
9182 }
9183 }
9184
9185
9187 }
9188 }
9189 }
9190
9192 {
9194 }
9195
9197 {
9199 {
9201
9204
9207
9208 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9209 }
9210 }
9211
9213 {
9215 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9216
9218 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9219
9221 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9222
9224 {
9226 }
9227 }
9228
9230 {
9232 }
9233
9235 {
9238 else
9240
9242 {
9245 }
9246 else
9247 {
9250
9253 }
9254
9256 }
9257
9259 {
9261 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9262 }
9263
9265 {
9267 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9269 }
9270
9272 {
9274 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9275 }
9276
9278 {
9281
9282 OverheatingParticle OP = new OverheatingParticle();
9287
9289 }
9290
9292 {
9295
9296 return -1;
9297 }
9298
9300 {
9302 {
9305
9306 for (int i = count; i > 0; --i)
9307 {
9308 int id = i - 1;
9311
9314
9315 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9316 {
9317 if (p)
9318 {
9321 }
9322 }
9323 }
9324 }
9325 }
9326
9328 {
9330 {
9332 {
9333 int id = i - 1;
9335
9336 if (OP)
9337 {
9339
9340 if (p)
9341 {
9343 }
9344
9345 delete OP;
9346 }
9347 }
9348
9351 }
9352 }
9353
9356 {
9357 return 0.0;
9358 }
9359
9360
9362 {
9363 return 250;
9364 }
9365
9367 {
9368 return 0;
9369 }
9370
9373 {
9375 return true;
9376
9377 return false;
9378 }
9379
9382 {
9385
9387 {
9389 }
9390 else
9391 {
9392
9394 }
9395
9397 }
9398
9405 {
9406 return -1;
9407 }
9408
9409
9410
9411
9413 {
9415 {
9417 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9418
9419 if (r_index >= 0)
9420 {
9421 InventoryLocation r_il = new InventoryLocation;
9422 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9423
9424 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9427 {
9428 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9429 }
9431 {
9432 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9433 }
9434
9435 }
9436
9437 player.GetHumanInventory().ClearUserReservedLocation(this);
9438 }
9439
9442 }
9443
9444
9445
9446
9448 {
9449 return ItemBase.m_DebugActionsMask;
9450 }
9451
9453 {
9454 return ItemBase.m_DebugActionsMask & mask;
9455 }
9456
9458 {
9459 ItemBase.m_DebugActionsMask = mask;
9460 }
9461
9463 {
9464 ItemBase.m_DebugActionsMask |= mask;
9465 }
9466
9468 {
9469 ItemBase.m_DebugActionsMask &= ~mask;
9470 }
9471
9473 {
9475 {
9477 }
9478 else
9479 {
9481 }
9482 }
9483
9484
9486 {
9487 if (GetEconomyProfile())
9488 {
9489 float q_max = GetEconomyProfile().GetQuantityMax();
9490 if (q_max > 0)
9491 {
9492 float q_min = GetEconomyProfile().GetQuantityMin();
9493 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9494
9496 {
9497 ComponentEnergyManager comp = GetCompEM();
9499 {
9501 }
9502 }
9504 {
9506
9507 }
9508
9509 }
9510 }
9511 }
9512
9515 {
9516 EntityAI parent = GetHierarchyParent();
9517
9518 if (parent)
9519 {
9520 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9521 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9522 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9523 }
9524 }
9525
9528 {
9529 EntityAI parent = GetHierarchyParent();
9530
9531 if (parent)
9532 {
9533 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9534 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9535 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9536 }
9537 }
9538
9540 {
9541
9542
9543
9544
9546
9548 {
9549 if (ScriptInputUserData.CanStoreInputUserData())
9550 {
9551 ScriptInputUserData ctx = new ScriptInputUserData;
9557 ctx.
Write(use_stack_max);
9560
9562 {
9563 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9564 }
9565 }
9566 }
9567 else if (!
GetGame().IsMultiplayer())
9568 {
9570 }
9571 }
9572
9574 {
9576 }
9577
9579 {
9581 }
9582
9584 {
9586 }
9587
9589 {
9590
9591 return false;
9592 }
9593
9595 {
9596 return false;
9597 }
9598
9602 {
9603 return false;
9604 }
9605
9607 {
9608 return "";
9609 }
9610
9612
9614 {
9615 return false;
9616 }
9617
9619 {
9620 return true;
9621 }
9622
9623
9624
9626 {
9627 return true;
9628 }
9629
9631 {
9632 return true;
9633 }
9634
9636 {
9637 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9639 }
9640
9642 {
9644 }
9645
9647 {
9649 if (!is_being_placed)
9651 SetSynchDirty();
9652 }
9653
9654
9656
9658 {
9660 }
9661
9663 {
9665 }
9666
9668 {
9669 return 1;
9670 }
9671
9673 {
9674 return false;
9675 }
9676
9678 {
9680 SetSynchDirty();
9681 }
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9718 {
9719 super.OnMovedInsideCargo(container);
9720
9721 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9722 }
9723
9724 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9725 {
9726 super.EEItemLocationChanged(oldLoc,newLoc);
9727
9728 PlayerBase new_player = null;
9729 PlayerBase old_player = null;
9730
9731 if (newLoc.GetParent())
9732 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9733
9734 if (oldLoc.GetParent())
9735 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9736
9738 {
9739 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9740
9741 if (r_index >= 0)
9742 {
9743 InventoryLocation r_il = new InventoryLocation;
9744 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9745
9746 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9749 {
9750 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9751 }
9753 {
9754 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9755 }
9756
9757 }
9758 }
9759
9761 {
9762 if (new_player)
9763 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9764
9765 if (new_player == old_player)
9766 {
9767
9768 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9769 {
9771 {
9772 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9773 {
9774 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9775 }
9776 }
9777 else
9778 {
9779 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9780 }
9781 }
9782
9783 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9784 {
9785 int type = oldLoc.GetType();
9787 {
9788 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9789 }
9791 {
9792 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9793 }
9794 }
9795 if (!m_OldLocation)
9796 {
9797 m_OldLocation = new InventoryLocation;
9798 }
9799 m_OldLocation.Copy(oldLoc);
9800 }
9801 else
9802 {
9803 if (m_OldLocation)
9804 {
9805 m_OldLocation.Reset();
9806 }
9807 }
9808
9810 }
9811 else
9812 {
9813 if (new_player)
9814 {
9815 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9816 if (res_index >= 0)
9817 {
9818 InventoryLocation il = new InventoryLocation;
9819 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9821 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9824 {
9825 il.
GetParent().GetOnReleaseLock().Invoke(it);
9826 }
9828 {
9830 }
9831
9832 }
9833 }
9835 {
9836
9838 }
9839
9840 if (m_OldLocation)
9841 {
9842 m_OldLocation.Reset();
9843 }
9844 }
9845 }
9846
9847 override void EOnContact(IEntity other, Contact extra)
9848 {
9850 {
9851 int liquidType = -1;
9853 if (impactSpeed > 0.0)
9854 {
9856 #ifndef SERVER
9858 #else
9860 SetSynchDirty();
9861 #endif
9863 }
9864 }
9865
9866 #ifdef SERVER
9867 if (GetCompEM() && GetCompEM().IsPlugged())
9868 {
9869 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9870 GetCompEM().UnplugThis();
9871 }
9872 #endif
9873 }
9874
9876
9878 {
9880 }
9881
9883 {
9884
9885 }
9886
9888 {
9889 super.OnItemLocationChanged(old_owner, new_owner);
9890
9891 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9892 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9893
9894 if (!relatedPlayer && playerNew)
9895 relatedPlayer = playerNew;
9896
9897 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9898 {
9900 if (actionMgr)
9901 {
9902 ActionBase currentAction = actionMgr.GetRunningAction();
9903 if (currentAction)
9905 }
9906 }
9907
9908 Man ownerPlayerOld = null;
9909 Man ownerPlayerNew = null;
9910
9911 if (old_owner)
9912 {
9913 if (old_owner.
IsMan())
9914 {
9915 ownerPlayerOld = Man.Cast(old_owner);
9916 }
9917 else
9918 {
9919 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9920 }
9921 }
9922 else
9923 {
9925 {
9927
9928 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9929 {
9930 GetCompEM().UnplugThis();
9931 }
9932 }
9933 }
9934
9935 if (new_owner)
9936 {
9937 if (new_owner.
IsMan())
9938 {
9939 ownerPlayerNew = Man.Cast(new_owner);
9940 }
9941 else
9942 {
9943 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9944 }
9945 }
9946
9947 if (ownerPlayerOld != ownerPlayerNew)
9948 {
9949 if (ownerPlayerOld)
9950 {
9951 array<EntityAI> subItemsExit = new array<EntityAI>;
9953 for (int i = 0; i < subItemsExit.Count(); i++)
9954 {
9957 }
9958 }
9959
9960 if (ownerPlayerNew)
9961 {
9962 array<EntityAI> subItemsEnter = new array<EntityAI>;
9964 for (int j = 0; j < subItemsEnter.Count(); j++)
9965 {
9968 }
9969 }
9970 }
9971 else if (ownerPlayerNew != null)
9972 {
9973 PlayerBase nplayer;
9974 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9975 {
9976 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9978 for (int k = 0; k < subItemsUpdate.Count(); k++)
9979 {
9981 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9982 }
9983 }
9984 }
9985
9986 if (old_owner)
9987 old_owner.OnChildItemRemoved(this);
9988 if (new_owner)
9989 new_owner.OnChildItemReceived(this);
9990 }
9991
9992
9994 {
9995 super.EEDelete(parent);
9996 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9997 if (player)
9998 {
10000
10001 if (player.IsAlive())
10002 {
10003 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10004 if (r_index >= 0)
10005 {
10006 InventoryLocation r_il = new InventoryLocation;
10007 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10008
10009 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10012 {
10013 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10014 }
10016 {
10017 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10018 }
10019
10020 }
10021
10022 player.RemoveQuickBarEntityShortcut(this);
10023 }
10024 }
10025 }
10026
10028 {
10029 super.EEKilled(killer);
10030
10033 {
10034 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10035 {
10036 if (IsMagazine())
10037 {
10038 if (Magazine.Cast(this).GetAmmoCount() > 0)
10039 {
10041 }
10042 }
10043 else
10044 {
10046 }
10047 }
10048 }
10049 }
10050
10052 {
10053 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10054
10055 super.OnWasAttached(parent, slot_id);
10056
10059
10061 }
10062
10064 {
10065 super.OnWasDetached(parent, slot_id);
10066
10069 }
10070
10072 {
10073 int idx;
10076
10077 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10078 if (inventory_slots.Count() < 1)
10079 {
10080 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10081 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10082 }
10083 else
10084 {
10085 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10086 }
10087
10088 idx = inventory_slots.Find(slot);
10089 if (idx < 0)
10090 return "";
10091
10092 return attach_types.Get(idx);
10093 }
10094
10096 {
10097 int idx = -1;
10098 string slot;
10099
10102
10103 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10104 if (inventory_slots.Count() < 1)
10105 {
10106 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10107 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10108 }
10109 else
10110 {
10111 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10112 if (detach_types.Count() < 1)
10113 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10114 }
10115
10116 for (int i = 0; i < inventory_slots.Count(); i++)
10117 {
10118 slot = inventory_slots.Get(i);
10119 }
10120
10121 if (slot != "")
10122 {
10123 if (detach_types.Count() == 1)
10124 idx = 0;
10125 else
10126 idx = inventory_slots.Find(slot);
10127 }
10128 if (idx < 0)
10129 return "";
10130
10131 return detach_types.Get(idx);
10132 }
10133
10135 {
10136
10138
10139
10140 float min_time = 1;
10141 float max_time = 3;
10142 float delay = Math.RandomFloat(min_time, max_time);
10143
10144 explode_timer.Run(delay, this, "DoAmmoExplosion");
10145 }
10146
10148 {
10149 Magazine magazine = Magazine.Cast(this);
10150 int pop_sounds_count = 6;
10151 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10152
10153
10154 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10155 string sound_name = pop_sounds[ sound_idx ];
10157
10158
10159 magazine.ServerAddAmmoCount(-1);
10160
10161
10162 float min_temp_to_explode = 100;
10163
10164 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10165 {
10167 }
10168 }
10169
10170
10171 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10172 {
10173 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10174
10175 const int CHANCE_DAMAGE_CARGO = 4;
10176 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10177 const int CHANCE_DAMAGE_NOTHING = 2;
10178
10180 {
10181 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10182 int chances;
10183 int rnd;
10184
10185 if (GetInventory().GetCargo())
10186 {
10187 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10188 rnd = Math.RandomInt(0,chances);
10189
10190 if (rnd < CHANCE_DAMAGE_CARGO)
10191 {
10193 }
10194 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10195 {
10197 }
10198 }
10199 else
10200 {
10201 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10202 rnd = Math.RandomInt(0,chances);
10203
10204 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10205 {
10207 }
10208 }
10209 }
10210 }
10211
10213 {
10214 if (GetInventory().GetCargo())
10215 {
10216 int item_count = GetInventory().GetCargo().GetItemCount();
10217 if (item_count > 0)
10218 {
10219 int random_pick = Math.RandomInt(0, item_count);
10221 if (!item.IsExplosive())
10222 {
10223 item.AddHealth("","",damage);
10224 return true;
10225 }
10226 }
10227 }
10228 return false;
10229 }
10230
10232 {
10233 int attachment_count = GetInventory().AttachmentCount();
10234 if (attachment_count > 0)
10235 {
10236 int random_pick = Math.RandomInt(0, attachment_count);
10237 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10238 if (!attachment.IsExplosive())
10239 {
10240 attachment.AddHealth("","",damage);
10241 return true;
10242 }
10243 }
10244 return false;
10245 }
10246
10248 {
10250 }
10251
10253 {
10255 return GetInventory().CanRemoveEntity();
10256
10257 return false;
10258 }
10259
10261 {
10262
10264 return false;
10265
10266
10268 return false;
10269
10270
10271
10273 if (delta == 0)
10274 return false;
10275
10276
10277 return true;
10278 }
10279
10281 {
10283 {
10284 if (ScriptInputUserData.CanStoreInputUserData())
10285 {
10286 ScriptInputUserData ctx = new ScriptInputUserData;
10291 ctx.
Write(destination_entity);
10293 ctx.
Write(slot_id);
10295 }
10296 }
10297 else if (!
GetGame().IsMultiplayer())
10298 {
10300 }
10301 }
10302
10304 {
10305 float split_quantity_new;
10309 InventoryLocation loc = new InventoryLocation;
10310
10311 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10312 {
10314 split_quantity_new = stack_max;
10315 else
10317
10319 {
10320 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10321 if (new_item)
10322 {
10323 new_item.SetResultOfSplit(true);
10324 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10326 new_item.
SetQuantity(split_quantity_new,
false,
true);
10327 }
10328 }
10329 }
10330 else if (destination_entity && slot_id == -1)
10331 {
10332 if (quantity > stack_max)
10333 split_quantity_new = stack_max;
10334 else
10335 split_quantity_new = quantity;
10336
10338 {
10340 {
10343 }
10344
10345 if (new_item)
10346 {
10347 new_item.SetResultOfSplit(true);
10348 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10350 new_item.
SetQuantity(split_quantity_new,
false,
true);
10351 }
10352 }
10353 }
10354 else
10355 {
10356 if (stack_max != 0)
10357 {
10359 {
10361 }
10362
10363 if (split_quantity_new == 0)
10364 {
10365 if (!
GetGame().IsMultiplayer())
10366 player.PhysicalPredictiveDropItem(this);
10367 else
10368 player.ServerDropEntity(this);
10369 return;
10370 }
10371
10373 {
10375
10376 if (new_item)
10377 {
10378 new_item.SetResultOfSplit(true);
10379 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10382 new_item.PlaceOnSurface();
10383 }
10384 }
10385 }
10386 }
10387 }
10388
10390 {
10391 float split_quantity_new;
10395 InventoryLocation loc = new InventoryLocation;
10396
10397 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10398 {
10400 split_quantity_new = stack_max;
10401 else
10403
10405 {
10406 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10407 if (new_item)
10408 {
10409 new_item.SetResultOfSplit(true);
10410 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10412 new_item.
SetQuantity(split_quantity_new,
false,
true);
10413 }
10414 }
10415 }
10416 else if (destination_entity && slot_id == -1)
10417 {
10418 if (quantity > stack_max)
10419 split_quantity_new = stack_max;
10420 else
10421 split_quantity_new = quantity;
10422
10424 {
10426 {
10429 }
10430
10431 if (new_item)
10432 {
10433 new_item.SetResultOfSplit(true);
10434 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10436 new_item.
SetQuantity(split_quantity_new,
false,
true);
10437 }
10438 }
10439 }
10440 else
10441 {
10442 if (stack_max != 0)
10443 {
10445 {
10447 }
10448
10450 {
10452
10453 if (new_item)
10454 {
10455 new_item.SetResultOfSplit(true);
10456 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10459 new_item.PlaceOnSurface();
10460 }
10461 }
10462 }
10463 }
10464 }
10465
10467 {
10469 {
10470 if (ScriptInputUserData.CanStoreInputUserData())
10471 {
10472 ScriptInputUserData ctx = new ScriptInputUserData;
10477 dst.WriteToContext(ctx);
10479 }
10480 }
10481 else if (!
GetGame().IsMultiplayer())
10482 {
10484 }
10485 }
10486
10488 {
10490 {
10491 if (ScriptInputUserData.CanStoreInputUserData())
10492 {
10493 ScriptInputUserData ctx = new ScriptInputUserData;
10498 ctx.
Write(destination_entity);
10504 }
10505 }
10506 else if (!
GetGame().IsMultiplayer())
10507 {
10509 }
10510 }
10511
10513 {
10515 }
10516
10518 {
10520 float split_quantity_new;
10522 if (dst.IsValid())
10523 {
10524 int slot_id = dst.GetSlot();
10526
10527 if (quantity > stack_max)
10528 split_quantity_new = stack_max;
10529 else
10530 split_quantity_new = quantity;
10531
10533 {
10535
10536 if (new_item)
10537 {
10538 new_item.SetResultOfSplit(true);
10539 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10541 new_item.
SetQuantity(split_quantity_new,
false,
true);
10542 }
10543
10544 return new_item;
10545 }
10546 }
10547
10548 return null;
10549 }
10550
10552 {
10554 float split_quantity_new;
10556 if (destination_entity)
10557 {
10559 if (quantity > stackable)
10560 split_quantity_new = stackable;
10561 else
10562 split_quantity_new = quantity;
10563
10565 {
10566 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10567 if (new_item)
10568 {
10569 new_item.SetResultOfSplit(true);
10570 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10572 new_item.
SetQuantity(split_quantity_new,
false,
true);
10573 }
10574 }
10575 }
10576 }
10577
10579 {
10581 {
10582 if (ScriptInputUserData.CanStoreInputUserData())
10583 {
10584 ScriptInputUserData ctx = new ScriptInputUserData;
10589 ItemBase destination_entity =
this;
10590 ctx.
Write(destination_entity);
10594 }
10595 }
10596 else if (!
GetGame().IsMultiplayer())
10597 {
10599 }
10600 }
10601
10603 {
10605 float split_quantity_new;
10607 if (player)
10608 {
10610 if (quantity > stackable)
10611 split_quantity_new = stackable;
10612 else
10613 split_quantity_new = quantity;
10614
10616 {
10617 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10618 new_item =
ItemBase.Cast(in_hands);
10619 if (new_item)
10620 {
10621 new_item.SetResultOfSplit(true);
10622 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10624 new_item.SetQuantity(split_quantity_new, false, true);
10625 }
10626 }
10627 }
10628 }
10629
10631 {
10633 float split_quantity_new = Math.Floor(quantity * 0.5);
10634
10636 return;
10637
10639
10640 if (new_item)
10641 {
10642 if (new_item.GetQuantityMax() < split_quantity_new)
10643 {
10644 split_quantity_new = new_item.GetQuantityMax();
10645 }
10646
10647 new_item.SetResultOfSplit(true);
10648 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10649
10651 {
10654 }
10655 else
10656 {
10658 new_item.
SetQuantity(split_quantity_new,
false,
true);
10659 }
10660 }
10661 }
10662
10664 {
10666 float split_quantity_new = Math.Floor(quantity / 2);
10667
10669 return;
10670
10671 InventoryLocation invloc = new InventoryLocation;
10673
10675 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10676
10677 if (new_item)
10678 {
10679 if (new_item.GetQuantityMax() < split_quantity_new)
10680 {
10681 split_quantity_new = new_item.GetQuantityMax();
10682 }
10684 {
10687 }
10688 else if (split_quantity_new > 1)
10689 {
10691 new_item.
SetQuantity(split_quantity_new,
false,
true);
10692 }
10693 }
10694 }
10695
10698 {
10699 SetWeightDirty();
10701
10702 if (parent)
10703 parent.OnAttachmentQuantityChangedEx(this, delta);
10704
10706 {
10708 {
10710 }
10712 {
10713 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10715 }
10716 }
10717
10718 }
10719
10722 {
10723
10724 }
10725
10728 {
10730 }
10731
10733 {
10734 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10735
10737 {
10738 if (newLevel == GameConstants.STATE_RUINED)
10739 {
10741 EntityAI parent = GetHierarchyParent();
10742 if (parent && parent.IsFireplace())
10743 {
10744 CargoBase cargo = GetInventory().GetCargo();
10745 if (cargo)
10746 {
10748 {
10750 }
10751 }
10752 }
10753 }
10754
10756 {
10757
10759 return;
10760 }
10761
10762 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10763 {
10765 }
10766 }
10767 }
10768
10769
10771 {
10772 super.OnRightClick();
10773
10775 {
10777 {
10778 if (ScriptInputUserData.CanStoreInputUserData())
10779 {
10780 EntityAI root = GetHierarchyRoot();
10781 Man playerOwner = GetHierarchyRootPlayer();
10782 InventoryLocation dst = new InventoryLocation;
10783
10784
10785 if (!playerOwner && root && root == this)
10786 {
10788 }
10789 else
10790 {
10791
10792 GetInventory().GetCurrentInventoryLocation(dst);
10794 {
10797 {
10799 }
10800 else
10801 {
10803
10804
10805 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10806 {
10808 }
10809 else
10810 {
10811 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10812 }
10813 }
10814 }
10815 }
10816
10817 ScriptInputUserData ctx = new ScriptInputUserData;
10825 }
10826 }
10827 else if (!
GetGame().IsMultiplayer())
10828 {
10830 }
10831 }
10832 }
10833
10835 {
10836 if (root)
10837 {
10838 vector m4[4];
10839 root.GetTransform(m4);
10840 dst.SetGround(this, m4);
10841 }
10842 else
10843 {
10844 GetInventory().GetCurrentInventoryLocation(dst);
10845 }
10846 }
10847
10848 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10849 {
10850
10851 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10852 return false;
10853
10854 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10855 return false;
10856
10857
10859 return false;
10860
10861
10862 Magazine mag = Magazine.Cast(this);
10863 if (mag)
10864 {
10865 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10866 return false;
10867
10868 if (stack_max_limit)
10869 {
10870 Magazine other_mag = Magazine.Cast(other_item);
10871 if (other_item)
10872 {
10873 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10874 return false;
10875 }
10876
10877 }
10878 }
10879 else
10880 {
10881
10883 return false;
10884
10886 return false;
10887 }
10888
10889 PlayerBase player = null;
10890 if (CastTo(player, GetHierarchyRootPlayer()))
10891 {
10892 if (player.GetInventory().HasAttachment(this))
10893 return false;
10894
10895 if (player.IsItemsToDelete())
10896 return false;
10897 }
10898
10899 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10900 return false;
10901
10902 int slotID;
10904 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10905 return false;
10906
10907 return true;
10908 }
10909
10911 {
10913 }
10914
10916 {
10917 return m_IsResultOfSplit;
10918 }
10919
10921 {
10922 m_IsResultOfSplit = value;
10923 }
10924
10926 {
10928 }
10929
10931 {
10932 float other_item_quantity = other_item.GetQuantity();
10933 float this_free_space;
10934
10936
10938
10939 if (other_item_quantity > this_free_space)
10940 {
10941 return this_free_space;
10942 }
10943 else
10944 {
10945 return other_item_quantity;
10946 }
10947 }
10948
10950 {
10952 }
10953
10955 {
10957 return;
10958
10959 if (!IsMagazine() && other_item)
10960 {
10962 if (quantity_used != 0)
10963 {
10964 float hp1 = GetHealth01("","");
10965 float hp2 = other_item.GetHealth01("","");
10966 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10967 hpResult = hpResult / (
GetQuantity() + quantity_used);
10968
10969 hpResult *= GetMaxHealth();
10970 Math.Round(hpResult);
10971 SetHealth("", "Health", hpResult);
10972
10974 other_item.AddQuantity(-quantity_used);
10975 }
10976 }
10978 }
10979
10981 {
10982 #ifdef SERVER
10983 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10984 GetHierarchyParent().IncreaseLifetimeUp();
10985 #endif
10986 };
10987
10989 {
10990 PlayerBase p = PlayerBase.Cast(player);
10991
10992 array<int> recipesIds = p.m_Recipes;
10993 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10994 if (moduleRecipesManager)
10995 {
10996 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10997 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10998 }
10999
11000 for (int i = 0;i < recipesIds.Count(); i++)
11001 {
11002 int key = recipesIds.Get(i);
11003 string recipeName = moduleRecipesManager.GetRecipeName(key);
11005 }
11006 }
11007
11008
11009 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11010 {
11011 super.GetDebugActions(outputList);
11012
11013
11019
11020
11025
11030
11031
11035
11036
11038 {
11042 }
11043
11046
11047
11051
11053
11054 InventoryLocation loc = new InventoryLocation();
11055 GetInventory().GetCurrentInventoryLocation(loc);
11057 {
11058 if (Gizmo_IsSupported())
11061 }
11062
11064 }
11065
11066
11067
11068
11070 {
11071 super.OnAction(action_id, player, ctx);
11072
11074 {
11075 switch (action_id)
11076 {
11079 return true;
11082 return true;
11083 }
11084 }
11085
11087 {
11088 switch (action_id)
11089 {
11091 Delete();
11092 return true;
11093 }
11094 }
11095
11096 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11097 {
11098 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11099 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11100 PlayerBase p = PlayerBase.Cast(player);
11101 if (
EActions.RECIPES_RANGE_START < 1000)
11102 {
11103 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11104 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11105 }
11106 }
11107 #ifndef SERVER
11108 else if (action_id ==
EActions.WATCH_PLAYER)
11109 {
11110 PluginDeveloper.SetDeveloperItemClientEx(player);
11111 }
11112 #endif
11114 {
11115 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11116 {
11117 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11118 OnDebugButtonPressServer(id + 1);
11119 }
11120
11121 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11122 {
11123 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11125 }
11126
11127 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11128 {
11129 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11131 }
11132
11133 else if (action_id ==
EActions.ADD_QUANTITY)
11134 {
11135 if (IsMagazine())
11136 {
11137 Magazine mag = Magazine.Cast(this);
11138 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11139 }
11140 else
11141 {
11143 }
11144
11145 if (m_EM)
11146 {
11147 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11148 }
11149
11150 }
11151
11152 else if (action_id ==
EActions.REMOVE_QUANTITY)
11153 {
11154 if (IsMagazine())
11155 {
11156 Magazine mag2 = Magazine.Cast(this);
11157 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11158 }
11159 else
11160 {
11162 }
11163 if (m_EM)
11164 {
11165 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11166 }
11167
11168 }
11169
11170 else if (action_id ==
EActions.SET_QUANTITY_0)
11171 {
11173
11174 if (m_EM)
11175 {
11176 m_EM.SetEnergy(0);
11177 }
11178 }
11179
11180 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11181 {
11183
11184 if (m_EM)
11185 {
11186 m_EM.SetEnergy(m_EM.GetEnergyMax());
11187 }
11188 }
11189
11190 else if (action_id ==
EActions.ADD_HEALTH)
11191 {
11192 AddHealth("","",GetMaxHealth("","Health")/5);
11193 }
11194 else if (action_id ==
EActions.REMOVE_HEALTH)
11195 {
11196 AddHealth("","",-GetMaxHealth("","Health")/5);
11197 }
11198 else if (action_id ==
EActions.DESTROY_HEALTH)
11199 {
11200 SetHealth01("","",0);
11201 }
11202 else if (action_id ==
EActions.WATCH_ITEM)
11203 {
11205 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11206 #ifdef DEVELOPER
11207 SetDebugDeveloper_item(this);
11208 #endif
11209 }
11210
11211 else if (action_id ==
EActions.ADD_TEMPERATURE)
11212 {
11213 AddTemperature(20);
11214
11215 }
11216
11217 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11218 {
11219 AddTemperature(-20);
11220
11221 }
11222
11223 else if (action_id ==
EActions.FLIP_FROZEN)
11224 {
11225 SetFrozen(!GetIsFrozen());
11226
11227 }
11228
11229 else if (action_id ==
EActions.ADD_WETNESS)
11230 {
11232
11233 }
11234
11235 else if (action_id ==
EActions.REMOVE_WETNESS)
11236 {
11238
11239 }
11240
11241 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11242 {
11245
11246
11247 }
11248
11249 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11250 {
11253 }
11254
11255 else if (action_id ==
EActions.MAKE_SPECIAL)
11256 {
11257 auto debugParams = DebugSpawnParams.WithPlayer(player);
11258 OnDebugSpawnEx(debugParams);
11259 }
11260
11261 }
11262
11263
11264 return false;
11265 }
11266
11267
11268
11269
11273
11276
11277
11278
11280 {
11281 return false;
11282 }
11283
11284
11286 {
11287 return true;
11288 }
11289
11290
11292 {
11293 return true;
11294 }
11295
11296
11297
11299 {
11300 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11302 }
11303
11306 {
11307 return null;
11308 }
11309
11311 {
11312 return false;
11313 }
11314
11316 {
11317 return false;
11318 }
11319
11323
11324
11326 {
11327 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11328 return module_repairing.CanRepair(this, item_repair_kit);
11329 }
11330
11331
11332 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11333 {
11334 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11335 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11336 }
11337
11338
11340 {
11341
11342
11343
11344
11345
11346
11347
11348
11349 return 1;
11350 }
11351
11352
11353
11355 {
11357 }
11358
11359
11360
11362 {
11364 }
11365
11366
11375 {
11376 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11377
11378 if (player)
11379 {
11380 player.MessageStatus(text);
11381 }
11382 }
11383
11384
11393 {
11394 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11395
11396 if (player)
11397 {
11398 player.MessageAction(text);
11399 }
11400 }
11401
11402
11411 {
11412 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11413
11414 if (player)
11415 {
11416 player.MessageFriendly(text);
11417 }
11418 }
11419
11420
11429 {
11430 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11431
11432 if (player)
11433 {
11434 player.MessageImportant(text);
11435 }
11436 }
11437
11439 {
11440 return true;
11441 }
11442
11443
11444 override bool KindOf(
string tag)
11445 {
11446 bool found = false;
11447 string item_name = this.
GetType();
11450
11451 int array_size = item_tag_array.Count();
11452 for (int i = 0; i < array_size; i++)
11453 {
11454 if (item_tag_array.Get(i) == tag)
11455 {
11456 found = true;
11457 break;
11458 }
11459 }
11460 return found;
11461 }
11462
11463
11465 {
11466
11467 super.OnRPC(sender, rpc_type,ctx);
11468
11469
11470 switch (rpc_type)
11471 {
11472 #ifndef SERVER
11473 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11474 Param2<bool, string> p = new Param2<bool, string>(false, "");
11475
11477 return;
11478
11479 bool play = p.param1;
11480 string soundSet = p.param2;
11481
11482 if (play)
11483 {
11485 {
11487 {
11489 }
11490 }
11491 else
11492 {
11494 }
11495 }
11496 else
11497 {
11499 }
11500
11501 break;
11502 #endif
11503
11504 }
11505
11507 {
11509 }
11510 }
11511
11512
11513
11514
11516 {
11517 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11518 return plugin.GetID(
name);
11519 }
11520
11522 {
11523 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11524 return plugin.GetName(id);
11525 }
11526
11529 {
11530
11531
11532 int varFlags;
11533 if (!ctx.
Read(varFlags))
11534 return;
11535
11536 if (varFlags & ItemVariableFlags.FLOAT)
11537 {
11539 }
11540 }
11541
11543 {
11544
11545 super.SerializeNumericalVars(floats_out);
11546
11547
11548
11550 {
11552 }
11553
11555 {
11557 }
11558
11560 {
11562 }
11563
11565 {
11570 }
11571
11573 {
11575 }
11576 }
11577
11579 {
11580
11581 super.DeSerializeNumericalVars(floats);
11582
11583
11584 int index = 0;
11585 int mask = Math.Round(floats.Get(index));
11586
11587 index++;
11588
11590 {
11592 {
11594 }
11595 else
11596 {
11597 float quantity = floats.Get(index);
11598 SetQuantity(quantity,
true,
false,
false,
false);
11599 }
11600 index++;
11601 }
11602
11604 {
11605 float wet = floats.Get(index);
11607 index++;
11608 }
11609
11611 {
11612 int liquidtype = Math.Round(floats.Get(index));
11614 index++;
11615 }
11616
11618 {
11620 index++;
11622 index++;
11624 index++;
11626 index++;
11627 }
11628
11630 {
11631 int cleanness = Math.Round(floats.Get(index));
11633 index++;
11634 }
11635 }
11636
11638 {
11639 super.WriteVarsToCTX(ctx);
11640
11641
11643 {
11645 }
11646
11648 {
11650 }
11651
11653 {
11655 }
11656
11658 {
11659 int r,g,b,a;
11665 }
11666
11668 {
11670 }
11671 }
11672
11674 {
11675 if (!super.ReadVarsFromCTX(ctx,version))
11676 return false;
11677
11678 int intValue;
11679 float value;
11680
11681 if (version < 140)
11682 {
11683 if (!ctx.
Read(intValue))
11684 return false;
11685
11686 m_VariablesMask = intValue;
11687 }
11688
11690 {
11691 if (!ctx.
Read(value))
11692 return false;
11693
11695 {
11697 }
11698 else
11699 {
11701 }
11702 }
11703
11704 if (version < 140)
11705 {
11707 {
11708 if (!ctx.
Read(value))
11709 return false;
11710 SetTemperatureDirect(value);
11711 }
11712 }
11713
11715 {
11716 if (!ctx.
Read(value))
11717 return false;
11719 }
11720
11722 {
11723 if (!ctx.
Read(intValue))
11724 return false;
11726 }
11727
11729 {
11730 int r,g,b,a;
11732 return false;
11734 return false;
11736 return false;
11738 return false;
11739
11741 }
11742
11744 {
11745 if (!ctx.
Read(intValue))
11746 return false;
11748 }
11749
11750 if (version >= 138 && version < 140)
11751 {
11753 {
11754 if (!ctx.
Read(intValue))
11755 return false;
11756 SetFrozen(intValue);
11757 }
11758 }
11759
11760 return true;
11761 }
11762
11763
11765 {
11768 {
11770 }
11771
11772 if (!super.OnStoreLoad(ctx, version))
11773 {
11775 return false;
11776 }
11777
11778 if (version >= 114)
11779 {
11780 bool hasQuickBarIndexSaved;
11781
11782 if (!ctx.
Read(hasQuickBarIndexSaved))
11783 {
11785 return false;
11786 }
11787
11788 if (hasQuickBarIndexSaved)
11789 {
11790 int itmQBIndex;
11791
11792
11793 if (!ctx.
Read(itmQBIndex))
11794 {
11796 return false;
11797 }
11798
11799 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11800 if (itmQBIndex != -1 && parentPlayer)
11801 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11802 }
11803 }
11804 else
11805 {
11806
11807 PlayerBase player;
11808 int itemQBIndex;
11809 if (version ==
int.
MAX)
11810 {
11811 if (!ctx.
Read(itemQBIndex))
11812 {
11814 return false;
11815 }
11816 }
11817 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11818 {
11819
11820 if (!ctx.
Read(itemQBIndex))
11821 {
11823 return false;
11824 }
11825 if (itemQBIndex != -1 && player)
11826 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11827 }
11828 }
11829
11830 if (version < 140)
11831 {
11832
11833 if (!LoadVariables(ctx, version))
11834 {
11836 return false;
11837 }
11838 }
11839
11840
11842 {
11844 return false;
11845 }
11846 if (version >= 132)
11847 {
11849 if (raib)
11850 {
11852 {
11854 return false;
11855 }
11856 }
11857 }
11858
11860 return true;
11861 }
11862
11863
11864
11866 {
11867 super.OnStoreSave(ctx);
11868
11869 PlayerBase player;
11870 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11871 {
11873
11874 int itemQBIndex = -1;
11875 itemQBIndex = player.FindQuickBarEntityIndex(this);
11876 ctx.
Write(itemQBIndex);
11877 }
11878 else
11879 {
11881 }
11882
11884
11886 if (raib)
11887 {
11889 }
11890 }
11891
11892
11894 {
11895 super.AfterStoreLoad();
11896
11898 {
11900 }
11901
11903 {
11906 }
11907 }
11908
11910 {
11911 super.EEOnAfterLoad();
11912
11914 {
11916 }
11917
11920 }
11921
11923 {
11924 return false;
11925 }
11926
11927
11928
11930 {
11932 {
11933 #ifdef PLATFORM_CONSOLE
11934
11936 {
11938 if (menu)
11939 {
11941 }
11942 }
11943 #endif
11944 }
11945
11947 {
11950 }
11951
11953 {
11954 SetWeightDirty();
11956 }
11958 {
11961 }
11962
11964 {
11967 }
11969 {
11972 }
11973
11974 super.OnVariablesSynchronized();
11975 }
11976
11977
11978
11980 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11981 {
11982 if (!IsServerCheck(allow_client))
11983 return false;
11984
11986 return false;
11987
11990
11991 if (value <= (min + 0.001))
11992 value = min;
11993
11994 if (value == min)
11995 {
11996 if (destroy_config)
11997 {
11998 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11999 if (dstr)
12000 {
12002 this.Delete();
12003 return true;
12004 }
12005 }
12006 else if (destroy_forced)
12007 {
12009 this.Delete();
12010 return true;
12011 }
12012
12014 }
12015
12018
12020 {
12022
12023 if (delta)
12025 }
12026
12028
12029 return false;
12030 }
12031
12032
12034 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12035 {
12037 }
12038
12040 {
12043 }
12044
12046 {
12049 }
12050
12052 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12053 {
12054 float value_clamped = Math.Clamp(value, 0, 1);
12056 SetQuantity(result, destroy_config, destroy_forced);
12057 }
12058
12059
12062 {
12064 }
12065
12067 {
12069 }
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12081 {
12082 int slot = -1;
12083 if (GetInventory())
12084 {
12085 InventoryLocation il = new InventoryLocation;
12086 GetInventory().GetCurrentInventoryLocation(il);
12088 }
12089
12091 }
12092
12094 {
12095 float quantity_max = 0;
12096
12098 {
12099 if (attSlotID != -1)
12100 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12101
12102 if (quantity_max <= 0)
12104 }
12105
12106 if (quantity_max <= 0)
12108
12109 return quantity_max;
12110 }
12111
12113 {
12115 }
12116
12118 {
12120 }
12121
12122
12124 {
12126 }
12127
12129 {
12131 }
12132
12134 {
12136 }
12137
12138
12140 {
12141
12142 float weightEx = GetWeightEx();
12143 float special = GetInventoryAndCargoWeight();
12144 return weightEx - special;
12145 }
12146
12147
12149 {
12151 }
12152
12154 {
12156 {
12157 #ifdef DEVELOPER
12158 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12159 {
12160 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12162 }
12163 #endif
12164
12165 return GetQuantity() * GetConfigWeightModified();
12166 }
12167 else if (HasEnergyManager())
12168 {
12169 #ifdef DEVELOPER
12170 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12171 {
12172 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12173 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12174 }
12175 #endif
12176 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12177 }
12178 else
12179 {
12180 #ifdef DEVELOPER
12181 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12182 {
12183 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12184 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12185 }
12186 #endif
12187 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12188 }
12189 }
12190
12193 {
12194 int item_count = 0;
12196
12197 if (GetInventory().GetCargo() != NULL)
12198 {
12199 item_count = GetInventory().GetCargo().GetItemCount();
12200 }
12201
12202 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12203 {
12204 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12205 if (item)
12206 item_count += item.GetNumberOfItems();
12207 }
12208 return item_count;
12209 }
12210
12213 {
12214 float weight = 0;
12215 float wetness = 1;
12216 if (include_wetness)
12219 {
12220 weight = wetness * m_ConfigWeight;
12221 }
12223 {
12224 weight = 1;
12225 }
12226 return weight;
12227 }
12228
12229
12230
12232 {
12233 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12234 {
12235 GameInventory inv = GetInventory();
12236 array<EntityAI> items = new array<EntityAI>;
12238 for (int i = 0; i < items.Count(); i++)
12239 {
12241 if (item)
12242 {
12244 }
12245 }
12246 }
12247 }
12248
12249
12250
12251
12253 {
12254 float energy = 0;
12255 if (HasEnergyManager())
12256 {
12257 energy = GetCompEM().GetEnergy();
12258 }
12259 return energy;
12260 }
12261
12262
12264 {
12265 super.OnEnergyConsumed();
12266
12268 }
12269
12271 {
12272 super.OnEnergyAdded();
12273
12275 }
12276
12277
12279 {
12280 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12281 {
12283 {
12284 float energy_0to1 = GetCompEM().GetEnergy0To1();
12286 }
12287 }
12288 }
12289
12290
12292 {
12293 return ConfigGetFloat("heatIsolation");
12294 }
12295
12297 {
12299 }
12300
12302 {
12303 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12304 if (
GetGame().ConfigIsExisting(paramPath))
12306
12307 return 0.0;
12308 }
12309
12311 {
12312 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12313 if (
GetGame().ConfigIsExisting(paramPath))
12315
12316 return 0.0;
12317 }
12318
12319 override void SetWet(
float value,
bool allow_client =
false)
12320 {
12321 if (!IsServerCheck(allow_client))
12322 return;
12323
12326
12328
12329 m_VarWet = Math.Clamp(value, min, max);
12330
12332 {
12335 }
12336 }
12337
12338 override void AddWet(
float value)
12339 {
12341 }
12342
12344 {
12346 }
12347
12349 {
12351 }
12352
12354 {
12356 }
12357
12359 {
12361 }
12362
12364 {
12366 }
12367
12368 override void OnWetChanged(
float newVal,
float oldVal)
12369 {
12372 if (newLevel != oldLevel)
12373 {
12375 }
12376 }
12377
12379 {
12380 SetWeightDirty();
12381 }
12382
12384 {
12385 return GetWetLevelInternal(
m_VarWet);
12386 }
12387
12388
12389
12391 {
12393 }
12394
12396 {
12398 }
12399
12401 {
12403 }
12404
12406 {
12408 }
12409
12410
12411
12413 {
12414 if (ConfigIsExisting("itemModelLength"))
12415 {
12416 return ConfigGetFloat("itemModelLength");
12417 }
12418 return 0;
12419 }
12420
12422 {
12423 if (ConfigIsExisting("itemAttachOffset"))
12424 {
12425 return ConfigGetFloat("itemAttachOffset");
12426 }
12427 return 0;
12428 }
12429
12430 override void SetCleanness(
int value,
bool allow_client =
false)
12431 {
12432 if (!IsServerCheck(allow_client))
12433 return;
12434
12436
12438
12441 }
12442
12444 {
12446 }
12447
12449 {
12450 return true;
12451 }
12452
12453
12454
12455
12457 {
12459 }
12460
12462 {
12464 }
12465
12466
12467
12468
12469 override void SetColor(
int r,
int g,
int b,
int a)
12470 {
12476 }
12478 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12479 {
12484 }
12485
12487 {
12489 }
12490
12493 {
12494 int r,g,b,a;
12496 r = r/255;
12497 g = g/255;
12498 b = b/255;
12499 a = a/255;
12500 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12501 }
12502
12503
12504
12505 override void SetLiquidType(
int value,
bool allow_client =
false)
12506 {
12507 if (!IsServerCheck(allow_client))
12508 return;
12509
12514 }
12515
12517 {
12518 return ConfigGetInt("varLiquidTypeInit");
12519 }
12520
12522 {
12524 }
12525
12527 {
12529 SetFrozen(false);
12530 }
12531
12534 {
12535 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12536 }
12537
12538
12541 {
12542 PlayerBase nplayer;
12543 if (PlayerBase.CastTo(nplayer, player))
12544 {
12546
12547 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12548 }
12549 }
12550
12551
12554 {
12555 PlayerBase nplayer;
12556 if (PlayerBase.CastTo(nplayer,player))
12557 {
12558
12559 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12560
12561 }
12562
12563
12564 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12565
12566
12567 if (HasEnergyManager())
12568 {
12569 GetCompEM().UpdatePlugState();
12570 }
12571 }
12572
12573
12575 {
12576 super.OnPlacementStarted(player);
12577
12579 }
12580
12581 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12582 {
12584 {
12585 m_AdminLog.OnPlacementComplete(player,
this);
12586 }
12587
12588 super.OnPlacementComplete(player, position, orientation);
12589 }
12590
12591
12592
12593
12594
12596 {
12598 {
12599 return true;
12600 }
12601 else
12602 {
12603 return false;
12604 }
12605 }
12606
12607
12609 {
12611 {
12613 }
12614 }
12615
12616
12618 {
12620 }
12621
12623 {
12625 }
12626
12627 override void InsertAgent(
int agent,
float count = 1)
12628 {
12629 if (count < 1)
12630 return;
12631
12633 }
12634
12637 {
12639 }
12640
12641
12643 {
12645 }
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12689 {
12691 return false;
12692 return true;
12693 }
12694
12696 {
12697
12699 }
12700
12701
12704 {
12705 super.CheckForRoofLimited(timeTresholdMS);
12706
12708 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12709 {
12710 m_PreviousRoofTestTime = time;
12711 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12712 }
12713 }
12714
12715
12717 {
12719 {
12720 return 0;
12721 }
12722
12723 if (GetInventory().GetAttachmentSlotsCount() != 0)
12724 {
12725 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12726 if (filter)
12727 return filter.GetProtectionLevel(type, false, system);
12728 else
12729 return 0;
12730 }
12731
12732 string subclassPath, entryName;
12733
12734 switch (type)
12735 {
12737 entryName = "biological";
12738 break;
12740 entryName = "chemical";
12741 break;
12742 default:
12743 entryName = "biological";
12744 break;
12745 }
12746
12747 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12748
12750 }
12751
12752
12753
12756 {
12757 if (!IsMagazine())
12759
12761 }
12762
12763
12764
12765
12766
12771 {
12772 return true;
12773 }
12774
12776 {
12778 }
12779
12780
12781
12782
12783
12785 {
12786 if (parent)
12787 {
12788 if (parent.IsInherited(DayZInfected))
12789 return true;
12790
12791 if (!parent.IsRuined())
12792 return true;
12793 }
12794
12795 return true;
12796 }
12797
12799 {
12800 if (!super.CanPutAsAttachment(parent))
12801 {
12802 return false;
12803 }
12804
12805 if (!IsRuined() && !parent.IsRuined())
12806 {
12807 return true;
12808 }
12809
12810 return false;
12811 }
12812
12814 {
12815
12816
12817
12818
12819 return super.CanReceiveItemIntoCargo(item);
12820 }
12821
12823 {
12824
12825
12826
12827
12828 GameInventory attachmentInv = attachment.GetInventory();
12830 {
12831 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12832 return false;
12833 }
12834
12835 InventoryLocation loc = new InventoryLocation();
12836 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12837 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12838 return false;
12839
12840 return super.CanReceiveAttachment(attachment, slotId);
12841 }
12842
12844 {
12845 if (!super.CanReleaseAttachment(attachment))
12846 return false;
12847
12848 return GetInventory().AreChildrenAccessible();
12849 }
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12872 {
12873 int id = muzzle_owner.GetMuzzleID();
12874 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12875
12876 if (WPOF_array)
12877 {
12878 for (int i = 0; i < WPOF_array.Count(); i++)
12879 {
12880 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12881
12882 if (WPOF)
12883 {
12884 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12885 }
12886 }
12887 }
12888 }
12889
12890
12892 {
12893 int id = muzzle_owner.GetMuzzleID();
12895
12896 if (WPOBE_array)
12897 {
12898 for (int i = 0; i < WPOBE_array.Count(); i++)
12899 {
12900 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12901
12902 if (WPOBE)
12903 {
12904 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12905 }
12906 }
12907 }
12908 }
12909
12910
12912 {
12913 int id = muzzle_owner.GetMuzzleID();
12914 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12915
12916 if (WPOOH_array)
12917 {
12918 for (int i = 0; i < WPOOH_array.Count(); i++)
12919 {
12920 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12921
12922 if (WPOOH)
12923 {
12924 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12925 }
12926 }
12927 }
12928 }
12929
12930
12932 {
12933 int id = muzzle_owner.GetMuzzleID();
12934 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12935
12936 if (WPOOH_array)
12937 {
12938 for (int i = 0; i < WPOOH_array.Count(); i++)
12939 {
12940 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12941
12942 if (WPOOH)
12943 {
12944 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12945 }
12946 }
12947 }
12948 }
12949
12950
12952 {
12953 int id = muzzle_owner.GetMuzzleID();
12954 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12955
12956 if (WPOOH_array)
12957 {
12958 for (int i = 0; i < WPOOH_array.Count(); i++)
12959 {
12960 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12961
12962 if (WPOOH)
12963 {
12964 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12965 }
12966 }
12967 }
12968 }
12969
12970
12971
12973 {
12975 {
12976 return true;
12977 }
12978
12979 return false;
12980 }
12981
12983 {
12985 {
12986 return true;
12987 }
12988
12989 return false;
12990 }
12991
12993 {
12995 {
12996 return true;
12997 }
12998
12999 return false;
13000 }
13001
13003 {
13004 return false;
13005 }
13006
13009 {
13010 return UATimeSpent.DEFAULT_DEPLOY;
13011 }
13012
13013
13014
13015
13017 {
13019 SetSynchDirty();
13020 }
13021
13023 {
13025 }
13026
13027
13029 {
13030 return false;
13031 }
13032
13035 {
13036 string att_type = "None";
13037
13038 if (ConfigIsExisting("soundAttType"))
13039 {
13040 att_type = ConfigGetString("soundAttType");
13041 }
13042
13044 }
13045
13047 {
13049 }
13050
13051
13052
13053
13054
13060
13062 {
13065
13067 }
13068
13069
13071 {
13073 return;
13074
13076
13079
13082
13083 SoundParameters params = new SoundParameters();
13087 }
13088
13089
13091 {
13093 return;
13094
13096 SetSynchDirty();
13097
13100 }
13101
13102
13104 {
13106 return;
13107
13109 SetSynchDirty();
13110
13113 }
13114
13116 {
13118 }
13119
13121 {
13123 }
13124
13127 {
13128 if (!
GetGame().IsDedicatedServer())
13129 {
13130 if (ConfigIsExisting("attachSoundSet"))
13131 {
13132 string cfg_path = "";
13133 string soundset = "";
13134 string type_name =
GetType();
13135
13138 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13139 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13140
13141 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13142 {
13143 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13144 {
13145 if (cfg_slot_array[i] == slot_type)
13146 {
13147 soundset = cfg_soundset_array[i];
13148 break;
13149 }
13150 }
13151 }
13152
13153 if (soundset != "")
13154 {
13155 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13157 }
13158 }
13159 }
13160 }
13161
13163 {
13164
13165 }
13166
13167 void OnApply(PlayerBase player);
13168
13170 {
13171 return 1.0;
13172 };
13173
13175 {
13177 }
13178
13180 {
13182 }
13183
13185
13187 {
13188 SetDynamicPhysicsLifeTime(0.01);
13190 }
13191
13193 {
13194 array<string> zone_names = new array<string>;
13195 GetDamageZones(zone_names);
13196 for (int i = 0; i < zone_names.Count(); i++)
13197 {
13198 SetHealthMax(zone_names.Get(i),"Health");
13199 }
13200 SetHealthMax("","Health");
13201 }
13202
13205 {
13206 float global_health = GetHealth01("","Health");
13207 array<string> zones = new array<string>;
13208 GetDamageZones(zones);
13209
13210 for (int i = 0; i < zones.Count(); i++)
13211 {
13212 SetHealth01(zones.Get(i),"Health",global_health);
13213 }
13214 }
13215
13218 {
13219 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13220 }
13221
13223 {
13224 if (!hasRootAsPlayer)
13225 {
13226 if (refParentIB)
13227 {
13228
13229 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13230 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13231
13232 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13233 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13234
13237 }
13238 else
13239 {
13240
13243 }
13244 }
13245 }
13246
13248 {
13250 {
13251 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13252 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13253 {
13254 float heatPermCoef = 1.0;
13256 while (ent)
13257 {
13258 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13259 ent = ent.GetHierarchyParent();
13260 }
13261
13262 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13263 }
13264 }
13265 }
13266
13268 {
13269
13270 EntityAI parent = GetHierarchyParent();
13271 if (!parent)
13272 {
13273 hasParent = false;
13274 hasRootAsPlayer = false;
13275 }
13276 else
13277 {
13278 hasParent = true;
13279 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13280 refParentIB =
ItemBase.Cast(parent);
13281 }
13282 }
13283
13284 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13285 {
13286
13287 }
13288
13290 {
13291
13292 return false;
13293 }
13294
13296 {
13297
13298
13299 return false;
13300 }
13301
13303 {
13304
13305 return false;
13306 }
13307
13310 {
13311 return !GetIsFrozen() &&
IsOpen();
13312 }
13313
13315 {
13316 bool hasParent = false, hasRootAsPlayer = false;
13318
13319 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13320 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13321
13322 if (wwtu || foodDecay)
13323 {
13327
13328 if (processWetness || processTemperature || processDecay)
13329 {
13331
13332 if (processWetness)
13333 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13334
13335 if (processTemperature)
13337
13338 if (processDecay)
13339 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13340 }
13341 }
13342 }
13343
13346 {
13348 }
13349
13351 {
13354
13355 return super.GetTemperatureFreezeThreshold();
13356 }
13357
13359 {
13362
13363 return super.GetTemperatureThawThreshold();
13364 }
13365
13367 {
13370
13371 return super.GetItemOverheatThreshold();
13372 }
13373
13375 {
13377 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13378
13379 return super.GetTemperatureFreezeTime();
13380 }
13381
13383 {
13385 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13386
13387 return super.GetTemperatureThawTime();
13388 }
13389
13394
13396 {
13397 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13398 }
13399
13401 {
13402 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13403 }
13404
13407 {
13409 }
13410
13412 {
13414 }
13415
13417 {
13419 }
13420
13423 {
13424 return null;
13425 }
13426
13429 {
13430 return false;
13431 }
13432
13434 {
13436 {
13439 if (!trg)
13440 {
13442 explosive = this;
13443 }
13444
13445 explosive.PairRemote(trg);
13447
13448 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13449 trg.SetPersistentPairID(persistentID);
13450 explosive.SetPersistentPairID(persistentID);
13451
13452 return true;
13453 }
13454 return false;
13455 }
13456
13459 {
13460 float ret = 1.0;
13463 ret *= GetHealth01();
13464
13465 return ret;
13466 }
13467
13468 #ifdef DEVELOPER
13469 override void SetDebugItem()
13470 {
13471 super.SetDebugItem();
13472 _itemBase = this;
13473 }
13474
13476 {
13477 string text = super.GetDebugText();
13478
13480 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13481
13482 return text;
13483 }
13484 #endif
13485
13487 {
13488 return true;
13489 }
13490
13492
13494
13496 {
13499 }
13500
13501
13509
13525}
13526
13528{
13530 if (entity)
13531 {
13532 bool is_item = entity.IsInherited(
ItemBase);
13533 if (is_item && full_quantity)
13534 {
13537 }
13538 }
13539 else
13540 {
13542 return NULL;
13543 }
13544 return entity;
13545}
13546
13548{
13549 if (item)
13550 {
13551 if (health > 0)
13552 item.SetHealth("", "", health);
13553
13554 if (item.CanHaveTemperature())
13555 {
13557 if (item.CanFreeze())
13558 item.SetFrozen(false);
13559 }
13560
13561 if (item.HasEnergyManager())
13562 {
13563 if (quantity >= 0)
13564 {
13565 item.GetCompEM().SetEnergy0To1(quantity);
13566 }
13567 else
13568 {
13570 }
13571 }
13572 else if (item.IsMagazine())
13573 {
13574 Magazine mag = Magazine.Cast(item);
13575 if (quantity >= 0)
13576 {
13577 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13578 }
13579 else
13580 {
13582 }
13583
13584 }
13585 else
13586 {
13587 if (quantity >= 0)
13588 {
13589 item.SetQuantityNormalized(quantity, false);
13590 }
13591 else
13592 {
13594 }
13595
13596 }
13597 }
13598}
13599
13600#ifdef DEVELOPER
13602#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.