8688{
8690 {
8691 return true;
8692 }
8693};
8694
8695
8696
8698{
8702
8704
8707
8708
8709
8710
8711
8720
8726
8731
8736
8757 protected bool m_IsResultOfSplit
8758
8760
8765
8766
8767
8769
8773
8774
8775
8777
8780
8781
8782
8788
8789
8797
8800
8801
8803
8804
8806
8807
8812
8813
8818
8819
8821
8822
8824 {
8829
8830 if (!
GetGame().IsDedicatedServer())
8831 {
8833 {
8835
8837 {
8839 }
8840 }
8841
8844 }
8845
8846 m_OldLocation = null;
8847
8849 {
8851 }
8852
8853 if (ConfigIsExisting("headSelectionsToHide"))
8854 {
8857 }
8858
8860 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8861 {
8863 }
8864
8866
8867 m_IsResultOfSplit = false;
8868
8870 }
8871
8873 {
8874 super.InitItemVariables();
8875
8881 m_Count = ConfigGetInt(
"count");
8882
8885
8890
8893
8898
8910
8914
8915
8918 if (ConfigIsExisting("canBeSplit"))
8919 {
8922 }
8923
8925 if (ConfigIsExisting("itemBehaviour"))
8927
8928
8931 RegisterNetSyncVariableInt("m_VarLiquidType");
8932 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8933
8934 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8935 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8936 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8937
8938 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8939 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8940 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8941 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8942
8943 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8944 RegisterNetSyncVariableBool("m_IsTakeable");
8945 RegisterNetSyncVariableBool("m_IsHologram");
8946
8949 {
8952 }
8953
8955
8957 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8959
8960 }
8961
8963 {
8965 }
8966
8968 {
8971 {
8976 }
8977 }
8978
8979 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8980 {
8982 {
8985 }
8986
8988 }
8989
8991 {
8997 }
8998
9000
9002 {
9004
9005 if (!action)
9006 {
9007 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9008 return;
9009 }
9010
9012 if (!ai)
9013 {
9015 return;
9016 }
9017
9019 if (!action_array)
9020 {
9021 action_array = new array<ActionBase_Basic>;
9023 }
9024 if (LogManager.IsActionLogEnable())
9025 {
9026 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9027 }
9028
9029 if (action_array.Find(action) != -1)
9030 {
9031 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9032 }
9033 else
9034 {
9035 action_array.Insert(action);
9036 }
9037 }
9038
9040 {
9042 ActionBase action = player.GetActionManager().GetAction(actionName);
9045
9046 if (action_array)
9047 {
9048 action_array.RemoveItem(action);
9049 }
9050 }
9051
9052
9053
9055 {
9056 ActionOverrideData overrideData = new ActionOverrideData();
9060
9062 if (!actionMap)
9063 {
9066 }
9067
9068 actionMap.Insert(this.
Type(), overrideData);
9069
9070 }
9071
9073
9075
9076
9078 {
9081
9084
9085 string config_to_search = "CfgVehicles";
9086 string muzzle_owner_config;
9087
9089 {
9090 if (IsInherited(Weapon))
9091 config_to_search = "CfgWeapons";
9092
9093 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9094
9095 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9096
9098
9099 if (config_OnFire_subclass_count > 0)
9100 {
9101 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9102
9103 for (int i = 0; i < config_OnFire_subclass_count; i++)
9104 {
9105 string particle_class = "";
9107 string config_OnFire_entry = config_OnFire_class + particle_class;
9108 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9109 WPOF_array.Insert(WPOF);
9110 }
9111
9112
9114 }
9115 }
9116
9118 {
9119 config_to_search = "CfgWeapons";
9120 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9121
9122 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9123
9125
9126 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9127 {
9128 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9129
9130 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9131 {
9132 string particle_class2 = "";
9134 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9135 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9136 WPOBE_array.Insert(WPOBE);
9137 }
9138
9139
9141 }
9142 }
9143 }
9144
9145
9147 {
9150
9152 {
9153 string config_to_search = "CfgVehicles";
9154
9155 if (IsInherited(Weapon))
9156 config_to_search = "CfgWeapons";
9157
9158 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9159 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9160
9161 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9162 {
9163
9165
9167 {
9169 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9171 return;
9172 }
9173
9176
9177
9178
9180 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9181
9182 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9183 {
9184 string particle_class = "";
9186 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9188
9189 if (entry_type == CT_CLASS)
9190 {
9191 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9192 WPOOH_array.Insert(WPOF);
9193 }
9194 }
9195
9196
9198 }
9199 }
9200 }
9201
9203 {
9205 }
9206
9208 {
9210 {
9212
9215
9218
9219 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9220 }
9221 }
9222
9224 {
9226 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9227
9229 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9230
9232 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9233
9235 {
9237 }
9238 }
9239
9241 {
9243 }
9244
9246 {
9249 else
9251
9253 {
9256 }
9257 else
9258 {
9261
9264 }
9265
9267 }
9268
9270 {
9272 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9273 }
9274
9276 {
9278 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9280 }
9281
9283 {
9285 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9286 }
9287
9289 {
9292
9293 OverheatingParticle OP = new OverheatingParticle();
9298
9300 }
9301
9303 {
9306
9307 return -1;
9308 }
9309
9311 {
9313 {
9316
9317 for (int i = count; i > 0; --i)
9318 {
9319 int id = i - 1;
9322
9325
9326 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9327 {
9328 if (p)
9329 {
9332 }
9333 }
9334 }
9335 }
9336 }
9337
9339 {
9341 {
9343 {
9344 int id = i - 1;
9346
9347 if (OP)
9348 {
9350
9351 if (p)
9352 {
9354 }
9355
9356 delete OP;
9357 }
9358 }
9359
9362 }
9363 }
9364
9367 {
9368 return 0.0;
9369 }
9370
9371
9373 {
9374 return 250;
9375 }
9376
9378 {
9379 return 0;
9380 }
9381
9384 {
9386 return true;
9387
9388 return false;
9389 }
9390
9393 {
9396
9398 {
9400 }
9401 else
9402 {
9403
9405 }
9406
9408 }
9409
9416 {
9417 return -1;
9418 }
9419
9420
9421
9422
9424 {
9426 {
9428 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9429
9430 if (r_index >= 0)
9431 {
9432 InventoryLocation r_il = new InventoryLocation;
9433 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9434
9435 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9438 {
9439 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9440 }
9442 {
9443 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9444 }
9445
9446 }
9447
9448 player.GetHumanInventory().ClearUserReservedLocation(this);
9449 }
9450
9453 }
9454
9455
9456
9457
9459 {
9460 return ItemBase.m_DebugActionsMask;
9461 }
9462
9464 {
9465 return ItemBase.m_DebugActionsMask & mask;
9466 }
9467
9469 {
9470 ItemBase.m_DebugActionsMask = mask;
9471 }
9472
9474 {
9475 ItemBase.m_DebugActionsMask |= mask;
9476 }
9477
9479 {
9480 ItemBase.m_DebugActionsMask &= ~mask;
9481 }
9482
9484 {
9486 {
9488 }
9489 else
9490 {
9492 }
9493 }
9494
9495
9497 {
9498 if (GetEconomyProfile())
9499 {
9500 float q_max = GetEconomyProfile().GetQuantityMax();
9501 if (q_max > 0)
9502 {
9503 float q_min = GetEconomyProfile().GetQuantityMin();
9504 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9505
9507 {
9508 ComponentEnergyManager comp = GetCompEM();
9510 {
9512 }
9513 }
9515 {
9517
9518 }
9519
9520 }
9521 }
9522 }
9523
9526 {
9527 EntityAI parent = GetHierarchyParent();
9528
9529 if (parent)
9530 {
9531 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9532 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9533 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9534 }
9535 }
9536
9539 {
9540 EntityAI parent = GetHierarchyParent();
9541
9542 if (parent)
9543 {
9544 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9545 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9546 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9547 }
9548 }
9549
9551 {
9552
9553
9554
9555
9557
9559 {
9560 if (ScriptInputUserData.CanStoreInputUserData())
9561 {
9562 ScriptInputUserData ctx = new ScriptInputUserData;
9568 ctx.
Write(use_stack_max);
9571
9573 {
9574 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9575 }
9576 }
9577 }
9578 else if (!
GetGame().IsMultiplayer())
9579 {
9581 }
9582 }
9583
9585 {
9587 }
9588
9590 {
9592 }
9593
9595 {
9597 }
9598
9600 {
9601
9602 return false;
9603 }
9604
9606 {
9607 return false;
9608 }
9609
9613 {
9614 return false;
9615 }
9616
9618 {
9619 return "";
9620 }
9621
9623
9625 {
9626 return false;
9627 }
9628
9630 {
9631 return true;
9632 }
9633
9634
9635
9637 {
9638 return true;
9639 }
9640
9642 {
9643 return true;
9644 }
9645
9647 {
9648 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9650 }
9651
9653 {
9655 }
9656
9658 {
9660 if (!is_being_placed)
9662 SetSynchDirty();
9663 }
9664
9665
9667
9669 {
9671 }
9672
9674 {
9676 }
9677
9679 {
9680 return 1;
9681 }
9682
9684 {
9685 return false;
9686 }
9687
9689 {
9691 SetSynchDirty();
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
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9729 {
9730 super.OnMovedInsideCargo(container);
9731
9732 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9733 }
9734
9735 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9736 {
9737 super.EEItemLocationChanged(oldLoc,newLoc);
9738
9739 PlayerBase new_player = null;
9740 PlayerBase old_player = null;
9741
9742 if (newLoc.GetParent())
9743 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9744
9745 if (oldLoc.GetParent())
9746 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9747
9749 {
9750 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9751
9752 if (r_index >= 0)
9753 {
9754 InventoryLocation r_il = new InventoryLocation;
9755 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9756
9757 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9760 {
9761 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9762 }
9764 {
9765 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9766 }
9767
9768 }
9769 }
9770
9772 {
9773 if (new_player)
9774 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9775
9776 if (new_player == old_player)
9777 {
9778
9779 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9780 {
9782 {
9783 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9784 {
9785 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9786 }
9787 }
9788 else
9789 {
9790 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9791 }
9792 }
9793
9794 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9795 {
9796 int type = oldLoc.GetType();
9798 {
9799 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9800 }
9802 {
9803 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9804 }
9805 }
9806 if (!m_OldLocation)
9807 {
9808 m_OldLocation = new InventoryLocation;
9809 }
9810 m_OldLocation.Copy(oldLoc);
9811 }
9812 else
9813 {
9814 if (m_OldLocation)
9815 {
9816 m_OldLocation.Reset();
9817 }
9818 }
9819
9821 }
9822 else
9823 {
9824 if (new_player)
9825 {
9826 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9827 if (res_index >= 0)
9828 {
9829 InventoryLocation il = new InventoryLocation;
9830 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9832 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9835 {
9836 il.
GetParent().GetOnReleaseLock().Invoke(it);
9837 }
9839 {
9841 }
9842
9843 }
9844 }
9846 {
9847
9849 }
9850
9851 if (m_OldLocation)
9852 {
9853 m_OldLocation.Reset();
9854 }
9855 }
9856 }
9857
9858 override void EOnContact(IEntity other, Contact extra)
9859 {
9861 {
9862 int liquidType = -1;
9864 if (impactSpeed > 0.0)
9865 {
9867 #ifndef SERVER
9869 #else
9871 SetSynchDirty();
9872 #endif
9874 }
9875 }
9876
9877 #ifdef SERVER
9878 if (GetCompEM() && GetCompEM().IsPlugged())
9879 {
9880 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9881 GetCompEM().UnplugThis();
9882 }
9883 #endif
9884 }
9885
9887
9889 {
9891 }
9892
9894 {
9895
9896 }
9897
9899 {
9900 super.OnItemLocationChanged(old_owner, new_owner);
9901
9902 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9903 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9904
9905 if (!relatedPlayer && playerNew)
9906 relatedPlayer = playerNew;
9907
9908 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9909 {
9911 if (actionMgr)
9912 {
9913 ActionBase currentAction = actionMgr.GetRunningAction();
9914 if (currentAction)
9916 }
9917 }
9918
9919 Man ownerPlayerOld = null;
9920 Man ownerPlayerNew = null;
9921
9922 if (old_owner)
9923 {
9924 if (old_owner.
IsMan())
9925 {
9926 ownerPlayerOld = Man.Cast(old_owner);
9927 }
9928 else
9929 {
9930 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9931 }
9932 }
9933 else
9934 {
9936 {
9938
9939 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9940 {
9941 GetCompEM().UnplugThis();
9942 }
9943 }
9944 }
9945
9946 if (new_owner)
9947 {
9948 if (new_owner.
IsMan())
9949 {
9950 ownerPlayerNew = Man.Cast(new_owner);
9951 }
9952 else
9953 {
9954 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9955 }
9956 }
9957
9958 if (ownerPlayerOld != ownerPlayerNew)
9959 {
9960 if (ownerPlayerOld)
9961 {
9962 array<EntityAI> subItemsExit = new array<EntityAI>;
9964 for (int i = 0; i < subItemsExit.Count(); i++)
9965 {
9968 }
9969 }
9970
9971 if (ownerPlayerNew)
9972 {
9973 array<EntityAI> subItemsEnter = new array<EntityAI>;
9975 for (int j = 0; j < subItemsEnter.Count(); j++)
9976 {
9979 }
9980 }
9981 }
9982 else if (ownerPlayerNew != null)
9983 {
9984 PlayerBase nplayer;
9985 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9986 {
9987 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9989 for (int k = 0; k < subItemsUpdate.Count(); k++)
9990 {
9992 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9993 }
9994 }
9995 }
9996
9997 if (old_owner)
9998 old_owner.OnChildItemRemoved(this);
9999 if (new_owner)
10000 new_owner.OnChildItemReceived(this);
10001 }
10002
10003
10005 {
10006 super.EEDelete(parent);
10007 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10008 if (player)
10009 {
10011
10012 if (player.IsAlive())
10013 {
10014 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10015 if (r_index >= 0)
10016 {
10017 InventoryLocation r_il = new InventoryLocation;
10018 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10019
10020 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10023 {
10024 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10025 }
10027 {
10028 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10029 }
10030
10031 }
10032
10033 player.RemoveQuickBarEntityShortcut(this);
10034 }
10035 }
10036 }
10037
10039 {
10040 super.EEKilled(killer);
10041
10044 {
10045 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10046 {
10047 if (IsMagazine())
10048 {
10049 if (Magazine.Cast(this).GetAmmoCount() > 0)
10050 {
10052 }
10053 }
10054 else
10055 {
10057 }
10058 }
10059 }
10060 }
10061
10063 {
10064 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10065
10066 super.OnWasAttached(parent, slot_id);
10067
10070
10072 }
10073
10075 {
10076 super.OnWasDetached(parent, slot_id);
10077
10080 }
10081
10083 {
10084 int idx;
10087
10088 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10089 if (inventory_slots.Count() < 1)
10090 {
10091 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10092 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10093 }
10094 else
10095 {
10096 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10097 }
10098
10099 idx = inventory_slots.Find(slot);
10100 if (idx < 0)
10101 return "";
10102
10103 return attach_types.Get(idx);
10104 }
10105
10107 {
10108 int idx = -1;
10109 string slot;
10110
10113
10114 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10115 if (inventory_slots.Count() < 1)
10116 {
10117 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10118 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10119 }
10120 else
10121 {
10122 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10123 if (detach_types.Count() < 1)
10124 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10125 }
10126
10127 for (int i = 0; i < inventory_slots.Count(); i++)
10128 {
10129 slot = inventory_slots.Get(i);
10130 }
10131
10132 if (slot != "")
10133 {
10134 if (detach_types.Count() == 1)
10135 idx = 0;
10136 else
10137 idx = inventory_slots.Find(slot);
10138 }
10139 if (idx < 0)
10140 return "";
10141
10142 return detach_types.Get(idx);
10143 }
10144
10146 {
10147
10149
10150
10151 float min_time = 1;
10152 float max_time = 3;
10153 float delay = Math.RandomFloat(min_time, max_time);
10154
10155 explode_timer.Run(delay, this, "DoAmmoExplosion");
10156 }
10157
10159 {
10160 Magazine magazine = Magazine.Cast(this);
10161 int pop_sounds_count = 6;
10162 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10163
10164
10165 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10166 string sound_name = pop_sounds[ sound_idx ];
10168
10169
10170 magazine.ServerAddAmmoCount(-1);
10171
10172
10173 float min_temp_to_explode = 100;
10174
10175 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10176 {
10178 }
10179 }
10180
10181
10182 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10183 {
10184 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10185
10186 const int CHANCE_DAMAGE_CARGO = 4;
10187 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10188 const int CHANCE_DAMAGE_NOTHING = 2;
10189
10191 {
10192 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10193 int chances;
10194 int rnd;
10195
10196 if (GetInventory().GetCargo())
10197 {
10198 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10199 rnd = Math.RandomInt(0,chances);
10200
10201 if (rnd < CHANCE_DAMAGE_CARGO)
10202 {
10204 }
10205 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10206 {
10208 }
10209 }
10210 else
10211 {
10212 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10213 rnd = Math.RandomInt(0,chances);
10214
10215 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10216 {
10218 }
10219 }
10220 }
10221 }
10222
10224 {
10225 if (GetInventory().GetCargo())
10226 {
10227 int item_count = GetInventory().GetCargo().GetItemCount();
10228 if (item_count > 0)
10229 {
10230 int random_pick = Math.RandomInt(0, item_count);
10232 if (!item.IsExplosive())
10233 {
10234 item.AddHealth("","",damage);
10235 return true;
10236 }
10237 }
10238 }
10239 return false;
10240 }
10241
10243 {
10244 int attachment_count = GetInventory().AttachmentCount();
10245 if (attachment_count > 0)
10246 {
10247 int random_pick = Math.RandomInt(0, attachment_count);
10248 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10249 if (!attachment.IsExplosive())
10250 {
10251 attachment.AddHealth("","",damage);
10252 return true;
10253 }
10254 }
10255 return false;
10256 }
10257
10259 {
10261 }
10262
10264 {
10266 return GetInventory().CanRemoveEntity();
10267
10268 return false;
10269 }
10270
10272 {
10273
10275 return false;
10276
10277
10279 return false;
10280
10281
10282
10284 if (delta == 0)
10285 return false;
10286
10287
10288 return true;
10289 }
10290
10292 {
10294 {
10295 if (ScriptInputUserData.CanStoreInputUserData())
10296 {
10297 ScriptInputUserData ctx = new ScriptInputUserData;
10302 ctx.
Write(destination_entity);
10304 ctx.
Write(slot_id);
10306 }
10307 }
10308 else if (!
GetGame().IsMultiplayer())
10309 {
10311 }
10312 }
10313
10315 {
10316 float split_quantity_new;
10320 InventoryLocation loc = new InventoryLocation;
10321
10322 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10323 {
10325 split_quantity_new = stack_max;
10326 else
10328
10330 {
10331 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10332 if (new_item)
10333 {
10334 new_item.SetResultOfSplit(true);
10335 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10337 new_item.
SetQuantity(split_quantity_new,
false,
true);
10338 }
10339 }
10340 }
10341 else if (destination_entity && slot_id == -1)
10342 {
10343 if (quantity > stack_max)
10344 split_quantity_new = stack_max;
10345 else
10346 split_quantity_new = quantity;
10347
10349 {
10351 {
10354 }
10355
10356 if (new_item)
10357 {
10358 new_item.SetResultOfSplit(true);
10359 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10361 new_item.
SetQuantity(split_quantity_new,
false,
true);
10362 }
10363 }
10364 }
10365 else
10366 {
10367 if (stack_max != 0)
10368 {
10370 {
10372 }
10373
10374 if (split_quantity_new == 0)
10375 {
10376 if (!
GetGame().IsMultiplayer())
10377 player.PhysicalPredictiveDropItem(this);
10378 else
10379 player.ServerDropEntity(this);
10380 return;
10381 }
10382
10384 {
10386
10387 if (new_item)
10388 {
10389 new_item.SetResultOfSplit(true);
10390 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10393 new_item.PlaceOnSurface();
10394 }
10395 }
10396 }
10397 }
10398 }
10399
10401 {
10402 float split_quantity_new;
10406 InventoryLocation loc = new InventoryLocation;
10407
10408 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10409 {
10411 split_quantity_new = stack_max;
10412 else
10414
10416 {
10417 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10418 if (new_item)
10419 {
10420 new_item.SetResultOfSplit(true);
10421 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10423 new_item.
SetQuantity(split_quantity_new,
false,
true);
10424 }
10425 }
10426 }
10427 else if (destination_entity && slot_id == -1)
10428 {
10429 if (quantity > stack_max)
10430 split_quantity_new = stack_max;
10431 else
10432 split_quantity_new = quantity;
10433
10435 {
10437 {
10440 }
10441
10442 if (new_item)
10443 {
10444 new_item.SetResultOfSplit(true);
10445 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10447 new_item.
SetQuantity(split_quantity_new,
false,
true);
10448 }
10449 }
10450 }
10451 else
10452 {
10453 if (stack_max != 0)
10454 {
10456 {
10458 }
10459
10461 {
10463
10464 if (new_item)
10465 {
10466 new_item.SetResultOfSplit(true);
10467 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10470 new_item.PlaceOnSurface();
10471 }
10472 }
10473 }
10474 }
10475 }
10476
10478 {
10480 {
10481 if (ScriptInputUserData.CanStoreInputUserData())
10482 {
10483 ScriptInputUserData ctx = new ScriptInputUserData;
10488 dst.WriteToContext(ctx);
10490 }
10491 }
10492 else if (!
GetGame().IsMultiplayer())
10493 {
10495 }
10496 }
10497
10499 {
10501 {
10502 if (ScriptInputUserData.CanStoreInputUserData())
10503 {
10504 ScriptInputUserData ctx = new ScriptInputUserData;
10509 ctx.
Write(destination_entity);
10515 }
10516 }
10517 else if (!
GetGame().IsMultiplayer())
10518 {
10520 }
10521 }
10522
10524 {
10526 }
10527
10529 {
10531 float split_quantity_new;
10533 if (dst.IsValid())
10534 {
10535 int slot_id = dst.GetSlot();
10537
10538 if (quantity > stack_max)
10539 split_quantity_new = stack_max;
10540 else
10541 split_quantity_new = quantity;
10542
10544 {
10546
10547 if (new_item)
10548 {
10549 new_item.SetResultOfSplit(true);
10550 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10552 new_item.
SetQuantity(split_quantity_new,
false,
true);
10553 }
10554
10555 return new_item;
10556 }
10557 }
10558
10559 return null;
10560 }
10561
10563 {
10565 float split_quantity_new;
10567 if (destination_entity)
10568 {
10570 if (quantity > stackable)
10571 split_quantity_new = stackable;
10572 else
10573 split_quantity_new = quantity;
10574
10576 {
10577 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10578 if (new_item)
10579 {
10580 new_item.SetResultOfSplit(true);
10581 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10583 new_item.
SetQuantity(split_quantity_new,
false,
true);
10584 }
10585 }
10586 }
10587 }
10588
10590 {
10592 {
10593 if (ScriptInputUserData.CanStoreInputUserData())
10594 {
10595 ScriptInputUserData ctx = new ScriptInputUserData;
10600 ItemBase destination_entity =
this;
10601 ctx.
Write(destination_entity);
10605 }
10606 }
10607 else if (!
GetGame().IsMultiplayer())
10608 {
10610 }
10611 }
10612
10614 {
10616 float split_quantity_new;
10618 if (player)
10619 {
10621 if (quantity > stackable)
10622 split_quantity_new = stackable;
10623 else
10624 split_quantity_new = quantity;
10625
10627 {
10628 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10629 new_item =
ItemBase.Cast(in_hands);
10630 if (new_item)
10631 {
10632 new_item.SetResultOfSplit(true);
10633 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10635 new_item.SetQuantity(split_quantity_new, false, true);
10636 }
10637 }
10638 }
10639 }
10640
10642 {
10644 float split_quantity_new = Math.Floor(quantity * 0.5);
10645
10647 return;
10648
10650
10651 if (new_item)
10652 {
10653 if (new_item.GetQuantityMax() < split_quantity_new)
10654 {
10655 split_quantity_new = new_item.GetQuantityMax();
10656 }
10657
10658 new_item.SetResultOfSplit(true);
10659 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10660
10662 {
10665 }
10666 else
10667 {
10669 new_item.
SetQuantity(split_quantity_new,
false,
true);
10670 }
10671 }
10672 }
10673
10675 {
10677 float split_quantity_new = Math.Floor(quantity / 2);
10678
10680 return;
10681
10682 InventoryLocation invloc = new InventoryLocation;
10684
10686 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10687
10688 if (new_item)
10689 {
10690 if (new_item.GetQuantityMax() < split_quantity_new)
10691 {
10692 split_quantity_new = new_item.GetQuantityMax();
10693 }
10695 {
10698 }
10699 else if (split_quantity_new > 1)
10700 {
10702 new_item.
SetQuantity(split_quantity_new,
false,
true);
10703 }
10704 }
10705 }
10706
10709 {
10710 SetWeightDirty();
10712
10713 if (parent)
10714 parent.OnAttachmentQuantityChangedEx(this, delta);
10715
10717 {
10719 {
10721 }
10723 {
10724 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10726 }
10727 }
10728
10729 }
10730
10733 {
10734
10735 }
10736
10739 {
10741 }
10742
10744 {
10745 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10746
10748 {
10749 if (newLevel == GameConstants.STATE_RUINED)
10750 {
10752 EntityAI parent = GetHierarchyParent();
10753 if (parent && parent.IsFireplace())
10754 {
10755 CargoBase cargo = GetInventory().GetCargo();
10756 if (cargo)
10757 {
10759 {
10761 }
10762 }
10763 }
10764 }
10765
10767 {
10768
10770 return;
10771 }
10772
10773 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10774 {
10776 }
10777 }
10778 }
10779
10780
10782 {
10783 super.OnRightClick();
10784
10786 {
10788 {
10789 if (ScriptInputUserData.CanStoreInputUserData())
10790 {
10791 EntityAI root = GetHierarchyRoot();
10792 Man playerOwner = GetHierarchyRootPlayer();
10793 InventoryLocation dst = new InventoryLocation;
10794
10795
10796 if (!playerOwner && root && root == this)
10797 {
10799 }
10800 else
10801 {
10802
10803 GetInventory().GetCurrentInventoryLocation(dst);
10805 {
10808 {
10810 }
10811 else
10812 {
10814
10815
10816 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10817 {
10819 }
10820 else
10821 {
10822 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10823 }
10824 }
10825 }
10826 }
10827
10828 ScriptInputUserData ctx = new ScriptInputUserData;
10836 }
10837 }
10838 else if (!
GetGame().IsMultiplayer())
10839 {
10841 }
10842 }
10843 }
10844
10846 {
10847 if (root)
10848 {
10849 vector m4[4];
10850 root.GetTransform(m4);
10851 dst.SetGround(this, m4);
10852 }
10853 else
10854 {
10855 GetInventory().GetCurrentInventoryLocation(dst);
10856 }
10857 }
10858
10859 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10860 {
10861
10862 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10863 return false;
10864
10865 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10866 return false;
10867
10868
10870 return false;
10871
10872
10873 Magazine mag = Magazine.Cast(this);
10874 if (mag)
10875 {
10876 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10877 return false;
10878
10879 if (stack_max_limit)
10880 {
10881 Magazine other_mag = Magazine.Cast(other_item);
10882 if (other_item)
10883 {
10884 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10885 return false;
10886 }
10887
10888 }
10889 }
10890 else
10891 {
10892
10894 return false;
10895
10897 return false;
10898 }
10899
10900 PlayerBase player = null;
10901 if (CastTo(player, GetHierarchyRootPlayer()))
10902 {
10903 if (player.GetInventory().HasAttachment(this))
10904 return false;
10905
10906 if (player.IsItemsToDelete())
10907 return false;
10908 }
10909
10910 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10911 return false;
10912
10913 int slotID;
10915 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10916 return false;
10917
10918 return true;
10919 }
10920
10922 {
10924 }
10925
10927 {
10928 return m_IsResultOfSplit;
10929 }
10930
10932 {
10933 m_IsResultOfSplit = value;
10934 }
10935
10937 {
10939 }
10940
10942 {
10943 float other_item_quantity = other_item.GetQuantity();
10944 float this_free_space;
10945
10947
10949
10950 if (other_item_quantity > this_free_space)
10951 {
10952 return this_free_space;
10953 }
10954 else
10955 {
10956 return other_item_quantity;
10957 }
10958 }
10959
10961 {
10963 }
10964
10966 {
10968 return;
10969
10970 if (!IsMagazine() && other_item)
10971 {
10973 if (quantity_used != 0)
10974 {
10975 float hp1 = GetHealth01("","");
10976 float hp2 = other_item.GetHealth01("","");
10977 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10978 hpResult = hpResult / (
GetQuantity() + quantity_used);
10979
10980 hpResult *= GetMaxHealth();
10981 Math.Round(hpResult);
10982 SetHealth("", "Health", hpResult);
10983
10985 other_item.AddQuantity(-quantity_used);
10986 }
10987 }
10989 }
10990
10992 {
10993 #ifdef SERVER
10994 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10995 GetHierarchyParent().IncreaseLifetimeUp();
10996 #endif
10997 };
10998
11000 {
11001 PlayerBase p = PlayerBase.Cast(player);
11002
11003 array<int> recipesIds = p.m_Recipes;
11004 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11005 if (moduleRecipesManager)
11006 {
11007 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11008 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11009 }
11010
11011 for (int i = 0;i < recipesIds.Count(); i++)
11012 {
11013 int key = recipesIds.Get(i);
11014 string recipeName = moduleRecipesManager.GetRecipeName(key);
11016 }
11017 }
11018
11019
11020 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11021 {
11022 super.GetDebugActions(outputList);
11023
11024
11030
11031
11036
11041
11042
11046
11047
11049 {
11053 }
11054
11057
11058
11062
11064
11065 InventoryLocation loc = new InventoryLocation();
11066 GetInventory().GetCurrentInventoryLocation(loc);
11068 {
11069 if (Gizmo_IsSupported())
11072 }
11073
11075 }
11076
11077
11078
11079
11081 {
11082 super.OnAction(action_id, player, ctx);
11083
11085 {
11086 switch (action_id)
11087 {
11090 return true;
11093 return true;
11094 }
11095 }
11096
11098 {
11099 switch (action_id)
11100 {
11102 Delete();
11103 return true;
11104 }
11105 }
11106
11107 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11108 {
11109 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11110 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11111 PlayerBase p = PlayerBase.Cast(player);
11112 if (
EActions.RECIPES_RANGE_START < 1000)
11113 {
11114 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11115 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11116 }
11117 }
11118 #ifndef SERVER
11119 else if (action_id ==
EActions.WATCH_PLAYER)
11120 {
11121 PluginDeveloper.SetDeveloperItemClientEx(player);
11122 }
11123 #endif
11125 {
11126 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11127 {
11128 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11129 OnDebugButtonPressServer(id + 1);
11130 }
11131
11132 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11133 {
11134 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11136 }
11137
11138 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11139 {
11140 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11142 }
11143
11144 else if (action_id ==
EActions.ADD_QUANTITY)
11145 {
11146 if (IsMagazine())
11147 {
11148 Magazine mag = Magazine.Cast(this);
11149 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11150 }
11151 else
11152 {
11154 }
11155
11156 if (m_EM)
11157 {
11158 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11159 }
11160
11161 }
11162
11163 else if (action_id ==
EActions.REMOVE_QUANTITY)
11164 {
11165 if (IsMagazine())
11166 {
11167 Magazine mag2 = Magazine.Cast(this);
11168 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11169 }
11170 else
11171 {
11173 }
11174 if (m_EM)
11175 {
11176 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11177 }
11178
11179 }
11180
11181 else if (action_id ==
EActions.SET_QUANTITY_0)
11182 {
11184
11185 if (m_EM)
11186 {
11187 m_EM.SetEnergy(0);
11188 }
11189 }
11190
11191 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11192 {
11194
11195 if (m_EM)
11196 {
11197 m_EM.SetEnergy(m_EM.GetEnergyMax());
11198 }
11199 }
11200
11201 else if (action_id ==
EActions.ADD_HEALTH)
11202 {
11203 AddHealth("","",GetMaxHealth("","Health")/5);
11204 }
11205 else if (action_id ==
EActions.REMOVE_HEALTH)
11206 {
11207 AddHealth("","",-GetMaxHealth("","Health")/5);
11208 }
11209 else if (action_id ==
EActions.DESTROY_HEALTH)
11210 {
11211 SetHealth01("","",0);
11212 }
11213 else if (action_id ==
EActions.WATCH_ITEM)
11214 {
11216 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11217 #ifdef DEVELOPER
11218 SetDebugDeveloper_item(this);
11219 #endif
11220 }
11221
11222 else if (action_id ==
EActions.ADD_TEMPERATURE)
11223 {
11224 AddTemperature(20);
11225
11226 }
11227
11228 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11229 {
11230 AddTemperature(-20);
11231
11232 }
11233
11234 else if (action_id ==
EActions.FLIP_FROZEN)
11235 {
11236 SetFrozen(!GetIsFrozen());
11237
11238 }
11239
11240 else if (action_id ==
EActions.ADD_WETNESS)
11241 {
11243
11244 }
11245
11246 else if (action_id ==
EActions.REMOVE_WETNESS)
11247 {
11249
11250 }
11251
11252 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11253 {
11256
11257
11258 }
11259
11260 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11261 {
11264 }
11265
11266 else if (action_id ==
EActions.MAKE_SPECIAL)
11267 {
11268 auto debugParams = DebugSpawnParams.WithPlayer(player);
11269 OnDebugSpawnEx(debugParams);
11270 }
11271
11272 }
11273
11274
11275 return false;
11276 }
11277
11278
11279
11280
11284
11287
11288
11289
11291 {
11292 return false;
11293 }
11294
11295
11297 {
11298 return true;
11299 }
11300
11301
11303 {
11304 return true;
11305 }
11306
11307
11308
11310 {
11311 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11313 }
11314
11317 {
11318 return null;
11319 }
11320
11322 {
11323 return false;
11324 }
11325
11327 {
11328 return false;
11329 }
11330
11334
11335
11337 {
11338 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11339 return module_repairing.CanRepair(this, item_repair_kit);
11340 }
11341
11342
11343 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11344 {
11345 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11346 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11347 }
11348
11349
11351 {
11352
11353
11354
11355
11356
11357
11358
11359
11360 return 1;
11361 }
11362
11363
11364
11366 {
11368 }
11369
11370
11371
11373 {
11375 }
11376
11377
11386 {
11387 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11388
11389 if (player)
11390 {
11391 player.MessageStatus(text);
11392 }
11393 }
11394
11395
11404 {
11405 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11406
11407 if (player)
11408 {
11409 player.MessageAction(text);
11410 }
11411 }
11412
11413
11422 {
11423 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11424
11425 if (player)
11426 {
11427 player.MessageFriendly(text);
11428 }
11429 }
11430
11431
11440 {
11441 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11442
11443 if (player)
11444 {
11445 player.MessageImportant(text);
11446 }
11447 }
11448
11450 {
11451 return true;
11452 }
11453
11454
11455 override bool KindOf(
string tag)
11456 {
11457 bool found = false;
11458 string item_name = this.
GetType();
11461
11462 int array_size = item_tag_array.Count();
11463 for (int i = 0; i < array_size; i++)
11464 {
11465 if (item_tag_array.Get(i) == tag)
11466 {
11467 found = true;
11468 break;
11469 }
11470 }
11471 return found;
11472 }
11473
11474
11476 {
11477
11478 super.OnRPC(sender, rpc_type,ctx);
11479
11480
11481 switch (rpc_type)
11482 {
11483 #ifndef SERVER
11484 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11485 Param2<bool, string> p = new Param2<bool, string>(false, "");
11486
11488 return;
11489
11490 bool play = p.param1;
11491 string soundSet = p.param2;
11492
11493 if (play)
11494 {
11496 {
11498 {
11500 }
11501 }
11502 else
11503 {
11505 }
11506 }
11507 else
11508 {
11510 }
11511
11512 break;
11513 #endif
11514
11515 }
11516
11518 {
11520 }
11521 }
11522
11523
11524
11525
11527 {
11528 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11529 return plugin.GetID(
name);
11530 }
11531
11533 {
11534 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11535 return plugin.GetName(id);
11536 }
11537
11540 {
11541
11542
11543 int varFlags;
11544 if (!ctx.
Read(varFlags))
11545 return;
11546
11547 if (varFlags & ItemVariableFlags.FLOAT)
11548 {
11550 }
11551 }
11552
11554 {
11555
11556 super.SerializeNumericalVars(floats_out);
11557
11558
11559
11561 {
11563 }
11564
11566 {
11568 }
11569
11571 {
11573 }
11574
11576 {
11581 }
11582
11584 {
11586 }
11587 }
11588
11590 {
11591
11592 super.DeSerializeNumericalVars(floats);
11593
11594
11595 int index = 0;
11596 int mask = Math.Round(floats.Get(index));
11597
11598 index++;
11599
11601 {
11603 {
11605 }
11606 else
11607 {
11608 float quantity = floats.Get(index);
11609 SetQuantity(quantity,
true,
false,
false,
false);
11610 }
11611 index++;
11612 }
11613
11615 {
11616 float wet = floats.Get(index);
11618 index++;
11619 }
11620
11622 {
11623 int liquidtype = Math.Round(floats.Get(index));
11625 index++;
11626 }
11627
11629 {
11631 index++;
11633 index++;
11635 index++;
11637 index++;
11638 }
11639
11641 {
11642 int cleanness = Math.Round(floats.Get(index));
11644 index++;
11645 }
11646 }
11647
11649 {
11650 super.WriteVarsToCTX(ctx);
11651
11652
11654 {
11656 }
11657
11659 {
11661 }
11662
11664 {
11666 }
11667
11669 {
11670 int r,g,b,a;
11676 }
11677
11679 {
11681 }
11682 }
11683
11685 {
11686 if (!super.ReadVarsFromCTX(ctx,version))
11687 return false;
11688
11689 int intValue;
11690 float value;
11691
11692 if (version < 140)
11693 {
11694 if (!ctx.
Read(intValue))
11695 return false;
11696
11697 m_VariablesMask = intValue;
11698 }
11699
11701 {
11702 if (!ctx.
Read(value))
11703 return false;
11704
11706 {
11708 }
11709 else
11710 {
11712 }
11713 }
11714
11715 if (version < 140)
11716 {
11718 {
11719 if (!ctx.
Read(value))
11720 return false;
11721 SetTemperatureDirect(value);
11722 }
11723 }
11724
11726 {
11727 if (!ctx.
Read(value))
11728 return false;
11730 }
11731
11733 {
11734 if (!ctx.
Read(intValue))
11735 return false;
11737 }
11738
11740 {
11741 int r,g,b,a;
11743 return false;
11745 return false;
11747 return false;
11749 return false;
11750
11752 }
11753
11755 {
11756 if (!ctx.
Read(intValue))
11757 return false;
11759 }
11760
11761 if (version >= 138 && version < 140)
11762 {
11764 {
11765 if (!ctx.
Read(intValue))
11766 return false;
11767 SetFrozen(intValue);
11768 }
11769 }
11770
11771 return true;
11772 }
11773
11774
11776 {
11779 {
11781 }
11782
11783 if (!super.OnStoreLoad(ctx, version))
11784 {
11786 return false;
11787 }
11788
11789 if (version >= 114)
11790 {
11791 bool hasQuickBarIndexSaved;
11792
11793 if (!ctx.
Read(hasQuickBarIndexSaved))
11794 {
11796 return false;
11797 }
11798
11799 if (hasQuickBarIndexSaved)
11800 {
11801 int itmQBIndex;
11802
11803
11804 if (!ctx.
Read(itmQBIndex))
11805 {
11807 return false;
11808 }
11809
11810 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11811 if (itmQBIndex != -1 && parentPlayer)
11812 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11813 }
11814 }
11815 else
11816 {
11817
11818 PlayerBase player;
11819 int itemQBIndex;
11820 if (version ==
int.
MAX)
11821 {
11822 if (!ctx.
Read(itemQBIndex))
11823 {
11825 return false;
11826 }
11827 }
11828 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11829 {
11830
11831 if (!ctx.
Read(itemQBIndex))
11832 {
11834 return false;
11835 }
11836 if (itemQBIndex != -1 && player)
11837 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11838 }
11839 }
11840
11841 if (version < 140)
11842 {
11843
11844 if (!LoadVariables(ctx, version))
11845 {
11847 return false;
11848 }
11849 }
11850
11851
11853 {
11855 return false;
11856 }
11857 if (version >= 132)
11858 {
11860 if (raib)
11861 {
11863 {
11865 return false;
11866 }
11867 }
11868 }
11869
11871 return true;
11872 }
11873
11874
11875
11877 {
11878 super.OnStoreSave(ctx);
11879
11880 PlayerBase player;
11881 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11882 {
11884
11885 int itemQBIndex = -1;
11886 itemQBIndex = player.FindQuickBarEntityIndex(this);
11887 ctx.
Write(itemQBIndex);
11888 }
11889 else
11890 {
11892 }
11893
11895
11897 if (raib)
11898 {
11900 }
11901 }
11902
11903
11905 {
11906 super.AfterStoreLoad();
11907
11909 {
11911 }
11912
11914 {
11917 }
11918 }
11919
11921 {
11922 super.EEOnAfterLoad();
11923
11925 {
11927 }
11928
11931 }
11932
11934 {
11935 return false;
11936 }
11937
11938
11939
11941 {
11943 {
11944 #ifdef PLATFORM_CONSOLE
11945
11947 {
11949 if (menu)
11950 {
11952 }
11953 }
11954 #endif
11955 }
11956
11958 {
11961 }
11962
11964 {
11965 SetWeightDirty();
11967 }
11969 {
11972 }
11973
11975 {
11978 }
11980 {
11983 }
11984
11985 super.OnVariablesSynchronized();
11986 }
11987
11988
11989
11991 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11992 {
11993 if (!IsServerCheck(allow_client))
11994 return false;
11995
11997 return false;
11998
12001
12002 if (value <= (min + 0.001))
12003 value = min;
12004
12005 if (value == min)
12006 {
12007 if (destroy_config)
12008 {
12009 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12010 if (dstr)
12011 {
12013 this.Delete();
12014 return true;
12015 }
12016 }
12017 else if (destroy_forced)
12018 {
12020 this.Delete();
12021 return true;
12022 }
12023
12025 }
12026
12029
12031 {
12033
12034 if (delta)
12036 }
12037
12039
12040 return false;
12041 }
12042
12043
12045 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12046 {
12048 }
12049
12051 {
12054 }
12055
12057 {
12060 }
12061
12063 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12064 {
12065 float value_clamped = Math.Clamp(value, 0, 1);
12067 SetQuantity(result, destroy_config, destroy_forced);
12068 }
12069
12070
12073 {
12075 }
12076
12078 {
12080 }
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12092 {
12093 int slot = -1;
12094 if (GetInventory())
12095 {
12096 InventoryLocation il = new InventoryLocation;
12097 GetInventory().GetCurrentInventoryLocation(il);
12099 }
12100
12102 }
12103
12105 {
12106 float quantity_max = 0;
12107
12109 {
12110 if (attSlotID != -1)
12111 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12112
12113 if (quantity_max <= 0)
12115 }
12116
12117 if (quantity_max <= 0)
12119
12120 return quantity_max;
12121 }
12122
12124 {
12126 }
12127
12129 {
12131 }
12132
12133
12135 {
12137 }
12138
12140 {
12142 }
12143
12145 {
12147 }
12148
12149
12151 {
12152
12153 float weightEx = GetWeightEx();
12154 float special = GetInventoryAndCargoWeight();
12155 return weightEx - special;
12156 }
12157
12158
12160 {
12162 }
12163
12165 {
12167 {
12168 #ifdef DEVELOPER
12169 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12170 {
12171 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12173 }
12174 #endif
12175
12176 return GetQuantity() * GetConfigWeightModified();
12177 }
12178 else if (HasEnergyManager())
12179 {
12180 #ifdef DEVELOPER
12181 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12182 {
12183 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12184 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12185 }
12186 #endif
12187 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12188 }
12189 else
12190 {
12191 #ifdef DEVELOPER
12192 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12193 {
12194 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12195 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12196 }
12197 #endif
12198 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12199 }
12200 }
12201
12204 {
12205 int item_count = 0;
12207
12208 if (GetInventory().GetCargo() != NULL)
12209 {
12210 item_count = GetInventory().GetCargo().GetItemCount();
12211 }
12212
12213 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12214 {
12215 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12216 if (item)
12217 item_count += item.GetNumberOfItems();
12218 }
12219 return item_count;
12220 }
12221
12224 {
12225 float weight = 0;
12226 float wetness = 1;
12227 if (include_wetness)
12230 {
12231 weight = wetness * m_ConfigWeight;
12232 }
12234 {
12235 weight = 1;
12236 }
12237 return weight;
12238 }
12239
12240
12241
12243 {
12244 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12245 {
12246 GameInventory inv = GetInventory();
12247 array<EntityAI> items = new array<EntityAI>;
12249 for (int i = 0; i < items.Count(); i++)
12250 {
12252 if (item)
12253 {
12255 }
12256 }
12257 }
12258 }
12259
12260
12261
12262
12264 {
12265 float energy = 0;
12266 if (HasEnergyManager())
12267 {
12268 energy = GetCompEM().GetEnergy();
12269 }
12270 return energy;
12271 }
12272
12273
12275 {
12276 super.OnEnergyConsumed();
12277
12279 }
12280
12282 {
12283 super.OnEnergyAdded();
12284
12286 }
12287
12288
12290 {
12291 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12292 {
12294 {
12295 float energy_0to1 = GetCompEM().GetEnergy0To1();
12297 }
12298 }
12299 }
12300
12301
12303 {
12304 return ConfigGetFloat("heatIsolation");
12305 }
12306
12308 {
12310 }
12311
12313 {
12314 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12315 if (
GetGame().ConfigIsExisting(paramPath))
12317
12318 return 0.0;
12319 }
12320
12322 {
12323 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12324 if (
GetGame().ConfigIsExisting(paramPath))
12326
12327 return 0.0;
12328 }
12329
12330 override void SetWet(
float value,
bool allow_client =
false)
12331 {
12332 if (!IsServerCheck(allow_client))
12333 return;
12334
12337
12339
12340 m_VarWet = Math.Clamp(value, min, max);
12341
12343 {
12346 }
12347 }
12348
12349 override void AddWet(
float value)
12350 {
12352 }
12353
12355 {
12357 }
12358
12360 {
12362 }
12363
12365 {
12367 }
12368
12370 {
12372 }
12373
12375 {
12377 }
12378
12379 override void OnWetChanged(
float newVal,
float oldVal)
12380 {
12383 if (newLevel != oldLevel)
12384 {
12386 }
12387 }
12388
12390 {
12391 SetWeightDirty();
12392 }
12393
12395 {
12396 return GetWetLevelInternal(
m_VarWet);
12397 }
12398
12399
12400
12402 {
12404 }
12405
12407 {
12409 }
12410
12412 {
12414 }
12415
12417 {
12419 }
12420
12421
12422
12424 {
12425 if (ConfigIsExisting("itemModelLength"))
12426 {
12427 return ConfigGetFloat("itemModelLength");
12428 }
12429 return 0;
12430 }
12431
12433 {
12434 if (ConfigIsExisting("itemAttachOffset"))
12435 {
12436 return ConfigGetFloat("itemAttachOffset");
12437 }
12438 return 0;
12439 }
12440
12441 override void SetCleanness(
int value,
bool allow_client =
false)
12442 {
12443 if (!IsServerCheck(allow_client))
12444 return;
12445
12447
12449
12452 }
12453
12455 {
12457 }
12458
12460 {
12461 return true;
12462 }
12463
12464
12465
12466
12468 {
12470 }
12471
12473 {
12475 }
12476
12477
12478
12479
12480 override void SetColor(
int r,
int g,
int b,
int a)
12481 {
12487 }
12489 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12490 {
12495 }
12496
12498 {
12500 }
12501
12504 {
12505 int r,g,b,a;
12507 r = r/255;
12508 g = g/255;
12509 b = b/255;
12510 a = a/255;
12511 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12512 }
12513
12514
12515
12516 override void SetLiquidType(
int value,
bool allow_client =
false)
12517 {
12518 if (!IsServerCheck(allow_client))
12519 return;
12520
12525 }
12526
12528 {
12529 return ConfigGetInt("varLiquidTypeInit");
12530 }
12531
12533 {
12535 }
12536
12538 {
12540 SetFrozen(false);
12541 }
12542
12545 {
12546 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12547 }
12548
12549
12552 {
12553 PlayerBase nplayer;
12554 if (PlayerBase.CastTo(nplayer, player))
12555 {
12557
12558 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12559 }
12560 }
12561
12562
12565 {
12566 PlayerBase nplayer;
12567 if (PlayerBase.CastTo(nplayer,player))
12568 {
12569
12570 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12571
12572 }
12573
12574
12575 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12576
12577
12578 if (HasEnergyManager())
12579 {
12580 GetCompEM().UpdatePlugState();
12581 }
12582 }
12583
12584
12586 {
12587 super.OnPlacementStarted(player);
12588
12590 }
12591
12592 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12593 {
12595 {
12596 m_AdminLog.OnPlacementComplete(player,
this);
12597 }
12598
12599 super.OnPlacementComplete(player, position, orientation);
12600 }
12601
12602
12603
12604
12605
12607 {
12609 {
12610 return true;
12611 }
12612 else
12613 {
12614 return false;
12615 }
12616 }
12617
12618
12620 {
12622 {
12624 }
12625 }
12626
12627
12629 {
12631 }
12632
12634 {
12636 }
12637
12638 override void InsertAgent(
int agent,
float count = 1)
12639 {
12640 if (count < 1)
12641 return;
12642
12644 }
12645
12648 {
12650 }
12651
12652
12654 {
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
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12700 {
12702 return false;
12703 return true;
12704 }
12705
12707 {
12708
12710 }
12711
12712
12715 {
12716 super.CheckForRoofLimited(timeTresholdMS);
12717
12719 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12720 {
12721 m_PreviousRoofTestTime = time;
12722 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12723 }
12724 }
12725
12726
12728 {
12730 {
12731 return 0;
12732 }
12733
12734 if (GetInventory().GetAttachmentSlotsCount() != 0)
12735 {
12736 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12737 if (filter)
12738 return filter.GetProtectionLevel(type, false, system);
12739 else
12740 return 0;
12741 }
12742
12743 string subclassPath, entryName;
12744
12745 switch (type)
12746 {
12748 entryName = "biological";
12749 break;
12751 entryName = "chemical";
12752 break;
12753 default:
12754 entryName = "biological";
12755 break;
12756 }
12757
12758 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12759
12761 }
12762
12763
12764
12767 {
12768 if (!IsMagazine())
12770
12772 }
12773
12774
12775
12776
12777
12782 {
12783 return true;
12784 }
12785
12787 {
12789 }
12790
12791
12792
12793
12794
12796 {
12797 if (parent)
12798 {
12799 if (parent.IsInherited(DayZInfected))
12800 return true;
12801
12802 if (!parent.IsRuined())
12803 return true;
12804 }
12805
12806 return true;
12807 }
12808
12810 {
12811 if (!super.CanPutAsAttachment(parent))
12812 {
12813 return false;
12814 }
12815
12816 if (!IsRuined() && !parent.IsRuined())
12817 {
12818 return true;
12819 }
12820
12821 return false;
12822 }
12823
12825 {
12826
12827
12828
12829
12830 return super.CanReceiveItemIntoCargo(item);
12831 }
12832
12834 {
12835
12836
12837
12838
12839 GameInventory attachmentInv = attachment.GetInventory();
12841 {
12842 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12843 return false;
12844 }
12845
12846 InventoryLocation loc = new InventoryLocation();
12847 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12848 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12849 return false;
12850
12851 return super.CanReceiveAttachment(attachment, slotId);
12852 }
12853
12855 {
12856 if (!super.CanReleaseAttachment(attachment))
12857 return false;
12858
12859 return GetInventory().AreChildrenAccessible();
12860 }
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12883 {
12884 int id = muzzle_owner.GetMuzzleID();
12885 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12886
12887 if (WPOF_array)
12888 {
12889 for (int i = 0; i < WPOF_array.Count(); i++)
12890 {
12891 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12892
12893 if (WPOF)
12894 {
12895 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12896 }
12897 }
12898 }
12899 }
12900
12901
12903 {
12904 int id = muzzle_owner.GetMuzzleID();
12906
12907 if (WPOBE_array)
12908 {
12909 for (int i = 0; i < WPOBE_array.Count(); i++)
12910 {
12911 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12912
12913 if (WPOBE)
12914 {
12915 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12916 }
12917 }
12918 }
12919 }
12920
12921
12923 {
12924 int id = muzzle_owner.GetMuzzleID();
12925 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12926
12927 if (WPOOH_array)
12928 {
12929 for (int i = 0; i < WPOOH_array.Count(); i++)
12930 {
12931 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12932
12933 if (WPOOH)
12934 {
12935 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12936 }
12937 }
12938 }
12939 }
12940
12941
12943 {
12944 int id = muzzle_owner.GetMuzzleID();
12945 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12946
12947 if (WPOOH_array)
12948 {
12949 for (int i = 0; i < WPOOH_array.Count(); i++)
12950 {
12951 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12952
12953 if (WPOOH)
12954 {
12955 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12956 }
12957 }
12958 }
12959 }
12960
12961
12963 {
12964 int id = muzzle_owner.GetMuzzleID();
12965 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12966
12967 if (WPOOH_array)
12968 {
12969 for (int i = 0; i < WPOOH_array.Count(); i++)
12970 {
12971 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12972
12973 if (WPOOH)
12974 {
12975 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12976 }
12977 }
12978 }
12979 }
12980
12981
12982
12984 {
12986 {
12987 return true;
12988 }
12989
12990 return false;
12991 }
12992
12994 {
12996 {
12997 return true;
12998 }
12999
13000 return false;
13001 }
13002
13004 {
13006 {
13007 return true;
13008 }
13009
13010 return false;
13011 }
13012
13014 {
13015 return false;
13016 }
13017
13020 {
13021 return UATimeSpent.DEFAULT_DEPLOY;
13022 }
13023
13024
13025
13026
13028 {
13030 SetSynchDirty();
13031 }
13032
13034 {
13036 }
13037
13038
13040 {
13041 return false;
13042 }
13043
13046 {
13047 string att_type = "None";
13048
13049 if (ConfigIsExisting("soundAttType"))
13050 {
13051 att_type = ConfigGetString("soundAttType");
13052 }
13053
13055 }
13056
13058 {
13060 }
13061
13062
13063
13064
13065
13071
13073 {
13076
13078 }
13079
13080
13082 {
13084 return;
13085
13087
13090
13093
13094 SoundParameters params = new SoundParameters();
13098 }
13099
13100
13102 {
13104 return;
13105
13107 SetSynchDirty();
13108
13111 }
13112
13113
13115 {
13117 return;
13118
13120 SetSynchDirty();
13121
13124 }
13125
13127 {
13129 }
13130
13132 {
13134 }
13135
13138 {
13139 if (!
GetGame().IsDedicatedServer())
13140 {
13141 if (ConfigIsExisting("attachSoundSet"))
13142 {
13143 string cfg_path = "";
13144 string soundset = "";
13145 string type_name =
GetType();
13146
13149 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13150 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13151
13152 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13153 {
13154 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13155 {
13156 if (cfg_slot_array[i] == slot_type)
13157 {
13158 soundset = cfg_soundset_array[i];
13159 break;
13160 }
13161 }
13162 }
13163
13164 if (soundset != "")
13165 {
13166 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13168 }
13169 }
13170 }
13171 }
13172
13174 {
13175
13176 }
13177
13178 void OnApply(PlayerBase player);
13179
13181 {
13182 return 1.0;
13183 };
13184
13186 {
13188 }
13189
13191 {
13193 }
13194
13196
13198 {
13199 SetDynamicPhysicsLifeTime(0.01);
13201 }
13202
13204 {
13205 array<string> zone_names = new array<string>;
13206 GetDamageZones(zone_names);
13207 for (int i = 0; i < zone_names.Count(); i++)
13208 {
13209 SetHealthMax(zone_names.Get(i),"Health");
13210 }
13211 SetHealthMax("","Health");
13212 }
13213
13216 {
13217 float global_health = GetHealth01("","Health");
13218 array<string> zones = new array<string>;
13219 GetDamageZones(zones);
13220
13221 for (int i = 0; i < zones.Count(); i++)
13222 {
13223 SetHealth01(zones.Get(i),"Health",global_health);
13224 }
13225 }
13226
13229 {
13230 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13231 }
13232
13234 {
13235 if (!hasRootAsPlayer)
13236 {
13237 if (refParentIB)
13238 {
13239
13240 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13241 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13242
13243 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13244 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13245
13248 }
13249 else
13250 {
13251
13254 }
13255 }
13256 }
13257
13259 {
13261 {
13262 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13263 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13264 {
13265 float heatPermCoef = 1.0;
13267 while (ent)
13268 {
13269 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13270 ent = ent.GetHierarchyParent();
13271 }
13272
13273 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13274 }
13275 }
13276 }
13277
13279 {
13280
13281 EntityAI parent = GetHierarchyParent();
13282 if (!parent)
13283 {
13284 hasParent = false;
13285 hasRootAsPlayer = false;
13286 }
13287 else
13288 {
13289 hasParent = true;
13290 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13291 refParentIB =
ItemBase.Cast(parent);
13292 }
13293 }
13294
13295 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13296 {
13297
13298 }
13299
13301 {
13302
13303 return false;
13304 }
13305
13307 {
13308
13309
13310 return false;
13311 }
13312
13314 {
13315
13316 return false;
13317 }
13318
13321 {
13322 return !GetIsFrozen() &&
IsOpen();
13323 }
13324
13326 {
13327 bool hasParent = false, hasRootAsPlayer = false;
13329
13330 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13331 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13332
13333 if (wwtu || foodDecay)
13334 {
13338
13339 if (processWetness || processTemperature || processDecay)
13340 {
13342
13343 if (processWetness)
13344 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13345
13346 if (processTemperature)
13348
13349 if (processDecay)
13350 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13351 }
13352 }
13353 }
13354
13357 {
13359 }
13360
13362 {
13365
13366 return super.GetTemperatureFreezeThreshold();
13367 }
13368
13370 {
13373
13374 return super.GetTemperatureThawThreshold();
13375 }
13376
13378 {
13381
13382 return super.GetItemOverheatThreshold();
13383 }
13384
13386 {
13388 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13389
13390 return super.GetTemperatureFreezeTime();
13391 }
13392
13394 {
13396 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13397
13398 return super.GetTemperatureThawTime();
13399 }
13400
13405
13407 {
13408 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13409 }
13410
13412 {
13413 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13414 }
13415
13418 {
13420 }
13421
13423 {
13425 }
13426
13428 {
13430 }
13431
13434 {
13435 return null;
13436 }
13437
13440 {
13441 return false;
13442 }
13443
13445 {
13447 {
13450 if (!trg)
13451 {
13453 explosive = this;
13454 }
13455
13456 explosive.PairRemote(trg);
13458
13459 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13460 trg.SetPersistentPairID(persistentID);
13461 explosive.SetPersistentPairID(persistentID);
13462
13463 return true;
13464 }
13465 return false;
13466 }
13467
13470 {
13471 float ret = 1.0;
13474 ret *= GetHealth01();
13475
13476 return ret;
13477 }
13478
13479 #ifdef DEVELOPER
13480 override void SetDebugItem()
13481 {
13482 super.SetDebugItem();
13483 _itemBase = this;
13484 }
13485
13487 {
13488 string text = super.GetDebugText();
13489
13491 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13492
13493 return text;
13494 }
13495 #endif
13496
13498 {
13499 return true;
13500 }
13501
13503
13505
13507 {
13510 }
13511
13512
13520
13536}
13537
13539{
13541 if (entity)
13542 {
13543 bool is_item = entity.IsInherited(
ItemBase);
13544 if (is_item && full_quantity)
13545 {
13548 }
13549 }
13550 else
13551 {
13553 return NULL;
13554 }
13555 return entity;
13556}
13557
13559{
13560 if (item)
13561 {
13562 if (health > 0)
13563 item.SetHealth("", "", health);
13564
13565 if (item.CanHaveTemperature())
13566 {
13568 if (item.CanFreeze())
13569 item.SetFrozen(false);
13570 }
13571
13572 if (item.HasEnergyManager())
13573 {
13574 if (quantity >= 0)
13575 {
13576 item.GetCompEM().SetEnergy0To1(quantity);
13577 }
13578 else
13579 {
13581 }
13582 }
13583 else if (item.IsMagazine())
13584 {
13585 Magazine mag = Magazine.Cast(item);
13586 if (quantity >= 0)
13587 {
13588 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13589 }
13590 else
13591 {
13593 }
13594
13595 }
13596 else
13597 {
13598 if (quantity >= 0)
13599 {
13600 item.SetQuantityNormalized(quantity, false);
13601 }
13602 else
13603 {
13605 }
13606
13607 }
13608 }
13609}
13610
13611#ifdef DEVELOPER
13613#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.